util/vgabios: build/warning fixes.

Signed-off-by: Luc Verhaegen <libv@skynet.be>
Acked-by: Stefan Reinauer <stepan@coresystems.de>

git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4312 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Luc Verhaegen 2009-05-27 11:39:16 +00:00
parent bab4f92c8b
commit e6e899dde9
8 changed files with 25 additions and 16 deletions

View File

@ -7,11 +7,7 @@
# #
CC = gcc CC = gcc
CFLAGS = -Wall -Ix86emu/include -O2 -g \ CFLAGS = -Wall -Ix86emu/include -O2 -g
-DLIBPCI_MAJOR_VERSION=2 \
-DLIBPCI_MINOR_VERSION=1 \
-DLIBPCI_MICRO_VERSION=11
INTOBJS = int10.o int15.o int16.o int1a.o inte6.o INTOBJS = int10.o int15.o int16.o int1a.o inte6.o
OBJECTS = testbios.o helper_exec.o helper_mem.o $(INTOBJS) 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. # user space pci is the only option right now.
OBJECTS += pci-userspace.o OBJECTS += pci-userspace.o
LIBS += /usr/lib/libpci.a
all: testbios all: testbios
testbios: $(OBJECTS) $(LIBS) testbios: $(OBJECTS) $(LIBS)
$(CC) -o testbios $(OBJECTS) $(LIBS) $(CC) -o testbios $(OBJECTS) $(LIBS) -lpci
helper_exec.o: helper_exec.c test.h helper_exec.o: helper_exec.c test.h

View File

@ -15,9 +15,12 @@
* on PIO. * on PIO.
*/ */
#include <x86emu.h> #include <x86emu.h>
#include "helper_exec.h"
#include "test.h" #include "test.h"
#include <asm/io.h> #include <sys/io.h>
#include <sys/time.h> #include <sys/time.h>
#include <stdio.h>
int port_rep_inb(u16 port, u32 base, int d_f, u32 count); int port_rep_inb(u16 port, u32 base, int d_f, u32 count);
u8 x_inb(u16 port); u8 x_inb(u16 port);

View File

@ -0,0 +1,2 @@
u32 getIntVect(int num);
int run_bios_int(int num);

View File

@ -4,6 +4,8 @@
* execute BIOS int 10h calls in x86 real mode environment * execute BIOS int 10h calls in x86 real mode environment
* Copyright 1999 Egbert Eich * Copyright 1999 Egbert Eich
*/ */
#include <stdio.h>
#define _INT10_PRIVATE #define _INT10_PRIVATE
#define REG pInt #define REG pInt
@ -35,7 +37,7 @@ void dprint(unsigned long start, unsigned long size)
printf("%2.2x ", (unsigned char) (*(c++))); printf("%2.2x ", (unsigned char) (*(c++)));
c = d; c = d;
for (i = 0; i < 16; i++) { 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)) : '.'); (unsigned char) (*(c)) : '.');
c++; c++;
} }
@ -122,7 +124,7 @@ void reset_int_vect(void)
* 64kB. Note that because this data doesn't survive POST, int 0x42 should * 64kB. Note that because this data doesn't survive POST, int 0x42 should
* only be used during EGA/VGA BIOS initialisation. * only be used during EGA/VGA BIOS initialisation.
*/ */
static const u8 VideoParms[] = { static const unsigned char VideoParms[] = {
/* Timing for modes 0x00 & 0x01 */ /* Timing for modes 0x00 & 0x01 */
0x38, 0x28, 0x2d, 0x0a, 0x1f, 0x06, 0x19, 0x1c, 0x38, 0x28, 0x2d, 0x0a, 0x1f, 0x06, 0x19, 0x1c,
0x02, 0x07, 0x06, 0x07, 0x00, 0x00, 0x00, 0x00, 0x02, 0x07, 0x06, 0x07, 0x00, 0x00, 0x00, 0x00,

View File

@ -2,11 +2,16 @@
#include <pci/pci.h> #include <pci/pci.h>
#include "pci.h" #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) \ #define LIBPCI_CHECK_VERSION(major,minor,micro) \
( (LIBPCI_MAJOR_VERSION > (major)) || \ ( (LIBPCI_MAJOR_VERSION > (major)) || \
(LIBPCI_MAJOR_VERSION == (major) && LIBPCI_MINOR_VERSION > (minor)) || \ (LIBPCI_MAJOR_VERSION == (major) && LIBPCI_MINOR_VERSION > (minor)) || \
(LIBPCI_MAJOR_VERSION == (major) && LIBPCI_MINOR_VERSION == (minor)) && \ (LIBPCI_MAJOR_VERSION == (major) && LIBPCI_MINOR_VERSION == (minor)) && \
LIBPCI_MICRO_VERSION >= (micro) ) LIBPCI_MICRO_VERSION >= (micro) )
#endif
#define PCITAG struct pci_filter * #define PCITAG struct pci_filter *

View File

@ -11,6 +11,7 @@
#define warn(x) { perror(x); } #define warn(x) { perror(x); }
#include <x86emu.h> #include <x86emu.h>
#include "helper_exec.h"
#include "test.h" #include "test.h"
#include "pci-userspace.h" #include "pci-userspace.h"

View File

@ -300,9 +300,9 @@ private - private data pointer
x86 - X86 registers x86 - X86 registers
****************************************************************************/ ****************************************************************************/
typedef struct { typedef struct {
unsigned long mem_base; void * mem_base;
unsigned long mem_size; unsigned int mem_size;
unsigned long abseg; void * abseg;
void* private; void* private;
X86EMU_regs x86; X86EMU_regs x86;
} X86EMU_sysEnv; } X86EMU_sysEnv;

View File

@ -50,6 +50,7 @@
#include "xf86_ansic.h" #include "xf86_ansic.h"
#else #else
#include <string.h> #include <string.h>
#include <stdio.h>
#endif #endif
/*------------------------- Global Variables ------------------------------*/ /*------------------------- Global Variables ------------------------------*/
@ -186,7 +187,7 @@ u8 *mem_ptr(u32 addr, int size)
u8 *retaddr = 0; u8 *retaddr = 0;
if (addr > M.mem_size - size) { 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(); HALT_SYS();
} }
@ -596,11 +597,11 @@ void X86EMU_prepareForInt(int num)
void X86EMU_setMemBase(void *base, size_t size) void X86EMU_setMemBase(void *base, size_t size)
{ {
M.mem_base = (int) base; M.mem_base = base;
M.mem_size = size; M.mem_size = size;
} }
void X86EMU_setabseg(void *abseg) void X86EMU_setabseg(void *abseg)
{ {
M.abseg = (unsigned long) abseg; M.abseg = abseg;
} }