]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Updated the Runtime Driver to use the MDE libs for cache flush and removed local...
authorajfish <ajfish@6f19259b-4bc3-4df7-8a09-765794883524>
Sun, 22 Oct 2006 07:32:16 +0000 (07:32 +0000)
committerajfish <ajfish@6f19259b-4bc3-4df7-8a09-765794883524>
Sun, 22 Oct 2006 07:32:16 +0000 (07:32 +0000)
Cleaned up BaseLib IPF cache routines to only Flush ranges when needed and not to flush the entire cache.

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

EdkModulePkg/EdkModulePkg.fpd
EdkModulePkg/Include/Library/EdkDxeSalLib.h
EdkModulePkg/Library/EdkDxeSalLib/EdkDxeSalLib.msa
EdkModulePkg/Universal/Runtime/RuntimeDxe/Runtime.c
EdkModulePkg/Universal/Runtime/RuntimeDxe/Runtime.h
EdkModulePkg/Universal/Runtime/RuntimeDxe/Runtime.msa
EdkNt32Pkg/Nt32.fpd
MdePkg/Include/Library/BaseLib.h
MdePkg/Library/BaseCacheMaintenanceLib/IpfCache.c
MdePkg/Library/BaseLib/BaseLib.msa

index d171610da4af28eb583597febbf348d70228610a..4ccad88df28014047f0f6dd39e19193b0dae2c98 100644 (file)
     </ModuleSA>\r
     <ModuleSA SupArchList="IA32" PackageGuid="68169ab0-d41b-4009-9060-292c253ac43d" ModuleGuid="B601F8C4-43B7-4784-95B1-F4226CB40CEE">\r
       <Libraries>\r
+        <Instance ModuleGuid="123dd843-57c9-4158-8418-ce68b3944ce7" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
         <Instance ModuleGuid="19cbbb97-ff61-45ff-8c3f-dfa66dd118c8" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
         <Instance ModuleGuid="ff5c7a2c-ab7a-4366-8616-11c6e53247b6" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
         <Instance ModuleGuid="27d67720-ea68-48ae-93da-a3a074c90e30" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
     </ModuleSA>\r
     <ModuleSA SupArchList="X64" PackageGuid="68169ab0-d41b-4009-9060-292c253ac43d" ModuleGuid="B601F8C4-43B7-4784-95B1-F4226CB40CEE">\r
       <Libraries>\r
+        <Instance ModuleGuid="123dd843-57c9-4158-8418-ce68b3944ce7" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
         <Instance ModuleGuid="19cbbb97-ff61-45ff-8c3f-dfa66dd118c8" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
         <Instance ModuleGuid="ff5c7a2c-ab7a-4366-8616-11c6e53247b6" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
         <Instance ModuleGuid="27d67720-ea68-48ae-93da-a3a074c90e30" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
     </ModuleSA>\r
     <ModuleSA SupArchList="IPF" PackageGuid="68169ab0-d41b-4009-9060-292c253ac43d" ModuleGuid="B601F8C4-43B7-4784-95B1-F4226CB40CEE">\r
       <Libraries>\r
+        <Instance ModuleGuid="123dd843-57c9-4158-8418-ce68b3944ce7" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
         <Instance ModuleGuid="19cbbb97-ff61-45ff-8c3f-dfa66dd118c8" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
         <Instance ModuleGuid="ff5c7a2c-ab7a-4366-8616-11c6e53247b6" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
         <Instance ModuleGuid="27d67720-ea68-48ae-93da-a3a074c90e30" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
index d5fe5ed141297422b67286333a947bbeff96afbf..1a37e97cda9fee684b8a2f7425b3f3ce4fe89fd2 100644 (file)
@@ -137,12 +137,5 @@ GetEsalEntryPoint (
   )\r
 ;\r
 \r
-VOID\r
-EFIAPI\r
-SalFlushCache (\r
-  IN EFI_PHYSICAL_ADDRESS  Start,\r
-  IN UINT64                Length\r
-  )\r
-;\r
 \r
 #endif\r
index dcb07b578b63bccccfca02f26508acdf1e01e8af..a2e51f09617c35dcd3e2c5d88dd787da68019f2a 100644 (file)
@@ -35,7 +35,6 @@
   <SourceFiles>\r
     <Filename SupArchList="IPF">Ipf/EsalServiceLib.c</Filename>\r
     <Filename SupArchList="IPF">Ipf/AsmEsalServiceLib.s</Filename>\r
