57 DBGC (
image,
"ELF %s could not load: %s\n",
68 DBGC (
image,
"ELF %s starting execution at %lx\n",
74 :
"eax",
"ebx",
"ecx",
"edx",
"esi",
"memory" );
97 DBGC (
image,
"ELF %s uses virtual addressing (phys %x, virt " 113 static const uint8_t e_ident[] = {
127 if (
image->
len < sizeof ( *ehdr ) ) {
128 DBGC (
image,
"ELF %s too short for ELF header\n",
133 if (
memcmp ( ehdr->
e_ident, e_ident, sizeof ( e_ident ) ) != 0 ) {
140 &entry, &
max ) ) != 0 ) {
141 DBGC (
image,
"ELF %s is not loadable: %s\n",
static int elfboot_check_segment(struct image *image, const Elf_Phdr *phdr, physaddr_t dest)
Check that ELF segment uses flat physical addressing.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
#define PHYS_CODE(asm_code_str)
struct arbelprm_rc_send_wqe rc
const void * data
Read-only data.
#define ENOEXEC
Exec format error.
An executable image type.
#define PROBE_NORMAL
Normal image probe priority.
#define FEATURE_IMAGE
Image formats.
#define ECANCELED
Operation canceled.
char * name
Name of this image type.
int elf_segments(struct image *image, const Elf_Ehdr *ehdr, int(*process)(struct image *image, const Elf_Phdr *phdr, physaddr_t dest), physaddr_t *entry, physaddr_t *max)
Process ELF segments.
int elf_load(struct image *image, physaddr_t *entry, physaddr_t *max)
Load ELF image into memory.
struct image_type elfboot_image_type __image_type(PROBE_NORMAL)
ELF image type.
#define DHCP_EB_FEATURE_ELF
ELF format.
unsigned char e_ident[EI_NIDENT]
char * strerror(int errno)
Retrieve string representation of error number.
size_t len
Length of raw file image.
FEATURE(FEATURE_IMAGE, "ELF", DHCP_EB_FEATURE_ELF, 1)
__asm__ __volatile__("call *%9" :"=a"(result), "=c"(discard_ecx), "=d"(discard_edx) :"d"(0), "a"(code), "b"(0), "c"(in_phys), "D"(0), "S"(out_phys), "m"(hypercall))
static int elfboot_exec(struct image *image)
Execute ELF image.
__asm__(".section \".rodata\", \"a\", " PROGBITS "\n\t" "\nprivate_key_data:\n\t" ".size private_key_data, ( . - private_key_data )\n\t" ".equ private_key_len, ( . - private_key_data )\n\t" ".previous\n\t")
if(len >=6 *4) __asm__ __volatile__("movsl" if(len >=5 *4) __asm__ __volatile__("movsl" if(len >=4 *4) __asm__ __volatile__("movsl" if(len >=3 *4) __asm__ __volatile__("movsl" if(len >=2 *4) __asm__ __volatile__("movsl" if(len >=1 *4) __asm__ __volatile__("movsl" if((len % 4) >=2) __asm__ __volatile__("movsw" if((len % 2) >=1) __asm__ __volatile__("movsb" return dest
static int elfboot_probe(struct image *image)
Probe ELF image.
static void shutdown_boot(void)
Shut down system for OS boot.
int memcmp(const void *first, const void *second, size_t len)
Compare memory regions.