[image] Provide image_memory()

Consolidate the remaining logic common to initrd_init() and imgmem()
into a shared image_memory() function.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2021-01-25 16:18:28 +00:00
parent ffc41ae9d1
commit 989a7a8032
6 changed files with 62 additions and 76 deletions

View File

@@ -60,7 +60,6 @@ static struct command_descriptor imgmem_cmd =
*/
static int imgmem_exec ( int argc, char **argv ) {
struct imgmem_options opts;
struct image *image;
unsigned int data;
unsigned int len;
int rc;
@@ -82,8 +81,7 @@ static int imgmem_exec ( int argc, char **argv ) {
return rc;
/* Create image */
if ( ( rc = imgmem ( phys_to_user ( data ), len, opts.name,
&image ) ) != 0 )
if ( ( rc = imgmem ( opts.name, phys_to_user ( data ), len ) ) != 0 )
return rc;
return 0;