28 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
29 |
* |
* |
30 |
* |
* |
31 |
* $Id: cpu_ppc.h,v 1.38 2005/09/24 23:44:19 debug Exp $ |
* $Id: cpu_ppc.h,v 1.41 2005/10/27 14:01:15 debug Exp $ |
32 |
*/ |
*/ |
33 |
|
|
34 |
#include "misc.h" |
#include "misc.h" |
93 |
|
|
94 |
/* Translation cache struct for each physical page: */ |
/* Translation cache struct for each physical page: */ |
95 |
struct ppc_tc_physpage { |
struct ppc_tc_physpage { |
96 |
|
struct ppc_instr_call ics[PPC_IC_ENTRIES_PER_PAGE + 1]; |
97 |
uint32_t next_ofs; /* or 0 for end of chain */ |
uint32_t next_ofs; /* or 0 for end of chain */ |
|
uint64_t physaddr; |
|
98 |
int flags; |
int flags; |
99 |
struct ppc_instr_call ics[PPC_IC_ENTRIES_PER_PAGE + 1]; |
uint64_t physaddr; |
100 |
}; |
}; |
101 |
|
|
102 |
#define PPC_N_VPH_ENTRIES 1048576 |
#define PPC_N_VPH_ENTRIES 1048576 |
187 |
unsigned char *host_store[PPC_N_VPH_ENTRIES]; |
unsigned char *host_store[PPC_N_VPH_ENTRIES]; |
188 |
uint32_t phys_addr[PPC_N_VPH_ENTRIES]; |
uint32_t phys_addr[PPC_N_VPH_ENTRIES]; |
189 |
struct ppc_tc_physpage *phys_page[PPC_N_VPH_ENTRIES]; |
struct ppc_tc_physpage *phys_page[PPC_N_VPH_ENTRIES]; |
190 |
|
|
191 |
|
uint32_t phystranslation[PPC_N_VPH_ENTRIES/32]; |
192 |
|
int16_t vaddr_to_tlbindex[PPC_N_VPH_ENTRIES]; |
193 |
}; |
}; |
194 |
|
|
195 |
|
|
214 |
#define PPC_MSR_LE (1) /* Little-Endian Mode */ |
#define PPC_MSR_LE (1) /* Little-Endian Mode */ |
215 |
|
|
216 |
/* XER bits: */ |
/* XER bits: */ |
217 |
#define PPC_XER_SO (1 << 31) /* Summary Overflow */ |
#define PPC_XER_SO (1UL << 31) /* Summary Overflow */ |
218 |
#define PPC_XER_OV (1 << 30) /* Overflow */ |
#define PPC_XER_OV (1 << 30) /* Overflow */ |
219 |
#define PPC_XER_CA (1 << 29) /* Carry */ |
#define PPC_XER_CA (1 << 29) /* Carry */ |
220 |
|
|
224 |
unsigned char *host_page, int writeflag, uint64_t paddr_page); |
unsigned char *host_page, int writeflag, uint64_t paddr_page); |
225 |
void ppc32_update_translation_table(struct cpu *cpu, uint64_t vaddr_page, |
void ppc32_update_translation_table(struct cpu *cpu, uint64_t vaddr_page, |
226 |
unsigned char *host_page, int writeflag, uint64_t paddr_page); |
unsigned char *host_page, int writeflag, uint64_t paddr_page); |
227 |
void ppc_invalidate_translation_caches_paddr(struct cpu *cpu, uint64_t, int); |
void ppc_invalidate_translation_caches(struct cpu *cpu, uint64_t, int); |
228 |
void ppc32_invalidate_translation_caches_paddr(struct cpu *cpu, uint64_t, int); |
void ppc32_invalidate_translation_caches(struct cpu *cpu, uint64_t, int); |
229 |
void ppc_invalidate_code_translation(struct cpu *cpu, uint64_t, int); |
void ppc_invalidate_code_translation(struct cpu *cpu, uint64_t, int); |
230 |
void ppc32_invalidate_code_translation(struct cpu *cpu, uint64_t, int); |
void ppc32_invalidate_code_translation(struct cpu *cpu, uint64_t, int); |
231 |
int ppc_memory_rw(struct cpu *cpu, struct memory *mem, uint64_t vaddr, |
int ppc_memory_rw(struct cpu *cpu, struct memory *mem, uint64_t vaddr, |