Changeset View
Changeset View
Standalone View
Standalone View
sys/powerpc/powermac/uninorth.c
Show First 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | |||||
* Bus interface. | * Bus interface. | ||||
*/ | */ | ||||
static int unin_chip_print_child(device_t dev, device_t child); | static int unin_chip_print_child(device_t dev, device_t child); | ||||
static void unin_chip_probe_nomatch(device_t, device_t); | static void unin_chip_probe_nomatch(device_t, device_t); | ||||
static struct rman *unin_chip_get_rman(device_t, int, u_int); | static struct rman *unin_chip_get_rman(device_t, int, u_int); | ||||
static struct resource *unin_chip_alloc_resource(device_t, device_t, int, int *, | static struct resource *unin_chip_alloc_resource(device_t, device_t, int, int *, | ||||
rman_res_t, rman_res_t, | rman_res_t, rman_res_t, | ||||
rman_res_t, u_int); | rman_res_t, u_int); | ||||
static int unin_chip_adjust_resource(device_t, device_t, int, | static int unin_chip_adjust_resource(device_t, device_t, | ||||
struct resource *, rman_res_t, | struct resource *, rman_res_t, | ||||
rman_res_t); | rman_res_t); | ||||
static int unin_chip_activate_resource(device_t, device_t, int, int, | static int unin_chip_activate_resource(device_t, device_t, int, int, | ||||
struct resource *); | struct resource *); | ||||
static int unin_chip_deactivate_resource(device_t, device_t, int, int, | static int unin_chip_deactivate_resource(device_t, device_t, int, int, | ||||
struct resource *); | struct resource *); | ||||
static int unin_chip_map_resource(device_t, device_t, int, struct resource *, | static int unin_chip_map_resource(device_t, device_t, int, struct resource *, | ||||
struct resource_map_request *, | struct resource_map_request *, | ||||
▲ Show 20 Lines • Show All 462 Lines • ▼ Show 20 Lines | unin_chip_alloc_resource(device_t bus, device_t child, int type, int *rid, | ||||
default: | default: | ||||
device_printf(bus, "unknown resource request from %s\n", | device_printf(bus, "unknown resource request from %s\n", | ||||
device_get_nameunit(child)); | device_get_nameunit(child)); | ||||
return (NULL); | return (NULL); | ||||
} | } | ||||
} | } | ||||
static int | static int | ||||
unin_chip_adjust_resource(device_t bus, device_t child, int type, | unin_chip_adjust_resource(device_t bus, device_t child, struct resource *r, | ||||
struct resource *r, rman_res_t start, rman_res_t end) | rman_res_t start, rman_res_t end) | ||||
{ | { | ||||
switch (type) { | switch (rman_get_type(r)) { | ||||
case SYS_RES_IOPORT: | case SYS_RES_IOPORT: | ||||
case SYS_RES_MEMORY: | case SYS_RES_MEMORY: | ||||
return (bus_generic_rman_adjust_resource(bus, child, type, r, | return (bus_generic_rman_adjust_resource(bus, child, r, start, | ||||
start, end)); | |||||
case SYS_RES_IRQ: | |||||
return (bus_generic_adjust_resource(bus, child, type, r, start, | |||||
end)); | end)); | ||||
case SYS_RES_IRQ: | |||||
return (bus_generic_adjust_resource(bus, child, r, start, end)); | |||||
default: | default: | ||||
return (EINVAL); | return (EINVAL); | ||||
} | } | ||||
} | } | ||||
static int | static int | ||||
unin_chip_release_resource(device_t bus, device_t child, int type, int rid, | unin_chip_release_resource(device_t bus, device_t child, int type, int rid, | ||||
struct resource *res) | struct resource *res) | ||||
▲ Show 20 Lines • Show All 154 Lines • Show Last 20 Lines |