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@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");
On 3/19/10 8:32 AM, Bao, Zheng wrote:
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@amd.com
Acked-by: Stefan Reinauer stepan@coresystems.de
On Fri, Mar 19, 2010 at 1:32 AM, Bao, Zheng Zheng.Bao@amd.com wrote:
The parameters of memset() should be memset(addr, value, size), right? It is an obvious bug created at r5201.
Yes. Sorry about that.
I am wondering why it doesnt trouble you.
Good question. I didn't see any effect on SimNow or my Tyan board.
Thanks, Myles
On 19.03.2010 08:32, Bao, Zheng wrote:
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@amd.com
Impressive bug discovery! Acked-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Regards, Carl-Daniel