18 #define EMBED( _index, _path, _name ) \ 19 extern char embedded_image_ ## _index ## _data[]; \ 20 extern char embedded_image_ ## _index ## _len[]; \ 21 __asm__ ( ".section \".rodata\", \"a\", " PROGBITS "\n\t" \ 22 "\nembedded_image_" #_index "_data:\n\t" \ 23 ".incbin \"" _path "\"\n\t" \ 24 "\nembedded_image_" #_index "_end:\n\t" \ 25 ".equ embedded_image_" #_index "_len, " \ 26 "( embedded_image_" #_index "_end - " \ 27 " embedded_image_" #_index "_data )\n\t" \ 33 #define EMBED( _index, _path, _name ) { \ 34 .refcnt = REF_INIT ( ref_no_free ), \ 36 .data = ( userptr_t ) ( embedded_image_ ## _index ## _data ), \ 37 .len = ( size_t ) embedded_image_ ## _index ## _len, \ 69 DBG (
"Embedded image \"%s\": %zd bytes at %p\n",
73 DBG (
"Could not register embedded image \"%s\": " 82 DBG (
"Could not select embedded image \"%s\": %s\n",
struct arbelprm_rc_send_wqe rc
int image_select(struct image *image)
Select image for execution.
userptr_t data
Raw file image.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
static void embedded_init(void)
Register all embedded images.
static struct image embedded_images[]
Access to external ("user") memory.
struct init_fn embedded_init_fn __init_fn(INIT_LATE)
Embedded image initialisation function.
An initialisation function.
int register_image(struct image *image)
Register executable image.
char * strerror(int errno)
Retrieve string representation of error number.
size_t len
Length of raw file image.
userptr_t virt_to_user(volatile const void *addr)
Convert virtual address to user pointer.
uint8_t data[48]
Additional event data.
#define INIT_LATE
Late initialisation.
static void image_trust(struct image *image)
Set image as trusted.
#define DBG(...)
Print a debugging message.