-    <Filename SupArchList="IPF">Ipf/AsmIpfCpuCache.s</Filename>\r
   </SourceFiles>\r
   <PackageDependencies>\r
     <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
index f3899bc8e19e03a767ad6cc286c8c103e5dfc4f3..61dbd9c1fc6c842338c7ff4b30a0fbcaa859669d 100644 (file)
@@ -468,7 +468,7 @@ RuntimeDriverSetVirtualAddressMap (
         RuntimeImage->RelocationData\r
         );\r
       \r
-      FlushCpuCache (RuntimeImage->ImageBase, (UINT64)RuntimeImage->ImageSize);\r
+      InvalidateInstructionCacheRange ((VOID *)(UINTN)RuntimeImage->ImageBase, (UINTN)RuntimeImage->ImageSize);\r
     }\r
   }\r
   //\r
index 5b582c76ba62f84eb23570fe9fde0126bd691349..1aa0af5767a2999d6cd2edba0b40846f86485041 100644 (file)
@@ -50,8 +50,7 @@ typedef struct {
 VOID\r
 RelocatePeImageForRuntime (\r
   RUNTIME_IMAGE_RELOCATION_DATA  *Image\r
-  )\r
-;\r
+  );\r
 \r
 EFI_STATUS\r
 EFIAPI\r
@@ -59,8 +58,7 @@ RuntimeDriverCalculateCrc32 (
   IN  VOID    *Data,\r
   IN  UINTN   DataSize,\r
   OUT UINT32  *CrcOut\r
-  )\r
-;\r
+  );\r
 \r
 EFI_STATUS\r
 EFIAPI\r
@@ -69,8 +67,7 @@ RuntimeDriverRegisterImage (
   IN  EFI_PHYSICAL_ADDRESS              ImageBase,\r
   IN  UINTN                             ImageSize,\r
   IN  VOID                              *RelocationData\r
-  )\r
-;\r
+  );\r
 \r
 EFI_STATUS\r
 EFIAPI\r
@@ -81,40 +78,27 @@ RuntimeDriverRegisterEvent (
   IN EFI_EVENT_NOTIFY                   NotifyFunction,\r
   IN VOID                               *NotifyContext,\r
   IN EFI_EVENT                          *Event\r
-  )\r
-;\r
+  );\r
 \r
 EFI_STATUS\r
 EFIAPI\r
 RuntimeDriverConvertPointer (\r
   IN     UINTN  DebugDisposition,\r
   IN OUT VOID   **ConvertAddress\r
-  )\r
-;\r
+  );\r
 \r
 VOID\r
 RuntimeDriverInitializeCrc32Table (\r
   VOID\r
-  )\r
-;\r
+  );\r
 \r
 EFI_STATUS\r
 EFIAPI\r
 RuntimeDriverInitialize (\r
   IN EFI_HANDLE                            ImageHandle,\r
   IN EFI_SYSTEM_TABLE                      *SystemTable\r
-  )\r
-;\r
+  );\r
 \r
 \r
-//\r
-// Cache Flush Routine.\r
-//\r
-EFI_STATUS\r
-FlushCpuCache (\r
-  IN EFI_PHYSICAL_ADDRESS          Start,\r
-  IN UINT64                        Length\r
-  )\r
-;\r
 \r
 #endif\r
index b72531eafbd538fefb686ade419d2f521fac4b06..516dfa485591017a7222717ca25c5a509a62e39c 100644 (file)
     <LibraryClass Usage="ALWAYS_CONSUMED">\r
       <Keyword>UefiBootServicesTableLib</Keyword>\r
     </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>CacheMaintenanceLib</Keyword>\r
+    </LibraryClass>\r
   </LibraryClassDefinitions>\r
   <SourceFiles>\r
     <Filename>Runtime.dxs</Filename>\r
     <Filename>Runtime.c</Filename>\r
     <Filename>Runtime.h</Filename>\r
     <Filename>Crc32.c</Filename>\r
-    <Filename SupArchList="IA32">Ia32/PeHotRelocateEx.c</Filename>\r
-    <Filename SupArchList="X64">x64/PeHotRelocateEx.c</Filename>\r
-    <Filename SupArchList="X64">x64/PeHotRelocateEx.h</Filename>\r
-    <Filename SupArchList="IPF">Ipf/PeHotRelocateEx.c</Filename>\r
-    <Filename SupArchList="IPF">Ipf/PeHotRelocateEx.h</Filename>\r
   </SourceFiles>\r
   <PackageDependencies>\r
     <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
