From: Andrew Waterman Date: Sun, 18 Aug 2013 11:14:16 +0000 (-0700) Subject: Renumber PCRs X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=67b8f98da7c780c36fa94950b9695ba8e81b5f76;p=riscv-isa-sim.git Renumber PCRs --- diff --git a/riscv/pcr.h b/riscv/pcr.h index 62c90dd..8c9617d 100644 --- a/riscv/pcr.h +++ b/riscv/pcr.h @@ -18,22 +18,22 @@ #define SR_IM_SHIFT 16 #define SR_IP_SHIFT 24 -#define PCR_SR 0 -#define PCR_EPC 1 -#define PCR_BADVADDR 2 -#define PCR_EVEC 3 -#define PCR_CAUSE 4 -#define PCR_PTBR 5 -#define PCR_ASID 6 -#define PCR_FATC 7 -#define PCR_COUNT 8 -#define PCR_COMPARE 9 -#define PCR_SEND_IPI 10 -#define PCR_CLR_IPI 11 -#define PCR_HARTID 12 -#define PCR_IMPL 13 -#define PCR_K0 14 -#define PCR_K1 15 +#define PCR_SUP0 0 +#define PCR_SUP1 1 +#define PCR_EPC 2 +#define PCR_BADVADDR 3 +#define PCR_PTBR 4 +#define PCR_ASID 5 +#define PCR_COUNT 6 +#define PCR_COMPARE 7 +#define PCR_EVEC 8 +#define PCR_CAUSE 9 +#define PCR_SR 10 +#define PCR_HARTID 11 +#define PCR_IMPL 12 +#define PCR_FATC 13 +#define PCR_SEND_IPI 14 +#define PCR_CLR_IPI 15 #define PCR_VECBANK 18 #define PCR_VECCFG 19 #define PCR_RESET 29 @@ -92,9 +92,6 @@ #define RISCV_PGLEVEL_BITS 10 #define RISCV_PGSIZE (1 << RISCV_PGSHIFT) -#define ASM_CR(r) _ASM_CR(r) -#define _ASM_CR(r) cr##r - #ifndef __ASSEMBLER__ #define mtpcr(reg,val) ({ long __tmp = (long)(val), __tmp2; \ diff --git a/riscv/processor.cc b/riscv/processor.cc index a4a1430..266bda6 100644 --- a/riscv/processor.cc +++ b/riscv/processor.cc @@ -213,10 +213,10 @@ reg_t processor_t::set_pcr(int which, reg_t val) case PCR_CLR_IPI: set_interrupt(IRQ_IPI, val & 1); break; - case PCR_K0: + case PCR_SUP0: state.pcr_k0 = val; break; - case PCR_K1: + case PCR_SUP1: state.pcr_k1 = val; break; case PCR_TOHOST: @@ -261,9 +261,9 @@ reg_t processor_t::get_pcr(int which) return id; case PCR_IMPL: return 1; - case PCR_K0: + case PCR_SUP0: return state.pcr_k0; - case PCR_K1: + case PCR_SUP1: return state.pcr_k1; case PCR_TOHOST: return state.tohost;