51 IN OUT VOID *CommBuffer,
67 if ((
PcdGet64 (PcdMmBufferBase) == 0) || (
PcdGet64 (PcdMmBufferSize) == 0)) {
68 ASSERT (
PcdGet64 (PcdMmBufferSize) > 0);
69 ASSERT (
PcdGet64 (PcdMmBufferBase) != 0);
70 return EFI_UNSUPPORTED;
76 if ((CommBuffer ==
NULL) || (CommSize ==
NULL)) {
77 ASSERT (CommBuffer !=
NULL);
78 ASSERT (CommSize !=
NULL);
79 return EFI_INVALID_PARAMETER;
85 if ((*CommSize == 0) || (*CommSize > (
UINTN)
PcdGet64 (PcdMmBufferSize))) {
88 "%a Invalid CommSize value 0x%llx!\n",
93 return EFI_BAD_BUFFER_SIZE;
110 if (*CommSize != BufferSize) {
113 "%a Unexpected CommSize value, has: 0x%llx vs. expected: 0x%llx!\n",
118 return EFI_INVALID_PARAMETER;
124 CopyMem (CommunicateHeader, CommBuffer, *CommSize);
127 CommunicateSmcArgs.Arg0 = ARM_SMC_ID_MM_COMMUNICATE_AARCH64;
130 CommunicateSmcArgs.Arg1 = 0;
133 CommunicateSmcArgs.Arg2 = (
UINTN)CommunicateHeader;
136 CommunicateSmcArgs.Arg3 = 0;
141 switch (CommunicateSmcArgs.Arg0) {
142 case ARM_SMC_MM_RET_SUCCESS:
152 "%a Returned buffer exceeds communication buffer limit. Has: 0x%llx vs. max: 0x%llx!\n",
157 Status = EFI_BAD_BUFFER_SIZE;
161 CopyMem (CommBuffer, CommunicateHeader, BufferSize);
162 *CommSize = BufferSize;
166 case ARM_SMC_MM_RET_INVALID_PARAMS:
167 Status = EFI_INVALID_PARAMETER;
170 case ARM_SMC_MM_RET_DENIED:
171 Status = EFI_ACCESS_DENIED;
174 case ARM_SMC_MM_RET_NO_MEMORY:
177 Status = EFI_OUT_OF_RESOURCES;
182 Status = EFI_ACCESS_DENIED;
198 (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
199 &gEfiPeiMmCommunicationPpiGuid,
200 (VOID *)&mPeiMmCommunication
215MmCommunicationPeiInitialize (
VOID ArmCallSmc(IN OUT ARM_SMC_ARGS *Args)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
EFI_STATUS EFIAPI PeiServicesInstallPpi(IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList)
#define DEBUG(Expression)
#define PcdGet64(TokenName)
VOID * EFI_PEI_FILE_HANDLE