summaryrefslogtreecommitdiff
path: root/src/mainboard/asus
diff options
context:
space:
mode:
authorPatrick Georgi <patrick@georgi-clan.de>2011-10-07 23:01:55 +0200
committerStefan Reinauer <stefan.reinauer@coreboot.org>2011-10-13 01:11:08 +0200
commitb0a9c5ccf31514630755e9a5d15204a55a47740f (patch)
tree5f53ed955bdfd26ddfe0a674570c5f1bd3c327d8 /src/mainboard/asus
parentc75c79bd0269fec41714fad1899f12e6463d93d8 (diff)
downloadcoreboot-b0a9c5ccf31514630755e9a5d15204a55a47740f.tar.xz
mptable: Refactor mptable generation some more
The last couple of lines of every mptable function were mostly identical. Refactor into common code, a new function mptable_finalize. Coccinelle script: @@ identifier mc; @@ ( -mc->mpe_checksum = smp_compute_checksum(smp_next_mpc_entry(mc), mc->mpe_length); -mc->mpc_checksum = smp_compute_checksum(mc, mc->mpc_length); -printk(BIOS_DEBUG, "Wrote the mp table end at: %p - %p\n", mc, smp_next_mpe_entry(mc)); -return smp_next_mpe_entry(mc); +return mptable_finalize(mc); | -mc->mpe_checksum = smp_compute_checksum(smp_next_mpc_entry(mc), mc->mpe_length); -mc->mpc_checksum = smp_compute_checksum(mc, mc->mpc_length); -return smp_next_mpe_entry(mc); +return mptable_finalize(mc); ) Change-Id: Ib2270d800bdd486c5eb49b328544d36bd2298c9e Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/246 Tested-by: build bot (Jenkins) Reviewed-by: Marc Jones <marcj303@gmail.com>
Diffstat (limited to 'src/mainboard/asus')
-rw-r--r--src/mainboard/asus/a8n_e/mptable.c7
-rw-r--r--src/mainboard/asus/a8v-e_deluxe/mptable.c6
-rw-r--r--src/mainboard/asus/a8v-e_se/mptable.c6
-rw-r--r--src/mainboard/asus/m2n-e/mptable.c7
-rw-r--r--src/mainboard/asus/m2v/mptable.c6
-rw-r--r--src/mainboard/asus/m4a78-em/mptable.c7
-rw-r--r--src/mainboard/asus/m4a785-m/mptable.c7
-rw-r--r--src/mainboard/asus/p2b-d/mptable.c7
-rw-r--r--src/mainboard/asus/p2b-ds/mptable.c7
9 files changed, 9 insertions, 51 deletions
diff --git a/src/mainboard/asus/a8n_e/mptable.c b/src/mainboard/asus/a8n_e/mptable.c
index d790c76ee8..349ae74979 100644
--- a/src/mainboard/asus/a8n_e/mptable.c
+++ b/src/mainboard/asus/a8n_e/mptable.c
@@ -113,12 +113,7 @@ static void *smp_write_config_table(void *v)
/* There is no extension information... */
/* Compute the checksums. */
- mc->mpe_checksum =
- smp_compute_checksum(smp_next_mpc_entry(mc), mc->mpe_length);
- mc->mpc_checksum = smp_compute_checksum(mc, mc->mpc_length);
- printk(BIOS_DEBUG, "Wrote the mp table end at: %p - %p\n",
- mc, smp_next_mpe_entry(mc));
- return smp_next_mpe_entry(mc);
+ return mptable_finalize(mc);
}
unsigned long write_smp_table(unsigned long addr)
diff --git a/src/mainboard/asus/a8v-e_deluxe/mptable.c b/src/mainboard/asus/a8v-e_deluxe/mptable.c
index 6c67533af5..999dd6cd33 100644
--- a/src/mainboard/asus/a8v-e_deluxe/mptable.c
+++ b/src/mainboard/asus/a8v-e_deluxe/mptable.c
@@ -105,11 +105,7 @@ static void *smp_write_config_table(void *v)
/* There is no extension information... */
/* Compute the checksums. */
- mc->mpe_checksum = smp_compute_checksum(smp_next_mpc_entry(mc),
- mc->mpe_length);
- mc->mpc_checksum = smp_compute_checksum(mc, mc->mpc_length);
-
- return smp_next_mpe_entry(mc);
+ return mptable_finalize(mc);
}
unsigned long write_smp_table(unsigned long addr)
diff --git a/src/mainboard/asus/a8v-e_se/mptable.c b/src/mainboard/asus/a8v-e_se/mptable.c
index 6c67533af5..999dd6cd33 100644
--- a/src/mainboard/asus/a8v-e_se/mptable.c
+++ b/src/mainboard/asus/a8v-e_se/mptable.c
@@ -105,11 +105,7 @@ static void *smp_write_config_table(void *v)
/* There is no extension information... */
/* Compute the checksums. */
- mc->mpe_checksum = smp_compute_checksum(smp_next_mpc_entry(mc),
- mc->mpe_length);
- mc->mpc_checksum = smp_compute_checksum(mc, mc->mpc_length);
-
- return smp_next_mpe_entry(mc);
+ return mptable_finalize(mc);
}
unsigned long write_smp_table(unsigned long addr)
diff --git a/src/mainboard/asus/m2n-e/mptable.c b/src/mainboard/asus/m2n-e/mptable.c
index 716c754eec..29b9d07e44 100644
--- a/src/mainboard/asus/m2n-e/mptable.c
+++ b/src/mainboard/asus/m2n-e/mptable.c
@@ -94,12 +94,7 @@ static void *smp_write_config_table(void *v)
mptable_lintsrc(mc, bus_isa);
/* Compute the checksums. */
- mc->mpe_checksum =
- smp_compute_checksum(smp_next_mpc_entry(mc), mc->mpe_length);
- mc->mpc_checksum = smp_compute_checksum(mc, mc->mpc_length);
- printk(BIOS_DEBUG, "Wrote the mp table end at: %p - %p\n",
- mc, smp_next_mpe_entry(mc));
- return smp_next_mpe_entry(mc);
+ return mptable_finalize(mc);
}
unsigned long write_smp_table(unsigned long addr)
diff --git a/src/mainboard/asus/m2v/mptable.c b/src/mainboard/asus/m2v/mptable.c
index 9dd57f5c1d..5dc340a9ba 100644
--- a/src/mainboard/asus/m2v/mptable.c
+++ b/src/mainboard/asus/m2v/mptable.c
@@ -136,11 +136,7 @@ static void *smp_write_config_table(void *v)
/* There is no extension information... */
/* Compute the checksums. */
- mc->mpe_checksum = smp_compute_checksum(smp_next_mpc_entry(mc),
- mc->mpe_length);
- mc->mpc_checksum = smp_compute_checksum(mc, mc->mpc_length);
-
- return smp_next_mpe_entry(mc);
+ return mptable_finalize(mc);
}
unsigned long write_smp_table(unsigned long addr)
diff --git a/src/mainboard/asus/m4a78-em/mptable.c b/src/mainboard/asus/m4a78-em/mptable.c
index 024e87a015..4bf3480fcf 100644
--- a/src/mainboard/asus/m4a78-em/mptable.c
+++ b/src/mainboard/asus/m4a78-em/mptable.c
@@ -160,12 +160,7 @@ static void *smp_write_config_table(void *v)
/* There is no extension information... */
/* Compute the checksums */
- mc->mpe_checksum =
- smp_compute_checksum(smp_next_mpc_entry(mc), mc->mpe_length);
- mc->mpc_checksum = smp_compute_checksum(mc, mc->mpc_length);
- printk(BIOS_DEBUG, "Wrote the mp table end at: %p - %p\n",
- mc, smp_next_mpe_entry(mc));
- return smp_next_mpe_entry(mc);
+ return mptable_finalize(mc);
}
unsigned long write_smp_table(unsigned long addr)
diff --git a/src/mainboard/asus/m4a785-m/mptable.c b/src/mainboard/asus/m4a785-m/mptable.c
index 024e87a015..4bf3480fcf 100644
--- a/src/mainboard/asus/m4a785-m/mptable.c
+++ b/src/mainboard/asus/m4a785-m/mptable.c
@@ -160,12 +160,7 @@ static void *smp_write_config_table(void *v)
/* There is no extension information... */
/* Compute the checksums */
- mc->mpe_checksum =
- smp_compute_checksum(smp_next_mpc_entry(mc), mc->mpe_length);
- mc->mpc_checksum = smp_compute_checksum(mc, mc->mpc_length);
- printk(BIOS_DEBUG, "Wrote the mp table end at: %p - %p\n",
- mc, smp_next_mpe_entry(mc));
- return smp_next_mpe_entry(mc);
+ return mptable_finalize(mc);
}
unsigned long write_smp_table(unsigned long addr)
diff --git a/src/mainboard/asus/p2b-d/mptable.c b/src/mainboard/asus/p2b-d/mptable.c
index 7030023f33..43f3a85f1e 100644
--- a/src/mainboard/asus/p2b-d/mptable.c
+++ b/src/mainboard/asus/p2b-d/mptable.c
@@ -52,12 +52,7 @@ static void *smp_write_config_table(void *v)
mptable_lintsrc(mc, isa_bus);
/* Compute the checksums. */
- mc->mpe_checksum =
- smp_compute_checksum(smp_next_mpc_entry(mc), mc->mpe_length);
- mc->mpc_checksum = smp_compute_checksum(mc, mc->mpc_length);
- printk(BIOS_DEBUG, "Wrote the mp table end at: %p - %p\n",
- mc, smp_next_mpe_entry(mc));
- return smp_next_mpe_entry(mc);
+ return mptable_finalize(mc);
}
unsigned long write_smp_table(unsigned long addr)
diff --git a/src/mainboard/asus/p2b-ds/mptable.c b/src/mainboard/asus/p2b-ds/mptable.c
index 31d360dfde..153c62c5c6 100644
--- a/src/mainboard/asus/p2b-ds/mptable.c
+++ b/src/mainboard/asus/p2b-ds/mptable.c
@@ -53,12 +53,7 @@ static void *smp_write_config_table(void *v)
mptable_lintsrc(mc, 0x1);
/* Compute the checksums. */
- mc->mpe_checksum =
- smp_compute_checksum(smp_next_mpc_entry(mc), mc->mpe_length);
- mc->mpc_checksum = smp_compute_checksum(mc, mc->mpc_length);
- printk(BIOS_DEBUG, "Wrote the mp table end at: %p - %p\n",
- mc, smp_next_mpe_entry(mc));
- return smp_next_mpe_entry(mc);
+ return mptable_finalize(mc);
}
unsigned long write_smp_table(unsigned long addr)