dragon-nx32: Zero out udata block instead of loading it
authorTormod Volden <debian.tormod@gmail.com>
Thu, 19 May 2016 21:19:15 +0000 (23:19 +0200)
committerAlan Cox <alan@linux.intel.com>
Fri, 20 May 2016 11:55:15 +0000 (12:55 +0100)
Especially handy if the bootloader occupies the area where
the udata block will reside.

Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Kernel/platform-dragon-nx32/commonmem.s
Kernel/platform-dragon-nx32/crt0.s

index 335764d..4e9abfa 100644 (file)
@@ -8,7 +8,7 @@
         .globl istack_top
         .globl istack_switched_sp
 
-        .area .udata
+        .area .udata,bss
 
 _ub:    ; first 512 bytes: starts with struct u_block, with the kernel stack working down from above
 _udata:
index 10ce72f..1ee3eca 100644 (file)
@@ -22,9 +22,13 @@ start:
 main:          orcc #0x10              ; interrupts definitely off
                lds #kstack_top
 
+               clra
+               ldx #__sectionbase_.udata__
+udata_wipe:    sta ,x+
+               cmpx #__sectionbase_.udata__+__sectionlen_.udata__
+               blo udata_wipe
                ldx #__sectionbase_.bss__
                ldy #__sectionlen_.bss__
-               clra
 bss_wipe:      sta ,x+
                leay -1,y
                bne bss_wipe