Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/mvme68k/stand Pass the boot partition number into t...



details:   https://anonhg.NetBSD.org/src/rev/ebe335457942
branches:  trunk
changeset: 495210:ebe335457942
user:      scw <scw%NetBSD.org@localhost>
date:      Mon Jul 24 09:25:53 2000 +0000

description:
Pass the boot partition number into the loaded kernel, in preparation
for doing away with __BROKEN_DK_ESTABLISH.

diffstat:

 sys/arch/mvme68k/stand/bootsd/boot.c      |   8 ++++----
 sys/arch/mvme68k/stand/bootst/boot.c      |   8 ++++----
 sys/arch/mvme68k/stand/libsa/exec_mvme.c  |  18 ++++++++++++------
 sys/arch/mvme68k/stand/libsa/libsa.h      |   6 +++---
 sys/arch/mvme68k/stand/libsa/parse_args.c |  21 +++++++++++++--------
 sys/arch/mvme68k/stand/netboot/boot.c     |  10 +++++-----
 6 files changed, 41 insertions(+), 30 deletions(-)

diffs (237 lines):

diff -r 356638dcf592 -r ebe335457942 sys/arch/mvme68k/stand/bootsd/boot.c
--- a/sys/arch/mvme68k/stand/bootsd/boot.c      Mon Jul 24 09:16:27 2000 +0000
+++ b/sys/arch/mvme68k/stand/bootsd/boot.c      Mon Jul 24 09:25:53 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: boot.c,v 1.1 1996/05/17 20:04:47 chuck Exp $ */
+/*     $NetBSD: boot.c,v 1.2 2000/07/24 09:25:53 scw Exp $ */
 
 /*-
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -51,13 +51,13 @@
 main()
 {
        char *cp, *file;
-       int     io, flag;
+       int     io, flag, part;
 
        printf(">> BSD MVME%x bootsd [%s]\n", bugargs.cputyp, version);
 
-       parse_args(&file, &flag);
+       parse_args(&file, &flag, &part);
 
-       exec_mvme(file, flag);
+       exec_mvme(file, flag, part);
 
        printf("boot: %s: %s\n", file, strerror(errno));
        return(0);
diff -r 356638dcf592 -r ebe335457942 sys/arch/mvme68k/stand/bootst/boot.c
--- a/sys/arch/mvme68k/stand/bootst/boot.c      Mon Jul 24 09:16:27 2000 +0000
+++ b/sys/arch/mvme68k/stand/bootst/boot.c      Mon Jul 24 09:25:53 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: boot.c,v 1.1 1996/05/28 15:23:53 chuck Exp $ */
+/*     $NetBSD: boot.c,v 1.2 2000/07/24 09:25:53 scw Exp $ */
 
 /*-
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -54,11 +54,11 @@
 main()
 {
        char *cp, *file;
-       int     io, flag;
+       int     io, flag, part;
 
        printf(">> BSD MVME%x tapeboot [%s]\n", bugargs.cputyp, version);
 
-       parse_args(&file, &flag);
+       parse_args(&file, &flag, &part);
        file = defname; /* override */
 
        if (flag & RB_ASKNAME) {
@@ -68,7 +68,7 @@
                        file = line;
        }
 
-       exec_mvme(file, flag);
+       exec_mvme(file, flag, part);
 
        printf("tapeboot: %s: %s\n", file, strerror(errno));
        return(0);
diff -r 356638dcf592 -r ebe335457942 sys/arch/mvme68k/stand/libsa/exec_mvme.c
--- a/sys/arch/mvme68k/stand/libsa/exec_mvme.c  Mon Jul 24 09:16:27 2000 +0000
+++ b/sys/arch/mvme68k/stand/libsa/exec_mvme.c  Mon Jul 24 09:25:53 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: exec_mvme.c,v 1.7 2000/07/10 22:48:25 jdolecek Exp $ */
+/*     $NetBSD: exec_mvme.c,v 1.8 2000/07/24 09:25:53 scw Exp $ */
 
 /*-
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -43,22 +43,28 @@
 #include "stand.h"
 #include "libsa.h"
 
+
+/* This must agree with what locore.s expects */
+typedef void (*kentry_t)(int, u_int, u_int, u_int, int, char *);
+
+
 /*ARGSUSED*/
 void
-exec_mvme(file, flag)
+exec_mvme(file, flag, part)
        char    *file;
        int     flag;
