Introduces Regression for 32 and 64 bit threadx and smp kernel in Debug, MinSizeRel and Release configuration #4
@@ -3,11 +3,15 @@ set(THREADX4TGFS_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../..)
|
||||
set(MOONLIGHT_SRC_DIR ${MOONLIGHT_ROOT}/src)
|
||||
set(MOONLIGHT_INC_DIR ${MOONLIGHT_ROOT}/inc)
|
||||
|
||||
if(NOT DEFINED MOONLIGHT_TRAP_SOURCE)
|
||||
set(MOONLIGHT_TRAP_SOURCE ${MOONLIGHT_SRC_DIR}/trap_non_vectored.c)
|
||||
endif()
|
||||
|
||||
set(MOONLIGHT_PLATFORM_SOURCES
|
||||
${THREADX4TGFS_ROOT}/port/picolibc/port.c
|
||||
${MOONLIGHT_SRC_DIR}/bootup.c
|
||||
${MOONLIGHT_SRC_DIR}/board.c
|
||||
${MOONLIGHT_SRC_DIR}/trap_non_vectored.c
|
||||
${MOONLIGHT_TRAP_SOURCE}
|
||||
${MOONLIGHT_SRC_DIR}/exception.c
|
||||
${MOONLIGHT_SRC_DIR}/vector_table.c)
|
||||
|
||||
|
||||
@@ -24,6 +24,18 @@ enable_testing()
|
||||
set(TARGET_MEM "ram_dram" CACHE STRING "memory map to use")
|
||||
set(CMAKE_EXECUTABLE_SUFFIX_C ".elf")
|
||||
|
||||
set(MOONLIGHT_TRAP_SOURCE_INPUT ${THREADX4TGFS_ROOT}/port/moonlight/src/trap_non_vectored.c)
|
||||
set(MOONLIGHT_TRAP_SOURCE ${CMAKE_BINARY_DIR}/generated/trap_non_vectored.c)
|
||||
execute_process(
|
||||
COMMAND bash ${CMAKE_CURRENT_LIST_DIR}/threadx/generate_trap_file.sh
|
||||
${MOONLIGHT_TRAP_SOURCE_INPUT}
|
||||
${MOONLIGHT_TRAP_SOURCE}
|
||||
RESULT_VARIABLE MOONLIGHT_TRAP_GENERATE_RESULT
|
||||
)
|
||||
if(NOT MOONLIGHT_TRAP_GENERATE_RESULT EQUAL 0)
|
||||
message(FATAL_ERROR "Failed to generate regression trap source")
|
||||
endif()
|
||||
|
||||
add_subdirectory(${THREADX4TGFS_ROOT}/port/moonlight ${CMAKE_BINARY_DIR}/port/moonlight)
|
||||
|
||||
function(setup_target TARGET)
|
||||
|
||||
27
test/threadx/generate_trap_file.sh
Executable file
27
test/threadx/generate_trap_file.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
set -eu
|
||||
|
||||
src="$1"
|
||||
dst="$2"
|
||||
|
||||
extern_anchor='extern void _tx_timer_interrupt(void);'
|
||||
call_anchor='_tx_timer_interrupt();'
|
||||
|
||||
line=$(grep -n -F "$extern_anchor" "$src" | head -n 1 | cut -d: -f1)
|
||||
if [ -z "$line" ]; then
|
||||
echo "failed to find _tx_timer_interrupt declaration anchor in trap source" >&2
|
||||
exit 1
|
||||
fi
|
||||
sed "${line}a\\
|
||||
extern void test_interrupt_dispatch(void);" "$src" > "$dst.tmp1"
|
||||
|
||||
line=$(grep -n -F "$call_anchor" "$dst.tmp1" | head -n 1 | cut -d: -f1)
|
||||
if [ -z "$line" ]; then
|
||||
echo "failed to find _tx_timer_interrupt call anchor in trap source" >&2
|
||||
rm -f "$dst.tmp1"
|
||||
exit 1
|
||||
fi
|
||||
mkdir -p "$(dirname "$dst")"
|
||||
sed "${line}i\\
|
||||
test_interrupt_dispatch();" "$dst.tmp1" > "$dst"
|
||||
rm -f "$dst.tmp1"
|
||||
Reference in New Issue
Block a user