Ring3: Added SysCallCloseProtocol.

This commit is contained in:
Mikhail Krichanov 2024-02-22 12:42:53 +03:00
parent 3c7863e47e
commit a00e407ac0
3 changed files with 35 additions and 2 deletions

View File

@ -441,7 +441,13 @@ Ring3CloseProtocol (
IN EFI_HANDLE ControllerHandle IN EFI_HANDLE ControllerHandle
) )
{ {
return EFI_UNSUPPORTED; return SysCall (
SysCallCloseProtocol,
UserHandle,
Protocol,
AgentHandle,
ControllerHandle
);
} }
EFI_STATUS EFI_STATUS

View File

@ -288,7 +288,7 @@ CallBootService (
case SysCallFreePool: case SysCallFreePool:
// //
// Argument 1: IN VOID *Buffer // Argument 1: VOID *Buffer
// //
DisableSMAP (); DisableSMAP ();
Status = gBS->FreePool ( Status = gBS->FreePool (
@ -298,6 +298,32 @@ CallBootService (
return Status; return Status;
case SysCallCloseProtocol:
//
// Argument 1: EFI_HANDLE CoreUserHandle
// Argument 2: EFI_GUID *Protocol
// Argument 3: EFI_HANDLE CoreAgentHandle
// Argument 4: EFI_HANDLE CoreControllerHandle
//
DisableSMAP ();
Status = FindGuid ((EFI_GUID *)CoreRbp->Argument2, &CoreProtocol, &MemoryCoreSize);
if (EFI_ERROR (Status)) {
EnableSMAP ();
return Status;
}
Argument4 = UserRsp->Arguments[4];
EnableSMAP ();
Status = gBS->CloseProtocol (
(EFI_HANDLE)CoreRbp->Argument1,
CoreProtocol,
(EFI_HANDLE)CoreRbp->Argument3,
(EFI_HANDLE)Argument4
);
return Status;
case SysCallBlockIoReset: case SysCallBlockIoReset:
// //
// Argument 1: EFI_BLOCK_IO_PROTOCOL *This // Argument 1: EFI_BLOCK_IO_PROTOCOL *This

View File

@ -2032,6 +2032,7 @@ typedef enum {
SysCallInstallMultipleProtocolInterfaces, SysCallInstallMultipleProtocolInterfaces,
SysCallAllocatePool, SysCallAllocatePool,
SysCallFreePool, SysCallFreePool,
SysCallCloseProtocol,
// //
// Protocols // Protocols
// //