dragon-nx32: Move some crt0 parts to discard
authorTormod Volden <debian.tormod@gmail.com>
Thu, 19 May 2016 21:19:16 +0000 (23:19 +0200)
committerAlan Cox <alan@linux.intel.com>
Fri, 20 May 2016 11:55:16 +0000 (12:55 +0100)
Also move init_early() and init_hardware() to discard

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

index 1ee3eca..0186b31 100644 (file)
                .area .start
 
 start:
+               orcc #0x10              ; interrupts definitely off
+               lds #kstack_top         ; note we'll wipe the stack later
                ldb $80FD               ; save from ROM space
-               ; text may be in memory bank 0
+               ; text and discard may be in memory bank 0
                jsr map_kernel
-               jmp main
-
-               .area .text
+               jmp premain
 
-main:          orcc #0x10              ; interrupts definitely off
-               lds #kstack_top
+               .area .discard
 
-               clra
+premain:       clra
                ldx #__sectionbase_.udata__
 udata_wipe:    sta ,x+
                cmpx #__sectionbase_.udata__+__sectionlen_.udata__
@@ -47,6 +46,10 @@ identified:
                sta _system_id          ; what sort of a box are we ?
                jsr init_early
                jsr init_hardware
-               jsr _fuzix_main
-               orcc #0x10
+               jmp main
+
+               .area .text
+
+main           jsr _fuzix_main
+               orcc #0x10              ; we should never get here
 stop:          bra stop
index 7fba7cc..f4dc9f5 100644 (file)
@@ -61,8 +61,6 @@ _bufpool:
 _discard_size:
        .db     __sectionlen_.discard__/BUFSIZE
 
-       .area .text
-
 init_early:
        ldx #null_handler
        stx 1