X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=ArmPlatformPkg%2FSec%2FArm%2FHelper.asm;h=0a2baaf19e36c65afa4a3078e43e612098dcdf04;hp=8aa7d7840d56459bab93c7b9a8a149237efe77a2;hb=949973b6c033918489e935869a5d2391e4feacb0;hpb=aaa0820553db9da8dee3ea562942dce89873886d diff --git a/ArmPlatformPkg/Sec/Arm/Helper.asm b/ArmPlatformPkg/Sec/Arm/Helper.asm index 8aa7d7840d..0a2baaf19e 100644 --- a/ArmPlatformPkg/Sec/Arm/Helper.asm +++ b/ArmPlatformPkg/Sec/Arm/Helper.asm @@ -45,10 +45,8 @@ enter_monitor_mode FUNCTION bx r4 ENDFUNC -// We cannot use the instruction 'movs pc, lr' because the caller can be written either in ARM or Thumb2 assembler. -// When we will jump into this function, we will set the CPSR flag to ARM assembler. By copying directly 'lr' into -// 'pc'; we will not change the CPSR flag and it will crash. -// The way to fix this limitation is to do the movs into the ARM assmbler code and then do a 'bx'. +// Return-from-exception is not an interworking return, so we must do it +// in two steps, in case r0 has the Thumb bit set. return_from_exception adr lr, returned_exception movs pc, lr