From nobody Wed Jan 03 20:45:33 2024 X-Original-To: dev-commits-src-all@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 4T51vK4yzqz56fkS; Wed, 3 Jan 2024 20:45:33 +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 4T51vK4397z4PmN; Wed, 3 Jan 2024 20:45:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704314733; 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=in2LyiGVs3MFOUHxv92jTh3JPoQcfb0DRG3rQ9qddzw=; b=q1fmmPJS/dpFBVkUAPrCqqWv11iKg508oid6fCgjAZpPDcf1JhAnCLsc4PYJ3h5Gfw+v7W DB/NTHN6MVPdL8SnHLqWgiwBws5BRPHH//rWb+pYuBWsHIvDKutGpdb3sNgtIRSAjci2AR 4apv1jAT6BBl8BqXcrthllIaEyD2JQoQH+ROD0e9f2j2jEA/0KLAA0mbMlbBqAjGouyV07 4pXr1fPVWU5WeWO7I3Z1u6M/AQRfsSL83JBZ54a3pcakkSJOPjfb7Qekb8lfX+kQ77GSaF FBfx7W8Mly//uiTxsZ1t/su83Ud8P3UeRKudyxti6CoG3DfW7h1fNqqh2KVy3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704314733; 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=in2LyiGVs3MFOUHxv92jTh3JPoQcfb0DRG3rQ9qddzw=; b=x5Z6/3r1B8kyrhFapt9oAh6G2bM4nXHaxj+4CnKK2u/OqOdEhElrlGcle/qd5Y/Yyj+XA8 zgnTzddAnQwNchcEDSsVsuRIrDGOD/GabCdibB+y0HinLDuoejSqZMCjln1xRVUSg1RAa/ 7vucQJtvmoVXT1FPjrA/cEkPY9GgypzfRlfkhoIdL/sJNOKhYrH//yzMGdY8cByvh81ota 68tPj9Bv386N93fIn4e46aNX5Q3uFYDqVJa/vKB6kyEy2VgSG72CJaCR9aUKd4CqsHmFmL 9Dpr3qa7iJqmnS2JzOYUdfh4zNhjNPTVZXiyIRX56i8Ou20AOz3bLQ5GIenXOA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704314733; a=rsa-sha256; cv=none; b=sdk2Ywj0aJ2v4DSaK/GF5RMr5mSxeMWMRwZOl9LnfM+4QMgsld4rvwFAwkIL2RjY/vZppe 8uouL0S+S9iOHtmC0UJnCNg/VREluJS0U6z1pX6n87LdoJolqsp7pEWdygAelR1XNJ44/p /hbGfD8NWbRA1oJnhnljnIvbgDB8VCdwbBxSZ+1m6Ymgn1gA0J1+7BAbgPrg15GAUeMcZu w3ma9qZOYeddAgY3WBZxMMSu+yB/Uy9lAvWqfbThPCemnaSmdQsAB93GBFV1DUZIuQh5Za Z1R1PQsJ4B/iI0HlJLbBX+WmY9pk4F1N3ffKl2u9CT/XJFlVEqCnJmMkHpJWFw== 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 4T51vK36czz10mn; Wed, 3 Jan 2024 20:45:33 +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 403KjXQX037352; Wed, 3 Jan 2024 20:45:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 403KjXXa037349; Wed, 3 Jan 2024 20:45:33 GMT (envelope-from git) Date: Wed, 3 Jan 2024 20:45:33 GMT Message-Id: <202401032045.403KjXXa037349@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 30ead05708ae - stable/14 - arm64/amd64/riscv nexus: Use bus_generic_rl_* List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 30ead05708ae4fc488cb2afa3924a329fab7c7ba Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=30ead05708ae4fc488cb2afa3924a329fab7c7ba commit 30ead05708ae4fc488cb2afa3924a329fab7c7ba Author: John Baldwin AuthorDate: 2023-11-22 17:06:33 +0000 Commit: John Baldwin CommitDate: 2024-01-03 20:33:59 +0000 arm64/amd64/riscv nexus: Use bus_generic_rl_* Reviewed by: mhorne, imp Differential Revision: https://reviews.freebsd.org/D42716 (cherry picked from commit ecf2106c0701e522b8c643f8ea37550b3e58ba57) --- 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 b9871f0e9b3a..2394ad912391 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; @@ -139,7 +138,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 @@ -433,19 +432,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)