mirror of
https://github.com/eclipse-threadx/threadx.git
synced 2025-11-16 04:24:48 +00:00
Fix MISRA issues for ThreadX SMP (#263)
* Fixed MISRA2012 rule 10.4_a The operands `pool_ptr->tx_byte_pool_fragments' and `2' have essential type categories unsigned 32-bit int and signed 8-bit int, which do not match. * Fixed MISRA2012 rule 10.4_a The operands `next_priority' and `TX_MAX_PRIORITIES' have essential type categories unsigned 32-bit int and signed 8-bit int, which do not match. * Fixed MISRA2012 rule 8.3 Declaration/definition of `_tx_thread_smp_preemptable_threads_get' is inconsistent with previous declaration/definition in types and/or type qualifiers
This commit is contained in:
@@ -26,7 +26,7 @@
|
|||||||
/* COMPONENT DEFINITION RELEASE */
|
/* COMPONENT DEFINITION RELEASE */
|
||||||
/* */
|
/* */
|
||||||
/* tx_thread.h PORTABLE SMP */
|
/* tx_thread.h PORTABLE SMP */
|
||||||
/* 6.1 */
|
/* 6.x */
|
||||||
/* AUTHOR */
|
/* AUTHOR */
|
||||||
/* */
|
/* */
|
||||||
/* William E. Lamie, Microsoft Corporation */
|
/* William E. Lamie, Microsoft Corporation */
|
||||||
@@ -42,6 +42,8 @@
|
|||||||
/* DATE NAME DESCRIPTION */
|
/* DATE NAME DESCRIPTION */
|
||||||
/* */
|
/* */
|
||||||
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||||
|
/* xx-xx-xxxx Tiejun Zhou Fixed MISRA2012 rule 8.3, */
|
||||||
|
/* resulting in version 6.x */
|
||||||
/* */
|
/* */
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
|
|
||||||
@@ -1349,7 +1351,7 @@ TX_THREAD *thread_remap_list[TX_THREAD_SMP_MAX_CORES];
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static INLINE_DECLARE ULONG _tx_thread_smp_preemptable_threads_get(UINT priority, TX_THREAD *possible_preemption_list[])
|
static INLINE_DECLARE ULONG _tx_thread_smp_preemptable_threads_get(UINT priority, TX_THREAD *possible_preemption_list[TX_THREAD_SMP_MAX_CORES])
|
||||||
{
|
{
|
||||||
|
|
||||||
UINT i, j, k;
|
UINT i, j, k;
|
||||||
@@ -1668,7 +1670,7 @@ ULONG _tx_thread_smp_available_cores_get(void);
|
|||||||
ULONG _tx_thread_smp_possible_cores_get(void);
|
ULONG _tx_thread_smp_possible_cores_get(void);
|
||||||
UINT _tx_thread_smp_lowest_priority_get(void);
|
UINT _tx_thread_smp_lowest_priority_get(void);
|
||||||
UINT _tx_thread_smp_remap_solution_find(TX_THREAD *schedule_thread, ULONG available_cores, ULONG thread_possible_cores, ULONG test_possible_cores);
|
UINT _tx_thread_smp_remap_solution_find(TX_THREAD *schedule_thread, ULONG available_cores, ULONG thread_possible_cores, ULONG test_possible_cores);
|
||||||
ULONG _tx_thread_smp_preemptable_threads_get(UINT priority, TX_THREAD *possible_preemption_list[]);
|
ULONG _tx_thread_smp_preemptable_threads_get(UINT priority, TX_THREAD *possible_preemption_list[TX_THREAD_SMP_MAX_CORES]);
|
||||||
VOID _tx_thread_smp_simple_priority_change(TX_THREAD *thread_ptr, UINT new_priority);
|
VOID _tx_thread_smp_simple_priority_change(TX_THREAD *thread_ptr, UINT new_priority);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
/* FUNCTION RELEASE */
|
/* FUNCTION RELEASE */
|
||||||
/* */
|
/* */
|
||||||
/* _tx_byte_pool_search PORTABLE SMP */
|
/* _tx_byte_pool_search PORTABLE SMP */
|
||||||
/* 6.1.7 */
|
/* 6.x */
|
||||||
/* AUTHOR */
|
/* AUTHOR */
|
||||||
/* */
|
/* */
|
||||||
/* William E. Lamie, Microsoft Corporation */
|
/* William E. Lamie, Microsoft Corporation */
|
||||||
@@ -81,6 +81,8 @@
|
|||||||
/* calculation, and reduced */
|
/* calculation, and reduced */
|
||||||
/* number of search resets, */
|
/* number of search resets, */
|
||||||
/* resulting in version 6.1.7 */
|
/* resulting in version 6.1.7 */
|
||||||
|
/* xx-xx-xxxx Tiejun Zhou Fixed MISRA2012 rule 10.4_a, */
|
||||||
|
/* resulting in version 6.x */
|
||||||
/* */
|
/* */
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
UCHAR *_tx_byte_pool_search(TX_BYTE_POOL *pool_ptr, ULONG memory_size)
|
UCHAR *_tx_byte_pool_search(TX_BYTE_POOL *pool_ptr, ULONG memory_size)
|
||||||
@@ -110,7 +112,7 @@ UINT blocks_searched = ((UINT) 0);
|
|||||||
|
|
||||||
/* First, determine if there are enough bytes in the pool. */
|
/* First, determine if there are enough bytes in the pool. */
|
||||||
/* Theoretical bytes available = free bytes + ((fragments-2) * overhead of each block) */
|
/* Theoretical bytes available = free bytes + ((fragments-2) * overhead of each block) */
|
||||||
total_theoretical_available = pool_ptr -> tx_byte_pool_available + ((pool_ptr -> tx_byte_pool_fragments - 2) * ((sizeof(UCHAR *)) + (sizeof(ALIGN_TYPE))));
|
total_theoretical_available = pool_ptr -> tx_byte_pool_available + ((pool_ptr -> tx_byte_pool_fragments - 2U) * ((sizeof(UCHAR *)) + (sizeof(ALIGN_TYPE))));
|
||||||
if (memory_size >= total_theoretical_available)
|
if (memory_size >= total_theoretical_available)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@@ -826,7 +826,7 @@ TX_THREAD *thread_remap_list[TX_THREAD_SMP_MAX_CORES];
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ULONG _tx_thread_smp_preemptable_threads_get(UINT priority, TX_THREAD *possible_preemption_list[])
|
ULONG _tx_thread_smp_preemptable_threads_get(UINT priority, TX_THREAD *possible_preemption_list[TX_THREAD_SMP_MAX_CORES])
|
||||||
{
|
{
|
||||||
|
|
||||||
UINT i, j, k;
|
UINT i, j, k;
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
/* FUNCTION RELEASE */
|
/* FUNCTION RELEASE */
|
||||||
/* */
|
/* */
|
||||||
/* _tx_thread_system_suspend PORTABLE SMP */
|
/* _tx_thread_system_suspend PORTABLE SMP */
|
||||||
/* 6.1.11 */
|
/* 6.x */
|
||||||
/* AUTHOR */
|
/* AUTHOR */
|
||||||
/* */
|
/* */
|
||||||
/* William E. Lamie, Microsoft Corporation */
|
/* William E. Lamie, Microsoft Corporation */
|
||||||
@@ -91,6 +91,8 @@
|
|||||||
/* 04-25-2022 Scott Larson Modified comments and fixed */
|
/* 04-25-2022 Scott Larson Modified comments and fixed */
|
||||||
/* loop to find next thread, */
|
/* loop to find next thread, */
|
||||||
/* resulting in version 6.1.11 */
|
/* resulting in version 6.1.11 */
|
||||||
|
/* xx-xx-xxxx Tiejun Zhou Fixed MISRA2012 rule 10.4_a, */
|
||||||
|
/* resulting in version 6.x */
|
||||||
/* */
|
/* */
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
VOID _tx_thread_system_suspend(TX_THREAD *thread_ptr)
|
VOID _tx_thread_system_suspend(TX_THREAD *thread_ptr)
|
||||||
@@ -671,7 +673,7 @@ UINT processing_complete;
|
|||||||
complex_path_possible = possible_cores & available_cores;
|
complex_path_possible = possible_cores & available_cores;
|
||||||
|
|
||||||
/* Check if we need to loop to find the next highest priority thread. */
|
/* Check if we need to loop to find the next highest priority thread. */
|
||||||
if (next_priority == TX_MAX_PRIORITIES)
|
if (next_priority == (ULONG)TX_MAX_PRIORITIES)
|
||||||
{
|
{
|
||||||
loop_finished = TX_TRUE;
|
loop_finished = TX_TRUE;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user