28 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
29 |
* |
* |
30 |
* |
* |
31 |
* $Id: cpu_arm.h,v 1.66 2006/06/24 21:47:23 debug Exp $ |
* $Id: cpu_arm.h,v 1.68 2006/07/16 13:32:27 debug Exp $ |
32 |
*/ |
*/ |
33 |
|
|
34 |
#include "misc.h" |
#include "misc.h" |
83 |
#define ARM_ADDR_TO_PAGENR(a) ((a) >> (ARM_IC_ENTRIES_SHIFT \ |
#define ARM_ADDR_TO_PAGENR(a) ((a) >> (ARM_IC_ENTRIES_SHIFT \ |
84 |
+ ARM_INSTR_ALIGNMENT_SHIFT)) |
+ ARM_INSTR_ALIGNMENT_SHIFT)) |
85 |
|
|
|
struct arm_instr_call { |
|
|
void (*f)(struct cpu *, struct arm_instr_call *); |
|
|
size_t arg[ARM_N_IC_ARGS]; |
|
|
}; |
|
|
|
|
|
/* Translation cache struct for each physical page: */ |
|
|
struct arm_tc_physpage { |
|
|
struct arm_instr_call ics[ARM_IC_ENTRIES_PER_PAGE + 1]; |
|
|
uint32_t next_ofs; /* or 0 for end of chain */ |
|
|
uint32_t physaddr; |
|
|
int flags; |
|
|
}; |
|
|
|
|
|
|
|
86 |
#define ARM_F_N 8 /* Same as ARM_FLAG_*, but */ |
#define ARM_F_N 8 /* Same as ARM_FLAG_*, but */ |
87 |
#define ARM_F_Z 4 /* for the 'flags' field instead */ |
#define ARM_F_Z 4 /* for the 'flags' field instead */ |
88 |
#define ARM_F_C 2 /* of cpsr. */ |
#define ARM_F_C 2 /* of cpsr. */ |
125 |
#define ARM_EXCEPTION_IRQ 6 |
#define ARM_EXCEPTION_IRQ 6 |
126 |
#define ARM_EXCEPTION_FIQ 7 |
#define ARM_EXCEPTION_FIQ 7 |
127 |
|
|
128 |
|
DYNTRANS_MISC_DECLARATIONS(arm,ARM,uint32_t) |
129 |
|
|
130 |
#define ARM_MAX_VPH_TLB_ENTRIES 128 |
#define ARM_MAX_VPH_TLB_ENTRIES 128 |
|
struct arm_vpg_tlb_entry { |
|
|
unsigned char valid; |
|
|
unsigned char writeflag; |
|
|
uint32_t vaddr_page; |
|
|
uint32_t paddr_page; |
|
|
unsigned char *host_page; |
|
|
}; |
|
131 |
|
|
132 |
|
|
133 |
struct arm_cpu { |
struct arm_cpu { |
290 |
void arm_translation_table_set_l1_b(struct cpu *cpu, uint32_t vaddr, |
void arm_translation_table_set_l1_b(struct cpu *cpu, uint32_t vaddr, |
291 |
uint32_t paddr); |
uint32_t paddr); |
292 |
void arm_exception(struct cpu *, int); |
void arm_exception(struct cpu *, int); |
293 |
|
int arm_run_instr(struct cpu *cpu); |
294 |
void arm_update_translation_table(struct cpu *cpu, uint64_t vaddr_page, |
void arm_update_translation_table(struct cpu *cpu, uint64_t vaddr_page, |
295 |
unsigned char *host_page, int writeflag, uint64_t paddr_page); |
unsigned char *host_page, int writeflag, uint64_t paddr_page); |
296 |
void arm_invalidate_translation_caches(struct cpu *cpu, uint64_t, int); |
void arm_invalidate_translation_caches(struct cpu *cpu, uint64_t, int); |