[rtems commit] bsp/i386: Use interrupt stack for init stack

Sebastian Huber sebh at rtems.org
Wed Nov 14 07:48:02 UTC 2018


Module:    rtems
Branch:    master
Commit:    a13b89bb173728aa66c258ba17f9a8a36bd0aea2
Changeset: http://git.rtems.org/rtems/commit/?id=a13b89bb173728aa66c258ba17f9a8a36bd0aea2

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Nov 14 08:42:22 2018 +0100

bsp/i386: Use interrupt stack for init stack

Update #3459.

---

 bsps/i386/pc386/start/bspgetworkarea.c |  5 +----
 bsps/i386/pc386/start/start.S          | 12 +++---------
 2 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/bsps/i386/pc386/start/bspgetworkarea.c b/bsps/i386/pc386/start/bspgetworkarea.c
index 21cb472..f869c38 100644
--- a/bsps/i386/pc386/start/bspgetworkarea.c
+++ b/bsps/i386/pc386/start/bspgetworkarea.c
@@ -49,15 +49,12 @@ static uintptr_t rtemsWorkAreaStart;
  */
 uint32_t bsp_mem_size = 0;
 
-/* Size of stack used during initialization. Defined in 'start.s'.  */
-extern uint32_t _stack_size;
-
 static void bsp_size_memory(void)
 {
   uintptr_t topAddr;
 
   /* Set the value of start of free memory. */
-  rtemsWorkAreaStart = (uint32_t)WorkAreaBase + _stack_size;
+  rtemsWorkAreaStart = (uint32_t)WorkAreaBase;
 
   /* Align the RTEMS Work Area at beginning of free memory. */
   if (rtemsWorkAreaStart & (CPU_ALIGNMENT - 1))  /* not aligned => align it */
diff --git a/bsps/i386/pc386/start/start.S b/bsps/i386/pc386/start/start.S
index 51cd471..06fd8b2 100644
--- a/bsps/i386/pc386/start/start.S
+++ b/bsps/i386/pc386/start/start.S
@@ -51,8 +51,6 @@
 #error  "Missing header ? CPU_STACK_ALIGNMENT NOT DEFINED"
 #endif
 
-.set STACK_SIZE, 0x1000
-
 /*----------------------------------------------------------------------------+
 | CODE section
 +----------------------------------------------------------------------------*/
@@ -176,9 +174,9 @@ speakl:	jmp	speakl             # and SPIN!!!
 	PUBLIC (_establish_stack)
 SYM (_establish_stack):
 
-	movl	$_end, eax		# eax = end of bss/start of heap
-	addl	$STACK_SIZE, eax	# make room for stack
-	subl    $4,          eax    # reserve room for arg to 'boot_card'
+	movl	$_ISR_Stack_area_begin, eax # eax = end of bss/start of heap
+	addl	$_ISR_Stack_size, eax	# make room for stack
+	subl	$4, eax			# reserve room for arg to 'boot_card'
 	andl	$ - CPU_STACK_ALIGNMENT, eax	# align SP on CPU_STACK_ALIGNMENT boundary
 	movl	eax, esp		# set stack pointer
 	movl	eax, ebp		# set base pointer
@@ -305,10 +303,6 @@ SYM(_boot_multiboot_cmdline):
 	.byte 0
 	.endr
 
-	PUBLIC(_stack_size)
-SYM(_stack_size):
-	.long STACK_SIZE
-
 #ifdef DEBUG_EARLY_START
 
 	PUBLIC (welcome_msg)




More information about the vc mailing list