Commit 9ba5695ce5c995437efce0462dd9b8631daba0c0

Authored by bellard
1 parent 66099dd9

added CPL and IOPL as translation time constants - changed I/O function prototyp…

…e to include emulator state - added error_code and cr2 support


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@125 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 10 additions and 6 deletions
cpu-i386.h
@@ -197,6 +197,8 @@ typedef struct CPUX86State { @@ -197,6 +197,8 @@ typedef struct CPUX86State {
197 /* exception/interrupt handling */ 197 /* exception/interrupt handling */
198 jmp_buf jmp_env; 198 jmp_buf jmp_env;
199 int exception_index; 199 int exception_index;
  200 + int error_code;
  201 + uint32_t cr2;
200 int interrupt_request; 202 int interrupt_request;
201 203
202 /* user data */ 204 /* user data */
@@ -401,12 +403,12 @@ static inline void stfq(void *ptr, double v) @@ -401,12 +403,12 @@ static inline void stfq(void *ptr, double v)
401 #endif 403 #endif
402 404
403 #ifndef IN_OP_I386 405 #ifndef IN_OP_I386
404 -void cpu_x86_outb(int addr, int val);  
405 -void cpu_x86_outw(int addr, int val);  
406 -void cpu_x86_outl(int addr, int val);  
407 -int cpu_x86_inb(int addr);  
408 -int cpu_x86_inw(int addr);  
409 -int cpu_x86_inl(int addr); 406 +void cpu_x86_outb(CPUX86State *env, int addr, int val);
  407 +void cpu_x86_outw(CPUX86State *env, int addr, int val);
  408 +void cpu_x86_outl(CPUX86State *env, int addr, int val);
  409 +int cpu_x86_inb(CPUX86State *env, int addr);
  410 +int cpu_x86_inw(CPUX86State *env, int addr);
  411 +int cpu_x86_inl(CPUX86State *env, int addr);
410 #endif 412 #endif
411 413
412 CPUX86State *cpu_x86_init(void); 414 CPUX86State *cpu_x86_init(void);
@@ -431,6 +433,8 @@ int cpu_x86_signal_handler(int host_signum, struct siginfo *info, @@ -431,6 +433,8 @@ int cpu_x86_signal_handler(int host_signum, struct siginfo *info,
431 #define GEN_FLAG_SS32_SHIFT 2 433 #define GEN_FLAG_SS32_SHIFT 2
432 #define GEN_FLAG_VM_SHIFT 3 434 #define GEN_FLAG_VM_SHIFT 3
433 #define GEN_FLAG_ST_SHIFT 4 435 #define GEN_FLAG_ST_SHIFT 4
  436 +#define GEN_FLAG_CPL_SHIFT 7
  437 +#define GEN_FLAG_IOPL_SHIFT 9
434 438
435 int cpu_x86_gen_code(uint8_t *gen_code_buf, int max_code_size, 439 int cpu_x86_gen_code(uint8_t *gen_code_buf, int max_code_size,
436 int *gen_code_size_ptr, 440 int *gen_code_size_ptr,