Changeset View
Changeset View
Standalone View
Standalone View
stand/efi/loader/arch/riscv/exec.c
Show All 37 Lines | |||||
#include <stand.h> | #include <stand.h> | ||||
#include <efi.h> | #include <efi.h> | ||||
#include <efilib.h> | #include <efilib.h> | ||||
#include "bootstrap.h" | #include "bootstrap.h" | ||||
#include "loader_efi.h" | #include "loader_efi.h" | ||||
extern int bi_load(char *, vm_offset_t *, vm_offset_t *); | extern int bi_load(char *, vm_offset_t *, vm_offset_t *, bool); | ||||
static int | static int | ||||
__elfN(exec)(struct preloaded_file *fp) | __elfN(exec)(struct preloaded_file *fp) | ||||
{ | { | ||||
struct file_metadata *fmp; | struct file_metadata *fmp; | ||||
vm_offset_t modulep, kernend; | vm_offset_t modulep, kernend; | ||||
Elf_Ehdr *e; | Elf_Ehdr *e; | ||||
int error; | int error; | ||||
void (*entry)(void *); | void (*entry)(void *); | ||||
if ((fmp = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) | if ((fmp = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) | ||||
return (EFTYPE); | return (EFTYPE); | ||||
e = (Elf_Ehdr *)&fmp->md_data; | e = (Elf_Ehdr *)&fmp->md_data; | ||||
efi_time_fini(); | efi_time_fini(); | ||||
entry = efi_translate(e->e_entry); | entry = efi_translate(e->e_entry); | ||||
printf("Kernel entry at %p...\n", entry); | printf("Kernel entry at %p...\n", entry); | ||||
printf("Kernel args: %s\n", fp->f_args); | printf("Kernel args: %s\n", fp->f_args); | ||||
if ((error = bi_load(fp->f_args, &modulep, &kernend)) != 0) { | if ((error = bi_load(fp->f_args, &modulep, &kernend, true)) != 0) { | ||||
efi_time_init(); | efi_time_init(); | ||||
return (error); | return (error); | ||||
} | } | ||||
/* | /* | ||||
* At this point we've called ExitBootServices, so we can't call | * At this point we've called ExitBootServices, so we can't call | ||||
* printf or any other function that uses Boot Services | * printf or any other function that uses Boot Services | ||||
*/ | */ | ||||
Show All 15 Lines |