Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
ad992686
提交
ad992686
2月 13, 2012
创建
作者:
Nickolai Zeldovich
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
c++-only header files
上级
21d8da79
隐藏空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
25 行增加
和
27 行删除
+25
-27
bio.cc
bio.cc
+1
-1
buf.hh
buf.hh
+0
-0
console.cc
console.cc
+1
-1
exec.cc
exec.cc
+1
-1
file.cc
file.cc
+1
-1
file.hh
file.hh
+0
-6
fs.cc
fs.cc
+2
-2
kernlet.cc
kernlet.cc
+11
-8
memide.cc
memide.cc
+2
-1
net.cc
net.cc
+1
-1
pipe.cc
pipe.cc
+1
-1
prof.cc
prof.cc
+1
-1
sampler.cc
sampler.cc
+1
-1
spinlock.cc
spinlock.cc
+1
-1
sysfile.cc
sysfile.cc
+1
-1
没有找到文件。
bio.cc
浏览文件 @
ad992686
...
...
@@ -26,9 +26,9 @@ extern "C" {
#include "kernel.h"
#include "spinlock.h"
#include "condvar.h"
#include "buf.h"
}
#include "buf.hh"
#include "cpputil.hh"
#include "ns.hh"
...
...
buf.h
→
buf.h
h
浏览文件 @
ad992686
移动文件
console.cc
浏览文件 @
ad992686
...
...
@@ -11,7 +11,7 @@ extern "C" {
#include "condvar.h"
}
#include "file.h"
#include "file.h
h
"
extern
"C"
{
#include "amd64.h"
...
...
exec.cc
浏览文件 @
ad992686
...
...
@@ -11,7 +11,7 @@ extern "C" {
#include "fs.h"
}
#include "file.h"
#include "file.h
h
"
extern
"C"
{
#include "elf.h"
...
...
file.cc
浏览文件 @
ad992686
...
...
@@ -6,7 +6,7 @@ extern "C" {
#include "fs.h"
}
#include "file.h"
#include "file.h
h
"
extern
"C"
{
#include "stat.h"
...
...
file.h
→
file.h
h
浏览文件 @
ad992686
#ifdef __cplusplus
#include "cpputil.hh"
#include "ns.hh"
u64
namehash
(
const
strbuf
<
DIRSIZ
>&
);
#endif
struct
file
{
enum
{
FD_NONE
,
FD_PIPE
,
FD_INODE
,
FD_SOCKET
}
type
;
...
...
@@ -30,11 +28,7 @@ struct inode {
struct
condvar
cv
;
struct
spinlock
lock
;
char
lockname
[
16
];
#ifdef __cplusplus
xns
<
strbuf
<
DIRSIZ
>
,
u32
,
namehash
>
*
dir
;
#else
void
*
dir
;
#endif
short
type
;
// copy of disk inode
short
major
;
...
...
fs.cc
浏览文件 @
ad992686
...
...
@@ -19,11 +19,11 @@ extern "C" {
#include "condvar.h"
#include "queue.h"
#include "proc.h"
#include "buf.h"
#include "fs.h"
}
#include "file.h"
#include "buf.hh"
#include "file.hh"
extern
"C"
{
#include "cpu.h"
...
...
kernlet.c
→
kernlet.c
c
浏览文件 @
ad992686
extern
"C"
{
#include "types.h"
#include "kernel.h"
#include "spinlock.h"
...
...
@@ -6,16 +7,18 @@
#include "proc.h"
#include "vm.h"
#include "fs.h"
#include "file.h"
#include "wq.h"
#include "ipc.h"
}
#include "file.hh"
static
void
pread_work
(
struct
work
*
w
,
void
*
a0
,
void
*
a1
,
void
*
a2
,
void
*
a3
)
{
struct
inode
*
ip
=
a0
;
void
*
kshared
=
a1
;
struct
ipcctl
*
ipc
=
kshared
;
struct
inode
*
ip
=
(
inode
*
)
a0
;
void
*
kshared
=
(
void
*
)
a1
;
struct
ipcctl
*
ipc
=
(
ipcctl
*
)
kshared
;
size_t
count
=
(
uptr
)
a2
;
off_t
off
=
(
uptr
)
a3
;
int
r
;
...
...
@@ -26,7 +29,7 @@ pread_work(struct work *w, void *a0, void *a1, void *a2, void *a3)
//cprintf("1: %p %p %lu %lu\n", ip, buf, count, off);
ilock
(
ip
,
0
);
r
=
readi
(
ip
,
kshared
+
PGSIZE
,
off
,
count
);
r
=
readi
(
ip
,
((
char
*
)
kshared
)
+
PGSIZE
,
off
,
count
);
iunlock
(
ip
);
ipc
->
result
=
r
;
...
...
@@ -41,11 +44,11 @@ pread_allocwork(struct inode *ip, void *buf, size_t count, off_t off)
{
struct
work
*
w
=
allocwork
();
if
(
w
==
NULL
)
return
NULL
;
return
0
;
//cprintf("0: %p %p %lu %lu\n", ip, buf, count, off);
w
->
rip
=
pread_work
;
w
->
rip
=
(
void
*
)
pread_work
;
w
->
arg0
=
ip
;
w
->
arg1
=
buf
;
w
->
arg2
=
(
void
*
)
count
;
...
...
@@ -63,7 +66,7 @@ sys_kernlet(int fd, size_t count, off_t off)
if
(
fd
<
0
||
fd
>=
NOFILE
||
(
f
=
myproc
()
->
ofile
[
fd
])
==
0
)
return
-
1
;
if
(
f
->
type
!=
FD_INODE
)
if
(
f
->
type
!=
file
::
FD_INODE
)
return
-
1
;
fetchadd
(
&
f
->
ip
->
ref
,
1
);
...
...
memide.cc
浏览文件 @
ad992686
...
...
@@ -11,9 +11,10 @@ extern "C" {
#include "proc.h"
#include "amd64.h"
#include "traps.h"
#include "buf.h"
}
#include "buf.hh"
extern
u8
_fs_img_start
[];
extern
u64
_fs_img_size
;
...
...
net.cc
浏览文件 @
ad992686
...
...
@@ -22,7 +22,7 @@ extern "C" {
#include "fs.h"
}
#include "file.h"
#include "file.h
h
"
extern
"C"
{
#include "net.h"
...
...
pipe.cc
浏览文件 @
ad992686
...
...
@@ -9,7 +9,7 @@ extern "C" {
#include "fs.h"
}
#include "file.h"
#include "file.h
h
"
extern
"C"
{
#include "cpu.h"
...
...
prof.cc
浏览文件 @
ad992686
...
...
@@ -6,7 +6,7 @@ extern "C" {
#include "fs.h"
}
#include "file.h"
#include "file.h
h
"
extern
"C"
{
#include "prof.h"
...
...
sampler.cc
浏览文件 @
ad992686
...
...
@@ -6,7 +6,7 @@ extern "C" {
#include "kernel.h"
}
#include "file.h"
#include "file.h
h
"
extern
"C"
{
#include "bits.h"
...
...
spinlock.cc
浏览文件 @
ad992686
...
...
@@ -12,7 +12,7 @@ extern "C" {
#include "fs.h"
}
#include "file.h"
#include "file.h
h
"
#if LOCKSTAT
static
int
lockstat_enable
;
...
...
sysfile.cc
浏览文件 @
ad992686
...
...
@@ -10,7 +10,7 @@ extern "C" {
#include "fs.h"
}
#include "file.h"
#include "file.h
h
"
extern
"C"
{
#include "fcntl.h"
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论