|
From: | Richard Henderson |
Subject: | Re: [Qemu-devel] [PATCH 09/10] mipsn32-linux-user: Restrict address space to 31-bits. |
Date: | Mon, 11 Feb 2013 09:56:57 -0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 |
On 2013-02-11 09:44, Peter Maydell wrote:
>-# ifdef TARGET_MIPS >+# if HOST_LONG_BITS == 64 \ >+ && (defined(TARGET_ABI_MIPSO32) || defined(TARGET_ABI_MIPSN32)) > /* MIPS only supports 31 bits of virtual address space for user space */ >-unsigned long reserved_va = 0x77000000; >-# else >+unsigned long reserved_va = 0x7f000000; >+# elif (TARGET_LONG_BITS == 32) && (HOST_LONG_BITS == 64) > unsigned long reserved_va = 0xf7000000; >-# endif > #else > unsigned long reserved_va; > #endif >-#endif >+#endif /* CONFIG_USE_GUEST_BASE */Maybe clearer to pull out the "#if HOST_LONG_BITS == 64" into its own #if rather than having it as an && term in both the #if and the #elif?
In which case you get two "base" (unsigned long reserved_va;) cases, which didn't look clearer at all. The only other thing I can think to do is
#if HLB == 64 # if MIPS # define RESERVED_MAX 0x7f000000 # elif TLB == 32 # define RESERVED_MAX 0xf7000000 # endif #endif #ifndef RESERVED_MAX # define RESERVED_MAX 0 #endif unsigned long reserved_va = RESERVED_MAX; r~
[Prev in Thread] | Current Thread | [Next in Thread] |