ArmVirtQemu may execute at EL2, in which case monitor calls are generally made using SMC instructions instead of HVC instructions. Whether or not this is the case can only be decided at runtime, and so the associated PCD needs to be settable at runtime, if the platform definition chooses so. This implies a boolean PCD, given that a feature PCD is build-time configurable only. Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Sami Mujawar <sami.mujawar@arm.com> Committed-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Doug Flick [MSFT] <doug.edk2@gmail.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
35 lines
775 B
C
35 lines
775 B
C
/** @file
|
|
Arm Monitor Library.
|
|
|
|
Copyright (c) 2022, Arm Limited. All rights reserved.<BR>
|
|
|
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
|
|
**/
|
|
|
|
#include <Library/ArmHvcLib.h>
|
|
#include <Library/ArmMonitorLib.h>
|
|
#include <Library/ArmSmcLib.h>
|
|
#include <Library/PcdLib.h>
|
|
|
|
/** Monitor call.
|
|
|
|
An HyperVisor Call (HVC) or System Monitor Call (SMC) will be issued
|
|
depending on the default conduit. PcdMonitorConduitHvc determines the type
|
|
of the call: if true, do an HVC.
|
|
|
|
@param [in,out] Args Arguments for the HVC/SMC.
|
|
**/
|
|
VOID
|
|
EFIAPI
|
|
ArmMonitorCall (
|
|
IN OUT ARM_MONITOR_ARGS *Args
|
|
)
|
|
{
|
|
if (PcdGetBool (PcdMonitorConduitHvc)) {
|
|
ArmCallHvc ((ARM_HVC_ARGS *)Args);
|
|
} else {
|
|
ArmCallSmc ((ARM_SMC_ARGS *)Args);
|
|
}
|
|
}
|