Changeset View
Changeset View
Standalone View
Standalone View
sys/arm/arm/nexus.c
Show First 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | |||||
struct nexus_device { | struct nexus_device { | ||||
struct resource_list nx_resources; | struct resource_list nx_resources; | ||||
}; | }; | ||||
#define DEVTONX(dev) ((struct nexus_device *)device_get_ivars(dev)) | #define DEVTONX(dev) ((struct nexus_device *)device_get_ivars(dev)) | ||||
static struct rman mem_rman; | static struct rman mem_rman; | ||||
static struct rman irq_rman; | |||||
static int nexus_probe(device_t); | static int nexus_probe(device_t); | ||||
static int nexus_attach(device_t); | static int nexus_attach(device_t); | ||||
static int nexus_print_child(device_t, device_t); | static int nexus_print_child(device_t, device_t); | ||||
static device_t nexus_add_child(device_t, u_int, const char *, int); | static device_t nexus_add_child(device_t, u_int, const char *, int); | ||||
static struct resource *nexus_alloc_resource(device_t, device_t, int, int *, | static struct resource *nexus_alloc_resource(device_t, device_t, int, int *, | ||||
rman_res_t, rman_res_t, rman_res_t, u_int); | rman_res_t, rman_res_t, rman_res_t, u_int); | ||||
static int nexus_activate_resource(device_t, device_t, int, int, | static int nexus_activate_resource(device_t, device_t, int, int, | ||||
▲ Show 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | nexus_attach(device_t dev) | ||||
mem_rman.rm_start = 0; | mem_rman.rm_start = 0; | ||||
mem_rman.rm_end = BUS_SPACE_MAXADDR; | mem_rman.rm_end = BUS_SPACE_MAXADDR; | ||||
mem_rman.rm_type = RMAN_ARRAY; | mem_rman.rm_type = RMAN_ARRAY; | ||||
mem_rman.rm_descr = "I/O memory addresses"; | mem_rman.rm_descr = "I/O memory addresses"; | ||||
if (rman_init(&mem_rman) || | if (rman_init(&mem_rman) || | ||||
rman_manage_region(&mem_rman, 0, BUS_SPACE_MAXADDR)) | rman_manage_region(&mem_rman, 0, BUS_SPACE_MAXADDR)) | ||||
panic("nexus_probe mem_rman"); | panic("nexus_probe mem_rman"); | ||||
irq_rman.rm_start = 0; | |||||
irq_rman.rm_end = ~0; | |||||
ehem_freebsd_m5p.com: I dislike this (you already knew) as this is well beyond the limits of anything likely to be… | |||||
irq_rman.rm_type = RMAN_ARRAY; | |||||
irq_rman.rm_descr = "Interrupts"; | |||||
if (rman_init(&irq_rman) || rman_manage_region(&irq_rman, 0, ~0)) | |||||
ehem_freebsd_m5p.comUnsubmitted Not Done Inline ActionsI favor rman_manage_region(&irq_rman, irq_rman.rm_start, irq_rman.rm_end), but that is the type of developer I am. ehem_freebsd_m5p.com: I favor `rman_manage_region(&irq_rman, irq_rman.rm_start, irq_rman.rm_end)`, but that is the… | |||||
panic("nexus_attach irq_rman"); | |||||
/* | /* | ||||
* First, deal with the children we know about already | * First, deal with the children we know about already | ||||
*/ | */ | ||||
bus_generic_probe(dev); | bus_generic_probe(dev); | ||||
bus_generic_attach(dev); | bus_generic_attach(dev); | ||||
return (0); | return (0); | ||||
Show All 40 Lines | |||||
{ | { | ||||
struct resource *rv; | struct resource *rv; | ||||
struct rman *rm; | struct rman *rm; | ||||
int needactivate = flags & RF_ACTIVE; | int needactivate = flags & RF_ACTIVE; | ||||
flags &= ~RF_ACTIVE; | flags &= ~RF_ACTIVE; | ||||
switch (type) { | switch (type) { | ||||
case SYS_RES_IRQ: | |||||
rm = &irq_rman; | |||||
break; | |||||
case SYS_RES_MEMORY: | case SYS_RES_MEMORY: | ||||
case SYS_RES_IOPORT: | case SYS_RES_IOPORT: | ||||
rm = &mem_rman; | rm = &mem_rman; | ||||
break; | break; | ||||
default: | default: | ||||
return (NULL); | return (NULL); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 195 Lines • Show Last 20 Lines |
I dislike this (you already knew) as this is well beyond the limits of anything likely to be seen for several years.
I'm inclined to suggest using INTR_IRQ_INVALID - 1. It will be interesting if interrupt numbers get that large.