summaryrefslogtreecommitdiff
path: root/src/devices/pci_rom.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/pci_rom.c')
-rw-r--r--src/devices/pci_rom.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/devices/pci_rom.c b/src/devices/pci_rom.c
index d47a7e3f51..1b7e4bffa8 100644
--- a/src/devices/pci_rom.c
+++ b/src/devices/pci_rom.c
@@ -26,6 +26,7 @@
#include <device/pci.h>
#include <device/pci_ids.h>
#include <device/pci_ops.h>
+#include <string.h>
struct rom_header * pci_rom_probe(struct device *dev)
{
@@ -62,7 +63,7 @@ struct rom_header * pci_rom_probe(struct device *dev)
return NULL;
}
- rom_data = (unsigned char *) rom_header + le32_to_cpu(rom_header->data);
+ rom_data = (struct pci_data *) ((void *)rom_header + le32_to_cpu(rom_header->data));
printk_spew("PCI ROM Image, Vendor %04x, Device %04x,\n",
rom_data->vendor, rom_data->device);
if (dev->vendor != rom_data->vendor || dev->device != rom_data->device) {
@@ -95,8 +96,8 @@ struct rom_header *pci_rom_load(struct device *dev, struct rom_header *rom_heade
rom_address = pci_read_config32(dev, PCI_ROM_ADDRESS);
do {
- rom_header = (unsigned char *) rom_header + image_size; // get next image
- rom_data = (unsigned char *) rom_header + le32_to_cpu(rom_header->data);
+ rom_header = (struct rom_header *)((void *) rom_header + image_size); // get next image
+ rom_data = (struct pci_data *)((void *) rom_header + le32_to_cpu(rom_header->data));
image_size = le32_to_cpu(rom_data->ilen) * 512;
} while ((rom_data->type!=0) && (rom_data->indicator!=0)); // make sure we got x86 version
@@ -111,7 +112,7 @@ struct rom_header *pci_rom_load(struct device *dev, struct rom_header *rom_heade
#endif
printk_debug("copying VGA ROM Image from 0x%x to 0x%x, 0x%x bytes\n",
rom_header, PCI_VGA_RAM_IMAGE_START, rom_size);
- memcpy(PCI_VGA_RAM_IMAGE_START, rom_header, rom_size);
+ memcpy((void *)PCI_VGA_RAM_IMAGE_START, rom_header, rom_size);
return (struct rom_header *) (PCI_VGA_RAM_IMAGE_START);
} else {
printk_debug("copying non-VGA ROM Image from 0x%x to 0x%x, 0x%x bytes\n",