summaryrefslogtreecommitdiff
path: root/bsp/env
diff options
context:
space:
mode:
authorScott Johnson <scottj@sifive.com>2016-12-06 11:00:55 -0800
committerScott Johnson <scottj@sifive.com>2016-12-06 11:00:55 -0800
commit697fadd2946dafaf84bc70413ba26116e872bc5f (patch)
tree23c461dc86a5bec284d0b12b27e7b7704c288355 /bsp/env
parent66c882e380656d45dec9019255d7a1106bb1f5ff (diff)
Enable FPU in MSTATUS CSR during init
This way, chips with FPU can run FPU instructions without taking exceptions. I've confirmed that dhrystone still runs successfully even on chips with no FPU.
Diffstat (limited to 'bsp/env')
-rw-r--r--bsp/env/freedom-e300-hifive1/init.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/bsp/env/freedom-e300-hifive1/init.c b/bsp/env/freedom-e300-hifive1/init.c
index d085f6c..be76f90 100644
--- a/bsp/env/freedom-e300-hifive1/init.c
+++ b/bsp/env/freedom-e300-hifive1/init.c
@@ -182,6 +182,7 @@ void _init()
printf("core freq at %d Hz\n", get_cpu_freq());
write_csr(mtvec, &handle_trap);
+ write_csr(mstatus, MSTATUS_FS); // enable FPU
_exit(main(0, NULL));
}