Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33627
Change subject: arch/x86/acpi: use ALIGN_UP instead of ALIGN
......................................................................
arch/x86/acpi: use ALIGN_UP instead of ALIGN
The ALIGN_UP macro is basically an alias of the ALIGN macro; with this change
it's more obvious in which direction the alignment happens.
Change-Id: I6f1b9f9bbcafeb85a6ef5c10ce4b57edc0740e72
Signed-off-by: Felix Held <felix-coreboot(a)felixheld.de>
---
M src/arch/x86/acpi.c
M src/arch/x86/include/arch/acpi.h
2 files changed, 3 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/27/33627/1
diff --git a/src/arch/x86/acpi.c b/src/arch/x86/acpi.c
index bf9813c..635f0fa 100644
--- a/src/arch/x86/acpi.c
+++ b/src/arch/x86/acpi.c
@@ -813,7 +813,7 @@
hpet = (acpi_hpet_t *) current;
current += sizeof(acpi_hpet_t);
- current = ALIGN(current, 16);
+ current = ALIGN_UP(current, 16);
acpi_create_hpet(hpet);
acpi_add_table(rsdp, hpet);
@@ -1271,7 +1271,7 @@
acpi_write_xsdt(xsdt, oem_id, oem_table_id);
printk(BIOS_DEBUG, "ACPI: * FACS\n");
- current = (ALIGN(current, 64));
+ current = (ALIGN_UP(current, 64));
facs = (acpi_facs_t *) current;
current += sizeof(acpi_facs_t);
current = acpi_align_current(current);
diff --git a/src/arch/x86/include/arch/acpi.h b/src/arch/x86/include/arch/acpi.h
index dbf46a9..a17729a 100644
--- a/src/arch/x86/include/arch/acpi.h
+++ b/src/arch/x86/include/arch/acpi.h
@@ -958,7 +958,7 @@
static inline uintptr_t acpi_align_current(uintptr_t current)
{
- return ALIGN(current, 16);
+ return ALIGN_UP(current, 16);
}
/* ACPI table revisions should match the revision of the ACPI spec
--
To view, visit https://review.coreboot.org/c/coreboot/+/33627
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I6f1b9f9bbcafeb85a6ef5c10ce4b57edc0740e72
Gerrit-Change-Number: 33627
Gerrit-PatchSet: 1
Gerrit-Owner: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-MessageType: newchange
Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33636
Change subject: drivers/intel/fsp: use ALIGN_UP instead of ALIGN for better readability
......................................................................
drivers/intel/fsp: use ALIGN_UP instead of ALIGN for better readability
Change-Id: I41fd50dc1e30332261f80e99419dad2635b5a54a
Signed-off-by: Felix Held <felix-coreboot(a)felixheld.de>
---
M src/drivers/intel/fsp1_0/fsp_util.c
M src/drivers/intel/fsp1_1/raminit.c
2 files changed, 2 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/36/33636/1
diff --git a/src/drivers/intel/fsp1_0/fsp_util.c b/src/drivers/intel/fsp1_0/fsp_util.c
index 4e50abae..d787c7b 100644
--- a/src/drivers/intel/fsp1_0/fsp_util.c
+++ b/src/drivers/intel/fsp1_0/fsp_util.c
@@ -275,7 +275,7 @@
printk(BIOS_DEBUG, "Memory Configure Data Hob at %p (size = 0x%x).\n",
(void *)mrc_hob_data, mrc_hob_size);
- output_len = ALIGN(mrc_hob_size, 16);
+ output_len = ALIGN_UP(mrc_hob_size, 16);
/* Save the MRC S3/fast boot/ADR restore data to cbmem */
mrc_data = cbmem_add (CBMEM_ID_MRCDATA,
diff --git a/src/drivers/intel/fsp1_1/raminit.c b/src/drivers/intel/fsp1_1/raminit.c
index eff011a..a631fca 100644
--- a/src/drivers/intel/fsp1_1/raminit.c
+++ b/src/drivers/intel/fsp1_1/raminit.c
@@ -297,7 +297,7 @@
else if (!vboot_recovery_mode_enabled()) {
/* Do not save MRC data in recovery path */
params->data_to_save = GET_GUID_HOB_DATA(mrc_hob);
- params->data_to_save_size = ALIGN(
+ params->data_to_save_size = ALIGN_UP(
((u32)GET_HOB_LENGTH(mrc_hob)), 16);
}
}
--
To view, visit https://review.coreboot.org/c/coreboot/+/33636
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I41fd50dc1e30332261f80e99419dad2635b5a54a
Gerrit-Change-Number: 33636
Gerrit-PatchSet: 1
Gerrit-Owner: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-MessageType: newchange
Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33633
Change subject: device/pci_rom: use ALIGN_UP instead of ALIGN for better readability
......................................................................
device/pci_rom: use ALIGN_UP instead of ALIGN for better readability
Change-Id: Icb0b3fd22fa9b6ea73b7770079f81335e40fd0d3
Signed-off-by: Felix Held <felix-coreboot(a)felixheld.de>
---
M src/device/pci_rom.c
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/33/33633/1
diff --git a/src/device/pci_rom.c b/src/device/pci_rom.c
index 2dbfb51..3160c20 100644
--- a/src/device/pci_rom.c
+++ b/src/device/pci_rom.c
@@ -257,7 +257,7 @@
/* AMD/ATI uses VFCT */
if (device->vendor == PCI_VENDOR_ID_ATI) {
- current = ALIGN(current, 8);
+ current = ALIGN_UP(current, 8);
printk(BIOS_DEBUG, "ACPI: * VFCT at %lx\n", current);
vfct = (struct acpi_vfct *)current;
acpi_create_vfct(device, vfct, pci_rom_acpi_fill_vfct);
--
To view, visit https://review.coreboot.org/c/coreboot/+/33633
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Icb0b3fd22fa9b6ea73b7770079f81335e40fd0d3
Gerrit-Change-Number: 33633
Gerrit-PatchSet: 1
Gerrit-Owner: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-MessageType: newchange
Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33631
Change subject: arch/arm/cpu: use ALIGN_UP instead of ALIGN for better readability
......................................................................
arch/arm/cpu: use ALIGN_UP instead of ALIGN for better readability
Change-Id: Id0e281ece0a647721c18402029cd6980f75d5908
Signed-off-by: Felix Held <felix-coreboot(a)felixheld.de>
---
M src/arch/arm/cpu.c
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/31/33631/1
diff --git a/src/arch/arm/cpu.c b/src/arch/arm/cpu.c
index fae1a37..93d5675 100644
--- a/src/arch/arm/cpu.c
+++ b/src/arch/arm/cpu.c
@@ -39,7 +39,7 @@
"feature, make sure you add the proper assertions " \
"(and maybe consider revising the whole thing to work closer to what " \
"arm64 is doing now)."
- uintptr_t addr = ALIGN((uintptr_t)__builtin_frame_address(0),
+ uintptr_t addr = ALIGN_UP((uintptr_t)__builtin_frame_address(0),
CONFIG_STACK_SIZE);
addr -= sizeof(struct cpu_info);
return (void *)addr;
--
To view, visit https://review.coreboot.org/c/coreboot/+/33631
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Id0e281ece0a647721c18402029cd6980f75d5908
Gerrit-Change-Number: 33631
Gerrit-PatchSet: 1
Gerrit-Owner: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-MessageType: newchange
Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33630
Change subject: arch/x86: use ALIGN_UP instead of ALIGN for better readability
......................................................................
arch/x86: use ALIGN_UP instead of ALIGN for better readability
This patch contains the rest of the fixes for this subtree; having one change
for every area would create an unnecessary amouint of patches.
Change-Id: Id92c11d58693292d58cba323c8468db858becfb5
Signed-off-by: Felix Held <felix-coreboot(a)felixheld.de>
---
M src/arch/x86/gdt.c
M src/arch/x86/include/arch/early_variables.h
M src/arch/x86/pirq_routing.c
3 files changed, 3 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/30/33630/1
diff --git a/src/arch/x86/gdt.c b/src/arch/x86/gdt.c
index c9aec6d..d3ad01e 100644
--- a/src/arch/x86/gdt.c
+++ b/src/arch/x86/gdt.c
@@ -46,7 +46,7 @@
newgdt = cbmem_find(CBMEM_ID_GDT);
num_gdt_bytes = (uintptr_t)&gdt_end - (uintptr_t)&gdt;
if (!newgdt) {
- newgdt = cbmem_add(CBMEM_ID_GDT, ALIGN(num_gdt_bytes, 512));
+ newgdt = cbmem_add(CBMEM_ID_GDT, ALIGN_UP(num_gdt_bytes, 512));
if (!newgdt) {
printk(BIOS_ERR, "Error: Could not relocate GDT.\n");
return;
diff --git a/src/arch/x86/include/arch/early_variables.h b/src/arch/x86/include/arch/early_variables.h
index 9ea1537..b3042c3 100644
--- a/src/arch/x86/include/arch/early_variables.h
+++ b/src/arch/x86/include/arch/early_variables.h
@@ -69,7 +69,7 @@
static inline size_t car_data_size(void)
{
size_t car_size = _car_relocatable_data_size;
- return ALIGN(car_size, 64);
+ return ALIGN_UP(car_size, 64);
}
static inline size_t car_object_offset(void *ptr)
diff --git a/src/arch/x86/pirq_routing.c b/src/arch/x86/pirq_routing.c
index 194efb4..70df201 100644
--- a/src/arch/x86/pirq_routing.c
+++ b/src/arch/x86/pirq_routing.c
@@ -191,7 +191,7 @@
const struct irq_routing_table *routing_table)
{
/* Align the table to be 16 byte aligned. */
- addr = ALIGN(addr, 16);
+ addr = ALIGN_UP(addr, 16);
/* This table must be between 0xf0000 & 0x100000 */
printk(BIOS_INFO, "Copying Interrupt Routing Table to 0x%08lx... ",
--
To view, visit https://review.coreboot.org/c/coreboot/+/33630
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Id92c11d58693292d58cba323c8468db858becfb5
Gerrit-Change-Number: 33630
Gerrit-PatchSet: 1
Gerrit-Owner: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-MessageType: newchange