[PATCH 09/16] boot: split off bootarg API into new bootargs.h header
Ahmad Fatoum
a.fatoum at pengutronix.de
Tue Apr 1 03:47:59 PDT 2025
In preparation for adding new functions to the flexible bootarg support
that are not used at boot-time, factor out the bootargs support,
so new code need not include the whole boot.h header.
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
include/boot.h | 16 +---------------
include/bootargs.h | 22 ++++++++++++++++++++++
2 files changed, 23 insertions(+), 15 deletions(-)
create mode 100644 include/bootargs.h
diff --git a/include/boot.h b/include/boot.h
index 71da2e2baba8..c1676364cadc 100644
--- a/include/boot.h
+++ b/include/boot.h
@@ -6,21 +6,7 @@
#include <menu.h>
#include <environment.h>
#include <bootm-overrides.h>
-
-#ifdef CONFIG_FLEXIBLE_BOOTARGS
-const char *linux_bootargs_get(void);
-int linux_bootargs_overwrite(const char *bootargs);
-#else
-static inline const char *linux_bootargs_get(void)
-{
- return getenv("bootargs");
-}
-
-static inline int linux_bootargs_overwrite(const char *bootargs)
-{
- return setenv("bootargs", bootargs);
-}
-#endif
+#include <bootargs.h>
struct bootentries {
struct list_head entries;
diff --git a/include/bootargs.h b/include/bootargs.h
new file mode 100644
index 000000000000..c85fd4c4a797
--- /dev/null
+++ b/include/bootargs.h
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef __BOOTARGS_H
+#define __BOOTARGS_H
+
+#include <environment.h>
+
+#ifdef CONFIG_FLEXIBLE_BOOTARGS
+const char *linux_bootargs_get(void);
+int linux_bootargs_overwrite(const char *bootargs);
+#else
+static inline const char *linux_bootargs_get(void)
+{
+ return getenv("bootargs");
+}
+
+static inline int linux_bootargs_overwrite(const char *bootargs)
+{
+ return setenv("bootargs", bootargs);
+}
+#endif
+
+#endif /* __BOOTARGS_H */
--
2.39.5
More information about the barebox
mailing list