summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2005-10-05 19:30:18 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2005-10-05 19:30:18 +0000
commit59d55753a8344251b3e031fe077b4565d029c5be (patch)
tree2fa5390d1d0ed6dd89f8023c62739459676af4ac
parent2005-10-05 Jiri Gaisler <jiri@gaisler.com> (diff)
downloadrtems-59d55753a8344251b3e031fe077b4565d029c5be.tar.bz2
2005-10-05 Jiri Gaisler <jiri@gaisler.com>
Edvin Catovic <edvin@gaisler.com> Konrad Eisele <konrad@gaisler.com> PR 827/bsps * ChangeLog, cpu.c, cpu_asm.S, rtems/score/cpu.h: Portion of large update of SPARC BSPs. Includes addition of sis, leon2 and leon3 BSPs, deletion of leon BSP, addition of SMC91111 NIC driver and much more.
-rw-r--r--cpukit/score/cpu/sparc/ChangeLog17
-rw-r--r--cpukit/score/cpu/sparc/cpu.c10
-rw-r--r--cpukit/score/cpu/sparc/cpu_asm.S28
-rw-r--r--cpukit/score/cpu/sparc/rtems/score/cpu.h2
4 files changed, 46 insertions, 11 deletions
diff --git a/cpukit/score/cpu/sparc/ChangeLog b/cpukit/score/cpu/sparc/ChangeLog
index 6cffd53fa2..09f3449aca 100644
--- a/cpukit/score/cpu/sparc/ChangeLog
+++ b/cpukit/score/cpu/sparc/ChangeLog
@@ -1,3 +1,20 @@
+2005-10-05 Jiri Gaisler <jiri@gaisler.com>
+ Edvin Catovic <edvin@gaisler.com>
+ Konrad Eisele <konrad@gaisler.com>
+
+ PR 827/bsps
+ * ChangeLog, cpu.c, cpu_asm.S, rtems/score/cpu.h: Portion of large
+ update of SPARC BSPs. Includes addition of sis, leon2 and leon3 BSPs,
+ deletion of leon BSP, addition of SMC91111 NIC driver and much more.
+
+2004-06-16 Edvin Catovic <edvin@gaisler.com>
+
+ * cpu_asm.S: Added FP context initialization routine
+ _CPU_Context_initialize_fp
+ * cpu.c: Changed FP context initialization.
+ * rtems/score/sparc.h: Defined SPARC_HAS_FPU to be 1 (Non-FP BSPs
+ erc32nfp and leon1 are removed)
+
2004-02-26 Andreas Karlsson <andreas.karlsson@space.se>
604/bsps
diff --git a/cpukit/score/cpu/sparc/cpu.c b/cpukit/score/cpu/sparc/cpu.c
index d0bc7ba8d5..e3b859f408 100644
--- a/cpukit/score/cpu/sparc/cpu.c
+++ b/cpukit/score/cpu/sparc/cpu.c
@@ -53,18 +53,15 @@ void _CPU_Initialize(
void (*thread_dispatch) /* ignored on this CPU */
)
{
-#if (SPARC_HAS_FPU == 1)
void *pointer;
/*
- * This seems to be the most appropriate way to obtain an initial
- * FP context on the SPARC. The NULL fp context is copied it to
+ * FP context is initialized. The NULL fp context is copied it to
* the task's FP context during Context_Initialize.
*/
pointer = &_CPU_Null_fp_context;
- _CPU_Context_save_fp( &pointer );
-#endif
+ _CPU_Context_initialize_fp(pointer);
/*
* Grab our own copy of the user's CPU table.
@@ -316,7 +313,6 @@ void _CPU_Context_Initialize(
tmp_psr |= (new_level << 8) & SPARC_PSR_PIL_MASK;
tmp_psr &= ~SPARC_PSR_EF_MASK; /* disabled by default */
-#if (SPARC_HAS_FPU == 1)
/*
* If this bit is not set, then a task gets a fault when it accesses
* a floating point register. This is a nice way to detect floating
@@ -325,6 +321,6 @@ void _CPU_Context_Initialize(
if ( is_fp )
tmp_psr |= SPARC_PSR_EF_MASK;
-#endif
+
the_context->psr = tmp_psr;
}
diff --git a/cpukit/score/cpu/sparc/cpu_asm.S b/cpukit/score/cpu/sparc/cpu_asm.S
index 357e3dcbd4..201759df38 100644
--- a/cpukit/score/cpu/sparc/cpu_asm.S
+++ b/cpukit/score/cpu/sparc/cpu_asm.S
@@ -23,7 +23,31 @@
#include <asm.h>
-#if (SPARC_HAS_FPU == 1)
+/*
+ * void _CPU_Context_initialize_fp(
+ * void *fp_context_ptr
+ * )
+ *
+ * This routine is responsible for initializing the FP context
+ * at *fp_context_ptr. All registers and FSR in the FP context
+ * are initailized to 0.
+ *
+ */
+
+ .align 4
+ PUBLIC(_CPU_Context_initialize_fp)
+SYM(_CPU_Context_initialize_fp):
+ set 0, %l1
+fpcontextinit:
+ std %g0, [%o0] ! write register fields of the FP context
+ add %l1, 1, %l1
+ cmp %l1, 16
+ bne fpcontextinit
+ add %o0, 8, %o0
+ retl
+ st %g0, [%o0] ! write fsr field of the FP context
+
+
/*
* void _CPU_Context_save_fp(
@@ -123,8 +147,6 @@ SYM(_CPU_Context_restore_fp):
ret
restore
-#endif /* SPARC_HAS_FPU */
-
/*
* void _CPU_Context_switch(
* Context_Control *run,
diff --git a/cpukit/score/cpu/sparc/rtems/score/cpu.h b/cpukit/score/cpu/sparc/rtems/score/cpu.h
index 1efae86666..ff11cfbf85 100644
--- a/cpukit/score/cpu/sparc/rtems/score/cpu.h
+++ b/cpukit/score/cpu/sparc/rtems/score/cpu.h
@@ -154,7 +154,7 @@ extern "C" {
* not provide one.
*/
-#define CPU_PROVIDES_IDLE_THREAD_BODY FALSE
+#define CPU_PROVIDES_IDLE_THREAD_BODY TRUE
/*
* Does the stack grow up (toward higher addresses) or down