aboutsummaryrefslogtreecommitdiff
path: root/machine/mtrap.c
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@cs.berkeley.edu>2016-04-29 10:54:40 -0700
committerAndrew Waterman <waterman@cs.berkeley.edu>2016-04-29 10:54:40 -0700
commit66776bbc3efce7fb4176ca03fb949f556c2c2d57 (patch)
treea05be0f4527f9c58fadc934b652a59457d009561 /machine/mtrap.c
parentde16a763e6bf266ad49384fa131a502a6174e7ba (diff)
downloadriscv-pk-66776bbc3efce7fb4176ca03fb949f556c2c2d57.zip
riscv-pk-66776bbc3efce7fb4176ca03fb949f556c2c2d57.tar.gz
riscv-pk-66776bbc3efce7fb4176ca03fb949f556c2c2d57.tar.bz2
Remove mtime/mtimecmp
Diffstat (limited to 'machine/mtrap.c')
-rw-r--r--machine/mtrap.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/machine/mtrap.c b/machine/mtrap.c
index 1c310f9..4087a67 100644
--- a/machine/mtrap.c
+++ b/machine/mtrap.c
@@ -91,7 +91,8 @@ static void send_ipi(uintptr_t recipient, int event)
{
if ((atomic_or(&OTHER_HLS(recipient)->mipi_pending, event) & event) == 0) {
mb();
- OTHER_HLS(recipient)->csrs[CSR_MIPI] = 1;
+ if (recipient != read_const_csr(mhartid))
+ assert(!"IPIs temporarily missing");
}
}
@@ -136,12 +137,7 @@ static uintptr_t mcall_shutdown()
static uintptr_t mcall_set_timer(uint64_t when)
{
- // bbl/pk don't use the timer, so there's no need to virtualize it
-#ifdef __riscv32
- write_csr(mtimecmp, -1);
- write_csr(mtimecmph, (uintptr_t)(when >> 32));
-#endif
- write_csr(mtimecmp, (uintptr_t)when);
+ *HLS()->timecmp = when;
clear_csr(mip, MIP_STIP);
set_csr(mie, MIP_MTIP);
return 0;