]> 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 b37ac9ee1f4b8830eaea0d72e017d754258002ed..5be001490523df2fcb8860f9451c0226c3cc4223 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
-CallPalProcStatic (\r
-  IN      UINT64                    Arg1,\r
-  IN      UINT64                    Arg2,\r
-  IN      UINT64                    Arg3,\r
-  IN      UINT64                    Arg4\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
@@ -41,7 +35,7 @@ InvalidateInstructionCache (
   VOID\r
   )\r
 {\r
-  CallPalProcStatic (1, 1, 1, 0);\r
+  PalCallStatic (NULL, 1, 1, 1, 0);\r
 }\r
 \r
 /**\r
@@ -69,19 +63,14 @@ InvalidateInstructionCache (
   @return Address\r
 \r
 **/\r
-VOID*\r
+VOID *\r
 EFIAPI\r
 InvalidateInstructionCacheRange (\r
   IN      VOID                      *Address,\r
   IN      UINTN                     Length\r
   )\r
 {\r
-  ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);\r
-\r
-  if (Length > 0) {\r
-    InvalidateInstructionCache ();\r
-  }\r
-  return Address;\r
+  return IpfFlushCacheRange (Address, Length);\r
 }\r
 \r
 /**\r
@@ -100,7 +89,7 @@ WriteBackInvalidateDataCache (
   VOID\r
   )\r
 {\r
-  CallPalProcStatic (1, 2, 1, 0);\r
+  PalCallStatic (NULL, 1, 2, 1, 0);\r
 }\r
 \r
 /**\r
@@ -138,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
@@ -160,7 +146,7 @@ WriteBackDataCache (
   VOID\r
   )\r
 {\r
-  CallPalProcStatic (1, 2, 0, 0);\r
+  PalCallStatic (NULL, 1, 2, 0, 0);\r
 }\r
 \r
 /**\r
@@ -197,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
@@ -257,5 +240,5 @@ InvalidateDataCacheRange (
   IN      UINTN                     Length\r
   )\r
 {\r
-  return WriteBackInvalidateDataCacheRange (Address, Length);\r
+  return IpfFlushCacheRange (Address, Length);\r
 }\r