properzero.diff changes the memset to only clean up the area which is

not memcopied to.

Signed-off-by: Alex Beregszaszi <alex@rtfs.hu>
Acked-by: Stefan Reinauer <stepan@coresystems.de>


git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@490 f3766cd6-281f-0410-b1cd-43a5c92072e9
This commit is contained in:
Stefan Reinauer 2007-09-05 01:54:28 +00:00
commit da78aab7d6

View file

@ -112,16 +112,13 @@ static int load_elf_segments(struct lb_memory *mem,unsigned char *header, int he
/* Verify the memory addresses in the segment are valid */
if (!valid_area(mem, phdr[i].p_paddr, size))
goto out;
/* let's just be stupid about this. Bzero the whole area we are copying to,
* then copy out the data, which may be a subset of the total area.
* the cache, after all, is your friend.
*/
printk(BIOS_INFO, "Set %p to 0 for %d bytes\n", (unsigned char *)phdr[i].p_paddr, phdr[i].p_memsz);
memset((unsigned char *)phdr[i].p_paddr, 0, phdr[i].p_memsz);
/* ok, copy it out */
printk(BIOS_INFO, "Copy to %p from %p for %d bytes\n", (unsigned char *)phdr[i].p_paddr, &header[phdr[i].p_offset], size);
memcpy((unsigned char *)phdr[i].p_paddr, &header[phdr[i].p_offset], size);
if (size < phdr[i].p_memsz) {
printk(BIOS_INFO, "Set %p to 0 for %d bytes\n", (unsigned char *)phdr[i].p_paddr, phdr[i].p_memsz-size);
memset((unsigned char *)phdr[i].p_paddr+size, 0, phdr[i].p_memsz-size);
}
}
return 1;
out: