Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/next68k/stand/boot Use common declarations and macr...



details:   https://anonhg.NetBSD.org/src/rev/504e642b822d
branches:  trunk
changeset: 373470:504e642b822d
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sun Feb 12 08:25:09 2023 +0000

description:
Use common declarations and macros in proper headers.

Also fix inconsistent sdopen() and sdstrategy() args and
remove useless #if 0'ed out code.
No functional change.

diffstat:

 sys/arch/next68k/stand/boot/boot.c      |  15 ++-----
 sys/arch/next68k/stand/boot/conf.c      |  12 +----
 sys/arch/next68k/stand/boot/devopen.c   |   8 ++--
 sys/arch/next68k/stand/boot/en.c        |   6 +--
 sys/arch/next68k/stand/boot/machdep.c   |   7 +--
 sys/arch/next68k/stand/boot/rtc.c       |   9 +---
 sys/arch/next68k/stand/boot/samachdep.h |  66 +++++++++++++++++++++++++++++++++
 sys/arch/next68k/stand/boot/scsi.c      |  17 +-------
 sys/arch/next68k/stand/boot/scsivar.h   |   5 +-
 sys/arch/next68k/stand/boot/sd.c        |  24 +++++++----
 10 files changed, 106 insertions(+), 63 deletions(-)

diffs (truncated from 423 to 300 lines):

diff -r df3ea6ca7976 -r 504e642b822d sys/arch/next68k/stand/boot/boot.c
--- a/sys/arch/next68k/stand/boot/boot.c        Sat Feb 11 22:42:49 2023 +0000
+++ b/sys/arch/next68k/stand/boot/boot.c        Sun Feb 12 08:25:09 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: boot.c,v 1.13 2023/02/11 02:33:27 tsutsui Exp $        */
+/*     $NetBSD: boot.c,v 1.14 2023/02/12 08:25:09 tsutsui Exp $        */
 /*
  * Copyright (c) 1994 Rolf Grossmann
  * All rights reserved.
@@ -34,17 +34,17 @@
 
 #include <lib/libsa/stand.h>
 #include <lib/libsa/loadfile.h>
+#include <lib/libsa/dev_net.h>
 #include <lib/libkern/libkern.h>
 
 #include <machine/cpu.h>        /* for NEXT_RAMBASE */
 
 #include <next68k/next68k/nextrom.h>
 
+#include "samachdep.h"
+
 #define KERN_LOADADDR NEXT_RAMBASE
 
-extern int errno;
-
-extern char *mg;
 #define        MON(type, off) (*(type *)((u_int) (mg) + off))
 
 int devparse(const char *, int *, char *, char *, char *, char **);
@@ -56,18 +56,11 @@
  * Boot device is derived from PROM provided information.
  */
 
-extern char bootprog_rev[];
-extern char bootprog_name[];
-extern int build;
 #define KNAMEN 100
 char kernel[KNAMEN];
 int entry_point;               /* return value filled in by machdep_start */
 int turbo;
 
-extern void rtc_init(void);
-
-extern int try_bootp;
-
 volatile int qq;
 
 int
diff -r df3ea6ca7976 -r 504e642b822d sys/arch/next68k/stand/boot/conf.c
--- a/sys/arch/next68k/stand/boot/conf.c        Sat Feb 11 22:42:49 2023 +0000
+++ b/sys/arch/next68k/stand/boot/conf.c        Sun Feb 12 08:25:09 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: conf.c,v 1.7 2005/12/11 12:18:29 christos Exp $        */
+/*     $NetBSD: conf.c,v 1.8 2023/02/12 08:25:09 tsutsui Exp $ */
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -45,21 +45,15 @@
 #include <netif.h>
 #include <dev_net.h>
 
+#include "samachdep.h"
+
 /*
  * Device configuration
  */
 
-extern int     sdstrategy(void *, int, daddr_t, size_t, void *, size_t *);
-extern int     sdopen(struct open_file *, ...);
-extern int     sdclose(struct open_file *);
 #define        sdioctl noioctl
 
