summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1999-05-30 16:53:49 +0000
committerphk <phk@FreeBSD.org>1999-05-30 16:53:49 +0000
commit7e4a9dced9acd97789b37c32063ee7a8aa133f6d (patch)
tree407469b3581129f6442306683b28d6b54126baad /sys/kern
parentdfa3967ffa4d84ed0b1691fac89ba3e73b8544e0 (diff)
downloadFreeBSD-src-7e4a9dced9acd97789b37c32063ee7a8aa133f6d.zip
FreeBSD-src-7e4a9dced9acd97789b37c32063ee7a8aa133f6d.tar.gz
This commit should be a extensive NO-OP:
Reformat and initialize correctly all "struct cdevsw". Initialize the d_maj and d_bmaj fields. The d_reset field was not removed, although it is never used. I used a program to do most of this, so all the files now use the same consistent format. Please keep it that way. Vinum and i4b not modified, patches emailed to respective authors.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_descrip.c27
-rw-r--r--sys/kern/subr_log.c27
-rw-r--r--sys/kern/tty_cons.c28
-rw-r--r--sys/kern/tty_pty.c54
-rw-r--r--sys/kern/tty_snoop.c25
-rw-r--r--sys/kern/tty_tty.c28
6 files changed, 148 insertions, 41 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index 2609d15..11d5305 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_descrip.c 8.6 (Berkeley) 4/19/94
- * $Id: kern_descrip.c,v 1.60 1999/05/03 23:57:20 billf Exp $
+ * $Id: kern_descrip.c,v 1.61 1999/05/11 19:54:28 phk Exp $
*/
#include "opt_compat.h"
@@ -78,10 +78,27 @@ static d_open_t fdopen;
#define NUMFDESC 64
#define CDEV_MAJOR 22
-static struct cdevsw fildesc_cdevsw =
- { fdopen, noclose, noread, nowrite,
- noioc, nostop, nullreset, nodevtotty,
- seltrue, nommap, nostrat, "FD" };
+static struct cdevsw fildesc_cdevsw = {
+ /* open */ fdopen,
+ /* close */ noclose,
+ /* read */ noread,
+ /* write */ nowrite,
+ /* ioctl */ noioctl,
+ /* stop */ nostop,
+ /* reset */ noreset,
+ /* devtotty */ nodevtotty,
+ /* poll */ nopoll,
+ /* mmap */ nommap,
+ /* strategy */ nostrategy,
+ /* name */ "FD",
+ /* parms */ noparms,
+ /* maj */ CDEV_MAJOR,
+ /* dump */ nodump,
+ /* psize */ nopsize,
+ /* flags */ 0,
+ /* maxio */ 0,
+ /* bmaj */ -1
+};
static int finishdup __P((struct filedesc *fdp, int old, int new, register_t *retval));
/*
diff --git a/sys/kern/subr_log.c b/sys/kern/subr_log.c
index c33d6bb..67a7d65 100644
--- a/sys/kern/subr_log.c
+++ b/sys/kern/subr_log.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)subr_log.c 8.1 (Berkeley) 6/10/93
- * $Id: subr_log.c,v 1.33 1998/12/07 21:58:29 archie Exp $
+ * $Id: subr_log.c,v 1.34 1999/05/06 18:12:46 peter Exp $
*/
/*
@@ -68,10 +68,27 @@ static d_ioctl_t logioctl;
static d_poll_t logpoll;
#define CDEV_MAJOR 7
-static struct cdevsw log_cdevsw =
- { logopen, logclose, logread, nowrite, /*7*/
- logioctl, nostop, nullreset, nodevtotty,/* klog */
- logpoll, nommap, NULL, "log", NULL, -1 };
+static struct cdevsw log_cdevsw = {
+ /* open */ logopen,
+ /* close */ logclose,
+ /* read */ logread,
+ /* write */ nowrite,
+ /* ioctl */ logioctl,
+ /* stop */ nostop,
+ /* reset */ noreset,
+ /* devtotty */ nodevtotty,
+ /* poll */ logpoll,
+ /* mmap */ nommap,
+ /* strategy */ nostrategy,
+ /* name */ "log",
+ /* parms */ noparms,
+ /* maj */ CDEV_MAJOR,
+ /* dump */ nodump,
+ /* psize */ nopsize,
+ /* flags */ 0,
+ /* maxio */ 0,
+ /* bmaj */ -1
+};
static struct logsoftc {
int sc_state; /* see above for possibilities */
diff --git a/sys/kern/tty_cons.c b/sys/kern/tty_cons.c
index 32b181d..6b7efb4 100644
--- a/sys/kern/tty_cons.c
+++ b/sys/kern/tty_cons.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: @(#)cons.c 7.2 (Berkeley) 5/9/91
- * $Id: cons.c,v 1.64 1999/04/28 10:52:04 dt Exp $
+ * $Id: cons.c,v 1.65 1999/05/08 06:39:20 phk Exp $
*/
#include "opt_devfs.h"
@@ -65,12 +65,26 @@ static d_ioctl_t cnioctl;
static d_poll_t cnpoll;
#define CDEV_MAJOR 0
-static struct cdevsw cn_cdevsw = {
- cnopen, cnclose, cnread, cnwrite,
- cnioctl, nullstop, nullreset, nodevtotty,
- cnpoll, nommap, NULL, "console",
- NULL, -1, nodump, nopsize,
- D_TTY,
+static struct cdevsw cn_cdevsw = {
+ /* open */ cnopen,
+ /* close */ cnclose,
+ /* read */ cnread,
+ /* write */ cnwrite,
+ /* ioctl */ cnioctl,
+ /* stop */ nostop,
+ /* reset */ noreset,
+ /* devtotty */ nodevtotty,
+ /* poll */ cnpoll,
+ /* mmap */ nommap,
+ /* strategy */ nostrategy,
+ /* name */ "console",
+ /* parms */ noparms,
+ /* maj */ CDEV_MAJOR,
+ /* dump */ nodump,
+ /* psize */ nopsize,
+ /* flags */ D_TTY,
+ /* maxio */ 0,
+ /* bmaj */ -1
};
static dev_t cn_dev_t; /* seems to be never really used */
diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c
index 87f21f0..535df84 100644
--- a/sys/kern/tty_pty.c
+++ b/sys/kern/tty_pty.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tty_pty.c 8.4 (Berkeley) 2/20/95
- * $Id: tty_pty.c,v 1.58 1999/05/14 20:44:20 luoqi Exp $
+ * $Id: tty_pty.c,v 1.59 1999/05/18 14:53:52 luoqi Exp $
*/
/*
@@ -80,21 +80,49 @@ static d_write_t ptcwrite;
static d_poll_t ptcpoll;
#define CDEV_MAJOR_S 5
-static struct cdevsw pts_cdevsw = {
- ptsopen, ptsclose, ptsread, ptswrite,
- ptyioctl, ptsstop, nullreset, ptydevtotty,
- ttpoll, nommap, NULL, "pts",
- NULL, -1, nodump, nopsize,
- D_TTY,
+static struct cdevsw pts_cdevsw = {
+ /* open */ ptsopen,
+ /* close */ ptsclose,
+ /* read */ ptsread,
+ /* write */ ptswrite,
+ /* ioctl */ ptyioctl,
+ /* stop */ ptsstop,
+ /* reset */ noreset,
+ /* devtotty */ ptydevtotty,
+ /* poll */ ttpoll,
+ /* mmap */ nommap,
+ /* strategy */ nostrategy,
+ /* name */ "pts",
+ /* parms */ noparms,
+ /* maj */ CDEV_MAJOR_S,
+ /* dump */ nodump,
+ /* psize */ nopsize,
+ /* flags */ D_TTY,
+ /* maxio */ 0,
+ /* bmaj */ -1
};
#define CDEV_MAJOR_C 6
-static struct cdevsw ptc_cdevsw = {
- ptcopen, ptcclose, ptcread, ptcwrite,
- ptyioctl, nullstop, nullreset, ptydevtotty,
- ptcpoll, nommap, NULL, "ptc",
- NULL, -1, nodump, nopsize,
- D_TTY,
+static struct cdevsw ptc_cdevsw = {
+ /* open */ ptcopen,
+ /* close */ ptcclose,
+ /* read */ ptcread,
+ /* write */ ptcwrite,
+ /* ioctl */ ptyioctl,
+ /* stop */ nostop,
+ /* reset */ noreset,
+ /* devtotty */ ptydevtotty,
+ /* poll */ ptcpoll,
+ /* mmap */ nommap,
+ /* strategy */ nostrategy,
+ /* name */ "ptc",
+ /* parms */ noparms,
+ /* maj */ CDEV_MAJOR_C,
+ /* dump */ nodump,
+ /* psize */ nopsize,
+ /* flags */ D_TTY,
+ /* maxio */ 0,
+ /* bmaj */ -1
};
#if NPTY == 1
diff --git a/sys/kern/tty_snoop.c b/sys/kern/tty_snoop.c
index 1018083..8b45c8a 100644
--- a/sys/kern/tty_snoop.c
+++ b/sys/kern/tty_snoop.c
@@ -46,10 +46,27 @@ static d_ioctl_t snpioctl;
static d_poll_t snppoll;
#define CDEV_MAJOR 53
-static struct cdevsw snp_cdevsw =
- { snpopen, snpclose, snpread, snpwrite, /*53*/
- snpioctl, nostop, nullreset, nodevtotty,/* snoop */
- snppoll, nommap, NULL, "snp", NULL, -1 };
+static struct cdevsw snp_cdevsw = {
+ /* open */ snpopen,
+ /* close */ snpclose,
+ /* read */ snpread,
+ /* write */ snpwrite,
+ /* ioctl */ snpioctl,
+ /* stop */ nostop,
+ /* reset */ noreset,
+ /* devtotty */ nodevtotty,
+ /* poll */ snppoll,
+ /* mmap */ nommap,
+ /* strategy */ nostrategy,
+ /* name */ "snp",
+ /* parms */ noparms,
+ /* maj */ CDEV_MAJOR,
+ /* dump */ nodump,
+ /* psize */ nopsize,
+ /* flags */ 0,
+ /* maxio */ 0,
+ /* bmaj */ -1
+};
#ifndef MIN
diff --git a/sys/kern/tty_tty.c b/sys/kern/tty_tty.c
index 889c935..693387d 100644
--- a/sys/kern/tty_tty.c
+++ b/sys/kern/tty_tty.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tty_tty.c 8.2 (Berkeley) 9/23/93
- * $Id: tty_tty.c,v 1.24 1998/06/07 17:11:44 dfr Exp $
+ * $Id: tty_tty.c,v 1.25 1998/08/23 08:26:42 bde Exp $
*/
/*
@@ -60,12 +60,26 @@ static d_poll_t cttypoll;
#define CDEV_MAJOR 1
/* Don't make this static, since fdesc_vnops uses it. */
-struct cdevsw ctty_cdevsw = {
- cttyopen, nullclose, cttyread, cttywrite,
- cttyioctl, nullstop, nullreset, nodevtotty,
- cttypoll, nommap, NULL, "ctty",
- NULL, -1, nodump, nopsize,
- D_TTY,
+struct cdevsw ctty_cdevsw = {
+ /* open */ cttyopen,
+ /* close */ nullclose,
+ /* read */ cttyread,
+ /* write */ cttywrite,
+ /* ioctl */ cttyioctl,
+ /* stop */ nostop,
+ /* reset */ noreset,
+ /* devtotty */ nodevtotty,
+ /* poll */ cttypoll,
+ /* mmap */ nommap,
+ /* strategy */ nostrategy,
+ /* name */ "ctty",
+ /* parms */ noparms,
+ /* maj */ CDEV_MAJOR,
+ /* dump */ nodump,
+ /* psize */ nopsize,
+ /* flags */ D_TTY,
+ /* maxio */ 0,
+ /* bmaj */ -1
};
#define cttyvp(p) ((p)->p_flag & P_CONTROLT ? (p)->p_session->s_ttyvp : NULL)
OpenPOWER on IntegriCloud