]> git.proxmox.com Git - mirror_edk2.git/commitdiff
1. Simplified PalCallStatic.s's by removing unnecessary condition testings.
authorbxing <bxing@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 6 Jul 2006 07:46:22 +0000 (07:46 +0000)
committerbxing <bxing@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 6 Jul 2006 07:46:22 +0000 (07:46 +0000)
2. Fixed a logical error in Synchronization.c which caused InterlockedIncrement() and InterlockedDecrement() to hang.
3. Replaced the pseudo-implementation of GetInterruptState() with a real version.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@793 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Library/BaseCacheMaintenanceLib/Ipf/PalCallStatic.s
MdePkg/Library/BaseLib/BaseLib.msa
MdePkg/Library/BaseLib/Ipf/CpuBreakpoint.c
MdePkg/Library/BaseLib/Ipf/GetInterruptState.s [new file with mode: 0644]
MdePkg/Library/BaseLib/Ipf/PalCallStatic.s
MdePkg/Library/BaseLib/Ipf/Synchronization.c
MdePkg/Library/BaseTimerLibLocalApic/Ipf/PalCallStatic.s

index 686383793d250dd852e76b616c110808b354ebef..c21d7427f9b3a48f2d4f0c3a74f26a05abe758a6 100644 (file)
 .type   PalCallStatic, @function\r
 .regstk 5, 0, 0, 0\r
 PalCallStatic::\r
-        cmp.eq              p6 = r0, in0\r
+        cmp.eq              p15 = in0, r0\r
         mov                 r31 = in4\r
         mov                 r8  = ip\r
-(p6)    mov                 in0 = ar.k5\r
-        add                 r8  = (PalProcReturn - PalCallStatic), r8\r
-        mov                 in4 = b0\r
+\r
+(p15)   mov                 in0 = ar.k5\r
+        add                 r8  = (_PalProcReturn - PalCallStatic), r8\r
         mov                 r30 = in3\r
-        mov                 r29 = in2\r
+\r
+        mov                 in4 = psr\r
+        mov                 in3 = b0\r
         mov                 b7  = in0\r
-        mov                 in3 = psr\r
+\r
         rsm                 1 << 14                 // Disable interrupts\r
+        mov                 r29 = in2\r
         mov                 r28 = in1\r
-        mov                 in0 = 256\r
+\r
         mov                 b0  = r8\r
-        br.cond.sptk        b7\r
-PalProcReturn:\r
-        mov                 psr.l = in3\r
-        cmp.eq              p6 = in0, in1           // in1 == PAL_COPY_PAL?\r
-(p6)    cmp.eq              p6 = r0, r8             // Status == Success?\r
-(p6)    add                 in2 = r9, in2\r
-(p6)    mov                 ar.k5 = in2\r
-        mov                 b0  = in4\r
+        br.cond.sptk.many   b7\r
+\r
+_PalProcReturn:\r
+        mov                 psr.l = in4\r
+        mov                 b0  = in3\r
         br.ret.sptk.many    b0\r
 .endp   PalCallStatic\r
index 5e677704a843e991a4d8e396d4714537ce78b9a6..8d7af00fec857a3ef21cd9ed7516f8da13c30f03 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
+<?xml version="1.0" encoding="UTF-8"?>\r
 <ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0">\r
   <MsaHeader>\r
     <ModuleName>BaseLib</ModuleName>\r
     <Filename SupArchList="IPF">Ipf/Synchronization.c</Filename>\r
     <Filename SupArchList="IPF">Ipf/CpuPause.s</Filename>\r
     <Filename SupArchList="IPF">Ipf/CpuFlushTlb.s</Filename>\r
+    <Filename SupArchList="IPF">Ipf/GetInterruptState.s</Filename>\r
     <Filename SupArchList="EBC">Math64.c</Filename>\r
     <Filename SupArchList="EBC">Unaligned.c</Filename>\r
     <Filename SupArchList="EBC">Ebc/SwitchStack.c</Filename>\r
index 478cac8c91414e1dfcbf9b617f8a0dfb72f9eca9..0097d991ebf2ae2bb75b10282672621dc92b79eb 100644 (file)
@@ -97,25 +97,6 @@ EnableInterrupts (
   _enable ();\r
 }\r
 \r
