mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
UPSTREAM: lb_tables: make lb_mainboard and lb_strings record sizes 64-bit aligned
They were sized to 32-bit alignment, this grows them to 64 bit-aligned.
BUG=none
BRANCH=none
TEST=none
Change-Id: Ie84b2c35b58f186bd8ae993e7ce298332858de05
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 23bb036dcb
Original-Change-Id: I494b942c4866a7912fb48a53f9524db20ac53a8c
Original-Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Original-Reviewed-on: https://review.coreboot.org/18165
Original-Tested-by: build bot (Jenkins)
Original-Tested-by: Raptor Engineering Automated Test Stand <noreply@raptorengineeringinc.com>
Original-Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Original-Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://chromium-review.googlesource.com/430618
Commit-Ready: Aaron Durbin <adurbin@chromium.org>
Tested-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
parent
1619ed3a0d
commit
cfde18b4b5
1 changed files with 4 additions and 4 deletions
|
@ -46,6 +46,7 @@
|
|||
#if CONFIG_ARCH_X86
|
||||
#include <cpu/x86/mtrr.h>
|
||||
#endif
|
||||
#include <commonlib/helpers.h>
|
||||
|
||||
static struct lb_header *lb_table_init(unsigned long addr)
|
||||
{
|
||||
|
@ -348,10 +349,9 @@ static struct lb_mainboard *lb_mainboard(struct lb_header *header)
|
|||
mainboard = (struct lb_mainboard *)rec;
|
||||
mainboard->tag = LB_TAG_MAINBOARD;
|
||||
|
||||
mainboard->size = (sizeof(*mainboard) +
|
||||
mainboard->size = ALIGN_UP(sizeof(*mainboard) +
|
||||
strlen(mainboard_vendor) + 1 +
|
||||
strlen(mainboard_part_number) + 1 +
|
||||
3) & ~3;
|
||||
strlen(mainboard_part_number) + 1, 8);
|
||||
|
||||
mainboard->vendor_idx = 0;
|
||||
mainboard->part_number_idx = strlen(mainboard_vendor) + 1;
|
||||
|
@ -402,7 +402,7 @@ static void lb_strings(struct lb_header *header)
|
|||
rec = (struct lb_string *)lb_new_record(header);
|
||||
len = strlen(strings[i].string);
|
||||
rec->tag = strings[i].tag;
|
||||
rec->size = (sizeof(*rec) + len + 1 + 3) & ~3;
|
||||
rec->size = ALIGN_UP(sizeof(*rec) + len + 1, 8);
|
||||
memcpy(rec->string, strings[i].string, len+1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue