You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to port LiteOS for MIPS ( Microchip PIC32 )
can you explain in detail the function LOS_StartToRun()
or publish something like a C equivalent
IDA Pro deassembler give this code (approximately)
can you explain it in detail (???)
int LOS_StartToRun() {
int (* func)(int, int, int, int); // ????
OS_NVIC_SYSPRI2 = OS_NVIC_PENDSV_PRI; // ARM
g_bTaskScheduled = 1; // enable task schedule
__asm{ MSR.W CONTROL, #2 } // current stack pointer
g_stLosTask.pstRunTask = g_stLosTask.pstNewTask;
LOS_TASK_CB * V = g_stLosTask.pstNewTask;
g_stLosTask.pstNewTask->usTaskStatus |= OS_TASK_STATUS_RUNNING;
int * R = (int *) ((char ) V->pStackPointer + 100); // ???
int v7 = R[0];
int v8 = R[1];
int v9 = R[2];
int v10 = R[3];
func = (int () (int, int, int, int))R[6]; // ???
R += 26; // ???
__asm{ MSR.W PSP, R } // ARM Process Stack Pointer
__enable_irq(); // global
return func(v7, v8, v9, v10); // ???
}
The text was updated successfully, but these errors were encountered:
I'm trying to port LiteOS for MIPS ( Microchip PIC32 )
can you explain in detail the function LOS_StartToRun()
or publish something like a C equivalent
IDA Pro deassembler give this code (approximately)
can you explain it in detail (???)
int LOS_StartToRun() {
int (* func)(int, int, int, int); // ????
OS_NVIC_SYSPRI2 = OS_NVIC_PENDSV_PRI; // ARM
g_bTaskScheduled = 1; // enable task schedule
__asm{ MSR.W CONTROL, #2 } // current stack pointer
g_stLosTask.pstRunTask = g_stLosTask.pstNewTask;
LOS_TASK_CB * V = g_stLosTask.pstNewTask;
g_stLosTask.pstNewTask->usTaskStatus |= OS_TASK_STATUS_RUNNING;
int * R = (int *) ((char ) V->pStackPointer + 100); // ???
int v7 = R[0];
int v8 = R[1];
int v9 = R[2];
int v10 = R[3];
func = (int () (int, int, int, int))R[6]; // ???
R += 26; // ???
__asm{ MSR.W PSP, R } // ARM Process Stack Pointer
__enable_irq(); // global
return func(v7, v8, v9, v10); // ???
}
The text was updated successfully, but these errors were encountered: