From 083565251e09942994b8395006f2654f823e3e41 Mon Sep 17 00:00:00 2001 From: Eyck-Alexander Jentzsch Date: Sat, 21 Mar 2026 15:40:54 +0100 Subject: [PATCH] cleans up moonlight dir --- port/moonlight/CMakeLists.txt | 16 +++++++++------- port/moonlight/{ => inc}/aclint.h | 0 port/moonlight/{ => inc}/aclint_ipi.h | 0 port/moonlight/{ => inc}/gen/aclint.h | 0 port/moonlight/{ => inc}/gen/ethmac.h | 0 port/moonlight/{ => inc}/gen/uart.h | 0 port/moonlight/{ => inc}/hwtimer.h | 2 +- port/moonlight/{ => inc}/platform.h | 0 port/moonlight/{ => inc}/riscv-csr.h | 0 port/moonlight/{ => inc}/riscv-traps.h | 0 port/moonlight/{ => inc}/uart.h | 0 port/moonlight/{ => inc}/vector_table.h | 0 port/moonlight/{ => src}/board.c | 0 port/moonlight/{ => src}/bootup.c | 0 port/moonlight/{ => src}/exception.c | 0 port/moonlight/{ => src}/mnrs_network_driver.c | 0 port/moonlight/{ => src}/trap_non_vectored.c | 0 port/moonlight/{ => src}/trap_vectored.c | 0 port/moonlight/{ => src}/vector_table.c | 0 port/threadx_smp/CMakeLists.txt | 2 +- 20 files changed, 11 insertions(+), 9 deletions(-) rename port/moonlight/{ => inc}/aclint.h (100%) rename port/moonlight/{ => inc}/aclint_ipi.h (100%) rename port/moonlight/{ => inc}/gen/aclint.h (100%) rename port/moonlight/{ => inc}/gen/ethmac.h (100%) rename port/moonlight/{ => inc}/gen/uart.h (100%) rename port/moonlight/{ => inc}/hwtimer.h (92%) rename port/moonlight/{ => inc}/platform.h (100%) rename port/moonlight/{ => inc}/riscv-csr.h (100%) rename port/moonlight/{ => inc}/riscv-traps.h (100%) rename port/moonlight/{ => inc}/uart.h (100%) rename port/moonlight/{ => inc}/vector_table.h (100%) rename port/moonlight/{ => src}/board.c (100%) rename port/moonlight/{ => src}/bootup.c (100%) rename port/moonlight/{ => src}/exception.c (100%) rename port/moonlight/{ => src}/mnrs_network_driver.c (100%) rename port/moonlight/{ => src}/trap_non_vectored.c (100%) rename port/moonlight/{ => src}/trap_vectored.c (100%) rename port/moonlight/{ => src}/vector_table.c (100%) diff --git a/port/moonlight/CMakeLists.txt b/port/moonlight/CMakeLists.txt index a211b39..febfa5c 100644 --- a/port/moonlight/CMakeLists.txt +++ b/port/moonlight/CMakeLists.txt @@ -1,17 +1,19 @@ set(MOONLIGHT_ROOT ${CMAKE_CURRENT_LIST_DIR}) set(THREADX4TGFS_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../..) +set(MOONLIGHT_SRC_DIR ${MOONLIGHT_ROOT}/src) +set(MOONLIGHT_INC_DIR ${MOONLIGHT_ROOT}/inc) set(MOONLIGHT_PLATFORM_SOURCES ${THREADX4TGFS_ROOT}/port/picolibc/port.c - ${MOONLIGHT_ROOT}/bootup.c - ${MOONLIGHT_ROOT}/board.c - ${MOONLIGHT_ROOT}/trap_non_vectored.c - ${MOONLIGHT_ROOT}/exception.c - ${MOONLIGHT_ROOT}/vector_table.c) + ${MOONLIGHT_SRC_DIR}/bootup.c + ${MOONLIGHT_SRC_DIR}/board.c + ${MOONLIGHT_SRC_DIR}/trap_non_vectored.c + ${MOONLIGHT_SRC_DIR}/exception.c + ${MOONLIGHT_SRC_DIR}/vector_table.c) add_library(moonlight_platform_defaults INTERFACE) target_include_directories(moonlight_platform_defaults INTERFACE - ${MOONLIGHT_ROOT} + ${MOONLIGHT_INC_DIR} ${THREADX4TGFS_ROOT}/src) target_compile_options(moonlight_platform_defaults INTERFACE -ffreestanding @@ -39,7 +41,7 @@ target_link_libraries(moonlight_platform_common PUBLIC threadx) add_library(moonlight_network_driver OBJECT - ${MOONLIGHT_ROOT}/mnrs_network_driver.c) + ${MOONLIGHT_SRC_DIR}/mnrs_network_driver.c) target_link_libraries(moonlight_network_driver PUBLIC moonlight_platform_defaults c diff --git a/port/moonlight/aclint.h b/port/moonlight/inc/aclint.h similarity index 100% rename from port/moonlight/aclint.h rename to port/moonlight/inc/aclint.h diff --git a/port/moonlight/aclint_ipi.h b/port/moonlight/inc/aclint_ipi.h similarity index 100% rename from port/moonlight/aclint_ipi.h rename to port/moonlight/inc/aclint_ipi.h diff --git a/port/moonlight/gen/aclint.h b/port/moonlight/inc/gen/aclint.h similarity index 100% rename from port/moonlight/gen/aclint.h rename to port/moonlight/inc/gen/aclint.h diff --git a/port/moonlight/gen/ethmac.h b/port/moonlight/inc/gen/ethmac.h similarity index 100% rename from port/moonlight/gen/ethmac.h rename to port/moonlight/inc/gen/ethmac.h diff --git a/port/moonlight/gen/uart.h b/port/moonlight/inc/gen/uart.h similarity index 100% rename from port/moonlight/gen/uart.h rename to port/moonlight/inc/gen/uart.h diff --git a/port/moonlight/hwtimer.h b/port/moonlight/inc/hwtimer.h similarity index 92% rename from port/moonlight/hwtimer.h rename to port/moonlight/inc/hwtimer.h index fb7e7a9..0c339fd 100644 --- a/port/moonlight/hwtimer.h +++ b/port/moonlight/inc/hwtimer.h @@ -15,7 +15,7 @@ #include "platform.h" #define TICKNUM_PER_SECOND 32768 -#define TICKNUM_PER_TIMER (TICKNUM_PER_SECOND / 100) // ~ 1ms timer +#define TICKNUM_PER_TIMER (TICKNUM_PER_SECOND / 1000) // ~ 1ms timer static inline int hwtimer_init(void) { diff --git a/port/moonlight/platform.h b/port/moonlight/inc/platform.h similarity index 100% rename from port/moonlight/platform.h rename to port/moonlight/inc/platform.h diff --git a/port/moonlight/riscv-csr.h b/port/moonlight/inc/riscv-csr.h similarity index 100% rename from port/moonlight/riscv-csr.h rename to port/moonlight/inc/riscv-csr.h diff --git a/port/moonlight/riscv-traps.h b/port/moonlight/inc/riscv-traps.h similarity index 100% rename from port/moonlight/riscv-traps.h rename to port/moonlight/inc/riscv-traps.h diff --git a/port/moonlight/uart.h b/port/moonlight/inc/uart.h similarity index 100% rename from port/moonlight/uart.h rename to port/moonlight/inc/uart.h diff --git a/port/moonlight/vector_table.h b/port/moonlight/inc/vector_table.h similarity index 100% rename from port/moonlight/vector_table.h rename to port/moonlight/inc/vector_table.h diff --git a/port/moonlight/board.c b/port/moonlight/src/board.c similarity index 100% rename from port/moonlight/board.c rename to port/moonlight/src/board.c diff --git a/port/moonlight/bootup.c b/port/moonlight/src/bootup.c similarity index 100% rename from port/moonlight/bootup.c rename to port/moonlight/src/bootup.c diff --git a/port/moonlight/exception.c b/port/moonlight/src/exception.c similarity index 100% rename from port/moonlight/exception.c rename to port/moonlight/src/exception.c diff --git a/port/moonlight/mnrs_network_driver.c b/port/moonlight/src/mnrs_network_driver.c similarity index 100% rename from port/moonlight/mnrs_network_driver.c rename to port/moonlight/src/mnrs_network_driver.c diff --git a/port/moonlight/trap_non_vectored.c b/port/moonlight/src/trap_non_vectored.c similarity index 100% rename from port/moonlight/trap_non_vectored.c rename to port/moonlight/src/trap_non_vectored.c diff --git a/port/moonlight/trap_vectored.c b/port/moonlight/src/trap_vectored.c similarity index 100% rename from port/moonlight/trap_vectored.c rename to port/moonlight/src/trap_vectored.c diff --git a/port/moonlight/vector_table.c b/port/moonlight/src/vector_table.c similarity index 100% rename from port/moonlight/vector_table.c rename to port/moonlight/src/vector_table.c diff --git a/port/threadx_smp/CMakeLists.txt b/port/threadx_smp/CMakeLists.txt index 898381a..e4c04ee 100644 --- a/port/threadx_smp/CMakeLists.txt +++ b/port/threadx_smp/CMakeLists.txt @@ -10,7 +10,7 @@ endif() set(THREADX_SMP_CUSTOM_INC ${CMAKE_CURRENT_SOURCE_DIR}/inc - ${CMAKE_CURRENT_SOURCE_DIR}/../moonlight #needed for aclint (inter process interrupts) + ${CMAKE_CURRENT_SOURCE_DIR}/../moonlight/inc # needed for Moonlight SMP support headers ) set(THREADX_SMP_CUSTOM_SRC src/tx_initialize_low_level.S