Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
5573c8f2
提交
5573c8f2
8月 28, 2007
创建
作者:
rsc
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
delete proc_ on proc_exit, proc_wait, proc_kill
上级
eb52c7de
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
12 行增加
和
12 行删除
+12
-12
defs.h
defs.h
+3
-3
proc.c
proc.c
+3
-3
sysproc.c
sysproc.c
+3
-3
trap.c
trap.c
+3
-3
没有找到文件。
defs.h
浏览文件 @
5573c8f2
...
...
@@ -98,10 +98,10 @@ int pipewrite(struct pipe*, char*, int);
struct
proc
*
copyproc
(
struct
proc
*
);
int
growproc
(
int
);
void
pinit
(
void
);
void
proc_exit
(
void
);
int
proc_kill
(
int
);
int
proc_wait
(
void
);
void
procdump
(
void
);
void
exit
(
void
);
int
kill
(
int
);
int
wait
(
void
);
void
scheduler
(
void
)
__attribute__
((
noreturn
));
void
setupsegs
(
struct
proc
*
);
void
sleep
(
void
*
,
struct
spinlock
*
);
...
...
proc.c
浏览文件 @
5573c8f2
...
...
@@ -318,7 +318,7 @@ wakeup(void *chan)
// Process won't actually exit until it returns
// to user space (see trap in trap.c).
int
proc_
kill
(
int
pid
)
kill
(
int
pid
)
{
struct
proc
*
p
;
...
...
@@ -341,7 +341,7 @@ proc_kill(int pid)
// Exited processes remain in the zombie state
// until their parent calls wait() to find out they exited.
void
proc_
exit
(
void
)
exit
(
void
)
{
struct
proc
*
p
;
int
fd
;
...
...
@@ -384,7 +384,7 @@ proc_exit(void)
// Wait for a child process to exit and return its pid.
// Return -1 if this process has no children.
int
proc_
wait
(
void
)
wait
(
void
)
{
struct
proc
*
p
;
int
i
,
havekids
,
pid
;
...
...
sysproc.c
浏览文件 @
5573c8f2
...
...
@@ -18,14 +18,14 @@ sys_fork(void)
int
sys_exit
(
void
)
{
proc_
exit
();
exit
();
return
0
;
// not reached
}
int
sys_wait
(
void
)
{
return
proc_
wait
();
return
wait
();
}
int
...
...
@@ -35,7 +35,7 @@ sys_kill(void)
if
(
argint
(
0
,
&
pid
)
<
0
)
return
-
1
;
return
proc_
kill
(
pid
);
return
kill
(
pid
);
}
int
...
...
trap.c
浏览文件 @
5573c8f2
...
...
@@ -36,11 +36,11 @@ trap(struct trapframe *tf)
{
if
(
tf
->
trapno
==
T_SYSCALL
){
if
(
cp
->
killed
)
proc_
exit
();
exit
();
cp
->
tf
=
tf
;
syscall
();
if
(
cp
->
killed
)
proc_
exit
();
exit
();
return
;
}
...
...
@@ -89,7 +89,7 @@ trap(struct trapframe *tf)
// (If it is still executing in the kernel, let it keep running
// until it gets to the regular system call return.)
if
(
cp
&&
cp
->
killed
&&
(
tf
->
cs
&
3
)
==
DPL_USER
)
proc_
exit
();
exit
();
// Force process to give up CPU on clock tick.
// If interrupts were on while locks held, would need to check nlock.
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论