audk/MdePkg/Library/BaseLib/AArch64/ArmReadCntPctReg.asm
Pierre Gondois a72d93e163 MdePkg/BaseLib: AARCH64: Add ArmReadCntPctReg()
To enable AARCH64 native instruction support for Openssl,
some interfaces must be implemented. OPENSSL_rdtsc() requests
an access to a counter to get some non-trusted entropy.

Add ArmReadCntPctReg() to read system count.
A similar ArmReadCntPct() function is available in the ArmPkg,
but the CryptoPkg where OPENSSL_rdtsc will reside cannot rely
on the ArmPkg.

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
2024-08-01 13:41:01 +00:00

31 lines
617 B
NASM

;------------------------------------------------------------------------------
;
; ArmReadCntPctReg() for AArch64
;
; Copyright (c) 2023 - 2024, Arm Limited. All rights reserved.<BR>
;
; SPDX-License-Identifier: BSD-2-Clause-Patent
;
;------------------------------------------------------------------------------
EXPORT ArmReadCntPctReg
AREA BaseLib_LowLevel, CODE, READONLY
;/**
; Reads the CNTPCT_EL0 Register.
;
; @return The contents of the CNTPCT_EL0 register.
;
;**/
;UINT64
;EFIAPI
;ArmReadCntPctReg (
; VOID
; );
;
ArmReadCntPctReg
mrs x0, cntpct_el0
ret
END