Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
rcore-os
RCore Tutorial V3
提交
0b33404a
R
RCore Tutorial V3
项目概览
rcore-os
/
RCore Tutorial V3
上一次同步 1 年多
通知
15
Star
793
Fork
260
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
4
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
RCore Tutorial V3
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
4
Issue
4
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
0b33404a
编写于
1月 04, 2021
作者:
Y
Yifan Wu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move some variable name to task_cx to task_cx_ptr2
上级
4b215e94
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
14 addition
and
8 deletion
+14
-8
os/src/task/mod.rs
os/src/task/mod.rs
+6
-6
os/src/task/switch.S
os/src/task/switch.S
+4
-1
os/src/task/switch.rs
os/src/task/switch.rs
+4
-1
未找到文件。
os/src/task/mod.rs
浏览文件 @
0b33404a
...
...
@@ -47,11 +47,11 @@ lazy_static! {
impl
TaskManager
{
fn
run_first_task
(
&
self
)
{
self
.inner
.borrow_mut
()
.tasks
[
0
]
.task_status
=
TaskStatus
::
Running
;
let
next_task_cx
=
self
.inner
.borrow
()
.tasks
[
0
]
.get_task_cx_ptr2
();
let
next_task_cx
_ptr2
=
self
.inner
.borrow
()
.tasks
[
0
]
.get_task_cx_ptr2
();
unsafe
{
__
switch
(
&
0u
size
as
*
const
_
,
next_task_cx
,
next_task_cx
_ptr2
,
);
}
}
...
...
@@ -84,13 +84,13 @@ impl TaskManager {
let
current
=
inner
.current_task
;
inner
.tasks
[
next
]
.task_status
=
TaskStatus
::
Running
;
inner
.current_task
=
next
;
let
current_task_cx
=
inner
.tasks
[
current
]
.get_task_cx_ptr2
();
let
next_task_cx
=
inner
.tasks
[
next
]
.get_task_cx_ptr2
();
let
current_task_cx
_ptr2
=
inner
.tasks
[
current
]
.get_task_cx_ptr2
();
let
next_task_cx
_ptr2
=
inner
.tasks
[
next
]
.get_task_cx_ptr2
();
core
::
mem
::
drop
(
inner
);
unsafe
{
__
switch
(
current_task_cx
,
next_task_cx
,
current_task_cx
_ptr2
,
next_task_cx
_ptr2
,
);
}
}
else
{
...
...
os/src/task/switch.S
浏览文件 @
0b33404a
...
...
@@ -8,7 +8,10 @@
.
section
.
text
.
globl
__switch
__switch
:
#
__switch
(
current_task_cx
:
&*
const
TaskContext
,
next_task_cx
:
&*
const
TaskContext
)
#
__switch
(
#
current_task_cx_ptr2
:
&*
const
TaskContext
,
#
next_task_cx_ptr2
:
&*
const
TaskContext
#
)
#
push
TaskContext
to
current
sp
and
save
its
address
to
where
a0
points
to
addi
sp
,
sp
,
-
13
*
8
sd
sp
,
0
(
a0
)
...
...
os/src/task/switch.rs
浏览文件 @
0b33404a
global_asm!
(
include_str!
(
"switch.S"
));
extern
"C"
{
pub
fn
__
switch
(
current_task_cx
:
*
const
usize
,
next_task_cx
:
*
const
usize
);
pub
fn
__
switch
(
current_task_cx_ptr2
:
*
const
usize
,
next_task_cx_ptr2
:
*
const
usize
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录