]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - 6/sys/alpha/tlsb/tlsbmem.c
merge fix for boot-time hang on centos' xen
[FreeBSD/FreeBSD.git] / 6 / sys / alpha / tlsb / tlsbmem.c
1 /*-
2  * Copyright (c) 1997, 2000 by Matthew Jacob
3  * NASA AMES Research Center.
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code must retain the above copyright
10  *    notice immediately at the beginning of the file, without modification,
11  *    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  *
16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
20  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26  * SUCH DAMAGE.
27  */
28
29 /*
30  * Dummy Node for TLSB Memory Modules found on
31  * AlphaServer 8200 and 8400 systems.
32  */
33
34 #include <sys/cdefs.h>
35 __FBSDID("$FreeBSD$");
36
37 #include <sys/param.h>
38 #include <sys/systm.h>
39 #include <sys/kernel.h>
40 #include <sys/module.h>
41 #include <sys/bus.h>
42 #include <sys/malloc.h>
43
44 #include <machine/rpb.h>
45
46 #include <alpha/tlsb/tlsbreg.h>
47 #include <alpha/tlsb/tlsbvar.h>
48
49 /*
50  * Device methods
51  */
52 static int tlsbmem_probe(device_t);
53
54 static device_method_t tlsbmem_methods[] = {
55         /* Device interface */
56         DEVMETHOD(device_probe,         tlsbmem_probe),
57         DEVMETHOD(device_attach,        bus_generic_attach),
58         DEVMETHOD(device_detach,        bus_generic_detach),
59         DEVMETHOD(device_shutdown,      bus_generic_shutdown),
60
61         /* Bus interface */
62         DEVMETHOD(bus_print_child,      bus_generic_print_child),
63         DEVMETHOD(bus_read_ivar,        bus_generic_read_ivar),
64         DEVMETHOD(bus_write_ivar,       bus_generic_write_ivar),
65         DEVMETHOD(bus_setup_intr,       bus_generic_setup_intr),
66         DEVMETHOD(bus_teardown_intr,    bus_generic_teardown_intr),
67
68         { 0, 0 }
69 };
70
71 static devclass_t tlsbmem_devclass;
72 static driver_t tlsbmem_driver = {
73         "tlsbmem", tlsbmem_methods, 1
74 };
75
76 static int
77 tlsbmem_probe(device_t dev)
78 {
79         struct tlsb_device *tdev = DEVTOTLSB(dev);
80         if (!TLDEV_ISMEM(tdev->td_tldev)) {
81                 return (-1);
82         }
83         return (0);
84 }
85
86 DRIVER_MODULE(tlsbmem, tlsb, tlsbmem_driver, tlsbmem_devclass, 0, 0);