Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Mar 2000 10:36:31 -0500 (EST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        current@FreeBSD.org, peter@FreeBSD.org
Subject:   sysinstall broken :(
Message-ID:  <200003241536.KAA78949@server.baldwin.cx>

next in thread | raw e-mail | index | archive | help
Hmph, it seems sysinstall (and thus make release) is broken in -current:

cc -O -pipe -Wall -I/usr/src/release/sysinstall/../../gnu/lib/libdialog
-I/usr/obj/usr/src/release/sysinstall -I/usr/src/release/sysinstall/../../sys   -c
/usr/src/release/sysinstall/kget.c
/usr/src/release/sysinstall/kget.c: In function `kget':
/usr/src/release/sysinstall/kget.c:83: sizeof applied to an incomplete type
/usr/src/release/sysinstall/kget.c:85: dereferencing pointer to incomplete type
/usr/src/release/sysinstall/kget.c:86: dereferencing pointer to incomplete type
/usr/src/release/sysinstall/kget.c:89: dereferencing pointer to incomplete type
/usr/src/release/sysinstall/kget.c:90: dereferencing pointer to incomplete type
/usr/src/release/sysinstall/kget.c:92: dereferencing pointer to incomplete type
/usr/src/release/sysinstall/kget.c:92: dereferencing pointer to incomplete type
/usr/src/release/sysinstall/kget.c:94: dereferencing pointer to incomplete type
/usr/src/release/sysinstall/kget.c:96: dereferencing pointer to incomplete type
/usr/src/release/sysinstall/kget.c:96: dereferencing pointer to incomplete type
/usr/src/release/sysinstall/kget.c:98: dereferencing pointer to incomplete type
/usr/src/release/sysinstall/kget.c:100: dereferencing pointer to incomplete type
/usr/src/release/sysinstall/kget.c:100: dereferencing pointer to incomplete type
/usr/src/release/sysinstall/kget.c:102: dereferencing pointer to incomplete type
/usr/src/release/sysinstall/kget.c:104: dereferencing pointer to incomplete type
/usr/src/release/sysinstall/kget.c:104: dereferencing pointer to incomplete type
/usr/src/release/sysinstall/kget.c:106: dereferencing pointer to incomplete type
/usr/src/release/sysinstall/kget.c:108: dereferencing pointer to incomplete type
/usr/src/release/sysinstall/kget.c:108: dereferencing pointer to incomplete type
/usr/src/release/sysinstall/kget.c:111: dereferencing pointer to incomplete type
/usr/src/release/sysinstall/kget.c:111: dereferencing pointer to incomplete type
/usr/src/release/sysinstall/kget.c:113: sizeof applied to an incomplete type
*** Error code 1

Stop in /usr/src/release/sysinstall.
*** Error code 1

Stop in /usr/src/release.
*** Error code 1

Stop in /usr/source/src/release.

All of these seem to be related to 'struct isa_device'.  It seems that when
the userconfig in the kernel was changed to use 'struct uc_device' instead,
that change wasn't propogated out to sysinstall.  This patch fixes all that:


Index: sys/i386/i386/userconfig.c
===================================================================
RCS file: /usr/cvs/src/sys/i386/i386/userconfig.c,v
retrieving revision 1.178
diff -u -r1.178 userconfig.c
--- sys/i386/i386/userconfig.c  2000/03/19 12:57:49     1.178
+++ sys/i386/i386/userconfig.c  2000/03/24 15:18:44
@@ -112,26 +112,6 @@
 #include <machine/md_var.h>
 #include <machine/limits.h>
 
-#define _I386_ISA_ISA_DEVICE_H_
-
-/*
- * Per device structure.  This just happens to resemble the old isa_device
- * but that is by accident.  It is NOT the same.
- */
-struct uc_device {
-       int     id_id;          /* device id */
-       char    *id_name;       /* device name */
-       int     id_iobase;      /* base i/o address */
-       u_int   id_irq;         /* interrupt request */
-       int     id_drq;         /* DMA request */
-       caddr_t id_maddr;       /* physical i/o memory address on bus (if any)*/
-       int     id_msize;       /* size of i/o memory */
-       int     id_unit;        /* unit number */
-       int     id_flags;       /* flags */
-       int     id_enabled;     /* is device enabled */
-       struct uc_device *id_next; /* used in uc_devlist in userconfig() */
-};
-
 #undef NPNP
 #define NPNP 0
 
@@ -141,6 +121,7 @@
 
 static MALLOC_DEFINE(M_DEVL, "uc_devlist", "uc_device lists in userconfig()");
 
+#include <machine/uc_device.h>
 static struct uc_device *uc_devlist;   /* list read by kget to extract changes */
 static struct uc_device *uc_devtab;    /* fake uc_device table */
 
Index: sys/i386/include/uc_device.h
===================================================================
RCS file: uc_device.h
diff -N uc_device.h
--- /dev/null   Fri Mar 24 02:17:20 2000
+++ uc_device.h Fri Mar 24 08:36:40 2000
@@ -0,0 +1,75 @@
+/**
+ ** Copyright (c) 1995
+ **      Michael Smith, msmith@freebsd.org.  All rights reserved.
+ **
+ ** This code contains a module marked :
+
+ * Copyright (c) 1991 Regents of the University of California.
+ * All rights reserved.
+ * Copyright (c) 1994 Jordan K. Hubbard
+ * All rights reserved.
+ * Copyright (c) 1994 David Greenman
+ * All rights reserved.
+ *
+ * Many additional changes by Bruce Evans
+ *
+ * This code is derived from software contributed by the
+ * University of California Berkeley, Jordan K. Hubbard,
+ * David Greenman and Bruce Evans.
+
+ ** As such, it contains code subject to the above copyrights.
+ ** The module and its copyright can be found below.
+ ** 
+ ** 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 as
+ **    the first lines of this file unmodified.
+ ** 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 acknowledgment:
+ **      This product includes software developed by Michael Smith.
+ ** 4. The name of the author may not be used to endorse or promote products
+ **    derived from this software without specific prior written permission.
+ **
+ ** THIS SOFTWARE IS PROVIDED BY MICHAEL SMITH ``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 MICHAEL SMITH 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.
+ **
+ ** $FreeBSD: src/sys/i386/i386/userconfig.c,v 1.178 2000/03/19 12:57:49 peter Exp $
+ **/
+
+#ifndef _I386_MACHINE_UC_DEVICE_H
+#define _I386_MACHINE_UC_DEVICE_H
+
+#define _I386_ISA_ISA_DEVICE_H_
+
+/*
+ * Per device structure.  This just happens to resemble the old isa_device
+ * but that is by accident.  It is NOT the same.
+ */
+struct uc_device {
+       int     id_id;          /* device id */
+       char    *id_name;       /* device name */
+       int     id_iobase;      /* base i/o address */
+       u_int   id_irq;         /* interrupt request */
+       int     id_drq;         /* DMA request */
+       caddr_t id_maddr;       /* physical i/o memory address on bus (if any)*/
+       int     id_msize;       /* size of i/o memory */
+       int     id_unit;        /* unit number */
+       int     id_flags;       /* flags */
+       int     id_enabled;     /* is device enabled */
+       struct uc_device *id_next; /* used in uc_devlist in userconfig() */
+};
+
+#endif
Index: release/sysinstall/Makefile
===================================================================
RCS file: /usr/cvs/src/release/sysinstall/Makefile,v
retrieving revision 1.92
diff -u -r1.92 Makefile
--- release/sysinstall/Makefile 2000/02/11 09:12:17     1.92
+++ release/sysinstall/Makefile 2000/03/24 15:34:23
@@ -18,7 +18,6 @@
        keymap.h
 
 CFLAGS+= -Wall -I${.CURDIR}/../../gnu/lib/libdialog -I${.OBJDIR}
-CFLAGS+= -I${.CURDIR}/../../sys
 .if ${MACHINE_ARCH} != "i386" || defined(X_AS_PKG)
 CFLAGS+= -DX_AS_PKG
 .endif
Index: release/sysinstall/kget.c
===================================================================
RCS file: /usr/cvs/src/release/sysinstall/kget.c,v
retrieving revision 1.14
diff -u -r1.14 kget.c
--- release/sysinstall/kget.c   1999/09/04 16:01:14     1.14
+++ release/sysinstall/kget.c   2000/03/24 15:29:08
@@ -37,7 +37,7 @@
 
 #include "sysinstall.h"
 #include <sys/sysctl.h>
-#include <i386/isa/isa_device.h>
+#include <machine/uc_device.h>
 
 int
 kget(char *out)
@@ -47,7 +47,7 @@
     char *mib1 = "machdep.uc_devlist";
     char name[9];
     FILE *fout = NULL;
-    struct isa_device *id;
+    struct uc_device *id;
     char *p;
  
     /* create the output file; if we end up not writing to it, we'll 
@@ -79,8 +79,8 @@
 
     i = 0;
     while (i < len) {
-       id = (struct isa_device *)(buf + i);
-       p = (buf + i + sizeof(struct isa_device));
+       id = (struct uc_device *)(buf + i);
+       p = (buf + i + sizeof(struct uc_device));
        strncpy(name, p, 8);
        if (!id->id_enabled) {
            bytes_written += fprintf(fout, "di %s%d\n", name, id->id_unit);
@@ -110,7 +110,7 @@
            bytes_written += fprintf(fout, "f %s%d %#x\n", name,
                                     id->id_unit, id->id_flags);
        }
-       i += sizeof(struct isa_device) + 8;
+       i += sizeof(struct uc_device) + 8;
     }
 
 bail:


Comments?

-- 

John Baldwin <jobaldwi@vt.edu> -- http://www.cslab.vt.edu/~jobaldwi/
PGP Key: http://www.cslab.vt.edu/~jobaldwi/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200003241536.KAA78949>