]> xenbits.xensource.com Git - people/andrewcoop/xen.git/commitdiff
xen: avoid generation of stub <asm/pci.h> header
authorOleksii Kurochko <oleksii.kurochko@gmail.com>
Mon, 13 Nov 2023 14:00:06 +0000 (15:00 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 13 Nov 2023 14:00:06 +0000 (15:00 +0100)
Platforms which doesn't have HAS_PCI enabled it is needed to
have <asm/pci.h>, which contains only an empty definition of
struct arch_pci_dev (except Arm, it introduces several Arm-specific
functions ).

Also, for architectures (such as PPC or RISC-V) on initial
stages of adding support, it is needed to generate <asm/pci.h>
for only define the mentioned above arch_pci_dev structure.

For the Arm-only stubs (mentioned in <asm/pci.h> for disabled
HAS_PCI and Arm-specific) will be needed
to add <asm/pci.h> directly alongside <xen/pci.h>. Only to
<arm/domain.c> <asm/pci.h> was added.

Suggested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Julien Grall <jgrall@amazon.com>
xen/arch/arm/domain_build.c
xen/arch/arm/include/asm/pci.h
xen/arch/ppc/include/asm/pci.h [deleted file]
xen/include/xen/pci.h

index 49792dd590ee93c03df93e362b98618e0fde197c..2dd2926b414400dc697eeea463bddf9b55e8eeea 100644 (file)
@@ -23,6 +23,7 @@
 #include <asm/kernel.h>
 #include <asm/setup.h>
 #include <asm/tee/tee.h>
+#include <asm/pci.h>
 #include <asm/platform.h>
 #include <asm/psci.h>
 #include <asm/setup.h>
index 8cb46f6b718597a8b620bb02e2097579d7e00f35..7f77226c9bbf9d8cc3d6052f2eecd5872a16d4a3 100644 (file)
@@ -130,13 +130,6 @@ bool pci_check_bar(const struct pci_dev *pdev, mfn_t start, mfn_t end);
 
 #else   /*!CONFIG_HAS_PCI*/
 
-struct arch_pci_dev { };
-
-static always_inline bool is_pci_passthrough_enabled(void)
-{
-    return false;
-}
-
 struct pci_dev;
 
 static inline void arch_pci_init_pdev(struct pci_dev *pdev) {}
diff --git a/xen/arch/ppc/include/asm/pci.h b/xen/arch/ppc/include/asm/pci.h
deleted file mode 100644 (file)
index e76c8e5..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef __ASM_PPC_PCI_H__
-#define __ASM_PPC_PCI_H__
-
-struct arch_pci_dev {
-};
-
-#endif /* __ASM_PPC_PCI_H__ */
index 251b8761a8e974f131e3d67e8412cfe05e84c35d..50d7dfb2a2fdc8c2f5fe06c7a04a44ac95a85624 100644 (file)
@@ -68,7 +68,18 @@ typedef union {
     };
 } pci_sbdf_t;
 
+#ifdef CONFIG_HAS_PCI
 #include <asm/pci.h>
+#else
+
+struct arch_pci_dev { };
+
+static inline bool is_pci_passthrough_enabled(void)
+{
+    return false;
+}
+
+#endif
 
 struct pci_dev_info {
     /*