]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdePkg/Library/BaseLib/Ia32/ReadMsr64.c
MdePkg/BaseLib: Support IA32 processors without CLFLUSH
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / ReadMsr64.c
... / ...
CommitLineData
1/** @file\r
2 AsmReadMsr64 function\r
3\r
4 Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
5 This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php.\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15\r
16\r
17\r
18/**\r
19 Returns a 64-bit Machine Specific Register(MSR).\r
20\r
21 Reads and returns the 64-bit MSR specified by Index. No parameter checking is\r
22 performed on Index, and some Index values may cause CPU exceptions. The\r
23 caller must either guarantee that Index is valid, or the caller must set up\r
24 exception handlers to catch the exceptions. This function is only available\r
25 on IA-32 and x64.\r
26\r
27 @param Index The 32-bit MSR index to read.\r
28\r
29 @return The value of the MSR identified by Index.\r
30\r
31**/\r
32UINT64\r
33EFIAPI\r
34AsmReadMsr64 (\r
35 IN UINT32 Index\r
36 )\r
37{\r
38 _asm {\r
39 mov ecx, Index\r
40 rdmsr\r
41 }\r
42}\r
43\r