Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 23 additions & 23 deletions .github/workflows/module_qemu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,30 +122,30 @@ jobs:

status=0
for port in cortex_m3 cortex_m4; do
build="build/module_qemu_$port"
echo ""
echo "=============================================================="
echo "== $port"
echo "=============================================================="
for pointer_context in OFF ON; do
config="$port (pointer context $pointer_context)"
build="build/module_qemu_${port}_$pointer_context"
echo "== $config"

if ! cmake -S test/tx/cmake/module_qemu -B "$build" -G Ninja \
-DCMAKE_TOOLCHAIN_FILE="$PWD/test/tx/cmake/module_qemu/arm-none-eabi-qemu.cmake" \
-DMODULE_QEMU_PORT="$port"; then
echo "::error::$port: CMake configure failed"
status=1
continue
fi
if ! cmake --build "$build"; then
echo "::error::$port: the images did not build"
status=1
continue
fi
# --no-tests=error: the tests are registered only when QEMU and
# Python are found, and ctest's default would pass on none.
if ! ctest --test-dir "$build" --output-on-failure --no-tests=error; then
echo "::error::$port: one or more images failed on QEMU, or no tests were registered"
status=1
fi
if ! cmake -S test/tx/cmake/module_qemu -B "$build" -G Ninja \
-DCMAKE_TOOLCHAIN_FILE="$PWD/test/tx/cmake/module_qemu/arm-none-eabi-qemu.cmake" \
-DMODULE_QEMU_PORT="$port" -DMODULE_QEMU_POINTER_CONTEXT="$pointer_context"; then
echo "::error::$config: CMake configure failed"
status=1
continue
fi
if ! cmake --build "$build"; then
echo "::error::$config: the images did not build"
status=1
continue
fi
# --no-tests=error: the tests are registered only when QEMU and
# Python are found, and ctest's default would pass on none.
if ! ctest --test-dir "$build" --output-on-failure --no-tests=error; then
echo "::error::$config: one or more images failed on QEMU, or no tests were registered"
status=1
fi
done
done

exit $status
70 changes: 70 additions & 0 deletions common/inc/tx_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,12 @@ typedef struct TX_TIMER_INTERNAL_STRUCT
#endif


#ifdef TX_ENABLE_POINTER_CONTEXT
/* Deliver a snapshotted pointer callback through the object's owner. */
typedef VOID (*TX_TIMER_POINTER_DISPATCH)(VOID *owner, VOID (*callback)(VOID *), VOID *input);
#endif


/* Define the timer structure utilized by the application. */

typedef struct TX_TIMER_STRUCT
Expand Down Expand Up @@ -413,6 +419,14 @@ typedef struct TX_TIMER_STRUCT
ULONG tx_timer_performance__expiration_adjust_count;
#endif

#ifdef TX_ENABLE_POINTER_CONTEXT
/* Pointer callback storage follows the port and user fields. */
VOID (*tx_timer_timeout_function_ptr)(VOID *input);
VOID *tx_timer_timeout_param_ptr;
TX_TIMER_POINTER_DISPATCH tx_timer_timeout_dispatch;
VOID *tx_timer_timeout_owner;
#endif

} TX_TIMER;


Expand Down Expand Up @@ -596,6 +610,12 @@ typedef struct TX_THREAD_STRUCT
defined in the file tx_port.h. */
TX_THREAD_USER_EXTENSION

#ifdef TX_ENABLE_POINTER_CONTEXT
/* Pointer callback storage follows the port and user fields. */
VOID (*tx_thread_entry_ptr)(VOID *input);
VOID *tx_thread_entry_parameter_ptr;
#endif

} TX_THREAD;


Expand Down Expand Up @@ -1140,6 +1160,13 @@ UINT _tx_trace_interrupt_control(UINT new_posture);
#define tx_semaphore_put _tx_semaphore_put
#define tx_semaphore_put_notify _tx_semaphore_put_notify

#ifdef TX_ENABLE_POINTER_CONTEXT
#ifdef TXM_MODULE
#define tx_thread_create_ptr(t,n,e,i,s,l,p,r,c,a) _txe_thread_create_ptr((t),(n),(e),(i),(s),(l),(p),(r),(c),(a),(sizeof(TX_THREAD)))
#else
#define tx_thread_create_ptr _tx_thread_create_ptr
#endif
#endif
#define tx_thread_create _tx_thread_create
#define tx_thread_delete _tx_thread_delete
#define tx_thread_entry_exit_notify _tx_thread_entry_exit_notify
Expand All @@ -1163,6 +1190,13 @@ UINT _tx_trace_interrupt_control(UINT new_posture);
#define tx_time_set _tx_time_set
#define tx_timer_activate _tx_timer_activate
#define tx_timer_change _tx_timer_change
#ifdef TX_ENABLE_POINTER_CONTEXT
#ifdef TXM_MODULE
#define tx_timer_create_ptr(t,n,e,i,c,r,a) _txe_timer_create_ptr((t),(n),(e),(i),(c),(r),(a),(sizeof(TX_TIMER)))
#else
#define tx_timer_create_ptr _tx_timer_create_ptr
#endif
#endif
#define tx_timer_create _tx_timer_create
#define tx_timer_deactivate _tx_timer_deactivate
#define tx_timer_delete _tx_timer_delete
Expand Down Expand Up @@ -1263,6 +1297,9 @@ UINT _tx_trace_interrupt_control(UINT new_posture);
#define tx_semaphore_put _txr_semaphore_put
#define tx_semaphore_put_notify _txr_semaphore_put_notify

