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