From nobody Mon Mar 20 20:36:54 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 4PgRNk6blDz40Cl1; Mon, 20 Mar 2023 20:36:54 +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 4PgRNk5vj8z3RFL; Mon, 20 Mar 2023 20:36:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679344614; 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=clb9Z1eXTyqfeSfbSFlBBELfr4D00swibYHhGg5BF/o=; b=QzRpe3SMAAjSydpCnYYq52FtetpFekj1hMuI9ZvQyBSNSPM2k7isV8vXVdAFNnmehshu+A aeDD5hJSjk7E5eU/aGczVh6hRXK07ubcYBVHKrdDP5Y5FKj8hTFLRju4nGsvUEH1qjduIt 2x+4TbhsUMNjJF2NkjrMyVQxiYdw0OsjFQ39JaOux2uuXImRU9VY++lrLt3NhtVu5tFJVA CE0Ia46mqgmY4KoEJZWhH66miCOnegiWXztFmkCFbH05Z/x9CywdDKJYG8DS4CxAQ0dbW1 FXV4lzde6x4X4R6vgoWvGlKiy6JgmFc1hAUtO84bElEjWzFB3WQmtMM19ney3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679344614; 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=clb9Z1eXTyqfeSfbSFlBBELfr4D00swibYHhGg5BF/o=; b=s868h24kZYOzDHNg7tbDP5w0n7VtjxVSZbDuYaF0xJ1dmfuqCrqZrN6AVwTdFOI6bfL4ud sa4/APafhBMEMHQqZvPJVUa8FDoC9nm5yXV3MoVCJrqSGDMJYH4o7uQlGWEFCDCdn4IPAP QJFSVuSHQoHm6C6NaP6WCQnrJegK7sr3Kp1SiDAeKaPlpoY6wfvEn2GRadpbyYH8Qjq7Pb Gnh161ln+Pzte3quoYR+0c3depMyYFnXyXm5KwDcTVOsH5gwzD5ITDgjdgBhU7xqsMB75k OWhkQWbAqImQeKu7v+UFX6BaLW3aK5Uh04NPTnzuaL+yzVx8qYIkKYWFQgU3jg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679344614; a=rsa-sha256; cv=none; b=KWL5tVvAVXjSR8wILimNlJ6/Sks+q62ddCf4f0rS2gjentaLI/PkQiNfTcDsahR7fCdNhq BYevhTetreAjNgi/atHs1/OCMEL6O21KMUYM7k9vgOmW01mAKVzb2ANSWhGyfJpbM3SgNj qh0s/Km7ts0pwXQxqylOxXgakZYUB1kABHil6iT54OulFWfzVOeREFhRWbcbZKsbTHLW6Y 2c3n0vMtislzmCeoQDmENIZ7Cc9P5VZab9Dy+Ho+jYS9HRVJcW1GoTLmTneMMtzUZOF6dY ERi9OxXH4VatR7/gJRUKAvjB5M0K9pfK3x3WgXWyu0L/Jck6wJzzSOivC6TE1g== 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 4PgRNk4jkVzkml; Mon, 20 Mar 2023 20:36:54 +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 32KKasTt066256; Mon, 20 Mar 2023 20:36:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32KKastX066255; Mon, 20 Mar 2023 20:36:54 GMT (envelope-from git) Date: Mon, 20 Mar 2023 20:36:54 GMT Message-Id: <202303202036.32KKastX066255@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: c514686aa06a - main - powerpc: nexus code tidy-up 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: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c514686aa06a08a97df051a75da9ea7964a74fb0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=c514686aa06a08a97df051a75da9ea7964a74fb0 commit c514686aa06a08a97df051a75da9ea7964a74fb0 Author: Mitchell Horne AuthorDate: 2023-02-10 14:37:08 +0000 Commit: Mitchell Horne CommitDate: 2023-03-20 20:35:47 +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 --- 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 3a1e961c743e..7ae542d67afa 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 */ @@ -222,7 +222,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,