Skip to content

Commit 15fa9a8

Browse files
williamtcdnskartben
authored andcommitted
arch: x86: remove arch specific dependencies from DYNAMIC_BOOTARGS
CONFIG_DYNAMIC_BOOTARGS currently depends on CONFIG_MULTIBOOT_INFO and CONFIG_BUILD_OUTPUT_EFI which are x86 specific. This change removes those dependencies so that another architecture can use CONFIG_DYNAMIC_BOOTARGS without the x86 specifc features. Signed-off-by: William Tambe <williamt@cadence.com>
1 parent a7c0ec2 commit 15fa9a8

File tree

5 files changed

+30
-21
lines changed

5 files changed

+30
-21
lines changed

arch/x86/core/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ zephyr_library_sources_ifdef(CONFIG_X86_MMU x86_mmu.c)
2121
zephyr_library_sources_ifdef(CONFIG_USERSPACE userspace.c)
2222
zephyr_library_sources_ifdef(CONFIG_ARCH_CACHE cache.c)
2323

24+
zephyr_library_sources_ifdef(CONFIG_DYNAMIC_BOOTARGS bootargs.c)
25+
2426
zephyr_library_sources_ifdef(CONFIG_X86_VERY_EARLY_CONSOLE early_serial.c)
2527

2628
zephyr_library_sources_ifdef(CONFIG_THREAD_LOCAL_STORAGE tls.c)

arch/x86/core/bootargs.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright (c) 2025 Cadence Design Systems, Inc.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/kernel.h>
8+
9+
#if defined(CONFIG_MULTIBOOT_INFO)
10+
11+
__pinned_noinit char multiboot_cmdline[CONFIG_BOOTARGS_ARGS_BUFFER_SIZE];
12+
13+
const char *get_bootargs(void)
14+
{
15+
return multiboot_cmdline;
16+
}
17+
18+
#elif defined(CONFIG_X86_EFI)
19+
20+
__pinned_noinit char efi_bootargs[CONFIG_BOOTARGS_ARGS_BUFFER_SIZE];
21+
22+
const char *get_bootargs(void)
23+
{
24+
return efi_bootargs;
25+
}
26+
27+
#endif

arch/x86/core/efi.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ static uint64_t __aligned(64) efi_stack[1024];
1818

1919
struct efi_boot_arg *efi;
2020

21-
#ifdef CONFIG_DYNAMIC_BOOTARGS
22-
__pinned_noinit char efi_bootargs[CONFIG_BOOTARGS_ARGS_BUFFER_SIZE];
23-
#endif
24-
2521
void *efi_get_acpi_rsdp(void)
2622
{
2723
if (efi == NULL) {
@@ -173,10 +169,3 @@ int arch_printk_char_out(int c)
173169
return efi_console_putchar(c);
174170
}
175171
#endif
176-
177-
#ifdef CONFIG_DYNAMIC_BOOTARGS
178-
const char *get_bootargs(void)
179-
{
180-
return efi_bootargs;
181-
}
182-
#endif /* CONFIG_DYNAMIC_BOOTARGS */

arch/x86/core/multiboot.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,6 @@
1111

1212
struct multiboot_info multiboot_info;
1313

14-
#ifdef CONFIG_DYNAMIC_BOOTARGS
15-
__pinned_noinit char multiboot_cmdline[CONFIG_BOOTARGS_ARGS_BUFFER_SIZE];
16-
17-
const char *get_bootargs(void)
18-
{
19-
return multiboot_cmdline;
20-
}
21-
#endif /* CONFIG_DYNAMIC_BOOTARGS */
22-
2314
/*
2415
* called very early in the boot process to fetch data out of the multiboot
2516
* info struct. we need to grab the relevant data before any dynamic memory

kernel/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,7 @@ config BOOTARGS
10611061

10621062
config DYNAMIC_BOOTARGS
10631063
bool "Support dynamic bootargs"
1064-
depends on BOOTARGS && (MULTIBOOT_INFO || BUILD_OUTPUT_EFI)
1064+
depends on BOOTARGS
10651065
help
10661066
Enables dynamic bootargs support.
10671067

0 commit comments

Comments
 (0)