]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseCacheMaintenanceLib/IpfCache.c
Fix invalid return status to sync with newest UEFI spec 2.1
[mirror_edk2.git] / MdePkg / Library / BaseCacheMaintenanceLib / IpfCache.c
index 0c6f0e4dc8b195e6ab19a339af8ddfd84a45cfdd..5be001490523df2fcb8860f9451c0226c3cc4223 100644 (file)
 **/\r
 \r
 \r
+//\r
+// Include common header file for this module.\r
+//\r
+#include <Base.h>\r
+#include <Library/CacheMaintenanceLib.h>\r
+#include <Library/BaseLib.h>\r
+#include <Library/DebugLib.h>\r
+\r
 /**\r
   Invalidates the entire instruction cache in cache coherency domain of the\r
   calling CPU.\r
@@ -62,7 +70,7 @@ InvalidateInstructionCacheRange (
   IN      UINTN                     Length\r
   )\r
 {\r
-  return IpfInvalidateInstructionCacheRange (Address, Length);\r
+  return IpfFlushCacheRange (Address, Length);\r
 }\r
 \r
 /**\r
@@ -119,10 +127,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 +183,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 +240,5 @@ InvalidateDataCacheRange (
   IN      UINTN                     Length\r
   )\r
 {\r
-  return WriteBackInvalidateDataCacheRange (Address, Length);\r
+  return IpfFlushCacheRange (Address, Length);\r
 }\r