1 /* $NetBSD: conf.c,v 1.69 2023/02/06 13:13:05 tsutsui Exp $ */ 2 3 /*- 4 * Copyright (c) 1982, 1986 The Regents of the University of California. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 1. Redistributions of source code must retain the above copyright 11 * notice, this list of conditions and the following disclaimer. 12 * 2. Redistributions in binary form must reproduce the above copyright 13 * notice, this list of conditions and the following disclaimer in the 14 * documentation and/or other materials provided with the distribution. 15 * 3. Neither the name of the University nor the names of its contributors 16 * may be used to endorse or promote products derived from this software 17 * without specific prior written permission. 18 * 19 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 * SUCH DAMAGE. 30 * 31 * @(#)conf.c 7.18 (Berkeley) 5/9/91 32 */ 33 34 #include <sys/cdefs.h> 35 __KERNEL_RCSID(0, "$NetBSD: conf.c,v 1.69 2023/02/06 13:13:05 tsutsui Exp $"); 36 37 #include "opt_cputype.h" 38 39 #include <sys/param.h> 40 #include <sys/conf.h> 41 #include <sys/cpu.h> 42 43 /* 44 * Console routines for VAX console. 45 */ 46 #include <dev/cons.h> 47 48 #include "gpx.h" 49 #include "lcg.h" 50 #include "qv.h" 51 #include "smg.h" 52 #include "spx.h" 53 #include "wskbd.h" 54 55 #if NGPX > 0 56 #if NWSKBD > 0 57 #define gpxcngetc wskbd_cngetc 58 #else 59 static int 60 gpxcngetc(dev_t dev) 61 { 62 return 0; 63 } 64 #endif 65 66 #define gpxcnputc wsdisplay_cnputc 67 #define gpxcnpollc nullcnpollc 68 #endif /* NGPX > 0 */ 69 70 #if NLCG > 0 71 #if NWSKBD > 0 72 #define lcgcngetc wskbd_cngetc 73 #else 74 static int 75 lcgcngetc(dev_t dev) 76 { 77 return 0; 78 } 79 #endif 80 81 #define lcgcnputc wsdisplay_cnputc 82 #define lcgcnpollc nullcnpollc 83 #endif /* NLCG > 0 */ 84 #if NQV > 0 85 #if NWSKBD > 0 86 #define qvcngetc wskbd_cngetc 87 #else 88 static int 89 qvcngetc(dev_t dev) 90 { 91 return 0; 92 } 93 #endif 94 95 #define qvcnputc wsdisplay_cnputc 96 #define qvcnpollc nullcnpollc 97 #endif /* NQV > 0 */ 98 #if NSMG > 0 99 #if NWSKBD > 0 100 #define smgcngetc wskbd_cngetc 101 #else 102 static int 103 smgcngetc(dev_t dev) 104 { 105 return 0; 106 } 107 #endif 108 109 #define smgcnputc wsdisplay_cnputc 110 #define smgcnpollc nullcnpollc 111 #endif /* NSMG > 0 */ 112 #if NSPX > 0 113 #if NWSKBD > 0 114 #define spxcngetc wskbd_cngetc 115 #else 116 static int 117 spxcngetc(dev_t dev) 118 { 119 return 0; 120 } 121 #endif 122 123 #define spxcnputc wsdisplay_cnputc 124 #define spxcnpollc nullcnpollc 125 #endif /* NSPX > 0 */ 126 127 cons_decl(gen); 128 cons_decl(dz); 129 cons_decl(gpx); 130 cons_decl(qd); 131 cons_decl(lcg); 132 cons_decl(qv); 133 cons_decl(spx); 134 cons_decl(smg); 135 #include "qd.h" 136 137 struct consdev constab[]={ 138 #if VAX8600 || VAX8200 || VAX780 || VAX750 || VAX650 || VAX630 || VAX660 || \ 139 VAX670 || VAX680 || VAX8800 || VAXANY 140 cons_init(gen), /* Generic console type; mtpr/mfpr */ 141 #endif 142 #if VAX410 || VAX43 || VAX46 || VAX48 || VAX49 || VAX53 || VAXANY 143 cons_init(dz), /* DZ11-like serial console on VAXstations */ 144 #endif 145 #if VAX650 || VAX630 || VAXANY 146 #if NQV 147 cons_init(qv), /* QVSS bit-mapped console driver */ 148 #endif 149 #if NQD 150 cons_init(qd), 151 #endif 152 #endif 153 #if NGPX 154 cons_init(gpx), 155 #endif 156 #if NLCG 157 cons_init(lcg), 158 #endif 159 #if NSMG 160 cons_init(smg), 161 #endif 162 #if NSPX 163 cons_init(spx), 164 #endif 165 166 #ifdef notyet 167 /* We may not always use builtin console, sometimes RD */ 168 { rdcnprobe, rdcninit, rdcngetc, rdcnputc }, 169 #endif 170 { 0 } 171 }; 172