Files

47 lines
910 B
C
Raw Permalink Normal View History

// SPDX-License-Identifier: GPL-2.0
2005-05-20 13:59:10 -07:00
/*
2008-02-04 22:31:08 -08:00
* Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
2005-05-20 13:59:10 -07:00
*/
#include <linux/init.h>
2018-10-30 15:09:49 -07:00
#include <linux/memblock.h>
#include <linux/initrd.h>
#include <asm/types.h>
#include <init.h>
#include <os.h>
2005-05-20 13:59:10 -07:00
2021-12-08 16:11:22 +01:00
#include "um_arch.h"
2005-05-20 13:59:10 -07:00
/* Changed by uml_initrd_setup, which is a setup */
static char *initrd __initdata = NULL;
int __init read_initrd(void)
2005-05-20 13:59:10 -07:00
{
2021-12-08 16:11:22 +01:00
unsigned long long size;
2005-05-20 13:59:10 -07:00
void *area;
2021-12-08 16:11:22 +01:00
if (!initrd)
return 0;
2021-12-08 16:11:22 +01:00
area = uml_load_file(initrd, &size);
if (!area)
return 0;
2005-05-20 13:59:10 -07:00
initrd_start = (unsigned long) area;
initrd_end = initrd_start + size;
return 0;
}
static int __init uml_initrd_setup(char *line, int *add)
{
*add = 0;
2005-05-20 13:59:10 -07:00
initrd = line;
return 0;
}
__uml_setup("initrd=", uml_initrd_setup,
"initrd=<initrd image>\n"
" This is used to boot UML from an initrd image. The argument is the\n"
" name of the file containing the image.\n\n"
);