diff --git a/arch/x86/stage1.c b/arch/x86/stage1.c index 5753d9846f..9c7f3a95ec 100644 --- a/arch/x86/stage1.c +++ b/arch/x86/stage1.c @@ -56,14 +56,13 @@ static void enable_rom(void) int legacy(struct mem_file *archive, char *name, void *where, struct lb_memory *mem) { int ret; - struct mem_file result; int elfboot_mem(struct lb_memory *mem, void *where, int size); ret = copy_file(archive, name, where); if (ret) { printk(BIOS_ERR, "'%s' found, but could not load it.\n", name); } - ret = elfboot_mem(mem, where, result.reallen); + ret = elfboot_mem(mem, where, archive->reallen); printk(BIOS_ERR, "elfboot_mem returns %d\n", ret); return -1; diff --git a/device/pci_device.c b/device/pci_device.c index 1ed1226f3a..dc2e52da28 100644 --- a/device/pci_device.c +++ b/device/pci_device.c @@ -661,7 +661,7 @@ void pci_dev_init(struct device *dev) ram = pci_rom_load(dev, rom); if (ram == NULL) return; - run_bios(dev, ram); + run_bios(dev, (unsigned long)ram); #endif } diff --git a/lib/lar.c b/lib/lar.c index 92a1daa1e8..fd079619b5 100644 --- a/lib/lar.c +++ b/lib/lar.c @@ -107,8 +107,8 @@ int find_file(struct mem_file *archive, const char *filename, struct mem_file *r result->len = ntohl(header->len); result->reallen = ntohl(header->reallen); result->compression = ntohl(header->compression); - result->entry = (void *)ntohl(header->entry); - result->loadaddress = (void *)ntohl(header->loadaddress); + result->entry = (void *)ntohl((u32)header->entry); + result->loadaddress = (void *)ntohl((u32)header->loadaddress); printk(BIOS_SPEW, "start %p len %d reallen %d compression %x entry %p loadaddress %p\n", result->start, result->len, result->reallen, diff --git a/util/lar/stream.c b/util/lar/stream.c index fd787acb4c..15d48665cc 100644 --- a/util/lar/stream.c +++ b/util/lar/stream.c @@ -79,7 +79,7 @@ int output_elf_segments(struct lar *lar, char *name, char *filebuf, u32 entry; int i; int size; - unsigned char *header; + char *header; char ename[64]; int headers; char *temp; @@ -101,7 +101,7 @@ int output_elf_segments(struct lar *lar, char *name, char *filebuf, /* validate elf header */ ehdr = (Elf32_Ehdr *)filebuf; headers = ehdr->e_phnum; - header = (unsigned char *)ehdr; + header = (char *)ehdr; if (verbose()) fprintf(stderr, "Type %d machine %d version %d entry %p phoff %d shoff %d flags %#x hsize %d phentsize %d phnum %d s_hentsize %d s_shnum %d \n", ehdr->e_type,