From nobody Wed Nov 22 17:06:47 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sb72H4bDmz52L2f; Wed, 22 Nov 2023 17:06:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sb72H44CQz3Pcw; Wed, 22 Nov 2023 17:06:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700672807; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b6VeelrZrRQ2ZdWCQWGB1SpmSKJsJGMqm71+zF2cS5A=; b=wsEVFdBJnMIUJnV2cn3TZPgwIODIIG05J6VGF37GJmhCqQ+hOQmVg1KbP7IN9sg9HsI2Ze EoM9cxdea8ScmpeoqBpG5RmJKUfq56w9Wb8l1A8cpALD/1ytQ0SptI0JK8ngPzMJKrWY3X EfYTXHjKmqDHSLYnibEV5zIXRDxeS/4iNhZPwVG7l1tdMFMaXAKsBdXR1DCCW1MQjVV1Mc znKUYgXNft18VUF67W6PwPkckgaSvCN4jXwpejU5RV6dkznNojYFT4frAT3DEc6GbksT5J 4NIG9XPvFZGcQft0IYoEGlH2WJkNPIivUOETrCXGi8nhp0rofhIxgVQHUV7nNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700672807; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b6VeelrZrRQ2ZdWCQWGB1SpmSKJsJGMqm71+zF2cS5A=; b=Ryx83Uwn6TURrWHsdJ1Im2itxFS1TfRdDdIU7MGX7dY+oNxBWIQiJ2lTd8iw8zoW4ejjQ1 fw861VrWmITwGSESQIx0RAmVuRvDjRdcvluwtLVMVByjhQ+ME3/piLbN0aviPJ332/td9a z584qFqnkANRZjF04Jiui+e7jbHIiFCBnBW8TtDDBoE0aVWUTQYaCP8UaZirg1yWSf/aqK EaR7qUaIPPgCujDbKT6PcRpVyfgOcj52tGIyBybam6MiTcigrrB7RC/GHWLdMB8uL76Ogn UKtDgpy/gqaPulTfU9wMJxpO1gdYt8PTrxBwnYAyf7TMipe4o3BxNjgCPowt4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1700672807; a=rsa-sha256; cv=none; b=aLZ4cte8ZlkB3n5PZlRZ3x4N7i/TN4ShxPHfEMWe4cscGOlUWjDvQFkg/J6F39JawB9Xt9 v6QoxVDsNhWWjo1sWdbjwXVTr3gRawmQJkenghuImafAIVU2DoG27v863wgBxf4AD28tML wnsk156/RbARO5nPBuo+HFqXYCMx46ihot1HwzBXy7PIJXmyuyv6ow9Fvo9Y7WZIruQRdr EHjijV6VYidPqZD9Pres6HP1ODSYkxmFLz4qeZBAxz5aTIqIR1sUYWANDEx0/P7Gt4rQsR gZb3WeFL+d1Sib4EEk3ctda9qJ6MxdEz2Z5J9ghJY20CTMLm6OI57uD0wM26KA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sb72H36m1zC72; Wed, 22 Nov 2023 17:06:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3AMH6lf0002703; Wed, 22 Nov 2023 17:06:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3AMH6lPQ002700; Wed, 22 Nov 2023 17:06:47 GMT (envelope-from git) Date: Wed, 22 Nov 2023 17:06:47 GMT Message-Id: <202311221706.3AMH6lPQ002700@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: ecf2106c0701 - main - arm64/amd64/riscv nexus: Use bus_generic_rl_* List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ecf2106c0701e522b8c643f8ea37550b3e58ba57 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ecf2106c0701e522b8c643f8ea37550b3e58ba57 commit ecf2106c0701e522b8c643f8ea37550b3e58ba57 Author: John Baldwin AuthorDate: 2023-11-22 17:06:33 +0000 Commit: John Baldwin CommitDate: 2023-11-22 17:06:33 +0000 arm64/amd64/riscv nexus: Use bus_generic_rl_* Reviewed by: mhorne, imp Differential Revision: https://reviews.freebsd.org/D42716 --- sys/arm64/arm64/nexus.c | 16 +--------------- sys/riscv/riscv/nexus.c | 18 +++--------------- sys/x86/x86/nexus.c | 48 +++--------------------------------------------- 3 files changed, 7 insertions(+), 75 deletions(-) diff --git a/sys/arm64/arm64/nexus.c b/sys/arm64/arm64/nexus.c index 6ba73cd456ef..dee86bce656a 100644 --- a/sys/arm64/arm64/nexus.c +++ b/sys/arm64/arm64/nexus.c @@ -112,7 +112,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_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 @@ static device_method_t nexus_methods[] = { 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 @@ nexus_get_reslist(device_t dev, device_t child) 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 index 48878807bb7e..2e693e6cf655 100644 --- a/sys/riscv/riscv/nexus.c +++ b/sys/riscv/riscv/nexus.c @@ -86,7 +86,6 @@ static bus_alloc_resource_t nexus_alloc_resource; 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 @@ static device_method_t nexus_methods[] = { 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 @@ nexus_get_reslist(device_t dev, device_t child) 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 index c90a8d252845..4896271b92bd 100644 --- a/sys/x86/x86/nexus.c +++ b/sys/x86/x86/nexus.c @@ -101,12 +101,9 @@ static bus_activate_resource_t nexus_activate_resource; 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 @@ static device_method_t nexus_methods[] = { 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 @@ nexus_get_reslist(device_t dev, device_t child) 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)