[coreboot-gerrit] Patch set updated for coreboot: 335e5a9 x86: use proper types for interrupt callbacks

Stefan Reinauer (stefan.reinauer@coreboot.org) gerrit at coreboot.org
Wed Nov 20 01:10:24 CET 2013


Stefan Reinauer (stefan.reinauer at coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4141

-gerrit

commit 335e5a928b8199a78c3643cef1f5c02ebf4f0e3a
Author: Aaron Durbin <adurbin at chromium.org>
Date:   Tue Apr 23 10:25:34 2013 -0500

    x86: use proper types for interrupt callbacks
    
    The mainboard_interrupt_handlers() argument for the function
    pointer was using void * as the type. This does not allow the compiler
    to catch type differences for the arguments. Thus, some code has been
    committed which violates the new interrupt callbacks not taking any
    arguments. Make sure the compiler provides a type checking benefit.
    
    Change-Id: Ie20699a368e70c33a9a9912e0fcd63f1e6bb4f18
    Signed-off-by: Aaron Durbin <adurbin at chromium.org>
    Reviewed-on: https://gerrit.chromium.org/gerrit/48970
---
 src/arch/x86/include/arch/interrupt.h | 4 ++--
 src/device/oprom/realmode/x86.c       | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/arch/x86/include/arch/interrupt.h b/src/arch/x86/include/arch/interrupt.h
index 8c9b4a9..9753c50 100644
--- a/src/arch/x86/include/arch/interrupt.h
+++ b/src/arch/x86/include/arch/interrupt.h
@@ -23,9 +23,9 @@
 
 /* setup interrupt handlers for mainboard */
 #if CONFIG_PCI_OPTION_ROM_RUN_REALMODE
-extern void mainboard_interrupt_handlers(int intXX, void *intXX_func);
+extern void mainboard_interrupt_handlers(int intXX, int (*intXX_func)(void));
 #elif CONFIG_PCI_OPTION_ROM_RUN_YABEL
 #include <device/oprom/yabel/biosemu.h>
 #else
-static inline void mainboard_interrupt_handlers(int intXX, void *intXX_func) { }
+static inline void mainboard_interrupt_handlers(int intXX, int (*intXX_func)(void)) { }
 #endif
diff --git a/src/device/oprom/realmode/x86.c b/src/device/oprom/realmode/x86.c
index 338294d..4385c03 100644
--- a/src/device/oprom/realmode/x86.c
+++ b/src/device/oprom/realmode/x86.c
@@ -118,7 +118,7 @@ static int intXX_unknown_handler(void)
 }
 
 /* setup interrupt handlers for mainboard */
-void mainboard_interrupt_handlers(int intXX, void *intXX_func)
+void mainboard_interrupt_handlers(int intXX, int (*intXX_func)(void))
 {
 	intXX_handler[intXX] = intXX_func;
 }



More information about the coreboot-gerrit mailing list