[PATCH] NFS: Fix race in nfs_release_page()
[linux-2.6/mini2440.git] / arch / sparc64 / prom / bootstr.c
bloba7278614e99dcd95e1d45bdf7bd4b27a00b48bdc
1 /* $Id: bootstr.c,v 1.6 1999/08/31 06:55:01 davem Exp $
2 * bootstr.c: Boot string/argument acquisition from the PROM.
4 * Copyright(C) 1995 David S. Miller (davem@caip.rutgers.edu)
5 * Copyright(C) 1996,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
6 */
8 #include <linux/string.h>
9 #include <linux/init.h>
10 #include <asm/oplib.h>
12 /* WARNING: The boot loader knows that these next three variables come one right
13 * after another in the .data section. Do not move this stuff into
14 * the .bss section or it will break things.
17 #define BARG_LEN 256
18 struct {
19 int bootstr_len;
20 int bootstr_valid;
21 char bootstr_buf[BARG_LEN];
22 } bootstr_info = {
23 .bootstr_len = BARG_LEN,
24 #ifdef CONFIG_CMDLINE
25 .bootstr_valid = 1,
26 .bootstr_buf = CONFIG_CMDLINE,
27 #endif
30 char * __init
31 prom_getbootargs(void)
33 /* This check saves us from a panic when bootfd patches args. */
34 if (bootstr_info.bootstr_valid)
35 return bootstr_info.bootstr_buf;
36 prom_getstring(prom_chosen_node, "bootargs",
37 bootstr_info.bootstr_buf, BARG_LEN);
38 bootstr_info.bootstr_valid = 1;
39 return bootstr_info.bootstr_buf;