Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
a7d6a3f6
提交
a7d6a3f6
3月 01, 2012
创建
作者:
Silas Boyd-Wickizer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Templatized cilk_call functions
上级
6ec84747
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
44 行增加
和
13 行删除
+44
-13
cilk.hh
include/cilk.hh
+32
-0
exec.cc
kernel/exec.cc
+12
-13
没有找到文件。
include/cilk.hh
0 → 100644
浏览文件 @
a7d6a3f6
#if CILKENABLE
template
<
typename
A1
>
static
void
cilk_call
(
void
(
*
fn
)(
A1
),
A1
a1
)
{
cilk_push
((
void
(
*
)(
uptr
,
uptr
))
fn
,
(
uptr
)
a1
,
(
uptr
)
0
);
}
template
<
typename
A1
,
typename
A2
>
static
void
cilk_call
(
void
(
*
fn
)(
A1
,
A2
),
A1
a1
,
A2
a2
)
{
cilk_push
((
void
(
*
)(
uptr
,
uptr
))
fn
,
(
uptr
)
a1
,
(
uptr
)
a2
);
}
#else // !CILKENABLE
template
<
typename
A1
>
static
void
cilk_call
(
void
(
*
fn
)(
A1
),
A1
a1
)
{
fn
(
a1
);
}
template
<
typename
A1
,
typename
A2
>
static
void
cilk_call
(
void
(
*
fn
)(
A1
,
A2
),
A1
a1
,
A2
a2
)
{
fn
(
a1
,
a2
);
}
#endif
kernel/exec.cc
浏览文件 @
a7d6a3f6
...
...
@@ -13,6 +13,8 @@
#include "elf.hh"
#include "cpu.hh"
#include "prof.hh"
#include "wq.hh"
#include "cilk.hh"
#define USTACKPAGES 2
#define BRK (USERTOP >> 1)
...
...
@@ -28,10 +30,8 @@ struct eargs {
};
static
void
dosegment
(
uptr
a0
,
u64
a1
)
dosegment
(
struct
eargs
*
args
,
u64
off
)
{
struct
eargs
*
args
=
(
eargs
*
)
a0
;
u64
off
=
a1
;
struct
vmnode
*
vmn
=
nullptr
;
struct
proghdr
ph
;
uptr
va_start
,
va_end
;
...
...
@@ -69,10 +69,10 @@ bad:
cilk_abort
(
-
1
);
}
static
void
__attribute__
((
unused
))
dostack
(
uptr
a0
,
u64
a1
)
static
void
dostack
(
struct
eargs
*
args
)
{
struct
vmnode
*
vmn
=
nullptr
;
struct
eargs
*
args
=
(
eargs
*
)
a0
;
int
argc
;
uptr
sp
;
uptr
ustack
[
1
+
MAXARG
+
1
];
...
...
@@ -123,10 +123,10 @@ bad:
cilk_abort
(
-
1
);
}
static
void
__attribute__
((
unused
))
doheap
(
uptr
a0
,
u64
a1
)
static
void
doheap
(
struct
eargs
*
args
)
{
struct
vmnode
*
vmn
=
nullptr
;
struct
eargs
*
args
=
(
eargs
*
)
a0
;
prof_start
(
doheap_prof
);
// Allocate a vmnode for the heap.
...
...
@@ -188,7 +188,7 @@ exec(const char *path, char **argv)
goto
bad
;
if
(
type
!=
ELF_PROG_LOAD
)
continue
;
cilk_
push
(
dosegment
,
(
uptr
)
&
args
,
(
uptr
)
off
);
cilk_
call
(
dosegment
,
&
args
,
off
);
}
if
(
odp
)
{
...
...
@@ -199,12 +199,11 @@ exec(const char *path, char **argv)
ip
=
0
;
}
cilk_
push
(
doheap
,
(
uptr
)
&
args
,
(
uptr
)
0
);
cilk_
call
(
doheap
,
&
args
);
// dostack reads from the user address space. The wq
// stuff doesn't switch to the user address space.
//cilk_push(dostack, (uptr)&args, (uptr)0);
dostack
((
uptr
)
&
args
,
(
uptr
)
0
);
// dostack reads from the user vm space. wq workers don't switch
// the user vm.
dostack
(
&
args
);
if
(
cilk_end
())
goto
bad
;
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论