mirror of
https://github.com/acidanthera/audk.git
synced 2025-08-16 15:18:10 +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
622 B
ArmAsm
31 lines
622 B
ArmAsm
#------------------------------------------------------------------------------
|
|
#
|
|
# ArmReadCntPctReg() for AArch64
|
|
#
|
|
# Copyright (c) 2023 - 2024, Arm Limited. All rights reserved.<BR>
|
|
#
|
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
#
|
|
#------------------------------------------------------------------------------
|
|
|
|
.text
|
|
.p2align 2
|
|
GCC_ASM_EXPORT(ArmReadCntPctReg)
|
|
|
|
#/**
|
|
# Reads the CNTPCT_EL0 Register.
|
|
#
|
|
# @return The contents of the CNTPCT_EL0 register.
|
|
#
|
|
#**/
|
|
#UINT64
|
|
#EFIAPI
|
|
#ArmReadCntPctReg (
|
|
# VOID
|
|
# );
|
|
#
|
|
ASM_PFX(ArmReadCntPctReg):
|
|
AARCH64_BTI(c)
|
|
mrs x0, cntpct_el0
|
|
ret
|