Skip to content
Open
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
62 changes: 58 additions & 4 deletions common/inc/tx_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,8 @@ typedef struct TX_TIMER_INTERNAL_STRUCT
ULONG tx_timer_internal_re_initialize_ticks;

/* Define the timeout function and timeout function parameter. */
VOID (*tx_timer_internal_timeout_function)(ULONG id);
ULONG tx_timer_internal_timeout_param;
VOID (*tx_timer_internal_timeout_function)(ALIGN_TYPE id);
ALIGN_TYPE tx_timer_internal_timeout_param;


/* Define the next and previous internal link pointers for active
Expand Down Expand Up @@ -465,8 +465,8 @@ typedef struct TX_THREAD_STRUCT
is recompiled. */

/* Define the thread's entry point and input parameter. */
VOID (*tx_thread_entry)(ULONG id);
ULONG tx_thread_entry_parameter;
VOID (*tx_thread_entry)(ALIGN_TYPE id);
ALIGN_TYPE tx_thread_entry_parameter;

/* Define the thread's timer block. This is used for thread
sleep and timeout requests. */
Expand Down Expand Up @@ -1140,7 +1140,12 @@ UINT _tx_trace_interrupt_control(UINT new_posture);
#define tx_semaphore_put _tx_semaphore_put
#define tx_semaphore_put_notify _tx_semaphore_put_notify

#define tx_thread_create_ptr _tx_thread_create_ptr
#ifdef TX_ENABLE_POINTER_CALLBACKS
#define tx_thread_create _tx_thread_create_ptr
#else
#define tx_thread_create _tx_thread_create
#endif
#define tx_thread_delete _tx_thread_delete
#define tx_thread_entry_exit_notify _tx_thread_entry_exit_notify
#define tx_thread_identify _tx_thread_identify
Expand All @@ -1163,7 +1168,12 @@ 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
#define tx_timer_create_ptr _tx_timer_create_ptr
#ifdef TX_ENABLE_POINTER_CALLBACKS
#define tx_timer_create _tx_timer_create_ptr
#else
#define tx_timer_create _tx_timer_create
#endif
#define tx_timer_deactivate _tx_timer_deactivate
#define tx_timer_delete _tx_timer_delete
#define tx_timer_info_get _tx_timer_info_get
Expand Down Expand Up @@ -1263,7 +1273,12 @@ UINT _tx_trace_interrupt_control(UINT new_posture);
#define tx_semaphore_put _txr_semaphore_put
#define tx_semaphore_put_notify _txr_semaphore_put_notify

#define tx_thread_create_ptr(t,n,e,i,s,l,p,r,c,a) _txr_thread_create_ptr((t),(n),(e),(i),(s),(l),(p),(r),(c),(a),(sizeof(TX_THREAD)))
#ifdef TX_ENABLE_POINTER_CALLBACKS
#define tx_thread_create(t,n,e,i,s,l,p,r,c,a) _txr_thread_create_ptr((t),(n),(e),(i),(s),(l),(p),(r),(c),(a),(sizeof(TX_THREAD)))
#else
#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)))
#endif
#define tx_thread_delete _txr_thread_delete
#define tx_thread_entry_exit_notify _txr_thread_entry_exit_notify
#define tx_thread_identify _tx_thread_identify
Expand All @@ -1286,7 +1301,12 @@ 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
#define tx_timer_create_ptr(t,n,e,i,c,r,a) _txr_timer_create_ptr((t),(n),(e),(i),(c),(r),(a),(sizeof(TX_TIMER)))
#ifdef TX_ENABLE_POINTER_CALLBACKS
#define tx_timer_create(t,n,e,i,c,r,a) _txr_timer_create_ptr((t),(n),(e),(i),(c),(r),(a),(sizeof(TX_TIMER)))
#else
#define tx_timer_create(t,n,e,i,c,r,a) _txr_timer_create((t),(n),(e),(i),(c),(r),(a),(sizeof(TX_TIMER)))
#endif
#define tx_timer_deactivate _txr_timer_deactivate
#define tx_timer_delete _txr_timer_delete
#define tx_timer_info_get _txr_timer_info_get
Expand Down Expand Up @@ -1374,7 +1394,12 @@ UINT _tx_el_interrupt_control(UINT new_posture);
#define tx_semaphore_put _txe_semaphore_put
#define tx_semaphore_put_notify _txe_semaphore_put_notify

