]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseLib/Ia32/ReadMsr64.c
MdePkg/BaseLib: Support IA32 processors without CLFLUSH
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / ReadMsr64.c
CommitLineData
e1f414b6 1/** @file\r
2 AsmReadMsr64 function\r
3\r
bb817c56
HT
4 Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
5 This program and the accompanying materials\r
e1f414b6 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
e4a34497 8 http://opensource.org/licenses/bsd-license.php.\r
e1f414b6 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
1efcc4ae 15\r
f734a10a 16\r
e1f414b6 17\r
42eedea9 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
030cd1a2 25 on IA-32 and x64.\r
42eedea9 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
e1f414b6 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