Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x68k/stand/xxboot Add xxboot.h common header to sha...



details:   https://anonhg.NetBSD.org/src/rev/e7dd1dcbe026
branches:  trunk
changeset: 974851:e7dd1dcbe026
user:      isaki <isaki%NetBSD.org@localhost>
date:      Fri Aug 14 03:34:22 2020 +0000

description:
Add xxboot.h common header to share prototype definitions.

diffstat:

 sys/arch/x68k/stand/xxboot/bootmain.c |  19 +-----------
 sys/arch/x68k/stand/xxboot/xx.c       |   4 +-
 sys/arch/x68k/stand/xxboot/xxboot.h   |  51 +++++++++++++++++++++++++++++++++++
 3 files changed, 55 insertions(+), 19 deletions(-)

diffs (118 lines):

diff -r d7c6e7e0c32a -r e7dd1dcbe026 sys/arch/x68k/stand/xxboot/bootmain.c
--- a/sys/arch/x68k/stand/xxboot/bootmain.c     Fri Aug 14 03:29:23 2020 +0000
+++ b/sys/arch/x68k/stand/xxboot/bootmain.c     Fri Aug 14 03:34:22 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bootmain.c,v 1.5 2020/08/14 02:51:48 isaki Exp $       */
+/*     $NetBSD: bootmain.c,v 1.6 2020/08/14 03:34:22 isaki Exp $       */
 
 /*-
  * Copyright (c) 1993, 1994 Takumi Nakamura.
@@ -39,25 +39,12 @@
 #include <lib/libsa/stand.h>
 #include <lib/libsa/loadfile.h>
 
+#include "xxboot.h"
 #include "libx68k.h"
 #include "iocs.h"
 #include "exec_image.h"
 
 #define EXSCSI_BDID    ((void *)0x00ea0001)
-#define BINF_ISFD(pbinf)       (*((uint8_t *)(pbinf) + 1) == 0)
-
-/* boot.S */
-extern int badbaddr(volatile void *);
-extern unsigned int ID;                /* target SCSI ID */
-extern unsigned int BOOT_INFO; /* result of IOCS(__BOOTINF) */
-extern struct {
-       struct fdfmt{
-               uint8_t N;      /* sector length 0: 128, ..., 3: 1K */
-               uint8_t C;      /* cylinder # */
-               uint8_t H;      /* head # */
-               uint8_t R;      /* sector # */
-       } minsec, maxsec;
-} FDSECMINMAX;                 /* FD format type of the first track */
 
 /* for debug */
 unsigned int startregs[16];
@@ -107,8 +94,6 @@
        return ha;
 }
 
-extern const char bootprog_name[], bootprog_rev[];
-
 void
 bootmain(void)
 {
diff -r d7c6e7e0c32a -r e7dd1dcbe026 sys/arch/x68k/stand/xxboot/xx.c
--- a/sys/arch/x68k/stand/xxboot/xx.c   Fri Aug 14 03:29:23 2020 +0000
+++ b/sys/arch/x68k/stand/xxboot/xx.c   Fri Aug 14 03:34:22 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xx.c,v 1.2 2012/11/17 16:02:00 tsutsui Exp $   */
+/*     $NetBSD: xx.c,v 1.3 2020/08/14 03:34:22 isaki Exp $     */
 
 /*
  * Copyright (c) 2010 MINOURA Makoto.
@@ -28,7 +28,7 @@
 #include <sys/param.h>
 #include <lib/libsa/stand.h>
 
-extern void RAW_READ(void *buf, uint32_t blkpos, size_t bytelen);
+#include "xxboot.h"
 
 int
 xxopen(struct open_file *f, ...)
diff -r d7c6e7e0c32a -r e7dd1dcbe026 sys/arch/x68k/stand/xxboot/xxboot.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/x68k/stand/xxboot/xxboot.h       Fri Aug 14 03:34:22 2020 +0000
@@ -0,0 +1,51 @@
+/*     $NetBSD: xxboot.h,v 1.3 2020/08/14 03:34:22 isaki Exp $ */
+
+/*
+ * Copyright (C) 2020 Tetsuya Isaki. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
+ */
+
+#define BINF_ISFD(pbinf)       (*((uint8_t *)(pbinf) + 1) == 0)
+
+/* boot.S */
+extern void RAW_READ(void *, uint32_t, size_t);
+extern int badbaddr(volatile void *);
+extern unsigned int BOOT_INFO; /* result of IOCS(__BOOTINF) */
+extern unsigned int ID;                /* target SCSI ID */
+extern struct {
+       struct fdfmt{
+               uint8_t N;      /* sector length 0: 128, ..., 3: 1K */
+               uint8_t C;      /* cylinder # */
+               uint8_t H;      /* head # */
+               uint8_t R;      /* sector # */
+       } minsec, maxsec;
+} FDSECMINMAX;                 /* FD format type of the first track */
+
+/* xx.c */
+extern int xxopen(struct open_file *, ...);
+extern int xxclose(struct open_file *);
+extern int xxstrategy(void *, int, daddr_t, size_t, void *, size_t *);
+
+/* vers.c */
+extern const char bootprog_name[];
+extern const char bootprog_rev[];



Home | Main Index | Thread Index | Old Index