Kernel/armv7 - Hack to prevent two multiple running _start
[tpg/acess2.git] / KernelLand / Kernel / arch / armv7 / start.S
index 71534f5..1fe0fd8 100644 (file)
@@ -16,8 +16,17 @@ ivt_unused:  b .             @ 0x14 Not Used
 ivt_irq:       b IRQHandler    @ 0x18 IRQ
 ivt_fiq:       b .             @ 0x1C FIQ (Fast interrupt)
 
+init_lock:     .long 0
+
+.extern SHORTLOCK
 .globl _start
 _start:
+       ldr r1, =init_lock
+       mov r0, #1
+       swp r0, r0, [r1]
+       tst r0,r0
+       bne .smp_halt
+       
        ldr r2, =UART0_PADDR
        mov r1, #'A'
        str r1, [r2]    
@@ -67,13 +76,17 @@ _start:
        @
        mrc p15, 0, r0, c0, c1, 1
        and r0, #0xF0
+       beq .no_sec_ext
        @ - Present
-       ldrne r0,=KERNEL_BASE
-       mcrne p15, 0, r0, c12, c0, 0    @ Set the VBAR (brings exceptions into high memory)
+       ldr r0,=KERNEL_BASE
+       mcr p15, 0, r0, c12, c0, 0      @ Set the VBAR (brings exceptions into high memory)
+       b .exceptions_vectored
+.no_sec_ext:
        @ - Absent
-       mrceq p15, 0, r0, c1, c0, 0     @ Set SCTLR.V
-       orreq r0, #0x2000
-       mcreq p15, 0, r0, c1, c0, 0
+       mrc p15, 0, r0, c1, c0, 0       @ Set SCTLR.V
+       orr r0, #0x2000
+       mcr p15, 0, r0, c1, c0, 0
+.exceptions_vectored:
 
        mov r1, #'-'
        str r1, [r2]    
@@ -112,6 +125,8 @@ _start:
        ldr r0, =kmain
        mov pc, r0
 1:     b 1b    @ Infinite loop
+.smp_halt:
+1:     b 1b
 
 .comm irqstack, 0x1000 @ ; 4KiB Stack
 .comm abortstack, 0x1000       @ ; 4KiB Stack

UCC git Repository :: git.ucc.asn.au