Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F163418468
D21927.id63011.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
882 B
Referenced Files
None
Subscribers
None
D21927.id63011.diff
View Options
Index: sys/riscv/riscv/plic.c
===================================================================
--- sys/riscv/riscv/plic.c
+++ sys/riscv/riscv/plic.c
@@ -53,10 +53,17 @@
#include "pic_if.h"
#define PLIC_MAX_IRQS 1024
+
+/* Convert a RISC-V hart to supervisor-mode context. */
+#define HART_TO_CONTEXT_S(h) (2 * (h) + 1)
+
#define PLIC_PRIORITY(n) (0x000000 + (n) * 0x4)
-#define PLIC_ENABLE(n, h) (0x002000 + (h) * 0x80 + 4 * ((n) / 32))
-#define PLIC_THRESHOLD(h) (0x200000 + (h) * 0x1000 + 0x0)
-#define PLIC_CLAIM(h) (0x200000 + (h) * 0x1000 + 0x4)
+#define PLIC_ENABLE(n, h) \
+ (0x002000 + HART_TO_CONTEXT_S(h) * 0x80 + 4 * ((n) / 32))
+#define PLIC_THRESHOLD(h) \
+ (0x200000 + HART_TO_CONTEXT_S(h) * 0x1000 + 0x0)
+#define PLIC_CLAIM(h) \
+ (0x200000 + HART_TO_CONTEXT_S(h) * 0x1000 + 0x4)
struct plic_irqsrc {
struct intr_irqsrc isrc;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jul 24, 1:20 AM (7 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35423098
Default Alt Text
D21927.id63011.diff (882 B)
Attached To
Mode
D21927: plic: fix context calculation
Attached
Detach File
Event Timeline
Log In to Comment