diff --git a/sys/arm64/arm64/nexus.c b/sys/arm64/arm64/nexus.c --- a/sys/arm64/arm64/nexus.c +++ b/sys/arm64/arm64/nexus.c @@ -112,7 +112,6 @@ static bus_get_resource_list_t nexus_get_reslist; static bus_map_resource_t nexus_map_resource; static bus_release_resource_t nexus_release_resource; -static bus_set_resource_t nexus_set_resource; #ifdef SMP static bus_bind_intr_t nexus_bind_intr; @@ -141,7 +140,7 @@ DEVMETHOD(bus_get_resource_list, nexus_get_reslist), DEVMETHOD(bus_map_resource, nexus_map_resource), DEVMETHOD(bus_release_resource, nexus_release_resource), - DEVMETHOD(bus_set_resource, nexus_set_resource), + DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), #ifdef SMP DEVMETHOD(bus_bind_intr, nexus_bind_intr), #endif @@ -435,19 +434,6 @@ return (&ndev->nx_resources); } -static int -nexus_set_resource(device_t dev, device_t child, int type, int rid, - rman_res_t start, rman_res_t count) -{ - struct nexus_device *ndev = DEVTONX(child); - struct resource_list *rl = &ndev->nx_resources; - - /* XXX this should return a success/failure indicator */ - resource_list_add(rl, type, rid, start, start + count - 1, count); - - return (0); -} - static int nexus_deactivate_resource(device_t bus, device_t child, int type, int rid, struct resource *r) diff --git a/sys/riscv/riscv/nexus.c b/sys/riscv/riscv/nexus.c --- a/sys/riscv/riscv/nexus.c +++ b/sys/riscv/riscv/nexus.c @@ -86,7 +86,6 @@ static bus_deactivate_resource_t nexus_deactivate_resource; static bus_get_resource_list_t nexus_get_reslist; static bus_map_resource_t nexus_map_resource; -static bus_set_resource_t nexus_set_resource; static bus_release_resource_t nexus_release_resource; static bus_config_intr_t nexus_config_intr; @@ -113,9 +112,11 @@ DEVMETHOD(bus_adjust_resource, nexus_adjust_resource), DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), + DEVMETHOD(bus_delete_resource, bus_generic_rl_delete_resource), + DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), DEVMETHOD(bus_get_resource_list, nexus_get_reslist), DEVMETHOD(bus_map_resource, nexus_map_resource), - DEVMETHOD(bus_set_resource, nexus_set_resource), + DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), DEVMETHOD(bus_release_resource, nexus_release_resource), DEVMETHOD(bus_config_intr, nexus_config_intr), DEVMETHOD(bus_describe_intr, nexus_describe_intr), @@ -395,19 +396,6 @@ return (&ndev->nx_resources); } -static int -nexus_set_resource(device_t dev, device_t child, int type, int rid, - rman_res_t start, rman_res_t count) -{ - struct nexus_device *ndev = DEVTONX(child); - struct resource_list *rl = &ndev->nx_resources; - - /* XXX this should return a success/failure indicator */ - resource_list_add(rl, type, rid, start, start + count - 1, count); - - return (0); -} - static int nexus_deactivate_resource(device_t bus, device_t child, int type, int rid, struct resource *r) diff --git a/sys/x86/x86/nexus.c b/sys/x86/x86/nexus.c --- a/sys/x86/x86/nexus.c +++ b/sys/x86/x86/nexus.c @@ -101,12 +101,9 @@ static bus_adjust_resource_t nexus_adjust_resource; static bus_alloc_resource_t nexus_alloc_resource; static bus_deactivate_resource_t nexus_deactivate_resource; -static bus_delete_resource_t nexus_delete_resource; -static bus_get_resource_t nexus_get_resource; static bus_get_resource_list_t nexus_get_reslist; static bus_map_resource_t nexus_map_resource; static bus_release_resource_t nexus_release_resource; -static bus_set_resource_t nexus_set_resource; static bus_unmap_resource_t nexus_unmap_resource; #ifdef SMP @@ -145,12 +142,12 @@ DEVMETHOD(bus_adjust_resource, nexus_adjust_resource), DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), - DEVMETHOD(bus_get_resource, nexus_get_resource), + DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), DEVMETHOD(bus_get_resource_list, nexus_get_reslist), - DEVMETHOD(bus_delete_resource, nexus_delete_resource), + DEVMETHOD(bus_delete_resource, bus_generic_rl_delete_resource), DEVMETHOD(bus_map_resource, nexus_map_resource), DEVMETHOD(bus_release_resource, nexus_release_resource), - DEVMETHOD(bus_set_resource, nexus_set_resource), + DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), DEVMETHOD(bus_unmap_resource, nexus_unmap_resource), #ifdef SMP DEVMETHOD(bus_bind_intr, nexus_bind_intr), @@ -645,45 +642,6 @@ return (&ndev->nx_resources); } -static int -nexus_set_resource(device_t dev, device_t child, int type, int rid, - rman_res_t start, rman_res_t count) -{ - struct nexus_device *ndev = DEVTONX(child); - struct resource_list *rl = &ndev->nx_resources; - - /* XXX this should return a success/failure indicator */ - resource_list_add(rl, type, rid, start, start + count - 1, count); - return (0); -} - -static int -nexus_get_resource(device_t dev, device_t child, int type, int rid, - rman_res_t *startp, rman_res_t *countp) -{ - struct nexus_device *ndev = DEVTONX(child); - struct resource_list *rl = &ndev->nx_resources; - struct resource_list_entry *rle; - - rle = resource_list_find(rl, type, rid); - if (!rle) - return (ENOENT); - if (startp) - *startp = rle->start; - if (countp) - *countp = rle->count; - return (0); -} - -static void -nexus_delete_resource(device_t dev, device_t child, int type, int rid) -{ - struct nexus_device *ndev = DEVTONX(child); - struct resource_list *rl = &ndev->nx_resources; - - resource_list_delete(rl, type, rid); -} - static int nexus_get_cpus(device_t dev, device_t child, enum cpu_sets op, size_t setsize, cpuset_t *cpuset)