patch-2.4.22 linux-2.4.22/arch/sparc64/prom/bootstr.c
Next file: linux-2.4.22/arch/sparc64/prom/init.c
Previous file: linux-2.4.22/arch/sparc64/mm/init.c
Back to the patch index
Back to the overall index
- Lines: 30
- Date:
2003-08-25 04:44:40.000000000 -0700
- Orig file:
linux-2.4.21/arch/sparc64/prom/bootstr.c
- Orig date:
2002-08-02 17:39:43.000000000 -0700
diff -urN linux-2.4.21/arch/sparc64/prom/bootstr.c linux-2.4.22/arch/sparc64/prom/bootstr.c
@@ -15,16 +15,22 @@
*/
#define BARG_LEN 256
-int bootstr_len = BARG_LEN;
-static int bootstr_valid = 0;
-static char bootstr_buf[BARG_LEN] = { 0 };
+struct {
+ int bootstr_len;
+ int bootstr_valid;
+ char bootstr_buf[BARG_LEN];
+} bootstr_info = {
+ .bootstr_len = BARG_LEN,
+};
char * __init
prom_getbootargs(void)
{
/* This check saves us from a panic when bootfd patches args. */
- if (bootstr_valid) return bootstr_buf;
- prom_getstring(prom_chosen_node, "bootargs", bootstr_buf, BARG_LEN);
- bootstr_valid = 1;
- return bootstr_buf;
+ if (bootstr_info.bootstr_valid)
+ return bootstr_info.bootstr_buf;
+ prom_getstring(prom_chosen_node, "bootargs",
+ bootstr_info.bootstr_buf, BARG_LEN);
+ bootstr_info.bootstr_valid = 1;
+ return bootstr_info.bootstr_buf;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)