Statistics
| Branch: | Revision:

root / targphys.h @ dc1c13d9

History | View | Annotate | Download (1.1 kB)

1 c227f099 Anthony Liguori
/* Define target_phys_addr_t if it exists.  */
2 1ad2134f Paul Brook
3 1ad2134f Paul Brook
#ifndef TARGPHYS_H
4 1ad2134f Paul Brook
#define TARGPHYS_H
5 1ad2134f Paul Brook
6 1ad2134f Paul Brook
#ifdef TARGET_PHYS_ADDR_BITS
7 c227f099 Anthony Liguori
/* target_phys_addr_t is the type of a physical address (its size can
8 355b1943 Paul Brook
   be different from 'target_ulong').  */
9 1ad2134f Paul Brook
10 1ad2134f Paul Brook
#if TARGET_PHYS_ADDR_BITS == 32
11 c227f099 Anthony Liguori
typedef uint32_t target_phys_addr_t;
12 9fa06385 Jan Kiszka
#define TARGET_PHYS_ADDR_MAX UINT32_MAX
13 1ad2134f Paul Brook
#define TARGET_FMT_plx "%08x"
14 1e9be4b4 Peter Maydell
/* Format strings for printing target_phys_addr_t types.
15 1e9be4b4 Peter Maydell
 * These are recommended over the less flexible TARGET_FMT_plx,
16 1e9be4b4 Peter Maydell
 * which is retained for the benefit of existing code.
17 1e9be4b4 Peter Maydell
 */
18 1e9be4b4 Peter Maydell
#define TARGET_PRIdPHYS PRId32
19 1e9be4b4 Peter Maydell
#define TARGET_PRIiPHYS PRIi32
20 1e9be4b4 Peter Maydell
#define TARGET_PRIoPHYS PRIo32
21 1e9be4b4 Peter Maydell
#define TARGET_PRIuPHYS PRIu32
22 1e9be4b4 Peter Maydell
#define TARGET_PRIxPHYS PRIx32
23 1e9be4b4 Peter Maydell
#define TARGET_PRIXPHYS PRIX32
24 1ad2134f Paul Brook
#elif TARGET_PHYS_ADDR_BITS == 64
25 c227f099 Anthony Liguori
typedef uint64_t target_phys_addr_t;
26 9fa06385 Jan Kiszka
#define TARGET_PHYS_ADDR_MAX UINT64_MAX
27 1ad2134f Paul Brook
#define TARGET_FMT_plx "%016" PRIx64
28 1e9be4b4 Peter Maydell
#define TARGET_PRIdPHYS PRId64
29 1e9be4b4 Peter Maydell
#define TARGET_PRIiPHYS PRIi64
30 1e9be4b4 Peter Maydell
#define TARGET_PRIoPHYS PRIo64
31 1e9be4b4 Peter Maydell
#define TARGET_PRIuPHYS PRIu64
32 1e9be4b4 Peter Maydell
#define TARGET_PRIxPHYS PRIx64
33 1e9be4b4 Peter Maydell
#define TARGET_PRIXPHYS PRIX64
34 1ad2134f Paul Brook
#endif
35 1ad2134f Paul Brook
#endif
36 1ad2134f Paul Brook
37 1ad2134f Paul Brook
#endif