mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
MdePkg: Add helper function to detect RME
Add helper function to check if the Realm Management Extension (RME) is implemented by the hardware. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Leif Lindholm <leif.lindholm@oss.qualcomm.com> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
This commit is contained in:
parent
c31b880bd2
commit
5bdf8acc13
3 changed files with 28 additions and 2 deletions
|
|
@ -36,6 +36,7 @@
|
|||
// ID_AA64PFR0 - AArch64 Processor Feature Register 0 definitions
|
||||
#define AARCH64_PFR0_FP (0xF << 16)
|
||||
#define AARCH64_PFR0_GIC (0xF << 24)
|
||||
#define AARCH64_PFR0_RME (0xFULL << 52)
|
||||
|
||||
// ID_AA64PFR2 - AArch64 Processor Feature Register 2 definitions
|
||||
#define AARCH64_PFR2_GCIE (0xF << 12)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/** @file
|
||||
|
||||
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
|
||||
Copyright (c) 2011 - 2016, ARM Ltd. All rights reserved.<BR>
|
||||
Copyright (c) 2011 - 2023, Arm Limited. All rights reserved.<BR>
|
||||
Copyright (c) 2020 - 2021, NUVIA Inc. All rights reserved.<BR>
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
|
@ -721,3 +721,14 @@ EFIAPI
|
|||
ArmHas52BitTgran4 (
|
||||
VOID
|
||||
);
|
||||
|
||||
/** Checks if RME is implemented.
|
||||
|
||||
@retval TRUE RME is implemented.
|
||||
@retval FALSE RME is not implemented.
|
||||
**/
|
||||
BOOLEAN
|
||||
EFIAPI
|
||||
ArmHasRme (
|
||||
VOID
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/** @file
|
||||
|
||||
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
|
||||
Portions copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.<BR>
|
||||
Portions copyright (c) 2011 - 2023, Arm Limited. All rights reserved.<BR>
|
||||
Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
|
@ -127,3 +127,17 @@ ArmHas52BitTgran4 (
|
|||
|
||||
return ((Mmfr0 & AARCH64_MMFR0_TGRAN4_MASK) == AARCH64_MMFR0_TGRAN4_52BITS);
|
||||
}
|
||||
|
||||
/** Checks if RME is implemented.
|
||||
|
||||
@retval TRUE RME is implemented.
|
||||
@retval FALSE RME is not implemented.
|
||||
**/
|
||||
BOOLEAN
|
||||
EFIAPI
|
||||
ArmHasRme (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
return ((ArmReadIdAA64Pfr0 () & AARCH64_PFR0_RME) != 0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue