Skip to content

Commit 90a0cbf

Browse files
committed
ArmPkg: StandaloneMmCoreEntryPoint: Move UUID conversion to common routine
As new interfaces are made available to support UUID-GUID conversion, this change is made to leverage new interfaces and remove the locally duplicated code. Signed-off-by: Kun Qin <[email protected]>
1 parent 3c99049 commit 90a0cbf

File tree

1 file changed

+1
-47
lines changed

1 file changed

+1
-47
lines changed

ArmPkg/Library/ArmStandaloneMmCoreEntryPoint/ArmStandaloneMmCoreEntryPoint.c

+1-47
Original file line numberDiff line numberDiff line change
@@ -796,52 +796,6 @@ InitializeMiscMmCommunicateBuffer (
796796
CopyGuid (&Buffer->HeaderGuid, ServiceGuid);
797797
}
798798

799-
/**
800-
Convert UUID to EFI_GUID format.
801-
for example, If there is EFI_GUID named
802-
"378daedc-f06b-4446-8314-40ab933c87a3",
803-
804-
EFI_GUID is saved in memory like:
805-
dc ae 8d 37
806-
6b f0 46 44
807-
83 14 40 ab
808-
93 3c 87 a3
809-
810-
However, UUID should be saved like:
811-
37 8d ae dc
812-
f0 6b 44 46
813-
83 14 40 ab
814-
93 3c 87 a3
815-
816-
FF-A and other software components (i.e. linux-kernel)
817-
uses below format.
818-
819-
To patch mm-service properly, the passed uuid should be converted to
820-
EFI_GUID format.
821-
822-
@param [in] Uuid Uuid
823-
@param [out] Guid EFI_GUID
824-
825-
**/
826-
STATIC
827-
VOID
828-
EFIAPI
829-
ConvertUuidToEfiGuid (
830-
IN UINT64 *Uuid,
831-
OUT EFI_GUID *Guid
832-
)
833-
{
834-
UINT32 *Data32;
835-
UINT16 *Data16;
836-
837-
Data32 = (UINT32 *)Uuid;
838-
Data32[0] = SwapBytes32 (Data32[0]);
839-
Data16 = (UINT16 *)&Data32[1];
840-
Data16[0] = SwapBytes16 (Data16[0]);
841-
Data16[1] = SwapBytes16 (Data16[1]);
842-
CopyGuid (Guid, (EFI_GUID *)Uuid);
843-
}
844-
845799
/**
846800
A loop to delegate events from SPMC.
847801
DelegatedEventLoop() calls ArmCallSvc() to exit to SPMC.
@@ -911,7 +865,7 @@ DelegatedEventLoop (
911865
FfaMsgInfo.DirectMsgVersion = DirectMsgV2;
912866
Uuid[0] = EventCompleteSvcArgs->Arg2;
913867
Uuid[1] = EventCompleteSvcArgs->Arg3;
914-
ConvertUuidToEfiGuid (Uuid, &ServiceGuid);
868+
ArmConvertUuidToEfiGuid (Uuid, &ServiceGuid);
915869
ServiceType = GetServiceType (&ServiceGuid);
916870
} else {
917871
Status = EFI_INVALID_PARAMETER;

0 commit comments

Comments
 (0)