]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseLib/Ia32/ReadMsr64.c
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / ReadMsr64.c
CommitLineData
e1f414b6 1/** @file\r
2 AsmReadMsr64 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
1efcc4ae 9\r
f734a10a 10\r
e1f414b6 11\r
42eedea9 12/**\r
13 Returns a 64-bit Machine Specific Register(MSR).\r
14\r
15 Reads and returns the 64-bit MSR specified by Index. No parameter checking is\r
16 performed on Index, and some Index values may cause CPU exceptions. The\r
17 caller must either guarantee that Index is valid, or the caller must set up\r
18 exception handlers to catch the exceptions. This function is only available\r
030cd1a2 19 on IA-32 and x64.\r
42eedea9 20\r
21 @param Index The 32-bit MSR index to read.\r
22\r
23 @return The value of the MSR identified by Index.\r
24\r
25**/\r
e1f414b6 26UINT64\r
27EFIAPI\r
28AsmReadMsr64 (\r
29 IN UINT32 Index\r
30 )\r
31{\r
32 _asm {\r
33 mov ecx, Index\r
34 rdmsr\r
35 }\r
36}\r
37\r