Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/siba/siba.c
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
"MIPS 3302 core" }, | "MIPS 3302 core" }, | ||||
{ 0, 0, 0, NULL } | { 0, 0, 0, NULL } | ||||
}; | }; | ||||
static int siba_activate_resource(device_t, device_t, int, int, | static int siba_activate_resource(device_t, device_t, int, int, | ||||
struct resource *); | struct resource *); | ||||
static device_t siba_add_child(device_t, u_int, const char *, int); | static device_t siba_add_child(device_t, u_int, const char *, int); | ||||
static struct resource * | static struct resource * | ||||
siba_alloc_resource(device_t, device_t, int, int *, u_long, | siba_alloc_resource(device_t, device_t, int, int *, rman_res_t, | ||||
u_long, u_long, u_int); | rman_res_t, rman_res_t, u_int); | ||||
static int siba_attach(device_t); | static int siba_attach(device_t); | ||||
#ifdef notyet | #ifdef notyet | ||||
static void siba_destroy_devinfo(struct siba_devinfo *); | static void siba_destroy_devinfo(struct siba_devinfo *); | ||||
#endif | #endif | ||||
static struct siba_devid * | static struct siba_devid * | ||||
siba_dev_match(uint16_t, uint16_t, uint8_t); | siba_dev_match(uint16_t, uint16_t, uint8_t); | ||||
static struct resource_list * | static struct resource_list * | ||||
siba_get_reslist(device_t, device_t); | siba_get_reslist(device_t, device_t); | ||||
▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | |||||
retval += printf(" flags %#x", device_get_flags(child)); | retval += printf(" flags %#x", device_get_flags(child)); | ||||
retval += printf(" on %s\n", device_get_nameunit(bus)); | retval += printf(" on %s\n", device_get_nameunit(bus)); | ||||
return (retval); | return (retval); | ||||
} | } | ||||
static struct resource * | static struct resource * | ||||
siba_alloc_resource(device_t bus, device_t child, int type, int *rid, | siba_alloc_resource(device_t bus, device_t child, int type, int *rid, | ||||
u_long start, u_long end, u_long count, u_int flags) | rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) | ||||
{ | { | ||||
struct resource *rv; | struct resource *rv; | ||||
struct resource_list *rl; | struct resource_list *rl; | ||||
struct resource_list_entry *rle; | struct resource_list_entry *rle; | ||||
int isdefault, needactivate; | int isdefault, needactivate; | ||||
#if 0 | #if 0 | ||||
if (siba_debug) | if (siba_debug) | ||||
printf("%s: entry\n", __func__); | printf("%s: entry\n", __func__); | ||||
#endif | #endif | ||||
isdefault = (start == 0UL && end == ~0UL && count == 1); | isdefault = (start == 0 && end == ~0 && count == 1); | ||||
needactivate = flags & RF_ACTIVE; | needactivate = flags & RF_ACTIVE; | ||||
rl = BUS_GET_RESOURCE_LIST(bus, child); | rl = BUS_GET_RESOURCE_LIST(bus, child); | ||||
rle = NULL; | rle = NULL; | ||||
if (isdefault) { | if (isdefault) { | ||||
rle = resource_list_find(rl, type, *rid); | rle = resource_list_find(rl, type, *rid); | ||||
if (rle == NULL) | if (rle == NULL) | ||||
return (NULL); | return (NULL); | ||||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |