--- /dev/null
+/** @file\r
+ Module functions' declarations are included here.\r
+\r
+Copyright (c) 2006 - 2008, Intel Corporation. <BR>\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
+ \r
+#ifndef _DXE_CORE_PERFORMANCE_LIB_INTERNAL_H_\r
+#define _DXE_CORE_PERFORMANCE_LIB_INTERNAL_H_\r
+\r
+\r
+#include <PiDxe.h>\r
+\r
+#include <Protocol/Performance.h>\r
+#include <Guid/PeiPerformanceHob.h>\r
+\r
+#include <Library/PerformanceLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/HobLib.h>\r
+#include <Library/BaseLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
+#include <Library/TimerLib.h>\r
+#include <Library/PcdLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
+\r
+//\r
+// Interface declarations for Performance Protocol.\r
+//\r
+/**\r
+ Adds a record at the end of the performance measurement log\r
+ that records the start time of a performance measurement.\r
+\r
+ Adds a record to the end of the performance measurement log\r
+ that contains the Handle, Token, and Module.\r
+ The end time of the new record must be set to zero.\r
+ If TimeStamp is not zero, then TimeStamp is used to fill in the start time in the record.\r
+ If TimeStamp is zero, the start time in the record is filled in with the value\r
+ read from the current time stamp.\r
+\r
+ @param Handle Pointer to environment specific context used\r
+ to identify the component being measured.\r
+ @param Token Pointer to a Null-terminated ASCII string\r
+ that identifies the component being measured.\r
+ @param Module Pointer to a Null-terminated ASCII string\r
+ that identifies the module being measured.\r
+ @param TimeStamp 64-bit time stamp.\r
+\r
+ @retval EFI_SUCCESS The data was read correctly from the device.\r
+ @retval EFI_OUT_OF_RESOURCES There are not enough resources to record the measurement.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+StartGauge (\r
+ IN CONST VOID *Handle, OPTIONAL\r
+ IN CONST CHAR8 *Token, OPTIONAL\r
+ IN CONST CHAR8 *Module, OPTIONAL\r
+ IN UINT64 TimeStamp\r
+ );\r
+\r
+/**\r
+ Searches the performance measurement log from the beginning of the log\r
+ for the first matching record that contains a zero end time and fills in a valid end time.\r
+\r
+ Searches the performance measurement log from the beginning of the log\r
+ for the first record that matches Handle, Token, and Module and has an end time value of zero.\r
+ If the record can not be found then return EFI_NOT_FOUND.\r
+ If the record is found and TimeStamp is not zero,\r
+ then the end time in the record is filled in with the value specified by TimeStamp.\r
+ If the record is found and TimeStamp is zero, then the end time in the matching record\r
+ is filled in with the current time stamp value.\r
+\r
+ @param Handle Pointer to environment specific context used\r
+ to identify the component being measured.\r
+ @param Token Pointer to a Null-terminated ASCII string\r
+ that identifies the component being measured.\r
+ @param Module Pointer to a Null-terminated ASCII string\r
+ that identifies the module being measured.\r
+ @param TimeStamp 64-bit time stamp.\r
+\r
+ @retval EFI_SUCCESS The end of the measurement was recorded.\r
+ @retval EFI_NOT_FOUND The specified measurement record could not be found.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EndGauge (\r
+ IN CONST VOID *Handle, OPTIONAL\r
+ IN CONST CHAR8 *Token, OPTIONAL\r
+ IN CONST CHAR8 *Module, OPTIONAL\r
+ IN UINT64 TimeStamp\r
+ );\r
+\r
+/**\r
+ Retrieves a previously logged performance measurement.\r
+\r
+ Retrieves the performance log entry from the performance log specified by LogEntryKey.\r
+ If it stands for a valid entry, then EFI_SUCCESS is returned and\r
+ GaugeDataEntry stores the pointer to that entry.\r
+\r
+ @param LogEntryKey The key for the previous performance measurement log entry.\r
+ If 0, then the first performance measurement log entry is retrieved.\r
+ @param GaugeDataEntry The indirect pointer to the gauge data entry specified by LogEntryKey\r
+ if the retrieval is successful.\r
+\r
+ @retval EFI_SUCCESS The GuageDataEntry is successfuly found based on LogEntryKey.\r
+ @retval EFI_NOT_FOUND The LogEntryKey is the last entry (equals to the total entry number).\r
+ @retval EFI_INVALIDE_PARAMETER The LogEntryKey is not a valid entry (greater than the total entry number).\r
+ @retval EFI_INVALIDE_PARAMETER GaugeDataEntry is NULL.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+GetGauge (\r
+ IN UINTN LogEntryKey,\r
+ OUT GAUGE_DATA_ENTRY **GaugeDataEntry\r
+ );\r
+\r
+\r
+#endif\r