Release 6.1.10

This commit is contained in:
Yuxin Zhou
2022-01-29 00:24:03 +00:00
parent b216ceb25e
commit f7f0957188
3111 changed files with 495735 additions and 40800 deletions

View File

@@ -20,6 +20,7 @@
/**************************************************************************/
/**************************************************************************/
#ifndef TXM_BLOCK_ALLOCATE_CALL_NOT_USED
/* UINT _txe_block_allocate(
TX_BLOCK_POOL *pool_ptr, -> param_0
VOID **block_ptr, -> param_1
@@ -46,7 +47,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_BLOCK_POOL_CREATE_CALL_NOT_USED
/* UINT _txe_block_pool_create(
TX_BLOCK_POOL *pool_ptr, -> param_0
CHAR *name_ptr, -> param_1
@@ -85,7 +88,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_BLOCK_POOL_DELETE_CALL_NOT_USED
/* UINT _txe_block_pool_delete(
TX_BLOCK_POOL *pool_ptr -> param_0
); */
@@ -111,7 +116,9 @@ ALIGN_TYPE return_value;
}
return(return_value);
}
#endif
#ifndef TXM_BLOCK_POOL_INFO_GET_CALL_NOT_USED
/* UINT _txe_block_pool_info_get(
TX_BLOCK_POOL *pool_ptr, -> param_0
CHAR **name, -> param_1
@@ -164,7 +171,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_BLOCK_POOL_PERFORMANCE_INFO_GET_CALL_NOT_USED
/* UINT _tx_block_pool_performance_info_get(
TX_BLOCK_POOL *pool_ptr, -> param_0
ULONG *allocates, -> param_1
@@ -207,7 +216,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_BLOCK_POOL_PERFORMANCE_SYSTEM_INFO_GET_CALL_NOT_USED
/* UINT _tx_block_pool_performance_system_info_get(
ULONG *allocates, -> param_0
ULONG *releases, -> param_1
@@ -245,7 +256,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_BLOCK_POOL_PRIORITIZE_CALL_NOT_USED
/* UINT _txe_block_pool_prioritize(
TX_BLOCK_POOL *pool_ptr -> param_0
); */
@@ -265,7 +278,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_BLOCK_RELEASE_CALL_NOT_USED
/* UINT _txe_block_release(
VOID *block_ptr -> param_0
); */
@@ -304,7 +319,9 @@ ALIGN_TYPE block_header_start;
);
return(return_value);
}
#endif
#ifndef TXM_BYTE_ALLOCATE_CALL_NOT_USED
/* UINT _txe_byte_allocate(
TX_BYTE_POOL *pool_ptr, -> param_0
VOID **memory_ptr, -> param_1
@@ -336,7 +353,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_BYTE_POOL_CREATE_CALL_NOT_USED
/* UINT _txe_byte_pool_create(
TX_BYTE_POOL *pool_ptr, -> param_0
CHAR *name_ptr, -> param_1
@@ -373,7 +392,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_BYTE_POOL_DELETE_CALL_NOT_USED
/* UINT _txe_byte_pool_delete(
TX_BYTE_POOL *pool_ptr -> param_0
); */
@@ -399,7 +420,9 @@ ALIGN_TYPE return_value;
}
return(return_value);
}
#endif
#ifndef TXM_BYTE_POOL_INFO_GET_CALL_NOT_USED
/* UINT _txe_byte_pool_info_get(
TX_BYTE_POOL *pool_ptr, -> param_0
CHAR **name, -> param_1
@@ -452,7 +475,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_BYTE_POOL_PERFORMANCE_INFO_GET_CALL_NOT_USED
/* UINT _tx_byte_pool_performance_info_get(
TX_BYTE_POOL *pool_ptr, -> param_0
ULONG *allocates, -> param_1
@@ -510,7 +535,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_BYTE_POOL_PERFORMANCE_SYSTEM_INFO_GET_CALL_NOT_USED
/* UINT _tx_byte_pool_performance_system_info_get(
ULONG *allocates, -> param_0
ULONG *releases, -> param_1
@@ -563,7 +590,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_BYTE_POOL_PRIORITIZE_CALL_NOT_USED
/* UINT _txe_byte_pool_prioritize(
TX_BYTE_POOL *pool_ptr -> param_0
); */
@@ -583,7 +612,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_BYTE_RELEASE_CALL_NOT_USED
/* UINT _txe_byte_release(
VOID *memory_ptr -> param_0
); */
@@ -622,7 +653,9 @@ ALIGN_TYPE block_header_start;
);
return(return_value);
}
#endif
#ifndef TXM_EVENT_FLAGS_CREATE_CALL_NOT_USED
/* UINT _txe_event_flags_create(
TX_EVENT_FLAGS_GROUP *group_ptr, -> param_0
CHAR *name_ptr, -> param_1
@@ -649,7 +682,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_EVENT_FLAGS_DELETE_CALL_NOT_USED
/* UINT _txe_event_flags_delete(
TX_EVENT_FLAGS_GROUP *group_ptr -> param_0
); */
@@ -675,7 +710,9 @@ ALIGN_TYPE return_value;
}
return(return_value);
}
#endif
#ifndef TXM_EVENT_FLAGS_GET_CALL_NOT_USED
/* UINT _txe_event_flags_get(
TX_EVENT_FLAGS_GROUP *group_ptr, -> param_0
ULONG requested_flags, -> param_1
@@ -709,7 +746,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_EVENT_FLAGS_INFO_GET_CALL_NOT_USED
/* UINT _txe_event_flags_info_get(
TX_EVENT_FLAGS_GROUP *group_ptr, -> param_0
CHAR **name, -> param_1
@@ -757,7 +796,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_EVENT_FLAGS_PERFORMANCE_INFO_GET_CALL_NOT_USED
/* UINT _tx_event_flags_performance_info_get(
TX_EVENT_FLAGS_GROUP *group_ptr, -> param_0
ULONG *sets, -> param_1
@@ -800,7 +841,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_EVENT_FLAGS_PERFORMANCE_SYSTEM_INFO_GET_CALL_NOT_USED
/* UINT _tx_event_flags_performance_system_info_get(
ULONG *sets, -> param_0
ULONG *gets, -> param_1
@@ -838,7 +881,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_EVENT_FLAGS_SET_CALL_NOT_USED
/* UINT _txe_event_flags_set(
TX_EVENT_FLAGS_GROUP *group_ptr, -> param_0
ULONG flags_to_set, -> param_1
@@ -862,7 +907,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_EVENT_FLAGS_SET_NOTIFY_CALL_NOT_USED
/* UINT _txe_event_flags_set_notify(
TX_EVENT_FLAGS_GROUP *group_ptr, -> param_0
VOID (*events_set_notify)(TX_EVENT_FLAGS_GROUP *) -> param_1
@@ -906,7 +953,9 @@ VOID (*events_set_notify)(TX_EVENT_FLAGS_GROUP *);
);
return(return_value);
}
#endif
#ifndef TXM_MUTEX_CREATE_CALL_NOT_USED
/* UINT _txe_mutex_create(
TX_MUTEX *mutex_ptr, -> param_0
CHAR *name_ptr, -> param_1
@@ -938,7 +987,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_MUTEX_DELETE_CALL_NOT_USED
/* UINT _txe_mutex_delete(
TX_MUTEX *mutex_ptr -> param_0
); */
@@ -964,7 +1015,9 @@ ALIGN_TYPE return_value;
}
return(return_value);
}
#endif
#ifndef TXM_MUTEX_GET_CALL_NOT_USED
/* UINT _txe_mutex_get(
TX_MUTEX *mutex_ptr, -> param_0
ULONG wait_option -> param_1
@@ -986,7 +1039,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_MUTEX_INFO_GET_CALL_NOT_USED
/* UINT _txe_mutex_info_get(
TX_MUTEX *mutex_ptr, -> param_0
CHAR **name, -> param_1
@@ -1039,7 +1094,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_MUTEX_PERFORMANCE_INFO_GET_CALL_NOT_USED
/* UINT _tx_mutex_performance_info_get(
TX_MUTEX *mutex_ptr, -> param_0
ULONG *puts, -> param_1
@@ -1092,7 +1149,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_MUTEX_PERFORMANCE_SYSTEM_INFO_GET_CALL_NOT_USED
/* UINT _tx_mutex_performance_system_info_get(
ULONG *puts, -> param_0
ULONG *gets, -> param_1
@@ -1140,7 +1199,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_MUTEX_PRIORITIZE_CALL_NOT_USED
/* UINT _txe_mutex_prioritize(
TX_MUTEX *mutex_ptr -> param_0
); */
@@ -1160,7 +1221,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_MUTEX_PUT_CALL_NOT_USED
/* UINT _txe_mutex_put(
TX_MUTEX *mutex_ptr -> param_0
); */
@@ -1180,7 +1243,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_QUEUE_CREATE_CALL_NOT_USED
/* UINT _txe_queue_create(
TX_QUEUE *queue_ptr, -> param_0
CHAR *name_ptr, -> param_1
@@ -1219,7 +1284,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_QUEUE_DELETE_CALL_NOT_USED
/* UINT _txe_queue_delete(
TX_QUEUE *queue_ptr -> param_0
); */
@@ -1245,7 +1312,9 @@ ALIGN_TYPE return_value;
}
return(return_value);
}
#endif
#ifndef TXM_QUEUE_FLUSH_CALL_NOT_USED
/* UINT _txe_queue_flush(
TX_QUEUE *queue_ptr -> param_0
); */
@@ -1265,7 +1334,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_QUEUE_FRONT_SEND_CALL_NOT_USED
/* UINT _txe_queue_front_send(
TX_QUEUE *queue_ptr, -> param_0
VOID *source_ptr, -> param_1
@@ -1283,7 +1354,7 @@ TX_QUEUE *queue_ptr;
return(TXM_MODULE_INVALID_MEMORY);
/* We need to get the size of the message from the queue. */
queue_ptr = (TX_QUEUE *) param_0;
queue_ptr = (TX_QUEUE *) param_0;
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_READ(module_instance, param_1, queue_ptr -> tx_queue_message_size))
return(TXM_MODULE_INVALID_MEMORY);
}
@@ -1295,7 +1366,9 @@ TX_QUEUE *queue_ptr;
);
return(return_value);
}
#endif
#ifndef TXM_QUEUE_INFO_GET_CALL_NOT_USED
/* UINT _txe_queue_info_get(
TX_QUEUE *queue_ptr, -> param_0
CHAR **name, -> param_1
@@ -1348,7 +1421,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_QUEUE_PERFORMANCE_INFO_GET_CALL_NOT_USED
/* UINT _tx_queue_performance_info_get(
TX_QUEUE *queue_ptr, -> param_0
ULONG *messages_sent, -> param_1
@@ -1401,7 +1476,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_QUEUE_PERFORMANCE_SYSTEM_INFO_GET_CALL_NOT_USED
/* UINT _tx_queue_performance_system_info_get(
ULONG *messages_sent, -> param_0
ULONG *messages_received, -> param_1
@@ -1449,7 +1526,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_QUEUE_PRIORITIZE_CALL_NOT_USED
/* UINT _txe_queue_prioritize(
TX_QUEUE *queue_ptr -> param_0
); */
@@ -1469,7 +1548,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_QUEUE_RECEIVE_CALL_NOT_USED
/* UINT _txe_queue_receive(
TX_QUEUE *queue_ptr, -> param_0
VOID *destination_ptr, -> param_1
@@ -1487,7 +1568,7 @@ TX_QUEUE *queue_ptr;
return(TXM_MODULE_INVALID_MEMORY);
/* We need to get the max size of the buffer from the queue. */
queue_ptr = (TX_QUEUE *) param_0;
queue_ptr = (TX_QUEUE *) param_0;
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_WRITE(module_instance, param_1, sizeof(ULONG)*queue_ptr -> tx_queue_message_size))
return(TXM_MODULE_INVALID_MEMORY);
}
@@ -1499,7 +1580,9 @@ TX_QUEUE *queue_ptr;
);
return(return_value);
}
#endif
#ifndef TXM_QUEUE_SEND_CALL_NOT_USED
/* UINT _txe_queue_send(
TX_QUEUE *queue_ptr, -> param_0
VOID *source_ptr, -> param_1
@@ -1517,7 +1600,7 @@ TX_QUEUE *queue_ptr;
return(TXM_MODULE_INVALID_MEMORY);
/* We need to get the size of the message from the queue. */
queue_ptr = (TX_QUEUE *) param_0;
queue_ptr = (TX_QUEUE *) param_0;
if (!TXM_MODULE_MANAGER_PARAM_CHECK_BUFFER_READ(module_instance, param_1, sizeof(ULONG)*queue_ptr -> tx_queue_message_size))
return(TXM_MODULE_INVALID_MEMORY);
}
@@ -1529,7 +1612,9 @@ TX_QUEUE *queue_ptr;
);
return(return_value);
}
#endif
#ifndef TXM_QUEUE_SEND_NOTIFY_CALL_NOT_USED
/* UINT _txe_queue_send_notify(
TX_QUEUE *queue_ptr, -> param_0
VOID (*queue_send_notify)(TX_QUEUE *notify_queue_ptr) -> param_1
@@ -1573,7 +1658,9 @@ VOID (*queue_send_notify)(TX_QUEUE *);
);
return(return_value);
}
#endif
#ifndef TXM_SEMAPHORE_CEILING_PUT_CALL_NOT_USED
/* UINT _txe_semaphore_ceiling_put(
TX_SEMAPHORE *semaphore_ptr, -> param_0
ULONG ceiling -> param_1
@@ -1595,7 +1682,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_SEMAPHORE_CREATE_CALL_NOT_USED
/* UINT _txe_semaphore_create(
TX_SEMAPHORE *semaphore_ptr, -> param_0
CHAR *name_ptr, -> param_1
@@ -1627,7 +1716,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_SEMAPHORE_DELETE_CALL_NOT_USED
/* UINT _txe_semaphore_delete(
TX_SEMAPHORE *semaphore_ptr -> param_0
); */
@@ -1653,7 +1744,9 @@ ALIGN_TYPE return_value;
}
return(return_value);
}
#endif
#ifndef TXM_SEMAPHORE_GET_CALL_NOT_USED
/* UINT _txe_semaphore_get(
TX_SEMAPHORE *semaphore_ptr, -> param_0
ULONG wait_option -> param_1
@@ -1675,7 +1768,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_SEMAPHORE_INFO_GET_CALL_NOT_USED
/* UINT _txe_semaphore_info_get(
TX_SEMAPHORE *semaphore_ptr, -> param_0
CHAR **name, -> param_1
@@ -1723,7 +1818,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_SEMAPHORE_PERFORMANCE_INFO_GET_CALL_NOT_USED
/* UINT _tx_semaphore_performance_info_get(
TX_SEMAPHORE *semaphore_ptr, -> param_0
ULONG *puts, -> param_1
@@ -1766,7 +1863,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_SEMAPHORE_PERFORMANCE_SYSTEM_INFO_GET_CALL_NOT_USED
/* UINT _tx_semaphore_performance_system_info_get(
ULONG *puts, -> param_0
ULONG *gets, -> param_1
@@ -1804,7 +1903,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_SEMAPHORE_PRIORITIZE_CALL_NOT_USED
/* UINT _txe_semaphore_prioritize(
TX_SEMAPHORE *semaphore_ptr -> param_0
); */
@@ -1824,7 +1925,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_SEMAPHORE_PUT_CALL_NOT_USED
/* UINT _txe_semaphore_put(
TX_SEMAPHORE *semaphore_ptr -> param_0
); */
@@ -1844,7 +1947,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_SEMAPHORE_PUT_NOTIFY_CALL_NOT_USED
/* UINT _txe_semaphore_put_notify(
TX_SEMAPHORE *semaphore_ptr, -> param_0
VOID (*semaphore_put_notify)(TX_SEMAPHORE *notify_semaphore_ptr) -> param_1
@@ -1888,7 +1993,9 @@ VOID (*semaphore_put_notify)(TX_SEMAPHORE *);
);
return(return_value);
}
#endif
#ifndef TXM_THREAD_CREATE_CALL_NOT_USED
/* UINT _txe_thread_create(
TX_THREAD *thread_ptr, -> param_0
CHAR *name_ptr, -> param_1
@@ -1945,7 +2052,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_THREAD_DELETE_CALL_NOT_USED
/* UINT _txe_thread_delete(
TX_THREAD *thread_ptr -> param_0
); */
@@ -1971,7 +2080,9 @@ ALIGN_TYPE return_value;
}
return(return_value);
}
#endif
#ifndef TXM_THREAD_ENTRY_EXIT_NOTIFY_CALL_NOT_USED
/* UINT _txe_thread_entry_exit_notify(
TX_THREAD *thread_ptr, -> param_0
VOID (*thread_entry_exit_notify)(TX_THREAD *notify_thread_ptr, UINT type) -> param_1
@@ -2020,7 +2131,9 @@ VOID (*thread_entry_exit_notify)(TX_THREAD *, UINT);
);
return(return_value);
}
#endif
#ifndef TXM_THREAD_IDENTIFY_CALL_NOT_USED
/* TX_THREAD *_tx_thread_identify(); */
static ALIGN_TYPE _txm_module_manager_tx_thread_identify_dispatch(TXM_MODULE_INSTANCE *module_instance, ALIGN_TYPE param_0, ALIGN_TYPE param_1, ALIGN_TYPE *extra_parameters)
{
@@ -2030,7 +2143,9 @@ ALIGN_TYPE return_value;
return_value = (ALIGN_TYPE) _tx_thread_identify();
return(return_value);
}
#endif
#ifndef TXM_THREAD_INFO_GET_CALL_NOT_USED
/* UINT _txe_thread_info_get(
TX_THREAD *thread_ptr, -> param_0
CHAR **name, -> param_1
@@ -2093,7 +2208,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_THREAD_INTERRUPT_CONTROL_CALL_NOT_USED
/* UINT _tx_thread_interrupt_control(
UINT new_posture -> param_0
); */
@@ -2110,7 +2227,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_THREAD_PERFORMANCE_INFO_GET_CALL_NOT_USED
/* UINT _tx_thread_performance_info_get(
TX_THREAD *thread_ptr, -> param_0
ULONG *resumptions, -> param_1
@@ -2183,7 +2302,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_THREAD_PERFORMANCE_SYSTEM_INFO_GET_CALL_NOT_USED
/* UINT _tx_thread_performance_system_info_get(
ULONG *resumptions, -> param_0
ULONG *suspensions, -> param_1
@@ -2256,7 +2377,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_THREAD_PREEMPTION_CHANGE_CALL_NOT_USED
/* UINT _txe_thread_preemption_change(
TX_THREAD *thread_ptr, -> param_0
UINT new_threshold, -> param_1
@@ -2283,7 +2406,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_THREAD_PRIORITY_CHANGE_CALL_NOT_USED
/* UINT _txe_thread_priority_change(
TX_THREAD *thread_ptr, -> param_0
UINT new_priority, -> param_1
@@ -2310,7 +2435,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_THREAD_RELINQUISH_CALL_NOT_USED
/* VOID _txe_thread_relinquish(); */
static ALIGN_TYPE _txm_module_manager_tx_thread_relinquish_dispatch(TXM_MODULE_INSTANCE *module_instance, ALIGN_TYPE param_0, ALIGN_TYPE param_1, ALIGN_TYPE *extra_parameters)
{
@@ -2318,7 +2445,9 @@ static ALIGN_TYPE _txm_module_manager_tx_thread_relinquish_dispatch(TXM_MODULE_I
_txe_thread_relinquish();
return(TX_SUCCESS);
}
#endif
#ifndef TXM_THREAD_RESET_CALL_NOT_USED
/* UINT _txe_thread_reset(
TX_THREAD *thread_ptr -> param_0
); */
@@ -2338,7 +2467,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_THREAD_RESUME_CALL_NOT_USED
/* UINT _txe_thread_resume(
TX_THREAD *thread_ptr -> param_0
); */
@@ -2358,7 +2489,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_THREAD_SLEEP_CALL_NOT_USED
/* UINT _tx_thread_sleep(
ULONG timer_ticks -> param_0
); */
@@ -2372,7 +2505,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_THREAD_STACK_ERROR_NOTIFY_CALL_NOT_USED
/* UINT _tx_thread_stack_error_notify(
VOID (*stack_error_handler)(TX_THREAD *thread_ptr) -> param_0
); */
@@ -2389,7 +2524,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_THREAD_SUSPEND_CALL_NOT_USED
/* UINT _txe_thread_suspend(
TX_THREAD *thread_ptr -> param_0
); */
@@ -2409,7 +2546,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_THREAD_SYSTEM_SUSPEND_CALL_NOT_USED
/* VOID _tx_thread_system_suspend(
TX_THREAD *thread_ptr -> param_0
); */
@@ -2464,7 +2603,9 @@ TX_THREAD *thread_ptr;
);
return(TX_SUCCESS);
}
#endif
#ifndef TXM_THREAD_TERMINATE_CALL_NOT_USED
/* UINT _txe_thread_terminate(
TX_THREAD *thread_ptr -> param_0
); */
@@ -2484,7 +2625,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_THREAD_TIME_SLICE_CHANGE_CALL_NOT_USED
/* UINT _txe_thread_time_slice_change(
TX_THREAD *thread_ptr, -> param_0
ULONG new_time_slice, -> param_1
@@ -2511,7 +2654,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_THREAD_WAIT_ABORT_CALL_NOT_USED
/* UINT _txe_thread_wait_abort(
TX_THREAD *thread_ptr -> param_0
); */
@@ -2531,7 +2676,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_TIME_GET_CALL_NOT_USED
/* ULONG _tx_time_get(); */
static ALIGN_TYPE _txm_module_manager_tx_time_get_dispatch(TXM_MODULE_INSTANCE *module_instance, ALIGN_TYPE param_0, ALIGN_TYPE param_1, ALIGN_TYPE *extra_parameters)
{
@@ -2541,7 +2688,9 @@ ALIGN_TYPE return_value;
return_value = (ALIGN_TYPE) _tx_time_get();
return(return_value);
}
#endif
#ifndef TXM_TIME_SET_CALL_NOT_USED
/* VOID _tx_time_set(
ULONG new_time -> param_0
); */
@@ -2553,7 +2702,9 @@ static ALIGN_TYPE _txm_module_manager_tx_time_set_dispatch(TXM_MODULE_INSTANCE *
);
return(TX_SUCCESS);
}
#endif
#ifndef TXM_TIMER_ACTIVATE_CALL_NOT_USED
/* UINT _txe_timer_activate(
TX_TIMER *timer_ptr -> param_0
); */
@@ -2573,7 +2724,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_TIMER_CHANGE_CALL_NOT_USED
/* UINT _txe_timer_change(
TX_TIMER *timer_ptr, -> param_0
ULONG initial_ticks, -> param_1
@@ -2597,7 +2750,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_TIMER_CREATE_CALL_NOT_USED
/* UINT _txe_timer_create(
TX_TIMER *timer_ptr, -> param_0
CHAR *name_ptr, -> param_1
@@ -2668,7 +2823,9 @@ VOID (*expiration_function)(ULONG);
}
return(return_value);
}
#endif
#ifndef TXM_TIMER_DEACTIVATE_CALL_NOT_USED
/* UINT _txe_timer_deactivate(
TX_TIMER *timer_ptr -> param_0
); */
@@ -2688,7 +2845,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_TIMER_DELETE_CALL_NOT_USED
/* UINT _txe_timer_delete(
TX_TIMER *timer_ptr -> param_0
); */
@@ -2714,7 +2873,9 @@ ALIGN_TYPE return_value;
}
return(return_value);
}
#endif
#ifndef TXM_TIMER_INFO_GET_CALL_NOT_USED
/* UINT _txe_timer_info_get(
TX_TIMER *timer_ptr, -> param_0
CHAR **name, -> param_1
@@ -2762,7 +2923,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_TIMER_PERFORMANCE_INFO_GET_CALL_NOT_USED
/* UINT _tx_timer_performance_info_get(
TX_TIMER *timer_ptr, -> param_0
ULONG *activates, -> param_1
@@ -2810,7 +2973,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_TIMER_PERFORMANCE_SYSTEM_INFO_GET_CALL_NOT_USED
/* UINT _tx_timer_performance_system_info_get(
ULONG *activates, -> param_0
ULONG *reactivates, -> param_1
@@ -2853,7 +3018,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_TRACE_BUFFER_FULL_NOTIFY_CALL_NOT_USED
/* UINT _tx_trace_buffer_full_notify(
VOID (*full_buffer_callback)(VOID *buffer) -> param_0
); */
@@ -2867,7 +3034,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_TRACE_DISABLE_CALL_NOT_USED
/* UINT _tx_trace_disable(); */
static ALIGN_TYPE _txm_module_manager_tx_trace_disable_dispatch(TXM_MODULE_INSTANCE *module_instance, ALIGN_TYPE param_0, ALIGN_TYPE param_1, ALIGN_TYPE *extra_parameters)
{
@@ -2880,7 +3049,9 @@ ALIGN_TYPE return_value;
return_value = (ALIGN_TYPE) _tx_trace_disable();
return(return_value);
}
#endif
#ifndef TXM_TRACE_ENABLE_CALL_NOT_USED
/* UINT _tx_trace_enable(
VOID *trace_buffer_start, -> param_0
ULONG trace_buffer_size, -> param_1
@@ -2901,7 +3072,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_TRACE_EVENT_FILTER_CALL_NOT_USED
/* UINT _tx_trace_event_filter(
ULONG event_filter_bits -> param_0
); */
@@ -2915,7 +3088,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_TRACE_EVENT_UNFILTER_CALL_NOT_USED
/* UINT _tx_trace_event_unfilter(
ULONG event_unfilter_bits -> param_0
); */
@@ -2929,7 +3104,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_TRACE_INTERRUPT_CONTROL_CALL_NOT_USED
/* UINT _tx_trace_interrupt_control(
UINT new_posture -> param_0
); */
@@ -2946,7 +3123,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_TRACE_ISR_ENTER_INSERT_CALL_NOT_USED
/* VOID _tx_trace_isr_enter_insert(
ULONG isr_id -> param_0
); */
@@ -2961,7 +3140,9 @@ static ALIGN_TYPE _txm_module_manager_tx_trace_isr_enter_insert_dispatch(TXM_MOD
);
return(TX_SUCCESS);
}
#endif
#ifndef TXM_TRACE_ISR_EXIT_INSERT_CALL_NOT_USED
/* VOID _tx_trace_isr_exit_insert(
ULONG isr_id -> param_0
); */
@@ -2976,7 +3157,9 @@ static ALIGN_TYPE _txm_module_manager_tx_trace_isr_exit_insert_dispatch(TXM_MODU
);
return(TX_SUCCESS);
}
#endif
#ifndef TXM_TRACE_USER_EVENT_INSERT_CALL_NOT_USED
/* UINT _tx_trace_user_event_insert(
ULONG event_id, -> param_0
ULONG info_field_1, -> param_1
@@ -2994,7 +3177,7 @@ ALIGN_TYPE return_value;
if (!TXM_MODULE_MANAGER_ENSURE_INSIDE_MODULE_DATA(module_instance, (ALIGN_TYPE)extra_parameters, sizeof(ALIGN_TYPE[3])))
return(TXM_MODULE_INVALID_MEMORY);
}
return_value = (ALIGN_TYPE) _tx_trace_user_event_insert(
(ULONG) param_0,
(ULONG) param_1,
@@ -3004,7 +3187,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_MODULE_OBJECT_ALLOCATE_CALL_NOT_USED
/* UINT _txm_module_object_allocate(
VOID **object_ptr, -> param_0
ULONG object_size -> param_1
@@ -3027,7 +3212,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_MODULE_OBJECT_DEALLOCATE_CALL_NOT_USED
/* UINT _txm_module_object_deallocate(
VOID *object_ptr -> param_0
); */
@@ -3076,7 +3263,9 @@ ALIGN_TYPE object_pool_end;
);
return(return_value);
}
#endif
#ifndef TXM_MODULE_OBJECT_POINTER_GET_CALL_NOT_USED
/* UINT _txm_module_object_pointer_get(
UINT object_type, -> param_0
CHAR *name, -> param_1
@@ -3103,7 +3292,9 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif
#ifndef TXM_MODULE_OBJECT_POINTER_GET_EXTENDED_CALL_NOT_USED
/* UINT _txm_module_object_pointer_get_extended(
UINT object_type, -> param_0
CHAR *name, -> param_1
@@ -3135,3 +3326,4 @@ ALIGN_TYPE return_value;
);
return(return_value);
}
#endif

View File

@@ -10,70 +10,71 @@
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Module Manager */
/** */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Module Manager */
/** */
/**************************************************************************/
/**************************************************************************/
/* Include necessary system files. */
#include "tx_api.h"
#include "txm_module.h"
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_application_request PORTABLE C */
/* 6.1 */
#ifndef TXM_MODULE_APPLICATION_REQUEST_CALL_NOT_USED
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_application_request PORTABLE C */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Scott Larson, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function processes the application-specific module request. */
/* The entire contents of the request structure is application */
/* specific and thus the processing in this file is left to the */
/* application to define. */
/* */
/* INPUT */
/* */
/* request_id Module request ID */
/* param_1 First parameter */
/* param_2 Second parameter */
/* param_3 Third parameter */
/* */
/* OUTPUT */
/* */
/* status Completion status */
/* */
/* CALLS */
/* */
/* None */
/* */
/* CALLED BY */
/* */
/* _txm_module_manager_kernel_dispatch Kernel dispatch function */
/* */
/* RELEASE HISTORY */
/* */
/* DESCRIPTION */
/* */
/* This function processes the application-specific module request. */
/* The entire contents of the request structure is application */
/* specific and thus the processing in this file is left to the */
/* application to define. */
/* */
/* INPUT */
/* */
/* request_id Module request ID */
/* param_1 First parameter */
/* param_2 Second parameter */
/* param_3 Third parameter */
/* */
/* OUTPUT */
/* */
/* status Completion status */
/* */
/* CALLS */
/* */
/* None */
/* */
/* CALLED BY */
/* */
/* _txm_module_manager_kernel_dispatch Kernel dispatch function */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* 01-31-2022 Scott Larson Modified comments and added */
/* CALL_NOT_USED option, */
/* resulting in version 6.1.10 */
/* */
/**************************************************************************/
UINT _txm_module_manager_application_request(ULONG request_id, ALIGN_TYPE param_1, ALIGN_TYPE param_2, ALIGN_TYPE param_3)
{
/* By default, simply return the status of not available. */
return(TX_NOT_AVAILABLE);
return(TX_NOT_AVAILABLE);
}
#endif

