]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/Ia32/ReadMsr64.c
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / ReadMsr64.c
1 /** @file
2 AsmReadMsr64 function
3
4 Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9
10
11
12 /**
13 Returns a 64-bit Machine Specific Register(MSR).
14
15 Reads and returns the 64-bit MSR specified by Index. No parameter checking is
16 performed on Index, and some Index values may cause CPU exceptions. The
17 caller must either guarantee that Index is valid, or the caller must set up
18 exception handlers to catch the exceptions. This function is only available
19 on IA-32 and x64.
20
21 @param Index The 32-bit MSR index to read.
22
23 @return The value of the MSR identified by Index.
24
25 **/
26 UINT64
27 EFIAPI
28 AsmReadMsr64 (
29 IN UINT32 Index
30 )
31 {
32 _asm {
33 mov ecx, Index
34 rdmsr
35 }
36 }
37