index 6347998e49a21c4307b53108f9ab980d5df72a03..cb0e2fbac1f264cddb6044ee9cfaf232ad34c546 100644 (file)
     </ModuleSA>\r
     <ModuleSA SupArchList="IA32" PackageGuid="68169ab0-d41b-4009-9060-292c253ac43d" ModuleGuid="B601F8C4-43B7-4784-95B1-F4226CB40CEE">\r
       <Libraries>\r
+        <Instance ModuleGuid="123dd843-57c9-4158-8418-ce68b3944ce7" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
         <Instance ModuleGuid="19cbbb97-ff61-45ff-8c3f-dfa66dd118c8" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
         <Instance ModuleGuid="ff5c7a2c-ab7a-4366-8616-11c6e53247b6" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
         <Instance ModuleGuid="27d67720-ea68-48ae-93da-a3a074c90e30" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
index e414e27399b1336ddf9c7ce2e18fcd13576ef9ca..329385d9c19f1813d04d55b01b1ef467bce8c779 100644 (file)
@@ -5072,24 +5072,24 @@ IpfReadItc (
 \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
+  Flush a range of  cache lines in the cache coherency domain of the calling \r
+  CPU.\r
+\r
+  Invalidates the  cache lines specified by Address and Length. If Address is \r
+  not aligned on a cache line boundary, then entire cache line containing \r
+  Address is invalidated. If Address + Length is not aligned on a cache line \r
+  boundary, then the entire instruction cache line containing Address + Length\r
+  -1 is invalidated. This function may choose to invalidate the entire \r
+  instruction cache if that is more efficient than invalidating the specified \r
+  range. If Length is 0, the no instruction cache lines are invalidated. \r
+  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
+  @param  Address The base address of the instruction lines to invalidate. If \r
+                  the CPU is in a physical addressing mode, then Address is a\r
+                  physical address. If the CPU is in a virtual addressing mode,\r
+                  then Address is a virtual address.\r
 \r
   @param  Length  The number of bytes to invalidate from the instruction cache.\r
 \r
@@ -5098,7 +5098,7 @@ IpfReadItc (
 **/\r
 VOID *\r
 EFIAPI\r
-IpfInvalidateInstructionCacheRange (\r
+IpfFlushCacheRange (\r
   IN      VOID                      *Address,\r
   IN      UINTN                     Length\r
   );\r
index 0c6f0e4dc8b195e6ab19a339af8ddfd84a45cfdd..17060eb70fdb942cfbbf982d77855abbcaf65c78 100644 (file)
@@ -62,7 +62,7 @@ InvalidateInstructionCacheRange (
   IN      UINTN                     Length\r
   )\r
 {\r
-  return IpfInvalidateInstructionCacheRange (Address, Length);\r
+  return IpfFlushCacheRange (Address, Length);\r
 }\r
 \r
 /**\r
@@ -119,10 +119,7 @@ WriteBackInvalidateDataCacheRange (
 {\r
   ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);\r
 \r
-  if (Length > 0) {\r
-    WriteBackInvalidateDataCache ();\r
-  }\r
-  return Address;\r
+  return IpfFlushCacheRange (Address, Length);\r
 }\r
 \r
 /**\r
@@ -178,10 +175,7 @@ WriteBackDataCacheRange (
 {\r
   ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);\r
 \r
-  if (Length > 0) {\r
-    WriteBackDataCache ();\r
-  }\r
-  return Address;\r
+  return IpfFlushCacheRange (Address, Length);\r
 }\r
 \r
 /**\r
@@ -238,5 +232,5 @@ InvalidateDataCacheRange (
   IN      UINTN                     Length\r
   )\r
 {\r
-  return WriteBackInvalidateDataCacheRange (Address, Length);\r
+  return IpfFlushCacheRange (Address, Length);\r
 }\r
index 52dbf7304a0198d7b6c572e85ee330bfbef3625d..08f21eb7b26f846050544dfe6e3715cd65db4342 100644 (file)
@@ -425,7 +425,7 @@ 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/FlushCacheRange.s</Filename>\r
     <Filename SupArchList="IPF">Ipf/ReadItc.s</Filename>\r
     \r
     <Filename SupArchList="EBC">Math64.c</Filename>\r