CloverBootloader/MdePkg/Library/BaseLib/X64/ReadMsr64.nasm

35 lines
834 B
NASM
Raw Normal View History

;------------------------------------------------------------------------------
;
; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
; SPDX-License-Identifier: BSD-2-Clause-Patent
;
; Module Name:
;
; ReadMsr64.Asm
;
; Abstract:
;
; AsmReadMsr64 function
;
; Notes:
;
;------------------------------------------------------------------------------
DEFAULT REL
SECTION .text
;------------------------------------------------------------------------------
; UINT64
; EFIAPI
; AsmReadMsr64 (
; IN UINT32 Index
; );
;------------------------------------------------------------------------------
global ASM_PFX(AsmReadMsr64)
ASM_PFX(AsmReadMsr64):
rdmsr ; edx & eax are zero extended
shl rdx, 0x20
or rax, rdx
ret