更新日期: 2022/06/01 来源: https://gitee.com/weharmony/kernel_liteos_a_note
los_percpu_pri.h 文件参考

浏览源代码.

结构体

struct  Percpu
 

枚举

enum  ExcFlag { CPU_RUNNING = 0 , CPU_HALT , CPU_EXC }
 

函数

STATIC INLINE PercpuOsPercpuGet (VOID)
 
STATIC INLINE PercpuOsPercpuGetByID (UINT32 cpuid)
 
STATIC INLINE UINT32 OsCpuStatusIsHalt (UINT16 cpuid)
 
STATIC INLINE VOID OsCpuStatusSet (ExcFlag flag)
 
VOID OsAllCpuStatusOutput (VOID)
 

变量

Percpu g_percpu [LOSCFG_KERNEL_CORE_NUM]
 CPU池,池大小由CPU核数决定 更多...
 

枚举类型说明

◆ ExcFlag

enum ExcFlag
枚举值
CPU_RUNNING 

cpu is running | CPU正在运行状态

CPU_HALT 

cpu in the halt | CPU处于暂停状态

CPU_EXC 

cpu in the exc | CPU处于异常状态

在文件 los_percpu_pri.h45 行定义.

45 {
46 CPU_RUNNING = 0, ///< cpu is running | CPU正在运行状态
47 CPU_HALT, ///< cpu in the halt | CPU处于暂停状态
48 CPU_EXC ///< cpu in the exc | CPU处于异常状态
49} ExcFlag;
ExcFlag
@ CPU_HALT
cpu in the halt | CPU处于暂停状态
@ CPU_EXC
cpu in the exc | CPU处于异常状态
@ CPU_RUNNING
cpu is running | CPU正在运行状态

函数说明

◆ OsAllCpuStatusOutput()

VOID OsAllCpuStatusOutput ( VOID  )

在文件 los_percpu.c38 行定义.

39{
40 UINT32 i;
41
42 for (i = 0; i < LOSCFG_KERNEL_CORE_NUM; i++) {
43 switch (g_percpu[i].excFlag) {
44 case CPU_RUNNING:
45 PrintExcInfo("cpu%u is running.\n", i);
46 break;
47 case CPU_HALT:
48 PrintExcInfo("cpu%u is halted.\n", i);
49 break;
50 case CPU_EXC:
51 PrintExcInfo("cpu%u is in exc.\n", i);
52 break;
53 default:
54 break;
55 }
56 }
57 PrintExcInfo("The current handling the exception is cpu%u !\n", ArchCurrCpuid());
58}
STATIC INLINE UINT32 ArchCurrCpuid(VOID)
Definition: los_hw_cpu.h:168
Percpu g_percpu[LOSCFG_KERNEL_CORE_NUM]
CPU池,池大小由CPU核数决定
Definition: los_percpu.c:36
VOID PrintExcInfo(const CHAR *fmt,...)
打印异常信息
Definition: los_printf.c:263
unsigned int UINT32
Definition: los_typedef.h:57
函数调用图:
这是这个函数的调用关系图:

◆ OsCpuStatusIsHalt()

STATIC INLINE UINT32 OsCpuStatusIsHalt ( UINT16  cpuid)

在文件 los_percpu_pri.h71 行定义.

72{
73 return (OsPercpuGetByID(cpuid)->excFlag == CPU_HALT);
74}
STATIC INLINE Percpu * OsPercpuGetByID(UINT32 cpuid)
函数调用图:
这是这个函数的调用关系图:

◆ OsCpuStatusSet()

STATIC INLINE VOID OsCpuStatusSet ( ExcFlag  flag)

在文件 los_percpu_pri.h76 行定义.

77{
78 OsPercpuGet()->excFlag = flag;
79}
STATIC INLINE Percpu * OsPercpuGet(VOID)
UINT32 excFlag
函数调用图:
这是这个函数的调用关系图:

◆ OsPercpuGet()

STATIC INLINE Percpu * OsPercpuGet ( VOID  )

获得当前运行CPU的信息

在文件 los_percpu_pri.h61 行定义.

62{
63 return &g_percpu[ArchCurrCpuid()];
64}
Percpu g_percpu[LOSCFG_KERNEL_CORE_NUM]
CPU池,池大小由CPU核数决定
Definition: los_percpu.c:36
函数调用图:
这是这个函数的调用关系图:

◆ OsPercpuGetByID()

STATIC INLINE Percpu * OsPercpuGetByID ( UINT32  cpuid)

获得参数CPU的信息

在文件 los_percpu_pri.h66 行定义.

67{
68 return &g_percpu[cpuid];
69}
这是这个函数的调用关系图:

变量说明

◆ g_percpu

Percpu g_percpu[LOSCFG_KERNEL_CORE_NUM]
extern

CPU池,池大小由CPU核数决定

the kernel per-cpu structure | 每个cpu的内核描述符

在文件 los_percpu.c36 行定义.