From: Eugene Cohen Date: Tue, 10 Sep 2013 10:10:56 +0000 (+0000) Subject: ArmPkg/CpuDxe: Exception Handling SP Adjust X-Git-Tag: edk2-stable201903~12274 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=1bc3923d08d96a1be657aa9b3b331824a48421b8;p=mirror_edk2.git ArmPkg/CpuDxe: Exception Handling SP Adjust The exception handling support code appears to adjust the stack pointer in the wrong direction. It decrements the stack pointer by 0x60, but this should be an increment (add) for the downward-growing stack. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eugene Cohen Reviewed-by: Olivier Martin git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14646 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/ArmPkg/Drivers/CpuDxe/ArmV6/ExceptionSupport.S b/ArmPkg/Drivers/CpuDxe/ArmV6/ExceptionSupport.S index 948ad69946..612ca02c7b 100644 --- a/ArmPkg/Drivers/CpuDxe/ArmV6/ExceptionSupport.S +++ b/ArmPkg/Drivers/CpuDxe/ArmV6/ExceptionSupport.S @@ -242,7 +242,7 @@ NoAdjustNeeded: str R5, [SP, #0x3c] @ Store it in EFI_SYSTEM_CONTEXT_ARM.PC - sub R1, SP, #0x60 @ We pused 0x60 bytes on the stack + add R1, SP, #0x60 @ We pushed 0x60 bytes on the stack str R1, [SP, #0x34] @ Store it in EFI_SYSTEM_CONTEXT_ARM.SP @ R0 is ExceptionType diff --git a/ArmPkg/Drivers/CpuDxe/ArmV6/ExceptionSupport.asm b/ArmPkg/Drivers/CpuDxe/ArmV6/ExceptionSupport.asm index c3f494ae37..780e1f7cd3 100644 --- a/ArmPkg/Drivers/CpuDxe/ArmV6/ExceptionSupport.asm +++ b/ArmPkg/Drivers/CpuDxe/ArmV6/ExceptionSupport.asm @@ -237,7 +237,7 @@ NoAdjustNeeded str R5, [SP, #0x3c] ; Store it in EFI_SYSTEM_CONTEXT_ARM.PC - sub R1, SP, #0x60 ; We pused 0x60 bytes on the stack + add R1, SP, #0x60 ; We pushed 0x60 bytes on the stack str R1, [SP, #0x34] ; Store it in EFI_SYSTEM_CONTEXT_ARM.SP ; R0 is ExceptionType