mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-23 23:59:22 +00:00
efi: Create the grub_efi_close_protocol() library function
Create a library function for CloseProtocol() and use it for the SNP driver. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
1 parent
efd9406e12
commit
d0219bffc7
3 files changed
+12
-6
No files matched your search
@@ -117,6 +117,14 @@ grub_efi_open_protocol (grub_efi_handle_t handle,
|
|||||||
return interface;
|
return interface;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
grub_efi_status_t
|
||||||
|
grub_efi_close_protocol (grub_efi_handle_t handle, grub_efi_guid_t *protocol)
|
||||||
|
{
|
||||||
|
grub_efi_boot_services_t *b = grub_efi_system_table->boot_services;
|
||||||
|
|
||||||
|
return efi_call_4 (b->close_protocol, handle, protocol, grub_efi_image_handle, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
grub_efi_set_text_mode (int on)
|
grub_efi_set_text_mode (int on)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -156,9 +156,7 @@ open_card (struct grub_net_card *dev)
|
|||||||
|
|
||||||
if (dev->efi_net != NULL)
|
if (dev->efi_net != NULL)
|
||||||
{
|
{
|
||||||
efi_call_4 (grub_efi_system_table->boot_services->close_protocol,
|
grub_efi_close_protocol (dev->efi_handle, &net_io_guid);
|
||||||
dev->efi_handle, &net_io_guid,
|
|
||||||
grub_efi_image_handle, NULL);
|
|
||||||
dev->efi_net = NULL;
|
dev->efi_net = NULL;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@@ -220,9 +218,7 @@ close_card (struct grub_net_card *dev)
|
|||||||
{
|
{
|
||||||
efi_call_1 (dev->efi_net->shutdown, dev->efi_net);
|
efi_call_1 (dev->efi_net->shutdown, dev->efi_net);
|
||||||
efi_call_1 (dev->efi_net->stop, dev->efi_net);
|
efi_call_1 (dev->efi_net->stop, dev->efi_net);
|
||||||
efi_call_4 (grub_efi_system_table->boot_services->close_protocol,
|
grub_efi_close_protocol (dev->efi_handle, &net_io_guid);
|
||||||
dev->efi_handle, &net_io_guid,
|
|
||||||
grub_efi_image_handle, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct grub_net_card_driver efidriver =
|
static struct grub_net_card_driver efidriver =
|
||||||
|
|||||||
@@ -35,6 +35,8 @@ EXPORT_FUNC(grub_efi_locate_handle) (grub_efi_locate_search_type_t search_type,
|
|||||||
void *EXPORT_FUNC(grub_efi_open_protocol) (grub_efi_handle_t handle,
|
void *EXPORT_FUNC(grub_efi_open_protocol) (grub_efi_handle_t handle,
|
||||||
grub_efi_guid_t *protocol,
|
grub_efi_guid_t *protocol,
|
||||||
grub_efi_uint32_t attributes);
|
grub_efi_uint32_t attributes);
|
||||||
|
grub_efi_status_t
|
||||||
|
EXPORT_FUNC(grub_efi_close_protocol) (grub_efi_handle_t handle, grub_efi_guid_t *protocol);
|
||||||
int EXPORT_FUNC(grub_efi_set_text_mode) (int on);
|
int EXPORT_FUNC(grub_efi_set_text_mode) (int on);
|
||||||
void EXPORT_FUNC(grub_efi_stall) (grub_efi_uintn_t microseconds);
|
void EXPORT_FUNC(grub_efi_stall) (grub_efi_uintn_t microseconds);
|
||||||
void *
|
void *
|
||||||
|
|||||||
Reference in new issue
Block a user