Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Kernel Liteos A
提交
a6c5309a
K
Kernel Liteos A
项目概览
OpenHarmony
/
Kernel Liteos A
1 年多 前同步成功
通知
461
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看板
未验证
提交
a6c5309a
编写于
3月 24, 2022
作者:
O
openharmony_ci
提交者:
Gitee
3月 24, 2022
浏览文件
操作
浏览文件
下载
差异文件
!856 fix: 修复类型不匹配问题
Merge pull request !856 from zhushengle/type
上级
33c4e194
65d5526c
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
33 addition
and
39 deletion
+33
-39
kernel/base/core/los_task.c
kernel/base/core/los_task.c
+3
-3
kernel/base/include/los_task_pri.h
kernel/base/include/los_task_pri.h
+2
-2
kernel/base/ipc/los_futex.c
kernel/base/ipc/los_futex.c
+3
-3
kernel/base/mp/los_stat.c
kernel/base/mp/los_stat.c
+3
-3
syscall/process_syscall.c
syscall/process_syscall.c
+22
-28
未找到文件。
kernel/base/core/los_task.c
浏览文件 @
a6c5309a
...
...
@@ -1249,19 +1249,19 @@ EXIT:
return
err
;
}
UINT32
OsUserTaskOperatePermissionsCheck
(
LosTaskCB
*
taskCB
)
INT32
OsUserTaskOperatePermissionsCheck
(
const
LosTaskCB
*
taskCB
)
{
return
OsUserProcessOperatePermissionsCheck
(
taskCB
,
OsCurrProcessGet
()
->
processID
);
}
UINT32
OsUserProcessOperatePermissionsCheck
(
LosTaskCB
*
taskCB
,
UINT32
processID
)
INT32
OsUserProcessOperatePermissionsCheck
(
const
LosTaskCB
*
taskCB
,
UINT32
processID
)
{
if
(
taskCB
==
NULL
)
{
return
LOS_EINVAL
;
}
if
(
processID
==
OS_INVALID_VALUE
)
{
return
OS_INVALID_VALUE
;
return
LOS_EINVAL
;
}
if
(
taskCB
->
taskStatus
&
OS_TASK_STATUS_UNUSED
)
{
...
...
kernel/base/include/los_task_pri.h
浏览文件 @
a6c5309a
...
...
@@ -323,8 +323,8 @@ extern UINT32 OsCreateUserTask(UINT32 processID, TSK_INIT_PARAM_S *initParam);
extern
INT32
OsSetTaskName
(
LosTaskCB
*
taskCB
,
const
CHAR
*
name
,
BOOL
setPName
);
extern
VOID
OsTaskCBRecycleToFree
(
VOID
);
extern
VOID
OsRunningTaskToExit
(
LosTaskCB
*
runTask
,
UINT32
status
);
extern
UINT32
OsUserTaskOperatePermissionsCheck
(
LosTaskCB
*
taskCB
);
extern
UINT32
OsUserProcessOperatePermissionsCheck
(
LosTaskCB
*
taskCB
,
UINT32
processID
);
extern
INT32
OsUserTaskOperatePermissionsCheck
(
const
LosTaskCB
*
taskCB
);
extern
INT32
OsUserProcessOperatePermissionsCheck
(
const
LosTaskCB
*
taskCB
,
UINT32
processID
);
extern
INT32
OsTcbDispatch
(
LosTaskCB
*
stcb
,
siginfo_t
*
info
);
extern
VOID
OsWriteResourceEvent
(
UINT32
events
);
extern
VOID
OsWriteResourceEventUnsafe
(
UINT32
events
);
...
...
kernel/base/ipc/los_futex.c
浏览文件 @
a6c5309a
...
...
@@ -112,16 +112,16 @@ STATIC VOID OsFutexShowTaskNodeAttr(const LOS_DL_LIST *futexList)
LOS_DL_LIST
*
queueList
=
NULL
;
tempNode
=
OS_FUTEX_FROM_FUTEXLIST
(
futexList
);
PRINTK
(
"key(pid) : 0x%x(%
d
) : ->"
,
tempNode
->
key
,
tempNode
->
pid
);
PRINTK
(
"key(pid) : 0x%x(%
u
) : ->"
,
tempNode
->
key
,
tempNode
->
pid
);
for
(
queueList
=
&
tempNode
->
queueList
;
;)
{
lastNode
=
OS_FUTEX_FROM_QUEUELIST
(
queueList
);
if
(
!
LOS_ListEmpty
(
&
(
lastNode
->
pendList
)))
{
taskCB
=
OS_TCB_FROM_PENDLIST
(
LOS_DL_LIST_FIRST
(
&
(
lastNode
->
pendList
)));
PRINTK
(
" %
d(%d
) ->"
,
taskCB
->
taskID
,
taskCB
->
priority
);
PRINTK
(
" %
u(%u
) ->"
,
taskCB
->
taskID
,
taskCB
->
priority
);
}
else
{
taskCB
=
LOS_DL_LIST_ENTRY
(
lastNode
,
LosTaskCB
,
futex
);
PRINTK
(
" %
d
(%d) ->"
,
taskCB
->
taskID
,
-
1
);
PRINTK
(
" %
u
(%d) ->"
,
taskCB
->
taskID
,
-
1
);
}
queueList
=
queueList
->
pstNext
;
if
(
queueList
==
&
tempNode
->
queueList
)
{
...
...
kernel/base/mp/los_stat.c
浏览文件 @
a6c5309a
...
...
@@ -173,7 +173,7 @@ LITE_OS_SEC_TEXT_MINOR VOID OsShellCmdDumpSched(VOID)
affinity
=
(
UINT32
)
taskCB
->
cpuAffiMask
;
PRINTK
(
"%-30s0x%-6x%+16lf ms %10
d
\n
"
,
taskCB
->
taskName
,
taskCB
->
taskID
,
PRINTK
(
"%-30s0x%-6x%+16lf ms %10
u
\n
"
,
taskCB
->
taskName
,
taskCB
->
taskID
,
(
DOUBLE
)(
taskCB
->
schedStat
.
allRuntime
)
/
NS_PER_MS
,
taskCB
->
schedStat
.
allContextSwitch
);
...
...
@@ -183,7 +183,7 @@ LITE_OS_SEC_TEXT_MINOR VOID OsShellCmdDumpSched(VOID)
}
PRINTK
(
" "
"CPU%
d %+16lf ms %12d
\n
"
,
cpuid
,
"CPU%
u %+16lf ms %12u
\n
"
,
cpuid
,
(
DOUBLE
)(
taskCB
->
schedStat
.
schedPercpu
[
cpuid
].
runtime
)
/
NS_PER_MS
,
taskCB
->
schedStat
.
schedPercpu
[
cpuid
].
contexSwitch
);
}
...
...
@@ -251,7 +251,7 @@ LITE_OS_SEC_TEXT_MINOR VOID OsMpStaticShow(UINT64 mpStaticPastTime)
"---------- ---------- ---------- ----------
\n
"
);
for
(
cpuid
=
0
;
cpuid
<
LOSCFG_KERNEL_CORE_NUM
;
cpuid
++
)
{
PRINTK
(
"CPU%
d %+10lf%14d%14d%14d %+11lf %+11lf %+11lf%14d
%+11lf
\n
"
,
cpuid
,
PRINTK
(
"CPU%
u %+10lf%14u%14u%14u %+11lf %+11lf %+11lf%14u
%+11lf
\n
"
,
cpuid
,
((
DOUBLE
)(
g_mpStatPercpu
[
cpuid
].
idleRuntime
)
/
mpStaticPastTime
)
*
DECIMAL_TO_PERCENTAGE
,
g_mpStatPercpu
[
cpuid
].
contexSwitch
,
g_mpStatPercpu
[
cpuid
].
hwiNum
,
...
...
syscall/process_syscall.c
浏览文件 @
a6c5309a
...
...
@@ -43,7 +43,6 @@
#include "capability_api.h"
#endif
static
int
OsPermissionToCheck
(
unsigned
int
pid
,
unsigned
int
who
)
{
int
ret
=
LOS_GetProcessGroupID
(
pid
);
...
...
@@ -78,8 +77,8 @@ static int OsUserTaskSchedulerSet(unsigned int tid, unsigned short policy, unsig
return
EINVAL
;
}
SCHEDULER_LOCK
(
intSave
);
LosTaskCB
*
taskCB
=
OS_TCB_FROM_TID
(
tid
);
SCHEDULER_LOCK
(
intSave
);
ret
=
OsUserTaskOperatePermissionsCheck
(
taskCB
);
if
(
ret
!=
LOS_OK
)
{
SCHEDULER_UNLOCK
(
intSave
);
...
...
@@ -100,13 +99,14 @@ static int OsUserTaskSchedulerSet(unsigned int tid, unsigned short policy, unsig
void
SysSchedYield
(
int
type
)
{
(
void
)
type
;
(
void
)
LOS_TaskYield
();
return
;
}
int
SysSchedGetScheduler
(
int
id
,
int
flag
)
{
LosTaskCB
*
taskCB
=
NULL
;
unsigned
int
intSave
;
int
policy
;
int
ret
;
...
...
@@ -116,15 +116,15 @@ int SysSchedGetScheduler(int id, int flag)
return
-
EINVAL
;
}
LosTaskCB
*
taskCB
=
OS_TCB_FROM_TID
(
id
);
SCHEDULER_LOCK
(
intSave
);
taskCB
=
OS_TCB_FROM_TID
(
id
);
ret
=
OsUserTaskOperatePermissionsCheck
(
taskCB
);
if
(
ret
!=
LOS_OK
)
{
SCHEDULER_UNLOCK
(
intSave
);
return
-
ret
;
}
policy
=
taskCB
->
policy
;
policy
=
(
int
)
taskCB
->
policy
;
SCHEDULER_UNLOCK
(
intSave
);
return
policy
;
}
...
...
@@ -158,8 +158,7 @@ int SysSchedSetScheduler(int id, int policy, int prio, int flag)
int
SysSchedGetParam
(
int
id
,
int
flag
)
{
LosTaskCB
*
taskCB
=
NULL
;
int
pri
;
int
prio
;
unsigned
int
intSave
;
if
(
flag
<
0
)
{
...
...
@@ -167,17 +166,17 @@ int SysSchedGetParam(int id, int flag)
return
-
EINVAL
;
}
LosTaskCB
*
taskCB
=
OS_TCB_FROM_TID
(
id
);
SCHEDULER_LOCK
(
intSave
);
taskCB
=
OS_TCB_FROM_TID
(
id
);
pri
=
OsUserTaskOperatePermissionsCheck
(
taskCB
);
if
(
pri
!=
LOS_OK
)
{
prio
=
OsUserTaskOperatePermissionsCheck
(
taskCB
);
if
(
prio
!=
LOS_OK
)
{
SCHEDULER_UNLOCK
(
intSave
);
return
-
pri
;
return
-
pri
o
;
}
pri
=
taskCB
->
priority
;
pri
o
=
(
int
)
taskCB
->
priority
;
SCHEDULER_UNLOCK
(
intSave
);
return
pri
;
return
pri
o
;
}
if
(
id
==
0
)
{
...
...
@@ -894,17 +893,15 @@ unsigned int SysCreateUserThread(const TSK_ENTRY_FUNC func, const UserTaskParam
int
SysSetThreadArea
(
const
char
*
area
)
{
unsigned
int
intSave
;
LosTaskCB
*
taskCB
=
NULL
;
LosProcessCB
*
processCB
=
NULL
;
unsigned
int
ret
=
LOS_OK
;
int
ret
=
LOS_OK
;
if
(
!
LOS_IsUserAddress
((
unsigned
long
)(
uintptr_t
)
area
))
{
return
EINVAL
;
}
LosTaskCB
*
taskCB
=
OsCurrTaskGet
();
SCHEDULER_LOCK
(
intSave
);
taskCB
=
OsCurrTaskGet
();
processCB
=
OS_PCB_FROM_PID
(
taskCB
->
processID
);
LosProcessCB
*
processCB
=
OS_PCB_FROM_PID
(
taskCB
->
processID
);
if
(
processCB
->
processMode
!=
OS_USER_MODE
)
{
ret
=
EPERM
;
goto
OUT
;
...
...
@@ -925,20 +922,19 @@ int SysUserThreadSetDetach(unsigned int taskID)
{
unsigned
int
intSave
;
int
ret
;
LosTaskCB
*
taskCB
=
NULL
;
if
(
OS_TID_CHECK_INVALID
(
taskID
))
{
return
EINVAL
;
}
LosTaskCB
*
taskCB
=
OS_TCB_FROM_TID
(
taskID
);
SCHEDULER_LOCK
(
intSave
);
taskCB
=
OS_TCB_FROM_TID
(
taskID
);
ret
=
OsUserTaskOperatePermissionsCheck
(
taskCB
);
if
(
ret
!=
LOS_OK
)
{
goto
EXIT
;
}
ret
=
OsTaskSetDetachUnsafe
(
taskCB
);
ret
=
(
int
)
OsTaskSetDetachUnsafe
(
taskCB
);
EXIT:
SCHEDULER_UNLOCK
(
intSave
);
...
...
@@ -948,7 +944,7 @@ EXIT:
int
SysUserThreadDetach
(
unsigned
int
taskID
)
{
unsigned
int
intSave
;
unsigned
int
ret
;
int
ret
;
if
(
OS_TID_CHECK_INVALID
(
taskID
))
{
return
EINVAL
;
...
...
@@ -961,8 +957,7 @@ int SysUserThreadDetach(unsigned int taskID)
return
ret
;
}
ret
=
LOS_TaskDelete
(
taskID
);
if
(
ret
!=
LOS_OK
)
{
if
(
LOS_TaskDelete
(
taskID
)
!=
LOS_OK
)
{
return
ESRCH
;
}
...
...
@@ -972,21 +967,20 @@ int SysUserThreadDetach(unsigned int taskID)
int
SysThreadJoin
(
unsigned
int
taskID
)
{
unsigned
int
intSave
;
unsigned
int
ret
;
LosTaskCB
*
taskCB
=
NULL
;
int
ret
;
if
(
OS_TID_CHECK_INVALID
(
taskID
))
{
return
EINVAL
;
}
LosTaskCB
*
taskCB
=
OS_TCB_FROM_TID
(
taskID
);
SCHEDULER_LOCK
(
intSave
);
taskCB
=
OS_TCB_FROM_TID
(
taskID
);
ret
=
OsUserTaskOperatePermissionsCheck
(
taskCB
);
if
(
ret
!=
LOS_OK
)
{
goto
EXIT
;
}
ret
=
OsTaskJoinPendUnsafe
(
OS_TCB_FROM_TID
(
taskID
));
ret
=
(
int
)
OsTaskJoinPendUnsafe
(
OS_TCB_FROM_TID
(
taskID
));
EXIT:
SCHEDULER_UNLOCK
(
intSave
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录