#ifdef TX_ENABLE_POINTER_CONTEXT
#define tx_thread_create_ptr(t,n,e,i,s,l,p,r,c,a) _txe_thread_create_ptr((t),(n),(e),(i),(s),(l),(p),(r),(c),(a),(sizeof(TX_THREAD)))
#endif
#define tx_thread_create(t,n,e,i,s,l,p,r,c,a) _txr_thread_create((t),(n),(e),(i),(s),(l),(p),(r),(c),(a),(sizeof(TX_THREAD)))
#define tx_thread_delete _txr_thread_delete
#define tx_thread_entry_exit_notify _txr_thread_entry_exit_notify
Expand All @@ -1286,6 +1323,9 @@ UINT _tx_trace_interrupt_control(UINT new_posture);
#define tx_time_set _tx_time_set
#define tx_timer_activate _txr_timer_activate
#define tx_timer_change _txr_timer_change
#ifdef TX_ENABLE_POINTER_CONTEXT
#define tx_timer_create_ptr(t,n,e,i,c,r,a) _txe_timer_create_ptr((t),(n),(e),(i),(c),(r),(a),(sizeof(TX_TIMER)))
#endif
#define tx_timer_create(t,n,e,i,c,r,a) _txr_timer_create((t),(n),(e),(i),(c),(r),(a),(sizeof(TX_TIMER)))
#define tx_timer_deactivate _txr_timer_deactivate
#define tx_timer_delete _txr_timer_delete
Expand Down Expand Up @@ -1374,6 +1414,9 @@ UINT _tx_el_interrupt_control(UINT new_posture);
#define tx_semaphore_put _txe_semaphore_put
#define tx_semaphore_put_notify _txe_semaphore_put_notify

