diff options
author | Andrew Waterman <waterman@cs.berkeley.edu> | 2016-06-05 23:08:30 -0700 |
---|---|---|
committer | Andrew Waterman <waterman@cs.berkeley.edu> | 2016-06-05 23:08:30 -0700 |
commit | 1e62fdfce7b0095a57e4672c6c5fa4d3efb33d2a (patch) | |
tree | d238cd2773375c639c13fc87e47d65757a7956cb /machine | |
parent | 771c1163d397cd08e1974869f15b2e0c2d394602 (diff) | |
download | pk-1e62fdfce7b0095a57e4672c6c5fa4d3efb33d2a.zip pk-1e62fdfce7b0095a57e4672c6c5fa4d3efb33d2a.tar.gz pk-1e62fdfce7b0095a57e4672c6c5fa4d3efb33d2a.tar.bz2 |
PLIC registers are 32-bit, not 16-bit
Diffstat (limited to 'machine')
-rw-r--r-- | machine/configstring.c | 2 | ||||
-rw-r--r-- | machine/minit.c | 4 | ||||
-rw-r--r-- | machine/mtrap.h | 6 |
3 files changed, 6 insertions, 6 deletions
diff --git a/machine/configstring.c b/machine/configstring.c index 535250b..c935eb8 100644 --- a/machine/configstring.c +++ b/machine/configstring.c @@ -26,7 +26,7 @@ static void query_plic(const char* config_string) query_result res = query_config_string(config_string, "plic{priority"); if (!res.start) return; - plic_priorities = (uint16_t*)(uintptr_t)get_uint(res); + plic_priorities = (uint32_t*)(uintptr_t)get_uint(res); res = query_config_string(config_string, "plic{ndevs"); if (!res.start) diff --git a/machine/minit.c b/machine/minit.c index 609eb3a..f01e579 100644 --- a/machine/minit.c +++ b/machine/minit.c @@ -10,7 +10,7 @@ uintptr_t first_free_paddr; uintptr_t mem_size; uintptr_t num_harts; volatile uint64_t* mtime; -volatile uint16_t* plic_priorities; +volatile uint32_t* plic_priorities; size_t plic_ndevs; static void mstatus_init() @@ -101,7 +101,7 @@ static void plic_init() static void hart_plic_init() { // clear pending interrupts - HLS()->ipi = 0; + *HLS()->ipi = 0; write_csr(mip, 0); if (!plic_ndevs) diff --git a/machine/mtrap.h b/machine/mtrap.h index 3a6fb22..13652e0 100644 --- a/machine/mtrap.h +++ b/machine/mtrap.h @@ -33,7 +33,7 @@ extern uintptr_t first_free_paddr; extern uintptr_t mem_size; extern uintptr_t num_harts; extern volatile uint64_t* mtime; -extern volatile uint16_t* plic_priorities; +extern volatile uint32_t* plic_priorities; extern size_t plic_ndevs; typedef struct { @@ -50,9 +50,9 @@ typedef struct { uint64_t scycle_delta; uint64_t sinstret_delta; - volatile uint16_t* plic_m_thresh; + volatile uint32_t* plic_m_thresh; volatile uintptr_t* plic_m_ie; - volatile uint16_t* plic_s_thresh; + volatile uint32_t* plic_s_thresh; volatile uintptr_t* plic_s_ie; } hls_t; |