9os

Experimental kernel using plan9 ideas for embedded device
git clone git://git.simple-cc.org/9os
Log | Files | Refs | README | LICENSE

fpu.c (245B)


      1 #include <os9/os9.h>
      2 
      3 #include "arch.h"
      4 #include "sysreg.h"
      5 
      6 void
      7 fpon(void)
      8 {
      9 	syswr(CPACR_EL1, 3<<20);
     10 }
     11 
     12 void
     13 fpoff(void)
     14 {
     15 	syswr(CPACR_EL1, 0<<20);
     16 }
     17 
     18 void
     19 ifpu(void)
     20 {
     21 	fpon();
     22 	syswr(FPCR, 0);
     23 	syswr(FPSR, 0);
     24 	fpoff();
     25 	barrier(CODE);
     26 }