#ifdef TX_ENABLE_POINTER_CONTEXT
#define tx_thread_create_ptr(t,n,e,i,s,l,p,r,c,a) _txe_thread_create_ptr((t),(n),(e),(i),(s),(l),(p),(r),(c),(a),(sizeof(TX_THREAD)))
#endif
#define tx_thread_create(t,n,e,i,s,l,p,r,c,a) _txe_thread_create((t),(n),(e),(i),(s),(l),(p),(r),(c),(a),(sizeof(TX_THREAD)))
#define tx_thread_delete _txe_thread_delete
#define tx_thread_entry_exit_notify _txe_thread_entry_exit_notify
Expand All @@ -1397,6 +1440,9 @@ UINT _tx_el_interrupt_control(UINT new_posture);
#define tx_time_set _tx_time_set
#define tx_timer_activate _txe_timer_activate
#define tx_timer_change _txe_timer_change
#ifdef TX_ENABLE_POINTER_CONTEXT
#define tx_timer_create_ptr(t,n,e,i,c,r,a) _txe_timer_create_ptr((t),(n),(e),(i),(c),(r),(a),(sizeof(TX_TIMER)))
#endif
#define tx_timer_create(t,n,e,i,c,r,a) _txe_timer_create((t),(n),(e),(i),(c),(r),(a),(sizeof(TX_TIMER)))
#define tx_timer_deactivate _txe_timer_deactivate
#define tx_timer_delete _txe_timer_delete
Expand Down Expand Up @@ -1704,6 +1750,13 @@ UINT _tx_thread_create(TX_THREAD *thread_ptr, TX_NAME_CONST CHAR *name_pt
VOID *stack_start, ULONG stack_size,
UINT priority, UINT preempt_threshold,
ULONG time_slice, UINT auto_start);
#ifdef TX_ENABLE_POINTER_CONTEXT
UINT _tx_thread_create_ptr(TX_THREAD *thread_ptr, TX_NAME_CONST CHAR *name_ptr,
VOID (*entry_function)(VOID *entry_input), VOID *entry_input,
VOID *stack_start, ULONG stack_size,
UINT priority, UINT preempt_threshold,
ULONG time_slice, UINT auto_start);
#endif
UINT _tx_thread_delete(TX_THREAD *thread_ptr);
UINT _tx_thread_entry_exit_notify(TX_THREAD *thread_ptr, VOID (*thread_entry_exit_notify)(TX_THREAD *notify_thread_ptr, UINT type));
TX_THREAD *_tx_thread_identify(VOID);
Expand Down Expand Up @@ -1741,6 +1794,13 @@ UINT _txe_thread_create(TX_THREAD *thread_ptr, TX_NAME_CONST CHAR *name_p
VOID *stack_start, ULONG stack_size,
UINT priority, UINT preempt_threshold,
ULONG time_slice, UINT auto_start, UINT thread_control_block_size);
#ifdef TX_ENABLE_POINTER_CONTEXT
UINT _txe_thread_create_ptr(TX_THREAD *thread_ptr, TX_NAME_CONST CHAR *name_ptr,
VOID (*entry_function)(VOID *entry_input), VOID *entry_input,
VOID *stack_start, ULONG stack_size,
UINT priority, UINT preempt_threshold,
ULONG time_slice, UINT auto_start, UINT thread_control_block_size);
#endif
UINT _txe_thread_delete(TX_THREAD *thread_ptr);
UINT _txe_thread_entry_exit_notify(TX_THREAD *thread_ptr, VOID (*thread_entry_exit_notify)(TX_THREAD *notify_thread_ptr, UINT type));
UINT _txe_thread_info_get(TX_THREAD *thread_ptr, TX_NAME_CONST CHAR **name, UINT *state, ULONG *run_count,
Expand Down Expand Up @@ -1788,6 +1848,11 @@ UINT _tx_timer_change(TX_TIMER *timer_ptr, ULONG initial_ticks, ULONG res
UINT _tx_timer_create(TX_TIMER *timer_ptr, TX_NAME_CONST CHAR *name_ptr,
VOID (*expiration_function)(ULONG input), ULONG expiration_input,
ULONG initial_ticks, ULONG reschedule_ticks, UINT auto_activate);
#ifdef TX_ENABLE_POINTER_CONTEXT
UINT _tx_timer_create_ptr(TX_TIMER *timer_ptr, TX_NAME_CONST CHAR *name_ptr,
VOID (*expiration_function)(VOID *input), VOID *expiration_input,
ULONG initial_ticks, ULONG reschedule_ticks, UINT auto_activate);
#endif
UINT _tx_timer_deactivate(TX_TIMER *timer_ptr);
UINT _tx_timer_delete(TX_TIMER *timer_ptr);
UINT _tx_timer_info_get(TX_TIMER *timer_ptr, TX_NAME_CONST CHAR **name, UINT *active, ULONG *remaining_ticks,
Expand All @@ -1809,6 +1874,11 @@ UINT _txe_timer_change(TX_TIMER *timer_ptr, ULONG initial_ticks, ULONG re
UINT _txe_timer_create(TX_TIMER *timer_ptr, TX_NAME_CONST CHAR *name_ptr,
VOID (*expiration_function)(ULONG input), ULONG expiration_input,
ULONG initial_ticks, ULONG reschedule_ticks, UINT auto_activate, UINT timer_control_block_size);
#ifdef TX_ENABLE_POINTER_CONTEXT
UINT _txe_timer_create_ptr(TX_TIMER *timer_ptr, TX_NAME_CONST CHAR *name_ptr,
VOID (*expiration_function)(VOID *input), VOID *expiration_input,
ULONG initial_ticks, ULONG reschedule_ticks, UINT auto_activate, UINT timer_control_block_size);
#endif
UINT _txe_timer_deactivate(TX_TIMER *timer_ptr);
UINT _txe_timer_delete(TX_TIMER *timer_ptr);
UINT _txe_timer_info_get(TX_TIMER *timer_ptr, TX_NAME_CONST CHAR **name, UINT *active, ULONG *remaining_ticks,
Expand Down
13 changes: 13 additions & 0 deletions common/inc/tx_timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*
* SPDX-License-Identifier: MIT
**************************************************************************/
// Portions of this file were generated with AI assistance.


/**************************************************************************/
Expand Down Expand Up @@ -204,4 +205,16 @@ TIMER_DECLARE ULONG _tx_timer_performance__expiration_adjust_count;
#endif


#ifdef TX_ENABLE_POINTER_CONTEXT
UINT _tx_timer_create_ptr_dispatch(TX_TIMER *timer_ptr, TX_NAME_CONST CHAR *name_ptr,
VOID (*expiration_function)(VOID *), VOID *expiration_input,
TX_TIMER_POINTER_DISPATCH dispatch, VOID *owner,
ULONG initial_ticks, ULONG reschedule_ticks, UINT auto_activate);
UINT _txe_timer_create_ptr_dispatch(TX_TIMER *timer_ptr, TX_NAME_CONST CHAR *name_ptr,
VOID (*expiration_function)(VOID *), VOID *expiration_input,
TX_TIMER_POINTER_DISPATCH dispatch, VOID *owner,
ULONG initial_ticks, ULONG reschedule_ticks, UINT auto_activate,
UINT timer_control_block_size);
#endif

#endif
8 changes: 8 additions & 0 deletions common/inc/tx_user_sample.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,14 @@
#endif
*/

/* Enable tx_thread_create_ptr and tx_timer_create_ptr with VOID * contexts.
Use the same setting for the kernel, applications, Module Manager, module
library, and loadable modules. It changes the TX_THREAD and TX_TIMER sizes. */

/*
#define TX_ENABLE_POINTER_CONTEXT
*/

/* Determine if the notify callback option should be disabled. By default, notify callbacks are
enabled. If the application does not use notify callbacks, they may be disabled to reduce
code size and improve performance. */
Expand Down
Loading