All of lore.kernel.org
 help / color / mirror / Atom feed
From: Doug Goldstein <cardoe@cardoe.com>
To: xen-devel@lists.xen.org
Cc: Stefano Stabellini <stefano.stabellini@citrix.com>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	Doug Goldstein <cardoe@cardoe.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: [PATCHv2] 04/27] build: convert HAS_DEVICE_TREE use to Kconfig
Date: Wed, 11 Nov 2015 10:49:54 -0600	[thread overview]
Message-ID: <1447260617-10138-5-git-send-email-cardoe@cardoe.com> (raw)
In-Reply-To: <1447260617-10138-1-git-send-email-cardoe@cardoe.com>

Use the Kconfig generated CONFIG_HAS_DEVICE_TREE defines in the code
base.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>

CC: Ian Campbell <ian.campbell@citrix.com>
CC: Stefano Stabellini <stefano.stabellini@citrix.com>
CC: Jan Beulich <jbeulich@suse.com>
CC: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
---
 xen/Rules.mk                     |  1 -
 xen/arch/arm/Kconfig             |  1 +
 xen/arch/arm/Rules.mk            |  1 -
 xen/common/Kconfig               |  4 ++++
 xen/common/Makefile              |  4 ++--
 xen/drivers/char/ns16550.c       |  6 +++---
 xen/drivers/passthrough/Makefile |  2 +-
 xen/drivers/passthrough/iommu.c  |  2 +-
 xen/include/asm-arm/device.h     |  2 +-
 xen/include/xen/hvm/iommu.h      |  2 +-
 xen/include/xen/iommu.h          |  4 ++--
 xen/include/xsm/dummy.h          |  4 ++--
 xen/include/xsm/xsm.h            | 10 +++++-----
 xen/xsm/dummy.c                  |  2 +-
 xen/xsm/flask/hooks.c            |  6 +++---
 xen/xsm/xsm_core.c               |  2 +-
 xen/xsm/xsm_policy.c             |  4 ++--
 17 files changed, 30 insertions(+), 27 deletions(-)

diff --git a/xen/Rules.mk b/xen/Rules.mk
index 07ff563..15dcedc 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -58,7 +58,6 @@ CFLAGS-$(perfc_arrays)  += -DPERF_ARRAYS
 CFLAGS-$(lock_profile)  += -DLOCK_PROFILE
 CFLAGS-$(HAS_ACPI)      += -DHAS_ACPI
 CFLAGS-$(HAS_GDBSX)     += -DHAS_GDBSX
-CFLAGS-$(HAS_DEVICE_TREE) += -DHAS_DEVICE_TREE
 CFLAGS-$(HAS_MEM_ACCESS)  += -DHAS_MEM_ACCESS
 CFLAGS-$(HAS_MEM_PAGING)  += -DHAS_MEM_PAGING
 CFLAGS-$(HAS_MEM_SHARING) += -DHAS_MEM_SHARING
diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index a6cc685..0c49d94 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -16,6 +16,7 @@ config ARM_64
 
 config ARM
 	def_bool y
+	select HAS_DEVICE_TREE
 	select HAS_PASSTHROUGH
 
 config ARCH_DEFCONFIG
diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk
index 86d7b81..4725374 100644
--- a/xen/arch/arm/Rules.mk
+++ b/xen/arch/arm/Rules.mk
@@ -6,7 +6,6 @@
 # 'make clean' before rebuilding.
 #
 
-HAS_DEVICE_TREE := y
 HAS_VIDEO := y
 HAS_ARM_HDLCD := y
 HAS_PDX := y
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 0251856..53ca33f 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -1,4 +1,8 @@
 
 menu "Common Features"
 
+# Select HAS_DEVICE_TREE if device tree is supported
+config HAS_DEVICE_TREE
+	bool
+
 endmenu
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 3547c8e..5dc2bb2 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -2,7 +2,7 @@ obj-y += bitmap.o
 obj-$(HAS_CORE_PARKING) += core_parking.o
 obj-y += cpu.o
 obj-y += cpupool.o