View File

@@ -10,15 +10,15 @@
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Module Manager */
/** */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Module Manager */
/** */
/**************************************************************************/
/**************************************************************************/
#define TX_SOURCE_CODE
@@ -26,45 +26,45 @@
#include "tx_queue.h"
#include "tx_thread.h"
#include "txm_module.h"
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_callback_request PORTABLE C */
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_callback_request PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Scott Larson, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function sends a notification callback function request to */
/* the associated module. */
/* */
/* INPUT */
/* */
/* module_callback_queue Module callback request queue */
/* callback_request Callback request */
/* */
/* OUTPUT */
/* */
/* None */
/* */
/* CALLS */
/* */
/* tx_queue_send Send module callback request */
/* */
/* CALLED BY */
/* */
/* ThreadX */
/* */
/* RELEASE HISTORY */
/* */
/* DESCRIPTION */
/* */
/* This function sends a notification callback function request to */
/* the associated module. */
/* */
/* INPUT */
/* */
/* module_callback_queue Module callback request queue */
/* callback_request Callback request */
/* */
/* OUTPUT */
/* */
/* None */
/* */
/* CALLS */
/* */
/* tx_queue_send Send module callback request */
/* */
/* CALLED BY */
/* */
/* ThreadX */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* */
/**************************************************************************/
VOID _txm_module_manager_callback_request(TX_QUEUE *module_callback_queue, TXM_MODULE_CALLBACK_MESSAGE *callback_message)
@@ -80,26 +80,26 @@ UINT status;
/* Lockout interrupts. */
TX_DISABLE
/* Determine if the queue is valid. */
if ((module_callback_queue) && (module_callback_queue -> tx_queue_id == TX_QUEUE_ID))
{
/* Yes, the queue is valid. */
/* Pickup the current callback request in the queue. */
queued_message = (TXM_MODULE_CALLBACK_MESSAGE *) module_callback_queue -> tx_queue_read;
/* Pickup the number of items enqueued. */
enqueued = module_callback_queue -> tx_queue_enqueued;
/* Set the found flag to false. */
found = TX_FALSE;
/* Loop to look for duplicates in the queue. */
while (enqueued != 0)
{
/* Does this entry match the new callback message? */
if ((queued_message -> txm_module_callback_message_application_function == callback_message -> txm_module_callback_message_application_function) &&
(queued_message -> txm_module_callback_message_param_1 == callback_message -> txm_module_callback_message_param_1) &&
@@ -113,62 +113,62 @@ UINT status;
(queued_message -> txm_module_callback_message_reserved1 == callback_message -> txm_module_callback_message_reserved1) &&
(queued_message -> txm_module_callback_message_reserved2 == callback_message -> txm_module_callback_message_reserved2))
{
/* Update the activation count in the queued request. */
queued_message -> txm_module_callback_message_activation_count++;
/* Set the found flag to true. */
found = TX_TRUE;
/* Get out of the loop. */
break;
}
/* Decrease the number of messages to examine. */
enqueued--;
/* Move the callback message to the next message. */
queued_message++;
/* Check for wrap? */
if (((ULONG *) queued_message) >= module_callback_queue -> tx_queue_end)
{
/* Yes, set the queued message to the beginning of the queue. */
queued_message = (TXM_MODULE_CALLBACK_MESSAGE *) module_callback_queue -> tx_queue_start;
}
}
}
/* Restore interrupts. */
TX_RESTORE
/* Determine if we need to send the new callback request. */
if (found == TX_FALSE)
{
/* Yes, send the message. */
status = _tx_queue_send(module_callback_queue, (VOID *) callback_message, TX_NO_WAIT);
/* Determine if an error was detected. */
if (status != TX_SUCCESS)
{
/* Error, increment the error counter and return. */
_txm_module_manager_callback_error_count++;
}
}
/* Increment the total number of callbacks. */
_txm_module_manager_callback_total_count++;
}
else
{
/* Module instance is not valid. */
/* Error, increment the error counter and return. */
_txm_module_manager_callback_error_count++;
/* Restore interrupts. */
TX_RESTORE
}

