diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2007-02-06 22:39:14 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2007-02-06 22:39:14 +0000 |
commit | edf6f88ae9200110423d88ff207347ffaaea31d2 (patch) | |
tree | 3f81faaf505bc642fcebdc16ddd048edf029635f | |
parent | 9ec0373c90abba62c24ecf1663b040d6515d5431 (diff) |
define the bio(4) cdev stuff in conf.h, rather than having a per machine
definition. switch amd64 and i386 to the conf.h version, and add it to
macppc.
original diff ok gwk@ tweaks and ok miod@
-rw-r--r-- | sys/arch/amd64/amd64/conf.c | 11 | ||||
-rw-r--r-- | sys/arch/i386/i386/conf.c | 11 | ||||
-rw-r--r-- | sys/arch/macppc/macppc/conf.c | 4 | ||||
-rw-r--r-- | sys/sys/conf.h | 9 |
4 files changed, 15 insertions, 20 deletions
diff --git a/sys/arch/amd64/amd64/conf.c b/sys/arch/amd64/amd64/conf.c index 07a75ec18f8..fccb2dabd3f 100644 --- a/sys/arch/amd64/amd64/conf.c +++ b/sys/arch/amd64/amd64/conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.c,v 1.10 2007/01/15 23:19:05 jsg Exp $ */ +/* $OpenBSD: conf.c,v 1.11 2007/02/06 22:39:13 dlg Exp $ */ /* * Copyright (c) 1994, 1995 Charles M. Hannum. All rights reserved. @@ -98,13 +98,6 @@ int nblkdev = sizeof(bdevsw) / sizeof(bdevsw[0]); (dev_type_stop((*))) enodev, 0, seltrue, \ (dev_type_mmap((*))) enodev } -/* open, close, ioctl -- XXX should be a generic device */ -#define cdev_oci_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, seltrue, \ - (dev_type_mmap((*))) enodev, 0 } - /* open, close, ioctl, select -- XXX should be a generic device */ #define cdev_ocis_init(c,n) { \ dev_init(c,n,open), dev_init(c,n,close), (dev_type_read((*))) enodev, \ @@ -285,7 +278,7 @@ struct cdevsw cdevsw[] = cdev_radio_init(NRADIO, radio), /* 76: generic radio I/O */ cdev_usbdev_init(NUSCANNER,uscanner), /* 77: USB scanners */ cdev_systrace_init(NSYSTRACE,systrace), /* 78: system call tracing */ - cdev_oci_init(NBIO,bio), /* 79: ioctl tunnel */ + cdev_bio_init(NBIO,bio), /* 79: ioctl tunnel */ cdev_notdef(), /* 80: gpr? XXX */ cdev_ptm_init(NPTY,ptm), /* 81: pseudo-tty ptm device */ cdev_hotplug_init(NHOTPLUG,hotplug), /* 82: devices hot plugging */ diff --git a/sys/arch/i386/i386/conf.c b/sys/arch/i386/i386/conf.c index 60b851ce105..8df7f01adc0 100644 --- a/sys/arch/i386/i386/conf.c +++ b/sys/arch/i386/i386/conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.c,v 1.114 2006/09/19 11:06:33 jsg Exp $ */ +/* $OpenBSD: conf.c,v 1.115 2007/02/06 22:39:13 dlg Exp $ */ /* $NetBSD: conf.c,v 1.75 1996/05/03 19:40:20 christos Exp $ */ /* @@ -99,13 +99,6 @@ int nblkdev = sizeof(bdevsw) / sizeof(bdevsw[0]); (dev_type_stop((*))) enodev, 0, seltrue, \ (dev_type_mmap((*))) enodev } -/* open, close, ioctl -- XXX should be a generic device */ -#define cdev_oci_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, seltrue, \ - (dev_type_mmap((*))) enodev, 0 } - /* open, close, ioctl, poll -- XXX should be a generic device */ #define cdev_ocis_init(c,n) { \ dev_init(c,n,open), dev_init(c,n,close), (dev_type_read((*))) enodev, \ @@ -310,7 +303,7 @@ struct cdevsw cdevsw[] = cdev_radio_init(NRADIO, radio), /* 76: generic radio I/O */ cdev_usbdev_init(NUSCANNER,uscanner), /* 77: USB scanners */ cdev_systrace_init(NSYSTRACE,systrace), /* 78: system call tracing */ - cdev_oci_init(NBIO,bio), /* 79: ioctl tunnel */ + cdev_bio_init(NBIO,bio), /* 79: ioctl tunnel */ cdev_ch_init(NGPR,gpr), /* 80: GPR400 SmartCard reader */ cdev_ptm_init(NPTY,ptm), /* 81: pseudo-tty ptm device */ cdev_hotplug_init(NHOTPLUG,hotplug), /* 82: devices hot plugging */ diff --git a/sys/arch/macppc/macppc/conf.c b/sys/arch/macppc/macppc/conf.c index e237b6d7495..e2c1ef27218 100644 --- a/sys/arch/macppc/macppc/conf.c +++ b/sys/arch/macppc/macppc/conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.c,v 1.28 2006/03/27 06:15:24 deraadt Exp $ */ +/* $OpenBSD: conf.c,v 1.29 2007/02/06 22:39:13 dlg Exp $ */ /* * Copyright (c) 1997 Per Fogelstrom @@ -149,6 +149,7 @@ cdev_decl(pci); #include "bktr.h" #include "hotplug.h" #include "gpio.h" +#include "bio.h" struct cdevsw cdevsw[] = { cdev_cn_init(1,cn), /* 0: virtual console */ @@ -243,6 +244,7 @@ struct cdevsw cdevsw[] = { cdev_ptm_init(NPTY,ptm), /* 77: pseudo-tty ptm device */ cdev_hotplug_init(NHOTPLUG,hotplug), /* 78: devices hot plugging */ cdev_gpio_init(NGPIO,gpio), /* 79: GPIO interface */ + cdev_bio_init(NBIO,bio), /* 80: ioctl tunnel */ }; int nchrdev = sizeof cdevsw / sizeof cdevsw[0]; diff --git a/sys/sys/conf.h b/sys/sys/conf.h index cde3b35c5f6..dddce436fcb 100644 --- a/sys/sys/conf.h +++ b/sys/sys/conf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.h,v 1.80 2006/07/12 19:56:18 thib Exp $ */ +/* $OpenBSD: conf.h,v 1.81 2007/02/06 22:39:13 dlg Exp $ */ /* $NetBSD: conf.h,v 1.33 1996/05/03 20:03:32 christos Exp $ */ /*- @@ -476,6 +476,13 @@ void randomattach(void); (dev_type_stop((*))) enodev, 0, (dev_type_poll((*))) enodev, \ (dev_type_mmap((*))) enodev } +/* open, close, ioctl */ +#define cdev_bio_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 } + #endif /* |