-obj-$(HAS_DEVICE_TREE) += device_tree.o
+obj-$(CONFIG_HAS_DEVICE_TREE) += device_tree.o
 obj-y += domctl.o
 obj-y += domain.o
 obj-y += event_2l.o
@@ -70,4 +70,4 @@ subdir-$(x86_64) += hvm
 subdir-$(coverage) += gcov
 
 subdir-y += libelf
-subdir-$(HAS_DEVICE_TREE) += libfdt
+subdir-$(CONFIG_HAS_DEVICE_TREE) += libfdt
diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index d443880..bd524e6 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -24,7 +24,7 @@
 #include <xen/8250-uart.h>
 #include <xen/vmap.h>
 #include <asm/io.h>
-#ifdef HAS_DEVICE_TREE
+#ifdef CONFIG_HAS_DEVICE_TREE
 #include <asm/device.h>
 #endif
 #ifdef CONFIG_X86
@@ -1123,7 +1123,7 @@ void __init ns16550_init(int index, struct ns16550_defaults *defaults)
     ns16550_parse_port_config(uart, (index == 0) ? opt_com1 : opt_com2);
 }
 
-#ifdef HAS_DEVICE_TREE
+#ifdef CONFIG_HAS_DEVICE_TREE
 static int __init ns16550_uart_dt_init(struct dt_device_node *dev,
                                        const void *data)
 {
@@ -1198,7 +1198,7 @@ DT_DEVICE_START(ns16550, "NS16550 UART", DEVICE_SERIAL)
         .init = ns16550_uart_dt_init,
 DT_DEVICE_END
 
-#endif /* HAS_DEVICE_TREE */
+#endif /* CONFIG_HAS_DEVICE_TREE */
 /*
  * Local variables:
  * mode: C
diff --git a/xen/drivers/passthrough/Makefile b/xen/drivers/passthrough/Makefile
index 16e9027..2bb5afb 100644
--- a/xen/drivers/passthrough/Makefile
+++ b/xen/drivers/passthrough/Makefile
@@ -6,4 +6,4 @@ subdir-$(arm) += arm
 obj-y += iommu.o
 obj-$(x86) += io.o
 obj-$(HAS_PCI) += pci.o
-obj-$(HAS_DEVICE_TREE) += device_tree.o
+obj-$(CONFIG_HAS_DEVICE_TREE) += device_tree.o
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 3e55abf..3359330 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -346,7 +346,7 @@ int iommu_do_domctl(
     ret = iommu_do_pci_domctl(domctl, d, u_domctl);
 #endif
 
-#ifdef HAS_DEVICE_TREE
+#ifdef CONFIG_HAS_DEVICE_TREE
     if ( ret == -ENODEV )
         ret = iommu_do_dt_domctl(domctl, d, u_domctl);
 #endif
diff --git a/xen/include/asm-arm/device.h b/xen/include/asm-arm/device.h
index 5d0a4cd..b455bdf 100644
--- a/xen/include/asm-arm/device.h
+++ b/xen/include/asm-arm/device.h
@@ -16,7 +16,7 @@ struct dev_archdata {
 struct device
 {
     enum device_type type;
-#ifdef HAS_DEVICE_TREE
+#ifdef CONFIG_HAS_DEVICE_TREE
     struct dt_device_node *of_node; /* Used by drivers imported from Linux */
 #endif
     struct dev_archdata archdata;
diff --git a/xen/include/xen/hvm/iommu.h b/xen/include/xen/hvm/iommu.h
index 106e08f..c817eec 100644
--- a/xen/include/xen/hvm/iommu.h
+++ b/xen/include/xen/hvm/iommu.h
@@ -29,7 +29,7 @@ struct hvm_iommu {
     /* iommu_ops */
     const struct iommu_ops *platform_ops;
 
-#ifdef HAS_DEVICE_TREE
+#ifdef CONFIG_HAS_DEVICE_TREE
     /* List of DT devices assigned to this domain */
     struct list_head dt_devices;
 #endif
diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index 8f3a20e..fa10a45 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -109,7 +109,7 @@ void iommu_read_msi_from_ire(struct msi_desc *msi_desc, struct msi_msg *msg);
 #define PT_IRQ_TIME_OUT MILLISECS(8)
 #endif /* HAS_PCI */
 
-#ifdef HAS_DEVICE_TREE
+#ifdef CONFIG_HAS_DEVICE_TREE
 #include <xen/device_tree.h>
 
 int iommu_assign_dt_device(struct domain *d, struct dt_device_node *dev);
@@ -120,7 +120,7 @@ int iommu_release_dt_devices(struct domain *d);
 int iommu_do_dt_domctl(struct xen_domctl *, struct domain *,
                        XEN_GUEST_HANDLE_PARAM(xen_domctl_t));
 
-#endif /* HAS_DEVICE_TREE */
+#endif /* CONFIG_HAS_DEVICE_TREE */
 
 struct page_info;
 
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index af0d3bd..fa47daa 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -350,7 +350,7 @@ static XSM_INLINE int xsm_deassign_device(XSM_DEFAULT_ARG struct domain *d, uint
 
 #endif /* CONFIG_HAS_PASSTHROUGH && HAS_PCI */
 
-#if defined(CONFIG_HAS_PASSTHROUGH) && defined(HAS_DEVICE_TREE)
+#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_DEVICE_TREE)
 static XSM_INLINE int xsm_test_assign_dtdevice(XSM_DEFAULT_ARG const char *dtpath)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
@@ -371,7 +371,7 @@ static XSM_INLINE int xsm_deassign_dtdevice(XSM_DEFAULT_ARG struct domain *d,
     return xsm_default_action(action, current->domain, d);
 }
 
-#endif /* CONFIG_HAS_PASSTHROUGH && HAS_DEVICE_TREE */
+#endif /* CONFIG_HAS_PASSTHROUGH && CONFIG_HAS_DEVICE_TREE */
 
 static XSM_INLINE int xsm_resource_plug_core(XSM_DEFAULT_VOID)
 {
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index f09f750..02d66c8 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -121,7 +121,7 @@ struct xsm_operations {
     int (*deassign_device) (struct domain *d, uint32_t machine_bdf);
 #endif
 
-#if defined(CONFIG_HAS_PASSTHROUGH) && defined(HAS_DEVICE_TREE)
+#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_DEVICE_TREE)
     int (*test_assign_dtdevice) (const char *dtpath);
     int (*assign_dtdevice) (struct domain *d, const char *dtpath);
     int (*deassign_dtdevice) (struct domain *d, const char *dtpath);
@@ -490,7 +490,7 @@ static inline int xsm_deassign_device(xsm_default_t def, struct domain *d, uint3
 }
 #endif /* CONFIG_HAS_PASSTHROUGH && HAS_PCI) */
 
-#if defined(CONFIG_HAS_PASSTHROUGH) && defined(HAS_DEVICE_TREE)
+#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_DEVICE_TREE)
 static inline int xsm_assign_dtdevice(xsm_default_t def, struct domain *d,
                                       const char *dtpath)
 {
@@ -509,7 +509,7 @@ static inline int xsm_deassign_dtdevice(xsm_default_t def, struct domain *d,
     return xsm_ops->deassign_dtdevice(d, dtpath);
 }
 
-#endif /* CONFIG_HAS_PASSTHROUGH && HAS_DEVICE_TREE */
+#endif /* CONFIG_HAS_PASSTHROUGH && CONFIG_HAS_DEVICE_TREE */
 
 static inline int xsm_resource_plug_pci (xsm_default_t def, uint32_t machine_bdf)
 {
@@ -740,7 +740,7 @@ extern int xsm_multiboot_policy_init(unsigned long *module_map,
                                      void *(*bootstrap_map)(const module_t *));
 #endif
 
-#ifdef HAS_DEVICE_TREE
+#ifdef CONFIG_HAS_DEVICE_TREE
 extern int xsm_dt_init(void);
 extern int xsm_dt_policy_init(void);
 #endif
@@ -764,7 +764,7 @@ static inline int xsm_multiboot_init (unsigned long *module_map,
 }
 #endif
 
-#ifdef HAS_DEVICE_TREE
+#ifdef CONFIG_HAS_DEVICE_TREE
 static inline int xsm_dt_init(void)
 {
     return 0;
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index ca84ff5..880662f 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -96,7 +96,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, deassign_device);
 #endif
 
-#if defined(CONFIG_HAS_PASSTHROUGH) && defined(HAS_DEVICE_TREE)
+#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_DEVICE_TREE)
     set_to_dummy_if_null(ops, test_assign_dtdevice);
     set_to_dummy_if_null(ops, assign_dtdevice);
     set_to_dummy_if_null(ops, deassign_dtdevice);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 67161b2..0c9ef87 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1279,7 +1279,7 @@ static int flask_deassign_device(struct domain *d, uint32_t machine_bdf)
 }
 #endif /* CONFIG_HAS_PASSTHROUGH && HAS_PCI */
 
-#if defined(CONFIG_HAS_PASSTHROUGH) && defined(HAS_DEVICE_TREE)
+#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_DEVICE_TREE)
 static int flask_test_assign_dtdevice(const char *dtpath)
 {
     u32 rsid;
@@ -1333,7 +1333,7 @@ static int flask_deassign_dtdevice(struct domain *d, const char *dtpath)
     return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__REMOVE_DEVICE,
                                 NULL);
 }
-#endif /* CONFIG_HAS_PASSTHROUGH && HAS_DEVICE_TREE */
+#endif /* CONFIG_HAS_PASSTHROUGH && CONFIG_HAS_DEVICE_TREE */
 
 #ifdef CONFIG_X86
 static int flask_do_mca(void)
@@ -1732,7 +1732,7 @@ static struct xsm_operations flask_ops = {
     .deassign_device = flask_deassign_device,
 #endif
 
-#if defined(CONFIG_HAS_PASSTHROUGH) && defined(HAS_DEVICE_TREE)
+#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_DEVICE_TREE)
     .test_assign_dtdevice = flask_test_assign_dtdevice,
     .assign_dtdevice = flask_assign_dtdevice,
     .deassign_dtdevice = flask_deassign_dtdevice,
diff --git a/xen/xsm/xsm_core.c b/xen/xsm/xsm_core.c
index 0ac6d03..2a74496 100644
--- a/xen/xsm/xsm_core.c
+++ b/xen/xsm/xsm_core.c
@@ -85,7 +85,7 @@ int __init xsm_multiboot_init(unsigned long *module_map,
 }
 #endif
 
-#ifdef HAS_DEVICE_TREE
+#ifdef CONFIG_HAS_DEVICE_TREE
 int __init xsm_dt_init(void)
 {
     int ret = 0;
diff --git a/xen/xsm/xsm_policy.c b/xen/xsm/xsm_policy.c
index 6e0bb78..b60d822 100644
--- a/xen/xsm/xsm_policy.c
+++ b/xen/xsm/xsm_policy.c
@@ -23,7 +23,7 @@
 #include <xen/multiboot.h>
 #endif
 #include <xen/bitops.h>
-#ifdef HAS_DEVICE_TREE
+#ifdef CONFIG_HAS_DEVICE_TREE
 # include <asm/setup.h>
 # include <xen/device_tree.h>
 #endif
@@ -74,7 +74,7 @@ int __init xsm_multiboot_policy_init(unsigned long *module_map,
 }
 #endif
 
-#ifdef HAS_DEVICE_TREE
+#ifdef CONFIG_HAS_DEVICE_TREE
 int __init xsm_dt_policy_init(void)
 {
     struct bootmodule *mod = boot_module_find_by_kind(BOOTMOD_XSM);
-- 
2.4.10

  parent reply	other threads:[~2015-11-11 16:49 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-11 16:49 [PATCHv2] 00/27] Kconfig conversion Doug Goldstein
2015-11-11 16:49 ` [PATCHv2] 01/27] build: import Kbuild/Kconfig from Linux 4.2 Doug Goldstein
2015-11-11 16:49 ` [PATCHv2] 02/27] build: hookup Kconfig build and usage Doug Goldstein
2015-11-11 16:49 ` [PATCHv2] 03/27] build: convert HAS_PASSTHROUGH use to Kconfig Doug Goldstein
2015-11-12 15:48   ` Daniel De Graaf
2015-11-11 16:49 ` Doug Goldstein [this message]
2015-11-12 15:49   ` [PATCHv2] 04/27] build: convert HAS_DEVICE_TREE " Daniel De Graaf
2015-11-11 16:49 ` [PATCHv2] 05/27] build: convert HAS_PCI " Doug Goldstein
2015-11-12 15:50   ` Daniel De Graaf
2015-11-11 16:49 ` [PATCHv2] 06/27] build: convert HAS_NS16550 " Doug Goldstein
2015-11-11 16:49 ` [PATCHv2] 07/27] build: convert HAS_IOPORTS " Doug Goldstein
2015-11-11 16:49 ` [PATCHv2] 08/27] build: convert HAS_ACPI " Doug Goldstein
2015-11-11 16:49 ` [PATCHv2] 09/27] build: convert HAS_VIDEO " Doug Goldstein
2015-11-11 16:50 ` [PATCHv2] 10/27] build: convert HAS_VGA " Doug Goldstein
2015-11-11 16:50 ` [PATCHv2] 11/27] build: convert HAS_CPUFREQ " Doug Goldstein
2015-11-11 16:50 ` [PATCHv2] 12/27] build: convert HAS_GDBSX " Doug Goldstein
2015-11-11 16:50 ` [PATCHv2] 13/27] build: convert HAS_PDX " Doug Goldstein
2015-11-11 16:50 ` [PATCHv2] 14/27] build: convert HAS_KEXEC " Doug Goldstein
2015-11-11 16:50 ` [PATCHv2] 15/27] build: convert HAS_ARM_HDLCD " Doug Goldstein
2015-11-11 16:50 ` [PATCHv2] 16/27] build: convert HAS_CADENCE_UART " Doug Goldstein
2015-11-11 16:50 ` [PATCHv2] 17/27] build: convert HAS_PL011 " Doug Goldstein
2015-11-11 16:50 ` [PATCHv2] 18/27] build: convert HAS_EXYNOS4210 " Doug Goldstein
2015-11-11 16:50 ` [PATCHv2] 19/27] build: convert HAS_OMAP " Doug Goldstein
2015-11-11 16:50 ` [PATCHv2] 20/27] build: convert HAS_SCIF " Doug Goldstein
2015-11-11 16:50 ` [PATCHv2] 21/27] build: convert HAS_EHCI " Doug Goldstein
2015-11-11 16:50 ` [PATCHv2] 22/27] build: convert HAS_MEM_ACCESS " Doug Goldstein
2015-11-12  8:58   ` Razvan Cojocaru
2015-11-12 15:51   ` Daniel De Graaf
2015-11-11 16:50 ` [PATCHv2] 23/27] build: convert HAS_MEM_PAGING " Doug Goldstein
2015-11-12  8:59   ` Razvan Cojocaru
2015-11-12 15:52   ` Daniel De Graaf
2015-11-11 16:50 ` [PATCHv2] 24/27] build: convert HAS_MEM_SHARING " Doug Goldstein
2015-11-12  9:00   ` Razvan Cojocaru
2015-11-12 15:52   ` Daniel De Graaf
2015-11-11 16:50 ` [PATCHv2] 25/27] build: convert HAS_GICV3 " Doug Goldstein
2015-11-11 16:50 ` [PATCHv2] 26/27] build: convert CONFIG_COMPAT " Doug Goldstein
2015-11-11 17:46   ` Andrew Cooper
2015-11-11 16:50 ` [PATCHv2] 27/27] build: convert kexec options to CONFIG_KEXEC Doug Goldstein
2015-11-11 18:01 ` [PATCHv2] 00/27] Kconfig conversion Doug Goldstein

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1447260617-10138-5-git-send-email-cardoe@cardoe.com \
    --to=cardoe@cardoe.com \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=ian.campbell@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=stefano.stabellini@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.