1 /*! *********************************************************************************
2  * Copyright 2020 NXP
3  * All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  ********************************************************************************** */
7 #if !defined(__FSL_OS_ABSTRACTION_THREADX_H__)
8 #define __FSL_OS_ABSTRACTION_THREADX_H__
9 
10 #include "tx_api.h"
11 #include "fsl_component_generic_list.h"
12 
13 /*!
14  * @addtogroup os_abstraction_thread
15  * @{
16  */
17 
18 /*******************************************************************************
19  * Declarations
20  ******************************************************************************/
21 /*! @brief OSA task handle size. */
22 #define OSA_TASK_HANDLE_SIZE (sizeof(TX_THREAD) + sizeof(list_element_t))
23 
24 /*! @brief OSA event handle size. */
25 #define OSA_EVENT_HANDLE_SIZE (sizeof(TX_EVENT_FLAGS_GROUP) + sizeof(uint8_t))
26 
27 /*! @brief OSA semaphore handle size. */
28 #define OSA_SEM_HANDLE_SIZE sizeof(TX_SEMAPHORE)
29 
30 /*! @brief OSA mutex handle size. */
31 #define OSA_MUTEX_HANDLE_SIZE sizeof(TX_MUTEX)
32 
33 /*!
34  * @brief To provide unified task priority for upper layer, OSA layer makes conversion.
35  */
36 #define PRIORITY_OSA_TO_THREAD(osa_prio)    ((UINT)TX_MAX_PRIORITIES - (osa_prio)-2U)
37 #define PRIORITY_THREAD_TO_OSA(thread_prio) ((UINT)TX_MAX_PRIORITIES - (thread_prio)-2U)
38 
39 #endif /* __FSL_OS_ABSTRACTION_THREADX_H__ */
40