mptable: Get rid of fixup_virtual_wire
As stated in some code files, fixup_virtual_wire was established
to avoid touching 200 invocations of the mptable code.
Let Coccinelle do it:
@@
type T;
identifier v;
@@
-void fixup_virtual_wire(T v)
-{ ... }
@@
expression A;
identifier v;
@@
-v = smp_write_floating_table(A);
+v = smp_write_floating_table(A, 0);
@@
expression A;
identifier v;
@@
-v = smp_write_floating_table(A, 0);
-fixup_virtual_wire(v);
+v = smp_write_floating_table(A, 1);
Change-Id: Icad8a063380bf4726be7cebb414d13b574112b14
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/245
Tested-by: build bot (Jenkins)
Reviewed-by: Marc Jones <marcj303@gmail.com>
diff --git a/src/mainboard/ibase/mb899/mptable.c b/src/mainboard/ibase/mb899/mptable.c
index 18af2a1..7ee2ed8 100644
--- a/src/mainboard/ibase/mb899/mptable.c
+++ b/src/mainboard/ibase/mb899/mptable.c
@@ -130,26 +130,9 @@
return smp_next_mpe_entry(mc);
}
-/* MP table generation in coreboot is not very well designed;
- * One of the issues is that it knows nothing about Virtual
- * Wire mode, which everyone uses since a decade or so. This
- * function fixes up our floating table. This spares us doing
- * a half-baked fix of adding a new parameter to 200+ calls
- * to smp_write_floating_table()
- */
-static void fixup_virtual_wire(void *v)
-{
- struct intel_mp_floating *mf = v;
-
- mf->mpf_checksum = 0;
- mf->mpf_feature2 = MP_FEATURE_VIRTUALWIRE;
- mf->mpf_checksum = smp_compute_checksum(mf, mf->mpf_length*16);
-}
-
unsigned long write_smp_table(unsigned long addr)
{
void *v;
- v = smp_write_floating_table(addr);
- fixup_virtual_wire(v);
+ v = smp_write_floating_table(addr, 1);
return (unsigned long)smp_write_config_table(v);
}