28 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
29 |
* |
* |
30 |
* |
* |
31 |
* $Id: cpu_x86.h,v 1.35 2005/10/27 14:01:15 debug Exp $ |
* $Id: cpu_x86.h,v 1.39 2005/11/16 21:15:19 debug Exp $ |
32 |
*/ |
*/ |
33 |
|
|
34 |
#include "misc.h" |
#include "misc.h" |
103 |
|
|
104 |
struct x86_instr_call { |
struct x86_instr_call { |
105 |
void (*f)(struct cpu *, struct x86_instr_call *); |
void (*f)(struct cpu *, struct x86_instr_call *); |
106 |
|
int len; |
107 |
size_t arg[X86_N_IC_ARGS]; |
size_t arg[X86_N_IC_ARGS]; |
108 |
}; |
}; |
109 |
|
|
119 |
|
|
120 |
#define X86_MAX_VPH_TLB_ENTRIES 256 |
#define X86_MAX_VPH_TLB_ENTRIES 256 |
121 |
struct x86_vpg_tlb_entry { |
struct x86_vpg_tlb_entry { |
122 |
int valid; |
uint8_t valid; |
123 |
int writeflag; |
uint8_t writeflag; |
|
int64_t timestamp; |
|
124 |
unsigned char *host_page; |
unsigned char *host_page; |
125 |
|
int64_t timestamp; |
126 |
uint64_t vaddr_page; |
uint64_t vaddr_page; |
127 |
uint64_t paddr_page; |
uint64_t paddr_page; |
128 |
}; |
}; |
191 |
struct x86_instr_call *cur_ic_page; |
struct x86_instr_call *cur_ic_page; |
192 |
struct x86_instr_call *next_ic; |
struct x86_instr_call *next_ic; |
193 |
|
|
194 |
|
void (*combination_check)(struct cpu *, |
195 |
|
struct x86_instr_call *, int low_addr); |
196 |
|
|
197 |
/* |
/* |
198 |
* Virtual -> physical -> host address translation: |
* Virtual -> physical -> host address translation: |
209 |
struct x86_tc_physpage *phys_page[X86_N_VPH_ENTRIES]; |
struct x86_tc_physpage *phys_page[X86_N_VPH_ENTRIES]; |
210 |
|
|
211 |
uint32_t phystranslation[X86_N_VPH_ENTRIES/32]; |
uint32_t phystranslation[X86_N_VPH_ENTRIES/32]; |
212 |
|
uint8_t vaddr_to_tlbindex[X86_N_VPH_ENTRIES]; |
213 |
}; |
}; |
214 |
|
|
215 |
|
|
333 |
int x86_interrupt(struct cpu *cpu, int nr, int errcode); |
int x86_interrupt(struct cpu *cpu, int nr, int errcode); |
334 |
int x86_memory_rw(struct cpu *cpu, struct memory *mem, uint64_t vaddr, |
int x86_memory_rw(struct cpu *cpu, struct memory *mem, uint64_t vaddr, |
335 |
unsigned char *data, size_t len, int writeflag, int cache_flags); |
unsigned char *data, size_t len, int writeflag, int cache_flags); |
336 |
|
void x86_update_translation_table(struct cpu *cpu, uint64_t vaddr_page, |
337 |
|
unsigned char *host_page, int writeflag, uint64_t paddr_page); |
338 |
|
void x8632_update_translation_table(struct cpu *cpu, uint64_t vaddr_page, |
339 |
|
unsigned char *host_page, int writeflag, uint64_t paddr_page); |
340 |
|
void x86_invalidate_translation_caches(struct cpu *cpu, uint64_t, int); |
341 |
|
void x8632_invalidate_translation_caches(struct cpu *cpu, uint64_t, int); |
342 |
|
void x86_invalidate_code_translation(struct cpu *cpu, uint64_t, int); |
343 |
|
void x8632_invalidate_code_translation(struct cpu *cpu, uint64_t, int); |
344 |
int x86_cpu_family_init(struct cpu_family *); |
int x86_cpu_family_init(struct cpu_family *); |
345 |
|
|
346 |
|
|
347 |
/* memory_x86.c: */ |
/* memory_x86.c: */ |
348 |
int x86_translate_address(struct cpu *cpu, uint64_t vaddr, |
int x86_translate_address(struct cpu *cpu, uint64_t vaddr, |
349 |
uint64_t *return_addr, int flags); |
uint64_t *return_addr, int flags); |