Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Kernel Liteos A
提交
cb67dd54
K
Kernel Liteos A
项目概览
OpenHarmony
/
Kernel Liteos A
大约 2 年 前同步成功
通知
475
Star
414
Fork
55
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
4
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel Liteos A
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
4
Issue
4
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
cb67dd54
编写于
3月 19, 2022
作者:
O
openharmony_ci
提交者:
Gitee
3月 19, 2022
浏览文件
操作
浏览文件
下载
差异文件
!834 feat: swtmr机制与调度分离,调度只针对通用线程,不针对特殊功能
Merge pull request !834 from zhushengle/swtmr
上级
41b80ad2
6d8cef40
变更
21
展开全部
隐藏空白更改
内联
并排
Showing
21 changed file
with
517 addition
and
410 deletion
+517
-410
arch/arm/arm/src/include/los_hwi_pri.h
arch/arm/arm/src/include/los_hwi_pri.h
+2
-2
arch/arm/arm/src/los_exc.c
arch/arm/arm/src/los_exc.c
+29
-29
arch/arm/arm/src/los_hwi.c
arch/arm/arm/src/los_hwi.c
+7
-7
kernel/base/core/los_swtmr.c
kernel/base/core/los_swtmr.c
+289
-88
kernel/base/core/los_task.c
kernel/base/core/los_task.c
+1
-1
kernel/base/include/los_sched_pri.h
kernel/base/include/los_sched_pri.h
+84
-79
kernel/base/include/los_sortlink_pri.h
kernel/base/include/los_sortlink_pri.h
+15
-1
kernel/base/include/los_swtmr_pri.h
kernel/base/include/los_swtmr_pri.h
+21
-14
kernel/base/misc/swtmr_shellcmd.c
kernel/base/misc/swtmr_shellcmd.c
+12
-11
kernel/base/sched/sched_sq/los_sched.c
kernel/base/sched/sched_sq/los_sched.c
+23
-153
kernel/base/sched/sched_sq/los_sortlink.c
kernel/base/sched/sched_sq/los_sortlink.c
+14
-5
kernel/extended/cpup/los_cpup.c
kernel/extended/cpup/los_cpup.c
+10
-10
kernel/extended/trace/los_trace.c
kernel/extended/trace/los_trace.c
+1
-1
kernel/extended/trace/trace_offline.c
kernel/extended/trace/trace_offline.c
+2
-2
kernel/include/los_trace.h
kernel/include/los_trace.h
+1
-1
testsuites/kernel/include/osTest.h
testsuites/kernel/include/osTest.h
+1
-1
testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_081.c
...el/sample/kernel_base/core/task/smp/It_smp_los_task_081.c
+1
-1
testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_114.c
...el/sample/kernel_base/core/task/smp/It_smp_los_task_114.c
+1
-1
testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_115.c
...el/sample/kernel_base/core/task/smp/It_smp_los_task_115.c
+1
-1
testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_126.c
...el/sample/kernel_base/core/task/smp/It_smp_los_task_126.c
+1
-1
testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_127.c
...el/sample/kernel_base/core/task/smp/It_smp_los_task_127.c
+1
-1
未找到文件。
arch/arm/arm/src/include/los_hwi_pri.h
浏览文件 @
cb67dd54
...
...
@@ -55,8 +55,8 @@ extern "C" {
#define HWI_IS_REGISTED(num) ((&g_hwiForm[num])->pstNext != NULL)
#endif
extern
VOID
OsHwiInit
(
VOID
);
extern
VOID
OsIncHwiFormCnt
(
UINT16
cpu
I
d
,
UINT32
index
);
extern
UINT32
OsGetHwiFormCnt
(
UINT16
cpu
I
d
,
UINT32
index
);
extern
VOID
OsIncHwiFormCnt
(
UINT16
cpu
i
d
,
UINT32
index
);
extern
UINT32
OsGetHwiFormCnt
(
UINT16
cpu
i
d
,
UINT32
index
);
extern
CHAR
*
OsGetHwiFormName
(
UINT32
index
);
extern
VOID
OsInterrupt
(
UINT32
intNum
);
extern
VOID
OsSyscallHandleInit
(
VOID
);
...
...
arch/arm/arm/src/los_exc.c
浏览文件 @
cb67dd54
...
...
@@ -74,7 +74,7 @@
STATIC
UINTPTR
g_minAddr
;
STATIC
UINTPTR
g_maxAddr
;
STATIC
UINT32
g_currHandleExcCpu
ID
=
INVALID_CPUID
;
STATIC
UINT32
g_currHandleExcCpu
id
=
INVALID_CPUID
;
VOID
OsExcHook
(
UINT32
excType
,
ExcContext
*
excBufAddr
,
UINT32
far
,
UINT32
fsr
);
UINT32
g_curNestCount
[
LOSCFG_KERNEL_CORE_NUM
]
=
{
0
};
BOOL
g_excFromUserMode
[
LOSCFG_KERNEL_CORE_NUM
];
...
...
@@ -112,11 +112,11 @@ STATIC const StackInfo g_excStack[] = {
UINT32
OsGetSystemStatus
(
VOID
)
{
UINT32
flag
;
UINT32
cpu
ID
=
g_currHandleExcCpuID
;
UINT32
cpu
id
=
g_currHandleExcCpuid
;
if
(
cpu
ID
==
INVALID_CPUID
)
{
if
(
cpu
id
==
INVALID_CPUID
)
{
flag
=
OS_SYSTEM_NORMAL
;
}
else
if
(
cpu
ID
==
ArchCurrCpuid
())
{
}
else
if
(
cpu
id
==
ArchCurrCpuid
())
{
flag
=
OS_SYSTEM_EXC_CURR_CPU
;
}
else
{
flag
=
OS_SYSTEM_EXC_OTHER_CPU
;
...
...
@@ -531,11 +531,11 @@ VOID OsDumpContextMem(const ExcContext *excBufAddr)
STATIC
VOID
OsExcRestore
(
VOID
)
{
UINT32
currCpu
ID
=
ArchCurrCpuid
();
UINT32
currCpu
id
=
ArchCurrCpuid
();
g_excFromUserMode
[
currCpu
ID
]
=
FALSE
;
g_intCount
[
currCpu
ID
]
=
0
;
g_curNestCount
[
currCpu
ID
]
=
0
;
g_excFromUserMode
[
currCpu
id
]
=
FALSE
;
g_intCount
[
currCpu
id
]
=
0
;
g_curNestCount
[
currCpu
id
]
=
0
;
#ifdef LOSCFG_KERNEL_SMP
OsCpuStatusSet
(
CPU_RUNNING
);
#endif
...
...
@@ -556,15 +556,15 @@ STATIC VOID OsUserExcHandle(ExcContext *excBufAddr)
#ifdef LOSCFG_KERNEL_SMP
LOS_SpinLock
(
&
g_excSerializerSpin
);
if
(
g_nextExcWaitCpu
!=
INVALID_CPUID
)
{
g_currHandleExcCpu
ID
=
g_nextExcWaitCpu
;
g_currHandleExcCpu
id
=
g_nextExcWaitCpu
;
g_nextExcWaitCpu
=
INVALID_CPUID
;
}
else
{
g_currHandleExcCpu
ID
=
INVALID_CPUID
;
g_currHandleExcCpu
id
=
INVALID_CPUID
;
}
g_currHandleExcPID
=
OS_INVALID_VALUE
;
LOS_SpinUnlock
(
&
g_excSerializerSpin
);
#else
g_currHandleExcCpu
ID
=
INVALID_CPUID
;
g_currHandleExcCpu
id
=
INVALID_CPUID
;
#endif
#ifdef LOSCFG_KERNEL_SMP
...
...
@@ -979,14 +979,14 @@ VOID OsDataAbortExcHandleEntry(ExcContext *excBufAddr)
#define EXC_WAIT_INTER 50U
#define EXC_WAIT_TIME 2000U
STATIC
VOID
WaitAllCpuStop
(
UINT32
cpu
ID
)
STATIC
VOID
WaitAllCpuStop
(
UINT32
cpu
id
)
{
UINT32
i
;
UINT32
time
=
0
;
while
(
time
<
EXC_WAIT_TIME
)
{
for
(
i
=
0
;
i
<
LOSCFG_KERNEL_CORE_NUM
;
i
++
)
{
if
((
i
!=
cpu
ID
)
&&
!
OsCpuStatusIsHalt
(
i
))
{
if
((
i
!=
cpu
id
)
&&
!
OsCpuStatusIsHalt
(
i
))
{
LOS_Mdelay
(
EXC_WAIT_INTER
);
time
+=
EXC_WAIT_INTER
;
break
;
...
...
@@ -1000,19 +1000,19 @@ STATIC VOID WaitAllCpuStop(UINT32 cpuID)
return
;
}
STATIC
VOID
OsWaitOtherCoresHandleExcEnd
(
UINT32
currCpu
ID
)
STATIC
VOID
OsWaitOtherCoresHandleExcEnd
(
UINT32
currCpu
id
)
{
while
(
1
)
{
LOS_SpinLock
(
&
g_excSerializerSpin
);
if
((
g_currHandleExcCpu
ID
==
INVALID_CPUID
)
||
(
g_currHandleExcCpuID
==
currCpuID
))
{
g_currHandleExcCpu
ID
=
currCpuID
;
if
((
g_currHandleExcCpu
id
==
INVALID_CPUID
)
||
(
g_currHandleExcCpuid
==
currCpuid
))
{
g_currHandleExcCpu
id
=
currCpuid
;
g_currHandleExcPID
=
OsCurrProcessGet
()
->
processID
;
LOS_SpinUnlock
(
&
g_excSerializerSpin
);
break
;
}
if
(
g_nextExcWaitCpu
==
INVALID_CPUID
)
{
g_nextExcWaitCpu
=
currCpu
ID
;
g_nextExcWaitCpu
=
currCpu
id
;
}
LOS_SpinUnlock
(
&
g_excSerializerSpin
);
LOS_Mdelay
(
EXC_WAIT_INTER
);
...
...
@@ -1021,7 +1021,7 @@ STATIC VOID OsWaitOtherCoresHandleExcEnd(UINT32 currCpuID)
STATIC
VOID
OsCheckAllCpuStatus
(
VOID
)
{
UINT32
currCpu
ID
=
ArchCurrCpuid
();
UINT32
currCpu
id
=
ArchCurrCpuid
();
UINT32
ret
,
target
;
OsCpuStatusSet
(
CPU_EXC
);
...
...
@@ -1029,17 +1029,17 @@ STATIC VOID OsCheckAllCpuStatus(VOID)
LOS_SpinLock
(
&
g_excSerializerSpin
);
/* Only the current CPU anomaly */
if
(
g_currHandleExcCpu
ID
==
INVALID_CPUID
)
{
g_currHandleExcCpu
ID
=
currCpuID
;
if
(
g_currHandleExcCpu
id
==
INVALID_CPUID
)
{
g_currHandleExcCpu
id
=
currCpuid
;
g_currHandleExcPID
=
OsCurrProcessGet
()
->
processID
;
LOS_SpinUnlock
(
&
g_excSerializerSpin
);
#ifndef LOSCFG_SAVE_EXCINFO
if
(
g_excFromUserMode
[
currCpu
ID
]
==
FALSE
)
{
target
=
(
UINT32
)(
OS_MP_CPU_ALL
&
~
CPUID_TO_AFFI_MASK
(
currCpu
ID
));
if
(
g_excFromUserMode
[
currCpu
id
]
==
FALSE
)
{
target
=
(
UINT32
)(
OS_MP_CPU_ALL
&
~
CPUID_TO_AFFI_MASK
(
currCpu
id
));
HalIrqSendIpi
(
target
,
LOS_MP_IPI_HALT
);
}
#endif
}
else
if
(
g_excFromUserMode
[
currCpu
ID
]
==
TRUE
)
{
}
else
if
(
g_excFromUserMode
[
currCpu
id
]
==
TRUE
)
{
/* Both cores raise exceptions, and the current core is a user-mode exception.
* Both cores are abnormal and come from the same process
*/
...
...
@@ -1051,12 +1051,12 @@ STATIC VOID OsCheckAllCpuStatus(VOID)
}
LOS_SpinUnlock
(
&
g_excSerializerSpin
);
OsWaitOtherCoresHandleExcEnd
(
currCpu
ID
);
OsWaitOtherCoresHandleExcEnd
(
currCpu
id
);
}
else
{
if
((
g_currHandleExcCpu
ID
<
LOSCFG_KERNEL_CORE_NUM
)
&&
(
g_excFromUserMode
[
g_currHandleExcCpuID
]
==
TRUE
))
{
g_currHandleExcCpu
ID
=
currCpuID
;
if
((
g_currHandleExcCpu
id
<
LOSCFG_KERNEL_CORE_NUM
)
&&
(
g_excFromUserMode
[
g_currHandleExcCpuid
]
==
TRUE
))
{
g_currHandleExcCpu
id
=
currCpuid
;
LOS_SpinUnlock
(
&
g_excSerializerSpin
);
target
=
(
UINT32
)(
OS_MP_CPU_ALL
&
~
CPUID_TO_AFFI_MASK
(
currCpu
ID
));
target
=
(
UINT32
)(
OS_MP_CPU_ALL
&
~
CPUID_TO_AFFI_MASK
(
currCpu
id
));
HalIrqSendIpi
(
target
,
LOS_MP_IPI_HALT
);
}
else
{
LOS_SpinUnlock
(
&
g_excSerializerSpin
);
...
...
@@ -1066,7 +1066,7 @@ STATIC VOID OsCheckAllCpuStatus(VOID)
#ifndef LOSCFG_SAVE_EXCINFO
/* use halt ipi to stop other active cores */
if
(
g_excFromUserMode
[
ArchCurrCpuid
()]
==
FALSE
)
{
WaitAllCpuStop
(
currCpu
ID
);
WaitAllCpuStop
(
currCpu
id
);
}
#endif
}
...
...
@@ -1077,7 +1077,7 @@ STATIC VOID OsCheckCpuStatus(VOID)
#ifdef LOSCFG_KERNEL_SMP
OsCheckAllCpuStatus
();
#else
g_currHandleExcCpu
ID
=
ArchCurrCpuid
();
g_currHandleExcCpu
id
=
ArchCurrCpuid
();
#endif
}
...
...
arch/arm/arm/src/los_hwi.c
浏览文件 @
cb67dd54
...
...
@@ -48,9 +48,9 @@ HwiHandleForm g_hwiForm[OS_HWI_MAX_NUM];
STATIC
CHAR
*
g_hwiFormName
[
OS_HWI_MAX_NUM
]
=
{
0
};
STATIC
UINT32
g_hwiFormCnt
[
LOSCFG_KERNEL_CORE_NUM
][
OS_HWI_MAX_NUM
]
=
{
0
};
UINT32
OsGetHwiFormCnt
(
UINT16
cpu
I
d
,
UINT32
index
)
UINT32
OsGetHwiFormCnt
(
UINT16
cpu
i
d
,
UINT32
index
)
{
return
g_hwiFormCnt
[
cpu
I
d
][
index
];
return
g_hwiFormCnt
[
cpu
i
d
][
index
];
}
CHAR
*
OsGetHwiFormName
(
UINT32
index
)
...
...
@@ -69,14 +69,14 @@ VOID OsInterrupt(UINT32 intNum)
{
HwiHandleForm
*
hwiForm
=
NULL
;
UINT32
*
intCnt
=
NULL
;
UINT16
cpu
I
d
=
ArchCurrCpuid
();
UINT16
cpu
i
d
=
ArchCurrCpuid
();
/* Must keep the operation at the beginning of the interface */
intCnt
=
&
g_intCount
[
cpu
I
d
];
intCnt
=
&
g_intCount
[
cpu
i
d
];
*
intCnt
=
*
intCnt
+
1
;
#ifdef LOSCFG_CPUP_INCLUDE_IRQ
OsCpupIrqStart
(
cpu
I
d
);
OsCpupIrqStart
(
cpu
i
d
);
#endif
OsSchedIrqStartTime
();
...
...
@@ -101,13 +101,13 @@ VOID OsInterrupt(UINT32 intNum)
#ifndef LOSCFG_NO_SHARED_IRQ
}
#endif
++
g_hwiFormCnt
[
cpu
I
d
][
intNum
];
++
g_hwiFormCnt
[
cpu
i
d
][
intNum
];
OsHookCall
(
LOS_HOOK_TYPE_ISR_EXIT
,
intNum
);
OsSchedIrqUpdateUsedTime
();
#ifdef LOSCFG_CPUP_INCLUDE_IRQ
OsCpupIrqEnd
(
cpu
I
d
,
intNum
);
OsCpupIrqEnd
(
cpu
i
d
,
intNum
);
#endif
/* Must keep the operation at the end of the interface */
*
intCnt
=
*
intCnt
-
1
;
...
...
kernel/base/core/los_swtmr.c
浏览文件 @
cb67dd54
此差异已折叠。
点击以展开。
kernel/base/core/los_task.c
浏览文件 @
cb67dd54
...
...
@@ -925,7 +925,7 @@ LITE_OS_SEC_TEXT UINT32 LOS_TaskDelay(UINT32 tick)
}
SCHEDULER_LOCK
(
intSave
);
OsSchedDelay
(
runTask
,
tick
);
OsSchedDelay
(
runTask
,
OS_SCHED_TICK_TO_CYCLE
(
tick
)
);
OsHookCall
(
LOS_HOOK_TYPE_MOVEDTASKTODELAYEDLIST
,
runTask
);
SCHEDULER_UNLOCK
(
intSave
);
...
...
kernel/base/include/los_sched_pri.h
浏览文件 @
cb67dd54
...
...
@@ -48,6 +48,7 @@
#ifdef LOSCFG_KERNEL_LITEIPC
#include "hm_liteipc.h"
#endif
#include "los_mp.h"
#ifdef __cplusplus
#if __cplusplus
...
...
@@ -55,9 +56,11 @@ extern "C" {
#endif
/* __cplusplus */
#endif
/* __cplusplus */
#define OS_SCHED_MINI_PERIOD (OS_SYS_CLOCK / LOSCFG_BASE_CORE_TICK_PER_SECOND_MINI)
#define OS_TICK_RESPONSE_PRECISION (UINT32)((OS_SCHED_MINI_PERIOD * 75) / 100)
#define OS_SCHED_MAX_RESPONSE_TIME (UINT64)(((UINT64)-1) - 1U)
#define OS_SCHED_MINI_PERIOD (OS_SYS_CLOCK / LOSCFG_BASE_CORE_TICK_PER_SECOND_MINI)
#define OS_TICK_RESPONSE_PRECISION (UINT32)((OS_SCHED_MINI_PERIOD * 75) / 100)
#define OS_SCHED_MAX_RESPONSE_TIME OS_SORT_LINK_INVALID_TIME
#define OS_SCHED_TICK_TO_CYCLE(ticks) ((UINT64)ticks * OS_CYCLE_PER_TICK)
#define AFFI_MASK_TO_CPUID(mask) ((UINT16)((mask) - 1))
extern
UINT32
g_taskScheduled
;
#define OS_SCHEDULER_ACTIVE (g_taskScheduled & (1U << ArchCurrCpuid()))
...
...
@@ -78,18 +81,17 @@ typedef enum {
typedef
struct
{
SortLinkAttribute
taskSortLink
;
/* task sort link */
SortLinkAttribute
swtmrSortLink
;
/* swtmr sort link */
UINT64
responseTime
;
/* Response time for current CPU tick interrupts */
UINT32
responseID
;
/* The response ID of the current CPU tick interrupt */
UINT32
idleTaskID
;
/* idle task id */
UINT32
taskLockCnt
;
/* task lock flag */
UINT32
swtmrTaskID
;
/* software timer task id */
UINT32
swtmrHandlerQueue
;
/* software timer timeout queue id */
UINT32
schedFlag
;
/* pending scheduler flag */
}
SchedRunQue
;
extern
SchedRunQue
g_schedRunQue
[
LOSCFG_KERNEL_CORE_NUM
];
VOID
OsSchedUpdateExpireTime
(
VOID
);
STATIC
INLINE
SchedRunQue
*
OsSchedRunQue
(
VOID
)
{
return
&
g_schedRunQue
[
ArchCurrCpuid
()];
...
...
@@ -190,75 +192,8 @@ STATIC INLINE VOID OsSchedRunQuePendingSet(VOID)
OsSchedRunQue
()
->
schedFlag
|=
INT_PEND_RESCH
;
}
#ifdef LOSCFG_KERNEL_SMP
STATIC
INLINE
VOID
FindIdleRunQue
(
UINT16
*
idleCpuID
)
{
SchedRunQue
*
idleRq
=
OsSchedRunQueByID
(
0
);
UINT32
nodeNum
=
OsGetSortLinkNodeNum
(
&
idleRq
->
taskSortLink
)
+
OsGetSortLinkNodeNum
(
&
idleRq
->
swtmrSortLink
);
UINT16
cpuID
=
1
;
do
{
SchedRunQue
*
rq
=
OsSchedRunQueByID
(
cpuID
);
UINT32
temp
=
OsGetSortLinkNodeNum
(
&
rq
->
taskSortLink
)
+
OsGetSortLinkNodeNum
(
&
rq
->
swtmrSortLink
);
if
(
nodeNum
>
temp
)
{
*
idleCpuID
=
cpuID
;
nodeNum
=
temp
;
}
cpuID
++
;
}
while
(
cpuID
<
LOSCFG_KERNEL_CORE_NUM
);
}
#endif
STATIC
INLINE
VOID
OsSchedAddTask2TimeList
(
SortLinkList
*
node
,
UINT64
startTime
,
UINT32
waitTicks
)
{
UINT16
idleCpu
=
0
;
#ifdef LOSCFG_KERNEL_SMP
FindIdleRunQue
(
&
idleCpu
);
#endif
SchedRunQue
*
rq
=
OsSchedRunQueByID
(
idleCpu
);
UINT64
responseTime
=
startTime
+
(
UINT64
)
waitTicks
*
OS_CYCLE_PER_TICK
;
OsAdd2SortLink
(
&
rq
->
taskSortLink
,
node
,
responseTime
,
idleCpu
);
}
STATIC
INLINE
UINT32
OsSchedSwtmrHandlerQueueGet
(
VOID
)
{
return
OsSchedRunQue
()
->
swtmrHandlerQueue
;
}
STATIC
INLINE
VOID
OsSchedDeTaskFromTimeList
(
SortLinkList
*
node
)
{
#ifdef LOSCFG_KERNEL_SMP
SchedRunQue
*
rq
=
OsSchedRunQueByID
(
node
->
cpuid
);
#else
SchedRunQue
*
rq
=
OsSchedRunQueByID
(
0
);
#endif
OsDeleteFromSortLink
(
&
rq
->
taskSortLink
,
node
);
}
STATIC
INLINE
VOID
OsSchedAddSwtmr2TimeList
(
SortLinkList
*
node
,
UINT64
startTime
,
UINT32
waitTicks
)
{
UINT16
idleCpu
=
0
;
#ifdef LOSCFG_KERNEL_SMP
FindIdleRunQue
(
&
idleCpu
);
#endif
SchedRunQue
*
rq
=
OsSchedRunQueByID
(
idleCpu
);
UINT64
responseTime
=
startTime
+
(
UINT64
)
waitTicks
*
OS_CYCLE_PER_TICK
;
OsAdd2SortLink
(
&
rq
->
swtmrSortLink
,
node
,
responseTime
,
idleCpu
);
}
STATIC
INLINE
VOID
OsSchedDeSwtmrFromTimeList
(
SortLinkList
*
node
)
{
#ifdef LOSCFG_KERNEL_SMP
SchedRunQue
*
rq
=
OsSchedRunQueByID
(
node
->
cpuid
);
#else
SchedRunQue
*
rq
=
OsSchedRunQueByID
(
0
);
#endif
OsDeleteFromSortLink
(
&
rq
->
swtmrSortLink
,
node
);
}
VOID
OsSchedRunQueIdleInit
(
UINT32
idleTaskID
);
VOID
OsSchedRunQueSwtmrInit
(
UINT32
swtmrTaskID
,
UINT32
swtmrQueue
);
VOID
OsSchedRunQueInit
(
VOID
);
BOOL
OsSchedSwtmrTimeListFind
(
SCHED_TL_FIND_FUNC
checkFunc
,
UINTPTR
arg
);
/**
* @ingroup los_sched
...
...
@@ -359,11 +294,11 @@ typedef struct {
UINT16
priority
;
/**< Task priority */
UINT16
policy
;
UINT64
startTime
;
/**< The start time of each phase of task */
UINT64
waitTime
;
/**< Task delay time, tick number */
UINT64
irqStartTime
;
/**< Interrupt start time */
UINT32
irqUsedTime
;
/**< Interrupt consumption time */
UINT32
initTimeSlice
;
/**< Task init time slice */
INT32
timeSlice
;
/**< Task remaining time slice */
UINT32
waitTimes
;
/**< Task delay time, tick number */
SortLinkList
sortList
;
/**< Task sortlink node */
UINT32
stackSize
;
/**< Task stack size */
...
...
@@ -480,6 +415,78 @@ STATIC INLINE VOID OsSchedIrqStartTime(VOID)
runTask
->
irqStartTime
=
OsGetCurrSchedTimeCycle
();
}
#ifdef LOSCFG_KERNEL_SMP
STATIC
INLINE
VOID
FindIdleRunQue
(
UINT16
*
idleCpuid
)
{
SchedRunQue
*
idleRq
=
OsSchedRunQueByID
(
0
);
UINT32
nodeNum
=
OsGetSortLinkNodeNum
(
&
idleRq
->
taskSortLink
);
UINT16
cpuid
=
1
;
do
{
SchedRunQue
*
rq
=
OsSchedRunQueByID
(
cpuid
);
UINT32
temp
=
OsGetSortLinkNodeNum
(
&
rq
->
taskSortLink
);
if
(
nodeNum
>
temp
)
{
*
idleCpuid
=
cpuid
;
nodeNum
=
temp
;
}
cpuid
++
;
}
while
(
cpuid
<
LOSCFG_KERNEL_CORE_NUM
);
}
#endif
STATIC
INLINE
VOID
OsSchedAddTask2TimeList
(
LosTaskCB
*
taskCB
,
UINT64
responseTime
)
{
#ifdef LOSCFG_KERNEL_SMP
UINT16
cpuid
=
AFFI_MASK_TO_CPUID
(
taskCB
->
cpuAffiMask
);
if
(
cpuid
>=
LOSCFG_KERNEL_CORE_NUM
)
{
cpuid
=
0
;
FindIdleRunQue
(
&
cpuid
);
}
#else
UINT16
cpuid
=
0
;
#endif
SchedRunQue
*
rq
=
OsSchedRunQueByID
(
cpuid
);
OsAdd2SortLink
(
&
rq
->
taskSortLink
,
&
taskCB
->
sortList
,
responseTime
,
cpuid
);
#ifdef LOSCFG_KERNEL_SMP
if
((
cpuid
!=
ArchCurrCpuid
())
&&
(
responseTime
<
rq
->
responseTime
))
{
rq
->
schedFlag
|=
INT_PEND_TICK
;
LOS_MpSchedule
(
CPUID_TO_AFFI_MASK
(
cpuid
));
}
#endif
}
STATIC
INLINE
VOID
OsSchedDeTaskFromTimeList
(
LosTaskCB
*
taskCB
)
{
SortLinkList
*
node
=
&
taskCB
->
sortList
;
#ifdef LOSCFG_KERNEL_SMP
SchedRunQue
*
rq
=
OsSchedRunQueByID
(
node
->
cpuid
);
#else
SchedRunQue
*
rq
=
OsSchedRunQueByID
(
0
);
#endif
UINT64
oldResponseTime
=
GET_SORTLIST_VALUE
(
node
);
OsDeleteFromSortLink
(
&
rq
->
taskSortLink
,
node
);
if
(
oldResponseTime
<=
rq
->
responseTime
)
{
rq
->
responseTime
=
OS_SCHED_MAX_RESPONSE_TIME
;
}
}
STATIC
INLINE
UINT32
OsSchedAdjustTaskFromTimeList
(
LosTaskCB
*
taskCB
,
UINT64
responseTime
)
{
UINT32
ret
;
SortLinkList
*
node
=
&
taskCB
->
sortList
;
#ifdef LOSCFG_KERNEL_SMP
UINT16
cpuid
=
node
->
cpuid
;
#else
UINT16
cpuid
=
0
;
#endif
SchedRunQue
*
rq
=
OsSchedRunQueByID
(
cpuid
);
ret
=
OsSortLinkAdjustNodeResponseTime
(
&
rq
->
taskSortLink
,
node
,
responseTime
);
if
(
ret
==
LOS_OK
)
{
rq
->
schedFlag
|=
INT_PEND_TICK
;
}
return
ret
;
}
/*
* Schedule flag, one bit represents one core.
* This flag is used to prevent kernel scheduling before OSStartToRun.
...
...
@@ -494,7 +501,6 @@ STATIC INLINE VOID OsSchedIrqStartTime(VOID)
VOID
OsSchedSetIdleTaskSchedParam
(
LosTaskCB
*
idleTask
);
VOID
OsSchedResetSchedResponseTime
(
UINT64
responseTime
);
VOID
OsSchedUpdateExpireTime
(
VOID
);
VOID
OsSchedToUserReleaseLock
(
VOID
);
VOID
OsSchedTaskDeQueue
(
LosTaskCB
*
taskCB
);
VOID
OsSchedTaskEnQueue
(
LosTaskCB
*
taskCB
);
...
...
@@ -504,7 +510,7 @@ BOOL OsSchedModifyTaskSchedParam(LosTaskCB *taskCB, UINT16 policy, UINT16 priori
BOOL
OsSchedModifyProcessSchedParam
(
UINT32
pid
,
UINT16
policy
,
UINT16
priority
);
VOID
OsSchedSuspend
(
LosTaskCB
*
taskCB
);
BOOL
OsSchedResume
(
LosTaskCB
*
taskCB
);
VOID
OsSchedDelay
(
LosTaskCB
*
runTask
,
UINT
32
tick
);
VOID
OsSchedDelay
(
LosTaskCB
*
runTask
,
UINT
64
waitTime
);
VOID
OsSchedYield
(
VOID
);
VOID
OsSchedTaskExit
(
LosTaskCB
*
taskCB
);
VOID
OsSchedTick
(
VOID
);
...
...
@@ -525,14 +531,13 @@ VOID OsSchedIrqEndCheckNeedSched(VOID);
*/
LOS_DL_LIST
*
OsSchedLockPendFindPos
(
const
LosTaskCB
*
runTask
,
LOS_DL_LIST
*
lockList
);
#ifdef LOSCFG_SCHED_DEBUG
#ifdef LOSCFG_SCHED_TICK_DEBUG
VOID
OsSchedDebugRecordData
(
VOID
);
#endif
UINT32
OsShellShowTickRespo
(
VOID
);
UINT32
OsShellShowSchedParam
(
VOID
);
#endif
#ifdef __cplusplus
#if __cplusplus
}
...
...
kernel/base/include/los_sortlink_pri.h
浏览文件 @
cb67dd54
...
...
@@ -72,28 +72,42 @@ STATIC INLINE UINT64 OsGetSortLinkNextExpireTime(SortLinkAttribute *sortHeader,
LOS_DL_LIST
*
head
=
&
sortHeader
->
sortLink
;
LOS_DL_LIST
*
list
=
head
->
pstNext
;
LOS_SpinLock
(
&
sortHeader
->
spinLock
);
if
(
LOS_ListEmpty
(
head
))
{
LOS_SpinUnlock
(
&
sortHeader
->
spinLock
);
return
OS_SORT_LINK_INVALID_TIME
-
tickPrecision
;
}
SortLinkList
*
listSorted
=
LOS_DL_LIST_ENTRY
(
list
,
SortLinkList
,
sortLinkNode
);
if
(
listSorted
->
responseTime
<=
(
startTime
+
tickPrecision
))
{
LOS_SpinUnlock
(
&
sortHeader
->
spinLock
);
return
startTime
+
tickPrecision
;
}
LOS_SpinUnlock
(
&
sortHeader
->
spinLock
);
return
listSorted
->
responseTime
;
}
STATIC
INLINE
UINT32
OsGetSortLinkNodeNum
(
SortLinkAttribute
*
head
)
STATIC
INLINE
UINT32
OsGetSortLinkNodeNum
(
const
SortLinkAttribute
*
head
)
{
return
head
->
nodeNum
;
}
STATIC
INLINE
UINT16
OsGetSortLinkNodeCpuid
(
const
SortLinkList
*
node
)
{
#ifdef LOSCFG_KERNEL_SMP
return
node
->
cpuid
;
#else
return
0
;
#endif
}
VOID
OsSortLinkInit
(
SortLinkAttribute
*
sortLinkHeader
);
VOID
OsAdd2SortLink
(
SortLinkAttribute
*
head
,
SortLinkList
*
node
,
UINT64
responseTime
,
UINT16
idleCpu
);
VOID
OsDeleteFromSortLink
(
SortLinkAttribute
*
head
,
SortLinkList
*
node
);
UINT64
OsSortLinkGetTargetExpireTime
(
UINT64
currTime
,
const
SortLinkList
*
targetSortList
);
UINT64
OsSortLinkGetNextExpireTime
(
UINT64
currTime
,
const
SortLinkAttribute
*
sortLinkHeader
);
UINT32
OsSortLinkAdjustNodeResponseTime
(
SortLinkAttribute
*
head
,
SortLinkList
*
node
,
UINT64
responseTime
);
#ifdef __cplusplus
#if __cplusplus
...
...
kernel/base/include/los_swtmr_pri.h
浏览文件 @
cb67dd54
...
...
@@ -66,8 +66,9 @@ typedef struct {
SWTMR_PROC_FUNC
handler
;
/**< Callback function that handles software timer timeout */
UINTPTR
arg
;
/**< Parameter passed in when the callback function
that handles software timer timeout is called */
LOS_DL_LIST
node
;
#ifdef LOSCFG_SWTMR_DEBUG
UINT32
swtmrI
d
;
UINT32
swtmrI
D
;
#endif
}
SwtmrHandlerItem
;
...
...
@@ -103,29 +104,35 @@ extern SWTMR_CTRL_S *g_swtmrCBArray;
* @see LOS_SwtmrStop
*/
extern
UINT32
OsSwtmrGetNextTimeout
(
VOID
);
extern
BOOL
OsIsSwtmrTask
(
const
LosTaskCB
*
taskCB
);
extern
VOID
OsSwtmrRestart
(
UINT64
startTime
,
SortLinkList
*
sortList
);
extern
VOID
OsSwtmrWake
(
SchedRunQue
*
rq
,
UINT64
currTime
,
SortLinkList
*
sortList
);
extern
VOID
OsSwtmrResponseTimeReset
(
UINT64
startTime
);
extern
UINT32
OsSwtmrInit
(
VOID
);
extern
VOID
OsSwtmrRecycle
(
UINT32
processID
);
extern
BOOL
OsSwtmrWorkQueueFind
(
SCHED_TL_FIND_FUNC
checkFunc
,
UINTPTR
arg
);
extern
SPIN_LOCK_S
g_swtmrSpin
;
extern
UINT32
OsSwtmrTaskIDGetByCpuid
(
UINT16
cpuid
);
#ifdef LOSCFG_SWTMR_DEBUG
typedef
struct
{
UINT64
startTime
;
UINT64
waitTimeMax
;
UINT64
waitTime
;
UINT64
waitCount
;
UINT64
readyStartTime
;
UINT64
readyTime
;
UINT64
readyTimeMax
;
UINT64
runTime
;
UINT64
runTimeMax
;
UINT64
runCount
;
UINT64
startTime
;
UINT64
waitTimeMax
;
UINT64
waitTime
;
UINT64
waitCount
;
UINT64
readyStartTime
;
UINT64
readyTime
;
UINT64
readyTimeMax
;
UINT64
runTime
;
UINT64
runTimeMax
;
UINT64
runCount
;
UINT32
times
;
}
SwtmrDebugBase
;
typedef
struct
{
SwtmrDebugBase
base
;
SWTMR_PROC_FUNC
handler
;
UINT32
period
;
UINT32
cpu
I
d
;
UINT32
cpu
i
d
;
BOOL
swtmrUsed
;
}
SwtmrDebugData
;
...
...
kernel/base/misc/swtmr_shellcmd.c
浏览文件 @
cb67dd54
...
...
@@ -116,8 +116,8 @@ STATIC VOID OsSwtmrTimeInfoShow(VOID)
UINT8
mode
;
SwtmrDebugData
data
;
PRINTK
(
"SwtmrID Cpu
I
d Mode Period(us) WaitTime(us) WaitMax(us) RTime(us) RTimeMax(us) ReTime(us)"
" ReTimeMax(us) RunCount Handler
\n
"
);
PRINTK
(
"SwtmrID Cpu
i
d Mode Period(us) WaitTime(us) WaitMax(us) RTime(us) RTimeMax(us) ReTime(us)"
" ReTimeMax(us) RunCount
LostNum
Handler
\n
"
);
for
(
UINT32
index
=
0
;
index
<
LOSCFG_BASE_CORE_SWTMR_LIMIT
;
index
++
)
{
if
(
!
OsSwtmrDebugDataUsed
(
index
))
{
continue
;
...
...
@@ -128,15 +128,16 @@ STATIC VOID OsSwtmrTimeInfoShow(VOID)
break
;
}
UINT64
waitTime
=
((
data
.
waitTime
/
data
.
waitCount
)
*
OS_NS_PER_CYCLE
)
/
OS_SYS_NS_PER_US
;
UINT64
waitTimeMax
=
(
data
.
waitTimeMax
*
OS_NS_PER_CYCLE
)
/
OS_SYS_NS_PER_US
;
UINT64
runTime
=
((
data
.
runTime
/
data
.
runCount
)
*
OS_NS_PER_CYCLE
)
/
OS_SYS_NS_PER_US
;
UINT64
runTimeMax
=
(
data
.
runTimeMax
*
OS_NS_PER_CYCLE
)
/
OS_SYS_NS_PER_US
;
UINT64
readyTime
=
((
data
.
readyTime
/
data
.
runCount
)
*
OS_NS_PER_CYCLE
)
/
OS_SYS_NS_PER_US
;
UINT64
readyTimeMax
=
(
data
.
readyTimeMax
*
OS_NS_PER_CYCLE
)
/
OS_SYS_NS_PER_US
;
PRINTK
(
"%4u%10u%7s%14u%13llu%12llu%10llu%13llu%10llu%14llu%15llu%#12x
\n
"
,
index
,
data
.
cpuId
,
g_shellSwtmrMode
[
mode
],
data
.
period
*
OS_US_PER_TICK
,
waitTime
,
waitTimeMax
,
runTime
,
runTimeMax
,
readyTime
,
readyTimeMax
,
data
.
runCount
,
data
.
handler
);
SwtmrDebugBase
*
base
=
&
data
.
base
;
UINT64
waitTime
=
((
base
->
waitTime
/
base
->
waitCount
)
*
OS_NS_PER_CYCLE
)
/
OS_SYS_NS_PER_US
;
UINT64
waitTimeMax
=
(
base
->
waitTimeMax
*
OS_NS_PER_CYCLE
)
/
OS_SYS_NS_PER_US
;
UINT64
runTime
=
((
base
->
runTime
/
base
->
runCount
)
*
OS_NS_PER_CYCLE
)
/
OS_SYS_NS_PER_US
;
UINT64
runTimeMax
=
(
base
->
runTimeMax
*
OS_NS_PER_CYCLE
)
/
OS_SYS_NS_PER_US
;
UINT64
readyTime
=
((
base
->
readyTime
/
base
->
runCount
)
*
OS_NS_PER_CYCLE
)
/
OS_SYS_NS_PER_US
;
UINT64
readyTimeMax
=
(
base
->
readyTimeMax
*
OS_NS_PER_CYCLE
)
/
OS_SYS_NS_PER_US
;
PRINTK
(
"%4u%10u%7s%14u%13llu%12llu%10llu%13llu%10llu%14llu%15llu%11u%#12x
\n
"
,
index
,
data
.
cpuid
,
g_shellSwtmrMode
[
mode
],
data
.
period
*
OS_US_PER_TICK
,
waitTime
,
waitTimeMax
,
runTime
,
runTimeMax
,
readyTime
,
readyTimeMax
,
base
->
runCount
,
base
->
times
,
data
.
handler
);
}
}
#endif
...
...
kernel/base/sched/sched_sq/los_sched.c
浏览文件 @
cb67dd54
...
...
@@ -59,7 +59,6 @@
#define OS_SCHED_TIME_SLICES_DIFF (OS_SCHED_TIME_SLICES_MAX - OS_SCHED_TIME_SLICES_MIN)
#define OS_SCHED_READY_MAX 30
#define OS_TIME_SLICE_MIN (INT32)((50 * OS_SYS_NS_PER_US) / OS_NS_PER_CYCLE)
/* 50us */
#define OS_TASK_STATUS_BLOCKED (OS_TASK_STATUS_INIT | OS_TASK_STATUS_PENDING | \
OS_TASK_STATUS_DELAY | OS_TASK_STATUS_PEND_TIME)
...
...
@@ -133,7 +132,7 @@ UINT32 OsShellShowTickRespo(VOID)
(
VOID
)
memset_s
((
CHAR
*
)
OsSchedDebugGet
(),
tickSize
,
0
,
tickSize
);
for
(
cpu
=
0
;
cpu
<
LOSCFG_KERNEL_CORE_NUM
;
cpu
++
)
{
SchedRunQue
*
rq
=
OsSchedRunQueByID
(
cpu
);
sortLinkNum
[
cpu
]
=
OsGetSortLinkNodeNum
(
&
rq
->
taskSortLink
)
+
OsGetSortLinkNodeNum
(
&
rq
->
swtmrSortLink
)
;
sortLinkNum
[
cpu
]
=
OsGetSortLinkNodeNum
(
&
rq
->
taskSortLink
);
}
SCHEDULER_UNLOCK
(
intSave
);
...
...
@@ -159,13 +158,6 @@ UINT32 OsShellShowTickRespo(VOID)
(
VOID
)
LOS_MemFree
(
m_aucSysMem1
,
schedDebug
);
return
LOS_OK
;
}
#else
UINT32
OsShellShowTickRespo
(
VOID
)
{
return
LOS_NOK
;
}
#endif
#ifdef LOSCFG_SCHED_DEBUG
...
...
@@ -175,6 +167,7 @@ UINT32 OsShellShowSchedParam(VOID)
UINT64
averTimeSlice
;
UINT64
averSchedWait
;
UINT64
averPendTime
;
UINT32
taskLinkNum
[
LOSCFG_KERNEL_CORE_NUM
];
UINT32
intSave
;
UINT32
size
=
g_taskMaxNum
*
sizeof
(
LosTaskCB
);
LosTaskCB
*
taskCBArray
=
LOS_MemAlloc
(
m_aucSysMem1
,
size
);
...
...
@@ -184,7 +177,16 @@ UINT32 OsShellShowSchedParam(VOID)
SCHEDULER_LOCK
(
intSave
);
(
VOID
)
memcpy_s
(
taskCBArray
,
size
,
g_taskCBArray
,
size
);
for
(
UINT16
cpu
=
0
;
cpu
<
LOSCFG_KERNEL_CORE_NUM
;
cpu
++
)
{
SchedRunQue
*
rq
=
OsSchedRunQueByID
(
cpu
);
taskLinkNum
[
cpu
]
=
OsGetSortLinkNodeNum
(
&
rq
->
taskSortLink
);
}
SCHEDULER_UNLOCK
(
intSave
);
for
(
UINT16
cpu
=
0
;
cpu
<
LOSCFG_KERNEL_CORE_NUM
;
cpu
++
)
{
PRINTK
(
"cpu: %u Task SortMax: %u
\n
"
,
cpu
,
taskLinkNum
[
cpu
]);
}
PRINTK
(
" Tid AverRunTime(us) SwitchCount AverTimeSlice(us) TimeSliceCount AverReadyWait(us) "
"AverPendTime(us) TaskName
\n
"
);
for
(
UINT32
tid
=
0
;
tid
<
g_taskMaxNum
;
tid
++
)
{
...
...
@@ -228,13 +230,6 @@ UINT32 OsShellShowSchedParam(VOID)
return
LOS_OK
;
}
#else
UINT32
OsShellShowSchedParam
(
VOID
)
{
return
LOS_NOK
;
}
#endif
STATIC
INLINE
VOID
TimeSliceUpdate
(
LosTaskCB
*
taskCB
,
UINT64
currTime
)
...
...
@@ -259,28 +254,12 @@ STATIC INLINE VOID TimeSliceUpdate(LosTaskCB *taskCB, UINT64 currTime)
#endif
}
STATIC
INLINE
UINT64
GetNextExpireTime
(
SchedRunQue
*
rq
,
UINT64
startTime
,
UINT32
tickPrecision
)
{
SortLinkAttribute
*
taskHeader
=
&
rq
->
taskSortLink
;
SortLinkAttribute
*
swtmrHeader
=
&
rq
->
swtmrSortLink
;
LOS_SpinLock
(
&
taskHeader
->
spinLock
);
UINT64
taskExpireTime
=
OsGetSortLinkNextExpireTime
(
taskHeader
,
startTime
,
tickPrecision
);
LOS_SpinUnlock
(
&
taskHeader
->
spinLock
);
LOS_SpinLock
(
&
swtmrHeader
->
spinLock
);
UINT64
swtmrExpireTime
=
OsGetSortLinkNextExpireTime
(
swtmrHeader
,
startTime
,
tickPrecision
);
LOS_SpinUnlock
(
&
swtmrHeader
->
spinLock
);
return
(
taskExpireTime
<
swtmrExpireTime
)
?
taskExpireTime
:
swtmrExpireTime
;
}
STATIC
INLINE
VOID
SchedSetNextExpireTime
(
UINT32
responseID
,
UINT64
taskEndTime
,
UINT32
oldResponseID
)
{
SchedRunQue
*
rq
=
OsSchedRunQue
();
BOOL
isTimeSlice
=
FALSE
;
UINT64
currTime
=
OsGetCurrSchedTimeCycle
();
UINT64
nextExpireTime
=
GetNextExpireTime
(
rq
,
currTime
,
OS_TICK_RESPONSE_PRECISION
);
UINT64
nextExpireTime
=
OsGetSortLinkNextExpireTime
(
&
rq
->
taskSortLink
,
currTime
,
OS_TICK_RESPONSE_PRECISION
);
rq
->
schedFlag
&=
~
INT_PEND_TICK
;
if
(
rq
->
responseID
==
oldResponseID
)
{
...
...
@@ -496,7 +475,7 @@ VOID OsSchedTaskExit(LosTaskCB *taskCB)
}
if
(
taskCB
->
taskStatus
&
(
OS_TASK_STATUS_DELAY
|
OS_TASK_STATUS_PEND_TIME
))
{
OsSchedDeTaskFromTimeList
(
&
taskCB
->
sortList
);
OsSchedDeTaskFromTimeList
(
taskCB
);
taskCB
->
taskStatus
&=
~
(
OS_TASK_STATUS_DELAY
|
OS_TASK_STATUS_PEND_TIME
);
}
}
...
...
@@ -512,11 +491,10 @@ VOID OsSchedYield(VOID)
OsSchedResched
();
}
VOID
OsSchedDelay
(
LosTaskCB
*
runTask
,
UINT
32
tick
)
VOID
OsSchedDelay
(
LosTaskCB
*
runTask
,
UINT
64
waitTime
)
{
OsSchedTaskDeQueue
(
runTask
);
runTask
->
taskStatus
|=
OS_TASK_STATUS_DELAY
;
runTask
->
waitTime
s
=
tick
;
runTask
->
waitTime
=
waitTime
;
OsSchedResched
();
}
...
...
@@ -530,7 +508,7 @@ UINT32 OsSchedTaskWait(LOS_DL_LIST *list, UINT32 ticks, BOOL needSched)
if
(
ticks
!=
LOS_WAIT_FOREVER
)
{
runTask
->
taskStatus
|=
OS_TASK_STATUS_PEND_TIME
;
runTask
->
waitTime
s
=
ticks
;
runTask
->
waitTime
=
OS_SCHED_TICK_TO_CYCLE
(
ticks
)
;
}
if
(
needSched
==
TRUE
)
{
...
...
@@ -550,7 +528,7 @@ VOID OsSchedTaskWake(LosTaskCB *resumedTask)
resumedTask
->
taskStatus
&=
~
OS_TASK_STATUS_PENDING
;
if
(
resumedTask
->
taskStatus
&
OS_TASK_STATUS_PEND_TIME
)
{
OsSchedDeTaskFromTimeList
(
&
resumedTask
->
sortList
);
OsSchedDeTaskFromTimeList
(
resumedTask
);
resumedTask
->
taskStatus
&=
~
OS_TASK_STATUS_PEND_TIME
;
}
...
...
@@ -625,7 +603,7 @@ STATIC VOID SchedFreezeTask(LosTaskCB *taskCB)
}
responseTime
=
GET_SORTLIST_VALUE
(
&
taskCB
->
sortList
);
OsSchedDeTaskFromTimeList
(
&
taskCB
->
sortList
);
OsSchedDeTaskFromTimeList
(
taskCB
);
SET_SORTLIST_VALUE
(
&
taskCB
->
sortList
,
responseTime
);
taskCB
->
taskStatus
|=
OS_TASK_FLAG_FREEZE
;
return
;
...
...
@@ -634,7 +612,6 @@ STATIC VOID SchedFreezeTask(LosTaskCB *taskCB)
STATIC
VOID
SchedUnfreezeTask
(
LosTaskCB
*
taskCB
)
{
UINT64
currTime
,
responseTime
;
UINT32
remainTick
;
if
(
!
(
taskCB
->
taskStatus
&
OS_TASK_FLAG_FREEZE
))
{
return
;
...
...
@@ -644,8 +621,7 @@ STATIC VOID SchedUnfreezeTask(LosTaskCB *taskCB)
currTime
=
OsGetCurrSchedTimeCycle
();
responseTime
=
GET_SORTLIST_VALUE
(
&
taskCB
->
sortList
);
if
(
responseTime
>
currTime
)
{
remainTick
=
((
responseTime
-
currTime
)
+
OS_CYCLE_PER_TICK
-
1
)
/
OS_CYCLE_PER_TICK
;
OsSchedAddTask2TimeList
(
&
taskCB
->
sortList
,
currTime
,
remainTick
);
OsSchedAddTask2TimeList
(
taskCB
,
responseTime
);
return
;
}
...
...
@@ -687,97 +663,6 @@ BOOL OsSchedResume(LosTaskCB *taskCB)
return
needSched
;
}
STATIC
INLINE
BOOL
SchedScanSwtmrTimeList
(
SchedRunQue
*
rq
)
{
BOOL
needSched
=
FALSE
;
SortLinkAttribute
*
swtmrSortLink
=
&
rq
->
swtmrSortLink
;
LOS_DL_LIST
*
listObject
=
&
swtmrSortLink
->
sortLink
;
/*
* it needs to be carefully coped with, since the swtmr is in specific sortlink
* while other cores still has the chance to process it, like stop the timer.
*/
LOS_SpinLock
(
&
swtmrSortLink
->
spinLock
);
if
(
LOS_ListEmpty
(
listObject
))
{
LOS_SpinUnlock
(
&
swtmrSortLink
->
spinLock
);
return
FALSE
;
}
SortLinkList
*
sortList
=
LOS_DL_LIST_ENTRY
(
listObject
->
pstNext
,
SortLinkList
,
sortLinkNode
);
UINT64
currTime
=
OsGetCurrSchedTimeCycle
();
while
(
sortList
->
responseTime
<=
currTime
)
{
sortList
=
LOS_DL_LIST_ENTRY
(
listObject
->
pstNext
,
SortLinkList
,
sortLinkNode
);
UINT64
startTime
=
GET_SORTLIST_VALUE
(
sortList
);
OsDeleteNodeSortLink
(
swtmrSortLink
,
sortList
);
LOS_SpinUnlock
(
&
swtmrSortLink
->
spinLock
);
OsSwtmrWake
(
rq
,
startTime
,
sortList
);
needSched
=
TRUE
;
LOS_SpinLock
(
&
swtmrSortLink
->
spinLock
);
if
(
LOS_ListEmpty
(
listObject
))
{
break
;
}
sortList
=
LOS_DL_LIST_ENTRY
(
listObject
->
pstNext
,
SortLinkList
,
sortLinkNode
);
}
LOS_SpinUnlock
(
&
swtmrSortLink
->
spinLock
);
return
needSched
;
}
STATIC
INLINE
VOID
SchedSwtmrResponseTimeReset
(
SchedRunQue
*
rq
,
UINT64
startTime
)
{
SortLinkAttribute
*
swtmrSortLink
=
&
rq
->
swtmrSortLink
;
LOS_DL_LIST
*
listHead
=
&
swtmrSortLink
->
sortLink
;
LOS_DL_LIST
*
listNext
=
listHead
->
pstNext
;
LOS_SpinLock
(
&
swtmrSortLink
->
spinLock
);
while
(
listNext
!=
listHead
)
{
SortLinkList
*
sortList
=
LOS_DL_LIST_ENTRY
(
listNext
,
SortLinkList
,
sortLinkNode
);
OsDeleteNodeSortLink
(
swtmrSortLink
,
sortList
);
LOS_SpinUnlock
(
&
swtmrSortLink
->
spinLock
);
OsSwtmrRestart
(
startTime
,
sortList
);
LOS_SpinLock
(
&
swtmrSortLink
->
spinLock
);
listNext
=
listNext
->
pstNext
;
}
LOS_SpinUnlock
(
&
swtmrSortLink
->
spinLock
);
}
STATIC
INLINE
BOOL
SchedSwtmrRunQueFind
(
SortLinkAttribute
*
swtmrSortLink
,
SCHED_TL_FIND_FUNC
checkFunc
,
UINTPTR
arg
)
{
LOS_DL_LIST
*
listObject
=
&
swtmrSortLink
->
sortLink
;
LOS_DL_LIST
*
list
=
listObject
->
pstNext
;
LOS_SpinLock
(
&
swtmrSortLink
->
spinLock
);
while
(
list
!=
listObject
)
{
SortLinkList
*
listSorted
=
LOS_DL_LIST_ENTRY
(
list
,
SortLinkList
,
sortLinkNode
);
if
(
checkFunc
((
UINTPTR
)
listSorted
,
arg
))
{
LOS_SpinUnlock
(
&
swtmrSortLink
->
spinLock
);
return
TRUE
;
}
list
=
list
->
pstNext
;
}
LOS_SpinUnlock
(
&
swtmrSortLink
->
spinLock
);
return
FALSE
;
}
BOOL
OsSchedSwtmrTimeListFind
(
SCHED_TL_FIND_FUNC
checkFunc
,
UINTPTR
arg
)
{
for
(
UINT16
cpuid
=
0
;
cpuid
<
LOSCFG_KERNEL_CORE_NUM
;
cpuid
++
)
{
SchedRunQue
*
rq
=
OsSchedRunQueByID
(
cpuid
);
SortLinkAttribute
*
swtmrSortLink
=
&
rq
->
swtmrSortLink
;
if
(
SchedSwtmrRunQueFind
(
swtmrSortLink
,
checkFunc
,
arg
))
{
return
TRUE
;
}
}
return
FALSE
;
}
STATIC
INLINE
VOID
SchedWakePendTimeTask
(
UINT64
currTime
,
LosTaskCB
*
taskCB
,
BOOL
*
needSchedule
)
{
#ifndef LOSCFG_SCHED_DEBUG
...
...
@@ -853,14 +738,9 @@ STATIC INLINE BOOL SchedScanTaskTimeList(SchedRunQue *rq)
VOID
OsSchedTick
(
VOID
)
{
SchedRunQue
*
rq
=
OsSchedRunQue
();
BOOL
needSched
=
FALSE
;
if
(
rq
->
responseID
==
OS_INVALID_VALUE
)
{
needSched
|=
SchedScanSwtmrTimeList
(
rq
);
needSched
|=
SchedScanTaskTimeList
(
rq
);
if
(
needSched
)
{
if
(
SchedScanTaskTimeList
(
rq
))
{
LOS_MpSchedule
(
OS_MP_CPU_ALL
);
rq
->
schedFlag
|=
INT_PEND_RESCH
;
}
...
...
@@ -892,18 +772,10 @@ VOID OsSchedRunQueInit(VOID)
for
(
UINT16
index
=
0
;
index
<
LOSCFG_KERNEL_CORE_NUM
;
index
++
)
{
SchedRunQue
*
rq
=
OsSchedRunQueByID
(
index
);
OsSortLinkInit
(
&
rq
->
taskSortLink
);
OsSortLinkInit
(
&
rq
->
swtmrSortLink
);
rq
->
responseTime
=
OS_SCHED_MAX_RESPONSE_TIME
;
}
}
VOID
OsSchedRunQueSwtmrInit
(
UINT32
swtmrTaskID
,
UINT32
swtmrQueue
)
{
SchedRunQue
*
rq
=
OsSchedRunQue
();
rq
->
swtmrTaskID
=
swtmrTaskID
;
rq
->
swtmrHandlerQueue
=
swtmrQueue
;
}
VOID
OsSchedRunQueIdleInit
(
UINT32
idleTaskID
)
{
SchedRunQue
*
rq
=
OsSchedRunQue
();
...
...
@@ -975,9 +847,7 @@ VOID OsSchedStart(VOID)
SCHEDULER_LOCK
(
intSave
);
if
(
cpuid
==
0
)
{
OsTickStart
();
}
OsTickStart
();
SchedRunQue
*
rq
=
OsSchedRunQue
();
LosTaskCB
*
newTask
=
GetTopTask
(
rq
);
...
...
@@ -995,7 +865,7 @@ VOID OsSchedStart(VOID)
newTask
->
startTime
=
OsGetCurrSchedTimeCycle
();
SchedSwtmrResponseTimeReset
(
rq
,
newTask
->
startTime
);
OsSwtmrResponseTimeReset
(
newTask
->
startTime
);
/* System start schedule */
OS_SCHEDULER_SET
(
cpuid
);
...
...
@@ -1078,7 +948,7 @@ STATIC VOID SchedTaskSwitch(LosTaskCB *runTask, LosTaskCB *newTask)
TimeSliceUpdate
(
runTask
,
newTask
->
startTime
);
if
(
runTask
->
taskStatus
&
(
OS_TASK_STATUS_PEND_TIME
|
OS_TASK_STATUS_DELAY
))
{
OsSchedAddTask2TimeList
(
&
runTask
->
sortList
,
runTask
->
startTime
,
runTask
->
waitTimes
);
OsSchedAddTask2TimeList
(
runTask
,
runTask
->
startTime
+
runTask
->
waitTime
);
}
}
...
...
kernel/base/sched/sched_sq/los_sortlink.c
浏览文件 @
cb67dd54
...
...
@@ -82,21 +82,30 @@ VOID OsAdd2SortLink(SortLinkAttribute *head, SortLinkList *node, UINT64 response
node
->
cpuid
=
idleCpu
;
#endif
LOS_SpinUnlock
(
&
head
->
spinLock
);
}
#ifdef LOSCFG_KERNEL_SMP
if
(
idleCpu
!=
ArchCurrCpuid
())
{
LOS_MpSchedule
(
CPUID_TO_AFFI_MASK
(
idleCpu
));
VOID
OsDeleteFromSortLink
(
SortLinkAttribute
*
head
,
SortLinkList
*
node
)
{
LOS_SpinLock
(
&
head
->
spinLock
);
if
(
node
->
responseTime
!=
OS_SORT_LINK_INVALID_TIME
)
{
OsDeleteNodeSortLink
(
head
,
node
);
}
#endif
LOS_SpinUnlock
(
&
head
->
spinLock
);
}
VOID
OsDeleteFromSortLink
(
SortLinkAttribute
*
head
,
SortLinkList
*
nod
e
)
UINT32
OsSortLinkAdjustNodeResponseTime
(
SortLinkAttribute
*
head
,
SortLinkList
*
node
,
UINT64
responseTim
e
)
{
UINT32
ret
=
LOS_NOK
;
LOS_SpinLock
(
&
head
->
spinLock
);
if
(
node
->
responseTime
!=
OS_SORT_LINK_INVALID_TIME
)
{
OsDeleteNodeSortLink
(
head
,
node
);
SET_SORTLIST_VALUE
(
node
,
responseTime
);
AddNode2SortLink
(
head
,
node
);
ret
=
LOS_OK
;
}
LOS_SpinUnlock
(
&
head
->
spinLock
);
return
ret
;
}
UINT64
OsSortLinkGetTargetExpireTime
(
UINT64
currTime
,
const
SortLinkList
*
targetSortList
)
...
...
kernel/extended/cpup/los_cpup.c
浏览文件 @
cb67dd54
...
...
@@ -254,7 +254,7 @@ VOID OsCpupCycleEndStart(UINT32 runTaskID, UINT32 newTaskID)
OsCpupBase
*
newTaskCpup
=
(
OsCpupBase
*
)
&
(
OS_TCB_FROM_TID
(
newTaskID
)
->
taskCpup
);
OsCpupBase
*
processCpup
=
OS_PCB_FROM_PID
(
runTask
->
processID
)
->
processCpup
;
UINT64
cpuCycle
,
cycleIncrement
;
UINT16
cpu
ID
=
ArchCurrCpuid
();
UINT16
cpu
id
=
ArchCurrCpuid
();
if
(
cpupInitFlg
==
0
)
{
return
;
...
...
@@ -264,8 +264,8 @@ VOID OsCpupCycleEndStart(UINT32 runTaskID, UINT32 newTaskID)
if
(
runTaskCpup
->
startTime
!=
0
)
{
cycleIncrement
=
cpuCycle
-
runTaskCpup
->
startTime
;
#ifdef LOSCFG_CPUP_INCLUDE_IRQ
cycleIncrement
-=
timeInIrqSwitch
[
cpu
ID
];
timeInIrqSwitch
[
cpu
ID
]
=
0
;
cycleIncrement
-=
timeInIrqSwitch
[
cpu
id
];
timeInIrqSwitch
[
cpu
id
]
=
0
;
#endif
runTaskCpup
->
allTime
+=
cycleIncrement
;
if
(
processCpup
!=
NULL
)
{
...
...
@@ -275,7 +275,7 @@ VOID OsCpupCycleEndStart(UINT32 runTaskID, UINT32 newTaskID)
}
newTaskCpup
->
startTime
=
cpuCycle
;
runningTasks
[
cpu
ID
]
=
newTaskID
;
runningTasks
[
cpu
id
]
=
newTaskID
;
}
LITE_OS_SEC_TEXT_MINOR
STATIC
VOID
OsCpupGetPos
(
UINT16
mode
,
UINT16
*
curPosPointer
,
UINT16
*
prePosPointer
)
...
...
@@ -524,17 +524,17 @@ LITE_OS_SEC_TEXT_MINOR UINT32 OsGetAllProcessAndTaskCpuUsageUnsafe(UINT16 mode,
}
#ifdef LOSCFG_CPUP_INCLUDE_IRQ
LITE_OS_SEC_TEXT_MINOR
VOID
OsCpupIrqStart
(
UINT16
cpu
I
d
)
LITE_OS_SEC_TEXT_MINOR
VOID
OsCpupIrqStart
(
UINT16
cpu
i
d
)
{
UINT32
high
;
UINT32
low
;
LOS_GetCpuCycle
(
&
high
,
&
low
);
cpupIntTimeStart
[
cpu
I
d
]
=
((
UINT64
)
high
<<
HIGH_BITS
)
+
low
;
cpupIntTimeStart
[
cpu
i
d
]
=
((
UINT64
)
high
<<
HIGH_BITS
)
+
low
;
return
;
}
LITE_OS_SEC_TEXT_MINOR
VOID
OsCpupIrqEnd
(
UINT16
cpu
I
d
,
UINT32
intNum
)
LITE_OS_SEC_TEXT_MINOR
VOID
OsCpupIrqEnd
(
UINT16
cpu
i
d
,
UINT32
intNum
)
{
UINT32
high
;
UINT32
low
;
...
...
@@ -543,11 +543,11 @@ LITE_OS_SEC_TEXT_MINOR VOID OsCpupIrqEnd(UINT16 cpuId, UINT32 intNum)
LOS_GetCpuCycle
(
&
high
,
&
low
);
intTimeEnd
=
((
UINT64
)
high
<<
HIGH_BITS
)
+
low
;
OsIrqCpupCB
*
irqCb
=
&
g_irqCpup
[(
intNum
*
LOSCFG_KERNEL_CORE_NUM
)
+
cpu
I
d
];
OsIrqCpupCB
*
irqCb
=
&
g_irqCpup
[(
intNum
*
LOSCFG_KERNEL_CORE_NUM
)
+
cpu
i
d
];
irqCb
->
id
=
intNum
;
irqCb
->
status
=
OS_CPUP_USED
;
usedTime
=
intTimeEnd
-
cpupIntTimeStart
[
cpu
I
d
];
timeInIrqSwitch
[
cpu
I
d
]
+=
usedTime
;
usedTime
=
intTimeEnd
-
cpupIntTimeStart
[
cpu
i
d
];
timeInIrqSwitch
[
cpu
i
d
]
+=
usedTime
;
irqCb
->
cpup
.
allTime
+=
usedTime
;
if
(
irqCb
->
count
<=
100
)
{
/* Take 100 samples */
irqCb
->
allTime
+=
usedTime
;
...
...
kernel/extended/trace/los_trace.c
浏览文件 @
cb67dd54
...
...
@@ -101,7 +101,7 @@ STATIC VOID OsTraceSetFrame(TraceEventFrame *frame, UINT32 eventType, UINTPTR id
frame
->
eventType
=
eventType
;
#ifdef LOSCFG_TRACE_FRAME_CORE_MSG
frame
->
core
.
cpu
I
d
=
ArchCurrCpuid
();
frame
->
core
.
cpu
i
d
=
ArchCurrCpuid
();
frame
->
core
.
hwiActive
=
OS_INT_ACTIVE
?
TRUE
:
FALSE
;
frame
->
core
.
taskLockCnt
=
MIN
(
OsSchedLockCountGet
(),
0xF
);
/* taskLockCnt is 4 bits, max value = 0xF */
frame
->
core
.
paramCount
=
paramCount
;
...
...
kernel/extended/trace/trace_offline.c
浏览文件 @
cb67dd54
...
...
@@ -157,7 +157,7 @@ STATIC VOID OsTraceInfoEventTitle(VOID)
PRINTK
(
"Index Time(cycles) EventType CurPid CurTask Identity "
);
#ifdef LOSCFG_TRACE_FRAME_CORE_MSG
PRINTK
(
"cpu
I
d hwiActive taskLockCnt "
);
PRINTK
(
"cpu
i
d hwiActive taskLockCnt "
);
#endif
#ifdef LOSCFG_TRACE_FRAME_EVENT_COUNT
PRINTK
(
"eventCount "
);
...
...
@@ -192,7 +192,7 @@ STATIC VOID OsTraceInfoEventData(VOID)
*/
taskLockCnt
-=
1
;
#endif
PRINTK
(
"%-11u %-11u %-11u"
,
frame
->
core
.
cpu
I
d
,
frame
->
core
.
hwiActive
,
taskLockCnt
);
PRINTK
(
"%-11u %-11u %-11u"
,
frame
->
core
.
cpu
i
d
,
frame
->
core
.
hwiActive
,
taskLockCnt
);
#endif
#ifdef LOSCFG_TRACE_FRAME_EVENT_COUNT
PRINTK
(
"%-11u"
,
frame
->
eventCount
);
...
...
kernel/include/los_trace.h
浏览文件 @
cb67dd54
...
...
@@ -245,7 +245,7 @@ typedef struct {
UINTPTR
identity
;
/**< subject of the event description */
#ifdef LOSCFG_TRACE_FRAME_CORE_MSG
struct
CoreStatus
{
UINT32
cpu
I
d
:
8
,
/**< cpuid */
UINT32
cpu
i
d
:
8
,
/**< cpuid */
hwiActive
:
4
,
/**< whether is in hwi response */
taskLockCnt
:
4
,
/**< task lock count */
paramCount
:
4
,
/**< event frame params' number */
...
...
testsuites/kernel/include/osTest.h
浏览文件 @
cb67dd54
...
...
@@ -343,7 +343,7 @@ extern void TestSystemInit(void);
extern
void
TEST_DT_COMMON
(
void
);
extern
VOID
dprintf
(
const
char
*
fmt
,
...);
extern
UINT32
OsSwtmrTaskI
dByCpuId
(
UINT16
cpuI
d
);
extern
UINT32
OsSwtmrTaskI
DGetByCpuid
(
UINT16
cpui
d
);
#define BIG_FD 512
typedef
struct
testrunParam
{
...
...
testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_081.c
浏览文件 @
cb67dd54
...
...
@@ -49,7 +49,7 @@ static UINT32 Testcase(void)
ret
=
LOS_TaskSuspend
(
gTestIdleTaskID
);
ICUNIT_ASSERT_EQUAL
(
ret
,
LOS_ERRNO_TSK_OPERATE_SYSTEM_TASK
,
ret
);
gTestSwtmrTaskID
=
OsSwtmrTaskI
dByCpuI
d
(
cpuid
);
gTestSwtmrTaskID
=
OsSwtmrTaskI
DGetByCpui
d
(
cpuid
);
ret
=
LOS_TaskSuspend
(
gTestSwtmrTaskID
);
ICUNIT_ASSERT_EQUAL
(
ret
,
LOS_ERRNO_TSK_OPERATE_SYSTEM_TASK
,
ret
);
...
...
testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_114.c
浏览文件 @
cb67dd54
...
...
@@ -49,7 +49,7 @@ static UINT32 Testcase(void)
ret
=
LOS_TaskDelete
(
gTestIdleTaskID
);
ICUNIT_ASSERT_EQUAL
(
ret
,
LOS_ERRNO_TSK_OPERATE_SYSTEM_TASK
,
ret
);
gTestSwtmrTaskID
=
OsSwtmrTaskI
dByCpuI
d
(
cpuid
);
gTestSwtmrTaskID
=
OsSwtmrTaskI
DGetByCpui
d
(
cpuid
);
ret
=
LOS_TaskDelete
(
gTestSwtmrTaskID
);
ICUNIT_ASSERT_EQUAL
(
ret
,
LOS_ERRNO_TSK_OPERATE_SYSTEM_TASK
,
ret
);
...
...
testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_115.c
浏览文件 @
cb67dd54
...
...
@@ -44,7 +44,7 @@ static UINT32 Testcase(void)
UINT32
gTestSwtmrTaskID
;
UINT32
cpuid
=
(
ArchCurrCpuid
()
+
1
)
%
(
LOSCFG_KERNEL_CORE_NUM
);
gTestSwtmrTaskID
=
OsSwtmrTaskI
dByCpuI
d
(
cpuid
);
gTestSwtmrTaskID
=
OsSwtmrTaskI
DGetByCpui
d
(
cpuid
);
ret
=
LOS_TaskDelete
(
gTestSwtmrTaskID
);
ICUNIT_ASSERT_EQUAL
(
ret
,
LOS_ERRNO_TSK_OPERATE_SYSTEM_TASK
,
ret
);
...
...
testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_126.c
浏览文件 @
cb67dd54
...
...
@@ -54,7 +54,7 @@ static void HwiF01(void)
LOS_AtomicInc
(
&
g_testCount
);
gTestSwtmrTaskID
=
OsSwtmrTaskI
dByCpuI
d
(
cpuid
);
gTestSwtmrTaskID
=
OsSwtmrTaskI
DGetByCpui
d
(
cpuid
);
ret
=
LOS_TaskDelete
(
gTestSwtmrTaskID
);
ICUNIT_ASSERT_EQUAL_VOID
(
ret
,
LOS_ERRNO_TSK_YIELD_IN_INT
,
ret
);
...
...
testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_127.c
浏览文件 @
cb67dd54
...
...
@@ -49,7 +49,7 @@ static void HwiF01(void)
ret
=
LOS_TaskDelete
(
gTestIdleTaskID
);
ICUNIT_ASSERT_EQUAL_VOID
(
ret
,
LOS_ERRNO_TSK_YIELD_IN_INT
,
ret
);
gTestSwtmrTaskID
=
OsSwtmrTaskI
dByCpuI
d
(
cpuid
);
gTestSwtmrTaskID
=
OsSwtmrTaskI
DGetByCpui
d
(
cpuid
);
ret
=
LOS_TaskDelete
(
gTestSwtmrTaskID
);
ICUNIT_ASSERT_EQUAL_VOID
(
ret
,
LOS_ERRNO_TSK_YIELD_IN_INT
,
ret
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录