summaryrefslogtreecommitdiff
path: root/sys/stand/boot
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1998-04-18 07:40:04 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1998-04-18 07:40:04 +0000
commit888b63e1743ef4b4277b88169301e0b5c1445e16 (patch)
tree5b9d1c51879f3e1f909c17e6ec7c2f6050ac92e1 /sys/stand/boot
parentc2ee71fae9cec63f4a94c921619dc28d1c5b5032 (diff)
i386 bootblocks that work for 2.3. A tale too long to tell
Diffstat (limited to 'sys/stand/boot')
-rw-r--r--sys/stand/boot/bootarg.c13
-rw-r--r--sys/stand/boot/cmd.c14
2 files changed, 14 insertions, 13 deletions
diff --git a/sys/stand/boot/bootarg.c b/sys/stand/boot/bootarg.c
index 642f1c8b317..efee8f52cc4 100644
--- a/sys/stand/boot/bootarg.c
+++ b/sys/stand/boot/bootarg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bootarg.c,v 1.3 1997/10/25 06:58:48 mickey Exp $ */
+/* $OpenBSD: bootarg.c,v 1.4 1998/04/18 07:40:02 deraadt Exp $ */
/*
* Copyright (c) 1997 Michael Shalayeff
@@ -35,7 +35,7 @@
#include <lib/libsa/stand.h>
#include <stand/boot/bootarg.h>
-static bootarg_t *list = NULL;
+bootarg_t *bootarg_list;
void
addbootarg(t, l, p)
@@ -48,8 +48,8 @@ addbootarg(t, l, p)
q->ba_type = t;
q->ba_size = sizeof(*q) + l - sizeof(q->ba_arg);
bcopy(p, q->ba_arg, l);
- q->ba_next = list;
- list = q;
+ q->ba_next = bootarg_list;
+ bootarg_list = q;
}
void
@@ -63,7 +63,7 @@ makebootargs(v, lenp)
/* get total size */
l = sizeof(*p);
- for (p = list; p != NULL; p = p->ba_next)
+ for (p = bootarg_list; p != NULL; p = p->ba_next)
l += p->ba_size;
if (*lenp < l) {
#ifdef DEBUG
@@ -73,7 +73,8 @@ makebootargs(v, lenp)
}
*lenp = l;
/* copy them out */
- for (p = list, q = v; p != NULL && ((q + p->ba_size) - (u_char*)v) < l;
+ for (p = bootarg_list, q = v;
+ p != NULL && ((q + p->ba_size) - (u_char*)v) < l;
q += p->ba_size, p = p->ba_next) {
#ifdef DEBUG
printf("%d,%d ", p->ba_type, p->ba_size);
diff --git a/sys/stand/boot/cmd.c b/sys/stand/boot/cmd.c
index bb91488169c..df77cb88510 100644
--- a/sys/stand/boot/cmd.c
+++ b/sys/stand/boot/cmd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd.c,v 1.36 1998/02/24 22:16:03 weingart Exp $ */
+/* $OpenBSD: cmd.c,v 1.37 1998/04/18 07:40:03 deraadt Exp $ */
/*
* Copyright (c) 1997 Michael Shalayeff
@@ -63,7 +63,7 @@ static int Xmachine __P((void));
extern const struct cmd_table MACHINE_CMD[];
#endif
-static const struct cmd_table cmd_set[] = {
+const struct cmd_table cmd_set[] = {
{"addr", CMDT_VAR, Xaddr},
{"howto", CMDT_VAR, Xhowto},
#ifdef DEBUG
@@ -75,7 +75,7 @@ static const struct cmd_table cmd_set[] = {
{NULL,0}
};
-static const struct cmd_table cmd_table[] = {
+const struct cmd_table cmd_table[] = {
{"#", CMDT_CMD, Xnop}, /* XXX must be first */
{"boot", CMDT_CMD, Xboot},
{"echo", CMDT_CMD, Xecho},
@@ -101,7 +101,7 @@ static char *whatcmd
static int docmd __P((void));
static char *qualify __P((char *));
-static char cmd_buf[133];
+char cmd_buf[133];
int
getcmd()
@@ -525,14 +525,14 @@ ls(name, sb)
}
#undef lsrwx
+int doboot = 1;
+
static int
Xnop()
{
- static int doboot = 1;
-
if (doboot) {
doboot = 0;
- return(Xboot());
+ return (Xboot());
}
return 0;