x86: protect against abi assumptions from compiler

Some of the functions called from assembly assume the standard
x86 32-bit ABI of passing all arguments on the stack. However,
that calling ABI can be changed by compiler flags. In order to
protect against the current implicit calling convention annotate
the functions called from assembly with the cdecl function
attribute. That tells the compiler to use the stack based parameter
calling convention.

Change-Id: I83625e1f92c6821a664b191b6ce1250977cf037a
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/2794
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
This commit is contained in:
Aaron Durbin
2013-02-08 22:31:33 -06:00
committed by Ronald G. Minnich
parent e2d9e5bfa9
commit ef4275bc2e
3 changed files with 6 additions and 5 deletions

View File

@ -149,7 +149,8 @@ static void cleanup_rom_caching(void)
/* By the time APs call ap_init() caching has been setup, and microcode has
* been loaded. */
static void ap_init(unsigned int cpu, void *microcode_ptr)
static void __attribute__((cdecl))
ap_init(unsigned int cpu, void *microcode_ptr)
{
struct cpu_info *info;