Remove d_reset. Replace d_ttys with a callback to the driver. Don't allow

select() on a framebuffer.
This commit is contained in:
mycroft 1995-04-19 18:04:57 +00:00
parent 7945dde65c
commit cd09cbdae5
1 changed files with 34 additions and 46 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: conf.h,v 1.22 1995/04/12 06:01:03 mellon Exp $ */
/* $NetBSD: conf.h,v 1.23 1995/04/19 18:04:57 mycroft Exp $ */
/*-
* Copyright (c) 1990, 1993
@ -142,8 +142,8 @@ struct cdevsw {
int (*d_ioctl) __P((dev_t dev, u_long cmd, caddr_t data,
int fflag, struct proc *p));
int (*d_stop) __P((struct tty *tp, int rw));
int (*d_reset) __P((int uban)); /* XXX */
struct tty **d_ttys;
struct tty *
(*d_tty) __P((dev_t dev));
int (*d_select) __P((dev_t dev, int which, struct proc *p));
int (*d_mmap) __P(());
void (*d_strategy) __P((struct buf *bp));
@ -158,151 +158,139 @@ extern struct cdevsw cdevsw[];
#define dev_type_read(n) int n __P((dev_t, struct uio *, int))
#define dev_type_write(n) int n __P((dev_t, struct uio *, int))
#define dev_type_stop(n) int n __P((struct tty *, int))
#define dev_type_reset(n) int n __P((int))
#define dev_type_tty(n) struct tty * __P((dev_t))
#define dev_type_select(n) int n __P((dev_t, int, struct proc *))
#define dev_type_mmap(n) int n __P(())
#define cdev_decl(n) \
dev_decl(n,open); dev_decl(n,close); dev_decl(n,read); \
dev_decl(n,write); dev_decl(n,ioctl); dev_decl(n,stop); \
dev_decl(n,reset); dev_decl(n,select); dev_decl(n,mmap); \
dev_decl(n,strategy); extern struct tty *__CONCAT(n,_tty)[]
#define dev_tty_init(c,n) (c > 0 ? __CONCAT(n,_tty) : 0)
dev_decl(n,tty); dev_decl(n,select); dev_decl(n,mmap); \
dev_decl(n,strategy)
/* open, close, read, write, ioctl, strategy */
#define cdev_disk_init(c,n) { \
dev_init(c,n,open), dev_init(c,n,close), rawread, rawwrite, \
dev_init(c,n,ioctl), (dev_type_stop((*))) enodev, \
(dev_type_reset((*))) nullop, 0, seltrue, (dev_type_mmap((*))) enodev, \
dev_init(c,n,strategy), D_DISK }
0, seltrue, (dev_type_mmap((*))) enodev, dev_init(c,n,strategy), \
D_DISK }
/* open, close, read, write, ioctl, strategy */
#define cdev_tape_init(c,n) { \
dev_init(c,n,open), dev_init(c,n,close), rawread, rawwrite, \
dev_init(c,n,ioctl), (dev_type_stop((*))) enodev, \
(dev_type_reset((*))) nullop, 0, seltrue, (dev_type_mmap((*))) enodev, \
dev_init(c,n,strategy), D_TAPE }
0, seltrue, (dev_type_mmap((*))) enodev, dev_init(c,n,strategy), \
D_TAPE }
/* 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_type_reset((*))) nullop, dev_tty_init(c,n), ttselect, \
(dev_type_mmap((*))) enodev, 0, D_TTY }
dev_init(c,n,tty), ttselect, (dev_type_mmap((*))) enodev, 0, D_TTY }
/* open, close, read, ioctl, select */
#define cdev_mouse_init(c,n) { \
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, (dev_type_reset((*))) nullop, 0, \
dev_init(c,n,select), (dev_type_mmap((*))) enodev, 0 }
(dev_type_stop((*))) enodev, 0, dev_init(c,n,select), \
(dev_type_mmap((*))) enodev, 0 }
#define cdev_lkm_dummy() { \
(dev_type_open((*))) lkmenodev, (dev_type_close((*))) enodev, \
(dev_type_read((*))) enodev, (dev_type_write((*))) enodev, \
(dev_type_ioctl((*))) enodev, (dev_type_stop((*))) enodev, \
(dev_type_reset((*))) nullop, 0, seltrue, \
(dev_type_mmap((*))) enodev, 0 }
0, seltrue, (dev_type_mmap((*))) enodev, 0 }
#define cdev_notdef() { \
(dev_type_open((*))) enodev, (dev_type_close((*))) enodev, \
(dev_type_read((*))) enodev, (dev_type_write((*))) enodev, \
(dev_type_ioctl((*))) enodev, (dev_type_stop((*))) enodev, \
(dev_type_reset((*))) nullop, 0, seltrue, \
(dev_type_mmap((*))) enodev, 0 }
0, seltrue, (dev_type_mmap((*))) enodev, 0 }
/* open, close, read, write, ioctl, select -- XXX should be a tty */
#define cdev_cn_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_type_reset((*))) nullop, 0, dev_init(c,n,select), \
(dev_type_mmap((*))) enodev, 0, D_TTY }
0, dev_init(c,n,select), (dev_type_mmap((*))) enodev, 0, D_TTY }
/* open, read, write, ioctl, select -- 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, \
(dev_type_reset((*))) nullop, 0, dev_init(c,n,select), \
(dev_type_mmap((*))) enodev, 0, D_TTY }
0, dev_init(c,n,select), (dev_type_mmap((*))) enodev, 0, D_TTY }
/* open, close, read, write, mmap */
#define cdev_mm_init(c,n) { \
dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \
dev_init(c,n,write), (dev_type_ioctl((*))) enodev, \
(dev_type_stop((*))) enodev, (dev_type_reset((*))) nullop, 0, \
seltrue, dev_init(c,n,mmap), 0 }
(dev_type_stop((*))) enodev, 0, seltrue, dev_init(c,n,mmap), 0 }
/* read, write, strategy */
#define cdev_swap_init(c,n) { \
(dev_type_open((*))) nullop, (dev_type_close((*))) nullop, rawread, \
rawwrite, (dev_type_ioctl((*))) enodev, (dev_type_stop((*))) enodev, \
(dev_type_reset((*))) nullop, 0, (dev_type_select((*))) enodev, \
(dev_type_mmap((*))) enodev, dev_init(c,n,strategy) }
0, (dev_type_select((*))) enodev, (dev_type_mmap((*))) enodev, \
dev_init(c,n,strategy) }
/* open, close, read, write, ioctl, tty, select */
#define cdev_ptc_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((*))) nullop, \
(dev_type_reset((*))) nullop, dev_tty_init(c,n), dev_init(c,n,select), \
(dev_type_mmap((*))) enodev, 0, D_TTY }
dev_init(c,n,tty), dev_init(c,n,select), (dev_type_mmap((*))) enodev, \
0, D_TTY }
/* open, close, read, ioctl, select -- XXX should be a generic device */
#define cdev_log_init(c,n) { \
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, (dev_type_reset((*))) nullop, 0, \
dev_init(c,n,select), (dev_type_mmap((*))) enodev, 0 }
(dev_type_stop((*))) enodev, 0, dev_init(c,n,select), \
(dev_type_mmap((*))) enodev, 0 }
/* open */
#define cdev_fd_init(c,n) { \
dev_init(c,n,open), (dev_type_close((*))) enodev, \
(dev_type_read((*))) enodev, (dev_type_write((*))) enodev, \
(dev_type_ioctl((*))) enodev, (dev_type_stop((*))) enodev, \
(dev_type_reset((*))) nullop, 0, (dev_type_select((*))) enodev, \
(dev_type_mmap((*))) enodev, 0 }
0, (dev_type_select((*))) enodev, (dev_type_mmap((*))) enodev, 0 }
/* open, close, read, write, ioctl, select -- XXX should be generic device */
#define cdev_bpftun_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, \
(dev_type_reset((*))) nullop, 0, dev_init(c,n,select), \
(dev_type_mmap((*))) enodev, 0 }
0, dev_init(c,n,select), (dev_type_mmap((*))) enodev, 0 }
/* open, close, ioctl */
#define cdev_lkm_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, (dev_type_reset((*))) nullop, 0, \
(dev_type_select((*))) enodev, (dev_type_mmap((*))) enodev, 0 }
(dev_type_stop((*))) enodev, 0, (dev_type_select((*))) enodev, \
(dev_type_mmap((*))) enodev, 0 }
/* open, close, ioctl */
#define cdev_ch_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, (dev_type_reset((*))) nullop, 0, \
(dev_type_select((*))) enodev, (dev_type_mmap((*))) enodev, 0 }
(dev_type_stop((*))) enodev, 0, (dev_type_select((*))) enodev, \
(dev_type_mmap((*))) enodev, 0 }
/* open, close, ioctl, mmap */
#define cdev_fb_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((*))) nullop, (dev_type_reset((*))) nullop, 0, \
seltrue, dev_init(c,n,mmap), 0 }
(dev_type_stop((*))) enodev, 0, (dev_type_select((*))) enodev, \
dev_init(c,n,mmap), 0 }
/* open, close, read, write, ioctl */
#define cdev_audio_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, \
(dev_type_reset((*))) nullop, 0, dev_init(c,n,select), \
(dev_type_mmap((*))) enodev, 0 }
0, dev_init(c,n,select), (dev_type_mmap((*))) enodev, 0 }
#define cdev_svr4_net_init(c,n) { \
dev_init(c,n,open), (dev_type_close((*))) enodev, \
(dev_type_read((*))) enodev, (dev_type_write((*))) enodev, \
(dev_type_ioctl((*))) enodev, (dev_type_stop((*))) nullop, \
(dev_type_reset((*))) nullop, 0, (dev_type_select((*))) enodev, \
(dev_type_mmap((*))) enodev, 0 }
0, (dev_type_select((*))) enodev, (dev_type_mmap((*))) enodev, 0 }
/* symbolic sleep message strings */
extern char devopn[], devio[], devwait[], devin[], devout[];