mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-23 05:34:31 +02:00
Ring3: Added SysCallFreePool,
fixed wrappers for EFI_DRIVER_BINDING_PROTOCOL.
This commit is contained in:
parent
77bb186c8a
commit
3d8a6585a1
@ -98,7 +98,17 @@ Ring3FreePool (
|
|||||||
IN VOID *Buffer
|
IN VOID *Buffer
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return EFI_UNSUPPORTED;
|
EFI_STATUS Status;
|
||||||
|
|
||||||
|
Status = SysCall (
|
||||||
|
SysCallFreePool,
|
||||||
|
Buffer
|
||||||
|
);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: Failed to free buffer.\n"));
|
||||||
|
}
|
||||||
|
|
||||||
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
|
@ -95,7 +95,6 @@ CallBootService (
|
|||||||
DisableSMAP ();
|
DisableSMAP ();
|
||||||
Interface = AllocateRing3Copy (Interface, MemoryCoreSize, MemoryCoreSize);
|
Interface = AllocateRing3Copy (Interface, MemoryCoreSize, MemoryCoreSize);
|
||||||
if (Interface == NULL) {
|
if (Interface == NULL) {
|
||||||
DEBUG ((DEBUG_ERROR, "Ring0: Failed to allocate pages for Ring3 PROTOCOL structure.\n"));
|
|
||||||
EnableSMAP ();
|
EnableSMAP ();
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
@ -141,7 +140,6 @@ CallBootService (
|
|||||||
DisableSMAP ();
|
DisableSMAP ();
|
||||||
Interface = AllocateRing3Copy (Interface, MemoryCoreSize, MemoryCoreSize);
|
Interface = AllocateRing3Copy (Interface, MemoryCoreSize, MemoryCoreSize);
|
||||||
if (Interface == NULL) {
|
if (Interface == NULL) {
|
||||||
DEBUG ((DEBUG_ERROR, "Ring0: Failed to allocate pages for Ring3 PROTOCOL structure.\n"));
|
|
||||||
EnableSMAP ();
|
EnableSMAP ();
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
@ -219,6 +217,18 @@ CallBootService (
|
|||||||
);
|
);
|
||||||
EnableSMAP ();
|
EnableSMAP ();
|
||||||
|
|
||||||
|
return Status;
|
||||||
|
|
||||||
|
case SysCallFreePool:
|
||||||
|
//
|
||||||
|
// Argument 1: IN VOID *Buffer
|
||||||
|
//
|
||||||
|
DisableSMAP ();
|
||||||
|
Status = gBS->FreePool (
|
||||||
|
(VOID *)CoreRbp->Argument1
|
||||||
|
);
|
||||||
|
EnableSMAP ();
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -55,13 +55,33 @@ CoreDriverBindingSupported (
|
|||||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
|
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return GoToRing3 (
|
EFI_STATUS Status;
|
||||||
3,
|
|
||||||
(VOID *)mRing3DriverBindingProtocol.Supported,
|
DisableSMAP ();
|
||||||
|
This = AllocateRing3Copy (
|
||||||
This,
|
This,
|
||||||
ControllerHandle,
|
sizeof (EFI_DRIVER_BINDING_PROTOCOL),
|
||||||
RemainingDevicePath
|
sizeof (EFI_DRIVER_BINDING_PROTOCOL)
|
||||||
);
|
);
|
||||||
|
if (This == NULL) {
|
||||||
|
EnableSMAP ();
|
||||||
|
return EFI_OUT_OF_RESOURCES;
|
||||||
|
}
|
||||||
|
EnableSMAP ();
|
||||||
|
|
||||||
|
Status = GoToRing3 (
|
||||||
|
3,
|
||||||
|
(VOID *)mRing3DriverBindingProtocol.Supported,
|
||||||
|
This,
|
||||||
|
ControllerHandle,
|
||||||
|
RemainingDevicePath
|
||||||
|
);
|
||||||
|
|
||||||
|
DisableSMAP ();
|
||||||
|
FreePool (This);
|
||||||
|
EnableSMAP ();
|
||||||
|
|
||||||
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
@ -72,13 +92,33 @@ CoreDriverBindingStart (
|
|||||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
|
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return GoToRing3 (
|
EFI_STATUS Status;
|
||||||
3,
|
|
||||||
(VOID *)mRing3DriverBindingProtocol.Start,
|
DisableSMAP ();
|
||||||
|
This = AllocateRing3Copy (
|
||||||
This,
|
This,
|
||||||
ControllerHandle,
|
sizeof (EFI_DRIVER_BINDING_PROTOCOL),
|
||||||
RemainingDevicePath
|
sizeof (EFI_DRIVER_BINDING_PROTOCOL)
|
||||||
);
|
);
|
||||||
|
if (This == NULL) {
|
||||||
|
EnableSMAP ();
|
||||||
|
return EFI_OUT_OF_RESOURCES;
|
||||||
|
}
|
||||||
|
EnableSMAP ();
|
||||||
|
|
||||||
|
Status = GoToRing3 (
|
||||||
|
3,
|
||||||
|
(VOID *)mRing3DriverBindingProtocol.Start,
|
||||||
|
This,
|
||||||
|
ControllerHandle,
|
||||||
|
RemainingDevicePath
|
||||||
|
);
|
||||||
|
|
||||||
|
DisableSMAP ();
|
||||||
|
FreePool (This);
|
||||||
|
EnableSMAP ();
|
||||||
|
|
||||||
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
@ -90,12 +130,32 @@ CoreDriverBindingStop (
|
|||||||
IN EFI_HANDLE *ChildHandleBuffer OPTIONAL
|
IN EFI_HANDLE *ChildHandleBuffer OPTIONAL
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return GoToRing3 (
|
EFI_STATUS Status;
|
||||||
4,
|
|
||||||
(VOID *)mRing3DriverBindingProtocol.Stop,
|
DisableSMAP ();
|
||||||
|
This = AllocateRing3Copy (
|
||||||
This,
|
This,
|
||||||
ControllerHandle,
|
sizeof (EFI_DRIVER_BINDING_PROTOCOL),
|
||||||
NumberOfChildren,
|
sizeof (EFI_DRIVER_BINDING_PROTOCOL)
|
||||||
ChildHandleBuffer
|
|
||||||
);
|
);
|
||||||
|
if (This == NULL) {
|
||||||
|
EnableSMAP ();
|
||||||
|
return EFI_OUT_OF_RESOURCES;
|
||||||
|
}
|
||||||
|
EnableSMAP ();
|
||||||
|
|
||||||
|
Status = GoToRing3 (
|
||||||
|
4,
|
||||||
|
(VOID *)mRing3DriverBindingProtocol.Stop,
|
||||||
|
This,
|
||||||
|
ControllerHandle,
|
||||||
|
NumberOfChildren,
|
||||||
|
ChildHandleBuffer
|
||||||
|
);
|
||||||
|
|
||||||
|
DisableSMAP ();
|
||||||
|
FreePool (This);
|
||||||
|
EnableSMAP ();
|
||||||
|
|
||||||
|
return Status;
|
||||||
}
|
}
|
||||||
|
@ -2019,6 +2019,7 @@ typedef enum {
|
|||||||
SysCallOpenProtocol,
|
SysCallOpenProtocol,
|
||||||
SysCallInstallMultipleProtocolInterfaces,
|
SysCallInstallMultipleProtocolInterfaces,
|
||||||
SysCallAllocatePool,
|
SysCallAllocatePool,
|
||||||
|
SysCallFreePool,
|
||||||
SysCallMax
|
SysCallMax
|
||||||
} SYS_CALL_TYPE;
|
} SYS_CALL_TYPE;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user