2
0

qemu-types.h 742 B

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef QEMU_TYPES_H
  2. #define QEMU_TYPES_H
  3. #include "cpu.h"
  4. #ifdef TARGET_ABI32
  5. typedef uint32_t abi_ulong;
  6. typedef int32_t abi_long;
  7. #define TARGET_ABI_FMT_lx "%08x"
  8. #define TARGET_ABI_FMT_ld "%d"
  9. #define TARGET_ABI_FMT_lu "%u"
  10. #define TARGET_ABI_BITS 32
  11. static inline abi_ulong tswapal(abi_ulong v)
  12. {
  13. return tswap32(v);
  14. }
  15. #else
  16. typedef target_ulong abi_ulong;
  17. typedef target_long abi_long;
  18. #define TARGET_ABI_FMT_lx TARGET_FMT_lx
  19. #define TARGET_ABI_FMT_ld TARGET_FMT_ld
  20. #define TARGET_ABI_FMT_lu TARGET_FMT_lu
  21. #define TARGET_ABI_BITS TARGET_LONG_BITS
  22. /* for consistency, define ABI32 too */
  23. #if TARGET_ABI_BITS == 32
  24. #define TARGET_ABI32 1
  25. #endif
  26. static inline abi_ulong tswapal(abi_ulong v)
  27. {
  28. return tswapl(v);
  29. }
  30. #endif
  31. #endif