patch-2.1.44 linux/arch/sparc64/prom/bootstr.c
Next file: linux/arch/sparc64/prom/misc.c
Previous file: linux/arch/sparc64/mm/ultra.S
Back to the patch index
Back to the overall index
- Lines: 35
- Date:
Mon Jul 7 08:18:55 1997
- Orig file:
v2.1.43/linux/arch/sparc64/prom/bootstr.c
- Orig date:
Mon Mar 17 14:54:23 1997
diff -u --recursive --new-file v2.1.43/linux/arch/sparc64/prom/bootstr.c linux/arch/sparc64/prom/bootstr.c
@@ -1,4 +1,4 @@
-/* $Id: bootstr.c,v 1.3 1997/03/04 16:27:06 jj Exp $
+/* $Id: bootstr.c,v 1.4 1997/06/17 13:25:35 jj Exp $
* bootstr.c: Boot string/argument acquisition from the PROM.
*
* Copyright(C) 1995 David S. Miller (davem@caip.rutgers.edu)
@@ -6,18 +6,20 @@
*/
#include <linux/string.h>
+#include <linux/init.h>
#include <asm/oplib.h>
#define BARG_LEN 256
-static char barg_buf[BARG_LEN];
-static char fetched = 0;
+int bootstr_len __initdata = BARG_LEN;
+static int bootstr_valid __initdata = 0;
+static char bootstr_buf[BARG_LEN] __initdata = { 0 };
-char *
-prom_getbootargs(void)
+__initfunc(char *
+prom_getbootargs(void))
{
/* This check saves us from a panic when bootfd patches args. */
- if (fetched) return barg_buf;
- prom_getstring(prom_chosen_node, "bootargs", barg_buf, BARG_LEN);
- fetched = 1;
- return barg_buf;
+ if (bootstr_valid) return bootstr_buf;
+ prom_getstring(prom_chosen_node, "bootargs", bootstr_buf, BARG_LEN);
+ bootstr_valid = 1;
+ return bootstr_buf;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov