We should do away altogether with <asm/common.h>, so prepare for doing that in the future by moing the only content it has on sandbox into Kconfig. Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx> --- Kconfig | 2 +- arch/Kconfig | 13 +++++++++++++ arch/sandbox/Kconfig | 1 + arch/sandbox/include/asm/common.h | 2 -- common/console.c | 2 +- common/console_simple.c | 2 +- include/stdio.h | 4 ++-- 7 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 arch/Kconfig diff --git a/Kconfig b/Kconfig index 49bd17c89f33..4c076026b0c9 100644 --- a/Kconfig +++ b/Kconfig @@ -8,7 +8,7 @@ mainmenu "Barebox/$(ARCH) $(KERNELVERSION) Configuration" source "scripts/Kconfig.include" -source "arch/$(SRCARCH)/Kconfig" +source "arch/Kconfig" source "common/Kconfig" source "commands/Kconfig" diff --git a/arch/Kconfig b/arch/Kconfig new file mode 100644 index 000000000000..1a9d32370422 --- /dev/null +++ b/arch/Kconfig @@ -0,0 +1,13 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# General architecture dependent options +# + +# +# Note: arch/$(SRCARCH)/Kconfig needs to be included first so that it can +# override the default values in this file. +# +source "arch/$(SRCARCH)/Kconfig" + +config ARCH_HAS_CTRLC + bool diff --git a/arch/sandbox/Kconfig b/arch/sandbox/Kconfig index 88da35a955ee..136a97b1ad30 100644 --- a/arch/sandbox/Kconfig +++ b/arch/sandbox/Kconfig @@ -16,6 +16,7 @@ config SANDBOX select ARCH_HAS_STACK_DUMP if ASAN select GENERIC_FIND_NEXT_BIT select ARCH_HAS_SJLJ + select ARCH_HAS_CTRLC select HAS_DEBUG_LL default y diff --git a/arch/sandbox/include/asm/common.h b/arch/sandbox/include/asm/common.h index 66ed2f5e9c52..002dfb52b513 100644 --- a/arch/sandbox/include/asm/common.h +++ b/arch/sandbox/include/asm/common.h @@ -3,6 +3,4 @@ #ifndef ASM_COMMON_H #define ASM_COMMON_H -#define ARCH_HAS_CTRLC - #endif /* ASM_COMMON_H */ diff --git a/common/console.c b/common/console.c index 7e43a9b5fc0e..03b76b122b2b 100644 --- a/common/console.c +++ b/common/console.c @@ -625,7 +625,7 @@ int ctrlc(void) if (ctrlc_abort) return 1; -#ifdef ARCH_HAS_CTRLC +#ifdef CONFIG_ARCH_HAS_CTRLC ret = arch_ctrlc(); #else if (tstc() && getchar() == 3) diff --git a/common/console_simple.c b/common/console_simple.c index afa9a0f186fb..702087bd23d7 100644 --- a/common/console_simple.c +++ b/common/console_simple.c @@ -70,7 +70,7 @@ EXPORT_SYMBOL(console_flush); int ctrlc (void) { int ret = 0; -#ifdef ARCH_HAS_CTRLC +#ifdef CONFIG_ARCH_HAS_CTRLC ret = arch_ctrlc(); #else if (tstc() && getchar() == 3) diff --git a/include/stdio.h b/include/stdio.h index 49f3d0cf77b3..b6ded805cc21 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -60,13 +60,13 @@ static inline int vprintf(const char *fmt, va_list args) return 0; } -#ifndef ARCH_HAS_CTRLC +#ifndef CONFIG_ARCH_HAS_CTRLC /* test if ctrl-c was pressed */ static inline int ctrlc (void) { return 0; } -#endif /* ARCH_HAS_CTRLC */ +#endif /* CONFIG_ARCH_HAS_CTRLC */ #endif -- 2.39.2