summaryrefslogtreecommitdiff
path: root/xc/programs/Xserver/hw/xfree86/int10/pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'xc/programs/Xserver/hw/xfree86/int10/pci.c')
-rw-r--r--xc/programs/Xserver/hw/xfree86/int10/pci.c30
1 files changed, 11 insertions, 19 deletions
diff --git a/xc/programs/Xserver/hw/xfree86/int10/pci.c b/xc/programs/Xserver/hw/xfree86/int10/pci.c
index 262e095cf..9b523ae82 100644
--- a/xc/programs/Xserver/hw/xfree86/int10/pci.c
+++ b/xc/programs/Xserver/hw/xfree86/int10/pci.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/pci.c,v 1.5 2000/12/02 15:31:01 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/pci.c,v 1.6 2001/01/06 20:19:13 tsi Exp $ */
/*
* XFree86 int10 module
@@ -7,7 +7,6 @@
*/
#include "xf86Pci.h"
#include "xf86.h"
-#include "xf86str.h"
#include "xf86_ansic.h"
#define _INT10_PRIVATE
#include "xf86int10.h"
@@ -18,7 +17,7 @@ mapPciRom(xf86Int10InfoPtr pInt, unsigned char * address)
PCITAG tag;
unsigned long offset = 0;
unsigned char *mem, *ptr;
- int length, rlength, blength;
+ int length;
pciVideoPtr pvp = xf86GetPciInfoForEntity(pInt->entityIndex);
@@ -30,25 +29,18 @@ mapPciRom(xf86Int10InfoPtr pInt, unsigned char * address)
}
tag = pciTag(pvp->bus,pvp->device,pvp->func);
- rlength = blength = 1 << pvp->biosSize;
+ length = 1 << pvp->biosSize;
- /* Read in entire PCI ROM in 64kB chunks */
- mem = ptr = xnfcalloc(blength, 1);
- while ((length = rlength) > 0) {
- if (length > 0x10000) length = 0x10000;
- if (xf86ReadPciBIOS(offset, tag, -1, ptr, length) < length) {
- xfree(mem);
+ /* Read in entire PCI ROM */
+ mem = ptr = xnfcalloc(length, 1);
+ if (xf86ReadPciBIOS(offset, tag, -1, ptr, length) < length) {
+ xfree(mem);
#ifdef DEBUG
- ErrorF("mapPciRom: cannot read BIOS\n");
+ ErrorF("mapPciRom: cannot read BIOS\n");
#endif
- return 0;
- }
- offset += length;
- rlength -= length;
- ptr += length;
+ return 0;
}
- ptr = mem;
while ((ptr[0] == 0x55) && (ptr[1] == 0xAA)) {
unsigned short data_off = ptr[0x18] | (ptr[0x19] << 8);
unsigned char *data = ptr + data_off;
@@ -63,10 +55,10 @@ mapPciRom(xf86Int10InfoPtr pInt, unsigned char * address)
#ifdef PRINT_PCI
ErrorF("data segment in BIOS: 0x%x, type: 0x%x\n", data_off, type);
#endif
- if (type) { /* not PC-AT image: find next one */
+ if (type) { /* not PC-AT image: find next one */
unsigned int image_length;
unsigned char indicator = data[0x15];
- if (indicator & 0x80) /* last image */
+ if (indicator & 0x80) /* last image */
break;
image_length = (data[0x10] | (data[0x11] << 8)) << 9;
#ifdef PRINT_PCI