diff --git a/sys/powerpc/powerpc/nexus.c b/sys/powerpc/powerpc/nexus.c index 3a1e961c743e..7ae542d67afa 100644 --- a/sys/powerpc/powerpc/nexus.c +++ b/sys/powerpc/powerpc/nexus.c @@ -32,62 +32,62 @@ * from: FreeBSD: src/sys/i386/i386/nexus.c,v 1.43 2001/02/09 */ +/* + * This code implements a `root nexus' for Power ISA Architecture + * machines. The function of the root nexus is to serve as an + * attachment point for both processors and buses, and to manage + * resources which are common to all of them. In particular, + * this code implements the core resource managers for interrupt + * requests and I/O memory address space. + */ + #include __FBSDID("$FreeBSD$"); -#include #include #include #include -#include #include #include #include -#include #include -#include #include #include +#include +#include +#include +#include + #include #include #include -#include -#include -#include - -/* - * The nexus handles root-level resource allocation requests and interrupt - * mapping. All direct subdevices of nexus are attached by DEVICE_IDENTIFY(). - */ - static struct rman intr_rman; static struct rman mem_rman; -static device_probe_t nexus_probe; -static device_attach_t nexus_attach; -static bus_setup_intr_t nexus_setup_intr; -static bus_teardown_intr_t nexus_teardown_intr; -static bus_alloc_resource_t nexus_alloc_resource; -static bus_activate_resource_t nexus_activate_resource; -static bus_deactivate_resource_t nexus_deactivate_resource; -static bus_adjust_resource_t nexus_adjust_resource; -static bus_release_resource_t nexus_release_resource; -static int nexus_map_resource(device_t bus, device_t child, int type, - struct resource *r, - struct resource_map_request *argsp, - struct resource_map *map); -static int nexus_unmap_resource(device_t bus, device_t child, int type, - struct resource *r, struct resource_map *map); +static device_probe_t nexus_probe; +static device_attach_t nexus_attach; + +static bus_activate_resource_t nexus_activate_resource; +static bus_adjust_resource_t nexus_adjust_resource; +static bus_alloc_resource_t nexus_alloc_resource; +static bus_deactivate_resource_t nexus_deactivate_resource; +static bus_map_resource_t nexus_map_resource; +static bus_release_resource_t nexus_release_resource; +static bus_unmap_resource_t nexus_unmap_resource; -static bus_space_tag_t nexus_get_bus_tag(device_t, device_t); #ifdef SMP -static bus_bind_intr_t nexus_bind_intr; +static bus_bind_intr_t nexus_bind_intr; #endif -static bus_config_intr_t nexus_config_intr; -static ofw_bus_map_intr_t nexus_ofw_map_intr; +static bus_config_intr_t nexus_config_intr; +static bus_setup_intr_t nexus_setup_intr; +static bus_teardown_intr_t nexus_teardown_intr; + +static bus_get_bus_tag_t nexus_get_bus_tag; + +static ofw_bus_map_intr_t nexus_ofw_map_intr; static device_method_t nexus_methods[] = { /* Device interface */ @@ -96,19 +96,19 @@ static device_method_t nexus_methods[] = { /* Bus interface */ DEVMETHOD(bus_add_child, bus_generic_add_child), - DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), - DEVMETHOD(bus_activate_resource, nexus_activate_resource), - DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), DEVMETHOD(bus_adjust_resource, nexus_adjust_resource), - DEVMETHOD(bus_release_resource, nexus_release_resource), + DEVMETHOD(bus_activate_resource, nexus_activate_resource), + DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), + DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), DEVMETHOD(bus_map_resource, nexus_map_resource), + DEVMETHOD(bus_release_resource, nexus_release_resource), DEVMETHOD(bus_unmap_resource, nexus_unmap_resource), - DEVMETHOD(bus_setup_intr, nexus_setup_intr), - DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), #ifdef SMP DEVMETHOD(bus_bind_intr, nexus_bind_intr), #endif DEVMETHOD(bus_config_intr, nexus_config_intr), + DEVMETHOD(bus_setup_intr, nexus_setup_intr), + DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), DEVMETHOD(bus_get_bus_tag, nexus_get_bus_tag), /* ofw_bus interface */ @@ -222,7 +222,7 @@ nexus_config_intr(device_t dev, int irq, enum intr_trigger trig, { return (powerpc_config_intr(irq, trig, pol)); -} +} static int nexus_ofw_map_intr(device_t dev, device_t child, phandle_t iparent, int icells,