summaryrefslogtreecommitdiff
path: root/loader/main_efi.c
diff options
context:
space:
mode:
authorAda Christine <adachristine18@gmail.com>2021-12-19 01:16:51 +0000
committerAda Christine <adachristine18@gmail.com>2021-12-19 01:16:51 +0000
commitbff63a4337eb3388617d230970c5eb2684d6a215 (patch)
treef40891f45918b23dac0f31888142136434c7fc8c /loader/main_efi.c
parentd5f485a4f6801f58cbb2bc9d8e80c955c79ff044 (diff)
i don't know what i'm doing anymore
Diffstat (limited to 'loader/main_efi.c')
-rw-r--r--loader/main_efi.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/loader/main_efi.c b/loader/main_efi.c
index 4c9c9a0..37802cb 100644
--- a/loader/main_efi.c
+++ b/loader/main_efi.c
@@ -1,5 +1,7 @@
#include <loader/efi/shim.h>
+#include <kernel/entry.h>
+
#include <efi.h>
#include <efidebug.h>
#include <efilib.h>
@@ -24,9 +26,10 @@ static struct efi_loader_image shim_image =
static struct efi_loader_interface loader_interface =
{
+ NULL,
+ NULL,
&alloc_page,
&free_page,
-
&open_image,
&allocate_image,
&load_image
@@ -35,8 +38,8 @@ static struct efi_loader_interface loader_interface =
EFI_STATUS efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *system_table)
{
InitializeLib(image_handle, system_table);
-
- shim_image.image_handle = image_handle;
+ loader_interface.image_handle = image_handle;
+ loader_interface.system_table = system_table;
EFI_STATUS status;
@@ -102,10 +105,10 @@ EFI_STATUS open_image(struct efi_loader_image *image)
EFI_STATUS status;
- status = gBS->OpenProtocol(image->image_handle,
+ status = gBS->OpenProtocol(loader_interface.image_handle,
&LoadedImageProtocol,
(void *)&loader_image,
- image->image_handle,
+ loader_interface.image_handle,
NULL,
EFI_OPEN_PROTOCOL_GET_PROTOCOL);
@@ -269,10 +272,10 @@ static EFI_STATUS enter_shim(void)
{
EFI_STATUS status;
Elf64_Ehdr *ehdr = (Elf64_Ehdr *)shim_image.buffer_base;
- efi_shim_entry_func entry;
+ kc_entry_func entry;
- entry = (efi_shim_entry_func)(shim_image.buffer_base + ehdr->e_entry);
- status = entry(&shim_image, &loader_interface);
+ entry = (kc_entry_func)(shim_image.buffer_base + ehdr->e_entry);
+ status = entry(&loader_interface);
return status;
}