|
|
| version 1.19, 2004/02/20 16:09:04 | version 1.20, 2004/03/05 14:17:35 |
|---|---|
| Line 116 enum { | Line 116 enum { |
| MAX_PREFIX = 8 | MAX_PREFIX = 8 |
| }; | }; |
| enum { | |
| CPU_PREFETCH_QUEUE_LENGTH = 16 | |
| }; | |
| typedef struct { | typedef struct { |
| REG32 reg[CPU_REG_NUM]; | REG32 reg[CPU_REG_NUM]; |
| UINT16 sreg[CPU_SEGREG_NUM]; | UINT16 sreg[CPU_SEGREG_NUM]; |
| Line 152 typedef struct { | Line 156 typedef struct { |
| descriptor_t ldtr; | descriptor_t ldtr; |
| descriptor_t tr; | descriptor_t tr; |
| BYTE prefetch[CPU_PREFETCH_QUEUE_LENGTH]; | |
| UINT32 prefetch_remain; | |
| UINT32 adrsmask; | UINT32 adrsmask; |
| UINT32 ovflag; | UINT32 ovflag; |
| Line 441 void set_eflags(UINT32 new_flags, UINT32 | Line 448 void set_eflags(UINT32 new_flags, UINT32 |
| #define CPU_STAT_EXCEPTION_COUNTER_INC() CPU_STATSAVE.cpu_stat.nerror++ | #define CPU_STAT_EXCEPTION_COUNTER_INC() CPU_STATSAVE.cpu_stat.nerror++ |
| #define CPU_STAT_EXCEPTION_COUNTER_CLEAR() CPU_STATSAVE.cpu_stat.nerror = 0 | #define CPU_STAT_EXCEPTION_COUNTER_CLEAR() CPU_STATSAVE.cpu_stat.nerror = 0 |
| #define CPU_PREFETCHQ CPU_STATSAVE.cpu_stat.prefetch | |
| #define CPU_PREFETCHQ_REMAIN CPU_STATSAVE.cpu_stat.prefetch_remain | |
| #if defined(IA32_SUPPORT_PREFETCH_QUEUE) | |
| #define CPU_PREFETCH_CLEAR() CPU_PREFETCHQ_REMAIN = 0 | |
| #else /* !IA32_SUPPORT_PREFETCH_QUEUE */ | |
| #define CPU_PREFETCH_CLEAR() | |
| #endif /* IA32_SUPPORT_PREFETCH_QUEUE */ | |
| #define CPU_MODE_SUPERVISER 0 | #define CPU_MODE_SUPERVISER 0 |
| #define CPU_MODE_USER 1 | #define CPU_MODE_USER 1 |
| #define CPU_SET_CPL(cpl) \ | #define CPU_SET_CPL(cpl) \ |
| Line 538 void exec_1step(void); | Line 554 void exec_1step(void); |
| #define INST_STRING (1 << 1) | #define INST_STRING (1 << 1) |
| #define REP_CHECKZF (1 << 7) | #define REP_CHECKZF (1 << 7) |
| int disasm(UINT32 *eip, char *buf, size_t size); | |
| void ia32_printf(const char *buf, ...); | void ia32_printf(const char *buf, ...); |
| void ia32_warning(const char *buf, ...); | void ia32_warning(const char *buf, ...); |
| void ia32_panic(const char *buf, ...); | void ia32_panic(const char *buf, ...); |
| Line 581 void idtr_dump(UINT32 base, UINT limit); | Line 595 void idtr_dump(UINT32 base, UINT limit); |
| void ldtr_dump(UINT32 base, UINT limit); | void ldtr_dump(UINT32 base, UINT limit); |
| void tr_dump(UINT16 selector, UINT32 base, UINT limit); | void tr_dump(UINT16 selector, UINT32 base, UINT limit); |
| /* | |
| * disasm | |
| */ | |
| /* context */ | |
| typedef struct { | |
| UINT32 val; | |
| UINT32 eip; | |
| BOOL op32; | |
| BOOL as32; | |
| UINT32 baseaddr; | |
| UINT8 opcode[3]; | |
| UINT8 modrm; | |
| UINT8 sib; | |
| BOOL useseg; | |
| int seg; | |
| UINT8 opbyte[32]; | |
| int nopbytes; | |
| char str[256]; | |
| size_t remain; | |
| char *next; | |
| char *prefix; | |
| char *op; | |
| char *arg[3]; | |
| int narg; | |
| char pad; | |
| } disasm_context_t; | |
| int disasm(UINT32 *eip, disasm_context_t *ctx); | |
| #ifdef __cplusplus | #ifdef __cplusplus |
| } | } |
| #endif | #endif |