From nobody Mon Apr 17 17:04:05 2023 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 4Q0YLG28NTz44vnJ; Mon, 17 Apr 2023 17:04:06 +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 4Q0YLG0rL9z49kw; Mon, 17 Apr 2023 17:04:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681751046; 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=5zPCXc7xz+KrQK2DZ4gyU5mTGVoS1LswA2A0DvRtSIc=; b=lGCu9VRLFVXxIvmL7vMCIf7o7szBNz06+Yua4HD8EoQ+D5RtNK0oCzdjkwnumoNdZP8kmU 2wL8GvMnafrExghyMmRuT42t4p9N18y2DpKLXrOOhpDsIvVPUV7C2uZt0m/71T16Oy5MSU vbLnor9/CPonwM0clX9d6JL2XM73vZpkLqJmc41Sm3YBNUjaGdJi2fNyKJ1wzupL995BsQ W9jwHq00yUPTNJ+XzPfvVMgf90/9FVRnxRGbHHXzA8p2leDRk98+Fijcjr/bAyOd3AODmo G32Xwiaw2DPLeijH5fP++yiaz3R86+32VWpHLyjpVQJ1FZupw0qQpog69rD8+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681751046; 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=5zPCXc7xz+KrQK2DZ4gyU5mTGVoS1LswA2A0DvRtSIc=; b=HTnvhY4neIXsaJJbeZ72yJiJw4SaWNW02v+BxewDDC3uI0zOKd+y+SRtu3ANm+5Dmh4eWg WsQwIM+MgTeUmC83rVjTQA95VyLzbA+8/U48M/cnMpVmeJ8iU9DUjO7EpnDjofxxUteR1c ddxlHnDHp/uFWM4s22wvVHXbhCIO7jxSOB7GSYFGjdgC5IEByN2zFBAkgR/Q35NQ5e8rBW t67+ZQf28VLxz/OVQ1OVMF87ztN8CJKyQBbn1t6riXZ8+LswyBjDJP+NCtFV0PSLYvoVXG CmaIBMmmqkGNo4K3igBu0ZotIwJaR5abeAv+Eyh5Mst++vXc1mTkGsWiZejxkw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1681751046; a=rsa-sha256; cv=none; b=W8oSoYJrDqfYtynh9qfu7tZC6lCdqC2/KNxVlWyS08RqSK2hlnLlOMzB4txt2YxIxM6MAa ytNb7VJ2w6rqW8h+rEdm+0Wc1+aMwK8O5rggzLa3iA+Fw7X3+RZR90GHhD5ljlYfLbqDS4 0GEbvJ8imONZj9CWsJZ2S+kOYcaBIS4QcXozYREm/p0AWtdKtG6LgZVRZYgD4nt4RA9X6G J2euhUrvbZn3JzMf2qa4msi/DvN2YcCHSj47O5J8NnK2CDFcQzRV+4pzvHZLr7oDf1oVv/ qOomQImmzBFfzWhepDXZiNoQJ2FJJs1v7lcNaVB1GKujiaSJt0Jk2ZbUk+XM8A== 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 4Q0YLF6fd3zd7X; Mon, 17 Apr 2023 17:04:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 33HH45sh002632; Mon, 17 Apr 2023 17:04:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33HH45TD002631; Mon, 17 Apr 2023 17:04:05 GMT (envelope-from git) Date: Mon, 17 Apr 2023 17:04:05 GMT Message-Id: <202304171704.33HH45TD002631@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: d3d739ffa7a5 - stable/13 - powerpc: nexus code tidy-up 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: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d3d739ffa7a53530ad81b4c242b9e12743bc8d99 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=d3d739ffa7a53530ad81b4c242b9e12743bc8d99 commit d3d739ffa7a53530ad81b4c242b9e12743bc8d99 Author: Mitchell Horne AuthorDate: 2023-02-10 14:37:08 +0000 Commit: Mitchell Horne CommitDate: 2023-04-17 16:57:55 +0000 powerpc: nexus code tidy-up Make a pass at the various nexus implementations, fixing some very minor style issues, obsolete comments, etc. Update the top-level comment to be closer to other nexus implementations. The method declaration section has become unwieldy in many respects. Attempt to tame it by: - Using generated method typedefs - Grouping methods roughly by category, and then alphabetically. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D38495 (cherry picked from commit c514686aa06a08a97df051a75da9ea7964a74fb0) --- sys/powerpc/powerpc/nexus.c | 76 ++++++++++++++++++++++----------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/sys/powerpc/powerpc/nexus.c b/sys/powerpc/powerpc/nexus.c index 78bcf6363d60..baca759b2071 100644 --- a/sys/powerpc/powerpc/nexus.c +++ b/sys/powerpc/powerpc/nexus.c @@ -32,62 +32,62 @@ * from: FreeBSD: src/sys/i386/i386/nexus.c,v 1.43 2001/02/09 */ +/* + * This code implements a `root nexus' for Power ISA Architecture + * machines. The function of the root nexus is to serve as an + * attachment point for both processors and buses, and to manage + * resources which are common to all of them. In particular, + * this code implements the core resource managers for interrupt + * requests and I/O memory address space. + */ + #include __FBSDID("$FreeBSD$"); -#include #include #include #include -#include #include #include #include -#include #include -#include #include #include -#include -#include -#include - #include +#include #include #include -/* - * The nexus handles root-level resource allocation requests and interrupt - * mapping. All direct subdevices of nexus are attached by DEVICE_IDENTIFY(). - */ +#include +#include +#include static struct rman intr_rman; static struct rman mem_rman; -static device_probe_t nexus_probe; -static device_attach_t nexus_attach; -static bus_setup_intr_t nexus_setup_intr; -static bus_teardown_intr_t nexus_teardown_intr; -static bus_alloc_resource_t nexus_alloc_resource; -static bus_activate_resource_t nexus_activate_resource; +static device_probe_t nexus_probe; +static device_attach_t nexus_attach; + +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_adjust_resource_t nexus_adjust_resource; -static bus_release_resource_t nexus_release_resource; -static int nexus_map_resource(device_t bus, device_t child, int type, - struct resource *r, - struct resource_map_request *argsp, - struct resource_map *map); -static int nexus_unmap_resource(device_t bus, device_t child, int type, - struct resource *r, struct resource_map *map); - -static bus_space_tag_t nexus_get_bus_tag(device_t, device_t); +static bus_map_resource_t nexus_map_resource; +static bus_release_resource_t nexus_release_resource; +static bus_unmap_resource_t nexus_unmap_resource; + #ifdef SMP -static bus_bind_intr_t nexus_bind_intr; +static bus_bind_intr_t nexus_bind_intr; #endif -static bus_config_intr_t nexus_config_intr; -static ofw_bus_map_intr_t nexus_ofw_map_intr; +static bus_config_intr_t nexus_config_intr; +static bus_setup_intr_t nexus_setup_intr; +static bus_teardown_intr_t nexus_teardown_intr; + +static bus_get_bus_tag_t nexus_get_bus_tag; + +static ofw_bus_map_intr_t nexus_ofw_map_intr; static device_method_t nexus_methods[] = { /* Device interface */ @@ -96,19 +96,19 @@ static device_method_t nexus_methods[] = { /* Bus interface */ DEVMETHOD(bus_add_child, bus_generic_add_child), - DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), - DEVMETHOD(bus_activate_resource, nexus_activate_resource), - DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), DEVMETHOD(bus_adjust_resource, nexus_adjust_resource), - DEVMETHOD(bus_release_resource, nexus_release_resource), + DEVMETHOD(bus_activate_resource, nexus_activate_resource), + DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), + DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), DEVMETHOD(bus_map_resource, nexus_map_resource), + DEVMETHOD(bus_release_resource, nexus_release_resource), DEVMETHOD(bus_unmap_resource, nexus_unmap_resource), - DEVMETHOD(bus_setup_intr, nexus_setup_intr), - DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), #ifdef SMP DEVMETHOD(bus_bind_intr, nexus_bind_intr), #endif DEVMETHOD(bus_config_intr, nexus_config_intr), + DEVMETHOD(bus_setup_intr, nexus_setup_intr), + DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), DEVMETHOD(bus_get_bus_tag, nexus_get_bus_tag), /* ofw_bus interface */ @@ -225,7 +225,7 @@ nexus_config_intr(device_t dev, int irq, enum intr_trigger trig, { return (powerpc_config_intr(irq, trig, pol)); -} +} static int nexus_ofw_map_intr(device_t dev, device_t child, phandle_t iparent, int icells,