diff options
author | Anas Nashif <anas.nashif@intel.com> | 2013-01-15 13:31:42 -0800 |
---|---|---|
committer | Anas Nashif <anas.nashif@intel.com> | 2013-01-15 13:31:42 -0800 |
commit | 42bf3037d458a330856a0be584200c1e41c3f417 (patch) | |
tree | 25b9be1088727757e52271e25a446e8a852357df /target-openrisc | |
parent | 060629c6ef0b7e5c267d84c91600113264d33120 (diff) | |
download | qemu-42bf3037d458a330856a0be584200c1e41c3f417.tar.gz qemu-42bf3037d458a330856a0be584200c1e41c3f417.tar.bz2 qemu-42bf3037d458a330856a0be584200c1e41c3f417.zip |
Imported Upstream version 1.3.0upstream/1.3.0
Diffstat (limited to 'target-openrisc')
-rw-r--r-- | target-openrisc/cpu.h | 32 | ||||
-rw-r--r-- | target-openrisc/mmu.c | 14 | ||||
-rw-r--r-- | target-openrisc/translate.c | 17 |
3 files changed, 24 insertions, 39 deletions
diff --git a/target-openrisc/cpu.h b/target-openrisc/cpu.h index de21a877d..ebb5ad312 100644 --- a/target-openrisc/cpu.h +++ b/target-openrisc/cpu.h @@ -89,24 +89,6 @@ enum { /* Interrupt */ #define NR_IRQS 32 -/* Registers */ -enum { - R0 = 0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, - R11, R12, R13, R14, R15, R16, R17, R18, R19, R20, - R21, R22, R23, R24, R25, R26, R27, R28, R29, R30, - R31 -}; - -/* Register aliases */ -enum { - R_ZERO = R0, - R_SP = R1, - R_FP = R2, - R_LR = R9, - R_RV = R11, - R_RVH = R12 -}; - /* Unit presece register */ enum { UPR_UP = (1 << 0), @@ -279,11 +261,11 @@ typedef struct CPUOpenRISCTLBContext { OpenRISCTLBEntry dtlb[DTLB_WAYS][DTLB_SIZE]; int (*cpu_openrisc_map_address_code)(struct OpenRISCCPU *cpu, - target_phys_addr_t *physical, + hwaddr *physical, int *prot, target_ulong address, int rw); int (*cpu_openrisc_map_address_data)(struct OpenRISCCPU *cpu, - target_phys_addr_t *physical, + hwaddr *physical, int *prot, target_ulong address, int rw); } CPUOpenRISCTLBContext; @@ -387,13 +369,13 @@ void cpu_openrisc_count_stop(OpenRISCCPU *cpu); void cpu_openrisc_mmu_init(OpenRISCCPU *cpu); int cpu_openrisc_get_phys_nommu(OpenRISCCPU *cpu, - target_phys_addr_t *physical, + hwaddr *physical, int *prot, target_ulong address, int rw); int cpu_openrisc_get_phys_code(OpenRISCCPU *cpu, - target_phys_addr_t *physical, + hwaddr *physical, int *prot, target_ulong address, int rw); int cpu_openrisc_get_phys_data(OpenRISCCPU *cpu, - target_phys_addr_t *physical, + hwaddr *physical, int *prot, target_ulong address, int rw); #endif @@ -437,8 +419,10 @@ static inline int cpu_mmu_index(CPUOpenRISCState *env) } #define CPU_INTERRUPT_TIMER CPU_INTERRUPT_TGT_INT_0 -static inline bool cpu_has_work(CPUOpenRISCState *env) +static inline bool cpu_has_work(CPUState *cpu) { + CPUOpenRISCState *env = &OPENRISC_CPU(cpu)->env; + return env->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_TIMER); } diff --git a/target-openrisc/mmu.c b/target-openrisc/mmu.c index 0be1d413c..f2a6523cf 100644 --- a/target-openrisc/mmu.c +++ b/target-openrisc/mmu.c @@ -28,7 +28,7 @@ #ifndef CONFIG_USER_ONLY int cpu_openrisc_get_phys_nommu(OpenRISCCPU *cpu, - target_phys_addr_t *physical, + hwaddr *physical, int *prot, target_ulong address, int rw) { *physical = address; @@ -37,7 +37,7 @@ int cpu_openrisc_get_phys_nommu(OpenRISCCPU *cpu, } int cpu_openrisc_get_phys_code(OpenRISCCPU *cpu, - target_phys_addr_t *physical, + hwaddr *physical, int *prot, target_ulong address, int rw) { int vpn = address >> TARGET_PAGE_BITS; @@ -72,7 +72,7 @@ int cpu_openrisc_get_phys_code(OpenRISCCPU *cpu, } int cpu_openrisc_get_phys_data(OpenRISCCPU *cpu, - target_phys_addr_t *physical, + hwaddr *physical, int *prot, target_ulong address, int rw) { int vpn = address >> TARGET_PAGE_BITS; @@ -116,7 +116,7 @@ int cpu_openrisc_get_phys_data(OpenRISCCPU *cpu, } static int cpu_openrisc_get_phys_addr(OpenRISCCPU *cpu, - target_phys_addr_t *physical, + hwaddr *physical, int *prot, target_ulong address, int rw) { @@ -185,7 +185,7 @@ int cpu_openrisc_handle_mmu_fault(CPUOpenRISCState *env, target_ulong address, int rw, int mmu_idx) { int ret = 0; - target_phys_addr_t physical = 0; + hwaddr physical = 0; int prot = 0; OpenRISCCPU *cpu = OPENRISC_CPU(ENV_GET_CPU(env)); @@ -219,10 +219,10 @@ int cpu_openrisc_handle_mmu_fault(CPUOpenRISCState *env, #endif #ifndef CONFIG_USER_ONLY -target_phys_addr_t cpu_get_phys_page_debug(CPUOpenRISCState *env, +hwaddr cpu_get_phys_page_debug(CPUOpenRISCState *env, target_ulong addr) { - target_phys_addr_t phys_addr; + hwaddr phys_addr; int prot; OpenRISCCPU *cpu = OPENRISC_CPU(ENV_GET_CPU(env)); diff --git a/target-openrisc/translate.c b/target-openrisc/translate.c index 325ba09cb..f14da7bd1 100644 --- a/target-openrisc/translate.c +++ b/target-openrisc/translate.c @@ -1675,7 +1675,7 @@ static inline void gen_intermediate_code_internal(OpenRISCCPU *cpu, pc_start = tb->pc; dc->tb = tb; - gen_opc_end = gen_opc_buf + OPC_MAX_SIZE; + gen_opc_end = tcg_ctx.gen_opc_buf + OPC_MAX_SIZE; dc->is_jmp = DISAS_NEXT; dc->ppc = pc_start; dc->pc = pc_start; @@ -1703,7 +1703,7 @@ static inline void gen_intermediate_code_internal(OpenRISCCPU *cpu, do { check_breakpoint(cpu, dc); if (search_pc) { - j = gen_opc_ptr - gen_opc_buf; + j = tcg_ctx.gen_opc_ptr - tcg_ctx.gen_opc_buf; if (k < j) { k++; while (k < j) { @@ -1715,7 +1715,7 @@ static inline void gen_intermediate_code_internal(OpenRISCCPU *cpu, gen_opc_icount[k] = num_insns; } - if (unlikely(qemu_loglevel_mask(CPU_LOG_TB_OP))) { + if (unlikely(qemu_loglevel_mask(CPU_LOG_TB_OP | CPU_LOG_TB_OP_OPT))) { tcg_gen_debug_insn_start(dc->pc); } @@ -1744,7 +1744,7 @@ static inline void gen_intermediate_code_internal(OpenRISCCPU *cpu, } } } while (!dc->is_jmp - && gen_opc_ptr < gen_opc_end + && tcg_ctx.gen_opc_ptr < gen_opc_end && !cpu->env.singlestep_enabled && !singlestep && (dc->pc < next_page_start) @@ -1782,9 +1782,9 @@ static inline void gen_intermediate_code_internal(OpenRISCCPU *cpu, } gen_icount_end(tb, num_insns); - *gen_opc_ptr = INDEX_op_end; + *tcg_ctx.gen_opc_ptr = INDEX_op_end; if (search_pc) { - j = gen_opc_ptr - gen_opc_buf; + j = tcg_ctx.gen_opc_ptr - tcg_ctx.gen_opc_buf; k++; while (k <= j) { gen_opc_instr_start[k++] = 0; @@ -1797,9 +1797,10 @@ static inline void gen_intermediate_code_internal(OpenRISCCPU *cpu, #ifdef DEBUG_DISAS if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM)) { qemu_log("\n"); - log_target_disas(pc_start, dc->pc - pc_start, 0); + log_target_disas(&cpu->env, pc_start, dc->pc - pc_start, 0); qemu_log("\nisize=%d osize=%td\n", - dc->pc - pc_start, gen_opc_ptr - gen_opc_buf); + dc->pc - pc_start, tcg_ctx.gen_opc_ptr - + tcg_ctx.gen_opc_buf); } #endif } |