summaryrefslogtreecommitdiff
path: root/src/mainboard/supermicro/h8qgi
diff options
context:
space:
mode:
authorPatrick Georgi <patrick@georgi-clan.de>2012-04-20 19:19:47 +0200
committerPatrick Georgi <patrick@georgi-clan.de>2012-04-20 21:18:02 +0200
commit26b00e6d3954dcfa00ee4d7c874161b2fbdd2ce2 (patch)
treecc4549a622b5cd43578b0cabe2cfb622114c4b11 /src/mainboard/supermicro/h8qgi
parentd6e4d518b1dbfdcfbea7b56113530900ba3e03b1 (diff)
downloadcoreboot-26b00e6d3954dcfa00ee4d7c874161b2fbdd2ce2.tar.xz
Refactor some alignment handling
Made using coccinelle: @@ expression E; @@ -(E + 7) & -8 +ALIGN(E, 8) @@ expression E; @@ -(E + 15) & -16 +ALIGN(E, 16) Change-Id: I071d2c98cd95580d7de21d256c31b6368a3dc70b Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/910 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/mainboard/supermicro/h8qgi')
-rw-r--r--src/mainboard/supermicro/h8qgi/acpi_tables.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mainboard/supermicro/h8qgi/acpi_tables.c b/src/mainboard/supermicro/h8qgi/acpi_tables.c
index 58215fc5ed..505b87ab2a 100644
--- a/src/mainboard/supermicro/h8qgi/acpi_tables.c
+++ b/src/mainboard/supermicro/h8qgi/acpi_tables.c
@@ -195,7 +195,7 @@ unsigned long write_acpi_tables(unsigned long start)
get_bus_conf(); /* it will get sblk, pci1234, hcdn, and sbdn */
/* Align ACPI tables to 16 bytes */
- start = (start + 0x0f) & -0x10;
+ start = ALIGN(start, 16);
current = start;
printk(BIOS_INFO, "ACPI: Writing ACPI tables at %lx...\n", start);
@@ -237,7 +237,7 @@ unsigned long write_acpi_tables(unsigned long start)
* We explicitly add these tables later on:
*/
#ifdef UNUSED_CODE // Don't need HPET table. we have one in dsdt
- current = (current + 0x07) & -0x08;
+ current = ALIGN(current, 8);
printk(BIOS_DEBUG, "ACPI: * HPET at %lx\n", current);
hpet = (acpi_hpet_t *) current;
current += sizeof(acpi_hpet_t);
@@ -246,7 +246,7 @@ unsigned long write_acpi_tables(unsigned long start)
#endif
/* If we want to use HPET Timers Linux wants an MADT */
- current = (current + 0x07) & -0x08;
+ current = ALIGN(current, 8);
printk(BIOS_DEBUG, "ACPI: * MADT at %lx\n",current);
madt = (acpi_madt_t *) current;
acpi_create_madt(madt);
@@ -254,14 +254,14 @@ unsigned long write_acpi_tables(unsigned long start)
acpi_add_table(rsdp, madt);
/* HEST */
- current = (current + 0x07) & -0x08;
+ current = ALIGN(current, 8);
hest = (acpi_hest_t *)current;
acpi_write_hest((void *)current);
acpi_add_table(rsdp, (void *)current);
current += ((acpi_header_t *)current)->length;
/* SRAT */
- current = (current + 0x07) & -0x08;
+ current = ALIGN(current, 8);
printk(BIOS_DEBUG, "ACPI: * SRAT at %lx\n", current);
srat = (acpi_srat_t *) agesawrapper_getlateinitptr (PICK_SRAT);
if (srat != NULL) {
@@ -273,7 +273,7 @@ unsigned long write_acpi_tables(unsigned long start)
}
/* SLIT */
- current = (current + 0x07) & -0x08;
+ current = ALIGN(current, 8);
printk(BIOS_DEBUG, "ACPI: * SLIT at %lx\n", current);
slit = (acpi_slit_t *) agesawrapper_getlateinitptr (PICK_SLIT);
if (slit != NULL) {
@@ -285,7 +285,7 @@ unsigned long write_acpi_tables(unsigned long start)
}
/* SSDT */
- current = (current + 0x0f) & -0x10;
+ current = ALIGN(current, 16);
printk(BIOS_DEBUG, "ACPI: * AGESA ALIB SSDT at %lx\n", current);
alib = (acpi_header_t *)agesawrapper_getlateinitptr (PICK_ALIB);
if (alib != NULL) {
@@ -299,7 +299,7 @@ unsigned long write_acpi_tables(unsigned long start)
/* The DSDT needs additional work for the AGESA SSDT Pstate table */
/* Keep the comment for a while. */
- current = (current + 0x0f) & -0x10;
+ current = ALIGN(current, 16);
printk(BIOS_DEBUG, "ACPI: * AGESA SSDT Pstate at %lx\n", current);
ssdt = (acpi_header_t *)agesawrapper_getlateinitptr (PICK_PSTATE);
if (ssdt != NULL) {
@@ -311,7 +311,7 @@ unsigned long write_acpi_tables(unsigned long start)
printk(BIOS_DEBUG, " AGESA SSDT Pstate table NULL. Skipping.\n");
}
- current = (current + 0x0f) & -0x10;
+ current = ALIGN(current, 16);
printk(BIOS_DEBUG, "ACPI: * coreboot TOM SSDT2 at %lx\n", current);
ssdt2 = (acpi_header_t *) current;
acpi_create_ssdt_generator(ssdt2, ACPI_TABLE_CREATOR);