]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/Ia32/ReadPmc.c
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / ReadPmc.c
1 /** @file
2 AsmReadPmc function
3
4 Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 /**
10 Reads the current value of a Performance Counter (PMC).
11
12 Reads and returns the current value of performance counter specified by
13 Index. This function is only available on IA-32 and x64.
14
15 @param Index The 32-bit Performance Counter index to read.
16
17 @return The value of the PMC specified by Index.
18
19 **/
20 UINT64
21 EFIAPI
22 AsmReadPmc (
23 IN UINT32 Index
24 )
25 {
26 _asm {
27 mov ecx, Index
28 rdpmc
29 }
30 }