Revision 3b46e624 cpu-exec.c
b/cpu-exec.c | ||
---|---|---|
84 | 84 |
unsigned int h; |
85 | 85 |
target_ulong phys_pc, phys_page1, phys_page2, virt_page2; |
86 | 86 |
uint8_t *tc_ptr; |
87 |
|
|
87 |
|
|
88 | 88 |
spin_lock(&tb_lock); |
89 | 89 |
|
90 | 90 |
tb_invalidated_flag = 0; |
91 |
|
|
91 |
|
|
92 | 92 |
regs_to_env(); /* XXX: do it just before cpu_gen_code() */ |
93 |
|
|
93 |
|
|
94 | 94 |
/* find translated block using physical mappings */ |
95 | 95 |
phys_pc = get_phys_addr_code(env, pc); |
96 | 96 |
phys_page1 = phys_pc & TARGET_PAGE_MASK; |
... | ... | |
135 | 135 |
tb->flags = flags; |
136 | 136 |
cpu_gen_code(env, tb, CODE_GEN_MAX_SIZE, &code_gen_size); |
137 | 137 |
code_gen_ptr = (void *)(((unsigned long)code_gen_ptr + code_gen_size + CODE_GEN_ALIGN - 1) & ~(CODE_GEN_ALIGN - 1)); |
138 |
|
|
138 |
|
|
139 | 139 |
/* check next page if needed */ |
140 | 140 |
virt_page2 = (pc + tb->size - 1) & TARGET_PAGE_MASK; |
141 | 141 |
phys_page2 = -1; |
... | ... | |
143 | 143 |
phys_page2 = get_phys_addr_code(env, virt_page2); |
144 | 144 |
} |
145 | 145 |
tb_link_phys(tb, phys_pc, phys_page2); |
146 |
|
|
146 |
|
|
147 | 147 |
found: |
148 | 148 |
/* we add the TB in the virtual pc hash table */ |
149 | 149 |
env->tb_jmp_cache[tb_jmp_cache_hash_func(pc)] = tb; |
... | ... | |
371 | 371 |
#if defined(__sparc__) && !defined(HOST_SOLARIS) |
372 | 372 |
/* g1 can be modified by some libc? functions */ |
373 | 373 |
tmp_T0 = T0; |
374 |
#endif
|
|
374 |
#endif |
|
375 | 375 |
interrupt_request = env->interrupt_request; |
376 | 376 |
if (__builtin_expect(interrupt_request, 0)) { |
377 | 377 |
if (interrupt_request & CPU_INTERRUPT_DEBUG) { |
... | ... | |
565 | 565 |
#endif |
566 | 566 |
#if defined(__sparc__) && !defined(HOST_SOLARIS) |
567 | 567 |
T0 = tmp_T0; |
568 |
#endif
|
|
568 |
#endif |
|
569 | 569 |
/* see if we can patch the calling TB. When the TB |
570 | 570 |
spans two pages, we cannot safely do a direct |
571 | 571 |
jump. */ |
... | ... | |
796 | 796 |
|
797 | 797 |
saved_env = env; |
798 | 798 |
env = s; |
799 |
|
|
799 |
|
|
800 | 800 |
helper_fsave((target_ulong)ptr, data32); |
801 | 801 |
|
802 | 802 |
env = saved_env; |
... | ... | |
808 | 808 |
|
809 | 809 |
saved_env = env; |
810 | 810 |
env = s; |
811 |
|
|
811 |
|
|
812 | 812 |
helper_frstor((target_ulong)ptr, data32); |
813 | 813 |
|
814 | 814 |
env = saved_env; |
... | ... | |
953 | 953 |
{ |
954 | 954 |
TranslationBlock *tb; |
955 | 955 |
int ret; |
956 |
|
|
956 |
|
|
957 | 957 |
if (cpu_single_env) |
958 | 958 |
env = cpu_single_env; /* XXX: find a correct solution for multithread */ |
959 | 959 |
#if defined(DEBUG_SIGNAL) |
... | ... | |
1042 | 1042 |
{ |
1043 | 1043 |
TranslationBlock *tb; |
1044 | 1044 |
int ret; |
1045 |
|
|
1045 |
|
|
1046 | 1046 |
if (cpu_single_env) |
1047 | 1047 |
env = cpu_single_env; /* XXX: find a correct solution for multithread */ |
1048 | 1048 |
#if defined(DEBUG_SIGNAL) |
... | ... | |
1092 | 1092 |
{ |
1093 | 1093 |
TranslationBlock *tb; |
1094 | 1094 |
int ret; |
1095 |
|
|
1095 |
|
|
1096 | 1096 |
if (cpu_single_env) |
1097 | 1097 |
env = cpu_single_env; /* XXX: find a correct solution for multithread */ |
1098 | 1098 |
#if defined(DEBUG_SIGNAL) |
... | ... | |
1137 | 1137 |
{ |
1138 | 1138 |
TranslationBlock *tb; |
1139 | 1139 |
int ret; |
1140 |
|
|
1140 |
|
|
1141 | 1141 |
if (cpu_single_env) |
1142 | 1142 |
env = cpu_single_env; /* XXX: find a correct solution for multithread */ |
1143 | 1143 |
#if defined(DEBUG_SIGNAL) |
... | ... | |
1371 | 1371 |
unsigned long pc; |
1372 | 1372 |
int is_write; |
1373 | 1373 |
uint32_t insn; |
1374 |
|
|
1374 |
|
|
1375 | 1375 |
/* XXX: is there a standard glibc define ? */ |
1376 | 1376 |
pc = regs[1]; |
1377 | 1377 |
/* XXX: need kernel patch to get write flag faster */ |
... | ... | |
1403 | 1403 |
struct ucontext *uc = puc; |
1404 | 1404 |
unsigned long pc; |
1405 | 1405 |
int is_write; |
1406 |
|
|
1406 |
|
|
1407 | 1407 |
pc = uc->uc_mcontext.gregs[R15]; |
1408 | 1408 |
/* XXX: compute is_write */ |
1409 | 1409 |
is_write = 0; |
... | ... | |
1421 | 1421 |
struct ucontext *uc = puc; |
1422 | 1422 |
unsigned long pc; |
1423 | 1423 |
int is_write; |
1424 |
|
|
1424 |
|
|
1425 | 1425 |
pc = uc->uc_mcontext.gregs[16]; |
1426 | 1426 |
/* XXX: compute is_write */ |
1427 | 1427 |
is_write = 0; |
... | ... | |
1473 | 1473 |
struct ucontext *uc = puc; |
1474 | 1474 |
unsigned long pc; |
1475 | 1475 |
int is_write; |
1476 |
|
|
1476 |
|
|
1477 | 1477 |
pc = uc->uc_mcontext.psw.addr; |
1478 | 1478 |
/* XXX: compute is_write */ |
1479 | 1479 |
is_write = 0; |
... | ... | |
1490 | 1490 |
struct ucontext *uc = puc; |
1491 | 1491 |
greg_t pc = uc->uc_mcontext.pc; |
1492 | 1492 |
int is_write; |
1493 |
|
|
1493 |
|
|
1494 | 1494 |
/* XXX: compute is_write */ |
1495 | 1495 |
is_write = 0; |
1496 | 1496 |
return handle_cpu_signal(pc, (unsigned long)info->si_addr, |
Also available in: Unified diff