#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)))
#ifdef TX_ENABLE_POINTER_CALLBACKS
#define tx_thread_create(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(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)))
#endif
#define tx_thread_delete _txe_thread_delete
#define tx_thread_entry_exit_notify _txe_thread_entry_exit_notify
#define tx_thread_identify _tx_thread_identify
Expand All @@ -1397,7 +1422,12 @@ 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
#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)))
#ifdef TX_ENABLE_POINTER_CALLBACKS
#define tx_timer_create(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(t,n,e,i,c,r,a) _txe_timer_create((t),(n),(e),(i),(c),(r),(a),(sizeof(TX_TIMER)))
#endif
#define tx_timer_deactivate _txe_timer_deactivate
#define tx_timer_delete _txe_timer_delete
#define tx_timer_info_get _txe_timer_info_get
Expand Down Expand Up @@ -1704,6 +1734,11 @@ 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);
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);
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 +1776,11 @@ 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);
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);
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 All @@ -1763,6 +1803,11 @@ UINT _txr_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);
UINT _txr_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);
UINT _txr_thread_delete(TX_THREAD *thread_ptr);
UINT _txr_thread_entry_exit_notify(TX_THREAD *thread_ptr, VOID (*thread_entry_exit_notify)(TX_THREAD *notify_thread_ptr, UINT type));
UINT _txr_thread_info_get(TX_THREAD *thread_ptr, TX_NAME_CONST CHAR **name, UINT *state, ULONG *run_count,
Expand All @@ -1788,6 +1833,9 @@ 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);
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);
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 +1857,9 @@ 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);
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);
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 All @@ -1819,6 +1870,9 @@ UINT _txr_timer_change(TX_TIMER *timer_ptr, ULONG initial_ticks, ULONG re
UINT _txr_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);
UINT _txr_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);
UINT _txr_timer_deactivate(TX_TIMER *timer_ptr);
UINT _txr_timer_delete(TX_TIMER *timer_ptr);
UINT _txr_timer_info_get(TX_TIMER *timer_ptr, TX_NAME_CONST CHAR **name, UINT *active, ULONG *remaining_ticks,
Expand Down
6 changes: 3 additions & 3 deletions common/inc/tx_thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,14 @@

#ifndef TX_THREAD_CREATE_TIMEOUT_SETUP
#define TX_THREAD_CREATE_TIMEOUT_SETUP(t) (t) -> tx_thread_timer.tx_timer_internal_timeout_function = &(_tx_thread_timeout); \
(t) -> tx_thread_timer.tx_timer_internal_timeout_param = TX_POINTER_TO_ULONG_CONVERT((t));
(t) -> tx_thread_timer.tx_timer_internal_timeout_param = (ALIGN_TYPE) ((VOID *) (t));
#endif


/* Define the thread timeout pointer setup macro used in _tx_thread_timeout. */

#ifndef TX_THREAD_TIMEOUT_POINTER_SETUP
#define TX_THREAD_TIMEOUT_POINTER_SETUP(t) (t) = TX_ULONG_TO_THREAD_POINTER_CONVERT(timeout_input);
#define TX_THREAD_TIMEOUT_POINTER_SETUP(t) (t) = (TX_THREAD *) ((VOID *) (timeout_input));
#endif


Expand Down Expand Up @@ -274,7 +274,7 @@ VOID _tx_thread_system_return(VOID);
VOID _tx_thread_system_suspend(TX_THREAD *thread_ptr);
VOID _tx_thread_system_ni_suspend(TX_THREAD *thread_ptr, ULONG wait_option);
VOID _tx_thread_time_slice(VOID);
VOID _tx_thread_timeout(ULONG timeout_input);
VOID _tx_thread_timeout(ALIGN_TYPE timeout_input);


/* Thread control component data declarations follow. */
Expand Down
Loading
Loading