memory_ldst_phys.h.inc 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. /*
  2. * Physical memory access templates
  3. *
  4. * Copyright (c) 2003 Fabrice Bellard
  5. * Copyright (c) 2015 Linaro, Inc.
  6. * Copyright (c) 2016 Red Hat, Inc.
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Lesser General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2.1 of the License, or (at your option) any later version.
  12. *
  13. * This library is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  20. */
  21. #ifdef TARGET_ENDIANNESS
  22. static inline uint16_t glue(lduw_phys, SUFFIX)(ARG1_DECL, hwaddr addr)
  23. {
  24. return glue(address_space_lduw, SUFFIX)(ARG1, addr,
  25. MEMTXATTRS_UNSPECIFIED, NULL);
  26. }
  27. static inline uint32_t glue(ldl_phys, SUFFIX)(ARG1_DECL, hwaddr addr)
  28. {
  29. return glue(address_space_ldl, SUFFIX)(ARG1, addr,
  30. MEMTXATTRS_UNSPECIFIED, NULL);
  31. }
  32. static inline uint64_t glue(ldq_phys, SUFFIX)(ARG1_DECL, hwaddr addr)
  33. {
  34. return glue(address_space_ldq, SUFFIX)(ARG1, addr,
  35. MEMTXATTRS_UNSPECIFIED, NULL);
  36. }
  37. static inline void glue(stw_phys, SUFFIX)(ARG1_DECL, hwaddr addr, uint16_t val)
  38. {
  39. glue(address_space_stw, SUFFIX)(ARG1, addr, val,
  40. MEMTXATTRS_UNSPECIFIED, NULL);
  41. }
  42. static inline void glue(stl_phys, SUFFIX)(ARG1_DECL, hwaddr addr, uint32_t val)
  43. {
  44. glue(address_space_stl, SUFFIX)(ARG1, addr, val,
  45. MEMTXATTRS_UNSPECIFIED, NULL);
  46. }
  47. static inline void glue(stq_phys, SUFFIX)(ARG1_DECL, hwaddr addr, uint64_t val)
  48. {
  49. glue(address_space_stq, SUFFIX)(ARG1, addr, val,
  50. MEMTXATTRS_UNSPECIFIED, NULL);
  51. }
  52. #else
  53. static inline uint8_t glue(ldub_phys, SUFFIX)(ARG1_DECL, hwaddr addr)
  54. {
  55. return glue(address_space_ldub, SUFFIX)(ARG1, addr,
  56. MEMTXATTRS_UNSPECIFIED, NULL);
  57. }
  58. static inline uint16_t glue(lduw_le_phys, SUFFIX)(ARG1_DECL, hwaddr addr)
  59. {
  60. return glue(address_space_lduw_le, SUFFIX)(ARG1, addr,
  61. MEMTXATTRS_UNSPECIFIED, NULL);
  62. }
  63. static inline uint16_t glue(lduw_be_phys, SUFFIX)(ARG1_DECL, hwaddr addr)
  64. {
  65. return glue(address_space_lduw_be, SUFFIX)(ARG1, addr,
  66. MEMTXATTRS_UNSPECIFIED, NULL);
  67. }
  68. static inline uint32_t glue(ldl_le_phys, SUFFIX)(ARG1_DECL, hwaddr addr)
  69. {
  70. return glue(address_space_ldl_le, SUFFIX)(ARG1, addr,
  71. MEMTXATTRS_UNSPECIFIED, NULL);
  72. }
  73. static inline uint32_t glue(ldl_be_phys, SUFFIX)(ARG1_DECL, hwaddr addr)
  74. {
  75. return glue(address_space_ldl_be, SUFFIX)(ARG1, addr,
  76. MEMTXATTRS_UNSPECIFIED, NULL);
  77. }
  78. static inline uint64_t glue(ldq_le_phys, SUFFIX)(ARG1_DECL, hwaddr addr)
  79. {
  80. return glue(address_space_ldq_le, SUFFIX)(ARG1, addr,
  81. MEMTXATTRS_UNSPECIFIED, NULL);
  82. }
  83. static inline uint64_t glue(ldq_be_phys, SUFFIX)(ARG1_DECL, hwaddr addr)
  84. {
  85. return glue(address_space_ldq_be, SUFFIX)(ARG1, addr,
  86. MEMTXATTRS_UNSPECIFIED, NULL);
  87. }
  88. static inline void glue(stb_phys, SUFFIX)(ARG1_DECL, hwaddr addr, uint8_t val)
  89. {
  90. glue(address_space_stb, SUFFIX)(ARG1, addr, val,
  91. MEMTXATTRS_UNSPECIFIED, NULL);
  92. }
  93. static inline void glue(stw_le_phys, SUFFIX)(ARG1_DECL, hwaddr addr, uint16_t val)
  94. {
  95. glue(address_space_stw_le, SUFFIX)(ARG1, addr, val,
  96. MEMTXATTRS_UNSPECIFIED, NULL);
  97. }
  98. static inline void glue(stw_be_phys, SUFFIX)(ARG1_DECL, hwaddr addr, uint16_t val)
  99. {
  100. glue(address_space_stw_be, SUFFIX)(ARG1, addr, val,
  101. MEMTXATTRS_UNSPECIFIED, NULL);
  102. }
  103. static inline void glue(stl_le_phys, SUFFIX)(ARG1_DECL, hwaddr addr, uint32_t val)
  104. {
  105. glue(address_space_stl_le, SUFFIX)(ARG1, addr, val,
  106. MEMTXATTRS_UNSPECIFIED, NULL);
  107. }
  108. static inline void glue(stl_be_phys, SUFFIX)(ARG1_DECL, hwaddr addr, uint32_t val)
  109. {
  110. glue(address_space_stl_be, SUFFIX)(ARG1, addr, val,
  111. MEMTXATTRS_UNSPECIFIED, NULL);
  112. }
  113. static inline void glue(stq_le_phys, SUFFIX)(ARG1_DECL, hwaddr addr, uint64_t val)
  114. {
  115. glue(address_space_stq_le, SUFFIX)(ARG1, addr, val,
  116. MEMTXATTRS_UNSPECIFIED, NULL);
  117. }
  118. static inline void glue(stq_be_phys, SUFFIX)(ARG1_DECL, hwaddr addr, uint64_t val)
  119. {
  120. glue(address_space_stq_be, SUFFIX)(ARG1, addr, val,
  121. MEMTXATTRS_UNSPECIFIED, NULL);
  122. }
  123. #endif
  124. #undef ARG1_DECL
  125. #undef ARG1
  126. #undef SUFFIX
  127. #undef TARGET_ENDIANNESS