nuttx/libs/libc/machine/Kconfig
Tiago Medicci Serrano 58e97e521c libc/string: prevent libc in the kernel/userspace optionally
Add the `LIBC_PREVENT_STRING_KERNEL` and `LIBC_PREVENT_STRING_USER`
that are meant to be selected by the chip if no libc implementation
is going to be built. If selected, neither NuttX's software version
of the libc nor any architecture-specific implementation will be
built in the kernel or in the userspace, respectively. In this
case, the linker may provide a ROM-defined version of the libc
functions instead.
2023-05-17 13:58:48 +08:00

193 lines
4.4 KiB
Plaintext

#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
# These are library functions that may be overridden by architecture-
# specific implementations. Not all architectures support implementations
# for every library function.
menu "Architecture-Specific Support"
config ARCH_LOWPUTC
bool "Low-level console output"
default y
---help---
architecture supports low-level, boot time console output
config ARCH_ROMGETC
bool "Support for ROM string access"
default n
---help---
In Harvard architectures, data accesses and instruction accesses
occur on different buses, perhaps concurrently. All data accesses
are performed on the data bus unless special machine instructions
are used to read data from the instruction address space. Also, in
the typical MCU, the available SRAM data memory is much smaller that
the non-volatile FLASH instruction memory. So if the application
requires many constant strings, the only practical solution may be
to store those constant strings in FLASH memory where they can only
be accessed using architecture-specific machine instructions.
If ARCH_ROMGETC is defined, then the architecture logic must export
the function up_romgetc(). up_romgetc() will simply read one byte
of data from the instruction space.
If ARCH_ROMGETC is selected, certain C stdio functions are effected: (1)
All format strings in printf, fprintf, sprintf, etc. are assumed to lie
in FLASH (string arguments for %s are still assumed to reside in SRAM).
And (2), the string argument to puts and fputs is assumed to reside
in FLASH. Clearly, these assumptions may have to modified for the
particular needs of your environment. There is no "one-size-fits-all"
solution for this problem.
# Default settings for C library functions that may be replaced with
# architecture-specific versions.
config LIBC_ARCH_ATOMIC
bool
default n
config LIBC_ARCH_MEMCHR
bool
default n
config LIBC_ARCH_MEMCPY
bool
default n
config LIBC_ARCH_MEMCMP
bool
default n
config LIBC_ARCH_MEMMOVE
bool
default n
config LIBC_ARCH_MEMSET
bool
default n
config LIBC_ARCH_STRCHR
bool
default n
config LIBC_ARCH_STRCHRNUL
bool
default n
config LIBC_ARCH_STRCMP
bool
default n
config LIBC_ARCH_STRNCMP
bool
default n
config LIBC_ARCH_STRCPY
bool
default n
config LIBC_ARCH_STRLCAT
bool
default n
config LIBC_ARCH_STRLCPY
bool
default n
config LIBC_ARCH_STRNCPY
bool
default n
config LIBC_ARCH_STRLEN
bool
default n
config LIBC_ARCH_STRNLEN
bool
default n
config LIBC_ARCH_STRRCHR
bool
default n
config LIBC_ARCH_STRCAT
bool
default n
config LIBC_ARCH_STRNCAT
bool
default n
config LIBC_ARCH_STRCASECMP
bool
default n
config LIBC_ARCH_STRNCASECMP
bool
default n
config LIBC_ARCH_ELF
bool
default n
config LIBC_ARCH_ELF_64BIT
bool
default n
depends on LIBC_ARCH_ELF
config LIBC_PREVENT_STRING_KERNEL
bool
default n
---help---
Prevent any implementation of the libc from being built and linked
in the kernel, including NuttX's software-defined version of the libc
or any other architecture-specific version of it. The ROM-defined
version should be linked instead. This option is particularly useful
when it's required that the ROM-defined libc to be used by the kernel
(for accessing some driver resource, for instance) but the userspace
is forbidden to use the same ROM-defined versions. In this case,
NuttX's software-defined version of the libc or arch-specific
assembly version is built instead.
config LIBC_PREVENT_STRING_USER
bool
default n
---help---
Prevent any implementation of the libc from being built and linked
in the userspace, including NuttX's software-defined version of the
libc or any other architecture-specific version of it. A ROM-defined
version of the libc may be linked to the userspace by the linker.
# One or more the of above may be selected by architecture specific logic
if ARCH_ARM
source "libs/libc/machine/arm/Kconfig"
endif
if ARCH_ARM64
source "libs/libc/machine/arm64/Kconfig"
endif
if ARCH_RISCV
source "libs/libc/machine/risc-v/Kconfig"
endif
if ARCH_SIM
source "libs/libc/machine/sim/Kconfig"
endif
if ARCH_X86
source "libs/libc/machine/x86/Kconfig"
endif
if ARCH_XTENSA
source "libs/libc/machine/xtensa/Kconfig"
endif
if ARCH_RENESAS
source "libs/libc/machine/renesas/Kconfig"
endif
if ARCH_SPARC
source "libs/libc/machine/sparc/Kconfig"
endif
endmenu # Architecture-Specific Support