From d9b4b3149029d1021486bd2887605bedc96e25e2 Mon Sep 17 00:00:00 2001 From: gbeauche <> Date: Sat, 28 Jan 2006 22:00:10 +0000 Subject: [PATCH] Merge from KPX: new exit() handling code --- SheepShaver/src/kpx_cpu/include/basic-cpu.hpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/SheepShaver/src/kpx_cpu/include/basic-cpu.hpp b/SheepShaver/src/kpx_cpu/include/basic-cpu.hpp index f909f4c0..b296f440 100644 --- a/SheepShaver/src/kpx_cpu/include/basic-cpu.hpp +++ b/SheepShaver/src/kpx_cpu/include/basic-cpu.hpp @@ -22,6 +22,7 @@ #define BASIC_CPU_H #include "sysdeps.h" +#include #include "task-plugin.hpp" /** @@ -61,9 +62,10 @@ struct basic_cpu }; // Constructor & destructor - basic_cpu(task_struct * parent_task) : task_plugin(parent_task) { } + basic_cpu(task_struct * parent_task); + virtual ~basic_cpu(); - // Start emulation loop + // Execute code at current address virtual void execute() = 0; // Set VALUE to register ID @@ -71,6 +73,16 @@ struct basic_cpu // Get register ID virtual any_register get_register(int id) = 0; + + // Start emulation, returns exit status + int run(); + + // Stop emulation + void exit(int status); + +private: + jmp_buf env; + int exit_status; }; // Alias basic register set