syscons_isa.c (55849) | syscons_isa.c (56836) |
---|---|
1/*- 2 * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/sys/isa/syscons_isa.c 55849 2000-01-12 12:30:33Z yokota $ | 26 * $FreeBSD: head/sys/isa/syscons_isa.c 56836 2000-01-29 15:08:56Z peter $ |
27 */ 28 | 27 */ 28 |
29#include "sc.h" | |
30#include "opt_syscons.h" 31 | 29#include "opt_syscons.h" 30 |
32#if NSC > 0 33 | |
34#include <sys/param.h> 35#include <sys/systm.h> 36#include <sys/kernel.h> 37#include <sys/module.h> 38#include <sys/bus.h> 39#include <sys/cons.h> 40 41#include <machine/console.h> --- 71 unchanged lines hidden (view full) --- 113 return devclass_get_maxunit(sc_devclass); 114} 115 116sc_softc_t 117*sc_get_softc(int unit, int flags) 118{ 119 sc_softc_t *sc; 120 | 31#include <sys/param.h> 32#include <sys/systm.h> 33#include <sys/kernel.h> 34#include <sys/module.h> 35#include <sys/bus.h> 36#include <sys/cons.h> 37 38#include <machine/console.h> --- 71 unchanged lines hidden (view full) --- 110 return devclass_get_maxunit(sc_devclass); 111} 112 113sc_softc_t 114*sc_get_softc(int unit, int flags) 115{ 116 sc_softc_t *sc; 117 |
121 if ((unit < 0) || (unit >= NSC)) | 118 if (unit < 0) |
122 return NULL; 123 if (flags & SC_KERNEL_CONSOLE) { 124 /* FIXME: clear if it is wired to another unit! */ 125 sc = &main_softc; 126 } else { 127 sc = (sc_softc_t *)device_get_softc(devclass_get_device(sc_devclass, unit)); | 119 return NULL; 120 if (flags & SC_KERNEL_CONSOLE) { 121 /* FIXME: clear if it is wired to another unit! */ 122 sc = &main_softc; 123 } else { 124 sc = (sc_softc_t *)device_get_softc(devclass_get_device(sc_devclass, unit)); |
125 if (sc == NULL) 126 return NULL; |
|
128 } 129 sc->unit = unit; 130 if (!(sc->flags & SC_INIT_DONE)) { 131 sc->keyboard = -1; 132 sc->adapter = -1; 133 sc->mouse_char = SC_MOUSE_CHAR; 134 } 135 return sc; --- 101 unchanged lines hidden (view full) --- 237 release_timer2(); 238 } 239#endif /* __i386__ */ 240 241 return 0; 242} 243 244DRIVER_MODULE(sc, isa, sc_driver, sc_devclass, 0, 0); | 127 } 128 sc->unit = unit; 129 if (!(sc->flags & SC_INIT_DONE)) { 130 sc->keyboard = -1; 131 sc->adapter = -1; 132 sc->mouse_char = SC_MOUSE_CHAR; 133 } 134 return sc; --- 101 unchanged lines hidden (view full) --- 236 release_timer2(); 237 } 238#endif /* __i386__ */ 239 240 return 0; 241} 242 243DRIVER_MODULE(sc, isa, sc_driver, sc_devclass, 0, 0); |
245 246#endif /* NSC > 0 */ | |