Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
ee9c7f3b
提交
ee9c7f3b
7月 17, 2006
创建
作者:
rsc
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
goodbye PushRegs
上级
f15a3ae2
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
6 行增加
和
9 行删除
+6
-9
proc.c
proc.c
+1
-1
syscall.c
syscall.c
+2
-2
trap.c
trap.c
+1
-1
x86.h
x86.h
+2
-5
没有找到文件。
proc.c
浏览文件 @
ee9c7f3b
...
@@ -104,7 +104,7 @@ copyproc(struct proc* p)
...
@@ -104,7 +104,7 @@ copyproc(struct proc* p)
*
np
->
tf
=
*
p
->
tf
;
*
np
->
tf
=
*
p
->
tf
;
// Clear %eax so that fork system call returns 0 in child.
// Clear %eax so that fork system call returns 0 in child.
np
->
tf
->
regs
.
eax
=
0
;
np
->
tf
->
eax
=
0
;
// Set up new jmpbuf to start executing at forkret (see below).
// Set up new jmpbuf to start executing at forkret (see below).
memset
(
&
np
->
jmpbuf
,
0
,
sizeof
np
->
jmpbuf
);
memset
(
&
np
->
jmpbuf
,
0
,
sizeof
np
->
jmpbuf
);
...
...
syscall.c
浏览文件 @
ee9c7f3b
...
@@ -263,7 +263,7 @@ void
...
@@ -263,7 +263,7 @@ void
syscall
(
void
)
syscall
(
void
)
{
{
struct
proc
*
cp
=
curproc
[
cpu
()];
struct
proc
*
cp
=
curproc
[
cpu
()];
int
num
=
cp
->
tf
->
regs
.
eax
;
int
num
=
cp
->
tf
->
eax
;
int
ret
=
-
1
;
int
ret
=
-
1
;
//cprintf("%x sys %d\n", cp, num);
//cprintf("%x sys %d\n", cp, num);
...
@@ -309,5 +309,5 @@ syscall(void)
...
@@ -309,5 +309,5 @@ syscall(void)
// XXX fault
// XXX fault
break
;
break
;
}
}
cp
->
tf
->
regs
.
eax
=
ret
;
cp
->
tf
->
eax
=
ret
;
}
}
trap.c
浏览文件 @
ee9c7f3b
...
@@ -37,7 +37,7 @@ trap(struct Trapframe *tf)
...
@@ -37,7 +37,7 @@ trap(struct Trapframe *tf)
if
(
v
==
T_SYSCALL
){
if
(
v
==
T_SYSCALL
){
struct
proc
*
cp
=
curproc
[
cpu
()];
struct
proc
*
cp
=
curproc
[
cpu
()];
int
num
=
cp
->
tf
->
regs
.
eax
;
int
num
=
cp
->
tf
->
eax
;
if
(
cp
==
0
)
if
(
cp
==
0
)
panic
(
"syscall with no proc"
);
panic
(
"syscall with no proc"
);
if
(
cp
->
killed
)
if
(
cp
->
killed
)
...
...
x86.h
浏览文件 @
ee9c7f3b
...
@@ -339,7 +339,7 @@ sti(void)
...
@@ -339,7 +339,7 @@ sti(void)
__asm__
volatile
(
"sti"
);
__asm__
volatile
(
"sti"
);
}
}
struct
PushRegs
{
struct
Trapframe
{
/* registers as pushed by pusha */
/* registers as pushed by pusha */
uint32_t
edi
;
uint32_t
edi
;
uint32_t
esi
;
uint32_t
esi
;
...
@@ -349,10 +349,7 @@ struct PushRegs {
...
@@ -349,10 +349,7 @@ struct PushRegs {
uint32_t
edx
;
uint32_t
edx
;
uint32_t
ecx
;
uint32_t
ecx
;
uint32_t
eax
;
uint32_t
eax
;
};
/* rest of trap frame */
struct
Trapframe
{
struct
PushRegs
regs
;
uint16_t
es
;
uint16_t
es
;
uint16_t
padding1
;
uint16_t
padding1
;
uint16_t
ds
;
uint16_t
ds
;
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论