The native_sim uses the pthread stack instead of the Zephyr allocated ones. This adds CONFIG_ARCH_POSIX_UPDATE_STACK_INFO to the posix arch to make the real stack bounds available in thread info. (CircuitPython uses this to do it's own stack overflow checking and recovery.) The original stack values are restored on abort for backwards compatibility with CMSIS v1. Signed-off-by: Scott Shawcroft <scott@adafruit.com> Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
60 lines
2 KiB
Text
60 lines
2 KiB
Text
# General configuration options
|
|
|
|
# Copyright (c) 2017 Intel Corporation
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
menu "Native (POSIX) Architecture Options"
|
|
depends on ARCH_POSIX
|
|
|
|
config ARCH
|
|
default "posix"
|
|
|
|
config ARCH_POSIX_UPDATE_STACK_INFO
|
|
bool "Update thread stack info with real pthread stack bounds"
|
|
depends on THREAD_STACK_INFO
|
|
help
|
|
When enabled, the POSIX architecture will update each thread's
|
|
stack_info to reflect the actual pthread stack instead of the
|
|
Zephyr-allocated stack. This is useful for applications that
|
|
perform their own stack overflow checking against the real
|
|
stack bounds.
|
|
|
|
config ARCH_POSIX_RECOMMENDED_STACK_SIZE
|
|
int
|
|
default 60 if 64BIT && ARCH_POSIX_UPDATE_STACK_INFO && STACK_SENTINEL
|
|
default 56 if 64BIT && ARCH_POSIX_UPDATE_STACK_INFO
|
|
default 44 if 64BIT && STACK_SENTINEL
|
|
default 40 if 64BIT
|
|
default 36 if ARCH_POSIX_UPDATE_STACK_INFO && STACK_SENTINEL
|
|
default 32 if ARCH_POSIX_UPDATE_STACK_INFO
|
|
default 28 if STACK_SENTINEL
|
|
default 24
|
|
help
|
|
In bytes, stack size for Zephyr threads meant only for the POSIX
|
|
architecture.
|
|
(In this architecture only part of the thread status is kept in the Zephyr
|
|
thread stack, the real stack is the native underlying pthread stack.
|
|
Therefore the allocated stack can be limited to this size)
|
|
|
|
config ARCH_POSIX_LIBFUZZER
|
|
bool "Build fuzz test target"
|
|
help
|
|
Build as an LLVM libfuzzer target. Requires
|
|
support from the toolchain (currently only clang works, and
|
|
only on native_sim[//64]), and should normally be used in
|
|
concert with some of CONFIG_ASAN/UBSAN/MSAN for validation.
|
|
The application needs to implement the
|
|
LLVMFuzzerTestOneInput() entry point, which runs in the host
|
|
environment "outside" the OS. See Zephyr documentation and
|
|
sample and https://llvm.org/docs/LibFuzzer.html for more
|
|
information.
|
|
|
|
config ARCH_POSIX_TRAP_ON_FATAL
|
|
bool "Raise a SIGTRAP on fatal error"
|
|
help
|
|
Raise a SIGTRAP signal on fatal error before exiting.
|
|
This automatically suspends the target if a debugger is attached.
|
|
|
|
rsource "Kconfig.natsim_optional"
|
|
|
|
endmenu
|