diff options
author | Richard Henderson <rth@twiddle.net> | 2010-06-04 12:14:14 -0700 |
---|---|---|
committer | Aurelien Jarno <aurelien@aurel32.net> | 2010-06-11 09:30:48 +0200 |
commit | eba0b89379b3af98b51a8c1559868de89f5f713e (patch) | |
tree | c321303a7e26b6b6929ef7523cddc0acff30a6fe /exec.c | |
parent | 1bcaae666fdcda03f768c2894091ec2e441abb57 (diff) |
tcg-s390: Allocate the code_gen_buffer near the main program.
This allows the use of direct calls to the helpers,
and a direct branch back to the epilogue.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'exec.c')
-rw-r--r-- | exec.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -519,6 +519,13 @@ static void code_gen_alloc(unsigned long tb_size) start = (void *) 0x01000000UL; if (code_gen_buffer_size > 16 * 1024 * 1024) code_gen_buffer_size = 16 * 1024 * 1024; +#elif defined(__s390x__) + /* Map the buffer so that we can use direct calls and branches. */ + /* We have a +- 4GB range on the branches; leave some slop. */ + if (code_gen_buffer_size > (3ul * 1024 * 1024 * 1024)) { + code_gen_buffer_size = 3ul * 1024 * 1024 * 1024; + } + start = (void *)0x90000000UL; #endif code_gen_buffer = mmap(start, code_gen_buffer_size, PROT_WRITE | PROT_READ | PROT_EXEC, |