patch-1.3.4 linux/arch/sparc/prom/bootstr.c
Next file: linux/arch/sparc/prom/console.c
Previous file: linux/arch/sparc/prom/Makefile
Back to the patch index
Back to the overall index
- Lines: 41
- Date:
Wed Jun 7 11:35:01 1995
- Orig file:
v1.3.3/linux/arch/sparc/prom/bootstr.c
- Orig date:
Thu Jan 1 02:00:00 1970
diff -u --recursive --new-file v1.3.3/linux/arch/sparc/prom/bootstr.c linux/arch/sparc/prom/bootstr.c
@@ -0,0 +1,40 @@
+/* bootstr.c: Boot string/argument acquisition from the PROM.
+ *
+ * Copyright(C) 1995 David S. Miller (davem@caip.rutgers.edu)
+ */
+
+#include <asm/oplib.h>
+
+static char barg_buf[128];
+
+char *
+prom_getbootargs(void)
+{
+ int iter;
+ char *cp;
+
+ switch(prom_vers) {
+ case PROM_V0:
+ cp = barg_buf;
+ for(iter = 0; iter < 8; iter++) {
+ strcpy(cp, (*(romvec->pv_v0bootargs))->argv[iter]);
+ cp += strlen(cp); *cp++=' ';
+ }
+ *cp = 0;
+ break;
+ case PROM_V2:
+ case PROM_V3:
+ cp = barg_buf;
+ strcpy(cp, *romvec->pv_v2bootargs.bootpath);
+ cp += strlen(cp);
+ *cp++ = ' ';
+ strcpy(cp, *romvec->pv_v2bootargs.bootargs);
+ cp += strlen(cp);
+ *cp = 0;
+ break;
+ default:
+ barg_buf[0] = 0;
+ break;
+ }
+ return barg_buf;
+}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov
with Sam's (original) version of this