mirror of
https://github.com/kanjitalk755/macemu.git
synced 2024-11-19 09:30:56 +00:00
Merge from KPX: new exit() handling code; make "syscall" illegal for MacOS
emulation (SheepShaver)
This commit is contained in:
parent
360a9457c6
commit
022d09375f
@ -47,4 +47,7 @@ public:
|
||||
program_info * program() const;
|
||||
};
|
||||
|
||||
// Get out of specified task
|
||||
extern void task_exit(task_plugin *task, int status);
|
||||
|
||||
#endif /* TASK_PLUGIN_H */
|
||||
|
@ -264,7 +264,6 @@ void powerpc_cpu::initialize()
|
||||
|
||||
// Init syscalls handler
|
||||
execute_do_syscall = NULL;
|
||||
syscall_exit_code = -1;
|
||||
|
||||
// Init field2mask
|
||||
for (int i = 0; i < 256; i++) {
|
||||
@ -493,12 +492,6 @@ bool powerpc_cpu::check_spcflags()
|
||||
{
|
||||
if (spcflags().test(SPCFLAG_CPU_EXEC_RETURN)) {
|
||||
spcflags().clear(SPCFLAG_CPU_EXEC_RETURN);
|
||||
#ifndef SHEEPSHAVER
|
||||
// FIXME: add unwind info to the translation cache? Otherwise
|
||||
// we have to manually handle the exit syscall here
|
||||
if (syscall_exit_code >= 0)
|
||||
throw kernel_syscall_exit(syscall_exit_code);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
#ifdef SHEEPSHAVER
|
||||
|
@ -238,7 +238,6 @@ private:
|
||||
// Syscall callback must return TRUE if no error occurred
|
||||
typedef bool (*syscall_fn)(powerpc_cpu *cpu);
|
||||
syscall_fn execute_do_syscall;
|
||||
int syscall_exit_code;
|
||||
|
||||
static const instr_info_t powerpc_ii_table[];
|
||||
std::vector<instr_info_t> ii_table;
|
||||
|
@ -903,20 +903,11 @@ void powerpc_cpu::execute_fp_round(uint32 opcode)
|
||||
void powerpc_cpu::execute_syscall(uint32 opcode)
|
||||
{
|
||||
#ifdef SHEEPSHAVER
|
||||
D(bug("syscall\n"));
|
||||
increment_pc(4);
|
||||
execute_illegal(opcode);
|
||||
#else
|
||||
try {
|
||||
cr().set_so(0, execute_do_syscall && !execute_do_syscall(this));
|
||||
increment_pc(4);
|
||||
}
|
||||
catch (kernel_syscall_exit & sc_exit) {
|
||||
// FIXME: add unwind info to the translation cache? Otherwise
|
||||
// we have to manually forward the exception to execution loop
|
||||
syscall_exit_code = sc_exit.status;
|
||||
spcflags().set(SPCFLAG_CPU_EXEC_RETURN);
|
||||
}
|
||||
cr().set_so(0, execute_do_syscall && !execute_do_syscall(this));
|
||||
#endif
|
||||
increment_pc(4);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user