2008-09-19 Joel Sherrill <joel.sherrill@oarcorp.com>

* shared/start/start.S, shared/startup/bspgetworkarea.c,
	shared/startup/bspstart.c, shared/startup/linkcmds: Modifications
	which reflect those tested on psim. Hopefully they work on all
	boards. The initialization stack is explicitly declared in the
	linkcmds memory layout rather than magic math.
This commit is contained in:
Joel Sherrill
2008-09-19 20:41:36 +00:00
parent af2eb770c7
commit 7a2125ca39
5 changed files with 27 additions and 23 deletions
+8
View File
@@ -1,3 +1,11 @@
2008-09-19 Joel Sherrill <joel.sherrill@oarcorp.com>
* shared/start/start.S, shared/startup/bspgetworkarea.c,
shared/startup/bspstart.c, shared/startup/linkcmds: Modifications
which reflect those tested on psim. Hopefully they work on all
boards. The initialization stack is explicitly declared in the
linkcmds memory layout rather than magic math.
2008-09-16 Joel Sherrill <joel.sherrill@oarcorp.com>
* shared/include/nvram.h: Fix typo.
@@ -105,8 +105,8 @@ enter_C_code:
/*
* stack = &__rtems_end + 4096
*/
addis r9,r0, __rtems_end+(4096-PPC_MINIMUM_STACK_FRAME_SIZE)@ha
addi r9,r9, __rtems_end+(4096-PPC_MINIMUM_STACK_FRAME_SIZE)@l
addis r9,r0, __stack-PPC_MINIMUM_STACK_FRAME_SIZE@ha
addi r9,r9, __stack-PPC_MINIMUM_STACK_FRAME_SIZE@l
mr r1, r9
/*
* We are now in a environment that is totally independent from
@@ -29,14 +29,24 @@ void bsp_get_work_area(
uintptr_t reserve;
uintptr_t spared;
reserve = (uintptr_t)BSP_INIT_STACK_SIZE;
reserve += rtems_configuration_get_interrupt_stack_size();
size = (uintptr_t)BSP_mem_size - (uintptr_t)&__rtems_end + reserve;
reserve = rtems_configuration_get_interrupt_stack_size();
size = (uintptr_t)BSP_mem_size - (uintptr_t)&__rtems_end - reserve;
*work_area_start = (void *)(&__rtems_end + reserve);
*work_area_start = (void *)((uintptr_t) &__rtems_end + reserve);
*work_area_size = size;
spared = _bsp_sbrk_init( *work_area_start, work_area_size );
*heap_start = BSP_BOOTCARD_HEAP_USES_WORK_AREA;
*heap_size = BSP_BOOTCARD_HEAP_SIZE_DEFAULT;
/*
* The following may be helpful in debugging what goes wrong when
* you are allocating the Work Area in a new BSP.
*/
#if 0
printk( "Work Area Base %d %x\n", *work_area_start, *work_area_start );
printk( "Work Area Size %d %x\n", *work_area_size, *work_area_size );
printk( "Work Area End %d %x\n",
*work_area_start + size, *work_area_start + size );
#endif
}
@@ -87,10 +87,6 @@ unsigned int BSP_processor_frequency;
* Time base divisior (how many tick for 1 second).
*/
unsigned int BSP_time_base_divisor;
/*
* system init stack
*/
#define INIT_STACK_SIZE 0x1000
void BSP_panic(char *s)
{
@@ -143,7 +139,6 @@ unsigned int get_eumbbar(void) {
void bsp_start( void )
{
unsigned char *stack;
#if !defined(mvme2100)
unsigned l2cr;
#endif
@@ -211,21 +206,10 @@ void bsp_start( void )
set_L2CR(0xb9A14000);
#endif
/*
* the initial stack has aready been set to this value in start.S
* so there is no need to set it in r1 again... It is just for info
* so that It can be printed without accessing R1.
*/
stack = ((unsigned char*) __rtems_end) +
INIT_STACK_SIZE - PPC_MINIMUM_STACK_FRAME_SIZE;
/* tag the bottom (T. Straumann 6/36/2001 <strauman@slac.stanford.edu>) */
*((uint32_t*)stack) = 0;
/*
* Initialize the interrupt related settings.
*/
intrStackStart = (uint32_t) __rtems_end + INIT_STACK_SIZE;
intrStackStart = (uint32_t) __rtems_end;
intrStackSize = rtems_configuration_get_interrupt_stack_size();
/*
@@ -224,6 +224,8 @@ _SDA_BASE_ = __SDATA_START__ + 0x8000;
PROVIDE (__bss_end = .);
} > CODE
. = ALIGN(16);
. += 0x1000;
__stack = .;
_end = . ;
__rtems_end = . ;
PROVIDE (end = .);