Fix of missing initialize stack for UNDEF exception in the RTEMS ARM BSPs startup...
authorPavel Pisa <pisa@cmp.felk.cvut.cz>
Mon, 26 Dec 2005 22:29:59 +0000 (23:29 +0100)
committerPavel Pisa <pi@thor.(none)>
Sat, 28 Nov 2009 23:29:46 +0000 (00:29 +0100)
This omission prevented debugger stubs to work.

darcs-hash:20051226222959-ff715-b0a47c8392d42ad04dfe168895891cea10803f6d.gz

rtems-patches/rtems-csb336-undef-stack.patch [new file with mode: 0644]
rtems-patches/series

diff --git a/rtems-patches/rtems-csb336-undef-stack.patch b/rtems-patches/rtems-csb336-undef-stack.patch
new file mode 100644 (file)
index 0000000..7826105
--- /dev/null
@@ -0,0 +1,43 @@
+Index: rtems-051009/c/src/lib/libbsp/arm/csb336/start/start.S
+===================================================================
+--- rtems-051009.orig/c/src/lib/libbsp/arm/csb336/start/start.S
++++ rtems-051009/c/src/lib/libbsp/arm/csb336/start/start.S
+@@ -72,6 +72,13 @@ _bss_init:        
+         ldr     sp, =_abt_stack
+         add     sp, sp, r1
+         
++        /* Enter UNDEF mode and set up the UNDEF stack pointer */
++        mov     r0, #(PSR_MODE_UNDEF | PSR_I | PSR_F)     /* No interrupts */
++        msr     cpsr, r0
++        ldr     r1, =_undef_stack_size
++        ldr     sp, =_undef_stack
++        add     sp, sp, r1
++        
+         /* Set up the SVC stack pointer last and stay in SVC mode */
+         mov     r0, #(PSR_MODE_SVC | PSR_I | PSR_F)     /* No interrupts */
+         msr     cpsr, r0
+Index: rtems-051009/c/src/lib/libbsp/arm/csb336/startup/linkcmds
+===================================================================
+--- rtems-051009.orig/c/src/lib/libbsp/arm/csb336/startup/linkcmds
++++ rtems-051009/c/src/lib/libbsp/arm/csb336/startup/linkcmds
+@@ -33,7 +33,8 @@ _sdram_size = DEFINED(_sdram_size) ? _sd
+ _irq_stack_size = DEFINED(_irq_stack_size) ? _irq_stack_size : 0x1000;
+ _fiq_stack_size = DEFINED(_fiq_stack_size) ? _fiq_stack_size : 0x400;
+-_abt_stack_size = DEFINED(_abt_stack_size) ? _abt_stack_size : 0x100;
++_abt_stack_size = DEFINED(_abt_stack_size) ? _abt_stack_size : 0x400;
++_undef_stack_size = DEFINED(_undef_stack_size) ? _undef_stack_size : 0x400;
+ _svc_stack_size = DEFINED(_svc_stack_size) ? _svc_stack_size : 0x1000;
+@@ -167,6 +168,10 @@ SECTIONS
+       . += _abt_stack_size;
+       . = ALIGN (256);
++      _undef_stack = .;
++      . += _undef_stack_size;
++
++      . = ALIGN (256);
+       _irq_stack = .;
+       . += _irq_stack_size;
index 08c96d3..6b3af8e 100644 (file)
@@ -13,3 +13,4 @@ rtems-ec555-add-to-configs.patch
 rtems-update-ss555-to-ec555.patch
 rtems-update-ss555-to-ec555-cpld-remove.patch
 rtems-arm-more-abort-info.patch
+rtems-csb336-undef-stack.patch