From 91f1423cac0460ab79492a9c167765359b9dd3e2 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Fri, 7 Dec 2012 16:55:12 -0800 Subject: Fix Yabel compilation on non-x86 platforms Mostly preventing inb/outb being used on non-x86 Change-Id: I0434df4ce477c262337672867dc6ce398ff95279 Signed-off-by: Stefan Reinauer Reviewed-on: http://review.coreboot.org/2002 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich --- src/device/oprom/yabel/io.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/device/oprom/yabel/io.c') diff --git a/src/device/oprom/yabel/io.c b/src/device/oprom/yabel/io.c index 5c19b5142c..d1172dc743 100644 --- a/src/device/oprom/yabel/io.c +++ b/src/device/oprom/yabel/io.c @@ -17,6 +17,7 @@ #include "device.h" #include "debug.h" #include +#include #include "io.h" #if CONFIG_PCI_OPTION_ROM_RUN_YABEL @@ -74,6 +75,9 @@ inl(u16 port) HALT_SYS(); return 0; } + +#ifndef CONFIG_PCI +#endif #endif #if CONFIG_YABEL_DIRECTHW @@ -136,13 +140,13 @@ read_io(void *addr, size_t sz) switch (sz) { case 1: - asm volatile ("inb %1, %b0" : "=a"(ret) : "d" (port)); + ret = inb(port); break; case 2: - asm volatile ("inw %1, %w0" : "=a"(ret) : "d" (port)); + ret = inw(port); break; case 4: - asm volatile ("inl %1, %0" : "=a"(ret) : "d" (port)); + ret = inl(port); break; default: ret = 0; @@ -158,13 +162,13 @@ write_io(void *addr, unsigned int value, size_t sz) switch (sz) { /* since we are using inb instructions, we need the port number as 16bit value */ case 1: - asm volatile ("outb %b0, %1" : : "a"(value), "d" (port)); + outb(value, port); break; case 2: - asm volatile ("outw %w0, %1" : : "a"(value), "d" (port)); + outw(value, port); break; case 4: - asm volatile ("outl %0, %1" : : "a"(value), "d" (port)); + outl(value, port); break; default: return -1; -- cgit v1.2.3