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 colour
Colour for debug messages.
struct arbelprm_rc_send_wqe rc
int isspace(int character)
Check to see if character is a space.
uint32_t type
Operating system type.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define ENOMEM
Not enough space.
#define STARTUP_NORMAL
Normal startup.
void free_image(struct refcnt *refcnt)
Free executable image.
int register_image(struct image *image)
Register executable image.
struct image * image_memory(const char *name, const void *data, size_t len)
Create registered image from block of memory.
#define IMAGE_STATIC_NAME
Image name is statically allocated.
static void image_put(struct image *image)
Decrement reference count on an image.
#define IMAGE_STATIC
Image is statically allocated.
#define __startup_fn(startup_order)
Declare a startup/shutdown function.
#define __bss16(variable)
static void(* free)(struct refcnt *refcnt))
#define REF_INIT(free_fn)
Initialise a static reference counter.
static struct image cmdline_image
Embedded script representing the command line.
static char * cmdline_copy
Internal copy of the command line.
static int initrd_init(void)
Initialise initrd.
static void runtime_init(void)
Initialise command line and initrd.
static void cmdline_image_free(struct refcnt *refcnt)
Free command line image.
static int cmdline_init(void)
Initialise command line.
static void cmdline_strip(char *cmdline, const char *cruft)
Strip unwanted cruft from command line.
#define container_of(ptr, type, field)
Get containing structure.
char * strerror(int errno)
Retrieve string representation of error number.
char * strchr(const char *src, int character)
Find character within a string.
char * strdup(const char *src)
Duplicate string.
char * strstr(const char *haystack, const char *needle)
Find substring.
char * strcpy(char *dest, const char *src)
Copy string.
size_t strlen(const char *src)
Get length of string.
A startup/shutdown function.