Changeset View
Changeset View
Standalone View
Standalone View
sys/arm64/arm64/gic_v3_fdt.c
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* FDT glue. | * FDT glue. | ||||
*/ | */ | ||||
static int gic_v3_fdt_probe(device_t); | static int gic_v3_fdt_probe(device_t); | ||||
static int gic_v3_fdt_attach(device_t); | static int gic_v3_fdt_attach(device_t); | ||||
static struct resource *gic_v3_ofw_bus_alloc_res(device_t, device_t, int, int *, | static struct resource *gic_v3_ofw_bus_alloc_res(device_t, device_t, int, int *, | ||||
u_long, u_long, u_long, u_int); | rman_res_t, rman_res_t, rman_res_t, u_int); | ||||
static const struct ofw_bus_devinfo *gic_v3_ofw_get_devinfo(device_t, device_t); | static const struct ofw_bus_devinfo *gic_v3_ofw_get_devinfo(device_t, device_t); | ||||
static device_method_t gic_v3_fdt_methods[] = { | static device_method_t gic_v3_fdt_methods[] = { | ||||
/* Device interface */ | /* Device interface */ | ||||
DEVMETHOD(device_probe, gic_v3_fdt_probe), | DEVMETHOD(device_probe, gic_v3_fdt_probe), | ||||
DEVMETHOD(device_attach, gic_v3_fdt_attach), | DEVMETHOD(device_attach, gic_v3_fdt_attach), | ||||
/* Bus interface */ | /* Bus interface */ | ||||
▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | |||||
struct gic_v3_ofw_devinfo *di; | struct gic_v3_ofw_devinfo *di; | ||||
di = device_get_ivars(child); | di = device_get_ivars(child); | ||||
return (&di->di_dinfo); | return (&di->di_dinfo); | ||||
} | } | ||||
static struct resource * | static struct resource * | ||||
gic_v3_ofw_bus_alloc_res(device_t bus, device_t child, int type, int *rid, | gic_v3_ofw_bus_alloc_res(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 gic_v3_ofw_devinfo *di; | struct gic_v3_ofw_devinfo *di; | ||||
struct resource_list_entry *rle; | struct resource_list_entry *rle; | ||||
int ranges_len; | int ranges_len; | ||||
if ((start == 0UL) && (end == ~0UL)) { | if ((start == 0) && (end == ~0)) { | ||||
if ((di = device_get_ivars(child)) == NULL) | if ((di = device_get_ivars(child)) == NULL) | ||||
return (NULL); | return (NULL); | ||||
if (type != SYS_RES_MEMORY) | if (type != SYS_RES_MEMORY) | ||||
return (NULL); | return (NULL); | ||||
/* Find defaults for this rid */ | /* Find defaults for this rid */ | ||||
rle = resource_list_find(&di->di_rl, type, *rid); | rle = resource_list_find(&di->di_rl, type, *rid); | ||||
if (rle == NULL) | if (rle == NULL) | ||||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |