56 DBGC (
image,
"ELF %p loading segment [%x,%x) to [%lx,%lx,%lx)\n",
63 DBGC (
image,
"ELF %p could not prepare segment: %s\n",
91 unsigned long e_offset;
112 DBGC (
image,
"ELF %p segment loads to physical address 0\n",
129 DBGC (
image,
"ELF %p found physical entry point at %lx\n",
134 *entry = (
dest + e_offset );
135 DBGC (
image,
"ELF %p found virtual entry point at %lx" 136 " (virt %lx)\n",
image, *entry,
137 ( (
unsigned long ) ehdr->
e_entry ) );
173 DBGC (
image,
"ELF %p program header %d outside " 174 "image\n",
image, phnum );
179 entry,
max ) ) != 0 )
185 DBGC (
image,
"ELF %p entry point %lx outside image\n",
202 static const uint8_t e_ident[] = {
215 sizeof ( e_ident ) ) != 0 ) {
222 entry,
max ) ) != 0 )
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.
static int elf_load_segment(struct image *image, Elf_Phdr *phdr, physaddr_t dest)
Load ELF segment into memory.
userptr_t phys_to_user(unsigned long phys_addr)
Convert physical address to user pointer.
uint32_t buffer
Buffer index (or NETVSC_RNDIS_NO_BUFFER)
Access to external ("user") memory.
Executable image segments.
uint32_t userptr_t
A pointer to a user buffer.
int prep_segment(userptr_t segment, size_t filesz, size_t memsz)
Prepare segment for loading.
int elf_load(struct image *image, physaddr_t *entry, physaddr_t *max)
Load ELF image into memory.
unsigned char e_ident[EI_NIDENT]
char * strerror(int errno)
Retrieve string representation of error number.
size_t len
Length of raw file image.
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.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
static int elf_segment(struct image *image, Elf_Ehdr *ehdr, Elf_Phdr *phdr, int(*process)(struct image *image, Elf_Phdr *phdr, physaddr_t dest), physaddr_t *entry, physaddr_t *max)
Process ELF segment.
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
uint32_t end
Ending offset.
int memcmp(const void *first, const void *second, size_t len)
Compare memory regions.
void memcpy_user(userptr_t dest, off_t dest_off, userptr_t src, off_t src_off, size_t len)
Copy data between user buffers.