exec.h (394B)
1 #ifndef EXEC_H 2 #define EXEC_H 3 4 #include "trap.h" 5 6 #ifdef TEST_BUILD 7 #define MEMSIZE 4096 8 #else 9 #define MEMSIZE 65536 10 #endif 11 12 typedef enum { 13 CPU_RUNNING = 0, 14 CPU_TRAPPED, 15 CPU_HALTED 16 } cpu_status_t; 17 18 typedef struct { 19 uint32_t x[32]; /* general purpose registers */ 20 uint32_t pc; 21 trap_info_t trap; 22 cpu_status_t status; 23 } cpu_state_t; 24 25 void cpu_step(cpu_state_t *cpu, uint8_t *mem); 26 27 #endif