• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /** @file
2   AsmReadMsr64 function
3 
4   Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
5   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
AsmReadMsr64(IN UINT32 Index)34 AsmReadMsr64 (
35   IN UINT32  Index
36   )
37 {
38   _asm {
39     mov     ecx, Index
40     rdmsr
41   }
42 }
43 
44