diff options
author | Richard Henderson <rth@twiddle.net> | 2014-04-24 08:25:03 -0700 |
---|---|---|
committer | Richard Henderson <rth@twiddle.net> | 2014-05-24 08:44:44 -0700 |
commit | 479eb12108b66265a8149b0fa90e16900bc217af (patch) | |
tree | 4ce3847491bae1deaa193ad233d0ee06c71c6415 /translate-all.c | |
parent | 178ac111bca16c08a79b2609ebdc75197bea976a (diff) |
tcg-mips: Layout executable and code_gen_buffer
Choosing good addresses for them means we can use JAL for helper calls.
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'translate-all.c')
-rw-r--r-- | translate-all.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/translate-all.c b/translate-all.c index 5549a85ed5..c631694a6e 100644 --- a/translate-all.c +++ b/translate-all.c @@ -475,6 +475,10 @@ static inline PageDesc *page_find(tb_page_addr_t index) #elif defined(__s390x__) /* We have a +- 4GB range on the branches; leave some slop. */ # define MAX_CODE_GEN_BUFFER_SIZE (3ul * 1024 * 1024 * 1024) +#elif defined(__mips__) + /* We have a 256MB branch region, but leave room to make sure the + main executable is also within that region. */ +# define MAX_CODE_GEN_BUFFER_SIZE (128ul * 1024 * 1024) #else # define MAX_CODE_GEN_BUFFER_SIZE ((size_t)-1) #endif @@ -545,6 +549,15 @@ static inline void *alloc_code_gen_buffer(void) start = 0x40000000ul; # elif defined(__s390x__) start = 0x90000000ul; +# elif defined(__mips__) + /* ??? We ought to more explicitly manage layout for softmmu too. */ +# ifdef CONFIG_USER_ONLY + start = 0x68000000ul; +# elif _MIPS_SIM == _ABI64 + start = 0x128000000ul; +# else + start = 0x08000000ul; +# endif # endif buf = mmap((void *)start, tcg_ctx.code_gen_buffer_size, |