The symbol "smmu" is declared and defined only in the smmu-v3 compilation unit. Give different names and pass a pointer as parameter to preserve generality of the accessor functions and avoid shadowing the smmu name.
Signed-off-by: Andrea Bastoni <[email protected]> --- hypervisor/arch/arm64/smmu-v3.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hypervisor/arch/arm64/smmu-v3.c b/hypervisor/arch/arm64/smmu-v3.c index 2f57868d..3b5117ba 100644 --- a/hypervisor/arch/arm64/smmu-v3.c +++ b/hypervisor/arch/arm64/smmu-v3.c @@ -360,7 +360,9 @@ struct arm_smmu_device { struct arm_smmu_evtq evtq; unsigned int sid_bits; struct arm_smmu_strtab_cfg strtab_cfg; -} smmu[JAILHOUSE_MAX_IOMMU_UNITS]; +}; + +static struct arm_smmu_device the_smmu[JAILHOUSE_MAX_IOMMU_UNITS]; /* Low-level queue manipulation functions */ static bool queue_full(struct arm_smmu_queue *q) @@ -1043,6 +1045,7 @@ static int arm_smmuv3_cell_init(struct cell *cell) struct jailhouse_iommu *iommu; struct arm_smmu_cmdq_ent cmd; int ret, i, j, sid; + struct arm_smmu_device *smmu = the_smmu; if (!iommu_count_units()) return 0; @@ -1072,6 +1075,7 @@ static void arm_smmuv3_cell_exit(struct cell *cell) struct jailhouse_iommu *iommu; struct arm_smmu_cmdq_ent cmd; int i, j, sid; + struct arm_smmu_device *smmu = the_smmu; if (!iommu_count_units()) return; @@ -1096,6 +1100,7 @@ static int arm_smmuv3_init(void) { struct jailhouse_iommu *iommu; int ret, i; + struct arm_smmu_device *smmu = the_smmu; iommu = &system_config->platform_info.iommu_units[0]; for (i = 0; i < iommu_count_units(); iommu++, i++) { -- 2.28.0 -- You received this message because you are subscribed to the Google Groups "Jailhouse" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jailhouse-dev/20201022175826.199614-6-andrea.bastoni%40tum.de.
