28 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
29 |
* |
* |
30 |
* |
* |
31 |
* $Id: cpu_i960.h,v 1.1 2005/09/07 07:10:17 debug Exp $ |
* $Id: cpu_i960.h,v 1.7 2005/11/16 21:15:19 debug Exp $ |
32 |
*/ |
*/ |
33 |
|
|
34 |
#include "misc.h" |
#include "misc.h" |
51 |
|
|
52 |
struct i960_instr_call { |
struct i960_instr_call { |
53 |
void (*f)(struct cpu *, struct i960_instr_call *); |
void (*f)(struct cpu *, struct i960_instr_call *); |
54 |
|
int len; |
55 |
size_t arg[I960_N_IC_ARGS]; |
size_t arg[I960_N_IC_ARGS]; |
56 |
}; |
}; |
57 |
|
|
58 |
/* Translation cache struct for each physical page: */ |
/* Translation cache struct for each physical page: */ |
59 |
struct i960_tc_physpage { |
struct i960_tc_physpage { |
60 |
|
struct i960_instr_call ics[I960_IC_ENTRIES_PER_PAGE + 1]; |
61 |
uint32_t next_ofs; /* or 0 for end of chain */ |
uint32_t next_ofs; /* or 0 for end of chain */ |
62 |
uint32_t physaddr; |
uint32_t physaddr; |
63 |
int flags; |
int flags; |
|
struct i960_instr_call ics[I960_IC_ENTRIES_PER_PAGE + 1]; |
|
64 |
}; |
}; |
65 |
|
|
66 |
|
|
68 |
|
|
69 |
#define I960_MAX_VPH_TLB_ENTRIES 256 |
#define I960_MAX_VPH_TLB_ENTRIES 256 |
70 |
struct i960_vpg_tlb_entry { |
struct i960_vpg_tlb_entry { |
71 |
int valid; |
unsigned char valid; |
72 |
int writeflag; |
unsigned char writeflag; |
|
int64_t timestamp; |
|
|
unsigned char *host_page; |
|
73 |
uint32_t vaddr_page; |
uint32_t vaddr_page; |
74 |
uint32_t paddr_page; |
uint32_t paddr_page; |
75 |
|
unsigned char *host_page; |
76 |
}; |
}; |
77 |
|
|
78 |
|
|
95 |
struct i960_instr_call *cur_ic_page; |
struct i960_instr_call *cur_ic_page; |
96 |
struct i960_instr_call *next_ic; |
struct i960_instr_call *next_ic; |
97 |
|
|
98 |
|
void (*combination_check)(struct cpu *, |
99 |
|
struct i960_instr_call *, int low_addr); |
100 |
|
|
101 |
/* |
/* |
102 |
* Virtual -> physical -> host address translation: |
* Virtual -> physical -> host address translation: |
111 |
unsigned char *host_store[I960_N_VPH_ENTRIES]; |
unsigned char *host_store[I960_N_VPH_ENTRIES]; |
112 |
uint32_t phys_addr[I960_N_VPH_ENTRIES]; |
uint32_t phys_addr[I960_N_VPH_ENTRIES]; |
113 |
struct i960_tc_physpage *phys_page[I960_N_VPH_ENTRIES]; |
struct i960_tc_physpage *phys_page[I960_N_VPH_ENTRIES]; |
114 |
|
|
115 |
|
uint32_t phystranslation[I960_N_VPH_ENTRIES/32]; |
116 |
|
uint8_t vaddr_to_tlbindex[I960_N_VPH_ENTRIES]; |
117 |
}; |
}; |
118 |
|
|
119 |
|
|
120 |
/* cpu_i960.c: */ |
/* cpu_i960.c: */ |
121 |
void i960_update_translation_table(struct cpu *cpu, uint64_t vaddr_page, |
void i960_update_translation_table(struct cpu *cpu, uint64_t vaddr_page, |
122 |
unsigned char *host_page, int writeflag, uint64_t paddr_page); |
unsigned char *host_page, int writeflag, uint64_t paddr_page); |
123 |
void i960_invalidate_translation_caches_paddr(struct cpu *cpu, uint64_t, int); |
void i960_invalidate_translation_caches(struct cpu *cpu, uint64_t, int); |
124 |
void i960_invalidate_code_translation(struct cpu *cpu, uint64_t, int); |
void i960_invalidate_code_translation(struct cpu *cpu, uint64_t, int); |
125 |
int i960_memory_rw(struct cpu *cpu, struct memory *mem, uint64_t vaddr, |
int i960_memory_rw(struct cpu *cpu, struct memory *mem, uint64_t vaddr, |
126 |
unsigned char *data, size_t len, int writeflag, int cache_flags); |
unsigned char *data, size_t len, int writeflag, int cache_flags); |