From e6e899dde951823ebc9abf997a6af06debac82a3 Mon Sep 17 00:00:00 2001 From: Luc Verhaegen Date: Wed, 27 May 2009 11:39:16 +0000 Subject: util/vgabios: build/warning fixes. Signed-off-by: Luc Verhaegen Acked-by: Stefan Reinauer git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4312 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- util/vgabios/Makefile | 9 ++------- util/vgabios/helper_exec.c | 5 ++++- util/vgabios/helper_exec.h | 2 ++ util/vgabios/helper_mem.c | 6 ++++-- util/vgabios/pci-userspace.c | 5 +++++ util/vgabios/testbios.c | 1 + util/vgabios/x86emu/include/x86emu/regs.h | 6 +++--- util/vgabios/x86emu/src/x86emu/sys.c | 7 ++++--- 8 files changed, 25 insertions(+), 16 deletions(-) create mode 100644 util/vgabios/helper_exec.h (limited to 'util') diff --git a/util/vgabios/Makefile b/util/vgabios/Makefile index 5fadba6ab8..c1359bbdc1 100644 --- a/util/vgabios/Makefile +++ b/util/vgabios/Makefile @@ -7,11 +7,7 @@ # CC = gcc -CFLAGS = -Wall -Ix86emu/include -O2 -g \ - -DLIBPCI_MAJOR_VERSION=2 \ - -DLIBPCI_MINOR_VERSION=1 \ - -DLIBPCI_MICRO_VERSION=11 - +CFLAGS = -Wall -Ix86emu/include -O2 -g INTOBJS = int10.o int15.o int16.o int1a.o inte6.o OBJECTS = testbios.o helper_exec.o helper_mem.o $(INTOBJS) @@ -20,12 +16,11 @@ LIBS = x86emu/src/x86emu/libx86emu.a # user space pci is the only option right now. OBJECTS += pci-userspace.o -LIBS += /usr/lib/libpci.a all: testbios testbios: $(OBJECTS) $(LIBS) - $(CC) -o testbios $(OBJECTS) $(LIBS) + $(CC) -o testbios $(OBJECTS) $(LIBS) -lpci helper_exec.o: helper_exec.c test.h diff --git a/util/vgabios/helper_exec.c b/util/vgabios/helper_exec.c index 8d18798c40..3ec2c2362b 100644 --- a/util/vgabios/helper_exec.c +++ b/util/vgabios/helper_exec.c @@ -15,9 +15,12 @@ * on PIO. */ #include +#include "helper_exec.h" #include "test.h" -#include +#include #include +#include + int port_rep_inb(u16 port, u32 base, int d_f, u32 count); u8 x_inb(u16 port); diff --git a/util/vgabios/helper_exec.h b/util/vgabios/helper_exec.h new file mode 100644 index 0000000000..2657b6e6f5 --- /dev/null +++ b/util/vgabios/helper_exec.h @@ -0,0 +1,2 @@ +u32 getIntVect(int num); +int run_bios_int(int num); diff --git a/util/vgabios/helper_mem.c b/util/vgabios/helper_mem.c index be53598b03..50a303b45e 100644 --- a/util/vgabios/helper_mem.c +++ b/util/vgabios/helper_mem.c @@ -4,6 +4,8 @@ * execute BIOS int 10h calls in x86 real mode environment * Copyright 1999 Egbert Eich */ +#include + #define _INT10_PRIVATE #define REG pInt @@ -35,7 +37,7 @@ void dprint(unsigned long start, unsigned long size) printf("%2.2x ", (unsigned char) (*(c++))); c = d; for (i = 0; i < 16; i++) { - printf("%c", ((((u8) (*c)) > 32) && (((u8) (*c)) < 128)) ? + printf("%c", ((((unsigned char) (*c)) > 32) && (((unsigned char) (*c)) < 128)) ? (unsigned char) (*(c)) : '.'); c++; } @@ -122,7 +124,7 @@ void reset_int_vect(void) * 64kB. Note that because this data doesn't survive POST, int 0x42 should * only be used during EGA/VGA BIOS initialisation. */ - static const u8 VideoParms[] = { + static const unsigned char VideoParms[] = { /* Timing for modes 0x00 & 0x01 */ 0x38, 0x28, 0x2d, 0x0a, 0x1f, 0x06, 0x19, 0x1c, 0x02, 0x07, 0x06, 0x07, 0x00, 0x00, 0x00, 0x00, diff --git a/util/vgabios/pci-userspace.c b/util/vgabios/pci-userspace.c index 7578e6f4a8..bc71a61594 100644 --- a/util/vgabios/pci-userspace.c +++ b/util/vgabios/pci-userspace.c @@ -2,11 +2,16 @@ #include #include "pci.h" +#ifdef PCI_LIB_VERSION +#define LIBPCI_CHECK_VERSION(major,minor,micro) \ + ((((major) << 16) | ((minor) << 8) | (micro)) <= PCI_LIB_VERSION) +#else #define LIBPCI_CHECK_VERSION(major,minor,micro) \ ( (LIBPCI_MAJOR_VERSION > (major)) || \ (LIBPCI_MAJOR_VERSION == (major) && LIBPCI_MINOR_VERSION > (minor)) || \ (LIBPCI_MAJOR_VERSION == (major) && LIBPCI_MINOR_VERSION == (minor)) && \ LIBPCI_MICRO_VERSION >= (micro) ) +#endif #define PCITAG struct pci_filter * diff --git a/util/vgabios/testbios.c b/util/vgabios/testbios.c index 06f6109516..e38315afd2 100644 --- a/util/vgabios/testbios.c +++ b/util/vgabios/testbios.c @@ -11,6 +11,7 @@ #define warn(x) { perror(x); } #include +#include "helper_exec.h" #include "test.h" #include "pci-userspace.h" diff --git a/util/vgabios/x86emu/include/x86emu/regs.h b/util/vgabios/x86emu/include/x86emu/regs.h index 726b7ac6f0..e77c56435b 100755 --- a/util/vgabios/x86emu/include/x86emu/regs.h +++ b/util/vgabios/x86emu/include/x86emu/regs.h @@ -300,9 +300,9 @@ private - private data pointer x86 - X86 registers ****************************************************************************/ typedef struct { - unsigned long mem_base; - unsigned long mem_size; - unsigned long abseg; + void * mem_base; + unsigned int mem_size; + void * abseg; void* private; X86EMU_regs x86; } X86EMU_sysEnv; diff --git a/util/vgabios/x86emu/src/x86emu/sys.c b/util/vgabios/x86emu/src/x86emu/sys.c index ae4c5daba3..695c87a43b 100644 --- a/util/vgabios/x86emu/src/x86emu/sys.c +++ b/util/vgabios/x86emu/src/x86emu/sys.c @@ -50,6 +50,7 @@ #include "xf86_ansic.h" #else #include +#include #endif /*------------------------- Global Variables ------------------------------*/ @@ -186,7 +187,7 @@ u8 *mem_ptr(u32 addr, int size) u8 *retaddr = 0; if (addr > M.mem_size - size) { - DB(printk("mem_ptr: address %#lx out of range!\n", addr); + DB(printk("mem_ptr: address %#x out of range!\n", addr); ) HALT_SYS(); } @@ -596,11 +597,11 @@ void X86EMU_prepareForInt(int num) void X86EMU_setMemBase(void *base, size_t size) { - M.mem_base = (int) base; + M.mem_base = base; M.mem_size = size; } void X86EMU_setabseg(void *abseg) { - M.abseg = (unsigned long) abseg; + M.abseg = abseg; } -- cgit v1.2.3