2018-07-12 14:56:34 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2018-01-17 22:04:09 +00:00
|
|
|
From: Peter Jones <pjones@redhat.com>
|
|
|
|
Date: Thu, 1 Jun 2017 09:59:56 -0400
|
2018-07-10 18:39:10 +00:00
|
|
|
Subject: [PATCH] Add grub_efi_allocate_pool() and grub_efi_free_pool()
|
2018-01-17 22:04:09 +00:00
|
|
|
wrappers.
|
|
|
|
|
|
|
|
Signed-off-by: Peter Jones <pjones@redhat.com>
|
|
|
|
---
|
|
|
|
include/grub/efi/efi.h | 36 ++++++++++++++++++++++++++++++++----
|
|
|
|
1 file changed, 32 insertions(+), 4 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h
|
2024-08-01 23:56:47 +00:00
|
|
|
index a5cd99e5afa..8d98203a784 100644
|
2018-01-17 22:04:09 +00:00
|
|
|
--- a/include/grub/efi/efi.h
|
|
|
|
+++ b/include/grub/efi/efi.h
|
2024-08-01 23:56:47 +00:00
|
|
|
@@ -36,6 +36,10 @@ struct linux_arch_kernel_header {
|
|
|
|
struct grub_pe_image_header pe_image_header;
|
|
|
|
};
|
2018-01-17 22:04:09 +00:00
|
|
|
|
|
|
|
+/* Variables. */
|
|
|
|
+extern grub_efi_system_table_t *EXPORT_VAR(grub_efi_system_table);
|
|
|
|
+extern grub_efi_handle_t EXPORT_VAR(grub_efi_image_handle);
|
|
|
|
+
|
|
|
|
/* Functions. */
|
2024-08-01 23:56:47 +00:00
|
|
|
void *EXPORT_FUNC(grub_efi_locate_protocol) (grub_guid_t *protocol,
|
2018-01-17 22:04:09 +00:00
|
|
|
void *registration);
|
2024-08-01 23:56:47 +00:00
|
|
|
@@ -71,6 +75,33 @@ EXPORT_FUNC(grub_efi_get_memory_map) (grub_efi_uintn_t *memory_map_size,
|
2018-01-17 22:04:09 +00:00
|
|
|
grub_efi_uintn_t *descriptor_size,
|
|
|
|
grub_efi_uint32_t *descriptor_version);
|
2018-07-10 19:08:14 +00:00
|
|
|
void grub_efi_memory_fini (void);
|
2018-01-17 22:04:09 +00:00
|
|
|
+
|
|
|
|
+static inline grub_efi_status_t
|
|
|
|
+__attribute__((__unused__))
|
|
|
|
+grub_efi_allocate_pool (grub_efi_memory_type_t pool_type,
|
|
|
|
+ grub_efi_uintn_t buffer_size,
|
|
|
|
+ void **buffer)
|
|
|
|
+{
|
|
|
|
+ grub_efi_boot_services_t *b;
|
|
|
|
+ grub_efi_status_t status;
|
|
|
|
+
|
|
|
|
+ b = grub_efi_system_table->boot_services;
|
2024-08-01 23:56:47 +00:00
|
|
|
+ status = b->allocate_pool(pool_type, buffer_size, buffer);
|
2018-01-17 22:04:09 +00:00
|
|
|
+ return status;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static inline grub_efi_status_t
|
|
|
|
+__attribute__((__unused__))
|
|
|
|
+grub_efi_free_pool (void *buffer)
|
|
|
|
+{
|
|
|
|
+ grub_efi_boot_services_t *b;
|
|
|
|
+ grub_efi_status_t status;
|
|
|
|
+
|
|
|
|
+ b = grub_efi_system_table->boot_services;
|
2024-08-01 23:56:47 +00:00
|
|
|
+ status = b->free_pool(buffer);
|
2018-01-17 22:04:09 +00:00
|
|
|
+ return status;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
grub_efi_loaded_image_t *EXPORT_FUNC(grub_efi_get_loaded_image) (grub_efi_handle_t image_handle);
|
|
|
|
void EXPORT_FUNC(grub_efi_print_device_path) (grub_efi_device_path_t *dp);
|
|
|
|
char *EXPORT_FUNC(grub_efi_get_filename) (grub_efi_device_path_t *dp);
|
2024-08-01 23:56:47 +00:00
|
|
|
@@ -140,10 +171,7 @@ void grub_efi_init (void);
|
2018-01-17 22:04:09 +00:00
|
|
|
void grub_efi_fini (void);
|
|
|
|
void grub_efi_set_prefix (void);
|
|
|
|
|
|
|
|
-/* Variables. */
|
|
|
|
-extern grub_efi_system_table_t *EXPORT_VAR(grub_efi_system_table);
|
|
|
|
-extern grub_efi_handle_t EXPORT_VAR(grub_efi_image_handle);
|
|
|
|
-
|
|
|
|
+/* More variables. */
|
|
|
|
extern int EXPORT_VAR(grub_efi_is_finished);
|
|
|
|
|
|
|
|
struct grub_net_card;
|