DRAM_END EQU 0x0c800000
AREA RamData, DATA, READWRITE
^ (DRAM_END - 0x800)
UserStack # 256
SVCStack # 256
UndefStack # 256
AbortStack # 256
IRQStack # 256
FIQStack # 256
EXPORT UserStack
EXPORT SVCStack
EXPORT UndefStack
EXPORT AbortStack
EXPORT IRQStack
EXPORT FIQStack
MAP (DRAM_END - 0x100)
SysRstVector # 4
UdfInsVector # 4
SwiSvcVector # 4
InsAbtVector # 4
DatAbtVector # 4
ReservedVector # 4
IrqSvcVector # 4
FiqSvcVector # 4
EXPORT SysRstVector
EXPORT UdfInsVector
EXPORT SwiSvcVector
EXPORT InsAbtVector
EXPORT DatAbtVector
EXPORT ReservedVector
EXPORT IrqSvcVector
EXPORT FiqSvcVector
;****************************************************
;初始化堆栈
;Do not use DRAM,such as stmfd,ldmfd......
;SVCstack is initialized before
;Under toolkit ver 2.50, 'msr cpsr,r1' can be used instead of 'msr cpsr_cxsf,r1'
mrs r0, cpsr
bic r0, r0, #(MODEMASK|NOINT)
orr r1, r0, #UNDEFMODE|NOINT
msr cpsr_cxsf, r1 ;UndefMode
ldr sp, =UndefStack
orr r1, r0, #ABORTMODE|NOINT
msr cpsr_cxsf, r1 ;AbortMode
ldr sp, =AbortStack
orr r1, r0, #IRQMODE|NOINT
msr cpsr_cxsf, r1 ;IRQMode
ldr sp, =IRQStack
orr r1, r0, #FIQMODE|NOINT
msr cpsr_cxsf, r1 ;FIQMode
ldr sp, =FIQStack
orr r1, r0, #SVCMODE ;enable irq,fiq
; orr r1, r0, #SVCMODE|NOINT ;disable irq, fiq
msr cpsr_cxsf,r1 ;SVCMode
ldr sp, =SVCStack
;USER mode is not initialized.
;未初始化用户模式栈,程序使用SVC模式
;****************************************************
按照这个初始代码,我是不是还可以给用户模式的堆栈再分配256字节的堆栈空间吗???只需要改成UserStack # 512 就好了吗??
我程序的嵌套比较深,怕堆栈不够。 |