Commit 9bbc5cc8295670fd3f80fbdbc7fdddcecb403880
1 parent
8f860bb8
Fiddly dyngen bits for s390 host support, by Ulrich Hecht.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3105 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
2 changed files
with
19 additions
and
1 deletions
dyngen-exec.h
| ... | ... | @@ -254,7 +254,7 @@ extern int __op_jmp0, __op_jmp1, __op_jmp2, __op_jmp3; |
| 254 | 254 | #define GOTO_LABEL_PARAM(n) asm volatile ("b " ASM_NAME(__op_gen_label) #n) |
| 255 | 255 | #elif defined(__s390__) |
| 256 | 256 | #define EXIT_TB() asm volatile ("br %r14") |
| 257 | -#define GOTO_LABEL_PARAM(n) asm volatile ("b " ASM_NAME(__op_gen_label) #n) | |
| 257 | +#define GOTO_LABEL_PARAM(n) asm volatile ("bras %r7,8; .long " ASM_NAME(__op_gen_label) #n "; l %r7, 0(%r7); br %r7") | |
| 258 | 258 | #elif defined(__alpha__) |
| 259 | 259 | #define EXIT_TB() asm volatile ("ret") |
| 260 | 260 | #elif defined(__ia64__) | ... | ... |
exec-all.h
| ... | ... | @@ -340,6 +340,24 @@ do {\ |
| 340 | 340 | "1:\n");\ |
| 341 | 341 | } while (0) |
| 342 | 342 | |
| 343 | +#elif defined(__s390__) | |
| 344 | +/* GCC spills R13, so we have to restore it before branching away */ | |
| 345 | + | |
| 346 | +#define GOTO_TB(opname, tbparam, n)\ | |
| 347 | +do {\ | |
| 348 | + static void __attribute__((used)) *dummy ## n = &&dummy_label ## n;\ | |
| 349 | + static void __attribute__((used)) *__op_label ## n \ | |
| 350 | + __asm__(ASM_OP_LABEL_NAME(n, opname)) = &&label ## n;\ | |
| 351 | + __asm__ __volatile__ ( \ | |
| 352 | + "l %%r13,52(%%r15)\n" \ | |
| 353 | + "br %0\n" \ | |
| 354 | + : : "r" (((TranslationBlock*)tbparam)->tb_next[n]));\ | |
| 355 | + \ | |
| 356 | + for(;*((int*)0);); /* just to keep GCC busy */ \ | |
| 357 | +label ## n: ;\ | |
| 358 | +dummy_label ## n: ;\ | |
| 359 | +} while(0) | |
| 360 | + | |
| 343 | 361 | #else |
| 344 | 362 | |
| 345 | 363 | /* jump to next block operations (more portable code, does not need | ... | ... |