From ef4275bc2e4332ed9b6f3ac25060687794f0b98d Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Fri, 8 Feb 2013 22:31:33 -0600 Subject: 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 Reviewed-on: http://review.coreboot.org/2794 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich --- src/include/cpu/x86/smm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/include/cpu/x86') diff --git a/src/include/cpu/x86/smm.h b/src/include/cpu/x86/smm.h index b6a6c4e0c6..62494a9f97 100644 --- a/src/include/cpu/x86/smm.h +++ b/src/include/cpu/x86/smm.h @@ -429,7 +429,7 @@ struct smm_runtime { u8 apic_id_to_cpu[CONFIG_MAX_CPUS]; } __attribute__ ((packed)); -typedef void (*smm_handler_t)(void *arg, int cpu, +typedef void __attribute__((cdecl)) (*smm_handler_t)(void *arg, int cpu, const struct smm_runtime *runtime); #ifdef __SMM__ -- cgit v1.2.3