注解汇编代码,原来它们竟如此可爱,爱了爱了.

    搜索 @note_pic 可查看绘制的全部字符图
    搜索 @note_why 是尚未看明白的地方,有看明白的,请Pull Request完善
    搜索 @note_thinking 是一些的思考和建议
    搜索 @note_#if0 是由第三方项目提供不在内核源码中定义的极为重要结构体,为方便理解而添加的。
    搜索 @note_good 是给源码点赞的地方
上级 dbfe205f
......@@ -76,11 +76,18 @@ MRS{条件} 通用寄存器,程序状态寄存器(CPSR 或SPSR)
MRS R0,CPSR @传送CPSR 的内容到R0
MRS R0,SPSR @传送SPSR 的内容到R0
@MRS指令是唯一可以直接读取CPSR和SPSR寄存器的指令
SPSR
程序状态保护寄存器,每一种模式下都有一个状态寄存器SPSR,用于保存CPSR的状态,
以便异常返回后恢复异常发生时的工作状态。用户模式和系统模式不是异常状态,
所以没有SPSR,在这两种模式下访问SPSR,将产生不可预知的后果。
1、SPSR 为 CPSR 中断时刻的副本,退出中断后,将SPSR中数据恢复到CPSR中。
2、用户模式和系统模式下SPSR不可用。
******************************************************************************/
#define CPSR_INT_DISABLE 0xC0 /* Disable both FIQ and IRQ */ //禁止IRQ和FIQ中断,因为0xC0 = 0x80 + 0x40
#define CPSR_IRQ_DISABLE 0x80 /* IRQ disabled when =1 */ //禁止IRQ 中断
#define CPSR_IRQ_DISABLE 0x80 /* IRQ disabled when =1 */ //禁止IRQ 中断
#define CPSR_FIQ_DISABLE 0x40 /* FIQ disabled when =1 */ //禁止 FIQ中断
#define CPSR_THUMB_ENABLE 0x20 /* Thumb mode when =1 */ //模式 1:CPU处于Thumb状态, 0:CPU处于ARM状态
#define CPSR_THUMB_ENABLE 0x20 /* Thumb mode when =1 */ //使能Thumb模式 1:CPU处于Thumb状态, 0:CPU处于ARM状态
#define CPSR_USER_MODE 0x10 //用户模式,除了用户模式,其余模式也叫特权模式,特权模式中除了系统模式以外的其余5种模式称为异常模式;
#define CPSR_FIQ_MODE 0x11 //快中断模式 用于高速数据传输或通道处理
#define CPSR_IRQ_MODE 0x12 //中断模式 用于通用的中断处理
......
......@@ -33,36 +33,36 @@
#include "arch_config.h"
#ifdef LOSCFG_KERNEL_SMP_LOCKDEP
.extern OsLockDepCheckOut
.extern OsLockDepCheckOut/*使用外部定义的函数*/
#endif
.extern g_taskSpin
.extern g_percpu
.global OsStartToRun
.global OsTaskSchedule /*任务调度*/
.global OsStartToRun /*任务开始执行 告诉 OsStartToRun()在本文件实现,将被外部函数调用,见于OsStart() */
.global OsTaskSchedule /*任务调度,见于OsSchedResched()*/
.global OsIrqHandler /*硬中断处理*/
.global ArchSpinUnlock /*自旋锁解锁*/
.global OsSchedToUserSpinUnlock
.global OsSchedToUserSpinUnlock /*尚未实现*/
.equ OS_TASK_STATUS_RUNNING, 0x0010U
.equ OS_TASK_STATUS_RUNNING, 0x0010U /* .equ用于把常量值设置为可以在文本段中使用的符号 #define OS_TASK_STATUS_RUNNING 0x0010U */
.equ OS_PERCPU_STRUCT_SIZE, 0x28U
.equ OS_PERCPU_TASK_LOCK_OFFSET, 0x14U
.fpu vfpv4
.fpu vfpv4 /* .fpu @note_why 尚未知这句话的含义 */
/* 此宏用于对齐和不对齐8字节边界上的堆栈以符合ABI */
/* macros to align and unalign the stack on 8 byte boundary for ABI compliance */
.macro STACK_ALIGN, reg
.macro STACK_ALIGN, reg /* 汇编带参数的宏定义*/
MOV \reg, sp
TST SP, #4
SUBEQ SP, #4
PUSH { \reg }
.endm
.macro STACK_RESTORE, reg
POP { \reg }
.macro STACK_RESTORE, reg /*汇编带参数的宏定义*/
POP { \reg } @
MOV sp, \reg
.endm
/* macros to save and restore fpu regs */
.macro PUSH_FPU_REGS reg1
.macro PUSH_FPU_REGS reg1 /* 汇编宏定义,类似于 #define PUSH_FPU_REGS(reg1) ... */
#if !defined(LOSCFG_ARCH_FPU_DISABLE)
VMRS \reg1, FPEXC
PUSH {\reg1}
......@@ -106,7 +106,7 @@ OsStartToRun:
VPUSH {D0}
VPOP {D0}
B OsTaskContextLoad
B OsTaskContextLoad @加载任务的上下文
/*
* R0: new task
......@@ -120,7 +120,7 @@ OsTaskSchedule: /*新老任务切换上下文*/
SUB SP, SP, #4 /*SP=SP-4 4是向低地址偏移4个字节的位置的地址,即堆栈的头部的地址*/
/* push r0-r12*/
STMFD SP!, {R0-R12} /*R0-R12入栈*/
STMFD SP!, {R0-R12} @将寄存器列表中的寄存器(R0-R12)压栈。
STMFD SP!, {R2} /*R2 入栈*/
/* 8 bytes stack align */
......@@ -130,26 +130,26 @@ OsTaskSchedule: /*新老任务切换上下文*/
PUSH_FPU_REGS R2 /*保存fpu寄存器*/
/* store sp on running task */
STR SP, [R1] /*R1上保存了SP,保存了老任务的现场*/
STR SP, [R1] @sp中的数据保存到以R1为地址的存储器中
OsTaskContextLoad:
/* clear the flag of ldrex */
CLREX
/* clear the flag of ldrex */ @LDREX 可从内存加载数据,如果物理地址有共享TLB属性,则LDREX会将该物理地址标记为由当前处理器独占访问,并且会清除该处理器对其他任何物理地址的任何独占访问标记。
CLREX @清除ldrex指令的标记
/* switch to new task's sp */
LDR SP, [R0]
LDR SP, [R0] @将存储器地址为R0的数据读入寄存器SP
/* restore fpu registers */
POP_FPU_REGS R2
POP_FPU_REGS R2 @恢复fpu寄存器,这里用了汇编宏R2是宏的参数
/* 8 bytes stack align */
ADD SP, SP, #4
ADD SP, SP, #4 /*SP=SP+4*/
LDMFD SP!, {R0}
MOV R4, R0
AND R0, R0, #CPSR_MASK_MODE
CMP R0, #CPSR_USER_MODE
BNE OsKernelTaskLoad
LDMFD SP!, {R0} @将堆栈内容出栈保存到寄存器R0
MOV R4, R0 @R4=R0 说明R4也记录了CPSR内容,这个内容将用于 OsKernelTaskLoad中保存到SPSR
AND R0, R0, #CPSR_MASK_MODE @R0 =R0&CPSR_MASK_MODE ,目的是清除高16
CMP R0, #CPSR_USER_MODE @比较R0是否为用户模式
BNE OsKernelTaskLoad @不相等则跳转到OsKernelTaskLoad执行
#ifdef LOSCFG_KERNEL_SMP
#ifdef LOSCFG_KERNEL_SMP_LOCKDEP
......@@ -181,12 +181,12 @@ OsTaskContextLoad:
ADD SP, SP, #(2 * 4)
LDMFD SP!, {PC}^
OsKernelTaskLoad:
MSR SPSR_cxsf, R4
OsKernelTaskLoad: @内核任务的加载
MSR SPSR_cxsf, R4 @R4保存到程序状态保存寄存器32
/* restore r0-r12, lr */
LDMFD SP!, {R0-R12}
ADD SP, SP, #4
LDMFD SP!, {LR, PC}^
LDMFD SP!, {R0-R12} @出栈,依次保存到 R0-R12,其实就是恢复现场
ADD SP, SP, #4 @sp=SP+4
LDMFD SP!, {LR, PC}^ @返回地址赋给pc指针
OsIrqHandler:
SUB LR, LR, #4
......
......@@ -84,6 +84,7 @@ extern "C" {
同时将函数入参、局部变量、寄存器入栈。栈帧从高地址向低地址生长。
以ARM32 CPU架构为例,每个栈帧中都会保存PC、LR、SP和FP寄存器的历史值。
ARM处理器中的R13被用作SP
堆栈分析
LR寄存器(Link Register),链接寄存器,指向函数的返回地址。
......@@ -143,8 +144,8 @@ STATIC UINT32 g_nextExcWaitCpu = INVALID_CPUID;
#define IS_VALID_ADDR(ptr) (((ptr) >= g_minAddr) && \
((ptr) <= g_maxAddr) && \
(IS_ALIGNED((ptr), sizeof(CHAR *))))
STATIC const StackInfo g_excStack[] = {// 6种异常情况下对应的栈
//6种异常情况下对应的栈,每一种异常模式都有其独立的堆栈,用不同的堆栈指针来索引,这样当ARM进入异常模式的时候,
STATIC const StackInfo g_excStack[] = {//程序就可以把一般通用寄存器压入堆栈,返回时再出栈,保证了各种模式下程序的状态的完整性
{ &__undef_stack, OS_EXC_UNDEF_STACK_SIZE, "udf_stack" }, //512 未定义的指令模式堆栈
{ &__abt_stack, OS_EXC_ABT_STACK_SIZE, "abt_stack" }, //512 中止模式堆栈,用于数据中止,可以将处理程序设置为在触发异常终止时运行
{ &__fiq_stack, OS_EXC_FIQ_STACK_SIZE, "fiq_stack" }, //64 FIQ中断模式堆栈.快速中断(FIQ)可能会在IRQ期间发生-它们就像优先级较高的IRQ.在FIQ中,FIQ和IRQ被禁用.
......
......@@ -145,7 +145,7 @@ VOID OsSchedResched(VOID)
newProcess->threadScheduleMap, newTask->taskName, newTask->taskID, newTask->taskStatus);
/* do the task context switch */
OsTaskSchedule(newTask, runTask);//切换CPU的上下文,由汇编实现,见于 los_dispatch.s
OsTaskSchedule(newTask, runTask);//切换CPU的上下文,注意OsTaskSchedule是一个汇编函数 见于 los_dispatch.s
}
VOID OsSchedPreempt(VOID)
......
......@@ -165,7 +165,7 @@ LITE_OS_SEC_TEXT_INIT VOID OsStart(VOID)
OS_SCHEDULER_SET(cpuid);//设置调度cpu id
PRINTK("cpu %d entering scheduler\n", cpuid);
OsStartToRun(taskCB);//任务开始跑任务
OsStartToRun(taskCB);//任务开始跑,注意OsStartToRun是一个汇编函数 见于 los_dispatch.s
}
//进程通讯IPC初始化 由OsMain()调用
LITE_OS_SEC_TEXT_INIT STATIC UINT32 OsIpcInit(VOID)
......
/*
* Copyright (c) 2013-2019, Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020, Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "los_base.h"
#include "los_hwi.h"
#ifdef LOSCFG_FS_VFS
#include "fs/fs.h"
#endif
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif /* __cplusplus */
#endif /* __cplusplus */
#ifdef LOSCFG_SHELL_EXCINFO
STATIC log_read_write_fn g_excInfoRW = NULL; /* the hook of read-writing exception information *///读写异常信息的钩子
STATIC CHAR *g_excInfoBuf = NULL; /* pointer to the buffer for storing the exception information *///指向存储异常信息的缓冲区的指针
STATIC UINT32 g_excInfoIndex = 0xFFFFFFFF; /* the index of the buffer for storing the exception information *///用于存储异常信息的缓冲区的索引
STATIC UINT32 g_recordAddr = 0; /* the address of storing the exception information */ //存储异常信息的地址
STATIC UINT32 g_recordSpace = 0; /* the size of storing the exception information */ //存储异常信息的大小
VOID SetExcInfoRW(log_read_write_fn func)
{
g_excInfoRW = func;
}
log_read_write_fn GetExcInfoRW(VOID)
{
return g_excInfoRW;
}
VOID SetExcInfoBuf(CHAR *buf)
{
g_excInfoBuf = buf;
}
CHAR *GetExcInfoBuf(VOID)
{
return g_excInfoBuf;
}
VOID SetExcInfoIndex(UINT32 index)
{
g_excInfoIndex = index;
}
UINT32 GetExcInfoIndex(VOID)
{
return g_excInfoIndex;
}
VOID SetRecordAddr(UINT32 addr)
{
g_recordAddr = addr;
}
UINT32 GetRecordAddr(VOID)
{
return g_recordAddr;
}
VOID SetRecordSpace(UINT32 space)
{
g_recordSpace = space;
}
UINT32 GetRecordSpace(VOID)
{
return g_recordSpace;
}
//vsnprintf 为C标准库可变参数的实现函数 见于 ..\third_party\musl\kernel\src\stdio\vsnprintf.c
VOID WriteExcBufVa(const CHAR *format, va_list arglist)
{
errno_t ret;
if (g_recordSpace > g_excInfoIndex) {
ret = vsnprintf_s((g_excInfoBuf + g_excInfoIndex), (g_recordSpace - g_excInfoIndex),
(g_recordSpace - g_excInfoIndex - 1), format, arglist);
if (ret == -1) {
PRINT_ERR("exc info buffer is not enough or vsnprintf_s is error.\n");
return;
}
g_excInfoIndex += ret;
}
}
//写异常信息到系统异常信息中心
VOID WriteExcInfoToBuf(const CHAR *format, ...)
{
va_list arglist;//va_arg
va_start(arglist, format);//从任务栈中取出入栈参数
WriteExcBufVa(format, arglist);//入栈参数列表作为实参传入交由vsnprintf处理
va_end(arglist);//释放资源
}
//用于注册记录异常信息函数,并指定位置、空间和大小
VOID LOS_ExcInfoRegHook(UINT32 startAddr, UINT32 space, CHAR *buf, log_read_write_fn hook)
{
if ((hook == NULL) || (buf == NULL)) {
PRINT_ERR("Buf or hook is null.\n");
return;
}
g_recordAddr = startAddr;
g_recordSpace = space;
g_excInfoBuf = buf;
g_excInfoRW = hook;
#ifdef LOSCFG_FS_VFS
los_vfs_init();//初始化虚拟文件系统
#endif
}
/* Be called in the exception. */
VOID OsReadWriteExceptionInfo(UINT32 startAddr, UINT32 space, UINT32 flag, CHAR *buf)
{
if ((buf == NULL) || (space == 0)) {
PRINT_ERR("buffer is null or space is zero\n");
return;
}
// user can write exception information to files here
}
//记录异常信息发送的时间
VOID OsRecordExcInfoTime(VOID)
{
#ifdef LOSCFG_FS_VFS
#define NOW_TIME_LENGTH 24
time_t t;
struct tm *tmTime = NULL;
CHAR nowTime[NOW_TIME_LENGTH];
(VOID)time(&t);
tmTime = localtime(&t);//获取本地时间的标准C库函数
if (tmTime == NULL) {
return;
}
(VOID)memset_s(nowTime, sizeof(nowTime), 0, sizeof(nowTime));
(VOID)strftime(nowTime, NOW_TIME_LENGTH, "%Y-%m-%d %H:%M:%S", tmTime);//生成时间格式
#undef NOW_TIME_LENGTH
WriteExcInfoToBuf("%s \n", nowTime);
#endif
}
#endif
#ifdef __cplusplus
#if __cplusplus
}
#endif /* __cplusplus */
#endif /* __cplusplus */
/*
* Copyright (c) 2013-2019, Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020, Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "los_base.h"
#include "los_hwi.h"
#ifdef LOSCFG_FS_VFS
#include "fs/fs.h"
#endif
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif /* __cplusplus */
#endif /* __cplusplus */
#ifdef LOSCFG_SHELL_EXCINFO //异常信息开关
STATIC log_read_write_fn g_excInfoRW = NULL; /* the hook of read-writing exception information */ //读写异常信息的钩子函数
STATIC CHAR *g_excInfoBuf = NULL; /* pointer to the buffer for storing the exception information */ //指向存储异常信息的缓冲区的指针
STATIC UINT32 g_excInfoIndex = 0xFFFFFFFF; /* the index of the buffer for storing the exception information */ //用于存储异常信息的缓冲区的索引
STATIC UINT32 g_recordAddr = 0; /* the address of storing the exception information */ //存储异常信息的地址
STATIC UINT32 g_recordSpace = 0; /* the size of storing the exception information */ //存储异常信息的大小
//设置异常信息的读写函数
VOID SetExcInfoRW(log_read_write_fn func)
{
g_excInfoRW = func;
}
//获取异常信息读写函数
log_read_write_fn GetExcInfoRW(VOID)
{
return g_excInfoRW;
}
//设置异常信息的缓存
VOID SetExcInfoBuf(CHAR *buf)
{
g_excInfoBuf = buf;
}
//获取异常信息的缓存
CHAR *GetExcInfoBuf(VOID)
{
return g_excInfoBuf;
}
//设置异常信息索引位
VOID SetExcInfoIndex(UINT32 index)
{
g_excInfoIndex = index;
}
//获取异常信息索引位
UINT32 GetExcInfoIndex(VOID)
{
return g_excInfoIndex;
}
VOID SetRecordAddr(UINT32 addr)
{
g_recordAddr = addr;
}
UINT32 GetRecordAddr(VOID)
{
return g_recordAddr;
}
VOID SetRecordSpace(UINT32 space)
{
g_recordSpace = space;
}
UINT32 GetRecordSpace(VOID)
{
return g_recordSpace;
}
//vsnprintf 为C标准库可变参数的实现函数 见于 ..\third_party\musl\kernel\src\stdio\vsnprintf.c
VOID WriteExcBufVa(const CHAR *format, va_list arglist)
{
errno_t ret;
if (g_recordSpace > g_excInfoIndex) {
ret = vsnprintf_s((g_excInfoBuf + g_excInfoIndex), (g_recordSpace - g_excInfoIndex),
(g_recordSpace - g_excInfoIndex - 1), format, arglist);
if (ret == -1) {
PRINT_ERR("exc info buffer is not enough or vsnprintf_s is error.\n");
return;
}
g_excInfoIndex += ret;
}
}
//写异常信息到系统异常信息中心
VOID WriteExcInfoToBuf(const CHAR *format, ...)
{
va_list arglist;//va_arg
va_start(arglist, format);//从任务栈中取出入栈参数
WriteExcBufVa(format, arglist);//入栈参数列表作为实参传入交由vsnprintf处理
va_end(arglist);//释放资源
}
//用于注册记录异常信息函数,并指定位置、空间和大小
VOID LOS_ExcInfoRegHook(UINT32 startAddr, UINT32 space, CHAR *buf, log_read_write_fn hook)
{
if ((hook == NULL) || (buf == NULL)) {
PRINT_ERR("Buf or hook is null.\n");
return;
}
g_recordAddr = startAddr;
g_recordSpace = space;
g_excInfoBuf = buf;
g_excInfoRW = hook;
#ifdef LOSCFG_FS_VFS
los_vfs_init();//初始化虚拟文件系统
#endif
}
/* Be called in the exception. */ //异常发生时回调这里
VOID OsReadWriteExceptionInfo(UINT32 startAddr, UINT32 space, UINT32 flag, CHAR *buf)
{
if ((buf == NULL) || (space == 0)) {
PRINT_ERR("buffer is null or space is zero\n");
return;
}
// user can write exception information to files here
}
//记录异常信息产生的时间
VOID OsRecordExcInfoTime(VOID)
{
#ifdef LOSCFG_FS_VFS
#define NOW_TIME_LENGTH 24
time_t t;
struct tm *tmTime = NULL;
CHAR nowTime[NOW_TIME_LENGTH];
(VOID)time(&t);
tmTime = localtime(&t);//获取本地时间的标准C库函数
if (tmTime == NULL) {
return;
}
(VOID)memset_s(nowTime, sizeof(nowTime), 0, sizeof(nowTime));
(VOID)strftime(nowTime, NOW_TIME_LENGTH, "%Y-%m-%d %H:%M:%S", tmTime);//生成时间格式
#undef NOW_TIME_LENGTH
WriteExcInfoToBuf("%s \n", nowTime);
#endif
}
#endif
#ifdef __cplusplus
#if __cplusplus
}
#endif /* __cplusplus */
#endif /* __cplusplus */
......@@ -203,7 +203,7 @@ LITE_OS_SEC_ALW_INLINE STATIC INLINE INT32 LOS_SpinTrylock(SPIN_LOCK_S *lock)
LITE_OS_SEC_ALW_INLINE STATIC INLINE VOID LOS_SpinUnlock(SPIN_LOCK_S *lock)
{
LOCKDEP_CHECK_OUT(lock);
ArchSpinUnlock(&lock->rawLock);
ArchSpinUnlock(&lock->rawLock);//注意ArchSpinUnlock是一个汇编函数 见于 los_dispatch.s
/* restore the scheduler flag */
LOS_TaskUnlock();
......
git add -A
git commit -m '注解:CPSR(当前程序的状态寄存器)各位表示什么含义 ? 如何读取这个寄存器 ?
git commit -m '注解汇编代码,原来它们竟如此可爱,爱了爱了.
搜索 @note_pic 可查看绘制的全部字符图
搜索 @note_why 是尚未看明白的地方,有看明白的,请Pull Request完善
搜索 @note_thinking 是一些的思考和建议
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册