Move domain_vpci_init() and domain_vpci_get_num_mmio_handlers()
declarations from the private xen/arch/arm/vpci.h into the public
xen/arch/arm/include/asm/vpci.h, and remove the now redundant
private header.
Update domain.c to include <asm/vpci.h> instead of the removed private
header.
This ensures the declarations are visible where the functions are
defined, resolving a MISRA C Rule 8.4 violation.
Signed-off-by: Michal Orzel <michal.orzel@amd.com>
---
I'm moving a file with GPL2+ license to a file with GPL2-only. I consider this
ok in this case becase the copyright on a file with just prototypes does not
make any sense and a license text was most likely blindly copy-pasted like for
most of the files in that era.
---
xen/arch/arm/domain.c | 2 +-
xen/arch/arm/include/asm/vpci.h | 18 ++++++++++++++
xen/arch/arm/vpci.h | 42 ---------------------------------
3 files changed, 19 insertions(+), 43 deletions(-)
delete mode 100644 xen/arch/arm/vpci.h
diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 581f82bddd48..26380a807cad 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -31,10 +31,10 @@
#include <asm/tee/tee.h>
#include <asm/vfp.h>
#include <asm/vgic.h>
+#include <asm/vpci.h>
#include <asm/vpsci.h>
#include <asm/vtimer.h>
-#include "vpci.h"
#include "vuart.h"
DEFINE_PER_CPU(struct vcpu *, curr_vcpu);
diff --git a/xen/arch/arm/include/asm/vpci.h b/xen/arch/arm/include/asm/vpci.h
index db04687fc099..0cc6f5a10532 100644
--- a/xen/arch/arm/include/asm/vpci.h
+++ b/xen/arch/arm/include/asm/vpci.h
@@ -2,6 +2,9 @@
#ifndef ARM_VPCI_H
#define ARM_VPCI_H
+struct domain;
+
+#ifdef CONFIG_HAS_VPCI
/* Arch-specific MSI data for vPCI. */
struct vpci_arch_msi {
};
@@ -10,4 +13,19 @@ struct vpci_arch_msi {
struct vpci_arch_msix_entry {
};
+
+int domain_vpci_init(struct domain *d);
+unsigned int domain_vpci_get_num_mmio_handlers(struct domain *d);
+#else
+static inline int domain_vpci_init(struct domain *d)
+{
+ return 0;
+}
+
+static inline unsigned int domain_vpci_get_num_mmio_handlers(struct domain *d)
+{
+ return 0;
+}
+#endif /* CONFIG_HAS_VPCI */
+
#endif /* ARM_VPCI_H */
diff --git a/xen/arch/arm/vpci.h b/xen/arch/arm/vpci.h
deleted file mode 100644
index 3c713f3fcdb5..000000000000
--- a/xen/arch/arm/vpci.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * xen/arch/arm/vpci.h
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-
-#ifndef __ARCH_ARM_VPCI_H__
-#define __ARCH_ARM_VPCI_H__
-
-#ifdef CONFIG_HAS_VPCI
-int domain_vpci_init(struct domain *d);
-unsigned int domain_vpci_get_num_mmio_handlers(struct domain *d);
-#else
-static inline int domain_vpci_init(struct domain *d)
-{
- return 0;
-}
-
-static inline unsigned int domain_vpci_get_num_mmio_handlers(struct domain *d)
-{
- return 0;
-}
-#endif
-
-#endif /* __ARCH_ARM_VPCI_H__ */
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * indent-tabs-mode: nil
- * End:
- */
--
2.43.0
© 2016 - 2026 Red Hat, Inc.