mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-12 09:58:36 +00:00
Update sysinstall to use struct uc_device instead of struct isa_device
for generating /boot/kernel.conf. Since this structure is shared, move its definition out to a header file, just as struct isa_device was defined in a header file. This fixes the sysinstall breakage in -current.
This commit is contained in:
parent
c8693bccf4
commit
76b501da94
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=58538
@ -18,7 +18,6 @@ SRCS= anonFTP.c cdrom.c command.c config.c devices.c dhcp.c kget.c \
|
||||
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
|
||||
|
@ -37,7 +37,7 @@ kget(char *out)
|
||||
|
||||
#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 @@ kget(char *out)
|
||||
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 @@ kget(char *out)
|
||||
|
||||
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 @@ kget(char *out)
|
||||
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:
|
||||
|
@ -114,24 +114,6 @@
|
||||
|
||||
#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 +123,7 @@ struct uc_device {
|
||||
|
||||
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 */
|
||||
|
||||
|
73
sys/i386/include/uc_device.h
Normal file
73
sys/i386/include/uc_device.h
Normal file
@ -0,0 +1,73 @@
|
||||
/**
|
||||
** 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$
|
||||
**/
|
||||
|
||||
#ifndef _I386_MACHINE_UC_DEVICE_H
|
||||
#define _I386_MACHINE_UC_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
|
@ -18,7 +18,6 @@ SRCS= anonFTP.c cdrom.c command.c config.c devices.c dhcp.c kget.c \
|
||||
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
|
||||
|
@ -18,7 +18,6 @@ SRCS= anonFTP.c cdrom.c command.c config.c devices.c dhcp.c kget.c \
|
||||
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
|
||||
|
@ -37,7 +37,7 @@ kget(char *out)
|
||||
|
||||
#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 @@ kget(char *out)
|
||||
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 @@ kget(char *out)
|
||||
|
||||
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 @@ kget(char *out)
|
||||
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:
|
||||
|
Loading…
Reference in New Issue
Block a user