]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fix bug in UncachedMemoryAllocationLib, Assembler, make DefaultExceptionHandler lib...
authorandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 16 Feb 2010 23:45:42 +0000 (23:45 +0000)
committerandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 16 Feb 2010 23:45:42 +0000 (23:45 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10018 6f19259b-4bc3-4df7-8a09-765794883524

ArmPkg/Drivers/CpuDxe/ExceptionSupport.ARMv6.asm
ArmPkg/Library/ArmDisassemblerLib/ThumbDisassembler.c
ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandler.c
ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.c
ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.inf

index 7411762c722b3c8484aabc1d2cc63bc80a7857d0..6e960133b1ab3ee86ba7b4266ec53f1aaf317e22 100755 (executable)
@@ -229,6 +229,7 @@ AsmCommonExceptionEntry
   
   tst       r1, #0x20               ;   if ((CPSR & T)) == T) {  // Thumb Mode on entry 
   addne     R5, R5, #2              ;     PC += 2;
   
   tst       r1, #0x20               ;   if ((CPSR & T)) == T) {  // Thumb Mode on entry 
   addne     R5, R5, #2              ;     PC += 2;
+  str       R5,[SP,#0x58]           ; Update LR value pused by srsfd 
   
 NoAdjustNeeded
 
   
 NoAdjustNeeded
 
index 8b3132cc99e965ae5b1df0a130010f7281f9f30f..d46a4fa2c38866be7e9912a2dc971c3644bf32a2 100644 (file)
@@ -339,7 +339,7 @@ THUMB_INSTRUCTIONS gOpThumb2[] = {
   { "LDR",   0xf8500800, 0xfff00800,  LDM_REG_IMM8 },           // LDR    <rt>, [<rn>, {, #<imm8>]}\r
   { "LDRBT", 0xf8100e00, 0xfff00f00,  LDM_REG_IMM8 },           // LDRBT  <rt>, [<rn>, {, #<imm8>]}\r
   { "LDRHT", 0xf8300e00, 0xfff00f00,  LDM_REG_IMM8 },           // LDRHT  <rt>, [<rn>, {, #<imm8>]}\r
   { "LDR",   0xf8500800, 0xfff00800,  LDM_REG_IMM8 },           // LDR    <rt>, [<rn>, {, #<imm8>]}\r
   { "LDRBT", 0xf8100e00, 0xfff00f00,  LDM_REG_IMM8 },           // LDRBT  <rt>, [<rn>, {, #<imm8>]}\r
   { "LDRHT", 0xf8300e00, 0xfff00f00,  LDM_REG_IMM8 },           // LDRHT  <rt>, [<rn>, {, #<imm8>]}\r
-  { "LDRSB", 0xf9900800, 0xfff00800,  LDM_REG_IMM8 },           // LDRHT  <rt>, [<rn>, {, #<imm8>]}  {!} form? \r
+  { "LDRSB", 0xf9100800, 0xfff00800,  LDM_REG_IMM8 },           // LDRHT  <rt>, [<rn>, {, #<imm8>]}  {!} form? \r
   { "LDRSBT",0xf9100e00, 0xfff00f00,  LDM_REG_IMM8 },           // LDRHBT <rt>, [<rn>, {, #<imm8>]}  {!} form? \r
   { "LDRSH" ,0xf9300800, 0xfff00800,  LDM_REG_IMM8 },           // LDRSH  <rt>, [<rn>, {, #<imm8>]}  \r
   { "LDRSHT",0xf9300e00, 0xfff00f00,  LDM_REG_IMM8 },           // LDRSHT <rt>, [<rn>, {, #<imm8>]}   \r
   { "LDRSBT",0xf9100e00, 0xfff00f00,  LDM_REG_IMM8 },           // LDRHBT <rt>, [<rn>, {, #<imm8>]}  {!} form? \r
   { "LDRSH" ,0xf9300800, 0xfff00800,  LDM_REG_IMM8 },           // LDRSH  <rt>, [<rn>, {, #<imm8>]}  \r
   { "LDRSHT",0xf9300e00, 0xfff00f00,  LDM_REG_IMM8 },           // LDRSHT <rt>, [<rn>, {, #<imm8>]}   \r
@@ -791,7 +791,6 @@ DisassembleThumbInstruction (
         return;\r
 \r
       case LDM_REG_IMM8:\r
         return;\r
 \r
       case LDM_REG_IMM8:\r
-        ASSERT (FALSE);\r
         // <rt>, [<rn>, {, #<imm8>}]{!}\r
         W = (OpCode32 & BIT8) == BIT8;\r
         U = (OpCode32 & BIT9) == BIT9;\r
         // <rt>, [<rn>, {, #<imm8>}]{!}\r
         W = (OpCode32 & BIT8) == BIT8;\r
         U = (OpCode32 & BIT9) == BIT9;\r
@@ -801,10 +800,10 @@ DisassembleThumbInstruction (
           if ((OpCode32 && 0xff) == 0) {\r
             AsciiSPrint (&Buf[Offset], Size - Offset, "]%a", W?"!":"");\r
           } else {\r
           if ((OpCode32 && 0xff) == 0) {\r
             AsciiSPrint (&Buf[Offset], Size - Offset, "]%a", W?"!":"");\r
           } else {\r
-            AsciiSPrint (&Buf[Offset], Size - Offset, ", #%a0x%x]%a", OpCode32 & 0xff, U?"":"-" , W?"!":"");\r
+            AsciiSPrint (&Buf[Offset], Size - Offset, ", #%a0x%x]%a", U?"":"-" , OpCode32 & 0xff, W?"!":"");\r
           }\r
         } else {\r
           }\r
         } else {\r
-          AsciiSPrint (&Buf[Offset], Size - Offset, "], #%a0x%x]", OpCode32 & 0xff, U?"":"-");\r
+          AsciiSPrint (&Buf[Offset], Size - Offset, "], #%a0x%x", U?"":"-", OpCode32 & 0xff);\r
         }\r
         return;\r
 \r
         }\r
         return;\r
 \r
index e146ac0c4a38cb9ca29e2ba661f43cad7aca842a..927a66b915ab76ac3ad421992261ffc91166599c 100644 (file)
@@ -224,6 +224,7 @@ DefaultExceptionHandler (
   )\r
 {\r
   UINT32    DfsrStatus;\r
   )\r
 {\r
   UINT32    DfsrStatus;\r
+  UINT32    IfsrStatus;\r
   BOOLEAN   DfsrWrite;\r
   UINT32    PcAdjust = 0;\r
 \r
   BOOLEAN   DfsrWrite;\r
   UINT32    PcAdjust = 0;\r
 \r
@@ -289,8 +290,10 @@ DefaultExceptionHandler (
   if (DfsrStatus != 0x00) {\r
     DEBUG ((EFI_D_ERROR, " %a: %a 0x%08x\n", FaultStatusToString (DfsrStatus), DfsrWrite ? "write to" : "read from", SystemContext.SystemContextArm->DFAR));\r
   }\r
   if (DfsrStatus != 0x00) {\r
     DEBUG ((EFI_D_ERROR, " %a: %a 0x%08x\n", FaultStatusToString (DfsrStatus), DfsrWrite ? "write to" : "read from", SystemContext.SystemContextArm->DFAR));\r
   }\r
-  if ((SystemContext.SystemContextArm->IFSR & 0xf) != 0x00) {\r
-    DEBUG ((EFI_D_ERROR, "Instruction %a at 0x%08x, \n", FaultStatusToString (SystemContext.SystemContextArm->IFSR & 0xf), SystemContext.SystemContextArm->IFAR));\r
+\r
+  IfsrStatus = (SystemContext.SystemContextArm->IFSR & 0xf) | ((SystemContext.SystemContextArm->IFSR >> 6) & 0x10);\r
+  if (IfsrStatus != 0) {\r
+    DEBUG ((EFI_D_ERROR, " Instruction %a at 0x%08x\n", FaultStatusToString (SystemContext.SystemContextArm->IFSR & 0xf), SystemContext.SystemContextArm->IFAR));\r
   }\r
 \r
   DEBUG ((EFI_D_ERROR, "\n"));\r
   }\r
 \r
   DEBUG ((EFI_D_ERROR, "\n"));\r
index fa683e19ed23cf4b56b06964f45a09a42e9fdc5c..bf1497daf0877c8b45696e670558981cf974c758 100644 (file)
@@ -609,7 +609,7 @@ UncachedSafeFreePool (
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
-DebugUncachedMemoryAllocationLibConstructor (\r
+UncachedMemoryAllocationLibConstructor (\r
   IN EFI_HANDLE        ImageHandle,\r
   IN EFI_SYSTEM_TABLE  *SystemTable\r
   )\r
   IN EFI_HANDLE        ImageHandle,\r
   IN EFI_SYSTEM_TABLE  *SystemTable\r
   )\r
index 87ff18ce375cec945cd8a0fbd56fe191434f8369..8b596377bd462cf1928c288bf5e2b848fbd9dda7 100644 (file)
@@ -20,6 +20,7 @@
   MODULE_TYPE                    = DXE_DRIVER\r
   VERSION_STRING                 = 1.0\r
   LIBRARY_CLASS                  = UncachedMemoryAllocationLib\r
   MODULE_TYPE                    = DXE_DRIVER\r
   VERSION_STRING                 = 1.0\r
   LIBRARY_CLASS                  = UncachedMemoryAllocationLib\r
+  CONSTRUCTOR                    = UncachedMemoryAllocationLibConstructor\r
 \r
 [Sources.common]\r
   UncachedMemoryAllocationLib.c\r
 \r
 [Sources.common]\r
   UncachedMemoryAllocationLib.c\r
@@ -37,4 +38,5 @@
   MemoryAllocationLib\r
   DxeServicesTableLib\r
 \r
   MemoryAllocationLib\r
   DxeServicesTableLib\r
 \r
-  
\ No newline at end of file
+[Depex]\r
+  gEfiCpuArchProtocolGuid    
\ No newline at end of file