📄 tx_adsp.c
字号:
{
VOID_PTR vpSlotVal=TX_NULL;
TX_THREAD_PTR tx_current_thread_ptr = tx_thread_identify();
if((inSlotNum > 0) && ( inSlotNum <= TX_ADSP_THREAD_SLOTS))
{
vpSlotVal = tx_current_thread_ptr->tx_thread_local_storage.tx_thread_slot[inSlotNum-1];
}
return(vpSlotVal);
}
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* SetThreadSlotValue__3VDKFiPv BLACKFIN561/VisualDSP */
/* 4.0 */
/* AUTHOR */
/* */
/* William E. Lamie, Express Logic, Inc. */
/* */
/* DESCRIPTION */
/* */
/* This function returns the 32-bit slot in Thread Local Storage. */
/* */
/* */
/* INPUT */
/* */
/* ioSlotNum pre-allocated slot # */
/* inValue Value to store in slot */
/* */
/* OUTPUT */
/* */
/* slot status TRUE/FALSE on slot set */
/* */
/* CALLS */
/* */
/* _tx_thread_identify Identify the current thread */
/* */
/* CALLED BY */
/* */
/* ADSP libraries */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 07-15-2004 Karl Homer Initial Version 4.0 */
/* */
/**************************************************************************/
BOOL SetThreadSlotValue__3VDKFiPv(INT inSlotNum, VOID_PTR inValue)
{
TX_THREAD_PTR tx_current_thread_ptr = tx_thread_identify();
BOOL bStatus=TX_FALSE;
if((inSlotNum > 0) && (inSlotNum <= TX_ADSP_THREAD_SLOTS))
{
tx_current_thread_ptr->tx_thread_local_storage.tx_thread_slot[inSlotNum-1] = inValue;
bStatus = TX_TRUE;
}
return(bStatus);
}
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* PushUnscheduledRegion__3VDKFv BLACKFIN561/VisualDSP */
/* 4.0 */
/* AUTHOR */
/* */
/* William E. Lamie, Express Logic, Inc. */
/* */
/* DESCRIPTION */
/* */
/* This function notifies Threadx that a critical/non-reentrant */
/* code section is about to be entered. */
/* */
/* */
/* INPUT */
/* */
/* */
/* OUTPUT */
/* */
/* */
/* CALLS */
/* */
/* tx_mutex_create Create the ADSP library */
/* mutex. */
/* tx_mutex_get Acquire the ADSP library */
/* mutex. */
/* */
/* CALLED BY */
/* */
/* ADSP libraries */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 07-15-2004 Karl Homer Initial Version 4.0 */
/* */
/**************************************************************************/
VOID PushUnscheduledRegion__3VDKFv(VOID)
{
UINT mutex_status;
if( tx_adsp_mutex.tx_mutex_id == TX_MUTEX_ID)
mutex_status = tx_mutex_get(&tx_adsp_mutex, TX_WAIT_FOREVER);
else
{
mutex_status = tx_mutex_create(&tx_adsp_mutex,"ADSP library mutex", TX_NO_INHERIT);
if(mutex_status == TX_SUCCESS)
mutex_status = tx_mutex_get(&tx_adsp_mutex, TX_WAIT_FOREVER);
}
}
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* PopUnscheduledRegion__3VDKFv BLACKFIN561/VisualDSP */
/* 4.0 */
/* AUTHOR */
/* */
/* William E. Lamie, Express Logic, Inc. */
/* */
/* DESCRIPTION */
/* */
/* This function notifies Threadx that a critical/non-reentrant */
/* code section is finished be entered. */
/* */
/* */
/* INPUT */
/* */
/* */
/* OUTPUT */
/* */
/* */
/* CALLS */
/* */
/* tx_mutex_put Release the ADSP library */
/* mutex. */
/* */
/* CALLED BY */
/* */
/* ADSP libraries */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 07-15-2004 Karl Homer Initial Version 4.0 */
/* */
/**************************************************************************/
VOID PopUnscheduledRegion__3VDKFv(VOID)
{
UINT mutex_status;
mutex_status = tx_mutex_put(&tx_adsp_mutex);
}
_END_EXTERN_C
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -