summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorMasami Hiramatsu (Google) <mhiramat@kernel.org>2026-09-11 23:13:33 +0900
committerMasami Hiramatsu (Google) <mhiramat@kernel.org>2026-10-11 10:33:40 +0900
commit677f83795fdfc25ddc51b665a9111f5ff199f7ca (patch)
tree3b6ecb9e22570698fbf20adcf7543218d07e921a /include/linux
parente84e60da22ea2fb48576d8d78def44fab677374e (diff)
downloadlinux-677f83795fdfc25ddc51b665a9111f5ff199f7ca.tar.gz
linux-677f83795fdfc25ddc51b665a9111f5ff199f7ca.zip
bootconfig: Move BOOTCONFIG_FOOTER_SIZE to include/linux/bootconfig.h
BOOTCONFIG_FOOTER_SIZE was defined locally in tools/bootconfig/main.c. Move it to include/linux/bootconfig.h so that it can be shared with the kernel and user-space tools. Also, use it in init/main.c instead of the hardcoded (BOOTCONFIG_MAGIC_LEN + 8) expression when checking the initrd size. Link: https://lore.kernel.org/all/178913601321.248794.4786502771058559887.stgit@devnote2/ Suggested-by: Sang-Heon Jeon <ekffu200098@gmail.com> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Reviewed-by: Sang-Heon Jeon <ekffu200098@gmail.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/bootconfig.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/bootconfig.h b/include/linux/bootconfig.h
index 6de07eac761b..260a6f46042e 100644
--- a/include/linux/bootconfig.h
+++ b/include/linux/bootconfig.h
@@ -27,6 +27,10 @@ bool __init cmdline_has_extra_options(void);
#define BOOTCONFIG_ALIGN (1 << BOOTCONFIG_ALIGN_SHIFT)
#define BOOTCONFIG_ALIGN_MASK (BOOTCONFIG_ALIGN - 1)
+/* Bootconfig footer is [size][csum][BOOTCONFIG_MAGIC]. */
+#define BOOTCONFIG_FOOTER_SIZE \
+ (sizeof(uint32_t) * 2 + BOOTCONFIG_MAGIC_LEN)
+
/**
* xbc_calc_checksum() - Calculate checksum of bootconfig
* @data: Bootconfig data.