included setjmp()/longjump() into emulator
This commit is contained in:
@@ -111,7 +111,7 @@ struct X86EMU_regs {
|
|||||||
uint8_t __pad[3];
|
uint8_t __pad[3];
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef uint32_t label_t;
|
typedef uint32_t jmp_buf[18];
|
||||||
|
|
||||||
struct X86EMU
|
struct X86EMU
|
||||||
{
|
{
|
||||||
@@ -120,7 +120,7 @@ struct X86EMU
|
|||||||
void *sys_private;
|
void *sys_private;
|
||||||
struct X86EMU_regs x86;
|
struct X86EMU_regs x86;
|
||||||
|
|
||||||
label_t exec_state;
|
jmp_buf exec_state;
|
||||||
|
|
||||||
uint64_t cur_cycles;
|
uint64_t cur_cycles;
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,14 @@
|
|||||||
#define SYS_BIOS 0xF0000
|
#define SYS_BIOS 0xF0000
|
||||||
#define SIZE_EMU 0x100000
|
#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
|
typedef struct
|
||||||
{
|
{
|
||||||
long ident;
|
long ident;
|
||||||
@@ -68,10 +76,8 @@ static uint32_t offset_io;
|
|||||||
static uint32_t config_address_reg;
|
static uint32_t config_address_reg;
|
||||||
|
|
||||||
extern int x86_pcibios_emulator();
|
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 */
|
/* general software interrupt handler */
|
||||||
uint32_t getIntVect(int num)
|
uint32_t getIntVect(int num)
|
||||||
@@ -270,7 +276,10 @@ void run_bios(struct radeonfb_info *rinfo)
|
|||||||
unsigned short initialcs;
|
unsigned short initialcs;
|
||||||
unsigned short initialip;
|
unsigned short initialip;
|
||||||
unsigned short devfn = (unsigned short) rinfo->handle;
|
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))
|
if ((rinfo->mmio_base == NULL) || (rinfo->io_base == NULL))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user