summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1995-11-20 12:42:39 +0000
committerphk <phk@FreeBSD.org>1995-11-20 12:42:39 +0000
commitd0c66446cc835afd7c554f93568beda34a3cbba0 (patch)
tree3c18ee3a32f49eafefcfca9b38f0533552958ab7 /sys/i386
parent7921cd5a326a4e25ea8f8e1c4da15f46710544e6 (diff)
downloadFreeBSD-src-d0c66446cc835afd7c554f93568beda34a3cbba0.zip
FreeBSD-src-d0c66446cc835afd7c554f93568beda34a3cbba0.tar.gz
Mega commit for sysctl.
Convert the remaining sysctl stuff to the new way of doing things. the devconf stuff is the reason for the large number of files. Cleaned up some compiler warnings while I were there.
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/eisa/eisaconf.c22
-rw-r--r--sys/i386/eisa/eisaconf.h7
-rw-r--r--sys/i386/i386/machdep.c11
-rw-r--r--sys/i386/include/devconf.h16
-rw-r--r--sys/i386/isa/fd.c17
-rw-r--r--sys/i386/isa/ft.c10
-rw-r--r--sys/i386/isa/isa.c31
-rw-r--r--sys/i386/isa/isa_device.h9
-rw-r--r--sys/i386/isa/wcd.c7
-rw-r--r--sys/i386/isa/wd.c9
10 files changed, 46 insertions, 93 deletions
diff --git a/sys/i386/eisa/eisaconf.c b/sys/i386/eisa/eisaconf.c
index d1b37ef..b83cc49 100644
--- a/sys/i386/eisa/eisaconf.c
+++ b/sys/i386/eisa/eisaconf.c
@@ -18,11 +18,12 @@
* 4. Modifications may be freely made to this file if the above conditions
* are met.
*
- * $Id: eisaconf.c,v 1.6 1995/11/09 22:43:25 gibbs Exp $
+ * $Id: eisaconf.c,v 1.7 1995/11/10 01:32:12 gibbs Exp $
*/
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
+#include <sys/sysctl.h>
#include <sys/conf.h>
#include <sys/malloc.h>
#include <sys/devconf.h>
@@ -464,25 +465,14 @@ eisa_registerdev(e_dev, driver, kdc_template)
* hw.devconf interface.
*/
int
-eisa_externalize(e_dev, userp, maxlen)
- struct eisa_device *e_dev;
- void *userp;
- size_t *maxlen;
+eisa_externalize(struct eisa_device *e_dev, struct sysctl_req *req)
{
- if (*maxlen < sizeof *e_dev) {
- return ENOMEM;
- }
- *maxlen -= sizeof *e_dev;
- return (copyout(e_dev, userp, sizeof *e_dev));
+ return (SYSCTL_OUT(req, e_dev, sizeof *e_dev));
}
int
-eisa_generic_externalize(p, kdc, userp, l)
- struct proc *p;
- struct kern_devconf *kdc;
- void *userp;
- size_t l;
+eisa_generic_externalize(struct kern_devconf *kdc, struct sysctl_req *req)
{
- return eisa_externalize(kdc->kdc_eisa, userp, &l);
+ return eisa_externalize(kdc->kdc_eisa, req);
}
diff --git a/sys/i386/eisa/eisaconf.h b/sys/i386/eisa/eisaconf.h
index b762846..7d79d89 100644
--- a/sys/i386/eisa/eisaconf.h
+++ b/sys/i386/eisa/eisaconf.h
@@ -18,7 +18,7 @@
* 4. Modifications may be freely made to this file if the above conditions
* are met.
*
- * $Id: eisaconf.h,v 1.3 1995/11/05 04:42:50 gibbs Exp $
+ * $Id: eisaconf.h,v 1.4 1995/11/06 05:21:01 gibbs Exp $
*/
#ifndef _I386_EISA_EISACONF_H_
@@ -85,9 +85,10 @@ int eisa_reg_iospace __P((struct eisa_device *, u_long, int));
int eisa_registerdev __P((struct eisa_device *, struct eisa_driver *, struct kern_devconf *));
-extern int eisa_externalize __P((struct eisa_device *, void *, size_t *));
+struct sysctl_req;
+int eisa_externalize (struct eisa_device *, struct sysctl_req*);
-extern int eisa_generic_externalize __P((struct proc *,struct kern_devconf *, void *, size_t));
+int eisa_generic_externalize (struct kern_devconf *, struct sysctl_req *);
extern struct kern_devconf kdc_eisa0;
#define EISA_EXTERNALLEN (sizeof(struct eisa_device))
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c
index 8963c34..77cfdb9 100644
--- a/sys/i386/i386/machdep.c
+++ b/sys/i386/i386/machdep.c
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
- * $Id: machdep.c,v 1.150 1995/11/12 19:51:22 phk Exp $
+ * $Id: machdep.c,v 1.151 1995/11/14 09:52:25 phk Exp $
*/
#include "npx.h"
@@ -1821,12 +1821,7 @@ bad:
}
int
-disk_externalize(int drive, void *userp, size_t *maxlen)
+disk_externalize(int drive, struct sysctl_req *req)
{
- if(*maxlen < sizeof drive) {
- return ENOMEM;
- }
-
- *maxlen -= sizeof drive;
- return copyout(&drive, userp, sizeof drive);
+ return SYSCTL_OUT(req, &drive, sizeof drive);
}
diff --git a/sys/i386/include/devconf.h b/sys/i386/include/devconf.h
index c1c822c..d4a30c9 100644
--- a/sys/i386/include/devconf.h
+++ b/sys/i386/include/devconf.h
@@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: devconf.h,v 1.10 1995/11/05 04:43:22 gibbs Exp $
+ * $Id: devconf.h,v 1.11 1995/11/14 20:52:14 phk Exp $
*/
/*
* devconf.h - machine-dependent device configuration table
@@ -67,23 +67,13 @@ struct machdep_devconf {
#define kdc_eisa kdc_parentdata
#define kdc_scsi kdc_parentdata
-
-
-/* XXX Don't do this, compile time increases too much
-#include <i386/isa/isa_device.h>
-#include <i386/eisa/eisaconf.h>
-#include <pci/pcireg.h>
-#include <pci/pcivar.h>
-#include <scsi/scsi_all.h>
-#include <scsi/scsiconf.h>
-*/
-
#define CPU_EXTERNALLEN (0)
#define DISK_EXTERNALLEN (sizeof(int))
#define BUS_EXTERNALLEN (0)
#ifdef KERNEL /* XXX move this */
-extern int disk_externalize(int, void *, size_t *);
+struct sysctl_req;
+extern int disk_externalize(int, struct sysctl_req *);
#endif
#endif /* _MACHINE_DEVCONF_H_ */
diff --git a/sys/i386/isa/fd.c b/sys/i386/isa/fd.c
index f862203..4601645 100644
--- a/sys/i386/isa/fd.c
+++ b/sys/i386/isa/fd.c
@@ -43,7 +43,7 @@
* SUCH DAMAGE.
*
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
- * $Id: fd.c,v 1.69 1995/11/04 17:07:17 bde Exp $
+ * $Id: fd.c,v 1.70 1995/11/18 07:48:11 bde Exp $
*
*/
@@ -89,8 +89,7 @@
static int fd_goaway(struct kern_devconf *, int);
static int fdc_goaway(struct kern_devconf *, int);
-static int
-fd_externalize(struct proc *, struct kern_devconf *, void *, size_t);
+static int fd_externalize(struct kern_devconf *, struct sysctl_req *);
/*
* Templates for the kern_devconf structures used when we attach.
@@ -344,17 +343,9 @@ struct isa_device *fdcdevs[NFDC];
* Provide hw.devconf information.
*/
static int
-fd_externalize(struct proc *p, struct kern_devconf *kdc,
- void *userp, size_t len)
-{
- return disk_externalize(fd_data[kdc->kdc_unit].fdsu, userp, &len);
-}
-
-static int
-fdc_externalize(struct proc *p, struct kern_devconf *kdc,
- void *userp, size_t len)
+fd_externalize(struct kern_devconf *kdc, struct sysctl_req *req)
{
- return isa_externalize(fdcdevs[kdc->kdc_unit], userp, &len);
+ return disk_externalize(fd_data[kdc->kdc_unit].fdsu, req);
}
static int
diff --git a/sys/i386/isa/ft.c b/sys/i386/isa/ft.c
index a56a84f..8d116d5 100644
--- a/sys/i386/isa/ft.c
+++ b/sys/i386/isa/ft.c
@@ -17,7 +17,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* ft.c - QIC-40/80 floppy tape driver
- * $Id: ft.c,v 1.21 1995/05/06 19:34:28 joerg Exp $
+ * $Id: ft.c,v 1.22 1995/05/30 08:01:41 rgrimes Exp $
*
* 01/19/95 ++sg
* Cleaned up recalibrate/seek code at attach time for FreeBSD 2.x.
@@ -401,8 +401,7 @@ segio_free(ft_p ft, SegReq *sp)
DPRT(("segio_free: nfree=%d ndone=%d nreq=%d\n", ft->nfreelist, ft->ndoneq, ft->nsegq));
}
-static int ft_externalize(struct proc *, struct kern_devconf *, void *,
- size_t);
+static int ft_externalize(struct kern_devconf *, struct sysctl_req *);
extern struct kern_devconf kdc_fdc[];
static struct kern_devconf kdc_ft[NFT] = { {
@@ -430,10 +429,9 @@ ft_registerdev(int ctlr, int unit)
static int
-ft_externalize(struct proc *p, struct kern_devconf *kdc, void *userp,
- size_t len)
+ft_externalize(struct kern_devconf *kdc, struct sysctl_req *req)
{
- return disk_externalize(ft_data[kdc->kdc_unit].ftsu, userp, &len);
+ return disk_externalize(ft_data[kdc->kdc_unit].ftsu, req);
}
/*
diff --git a/sys/i386/isa/isa.c b/sys/i386/isa/isa.c
index 21d653b..35003e8 100644
--- a/sys/i386/isa/isa.c
+++ b/sys/i386/isa/isa.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)isa.c 7.2 (Berkeley) 5/13/91
- * $Id: isa.c,v 1.54 1995/10/31 21:03:57 peter Exp $
+ * $Id: isa.c,v 1.55 1995/11/05 04:45:15 gibbs Exp $
*/
/*
@@ -50,6 +50,7 @@
#include <sys/param.h>
#include <sys/systm.h> /* isn't it a joy */
#include <sys/kernel.h> /* to have three of these */
+#include <sys/sysctl.h>
#include <sys/proc.h>
#include <sys/conf.h>
#include <sys/file.h>
@@ -508,14 +509,9 @@ config_isadev_c(isdp, mp, reconfig)
* hw.devconf interface.
*/
int
-isa_externalize(struct isa_device *id, void *userp, size_t *maxlen)
+isa_externalize(struct isa_device *id, struct sysctl_req *req)
{
- if(*maxlen < sizeof *id) {
- return ENOMEM;
- }
-
- *maxlen -= sizeof *id;
- return copyout(id, userp, sizeof *id);
+ return (SYSCTL_OUT(req, id, sizeof *id));
}
/*
@@ -524,20 +520,14 @@ isa_externalize(struct isa_device *id, void *userp, size_t *maxlen)
* what the `internalize' routine is supposed to do.
*/
int
-isa_internalize(struct isa_device *id, void **userpp, size_t *len)
+isa_internalize(struct isa_device *id, struct sysctl_req *req)
{
struct isa_device myid;
- char *userp = *userpp;
int rv;
- if(*len < sizeof *id) {
- return EINVAL;
- }
-
- rv = copyin(userp, &myid, sizeof myid);
- if(rv) return rv;
- *userpp = userp + sizeof myid;
- *len -= sizeof myid;
+ rv = SYSCTL_IN(req, &myid, sizeof *id);
+ if(rv)
+ return rv;
rv = EOPNOTSUPP;
/* code would go here to validate the configuration request */
@@ -546,10 +536,9 @@ isa_internalize(struct isa_device *id, void **userpp, size_t *len)
}
int
-isa_generic_externalize(struct proc *p, struct kern_devconf *kdc,
- void *userp, size_t l)
+isa_generic_externalize(struct kern_devconf *kdc, struct sysctl_req *req)
{
- return isa_externalize(kdc->kdc_isa, userp, &l);
+ return isa_externalize(kdc->kdc_isa, req);
}
/*
diff --git a/sys/i386/isa/isa_device.h b/sys/i386/isa/isa_device.h
index 3ce0385..1fb22d9 100644
--- a/sys/i386/isa/isa_device.h
+++ b/sys/i386/isa/isa_device.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)isa_device.h 7.1 (Berkeley) 5/9/91
- * $Id: isa_device.h,v 1.24 1995/09/10 21:35:10 bde Exp $
+ * $Id: isa_device.h,v 1.25 1995/11/05 04:45:16 gibbs Exp $
*/
#ifndef _I386_ISA_ISA_DEVICE_H_
@@ -156,11 +156,12 @@ int register_intr __P((int intr, int device_id, u_int flags,
int unregister_intr __P((int intr, inthand2_t *handler));
int update_intr_masks __P((void));
-extern int isa_externalize(struct isa_device *, void *, size_t *);
-extern int isa_internalize(struct isa_device *, void **, size_t *);
+struct sysctl_req;
+extern int isa_externalize(struct isa_device *, struct sysctl_req *);
+extern int isa_internalize(struct isa_device *, struct sysctl_req *);
struct kern_devconf;
-extern int isa_generic_externalize(struct proc *, struct kern_devconf *, void *, size_t);
+extern int isa_generic_externalize(struct kern_devconf *, struct sysctl_req *);
extern struct kern_devconf kdc_isa0;
#endif /* KERNEL */
diff --git a/sys/i386/isa/wcd.c b/sys/i386/isa/wcd.c
index 72e705e..868e3be 100644
--- a/sys/i386/isa/wcd.c
+++ b/sys/i386/isa/wcd.c
@@ -209,7 +209,7 @@ static int wcd_read_toc (struct wcd *t);
static int wcd_request_wait (struct wcd *t, u_char cmd, u_char a1, u_char a2,
u_char a3, u_char a4, u_char a5, u_char a6, u_char a7, u_char a8,
u_char a9, char *addr, int count);
-static int wcd_externalize (struct proc*, struct kern_devconf*, void*, size_t);
+static int wcd_externalize (struct kern_devconf*, struct sysctl_req *);
static int wcd_goaway (struct kern_devconf *kdc, int force);
static void wcd_describe (struct wcd *t);
static int wcd_open(dev_t dev, int rawflag);
@@ -236,10 +236,9 @@ static void wcd_dump (int lun, char *label, void *data, int len)
printf ("\n");
}
-static int wcd_externalize (struct proc *p, struct kern_devconf *kdc,
- void *userp, size_t len)
+static int wcd_externalize (struct kern_devconf *kdc, struct sysctl_req *req)
{
- return disk_externalize (wcdtab[kdc->kdc_unit]->unit, userp, &len);
+ return disk_externalize (wcdtab[kdc->kdc_unit]->unit, req);
}
static int wcd_goaway (struct kern_devconf *kdc, int force)
diff --git a/sys/i386/isa/wd.c b/sys/i386/isa/wd.c
index 680cfeb..9416bc7 100644
--- a/sys/i386/isa/wd.c
+++ b/sys/i386/isa/wd.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)wd.c 7.2 (Berkeley) 5/9/91
- * $Id: wd.c,v 1.89 1995/10/28 15:39:28 phk Exp $
+ * $Id: wd.c,v 1.90 1995/10/29 17:34:17 bde Exp $
*/
/* TODO:
@@ -107,8 +107,7 @@ extern void wdstart(int ctrlr);
static int wd_goaway(struct kern_devconf *, int);
static int wdc_goaway(struct kern_devconf *, int);
-static int wd_externalize(struct proc *, struct kern_devconf *, void *, size_t);
-static int wdc_externalize(struct proc *, struct kern_devconf *, void *, size_t);
+static int wd_externalize(struct kern_devconf *, struct sysctl_req *);
/*
* Templates for the kern_devconf structures used when we attach.
@@ -274,9 +273,9 @@ static int wdwait(struct disk *du, u_char bits_wanted, int timeout);
* Provide hw.devconf information.
*/
static int
-wd_externalize(struct proc *p, struct kern_devconf *kdc, void *userp, size_t len)
+wd_externalize(struct kern_devconf *kdc, struct sysctl_req *req)
{
- return disk_externalize(wddrives[kdc->kdc_unit]->dk_unit, userp, &len);
+ return disk_externalize(wddrives[kdc->kdc_unit]->dk_unit, req);
}
struct isa_driver wdcdriver = {
OpenPOWER on IntegriCloud