]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPkg/Drivers/CpuDxe/ExceptionSupport.ARMv6.asm
Update remaining ARM .S files with INTERWORK_FUNC macro. This is the 2nd half of...
[mirror_edk2.git] / ArmPkg / Drivers / CpuDxe / ExceptionSupport.ARMv6.asm
index 3bcca4d6aa69af76e10274965ab4dfb9d52c21cf..a8a477026eeb1636bd949f1ee8a2e72b13fefd58 100644 (file)
@@ -2,9 +2,9 @@
 //
 // Use ARMv6 instruction to operate on a single stack
 //
-// Copyright (c) 2008-2010 Apple Inc. All rights reserved.
+// Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
 //
-// All rights reserved. This program and the accompanying materials
+// This program and the accompanying materials
 // are licensed and made available under the terms and conditions of the BSD License
 // which accompanies this distribution.  The full text of the license may be found at
 // http://opensource.org/licenses/bsd-license.php
@@ -243,6 +243,8 @@ NoAdjustNeeded
                                     ; R0 is ExceptionType 
   mov       R1,SP                   ; R1 is SystemContext 
 
+  vpush    {d0-d15}                  ; save vstm registers in case they are used in optimizations\r
+
 /* 
 VOID
 EFIAPI
@@ -253,6 +255,14 @@ CommonCExceptionHandler (
 
 */
   blx       CommonCExceptionHandler ; Call exception handler
+\r
+  vpop      {d0-d15}\r
+  
+  ldr       R1, [SP, #0x4c]         ; Restore EFI_SYSTEM_CONTEXT_ARM.IFSR
+  mcr       p15, 0, R1, c5, c0, 1   ; Write IFSR
+
+  ldr       R1, [SP, #0x44]         ; sRestore EFI_SYSTEM_CONTEXT_ARM.DFSR
+  mcr       p15, 0, R1, c5, c0, 0   ; Write DFSR
   
   ldr       R1,[SP,#0x3c]           ; EFI_SYSTEM_CONTEXT_ARM.PC
   str       R1,[SP,#0x58]           ; Store it back to srsfd stack slot so it can be restored