1 /* $OpenBSD: conf.h,v 1.24 2012/12/08 20:38:10 kettenis 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, selfalse, \ 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, selfalse, \ 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, selfalse, \ 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_init(c,n,poll), (dev_type_mmap((*))) enodev } 68 69 cdev_decl(cn); 70 71 cdev_decl(zs); 72 73 bdev_decl(fd); 74 cdev_decl(fd); 75 76 cdev_decl(fb); 77 78 cdev_decl(ms); 79 80 cdev_decl(kbd); 81 cdev_decl(kd); 82 83 cdev_decl(bwtwo); 84 85 cdev_decl(cgtwo); 86 87 cdev_decl(cgthree); 88 89 cdev_decl(cgfour); 90 91 cdev_decl(cgsix); 92 93 cdev_decl(cgeight); 94 95 cdev_decl(tcx); 96 97 cdev_decl(cgfourteen); 98 99 cdev_decl(bpp); 100 cdev_decl(lpt); 101 102 cdev_decl(scsibus); 103 104 bdev_decl(wd); 105 cdev_decl(wd); 106 107 cdev_decl(sabtty); 108 109 cdev_decl(pcons); 110 cdev_decl(vcons); 111 cdev_decl(vcctty); 112 cdev_decl(sbbc); 113 114 cdev_decl(vldcp); 115 116 cdev_decl(com); 117 118 cdev_decl(mtty); 119 cdev_decl(mbpp); 120 cdev_decl(stty); 121 cdev_decl(sbpp); 122 123 /* open, close, write, ioctl */ 124 #define cdev_bpp_init(c,n) { \ 125 dev_init(c,n,open), dev_init(c,n,close), (dev_type_read((*))) enodev, \ 126 dev_init(c,n,write), dev_init(c,n,ioctl), (dev_type_stop((*))) nullop, \ 127 0, seltrue, (dev_type_mmap((*))) enodev } 128 129 cdev_decl(bpp); 130