]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkCompatibilityPkg/Foundation/Library/Pei/Include/PeiLib.h
Sync all bug fixes between EDK1.04 and EDK1.06 into EdkCompatibilityPkg.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / Pei / Include / PeiLib.h
index f2cfdb865c54cb2880e85129ce4e426602e11d22..8fd3f932474a829d4b24260d4036c0ed85d75660 100644 (file)
@@ -1,7 +1,7 @@
 /*++\r
 \r
-Copyright (c) 2004 - 2007, Intel Corporation                                                         \r
-All rights reserved. This program and the accompanying materials                          \r
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
+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
@@ -24,12 +24,67 @@ Abstract:
 \r
 #include "Tiano.h"\r
 #include "Pei.h"\r
-#include "peiHobLib.h"\r
+#include "PeiHobLib.h"\r
+#include "PeiPerf.h"\r
 #include EFI_PROTOCOL_DEFINITION (Decompress)\r
 #include EFI_PROTOCOL_DEFINITION (TianoDecompress)\r
 #include EFI_GUID_DEFINITION (PeiPeCoffLoader)\r
 #include EFI_PPI_DEFINITION (FindFv)\r
 \r
+#if defined(__GNUC__) && defined(ECP_CPU_IPF)\r
+\r
+VOID\r
+EFIAPI\r
+EcpEfiBreakPoint (\r
+  VOID\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Generates a breakpoint on the CPU.\r
+\r
+  Generates a breakpoint on the CPU. The breakpoint must be implemented such\r
+  that code can resume normal execution after the breakpoint.\r
+\r
+Arguments:\r
+\r
+  VOID\r
+\r
+Returns: \r
+\r
+  VOID\r
+\r
+--*/\r
+;\r
+\r
+VOID\r
+EFIAPI\r
+EcpMemoryFence (\r
+  VOID\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Used to serialize load and store operations.\r
+\r
+  All loads and stores that proceed calls to this function are guaranteed to be\r
+  globally visible when this function returns.\r
+\r
+Arguments:\r
+\r
+  VOID\r
+\r
+Returns: \r
+\r
+  VOID\r
+\r
+--*/\r
+;\r
+\r
+#endif\r
+\r
 \r
 #if (PI_SPECIFICATION_VERSION >= 0x00010000)\r
 \r
@@ -140,8 +195,8 @@ EFI_STATUS
 EFIAPI\r
 PeiLibFfsFindNextFile (\r
   IN EFI_FV_FILETYPE            SearchType,\r
-  IN EFI_PEI_FV_HANDLE          FwVolHeader,\r
-  IN OUT EFI_PEI_FILE_HANDLE    *FileHeader\r
+  IN EFI_PEI_FV_HANDLE          FvHandle,\r
+  IN OUT EFI_PEI_FILE_HANDLE    *FileHandle\r
   )\r
 /*++\r
 \r
@@ -152,7 +207,7 @@ Routine Description:
 Arguments:\r
 \r
   SearchType   - Filter to find only file of this type.\r
-  FwVolHeader  - Pointer to the current FV to search.\r
+  FvHandle     - Pointer to the current FV to search.\r
   FileHandle   - Pointer to the file matching SearchType in FwVolHeader.\r
                 - NULL if file not found\r
 \r
@@ -216,7 +271,7 @@ Returns:
 EFI_STATUS\r
 EFIAPI\r
 PeiLibFfsGetVolumeInfo (\r
-  IN EFI_PEI_FV_HANDLE  *VolumeHandle,\r
+  IN EFI_PEI_FV_HANDLE  VolumeHandle,\r
   OUT EFI_FV_INFO       *VolumeInfo\r
   )\r
 /*++\r
@@ -709,37 +764,6 @@ Returns:
 --*/\r
 ;\r
 \r
-VOID\r
-PeiPerfMeasure (\r
-  EFI_PEI_SERVICES              **PeiServices,\r
-  IN UINT16                     *Token,\r
-  IN EFI_FFS_FILE_HEADER        *FileHeader,\r
-  IN BOOLEAN                    EntryExit,\r
-  IN UINT64                     Value\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Log a timestamp count.\r
-\r
-Arguments:\r
-\r
-  PeiServices - Pointer to the PEI Core Services table\r
-  \r
-  Token       - Pointer to Token Name\r
-  \r
-  FileHeader  - Pointer to the file header\r
-\r
-  EntryExit   - Indicates start or stop measurement\r
-\r
-  Value       - The start time or the stop time\r
-\r
-Returns:\r
-\r
---*/\r
-;\r
-\r
 EFI_STATUS\r
 GetTimerValue (\r
   OUT UINT64    *TimerValue\r
@@ -761,14 +785,6 @@ Returns:
 --*/\r
 ;\r
 \r
-#ifdef EFI_PEI_PERFORMANCE\r
-#define PEI_PERF_START(Ps, Token, FileHeader, Value)  PeiPerfMeasure (Ps, Token, FileHeader, FALSE, Value)\r
-#define PEI_PERF_END(Ps, Token, FileHeader, Value)    PeiPerfMeasure (Ps, Token, FileHeader, TRUE, Value)\r
-#else\r
-#define PEI_PERF_START(Ps, Token, FileHeader, Value)\r
-#define PEI_PERF_END(Ps, Token, FileHeader, Value)\r
-#endif\r
-\r
 #ifdef EFI_NT_EMULATOR\r
 EFI_STATUS\r
 PeCoffLoaderWinNtLoadAsDll (\r
@@ -1306,6 +1322,7 @@ Returns:
 ;\r
 \r
 EFI_STATUS\r
+EFIAPI\r
 FindFv (\r
   IN     EFI_FIND_FV_PPI             *This,\r
   IN     EFI_PEI_SERVICES            **PeiServices,\r
@@ -1338,4 +1355,79 @@ Returns:
 --*/\r
 ;\r
 \r
+\r
+\r
+EFI_STATUS\r
+EFIAPI \r
+PeiLibPciCfgModify (\r
+  IN EFI_PEI_SERVICES         **PeiServices,\r
+  IN PEI_PCI_CFG_PPI          *PciCfg,\r
+  IN PEI_PCI_CFG_PPI_WIDTH    Width,\r
+  IN UINT64                   Address,\r
+  IN UINTN                    SetBits,\r
+  IN UINTN                    ClearBits\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  PCI read-modify-write operations.\r
+\r
+  PIWG's PI specification replaces Inte's EFI Specification 1.10.\r
+  EFI_PEI_PCI_CFG_PPI defined in Inte's EFI Specification 1.10 is replaced by\r
+  EFI_PEI_PCI_CFG2_PPI in PI 1.0. "Modify" function  in these two PPI are not \r
+  compatibile with each other.\r
+  \r
+\r
+  For Framework code that make the following call:\r
+\r
+      PciCfg->Modify (\r
+                       PeiServices,\r
+                       PciCfg,\r
+                       Width,\r
+                       Address,\r
+                       SetBits,\r
+                       ClearBits\r
+                       );\r
+   it will be updated to the following code which call this library API:\r
+      PeiLibPciCfgModify (\r
+          PeiServices,\r
+          PciCfg,\r
+          Width,\r
+          Address,\r
+          SetBits,\r
+          ClearBits\r
+          );\r
+\r
+   The \r
+\r
+Arguments:\r
+  \r
+  PeiServices     An indirect pointer to the PEI Services Table\r
+                          published by the PEI Foundation.\r
+  PciCfg          A pointer to the this pointer of EFI_PEI_PCI_CFG_PPI. \r
+                          This parameter is unused as a place holder to make\r
+                          the parameter list identical to PEI_PCI_CFG_PPI_RW.\r
+  Width           The width of the access. Enumerated in bytes. Type\r
+                          EFI_PEI_PCI_CFG_PPI_WIDTH is defined in Read().\r
+\r
+  Address         The physical address of the access.\r
+\r
+  SetBits         Points to value to bitwise-OR with the read configuration value.\r
+\r
+                          The size of the value is determined by Width.\r
+\r
+  ClearBits       Points to the value to negate and bitwise-AND with the read configuration value.\r
+                          The size of the value is determined by Width.\r
+\r
+\r
+Returns:\r
+\r
+  EFI_SUCCESS           The function completed successfully.\r
+\r
+  EFI_DEVICE_ERROR      There was a problem with the transaction.\r
+\r
+--*/\r
+;\r
+\r
 #endif\r