Use mainboard_interrupt_handlers everywhere

The previous commit provides a mainboard_interrupt_handlers
implementation YABEL with identical semantics to the
x86emu one, so let's use it in both cases.

This eliminates the need for the int15_install()
indirection, so let's drop that, too.

Generated using the following coccinelle patch and
manual cleanups (empty #if/#endif):
  @@
  type T;
  identifier FUNCARR;
  expression INT, HANDLER;
  @@
  -typedef T yabel_handleIntFunc;
  -extern yabel_handleIntFunc FUNCARR[256];
  -FUNCARR[INT] = HANDLER;
  +mainboard_interrupt_handlers(INT, &HANDLER);

  @@
  @@
  -void int15_install(void)
  -{
  -mainboard_interrupt_handlers(0x15, &int15_handler);
  -}

  @@
  @@
  -void int15_install(void)
  -{
  -mainboard_interrupt_handlers(0x15, &int15_handler); ... mainboard_interrupt_handlers(0x15, &int15_handler);
  -}

  @@
  @@
  -int15_install();
  +mainboard_interrupt_handlers(0x15, &int15_handler);

Change-Id: I70fd780d7ebf1564a2ff7d7148411673f6de113c
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/1559
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
Patrick Georgi
2012-09-23 18:41:03 +02:00
committed by Stefan Reinauer
parent f3a163a127
commit 89bbcf4c9b
8 changed files with 8 additions and 95 deletions

View File

@@ -60,13 +60,6 @@ static int int15_handler(void)
/* Interrupt handled */ /* Interrupt handled */
return 1; return 1;
} }
static void int15_install(void)
{
typedef int (* yabel_handleIntFunc)(void);
extern yabel_handleIntFunc yabel_intFuncArray[256];
yabel_intFuncArray[0x15] = int15_handler;
}
#endif #endif
/* Hardware Monitor */ /* Hardware Monitor */
@@ -222,7 +215,7 @@ static void mainboard_enable(device_t dev)
{ {
#if CONFIG_PCI_OPTION_ROM_RUN_YABEL #if CONFIG_PCI_OPTION_ROM_RUN_YABEL
/* Install custom int15 handler for VGA OPROM */ /* Install custom int15 handler for VGA OPROM */
int15_install(); mainboard_interrupt_handlers(0x15, &int15_handler);
#endif #endif
verb_setup(); verb_setup();
hwm_setup(); hwm_setup();

View File

@@ -200,20 +200,6 @@ static int int15_handler(void)
} }
#endif #endif
#if CONFIG_PCI_OPTION_ROM_RUN_YABEL || CONFIG_PCI_OPTION_ROM_RUN_REALMODE
static void int15_install(void)
{
#if CONFIG_PCI_OPTION_ROM_RUN_YABEL
typedef int (* yabel_handleIntFunc)(void);
extern yabel_handleIntFunc yabel_intFuncArray[256];
yabel_intFuncArray[0x15] = int15_handler;
#endif
#ifdef CONFIG_PCI_OPTION_ROM_RUN_REALMODE
mainboard_interrupt_handlers(0x15, &int15_handler);
#endif
}
#endif
/* Audio Setup */ /* Audio Setup */
extern const u32 * cim_verb_data; extern const u32 * cim_verb_data;
@@ -232,7 +218,7 @@ static void mainboard_enable(device_t dev)
{ {
#if CONFIG_PCI_OPTION_ROM_RUN_YABEL || CONFIG_PCI_OPTION_ROM_RUN_REALMODE #if CONFIG_PCI_OPTION_ROM_RUN_YABEL || CONFIG_PCI_OPTION_ROM_RUN_REALMODE
/* Install custom int15 handler for VGA OPROM */ /* Install custom int15 handler for VGA OPROM */
int15_install(); mainboard_interrupt_handlers(0x15, &int15_handler);
#endif #endif
verb_setup(); verb_setup();
} }

View File

