]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Removed duplicate PalCallStatic functions in different libraries. Moved ReadItc and...
authorajfish <ajfish@6f19259b-4bc3-4df7-8a09-765794883524>
Sun, 22 Oct 2006 03:03:45 +0000 (03:03 +0000)
committerajfish <ajfish@6f19259b-4bc3-4df7-8a09-765794883524>
Sun, 22 Oct 2006 03:03:45 +0000 (03:03 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1809 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Include/Library/BaseLib.h
MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.msa
MdePkg/Library/BaseCacheMaintenanceLib/IpfCache.c
MdePkg/Library/BaseLib/BaseLib.msa
MdePkg/Library/BaseLib/Ipf/CpuBreakpoint.c
MdePkg/Library/BaseTimerLibLocalApic/BaseTimerLibLocalApic.msa
MdePkg/Library/BaseTimerLibLocalApic/Ipf/IpfTimerLib.c
MdePkg/Library/BaseTimerLibLocalApic/Ipf/PalCallStatic.s [deleted file]
MdePkg/Library/BaseTimerLibLocalApic/Ipf/ReadItc.s [deleted file]

index c1d1fa09006734c9adb760b3a036b2918700096a..e414e27399b1336ddf9c7ce2e18fcd13576ef9ca 100644 (file)
@@ -5019,4 +5019,88 @@ AsmSwitchStackAndBackingStore (
   IN      VOID                      *NewBsp\r
   );\r
 \r
+typedef struct {\r
+  UINT64                            Status;\r
+  UINT64                            r9;\r
+  UINT64                            r10;\r
+  UINT64                            r11;\r
+} PAL_PROC_RETURN;\r
+\r
+//\r
+// IPF Specific functions\r
+//\r
+\r
+\r
+/**\r
+  Performs a PAL call using static calling convention.\r
+\r
+  An internal function to perform a PAL call using static calling convention.\r
+\r
+  @param  PalEntryPoint The entry point address of PAL. The address in ar.kr5\r
+                        would be used if this parameter were NULL on input.\r
+  @param  Arg1          The first argument of a PAL call.\r
+  @param  Arg1          The second argument of a PAL call.\r
+  @param  Arg1          The third argument of a PAL call.\r
+  @param  Arg1          The fourth argument of a PAL call.\r
+\r
+  @return The values returned in r8, r9, r10 and r11.\r
+\r
+**/\r
+PAL_PROC_RETURN\r
+PalCallStatic (\r
+  IN      CONST VOID                *PalEntryPoint,\r
+  IN      UINT64                    Arg1,\r
+  IN      UINT64                    Arg2,\r
+  IN      UINT64                    Arg3,\r
+  IN      UINT64                    Arg4\r
+  );\r
+\r
+\r
+/**\r
+  Returns the current value of ar.itc.\r
+\r
+  An internal function to return the current value of ar.itc, which is the\r
+  timer tick on IPF.\r
+\r
+  @return The currect value of ar.itc\r
+\r
+**/\r
+INT64\r
+IpfReadItc (\r
+  VOID\r
+  );\r
+\r
+\r
+/**\r
+  Invalidates a range of instruction cache lines in the cache coherency domain\r
+  of the calling CPU.\r
+\r
+  Invalidates the instruction cache lines specified by Address and Length. If\r
+  Address is not aligned on a cache line boundary, then entire instruction\r
+  cache line containing Address is invalidated. If Address + Length is not\r
+  aligned on a cache line boundary, then the entire instruction cache line\r
+  containing Address + Length -1 is invalidated. This function may choose to\r
+  invalidate the entire instruction cache if that is more efficient than\r
+  invalidating the specified range. If Length is 0, the no instruction cache\r
+  lines are invalidated. Address is returned.\r
+\r
+  If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().\r
+\r
+  @param  Address The base address of the instruction cache lines to\r
+                  invalidate. If the CPU is in a physical addressing mode, then\r
+                  Address is a physical address. If the CPU is in a virtual\r
+                  addressing mode, then Address is a virtual address.\r
+\r
+  @param  Length  The number of bytes to invalidate from the instruction cache.\r
+\r
+  @return Address\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+IpfInvalidateInstructionCacheRange (\r
+  IN      VOID                      *Address,\r
+  IN      UINTN                     Length\r
+  );\r
+\r
 #endif\r
index 02ea3701519765ef5eed269cba55a66867e081ad..16d5b20998c809e6f4c22831bf0e24d251ffd803 100644 (file)
@@ -1,19 +1,19 @@
 <?xml version="1.0" encoding="UTF-8"?>\r
-<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0">\r
+<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r
   <MsaHeader>\r
     <ModuleName>BaseCacheMaintenanceLib</ModuleName>\r
     <ModuleType>BASE</ModuleType>\r
     <GuidValue>123dd843-57c9-4158-8418-ce68b3944ce7</GuidValue>\r
     <Version>1.0</Version>\r
     <Abstract>Component description file for Base Cache Maintenance Library</Abstract>\r
-    <Description>Cache Maintenance Library that uses Base Library services to maintain caches.\r
+    <Description>Cache Maintenance Library that uses Base Library services to maintain caches.
     This library assumes there are no chipset dependencies required to maintain caches.</Description>\r
     <Copyright>Copyright (c) 2006, Intel Corporation</Copyright>\r
-    <License>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
-      THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+    <License>All rights reserved. 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
+      THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
       WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.</License>\r
     <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION   0x00000052</Specification>\r
   </MsaHeader>\r
@@ -38,8 +38,6 @@
     <Filename SupArchList="X64">x86Cache.c</Filename>\r
     <Filename SupArchList="EBC">EbcCache.c</Filename>\r
     <Filename SupArchList="IPF">IpfCache.c</Filename>\r
-    <Filename SupArchList="IPF">Ipf/Cpu.s</Filename>\r
-    <Filename SupArchList="IPF">Ipf/PalCallStatic.s</Filename>\r
   </SourceFiles>\r
   <PackageDependencies>\r
     <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
index 7e96d9b76a5d5559e66a8a57dd7d2d41259c8f21..0c6f0e4dc8b195e6ab19a339af8ddfd84a45cfdd 100644 (file)
 \r
 **/\r
 \r
-typedef struct {\r
-  UINT64                            Status;\r
-  UINT64                            r9;\r
-  UINT64                            r10;\r
-  UINT64                            r11;\r
-} PAL_PROC_RETURN;\r
-\r
-PAL_PROC_RETURN\r
-PalCallStatic (\r
-  IN      CONST VOID                *PalEntryPoint,\r
-  IN      UINT64                    Arg1,\r
-  IN      UINT64                    Arg2,\r
-  IN      UINT64                    Arg3,\r
-  IN      UINT64                    Arg4\r
-  );\r
 \r
 /**\r
   Invalidates the entire instruction cache in cache coherency domain of the\r
@@ -45,6 +30,41 @@ InvalidateInstructionCache (
   PalCallStatic (NULL, 1, 1, 1, 0);\r
 }\r
 \r
+/**\r
+  Invalidates a range of instruction cache lines in the cache coherency domain\r
+  of the calling CPU.\r
+\r
+  Invalidates the instruction cache lines specified by Address and Length. If\r
+  Address is not aligned on a cache line boundary, then entire instruction\r
+  cache line containing Address is invalidated. If Address + Length is not\r
+  aligned on a cache line boundary, then the entire instruction cache line\r
+  containing Address + Length -1 is invalidated. This function may choose to\r
+  invalidate the entire instruction cache if that is more efficient than\r
+  invalidating the specified range. If Length is 0, the no instruction cache\r
+  lines are invalidated. Address is returned.\r
+\r
+  If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().\r
+\r
+  @param  Address The base address of the instruction cache lines to\r
+                  invalidate. If the CPU is in a physical addressing mode, then\r
+                  Address is a physical address. If the CPU is in a virtual\r
+                  addressing mode, then Address is a virtual address.\r
+\r
+  @param  Length  The number of bytes to invalidate from the instruction cache.\r
+\r
+  @return Address\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+InvalidateInstructionCacheRange (\r
+  IN      VOID                      *Address,\r
+  IN      UINTN                     Length\r
+  )\r
+{\r
+  return IpfInvalidateInstructionCacheRange (Address, Length);\r
+}\r
+\r
 /**\r
   Writes Back and Invalidates the entire data cache in cache coherency domain\r
   of the calling CPU.\r
index 5d24dcf425c8b9524c78821a92a608aa3c33811f..52dbf7304a0198d7b6c572e85ee330bfbef3625d 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
+<?xml version="1.0" encoding="UTF-8"?>\r
 <!--\r
 Copyright (c) 2006, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
@@ -425,6 +425,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     <Filename SupArchList="IPF">Ipf/CpuFlushTlb.s</Filename>\r
     <Filename SupArchList="IPF">Ipf/GetInterruptState.s</Filename>\r
     <Filename SupArchList="IPF">Ipf/Non-existing.c</Filename>\r
+    <Filename SupArchList="IPF">Ipf/InvalidateInstructionCacheRange.s</Filename>\r
+    <Filename SupArchList="IPF">Ipf/ReadItc.s</Filename>\r
     \r
     <Filename SupArchList="EBC">Math64.c</Filename>\r
     <Filename SupArchList="EBC">Unaligned.c</Filename>\r
index 0097d991ebf2ae2bb75b10282672621dc92b79eb..49bd06b8c2a3063cc9b03b5e701a1b644531ccc2 100644 (file)
 #pragma intrinsic (__break)\r
 #pragma intrinsic (__mfa)\r
 \r
-typedef struct {\r
-  UINT64                            Status;\r
-  UINT64                            r9;\r
-  UINT64                            r10;\r
-  UINT64                            r11;\r
-} PAL_PROC_RETURN;\r
-\r
-PAL_PROC_RETURN\r
-PalCallStatic (\r
-  IN      CONST VOID                *PalEntryPoint,\r
-  IN      UINT64                    Arg1,\r
-  IN      UINT64                    Arg2,\r
-  IN      UINT64                    Arg3,\r
-  IN      UINT64                    Arg4\r
-  );\r
 \r
 /**\r
   Generates a breakpoint on the CPU.\r
index 144a6f19bd9ed260bcf8d07af0111afa832043b9..f24d6daabed29ebcf36ab1abc809dd1ee555fde4 100644 (file)
@@ -1,19 +1,19 @@
 <?xml version="1.0" encoding="UTF-8"?>\r
-<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0">\r
+<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r
   <MsaHeader>\r
     <ModuleName>BaseTimerLibLocalApic</ModuleName>\r
     <ModuleType>BASE</ModuleType>\r
     <GuidValue>b5a05743-9b71-489b-a0ed-a0eb3950d23b</GuidValue>\r
     <Version>1.0</Version>\r
     <Abstract>Component description file for Baser Timer Library</Abstract>\r
-    <Description>Timer Library that only uses CPU resources to provide calibrated\r
+    <Description>Timer Library that only uses CPU resources to provide calibrated
       delays on IA-32 and x64.</Description>\r
     <Copyright>Copyright (c) 2006, Intel Corporation.</Copyright>\r
-    <License>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
-      THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+    <License>All rights reserved. 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
+      THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
       WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.</License>\r
     <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION   0x00000052</Specification>\r
   </MsaHeader>\r
@@ -39,8 +39,6 @@
   <SourceFiles>\r
     <Filename SupArchList="IA32">x86TimerLib.c</Filename>\r
     <Filename SupArchList="X64">x86TimerLib.c</Filename>\r
-    <Filename SupArchList="IPF">Ipf/PalCallStatic.s</Filename>\r
-    <Filename SupArchList="IPF">Ipf/ReadItc.s</Filename>\r
     <Filename SupArchList="IPF">Ipf/IpfTimerLib.c</Filename>\r
     <Filename SupArchList="EBC">Ebc/EbcTimerLib.c</Filename>\r
   </SourceFiles>\r
index 12803d9fa4120a858a0342032f7636573540d284..65b58bc54945ec96ff2187c5ad50020505ef2fcf 100644 (file)
 \r
 **/\r
 \r
-typedef struct {\r
-  UINT64                            Status;\r
-  UINT64                            r9;\r
-  UINT64                            r10;\r
-  UINT64                            r11;\r
-} PAL_PROC_RETURN;\r
 \r
-/**\r
-  Performs a PAL call using static calling convention.\r
-\r
-  An internal function to perform a PAL call using static calling convention.\r
-\r
-  @param  PalEntryPoint The entry point address of PAL. The address in ar.kr5\r
-                        would be used if this parameter were NULL on input.\r
-  @param  Arg1          The first argument of a PAL call.\r
-  @param  Arg1          The second argument of a PAL call.\r
-  @param  Arg1          The third argument of a PAL call.\r
-  @param  Arg1          The fourth argument of a PAL call.\r
-\r
-  @return The values returned in r8, r9, r10 and r11.\r
-\r
-**/\r
-PAL_PROC_RETURN\r
-PalCallStatic (\r
-  IN      CONST VOID                *PalEntryPoint,\r
-  IN      UINT64                    Arg1,\r
-  IN      UINT64                    Arg2,\r
-  IN      UINT64                    Arg3,\r
-  IN      UINT64                    Arg4\r
-  );\r
 \r
-/**\r
-  Returns the current value of ar.itc.\r
-\r
-  An internal function to return the current value of ar.itc, which is the\r
-  timer tick on IPF.\r
-\r
-  @return The currect value of ar.itc\r
-\r
-**/\r
-INT64\r
-InternalIpfReadItc (\r
-  VOID\r
-  );\r
 \r
 /**\r
   Performs a delay measured as number of ticks.\r
@@ -83,14 +41,14 @@ InternalIpfDelay (
   //\r
   // The target timer count is calculated here\r
   //\r
-  Ticks = InternalIpfReadItc () + Delay;\r
+  Ticks = IpfReadItc () + Delay;\r
 \r
   //\r
   // Wait until time out\r
   // Delay > 2^63 could not be handled by this function\r
   // Timer wrap-arounds are handled correctly by this function\r
   //\r
-  while (Ticks - InternalIpfReadItc () >= 0);\r
+  while (Ticks - IpfReadItc () >= 0);\r
 }\r
 \r
 /**\r
@@ -159,7 +117,7 @@ GetPerformanceCounter (
   VOID\r
   )\r
 {\r
-  return InternalIpfReadItc ();\r
+  return IpfReadItc ();\r
 }\r
 \r
 /**\r
diff --git a/MdePkg/Library/BaseTimerLibLocalApic/Ipf/PalCallStatic.s b/MdePkg/Library/BaseTimerLibLocalApic/Ipf/PalCallStatic.s
deleted file mode 100644 (file)
index c21d742..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/// @file\r
-///   Contains an implementation of CallPalProcStatic on Itanium-based\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:  PalCallStatic.s\r
-///\r
-///\r
-\r
-.auto\r
-.text\r
-\r
-.proc   PalCallStatic\r
-.type   PalCallStatic, @function\r
-.regstk 5, 0, 0, 0\r
-PalCallStatic::\r
-        cmp.eq              p15 = in0, r0\r
-        mov                 r31 = in4\r
-        mov                 r8  = ip\r
-\r
-(p15)   mov                 in0 = ar.k5\r
-        add                 r8  = (_PalProcReturn - PalCallStatic), r8\r
-        mov                 r30 = in3\r
-\r
-        mov                 in4 = psr\r
-        mov                 in3 = b0\r
-        mov                 b7  = in0\r
-\r
-        rsm                 1 << 14                 // Disable interrupts\r
-        mov                 r29 = in2\r
-        mov                 r28 = in1\r
-\r
-        mov                 b0  = r8\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
diff --git a/MdePkg/Library/BaseTimerLibLocalApic/Ipf/ReadItc.s b/MdePkg/Library/BaseTimerLibLocalApic/Ipf/ReadItc.s
deleted file mode 100644 (file)
index ea94b67..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/// @file\r
-///   Contains an implementation of InternalIpfReadItc () on Itanium-based\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:  ReadItc.s\r
-///\r
-///\r
-\r
-.auto\r
-.text\r
-\r
-.proc   InternalIpfReadItc\r
-.type   InternalIpfReadItc, @function\r
-InternalIpfReadItc::\r
-        mov                 r8  = ar.itc\r
-        br.ret.sptk.many    b0\r
-.endp   InternalIpfReadItc\r