mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-22 21:24:35 +02:00
Ring3: Added SysCallCalculateCrc32 wrapper.
This commit is contained in:
parent
7144df121c
commit
6c366a9d5f
@ -697,9 +697,12 @@ Ring3CalculateCrc32 (
|
||||
OUT UINT32 *Crc32
|
||||
)
|
||||
{
|
||||
DEBUG ((DEBUG_ERROR, "Ring3: CalculateCrc32 is not supported\n"));
|
||||
|
||||
return EFI_UNSUPPORTED;
|
||||
return SysCall (
|
||||
SysCallCalculateCrc32,
|
||||
Data,
|
||||
DataSize,
|
||||
Crc32
|
||||
);
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
|
@ -650,6 +650,42 @@ CallBootService (
|
||||
|
||||
return StatusBS;
|
||||
|
||||
case SysCallCalculateCrc32:
|
||||
//
|
||||
// Argument 1: VOID *Data
|
||||
// Argument 2: UINTN DataSize
|
||||
// Argument 3: UINT32 *Crc32
|
||||
//
|
||||
gCpu->GetMemoryAttributes (gCpu, (EFI_PHYSICAL_ADDRESS)CoreRbp->Argument1, &Attributes);
|
||||
ASSERT ((Attributes & EFI_MEMORY_USER) != 0);
|
||||
gCpu->GetMemoryAttributes (gCpu, (EFI_PHYSICAL_ADDRESS)(CoreRbp->Argument1 + CoreRbp->Argument2 - 1), &Attributes);
|
||||
ASSERT ((Attributes & EFI_MEMORY_USER) != 0);
|
||||
gCpu->GetMemoryAttributes (gCpu, (EFI_PHYSICAL_ADDRESS)CoreRbp->Argument3, &Attributes);
|
||||
ASSERT ((Attributes & EFI_MEMORY_USER) != 0);
|
||||
gCpu->GetMemoryAttributes (gCpu, (EFI_PHYSICAL_ADDRESS)(CoreRbp->Argument3 + sizeof (UINT32 *) - 1), &Attributes);
|
||||
ASSERT ((Attributes & EFI_MEMORY_USER) != 0);
|
||||
|
||||
Argument4 = (UINTN)AllocatePool (CoreRbp->Argument2);
|
||||
if ((VOID *)Argument4 == NULL) {
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
DisableSMAP ();
|
||||
CopyMem ((VOID *)Argument4, (VOID *)CoreRbp->Argument1, CoreRbp->Argument2);
|
||||
EnableSMAP ();
|
||||
|
||||
Status = gBS->CalculateCrc32 (
|
||||
(VOID *)Argument4,
|
||||
CoreRbp->Argument2,
|
||||
(UINT32 *)&Argument5
|
||||
);
|
||||
|
||||
DisableSMAP ();
|
||||
*(UINT32 *)CoreRbp->Argument3 = (UINT32)Argument5;
|
||||
EnableSMAP ();
|
||||
|
||||
return Status;
|
||||
|
||||
case SysCallGetVariable:
|
||||
//
|
||||
// Argument 1: CHAR16 *VariableName
|
||||
|
@ -2028,6 +2028,7 @@ typedef enum {
|
||||
SysCallRaiseTpl,
|
||||
SysCallRestoreTpl,
|
||||
SysCallLocateHandleBuffer,
|
||||
SysCallCalculateCrc32,
|
||||
//
|
||||
// RuntimeServices
|
||||
//
|
||||
|
Loading…
x
Reference in New Issue
Block a user