Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions MdeModulePkg/Library/ArmFfaLib/ArmFfaCommon.c
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,7 @@ ArmFfaLibPartitionInfoGet (

@param [in] PartId Partition id
@param [in] CpuNumber Cpu number in partition
@param [out] CtxFfaArgs Optional context of FFA_ARGS

@retval EFI_SUCCESS
@retval Other Error
Expand All @@ -561,11 +562,13 @@ ArmFfaLibPartitionInfoGet (
EFI_STATUS
EFIAPI
ArmFfaLibRun (
IN UINT16 PartId,
IN UINT16 CpuNumber
IN UINT16 PartId,
IN UINT16 CpuNumber,
OUT ARM_FFA_ARGS *CtxFfaArgs OPTIONAL
)
{
ARM_FFA_ARGS FfaArgs;
EFI_STATUS Status;

ZeroMem (&FfaArgs, sizeof (ARM_FFA_ARGS));

Expand All @@ -574,7 +577,16 @@ ArmFfaLibRun (

ArmCallFfa (&FfaArgs);

return FfaArgsToEfiStatus (&FfaArgs);
Status = FfaArgsToEfiStatus (&FfaArgs);
if (EFI_ERROR (Status)) {
return Status;
}

if (CtxFfaArgs != NULL) {
CopyMem (CtxFfaArgs, &FfaArgs, sizeof (ARM_FFA_ARGS));
}

return Status;
}

/**
Expand Down
8 changes: 5 additions & 3 deletions MdePkg/Include/Library/ArmFfaLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,11 @@ ArmFfaLibSpmIdGet (
);

/**
Restore context which interrupted with FFA_INTERRUPT (EFI_INTERRUPT_PENDING).
Restore the context which was interrupted with FFA_INTERRUPT (EFI_INTERRUPT_PENDING).

@param [in] PartId Partition id
@param [in] CpuNumber Cpu number in partition
@param [out] CtxFfaArgs Optional context of FFA_ARGS

@retval EFI_SUCCESS
@retval Other Error
Expand All @@ -309,8 +310,9 @@ ArmFfaLibSpmIdGet (
EFI_STATUS
EFIAPI
ArmFfaLibRun (
IN UINT16 PartId,
IN UINT16 CpuNumber
IN UINT16 PartId,
IN UINT16 CpuNumber,
OUT ARM_FFA_ARGS *CtxFfaArgs OPTIONAL
);

/**
Expand Down