1
0
mirror of https://github.com/armink/CmBacktrace.git synced 2025-01-08 20:16:17 +08:00

Merge pull request #13 from lanxb/lanxb_debug

Lanxb add ucosiii and add iar6 support
This commit is contained in:
朱天龙 (Armink) 2018-04-08 22:03:38 +08:00 committed by GitHub
commit f7ca5df505
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 13 deletions

View File

@ -260,8 +260,10 @@ static void get_cur_thread_stack_info(uint32_t sp, uint32_t *start_addr, size_t
*start_addr = (uint32_t) OSTCBCur->OSTCBStkBottom;
*size = OSTCBCur->OSTCBStkSize * sizeof(OS_STK);
#elif (CMB_OS_PLATFORM_TYPE == CMB_OS_PLATFORM_UCOSIII)
#error "not implemented, I hope you can do this"
//TODO <20><>ʵ<EFBFBD><CAB5>
extern OS_TCB *OSTCBCurPtr;
*start_addr = (uint32_t) OSTCBCurPtr->StkBasePtr;
*size = OSTCBCurPtr->StkSize * sizeof(CPU_STK_SIZE);
#elif (CMB_OS_PLATFORM_TYPE == CMB_OS_PLATFORM_FREERTOS)
*start_addr = (uint32_t)vTaskStackAddr();
*size = vTaskStackSize() * sizeof( StackType_t );
@ -284,8 +286,9 @@ static const char *get_cur_thread_name(void) {
#endif /* OS_TASK_NAME_SIZE > 0 || OS_TASK_NAME_EN > 0 */
#elif (CMB_OS_PLATFORM_TYPE == CMB_OS_PLATFORM_UCOSIII)
#error "not implemented, I hope you can do this"
//TODO <20><>ʵ<EFBFBD><CAB5>
extern OS_TCB *OSTCBCurPtr;
return (const char *)OSTCBCurPtr->NamePtr;
#elif (CMB_OS_PLATFORM_TYPE == CMB_OS_PLATFORM_FREERTOS)
return vTaskName();
#endif

View File

@ -327,24 +327,25 @@ if (!(EXPR)) \
bx lr
}
#elif defined(__ICCARM__)
/* IAR iccarm specific functions */
/* Close Raw Asm Code Warning */
#pragma diag_suppress=Pe940
static uint32_t cmb_get_msp(void)
{
register uint32_t result;
__asm("MRS %0, msp" : "=r" (result));
return(result);
__asm("mrs r0, msp");
__asm("bx lr");
}
static uint32_t cmb_get_psp(void)
{
register uint32_t result;
__asm("MRS %0, psp" : "=r" (result));
return(result);
__asm("mrs r0, psp");
__asm("bx lr");
}
static uint32_t cmb_get_sp(void)
{
register uint32_t result;
__asm("MOV %0, sp" : "=r" (result));
return(result);
__asm("mov r0, sp");
__asm("bx lr");
}
#pragma diag_default=Pe940
#elif defined(__GNUC__)
__attribute__( ( always_inline ) ) static inline uint32_t cmb_get_msp(void) {
register uint32_t result;