Softmmu common code gets a 64-bit target_ulong and a runtime MO_TL.
target_long and TARGET_FMT_* stay per-target. The per-target half of
target_long.h is unchanged.

Signed-off-by: Yonggang Luo <[email protected]>
---
 include/exec/target_long.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/include/exec/target_long.h b/include/exec/target_long.h
index 3cd8e26a23f..c7bc65a60c9 100644
--- a/include/exec/target_long.h
+++ b/include/exec/target_long.h
@@ -10,6 +10,7 @@
 #ifndef _TARGET_LONG_H_
 #define _TARGET_LONG_H_
 
+#if defined(COMPILING_PER_TARGET)
 /*
  * Usually this should only be included via cpu-defs.h however for
  * certain cases where we want to build only two versions of a binary
@@ -40,5 +41,15 @@ typedef uint64_t target_ulong;
 #else
 #error TARGET_LONG_SIZE undefined
 #endif
+#elif defined(CONFIG_SOFTMMU)
+/*
+ * softmmu common: widest target_ulong and runtime MO_TL only.
+ * target_long, TARGET_LONG_SIZE, and TARGET_FMT_* stay per-target
+ * (TARGET_LONG_BITS / TARGET_FMT_* are poisoned here).
+ */
+#include "qemu/target-info.h"
+typedef uint64_t target_ulong;
+#define MO_TL (target_long_bits() == 64 ? MO_64 : MO_32)
+#endif
 
 #endif /* _TARGET_LONG_H_ */
-- 
2.52.0.windows.1


Reply via email to