Expand PMF_FN_* macros.
[netbsd-mini2440.git] / sys / arch / sun68k / stand / libsa / promboot.c
blob20c30efc7da8cfbdec4c49138b0884687a9d267e
1 /* $NetBSD: promboot.c,v 1.2.10.1 2005/01/24 08:35:03 skrll Exp $ */
4 #include <sys/param.h>
5 #include <sys/reboot.h>
7 #include <machine/mon.h>
9 #include "stand.h"
10 #include "libsa.h"
12 #ifdef DEBUG
13 int debug = 0;
14 #endif /* DEBUG */
15 int prom_boothow;
16 char * prom_bootfile;
17 char prom_bootdev[32];
20 * Get useful info from the PROM bootparams struct, i.e.:
21 * arg[0] = sd(0,0,0)netbsd
22 * arg[1] = -sa
25 void
26 prom_get_boot_info(void)
28 struct bootparam *bp;
29 char c, *src, *dst;
31 #ifdef DEBUG
32 printf("prom_get_boot_info\n");
33 #endif
35 bp = *romVectorPtr->bootParam;
37 /* Get device and file names. */
38 src = bp->argPtr[0];
39 dst = prom_bootdev;
40 *dst++ = *src++;
41 *dst++ = *src++;
42 if (*src == '(') {
43 while (*src) {
44 c = *src++;
45 *dst++ = c;
46 if (c == ')')
47 break;
49 *dst = '\0';
51 prom_bootfile = src;
53 /* Get boothowto flags. */
54 src = bp->argPtr[1];
55 if (src && (*src == '-')) {
56 while (*src) {
57 switch (*src++) {
58 case 'a':
59 prom_boothow |= RB_ASKNAME;
60 break;
61 case 's':
62 prom_boothow |= RB_SINGLE;
63 break;
64 case 'd':
65 prom_boothow |= RB_KDB;
66 #ifdef DEBUG
67 debug++;
68 #endif /* DEBUG */
69 break;
74 #ifdef DEBUG
75 if (debug) {
76 printf("Debug level %d - enter c to continue...", debug);
77 /* This will print "\nAbort at ...\n" */
78 breakpoint();
80 #endif /* DEBUG */