mirror of
https://github.com/acidanthera/audk.git
synced 2025-08-16 23:28:09 +02:00
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>
31 lines
617 B
NASM
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
|