X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Ftarget%2Farm_simulator.h;h=bad904bac64b55249d0e1913bcb4dbca9e38a0e2;hp=7894873043a75184ddf407f84d2ff3f134c9c6a6;hb=a9abfa7d06dbcfded97b7fb41f50d3581c24fbae;hpb=32c6d70f6acd41dd1af5ea73051dd6c8a46eac14 diff --git a/src/target/arm_simulator.h b/src/target/arm_simulator.h index 7894873043..bad904bac6 100644 --- a/src/target/arm_simulator.h +++ b/src/target/arm_simulator.h @@ -20,12 +20,29 @@ #ifndef ARM_SIMULATOR_H #define ARM_SIMULATOR_H -#include "target.h" #include "types.h" -extern int arm_simulate_step(target_t *target, u32 *dry_run_pc); +struct target_s; +struct arm_sim_interface +{ + void *user_data; + uint32_t (*get_reg)(struct arm_sim_interface *sim, int reg); + void (*set_reg)(struct arm_sim_interface *sim, int reg, uint32_t value); + uint32_t (*get_reg_mode)(struct arm_sim_interface *sim, int reg); + void (*set_reg_mode)(struct arm_sim_interface *sim, int reg, uint32_t value); + uint32_t (*get_cpsr)(struct arm_sim_interface *sim, int pos, int bits); + enum armv4_5_state (*get_state)(struct arm_sim_interface *sim); + void (*set_state)(struct arm_sim_interface *sim, enum armv4_5_state mode); + enum armv4_5_mode (*get_mode)(struct arm_sim_interface *sim); +}; + + +/* armv4_5 version */ +extern int arm_simulate_step(struct target_s *target, uint32_t *dry_run_pc); + +/* a generic arm simulator. Caller must implement the sim interface */ +extern int arm_simulate_step_core(target_t *target, uint32_t *dry_run_pc, struct arm_sim_interface *sim); -#define ERROR_ARM_SIMULATOR_NOT_IMPLEMENTED (-700) #endif /* ARM_SIMULATOR_H */