View File

@@ -10,15 +10,15 @@
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Module Manager */
/** */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Module Manager */
/** */
/**************************************************************************/
/**************************************************************************/
#define TX_SOURCE_CODE
@@ -27,45 +27,45 @@
#include "tx_event_flags.h"
#include "tx_thread.h"
#include "txm_module.h"
#ifndef TX_DISABLE_NOTIFY_CALLBACKS
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_event_flags_notify_trampoline PORTABLE C */
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_event_flags_notify_trampoline PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Scott Larson, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function processes the event flags set notification call from */
/* ThreadX. */
/* */
/* INPUT */
/* */
/* group_ptr Event flags group pointer */
/* */
/* OUTPUT */
/* */
/* None */
/* */
/* CALLS */
/* */
/* _txm_module_manager_callback_request Send module callback request */
/* */
/* CALLED BY */
/* */
/* ThreadX */
/* */
/* RELEASE HISTORY */
/* */
/* DESCRIPTION */
/* */
/* This function processes the event flags set notification call from */
/* ThreadX. */
/* */
/* INPUT */
/* */
/* group_ptr Event flags group pointer */
/* */
/* OUTPUT */
/* */
/* None */
/* */
/* CALLS */
/* */
/* _txm_module_manager_callback_request Send module callback request */
/* */
/* CALLED BY */
/* */
/* ThreadX */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* */
/**************************************************************************/
VOID _txm_module_manager_event_flags_notify_trampoline(TX_EVENT_FLAGS_GROUP *group_ptr)
@@ -77,9 +77,9 @@ TXM_MODULE_INSTANCE *module_instance;
TXM_MODULE_CALLBACK_MESSAGE callback_message;
TX_QUEUE *module_callback_queue;
/* We now know the callback is for a module. */
/* Disable interrupts. */
TX_DISABLE
@@ -90,9 +90,9 @@ TX_QUEUE *module_callback_queue;
if ((module_instance) && (module_instance -> txm_module_instance_id == TXM_MODULE_ID) &&
(module_instance -> txm_module_instance_state == TXM_MODULE_STARTED))
{
/* Yes, the module is still valid. */
/* Yes, the module is still valid. */
/* Pickup the module's callback message queue. */
module_callback_queue = &(module_instance -> txm_module_instance_callback_request_queue);
@@ -113,21 +113,21 @@ TX_QUEUE *module_callback_queue;
/* Restore interrupts. */
TX_RESTORE
/* Call the general processing that will place the callback on the
/* Call the general processing that will place the callback on the
module's callback request queue. */
_txm_module_manager_callback_request(module_callback_queue, &callback_message);
}
else
{
/* Module no longer valid. */
/* Error, increment the error counter and return. */
_txm_module_manager_callback_error_count++;
/* Restore interrupts. */
TX_RESTORE
}
}
}
#endif

View File

@@ -80,7 +80,7 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* */
/**************************************************************************/
UINT _txm_module_manager_file_load(TXM_MODULE_INSTANCE *module_instance, CHAR *module_name, FX_MEDIA *media_ptr, CHAR *file_name)

View File

@@ -10,15 +10,15 @@
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Module Manager */
/** */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Module Manager */
/** */
/**************************************************************************/
/**************************************************************************/
#define TX_SOURCE_CODE
@@ -31,46 +31,46 @@
#include "txm_module_manager_util.h"
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_in_place_load PORTABLE C */
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_in_place_load PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Scott Larson, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* DESCRIPTION */
/* */
/* This function ensures the code-related parts of the module preamble */
/* are valid and calls _txm_module_manager_internal_load to load the */
/* data and prepare the module for execution. */
/* */
/* INPUT */
/* */
/* module_instance Module instance pointer */
/* module_name Module name pointer */
/* module_location Module code location */
/* */
/* OUTPUT */
/* */
/* status Completion status */
/* */
/* CALLS */
/* */
/* */
/* INPUT */
/* */
/* module_instance Module instance pointer */
/* module_name Module name pointer */
/* module_location Module code location */
/* */
/* OUTPUT */
/* */
/* status Completion status */
/* */
/* CALLS */
/* */
/* _txm_module_manager_internal_load Load data and prepare module for */
/* execution */
/* */
/* CALLED BY */
/* */
/* Application code */
/* */
/* RELEASE HISTORY */
/* */
/* */
/* CALLED BY */
/* */
/* Application code */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* */
/**************************************************************************/
UINT _txm_module_manager_in_place_load(TXM_MODULE_INSTANCE *module_instance, CHAR *module_name, VOID *module_location)

View File

