aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYannis Huber <[email protected]>2020-06-07 11:23:14 +0200
committerRon Evans <[email protected]>2020-06-07 11:45:26 +0200
commitd61d5d7ab1beeb7d2ecace8c510ec6bdaece88d8 (patch)
treeb5145d6f18c1ef4a795c9ac9dc91083782870cc8
parentc5a896771d865fc77fac3e50c98e3d0ec98bad54 (diff)
downloadtinygo-d61d5d7ab1beeb7d2ecace8c510ec6bdaece88d8.tar.gz
tinygo-d61d5d7ab1beeb7d2ecace8c510ec6bdaece88d8.zip
Zero PLIC threshold value at startup
The PLIC threshold value must be zeroed at startup to permit all interrupt priorities. Fixes #1128.
-rw-r--r--src/runtime/runtime_fe310.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/runtime/runtime_fe310.go b/src/runtime/runtime_fe310.go
index de0d7ec46..437f03bf5 100644
--- a/src/runtime/runtime_fe310.go
+++ b/src/runtime/runtime_fe310.go
@@ -24,6 +24,9 @@ func main() {
sifive.PLIC.ENABLE[0].Set(0)
sifive.PLIC.ENABLE[1].Set(0)
+ // Zero the threshold value to allow all priorities of interrupts.
+ sifive.PLIC.THRESHOLD.Set(0)
+
// Set the interrupt address.
// Note that this address must be aligned specially, otherwise the MODE bits
// of MTVEC won't be zero.