39 { 0xc07,
"Cortex-A7" },
40 { 0xc09,
"Cortex-A9" },
46 [0 ... LOSCFG_KERNEL_CORE_NUM - 1] = (
UINT64)(-1)
50#define FP_EN (1U << 30)
53 __asm__ __volatile__(
"swi 0");
60 asm volatile(
"\tsub fp, sp, #0x4\n"
62 "\tadd fp, sp, #0x4\n"
65 "\tadd fp, sp, #0x4\n"
75 if (initFlag == TRUE) {
87 taskContext->
R0 = taskID;
90 taskContext->
regCPSR = PSR_MODE_SVC_THUMB;
92 taskContext->
regCPSR = PSR_MODE_SVC_ARM;
95#if !defined(LOSCFG_ARCH_FPU_DISABLE)
97 for (
UINT32 index = 0; index < FP_REGS_NUM; index++) {
98 taskContext->
D[index] = 0xAAA0000000000000LL + index;
104 return (VOID *)taskContext;
111 VOID *cloneStack = NULL;
116 cloneStack = (VOID *)(((
UINTPTR)parentTopOfStack + parentStackSize) -
sizeof(
TaskContext));
125 LOS_ASSERT(context != NULL);
128 context->
regCPSR = PSR_MODE_USR_THUMB;
130 context->
regCPSR = PSR_MODE_USR_ARM;
133 context->
USP = TRUNCATE(stack, LOSCFG_STACK_POINT_ALIGN_SIZE);
142 newSp->
PC = sigHandler;
148 __asm__ __volatile__ (
"dmb" : : :
"memory");
153 __asm__ __volatile__(
"dsb" : : :
"memory");
158 __asm__ __volatile__(
"isb" : : :
"memory");
167 __asm__ __volatile__ (
"mcr p15, 0, %0, c7, c1, 0" : :
"r" (0) :
"memory");
macro EXC_SP_SET stackSize
macro EXC_SP_SET reg1 mrc 获取CPU信息 and mov mul reg0 计算当前CPU栈的偏移位置 ldr reg1 相减得到栈顶 mov sp
VOID FlushICache(VOID)
Invalidate instruction cache.
__attribute__((aligned(MMU_DESCRIPTOR_L1_SMALL_ENTRY_NUMBERS)))
LITE_OS_SEC_TEXT_INIT VOID * OsTaskStackInit(UINT32 taskID, UINT32 stackSize, VOID *topStack, BOOL initFlag)
内核态任务运行栈初始化
VOID OsInitSignalContext(const VOID *sp, VOID *signalContext, UINTPTR sigHandler, UINT32 signo, UINT32 param)
初始化信号上下文
VOID DCacheInvRange(UINT32 start, UINT32 end)
LITE_OS_SEC_TEXT_INIT VOID OsTaskExit(VOID)
STATIC VOID OsTaskEntrySetupLoopFrame(UINT32)
LITE_OS_SEC_TEXT_INIT VOID OsUserTaskStackInit(TaskContext *context, UINTPTR taskEntry, UINTPTR stack)
用户态运行栈初始化,此时上下文还在内核区
DEPRECATED VOID Dmb(VOID)
DEPRECATED VOID Dsb(VOID)
DEPRECATED VOID Isb(VOID)
LITE_OS_SEC_TEXT VOID OsUserCloneParentStack(VOID *childStack, UINTPTR parentTopOfStack, UINT32 parentStackSize)
把父任务上下文克隆给子任务
VOID DCacheFlushRange(UINT32 start, UINT32 end)
UINT64 g_cpuMap[LOSCFG_KERNEL_CORE_NUM]
void arm_inv_cache_range(UINTPTR start, UINTPTR end)
void arm_clean_cache_range(UINTPTR start, UINTPTR end)
STATIC INLINE LosTaskCB * OsCurrTaskGet(VOID)
VOID OsStackInit(VOID *stacktop, UINT32 stacksize)
task栈的初始化,设置固定的值. 0xcccccccc 和 0xcacacaca
LITE_OS_SEC_TEXT_INIT VOID OsTaskEntry(UINT32 taskID)
sig_cb sig
信号控制块,用于异步通信,类似于 linux singal模块