Ring3: Added SysCallCloseProtocol.

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

View File

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

View File

@ -288,7 +288,7 @@ CallBootService (
case SysCallFreePool:
//
// Argument 1: IN VOID *Buffer
// Argument 1: VOID *Buffer
//
DisableSMAP ();
Status = gBS->FreePool (
@ -298,6 +298,32 @@ CallBootService (
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:
//
// Argument 1: EFI_BLOCK_IO_PROTOCOL *This

View File

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