[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [RFC 09/29] build: convert HAS_IOPORTS use to Kconfig



Use the Kconfig generated CONFIG_HAS_IOPORTS defines in the code base.

Signed-off-by: Doug Goldstein <cardoe@xxxxxxxxxx>
---
 xen/Rules.mk               |  1 -
 xen/arch/x86/Kconfig       |  1 +
 xen/arch/x86/Rules.mk      |  1 -
 xen/drivers/char/Kconfig   |  5 +++++
 xen/drivers/char/ns16550.c | 10 +++++-----
 5 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/xen/Rules.mk b/xen/Rules.mk
index 2dcd102..fb1b256 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -61,7 +61,6 @@ CFLAGS-$(HAS_GDBSX)     += -DHAS_GDBSX
 CFLAGS-$(HAS_MEM_ACCESS)  += -DHAS_MEM_ACCESS
 CFLAGS-$(HAS_MEM_PAGING)  += -DHAS_MEM_PAGING
 CFLAGS-$(HAS_MEM_SHARING) += -DHAS_MEM_SHARING
-CFLAGS-$(HAS_IOPORTS)   += -DHAS_IOPORTS
 CFLAGS-$(HAS_PDX)       += -DHAS_PDX
 CFLAGS-$(frame_pointer) += -fno-omit-frame-pointer -DCONFIG_FRAME_POINTER
 
diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index 7296fbb..ba1e2f2 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -16,6 +16,7 @@ config X86_64
 
 config X86
        def_bool y
+       select HAS_IOPORTS
        select HAS_PASSTHROUGH
        select HAS_PCI
        select HAS_NS16550
diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk
index ae2929d..5fb4ff7 100644
--- a/xen/arch/x86/Rules.mk
+++ b/xen/arch/x86/Rules.mk
@@ -1,7 +1,6 @@
 ########################################
 # x86-specific definitions
 
-HAS_IOPORTS := y
 HAS_ACPI := y
 HAS_VGA  := y
 HAS_VIDEO  := y
diff --git a/xen/drivers/char/Kconfig b/xen/drivers/char/Kconfig
index ca7924f..09cb79f 100644
--- a/xen/drivers/char/Kconfig
+++ b/xen/drivers/char/Kconfig
@@ -2,3 +2,8 @@
 # Select HAS_NS16550 if a 16550 UART is supported
 config HAS_NS16550
        bool
+
+# Select HAS_IOPORTS if 16550 has I/O ports
+config HAS_IOPORTS
+       bool
+       depends on HAS_NS16550
diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 615124c..98b660a 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -348,7 +348,7 @@ static void ns16550_delayed_resume(void *data);
 static char ns_read_reg(struct ns16550 *uart, int reg)
 {
     void __iomem *addr = uart->remapped_io_base + (reg << uart->reg_shift);
-#ifdef HAS_IOPORTS
+#ifdef CONFIG_HAS_IOPORTS
     if ( uart->remapped_io_base == NULL )
         return inb(uart->io_base + reg);
 #endif
@@ -366,7 +366,7 @@ static char ns_read_reg(struct ns16550 *uart, int reg)
 static void ns_write_reg(struct ns16550 *uart, int reg, char c)
 {
     void __iomem *addr = uart->remapped_io_base + (reg << uart->reg_shift);
-#ifdef HAS_IOPORTS
+#ifdef CONFIG_HAS_IOPORTS
     if ( uart->remapped_io_base == NULL )
         return outb(c, uart->io_base + reg);
 #endif
@@ -546,7 +546,7 @@ static void __init ns16550_init_preirq(struct serial_port 
*port)
 {
     struct ns16550 *uart = port->uart;
 
-#ifdef HAS_IOPORTS
+#ifdef CONFIG_HAS_IOPORTS
     /* I/O ports are distinguished by their size (16 bits). */
     if ( uart->io_base >= 0x10000 )
 #endif
@@ -716,7 +716,7 @@ static void ns16550_resume(struct serial_port *port)
 
 static void __init ns16550_endboot(struct serial_port *port)
 {
-#ifdef HAS_IOPORTS
+#ifdef CONFIG_HAS_IOPORTS
     struct ns16550 *uart = port->uart;
     int rv;
 
@@ -780,7 +780,7 @@ static int __init check_existence(struct ns16550 *uart)
 {
     unsigned char status, scratch, scratch2, scratch3;
 
-#ifdef HAS_IOPORTS
+#ifdef CONFIG_HAS_IOPORTS
     /*
      * We can't poke MMIO UARTs until they get I/O remapped later. Assume that
      * if we're getting MMIO UARTs, the arch code knows what it's doing.
-- 
2.4.9


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.