summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2026-02-17 16:56:19 +0100
committerThomas Zimmermann <tzimmermann@suse.de>2026-02-20 14:38:22 +0100
commit27fc52b5505a3acca96b884a4bf1345344e5a566 (patch)
tree20b70160759e1f08a8f9948b7cdf2cb572a20235 /include
parent95cef38e70250234a254e6228eb7342b6deaaffa (diff)
firmware: google: Pack structures for coreboot table entries
Pack the fields in the coreboot table entries. These entries are part of the coreboot ABI, so they don't follow regular calling conventions. Fields of type u64 are aligned to boundaries of 4 bytes instead of 8. [1] So far this has not been a problem. In the future, padding bytes should be added where explicit alignment is required. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://github.com/coreboot/coreboot/blob/main/payloads/libpayload/include/coreboot_tables.h#L96 # [1] Suggested-by: Julius Werner <jwerner@chromium.org> Acked-by: Julius Werner <jwerner@chromium.org> Acked-by: Tzung-Bi Shih <tzungbi@kernel.org> Link: https://patch.msgid.link/20260217155836.96267-10-tzimmermann@suse.de
Diffstat (limited to 'include')
-rw-r--r--include/linux/coreboot.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/linux/coreboot.h b/include/linux/coreboot.h
index 48705b439c6e..5746b99a070d 100644
--- a/include/linux/coreboot.h
+++ b/include/linux/coreboot.h
@@ -12,8 +12,11 @@
#ifndef _LINUX_COREBOOT_H
#define _LINUX_COREBOOT_H
+#include <linux/compiler_attributes.h>
#include <linux/types.h>
+typedef __aligned(4) u64 cb_u64;
+
/* List of coreboot entry structures that is used */
#define CB_TAG_FRAMEBUFFER 0x12
@@ -30,7 +33,7 @@ struct lb_cbmem_ref {
u32 tag;
u32 size;
- u64 cbmem_addr;
+ cb_u64 cbmem_addr;
};
/* Corresponds to LB_TAG_CBMEM_ENTRY */
@@ -38,7 +41,7 @@ struct lb_cbmem_entry {
u32 tag;
u32 size;
- u64 address;
+ cb_u64 address;
u32 entry_size;
u32 id;
};
@@ -48,7 +51,7 @@ struct lb_framebuffer {
u32 tag;
u32 size;
- u64 physical_address;
+ cb_u64 physical_address;
u32 x_resolution;
u32 y_resolution;
u32 bytes_per_line;