aboutsummaryrefslogtreecommitdiff
path: root/target/openrisc/cpu.h
diff options
context:
space:
mode:
Diffstat (limited to 'target/openrisc/cpu.h')
-rw-r--r--target/openrisc/cpu.h47
1 files changed, 13 insertions, 34 deletions
diff --git a/target/openrisc/cpu.h b/target/openrisc/cpu.h
index b97d2ff..c8e2827 100644
--- a/target/openrisc/cpu.h
+++ b/target/openrisc/cpu.h
@@ -21,7 +21,9 @@
#define OPENRISC_CPU_H
#include "cpu-qom.h"
+#include "exec/cpu-common.h"
#include "exec/cpu-defs.h"
+#include "exec/cpu-interrupt.h"
#include "fpu/softfloat-types.h"
/**
@@ -38,8 +40,6 @@ struct OpenRISCCPUClass {
ResettablePhases parent_phases;
};
-#define TARGET_INSN_START_EXTRA_WORDS 1
-
enum {
MMU_NOMMU_IDX = 0,
MMU_SUPERVISOR_IDX = 1,
@@ -220,33 +220,24 @@ typedef struct OpenRISCTLBEntry {
typedef struct CPUOpenRISCTLBContext {
OpenRISCTLBEntry itlb[TLB_SIZE];
OpenRISCTLBEntry dtlb[TLB_SIZE];
-
- int (*cpu_openrisc_map_address_code)(OpenRISCCPU *cpu,
- hwaddr *physical,
- int *prot,
- target_ulong address, int rw);
- int (*cpu_openrisc_map_address_data)(OpenRISCCPU *cpu,
- hwaddr *physical,
- int *prot,
- target_ulong address, int rw);
} CPUOpenRISCTLBContext;
#endif
typedef struct CPUArchState {
- target_ulong shadow_gpr[16][32]; /* Shadow registers */
+ uint32_t shadow_gpr[16][32]; /* Shadow registers */
- target_ulong pc; /* Program counter */
- target_ulong ppc; /* Prev PC */
- target_ulong jmp_pc; /* Jump PC */
+ uint32_t pc; /* Program counter */
+ uint32_t ppc; /* Prev PC */
+ uint32_t jmp_pc; /* Jump PC */
uint64_t mac; /* Multiply registers MACHI:MACLO */
- target_ulong epcr; /* Exception PC register */
- target_ulong eear; /* Exception EA register */
+ uint32_t epcr; /* Exception PC register */
+ uint32_t eear; /* Exception EA register */
- target_ulong sr_f; /* the SR_F bit, values 0, 1. */
- target_ulong sr_cy; /* the SR_CY bit, values 0, 1. */
- target_long sr_ov; /* the SR_OV bit (in the sign bit only) */
+ uint32_t sr_f; /* the SR_F bit, values 0, 1. */
+ uint32_t sr_cy; /* the SR_CY bit, values 0, 1. */
+ int32_t sr_ov; /* the SR_OV bit (in the sign bit only) */
uint32_t sr; /* Supervisor register, without SR_{F,CY,OV} */
uint32_t esr; /* Exception supervisor register */
uint32_t evbar; /* Exception vector base address register */
@@ -254,8 +245,8 @@ typedef struct CPUArchState {
uint32_t fpcsr; /* Float register */
float_status fp_status;
- target_ulong lock_addr;
- target_ulong lock_value;
+ uint32_t lock_addr;
+ uint32_t lock_value;
uint32_t dflag; /* In delay slot (boolean) */
@@ -332,8 +323,6 @@ void cpu_openrisc_count_stop(OpenRISCCPU *cpu);
#define CPU_RESOLVING_TYPE TYPE_OPENRISC_CPU
-#include "exec/cpu-all.h"
-
#define TB_FLAGS_SM SR_SM
#define TB_FLAGS_DME SR_DME
#define TB_FLAGS_IME SR_IME
@@ -351,16 +340,6 @@ static inline void cpu_set_gpr(CPUOpenRISCState *env, int i, uint32_t val)
env->shadow_gpr[0][i] = val;
}
-static inline void cpu_get_tb_cpu_state(CPUOpenRISCState *env, vaddr *pc,
- uint64_t *cs_base, uint32_t *flags)
-{
- *pc = env->pc;
- *cs_base = 0;
- *flags = (env->dflag ? TB_FLAGS_DFLAG : 0)
- | (cpu_get_gpr(env, 0) ? 0 : TB_FLAGS_R0_0)
- | (env->sr & (SR_SM | SR_DME | SR_IME | SR_OVE));
-}
-
static inline uint32_t cpu_get_sr(const CPUOpenRISCState *env)
{
return (env->sr