From ec1233b4fcd61a8d1eccbf030cede36e9848e06c Mon Sep 17 00:00:00 2001 From: Ada Christine Date: Thu, 16 Dec 2021 12:06:04 +0000 Subject: reworking loader --- loader/memory_efi.c | 55 ----------------------------------------------------- 1 file changed, 55 deletions(-) delete mode 100644 loader/memory_efi.c (limited to 'loader/memory_efi.c') diff --git a/loader/memory_efi.c b/loader/memory_efi.c deleted file mode 100644 index 2fab6b7..0000000 --- a/loader/memory_efi.c +++ /dev/null @@ -1,55 +0,0 @@ -#include "loader_efi.h" - -#include -#include - -struct memory_range system_allocate(size_t size) -{ - EFI_STATUS status; - struct memory_range buffer; - - buffer.type = SYSTEM_MEMORY; - buffer.size = size; - - status = e_bs->AllocatePages(AllocateAnyPages, - SystemMemoryType, - page_count(buffer.size, 1), - &buffer.base); - - if (EFI_ERROR(status)) - { - Print(L"error allocating range: %r\r\n", status); - e_last_error = status; - buffer.type = UNUSABLE_MEMORY; - } - - return buffer; -} - -void *efi_allocate(size_t size) -{ - EFI_STATUS status; - void *buffer; - - status = e_bs->AllocatePool(EfiLoaderData, size, &buffer); - - if (EFI_ERROR(status)) - { - e_last_error = status; - buffer = NULL; - } - - return buffer; -} - -void efi_free(void *buffer) -{ - EFI_STATUS status; - - status = e_bs->FreePool(buffer); - - if (EFI_ERROR(status)) - { - e_last_error = status; - } -} -- cgit v1.3.1-1-g115d