Changeset View
Changeset View
Standalone View
Standalone View
head/sys/boot/efi/loader/bootinfo.c
Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | |||||
#include <machine/specialreg.h> | #include <machine/specialreg.h> | ||||
#include "framebuffer.h" | #include "framebuffer.h" | ||||
#endif | #endif | ||||
#if defined(LOADER_FDT_SUPPORT) | #if defined(LOADER_FDT_SUPPORT) | ||||
#include <fdt_platform.h> | #include <fdt_platform.h> | ||||
#endif | #endif | ||||
int bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp); | |||||
extern EFI_SYSTEM_TABLE *ST; | extern EFI_SYSTEM_TABLE *ST; | ||||
static const char howto_switches[] = "aCdrgDmphsv"; | static const char howto_switches[] = "aCdrgDmphsv"; | ||||
static int howto_masks[] = { | static int howto_masks[] = { | ||||
RB_ASKNAME, RB_CDROM, RB_KDB, RB_DFLTROOT, RB_GDB, RB_MULTIPLE, | RB_ASKNAME, RB_CDROM, RB_KDB, RB_DFLTROOT, RB_GDB, RB_MULTIPLE, | ||||
RB_MUTE, RB_PAUSE, RB_SERIAL, RB_SINGLE, RB_VERBOSE | RB_MUTE, RB_PAUSE, RB_SERIAL, RB_SINGLE, RB_VERBOSE | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | bi_copyenv(vm_offset_t start) | ||||
vm_offset_t addr, last; | vm_offset_t addr, last; | ||||
size_t len; | size_t len; | ||||
addr = last = start; | addr = last = start; | ||||
/* Traverse the environment. */ | /* Traverse the environment. */ | ||||
for (ep = environ; ep != NULL; ep = ep->ev_next) { | for (ep = environ; ep != NULL; ep = ep->ev_next) { | ||||
len = strlen(ep->ev_name); | len = strlen(ep->ev_name); | ||||
if (archsw.arch_copyin(ep->ev_name, addr, len) != len) | if ((size_t)archsw.arch_copyin(ep->ev_name, addr, len) != len) | ||||
break; | break; | ||||
addr += len; | addr += len; | ||||
if (archsw.arch_copyin("=", addr, 1) != 1) | if (archsw.arch_copyin("=", addr, 1) != 1) | ||||
break; | break; | ||||
addr++; | addr++; | ||||
if (ep->ev_value != NULL) { | if (ep->ev_value != NULL) { | ||||
len = strlen(ep->ev_value); | len = strlen(ep->ev_value); | ||||
if (archsw.arch_copyin(ep->ev_value, addr, len) != len) | if ((size_t)archsw.arch_copyin(ep->ev_value, addr, len) != len) | ||||
break; | break; | ||||
addr += len; | addr += len; | ||||
} | } | ||||
if (archsw.arch_copyin("", addr, 1) != 1) | if (archsw.arch_copyin("", addr, 1) != 1) | ||||
break; | break; | ||||
last = ++addr; | last = ++addr; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 204 Lines • ▼ Show 20 Lines | bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp) | ||||
char *rootdevname; | char *rootdevname; | ||||
int howto; | int howto; | ||||
#if defined(LOADER_FDT_SUPPORT) | #if defined(LOADER_FDT_SUPPORT) | ||||
vm_offset_t dtbp; | vm_offset_t dtbp; | ||||
int dtb_size; | int dtb_size; | ||||
#endif | #endif | ||||
#if defined(__arm__) | #if defined(__arm__) | ||||
vm_offset_t vaddr; | vm_offset_t vaddr; | ||||
int i; | size_t i; | ||||
/* | /* | ||||
* These metadata addreses must be converted for kernel after | * These metadata addreses must be converted for kernel after | ||||
* relocation. | * relocation. | ||||
*/ | */ | ||||
uint32_t mdt[] = { | uint32_t mdt[] = { | ||||
MODINFOMD_SSYM, MODINFOMD_ESYM, MODINFOMD_KERNEND, | MODINFOMD_SSYM, MODINFOMD_ESYM, MODINFOMD_KERNEND, | ||||
MODINFOMD_ENVP, | MODINFOMD_ENVP, | ||||
#if defined(LOADER_FDT_SUPPORT) | #if defined(LOADER_FDT_SUPPORT) | ||||
▲ Show 20 Lines • Show All 99 Lines • Show Last 20 Lines |