@@ -10,15 +10,15 @@
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Module Manager */
/** */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Module Manager */
/** */
/**************************************************************************/
/**************************************************************************/
#define TX_SOURCE_CODE
#define TX_MODULE_MANAGER_INIT
@@ -80,7 +80,7 @@ ULONG _txm_module_manger_loaded_count;
/* Define the ready flag, which is checked by other module manager APIs
to make sure the manager has been initialized. */
UINT _txm_module_manager_ready;
@@ -97,44 +97,44 @@ ULONG _txm_module_manager_callback_error_count;
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_initialize PORTABLE C */
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_initialize PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Scott Larson, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function initializes the module manager. */
/* */
/* INPUT */
/* */
/* module_memory_start Start of module area */
/* module_memory_size Size in bytes of module area */
/* */
/* OUTPUT */
/* */
/* status Completion status */
/* */
/* CALLS */
/* */
/* _tx_byte_pool_create Create module memory byte pool */
/* _tx_mutex_create Create module manager */
/* protection mutex */
/* */
/* CALLED BY */
/* */
/* Application code */
/* */
/* RELEASE HISTORY */
/* */
/* DESCRIPTION */
/* */
/* This function initializes the module manager. */
/* */
/* INPUT */
/* */
/* module_memory_start Start of module area */
/* module_memory_size Size in bytes of module area */
/* */
/* OUTPUT */
/* */
/* status Completion status */
/* */
/* CALLS */
/* */
/* _tx_byte_pool_create Create module memory byte pool */
/* _tx_mutex_create Create module manager */
/* protection mutex */
/* */
/* CALLED BY */
/* */
/* Application code */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* */
/**************************************************************************/
UINT _txm_module_manager_initialize(VOID *module_memory_start, ULONG module_memory_size)
@@ -143,11 +143,11 @@ UINT _txm_module_manager_initialize(VOID *module_memory_start, ULONG module_mem
/* Check for interrupt call. */
if (TX_THREAD_GET_SYSTEM_STATE() != 0)
{
/* Now, make sure the call is from an interrupt and not initialization. */
if (TX_THREAD_GET_SYSTEM_STATE() < TX_INITIALIZE_IN_PROGRESS)
{
/* Invalid caller of this function, return appropriate error code. */
return(TX_CALLER_ERROR);
}
@@ -171,7 +171,7 @@ UINT _txm_module_manager_initialize(VOID *module_memory_start, ULONG module_mem
/* Create the module manager protection mutex. */
_tx_mutex_create(&_txm_module_manager_mutex, "Module Manager Protection Mutex", TX_NO_INHERIT);
/* Create a byte pool for allocating RAM areas for modules. */
/* Create a byte pool for allocating RAM areas for modules. */
_tx_byte_pool_create(&_txm_module_manager_byte_pool, "Module Manager Byte Pool", module_memory_start, module_memory_size);
/* Indicate the module manager object pool has not been created. */
@@ -179,7 +179,7 @@ UINT _txm_module_manager_initialize(VOID *module_memory_start, ULONG module_mem
/* Mark the module manager as ready! */
_txm_module_manager_ready = TX_TRUE;
/* Return success. */
return(TX_SUCCESS);
}

View File

@@ -10,15 +10,15 @@
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Module Manager */
/** */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Module Manager */
/** */
/**************************************************************************/
/**************************************************************************/
#define TX_SOURCE_CODE
@@ -31,49 +31,49 @@
#include "txm_module_manager_util.h"
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_internal_load PORTABLE C */
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_internal_load PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Scott Larson, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function allocates data memory for module and prepares the */
/* module for execution from the supplied code location. */
/* */
/* INPUT */
/* */
/* module_instance Module instance pointer */
/* module_name Module name pointer */
/* module_location Module code location */
/* code_size Module code size */
/* code_allocation_ptr Allocated code location */
/* code_allocation_size Allocated code size */
/* */
/* OUTPUT */
/* */
/* status Completion status */
/* */
/* CALLS */
/* */
/* _tx_byte_allocate Allocate data area */
/* _tx_mutex_get Get protection mutex */
/* _tx_mutex_put Release protection mutex */
/* */
/* CALLED BY */
/* */
/* Application code */
/* */
/* RELEASE HISTORY */
/* */
/* DESCRIPTION */
/* */
/* This function allocates data memory for module and prepares the */
/* module for execution from the supplied code location. */
/* */
/* INPUT */
/* */
/* module_instance Module instance pointer */
/* module_name Module name pointer */
/* module_location Module code location */
/* code_size Module code size */
/* code_allocation_ptr Allocated code location */
/* code_allocation_size Allocated code size */
/* */
/* OUTPUT */
/* */
/* status Completion status */
/* */
/* CALLS */
/* */
/* _tx_byte_allocate Allocate data area */
/* _tx_mutex_get Get protection mutex */
/* _tx_mutex_put Release protection mutex */
/* */
/* CALLED BY */
/* */
/* Application code */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* */
/**************************************************************************/
UINT _txm_module_manager_internal_load(TXM_MODULE_INSTANCE *module_instance, CHAR *module_name, VOID *module_location,
@@ -81,7 +81,7 @@ UINT _txm_module_manager_internal_load(TXM_MODULE_INSTANCE *module_instance, CH
{
TX_INTERRUPT_SAVE_AREA
TXM_MODULE_PREAMBLE *module_preamble;
TXM_MODULE_INSTANCE *next_module, *previous_module;
ULONG shell_function_adjust;
@@ -104,11 +104,11 @@ UINT status;
/* Check for interrupt call. */
if (TX_THREAD_GET_SYSTEM_STATE() != 0)
{
/* Now, make sure the call is from an interrupt and not initialization. */
if (TX_THREAD_GET_SYSTEM_STATE() < TX_INITIALIZE_IN_PROGRESS)
{
/* Invalid caller of this function, return appropriate error code. */
return(TX_CALLER_ERROR);
}
@@ -117,15 +117,15 @@ UINT status;
/* Determine if the module manager has not been initialized yet. */
if (_txm_module_manager_ready != TX_TRUE)
{
/* Module manager has not been initialized. */
return(TX_NOT_AVAILABLE);
return(TX_NOT_AVAILABLE);
}
/* Determine if the module is valid. */
if (module_instance == TX_NULL)
{
/* Invalid module pointer. */
return(TX_PTR_ERROR);
}
@@ -150,7 +150,7 @@ UINT status;
/* Check to make sure there is a valid module to load. */
if (module_preamble -> txm_module_preamble_id != TXM_MODULE_ID)
{
/* Release the protection mutex. */
_tx_mutex_put(&_txm_module_manager_mutex);
@@ -175,12 +175,12 @@ UINT status;
/* Invalid properties. Return error. */
return(TXM_MODULE_INVALID_PROPERTIES);
}
/* Check for valid module entry offsets. */
if ((module_preamble -> txm_module_preamble_shell_entry_function == 0) ||
(module_preamble -> txm_module_preamble_start_function == 0))
{
/* Release the protection mutex. */
_tx_mutex_put(&_txm_module_manager_mutex);
@@ -194,7 +194,7 @@ UINT status;
(module_preamble -> txm_module_preamble_start_stop_stack_size == 0) ||
(module_preamble -> txm_module_preamble_callback_stack_size == 0))
{
/* Release the protection mutex. */
_tx_mutex_put(&_txm_module_manager_mutex);
@@ -227,11 +227,11 @@ UINT status;
/* Update the data size to account for the default thread stacks. */
TXM_MODULE_MANAGER_UTIL_MATH_ADD_ULONG(data_size, start_stop_stack_size, data_size);
TXM_MODULE_MANAGER_UTIL_MATH_ADD_ULONG(data_size, callback_stack_size, data_size);
/* Setup the default code and data alignments. */
data_alignment = (ULONG) TXM_MODULE_DATA_ALIGNMENT;
/* Get the port-specific alignment for the data size. Note we only want data
/* Get the port-specific alignment for the data size. Note we only want data
so we pass values of 1 for code (to avoid any possible div by 0 errors). */
code_size_ignored = 1;
code_alignment_ignored = 1;
@@ -239,16 +239,16 @@ UINT status;
/* Calculate the module's total RAM memory requirement. This entire area is allocated from the module
manager's byte pool. The general layout is defined as follows:
Lowest Address: Start of start/stop thread stack
... [note: thread entry info is embedded near end of stack areas]
End of start/stop thread stack
End of start/stop thread stack
Start of callback thread stack
... [note: thread entry info is embedded near end of stack areas]
End of callback thread stack
Module's Data Area
End of callback thread stack
Module's Data Area
...
End of Module's Data Area
Highest Address: */
@@ -258,11 +258,11 @@ UINT status;
/* Allocate memory for the module. */
status = _tx_byte_allocate(&_txm_module_manager_byte_pool, (VOID **) &memory_ptr, data_allocation_size, TX_NO_WAIT);
/* Determine if the module memory allocation was successful. */
if (status)
{
/* Release the protection mutex. */
_tx_mutex_put(&_txm_module_manager_mutex);
@@ -272,10 +272,10 @@ UINT status;
/* Clear the allocated memory. */
TX_MEMSET(memory_ptr, ((UCHAR) 0), data_allocation_size);
/* Disable interrupts. */
TX_DISABLE
/* Setup the module instance structure. */
module_instance -> txm_module_instance_id = TXM_MODULE_ID;
@@ -285,7 +285,7 @@ UINT status;
/* Save the module properties. */
module_instance -> txm_module_instance_property_flags = module_preamble -> txm_module_preamble_property_flags;
/* Set the module data memory allocation. This is the address released
/* Set the module data memory allocation. This is the address released
when the module is unloaded. */
module_instance -> txm_module_instance_data_allocation_ptr = (VOID *) memory_ptr;
@@ -297,14 +297,14 @@ UINT status;
data_start = (data_start + (((ALIGN_TYPE)data_alignment) - 1)) & ~(((ALIGN_TYPE)data_alignment) - 1);
memory_ptr = (CHAR *) data_start;
module_instance -> txm_module_instance_data_start = (VOID *) memory_ptr;
/* Compute the end of the data memory allocation. */
module_instance -> txm_module_instance_data_end = (VOID *) (memory_ptr + (data_size - 1));
/* Save the size of the data area. */
module_instance -> txm_module_instance_data_size = data_size;
/* Set the module code memory allocation. This is the address released
/* Set the module code memory allocation. This is the address released
when the module is unloaded. */
module_instance -> txm_module_instance_code_allocation_ptr = (VOID *) code_allocation_ptr;
@@ -329,7 +329,7 @@ UINT status;
/* Save the module application ID in the module instance. */
module_instance -> txm_module_instance_application_module_id = module_preamble -> txm_module_preamble_application_module_id;
/* Setup the module's start/stop thread stack area. */
module_instance -> txm_module_instance_start_stop_stack_start_address = (VOID *) (memory_ptr);
module_instance -> txm_module_instance_start_stop_stack_size = start_stop_stack_size;
@@ -358,36 +358,36 @@ UINT status;
/* Calculate the function adjustments based on the specific implementation of the module manager/module. */
TXM_MODULE_MANAGER_CALCULATE_ADJUSTMENTS(module_preamble -> txm_module_preamble_property_flags, shell_function_adjust, start_function_adjust, stop_function_adjust, callback_function_adjust)
/* Build actual addresses based on load... Setup all the function pointers. Any adjustments needed to shell entry, start function, and callback function are defined in the
/* Build actual addresses based on load... Setup all the function pointers. Any adjustments needed to shell entry, start function, and callback function are defined in the
module preamble. */
module_instance -> txm_module_instance_shell_entry_function = (VOID (*)(TX_THREAD *, TXM_MODULE_INSTANCE *)) (((CHAR *) module_instance -> txm_module_instance_code_start) +
(module_preamble -> txm_module_preamble_shell_entry_function) +
module_instance -> txm_module_instance_shell_entry_function = (VOID (*)(TX_THREAD *, TXM_MODULE_INSTANCE *)) (((CHAR *) module_instance -> txm_module_instance_code_start) +
(module_preamble -> txm_module_preamble_shell_entry_function) +
(shell_function_adjust));
module_instance -> txm_module_instance_start_thread_entry = (VOID (*)(ULONG)) (((CHAR *) module_instance -> txm_module_instance_code_start) +
(module_preamble -> txm_module_preamble_start_function) +
module_instance -> txm_module_instance_start_thread_entry = (VOID (*)(ULONG)) (((CHAR *) module_instance -> txm_module_instance_code_start) +
(module_preamble -> txm_module_preamble_start_function) +
(start_function_adjust));
module_instance -> txm_module_instance_callback_request_thread_entry = (VOID (*)(ULONG)) (((CHAR *) module_instance -> txm_module_instance_code_start) +
module_instance -> txm_module_instance_callback_request_thread_entry = (VOID (*)(ULONG)) (((CHAR *) module_instance -> txm_module_instance_code_start) +
(module_preamble -> txm_module_preamble_callback_function) +
(callback_function_adjust));
(callback_function_adjust));
/* Determine if there is a stop function for this module. */
if (module_preamble -> txm_module_preamble_stop_function)
{
/* Yes, there is a stop function, build the address. */
module_instance -> txm_module_instance_stop_thread_entry = (VOID (*)(ULONG)) (((CHAR *) module_instance -> txm_module_instance_code_start) +
(module_preamble -> txm_module_preamble_stop_function) +
module_instance -> txm_module_instance_stop_thread_entry = (VOID (*)(ULONG)) (((CHAR *) module_instance -> txm_module_instance_code_start) +
(module_preamble -> txm_module_preamble_stop_function) +
(stop_function_adjust));
}
else
{
/* No, there is no stop function. Just set the pointer to NULL. */
module_instance -> txm_module_instance_stop_thread_entry = TX_NULL;
}
/* Load the module control block with port-specific information. */
TXM_MODULE_MANAGER_MODULE_SETUP(module_instance);
/* Now add the module to the linked list of created modules. */
if (_txm_module_manger_loaded_count++ == 0)
{
@@ -410,7 +410,7 @@ UINT status;
/* Setup this module's created links. */
module_instance -> txm_module_instance_loaded_previous = previous_module;
module_instance -> txm_module_instance_loaded_next = next_module;
module_instance -> txm_module_instance_loaded_next = next_module;
}
/* Restore interrupts. */

View File

@@ -29,7 +29,7 @@
#include "tx_queue.h"
#include "tx_mutex.h"
#include "tx_semaphore.h"
#include "tx_thread.h"
#include "tx_thread.h"
#include "tx_timer.h"
#include "tx_trace.h"
#include "txm_module.h"
@@ -41,7 +41,7 @@
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_kernel_dispatch PORTABLE C */
/* 6.1.6 */
/* 6.1.10 */
/* AUTHOR */
/* */
/* Scott Larson, Microsoft Corporation */
@@ -89,6 +89,9 @@
/* added optional defines to */
/* remove unneeded functions, */
/* resulting in version 6.1.6 */
/* 01-31-2022 Scott Larson Modified comments and added */
/* CALL_NOT_USED option, */
/* resulting in version 6.1.10 */
/* */
/**************************************************************************/
ALIGN_TYPE _txm_module_manager_kernel_dispatch(ULONG kernel_request, ALIGN_TYPE param_0, ALIGN_TYPE param_1, ALIGN_TYPE param_2)
@@ -437,7 +440,7 @@ TXM_MODULE_INSTANCE *module_instance;
break;
}
#endif
#ifndef TXM_QUEUE_SEND_CALL_NOT_USED
case TXM_QUEUE_SEND_CALL:
{
@@ -888,14 +891,16 @@ TXM_MODULE_INSTANCE *module_instance;
return_value = (ALIGN_TYPE) _txm_module_manager_port_dispatch(module_instance, kernel_request, param_0, param_1, param_2);
}
#endif
/* Determine if an application request is present. */
#ifndef TXM_MODULE_APPLICATION_REQUEST_CALL_NOT_USED
/* Determine if an application request is present. */
if (kernel_request >= TXM_APPLICATION_REQUEST_ID_BASE)
{
/* Yes, call the module manager function that the application defines in order to
support application-specific requests. */
return_value = (ALIGN_TYPE) _txm_module_manager_application_request(kernel_request-TXM_APPLICATION_REQUEST_ID_BASE, param_0, param_1, param_2);
}
#endif
#ifdef TXM_MODULE_ENABLE_NETX
/* Determine if there is a NetX request. */

View File

@@ -10,15 +10,15 @@
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Module Manager */
/** */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Module Manager */
/** */
/**************************************************************************/
/**************************************************************************/
#define TX_SOURCE_CODE
@@ -27,43 +27,43 @@
#include "txm_module.h"
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_maximum_module_priority_set PORTABLE C */
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_maximum_module_priority_set PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Scott Larson, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function sets the maximum thread priority allowed in a module. */
/* */
/* INPUT */
/* */
/* module_instance Module instance pointer */
/* priority Maximum thread priority */
/* */
/* OUTPUT */
/* */
/* status Completion status */
/* */
/* CALLS */
/* */
/* _tx_mutex_get Get protection mutex */
/* _tx_mutex_put Release protection mutex */
/* */
/* CALLED BY */
/* */
/* Application code */
/* */
/* RELEASE HISTORY */
/* */
/* DESCRIPTION */
/* */
/* This function sets the maximum thread priority allowed in a module. */
/* */
/* INPUT */
/* */
/* module_instance Module instance pointer */
/* priority Maximum thread priority */
/* */
/* OUTPUT */
/* */
/* status Completion status */
/* */
/* CALLS */
/* */
/* _tx_mutex_get Get protection mutex */
/* _tx_mutex_put Release protection mutex */
/* */
/* CALLED BY */
/* */
/* Application code */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* */
/**************************************************************************/
UINT _txm_module_manager_maximum_module_priority_set(TXM_MODULE_INSTANCE *module_instance, UINT priority)
@@ -72,45 +72,45 @@ UINT _txm_module_manager_maximum_module_priority_set(TXM_MODULE_INSTANCE *module
if (_txm_module_manager_ready != TX_TRUE)
{
/* Module manager has not been initialized. */
return(TX_NOT_AVAILABLE);
return(TX_NOT_AVAILABLE);
}
/* Determine if the module is valid. */
if (module_instance == TX_NULL)
{
/* Invalid module pointer. */
return(TX_PTR_ERROR);
}
/* Get module manager protection mutex. */
_tx_mutex_get(&_txm_module_manager_mutex, TX_WAIT_FOREVER);
/* Determine if the module instance is valid. */
if (module_instance -> txm_module_instance_id != TXM_MODULE_ID)
{
/* Release the protection mutex. */
_tx_mutex_put(&_txm_module_manager_mutex);
/* Invalid module pointer. */
return(TX_PTR_ERROR);
}
/* Determine if the module instance is in the loaded state. */
if ((module_instance -> txm_module_instance_state != TXM_MODULE_LOADED) && (module_instance -> txm_module_instance_state != TXM_MODULE_STOPPED))
{
/* Release the protection mutex. */
_tx_mutex_put(&_txm_module_manager_mutex);
/* Return error if the module is not ready. */
return(TX_START_ERROR);
}
/* Set module's maximum priority. */
module_instance->txm_module_instance_maximum_priority = priority;
/* Release the protection mutex. */
_tx_mutex_put(&_txm_module_manager_mutex);
return(TX_SUCCESS);
}

View File

@@ -71,7 +71,7 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* */
/**************************************************************************/
UINT _txm_module_manager_memory_load(TXM_MODULE_INSTANCE *module_instance, CHAR *module_name, VOID *module_location)

View File

@@ -28,7 +28,7 @@
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_object_allocate PORTABLE C */
/* _txm_module_manager_object_allocate PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
@@ -36,16 +36,16 @@
/* */
/* DESCRIPTION */
/* */
/* This function allocates memory for an object from the memory pool */
/* supplied to txm_module_manager_initialize. */
/* This function allocates memory for an object from the memory pool */
/* supplied to txm_module_manager_initialize. */
/* */
/* INPUT */
/* */
/* object_ptr Destination of object pointer on */
/* successful allocation */
/* object_size Size in bytes of the object to be */
/* allocated */
/* module_instance The module instance that the */
/* object_ptr Destination of object pointer on */
/* successful allocation */
/* object_size Size in bytes of the object to be */
/* allocated */
/* module_instance The module instance that the */
/* object belongs to */
/* */
/* OUTPUT */
@@ -66,7 +66,7 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* */
/**************************************************************************/
UINT _txm_module_manager_object_allocate(VOID **object_ptr_ptr, ULONG object_size, TXM_MODULE_INSTANCE *module_instance)
@@ -98,7 +98,7 @@ UINT return_value;
/* Allocate the object requested by the module - adding an extra ULONG in order to
store the module instance pointer. */
return_value = (ULONG) _txe_byte_allocate(&_txm_module_manager_object_pool, (VOID **) &object_ptr,
return_value = (ULONG) _txe_byte_allocate(&_txm_module_manager_object_pool, (VOID **) &object_ptr,
(ULONG) (object_size + sizeof(TXM_MODULE_ALLOCATED_OBJECT)), TX_NO_WAIT);
/* Determine if the request was successful. */

View File

@@ -23,7 +23,7 @@
#define TX_SOURCE_CODE
#include "tx_api.h"
#include "tx_thread.h"
#include "tx_thread.h"
#include "txm_module.h"
/**************************************************************************/
@@ -38,11 +38,11 @@
/* */
/* DESCRIPTION */
/* */
/* This function deallocates a previously allocated object. */
/* This function deallocates a previously allocated object. */
/* */
/* INPUT */
/* */
/* object_ptr Object pointer to deallocate */
/* object_ptr Object pointer to deallocate */
/* */
/* OUTPUT */
/* */
@@ -63,7 +63,7 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* */
/**************************************************************************/
UINT _txm_module_manager_object_deallocate(VOID *object_ptr)
@@ -78,18 +78,18 @@ UINT return_value;
/* Determine if an object pool was created. */
if (_txm_module_manager_object_pool_created)
{
TXM_MODULE_ALLOCATED_OBJECT *next_object, *previous_object;
/* Pickup module instance pointer. */
module_instance = _tx_thread_current_ptr -> tx_thread_module_instance_ptr;
/* Setup the memory pointer. */
module_allocated_object_ptr = (TXM_MODULE_ALLOCATED_OBJECT *) object_ptr;
/* Position the object pointer backwards to position back to the module manager information. */
previous_object = module_allocated_object_ptr--;
/* Make sure the object is valid. */
if ((module_allocated_object_ptr == TX_NULL) || (module_allocated_object_ptr -> txm_module_allocated_object_module_instance != module_instance) || (module_instance -> txm_module_instance_object_list_count == 0))
{
@@ -98,8 +98,8 @@ UINT return_value;
}
else
{
/* Unlink the node. */
/* Unlink the node. */
if ((--module_instance -> txm_module_instance_object_list_count) == 0)
{
/* Only allocated object, just set the allocated list to NULL. */
@@ -112,16 +112,16 @@ UINT return_value;
previous_object = module_allocated_object_ptr -> txm_module_allocated_object_previous;
next_object -> txm_module_allocated_object_previous = previous_object;
previous_object -> txm_module_allocated_object_next = next_object;
/* See if we have to update the allocated object list head pointer. */
if (module_instance -> txm_module_instance_object_list_head == module_allocated_object_ptr)
{
/* Yes, move the head pointer to the next link. */
module_instance -> txm_module_instance_object_list_head = next_object;
module_instance -> txm_module_instance_object_list_head = next_object;
}
}
/* Release the object memory. */
/* Release the object memory. */
return_value = (ULONG) _txe_byte_release((VOID *) module_allocated_object_ptr);
}
}
@@ -130,9 +130,9 @@ UINT return_value;
/* Set return value to not enabled. */
return_value = TX_NOT_AVAILABLE;
}
/* Release the protection mutex. */
_txe_mutex_put(&_txm_module_manager_mutex);
return(return_value);
}

View File

@@ -76,7 +76,7 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* */
/**************************************************************************/
UINT _txm_module_manager_object_pointer_get(UINT object_type, CHAR *name, VOID **object_ptr)
@@ -84,7 +84,7 @@ UINT _txm_module_manager_object_pointer_get(UINT object_type, CHAR *name, VOID
UINT status;
/* Call the secure version of this function with the maximum length
/* Call the secure version of this function with the maximum length
possible since none was passed. */
status = _txm_module_manager_object_pointer_get_extended(object_type, name, TXM_MODULE_MANAGER_UTIL_MAX_VALUE_OF_TYPE_UNSIGNED(UINT), object_ptr);
return(status);

View File

@@ -93,14 +93,14 @@
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* */
/**************************************************************************/
UINT _txm_module_manager_object_pointer_get_extended(UINT object_type, CHAR *search_name, UINT search_name_length, VOID **object_ptr)
{
TX_INTERRUPT_SAVE_AREA
TX_THREAD *thread_ptr;
TX_TIMER *timer_ptr;
TX_QUEUE *queue_ptr;
@@ -117,7 +117,7 @@ TXM_MODULE_INSTANCE *module_instance;
/* Determine if the name or object pointer are NULL. */
if ((search_name == TX_NULL) || (object_ptr == TX_NULL))
{
/* Return error! */
return(TX_PTR_ERROR);
}
@@ -133,36 +133,36 @@ TXM_MODULE_INSTANCE *module_instance;
/* Temporarily disable preemption. This will keep other threads from creating and deleting threads. */
_tx_thread_preempt_disable++;
/* Restore interrupts. */
TX_RESTORE
/* Process relative to the object type. */
switch(object_type)
{
/* Determine if a thread object is requested. */
case TXM_THREAD_OBJECT:
{
{
/* Loop to find the first matching thread. */
i = 0;
thread_ptr = _tx_thread_created_ptr;
while (i < _tx_thread_created_count)
{
/* Do we have a match? */
if (_txm_module_manager_object_name_compare(search_name, search_name_length, thread_ptr -> tx_thread_name))
{
/* Yes, we found it - return the necessary info! */
*object_ptr = (VOID *) thread_ptr;
/* Set the the status to success! */
status = TX_SUCCESS;
status = TX_SUCCESS;
break;
}
/* Increment the counter. */
i++;
@@ -171,32 +171,32 @@ TXM_MODULE_INSTANCE *module_instance;
}
break;
}
/* Determine if a timer object is requested. */
case TXM_TIMER_OBJECT:
{
/* Loop to find the first matching timer. */
i = 0;
timer_ptr = _tx_timer_created_ptr;
while (i < _tx_timer_created_count)
{
/* Do we have a match? */
if (_txm_module_manager_object_name_compare(search_name, search_name_length, timer_ptr -> tx_timer_name))
{
/* Yes, we found it - return the necessary info! */
*object_ptr = (VOID *) timer_ptr;
/* Set the the status to success! */
status = TX_SUCCESS;
status = TX_SUCCESS;
break;
}
/* Increment the counter. */
i++;
/* Move to next timer. */
timer_ptr = timer_ptr -> tx_timer_created_next;
}
@@ -212,22 +212,22 @@ TXM_MODULE_INSTANCE *module_instance;
queue_ptr = _tx_queue_created_ptr;
while (i < _tx_queue_created_count)
{
/* Do we have a match? */
if (_txm_module_manager_object_name_compare(search_name, search_name_length, queue_ptr -> tx_queue_name))
{
/* Yes, we found it - return the necessary info! */
*object_ptr = (VOID *) queue_ptr;
/* Set the the status to success! */
status = TX_SUCCESS;
status = TX_SUCCESS;
break;
}
/* Increment the counter. */
i++;
/* Move to next queue. */
queue_ptr = queue_ptr -> tx_queue_created_next;
}
@@ -243,22 +243,22 @@ TXM_MODULE_INSTANCE *module_instance;
events_ptr = _tx_event_flags_created_ptr;
while (i < _tx_event_flags_created_count)
{
/* Do we have a match? */
if (_txm_module_manager_object_name_compare(search_name, search_name_length, events_ptr -> tx_event_flags_group_name))
{
/* Yes, we found it - return the necessary info! */
*object_ptr = (VOID *) events_ptr;
/* Set the the status to success! */
status = TX_SUCCESS;
status = TX_SUCCESS;
break;
}
/* Increment the counter. */
i++;
/* Move to next event flags group. */
events_ptr = events_ptr -> tx_event_flags_group_created_next;
}
@@ -274,22 +274,22 @@ TXM_MODULE_INSTANCE *module_instance;
semaphore_ptr = _tx_semaphore_created_ptr;
while (i < _tx_semaphore_created_count)
{
/* Do we have a match? */
if (_txm_module_manager_object_name_compare(search_name, search_name_length, semaphore_ptr -> tx_semaphore_name))
{
/* Yes, we found it - return the necessary info! */
*object_ptr = (VOID *) semaphore_ptr;
/* Set the the status to success! */
status = TX_SUCCESS;
status = TX_SUCCESS;
break;
}
/* Increment the counter. */
i++;
/* Move to next semaphore. */
semaphore_ptr = semaphore_ptr -> tx_semaphore_created_next;
}
@@ -305,22 +305,22 @@ TXM_MODULE_INSTANCE *module_instance;
mutex_ptr = _tx_mutex_created_ptr;
while (i < _tx_mutex_created_count)
{
/* Do we have a match? */
if (_txm_module_manager_object_name_compare(search_name, search_name_length, mutex_ptr -> tx_mutex_name))
{
/* Yes, we found it - return the necessary info! */
*object_ptr = (VOID *) mutex_ptr;
/* Set the the status to success! */
status = TX_SUCCESS;
status = TX_SUCCESS;
break;
}
/* Increment the counter. */
i++;
/* Move to next mutex. */
mutex_ptr = mutex_ptr -> tx_mutex_created_next;
}
@@ -353,22 +353,22 @@ TXM_MODULE_INSTANCE *module_instance;
block_pool_ptr = _tx_block_pool_created_ptr;
while (i < _tx_block_pool_created_count)
{
/* Do we have a match? */
if (_txm_module_manager_object_name_compare(search_name, search_name_length, block_pool_ptr -> tx_block_pool_name))
{
/* Yes, we found it - return the necessary info! */
*object_ptr = (VOID *) block_pool_ptr;
/* Set the the status to success! */
status = TX_SUCCESS;
status = TX_SUCCESS;
break;
}
/* Increment the counter. */
i++;
/* Move to next block pool. */
block_pool_ptr = block_pool_ptr -> tx_block_pool_created_next;
}
@@ -401,22 +401,22 @@ TXM_MODULE_INSTANCE *module_instance;
byte_pool_ptr = _tx_byte_pool_created_ptr;
while (i < _tx_byte_pool_created_count)
{
/* Do we have a match? */
if (_txm_module_manager_object_name_compare(search_name, search_name_length, byte_pool_ptr -> tx_byte_pool_name))
{
/* Yes, we found it - return the necessary info! */
*object_ptr = (VOID *) byte_pool_ptr;
/* Set the the status to success! */
status = TX_SUCCESS;
status = TX_SUCCESS;
break;
}
/* Increment the counter. */
i++;
/* Move to next byte pool. */
byte_pool_ptr = byte_pool_ptr -> tx_byte_pool_created_next;
}
@@ -435,7 +435,7 @@ TXM_MODULE_INSTANCE *module_instance;
/* Determine if there is a NetX object get request. */
if ((object_type >= TXM_NETX_OBJECTS_START) && (object_type < TXM_NETX_OBJECTS_END))
{
/* Call the NetX module object get function. */
status = _txm_module_manager_netx_object_pointer_get(object_type, search_name, search_name_length, object_ptr);
}
@@ -446,7 +446,7 @@ TXM_MODULE_INSTANCE *module_instance;
/* Determine if there is a NetX Duo object get request. */
if ((object_type >= TXM_NETXDUO_OBJECTS_START) && (object_type < TXM_NETXDUO_OBJECTS_END))
{
/* Call the NetX Duo module object get function. */
status = _txm_module_manager_netxduo_object_pointer_get(object_type, search_name, search_name_length, object_ptr);
}
@@ -457,7 +457,7 @@ TXM_MODULE_INSTANCE *module_instance;
/* Determine if there is a FileX object get request. */
if ((object_type >= TXM_FILEX_OBJECTS_START) && (object_type < TXM_FILEX_OBJECTS_END))
{
/* Call the FileX module object get function. */
status = _txm_module_manager_filex_object_pointer_get(object_type, search_name, search_name_length, object_ptr);
}
@@ -469,7 +469,7 @@ TXM_MODULE_INSTANCE *module_instance;
/* Determine if there is a GUIX object get request. */
if ((object_type >= TXM_GUIX_OBJECTS_START) && (object_type < TXM_GUIX_OBJECTS_END))
{
/* Call the GUIX module object get function. */
status = _txm_module_manager_guix_object_pointer_get(object_type, search_name, search_name_length, object_ptr);
}
@@ -480,13 +480,13 @@ TXM_MODULE_INSTANCE *module_instance;
/* Determine if there is a USBX object get request. */
if ((object_type >= TXM_USBX_OBJECTS_START) && (object_type < TXM_USBX_OBJECTS_END))
{
/* Call the USBX object get function. */
status = _txm_module_manager_usbx_object_pointer_get(object_type, search_name, search_name_length, object_ptr);
}
#endif
break;
break;
}
/* Disable interrupts. */

View File

@@ -10,15 +10,15 @@
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Module Manager */
/** */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Module Manager */
/** */
/**************************************************************************/
/**************************************************************************/
#define TX_SOURCE_CODE
@@ -26,56 +26,56 @@
#include "txm_module.h"
#include "tx_byte_pool.h"
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* txm_module_manager_object_pool_create PORTABLE C */
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* txm_module_manager_object_pool_create PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Scott Larson, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function creates an object pool for the module manager, */
/* which is used by modules to allocate system resources outside */
/* the memory area of the module. This is especially useful in */
/* memory protection. */
/* */
/* INPUT */
/* */
/* object_memory Object memory address */
/* object_memory_size Size in bytes of memory area */
/* */
/* OUTPUT */
/* */
/* status Completion status */
/* */
/* CALLS */
/* */
/* _tx_byte_pool_create Create module memory byte pool */
/* */
/* CALLED BY */
/* */
/* Application code */
/* */
/* RELEASE HISTORY */
/* */
/* DESCRIPTION */
/* */
/* This function creates an object pool for the module manager, */
/* which is used by modules to allocate system resources outside */
/* the memory area of the module. This is especially useful in */
/* memory protection. */
/* */
/* INPUT */
/* */
/* object_memory Object memory address */
/* object_memory_size Size in bytes of memory area */
/* */
/* OUTPUT */
/* */
/* status Completion status */
/* */
/* CALLS */
/* */
/* _tx_byte_pool_create Create module memory byte pool */
/* */
/* CALLED BY */
/* */
/* Application code */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* */
/**************************************************************************/
UINT _txm_module_manager_object_pool_create(VOID *object_memory, ULONG object_memory_size)
{
/* Create a byte pool for allocating RAM areas for modules. */
/* Create a byte pool for allocating RAM areas for modules. */
_tx_byte_pool_create(&_txm_module_manager_object_pool, "Module Manager Object Pool", object_memory, object_memory_size);
/* Indicate the module manager object pool has been created. */
_txm_module_manager_object_pool_created = TX_TRUE;
/* Return success. */
return(TX_SUCCESS);
}

View File

@@ -10,57 +10,57 @@
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Module Manager */
/** */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Module Manager */
/** */
/**************************************************************************/
/**************************************************************************/
#define TX_SOURCE_CODE
#include "txm_module.h"
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_properties_get PORTABLE C */
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_properties_get PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Scott Larson, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function returns the properties of the specified module so they*/
/* may be checked before executing the module. */
/* */
/* INPUT */
/* */
/* module_instance Module instance pointer */
/* */
/* OUTPUT */
/* */
/* status Completion status */
/* */
/* CALLS */
/* */
/* None */
/* */
/* CALLED BY */
/* */
/* Application code */
/* */
/* RELEASE HISTORY */
/* */
/* DESCRIPTION */
/* */
/* This function returns the properties of the specified module so they*/
/* may be checked before executing the module. */
/* */
/* INPUT */
/* */
/* module_instance Module instance pointer */
/* */
/* OUTPUT */
/* */
/* status Completion status */
/* */
/* CALLS */
/* */
/* None */
/* */
/* CALLED BY */
/* */
/* Application code */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* */
/**************************************************************************/
UINT _txm_module_manager_properties_get(TXM_MODULE_INSTANCE *module_instance, ULONG *module_properties_ptr)
@@ -69,15 +69,15 @@ UINT _txm_module_manager_properties_get(TXM_MODULE_INSTANCE *module_instance, U
/* Determine if the module manager has not been initialized yet. */
if (_txm_module_manager_ready != TX_TRUE)
{
/* Module manager has not been initialized. */
return(TX_NOT_AVAILABLE);
return(TX_NOT_AVAILABLE);
}
/* Determine if the module is valid. */
if (module_instance == TX_NULL)
{
/* Invalid module pointer. */
return(TX_PTR_ERROR);
}

View File

@@ -10,15 +10,15 @@
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Module Manager */
/** */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Module Manager */
/** */
/**************************************************************************/
/**************************************************************************/
#define TX_SOURCE_CODE
@@ -28,41 +28,41 @@
#include "txm_module.h"
#ifndef TX_DISABLE_NOTIFY_CALLBACKS
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_queue_notify_trampoline PORTABLE C */
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_queue_notify_trampoline PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Scott Larson, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function processes the queue notification call from ThreadX. */
/* */
/* INPUT */
/* */
/* queue_ptr Queue pointer */
/* */
/* OUTPUT */
/* */
/* None */
/* */
/* CALLS */
/* */
/* _txm_module_manager_callback_request Send module callback request */
/* */
/* CALLED BY */
/* */
/* ThreadX */
/* */
/* RELEASE HISTORY */
/* */
/* DESCRIPTION */
/* */
/* This function processes the queue notification call from ThreadX. */
/* */
/* INPUT */
/* */
/* queue_ptr Queue pointer */
/* */
/* OUTPUT */
/* */
/* None */
/* */
/* CALLS */
/* */
/* _txm_module_manager_callback_request Send module callback request */
/* */
/* CALLED BY */
/* */
/* ThreadX */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* */
/**************************************************************************/
VOID _txm_module_manager_queue_notify_trampoline(TX_QUEUE *queue_ptr)
@@ -74,9 +74,9 @@ TXM_MODULE_INSTANCE *module_instance;
TXM_MODULE_CALLBACK_MESSAGE callback_message;
TX_QUEUE *module_callback_queue;
/* We now know the callback is for a module. */
/* Disable interrupts. */
TX_DISABLE
@@ -87,9 +87,9 @@ TX_QUEUE *module_callback_queue;
if ((module_instance) && (module_instance -> txm_module_instance_id == TXM_MODULE_ID) &&
(module_instance -> txm_module_instance_state == TXM_MODULE_STARTED))
{
/* Yes, the module is still valid. */
/* Yes, the module is still valid. */
/* Pickup the module's callback message queue. */
module_callback_queue = &(module_instance -> txm_module_instance_callback_request_queue);
@@ -107,26 +107,26 @@ TX_QUEUE *module_callback_queue;
callback_message.txm_module_callback_message_param_8 = 0;
callback_message.txm_module_callback_message_reserved1 = 0;
callback_message.txm_module_callback_message_reserved2 = 0;
/* Restore interrupts. */
TX_RESTORE
/* Call the general processing that will place the callback on the
/* Call the general processing that will place the callback on the
module's callback request queue. */
_txm_module_manager_callback_request(module_callback_queue, &callback_message);
}
else
{
/* Module no longer valid. */
/* Error, increment the error counter and return. */
_txm_module_manager_callback_error_count++;
/* Restore interrupts. */
TX_RESTORE
}
}
}
#endif

View File

@@ -10,15 +10,15 @@
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Module Manager */
/** */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Module Manager */
/** */
/**************************************************************************/
/**************************************************************************/
#define TX_SOURCE_CODE
@@ -28,42 +28,42 @@
#include "txm_module.h"
#ifndef TX_DISABLE_NOTIFY_CALLBACKS
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_semaphore_notify_trampoline PORTABLE C */
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_semaphore_notify_trampoline PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Scott Larson, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function processes the semaphore put notification call from */
/* ThreadX. */
/* */
/* INPUT */
/* */
/* semaphore_ptr Semaphore pointer */
/* */
/* OUTPUT */
/* */
/* None */
/* */
/* CALLS */
/* */
/* _txm_module_manager_callback_request Send module callback request */
/* */
/* CALLED BY */
/* */
/* ThreadX */
/* */
/* RELEASE HISTORY */
/* */
/* DESCRIPTION */
/* */
/* This function processes the semaphore put notification call from */
/* ThreadX. */
/* */
/* INPUT */
/* */
/* semaphore_ptr Semaphore pointer */
/* */
/* OUTPUT */
/* */
/* None */
/* */
/* CALLS */
/* */
/* _txm_module_manager_callback_request Send module callback request */
/* */
/* CALLED BY */
/* */
/* ThreadX */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* */
/**************************************************************************/
VOID _txm_module_manager_semaphore_notify_trampoline(TX_SEMAPHORE *semaphore_ptr)
@@ -75,9 +75,9 @@ TXM_MODULE_INSTANCE *module_instance;
TXM_MODULE_CALLBACK_MESSAGE callback_message;
TX_QUEUE *module_callback_queue;
/* We now know the callback is for a module. */
/* Disable interrupts. */
TX_DISABLE
@@ -88,9 +88,9 @@ TX_QUEUE *module_callback_queue;
if ((module_instance) && (module_instance -> txm_module_instance_id == TXM_MODULE_ID) &&
(module_instance -> txm_module_instance_state == TXM_MODULE_STARTED))
{
/* Yes, the module is still valid. */
/* Yes, the module is still valid. */
/* Pickup the module's callback message queue. */
module_callback_queue = &(module_instance -> txm_module_instance_callback_request_queue);
@@ -108,24 +108,24 @@ TX_QUEUE *module_callback_queue;
callback_message.txm_module_callback_message_param_8 = 0;
callback_message.txm_module_callback_message_reserved1 = 0;
callback_message.txm_module_callback_message_reserved2 = 0;
/* Restore interrupts. */
TX_RESTORE
/* Call the general processing that will place the callback on the
/* Call the general processing that will place the callback on the
module's callback request queue. */
_txm_module_manager_callback_request(module_callback_queue, &callback_message);
}
else
{
/* Module no longer valid. */
/* Error, increment the error counter and return. */
_txm_module_manager_callback_error_count++;
/* Restore interrupts. */
TX_RESTORE
}
}
}
#endif

View File

@@ -75,22 +75,22 @@
/**************************************************************************/
UINT _txm_module_manager_start(TXM_MODULE_INSTANCE *module_instance)
{
UINT status;
/* Determine if the module manager has not been initialized yet. */
if (_txm_module_manager_ready != TX_TRUE)
{
/* Module manager has not been initialized. */
return(TX_NOT_AVAILABLE);
return(TX_NOT_AVAILABLE);
}
/* Determine if the module is valid. */
if (module_instance == TX_NULL)
{
/* Invalid module pointer. */
return(TX_PTR_ERROR);
}
@@ -108,11 +108,11 @@ UINT status;
/* Invalid module pointer. */
return(TX_PTR_ERROR);
}
/* Determine if the module instance is in the loaded state. */
if ((module_instance -> txm_module_instance_state != TXM_MODULE_LOADED) && (module_instance -> txm_module_instance_state != TXM_MODULE_STOPPED))
{
/* Release the protection mutex. */
_tx_mutex_put(&_txm_module_manager_mutex);
@@ -124,7 +124,7 @@ UINT status;
if (module_instance -> txm_module_instance_start_stop_priority < module_instance -> txm_module_instance_maximum_priority ||
module_instance -> txm_module_instance_callback_priority < module_instance -> txm_module_instance_maximum_priority)
{
/* Release the protection mutex. */
_tx_mutex_put(&_txm_module_manager_mutex);
@@ -133,13 +133,13 @@ UINT status;
}
/* Create the module's callback request queue. */
status = _tx_queue_create(&(module_instance -> txm_module_instance_callback_request_queue), "Module Callback Request Queue", (sizeof(TXM_MODULE_CALLBACK_MESSAGE)/sizeof(ULONG)),
status = _tx_queue_create(&(module_instance -> txm_module_instance_callback_request_queue), "Module Callback Request Queue", (sizeof(TXM_MODULE_CALLBACK_MESSAGE)/sizeof(ULONG)),
module_instance -> txm_module_instance_callback_request_queue_area, sizeof(module_instance -> txm_module_instance_callback_request_queue_area));
/* Determine if there was an error. */
if (status)
{
/* Release the protection mutex. */
_tx_mutex_put(&_txm_module_manager_mutex);
@@ -147,7 +147,7 @@ UINT status;
return(TX_START_ERROR);
}
/* Create the module start thread. */
/* Create the module start thread. */
status = _txm_module_manager_thread_create(&(module_instance -> txm_module_instance_start_stop_thread),
"Module Start Thread",
module_instance -> txm_module_instance_shell_entry_function,
@@ -158,14 +158,14 @@ UINT status;
(UINT) module_instance -> txm_module_instance_start_stop_priority,
(UINT) module_instance -> txm_module_instance_start_stop_priority,
TXM_MODULE_TIME_SLICE,
TX_DONT_START,
TX_DONT_START,
sizeof(TX_THREAD),
module_instance);
/* Determine if the thread create was successful. */
if (status != TX_SUCCESS)
{
/* Delete the callback notification queue. */
_tx_queue_delete(&(module_instance -> txm_module_instance_callback_request_queue));
@@ -173,10 +173,10 @@ UINT status;
_tx_mutex_put(&_txm_module_manager_mutex);
/* Return the error status. */
return(status);
return(status);
}
/* Create the module callback thread. */
/* Create the module callback thread. */
status = _txm_module_manager_thread_create(&(module_instance -> txm_module_instance_callback_request_thread),
"Module Callback Request Thread",
module_instance -> txm_module_instance_shell_entry_function,
@@ -187,20 +187,20 @@ UINT status;
(UINT) module_instance -> txm_module_instance_callback_priority,
(UINT) module_instance -> txm_module_instance_callback_priority,
TX_NO_TIME_SLICE,
TX_DONT_START,
TX_DONT_START,
sizeof(TX_THREAD),
module_instance);
/* Determine if the thread create was successful. */
if (status != TX_SUCCESS)
{
/* Terminate the start thread. */
_tx_thread_terminate(&(module_instance -> txm_module_instance_start_stop_thread));
/* Delete the start thread. */
_tx_thread_delete(&(module_instance -> txm_module_instance_start_stop_thread));
/* Delete the callback notification queue. */
_tx_queue_delete(&(module_instance -> txm_module_instance_callback_request_queue));
@@ -208,7 +208,7 @@ UINT status;
_tx_mutex_put(&_txm_module_manager_mutex);
/* Return the error status. */
return(status);
return(status);
}

View File

@@ -10,15 +10,15 @@
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Module Manager */
/** */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Module Manager */
/** */
/**************************************************************************/
/**************************************************************************/
#define TX_SOURCE_CODE
@@ -28,43 +28,43 @@
#include "txm_module.h"
#ifndef TX_DISABLE_NOTIFY_CALLBACKS
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_thread_notify_trampoline PORTABLE C */
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_thread_notify_trampoline PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Scott Larson, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function processes the thread entry/exit notification call */
/* from ThreadX. */
/* */
/* INPUT */
/* */
/* thread_ptr Thread pointer */
/* type Entry or exit type */
/* */
/* OUTPUT */
/* */
/* None */
/* */
/* CALLS */
/* */
/* _txm_module_manager_callback_request Send module callback request */
/* */
/* CALLED BY */
/* */
/* ThreadX */
/* */
/* RELEASE HISTORY */
/* */
/* DESCRIPTION */
/* */
/* This function processes the thread entry/exit notification call */
/* from ThreadX. */
/* */
/* INPUT */
/* */
/* thread_ptr Thread pointer */
/* type Entry or exit type */
/* */
/* OUTPUT */
/* */
/* None */
/* */
/* CALLS */
/* */
/* _txm_module_manager_callback_request Send module callback request */
/* */
/* CALLED BY */
/* */
/* ThreadX */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* */
/**************************************************************************/
VOID _txm_module_manager_thread_notify_trampoline(TX_THREAD *thread_ptr, UINT type)
@@ -77,9 +77,9 @@ TXM_MODULE_CALLBACK_MESSAGE callback_message;
TX_QUEUE *module_callback_queue;
TXM_MODULE_THREAD_ENTRY_INFO *thread_info;
/* We now know the callback is for a module. */
/* Disable interrupts. */
TX_DISABLE
@@ -97,9 +97,9 @@ TXM_MODULE_THREAD_ENTRY_INFO *thread_info;
if ((module_instance) && (module_instance -> txm_module_instance_id == TXM_MODULE_ID) &&
(module_instance -> txm_module_instance_state == TXM_MODULE_STARTED))
{
/* Yes, the module is still valid. */
/* Yes, the module is still valid. */
/* Pickup the module's callback message queue. */
module_callback_queue = &(module_instance -> txm_module_instance_callback_request_queue);
@@ -117,19 +117,19 @@ TXM_MODULE_THREAD_ENTRY_INFO *thread_info;
callback_message.txm_module_callback_message_param_8 = 0;
callback_message.txm_module_callback_message_reserved1 = 0;
callback_message.txm_module_callback_message_reserved2 = 0;
/* Restore interrupts. */
TX_RESTORE
/* Call the general processing that will place the callback on the
/* Call the general processing that will place the callback on the
module's callback request queue. */
_txm_module_manager_callback_request(module_callback_queue, &callback_message);
}
else
{
/* Module no longer valid. */
/* Error, increment the error counter and return. */
_txm_module_manager_callback_error_count++;
@@ -139,15 +139,15 @@ TXM_MODULE_THREAD_ENTRY_INFO *thread_info;
}
else
{
/* Thread pointer is not valid. */
/* Error, increment the error counter and return. */
_txm_module_manager_callback_error_count++;
/* Restore interrupts. */
TX_RESTORE
}
}
}
#endif

View File

@@ -10,15 +10,15 @@
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Module Manager */
/** */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Module Manager */
/** */
/**************************************************************************/
/**************************************************************************/
#define TX_SOURCE_CODE
@@ -27,45 +27,45 @@
#include "tx_thread.h"
#include "txm_module.h"
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_thread_reset PORTABLE C */
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_thread_reset PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Scott Larson, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function prepares the thread to run again from the entry */
/* point specified during thread creation. The application must */
/* call tx_thread_resume after this call completes for the thread */
/* to actually run. */
/* */
/* INPUT */
/* */
/* thread_ptr Pointer to thread to reset */
/* */
/* OUTPUT */
/* */
/* status Service return status */
/* */
/* CALLS */
/* */
/* _txm_module_manager_thread_stack_build Build initial thread */
/* stack */
/* */
/* CALLED BY */
/* */
/* _txm_module_manager_kernel_dispatch Kernel dispatch function */
/* */
/* RELEASE HISTORY */
/* */
/* DESCRIPTION */
/* */
/* This function prepares the thread to run again from the entry */
/* point specified during thread creation. The application must */
/* call tx_thread_resume after this call completes for the thread */
/* to actually run. */
/* */
/* INPUT */
/* */
/* thread_ptr Pointer to thread to reset */
/* */
/* OUTPUT */
/* */
/* status Service return status */
/* */
/* CALLS */
/* */
/* _txm_module_manager_thread_stack_build Build initial thread */
/* stack */
/* */
/* CALLED BY */
/* */
/* _txm_module_manager_kernel_dispatch Kernel dispatch function */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* */
/**************************************************************************/
UINT _txm_module_manager_thread_reset(TX_THREAD *thread_ptr)
@@ -101,7 +101,7 @@ TXM_MODULE_THREAD_ENTRY_INFO *thread_entry_info;
{
/* Check for proper status of this thread to reset. */
if (thread_ptr -> tx_thread_state != TX_COMPLETED)
if (thread_ptr -> tx_thread_state != TX_COMPLETED)
{
/* Now check for terminated state. */
@@ -139,18 +139,18 @@ TXM_MODULE_THREAD_ENTRY_INFO *thread_entry_info;
#endif
/* Setup pointer to the thread entry information structure, which will live at the top of each
module thread's stack. This will allow the module thread entry function to avoid direct
module thread's stack. This will allow the module thread entry function to avoid direct
access to the actual thread control block. */
thread_entry_info = (TXM_MODULE_THREAD_ENTRY_INFO *) (((UCHAR *) thread_ptr -> tx_thread_stack_end) + (2*sizeof(ULONG)) + 1);
thread_entry_info = (TXM_MODULE_THREAD_ENTRY_INFO *) (((ALIGN_TYPE)(thread_entry_info)) & (~0x3));
/* Place the thread entry information pointer in the thread control block so it can be picked up
in the following stack build function. This is supplied to the module's shell entry function
to avoid direct access to the actual thread control block. Note that this is overwritten
with the actual stack pointer at the end of stack build. */
thread_ptr -> tx_thread_stack_ptr = (VOID *) thread_entry_info;
/* Call the target specific stack frame building routine to build the
/* Call the target specific stack frame building routine to build the
thread's initial stack and to setup the actual stack pointer in the
control block. */
_txm_module_manager_thread_stack_build(thread_ptr, module_instance -> txm_module_instance_shell_entry_function);

View File

@@ -10,15 +10,15 @@
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Module Manager */
/** */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Module Manager */
/** */
/**************************************************************************/
/**************************************************************************/
#define TX_SOURCE_CODE
@@ -27,43 +27,43 @@
#include "tx_thread.h"
#include "tx_timer.h"
#include "txm_module.h"
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_timer_notify_trampoline PORTABLE C */
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_timer_notify_trampoline PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Scott Larson, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function processes the timer expirations from ThreadX. */
/* */
/* INPUT */
/* */
/* id Timer ID */
/* */
/* OUTPUT */
/* */
/* None */
/* */
/* CALLS */
/* */
/* _txm_module_manager_callback_request Send module callback request */
/* */
/* CALLED BY */
/* */
/* ThreadX */
/* */
/* RELEASE HISTORY */
/* */
/* DESCRIPTION */
/* */
/* This function processes the timer expirations from ThreadX. */
/* */
/* INPUT */
/* */
/* id Timer ID */
/* */
/* OUTPUT */
/* */
/* None */
/* */
/* CALLS */
/* */
/* _txm_module_manager_callback_request Send module callback request */
/* */
/* CALLED BY */
/* */
/* ThreadX */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* */
/**************************************************************************/
VOID _txm_module_manager_timer_notify_trampoline(ULONG id)
@@ -77,20 +77,20 @@ TX_QUEUE *module_callback_queue;
TX_TIMER *timer_ptr;
CHAR *internal_ptr;
/* We now know the callback is for a module. */
/* Disable interrupts. */
TX_DISABLE
/* Our expired timer pointer points to the internal timer,
/* Our expired timer pointer points to the internal timer,
* we need to get to the full timer pointer. */
/* Pickup the current internal timer pointer. */
internal_ptr = (CHAR *) _tx_timer_expired_timer_ptr;
internal_ptr = (CHAR *) _tx_timer_expired_timer_ptr;
/* Get the timer pointer from the internal pointer. */
TX_USER_TIMER_POINTER_GET((TX_TIMER_INTERNAL *) internal_ptr, timer_ptr);
/* Pickup the module instance pointer. */
module_instance = (TXM_MODULE_INSTANCE *) timer_ptr -> tx_timer_module_instance;
@@ -98,9 +98,9 @@ CHAR *internal_ptr;
if ((module_instance) && (module_instance -> txm_module_instance_id == TXM_MODULE_ID) &&
(module_instance -> txm_module_instance_state == TXM_MODULE_STARTED))
{
/* Yes, the module is still valid. */
/* Yes, the module is still valid. */
/* Pickup the module's callback message queue. */
module_callback_queue = &(module_instance -> txm_module_instance_callback_request_queue);
@@ -118,24 +118,24 @@ CHAR *internal_ptr;
callback_message.txm_module_callback_message_param_8 = 0;
callback_message.txm_module_callback_message_reserved1 = 0;
callback_message.txm_module_callback_message_reserved2 = 0;
/* Restore interrupts. */
TX_RESTORE
/* Call the general processing that will place the callback on the
/* Call the general processing that will place the callback on the
module's callback request queue. */
_txm_module_manager_callback_request(module_callback_queue, &callback_message);
}
else
{
/* Module no longer valid. */
/* Error, increment the error counter and return. */
_txm_module_manager_callback_error_count++;
/* Restore interrupts. */
TX_RESTORE
}
}
}

View File

@@ -10,15 +10,15 @@
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Module Manager */
/** */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Module Manager */
/** */
/**************************************************************************/
/**************************************************************************/
#define TX_SOURCE_CODE
@@ -30,50 +30,50 @@
#include "txm_module.h"
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_unload PORTABLE C */
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_unload PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Scott Larson, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function unloads a previously loaded module. */
/* */
/* INPUT */
/* */
/* module_instance Module instance pointer */
/* */
/* OUTPUT */
/* */
/* status Completion status */
/* */
/* CALLS */
/* */
/* _tx_byte_release Release data area */
/* _tx_mutex_get Get protection mutex */
/* _tx_mutex_put Release protection mutex */
/* */
/* CALLED BY */
/* */
/* Application code */
/* */
/* RELEASE HISTORY */
/* */
/* DESCRIPTION */
/* */
/* This function unloads a previously loaded module. */
/* */
/* INPUT */
/* */
/* module_instance Module instance pointer */
/* */
/* OUTPUT */
/* */
/* status Completion status */
/* */
/* CALLS */
/* */
/* _tx_byte_release Release data area */
/* _tx_mutex_get Get protection mutex */
/* _tx_mutex_put Release protection mutex */
/* */
/* CALLED BY */
/* */
/* Application code */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* */
/**************************************************************************/
UINT _txm_module_manager_unload(TXM_MODULE_INSTANCE *module_instance)
{
TX_INTERRUPT_SAVE_AREA
TXM_MODULE_INSTANCE *next_module, *previous_module;
CHAR *memory_ptr;
@@ -81,11 +81,11 @@ CHAR *memory_ptr;
/* Check for interrupt call. */
if (TX_THREAD_GET_SYSTEM_STATE() != 0)
{
/* Now, make sure the call is from an interrupt and not initialization. */
if (TX_THREAD_GET_SYSTEM_STATE() < TX_INITIALIZE_IN_PROGRESS)
{
/* Invalid caller of this function, return appropriate error code. */
return(TX_CALLER_ERROR);
}
@@ -94,15 +94,15 @@ CHAR *memory_ptr;
/* Determine if the module manager has not been initialized yet. */
if (_txm_module_manager_ready != TX_TRUE)
{
/* Module manager has not been initialized. */
return(TX_NOT_AVAILABLE);
return(TX_NOT_AVAILABLE);
}
/* Determine if the module is valid. */
if (module_instance == TX_NULL)
{
/* Invalid module pointer. */
return(TX_PTR_ERROR);
}
@@ -124,7 +124,7 @@ CHAR *memory_ptr;
/* Determine if the module instance is in the state. */
if ((module_instance -> txm_module_instance_state != TXM_MODULE_LOADED) && (module_instance -> txm_module_instance_state != TXM_MODULE_STOPPED))
{
/* Release the protection mutex. */
_tx_mutex_put(&_txm_module_manager_mutex);
@@ -141,14 +141,14 @@ CHAR *memory_ptr;
/* Determine if there was memory allocated for the code. */
if (module_instance -> txm_module_instance_code_allocation_ptr)
{
/* Yes, release the module's code memory. */
memory_ptr = module_instance -> txm_module_instance_code_allocation_ptr;
/* Release the module's data memory. */
_tx_byte_release(memory_ptr);
}
/* Temporarily disable interrupts. */
TX_DISABLE
@@ -158,7 +158,7 @@ CHAR *memory_ptr;
/* Call port-specific unload function. */
TXM_MODULE_MANAGER_MODULE_UNLOAD(module_instance);
/* Remove the module from the linked list of loaded modules. */
/* See if the module is the only one on the list. */
@@ -180,9 +180,9 @@ CHAR *memory_ptr;
/* See if we have to update the created list head pointer. */
if (_txm_module_manager_loaded_list_ptr == module_instance)
{
/* Yes, move the head pointer to the next link. */
_txm_module_manager_loaded_list_ptr = next_module;
_txm_module_manager_loaded_list_ptr = next_module;
}
}

View File

@@ -10,15 +10,15 @@
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Module Manager */
/** */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** ThreadX Component */
/** */
/** Module Manager */
/** */
/**************************************************************************/
/**************************************************************************/
/* Include necessary system files. */
@@ -29,115 +29,115 @@
#include "txm_module_manager_util.h"
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_object_memory_check PORTABLE C */
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_object_memory_check PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Scott Larson, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function checks if the object is inside a module's object pool */
/* or, if it's a privileged module, inside the module's data area. */
/* */
/* INPUT */
/* */
/* module_instance Module instance that the object */
/* belongs to */
/* object_ptr Pointer to object to check */
/* object_size Size of the object to check */
/* */
/* OUTPUT */
/* */
/* status Whether the object resides in a */
/* valid location */
/* */
/* CALLS */
/* */
/* None */
/* */
/* CALLED BY */
/* */
/* _txm_module_manager_kernel_dispatch Kernel dispatch function */
/* */
/* RELEASE HISTORY */
/* */
/* DESCRIPTION */
/* */
/* This function checks if the object is inside a module's object pool */
/* or, if it's a privileged module, inside the module's data area. */
/* */
/* INPUT */
/* */
/* module_instance Module instance that the object */
/* belongs to */
/* object_ptr Pointer to object to check */
/* object_size Size of the object to check */
/* */
/* OUTPUT */
/* */
/* status Whether the object resides in a */
/* valid location */
/* */
/* CALLS */
/* */
/* None */
/* */
/* CALLED BY */
/* */
/* _txm_module_manager_kernel_dispatch Kernel dispatch function */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* */
/**************************************************************************/
UINT _txm_module_manager_object_memory_check(TXM_MODULE_INSTANCE *module_instance, ALIGN_TYPE object_ptr, ULONG object_size)
{
/* Is the object pointer from the module manager's object pool? */
if ((_txm_module_manager_object_pool_created == TX_TRUE) &&
(object_ptr >= (ALIGN_TYPE) _txm_module_manager_object_pool.tx_byte_pool_start) &&
if ((_txm_module_manager_object_pool_created == TX_TRUE) &&
(object_ptr >= (ALIGN_TYPE) _txm_module_manager_object_pool.tx_byte_pool_start) &&
((object_ptr+object_size) <= (ALIGN_TYPE) (_txm_module_manager_object_pool.tx_byte_pool_start + _txm_module_manager_object_pool.tx_byte_pool_size)))
{
/* Object is from manager object pool. */
return(TX_SUCCESS);
}
/* If memory protection is not required, check if object is in module data. */
else if (!(module_instance -> txm_module_instance_property_flags & TXM_MODULE_MEMORY_PROTECTION))
{
if ((object_ptr >= (ALIGN_TYPE) module_instance -> txm_module_instance_data_start) &&
if ((object_ptr >= (ALIGN_TYPE) module_instance -> txm_module_instance_data_start) &&
((object_ptr+object_size) <= (ALIGN_TYPE) module_instance -> txm_module_instance_data_end))
{
/* Object is from the local module memory. */
return(TX_SUCCESS);
}
}
/* Object is from invalid memory. */
return(TXM_MODULE_INVALID_MEMORY);
}
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_created_object_check PORTABLE C */
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_created_object_check PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Scott Larson, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* DESCRIPTION */
/* */
/* This functions checks if the specified object was created by the */
/* specified module */
/* */
/* INPUT */
/* */
/* module_instance The module instance to check */
/* object_ptr The object to check */
/* */
/* OUTPUT */
/* */
/* status Whether the module created the */
/* object */
/* */
/* CALLS */
/* */
/* None */
/* */
/* CALLED BY */
/* */
/* txm_module_manager*_stop Module manager stop functions */
/* */
/* RELEASE HISTORY */
/* */
/* specified module */
/* */
/* INPUT */
/* */
/* module_instance The module instance to check */
/* object_ptr The object to check */
/* */
/* OUTPUT */
/* */
/* status Whether the module created the */
/* object */
/* */
/* CALLS */
/* */
/* None */
/* */
/* CALLED BY */
/* */
/* txm_module_manager*_stop Module manager stop functions */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* */
/**************************************************************************/
UCHAR _txm_module_manager_created_object_check(TXM_MODULE_INSTANCE *module_instance, VOID *object_ptr)
@@ -179,51 +179,51 @@ TXM_MODULE_ALLOCATED_OBJECT *allocated_object_ptr;
}
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_object_size_check PORTABLE C */
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_object_size_check PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Scott Larson, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function checks if the specified object's size matches what is */
/* inside the object pool. */
/* */
/* INPUT */
/* */
/* object_ptr Pointer to object to check */
/* object_size Size of the object to check */
/* */
/* OUTPUT */
/* */
/* status Whether the object's size matches */
/* what's inside the object pool */
/* */
/* CALLS */
/* */
/* None */
/* */
/* CALLED BY */
/* */
/* _txm_module_manager_kernel_dispatch Kernel dispatch function */
/* */
/* RELEASE HISTORY */
/* */
/* DESCRIPTION */
/* */
/* This function checks if the specified object's size matches what is */
/* inside the object pool. */
/* */
/* INPUT */
/* */
/* object_ptr Pointer to object to check */
/* object_size Size of the object to check */
/* */
/* OUTPUT */
/* */
/* status Whether the object's size matches */
/* what's inside the object pool */
/* */
/* CALLS */
/* */
/* None */
/* */
/* CALLED BY */
/* */
/* _txm_module_manager_kernel_dispatch Kernel dispatch function */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* */
/**************************************************************************/
UINT _txm_module_manager_object_size_check(ALIGN_TYPE object_ptr, ULONG object_size)
{
TXM_MODULE_ALLOCATED_OBJECT *module_allocated_object_ptr;
UINT return_value;
/* Pickup the allocated object pointer. */
module_allocated_object_ptr = ((TXM_MODULE_ALLOCATED_OBJECT *) object_ptr) - 1;
@@ -232,50 +232,50 @@ UINT return_value;
return_value = TX_SUCCESS;
else
return_value = TXM_MODULE_INVALID_MEMORY;
return(return_value);
}
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_name_compare PORTABLE C */
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_name_compare PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Scott Larson, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function compares the specified object names. */
/* */
/* INPUT */
/* */
/* search_name String pointer to the object's */
/* name being searched for */
/* search_name_length Length of search_name */
/* object_name String pointer to an object's name*/
/* to compare the search name to */
/* */
/* OUTPUT */
/* */
/* status Whether the names are equal */
/* */
/* CALLS */
/* */
/* None */
/* */
/* CALLED BY */
/* */
/* *_object_pointer_get Kernel dispatch function */
/* */
/* RELEASE HISTORY */
/* */
/* DESCRIPTION */
/* */
/* This function compares the specified object names. */
/* */
/* INPUT */
/* */
/* search_name String pointer to the object's */
/* name being searched for */
/* search_name_length Length of search_name */
/* object_name String pointer to an object's name*/
/* to compare the search name to */
/* */
/* OUTPUT */
/* */
/* status Whether the names are equal */
/* */
/* CALLS */
/* */
/* None */
/* */
/* CALLED BY */
/* */
/* *_object_pointer_get Kernel dispatch function */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* */
/**************************************************************************/
UINT _txm_module_manager_object_name_compare(CHAR *search_name, UINT search_name_length, CHAR *object_name)
@@ -337,48 +337,48 @@ CHAR object_name_char;
}
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_util_code_allocation_size_and_alignment_get */
/* PORTABLE C */
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _txm_module_manager_util_code_allocation_size_and_alignment_get */
/* PORTABLE C */
/* 6.1 */
/* AUTHOR */
/* */
/* Scott Larson, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function returns the required alignment and allocation size */
/* for a module's code area. */
/* */
/* INPUT */
/* */
/* module_preamble Preamble of module to return code */
/* values for */
/* code_alignment_dest Address to return code alignment */
/* code_allocation_size_desk Address to return code allocation */
/* size */
/* */
/* OUTPUT */
/* */
/* status Success if no math overflow */
/* occurred during calculation */
/* */
/* CALLS */
/* */
/* None */
/* */
/* CALLED BY */
/* */
/* txm_module_manager_*_load Module load functions */
/* */
/* RELEASE HISTORY */
/* */
/* DESCRIPTION */
/* */
/* This function returns the required alignment and allocation size */
/* for a module's code area. */
/* */
/* INPUT */
/* */
/* module_preamble Preamble of module to return code */
/* values for */
/* code_alignment_dest Address to return code alignment */
/* code_allocation_size_desk Address to return code allocation */
/* size */
/* */
/* OUTPUT */
/* */
/* status Success if no math overflow */
/* occurred during calculation */
/* */
/* CALLS */
/* */
/* None */
/* */
/* CALLED BY */
/* */
/* txm_module_manager_*_load Module load functions */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* 09-30-2020 Scott Larson Initial Version 6.1 */
/* */
/**************************************************************************/
UINT _txm_module_manager_util_code_allocation_size_and_alignment_get(TXM_MODULE_PREAMBLE *module_preamble,