124 |
|
|
125 |
void load_seg(int seg_reg, int selector, unsigned cur_eip); |
void load_seg(int seg_reg, int selector, unsigned cur_eip); |
126 |
void jmp_seg(int selector, unsigned int new_eip); |
void jmp_seg(int selector, unsigned int new_eip); |
127 |
|
void helper_iret_protected(int shift); |
128 |
void helper_lldt_T0(void); |
void helper_lldt_T0(void); |
129 |
void helper_ltr_T0(void); |
void helper_ltr_T0(void); |
130 |
void helper_movl_crN_T0(int reg); |
void helper_movl_crN_T0(int reg); |
131 |
void helper_movl_drN_T0(int reg); |
void helper_movl_drN_T0(int reg); |
132 |
|
void helper_invlpg(unsigned int addr); |
133 |
|
void cpu_x86_update_cr0(CPUX86State *env); |
134 |
|
void cpu_x86_update_cr3(CPUX86State *env); |
135 |
|
void cpu_x86_flush_tlb(CPUX86State *env, uint32_t addr); |
136 |
|
int cpu_x86_handle_mmu_fault(CPUX86State *env, uint32_t addr, int is_write); |
137 |
void __hidden cpu_lock(void); |
void __hidden cpu_lock(void); |
138 |
void __hidden cpu_unlock(void); |
void __hidden cpu_unlock(void); |
139 |
|
void do_interrupt(int intno, int is_int, int error_code, |
140 |
|
unsigned int next_eip); |
141 |
|
void do_interrupt_user(int intno, int is_int, int error_code, |
142 |
|
unsigned int next_eip); |
143 |
void raise_interrupt(int intno, int is_int, int error_code, |
void raise_interrupt(int intno, int is_int, int error_code, |
144 |
unsigned int next_eip); |
unsigned int next_eip); |
145 |
void raise_exception_err(int exception_index, int error_code); |
void raise_exception_err(int exception_index, int error_code); |
339 |
const uint8_t parity_table[256]; |
const uint8_t parity_table[256]; |
340 |
const uint8_t rclw_table[32]; |
const uint8_t rclw_table[32]; |
341 |
const uint8_t rclb_table[32]; |
const uint8_t rclb_table[32]; |
342 |
|
|
343 |
|
static inline uint32_t compute_eflags(void) |
344 |
|
{ |
345 |
|
return env->eflags | cc_table[CC_OP].compute_all() | (DF & DF_MASK); |
346 |
|
} |
347 |
|
|
348 |
|
#define FL_UPDATE_MASK32 (TF_MASK | AC_MASK | ID_MASK) |
349 |
|
|
350 |
|
#define FL_UPDATE_CPL0_MASK (TF_MASK | IF_MASK | IOPL_MASK | NT_MASK | \ |
351 |
|
RF_MASK | AC_MASK | ID_MASK) |
352 |
|
|
353 |
|
/* NOTE: CC_OP must be modified manually to CC_OP_EFLAGS */ |
354 |
|
static inline void load_eflags(int eflags, int update_mask) |
355 |
|
{ |
356 |
|
CC_SRC = eflags & (CC_O | CC_S | CC_Z | CC_A | CC_P | CC_C); |
357 |
|
DF = 1 - (2 * ((eflags >> 10) & 1)); |
358 |
|
env->eflags = (env->eflags & ~update_mask) | |
359 |
|
(eflags & update_mask); |
360 |
|
} |