mirror of https://github.com/acidanthera/audk.git
ArmPlatformPkg/Sec: Fixed monitor stack setup
The Secure Monitor stack was not when a stack base was not provided by the Secure SVC world. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13126 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
7defe7b354
commit
59a2b365ea
|
@ -24,13 +24,15 @@ GCC_ASM_EXPORT(set_non_secure_mode)
|
|||
# r1: MpId
|
||||
# r2: Secure Monitor mode stack
|
||||
ASM_PFX(enter_monitor_mode):
|
||||
mrs r4, cpsr @ Save current mode (SVC) in r1
|
||||
cmp r2, #0 @ If a Secure Monitor stack base has not been defined then use the Secure stack
|
||||
moveq r2, sp
|
||||
|
||||
mrs r4, cpsr @ Save current mode (SVC) in r4
|
||||
bic r3, r4, #0x1f @ Clear all mode bits
|
||||
orr r3, r3, #0x16 @ Set bits for Monitor mode
|
||||
msr cpsr_cxsf, r3 @ We are now in Monitor Mode
|
||||
|
||||
cmp r2, #0 @ If a Secure Monitor stack base has been passed, used it
|
||||
movne sp, r2 @ Use the passed sp
|
||||
mov sp, r2 @ Set the stack of the Monitor Mode
|
||||
|
||||
mov lr, r0 @ Use the pass entrypoint as lr
|
||||
|
||||
|
|
|
@ -22,13 +22,15 @@
|
|||
// r1: MpId
|
||||
// r2: Secure Monitor mode stack
|
||||
enter_monitor_mode
|
||||
mrs r4, cpsr // Save current mode (SVC) in r1
|
||||
cmp r2, #0 // If a Secure Monitor stack base has not been defined then use the Secure stack
|
||||
moveq r2, sp
|
||||
|
||||
mrs r4, cpsr // Save current mode (SVC) in r4
|
||||
bic r3, r4, #0x1f // Clear all mode bits
|
||||
orr r3, r3, #0x16 // Set bits for Monitor mode
|
||||
msr cpsr_cxsf, r3 // We are now in Monitor Mode
|
||||
|
||||
cmp r2, #0 // If a Secure Monitor stack base has been passed, used it
|
||||
movne sp, r2 // Use the passed sp
|
||||
mov sp, r2 // Set the stack of the Monitor Mode
|
||||
|
||||
mov lr, r0 // Use the pass entrypoint as lr
|
||||
|
||||
|
|
Loading…
Reference in New Issue