49 #define cmdline_phys __use_data16 ( cmdline_phys ) 56 #define initrd_phys __use_data16 ( initrd_phys ) 63 #define initrd_len __use_data16 ( initrd_len ) 72 DBGC (
image,
"RUNTIME freeing command line\n" );
82 .
type = &script_image_type,
86 #define colour &cmdline_image 103 strip_end =
strchr ( strip,
' ' );
106 DBGC (
colour,
"RUNTIME stripping \"%s\"\n", strip );
107 strcpy ( strip, ( strip_end + 1 ) );
109 DBGC (
colour,
"RUNTIME stripping \"%s\"\n", strip );
125 DBGC (
colour,
"RUNTIME found no command line\n" );
132 DBGC (
colour,
"RUNTIME could not allocate command line\n" );
134 goto err_alloc_cmdline_copy;
137 DBGC (
colour,
"RUNTIME found command line \"%s\" at %08x\n",
155 DBGC (
colour,
"RUNTIME could not register command " 157 goto err_register_image;
168 err_alloc_cmdline_copy:
186 DBGC (
colour,
"RUNTIME found empty initrd\n" );
189 DBGC (
colour,
"RUNTIME found initrd at [%x,%x)\n",
196 DBGC (
colour,
"RUNTIME could not create initrd image\n" );
#define STARTUP_NORMAL
Normal startup.
struct arbelprm_rc_send_wqe rc
const void * data
Read-only data.
uint32_t type
Operating system type.
static int cmdline_init(void)
Initialise command line.
struct startup_fn runtime_startup_fn __startup_fn(STARTUP_NORMAL)
Command line and initrd initialisation function.
static int initrd_init(void)
Initialise initrd.
static void runtime_init(void)
Initialise command line and initrd.
A startup/shutdown function.
char * strstr(const char *haystack, const char *needle)
Find substring.
#define ENOMEM
Not enough space.
void free_image(struct refcnt *refcnt)
Free executable image.
#define IMAGE_STATIC
Image is statically allocated.
#define container_of(ptr, type, field)
Get containing structure.
char * strcpy(char *dest, const char *src)
Copy string.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
int register_image(struct image *image)
Register executable image.
char * strerror(int errno)
Retrieve string representation of error number.
static void(* free)(struct refcnt *refcnt))
size_t len
Length of raw file image.
char * strchr(const char *src, int character)
Find character within a string.
char * strdup(const char *src)
Duplicate string.
int isspace(int character)
Check to see if character is a space.
size_t strlen(const char *src)
Get length of string.
static void image_put(struct image *image)
Decrement reference count on an image.
static struct image cmdline_image
Embedded script representing the command line.
struct image * image_memory(const char *name, const void *data, size_t len)
Create registered image from block of memory.
static void cmdline_strip(char *cmdline, const char *cruft)
Strip unwanted cruft from command line.
#define IMAGE_STATIC_NAME
Image name is statically allocated.
#define REF_INIT(free_fn)
Initialise a static reference counter.
static void cmdline_image_free(struct refcnt *refcnt)
Free command line image.
static char * cmdline_copy
Internal copy of the command line.
uint32_t __bss16(cmdline_phys)
Command line physical address.
#define colour
Colour for debug messages.
struct refcnt refcnt
Reference count.