From c06ad33ed2fbbacdba42baf07f5d3fd41b36781d Mon Sep 17 00:00:00 2001 From: darylm503 Date: Fri, 23 Apr 2010 17:00:32 +0000 Subject: Libraries and utilities for instrumenting regions of code and measuring their performance. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10417 6f19259b-4bc3-4df7-8a09-765794883524 --- PerformancePkg/Include/Ich/GenericIch.h | 54 ++++++++++++++++++++++++++++++ PerformancePkg/Include/PerformanceTokens.h | 28 ++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 PerformancePkg/Include/Ich/GenericIch.h create mode 100644 PerformancePkg/Include/PerformanceTokens.h (limited to 'PerformancePkg/Include') diff --git a/PerformancePkg/Include/Ich/GenericIch.h b/PerformancePkg/Include/Ich/GenericIch.h new file mode 100644 index 0000000000..67af774f40 --- /dev/null +++ b/PerformancePkg/Include/Ich/GenericIch.h @@ -0,0 +1,54 @@ +/** @file + Generic definitions for registers in the Intel Ich devices. + + These definitions should work for any version of Ich. + + Copyright (c) 2009-2010, Intel Corporation. All rights reserved.
+ This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#ifndef _GENERIC_ICH_H_ +#define _GENERIC_ICH_H_ + +/** @defgroup GenericIchDefs Generic ICH Definitions. + +Definitions beginning with "R_" are registers. +Definitions beginning with "B_" are bits within registers. +Definitions beginning with "V_" are meaningful values of bits within the registers. +**/ +///@{ + +/// @defgroup IchPciAddressing PCI Bus Address for ICH. +///@{ +#define PCI_BUS_NUMBER_ICH 0x00 ///< ICH is on PCI Bus 0. +#define PCI_DEVICE_NUMBER_ICH_LPC 31 ///< ICH is Device 31. +#define PCI_FUNCTION_NUMBER_ICH_LPC 0 ///< ICH is Function 0. +///@} + +/// @defgroup IchAcpiCntr Control for the ICH's ACPI Counter. +///@{ +#define R_ICH_LPC_ACPI_BASE 0x40 +#define R_ICH_LPC_ACPI_CNT 0x44 +#define B_ICH_LPC_ACPI_CNT_ACPI_EN 0x80 +///@} + +/// @defgroup IchAcpiTimer The ICH's ACPI Timer. +///@{ +#define R_ACPI_PM1_TMR 0x08 +#define V_ACPI_TMR_FREQUENCY 3579545 +#define V_ACPI_PM1_TMR_MAX_VAL 0x1000000 ///< The timer is 24 bit overflow. +///@} + +/// Macro to generate the PCI address of any given ICH Register. +#define PCI_ICH_LPC_ADDRESS(Register) \ + ((UINTN)(PCI_LIB_ADDRESS (PCI_BUS_NUMBER_ICH, PCI_DEVICE_NUMBER_ICH_LPC, PCI_FUNCTION_NUMBER_ICH_LPC, Register))) + +///@} +#endif // _GENERIC_ICH_H_ diff --git a/PerformancePkg/Include/PerformanceTokens.h b/PerformancePkg/Include/PerformanceTokens.h new file mode 100644 index 0000000000..8a69415a30 --- /dev/null +++ b/PerformancePkg/Include/PerformanceTokens.h @@ -0,0 +1,28 @@ +/** @file + ASCII String Literals with special meaning to Performance measurement and the Dp utility. + +Copyright (c) 2009-2010, Intel Corporation. All rights reserved.
+This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#ifndef __PERFORMANCE_TOKENS_H__ +#define __PERFORMANCE_TOKENS_H__ + +#define SEC_TOK "SEC" ///< SEC Phase +#define DXE_TOK "DXE" ///< DEC Phase +#define SHELL_TOK "SHELL" ///< Shell Phase +#define PEI_TOK "PEI" ///< PEI Phase +#define BDS_TOK "BDS" ///< BDS Phase +#define DRIVERBINDING_START_TOK "DB:Start:" ///< Driver Binding Start() function call +#define DRIVERBINDING_SUPPORT_TOK "DB:Support:" ///< Driver Binding Support() function call +#define LOAD_IMAGE_TOK "LoadImage:" ///< Load a dispatched module +#define START_IMAGE_TOK "StartImage:" ///< Dispatched Modules Entry Point execution + +#endif // __PERFORMANCE_TOKENS_H__ -- cgit v1.2.3