diff options
Diffstat (limited to 'loader/memory_efi.c')
| -rw-r--r-- | loader/memory_efi.c | 55 |
1 files changed, 0 insertions, 55 deletions
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 <loader/data_efi.h> -#include <kernel/memory/paging.h> - -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; - } -} |
