| 21 |
/* allow to see translation results - the slowdown should be negligible, so we leave it */ |
/* allow to see translation results - the slowdown should be negligible, so we leave it */ |
| 22 |
#define DEBUG_DISAS |
#define DEBUG_DISAS |
| 23 |
|
|
| 24 |
|
#ifndef glue |
| 25 |
|
#define xglue(x, y) x ## y |
| 26 |
|
#define glue(x, y) xglue(x, y) |
| 27 |
|
#define stringify(s) tostring(s) |
| 28 |
|
#define tostring(s) #s |
| 29 |
|
#endif |
| 30 |
|
|
| 31 |
|
#if GCC_MAJOR < 3 |
| 32 |
|
#define __builtin_expect(x, n) (x) |
| 33 |
|
#endif |
| 34 |
|
|
| 35 |
/* is_jmp field values */ |
/* is_jmp field values */ |
| 36 |
#define DISAS_NEXT 0 /* next instruction can be analyzed */ |
#define DISAS_NEXT 0 /* next instruction can be analyzed */ |
| 37 |
#define DISAS_JUMP 1 /* only pc was modified dynamically */ |
#define DISAS_JUMP 1 /* only pc was modified dynamically */ |
| 55 |
|
|
| 56 |
#if defined(TARGET_I386) |
#if defined(TARGET_I386) |
| 57 |
|
|
| 58 |
#define GEN_FLAG_CODE32_SHIFT 0 |
#define GEN_FLAG_CODE32_SHIFT 0 |
| 59 |
#define GEN_FLAG_ADDSEG_SHIFT 1 |
#define GEN_FLAG_ADDSEG_SHIFT 1 |
| 60 |
#define GEN_FLAG_SS32_SHIFT 2 |
#define GEN_FLAG_SS32_SHIFT 2 |
| 61 |
#define GEN_FLAG_VM_SHIFT 3 |
#define GEN_FLAG_VM_SHIFT 3 |
| 62 |
#define GEN_FLAG_ST_SHIFT 4 |
#define GEN_FLAG_ST_SHIFT 4 |
| 63 |
#define GEN_FLAG_TF_SHIFT 8 /* same position as eflags */ |
#define GEN_FLAG_TF_SHIFT 8 /* same position as eflags */ |
| 64 |
#define GEN_FLAG_CPL_SHIFT 9 |
#define GEN_FLAG_CPL_SHIFT 9 |
| 65 |
#define GEN_FLAG_IOPL_SHIFT 12 /* same position as eflags */ |
#define GEN_FLAG_SOFT_MMU_SHIFT 11 |
| 66 |
|
#define GEN_FLAG_IOPL_SHIFT 12 /* same position as eflags */ |
| 67 |
|
|
| 68 |
|
void optimize_flags_init(void); |
| 69 |
|
|
| 70 |
#endif |
#endif |
| 71 |
|
|
| 82 |
void cpu_exec_init(void); |
void cpu_exec_init(void); |
| 83 |
int page_unprotect(unsigned long address); |
int page_unprotect(unsigned long address); |
| 84 |
void page_unmap(void); |
void page_unmap(void); |
| 85 |
|
void tlb_flush_page(CPUState *env, uint32_t addr); |
| 86 |
|
void tlb_flush(CPUState *env); |
| 87 |
|
|
| 88 |
#define CODE_GEN_MAX_SIZE 65536 |
#define CODE_GEN_MAX_SIZE 65536 |
| 89 |
#define CODE_GEN_ALIGN 16 /* must be >= of the size of a icache line */ |
#define CODE_GEN_ALIGN 16 /* must be >= of the size of a icache line */ |
| 246 |
|
|
| 247 |
#endif |
#endif |
| 248 |
|
|
| 249 |
|
/* physical memory access */ |
| 250 |
|
#define IO_MEM_NB_ENTRIES 256 |
| 251 |
|
#define TLB_INVALID_MASK (1 << 3) |
| 252 |
|
#define IO_MEM_SHIFT 4 |
| 253 |
|
#define IO_MEM_UNASSIGNED (1 << IO_MEM_SHIFT) |
| 254 |
|
|
| 255 |
|
unsigned long physpage_find(unsigned long page); |
| 256 |
|
|
| 257 |
|
extern CPUWriteMemoryFunc *io_mem_write[IO_MEM_NB_ENTRIES][4]; |
| 258 |
|
extern CPUReadMemoryFunc *io_mem_read[IO_MEM_NB_ENTRIES][4]; |
| 259 |
|
|
| 260 |
#ifdef __powerpc__ |
#ifdef __powerpc__ |
| 261 |
static inline int testandset (int *p) |
static inline int testandset (int *p) |
| 262 |
{ |
{ |