FreeBSD/Linux Kernel Cross Reference
sys/isa/syscons_isa.c
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 * notice, this list of conditions and the following disclaimer as
10 * the first lines of this file unmodified.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
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$
27 */
28
29 #include "sc.h"
30 #include "opt_syscons.h"
31
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
40 #include <machine/console.h>
41
42 #include <dev/syscons/syscons.h>
43
44 #include <isa/isareg.h>
45 #include <isa/isavar.h>
46
47 devclass_t sc_devclass;
48
49 static int scprobe(device_t dev);
50 static int scattach(device_t dev);
51
52 static device_method_t sc_methods[] = {
53 DEVMETHOD(device_probe, scprobe),
54 DEVMETHOD(device_attach, scattach),
55 { 0, 0 }
56 };
57
58 static driver_t sc_driver = {
59 "sc",
60 sc_methods,
61 DRIVER_TYPE_TTY,
62 1, /* XXX */
63 };
64
65 static int
66 scprobe(device_t dev)
67 {
68 device_set_desc(dev, "System console");
69 return sc_probe_unit(device_get_unit(dev), isa_get_flags(dev));
70 }
71
72 static int
73 scattach(device_t dev)
74 {
75 return sc_attach_unit(device_get_unit(dev), isa_get_flags(dev));
76 }
77
78 DRIVER_MODULE(sc, isa, sc_driver, sc_devclass, 0, 0);
79
80 #endif /* NSC > 0 */
Cache object: 4f52589037957d8a498e251ea1bfd1bc
|