+       int     part;
 {
        char *loadaddr;
        int io;
        struct exec x;
        int cc, magic;
-       void (*entry)();
+       kentry_t *entry;
        char *cp;
        int *ip;
 
 #ifdef DEBUG
-       printf("exec_mvme: file=%s flag=0x%x\n", file, flag);
+       printf("exec_mvme: partition=%d, file=%s flag=0x%x\n", part, file, flag);
 #endif
 
        io = open(file, 0);
@@ -93,7 +99,7 @@
        if (magic == ZMAGIC)
                cp += sizeof(x);
        /*LINTED*/
-       entry = (void (*)())cp;
+       entry = (kentry_t *) cp;
 
        /*
         * Leave a copy of the exec header before the text.
@@ -185,7 +191,7 @@
 
        printf("Start @ 0x%p ...\n", entry);
        (*entry)(flag, bugargs.ctrl_addr, 
-                               bugargs.ctrl_lun, bugargs.dev_lun, 0, cp);
+                               bugargs.ctrl_lun, bugargs.dev_lun, part, cp);
        printf("exec: kernel returned!\n");
        return;
 
diff -r 356638dcf592 -r ebe335457942 sys/arch/mvme68k/stand/libsa/libsa.h
--- a/sys/arch/mvme68k/stand/libsa/libsa.h      Mon Jul 24 09:16:27 2000 +0000
+++ b/sys/arch/mvme68k/stand/libsa/libsa.h      Mon Jul 24 09:25:53 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: libsa.h,v 1.2 1996/05/19 20:08:15 chuck Exp $  */
+/*     $NetBSD: libsa.h,v 1.3 2000/07/24 09:25:53 scw Exp $    */
 
 /*
  * libsa prototypes 
@@ -13,8 +13,8 @@
 int bugscstrategy __P((void *, int, daddr_t, size_t, void *, size_t *));
 
 /* exec_mvme.c */
-void exec_mvme __P((char *, int));
+void exec_mvme __P((char *, int, int));
 
 /* parse_args.c */
-void parse_args __P((char **, int *));
+void parse_args __P((char **, int *, int *));
 
diff -r 356638dcf592 -r ebe335457942 sys/arch/mvme68k/stand/libsa/parse_args.c
--- a/sys/arch/mvme68k/stand/libsa/parse_args.c Mon Jul 24 09:16:27 2000 +0000
+++ b/sys/arch/mvme68k/stand/libsa/parse_args.c Mon Jul 24 09:25:53 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse_args.c,v 1.4 2000/07/10 22:48:25 jdolecek Exp $  */
+/*     $NetBSD: parse_args.c,v 1.5 2000/07/24 09:25:53 scw Exp $       */
 
 /*-
  * Copyright (c) 1995 Theo de Raadt
@@ -34,6 +34,7 @@
 
 #include <sys/param.h>
 #include <sys/reboot.h>
+#include <sys/disklabel.h>
 #include <machine/prom.h>
 
 #include "stand.h"
@@ -55,14 +56,13 @@
 };
 
 void
-parse_args(filep, flagp)
-
+parse_args(filep, flagp, partp)
 char **filep;
 int *flagp;
-
+int *partp;
 {
        char *name = KERNEL_NAME, *ptr;
-       int i, howto = 0;
+       int i, howto = 0, part = 0;
        char c;
 
        if (bugargs.arg_start != bugargs.arg_end) {
@@ -73,9 +73,13 @@
                        if (c == '\0')
                                return;
                        if (c != '-') {
-                               if ( ptr[1] == ':' ) {
-                                       howto |= RB_ASKNAME;
-                                       if ( ptr[2] == ' ' || ptr[2] == '\0' ) {
+                               if (ptr[1] == ':') {
+                                       part = (int) (*ptr - 'A');
+                                       if (part >= MAXPARTITIONS)
+                                               part -= 0x20;
+                                       if (part < 0 || part >= MAXPARTITIONS)
+                                               part = 0;
+                                       if (ptr[2] == ' ' || ptr[2] == '\0') {
                                                ptr += 2;
                                                continue;
                                        }
@@ -98,4 +102,5 @@
        }
        *flagp = howto;
        *filep = name;
+       *partp = part;
 }
diff -r 356638dcf592 -r ebe335457942 sys/arch/mvme68k/stand/netboot/boot.c
--- a/sys/arch/mvme68k/stand/netboot/boot.c     Mon Jul 24 09:16:27 2000 +0000
+++ b/sys/arch/mvme68k/stand/netboot/boot.c     Mon Jul 24 09:25:53 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: boot.c,v 1.4 1996/05/19 21:07:21 chuck Exp $ */
+/*     $NetBSD: boot.c,v 1.5 2000/07/24 09:25:54 scw Exp $ */
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -48,7 +48,7 @@
 main()
 {
        char *cp, *file;
-       int ask = 0, howto, sboot = 0;
+       int ask = 0, howto, part, sboot = 0;
 
        printf(">> BSD MVME%x netboot (via %s) [%s]\n", bugargs.cputyp, 
                bugargs.arg_start, version);
@@ -59,7 +59,7 @@
        bugargs.arg_end   = bugargs.nbarg_end;
        *bugargs.arg_end = 0; /* ensure */
 
-       parse_args(&file, &howto);
+       parse_args(&file, &howto, &part);
 
        for (;;) {
                if (ask) {
@@ -71,12 +71,12 @@
                                while (cp < (line + sizeof(line) - 1) && *cp) 
                                        cp++;
                                bugargs.arg_end = cp;
-                               parse_args(&file, &howto);
+                               parse_args(&file, &howto, &part);
                        }
                }
                if (sboot)
                        howto |= RB_SBOOT;
-               exec_mvme(file, howto);
+               exec_mvme(file, howto, part);
                printf("boot: %s: %s\n", file, strerror(errno));
                ask = 1;
        }



Home | Main Index | Thread Index | Old Index