Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
66432474
提交
66432474
7月 12, 2006
创建
作者:
rtm
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cvs add spinlock.h
fix race in schedule()
上级
4e8f237b
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
17 行增加
和
3 行删除
+17
-3
Notes
Notes
+7
-0
proc.c
proc.c
+2
-1
spinlock.h
spinlock.h
+6
-0
usertests.c
usertests.c
+2
-2
没有找到文件。
Notes
浏览文件 @
66432474
...
@@ -126,3 +126,10 @@ in general, the table locks protect both free-ness and
...
@@ -126,3 +126,10 @@ in general, the table locks protect both free-ness and
why can't i get a lock in console code?
why can't i get a lock in console code?
always triple fault
always triple fault
lock code shouldn't call cprintf...
lock code shouldn't call cprintf...
ide_init doesn't work now?
and IOAPIC: read from unsupported address
when running pre-empt user test
so maybe something wrong with clock interrupts
no! if one cpu holds lock w/ curproc0=,
then another cpu can take it, it looks like
a recursive acquire()
proc.c
浏览文件 @
66432474
...
@@ -148,7 +148,6 @@ scheduler(void)
...
@@ -148,7 +148,6 @@ scheduler(void)
if
(
i
<
NPROC
){
if
(
i
<
NPROC
){
np
->
state
=
RUNNING
;
np
->
state
=
RUNNING
;
release
(
&
proc_table_lock
);
break
;
break
;
}
}
...
@@ -159,6 +158,8 @@ scheduler(void)
...
@@ -159,6 +158,8 @@ scheduler(void)
cpus
[
cpu
()].
lastproc
=
np
;
cpus
[
cpu
()].
lastproc
=
np
;
curproc
[
cpu
()]
=
np
;
curproc
[
cpu
()]
=
np
;
release
(
&
proc_table_lock
);
// h/w sets busy bit in TSS descriptor sometimes, and faults
// h/w sets busy bit in TSS descriptor sometimes, and faults
// if it's set in LTR. so clear tss descriptor busy bit.
// if it's set in LTR. so clear tss descriptor busy bit.
np
->
gdt
[
SEG_TSS
].
sd_type
=
STS_T32A
;
np
->
gdt
[
SEG_TSS
].
sd_type
=
STS_T32A
;
...
...
spinlock.h
0 → 100644
浏览文件 @
66432474
struct
spinlock
{
unsigned
int
locked
;
struct
proc
*
p
;
int
count
;
unsigned
locker_pc
;
};
usertests.c
浏览文件 @
66432474
...
@@ -93,8 +93,8 @@ preempt()
...
@@ -93,8 +93,8 @@ preempt()
main
()
main
()
{
{
puts
(
"usertests starting
\n
"
);
puts
(
"usertests starting
\n
"
);
pipe1
();
//
pipe1();
//
preempt();
preempt
();
while
(
1
)
while
(
1
)
;
;
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论