Changeset View
Changeset View
Standalone View
Standalone View
sys/powerpc/psim/iobus.c
| Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | static int iobus_adjust_resource(device_t, device_t, struct resource *, | ||||
| rman_res_t, rman_res_t); | rman_res_t, rman_res_t); | ||||
| static int iobus_activate_resource(device_t, device_t, struct resource *); | static int iobus_activate_resource(device_t, device_t, struct resource *); | ||||
| static int iobus_deactivate_resource(device_t, device_t, struct resource *); | static int iobus_deactivate_resource(device_t, device_t, struct resource *); | ||||
| static int iobus_map_resource(device_t, device_t, struct resource *, | static int iobus_map_resource(device_t, device_t, struct resource *, | ||||
| struct resource_map_request *, | struct resource_map_request *, | ||||
| struct resource_map *); | struct resource_map *); | ||||
| static int iobus_unmap_resource(device_t, device_t, struct resource *, | static int iobus_unmap_resource(device_t, device_t, struct resource *, | ||||
| struct resource_map *); | struct resource_map *); | ||||
| static int iobus_release_resource(device_t, device_t, int, int, | static int iobus_release_resource(device_t, device_t, struct resource *); | ||||
| struct resource *); | |||||
| /* | /* | ||||
| * Bus interface definition | * Bus interface definition | ||||
| */ | */ | ||||
| static device_method_t iobus_methods[] = { | static device_method_t iobus_methods[] = { | ||||
| /* Device interface */ | /* Device interface */ | ||||
| DEVMETHOD(device_probe, iobus_probe), | DEVMETHOD(device_probe, iobus_probe), | ||||
| DEVMETHOD(device_attach, iobus_attach), | DEVMETHOD(device_attach, iobus_attach), | ||||
| ▲ Show 20 Lines • Show All 256 Lines • ▼ Show 20 Lines | iobus_adjust_resource(device_t bus, device_t child, struct resource *r, | ||||
| case SYS_RES_IRQ: | case SYS_RES_IRQ: | ||||
| return (bus_generic_adjust_resource(bus, child, r, start, end)); | return (bus_generic_adjust_resource(bus, child, r, start, end)); | ||||
| default: | default: | ||||
| return (EINVAL); | return (EINVAL); | ||||
| } | } | ||||
| } | } | ||||
| static int | static int | ||||
| iobus_release_resource(device_t bus, device_t child, int type, int rid, | iobus_release_resource(device_t bus, device_t child, struct resource *res) | ||||
| struct resource *res) | |||||
| { | { | ||||
| switch (type) { | switch (rman_get_type(res)) { | ||||
| case SYS_RES_MEMORY: | case SYS_RES_MEMORY: | ||||
| case SYS_RES_IOPORT: | case SYS_RES_IOPORT: | ||||
| return (bus_generic_rman_release_resource(bus, child, type, rid, | return (bus_generic_rman_release_resource(bus, child, res)); | ||||
| res)); | |||||
| case SYS_RES_IRQ: | case SYS_RES_IRQ: | ||||
| return (bus_generic_release_resource(bus, child, type, rid, res)); | return (bus_generic_release_resource(bus, child, res)); | ||||
| default: | default: | ||||
| return (EINVAL); | return (EINVAL); | ||||
| } | } | ||||
| } | } | ||||
| static int | static int | ||||
| iobus_activate_resource(device_t bus, device_t child, struct resource *res) | iobus_activate_resource(device_t bus, device_t child, struct resource *res) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 79 Lines • Show Last 20 Lines | |||||