mirror of
https://github.com/rvtr/ctr_firmware.git
synced 2025-10-31 07:51:08 -04:00
glに合わせてOSi_→i_os変更。
git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-09-30%20-%20paladin.7z/paladin/ctr_firmware@99 b871894f-2f95-9b40-918c-086798483c85
This commit is contained in:
parent
683d8a881a
commit
e781b2f723
@ -22,7 +22,7 @@
|
|||||||
extern OSIntrFunction osIntrTable[OS_INTR_ID_NUM];
|
extern OSIntrFunction osIntrTable[OS_INTR_ID_NUM];
|
||||||
|
|
||||||
//---- thread queue for interrupt
|
//---- thread queue for interrupt
|
||||||
OSThreadQueue OSi_IrqThreadQueue;
|
OSThreadQueue i_osIrqThreadQueue;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
Name: osIrqHandler
|
Name: osIrqHandler
|
||||||
@ -87,15 +87,15 @@ my_undefined_interrupt_1
|
|||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
asm void osIrqHandler_ThreadSwitch(void)
|
asm void osIrqHandler_ThreadSwitch(void)
|
||||||
{
|
{
|
||||||
INASM_EXTERN( OSi_IrqThreadQueue )
|
INASM_EXTERN( i_osIrqThreadQueue )
|
||||||
INASM_EXTERN( OSi_ThreadInfo )
|
INASM_EXTERN( i_osThreadInfo )
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// wakeup threads in OSi_IrqThreadQueue
|
// wakeup threads in i_osIrqThreadQueue
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
ldr r12, =OSi_IrqThreadQueue
|
ldr r12, =i_osIrqThreadQueue
|
||||||
mov r3, #0 // avoid stall
|
mov r3, #0 // avoid stall
|
||||||
ldr r12, [r12, #__cpp(offsetof(OSThreadQueue,head))] // r12 = OSi_IrqThreadQueue.head
|
ldr r12, [r12, #__cpp(offsetof(OSThreadQueue,head))] // r12 = i_osIrqThreadQueue.head
|
||||||
mov r2, #__cpp(OS_THREAD_STATE_READY) // avoid stall
|
mov r2, #__cpp(OS_THREAD_STATE_READY) // avoid stall
|
||||||
cmp r12, #0
|
cmp r12, #0
|
||||||
|
|
||||||
@ -111,11 +111,11 @@ LSYM(1) str r2, [r12, #__cpp(offsetof(OSThread,state))]
|
|||||||
cmp r12, #0
|
cmp r12, #0
|
||||||
bne BSYM(1)
|
bne BSYM(1)
|
||||||
|
|
||||||
ldr r12, =OSi_IrqThreadQueue
|
ldr r12, =i_osIrqThreadQueue
|
||||||
str r3, [r12, #__cpp(offsetof(OSThreadQueue,head))] // clear OSi_IrqThreadQueue.head
|
str r3, [r12, #__cpp(offsetof(OSThreadQueue,head))] // clear i_osIrqThreadQueue.head
|
||||||
str r3, [r12, #__cpp(offsetof(OSThreadQueue,tail))] // clear OSi_IrqThreadQueue.tail
|
str r3, [r12, #__cpp(offsetof(OSThreadQueue,tail))] // clear i_osIrqThreadQueue.tail
|
||||||
|
|
||||||
ldr r12, =OSi_ThreadInfo // need to do scheduling
|
ldr r12, =i_osThreadInfo // need to do scheduling
|
||||||
mov r1, #1
|
mov r1, #1
|
||||||
strh r1, [ r12, #OS_THREADINFO_OFFSET_ISNEEDRESCHEDULING ]
|
strh r1, [ r12, #OS_THREADINFO_OFFSET_ISNEEDRESCHEDULING ]
|
||||||
|
|
||||||
@ -130,7 +130,7 @@ thread_switch
|
|||||||
// isNeedRescheduling = FALSE;
|
// isNeedRescheduling = FALSE;
|
||||||
//
|
//
|
||||||
// // OS_SelectThread
|
// // OS_SelectThread
|
||||||
// OSThread* t = OSi_ThreadInfo.list;
|
// OSThread* t = i_osThreadInfo.list;
|
||||||
// while( t && ! OS_IsThreadRunnable( t ) ){ t = t->next; }
|
// while( t && ! OS_IsThreadRunnable( t ) ){ t = t->next; }
|
||||||
// return t;
|
// return t;
|
||||||
//
|
//
|
||||||
@ -143,10 +143,10 @@ thread_switch
|
|||||||
//
|
//
|
||||||
|
|
||||||
// [[[ new OS_SelectThread ]]]
|
// [[[ new OS_SelectThread ]]]
|
||||||
ldr r12, =OSi_ThreadInfo
|
ldr r12, =i_osThreadInfo
|
||||||
ldrh r1, [ r12, #OS_THREADINFO_OFFSET_ISNEEDRESCHEDULING ]
|
ldrh r1, [ r12, #OS_THREADINFO_OFFSET_ISNEEDRESCHEDULING ]
|
||||||
cmp r1, #0
|
cmp r1, #0
|
||||||
beq _dont_switched_ // return if OSi_IsNeedResceduling == 0
|
beq _dont_switched_ // return if i_osIsNeedResceduling == 0
|
||||||
|
|
||||||
mov r1, #0
|
mov r1, #0
|
||||||
strh r1, [ r12, #OS_THREADINFO_OFFSET_ISNEEDRESCHEDULING ]
|
strh r1, [ r12, #OS_THREADINFO_OFFSET_ISNEEDRESCHEDULING ]
|
||||||
@ -155,7 +155,7 @@ thread_switch
|
|||||||
mov r3, #HW_PSR_IRQ_MODE|HW_PSR_FIQ_DISABLE|HW_PSR_IRQ_DISABLE|HW_PSR_ARM_STATE
|
mov r3, #HW_PSR_IRQ_MODE|HW_PSR_FIQ_DISABLE|HW_PSR_IRQ_DISABLE|HW_PSR_ARM_STATE
|
||||||
msr cpsr_c, r3
|
msr cpsr_c, r3
|
||||||
|
|
||||||
add r2, r12, #OS_THREADINFO_OFFSET_LIST // r2 = &OSi_ThreadInfo.list
|
add r2, r12, #OS_THREADINFO_OFFSET_LIST // r2 = &i_osThreadInfo.list
|
||||||
ldr r1, [r2] // r1 = *r2 = TopOfList
|
ldr r1, [r2] // r1 = *r2 = TopOfList
|
||||||
LSYM(11)
|
LSYM(11)
|
||||||
cmp r1, #0
|
cmp r1, #0
|
||||||
|
|||||||
@ -24,7 +24,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
//---- thread queue for interrupt
|
//---- thread queue for interrupt
|
||||||
OSThreadQueue OSi_IrqThreadQueue;
|
OSThreadQueue i_osIrqThreadQueue;
|
||||||
|
|
||||||
#ifdef SDK_ARM9
|
#ifdef SDK_ARM9
|
||||||
#include <brom/dtcm_end.h>
|
#include <brom/dtcm_end.h>
|
||||||
@ -110,15 +110,15 @@ irq_return
|
|||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
asm void osIrqHandler_ThreadSwitch(void)
|
asm void osIrqHandler_ThreadSwitch(void)
|
||||||
{
|
{
|
||||||
INASM_EXTERN( OSi_IrqThreadQueue )
|
INASM_EXTERN( i_osIrqThreadQueue )
|
||||||
INASM_EXTERN( OSi_ThreadInfo )
|
INASM_EXTERN( i_osThreadInfo )
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// wakeup threads in OSi_IrqThreadQueue
|
// wakeup threads in i_osIrqThreadQueue
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
ldr r12, =OSi_IrqThreadQueue
|
ldr r12, =i_osIrqThreadQueue
|
||||||
mov r3, #0 // avoid stall
|
mov r3, #0 // avoid stall
|
||||||
ldr r12, [r12, #__cpp(offsetof(OSThreadQueue,head))] // r12 = OSi_IrqThreadQueue.head
|
ldr r12, [r12, #__cpp(offsetof(OSThreadQueue,head))] // r12 = i_osIrqThreadQueue.head
|
||||||
mov r2, #__cpp(OS_THREAD_STATE_READY) // avoid stall
|
mov r2, #__cpp(OS_THREAD_STATE_READY) // avoid stall
|
||||||
cmp r12, #0
|
cmp r12, #0
|
||||||
|
|
||||||
@ -134,11 +134,11 @@ LSYM(1) str r2, [r12, #__cpp(offsetof(OSThread,state))]
|
|||||||
cmp r12, #0
|
cmp r12, #0
|
||||||
bne BSYM(1)
|
bne BSYM(1)
|
||||||
|
|
||||||
ldr r12, =OSi_IrqThreadQueue
|
ldr r12, =i_osIrqThreadQueue
|
||||||
str r3, [r12, #__cpp(offsetof(OSThreadQueue,head))] // clear OSi_IrqThreadQueue.head
|
str r3, [r12, #__cpp(offsetof(OSThreadQueue,head))] // clear i_osIrqThreadQueue.head
|
||||||
str r3, [r12, #__cpp(offsetof(OSThreadQueue,tail))] // clear OSi_IrqThreadQueue.tail
|
str r3, [r12, #__cpp(offsetof(OSThreadQueue,tail))] // clear i_osIrqThreadQueue.tail
|
||||||
|
|
||||||
ldr r12, =OSi_ThreadInfo // need to do scheduling
|
ldr r12, =i_osThreadInfo // need to do scheduling
|
||||||
mov r1, #1
|
mov r1, #1
|
||||||
strh r1, [ r12, #OS_THREADINFO_OFFSET_ISNEEDRESCHEDULING ]
|
strh r1, [ r12, #OS_THREADINFO_OFFSET_ISNEEDRESCHEDULING ]
|
||||||
|
|
||||||
@ -153,7 +153,7 @@ thread_switch
|
|||||||
// isNeedRescheduling = FALSE;
|
// isNeedRescheduling = FALSE;
|
||||||
//
|
//
|
||||||
// // OS_SelectThread
|
// // OS_SelectThread
|
||||||
// OSThread* t = OSi_ThreadInfo.list;
|
// OSThread* t = i_osThreadInfo.list;
|
||||||
// while( t && ! OS_IsThreadRunnable( t ) ){ t = t->next; }
|
// while( t && ! OS_IsThreadRunnable( t ) ){ t = t->next; }
|
||||||
// return t;
|
// return t;
|
||||||
//
|
//
|
||||||
@ -166,10 +166,10 @@ thread_switch
|
|||||||
//
|
//
|
||||||
|
|
||||||
// [[[ new OS_SelectThread ]]]
|
// [[[ new OS_SelectThread ]]]
|
||||||
ldr r12, =OSi_ThreadInfo
|
ldr r12, =i_osThreadInfo
|
||||||
ldrh r1, [ r12, #OS_THREADINFO_OFFSET_ISNEEDRESCHEDULING ]
|
ldrh r1, [ r12, #OS_THREADINFO_OFFSET_ISNEEDRESCHEDULING ]
|
||||||
cmp r1, #0
|
cmp r1, #0
|
||||||
beq _dont_switched_ // return if OSi_IsNeedResceduling == 0
|
beq _dont_switched_ // return if i_osIsNeedResceduling == 0
|
||||||
|
|
||||||
mov r1, #0
|
mov r1, #0
|
||||||
strh r1, [ r12, #OS_THREADINFO_OFFSET_ISNEEDRESCHEDULING ]
|
strh r1, [ r12, #OS_THREADINFO_OFFSET_ISNEEDRESCHEDULING ]
|
||||||
@ -178,7 +178,7 @@ thread_switch
|
|||||||
mov r3, #HW_PSR_IRQ_MODE|HW_PSR_FIQ_DISABLE|HW_PSR_IRQ_DISABLE|HW_PSR_ARM_STATE
|
mov r3, #HW_PSR_IRQ_MODE|HW_PSR_FIQ_DISABLE|HW_PSR_IRQ_DISABLE|HW_PSR_ARM_STATE
|
||||||
msr cpsr_c, r3
|
msr cpsr_c, r3
|
||||||
|
|
||||||
add r2, r12, #OS_THREADINFO_OFFSET_LIST // r2 = &OSi_ThreadInfo.list
|
add r2, r12, #OS_THREADINFO_OFFSET_LIST // r2 = &i_osThreadInfo.list
|
||||||
ldr r1, [r2] // r1 = *r2 = TopOfList
|
ldr r1, [r2] // r1 = *r2 = TopOfList
|
||||||
LSYM(11)
|
LSYM(11)
|
||||||
cmp r1, #0
|
cmp r1, #0
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -57,38 +57,38 @@ struct OSMutex
|
|||||||
//#pragma warn_padding reset
|
//#pragma warn_padding reset
|
||||||
|
|
||||||
|
|
||||||
static inline void OS_SetMutexCount( OSMutex* mutex, s32 count )
|
static inline void osSetMutexCount( OSMutex* mutex, s32 count )
|
||||||
{
|
{
|
||||||
mutex->count = (s32)( (mutex->count & OSi_MUTEX_TYPE_MASK) | (count & OSi_MUTEX_COUNT_MASK) );
|
mutex->count = (s32)( (mutex->count & OSi_MUTEX_TYPE_MASK) | (count & OSi_MUTEX_COUNT_MASK) );
|
||||||
}
|
}
|
||||||
static inline s32 OS_GetMutexCount( OSMutex* mutex )
|
static inline s32 osGetMutexCount( OSMutex* mutex )
|
||||||
{
|
{
|
||||||
return (s32)( mutex->count & OSi_MUTEX_COUNT_MASK);
|
return (s32)( mutex->count & OSi_MUTEX_COUNT_MASK);
|
||||||
}
|
}
|
||||||
static inline void OS_IncreaseMutexCount( OSMutex* mutex )
|
static inline void osIncreaseMutexCount( OSMutex* mutex )
|
||||||
{
|
{
|
||||||
u32 type = (u32)(mutex->count & OSi_MUTEX_TYPE_MASK);
|
u32 type = (u32)(mutex->count & OSi_MUTEX_TYPE_MASK);
|
||||||
mutex->count ++;
|
mutex->count ++;
|
||||||
mutex->count = (s32)( type | (mutex->count & OSi_MUTEX_COUNT_MASK) );
|
mutex->count = (s32)( type | (mutex->count & OSi_MUTEX_COUNT_MASK) );
|
||||||
}
|
}
|
||||||
static inline void OS_DecreaseMutexCount( OSMutex* mutex )
|
static inline void osDecreaseMutexCount( OSMutex* mutex )
|
||||||
{
|
{
|
||||||
u32 type = (u32)(mutex->count & OSi_MUTEX_TYPE_MASK);
|
u32 type = (u32)(mutex->count & OSi_MUTEX_TYPE_MASK);
|
||||||
mutex->count --;
|
mutex->count --;
|
||||||
mutex->count = (s32)( type | (mutex->count & OSi_MUTEX_COUNT_MASK) );
|
mutex->count = (s32)( type | (mutex->count & OSi_MUTEX_COUNT_MASK) );
|
||||||
}
|
}
|
||||||
static inline void OS_SetMutexType( OSMutex* mutex, u32 type )
|
static inline void osSetMutexType( OSMutex* mutex, u32 type )
|
||||||
{
|
{
|
||||||
mutex->count = (s32)( type | (mutex->count & OSi_MUTEX_COUNT_MASK) );
|
mutex->count = (s32)( type | (mutex->count & OSi_MUTEX_COUNT_MASK) );
|
||||||
}
|
}
|
||||||
static inline u32 OS_GetMutexType( OSMutex* mutex )
|
static inline u32 osGetMutexType( OSMutex* mutex )
|
||||||
{
|
{
|
||||||
return (u32)( mutex->count & OSi_MUTEX_TYPE_MASK );
|
return (u32)( mutex->count & OSi_MUTEX_TYPE_MASK );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
Name: OS_InitMutex
|
Name: osInitMutex
|
||||||
|
|
||||||
Description: initialize mutex
|
Description: initialize mutex
|
||||||
|
|
||||||
@ -97,10 +97,10 @@ static inline u32 OS_GetMutexType( OSMutex* mutex )
|
|||||||
|
|
||||||
Returns: None
|
Returns: None
|
||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
void OS_InitMutex(OSMutex *mutex);
|
void osInitMutex(OSMutex *mutex);
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
Name: OS_LockMutex
|
Name: osLockMutex
|
||||||
|
|
||||||
Description: lock mutex
|
Description: lock mutex
|
||||||
|
|
||||||
@ -108,10 +108,10 @@ void OS_InitMutex(OSMutex *mutex);
|
|||||||
|
|
||||||
Returns: None
|
Returns: None
|
||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
void OS_LockMutex(OSMutex *mutex);
|
void osLockMutex(OSMutex *mutex);
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
Name: OS_UnlockMutex
|
Name: osUnlockMutex
|
||||||
|
|
||||||
Description: unlock mutex
|
Description: unlock mutex
|
||||||
|
|
||||||
@ -119,10 +119,10 @@ void OS_LockMutex(OSMutex *mutex);
|
|||||||
|
|
||||||
Returns: None
|
Returns: None
|
||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
void OS_UnlockMutex(OSMutex *mutex);
|
void osUnlockMutex(OSMutex *mutex);
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
Name: OS_TryLockMutex
|
Name: osTryLockMutex
|
||||||
|
|
||||||
Description: try to lock mutex
|
Description: try to lock mutex
|
||||||
|
|
||||||
@ -130,10 +130,10 @@ void OS_UnlockMutex(OSMutex *mutex);
|
|||||||
|
|
||||||
Returns: True if lock
|
Returns: True if lock
|
||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
BOOL OS_TryLockMutex(OSMutex *mutex);
|
BOOL osTryLockMutex(OSMutex *mutex);
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
Name: OSi_UnlockAllMutex
|
Name: i_osUnlockAllMutex
|
||||||
|
|
||||||
Description: unlocks all the mutexes locked by the thread
|
Description: unlocks all the mutexes locked by the thread
|
||||||
|
|
||||||
@ -141,11 +141,11 @@ BOOL OS_TryLockMutex(OSMutex *mutex);
|
|||||||
|
|
||||||
Returns: None.
|
Returns: None.
|
||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
void OSi_UnlockAllMutex(OSThread *thread);
|
void i_osUnlockAllMutex(OSThread *thread);
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
Name: OS_LockMutexR
|
Name: osLockMutexR
|
||||||
|
|
||||||
Description: lock RW mutex as READ access
|
Description: lock RW mutex as READ access
|
||||||
|
|
||||||
@ -153,10 +153,10 @@ void OSi_UnlockAllMutex(OSThread *thread);
|
|||||||
|
|
||||||
Returns: None
|
Returns: None
|
||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
void OS_LockMutexR(OSMutex *mutex);
|
void osLockMutexR(OSMutex *mutex);
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
Name: OS_LockMutexW
|
Name: osLockMutexW
|
||||||
|
|
||||||
Description: lock RW mutex as WRITE access
|
Description: lock RW mutex as WRITE access
|
||||||
|
|
||||||
@ -164,10 +164,10 @@ void OS_LockMutexR(OSMutex *mutex);
|
|||||||
|
|
||||||
Returns: None
|
Returns: None
|
||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
void OS_LockMutexW(OSMutex *mutex);
|
void osLockMutexW(OSMutex *mutex);
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
Name: OS_TryLockMutexR
|
Name: osTryLockMutexR
|
||||||
|
|
||||||
Description: try to lock RW mutex as READ access
|
Description: try to lock RW mutex as READ access
|
||||||
|
|
||||||
@ -175,10 +175,10 @@ void OS_LockMutexW(OSMutex *mutex);
|
|||||||
|
|
||||||
Returns: TRUE if locked
|
Returns: TRUE if locked
|
||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
BOOL OS_TryLockMutexR(OSMutex *mutex);
|
BOOL osTryLockMutexR(OSMutex *mutex);
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
Name: OS_TryLockMutexW
|
Name: osTryLockMutexW
|
||||||
|
|
||||||
Description: try to lock RW mutex as WRITE access
|
Description: try to lock RW mutex as WRITE access
|
||||||
|
|
||||||
@ -186,10 +186,10 @@ BOOL OS_TryLockMutexR(OSMutex *mutex);
|
|||||||
|
|
||||||
Returns: TRUE if locked
|
Returns: TRUE if locked
|
||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
BOOL OS_TryLockMutexW(OSMutex *mutex);
|
BOOL osTryLockMutexW(OSMutex *mutex);
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
Name: OS_UnlockMutexR
|
Name: osUnlockMutexR
|
||||||
|
|
||||||
Description: unlock mutex locked as READ access
|
Description: unlock mutex locked as READ access
|
||||||
|
|
||||||
@ -197,10 +197,10 @@ BOOL OS_TryLockMutexW(OSMutex *mutex);
|
|||||||
|
|
||||||
Returns: None
|
Returns: None
|
||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
void OS_UnlockMutexR(OSMutex *mutex);
|
void osUnlockMutexR(OSMutex *mutex);
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
Name: OS_UnlockMutexW
|
Name: osUnlockMutexW
|
||||||
|
|
||||||
Description: unlock mutex locked as WRITE access
|
Description: unlock mutex locked as WRITE access
|
||||||
|
|
||||||
@ -208,10 +208,10 @@ void OS_UnlockMutexR(OSMutex *mutex);
|
|||||||
|
|
||||||
Returns: None
|
Returns: None
|
||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
void OS_UnlockMutexW(OSMutex *mutex);
|
void osUnlockMutexW(OSMutex *mutex);
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
Name: OS_UnlockMutexRW
|
Name: osUnlockMutexRW
|
||||||
|
|
||||||
Description: unlock mutex locked as READ/WRITE access
|
Description: unlock mutex locked as READ/WRITE access
|
||||||
|
|
||||||
@ -219,10 +219,10 @@ void OS_UnlockMutexW(OSMutex *mutex);
|
|||||||
|
|
||||||
Returns: None
|
Returns: None
|
||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
void OS_UnlockMutexRW(OSMutex *mutex);
|
void osUnlockMutexRW(OSMutex *mutex);
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
Name: OS_LockMutexFromRToW
|
Name: osLockMutexFromRToW
|
||||||
|
|
||||||
Description: Promote mutexR lock to mutexW lock without unlock.
|
Description: Promote mutexR lock to mutexW lock without unlock.
|
||||||
Wait till success.
|
Wait till success.
|
||||||
@ -231,10 +231,10 @@ void OS_UnlockMutexRW(OSMutex *mutex);
|
|||||||
|
|
||||||
Returns: None
|
Returns: None
|
||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
void OS_LockMutexFromRToW(OSMutex *mutex);
|
void osLockMutexFromRToW(OSMutex *mutex);
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
Name: OS_TryLockMutexFromRToW
|
Name: osTryLockMutexFromRToW
|
||||||
|
|
||||||
Description: Try to promote mutexR lock to mutexW lock without unlock.
|
Description: Try to promote mutexR lock to mutexW lock without unlock.
|
||||||
|
|
||||||
@ -242,10 +242,10 @@ void OS_LockMutexFromRToW(OSMutex *mutex);
|
|||||||
|
|
||||||
Returns: TRUE if success
|
Returns: TRUE if success
|
||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
BOOL OS_TryLockMutexFromRToW(OSMutex *mutex);
|
BOOL osTryLockMutexFromRToW(OSMutex *mutex);
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
Name: OS_LockMutexFromWToR
|
Name: osLockMutexFromWToR
|
||||||
|
|
||||||
Description: Demote mutexW lock to mutexR lock without unlock.
|
Description: Demote mutexW lock to mutexR lock without unlock.
|
||||||
Wait till success.
|
Wait till success.
|
||||||
@ -254,10 +254,10 @@ BOOL OS_TryLockMutexFromRToW(OSMutex *mutex);
|
|||||||
|
|
||||||
Returns: None
|
Returns: None
|
||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
void OS_LockMutexFromWToR(OSMutex *mutex);
|
void osLockMutexFromWToR(OSMutex *mutex);
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
Name: OS_TryLockMutexFromWToR
|
Name: osTryLockMutexFromWToR
|
||||||
|
|
||||||
Description: Try to demote mutexW lock to mutexR lock without unlock.
|
Description: Try to demote mutexW lock to mutexR lock without unlock.
|
||||||
|
|
||||||
@ -265,7 +265,7 @@ void OS_LockMutexFromWToR(OSMutex *mutex);
|
|||||||
|
|
||||||
Returns: TRUE if success
|
Returns: TRUE if success
|
||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
BOOL OS_TryLockMutexFromWToR(OSMutex *mutex);
|
BOOL osTryLockMutexFromWToR(OSMutex *mutex);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* extern "C" */
|
} /* extern "C" */
|
||||||
|
|||||||
@ -224,11 +224,11 @@ typedef struct OSThreadResource
|
|||||||
OSThreadResource;
|
OSThreadResource;
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
//---- private function ( don't use these OSi_* function )
|
//---- private function ( don't use these i_os* function )
|
||||||
void OSi_CheckStack(const char *file, int line, const OSThread *thread);
|
void i_osCheckStack(const char *file, int line, const OSThread *thread);
|
||||||
u32 OSi_GetSystemStackPointer(void);
|
u32 i_osGetSystemStackPointer(void);
|
||||||
u32 OSi_GetCurrentStackPointer(void);
|
u32 i_osGetCurrentStackPointer(void);
|
||||||
OSThread *OSi_GetIdleThread(void);
|
OSThread *i_osGetIdleThread(void);
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
Name: osInitThread
|
Name: osInitThread
|
||||||
@ -440,11 +440,11 @@ int osGetNumberOfThread(void);
|
|||||||
|
|
||||||
Returns: pointer of thread info structure
|
Returns: pointer of thread info structure
|
||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
extern OSThreadInfo OSi_ThreadInfo;
|
extern OSThreadInfo i_osThreadInfo;
|
||||||
|
|
||||||
static inline OSThreadInfo *osGetThreadInfo(void)
|
static inline OSThreadInfo *osGetThreadInfo(void)
|
||||||
{
|
{
|
||||||
return &OSi_ThreadInfo;
|
return &i_osThreadInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
@ -630,7 +630,7 @@ OSStackStatus osGetStackStatus(const OSThread *thread);
|
|||||||
( if error occurred, never return )
|
( if error occurred, never return )
|
||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
#if !defined(SDK_FINALROM) && !defined(SDK_NO_MESSAGE)
|
#if !defined(SDK_FINALROM) && !defined(SDK_NO_MESSAGE)
|
||||||
#define osCheckStack( thread ) OSi_CheckStack( __FILE__, __LINE__, (const OSThread*)thread );
|
#define osCheckStack( thread ) i_osCheckStack( __FILE__, __LINE__, (const OSThread*)thread );
|
||||||
#else
|
#else
|
||||||
#define osCheckStack( thread ) ((void)0)
|
#define osCheckStack( thread ) ((void)0)
|
||||||
#endif
|
#endif
|
||||||
@ -811,7 +811,7 @@ void osSetThreadDestructorStack(void *stack);
|
|||||||
// The following functions are for internal use. Not for user.
|
// The following functions are for internal use. Not for user.
|
||||||
//================================================================================
|
//================================================================================
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
Name: OSi_RemoveMutexLinkFromQueue
|
Name: i_osRemoveMutexLinkFromQueue
|
||||||
|
|
||||||
Description: remove mutex from mutex queue
|
Description: remove mutex from mutex queue
|
||||||
|
|
||||||
@ -819,10 +819,10 @@ void osSetThreadDestructorStack(void *stack);
|
|||||||
|
|
||||||
Returns: mutex pointer which is removed
|
Returns: mutex pointer which is removed
|
||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
extern OSMutex *OSi_RemoveMutexLinkFromQueue(OSMutexQueue * queue);
|
extern OSMutex *i_osRemoveMutexLinkFromQueue(OSMutexQueue * queue);
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
Name: OSi_SetSystemErrno
|
Name: i_osSetSystemErrno
|
||||||
|
|
||||||
Description: set system error number.
|
Description: set system error number.
|
||||||
|
|
||||||
@ -831,10 +831,10 @@ extern OSMutex *OSi_RemoveMutexLinkFromQueue(OSMutexQueue * queue);
|
|||||||
|
|
||||||
Returns: None
|
Returns: None
|
||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
void OSi_SetSystemErrno(OSThread *thread, int errno);
|
void i_osSetSystemErrno(OSThread *thread, int errno);
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
Name: OSi_GetSystemErrno
|
Name: i_osGetSystemErrno
|
||||||
|
|
||||||
Description: get system error number.
|
Description: get system error number.
|
||||||
|
|
||||||
@ -842,13 +842,13 @@ void OSi_SetSystemErrno(OSThread *thread, int errno);
|
|||||||
|
|
||||||
Returns: error number
|
Returns: error number
|
||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
int OSi_GetSystemErrno(const OSThread *thread);
|
int i_osGetSystemErrno(const OSThread *thread);
|
||||||
|
|
||||||
|
|
||||||
#define OSi_SPECIFIC_CPS 0
|
#define OSi_SPECIFIC_CPS 0
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
Name: OSi_SetSpecificData
|
Name: i_osSetSpecificData
|
||||||
|
|
||||||
Description: set system specific data
|
Description: set system specific data
|
||||||
|
|
||||||
@ -858,14 +858,14 @@ int OSi_GetSystemErrno(const OSThread *thread);
|
|||||||
|
|
||||||
Returns: None
|
Returns: None
|
||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
static inline void OSi_SetSpecificData(OSThread *thread, int index, void *data)
|
static inline void i_osSetSpecificData(OSThread *thread, int index, void *data)
|
||||||
{
|
{
|
||||||
SDK_ASSERT(thread && 0 <= index && index < OS_THREAD_SPECIFIC_MAX);
|
SDK_ASSERT(thread && 0 <= index && index < OS_THREAD_SPECIFIC_MAX);
|
||||||
thread->specific[index] = data;
|
thread->specific[index] = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
Name: OSi_GetSpecificData
|
Name: i_osGetSpecificData
|
||||||
|
|
||||||
Description: get system specific data
|
Description: get system specific data
|
||||||
|
|
||||||
@ -874,7 +874,7 @@ static inline void OSi_SetSpecificData(OSThread *thread, int index, void *data)
|
|||||||
|
|
||||||
Returns: error number
|
Returns: error number
|
||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
static inline void *OSi_GetSpecificData(const OSThread *thread, int index)
|
static inline void *i_osGetSpecificData(const OSThread *thread, int index)
|
||||||
{
|
{
|
||||||
SDK_ASSERT(thread && 0 <= index && index < OS_THREAD_SPECIFIC_MAX);
|
SDK_ASSERT(thread && 0 <= index && index < OS_THREAD_SPECIFIC_MAX);
|
||||||
return thread->specific[index];
|
return thread->specific[index];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user