]> git.proxmox.com Git - mirror_edk2.git/commitdiff
moved the PeiPalCallLib from ItaniumFamilyCpuPkg to MdePkg
authorvprabhal <vprabhal@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 11 Oct 2007 23:51:46 +0000 (23:51 +0000)
committervprabhal <vprabhal@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 11 Oct 2007 23:51:46 +0000 (23:51 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4102 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Library/PeiPalCallLib/PalCallLib.c [new file with mode: 0644]
MdePkg/Library/PeiPalCallLib/PeiPalCallLib.inf [new file with mode: 0644]
MdePkg/Library/PeiPalCallLib/PeiPalCallLib.msa [new file with mode: 0644]

diff --git a/MdePkg/Library/PeiPalCallLib/PalCallLib.c b/MdePkg/Library/PeiPalCallLib/PalCallLib.c
new file mode 100644 (file)
index 0000000..4d52fc3
--- /dev/null
@@ -0,0 +1,101 @@
+/** @file\r
+  PAL Call Services Function.\r
+\r
+  Copyright (c) 2006 - 2007 Intel Corporation. All rights reserved\r
+  This software and associated documentation (if any) is furnished\r
+  under a license and may only be used or copied in accordance\r
+  with the terms of the license. Except as permitted by such\r
+  license, no part of this software or documentation may be\r
+  reproduced, stored in a retrieval system, or transmitted in any\r
+  form or by any means without the express written consent of\r
+  Intel Corporation.\r
+\r
+  Module Name:  PalCallLib.c\r
+\r
+**/\r
+\r
+\r
+#include <PiPei.h>\r
+#include <ItaniumFamilyCpuPeim.h>\r
+\r
+#include <Ppi/SecPlatformInformation.h>\r
+\r
+#include <Library/PalCallLib.h>\r
+#include <Library/PeiServicesTablePointerLib.h>\r
+#include <Library/PeiServicesLib.h>\r
+#include <Library/BaseLib.h>\r
+#include <Library/DebugLib.h>\r
+\r
+/**\r
+\r
+  Makes a PAL procedure call.\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
+  UINT64                            PalCallAddress;\r
+  PAL_CALL_RETURN                   ReturnVal;\r
+\r
+  EFI_PEI_SERVICES                  **PeiServices;\r
+  EFI_STATUS                        Status;\r
+  EFI_SEC_PLATFORM_INFORMATION_PPI  *SecPlatformPpi;\r
+  IPF_HANDOFF_STATUS                IpfStatus;\r
+  UINT64                            RecordSize;\r
+\r
+  //\r
+  // Get Pei Service Table Pointer\r
+  //\r
+  PeiServices = GetPeiServicesTablePointer ();\r
+\r
+  //\r
+  // Locate SEC Ppi\r
+  //\r
+\r
+  Status = PeiServicesLocatePpi (\r
+                             &gEfiSecPlatformInformationPpiGuid,\r
+                             0,\r
+                             NULL,\r
+                             (VOID **)&SecPlatformPpi\r
+                             );\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  RecordSize = sizeof (IpfStatus);\r
+  SecPlatformPpi->PlatformInformation (\r
+                        PeiServices,\r
+                        &RecordSize,\r
+                        (EFI_SEC_PLATFORM_INFORMATION_RECORD *) &IpfStatus\r
+                        );\r
+  PalCallAddress = IpfStatus.PalCallAddress;\r
+\r
+  ReturnVal = AsmPalCall (PalCallAddress, Index, Arg2, Arg3, Arg4);\r
+\r
+  return ReturnVal;\r
+}\r
+\r
diff --git a/MdePkg/Library/PeiPalCallLib/PeiPalCallLib.inf b/MdePkg/Library/PeiPalCallLib/PeiPalCallLib.inf
new file mode 100644 (file)
index 0000000..046e80c
--- /dev/null
@@ -0,0 +1,52 @@
+#/** @file\r
+# Component description file for Pei PAL call Library\r
+#\r
+# PAL Call Library implementation to wrap the PAL call in PEI.\r
+# Copyright (c) 2006, Intel Corporation\r
+#\r
+#  All rights reserved.\r
+#  This software and associated documentation (if any) is furnished\r
+#  under a license and may only be used or copied in accordance\r
+#  with the terms of the license. Except as permitted by such\r
+#  license, no part of this software or documentation may be\r
+#  reproduced, stored in a retrieval system, or transmitted in any\r
+#  form or by any means without the express written consent of\r
+#  Intel Corporation.\r
+#\r
+#\r
+#**/\r
+\r
+[Defines]\r
+  INF_VERSION                    = 0x00010005\r
+  BASE_NAME                      = PeiPalCallLib\r
+  FILE_GUID                      = B53DC524-6B98-4584-940B-8F1363DEF09E\r
+  MODULE_TYPE                    = PEIM\r
+  VERSION_STRING                 = 1.0\r
+  LIBRARY_CLASS                  = PalCallLib \r
+  EDK_RELEASE_VERSION            = 0x00020000\r
+  EFI_SPECIFICATION_VERSION      = 0x00020000\r
+\r
+\r
+#\r
+# The following information is for reference only and not required by the build tools.\r
+#\r
+#  VALID_ARCHITECTURES           = IPF\r
+#\r
+\r
+[Sources.common]\r
+  PalCallLib.c\r
+\r
+\r
+[Packages]\r
+  MdePkg/MdePkg.dec\r
+\r
+\r
+[LibraryClasses]\r
+  BaseLib\r
+  PeiServicesLib\r
+  PeiServicesTablePointerLib\r
+\r
+\r
+[Ppis]\r
+  gEfiSecPlatformInformationPpiGuid             # PPI ALWAYS_CONSUMED\r
+\r
diff --git a/MdePkg/Library/PeiPalCallLib/PeiPalCallLib.msa b/MdePkg/Library/PeiPalCallLib/PeiPalCallLib.msa
new file mode 100644 (file)
index 0000000..456019f
--- /dev/null
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r
+  <MsaHeader>\r
+    <ModuleName>PeiPalCallLib</ModuleName>\r
+    <ModuleType>PEIM</ModuleType>\r
+    <GuidValue>B53DC524-6B98-4584-940B-8F1363DEF09E</GuidValue>\r
+    <Version>1.0</Version>\r
+    <Abstract>Component description file for Pei PAL call Library</Abstract>\r
+    <Description>PAL Call Library implementation to wrap the PAL call in PEI.</Description>\r
+    <Copyright>Copyright (c) 2006, Intel Corporation</Copyright>\r
+    <License>All rights reserved.
+      This software and associated documentation (if any) is furnished
+      under a license and may only be used or copied in accordance
+      with the terms of the license. Except as permitted by such
+      license, no part of this software or documentation may be
+      reproduced, stored in a retrieval system, or transmitted in any
+      form or by any means without the express written consent of
+      Intel Corporation.</License>\r
+    <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION   0x00000052</Specification>\r
+  </MsaHeader>\r
+  <ModuleDefinitions>\r
+    <SupportedArchitectures>IPF</SupportedArchitectures>\r
+    <BinaryModule>false</BinaryModule>\r
+    <OutputFileBasename>PeiPalCallLib</OutputFileBasename>\r
+  </ModuleDefinitions>\r
+  <LibraryClassDefinitions>\r
+    <LibraryClass Usage="ALWAYS_PRODUCED">\r
+      <Keyword>PalCallLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>PeiServicesTablePointerLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>PeiServicesLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>BaseLib</Keyword>\r
+    </LibraryClass>\r
+  </LibraryClassDefinitions>\r
+  <SourceFiles>\r
+    <Filename>PalCallLib.c</Filename>\r
+  </SourceFiles>\r
+  <PackageDependencies>\r
+    <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
+    <Package PackageGuid="2604113b-55bb-4337-abf6-24803b0ef369"/>\r
+  </PackageDependencies>\r
+  <PPIs>\r
+    <Ppi Usage="ALWAYS_CONSUMED">\r
+      <PpiCName>gEfiSecPlatformInformationPpiGuid</PpiCName>\r
+    </Ppi>\r
+  </PPIs>\r
+  <Externs>\r
+    <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
+    <Specification>EDK_RELEASE_VERSION 0x00020000</Specification>\r
+  </Externs>\r
+</ModuleSurfaceArea>
\ No newline at end of file