]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add BasePalCallLibNull instance in MdePkg. It is useful when building IPF components...
authoryshang1 <yshang1@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 11 Oct 2007 11:12:28 +0000 (11:12 +0000)
committeryshang1 <yshang1@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 11 Oct 2007 11:12:28 +0000 (11:12 +0000)
Use  meaningful arguments defined in PalLib.h when invoking  PalCall().

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

MdeModulePkg/MdeModulePkg.dsc
MdePkg/Include/Library/PalCallLib.h
MdePkg/Library/BaseCacheMaintenanceLib/IpfCache.c
MdePkg/Library/BasePalCallLibNull/BasePalCallLibNull.inf [new file with mode: 0644]
MdePkg/Library/BasePalCallLibNull/PalCall.c [new file with mode: 0644]
MdePkg/Library/SecPeiDxeTimerLibCpu/IpfTimerLib.c
MdePkg/MdePkg.dsc

index fd4b5e3dcc023229f8ce87d5bc1aa2003f80f007..752aa853147b3da0e66b53641e52b8007cbba4ae 100644 (file)
@@ -55,6 +55,8 @@
 \r
 [LibraryClasses.IPF]\r
   IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf\r
+  TimerLib|MdePkg/Library/SecPeiDxeTimerLibCpu/SecPeiDxeTimerLibCpu.inf\r
+  PalCallLib|MdePkg/Library/BasePalCallLibNull/BasePalCallLibNull.inf\r
 \r
 [LibraryClasses.EBC.DXE_DRIVER]\r
   IoLib|IntelFrameworkPkg/Library/DxeIoLibCpuIo/DxeIoLibCpuIo.inf\r
 [LibraryClasses.X64.UEFI_APPLICATION]\r
   TimerLib|MdePkg/Library/SecPeiDxeTimerLibCpu/SecPeiDxeTimerLibCpu.inf\r
 \r
-[LibraryClasses.IPF.BASE]\r
-  TimerLib|MdePkg/Library/SecPeiDxeTimerLibCpu/SecPeiDxeTimerLibCpu.inf\r
-\r
-[LibraryClasses.IPF.SEC]\r
-  TimerLib|MdePkg/Library/SecPeiDxeTimerLibCpu/SecPeiDxeTimerLibCpu.inf\r
-\r
-[LibraryClasses.IPF.PEI_CORE]\r
-  TimerLib|MdePkg/Library/SecPeiDxeTimerLibCpu/SecPeiDxeTimerLibCpu.inf\r
-\r
-[LibraryClasses.IPF.PEIM]\r
-  TimerLib|MdePkg/Library/SecPeiDxeTimerLibCpu/SecPeiDxeTimerLibCpu.inf\r
-\r
-[LibraryClasses.IPF.DXE_DRIVER]\r
-  TimerLib|MdePkg/Library/SecPeiDxeTimerLibCpu/SecPeiDxeTimerLibCpu.inf\r
-\r
-[LibraryClasses.IPF.DXE_SAL_DRIVER]\r
-  TimerLib|MdePkg/Library/SecPeiDxeTimerLibCpu/SecPeiDxeTimerLibCpu.inf\r
-\r
-[LibraryClasses.IPF.UEFI_DRIVER]\r
-  TimerLib|MdePkg/Library/SecPeiDxeTimerLibCpu/SecPeiDxeTimerLibCpu.inf\r
-\r
-[LibraryClasses.IPF.UEFI_APPLICATION]\r
-  TimerLib|MdePkg/Library/SecPeiDxeTimerLibCpu/SecPeiDxeTimerLibCpu.inf\r
-\r
 [LibraryClasses.IA32.DXE_RUNTIME_DRIVER]\r
   UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf\r
 \r
index e3b827703833966462cc09389db170400074e7e2..49980874f892af865c8ab068828342f5c8d60606 100644 (file)
@@ -33,7 +33,7 @@
 #define PAL_CACHE_FLUSH_INVALIDATE_LINES     BIT0\r
 #define PAL_CACHE_FLUSH_NO_INVALIDATE_LINES  0\r
 #define PAL_CACHE_FLUSH_POLL_INTERRUPT       BIT1\r
-#define PAL_CACHE_FLUSH_NO_INTERRUPT       0\r
+#define PAL_CACHE_FLUSH_NO_INTERRUPT         0\r
 \r
 /**\r
   \r
index 1007b4448f0237af05432b4180d0c8d4e30bf64f..17ef43d9689c45c8e32c447aafbcb1f6b8f9418c 100644 (file)
@@ -36,7 +36,7 @@ InvalidateInstructionCache (
   VOID\r
   )\r
 {\r
-  PalCall (1, 1, 1, 0);\r
+  PalCall (PAL_CACHE_FLUSH, PAL_CACHE_FLUSH_INSTRUCTION_ALL, PAL_CACHE_FLUSH_INVALIDATE_LINES, 0);\r
 }\r
 \r
 /**\r
@@ -90,7 +90,7 @@ WriteBackInvalidateDataCache (
   VOID\r
   )\r
 {\r
-  PalCall (1, 2, 1, 0);\r
+  PalCall (PAL_CACHE_FLUSH, PAL_CACHE_FLUSH_DATA_ALL, PAL_CACHE_FLUSH_INVALIDATE_LINES, 0);\r
 }\r
 \r
 /**\r
@@ -147,7 +147,7 @@ WriteBackDataCache (
   VOID\r
   )\r
 {\r
-  PalCall (1, 2, 0, 0);\r
+  PalCall (PAL_CACHE_FLUSH, PAL_CACHE_FLUSH_DATA_ALL, PAL_CACHE_FLUSH_NO_INVALIDATE_LINES | PAL_CACHE_FLUSH_NO_INTERRUPT, 0);\r
 }\r
 \r
 /**\r
diff --git a/MdePkg/Library/BasePalCallLibNull/BasePalCallLibNull.inf b/MdePkg/Library/BasePalCallLibNull/BasePalCallLibNull.inf
new file mode 100644 (file)
index 0000000..8de1890
--- /dev/null
@@ -0,0 +1,42 @@
+#/** @file\r
+# Component description file for NULL Debug Library\r
+#\r
+# Debug Library with empty functions.\r
+# Copyright (c) 2007, Intel Corporation.\r
+#\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
+#  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
+#\r
+#**/\r
+\r
+[Defines]\r
+  INF_VERSION                    = 0x00010005\r
+  BASE_NAME                      = BasePalCallLibNull\r
+  FILE_GUID                      = 632D5625-B73D-43b8-AF30-8D225D96168E\r
+  MODULE_TYPE                    = BASE\r
+  VERSION_STRING                 = 1.0\r
+  LIBRARY_CLASS                  = PalCallLib \r
+  EDK_RELEASE_VERSION            = 0x00020000\r
+  EFI_SPECIFICATION_VERSION      = 0x00020000\r
+\r
+\r
+#\r
+#  VALID_ARCHITECTURES           = IPF\r
+#\r
+\r
+[Sources.common]\r
+  PalCall.c\r
+\r
+\r
+[Packages]\r
+  MdePkg/MdePkg.dec\r
+\r
+\r
+[LibraryClasses]\r
+  DebugLib\r
+\r
diff --git a/MdePkg/Library/BasePalCallLibNull/PalCall.c b/MdePkg/Library/BasePalCallLibNull/PalCall.c
new file mode 100644 (file)
index 0000000..0c1d137
--- /dev/null
@@ -0,0 +1,58 @@
+/** @file\r
+  \r
+  Template and Sample instance of PalCallLib.\r
+  \r
+  Copyright (c) 2006 - 2007, 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
+**/\r
+#include <Base.h>\r
+#include <Library/PalCallLib.h>\r
+#include <Library/DebugLib.h>\r
+\r
+/**\r
+  Makes a PAL procedure call.\r
+\r
+  This is a wrapper function to make a PAL procedure call.  Based on the Index value,\r
+  this API will make static or stacked PAL call. Architected procedures may be designated\r
+  as required or optional.  If a PAL procedure is specified as optional, a unique return\r
+  code of 0xFFFFFFFFFFFFFFFF is returned in the Status field of the PAL_CALL_RETURN structure.\r
+  This indicates that the procedure is not present in this PAL implementation.  It is the\r
+  caller¡¯s responsibility to check for this return code after calling any optional PAL\r
+  procedure. No parameter checking is performed on the 4 input parameters, but there are\r
+  some common rules that the caller should follow when making a PAL call.  Any address\r
+  passed to PAL as buffers for return parameters must be 8-byte aligned.  Unaligned addresses\r
+  may cause undefined results.  For those parameters defined as reserved or some fields\r
+  defined as reserved must be zero filled or the invalid argument return value may be\r
+  returned or undefined result may occur during the execution of the procedure.\r
+  This function is only available on IPF.\r
+\r
+  @param Index - The PAL procedure Index number.\r
+  @param Arg2  - The 2nd parameter for PAL procedure calls.\r
+  @param Arg3  - The 3rd parameter for PAL procedure calls.\r
+  @param Arg4  - The 4th parameter for PAL procedure calls.\r
+\r
+  @return structure returned from the PAL Call procedure, including the status and return value.\r
+\r
+**/\r
+PAL_CALL_RETURN\r
+EFIAPI\r
+PalCall (\r
+  IN UINT64                  Index,\r
+  IN UINT64                  Arg2,\r
+  IN UINT64                  Arg3,\r
+  IN UINT64                  Arg4\r
+  )\r
+{\r
+  PAL_CALL_RETURN Ret;\r
+\r
+  Ret.Status = (UINT64) -1;\r
+  ASSERT (!RETURN_ERROR (RETURN_UNSUPPORTED));\r
+  return Ret;\r
+}\r
index 3977880526c62001b9117b19f9161d850938304b..cb5c6d4b739ce4c5f328ddad01ddbfaea873003b 100644 (file)
@@ -161,13 +161,13 @@ GetPerformanceCounterProperties (
     *EndValue = (UINT64)(-1);\r
   }\r
 \r
-  PalRet = PalCall (13, 0, 0, 0);\r
+  PalRet = PalCall (PAL_FREQ_BASE, 0, 0, 0);\r
   if (PalRet.Status != 0) {\r
     return 1000000;\r
   }\r
   BaseFrequence = PalRet.r9;\r
 \r
-  PalRet = PalCall (14, 0, 0, 0);\r
+  PalRet = PalCall (PAL_FREQ_RATIOS, 0, 0, 0);\r
   if (PalRet.Status != 0) {\r
     return 1000000;\r
   }\r
index 0f05fb1ab5442e58f55bc8824eece7e7f3258827..f394a9d50046b8014263eba1a0def4d908c24bb2 100644 (file)
 [Components.IPF]\r
   MdePkg/Library/SecPeiDxeTimerLibCpu/SecPeiDxeTimerLibCpu.inf\r
   MdePkg/Library/PeiServicesTablePointerLibKr7/PeiServicesTablePointerLibKr7.inf\r
+  MdePkg/Library/BasePalCallLibNull/BasePalCallLibNull.inf\r