@@ -61,13 +61,6 @@ static int int15_handler(void)
/* Interrupt handled */ /* Interrupt handled */
return 1; return 1;
} }
static void int15_install(void)
{
typedef int (* yabel_handleIntFunc)(void);
extern yabel_handleIntFunc yabel_intFuncArray[256];
yabel_intFuncArray[0x15] = int15_handler;
}
#endif #endif
#if defined(CONFIG_PCI_OPTION_ROM_RUN_REALMODE) && CONFIG_PCI_OPTION_ROM_RUN_REALMODE #if defined(CONFIG_PCI_OPTION_ROM_RUN_REALMODE) && CONFIG_PCI_OPTION_ROM_RUN_REALMODE
@@ -109,11 +102,6 @@ static int int15_handler(struct eregs *regs)
return res; return res;
} }
static void int15_install(void)
{
mainboard_interrupt_handlers(0x15, &int15_handler);
}
#endif #endif
@@ -270,7 +258,7 @@ static void mainboard_enable(device_t dev)
{ {
#if CONFIG_PCI_OPTION_ROM_RUN_YABEL || CONFIG_PCI_OPTION_ROM_RUN_REALMODE #if CONFIG_PCI_OPTION_ROM_RUN_YABEL || CONFIG_PCI_OPTION_ROM_RUN_REALMODE
/* Install custom int15 handler for VGA OPROM */ /* Install custom int15 handler for VGA OPROM */
int15_install(); mainboard_interrupt_handlers(0x15, &int15_handler);
#endif #endif
verb_setup(); verb_setup();
hwm_setup(); hwm_setup();

View File

@@ -88,13 +88,6 @@ static int int15_handler(void)
/* Interrupt handled */ /* Interrupt handled */
return 1; return 1;
} }
static void int15_install(void)
{
typedef int (* yabel_handleIntFunc)(void);
extern yabel_handleIntFunc yabel_intFuncArray[256];
yabel_intFuncArray[0x15] = int15_handler;
}
#endif #endif
#if CONFIG_PCI_OPTION_ROM_RUN_REALMODE #if CONFIG_PCI_OPTION_ROM_RUN_REALMODE
@@ -136,11 +129,6 @@ static int int15_handler(struct eregs *regs)
return res; return res;
} }
static void int15_install(void)
{
mainboard_interrupt_handlers(0x15, &int15_handler);
}
#endif #endif
#if DUMP_RUNTIME_REGISTERS #if DUMP_RUNTIME_REGISTERS
@@ -171,7 +159,7 @@ static void mainboard_enable(device_t dev)
#if CONFIG_PCI_OPTION_ROM_RUN_YABEL || CONFIG_PCI_OPTION_ROM_RUN_REALMODE #if CONFIG_PCI_OPTION_ROM_RUN_YABEL || CONFIG_PCI_OPTION_ROM_RUN_REALMODE
/* Install custom int15 handler for VGA OPROM */ /* Install custom int15 handler for VGA OPROM */
int15_install(); mainboard_interrupt_handlers(0x15, &int15_handler);
#endif #endif
#if DUMP_RUNTIME_REGISTERS #if DUMP_RUNTIME_REGISTERS
dump_runtime_registers(); dump_runtime_registers();

View File

@@ -230,20 +230,6 @@ static int int15_handler(void)
} }
#endif #endif
#if CONFIG_PCI_OPTION_ROM_RUN_YABEL || CONFIG_PCI_OPTION_ROM_RUN_REALMODE
static void int15_install(void)
{
#if CONFIG_PCI_OPTION_ROM_RUN_YABEL
typedef int (* yabel_handleIntFunc)(void);
extern yabel_handleIntFunc yabel_intFuncArray[256];
yabel_intFuncArray[0x15] = int15_handler;
#endif
#ifdef CONFIG_PCI_OPTION_ROM_RUN_REALMODE
mainboard_interrupt_handlers(0x15, &int15_handler);
#endif
}
#endif
/* Audio Setup */ /* Audio Setup */
extern const u32 * cim_verb_data; extern const u32 * cim_verb_data;
@@ -273,7 +259,7 @@ static void mainboard_enable(device_t dev)
dev->ops->init = mainboard_init; dev->ops->init = mainboard_init;
#if CONFIG_PCI_OPTION_ROM_RUN_YABEL || CONFIG_PCI_OPTION_ROM_RUN_REALMODE #if CONFIG_PCI_OPTION_ROM_RUN_YABEL || CONFIG_PCI_OPTION_ROM_RUN_REALMODE
/* Install custom int15 handler for VGA OPROM */ /* Install custom int15 handler for VGA OPROM */
int15_install(); mainboard_interrupt_handlers(0x15, &int15_handler);
#endif #endif
verb_setup(); verb_setup();
} }

