coreboot-kgpe-d16/src/arch/x86
Patrick Georgi 6eb7a53169 mptable: Refactor lintsrc generation
We copied pretty much the same code for generating mptable entries for
local interrupts (with some notable exceptions).
This change moves these lines into a generic function "mptable_lintsrc"
and makes use of it in many places.

The remaining uses of smp_write_lintsrc should be reviewed and replaced
by mptable_lintsrc calls where possible, and smp_write_lintsrc made static.

This patch was generated using Coccinelle:
  @@
  expression mc;
  expression isa_bus;
  @@
  -smp_write_lintsrc(mc, mp_ExtINT, MP_IRQ_TRIGGER_DEFAULT|MP_IRQ_POLARITY_DEFAULT, isa_bus, 0x0, MP_APIC_ALL, 0x0);
  -smp_write_lintsrc(mc, mp_NMI, MP_IRQ_TRIGGER_DEFAULT|MP_IRQ_POLARITY_DEFAULT, isa_bus, 0x0, MP_APIC_ALL, 0x1);
  +mptable_lintsrc(mc, isa_bus);

  @@
  expression mc;
  expression isa_bus;
  @@
  -smp_write_lintsrc(mc, mp_ExtINT, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, isa_bus, 0x0, MP_APIC_ALL, 0x0);
  -smp_write_lintsrc(mc, mp_NMI, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, isa_bus, 0x0, MP_APIC_ALL, 0x1);
  +mptable_lintsrc(mc, isa_bus);

  @m@
  identifier mc;
  expression BUS;
  @@
  -#define IO_LOCAL_INT(type, intr, apicid, pin) smp_write_lintsrc(mc, (type), MP_IRQ_TRIGGER_EDGE | MP_IRQ_POLARITY_HIGH, BUS, (intr), (apicid), (pin));
  ...
  -IO_LOCAL_INT(mp_ExtINT, 0x0, MP_APIC_ALL, 0x0);
  -IO_LOCAL_INT(mp_NMI, 0x0, MP_APIC_ALL, 0x1);
  +mptable_lintsrc(mc, BUS);

Change-Id: I97421f820cd039f5fd753cb0da5c1cca68819bb4
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/244
Tested-by: build bot (Jenkins)
Reviewed-by: Marc Jones <marcj303@gmail.com>
2011-10-13 01:10:31 +02:00
..
acpi After this has been brought up many times before, rename src/arch/i386 to 2010-12-11 20:33:41 +00:00
boot mptable: Refactor lintsrc generation 2011-10-13 01:10:31 +02:00
include mptable: Refactor lintsrc generation 2011-10-13 01:10:31 +02:00
init Recently the 3 projects using the new AMD reference code have been 2011-04-19 01:36:24 +00:00
lib Do full flush on uart8250 only at end of printk. 2011-07-12 11:36:20 +02:00
llshell After this has been brought up many times before, rename src/arch/i386 to 2010-12-11 20:33:41 +00:00
Kconfig more ifdef -> if fixes. 2011-04-21 21:26:58 +00:00
Makefile.bigbootblock.inc In 2007 Adrian Reber suggested that we drop ASSEMBLY in favor of __ASSEMBLER__. 2011-04-10 04:15:23 +00:00
Makefile.bootblock.inc In 2007 Adrian Reber suggested that we drop ASSEMBLY in favor of __ASSEMBLER__. 2011-04-10 04:15:23 +00:00
Makefile.inc Add xhcbios and ahcibios rom handling 2011-07-22 20:02:22 +02:00
coreboot_ram.ld After this has been brought up many times before, rename src/arch/i386 to 2010-12-11 20:33:41 +00:00