mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
RISC-V: Use riscv prefix consistently on cpu helpers
* Add riscv prefix to raise_exception function * Add riscv prefix to CSR read/write functions * Add riscv prefix to signal handler function * Add riscv prefix to get fflags function * Remove redundant declaration of riscv_cpu_init and rename cpu_riscv_init to riscv_cpu_init * rename riscv_set_mode to riscv_cpu_set_mode Signed-off-by: Michael Clark <mjc@sifive.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
This commit is contained in:
parent
7f2b5ff125
commit
fb73883964
6 changed files with 38 additions and 39 deletions
|
@ -256,7 +256,7 @@ int riscv_cpu_handle_mmu_fault(CPUState *cpu, vaddr address, int size,
|
|||
char *riscv_isa_string(RISCVCPU *cpu);
|
||||
void riscv_cpu_list(FILE *f, fprintf_function cpu_fprintf);
|
||||
|
||||
#define cpu_signal_handler cpu_riscv_signal_handler
|
||||
#define cpu_signal_handler riscv_cpu_signal_handler
|
||||
#define cpu_list riscv_cpu_list
|
||||
#define cpu_mmu_index riscv_cpu_mmu_index
|
||||
|
||||
|
@ -264,16 +264,15 @@ void riscv_cpu_list(FILE *f, fprintf_function cpu_fprintf);
|
|||
uint32_t riscv_cpu_update_mip(RISCVCPU *cpu, uint32_t mask, uint32_t value);
|
||||
#define BOOL_TO_MASK(x) (-!!(x)) /* helper for riscv_cpu_update_mip value */
|
||||
#endif
|
||||
void riscv_set_mode(CPURISCVState *env, target_ulong newpriv);
|
||||
void riscv_cpu_set_mode(CPURISCVState *env, target_ulong newpriv);
|
||||
|
||||
void riscv_translate_init(void);
|
||||
RISCVCPU *cpu_riscv_init(const char *cpu_model);
|
||||
int cpu_riscv_signal_handler(int host_signum, void *pinfo, void *puc);
|
||||
void QEMU_NORETURN do_raise_exception_err(CPURISCVState *env,
|
||||
uint32_t exception, uintptr_t pc);
|
||||
int riscv_cpu_signal_handler(int host_signum, void *pinfo, void *puc);
|
||||
void QEMU_NORETURN riscv_raise_exception(CPURISCVState *env,
|
||||
uint32_t exception, uintptr_t pc);
|
||||
|
||||
target_ulong cpu_riscv_get_fflags(CPURISCVState *env);
|
||||
void cpu_riscv_set_fflags(CPURISCVState *env, target_ulong);
|
||||
target_ulong riscv_cpu_get_fflags(CPURISCVState *env);
|
||||
void riscv_cpu_set_fflags(CPURISCVState *env, target_ulong);
|
||||
|
||||
#define TB_FLAGS_MMU_MASK 3
|
||||
#define TB_FLAGS_MSTATUS_FS MSTATUS_FS
|
||||
|
@ -293,13 +292,13 @@ static inline void cpu_get_tb_cpu_state(CPURISCVState *env, target_ulong *pc,
|
|||
int riscv_csrrw(CPURISCVState *env, int csrno, target_ulong *ret_value,
|
||||
target_ulong new_value, target_ulong write_mask);
|
||||
|
||||
static inline void csr_write_helper(CPURISCVState *env, target_ulong val,
|
||||
int csrno)
|
||||
static inline void riscv_csr_write(CPURISCVState *env, int csrno,
|
||||
target_ulong val)
|
||||
{
|
||||
riscv_csrrw(env, csrno, NULL, val, MAKE_64BIT_MASK(0, TARGET_LONG_BITS));
|
||||
}
|
||||
|
||||
static inline target_ulong csr_read_helper(CPURISCVState *env, int csrno)
|
||||
static inline target_ulong riscv_csr_read(CPURISCVState *env, int csrno)
|
||||
{
|
||||
target_ulong val = 0;
|
||||
riscv_csrrw(env, csrno, &val, 0, 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue