]>
Commit | Line | Data |
---|---|---|
e1f414b6 | 1 | /** @file\r |
2 | AsmReadPmc function\r | |
3 | \r | |
bb817c56 | 4 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r |
9344f092 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
e1f414b6 | 6 | \r |
7 | **/\r | |
8 | \r | |
42eedea9 | 9 | /**\r |
10 | Reads the current value of a Performance Counter (PMC).\r | |
11 | \r | |
12 | Reads and returns the current value of performance counter specified by\r | |
030cd1a2 | 13 | Index. This function is only available on IA-32 and x64.\r |
42eedea9 | 14 | \r |
15 | @param Index The 32-bit Performance Counter index to read.\r | |
16 | \r | |
17 | @return The value of the PMC specified by Index.\r | |
18 | \r | |
19 | **/\r | |
e1f414b6 | 20 | UINT64\r |
21 | EFIAPI\r | |
22 | AsmReadPmc (\r | |
44b013bd | 23 | IN UINT32 Index\r |
e1f414b6 | 24 | )\r |
25 | {\r | |
26 | _asm {\r | |
44b013bd | 27 | mov ecx, Index\r |
e1f414b6 | 28 | rdpmc\r |
29 | }\r | |
30 | }\r | |
31 | \r |