From e4dd1abb05173a61161e22312a000cb5ebf32bee Mon Sep 17 00:00:00 2001 From: simonb Date: Sun, 14 Mar 1999 00:57:06 +0000 Subject: [PATCH] Merge contents of filesystem.c into conf.c, and remove declaration of errno from conf.c and put it in boot.c. --- sys/arch/pmax/stand/lib/conf.c | 17 ++++++-- sys/arch/pmax/stand/scsiboot/Makefile | 4 +- sys/arch/pmax/stand/scsiboot/boot.c | 33 ++------------- sys/arch/pmax/stand/scsiboot/bootxx.c | 33 ++------------- sys/arch/pmax/stand/scsiboot/conf.c | 17 ++++++-- sys/arch/pmax/stand/scsiboot/filesystem.c | 50 ----------------------- 6 files changed, 36 insertions(+), 118 deletions(-) delete mode 100644 sys/arch/pmax/stand/scsiboot/filesystem.c diff --git a/sys/arch/pmax/stand/lib/conf.c b/sys/arch/pmax/stand/lib/conf.c index 2adb39cca1c8..b33874b5d1e1 100644 --- a/sys/arch/pmax/stand/lib/conf.c +++ b/sys/arch/pmax/stand/lib/conf.c @@ -1,4 +1,4 @@ -/* $NetBSD: conf.c,v 1.10 1999/02/22 07:17:44 simonb Exp $ */ +/* $NetBSD: conf.c,v 1.11 1999/03/14 00:57:07 simonb Exp $ */ /* * Copyright (c) 1992, 1993 @@ -45,10 +45,13 @@ #include const struct callback *callv = &callvec; -int errno; -extern void nullsys(); -extern int nodev(), noioctl(); +#ifdef UFS_NOCLOSE +#define ufs_close 0 +#endif +#ifdef UFS_NOWRITE +#define ufs_write 0 +#endif #ifdef SMALL #define rzclose /*(()(struct open_file*))*/0 @@ -62,3 +65,9 @@ struct devsw devsw[] = { }; int ndevs = (sizeof(devsw)/sizeof(devsw[0])); + +struct fs_ops file_system[] = { + { ufs_open, ufs_close, ufs_read, ufs_write, ufs_seek, ufs_stat } +}; + +int nfsys = sizeof(file_system)/sizeof(struct fs_ops); diff --git a/sys/arch/pmax/stand/scsiboot/Makefile b/sys/arch/pmax/stand/scsiboot/Makefile index e82ee79fc0ac..559e5b4fc38e 100644 --- a/sys/arch/pmax/stand/scsiboot/Makefile +++ b/sys/arch/pmax/stand/scsiboot/Makefile @@ -1,10 +1,10 @@ -# $NetBSD: Makefile,v 1.6 1999/02/24 13:54:54 simonb Exp $ +# $NetBSD: Makefile,v 1.7 1999/03/14 00:57:06 simonb Exp $ # @(#)Makefile 8.3 (Berkeley) 2/16/94 S= ${.CURDIR}/../../../.. PROG= boot -SRCS= start.S boot.c conf.c filesystem.c +SRCS= start.S boot.c conf.c CLEANFILES+=${PROG}.elf ${PROG}.map ${ALL} DPADD+= ${LIBS} diff --git a/sys/arch/pmax/stand/scsiboot/boot.c b/sys/arch/pmax/stand/scsiboot/boot.c index 0e857e7602cc..ba1169857ddb 100644 --- a/sys/arch/pmax/stand/scsiboot/boot.c +++ b/sys/arch/pmax/stand/scsiboot/boot.c @@ -1,4 +1,4 @@ -/* $NetBSD: boot.c,v 1.11 1999/02/22 10:23:53 simonb Exp $ */ +/* $NetBSD: boot.c,v 1.12 1999/03/14 00:57:07 simonb Exp $ */ /* * Copyright (c) 1992, 1993 @@ -43,10 +43,9 @@ #include #include - #include "byteswap.h" -char line[512]; +int errno; /* * This gets arguments from the PROM, calls other routines to open @@ -62,39 +61,15 @@ _main(argc, argv) char **argv; { register char *cp; - int ask, entry; + int entry; -#ifdef DIAGNOSTIC - extern int prom_id; /* hack, saved by standalone startup */ - - (*(callvec._printf))("hello, world\n"); - - printf ((callv == &callvec)? "No REX %x\n" : "have REX %x\n", - prom_id); -#endif - -#ifdef JUSTASK - ask = 1; -#else /* check for DS5000 boot */ if (strcmp(argv[0], "boot") == 0) { argc--; argv++; } cp = *argv; - ask = 0; -#endif /* JUSTASK */ - - printf("Boot: "); - if (ask) { - gets(line); - if (line[0] == '\0') - return 0; - cp = line; - argv[0] = cp; - argc = 1; - } else - printf("%s\n", cp); + printf("Boot: %s\n", cp); entry = loadfile(cp); if (entry == -1) return 0; diff --git a/sys/arch/pmax/stand/scsiboot/bootxx.c b/sys/arch/pmax/stand/scsiboot/bootxx.c index 09a246c14194..4bb746bdc412 100644 --- a/sys/arch/pmax/stand/scsiboot/bootxx.c +++ b/sys/arch/pmax/stand/scsiboot/bootxx.c @@ -1,4 +1,4 @@ -/* $NetBSD: bootxx.c,v 1.11 1999/02/22 10:23:53 simonb Exp $ */ +/* $NetBSD: bootxx.c,v 1.12 1999/03/14 00:57:07 simonb Exp $ */ /* * Copyright (c) 1992, 1993 @@ -43,10 +43,9 @@ #include #include - #include "byteswap.h" -char line[512]; +int errno; /* * This gets arguments from the PROM, calls other routines to open @@ -62,39 +61,15 @@ _main(argc, argv) char **argv; { register char *cp; - int ask, entry; + int entry; -#ifdef DIAGNOSTIC - extern int prom_id; /* hack, saved by standalone startup */ - - (*(callvec._printf))("hello, world\n"); - - printf ((callv == &callvec)? "No REX %x\n" : "have REX %x\n", - prom_id); -#endif - -#ifdef JUSTASK - ask = 1; -#else /* check for DS5000 boot */ if (strcmp(argv[0], "boot") == 0) { argc--; argv++; } cp = *argv; - ask = 0; -#endif /* JUSTASK */ - - printf("Boot: "); - if (ask) { - gets(line); - if (line[0] == '\0') - return 0; - cp = line; - argv[0] = cp; - argc = 1; - } else - printf("%s\n", cp); + printf("Boot: %s\n", cp); entry = loadfile(cp); if (entry == -1) return 0; diff --git a/sys/arch/pmax/stand/scsiboot/conf.c b/sys/arch/pmax/stand/scsiboot/conf.c index 2adb39cca1c8..b33874b5d1e1 100644 --- a/sys/arch/pmax/stand/scsiboot/conf.c +++ b/sys/arch/pmax/stand/scsiboot/conf.c @@ -1,4 +1,4 @@ -/* $NetBSD: conf.c,v 1.10 1999/02/22 07:17:44 simonb Exp $ */ +/* $NetBSD: conf.c,v 1.11 1999/03/14 00:57:07 simonb Exp $ */ /* * Copyright (c) 1992, 1993 @@ -45,10 +45,13 @@ #include const struct callback *callv = &callvec; -int errno; -extern void nullsys(); -extern int nodev(), noioctl(); +#ifdef UFS_NOCLOSE +#define ufs_close 0 +#endif +#ifdef UFS_NOWRITE +#define ufs_write 0 +#endif #ifdef SMALL #define rzclose /*(()(struct open_file*))*/0 @@ -62,3 +65,9 @@ struct devsw devsw[] = { }; int ndevs = (sizeof(devsw)/sizeof(devsw[0])); + +struct fs_ops file_system[] = { + { ufs_open, ufs_close, ufs_read, ufs_write, ufs_seek, ufs_stat } +}; + +int nfsys = sizeof(file_system)/sizeof(struct fs_ops); diff --git a/sys/arch/pmax/stand/scsiboot/filesystem.c b/sys/arch/pmax/stand/scsiboot/filesystem.c deleted file mode 100644 index 41644e9c8308..000000000000 --- a/sys/arch/pmax/stand/scsiboot/filesystem.c +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 1993 Philip A. Nelson. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Philip A. Nelson. - * 4. The name of Philip A. Nelson may not be used to endorse or promote - * products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY PHILIP NELSON ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL PHILIP NELSON BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * filesystem.c - * - * $NetBSD: filesystem.c,v 1.3 1999/02/22 10:18:40 simonb Exp $ - */ - -#include -#include - -#ifdef UFS_NOCLOSE -#define ufs_close 0 -#endif -#ifdef UFS_NOWRITE -#define ufs_write 0 -#endif - -struct fs_ops file_system[] = { - { ufs_open, ufs_close, ufs_read, ufs_write, ufs_seek, ufs_stat } -}; - -int nfsys = sizeof(file_system)/sizeof(struct fs_ops);