View File

@@ -200,20 +200,6 @@ static int int15_handler(void)
} }
#endif #endif
#if CONFIG_PCI_OPTION_ROM_RUN_YABEL || CONFIG_PCI_OPTION_ROM_RUN_REALMODE
static void int15_install(void)
{
#if CONFIG_PCI_OPTION_ROM_RUN_YABEL
typedef int (* yabel_handleIntFunc)(void);
extern yabel_handleIntFunc yabel_intFuncArray[256];
yabel_intFuncArray[0x15] = int15_handler;
#endif
#ifdef CONFIG_PCI_OPTION_ROM_RUN_REALMODE
mainboard_interrupt_handlers(0x15, &int15_handler);
#endif
}
#endif
/* Audio Setup */ /* Audio Setup */
extern const u32 * cim_verb_data; extern const u32 * cim_verb_data;
@@ -236,7 +222,7 @@ static void mainboard_enable(device_t dev)
{ {
#if CONFIG_PCI_OPTION_ROM_RUN_YABEL || CONFIG_PCI_OPTION_ROM_RUN_REALMODE #if CONFIG_PCI_OPTION_ROM_RUN_YABEL || CONFIG_PCI_OPTION_ROM_RUN_REALMODE
/* Install custom int15 handler for VGA OPROM */ /* Install custom int15 handler for VGA OPROM */
int15_install(); mainboard_interrupt_handlers(0x15, &int15_handler);
#endif #endif
verb_setup(); verb_setup();
} }

View File

@@ -270,13 +270,6 @@ static int int15_handler(void)
/* Interrupt handled */ /* Interrupt handled */
return 1; return 1;
} }
static void int15_install(void)
{
typedef int (* yabel_handleIntFunc)(void);
extern yabel_handleIntFunc yabel_intFuncArray[256];
yabel_intFuncArray[0x15] = int15_handler;
}
#endif #endif
/* ############################################################################################# */ /* ############################################################################################# */
@@ -845,7 +838,7 @@ static void enable_dev(device_t dev)
dev->chip_ops->name, dev_path(dev), dev->subsystem_vendor, dev->subsystem_device, __func__); dev->chip_ops->name, dev_path(dev), dev->subsystem_vendor, dev->subsystem_device, __func__);
#if CONFIG_PCI_OPTION_ROM_RUN_YABEL #if CONFIG_PCI_OPTION_ROM_RUN_YABEL
/* Install custom int15 handler for VGA OPROM */ /* Install custom int15 handler for VGA OPROM */
int15_install(); mainboard_interrupt_handlers(0x15, &int15_handler);
#endif #endif
detect_hw_variant(dev); detect_hw_variant(dev);

View File

@@ -130,13 +130,6 @@ static int int15_handler(void)
/* Interrupt handled */ /* Interrupt handled */
return 1; return 1;
} }
static void int15_install(void)
{
typedef int (* yabel_handleIntFunc)(void);
extern yabel_handleIntFunc yabel_intFuncArray[256];
yabel_intFuncArray[0x15] = int15_handler;
}
#endif #endif
static void mainboard_init(device_t dev) static void mainboard_init(device_t dev)
@@ -150,7 +143,7 @@ static void mainboard_enable(device_t dev)
dev->ops->init = mainboard_init; dev->ops->init = mainboard_init;
#if CONFIG_PCI_OPTION_ROM_RUN_YABEL #if CONFIG_PCI_OPTION_ROM_RUN_YABEL
/* Install custom int15 handler for VGA OPROM */ /* Install custom int15 handler for VGA OPROM */
int15_install(); mainboard_interrupt_handlers(0x15, &int15_handler);
#endif #endif
} }