Alper Nebi Yasak has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/80377?usp=email )
Change subject: drivers/qemu/bochs: Clean up #if directives ......................................................................
drivers/qemu/bochs: Clean up #if directives
A previous commit adds io.h stubs for x86-style I/O port functions for other architectures, so we can avoid using #if preprocessor directives to check for x86 in the QEMU Bochs display device driver. Remove them since it's cleaner to use the existing if statements and doing so no longer breaks building.
Change-Id: I783e12f3d60bf8ac872123dd63632020bf88918c Signed-off-by: Alper Nebi Yasak alpernebiyasak@gmail.com --- M src/drivers/emulation/qemu/bochs.c 1 file changed, 2 insertions(+), 14 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/77/80377/1
diff --git a/src/drivers/emulation/qemu/bochs.c b/src/drivers/emulation/qemu/bochs.c index b8a6fa9..6d6422f 100644 --- a/src/drivers/emulation/qemu/bochs.c +++ b/src/drivers/emulation/qemu/bochs.c @@ -1,10 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */
-#if CONFIG(CPU_QEMU_X86) #include <arch/io.h> -#else -#include <arch/mmio.h> -#endif #include <console/console.h> #include <device/device.h> #include <device/mmio.h> @@ -49,10 +45,8 @@ static void bochs_write(struct resource *res, int index, int val) { if (res->flags & IORESOURCE_IO) { -#if CONFIG(CPU_QEMU_X86) outw(index, res->base); outw(val, res->base + 1); -#endif } else { write16(res2mmio(res, 0x500 + index * 2, 0), val); } @@ -61,12 +55,8 @@ static int bochs_read(struct resource *res, int index) { if (res->flags & IORESOURCE_IO) { -#if CONFIG(CPU_QEMU_X86) outw(index, res->base); return inw(res->base + 1); -#else - return 0; -#endif } else { return read16(res2mmio(res, 0x500 + index * 2, 0)); } @@ -74,11 +64,9 @@
static void bochs_vga_write(struct resource *res, int index, uint8_t val) { - if (res->flags & IORESOURCE_IO) { -#if CONFIG(CPU_QEMU_X86) + if (res->flags & IORESOURCE_IO) outb(val, index + 0x3c0); -#endif - } else + else write8(res2mmio(res, 0x400 + index, 0), val); }