diff options
| author | Meco Man <[email protected]> | 2021-03-27 17:51:56 +0800 |
|---|---|---|
| committer | Meco Man <[email protected]> | 2021-03-27 17:51:56 +0800 |
| commit | 6c907c3a477b1f34ca1adb277748c3306110cabf (patch) | |
| tree | 634037b92c323465d8151778d0a3eb1b04df2271 /libcpu/sim | |
| parent | 1ba020f3c89fbf2ac2a5b58424852e501fd59a91 (diff) | |
[libcpu] auto formatted
Diffstat (limited to 'libcpu/sim')
| -rw-r--r-- | libcpu/sim/posix/cpu_port.c | 4 | ||||
| -rw-r--r-- | libcpu/sim/win32/cpu_port.c | 50 |
2 files changed, 27 insertions, 27 deletions
diff --git a/libcpu/sim/posix/cpu_port.c b/libcpu/sim/posix/cpu_port.c index eb1ae4865c..dc3e9379dd 100644 --- a/libcpu/sim/posix/cpu_port.c +++ b/libcpu/sim/posix/cpu_port.c @@ -173,8 +173,8 @@ static void *thread_run(void *parameter) /*TODO: * 最后一行的pthread_exit永远没有机会执行,这是因为在threead->exit函数中 * 会发生线程切换,并永久将此pthread线程挂起,所以更完美的解决方案是在这 - * 里发送信号给主线程,主线程中再次唤醒此线程令其自动退出。 - */ + * 里发送信号给主线程,主线程中再次唤醒此线程令其自动退出。 + */ //sem_destroy(&thread->sem); pthread_exit(NULL); diff --git a/libcpu/sim/win32/cpu_port.c b/libcpu/sim/win32/cpu_port.c index cc8ad9a25c..621420e7bf 100644 --- a/libcpu/sim/win32/cpu_port.c +++ b/libcpu/sim/win32/cpu_port.c @@ -5,7 +5,7 @@ * Version : V1.00.00 * * By : prife -* Version : V1.00.01 +* Version : V1.00.01 ************************************************************************************************************************ */ @@ -47,10 +47,10 @@ const DWORD MS_VC_EXCEPTION=0x406D1388; #pragma pack(push,8) typedef struct tagTHREADNAME_INFO { - DWORD dwType; // Must be 0x1000. - LPCSTR szName; // Pointer to name (in user addr space). - DWORD dwThreadID; // Thread ID (-1=caller thread). - DWORD dwFlags; // Reserved for future use, must be zero. + DWORD dwType; // Must be 0x1000. + LPCSTR szName; // Pointer to name (in user addr space). + DWORD dwThreadID; // Thread ID (-1=caller thread). + DWORD dwFlags; // Reserved for future use, must be zero. } THREADNAME_INFO; #pragma pack(pop) @@ -115,19 +115,19 @@ static DWORD WINAPI ThreadforKeyGet(LPVOID lpParam); static void SetThreadName(DWORD dwThreadID, char* threadName) { #if defined(_MSC_VER) - THREADNAME_INFO info; - info.dwType = 0x1000; - info.szName = threadName; - info.dwThreadID = dwThreadID; - info.dwFlags = 0; + THREADNAME_INFO info; + info.dwType = 0x1000; + info.szName = threadName; + info.dwThreadID = dwThreadID; + info.dwFlags = 0; - __try - { - RaiseException( MS_VC_EXCEPTION, 0, sizeof(info)/sizeof(ULONG_PTR), (ULONG_PTR*)&info ); - } - __except(EXCEPTION_EXECUTE_HANDLER) - { - } + __try + { + RaiseException( MS_VC_EXCEPTION, 0, sizeof(info)/sizeof(ULONG_PTR), (ULONG_PTR*)&info ); + } + __except(EXCEPTION_EXECUTE_HANDLER) + { + } #endif } @@ -144,15 +144,15 @@ static void SetThreadName(DWORD dwThreadID, char* threadName) static DWORD WINAPI thread_run( LPVOID lpThreadParameter ) { - rt_thread_t tid = rt_thread_self(); - win_thread_t *pWinThread = (win_thread_t *)lpThreadParameter; + rt_thread_t tid = rt_thread_self(); + win_thread_t *pWinThread = (win_thread_t *)lpThreadParameter; - SetThreadName(GetCurrentThreadId(), tid->name); + SetThreadName(GetCurrentThreadId(), tid->name); - pWinThread->Entry(pWinThread->Param); + pWinThread->Entry(pWinThread->Param); - pWinThread->Exit(); - return 0; + pWinThread->Exit(); + return 0; } rt_uint8_t* rt_hw_stack_init(void *pEntry,void *pParam,rt_uint8_t *pStackAddr,void *pExit) @@ -261,7 +261,7 @@ void rt_hw_context_switch_interrupt(rt_uint32_t from, rt_interrupt_to_thread = *((rt_uint32_t *)(to)); - //trigger YIELD exception(cause context switch) + //trigger YIELD exception(cause context switch) TriggerSimulateInterrupt(CPU_INTERRUPT_YIELD); } /*** rt_hw_context_switch_interrupt ***/ @@ -312,7 +312,7 @@ void rt_hw_context_switch(rt_uint32_t from, */ void rt_hw_context_switch_to(rt_uint32_t to) { - //set to thread + //set to thread rt_interrupt_to_thread = *((rt_uint32_t *)(to)); //clear from thread |
