WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
los_percpu_pri.h
浏览该文件的文档.
1/* ----------------------------------------------------------------------------
2 * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
3 * Description: Percpu Private HeadFile
4 * Author: Huawei LiteOS Team
5 * Create: 2018-08-29
6 * Redistribution and use in source and binary forms, with or without modification,
7 * are permitted provided that the following conditions are met:
8 * 1. Redistributions of source code must retain the above copyright notice, this list of
9 * conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
11 * of conditions and the following disclaimer in the documentation and/or other materials
12 * provided with the distribution.
13 * 3. Neither the name of the copyright holder nor the names of its contributors may be used
14 * to endorse or promote products derived from this software without specific prior written
15 * permission.
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
18 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
20 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
23 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
25 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
26 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 * --------------------------------------------------------------------------- */
28
29#ifndef _LOS_PERCPU_PRI_H
30#define _LOS_PERCPU_PRI_H
31
32#include "los_base.h"
33#include "los_sortlink_pri.h"
34
35#include "arch/cpu.h"
36
37#ifdef __cplusplus
38extern "C" {
39#endif /* __cplusplus */
40
41#ifdef LOSCFG_KERNEL_SMP
42typedef enum {
43 CPU_RUNNING = 0, /* cpu is running */
44 CPU_HALT, /* cpu in the halt */
45 CPU_EXC /* cpu in the exc */
46} ExcFlag;
47#endif
48
55
56typedef struct {
57 SortLinkAttribute taskSortLink; /* task sort link */
58#ifdef LOSCFG_BASE_CORE_SWTMR
59 SortLinkAttribute swtmrSortLink; /* swtmr sort link */
60 ExpiryList expiryList; /* swtmr expiry List */
61#endif
62
63 UINT32 idleTaskId; /* idle task id */
64 UINT32 taskLockCnt; /* task lock flag */
65 UINT32 swtmrHandlerQueue; /* software timer timeout queue id */
66 UINT32 swtmrTaskId; /* software timer task id */
67#ifndef LOSCFG_SCHED_LATENCY
68 UINT32 schedFlag; /* pending scheduler flag */
69#endif
70#ifdef LOSCFG_KERNEL_SMP
71 UINT32 excFlag; /* cpu halt or exc flag */
72#ifdef LOSCFG_KERNEL_SMP_CALL
73 LOS_DL_LIST funcLink; /* mp function call link */
74#endif
75#endif
76} Percpu;
77
78/* the kernel per-cpu structure */
80
82{
83 return &g_percpu[ArchCurrCpuid()];
84}
85
87{
88 return &g_percpu[cpuid];
89}
90
91#ifdef __cplusplus
92}
93#endif /* __cplusplus */
94
95#endif /* _LOS_PERCPU_PRI_H */
#define STATIC
Definition common_def.h:57
#define INLINE
Definition common_def.h:65
#define LOSCFG_KERNEL_CORE_NUM
Definition los_config.h:258
Percpu g_percpu[LOSCFG_KERNEL_CORE_NUM]
STATIC INLINE Percpu * OsPercpuGetByID(UINT32 cpuid)
Definition los_percpu_pri.h:86
STATIC INLINE Percpu * OsPercpuGet(VOID)
Definition los_percpu_pri.h:81
unsigned short UINT16
Definition los_typedef.h:51
#define VOID
Definition los_typedef.h:88
unsigned int UINTPTR
Definition los_typedef.h:74
unsigned int UINT32
Definition los_typedef.h:52
Definition los_percpu_pri.h:49
UINT32 free
Definition los_percpu_pri.h:52
UINT16 tail
Definition los_percpu_pri.h:51
UINT16 head
Definition los_percpu_pri.h:50
UINTPTR * buf
Definition los_percpu_pri.h:53
Definition los_list.h:47
Definition los_percpu_pri.h:56
UINT32 idleTaskId
Definition los_percpu_pri.h:63
UINT32 schedFlag
Definition los_percpu_pri.h:68
UINT32 taskLockCnt
Definition los_percpu_pri.h:64
UINT32 swtmrTaskId
Definition los_percpu_pri.h:66
SortLinkAttribute taskSortLink
Definition los_percpu_pri.h:57
UINT32 swtmrHandlerQueue
Definition los_percpu_pri.h:65
Definition los_sortlink_pri.h:112