diff options
author | Alexander Richardson <Alexander.Richardson@cl.cam.ac.uk> | 2020-07-31 22:15:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-31 14:15:12 -0700 |
commit | 7d8b7c0dab72108e3ea7bb7744d3f6cc907c7ef4 (patch) | |
tree | 624935c30601796d647ae9d6351f1d305d3abe1a /machine/fdt.c | |
parent | 6584364eaebfbad80ae91f232e7155c3c275b098 (diff) | |
download | riscv-pk-7d8b7c0dab72108e3ea7bb7744d3f6cc907c7ef4.zip riscv-pk-7d8b7c0dab72108e3ea7bb7744d3f6cc907c7ef4.tar.gz riscv-pk-7d8b7c0dab72108e3ea7bb7744d3f6cc907c7ef4.tar.bz2 |
Don't perform 64-bit accesses to the PLIC (#205)
Recent QEMU will fault for 8-byte accesses. Use a uint32_t instead of
uintptr_t to avoid those problems.
Diffstat (limited to 'machine/fdt.c')
-rw-r--r-- | machine/fdt.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/machine/fdt.c b/machine/fdt.c index fee3ae9..07b574f 100644 --- a/machine/fdt.c +++ b/machine/fdt.c @@ -439,10 +439,10 @@ static void plic_done(const struct fdt_scan_node *node, void *extra) if (hart < MAX_HARTS) { hls_t *hls = OTHER_HLS(hart); if (cpu_int == IRQ_M_EXT) { - hls->plic_m_ie = (uintptr_t*)((uintptr_t)scan->reg + ENABLE_BASE + ENABLE_SIZE * index); + hls->plic_m_ie = (uint32_t*)((uintptr_t)scan->reg + ENABLE_BASE + ENABLE_SIZE * index); hls->plic_m_thresh = (uint32_t*) ((uintptr_t)scan->reg + HART_BASE + HART_SIZE * index); } else if (cpu_int == IRQ_S_EXT) { - hls->plic_s_ie = (uintptr_t*)((uintptr_t)scan->reg + ENABLE_BASE + ENABLE_SIZE * index); + hls->plic_s_ie = (uint32_t*)((uintptr_t)scan->reg + ENABLE_BASE + ENABLE_SIZE * index); hls->plic_s_thresh = (uint32_t*) ((uintptr_t)scan->reg + HART_BASE + HART_SIZE * index); } else { printm("PLIC wired hart %d to wrong interrupt %d", hart, cpu_int); |