Make libpayload alloc() memory pointers volatile
authorMarc Jones <marc.jones@se-eng.com>
Thu, 1 Mar 2012 23:12:11 +0000 (16:12 -0700)
committerPatrick Georgi <patrick@georgi-clan.de>
Sat, 10 Mar 2012 13:19:42 +0000 (14:19 +0100)
commit987e883e6a5a48eb7404c81e1eb5fdcfb1107ef7
treee2238bc4e84750ebef0b060e5a1ace79b951632f
parent32829caf40e12974a11cb470c4da1e9a04971f76
Make libpayload alloc() memory pointers volatile

gcc4.6.2 was optimizing the libpayload alloc() function and failing to
reload a pointer after the memory had been manipulated by a pointer in
the inlined function setup(). Change the pointer type to volatile
and now pass it to the setup() function. Also clean up the
declaration so that it isn't cast a bunch times in the function.

Change-Id: I1637bd7bd5d9cf82ac88925cbfe76d319aa3cd82
Signed-off-by: Marc Jones <marc.jones@se-eng.com>
Reviewed-on: http://review.coreboot.org/705
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
payloads/libpayload/libc/malloc.c