summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/powerpc/psim/startup/bspstart.c
diff options
context:
space:
mode:
authorThomas Doerfler <Thomas.Doerfler@embedded-brains.de>2008-07-11 10:01:37 +0000
committerThomas Doerfler <Thomas.Doerfler@embedded-brains.de>2008-07-11 10:01:37 +0000
commita86f3aac965e39414f19d7e67ed50400583cd598 (patch)
tree24692c56d9b7480af4482d4ac5930d099c3396b1 /c/src/lib/libbsp/powerpc/psim/startup/bspstart.c
parentadded variant to gen68360 BSP (diff)
downloadrtems-a86f3aac965e39414f19d7e67ed50400583cd598.tar.bz2
adapted powerpc BSPs to new exception code
Diffstat (limited to 'c/src/lib/libbsp/powerpc/psim/startup/bspstart.c')
-rw-r--r--c/src/lib/libbsp/powerpc/psim/startup/bspstart.c40
1 files changed, 13 insertions, 27 deletions
diff --git a/c/src/lib/libbsp/powerpc/psim/startup/bspstart.c b/c/src/lib/libbsp/powerpc/psim/startup/bspstart.c
index 77e5cd4c9f..974a220ca6 100644
--- a/c/src/lib/libbsp/powerpc/psim/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/psim/startup/bspstart.c
@@ -14,6 +14,8 @@
* $Id$
*/
+#warning The interrupt disable mask is now stored in SPRG0, please verify that this is compatible to this BSP (see also bootcard.c).
+
#include <string.h>
#include <fcntl.h>
#include <bsp.h>
@@ -27,11 +29,8 @@
#include <libcpu/bat.h>
#include <libcpu/spr.h>
-SPR_RW(SPRG0)
SPR_RW(SPRG1)
-void initialize_exceptions(void);
-
/* On psim, each click of the decrementer register corresponds
* to 1 instruction. By setting this to 100, we are indicating
* that we are assuming it can execute 100 instructions per
@@ -93,8 +92,8 @@ void bsp_get_workarea(
void bsp_start( void )
{
extern unsigned long __rtems_end[];
- register uint32_t intrStack;
- register uint32_t *intrStackPtr;
+ uint32_t intrStackStart;
+ uint32_t intrStackSize;
/*
* Note we can not get CPU identification dynamically, so
@@ -115,32 +114,19 @@ void bsp_start( void )
bsp_exceptions_in_RAM = FALSE;
/*
- * Initialize the interrupt related settings
- * SPRG1 = software managed IRQ stack
- *
- * This could be done latter (e.g in IRQ_INIT) but it helps to understand
- * some settings below...
+ * Initialize the interrupt related settings.
*/
- intrStack = ((uint32_t) __rtems_end) + INIT_STACK_SIZE +
- rtems_configuration_get_interrupt_stack_size() -
- PPC_MINIMUM_STACK_FRAME_SIZE;
-
- /* make sure it's properly aligned */
- intrStack &= ~(CPU_STACK_ALIGNMENT-1);
-
- /* tag the bottom (T. Straumann 6/36/2001 <strauman@slac.stanford.edu>) */
- intrStackPtr = (uint32_t*) intrStack;
- *intrStackPtr = 0;
-
- _write_SPRG1(intrStack);
-
- /* signal them that we have fixed PR288 - eventually, this should go away */
- _write_SPRG0(PPC_BSP_HAS_FIXED_PR288);
+ intrStackStart = (uint32_t) __rtems_end + INIT_STACK_SIZE;
+ intrStackSize = rtems_configuration_get_interrupt_stack_size();
/*
- * Initialize default raw exception handlers. See vectors/vectors_init.c
+ * Initialize default raw exception handlers.
*/
- initialize_exceptions();
+ ppc_exc_initialize(
+ PPC_INTERRUPT_DISABLE_MASK_DEFAULT,
+ intrStackStart,
+ intrStackSize
+ );
/*
* Initalize RTEMS IRQ system