mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
ArmCcaLib provides helper functions for detecting Realm execution state and caching Realm IPA width. These helpers build on the architectural Arm CCA RSI library and are not specific to ArmVirtPkg. Therefore, move ArmCcaLib, ArmCcaLibNull, their public header, and related GUID declarations to MdeModulePkg. Update ArmVirtPkg library mappings and consumers to use the new MdeModulePkg library instances. Continuous-integration-options: PatchCheck.ignore-multi-package Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
74 lines
2.1 KiB
C
74 lines
2.1 KiB
C
/** @file
|
|
Null implemmentation of the ArmCcaLib library.
|
|
|
|
Copyright (c) 2022 - 2023, Arm Limited. All rights reserved.<BR>
|
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
|
|
@par Glossary:
|
|
- Rsi or RSI - Realm Service Interface
|
|
- IPA - Intermediate Physical Address
|
|
- RIPAS - Realm IPA state
|
|
**/
|
|
#include <Base.h>
|
|
|
|
/**
|
|
Check if running in a Realm.
|
|
|
|
@retval TRUE The execution is within the context of a Realm.
|
|
@retval FALSE The execution is not within the context of a Realm.
|
|
**/
|
|
BOOLEAN
|
|
EFIAPI
|
|
ArmCcaIsRealm (
|
|
VOID
|
|
)
|
|
{
|
|
return FALSE;
|
|
}
|
|
|
|
/**
|
|
Return the IPA width of the Realm.
|
|
|
|
The IPA width of the Realm is used to configure the protection attribute
|
|
for memory regions, see ArmCcaSetMemoryProtectionAttribute().
|
|
|
|
@param [out] IpaWidth IPA width of the Realm.
|
|
|
|
@retval RETURN_SUCCESS Success.
|
|
@retval RETURN_INVALID_PARAMETER A parameter is invalid.
|
|
@retval RETURN_UNSUPPORTED The execution is not within the
|
|
context of a Realm.
|
|
**/
|
|
RETURN_STATUS
|
|
EFIAPI
|
|
ArmCcaGetIpaWidth (
|
|
OUT UINT64 *IpaWidth
|
|
)
|
|
{
|
|
return RETURN_UNSUPPORTED;
|
|
}
|
|
|
|
/** Check if the address range is protected MMIO
|
|
|
|
@param [in] BaseAddress Base address of the device MMIO region.
|
|
@param [in] Length Length of the device MMIO region.
|
|
@param [out] IsProtectedMmio TRUE - if the RIPAS for the address range is
|
|
protected MMIO.
|
|
FALSE - if the RIPAS for the address range is
|
|
not protected MMIO.
|
|
|
|
@retval RETURN_SUCCESS Success.
|
|
@retval RETURN_INVALID_PARAMETER A parameter is invalid.
|
|
@retval RETURN_UNSUPPORTED The request is not initiated in a
|
|
Realm.
|
|
**/
|
|
RETURN_STATUS
|
|
EFIAPI
|
|
ArmCcaMemRangeIsProtectedMmio (
|
|
IN UINT64 BaseAddress,
|
|
IN UINT64 Length,
|
|
OUT BOOLEAN *IsProtectedMmio
|
|
)
|
|
{
|
|
return RETURN_UNSUPPORTED;
|
|
}
|