Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
27e046f9
提交
27e046f9
6月 13, 2011
创建
作者:
Nickolai Zeldovich
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
unsigned keys to avoid negative mod outputs
上级
f484e1cb
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
16 行增加
和
16 行删除
+16
-16
defs.h
defs.h
+5
-5
ns.c
ns.c
+8
-8
proc.c
proc.c
+2
-2
rcu.c
rcu.c
+1
-1
没有找到文件。
defs.h
浏览文件 @
27e046f9
...
...
@@ -102,11 +102,11 @@ void mpstartthem(void);
void
nsinit
(
void
);
struct
ns
*
nsalloc
(
int
allowdup
);
int
ns_allockey
(
struct
ns
*
);
int
ns_insert
(
struct
ns
*
,
int
key
,
void
*
);
void
*
ns_lookup
(
struct
ns
*
,
int
);
int
ns_remove
(
struct
ns
*
ns
,
int
key
,
void
*
val
);
void
*
ns_enumerate
(
struct
ns
*
ns
,
void
*
(
*
f
)(
int
,
void
*
));
void
*
ns_enumerate_key
(
struct
ns
*
ns
,
int
key
,
void
*
(
*
f
)(
void
*
));
int
ns_insert
(
struct
ns
*
,
u
int
key
,
void
*
);
void
*
ns_lookup
(
struct
ns
*
,
u
int
);
int
ns_remove
(
struct
ns
*
ns
,
u
int
key
,
void
*
val
);
void
*
ns_enumerate
(
struct
ns
*
ns
,
void
*
(
*
f
)(
u
int
,
void
*
));
void
*
ns_enumerate_key
(
struct
ns
*
ns
,
u
int
key
,
void
*
(
*
f
)(
void
*
));
// picirq.c
...
...
ns.c
浏览文件 @
27e046f9
...
...
@@ -13,7 +13,7 @@
#endif
struct
elem
{
int
key
;
u
int
key
;
void
*
val
;
int
next_lock
;
struct
elem
*
volatile
next
;
...
...
@@ -25,7 +25,7 @@ struct bucket {
struct
ns
{
int
allowdup
;
int
nextkey
;
u
int
nextkey
;
struct
bucket
table
[
NHASH
];
};
...
...
@@ -64,12 +64,12 @@ elemalloc(void)
int
ns_allockey
(
struct
ns
*
ns
)
{
int
n
=
__sync_fetch_and_add
(
&
ns
->
nextkey
,
1
);
u
int
n
=
__sync_fetch_and_add
(
&
ns
->
nextkey
,
1
);
return
n
;
}
int
ns_insert
(
struct
ns
*
ns
,
int
key
,
void
*
val
)
ns_insert
(
struct
ns
*
ns
,
u
int
key
,
void
*
val
)
{
struct
elem
*
e
=
elemalloc
();
if
(
e
)
{
...
...
@@ -102,7 +102,7 @@ ns_insert(struct ns *ns, int key, void *val)
}
void
*
ns_lookup
(
struct
ns
*
ns
,
int
key
)
ns_lookup
(
struct
ns
*
ns
,
u
int
key
)
{
uint
i
=
key
%
NHASH
;
...
...
@@ -121,7 +121,7 @@ ns_lookup(struct ns *ns, int key)
}
int
ns_remove
(
struct
ns
*
ns
,
int
key
,
void
*
v
)
ns_remove
(
struct
ns
*
ns
,
u
int
key
,
void
*
v
)
{
uint
i
=
key
%
NHASH
;
rcu_begin_write
(
0
);
...
...
@@ -165,7 +165,7 @@ ns_remove(struct ns *ns, int key, void *v)
}
void
*
ns_enumerate
(
struct
ns
*
ns
,
void
*
(
*
f
)(
int
,
void
*
))
ns_enumerate
(
struct
ns
*
ns
,
void
*
(
*
f
)(
u
int
,
void
*
))
{
rcu_begin_read
();
for
(
int
i
=
0
;
i
<
NHASH
;
i
++
)
{
...
...
@@ -182,7 +182,7 @@ ns_enumerate(struct ns *ns, void *(*f)(int, void *))
}
void
*
ns_enumerate_key
(
struct
ns
*
ns
,
int
key
,
void
*
(
*
f
)(
void
*
))
ns_enumerate_key
(
struct
ns
*
ns
,
u
int
key
,
void
*
(
*
f
)(
void
*
))
{
uint
i
=
key
%
NHASH
;
rcu_begin_read
();
...
...
proc.c
浏览文件 @
27e046f9
...
...
@@ -445,7 +445,7 @@ migrate(struct proc *p)
}
static
void
*
steal_cb
(
int
k
,
void
*
v
)
steal_cb
(
u
int
k
,
void
*
v
)
{
struct
proc
*
p
=
v
;
...
...
@@ -643,7 +643,7 @@ kill(int pid)
return
0
;
}
void
*
procdump
(
int
k
,
void
*
v
)
void
*
procdump
(
u
int
k
,
void
*
v
)
{
struct
proc
*
p
=
(
struct
proc
*
)
v
;
...
...
rcu.c
浏览文件 @
27e046f9
...
...
@@ -35,7 +35,7 @@ rcu_alloc()
}
void
*
rcu_min
(
int
key
,
void
*
v
){
rcu_min
(
u
int
key
,
void
*
v
){
struct
proc
*
p
=
(
struct
proc
*
)
v
;
if
(
min_epoch
[
cpu
->
id
].
x
>
p
->
epoch
)
{
min_epoch
[
cpu
->
id
].
x
=
p
->
epoch
;
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论