]> git.proxmox.com Git - mirror_qemu.git/blame - include/exec/memory_ldst_phys.h.inc
memory: Have memory_region_init_ram_nomigrate() handler return a boolean
[mirror_qemu.git] / include / exec / memory_ldst_phys.h.inc
CommitLineData
4269c82b
PB
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
61f3c91a 11 * version 2.1 of the License, or (at your option) any later version.
4269c82b
PB
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
22#ifdef TARGET_ENDIANNESS
c6fe45b3 23static inline uint16_t glue(lduw_phys, SUFFIX)(ARG1_DECL, hwaddr addr)
e1d2dbee
PMD
24{
25 return glue(address_space_lduw, SUFFIX)(ARG1, addr,
26 MEMTXATTRS_UNSPECIFIED, NULL);
27}
28
4269c82b
PB
29static inline uint32_t glue(ldl_phys, SUFFIX)(ARG1_DECL, hwaddr addr)
30{
31 return glue(address_space_ldl, SUFFIX)(ARG1, addr,
32 MEMTXATTRS_UNSPECIFIED, NULL);
33}
34
35static inline uint64_t glue(ldq_phys, SUFFIX)(ARG1_DECL, hwaddr addr)
36{
37 return glue(address_space_ldq, SUFFIX)(ARG1, addr,
38 MEMTXATTRS_UNSPECIFIED, NULL);
39}
40
c6fe45b3 41static inline void glue(stw_phys, SUFFIX)(ARG1_DECL, hwaddr addr, uint16_t val)
4269c82b 42{
e1d2dbee
PMD
43 glue(address_space_stw, SUFFIX)(ARG1, addr, val,
44 MEMTXATTRS_UNSPECIFIED, NULL);
4269c82b
PB
45}
46
47static inline void glue(stl_phys, SUFFIX)(ARG1_DECL, hwaddr addr, uint32_t val)
48{
49 glue(address_space_stl, SUFFIX)(ARG1, addr, val,
50 MEMTXATTRS_UNSPECIFIED, NULL);
51}
52
4269c82b
PB
53static inline void glue(stq_phys, SUFFIX)(ARG1_DECL, hwaddr addr, uint64_t val)
54{
55 glue(address_space_stq, SUFFIX)(ARG1, addr, val,
56 MEMTXATTRS_UNSPECIFIED, NULL);
57}
58#else
c6fe45b3 59static inline uint8_t glue(ldub_phys, SUFFIX)(ARG1_DECL, hwaddr addr)
e1d2dbee
PMD
60{
61 return glue(address_space_ldub, SUFFIX)(ARG1, addr,
62 MEMTXATTRS_UNSPECIFIED, NULL);
63}
64
c6fe45b3 65static inline uint16_t glue(lduw_le_phys, SUFFIX)(ARG1_DECL, hwaddr addr)
e1d2dbee
PMD
66{
67 return glue(address_space_lduw_le, SUFFIX)(ARG1, addr,
68 MEMTXATTRS_UNSPECIFIED, NULL);
69}
70
c6fe45b3 71static inline uint16_t glue(lduw_be_phys, SUFFIX)(ARG1_DECL, hwaddr addr)
e1d2dbee
PMD
72{
73 return glue(address_space_lduw_be, SUFFIX)(ARG1, addr,
74 MEMTXATTRS_UNSPECIFIED, NULL);
75}
76
4269c82b
PB
77static inline uint32_t glue(ldl_le_phys, SUFFIX)(ARG1_DECL, hwaddr addr)
78{
79 return glue(address_space_ldl_le, SUFFIX)(ARG1, addr,
80 MEMTXATTRS_UNSPECIFIED, NULL);
81}
82
83static inline uint32_t glue(ldl_be_phys, SUFFIX)(ARG1_DECL, hwaddr addr)
84{
85 return glue(address_space_ldl_be, SUFFIX)(ARG1, addr,
86 MEMTXATTRS_UNSPECIFIED, NULL);
87}
88
89static inline uint64_t glue(ldq_le_phys, SUFFIX)(ARG1_DECL, hwaddr addr)
90{
91 return glue(address_space_ldq_le, SUFFIX)(ARG1, addr,
92 MEMTXATTRS_UNSPECIFIED, NULL);
93}
94
95static inline uint64_t glue(ldq_be_phys, SUFFIX)(ARG1_DECL, hwaddr addr)
96{
97 return glue(address_space_ldq_be, SUFFIX)(ARG1, addr,
98 MEMTXATTRS_UNSPECIFIED, NULL);
99}
100
c6fe45b3 101static inline void glue(stb_phys, SUFFIX)(ARG1_DECL, hwaddr addr, uint8_t val)
4269c82b 102{
e1d2dbee
PMD
103 glue(address_space_stb, SUFFIX)(ARG1, addr, val,
104 MEMTXATTRS_UNSPECIFIED, NULL);
4269c82b
PB
105}
106
c6fe45b3 107static inline void glue(stw_le_phys, SUFFIX)(ARG1_DECL, hwaddr addr, uint16_t val)
4269c82b 108{
e1d2dbee
PMD
109 glue(address_space_stw_le, SUFFIX)(ARG1, addr, val,
110 MEMTXATTRS_UNSPECIFIED, NULL);
4269c82b
PB
111}
112
c6fe45b3 113static inline void glue(stw_be_phys, SUFFIX)(ARG1_DECL, hwaddr addr, uint16_t val)
4269c82b 114{
e1d2dbee
PMD
115 glue(address_space_stw_be, SUFFIX)(ARG1, addr, val,
116 MEMTXATTRS_UNSPECIFIED, NULL);
4269c82b
PB
117}
118
119static inline void glue(stl_le_phys, SUFFIX)(ARG1_DECL, hwaddr addr, uint32_t val)
120{
121 glue(address_space_stl_le, SUFFIX)(ARG1, addr, val,
122 MEMTXATTRS_UNSPECIFIED, NULL);
123}
124
125static inline void glue(stl_be_phys, SUFFIX)(ARG1_DECL, hwaddr addr, uint32_t val)
126{
127 glue(address_space_stl_be, SUFFIX)(ARG1, addr, val,
128 MEMTXATTRS_UNSPECIFIED, NULL);
129}
130
4269c82b
PB
131static inline void glue(stq_le_phys, SUFFIX)(ARG1_DECL, hwaddr addr, uint64_t val)
132{
133 glue(address_space_stq_le, SUFFIX)(ARG1, addr, val,
134 MEMTXATTRS_UNSPECIFIED, NULL);
135}
136
137static inline void glue(stq_be_phys, SUFFIX)(ARG1_DECL, hwaddr addr, uint64_t val)
138{
139 glue(address_space_stq_be, SUFFIX)(ARG1, addr, val,
140 MEMTXATTRS_UNSPECIFIED, NULL);
141}
142#endif
143
144#undef ARG1_DECL
145#undef ARG1
146#undef SUFFIX
147#undef TARGET_ENDIANNESS