| 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 | |
| 22 | static inline uint8_t glue(ldub_phys, SUFFIX)(ARG1_DECL, hwaddr addr) |
| 23 | { |
| 24 | return glue(address_space_ldub, SUFFIX)(ARG1, addr, |
| 25 | MEMTXATTRS_UNSPECIFIED, NULL); |
| 26 | } |
| 27 | |
| 28 | static inline void glue(stb_phys, SUFFIX)(ARG1_DECL, hwaddr addr, uint8_t val) |
| 29 | { |
| 30 | glue(address_space_stb, SUFFIX)(ARG1, addr, val, |
| 31 | MEMTXATTRS_UNSPECIFIED, NULL); |
| 32 | } |
| 33 | |
| 34 | #ifndef TARGET_NOT_USING_LEGACY_NATIVE_ENDIAN_API |
| 35 | #define ENDIANNESS |
| 36 | #include "system/memory_ldst_phys_endian.h.inc" |
| 37 | #endif /* TARGET_NOT_USING_LEGACY_NATIVE_ENDIAN_API */ |
| 38 | |
| 39 | #define ENDIANNESS _le |
| 40 | #include "system/memory_ldst_phys_endian.h.inc" |
| 41 | |
| 42 | #define ENDIANNESS _be |
| 43 | #include "system/memory_ldst_phys_endian.h.inc" |
| 44 | |
| 45 | #undef ARG1_DECL |
| 46 | #undef ARG1 |
| 47 | #undef SUFFIX |