diff --git a/MdePkg/Library/BaseLib/BaseLib.inf b/MdePkg/Library/BaseLib/BaseLib.inf index 3dc5cd4d0a..e208e7a5d2 100644 --- a/MdePkg/Library/BaseLib/BaseLib.inf +++ b/MdePkg/Library/BaseLib/BaseLib.inf @@ -471,6 +471,7 @@ X64/Monitor.asm | MSFT X64/ReadPmc.nasm| MSFT X64/ReadPmc.asm | MSFT + X64/ReadTsc.nasm| MSFT X64/ReadTsc.asm | MSFT X64/WriteMm7.asm | MSFT X64/WriteMm6.asm | MSFT @@ -556,6 +557,7 @@ X64/Monitor.asm | INTEL X64/ReadPmc.nasm| INTEL X64/ReadPmc.asm | INTEL + X64/ReadTsc.nasm| INTEL X64/ReadTsc.asm | INTEL X64/WriteMm7.asm | INTEL X64/WriteMm6.asm | INTEL diff --git a/MdePkg/Library/BaseLib/X64/ReadTsc.nasm b/MdePkg/Library/BaseLib/X64/ReadTsc.nasm new file mode 100644 index 0000000000..457322cfe0 --- /dev/null +++ b/MdePkg/Library/BaseLib/X64/ReadTsc.nasm @@ -0,0 +1,40 @@ +;------------------------------------------------------------------------------ +; +; Copyright (c) 2006, Intel Corporation. All rights reserved.
+; This program and the accompanying materials +; are licensed and made available under the terms and conditions of the BSD License +; which accompanies this distribution. The full text of the license may be found at +; http://opensource.org/licenses/bsd-license.php. +; +; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +; +; Module Name: +; +; ReadTsc.Asm +; +; Abstract: +; +; AsmReadTsc function +; +; Notes: +; +;------------------------------------------------------------------------------ + + DEFAULT REL + SECTION .text + +;------------------------------------------------------------------------------ +; UINT64 +; EFIAPI +; AsmReadTsc ( +; VOID +; ); +;------------------------------------------------------------------------------ +global ASM_PFX(AsmReadTsc) +ASM_PFX(AsmReadTsc): + rdtsc + shl rdx, 0x20 + or rax, rdx + ret +