From 2b0be198e7d44b0f758d3be5d5b7852886ae09d9 Mon Sep 17 00:00:00 2001 From: kettenis Date: Mon, 17 May 2021 17:25:13 +0000 Subject: [PATCH] Rename some MD structs by giving them an architecture-neutral name in preparation for sharing PCIe host bridge drivers between arm64 and riscv64. ok mpi@, mlarkin@, patrick@ --- sys/arch/arm64/arm64/acpi_machdep.c | 6 +++--- sys/arch/arm64/arm64/intr.c | 22 +++++++++++----------- sys/arch/arm64/dev/acpipci.c | 12 ++++++------ sys/arch/arm64/dev/aplpcie.c | 4 ++-- sys/arch/arm64/dev/pciecam.c | 10 +++++----- sys/arch/arm64/include/intr.h | 4 ++-- sys/arch/arm64/include/pci_machdep.h | 8 ++++---- sys/dev/fdt/bcm2711_pcie.c | 4 ++-- sys/dev/fdt/dwpcie.c | 10 +++++----- sys/dev/fdt/mvgicp.c | 8 ++++---- sys/dev/fdt/mvicu.c | 6 +++--- sys/dev/fdt/mvkpcie.c | 4 ++-- sys/dev/fdt/rkpcie.c | 4 ++-- 13 files changed, 51 insertions(+), 51 deletions(-) diff --git a/sys/arch/arm64/arm64/acpi_machdep.c b/sys/arch/arm64/arm64/acpi_machdep.c index f03bd1f5731..7b9bb1105f1 100644 --- a/sys/arch/arm64/arm64/acpi_machdep.c +++ b/sys/arch/arm64/arm64/acpi_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi_machdep.c,v 1.14 2021/03/16 18:31:16 patrick Exp $ */ +/* $OpenBSD: acpi_machdep.c,v 1.15 2021/05/17 17:25:13 kettenis Exp $ */ /* * Copyright (c) 2018 Mark Kettenis * @@ -142,7 +142,7 @@ acpi_intr_establish(int irq, int flags, int level, int (*func)(void *), void *arg, const char *name) { struct interrupt_controller *ic; - struct arm_intr_handle *aih; + struct machine_intr_handle *aih; uint32_t interrupt[3]; void *cookie; @@ -183,7 +183,7 @@ acpi_intr_establish(int irq, int flags, int level, void acpi_intr_disestablish(void *cookie) { - struct arm_intr_handle *aih = cookie; + struct machine_intr_handle *aih = cookie; struct interrupt_controller *ic = aih->ih_ic; ic->ic_disestablish(aih->ih_ih); diff --git a/sys/arch/arm64/arm64/intr.c b/sys/arch/arm64/arm64/intr.c index bdd79a3bbaf..af50223cd30 100644 --- a/sys/arch/arm64/arm64/intr.c +++ b/sys/arch/arm64/arm64/intr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.c,v 1.22 2021/05/15 11:30:27 kettenis Exp $ */ +/* $OpenBSD: intr.c,v 1.23 2021/05/17 17:25:13 kettenis Exp $ */ /* * Copyright (c) 2011 Dale Rahn * @@ -343,7 +343,7 @@ arm_intr_establish_fdt_idx_cpu(int node, int idx, int level, struct cpu_info *ci struct interrupt_controller *ic; int i, len, ncells, extended = 1; uint32_t *cell, *cells, phandle; - struct arm_intr_handle *ih; + struct machine_intr_handle *ih; void *val = NULL; len = OF_getproplen(node, "interrupts-extended"); @@ -424,7 +424,7 @@ arm_intr_establish_fdt_imap_cpu(int node, int *reg, int nreg, int level, struct cpu_info *ci, int (*func)(void *), void *cookie, char *name) { struct interrupt_controller *ic; - struct arm_intr_handle *ih; + struct machine_intr_handle *ih; uint32_t *cell; uint32_t map_mask[4], *map; int len, acells, ncells; @@ -498,7 +498,7 @@ arm_intr_establish_fdt_msi_cpu(int node, uint64_t *addr, uint64_t *data, char *name) { struct interrupt_controller *ic; - struct arm_intr_handle *ih; + struct machine_intr_handle *ih; uint32_t phandle; void *val = NULL; @@ -524,7 +524,7 @@ arm_intr_establish_fdt_msi_cpu(int node, uint64_t *addr, uint64_t *data, void arm_intr_disestablish_fdt(void *cookie) { - struct arm_intr_handle *ih = cookie; + struct machine_intr_handle *ih = cookie; struct interrupt_controller *ic = ih->ih_ic; ic->ic_disestablish(ih->ih_ih); @@ -534,7 +534,7 @@ arm_intr_disestablish_fdt(void *cookie) void arm_intr_enable(void *cookie) { - struct arm_intr_handle *ih = cookie; + struct machine_intr_handle *ih = cookie; struct interrupt_controller *ic = ih->ih_ic; KASSERT(ic->ic_enable != NULL); @@ -544,7 +544,7 @@ arm_intr_enable(void *cookie) void arm_intr_disable(void *cookie) { - struct arm_intr_handle *ih = cookie; + struct machine_intr_handle *ih = cookie; struct interrupt_controller *ic = ih->ih_ic; KASSERT(ic->ic_disable != NULL); @@ -561,7 +561,7 @@ arm_intr_parent_establish_fdt(void *cookie, int *cell, int level, struct cpu_info *ci, int (*func)(void *), void *arg, char *name) { struct interrupt_controller *ic = cookie; - struct arm_intr_handle *ih; + struct machine_intr_handle *ih; uint32_t phandle; void *val; @@ -587,7 +587,7 @@ arm_intr_parent_establish_fdt(void *cookie, int *cell, int level, void arm_intr_parent_disestablish_fdt(void *cookie) { - struct arm_intr_handle *ih = cookie; + struct machine_intr_handle *ih = cookie; struct interrupt_controller *ic = ih->ih_ic; ic->ic_disestablish(ih->ih_ih); @@ -597,7 +597,7 @@ arm_intr_parent_disestablish_fdt(void *cookie) void arm_intr_route(void *cookie, int enable, struct cpu_info *ci) { - struct arm_intr_handle *ih = cookie; + struct machine_intr_handle *ih = cookie; struct interrupt_controller *ic = ih->ih_ic; if (ic->ic_route) @@ -857,7 +857,7 @@ setstatclockrate(int new) void intr_barrier(void *cookie) { - struct arm_intr_handle *ih = cookie; + struct machine_intr_handle *ih = cookie; struct interrupt_controller *ic = ih->ih_ic; ic->ic_barrier(ih->ih_ih); diff --git a/sys/arch/arm64/dev/acpipci.c b/sys/arch/arm64/dev/acpipci.c index 1d744147c43..2b6566cdcc3 100644 --- a/sys/arch/arm64/dev/acpipci.c +++ b/sys/arch/arm64/dev/acpipci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpipci.c,v 1.28 2021/03/22 20:30:21 patrick Exp $ */ +/* $OpenBSD: acpipci.c,v 1.29 2021/05/17 17:25:13 kettenis Exp $ */ /* * Copyright (c) 2018 Mark Kettenis * @@ -46,7 +46,7 @@ struct acpipci_mcfg { bus_space_tag_t am_iot; bus_space_handle_t am_ioh; - struct arm64_pci_chipset am_pc; + struct machine_pci_chipset am_pc; }; struct acpipci_trans { @@ -80,9 +80,9 @@ struct acpipci_softc { }; struct acpipci_intr_handle { - struct arm_intr_handle aih_ih; - bus_dma_tag_t aih_dmat; - bus_dmamap_t aih_map; + struct machine_intr_handle aih_ih; + bus_dma_tag_t aih_dmat; + bus_dmamap_t aih_map; }; int acpipci_match(struct device *, void *, void *); @@ -678,7 +678,7 @@ acpipci_dummy_conf_write(void *v, pcitag_t tag, int reg, pcireg_t data) { } -struct arm64_pci_chipset acpipci_dummy_chipset = { +struct machine_pci_chipset acpipci_dummy_chipset = { .pc_attach_hook = acpipci_attach_hook, .pc_bus_maxdevs = acpipci_bus_maxdevs, .pc_make_tag = acpipci_make_tag, diff --git a/sys/arch/arm64/dev/aplpcie.c b/sys/arch/arm64/dev/aplpcie.c index eaf1206fa91..ff579cd1cde 100644 --- a/sys/arch/arm64/dev/aplpcie.c +++ b/sys/arch/arm64/dev/aplpcie.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aplpcie.c,v 1.1 2021/02/26 11:09:23 kettenis Exp $ */ +/* $OpenBSD: aplpcie.c,v 1.2 2021/05/17 17:25:13 kettenis Exp $ */ /* * Copyright (c) 2021 Mark Kettenis * @@ -80,7 +80,7 @@ struct aplpcie_softc { struct bus_space sc_bus_iot; struct bus_space sc_bus_memt; - struct arm64_pci_chipset sc_pc; + struct machine_pci_chipset sc_pc; struct extent *sc_busex; struct extent *sc_memex; struct extent *sc_pmemex; diff --git a/sys/arch/arm64/dev/pciecam.c b/sys/arch/arm64/dev/pciecam.c index 91f2797b9ee..efa54a0b995 100644 --- a/sys/arch/arm64/dev/pciecam.c +++ b/sys/arch/arm64/dev/pciecam.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pciecam.c,v 1.14 2021/03/22 20:30:21 patrick Exp $ */ +/* $OpenBSD: pciecam.c,v 1.15 2021/05/17 17:25:13 kettenis Exp $ */ /* * Copyright (c) 2013,2017 Patrick Wildt * @@ -89,13 +89,13 @@ struct pciecam_softc { struct extent *sc_memex; char sc_ioex_name[32]; char sc_memex_name[32]; - struct arm64_pci_chipset sc_pc; + struct machine_pci_chipset sc_pc; }; struct pciecam_intr_handle { - struct arm_intr_handle pih_ih; - bus_dma_tag_t pih_dmat; - bus_dmamap_t pih_map; + struct machine_intr_handle pih_ih; + bus_dma_tag_t pih_dmat; + bus_dmamap_t pih_map; }; int pciecam_match(struct device *, void *, void *); diff --git a/sys/arch/arm64/include/intr.h b/sys/arch/arm64/include/intr.h index d8c5b3640a0..d1389c39087 100644 --- a/sys/arch/arm64/include/intr.h +++ b/sys/arch/arm64/include/intr.h @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.h,v 1.17 2021/02/17 12:11:45 kettenis Exp $ */ +/* $OpenBSD: intr.h,v 1.18 2021/05/17 17:25:13 kettenis Exp $ */ /* * Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -89,7 +89,7 @@ void arm_do_pending_intr(int); void arm_set_intr_handler(int (*)(int), int (*)(int), void (*)(int), void (*)(int), void (*)(void *), void (*)(void *)); -struct arm_intr_handle { +struct machine_intr_handle { struct interrupt_controller *ih_ic; void *ih_ih; }; diff --git a/sys/arch/arm64/include/pci_machdep.h b/sys/arch/arm64/include/pci_machdep.h index eefb6c581cc..bd186bb1265 100644 --- a/sys/arch/arm64/include/pci_machdep.h +++ b/sys/arch/arm64/include/pci_machdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.h,v 1.9 2021/03/22 20:30:21 patrick Exp $ */ +/* $OpenBSD: pci_machdep.h,v 1.10 2021/05/17 17:25:13 kettenis Exp $ */ /* * Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -26,7 +26,7 @@ * */ -typedef struct arm64_pci_chipset *pci_chipset_tag_t; +typedef struct machine_pci_chipset *pci_chipset_tag_t; typedef u_long pcitag_t; /* Supported interrupt types. */ @@ -46,10 +46,10 @@ typedef struct { struct pci_attach_args; /* - * arm64-specific PCI structure and type definitions. + * Machine-specific PCI structure and type definitions. * NOT TO BE USED DIRECTLY BY MACHINE INDEPENDENT CODE. */ -struct arm64_pci_chipset { +struct machine_pci_chipset { void *pc_conf_v; void (*pc_attach_hook)(struct device *, struct device *, struct pcibus_attach_args *); diff --git a/sys/dev/fdt/bcm2711_pcie.c b/sys/dev/fdt/bcm2711_pcie.c index 0e404d72429..70b1d2efa2b 100644 --- a/sys/dev/fdt/bcm2711_pcie.c +++ b/sys/dev/fdt/bcm2711_pcie.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bcm2711_pcie.c,v 1.5 2021/02/25 23:07:49 patrick Exp $ */ +/* $OpenBSD: bcm2711_pcie.c,v 1.6 2021/05/17 17:25:13 kettenis Exp $ */ /* * Copyright (c) 2020 Mark Kettenis * @@ -69,7 +69,7 @@ struct bcmpcie_softc { struct bus_space sc_bus_iot; struct bus_space sc_bus_memt; - struct arm64_pci_chipset sc_pc; + struct machine_pci_chipset sc_pc; int sc_bus; }; diff --git a/sys/dev/fdt/dwpcie.c b/sys/dev/fdt/dwpcie.c index 21b5b6bf9de..974bd6bc052 100644 --- a/sys/dev/fdt/dwpcie.c +++ b/sys/dev/fdt/dwpcie.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dwpcie.c,v 1.28 2021/03/22 20:30:21 patrick Exp $ */ +/* $OpenBSD: dwpcie.c,v 1.29 2021/05/17 17:25:13 kettenis Exp $ */ /* * Copyright (c) 2018 Mark Kettenis * @@ -215,7 +215,7 @@ struct dwpcie_softc { struct bus_space sc_bus_iot; struct bus_space sc_bus_memt; - struct arm64_pci_chipset sc_pc; + struct machine_pci_chipset sc_pc; int sc_bus; int sc_num_viewport; @@ -226,9 +226,9 @@ struct dwpcie_softc { }; struct dwpcie_intr_handle { - struct arm_intr_handle pih_ih; - bus_dma_tag_t pih_dmat; - bus_dmamap_t pih_map; + struct machine_intr_handle pih_ih; + bus_dma_tag_t pih_dmat; + bus_dmamap_t pih_map; }; int dwpcie_match(struct device *, void *, void *); diff --git a/sys/dev/fdt/mvgicp.c b/sys/dev/fdt/mvgicp.c index 8ce3eec2e3c..b2098012beb 100644 --- a/sys/dev/fdt/mvgicp.c +++ b/sys/dev/fdt/mvgicp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mvgicp.c,v 1.3 2020/07/17 08:07:34 patrick Exp $ */ +/* $OpenBSD: mvgicp.c,v 1.4 2021/05/17 17:25:13 kettenis Exp $ */ /* * Copyright (c) 2019 Patrick Wildt * @@ -125,7 +125,7 @@ mvgicp_intr_establish(void *self, uint64_t *addr, uint64_t *data, { struct mvgicp_softc *sc = (struct mvgicp_softc *)self; struct interrupt_controller *ic = sc->sc_parent_ic; - struct arm_intr_handle *ih; + struct machine_intr_handle *ih; uint32_t interrupt[3]; uint32_t flags; void *cookie; @@ -178,7 +178,7 @@ mvgicp_intr_establish(void *self, uint64_t *addr, uint64_t *data, void mvgicp_intr_disestablish(void *cookie) { - struct arm_intr_handle *ih = *(void **)cookie; + struct machine_intr_handle *ih = *(void **)cookie; struct interrupt_controller *ic = ih->ih_ic; ic->ic_disestablish(ih->ih_ih); @@ -189,7 +189,7 @@ mvgicp_intr_disestablish(void *cookie) void mvgicp_intr_barrier(void *cookie) { - struct arm_intr_handle *ih = *(void **)cookie; + struct machine_intr_handle *ih = *(void **)cookie; struct interrupt_controller *ic = ih->ih_ic; ic->ic_barrier(ih->ih_ih); diff --git a/sys/dev/fdt/mvicu.c b/sys/dev/fdt/mvicu.c index 805aac01c82..49a3b0e5e8f 100644 --- a/sys/dev/fdt/mvicu.c +++ b/sys/dev/fdt/mvicu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mvicu.c,v 1.6 2020/07/17 08:07:34 patrick Exp $ */ +/* $OpenBSD: mvicu.c,v 1.7 2021/05/17 17:25:13 kettenis Exp $ */ /* * Copyright (c) 2018 Mark Kettenis * @@ -200,7 +200,7 @@ mvicu_intr_establish(void *cookie, int *cell, int level, struct mvicu_subnode *sn = cookie; struct mvicu_softc *sc = sn->sn_sc; struct interrupt_controller *ic = sn->sn_parent_ic; - struct arm_intr_handle *ih; + struct machine_intr_handle *ih; uint32_t idx, flags; uint64_t addr, data; int edge = 0; @@ -277,7 +277,7 @@ mvicu_intr_disestablish(void *cookie) void mvicu_intr_barrier(void *cookie) { - struct arm_intr_handle *ih = cookie; + struct machine_intr_handle *ih = cookie; struct interrupt_controller *ic = ih->ih_ic; ic->ic_barrier(ih->ih_ih); diff --git a/sys/dev/fdt/mvkpcie.c b/sys/dev/fdt/mvkpcie.c index ca1ea1a8a4a..011531af4eb 100644 --- a/sys/dev/fdt/mvkpcie.c +++ b/sys/dev/fdt/mvkpcie.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mvkpcie.c,v 1.9 2021/02/25 23:07:49 patrick Exp $ */ +/* $OpenBSD: mvkpcie.c,v 1.10 2021/05/17 17:25:13 kettenis Exp $ */ /* * Copyright (c) 2018 Mark Kettenis * Copyright (c) 2020 Patrick Wildt @@ -184,7 +184,7 @@ struct mvkpcie_softc { struct bus_space sc_bus_iot; struct bus_space sc_bus_memt; - struct arm64_pci_chipset sc_pc; + struct machine_pci_chipset sc_pc; int sc_bus; uint32_t sc_bridge_command; diff --git a/sys/dev/fdt/rkpcie.c b/sys/dev/fdt/rkpcie.c index e01db545059..9d8d98429a7 100644 --- a/sys/dev/fdt/rkpcie.c +++ b/sys/dev/fdt/rkpcie.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rkpcie.c,v 1.13 2021/03/01 20:49:20 patrick Exp $ */ +/* $OpenBSD: rkpcie.c,v 1.14 2021/05/17 17:25:13 kettenis Exp $ */ /* * Copyright (c) 2018 Mark Kettenis * @@ -103,7 +103,7 @@ struct rkpcie_softc { int sc_node; int sc_phy_node; - struct arm64_pci_chipset sc_pc; + struct machine_pci_chipset sc_pc; struct extent *sc_busex; struct extent *sc_memex; struct extent *sc_ioex; -- 2.20.1