55 DBGC (
image,
"ELF %p could not load: %s\n",
66 DBGC (
image,
"ELF %p starting execution at %lx\n",
image, entry );
71 :
"eax",
"ebx",
"ecx",
"edx",
"esi",
"memory" );
94 DBGC (
image,
"ELF %p uses virtual addressing (phys %x, " 110 static const uint8_t e_ident[] = {
125 if (
memcmp ( ehdr.
e_ident, e_ident, sizeof ( e_ident ) ) != 0 ) {
126 DBGC (
image,
"Invalid ELF identifier\n" );
132 &entry, &
max ) ) != 0 ) {
133 DBGC (
image,
"Unloadable ELF image\n" );
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
#define PHYS_CODE(asm_code_str)
struct arbelprm_rc_send_wqe rc
userptr_t data
Raw file image.
#define ENOEXEC
Exec format error.
static __always_inline void copy_from_user(void *dest, userptr_t src, off_t src_off, size_t len)
Copy data from user buffer.
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_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.
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))
int elf_segments(struct image *image, Elf_Ehdr *ehdr, int(*process)(struct image *image, Elf_Phdr *phdr, physaddr_t dest), physaddr_t *entry, physaddr_t *max)
Process ELF segments.
static int elfboot_check_segment(struct image *image, Elf_Phdr *phdr, physaddr_t dest)
Check that ELF segment uses flat physical addressing.
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.