[coreboot] [PATCH]: Fix memset calling error
Bao, Zheng
Zheng.Bao at amd.com
Fri Mar 19 08:32:51 CET 2010
The parameters of memset() should be
memset(addr, value, size), right?
It is an obvious bug created at r5201. I am wondering
why it doesnt trouble you. I took a quike look at other
files and didnt find other calling error.
Signed-off-by: Zheng Bao <zheng.bao at amd.com>
Index: src/cpu/amd/model_fxx/model_fxx_init.c
===================================================================
--- src/cpu/amd/model_fxx/model_fxx_init.c (revision 5260)
+++ src/cpu/amd/model_fxx/model_fxx_init.c (working copy)
@@ -238,7 +238,7 @@
/* clear memory 2M (limitk - basek) */
addr = (void *)(((uint32_t)addr) | ((basek & 0x7ff) <<
10));
- memset(addr, size, 0);
+ memset(addr, 0, size);
}
static void init_ecc_memory(unsigned node_id)
Index: src/cpu/amd/car/post_cache_as_ram.c
===================================================================
--- src/cpu/amd/car/post_cache_as_ram.c (revision 5260)
+++ src/cpu/amd/car/post_cache_as_ram.c (working copy)
@@ -95,9 +95,9 @@
print_debug("Clearing initial memory region: ");
#if CONFIG_HAVE_ACPI_RESUME == 1
/* clear only coreboot used region of memory. Note: this may
break ECC enabled boards */
- memset((void*) CONFIG_RAMBASE, (CONFIG_RAMTOP) - CONFIG_RAMBASE
- CONFIG_DCACHE_RAM_SIZE, 0);
+ memset((void*) CONFIG_RAMBASE, 0, (CONFIG_RAMTOP) -
CONFIG_RAMBASE - CONFIG_DCACHE_RAM_SIZE);
#else
- memset((void*)0, ((CONFIG_RAMTOP) - CONFIG_DCACHE_RAM_SIZE), 0);
+ memset((void*)0, 0, ((CONFIG_RAMTOP) - CONFIG_DCACHE_RAM_SIZE));
#endif
print_debug("Done\r\n");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: memset_fix_error.patch
Type: application/octet-stream
Size: 1575 bytes
Desc: memset_fix_error.patch
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20100319/8aa779ed/attachment.obj>
More information about the coreboot
mailing list