From 6336ef155fabdd15eecf11949b7e13a49e279738 Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Tue, 4 Sep 2012 23:23:08 -0700 Subject: fix FP emulation routines to disable, add --disable-fp-emulation to configure command line --- pk/fp.c | 9 +++++---- pk/handlers.c | 3 +-- 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); -- cgit v1.1