aboutsummaryrefslogtreecommitdiff
path: root/pk/mtrap.h
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@cs.berkeley.edu>2015-11-16 14:02:07 -0800
committerAndrew Waterman <waterman@cs.berkeley.edu>2015-11-16 14:02:07 -0800
commit197a8b81e4bbf61c497c93c0ac4630a33ab11b1c (patch)
tree27b984cf55295258d9ab31294402c66f328b53a4 /pk/mtrap.h
parent47f9e06fc2c696dfb1054d730cde888f1ac75d07 (diff)
downloadriscv-pk-197a8b81e4bbf61c497c93c0ac4630a33ab11b1c.zip
riscv-pk-197a8b81e4bbf61c497c93c0ac4630a33ab11b1c.tar.gz
riscv-pk-197a8b81e4bbf61c497c93c0ac4630a33ab11b1c.tar.bz2
Use IPIs to wake up harts
This has the side effect of testing the IPI mechanism. Still not sure this is the best approach to booting, but it works...
Diffstat (limited to 'pk/mtrap.h')
-rw-r--r--pk/mtrap.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/pk/mtrap.h b/pk/mtrap.h
index 375d549..61624d3 100644
--- a/pk/mtrap.h
+++ b/pk/mtrap.h
@@ -238,6 +238,7 @@ void hls_init(uint32_t hart_id, uintptr_t* csrs);
// hart-local storage, at top of stack
#define HLS() ((hls_t*)(MACHINE_STACK_TOP() - HLS_SIZE))
+#define OTHER_STACK_TOP(id) (MACHINE_STACK_TOP() + RISCV_PGSIZE * ((id) - HLS()->hart_id))
#define OTHER_HLS(id) ((hls_t*)((void*)HLS() + RISCV_PGSIZE * ((id) - HLS()->hart_id)))
#endif // !__ASSEMBLER__