This is the mail archive of the ecos-patches@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

ARM architecture HAL fix


This fixes a very old bug in the ARM architecture HAL.


Index: ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/arch/current/ChangeLog,v
retrieving revision 1.114
diff -u -5 -r1.114 ChangeLog
--- ChangeLog	2 Feb 2009 19:02:40 -0000	1.114
+++ ChangeLog	9 Feb 2009 15:31:31 -0000
@@ -1,5 +1,15 @@
+2009-02-09  Nick Garnett  <nickg@ecoscentric.com>
+
+	* src/vectors.S (start): The loop to initialize BSS was using a
+	BLS to terminate. This caused an extra zero to be stored beyond
+	the end of __bss_end. Usually this is benign, but when __bss_end
+	is at the very top of RAM, and the hardware generates an exception
+	for illegal accesses, this can crash the program before it even
+	starts. The fix is to use a BLT instructions which will terminate
+	the loop 1 word earlier.
+
 2009-02-02  Bart Veer  <bartv@ecoscentric.com>
 
 	* cdl/hal_arm.cdl: add new architectural CFLAGS and LDFLAGS
 	options.
 
Index: src/vectors.S
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/arch/current/src/vectors.S,v
retrieving revision 1.59
diff -u -5 -r1.59 vectors.S
--- src/vectors.S	29 Jan 2009 17:48:55 -0000	1.59
+++ src/vectors.S	9 Feb 2009 15:31:31 -0000
@@ -448,11 +448,11 @@
         mov     r0,#0
         cmp     r1,r2
         beq     2f
 1:      str     r0,[r1],#4
         cmp     r1,r2
-        bls     1b
+        blt     1b
 2:
 
         // Run kernel + application in THUMB mode
         THUMB_MODE(r1,10)
 



-- 
Nick Garnett                                        eCos Kernel Architect
eCosCentric Limited    http://www.eCosCentric.com        The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
Registered in England and Wales:                          Reg No: 4422071
Besuchen Sie uns vom 3.-5.03.09 auf der Embedded World 2009, Stand 11-300
Visit us at Embedded World 2009, NÃrnberg, Germany, 3-5 Mar, Stand 11-300


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]