summaryrefslogtreecommitdiff
path: root/loader
diff options
context:
space:
mode:
Diffstat (limited to 'loader')
-rw-r--r--loader/main_efi.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/loader/main_efi.c b/loader/main_efi.c
index df156e3..b3df593 100644
--- a/loader/main_efi.c
+++ b/loader/main_efi.c
@@ -6,8 +6,8 @@
#include <efi/error.h>
#include <lib/elf.h>
-#include <lib/kstdio.h>
-#include <lib/kstring.h>
+#include <libc/stdio.h>
+#include <libc/string.h>
FILE *kstdout;
FILE *kstderr;
@@ -121,7 +121,7 @@ static const CHAR16 *efi_warning_strings[] =
};
**/
-int kfputc(int c, FILE *f)
+int fputc(int c, FILE *f)
{
(void)f;
EFI_STATUS status = EFI_SUCCESS;
@@ -184,7 +184,7 @@ EFI_STATUS efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *system_table)
linebuf_ptr = linebuf;
}
- kprintf("loader interface %p\r\n"
+ printf("loader interface %p\r\n"
"image_handle %p\r\n"
"system_table %p\r\n"
"page_alloc %p\r\n"
@@ -203,25 +203,25 @@ EFI_STATUS efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *system_table)
if (EFI_ERROR((status = open_image(&shim_image))))
{
- kprintf("error opening shim image: %ls\r\n",
+ printf("error opening shim image: %ls\r\n",
efi_strerror(status));
}
if (EFI_ERROR((status = allocate_image(&shim_image))))
{
- kprintf("error allocating shim image: %ls\r\n",
+ printf("error allocating shim image: %ls\r\n",
efi_strerror(status));
}
if (EFI_ERROR((status = load_image(&shim_image))))
{
- kprintf("error loading shim image: %ls\r\n",
+ printf("error loading shim image: %ls\r\n",
efi_strerror(status));
}
if (EFI_ERROR((status = enter_shim())))
{
- kprintf("error running shim image: %ls\r\n",
+ printf("error running shim image: %ls\r\n",
efi_strerror(status));
}
@@ -280,7 +280,7 @@ EFI_STATUS open_image(struct efi_loader_image *image)
if (EFI_ERROR(status))
{
- kprintf(
+ printf(
"failed locating image protocol: %ls\r\n",
efi_strerror(status));
return status;
@@ -296,7 +296,7 @@ EFI_STATUS open_image(struct efi_loader_image *image)
if (EFI_ERROR(status))
{
- kprintf(
+ printf(
"failed locating ESP file system: %ls\r\n",
efi_strerror(status));
return status;
@@ -306,13 +306,13 @@ EFI_STATUS open_image(struct efi_loader_image *image)
if (EFI_ERROR(status))
{
- kprintf(
+ printf(
"failed opening root device: %ls\r\n",
efi_strerror(status));
return status;
}
- kprintf("opening image %ls\r\n", image->path);
+ printf("opening image %ls\r\n", image->path);
status = root->Open(root,
&image->file,
@@ -326,7 +326,7 @@ EFI_STATUS open_image(struct efi_loader_image *image)
}
else
{
- kprintf("failed opening image %ls: %r\r\n", image->path, status);
+ printf("failed opening image %ls: %r\r\n", image->path, status);
return status;
}
@@ -349,13 +349,13 @@ EFI_STATUS open_image(struct efi_loader_image *image)
else
{
FreePool(phdrs);
- kprintf("invalid image format detected\r\n");
+ printf("invalid image format detected\r\n");
return EFI_INVALID_PARAMETER;
}
}
else
{
- kprintf("failed reading shim image headers\r\n");
+ printf("failed reading shim image headers\r\n");
return status;
}
@@ -365,11 +365,11 @@ EFI_STATUS open_image(struct efi_loader_image *image)
{
image->buffer_size = elf_size(&ehdr, phdrs);
image->system_table = gST;
- kprintf("elf image %d bytes\r\n", image->buffer_size);
+ printf("elf image %d bytes\r\n", image->buffer_size);
}
else
{
- kprintf("failed reading shim image segments\r\n");
+ printf("failed reading shim image segments\r\n");
}
FreePool(phdrs);
@@ -379,7 +379,7 @@ EFI_STATUS open_image(struct efi_loader_image *image)
EFI_STATUS allocate_image(struct efi_loader_image *image)
{
- kprintf("allocating image %ls\r\n", image->path);
+ printf("allocating image %ls\r\n", image->path);
EFI_STATUS status;
status = alloc_page(SystemMemoryType,
@@ -399,7 +399,7 @@ static EFI_STATUS read_image(struct efi_loader_image *image,
UINTN offset,
UINTN length)
{
- kprintf("reading %d bytes from image at %p %ls\r\n",
+ printf("reading %d bytes from image at %p %ls\r\n",
length,
offset,
image->path);
@@ -413,7 +413,7 @@ static EFI_STATUS read_image(struct efi_loader_image *image,
}
else
{
- kprintf("failed seeking shim image: %ls\r\n", efi_strerror(status));
+ printf("failed seeking shim image: %ls\r\n", efi_strerror(status));
}
return status;
@@ -449,7 +449,7 @@ EFI_STATUS load_image(struct efi_loader_image *image)
if (!EFI_ERROR(status))
{
- kprintf("loaded segment %p of %d bytes "
+ printf("loaded segment %p of %d bytes "
"(file size %d bytes)\r\n",
placement,
phdrs[i].p_memsz,
@@ -468,7 +468,7 @@ static EFI_STATUS enter_shim(void)
efi_shim_entry_func *entry;
entry = (efi_shim_entry_func *)(shim_image.buffer_base + ehdr->e_entry);
- kprintf("entering shim @%p\r\n", entry);
+ printf("entering shim @%p\r\n", entry);
status = entry(&loader_interface);