-/* ### now from libsa
-extern int     enstrategy(void *, int, daddr_t, size_t, void *, size_t *);
-extern int     enopen(struct open_file *, ...);
-extern int     enclose(struct open_file *);
 #define        enioctl noioctl
-*/
 
 struct devsw devsw[] = {
        { "sd", sdstrategy,     sdopen, sdclose,        sdioctl },
diff -r df3ea6ca7976 -r 504e642b822d sys/arch/next68k/stand/boot/devopen.c
--- a/sys/arch/next68k/stand/boot/devopen.c     Sat Feb 11 22:42:49 2023 +0000
+++ b/sys/arch/next68k/stand/boot/devopen.c     Sun Feb 12 08:25:09 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: devopen.c,v 1.7 2023/02/04 14:38:09 tsutsui Exp $      */
+/*     $NetBSD: devopen.c,v 1.8 2023/02/12 08:25:09 tsutsui Exp $      */
 /*
  * Copyright (c) 1994 Rolf Grossmann
  * All rights reserved.
@@ -33,7 +33,7 @@
 #include <lib/libkern/libkern.h>
 
 int devlookup(const char *, int);
-int devparse(const char *, int *, char *, char *, char *, char **);
+int devparse(const char *, int *, int *, int *, int *, char **);
 
 int
 devlookup(const char *d, int len)
@@ -64,7 +64,7 @@
  */
 int
 devparse(const char *fname, int *dev,
-        char *count, char *lun, char *part, char **file)
+        int *count, int *lun, int *part, char **file)
 {
     int i;
     const char *s, *args[3];
@@ -120,7 +120,7 @@
 {
     int error;
     int dev;
-    char count, lun, part;
+    int count, lun, part;
     struct devsw *dp;
 
     dev   = 0; /* default device is first in table (usually scsi disk) */
diff -r df3ea6ca7976 -r 504e642b822d sys/arch/next68k/stand/boot/en.c
--- a/sys/arch/next68k/stand/boot/en.c  Sat Feb 11 22:42:49 2023 +0000
+++ b/sys/arch/next68k/stand/boot/en.c  Sun Feb 12 08:25:09 2023 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: en.c,v 1.19 2018/03/08 03:12:02 mrg Exp $        */
+/*      $NetBSD: en.c,v 1.20 2023/02/12 08:25:09 tsutsui Exp $        */
 /*
  * Copyright (c) 1996 Rolf Grossmann
  * All rights reserved.
@@ -37,6 +37,7 @@
 #include <next68k/next68k/nextrom.h>
 #include "enreg.h"
 #include "dmareg.h"
+#include "samachdep.h"
 
 #include <stand.h>
 #include <netif.h>
@@ -45,7 +46,6 @@
 
 #include <lib/libkern/libkern.h>
 
-extern char *mg;
 #define        MON(type, off) (*(type *)((u_int) (mg) + off))
 
 #define PRINTF(x) printf x;
@@ -80,8 +80,6 @@
        en_ifs, sizeof(en_ifs) / sizeof(en_ifs[0])
 };
 
-extern int turbo;
-
 /* ### int netdev_sock;
 static int open_count; */
 
diff -r df3ea6ca7976 -r 504e642b822d sys/arch/next68k/stand/boot/machdep.c
--- a/sys/arch/next68k/stand/boot/machdep.c     Sat Feb 11 22:42:49 2023 +0000
+++ b/sys/arch/next68k/stand/boot/machdep.c     Sun Feb 12 08:25:09 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.8 2023/02/04 14:38:09 tsutsui Exp $      */
+/*     $NetBSD: machdep.c,v 1.9 2023/02/12 08:25:09 tsutsui Exp $      */
 /*
  * Copyright (c) 1998 Darrin Jewell
  * Copyright (c) 1994 Rolf Grossmann
@@ -35,12 +35,12 @@
 #include <stand.h>
 #include <next68k/next68k/nextrom.h>
 
+#include "samachdep.h"
+
 char *mg;
 
 #define        MON(type, off) (*(type *)((u_int) (mg) + off))
 
-extern int entry_point;
-
 #ifdef DEBUG
 int debug = 1;
 #else
@@ -86,7 +86,6 @@
 __dead void
 _rtt(void)
 {
-       extern __dead void _halt(void);
 
        printf("Press any key to halt.\n");
        getchar();
diff -r df3ea6ca7976 -r 504e642b822d sys/arch/next68k/stand/boot/rtc.c
--- a/sys/arch/next68k/stand/boot/rtc.c Sat Feb 11 22:42:49 2023 +0000
+++ b/sys/arch/next68k/stand/boot/rtc.c Sun Feb 12 08:25:09 2023 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: rtc.c,v 1.7 2023/02/04 14:38:09 tsutsui Exp $        */
+/*      $NetBSD: rtc.c,v 1.8 2023/02/12 08:25:09 tsutsui Exp $        */
 /*
  * Copyright (c) 1997 Rolf Grossmann
  * All rights reserved.
@@ -35,12 +35,9 @@
 #include <lib/libsa/stand.h>
 #include <lib/libsa/net.h>
 
-u_char rtc_read(u_char);
-void rtc_init(void);
+#include "samachdep.h"
 
-
-/* ### where shall I put this definition? */
-#define        DELAY(n)        { register int N = (n); while (--N > 0); }
+u_char rtc_read(u_char);
 
 static volatile u_int *scr2 = (u_int *)NEXT_P_SCR2_CON;
 static u_char new_clock;
diff -r df3ea6ca7976 -r 504e642b822d sys/arch/next68k/stand/boot/samachdep.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/next68k/stand/boot/samachdep.h   Sun Feb 12 08:25:09 2023 +0000
@@ -0,0 +1,66 @@
+/*     $NetBSD: samachdep.h,v 1.1 2023/02/12 08:25:09 tsutsui Exp $    */
+
+/*
+ * Copyright (c) 1982, 1990, 1993
+ *     The Regents of the University of California.  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. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 THE REGENTS OR CONTRIBUTORS 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.
+ *
+ *     @(#)samachdep.h 8.1 (Berkeley) 6/10/93
+ */
+
+#include <sys/param.h>
+#include <lib/libsa/stand.h>
+
+/* boot.c */
+extern int entry_point;
+extern int turbo;
+
+/* en.c */
+int enstrategy(void *, int, daddr_t, size_t, void *, size_t *);
+int enopen(struct open_file *, ...);
+int enclose(struct open_file *);
+
+/* machdep.c */
+extern char *mg;
+
+/* rtc.c */
+void rtc_init(void);
+
+/* sd.c */
+int sdstrategy(void *, int, daddr_t, size_t, void *, size_t *);
+int sdopen(struct open_file *, ...);
+int sdclose(struct open_file *);
+
+/* srt0.S */
+__dead void _halt(void);
+
+/* vers.c (generated by sys/conf/newvers_stand.sh) */
+extern char bootprog_name[], bootprog_rev[], bootprog_kernrev[];
+
+/* build.c (generated by ${.CURDIR}/newvers.sh) */
+extern int build;
+
+#define DELAY(n)       { register int N = (n); while (--N > 0); }
diff -r df3ea6ca7976 -r 504e642b822d sys/arch/next68k/stand/boot/scsi.c
--- a/sys/arch/next68k/stand/boot/scsi.c        Sat Feb 11 22:42:49 2023 +0000
+++ b/sys/arch/next68k/stand/boot/scsi.c        Sun Feb 12 08:25:09 2023 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: scsi.c,v 1.12 2023/02/09 15:20:40 tsutsui Exp $        */
+/*      $NetBSD: scsi.c,v 1.13 2023/02/12 08:25:09 tsutsui Exp $        */
 /*
  * Copyright (c) 1994, 1997 Rolf Grossmann
  * All rights reserved.
@@ -33,17 +33,15 @@
 #include <next68k/dev/espreg.h>
 #include <dev/ic/ncr53c9xreg.h>
 #include <dev/scsipi/scsi_message.h>
-#if 0
-#include <next/next/prominfo.h>
-#else
 #include <next68k/next68k/nextrom.h>
-#endif
 #include "scsireg.h"
 #include "dmareg.h"
 #include "scsivar.h"
 



Home | Main Index | Thread Index | Old Index