aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@cs.berkeley.edu>2012-09-04 23:23:08 -0700
committerAndrew Waterman <waterman@cs.berkeley.edu>2012-09-04 23:23:08 -0700
commit6336ef155fabdd15eecf11949b7e13a49e279738 (patch)
tree51942c7d0f74fb30bf9dd477b5b995568e69194b
parent6941d5f6b0929517a1bfc410b2a97ff0574716a4 (diff)
downloadriscv-pk-6336ef155fabdd15eecf11949b7e13a49e279738.zip
riscv-pk-6336ef155fabdd15eecf11949b7e13a49e279738.tar.gz
riscv-pk-6336ef155fabdd15eecf11949b7e13a49e279738.tar.bz2
fix FP emulation routines
to disable, add --disable-fp-emulation to configure command line
-rw-r--r--pk/fp.c9
-rw-r--r--pk/handlers.c3
2 files changed, 6 insertions, 6 deletions
diff --git a/pk/fp.c b/pk/fp.c
index 5426c71..f6d4eaf 100644
--- a/pk/fp.c
+++ b/pk/fp.c
@@ -1,6 +1,7 @@
#include "pk.h"
#include "pcr.h"
#include "fp.h"
+#include "config.h"
static fp_state_t fp_state;
@@ -211,10 +212,10 @@ int emulate_fp(trapframe_t* tf)
#define STR(x) XSTR(x)
#define XSTR(x) #x
-#define PUT_FP_REG(which, type, val) asm("mxtf." STR(type) " $f" STR(which) ",%0" : : "r"(val))
-#define GET_FP_REG(which, type, val) asm("mftx." STR(type) " %0,$f" STR(which) : "=r"(val))
-#define LOAD_FP_REG(which, type, val) asm("fl" STR(type) " $f" STR(which) ",%0" : : "m"(val))
-#define STORE_FP_REG(which, type, val) asm("fs" STR(type) " $f" STR(which) ",%0" : "=m"(val) : : "memory")
+#define PUT_FP_REG(which, type, val) asm("mxtf." STR(type) " f" STR(which) ",%0" : : "r"(val))
+#define GET_FP_REG(which, type, val) asm("mftx." STR(type) " %0,f" STR(which) : "=r"(val))
+#define LOAD_FP_REG(which, type, val) asm("fl" STR(type) " f" STR(which) ",%0" : : "m"(val))
+#define STORE_FP_REG(which, type, val) asm("fs" STR(type) " f" STR(which) ",%0" : "=m"(val) : : "memory")
static void __attribute__((noinline))
set_fp_reg(unsigned int which, unsigned int dp, uint64_t val)
diff --git a/pk/handlers.c b/pk/handlers.c
index da2f915..817f14d 100644
--- a/pk/handlers.c
+++ b/pk/handlers.c
@@ -1,5 +1,6 @@
#include "pcr.h"
#include "pk.h"
+#include "config.h"
int have_fp = 1; // initialized to 1 because it can't be in the .bss section!
int have_vector = 1;
@@ -33,8 +34,6 @@ static void handle_privileged_instruction(trapframe_t* tf)
static void handle_illegal_instruction(trapframe_t* tf)
{
#ifdef PK_ENABLE_FP_EMULATION
- irq_enable();
-
if(emulate_fp(tf) == 0)
{
advance_pc(tf);