2018-06-14 10:07:36 +00:00
|
|
|
#ifndef EMU_H
|
|
|
|
#define EMU_H
|
|
|
|
|
|
|
|
extern void fatal(char* fmt, ...);
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
uint32_t gpr[32];
|
|
|
|
uint64_t fpr[32];
|
|
|
|
uint32_t cr;
|
|
|
|
uint32_t ctr;
|
|
|
|
uint32_t lr;
|
|
|
|
uint32_t xer;
|
|
|
|
uint32_t fpscr;
|
|
|
|
uint32_t cia;
|
|
|
|
uint32_t nia;
|
|
|
|
}
|
|
|
|
cpu_t;
|
|
|
|
|
|
|
|
extern cpu_t cpu;
|
|
|
|
|
|
|
|
extern uint32_t read_byte(uint32_t address);
|
|
|
|
extern uint32_t read_word(uint32_t address);
|
|
|
|
extern uint32_t read_long(uint32_t address);
|
2018-06-16 20:55:23 +00:00
|
|
|
extern uint64_t read_double(uint32_t address);
|
2018-06-14 10:07:36 +00:00
|
|
|
extern void write_byte(uint32_t address, uint32_t value);
|
|
|
|
extern void write_word(uint32_t address, uint32_t value);
|
|
|
|
extern void write_long(uint32_t address, uint32_t value);
|
2018-06-16 20:55:23 +00:00
|
|
|
extern void write_double(uint32_t address, uint64_t value);
|
2018-06-14 10:07:36 +00:00
|
|
|
|
|
|
|
extern void system_call(uint8_t trapno);
|
|
|
|
|
2018-06-14 11:41:21 +00:00
|
|
|
extern void dump_state(FILE* stream);
|
|
|
|
extern void single_step(void);
|
|
|
|
|
2018-06-14 10:07:36 +00:00
|
|
|
#endif
|
|
|
|
|