Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Jan 2023 12:37:25 GMT
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: e5e323b58796 - stable/13 - Move the GICv3 bus_print_child function to the parent
Message-ID:  <202301231237.30NCbPv5085057@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by andrew:

URL: https://cgit.FreeBSD.org/src/commit/?id=e5e323b587968e6f490f03e3f42a0795205d99b1

commit e5e323b587968e6f490f03e3f42a0795205d99b1
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2022-09-22 10:50:15 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2023-01-23 12:36:27 +0000

    Move the GICv3 bus_print_child function to the parent
    
    This should be common for both ACPI and FDT. Move this to the common
    part of the driver.
    
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit bdc9ece97b80c3a8b8c9161d95ef908172eb316a)
---
 sys/arm64/arm64/gic_v3.c     | 17 +++++++++++++++++
 sys/arm64/arm64/gic_v3_fdt.c | 17 -----------------
 2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/sys/arm64/arm64/gic_v3.c b/sys/arm64/arm64/gic_v3.c
index 3e7cd30140eb..9a65bdd9d585 100644
--- a/sys/arm64/arm64/gic_v3.c
+++ b/sys/arm64/arm64/gic_v3.c
@@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$");
 #include "gic_v3_reg.h"
 #include "gic_v3_var.h"
 
+static bus_print_child_t gic_v3_print_child;
 static bus_get_domain_t gic_v3_get_domain;
 static bus_read_ivar_t gic_v3_read_ivar;
 
@@ -111,6 +112,7 @@ static device_method_t gic_v3_methods[] = {
 	DEVMETHOD(device_detach,	gic_v3_detach),
 
 	/* Bus interface */
+	DEVMETHOD(bus_print_child,	gic_v3_print_child),
 	DEVMETHOD(bus_get_domain,	gic_v3_get_domain),
 	DEVMETHOD(bus_read_ivar,	gic_v3_read_ivar),
 
@@ -401,6 +403,21 @@ gic_v3_detach(device_t dev)
 	return (0);
 }
 
+static int
+gic_v3_print_child(device_t bus, device_t child)
+{
+	struct resource_list *rl;
+	int retval = 0;
+
+	rl = BUS_GET_RESOURCE_LIST(bus, child);
+	KASSERT(rl != NULL, ("%s: No resource list", __func__));
+	retval += bus_print_child_header(bus, child);
+	retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#jx");
+	retval += bus_print_child_footer(bus, child);
+
+	return (retval);
+}
+
 static int
 gic_v3_get_domain(device_t dev, device_t child, int *domain)
 {
diff --git a/sys/arm64/arm64/gic_v3_fdt.c b/sys/arm64/arm64/gic_v3_fdt.c
index 16539b50fd09..07272c3ebd42 100644
--- a/sys/arm64/arm64/gic_v3_fdt.c
+++ b/sys/arm64/arm64/gic_v3_fdt.c
@@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$");
  */
 static int gic_v3_fdt_probe(device_t);
 static int gic_v3_fdt_attach(device_t);
-static int gic_v3_fdt_print_child(device_t, device_t);
 
 static struct resource *gic_v3_ofw_bus_alloc_res(device_t, device_t, int, int *,
     rman_res_t, rman_res_t, rman_res_t, u_int);
@@ -66,7 +65,6 @@ static device_method_t gic_v3_fdt_methods[] = {
 	DEVMETHOD(device_attach,	gic_v3_fdt_attach),
 
 	/* Bus interface */
-	DEVMETHOD(bus_print_child,		gic_v3_fdt_print_child),
 	DEVMETHOD(bus_alloc_resource,		gic_v3_ofw_bus_alloc_res),
 	DEVMETHOD(bus_activate_resource,	bus_generic_activate_resource),
 	DEVMETHOD(bus_get_resource_list,	gic_v3_fdt_get_resource_list),
@@ -212,21 +210,6 @@ struct gic_v3_ofw_devinfo {
 	struct resource_list	di_rl;
 };
 
-static int
-gic_v3_fdt_print_child(device_t bus, device_t child)
-{
-	struct resource_list *rl;
-	int retval = 0;
-
-	rl = BUS_GET_RESOURCE_LIST(bus, child);
-	KASSERT(rl != NULL, ("%s: No resource list", __func__));
-	retval += bus_print_child_header(bus, child);
-	retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#jx");
-	retval += bus_print_child_footer(bus, child);
-
-	return (retval);
-}
-
 static const struct ofw_bus_devinfo *
 gic_v3_ofw_get_devinfo(device_t bus __unused, device_t child)
 {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202301231237.30NCbPv5085057>