diff --git a/BaS_gcc/include/x86emu.h b/BaS_gcc/include/x86emu.h index 05fe0c1..306eea1 100644 --- a/BaS_gcc/include/x86emu.h +++ b/BaS_gcc/include/x86emu.h @@ -111,7 +111,7 @@ struct X86EMU_regs { uint8_t __pad[3]; }; -typedef uint32_t label_t; +typedef uint32_t jmp_buf[18]; struct X86EMU { @@ -120,7 +120,7 @@ struct X86EMU void *sys_private; struct X86EMU_regs x86; - label_t exec_state; + jmp_buf exec_state; uint64_t cur_cycles; diff --git a/BaS_gcc/x86emu/x86biosemu.c b/BaS_gcc/x86emu/x86biosemu.c index 3eea064..145b94d 100644 --- a/BaS_gcc/x86emu/x86biosemu.c +++ b/BaS_gcc/x86emu/x86biosemu.c @@ -24,6 +24,14 @@ #define SYS_BIOS 0xF0000 #define SIZE_EMU 0x100000 +#define DBG_BIOSEMU +#ifdef DBG_BIOSEMU +#define dbg(format, arg...) do { xprintf("DEBUG (%s()): " format, __FUNCTION__, ##arg);} while(0) +#else +#define dbg(format, arg...) do {;} while (0) +#endif /* DBG_BIOSEMU */ +#define err(format, arg...) do { xprintf("ERROR (%s()): " format, __FUNCTION__, ##arg); } while(0) + typedef struct { long ident; @@ -68,10 +76,8 @@ static uint32_t offset_io; static uint32_t config_address_reg; extern int x86_pcibios_emulator(); -extern COOKIE *get_cookie(long id); -extern short restart, os_magic; -X86EMU_sysEnv _X86EMU_env; +//X86EMU_sysEnv _X86EMU_env; /* general software interrupt handler */ uint32_t getIntVect(int num) @@ -270,7 +276,10 @@ void run_bios(struct radeonfb_info *rinfo) unsigned short initialcs; unsigned short initialip; unsigned short devfn = (unsigned short) rinfo->handle; - X86EMU_intrFuncs intFuncs[256]; + + struct X86EMU emu; + + X86EMU_init_default(&emu); if ((rinfo->mmio_base == NULL) || (rinfo->io_base == NULL)) {