summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorElyes Haouas <ehaouas@noos.fr>2022-10-10 12:34:21 +0200
committerFelix Held <felix-coreboot@felixheld.de>2022-10-13 19:14:57 +0000
commitd6b6b2261667f0a4688fa0cf9f0699596d7efc93 (patch)
treed2f3a5f715f911dbfd8013c060c1c9b9ea8f5b99 /src
parent5f69b867f0c9ec9c0afab4df70a3d0d06809957a (diff)
downloadcoreboot-d6b6b2261667f0a4688fa0cf9f0699596d7efc93.tar.gz
coreboot-d6b6b2261667f0a4688fa0cf9f0699596d7efc93.tar.bz2
coreboot-d6b6b2261667f0a4688fa0cf9f0699596d7efc93.zip
payloads,src: Replace ALIGN(x, a) by ALIGN_UP(x, a) for clarity
Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Change-Id: I80f3d2c90c58daa62651f6fd635c043b1ce38b84 Reviewed-on: https://review.coreboot.org/c/coreboot/+/68255 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com> Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Diffstat (limited to 'src')
-rw-r--r--src/lib/bootmem.c2
-rw-r--r--src/lib/gcov-glue.c4
-rw-r--r--src/lib/malloc.c2
-rw-r--r--src/lib/rmodule.c2
-rw-r--r--src/mainboard/emulation/qemu-i440fx/fw_cfg.c4
-rw-r--r--src/northbridge/amd/agesa/family14/northbridge.c10
-rw-r--r--src/northbridge/amd/agesa/family15tn/northbridge.c12
-rw-r--r--src/northbridge/amd/agesa/family16kb/northbridge.c12
-rw-r--r--src/northbridge/amd/pi/00730F01/northbridge.c12
-rw-r--r--src/soc/amd/cezanne/agesa_acpi.c2
-rw-r--r--src/soc/amd/mendocino/agesa_acpi.c2
-rw-r--r--src/soc/amd/picasso/agesa_acpi.c4
-rw-r--r--src/soc/amd/stoneyridge/northbridge.c12
-rw-r--r--src/soc/intel/common/mma.c2
-rw-r--r--src/soc/intel/denverton_ns/acpi.c4
-rw-r--r--src/soc/intel/quark/memmap.c2
-rw-r--r--src/soc/intel/xeon_sp/nb_acpi.c6
-rw-r--r--src/soc/intel/xeon_sp/ras/hest.c2
-rw-r--r--src/soc/samsung/exynos5250/fb.c2
19 files changed, 49 insertions, 49 deletions
diff --git a/src/lib/bootmem.c b/src/lib/bootmem.c
index 078f96093257..ea971b6851e8 100644
--- a/src/lib/bootmem.c
+++ b/src/lib/bootmem.c
@@ -228,7 +228,7 @@ void *bootmem_allocate_buffer(size_t size)
}
/* 4KiB alignment. */
- size = ALIGN(size, 4096);
+ size = ALIGN_UP(size, 4096);
region = NULL;
memranges_each_entry(r, &bootmem) {
if (range_entry_base(r) >= max_addr)
diff --git a/src/lib/gcov-glue.c b/src/lib/gcov-glue.c
index 14f3e3ec3b5f..6bdb870195b6 100644
--- a/src/lib/gcov-glue.c
+++ b/src/lib/gcov-glue.c
@@ -37,7 +37,7 @@ static FILE *fopen(const char *path, const char *mode)
} else {
previous_file = current_file;
current_file =
- (FILE *)(ALIGN(((unsigned long)previous_file->data
+ (FILE *)(ALIGN_UP(((unsigned long)previous_file->data
+ previous_file->len), 16));
}
@@ -50,7 +50,7 @@ static FILE *fopen(const char *path, const char *mode)
current_file->filename = (char *)&current_file[1];
strcpy(current_file->filename, path);
current_file->data =
- (char *)ALIGN(((unsigned long)current_file->filename
+ (char *)ALIGN_UP(((unsigned long)current_file->filename
+ strlen(path) + 1), 16);
current_file->offset = 0;
current_file->len = 0;
diff --git a/src/lib/malloc.c b/src/lib/malloc.c
index 57a72c22c810..8ad038af5f89 100644
--- a/src/lib/malloc.c
+++ b/src/lib/malloc.c
@@ -26,7 +26,7 @@ void *memalign(size_t boundary, size_t size)
MALLOCDBG("%s Enter, boundary %zu, size %zu, free_mem_ptr %p\n",
__func__, boundary, size, free_mem_ptr);
- free_mem_ptr = (void *)ALIGN((unsigned long)free_mem_ptr, boundary);
+ free_mem_ptr = (void *)ALIGN_UP((unsigned long)free_mem_ptr, boundary);
p = free_mem_ptr;
free_mem_ptr += size;
diff --git a/src/lib/rmodule.c b/src/lib/rmodule.c
index bee71d88ee7a..1446440e5a13 100644
--- a/src/lib/rmodule.c
+++ b/src/lib/rmodule.c
@@ -222,7 +222,7 @@ static void *rmodule_cbfs_allocator(void *rsl_arg, size_t unused,
* to place the rmodule so that the program falls on the aligned
* address with the header just before it. Therefore, we need at least
* a page to account for the size of the header. */
- size_t region_size = ALIGN(memlen + region_alignment, 4096);
+ size_t region_size = ALIGN_UP(memlen + region_alignment, 4096);
/* The program starts immediately after the header. However,
* it needs to be aligned to a 4KiB boundary. Therefore, adjust the
* program location so that the program lands on a page boundary. The
diff --git a/src/mainboard/emulation/qemu-i440fx/fw_cfg.c b/src/mainboard/emulation/qemu-i440fx/fw_cfg.c
index 3206e4cec797..5c23988ba6df 100644
--- a/src/mainboard/emulation/qemu-i440fx/fw_cfg.c
+++ b/src/mainboard/emulation/qemu-i440fx/fw_cfg.c
@@ -249,7 +249,7 @@ unsigned long fw_cfg_acpi_tables(unsigned long start)
uint64_t addr8;
switch (s[i].command) {
case BIOS_LINKER_LOADER_COMMAND_ALLOCATE:
- current = ALIGN(current, s[i].alloc.align);
+ current = ALIGN_UP(current, s[i].alloc.align);
if (fw_cfg_check_file(&f, s[i].alloc.file))
goto err;
@@ -329,7 +329,7 @@ unsigned long fw_cfg_acpi_tables(unsigned long start)
printk(BIOS_DEBUG, "QEMU: loaded ACPI tables from fw_cfg.\n");
free(s);
free(addrs);
- return ALIGN(current, 16);
+ return ALIGN_UP(current, 16);
err:
printk(BIOS_DEBUG, "QEMU: loading ACPI tables from fw_cfg failed.\n");
diff --git a/src/northbridge/amd/agesa/family14/northbridge.c b/src/northbridge/amd/agesa/family14/northbridge.c
index 7a46bd4f3613..6237a7ffffe5 100644
--- a/src/northbridge/amd/agesa/family14/northbridge.c
+++ b/src/northbridge/amd/agesa/family14/northbridge.c
@@ -709,14 +709,14 @@ static unsigned long agesa_write_acpi_tables(const struct device *device,
acpi_hest_t *hest;
/* HEST */
- current = ALIGN(current, 8);
+ current = ALIGN_UP(current, 8);
hest = (acpi_hest_t *)current;
acpi_write_hest(hest, acpi_fill_hest);
acpi_add_table(rsdp, hest);
current += hest->header.length;
/* SRAT */
- current = ALIGN(current, 8);
+ current = ALIGN_UP(current, 8);
printk(BIOS_DEBUG, "ACPI: * SRAT at %lx\n", current);
srat = (acpi_srat_t *)agesawrapper_getlateinitptr(PICK_SRAT);
if (srat != NULL) {
@@ -730,7 +730,7 @@ static unsigned long agesa_write_acpi_tables(const struct device *device,
}
/* SLIT */
- current = ALIGN(current, 8);
+ current = ALIGN_UP(current, 8);
printk(BIOS_DEBUG, "ACPI: * SLIT at %lx\n", current);
slit = (acpi_slit_t *)agesawrapper_getlateinitptr(PICK_SLIT);
if (slit != NULL) {
@@ -744,7 +744,7 @@ static unsigned long agesa_write_acpi_tables(const struct device *device,
}
/* SSDT */
- current = ALIGN(current, 16);
+ current = ALIGN_UP(current, 16);
printk(BIOS_DEBUG, "ACPI: * AGESA ALIB SSDT at %lx\n", current);
alib = (acpi_header_t *)agesawrapper_getlateinitptr(PICK_ALIB);
if (alib != NULL) {
@@ -758,7 +758,7 @@ static unsigned long agesa_write_acpi_tables(const struct device *device,
/* The DSDT needs additional work for the AGESA SSDT Pstate table */
/* Keep the comment for a while. */
- current = ALIGN(current, 16);
+ current = ALIGN_UP(current, 16);
printk(BIOS_DEBUG, "ACPI: * AGESA SSDT Pstate at %lx\n", current);
ssdt = (acpi_header_t *)agesawrapper_getlateinitptr(PICK_PSTATE);
if (ssdt != NULL) {
diff --git a/src/northbridge/amd/agesa/family15tn/northbridge.c b/src/northbridge/amd/agesa/family15tn/northbridge.c
index caacce933a5a..9cacb79c5995 100644
--- a/src/northbridge/amd/agesa/family15tn/northbridge.c
+++ b/src/northbridge/amd/agesa/family15tn/northbridge.c
@@ -473,13 +473,13 @@ static unsigned long agesa_write_acpi_tables(const struct device *device,
acpi_hest_t *hest;
/* HEST */
- current = ALIGN(current, 8);
+ current = ALIGN_UP(current, 8);
hest = (acpi_hest_t *)current;
acpi_write_hest(hest, acpi_fill_hest);
acpi_add_table(rsdp, hest);
current += hest->header.length;
- current = ALIGN(current, 8);
+ current = ALIGN_UP(current, 8);
printk(BIOS_DEBUG, "ACPI: * IVRS at %lx\n", current);
ivrs = agesawrapper_getlateinitptr(PICK_IVRS);
if (ivrs != NULL) {
@@ -492,7 +492,7 @@ static unsigned long agesa_write_acpi_tables(const struct device *device,
}
/* SRAT */
- current = ALIGN(current, 8);
+ current = ALIGN_UP(current, 8);
printk(BIOS_DEBUG, "ACPI: * SRAT at %lx\n", current);
srat = (acpi_srat_t *)agesawrapper_getlateinitptr(PICK_SRAT);
if (srat != NULL) {
@@ -505,7 +505,7 @@ static unsigned long agesa_write_acpi_tables(const struct device *device,
}
/* SLIT */
- current = ALIGN(current, 8);
+ current = ALIGN_UP(current, 8);
printk(BIOS_DEBUG, "ACPI: * SLIT at %lx\n", current);
slit = (acpi_slit_t *)agesawrapper_getlateinitptr(PICK_SLIT);
if (slit != NULL) {
@@ -518,7 +518,7 @@ static unsigned long agesa_write_acpi_tables(const struct device *device,
}
/* ALIB */
- current = ALIGN(current, 16);
+ current = ALIGN_UP(current, 16);
printk(BIOS_DEBUG, "ACPI: * AGESA ALIB SSDT at %lx\n", current);
alib = (acpi_header_t *)agesawrapper_getlateinitptr(PICK_ALIB);
if (alib != NULL) {
@@ -533,7 +533,7 @@ static unsigned long agesa_write_acpi_tables(const struct device *device,
/* this pstate ssdt may cause Blue Screen: Fixed: Keep this comment for a while. */
/* SSDT */
- current = ALIGN(current, 16);
+ current = ALIGN_UP(current, 16);
printk(BIOS_DEBUG, "ACPI: * SSDT at %lx\n", current);
ssdt = (acpi_header_t *)agesawrapper_getlateinitptr(PICK_PSTATE);
if (ssdt != NULL) {
diff --git a/src/northbridge/amd/agesa/family16kb/northbridge.c b/src/northbridge/amd/agesa/family16kb/northbridge.c
index 9f20e7135265..9943e34d5f12 100644
--- a/src/northbridge/amd/agesa/family16kb/northbridge.c
+++ b/src/northbridge/amd/agesa/family16kb/northbridge.c
@@ -467,13 +467,13 @@ static unsigned long agesa_write_acpi_tables(const struct device *device,
acpi_hest_t *hest;
/* HEST */
- current = ALIGN(current, 8);
+ current = ALIGN_UP(current, 8);
hest = (acpi_hest_t *)current;
acpi_write_hest(hest, acpi_fill_hest);
acpi_add_table(rsdp, hest);
current += hest->header.length;
- current = ALIGN(current, 8);
+ current = ALIGN_UP(current, 8);
printk(BIOS_DEBUG, "ACPI: * IVRS at %lx\n", current);
ivrs = agesawrapper_getlateinitptr(PICK_IVRS);
if (ivrs != NULL) {
@@ -486,7 +486,7 @@ static unsigned long agesa_write_acpi_tables(const struct device *device,
}
/* SRAT */
- current = ALIGN(current, 8);
+ current = ALIGN_UP(current, 8);
printk(BIOS_DEBUG, "ACPI: * SRAT at %lx\n", current);
srat = (acpi_srat_t *)agesawrapper_getlateinitptr(PICK_SRAT);
if (srat != NULL) {
@@ -499,7 +499,7 @@ static unsigned long agesa_write_acpi_tables(const struct device *device,
}
/* SLIT */
- current = ALIGN(current, 8);
+ current = ALIGN_UP(current, 8);
printk(BIOS_DEBUG, "ACPI: * SLIT at %lx\n", current);
slit = (acpi_slit_t *)agesawrapper_getlateinitptr(PICK_SLIT);
if (slit != NULL) {
@@ -512,7 +512,7 @@ static unsigned long agesa_write_acpi_tables(const struct device *device,
}
/* ALIB */
- current = ALIGN(current, 16);
+ current = ALIGN_UP(current, 16);
printk(BIOS_DEBUG, "ACPI: * AGESA ALIB SSDT at %lx\n", current);
alib = (acpi_header_t *)agesawrapper_getlateinitptr(PICK_ALIB);
if (alib != NULL) {
@@ -527,7 +527,7 @@ static unsigned long agesa_write_acpi_tables(const struct device *device,
/* this pstate ssdt may cause Blue Screen: Fixed: Keep this comment for a while. */
/* SSDT */
- current = ALIGN(current, 16);
+ current = ALIGN_UP(current, 16);
printk(BIOS_DEBUG, "ACPI: * SSDT at %lx\n", current);
ssdt = (acpi_header_t *)agesawrapper_getlateinitptr(PICK_PSTATE);
if (ssdt != NULL) {
diff --git a/src/northbridge/amd/pi/00730F01/northbridge.c b/src/northbridge/amd/pi/00730F01/northbridge.c
index 0245a74ea9f1..dab0e72d50d6 100644
--- a/src/northbridge/amd/pi/00730F01/northbridge.c
+++ b/src/northbridge/amd/pi/00730F01/northbridge.c
@@ -584,13 +584,13 @@ static unsigned long agesa_write_acpi_tables(const struct device *device,
acpi_ivrs_t *ivrs;
/* HEST */
- current = ALIGN(current, 8);
+ current = ALIGN_UP(current, 8);
acpi_write_hest((void *)current, acpi_fill_hest);
acpi_add_table(rsdp, (void *)current);
current += ((acpi_header_t *)current)->length;
/* IVRS */
- current = ALIGN(current, 8);
+ current = ALIGN_UP(current, 8);
printk(BIOS_DEBUG, "ACPI: * IVRS at %lx\n", current);
ivrs = (acpi_ivrs_t *)current;
acpi_create_ivrs(ivrs, acpi_fill_ivrs);
@@ -598,7 +598,7 @@ static unsigned long agesa_write_acpi_tables(const struct device *device,
acpi_add_table(rsdp, ivrs);
/* SRAT */
- current = ALIGN(current, 8);
+ current = ALIGN_UP(current, 8);
printk(BIOS_DEBUG, "ACPI: * SRAT at %lx\n", current);
srat = (acpi_srat_t *)agesawrapper_getlateinitptr(PICK_SRAT);
if (srat != NULL) {
@@ -611,7 +611,7 @@ static unsigned long agesa_write_acpi_tables(const struct device *device,
}
/* SLIT */
- current = ALIGN(current, 8);
+ current = ALIGN_UP(current, 8);
printk(BIOS_DEBUG, "ACPI: * SLIT at %lx\n", current);
slit = (acpi_slit_t *)agesawrapper_getlateinitptr(PICK_SLIT);
if (slit != NULL) {
@@ -624,7 +624,7 @@ static unsigned long agesa_write_acpi_tables(const struct device *device,
}
/* ALIB */
- current = ALIGN(current, 16);
+ current = ALIGN_UP(current, 16);
printk(BIOS_DEBUG, "ACPI: * AGESA ALIB SSDT at %lx\n", current);
alib = (acpi_header_t *)agesawrapper_getlateinitptr(PICK_ALIB);
if (alib != NULL) {
@@ -639,7 +639,7 @@ static unsigned long agesa_write_acpi_tables(const struct device *device,
/* this pstate ssdt may cause Blue Screen: Fixed: Keep this comment for a while. */
/* SSDT */
- current = ALIGN(current, 16);
+ current = ALIGN_UP(current, 16);
printk(BIOS_DEBUG, "ACPI: * SSDT at %lx\n", current);
ssdt = (acpi_header_t *)agesawrapper_getlateinitptr(PICK_PSTATE);
if (ssdt != NULL) {
diff --git a/src/soc/amd/cezanne/agesa_acpi.c b/src/soc/amd/cezanne/agesa_acpi.c
index a397360bce56..4adf95952c21 100644
--- a/src/soc/amd/cezanne/agesa_acpi.c
+++ b/src/soc/amd/cezanne/agesa_acpi.c
@@ -16,7 +16,7 @@ uintptr_t agesa_write_acpi_tables(const struct device *device, uintptr_t current
current = add_agesa_fsp_acpi_table(AMD_FSP_ACPI_ALIB_HOB_GUID, "ALIB", rsdp, current);
/* IVRS */
- current = ALIGN(current, 8);
+ current = ALIGN_UP(current, 8);
ivrs = (acpi_ivrs_t *)current;
acpi_create_ivrs(ivrs, acpi_fill_ivrs);
current += ivrs->header.length;
diff --git a/src/soc/amd/mendocino/agesa_acpi.c b/src/soc/amd/mendocino/agesa_acpi.c
index 9062c7a74846..e0ca9ac92683 100644
--- a/src/soc/amd/mendocino/agesa_acpi.c
+++ b/src/soc/amd/mendocino/agesa_acpi.c
@@ -18,7 +18,7 @@ uintptr_t agesa_write_acpi_tables(const struct device *device, uintptr_t current
current = add_agesa_fsp_acpi_table(AMD_FSP_ACPI_ALIB_HOB_GUID, "ALIB", rsdp, current);
/* IVRS */
- current = ALIGN(current, 8);
+ current = ALIGN_UP(current, 8);
ivrs = (acpi_ivrs_t *)current;
acpi_create_ivrs(ivrs, acpi_fill_ivrs);
current += ivrs->header.length;
diff --git a/src/soc/amd/picasso/agesa_acpi.c b/src/soc/amd/picasso/agesa_acpi.c
index e4a9b1421c8e..35eedcb91afc 100644
--- a/src/soc/amd/picasso/agesa_acpi.c
+++ b/src/soc/amd/picasso/agesa_acpi.c
@@ -547,7 +547,7 @@ uintptr_t agesa_write_acpi_tables(const struct device *device, uintptr_t current
struct acpi_crat_header *crat;
/* CRAT */
- current = ALIGN(current, 8);
+ current = ALIGN_UP(current, 8);
crat = (struct acpi_crat_header *)current;
acpi_create_crat(crat, acpi_fill_crat);
current += crat->header.length;
@@ -557,7 +557,7 @@ uintptr_t agesa_write_acpi_tables(const struct device *device, uintptr_t current
current = add_agesa_fsp_acpi_table(AMD_FSP_ACPI_ALIB_HOB_GUID, "ALIB", rsdp, current);
/* IVRS */
- current = ALIGN(current, 8);
+ current = ALIGN_UP(current, 8);
ivrs = (acpi_ivrs_t *)current;
acpi_create_ivrs(ivrs, acpi_fill_ivrs);
current += ivrs->header.length;
diff --git a/src/soc/amd/stoneyridge/northbridge.c b/src/soc/amd/stoneyridge/northbridge.c
index 500940cee457..4549abb89450 100644
--- a/src/soc/amd/stoneyridge/northbridge.c
+++ b/src/soc/amd/stoneyridge/northbridge.c
@@ -235,13 +235,13 @@ static unsigned long agesa_write_acpi_tables(const struct device *device,
acpi_hest_t *hest;
/* HEST */
- current = ALIGN(current, 8);
+ current = ALIGN_UP(current, 8);
hest = (acpi_hest_t *)current;
acpi_write_hest(hest, acpi_fill_hest);
acpi_add_table(rsdp, (void *)current);
current += hest->header.length;
- current = ALIGN(current, 8);
+ current = ALIGN_UP(current, 8);
printk(BIOS_DEBUG, "ACPI: * IVRS at %lx\n", current);
ivrs = agesawrapper_getlateinitptr(PICK_IVRS);
if (ivrs != NULL) {
@@ -254,7 +254,7 @@ static unsigned long agesa_write_acpi_tables(const struct device *device,
}
/* SRAT */
- current = ALIGN(current, 8);
+ current = ALIGN_UP(current, 8);
printk(BIOS_DEBUG, "ACPI: * SRAT at %lx\n", current);
srat = (acpi_srat_t *)agesawrapper_getlateinitptr(PICK_SRAT);
if (srat != NULL) {
@@ -267,7 +267,7 @@ static unsigned long agesa_write_acpi_tables(const struct device *device,
}
/* SLIT */
- current = ALIGN(current, 8);
+ current = ALIGN_UP(current, 8);
printk(BIOS_DEBUG, "ACPI: * SLIT at %lx\n", current);
slit = (acpi_slit_t *)agesawrapper_getlateinitptr(PICK_SLIT);
if (slit != NULL) {
@@ -280,7 +280,7 @@ static unsigned long agesa_write_acpi_tables(const struct device *device,
}
/* ALIB */
- current = ALIGN(current, 16);
+ current = ALIGN_UP(current, 16);
printk(BIOS_DEBUG, "ACPI: * AGESA ALIB SSDT at %lx\n", current);
alib = (acpi_header_t *)agesawrapper_getlateinitptr(PICK_ALIB);
if (alib != NULL) {
@@ -293,7 +293,7 @@ static unsigned long agesa_write_acpi_tables(const struct device *device,
" Skipping.\n");
}
- current = ALIGN(current, 16);
+ current = ALIGN_UP(current, 16);
printk(BIOS_DEBUG, "ACPI: * SSDT at %lx\n", current);
ssdt = (acpi_header_t *)agesawrapper_getlateinitptr(PICK_PSTATE);
if (ssdt != NULL) {
diff --git a/src/soc/intel/common/mma.c b/src/soc/intel/common/mma.c
index 04d766dc81d5..3314e8e5c5a6 100644
--- a/src/soc/intel/common/mma.c
+++ b/src/soc/intel/common/mma.c
@@ -173,7 +173,7 @@ static void save_mma_results_data(void *unused)
return;
}
- mma_data_size = ALIGN(mma_hob_size, 16) +
+ mma_data_size = ALIGN_UP(mma_hob_size, 16) +
sizeof(struct mma_data_container);
mma_data = cbmem_add(CBMEM_ID_MMA_DATA, mma_data_size);
diff --git a/src/soc/intel/denverton_ns/acpi.c b/src/soc/intel/denverton_ns/acpi.c
index 808affa67fea..399bb64713f0 100644
--- a/src/soc/intel/denverton_ns/acpi.c
+++ b/src/soc/intel/denverton_ns/acpi.c
@@ -152,7 +152,7 @@ unsigned long southcluster_write_acpi_tables(const struct device *device,
acpi_header_t *ssdt2;
current = acpi_write_hpet(device, current, rsdp);
- current = (ALIGN(current, 16));
+ current = (ALIGN_UP(current, 16));
ssdt2 = (acpi_header_t *)current;
memset(ssdt2, 0, sizeof(acpi_header_t));
@@ -162,7 +162,7 @@ unsigned long southcluster_write_acpi_tables(const struct device *device,
acpi_add_table(rsdp, ssdt2);
printk(BIOS_DEBUG, "ACPI: * SSDT2 @ %p Length %x\n", ssdt2,
ssdt2->length);
- current = (ALIGN(current, 16));
+ current = (ALIGN_UP(current, 16));
} else {
ssdt2 = NULL;
printk(BIOS_DEBUG, "ACPI: * SSDT2 not generated.\n");
diff --git a/src/soc/intel/quark/memmap.c b/src/soc/intel/quark/memmap.c
index 97a9fd88f2aa..46671b2414fe 100644
--- a/src/soc/intel/quark/memmap.c
+++ b/src/soc/intel/quark/memmap.c
@@ -12,7 +12,7 @@ void fill_postcar_frame(struct postcar_frame *pcf)
/* Locate the top of RAM */
top_of_low_usable_memory = (uintptr_t) cbmem_top();
- top_of_ram = ALIGN(top_of_low_usable_memory, 16 * MiB);
+ top_of_ram = ALIGN_UP(top_of_low_usable_memory, 16 * MiB);
/* Cache postcar and ramstage */
postcar_frame_add_mtrr(pcf, top_of_ram - (16 * MiB), 16 * MiB,
diff --git a/src/soc/intel/xeon_sp/nb_acpi.c b/src/soc/intel/xeon_sp/nb_acpi.c
index 64851f5bbc14..c31fd61f67a7 100644
--- a/src/soc/intel/xeon_sp/nb_acpi.c
+++ b/src/soc/intel/xeon_sp/nb_acpi.c
@@ -414,7 +414,7 @@ unsigned long northbridge_write_acpi_tables(const struct device *device,
const config_t *const config = config_of(device);
/* SRAT */
- current = ALIGN(current, 8);
+ current = ALIGN_UP(current, 8);
printk(BIOS_DEBUG, "ACPI: * SRAT at %lx\n", current);
srat = (acpi_srat_t *) current;
acpi_create_srat(srat, acpi_fill_srat);
@@ -422,7 +422,7 @@ unsigned long northbridge_write_acpi_tables(const struct device *device,
acpi_add_table(rsdp, srat);
/* SLIT */
- current = ALIGN(current, 8);
+ current = ALIGN_UP(current, 8);
printk(BIOS_DEBUG, "ACPI: * SLIT at %lx\n", current);
slit = (acpi_slit_t *) current;
acpi_create_slit(slit, acpi_fill_slit);
@@ -431,7 +431,7 @@ unsigned long northbridge_write_acpi_tables(const struct device *device,
/* DMAR */
if (config->vtd_support) {
- current = ALIGN(current, 8);
+ current = ALIGN_UP(current, 8);
dmar = (acpi_dmar_t *)current;
enum dmar_flags flags = DMAR_INTR_REMAP;
diff --git a/src/soc/intel/xeon_sp/ras/hest.c b/src/soc/intel/xeon_sp/ras/hest.c
index 02a9ab1b53d2..9eb54d95595c 100644
--- a/src/soc/intel/xeon_sp/ras/hest.c
+++ b/src/soc/intel/xeon_sp/ras/hest.c
@@ -91,7 +91,7 @@ unsigned long hest_create(unsigned long current, struct acpi_rsdp *rsdp)
printk(BIOS_DEBUG, "elog_addr: %llx, size:%x\n", gnvs->hest_log_addr,
CONFIG_ERROR_LOG_BUFFER_SIZE);
- current = ALIGN(current, 8);
+ current = ALIGN_UP(current, 8);
hest = (acpi_hest_t *)current;
acpi_write_hest(hest, acpi_fill_hest);
acpi_add_table(rsdp, (void *)current);
diff --git a/src/soc/samsung/exynos5250/fb.c b/src/soc/samsung/exynos5250/fb.c
index 1fc926a7e17c..ab097e294eb9 100644
--- a/src/soc/samsung/exynos5250/fb.c
+++ b/src/soc/samsung/exynos5250/fb.c
@@ -100,7 +100,7 @@ void fb_init(unsigned long int fb_size, void *lcdbase,
{
unsigned int val;
- fb_size = ALIGN(fb_size, 4096);
+ fb_size = ALIGN_UP(fb_size, 4096);
write32(&exynos_disp_ctrl->vidcon1, pd->ivclk | pd->fixvclk);
val = ENVID_ON | ENVID_F_ON | (pd->clkval_f << CLKVAL_F_OFFSET);