summaryrefslogtreecommitdiffstats
path: root/c/src/exec/score
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1996-08-15 21:09:02 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1996-08-15 21:09:02 +0000
commitcd3868cdd35255d57a08c4dd6e8a7b8545a08538 (patch)
tree943b1ed5ffacd8b53701df82a59c681c195ee490 /c/src/exec/score
parent_Thread_Start_multitasking: added code to initialize the floating point (diff)
downloadrtems-cd3868cdd35255d57a08c4dd6e8a7b8545a08538.tar.bz2
updates from Tony Bennett (tbennett@divnc.com)
Diffstat (limited to 'c/src/exec/score')
-rw-r--r--c/src/exec/score/cpu/hppa1.1/cpu.c6
-rw-r--r--c/src/exec/score/cpu/hppa1.1/hppa.h22
2 files changed, 26 insertions, 2 deletions
diff --git a/c/src/exec/score/cpu/hppa1.1/cpu.c b/c/src/exec/score/cpu/hppa1.1/cpu.c
index 89bb8a8447..d72dda4941 100644
--- a/c/src/exec/score/cpu/hppa1.1/cpu.c
+++ b/c/src/exec/score/cpu/hppa1.1/cpu.c
@@ -126,15 +126,17 @@ void _CPU_Initialize(
proc_ptr old_handler;
/*
- * XXX; need to setup fpsr smarter perhaps
+ * This is the default fp context for all tasks
+ * Set it up so that denormalized results go to zero.
*/
fp_context = (unsigned8*) &_CPU_Null_fp_context;
for (i=0 ; i<sizeof(Context_Control_fp); i++)
*fp_context++ = 0;
+ *((unsigned32 *) &_CPU_Null_fp_context) = HPPA_FPSTATUS_D;
/*
- * Set _CPU_Default_gr27 here so it will hopefully be the correct
+ * Save r27 into _CPU_Default_gr27 so it will hopefully be the correct
* global data pointer for the entire system.
*/
diff --git a/c/src/exec/score/cpu/hppa1.1/hppa.h b/c/src/exec/score/cpu/hppa1.1/hppa.h
index ae1bd700de..87ba027aab 100644
--- a/c/src/exec/score/cpu/hppa1.1/hppa.h
+++ b/c/src/exec/score/cpu/hppa1.1/hppa.h
@@ -249,6 +249,28 @@ extern "C" {
#define HPPA_PROT_X2 0x06c00000 /* Execute Only, Promote to Level 2 */
#define HPPA_PROT_X3 0x07c00000 /* Execute Only, Promote to Level 3 */
+/*
+ * Floating point status register definitions
+ */
+
+#define HPPA_FPSTATUS_ENABLE_I 0x00000001 /* inexact operation */
+#define HPPA_FPSTATUS_ENABLE_U 0x00000002 /* underflow */
+#define HPPA_FPSTATUS_ENABLE_O 0x00000004 /* overflow */
+#define HPPA_FPSTATUS_ENABLE_Z 0x00000008 /* division by zero */
+#define HPPA_FPSTATUS_ENABLE_V 0x00000010 /* invalid operation */
+#define HPPA_FPSTATUS_D 0x00000020 /* denormalize as zero */
+#define HPPA_FPSTATUS_T 0x00000040 /* delayed trap */
+#define HPPA_FPSTATUS_RM_MASK 0x00000600 /* rounding mode */
+#define HPPA_FPSTATUS_RM_SHIFT 9
+#define HPPA_FPSTATUS_CQ_MASK 0x001FFC00 /* compare queue */
+#define HPPA_FPSTATUS_CQ_SHIFT 13
+#define HPPA_FPSTATUS_C 0x04000000 /* most recent ompare bit */
+#define HPPA_FPSTATUS_FLAG_I 0x08000000 /* inexact */
+#define HPPA_FPSTATUS_FLAG_U 0x10000000 /* underflow */
+#define HPPA_FPSTATUS_FLAG_O 0x20000000 /* overflow */
+#define HPPA_FPSTATUS_FLAG_Z 0x40000000 /* division by zero */
+#define HPPA_FPSTATUS_FLAG_V 0x80000000 /* invalid operation */
+
/*
* Inline macros for misc. interesting opcodes