Merge from KPX: new exit() handling code; make "syscall" illegal for MacOS

emulation (SheepShaver)
This commit is contained in:
gbeauche 2006-01-28 21:57:52 +00:00
parent 360a9457c6
commit 022d09375f
4 changed files with 6 additions and 20 deletions

View File

@ -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 */

View File

@ -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

View File

@ -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;

View File

@ -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);
}
/**