llext: provide an example of tristate Kconfig option

Add a tristate Kconfig option to the llext hello-world twister test.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This commit is contained in:
Guennadi Liakhovetski 2024-01-10 16:29:05 +01:00 committed by Anas Nashif
parent b53a792ff0
commit aee2d1a677
3 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,12 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2024 Intel Corporation.
mainmenu "LLEXT functionality test"
source "Kconfig.zephyr"
config LLEXT_TEST_HELLO
tristate "llext hello test"
default n
help
Set to "m" to test hello-world loading

View File

@ -5,6 +5,8 @@ cmake_minimum_required(VERSION 3.20.0)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(hello_world)
if(NOT CONFIG_MODULES OR CONFIG_LLEXT_TEST_HELLO STREQUAL "m")
# TODO check which architecture is being used
if(CONFIG_ARM)
set(CMAKE_C_FLAGS "-mlong-calls" "-mthumb")
@ -34,3 +36,5 @@ endif()
set(HELLO_WORLD_LLEXT ${PROJECT_BINARY_DIR}/hello_world.llext PARENT_SCOPE)
add_custom_target(hello_world DEPENDS ${PROJECT_BINARY_DIR}/hello_world.llext)
endif()

View File

@ -6,6 +6,8 @@ tests:
arch_allow: arm
extra_configs:
- CONFIG_ARM_MPU=n
- CONFIG_MODULES=y
- CONFIG_LLEXT_TEST_HELLO=m
# Broken platforms
platform_exclude:
- nuvoton_pfm_m487 # See #63167
@ -13,6 +15,8 @@ tests:
arch_allow: xtensa
extra_configs:
- CONFIG_LLEXT_STORAGE_WRITABLE=y
- CONFIG_MODULES=y
- CONFIG_LLEXT_TEST_HELLO=m
# Broken platforms
platform_exclude:
- qemu_xtensa_mmu # ELF sections are read-only, and without peek() .text copy isn't executable