]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPlatformPkg/Sec/Arm/Helper.asm
ArmPlatformPkg/Sec: fix return_from_exception code and comment
[mirror_edk2.git] / ArmPlatformPkg / Sec / Arm / Helper.asm
index 8aa7d7840d56459bab93c7b9a8a149237efe77a2..0a2baaf19e36c65afa4a3078e43e612098dcdf04 100644 (file)
@@ -45,10 +45,8 @@ enter_monitor_mode FUNCTION
     bx      r4\r
     ENDFUNC\r
 \r
     bx      r4\r
     ENDFUNC\r
 \r
-// We cannot use the instruction 'movs pc, lr' because the caller can be written either in ARM or Thumb2 assembler.\r
-// When we will jump into this function, we will set the CPSR flag to ARM assembler. By copying directly 'lr' into\r
-// 'pc'; we will not change the CPSR flag and it will crash.\r
-// The way to fix this limitation is to do the movs into the ARM assmbler code and then do a 'bx'.\r
+// Return-from-exception is not an interworking return, so we must do it\r
+// in two steps, in case r0 has the Thumb bit set.\r
 return_from_exception\r
     adr     lr, returned_exception\r
     movs    pc, lr\r
 return_from_exception\r
     adr     lr, returned_exception\r
     movs    pc, lr\r