Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Mozi
rt-thread
提交
43ede185
R
rt-thread
项目概览
Mozi
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
43ede185
编写于
8月 24, 2022
作者:
mysterywolf
提交者:
guo
8月 25, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[kernel] 优化内置线程命名
main线程栈指定对齐字节数
上级
d49ac097
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
16 addition
and
16 deletion
+16
-16
src/components.c
src/components.c
+3
-3
src/idle.c
src/idle.c
+13
-13
未找到文件。
src/components.c
浏览文件 @
43ede185
...
@@ -166,8 +166,8 @@ int entry(void)
...
@@ -166,8 +166,8 @@ int entry(void)
#ifndef RT_USING_HEAP
#ifndef RT_USING_HEAP
/* if there is not enable heap, we should use static thread and stack. */
/* if there is not enable heap, we should use static thread and stack. */
ALIGN
(
8
)
ALIGN
(
RT_ALIGN_SIZE
)
static
rt_uint8_t
main_stack
[
RT_MAIN_THREAD_STACK_SIZE
];
static
rt_uint8_t
main_
thread_
stack
[
RT_MAIN_THREAD_STACK_SIZE
];
struct
rt_thread
main_thread
;
struct
rt_thread
main_thread
;
#endif
/* RT_USING_HEAP */
#endif
/* RT_USING_HEAP */
...
@@ -216,7 +216,7 @@ void rt_application_init(void)
...
@@ -216,7 +216,7 @@ void rt_application_init(void)
tid
=
&
main_thread
;
tid
=
&
main_thread
;
result
=
rt_thread_init
(
tid
,
"main"
,
main_thread_entry
,
RT_NULL
,
result
=
rt_thread_init
(
tid
,
"main"
,
main_thread_entry
,
RT_NULL
,
main_
stack
,
sizeof
(
main
_stack
),
RT_MAIN_THREAD_PRIORITY
,
20
);
main_
thread_stack
,
sizeof
(
main_thread
_stack
),
RT_MAIN_THREAD_PRIORITY
,
20
);
RT_ASSERT
(
result
==
RT_EOK
);
RT_ASSERT
(
result
==
RT_EOK
);
/* if not define RT_USING_HEAP, using to eliminate the warning */
/* if not define RT_USING_HEAP, using to eliminate the warning */
...
...
src/idle.c
浏览文件 @
43ede185
...
@@ -47,9 +47,9 @@
...
@@ -47,9 +47,9 @@
static
rt_list_t
_rt_thread_defunct
=
RT_LIST_OBJECT_INIT
(
_rt_thread_defunct
);
static
rt_list_t
_rt_thread_defunct
=
RT_LIST_OBJECT_INIT
(
_rt_thread_defunct
);
static
struct
rt_thread
idle
[
_CPUS_NR
];
static
struct
rt_thread
idle
_thread
[
_CPUS_NR
];
ALIGN
(
RT_ALIGN_SIZE
)
ALIGN
(
RT_ALIGN_SIZE
)
static
rt_uint8_t
rt
_thread_stack
[
_CPUS_NR
][
IDLE_THREAD_STACK_SIZE
];
static
rt_uint8_t
idle
_thread_stack
[
_CPUS_NR
][
IDLE_THREAD_STACK_SIZE
];
#ifdef RT_USING_SMP
#ifdef RT_USING_SMP
#ifndef SYSTEM_THREAD_STACK_SIZE
#ifndef SYSTEM_THREAD_STACK_SIZE
...
@@ -248,7 +248,7 @@ static void rt_defunct_execute(void)
...
@@ -248,7 +248,7 @@ static void rt_defunct_execute(void)
}
}
}
}
static
void
rt_thread_idle
_entry
(
void
*
parameter
)
static
void
idle_thread
_entry
(
void
*
parameter
)
{
{
#ifdef RT_USING_SMP
#ifdef RT_USING_SMP
if
(
rt_hw_cpu_id
()
!=
0
)
if
(
rt_hw_cpu_id
()
!=
0
)
...
@@ -306,24 +306,24 @@ static void rt_thread_system_entry(void *parameter)
...
@@ -306,24 +306,24 @@ static void rt_thread_system_entry(void *parameter)
void
rt_thread_idle_init
(
void
)
void
rt_thread_idle_init
(
void
)
{
{
rt_ubase_t
i
;
rt_ubase_t
i
;
char
tidle
_name
[
RT_NAME_MAX
];
char
idle_thread
_name
[
RT_NAME_MAX
];
for
(
i
=
0
;
i
<
_CPUS_NR
;
i
++
)
for
(
i
=
0
;
i
<
_CPUS_NR
;
i
++
)
{
{
rt_sprintf
(
tidle
_name
,
"tidle%d"
,
i
);
rt_sprintf
(
idle_thread
_name
,
"tidle%d"
,
i
);
rt_thread_init
(
&
idle
[
i
],
rt_thread_init
(
&
idle
_thread
[
i
],
tidle
_name
,
idle_thread
_name
,
rt_thread_idle
_entry
,
idle_thread
_entry
,
RT_NULL
,
RT_NULL
,
&
rt
_thread_stack
[
i
][
0
],
&
idle
_thread_stack
[
i
][
0
],
sizeof
(
rt
_thread_stack
[
i
]),
sizeof
(
idle
_thread_stack
[
i
]),
RT_THREAD_PRIORITY_MAX
-
1
,
RT_THREAD_PRIORITY_MAX
-
1
,
32
);
32
);
#ifdef RT_USING_SMP
#ifdef RT_USING_SMP
rt_thread_control
(
&
idle
[
i
],
RT_THREAD_CTRL_BIND_CPU
,
(
void
*
)
i
);
rt_thread_control
(
&
idle
_thread
[
i
],
RT_THREAD_CTRL_BIND_CPU
,
(
void
*
)
i
);
#endif
/* RT_USING_SMP */
#endif
/* RT_USING_SMP */
/* startup */
/* startup */
rt_thread_startup
(
&
idle
[
i
]);
rt_thread_startup
(
&
idle
_thread
[
i
]);
}
}
#ifdef RT_USING_SMP
#ifdef RT_USING_SMP
...
@@ -356,5 +356,5 @@ rt_thread_t rt_thread_idle_gethandler(void)
...
@@ -356,5 +356,5 @@ rt_thread_t rt_thread_idle_gethandler(void)
int
id
=
0
;
int
id
=
0
;
#endif
/* RT_USING_SMP */
#endif
/* RT_USING_SMP */
return
(
rt_thread_t
)(
&
idle
[
id
]);
return
(
rt_thread_t
)(
&
idle
_thread
[
id
]);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录