From: John Hodge Date: Tue, 11 Oct 2011 01:45:03 +0000 (+0800) Subject: Kernel/armv7 - Added IRQ stack, changed IRQs to be disabled until after handling X-Git-Tag: rel0.12~12 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=c865bd1ebd2e33f0477f3f0145acb98786b1cc41;p=tpg%2Facess2.git Kernel/armv7 - Added IRQ stack, changed IRQs to be disabled until after handling --- diff --git a/Kernel/arch/armv7/include/proc.h b/Kernel/arch/armv7/include/proc.h index 1dd9b0f4..4d48f544 100644 --- a/Kernel/arch/armv7/include/proc.h +++ b/Kernel/arch/armv7/include/proc.h @@ -8,6 +8,7 @@ #define _PROC_H_ #define MAX_CPUS 4 +#define USER_MAX 0x80000000 // === STRUCTURES === typedef struct { diff --git a/Kernel/arch/armv7/start.S b/Kernel/arch/armv7/start.S index e2f2d2c2..0ba0c8c3 100644 --- a/Kernel/arch/armv7/start.S +++ b/Kernel/arch/armv7/start.S @@ -36,6 +36,8 @@ _start: mcr p15, 0, r0, c1, c0, 0 @ Prepare for interrupts + cps #18 @ IRQ Mode + ldr sp, =irqstack+0x1000 @ Set up stack cps #19 ldr sp, =stack+0x10000 @ Set up stack @@ -46,6 +48,7 @@ _ptr_kmain: .long kmain .comm stack, 0x10000 @ ; 64KiB Stack +.comm irqstack, 0x1000 @ ; 4KiB Stack SyscallHandler: b . @@ -58,7 +61,7 @@ IRQ_saved_lr: .long 0 IRQHandler: sub lr, #4 @ Adjust LR to the correct value srsdb sp!, #19 @ Switch to supervisor mode (DDI0406B D1.6.5) (actually SRSFD) - cpsie i, #19 + cps #19 PUSH_GPRS @@ -73,6 +76,7 @@ IRQHandler: @ Restore CPU state POP_GPRS + cpsie i rfeia sp! @ Pop state (actually RFEFD) bx lr @@ -80,7 +84,7 @@ IRQHandler: DataAbort: sub lr, #8 @ Adjust LR to the correct value srsdb sp!, #19 @ Switch to supervisor mode (DDI0406B D1.6.5) (actually SRSFD) - cpsie i, #19 + cpsid ifa, #19 PUSH_GPRS mov r2, lr