2
0

targphys.h 1.1 KB

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