Commit 1cb0661e009267a5d060c4686f0857784a8da228

Authored by balrog
1 parent 3233f0d4

arm: Reserve code buffer in memory range reachable for pc-relative branch.

Unfortunately this range is so narrow that I'm not sure if it makes more
sense to always use memory load to pc kind of branch instead.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5844 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 6 additions and 0 deletions
... ... @@ -436,6 +436,12 @@ static void code_gen_alloc(unsigned long tb_size)
436 436 start = (void *) 0x60000000UL;
437 437 if (code_gen_buffer_size > (512 * 1024 * 1024))
438 438 code_gen_buffer_size = (512 * 1024 * 1024);
  439 +#elif defined(__arm__)
  440 + /* Map the buffer below 64M, so we can use direct calls and branches */
  441 + flags |= MAP_FIXED;
  442 + start = (void *) 0x01000000UL;
  443 + if (code_gen_buffer_size > 16 * 1024 * 1024)
  444 + code_gen_buffer_size = 16 * 1024 * 1024;
439 445 #endif
440 446 code_gen_buffer = mmap(start, code_gen_buffer_size,
441 447 PROT_WRITE | PROT_READ | PROT_EXEC,
... ...