mirror of https://github.com/ipxe/ipxe.git
Place command-line inline, to save on memory allocation hassles.
parent
f15482d85f
commit
9debfed07a
|
@ -119,7 +119,6 @@ multiboot_build_module_list ( struct image *image,
|
||||||
module->mod_start = user_to_phys ( module_image->data, 0 );
|
module->mod_start = user_to_phys ( module_image->data, 0 );
|
||||||
module->mod_end = user_to_phys ( module_image->data,
|
module->mod_end = user_to_phys ( module_image->data,
|
||||||
module_image->len );
|
module_image->len );
|
||||||
if ( image->cmdline )
|
|
||||||
module->string = virt_to_phys ( image->cmdline );
|
module->string = virt_to_phys ( image->cmdline );
|
||||||
|
|
||||||
/* We promise to page-align modules, so at least check */
|
/* We promise to page-align modules, so at least check */
|
||||||
|
@ -154,11 +153,9 @@ static int multiboot_exec ( struct image *image ) {
|
||||||
mbinfo.mmap_addr = virt_to_phys ( &mbmemmap[0].base_addr );
|
mbinfo.mmap_addr = virt_to_phys ( &mbmemmap[0].base_addr );
|
||||||
mbinfo.flags |= ( MBI_FLAG_MEM | MBI_FLAG_MMAP );
|
mbinfo.flags |= ( MBI_FLAG_MEM | MBI_FLAG_MMAP );
|
||||||
|
|
||||||
/* Set command line, if present */
|
/* Set command line */
|
||||||
if ( image->cmdline ) {
|
|
||||||
mbinfo.cmdline = virt_to_phys ( image->cmdline );
|
mbinfo.cmdline = virt_to_phys ( image->cmdline );
|
||||||
mbinfo.flags |= MBI_FLAG_CMDLINE;
|
mbinfo.flags |= MBI_FLAG_CMDLINE;
|
||||||
}
|
|
||||||
|
|
||||||
/* Construct module list */
|
/* Construct module list */
|
||||||
num_modules = multiboot_build_module_list ( image, NULL );
|
num_modules = multiboot_build_module_list ( image, NULL );
|
||||||
|
|
|
@ -14,6 +14,9 @@
|
||||||
|
|
||||||
struct image_type;
|
struct image_type;
|
||||||
|
|
||||||
|
/** Maximum length of a command line */
|
||||||
|
#define CMDLINE_MAX 128
|
||||||
|
|
||||||
/** An executable or loadable image */
|
/** An executable or loadable image */
|
||||||
struct image {
|
struct image {
|
||||||
/** Name */
|
/** Name */
|
||||||
|
@ -22,12 +25,20 @@ struct image {
|
||||||
struct list_head list;
|
struct list_head list;
|
||||||
|
|
||||||
/** Command line to pass to image */
|
/** Command line to pass to image */
|
||||||
const char *cmdline;
|
char cmdline[CMDLINE_MAX];
|
||||||
|
|
||||||
/** Raw file image */
|
/** Raw file image */
|
||||||
userptr_t data;
|
userptr_t data;
|
||||||
/** Length of raw file image */
|
/** Length of raw file image */
|
||||||
size_t len;
|
size_t len;
|
||||||
|
/**
|
||||||
|
* Free raw file image
|
||||||
|
*
|
||||||
|
* @v data Raw file image
|
||||||
|
*
|
||||||
|
* Call this method before freeing up the @c struct @c image.
|
||||||
|
*/
|
||||||
|
void ( * free ) ( userptr_t data );
|
||||||
|
|
||||||
/** Entry point */
|
/** Entry point */
|
||||||
physaddr_t entry;
|
physaddr_t entry;
|
||||||
|
|
Loading…
Reference in New Issue