-/**\r
-  Retrieves the current CPU interrupt state.\r
-\r
-  Retrieves the current CPU interrupt state. Returns TRUE is interrupts are\r
-  currently enabled. Otherwise returns FALSE.\r
-\r
-  @retval TRUE  CPU interrupts are enabled.\r
-  @retval FALSE CPU interrupts are disabled.\r
-\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-GetInterruptState (\r
-  VOID\r
-  )\r
-{\r
-  return FALSE;\r
-}\r
-\r
 /**\r
   Enables CPU interrupts for the smallest window required to capture any\r
   pending interrupts.\r
diff --git a/MdePkg/Library/BaseLib/Ipf/GetInterruptState.s b/MdePkg/Library/BaseLib/Ipf/GetInterruptState.s
new file mode 100644 (file)
index 0000000..66eb17f
--- /dev/null
@@ -0,0 +1,27 @@
+/// @file\r
+///   Retrieve of the interrupt state of the running processor for the Itanium\r
+///   architecture.\r
+///\r
+/// Copyright (c) 2006, Intel Corporation\r
+/// All rights reserved. This program and the accompanying materials\r
+/// are licensed and made available under the terms and conditions of the BSD License\r
+/// which accompanies this distribution.  The full text of the license may be found at\r
+/// http://opensource.org/licenses/bsd-license.php\r
+///\r
+/// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+/// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+///\r
+/// Module Name:  GetInterruptState.s\r
+///\r
+///\r
+\r
+.auto\r
+.text\r
+\r
+.proc   GetInterruptState\r
+.type   GetInterruptState, @function\r
+GetInterruptState::\r
+        mov                 r8  = psr\r
+        dep.z               r8  = r8, 14, 1\r
+        br.ret.sptk.many    b0\r
+.endp   GetInterruptState\r
index 686383793d250dd852e76b616c110808b354ebef..c21d7427f9b3a48f2d4f0c3a74f26a05abe758a6 100644 (file)
 .type   PalCallStatic, @function\r
 .regstk 5, 0, 0, 0\r
 PalCallStatic::\r
-        cmp.eq              p6 = r0, in0\r
+        cmp.eq              p15 = in0, r0\r
         mov                 r31 = in4\r
         mov                 r8  = ip\r
-(p6)    mov                 in0 = ar.k5\r
-        add                 r8  = (PalProcReturn - PalCallStatic), r8\r
-        mov                 in4 = b0\r
+\r
+(p15)   mov                 in0 = ar.k5\r
+        add                 r8  = (_PalProcReturn - PalCallStatic), r8\r
         mov                 r30 = in3\r
-        mov                 r29 = in2\r
+\r
+        mov                 in4 = psr\r
+        mov                 in3 = b0\r
         mov                 b7  = in0\r
-        mov                 in3 = psr\r
+\r
         rsm                 1 << 14                 // Disable interrupts\r
+        mov                 r29 = in2\r
         mov                 r28 = in1\r
-        mov                 in0 = 256\r
+\r
         mov                 b0  = r8\r
-        br.cond.sptk        b7\r
-PalProcReturn:\r
-        mov                 psr.l = in3\r
-        cmp.eq              p6 = in0, in1           // in1 == PAL_COPY_PAL?\r
-(p6)    cmp.eq              p6 = r0, r8             // Status == Success?\r
-(p6)    add                 in2 = r9, in2\r
-(p6)    mov                 ar.k5 = in2\r
-        mov                 b0  = in4\r
+        br.cond.sptk.many   b7\r
+\r
+_PalProcReturn:\r
+        mov                 psr.l = in4\r
+        mov                 b0  = in3\r
         br.ret.sptk.many    b0\r
 .endp   PalCallStatic\r
index 9eb8799e30250f311ec63b608c1b1fe48c218763..f09dbd5c00bd69e6fad05cd0def079a9728da66a 100644 (file)
@@ -32,7 +32,7 @@ InternalSyncIncrement (
 \r
   do {\r
     OriginalValue = *Value;\r
-  } while (OriginalValue == InternalSyncCompareExchange32 (\r
+  } while (OriginalValue != InternalSyncCompareExchange32 (\r
                               Value,\r
                               OriginalValue,\r
                               OriginalValue + 1\r
@@ -50,7 +50,7 @@ InternalSyncDecrement (
 \r
   do {\r
     OriginalValue = *Value;\r
-  } while (OriginalValue == InternalSyncCompareExchange32 (\r
+  } while (OriginalValue != InternalSyncCompareExchange32 (\r
                               Value,\r
                               OriginalValue,\r
                               OriginalValue - 1\r
index 686383793d250dd852e76b616c110808b354ebef..c21d7427f9b3a48f2d4f0c3a74f26a05abe758a6 100644 (file)
 .type   PalCallStatic, @function\r
 .regstk 5, 0, 0, 0\r
 PalCallStatic::\r
-        cmp.eq              p6 = r0, in0\r
+        cmp.eq              p15 = in0, r0\r
         mov                 r31 = in4\r
         mov                 r8  = ip\r
-(p6)    mov                 in0 = ar.k5\r
-        add                 r8  = (PalProcReturn - PalCallStatic), r8\r
-        mov                 in4 = b0\r
+\r
+(p15)   mov                 in0 = ar.k5\r
+        add                 r8  = (_PalProcReturn - PalCallStatic), r8\r
         mov                 r30 = in3\r
-        mov                 r29 = in2\r
+\r
+        mov                 in4 = psr\r
+        mov                 in3 = b0\r
         mov                 b7  = in0\r
-        mov                 in3 = psr\r
+\r
         rsm                 1 << 14                 // Disable interrupts\r
+        mov                 r29 = in2\r
         mov                 r28 = in1\r
-        mov                 in0 = 256\r
+\r
         mov                 b0  = r8\r
-        br.cond.sptk        b7\r
-PalProcReturn:\r
-        mov                 psr.l = in3\r
-        cmp.eq              p6 = in0, in1           // in1 == PAL_COPY_PAL?\r
-(p6)    cmp.eq              p6 = r0, r8             // Status == Success?\r
-(p6)    add                 in2 = r9, in2\r
-(p6)    mov                 ar.k5 = in2\r
-        mov                 b0  = in4\r
+        br.cond.sptk.many   b7\r
+\r
+_PalProcReturn:\r
+        mov                 psr.l = in4\r
+        mov                 b0  = in3\r
         br.ret.sptk.many    b0\r
 .endp   PalCallStatic\r