]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdePkg/Library/BaseLib/Ia32/ReadMsr64.c
MdePkg: Replace BSD License with BSD+Patent License
[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 SPDX-License-Identifier: BSD-2-Clause-Patent\r
6\r
7**/\r
8\r
9\r
10\r
11\r
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
19 on IA-32 and x64.\r
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
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