144 |
|
{ "sheep", |
145 |
|
(execute_fn)&sheepshaver_cpu::execute_sheep, |
146 |
|
NULL, |
147 |
< |
D_form, 6, 0, CFLOW_TRAP |
147 |
> |
D_form, 6, 0, CFLOW_JUMP | CFLOW_TRAP |
148 |
|
} |
149 |
|
}; |
150 |
|
|
492 |
|
static sheepshaver_cpu *interrupt_cpu = NULL; // CPU emulator to handle interrupts |
493 |
|
static sheepshaver_cpu *current_cpu = NULL; // Current CPU emulator context |
494 |
|
|
495 |
+ |
void FlushCodeCache(uintptr start, uintptr end) |
496 |
+ |
{ |
497 |
+ |
D(bug("FlushCodeCache(%08x, %08x)\n", start, end)); |
498 |
+ |
main_cpu->invalidate_cache_range(start, end); |
499 |
+ |
#if MULTICORE_CPU |
500 |
+ |
interrupt_cpu->invalidate_cache_range(start, end); |
501 |
+ |
#endif |
502 |
+ |
} |
503 |
+ |
|
504 |
|
static inline void cpu_push(sheepshaver_cpu *new_cpu) |
505 |
|
{ |
506 |
|
#if MULTICORE_CPU |
732 |
|
POWERPC_NATIVE_OP_INIT(1, NATIVE_R_GET_RESOURCE), |
733 |
|
POWERPC_NATIVE_OP_INIT(0, NATIVE_DISABLE_INTERRUPT), |
734 |
|
POWERPC_NATIVE_OP_INIT(0, NATIVE_ENABLE_INTERRUPT), |
735 |
+ |
POWERPC_NATIVE_OP_INIT(1, NATIVE_MAKE_EXECUTABLE), |
736 |
|
}; |
737 |
|
|
738 |
|
static void get_resource(void); |
800 |
|
case NATIVE_ENABLE_INTERRUPT: |
801 |
|
EnableInterrupt(); |
802 |
|
break; |
803 |
+ |
case NATIVE_MAKE_EXECUTABLE: |
804 |
+ |
MakeExecutable(0, (void *)GPR(4), GPR(5)); |
805 |
+ |
break; |
806 |
|
default: |
807 |
|
printf("FATAL: NATIVE_OP called with bogus selector %d\n", selector); |
808 |
|
QuitEmulator(); |