Revived GUEST_BASE support for usermode emulation targets [v5]
[qemu] / cpu-all.h
index 8f078c4..d8603ae 100644 (file)
--- a/cpu-all.h
+++ b/cpu-all.h
@@ -625,8 +625,13 @@ static inline void stfq_be_p(void *ptr, float64 v)
 /* On some host systems the guest address space is reserved on the host.
  * This allows the guest address space to be offset to a convenient location.
  */
-//#define GUEST_BASE 0x20000000
+#if defined(CONFIG_USE_GUEST_BASE)
+#define GUEST_BASE_MAX 0x38000000
+extern unsigned long guest_base;
+#define GUEST_BASE guest_base
+#else
 #define GUEST_BASE 0
+#endif
 
 /* All direct uses of g2h and h2g need to go away for usermode softmmu.  */
 #define g2h(x) ((void *)((unsigned long)(x) + GUEST_BASE))