diff options
author | Patrick Georgi <patrick@georgi-clan.de> | 2011-10-07 22:41:07 +0200 |
---|---|---|
committer | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2011-10-13 01:10:44 +0200 |
commit | c75c79bd0269fec41714fad1899f12e6463d93d8 (patch) | |
tree | 2eda1b714c3080800a3fde89ccb6dd3849e952b7 /src/arch/x86/boot/mpspec.c | |
parent | 6eb7a5316963cb0285fe86286c47491fd213a36b (diff) | |
download | coreboot-c75c79bd0269fec41714fad1899f12e6463d93d8.tar.xz |
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>
Diffstat (limited to 'src/arch/x86/boot/mpspec.c')
-rw-r--r-- | src/arch/x86/boot/mpspec.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/arch/x86/boot/mpspec.c b/src/arch/x86/boot/mpspec.c index 6c81430cb1..604f1918e2 100644 --- a/src/arch/x86/boot/mpspec.c +++ b/src/arch/x86/boot/mpspec.c @@ -53,14 +53,7 @@ unsigned char smp_compute_checksum(void *v, int len) return checksum; } -void *smp_write_floating_table(unsigned long addr) -{ - /* 16 byte align the table address */ - addr = (addr + 0xf) & (~0xf); - return smp_write_floating_table_physaddr(addr, addr + SMP_FLOATING_TABLE_LEN); -} - -void *smp_write_floating_table_physaddr(unsigned long addr, unsigned long mpf_physptr) +static void *smp_write_floating_table_physaddr(unsigned long addr, unsigned long mpf_physptr, unsigned int virtualwire) { struct intel_mp_floating *mf; void *v; @@ -76,7 +69,7 @@ void *smp_write_floating_table_physaddr(unsigned long addr, unsigned long mpf_ph mf->mpf_specification = 4; mf->mpf_checksum = 0; mf->mpf_feature1 = 0; - mf->mpf_feature2 = 0; + mf->mpf_feature2 = virtualwire?MP_FEATURE_VIRTUALWIRE:0; mf->mpf_feature3 = 0; mf->mpf_feature4 = 0; mf->mpf_feature5 = 0; @@ -84,6 +77,13 @@ void *smp_write_floating_table_physaddr(unsigned long addr, unsigned long mpf_ph return v; } +void *smp_write_floating_table(unsigned long addr, unsigned int virtualwire) +{ + /* 16 byte align the table address */ + addr = (addr + 0xf) & (~0xf); + return smp_write_floating_table_physaddr(addr, addr + SMP_FLOATING_TABLE_LEN, virtualwire); +} + void *smp_next_mpc_entry(struct mp_config_table *mc) { void *v; |