aboutsummaryrefslogtreecommitdiff
path: root/pk/pcr.h
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@s144.Millennium.Berkeley.EDU>2010-10-18 01:47:09 -0700
committerAndrew Waterman <waterman@s144.Millennium.Berkeley.EDU>2010-10-18 01:47:09 -0700
commit77c382ff239f61ee9846a7abb6d96a6434b52b56 (patch)
tree44be4c6cf17b74bd0d87c2498c5a781f9be11156 /pk/pcr.h
parent68879a67d0f49323e1e2f8358d19bc1d94bb9f30 (diff)
downloadpk-77c382ff239f61ee9846a7abb6d96a6434b52b56.zip
pk-77c382ff239f61ee9846a7abb6d96a6434b52b56.tar.gz
pk-77c382ff239f61ee9846a7abb6d96a6434b52b56.tar.bz2
[pk] improved performance of fp emulation
Diffstat (limited to 'pk/pcr.h')
-rw-r--r--pk/pcr.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/pk/pcr.h b/pk/pcr.h
index 0834c2d..144b12c 100644
--- a/pk/pcr.h
+++ b/pk/pcr.h
@@ -23,6 +23,9 @@
#define PCR_K0 24
#define PCR_K1 25
+#define CR_FSR 0
+#define CR_TID 29
+
#define TIMER_PERIOD 0x1000000
#define ASM_CR(r) _ASM_CR(r)
@@ -37,6 +40,13 @@
asm volatile ("mfpcr %0,$cr%1" : "=r"(__tmp) : "i"(reg)); \
__tmp; })
+#define mtcr(val,reg) ({ long __tmp = (long)(val); \
+ asm volatile ("mtcr %0,$cr%1"::"r"(__tmp),"i"(reg)); })
+
+#define mfcr(reg) ({ long __tmp; \
+ asm volatile ("mfcr %0,$cr%1" : "=r"(__tmp) : "i"(reg)); \
+ __tmp; })
+
#endif
#endif