1 /* $OpenBSD: conf.h,v 1.28 2024/03/29 21:06:14 miod Exp $ */ 2 /* $NetBSD: conf.h,v 1.9 2001/03/26 12:33:26 lukem Exp $ */ 3 4 /*- 5 * Copyright (c) 1996 The NetBSD Foundation, Inc. 6 * All rights reserved. 7 * 8 * This code is derived from software contributed to The NetBSD Foundation 9 * by Christos Zoulas. 10 * 11 * Redistribution and use in source and binary forms, with or without 12 * modification, are permitted provided that the following conditions 13 * are met: 14 * 1. Redistributions of source code must retain the above copyright 15 * notice, this list of conditions and the following disclaimer. 16 * 2. Redistributions in binary form must reproduce the above copyright 17 * notice, this list of conditions and the following disclaimer in the 18 * documentation and/or other materials provided with the distribution. 19 * 20 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30 * POSSIBILITY OF SUCH DAMAGE. 31 */ 32 33 #define mmread mmrw 34 #define mmwrite mmrw 35 cdev_decl(mm); 36 37 cdev_decl(openprom); 38 39 /* open, close, ioctl */ 40 #define cdev_openprom_init(c,n) { \ 41 dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \ 42 (dev_type_write((*))) enodev, dev_init(c,n,ioctl), \ 43 (dev_type_stop((*))) nullop, 0, \ 44 (dev_type_mmap((*))) enodev } 45 46 cdev_decl(uperf); 47 48 /* open, close, ioctl */ 49 #define cdev_uperf_init(c,n) { \ 50 dev_init(c,n,open), dev_init(c,n,close), (dev_type_read((*))) enodev, \ 51 (dev_type_write((*))) enodev, dev_init(c,n,ioctl), \ 52 (dev_type_stop((*))) nullop, 0, \ 53 (dev_type_mmap((*))) enodev } 54 55 cdev_decl(vdsp); 56 57 /* open, close, ioctl */ 58 #define cdev_vdsp_init(c,n) { \ 59 dev_init(c,n,open), dev_init(c,n,close), (dev_type_read((*))) enodev, \ 60 (dev_type_write((*))) enodev, dev_init(c,n,ioctl), \ 61 (dev_type_stop((*))) nullop, 0, \ 62 (dev_type_mmap((*))) enodev } 63 64 #define cdev_gen_init(c,n) { \ 65 dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \ 66 dev_init(c,n,write), dev_init(c,n,ioctl), (dev_type_stop((*))) nullop, \ 67 0, (dev_type_mmap((*))) enodev, \ 68 0, 0, dev_init(c,n,kqfilter) } 69 70 cdev_decl(zs); 71 72 bdev_decl(fd); 73 cdev_decl(fd); 74 75 cdev_decl(bpp); 76 cdev_decl(lpt); 77 78 bdev_decl(wd); 79 cdev_decl(wd); 80 81 cdev_decl(sabtty); 82 83 cdev_decl(pcons); 84 cdev_decl(vcons); 85 cdev_decl(vcctty); 86 cdev_decl(sbbc); 87 88 cdev_decl(vldcp); 89 90 cdev_decl(com); 91 92 cdev_decl(mtty); 93 cdev_decl(mbpp); 94 cdev_decl(stty); 95 cdev_decl(sbpp); 96 97 /* open, close, write, ioctl */ 98 #define cdev_bpp_init(c,n) { \ 99 dev_init(c,n,open), dev_init(c,n,close), (dev_type_read((*))) enodev, \ 100 dev_init(c,n,write), dev_init(c,n,ioctl), (dev_type_stop((*))) nullop, \ 101 0, (dev_type_mmap((*))) enodev, 0, 0, seltrue_kqfilter } 102