71 PRINTK(
"-------- %s Module Init... level = %u --------\n",
name, level);
89 if (module->
hook != NULL) {
95 singleTime = endNsec - startNsec;
96 totalTime += singleTime;
97 PRINTK(
"Starting %s module consumes %llu ns. Run on cpu %u\n", module->
name, singleTime,
ArchCurrCpuid());
104 PRINT_ERR(
"%s initialization failed at module %s, function addr at 0x%x, ret code is %u\n",
110 if (level >= LOS_INIT_LEVEL_KMOD_TASK) {
117 PRINTK(
"%s initialization at level %u consumes %lluns on cpu %u.\n",
name, level, totalTime,
ArchCurrCpuid());
129 if (level >= LOS_INIT_LEVEL_FINISH) {
STATIC INLINE VOID LOS_AtomicInc(Atomic *v)
Atomic addSelf.
STATIC INLINE INT32 LOS_AtomicRead(const Atomic *v)
Atomic read. | 读取32bit原子数据
LITE_OS_SEC_TEXT_MINOR UINT64 LOS_CurrNanosec(VOID)
获取自系统启动以来的纳秒数
原子操作 http://weharmonyos.com/openharmony/zh-cn/device-dev/kernel/kernel-small-basic-atomic....
STATIC INLINE UINT32 ArchCurrCpuid(VOID)
STATIC VOID InitLevelCall(const CHAR *name, const UINT32 level, struct ModuleInitInfo *initLevelList[])
STATIC SPIN_LOCK_INIT(g_initLock)
VOID OsInitCall(const UINT32 level)
初始化调用日志打印,这个函数的功能主要是为了记录某个步骤的耗时.在一个函数前后各调用一次就知道函数的执行情况. 这为开机调试提供了很重要的日志依据.
STATIC volatile UINT32 g_initCurrentLevel
STATIC volatile struct ModuleInitInfo * g_initCurrentModule
OS_INIT_LEVEL_REG(kernel, 10, g_kernInitLevelList)
STATIC Atomic g_initCount
VOID LOS_SpinLock(SPIN_LOCK_S *lock)
VOID LOS_SpinUnlock(SPIN_LOCK_S *lock)