summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2005-12-31 21:22:36 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2005-12-31 21:22:36 +0000
commit73ed0e5c02f4909688a40974d9bb8086b01f22c5 (patch)
treead16c18eb39bc329620becf40fc2564e13cf5d45 /sys
parentbef19611e76eddbba0c90d0f8cc136d3937de6d0 (diff)
Split the d_type field of cdevsw entries into d_type and d_flags for clarity.
Discussed with and ok deraadt@ millert@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/include/conf.h4
-rw-r--r--sys/arch/arm/include/conf.h4
-rw-r--r--sys/arch/i386/include/conf.h6
-rw-r--r--sys/arch/macppc/include/conf.h4
-rw-r--r--sys/arch/sparc/include/conf.h4
-rw-r--r--sys/dev/cons.c4
-rw-r--r--sys/kern/spec_vnops.c4
-rw-r--r--sys/miscfs/specfs/spec_vnops.c4
-rw-r--r--sys/sys/conf.h36
9 files changed, 36 insertions, 34 deletions
diff --git a/sys/arch/amd64/include/conf.h b/sys/arch/amd64/include/conf.h
index 688c8eda04d..960b06eae53 100644
--- a/sys/arch/amd64/include/conf.h
+++ b/sys/arch/amd64/include/conf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.h,v 1.2 2005/06/02 20:09:39 tholo Exp $ */
+/* $OpenBSD: conf.h,v 1.3 2005/12/31 21:22:32 miod Exp $ */
/* $NetBSD: conf.h,v 1.2 1996/05/05 19:28:34 christos Exp $ */
/*
@@ -48,5 +48,5 @@ cdev_decl(bios);
dev_init(c,n,open), dev_init(c,n,close), (dev_type_read((*))) enodev, \
(dev_type_write((*))) enodev, dev_init(c,n,ioctl), \
(dev_type_stop((*))) enodev, 0, (dev_type_poll((*))) enodev, \
- (dev_type_mmap((*))) enodev, D_KQFILTER, dev_init(c,n,kqfilter) }
+ (dev_type_mmap((*))) enodev, 0, D_KQFILTER, dev_init(c,n,kqfilter) }
cdev_decl(acpi);
diff --git a/sys/arch/arm/include/conf.h b/sys/arch/arm/include/conf.h
index c6db3f7be7e..13e79916e2c 100644
--- a/sys/arch/arm/include/conf.h
+++ b/sys/arch/arm/include/conf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.h,v 1.4 2005/05/13 22:54:00 miod Exp $ */
+/* $OpenBSD: conf.h,v 1.5 2005/12/31 21:22:34 miod Exp $ */
/* $NetBSD: conf.h,v 1.7 2002/04/19 01:04:39 wiz Exp $ */
/*
@@ -84,7 +84,7 @@ cdev_decl(fd);
dev_init(c,n,open), dev_init(c,n,close), (dev_type_read((*))) enodev, \
(dev_type_write((*))) enodev, dev_init(c,n,ioctl), \
(dev_type_stop((*))) enodev, 0, (dev_type_poll((*))) enodev, \
- (dev_type_mmap((*))) enodev, D_KQFILTER, dev_init(c,n,kqfilter) }
+ (dev_type_mmap((*))) enodev, 0, D_KQFILTER, dev_init(c,n,kqfilter) }
cdev_decl(physcon);
cdev_decl(vidcconsole);
diff --git a/sys/arch/i386/include/conf.h b/sys/arch/i386/include/conf.h
index 33276008ce1..cbf6a0b33cc 100644
--- a/sys/arch/i386/include/conf.h
+++ b/sys/arch/i386/include/conf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.h,v 1.11 2005/06/02 20:09:39 tholo Exp $ */
+/* $OpenBSD: conf.h,v 1.12 2005/12/31 21:22:34 miod Exp $ */
/* $NetBSD: conf.h,v 1.2 1996/05/05 19:28:34 christos Exp $ */
/*
@@ -53,13 +53,13 @@ cdev_decl(pc);
dev_init(c,n,open), dev_init(c,n,close), (dev_type_read((*))) enodev, \
(dev_type_write((*))) enodev, dev_init(c,n,ioctl), \
(dev_type_stop((*))) enodev, 0, (dev_type_poll((*))) enodev, \
- (dev_type_mmap((*))) enodev, D_KQFILTER, dev_init(c,n,kqfilter) }
+ (dev_type_mmap((*))) enodev, 0, D_KQFILTER, dev_init(c,n,kqfilter) }
#define cdev_acpi_init(c,n) {\
dev_init(c,n,open), dev_init(c,n,close), (dev_type_read((*))) enodev, \
(dev_type_write((*))) enodev, dev_init(c,n,ioctl), \
(dev_type_stop((*))) enodev, 0, (dev_type_poll((*))) enodev, \
- (dev_type_mmap((*))) enodev, D_KQFILTER, dev_init(c,n,kqfilter) }
+ (dev_type_mmap((*))) enodev, 0, D_KQFILTER, dev_init(c,n,kqfilter) }
cdev_decl(spkr);
diff --git a/sys/arch/macppc/include/conf.h b/sys/arch/macppc/include/conf.h
index c0ff0a84715..cbb0768028c 100644
--- a/sys/arch/macppc/include/conf.h
+++ b/sys/arch/macppc/include/conf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.h,v 1.10 2005/12/21 18:50:52 miod Exp $ */
+/* $OpenBSD: conf.h,v 1.11 2005/12/31 21:22:34 miod Exp $ */
/* $NetBSD: conf.h,v 1.2 1996/05/05 19:28:34 christos Exp $ */
/*
@@ -41,7 +41,7 @@ cdev_decl(mm);
dev_init(c,n,open), dev_init(c,n,close), (dev_type_read((*))) enodev, \
(dev_type_write((*))) enodev, dev_init(c,n,ioctl), \
(dev_type_stop((*))) enodev, 0, (dev_type_poll((*))) enodev, \
- (dev_type_mmap((*))) enodev, D_KQFILTER, dev_init(c,n,kqfilter) }
+ (dev_type_mmap((*))) enodev, 0, D_KQFILTER, dev_init(c,n,kqfilter) }
cdev_decl(apm);
cdev_decl(zs);
diff --git a/sys/arch/sparc/include/conf.h b/sys/arch/sparc/include/conf.h
index 00c43d9d719..d4b8daa0b2b 100644
--- a/sys/arch/sparc/include/conf.h
+++ b/sys/arch/sparc/include/conf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.h,v 1.20 2005/07/17 12:21:28 miod Exp $ */
+/* $OpenBSD: conf.h,v 1.21 2005/12/31 21:22:34 miod Exp $ */
/* $NetBSD: conf.h,v 1.8 1996/12/31 07:12:43 mrg Exp $ */
/*
@@ -113,5 +113,5 @@ cdev_decl(daadio);
dev_init(c,n,open), dev_init(c,n,close), (dev_type_read((*))) enodev, \
(dev_type_write((*))) enodev, dev_init(c,n,ioctl), \
(dev_type_stop((*))) enodev, 0, (dev_type_poll((*))) enodev, \
- (dev_type_mmap((*))) enodev, D_KQFILTER, dev_init(c,n,kqfilter) }
+ (dev_type_mmap((*))) enodev, 0, D_KQFILTER, dev_init(c,n,kqfilter) }
cdev_decl(apm);
diff --git a/sys/dev/cons.c b/sys/dev/cons.c
index 0d2125d4453..b9130b402bf 100644
--- a/sys/dev/cons.c
+++ b/sys/dev/cons.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cons.c,v 1.15 2005/12/30 18:11:25 miod Exp $ */
+/* $OpenBSD: cons.c,v 1.16 2005/12/31 21:22:34 miod Exp $ */
/* $NetBSD: cons.c,v 1.30 1996/04/08 19:57:30 jonathan Exp $ */
/*
@@ -240,7 +240,7 @@ cnkqfilter(dev, kn)
return (1);
else
dev = cn_tab->cn_dev;
- if (cdevsw[major(dev)].d_type & D_KQFILTER)
+ if (cdevsw[major(dev)].d_flags & D_KQFILTER)
return ((*cdevsw[major(dev)].d_kqfilter)(dev, kn));
return (1);
}
diff --git a/sys/kern/spec_vnops.c b/sys/kern/spec_vnops.c
index abd1dfa98c8..04065b17bd7 100644
--- a/sys/kern/spec_vnops.c
+++ b/sys/kern/spec_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: spec_vnops.c,v 1.30 2005/12/29 20:00:52 pedro Exp $ */
+/* $OpenBSD: spec_vnops.c,v 1.31 2005/12/31 21:22:35 miod Exp $ */
/* $NetBSD: spec_vnops.c,v 1.29 1996/04/22 01:42:38 christos Exp $ */
/*
@@ -482,7 +482,7 @@ spec_kqfilter(v)
dev_t dev;
dev = ap->a_vp->v_rdev;
- if (cdevsw[major(dev)].d_type & D_KQFILTER)
+ if (cdevsw[major(dev)].d_flags & D_KQFILTER)
return (*cdevsw[major(dev)].d_kqfilter)(dev, ap->a_kn);
return (1);
}
diff --git a/sys/miscfs/specfs/spec_vnops.c b/sys/miscfs/specfs/spec_vnops.c
index abd1dfa98c8..04065b17bd7 100644
--- a/sys/miscfs/specfs/spec_vnops.c
+++ b/sys/miscfs/specfs/spec_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: spec_vnops.c,v 1.30 2005/12/29 20:00:52 pedro Exp $ */
+/* $OpenBSD: spec_vnops.c,v 1.31 2005/12/31 21:22:35 miod Exp $ */
/* $NetBSD: spec_vnops.c,v 1.29 1996/04/22 01:42:38 christos Exp $ */
/*
@@ -482,7 +482,7 @@ spec_kqfilter(v)
dev_t dev;
dev = ap->a_vp->v_rdev;
- if (cdevsw[major(dev)].d_type & D_KQFILTER)
+ if (cdevsw[major(dev)].d_flags & D_KQFILTER)
return (*cdevsw[major(dev)].d_kqfilter)(dev, ap->a_kn);
return (1);
}
diff --git a/sys/sys/conf.h b/sys/sys/conf.h
index 287535f40ed..087744819a2 100644
--- a/sys/sys/conf.h
+++ b/sys/sys/conf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.h,v 1.77 2005/12/27 18:31:12 miod Exp $ */
+/* $OpenBSD: conf.h,v 1.78 2005/12/31 21:22:35 miod Exp $ */
/* $NetBSD: conf.h,v 1.33 1996/05/03 20:03:32 christos Exp $ */
/*-
@@ -60,9 +60,9 @@ struct knote;
#define D_TTY 3
/*
- * Flags for d_type
+ * Flags for d_flags
*/
-#define D_KQFILTER 0x00010000 /* has kqfilter entry */
+#define D_KQFILTER 0x0001 /* has kqfilter entry */
#ifdef _KERNEL
@@ -92,7 +92,8 @@ struct bdevsw {
int (*d_dump)(dev_t dev, daddr_t blkno, caddr_t va,
size_t size);
int (*d_psize)(dev_t dev);
- int d_type;
+ u_int d_type;
+ /* u_int d_flags; */
};
#ifdef _KERNEL
@@ -155,6 +156,7 @@ struct cdevsw {
int (*d_poll)(dev_t dev, int events, struct proc *p);
paddr_t (*d_mmap)(dev_t, off_t, int);
u_int d_type;
+ u_int d_flags;
int (*d_kqfilter)(dev_t dev, struct knote *kn);
};
@@ -181,7 +183,7 @@ extern struct cdevsw cdevsw[];
#define cdev_disk_init(c,n) { \
dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \
dev_init(c,n,write), dev_init(c,n,ioctl), (dev_type_stop((*))) enodev, \
- 0, seltrue, (dev_type_mmap((*))) enodev, D_DISK }
+ 0, seltrue, (dev_type_mmap((*))) enodev, D_DISK, 0 }
/* open, close, read, write, ioctl */
#define cdev_tape_init(c,n) { \
@@ -194,14 +196,14 @@ extern struct cdevsw cdevsw[];
dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \
(dev_type_write((*))) enodev, dev_init(c,n,ioctl), \
(dev_type_stop((*))) nullop, \
- 0, seltrue, (dev_type_mmap((*))) enodev, 0 }
+ 0, seltrue, (dev_type_mmap((*))) enodev }
/* open, close, read, write, ioctl, stop, tty */
#define cdev_tty_init(c,n) { \
dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \
dev_init(c,n,write), dev_init(c,n,ioctl), dev_init(c,n,stop), \
dev_init(c,n,tty), ttpoll, (dev_type_mmap((*))) enodev, \
- D_TTY | D_KQFILTER, ttkqfilter }
+ D_TTY, D_KQFILTER, ttkqfilter }
/* open, close, read, ioctl, poll, nokqfilter */
#define cdev_mouse_init(c,n) { \
@@ -234,14 +236,14 @@ extern struct cdevsw cdevsw[];
dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \
dev_init(c,n,write), dev_init(c,n,ioctl), dev_init(c,n,stop), \
0, dev_init(c,n,poll), (dev_type_mmap((*))) enodev, \
- D_TTY | D_KQFILTER, dev_init(c,n,kqfilter) }
+ D_TTY, D_KQFILTER, dev_init(c,n,kqfilter) }
/* open, read, write, ioctl, poll, kqfilter -- XXX should be a tty */
#define cdev_ctty_init(c,n) { \
dev_init(c,n,open), (dev_type_close((*))) nullop, dev_init(c,n,read), \
dev_init(c,n,write), dev_init(c,n,ioctl), (dev_type_stop((*))) nullop, \
0, dev_init(c,n,poll), (dev_type_mmap((*))) enodev, \
- D_TTY | D_KQFILTER, ttkqfilter }
+ D_TTY, D_KQFILTER, ttkqfilter }
/* open, close, read, write, ioctl, mmap */
#define cdev_mm_init(c,n) { \
@@ -273,7 +275,7 @@ extern struct cdevsw cdevsw[];
dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \
dev_init(c,n,write), dev_init(c,n,ioctl), (dev_type_stop((*))) nullop, \
dev_init(c,n,tty), dev_init(c,n,poll), (dev_type_mmap((*))) enodev, \
- D_TTY | D_KQFILTER, dev_init(c,n,kqfilter) }
+ D_TTY, D_KQFILTER, dev_init(c,n,kqfilter) }
/* open, close, read, write, ioctl, mmap */
#define cdev_ptm_init(c,n) { \
@@ -286,7 +288,7 @@ extern struct cdevsw cdevsw[];
dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \
(dev_type_write((*))) enodev, dev_init(c,n,ioctl), \
(dev_type_stop((*))) enodev, 0, dev_init(c,n,poll), \
- (dev_type_mmap((*))) enodev, D_KQFILTER, dev_init(c,n,kqfilter) }
+ (dev_type_mmap((*))) enodev, 0, D_KQFILTER, dev_init(c,n,kqfilter) }
/* open */
#define cdev_fd_init(c,n) { \
@@ -300,7 +302,7 @@ extern struct cdevsw cdevsw[];
dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \
dev_init(c,n,write), dev_init(c,n,ioctl), (dev_type_stop((*))) enodev, \
0, dev_init(c,n,poll), (dev_type_mmap((*))) enodev, \
- D_KQFILTER, dev_init(c,n,kqfilter) }
+ 0, D_KQFILTER, dev_init(c,n,kqfilter) }
/* open, close, ioctl */
#define cdev_lkm_init(c,n) { \
@@ -342,7 +344,7 @@ extern struct cdevsw cdevsw[];
dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \
dev_init(c,n,write), dev_init(c,n,ioctl), \
(dev_type_stop((*))) enodev, 0, dev_init(c,n,poll), \
- dev_init(c,n,mmap), D_KQFILTER, dev_init(c,n,kqfilter) }
+ dev_init(c,n,mmap), 0, D_KQFILTER, dev_init(c,n,kqfilter) }
/* open, close, read, write, ioctl, poll, nokqfilter */
#define cdev_midi_init(c,n) { \
@@ -376,14 +378,14 @@ extern struct cdevsw cdevsw[];
dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \
dev_init(c,n,write), dev_init(c,n,ioctl), dev_init(c,n,stop), \
dev_init(c,n,tty), ttpoll, dev_init(c,n,mmap), \
- D_KQFILTER, dev_init(c,n,kqfilter) }
+ 0, D_KQFILTER, dev_init(c,n,kqfilter) }
/* open, close, read, write, ioctl, poll, kqfilter */
#define cdev_random_init(c,n) { \
dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \
dev_init(c,n,write), dev_init(c,n,ioctl), (dev_type_stop((*))) enodev, \
0, dev_init(c,n,poll), (dev_type_mmap((*))) enodev, \
- D_KQFILTER, dev_init(c,n,kqfilter) }
+ 0, D_KQFILTER, dev_init(c,n,kqfilter) }
void randomattach(void);
/* open, close, ioctl, poll, nokqfilter */
@@ -416,7 +418,7 @@ void randomattach(void);
#define cdev_usbdev_init(c,n) { \
dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \
dev_init(c,n,write), dev_init(c,n,ioctl), (dev_type_stop((*))) enodev, \
- 0, dev_init(c,n,poll), (dev_type_mmap((*))) enodev, D_KQFILTER, \
+ 0, dev_init(c,n,poll), (dev_type_mmap((*))) enodev, 0, D_KQFILTER, \
dev_init(c,n,kqfilter) }
/* open, close, init */
@@ -464,7 +466,7 @@ void randomattach(void);
dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \
(dev_type_write((*))) enodev, dev_init(c,n,ioctl), \
(dev_type_stop((*))) enodev, 0, dev_init(c,n,poll), \
- (dev_type_mmap((*))) enodev, D_KQFILTER, dev_init(c,n,kqfilter) }
+ (dev_type_mmap((*))) enodev, 0, D_KQFILTER, dev_init(c,n,kqfilter) }
/* open, close, ioctl */
#define cdev_gpio_init(c,n) { \