Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
e5ce2747
提交
e5ce2747
10月 31, 2011
创建
作者:
Silas Boyd-Wickizer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove defs.h (replaced by kernel.h).
上级
a0620682
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
0 行增加
和
278 行删除
+0
-278
defs.h
defs.h
+0
-278
没有找到文件。
defs.h
deleted
100644 → 0
浏览文件 @
a0620682
#include <stdarg.h>
struct
buf
;
struct
context
;
struct
file
;
struct
inode
;
struct
pipe
;
struct
proc
;
struct
spinlock
;
struct
condvar
;
struct
stat
;
struct
vmnode
;
struct
ns
;
struct
node
;
// bio.c
void
binit
(
void
);
struct
buf
*
bread
(
uint
,
uint
,
int
writer
);
void
brelse
(
struct
buf
*
,
int
writer
);
void
bwrite
(
struct
buf
*
);
// bonsai.c
struct
kv
{
uint
key
;
void
*
val
;
};
struct
kv
*
tree_find
(
struct
node
*
n
,
int
key
);
struct
kv
*
tree_find_gt
(
struct
node
*
n
,
int
key
);
struct
node
*
tree_insert
(
struct
node
*
n
,
struct
kv
*
kv
);
struct
node
*
tree_remove
(
struct
node
*
n
,
int
key
);
int
tree_foreach
(
struct
node
*
n
,
int
(
*
cb
)(
struct
kv
*
kv
,
void
*
),
void
*
);
void
tree_test
(
void
);
// condvar.c
void
initcondvar
(
struct
condvar
*
,
char
*
);
void
cv_sleep
(
struct
condvar
*
cv
,
struct
spinlock
*
);
void
cv_wakeup
(
struct
condvar
*
cv
);
// console.c
void
consoleinit
(
void
);
void
cprintf
(
char
*
,
...);
void
vsnprintf
(
char
*
buf
,
uint
n
,
char
*
fmt
,
va_list
ap
);
void
snprintf
(
char
*
buf
,
uint
n
,
char
*
fmt
,
...);
void
consoleintr
(
int
(
*
)(
void
));
void
panic
(
char
*
)
__attribute__
((
noreturn
));
// exec.c
int
exec
(
char
*
,
char
**
);
// file.c
struct
file
*
filealloc
(
void
);
void
fileclose
(
struct
file
*
);
struct
file
*
filedup
(
struct
file
*
);
void
fileinit
(
void
);
int
fileread
(
struct
file
*
,
char
*
,
int
n
);
int
filestat
(
struct
file
*
,
struct
stat
*
);
int
filewrite
(
struct
file
*
,
char
*
,
int
n
);
// fs.c
int
dirlink
(
struct
inode
*
,
char
*
,
uint
);
struct
inode
*
dirlookup
(
struct
inode
*
,
char
*
);
struct
inode
*
ialloc
(
uint
,
short
);
struct
inode
*
iget
(
uint
dev
,
uint
inum
);
struct
inode
*
idup
(
struct
inode
*
);
void
iinit
(
void
);
void
ilock
(
struct
inode
*
,
int
writer
);
void
iput
(
struct
inode
*
);
void
iunlock
(
struct
inode
*
);
void
iunlockput
(
struct
inode
*
);
void
iupdate
(
struct
inode
*
);
int
namecmp
(
const
char
*
,
const
char
*
);
struct
inode
*
namei
(
char
*
);
struct
inode
*
nameiparent
(
char
*
,
char
*
);
int
readi
(
struct
inode
*
,
char
*
,
uint
,
uint
);
void
stati
(
struct
inode
*
,
struct
stat
*
);
int
writei
(
struct
inode
*
,
char
*
,
uint
,
uint
);
void
dir_init
(
struct
inode
*
dp
);
void
dir_flush
(
struct
inode
*
dp
);
// ide.c
void
ideinit
(
void
);
void
ideintr
(
void
);
void
iderw
(
struct
buf
*
);
// ioapic.c
void
ioapicenable
(
int
irq
,
int
cpu
);
extern
uchar
ioapicid
;
void
ioapicinit
(
void
);
// kalloc.c
char
*
pgalloc
(
void
);
void
kinit
(
void
);
char
*
kalloc
(
void
);
void
kfree
(
void
*
);
void
*
kmalloc
(
uint
);
void
kmfree
(
void
*
);
// kbd.c
void
kbdintr
(
void
);
// lapic.c
int
cpunum
(
void
);
extern
volatile
uint
*
lapic
;
void
lapiceoi
(
void
);
void
lapicinit
(
int
);
void
lapic_tlbflush
(
uint
);
void
lapicstartap
(
uchar
,
uint
);
void
microdelay
(
int
);
// mp.c
extern
int
ismp
;
int
mpbcpu
(
void
);
void
mpinit
(
void
);
void
mpstartthem
(
void
);
// ns.c
enum
{
nskey_int
=
1
,
nskey_ii
,
nskey_str
,
nskey_dirname
,
nskey_iis
};
struct
nskey
{
int
type
;
union
{
uint
i
;
struct
{
uint
a
;
uint
b
;
}
ii
;
char
*
s
;
char
*
dirname
;
struct
{
uint
a
;
uint
b
;
char
*
s
;
}
iis
;
}
u
;
};
#define KI(v) (struct nskey){.type=nskey_int,.u.i=v}
#define KII(x,y) (struct nskey){.type=nskey_ii,.u.ii.a=x,.u.ii.b=y}
#define KS(v) (struct nskey){.type=nskey_str,.u.s=v}
#define KD(v) (struct nskey){.type=nskey_dirname,.u.dirname=v}
#define KIIS(x,y,z) (struct nskey){.type=nskey_iis,.u.iis.a=x, \
.u.iis.b=y, \
.u.iis.s=z}
void
nsinit
(
void
);
struct
ns
*
nsalloc
(
int
allowdup
);
void
nsfree
(
struct
ns
*
);
int
ns_allockey
(
struct
ns
*
);
int
ns_insert
(
struct
ns
*
,
struct
nskey
key
,
void
*
);
void
*
ns_lookup
(
struct
ns
*
,
struct
nskey
key
);
void
*
ns_remove
(
struct
ns
*
ns
,
struct
nskey
key
,
void
*
val
);
// removed val
void
*
ns_enumerate
(
struct
ns
*
ns
,
void
*
(
*
f
)(
void
*
,
void
*
,
void
*
),
void
*
arg
);
void
*
ns_enumerate_key
(
struct
ns
*
ns
,
struct
nskey
key
,
void
*
(
*
f
)(
void
*
,
void
*
),
void
*
arg
);
// picirq.c
void
picenable
(
int
);
void
picinit
(
void
);
// pipe.c
int
pipealloc
(
struct
file
**
,
struct
file
**
);
void
pipeclose
(
struct
pipe
*
,
int
);
int
piperead
(
struct
pipe
*
,
char
*
,
int
);
int
pipewrite
(
struct
pipe
*
,
char
*
,
int
);
//PAGEBREAK: 16
// proc.c
void
addrun
(
struct
proc
*
);
struct
proc
*
copyproc
(
struct
proc
*
);
void
exit
(
void
);
int
fork
(
int
);
int
growproc
(
int
);
int
kill
(
int
);
void
pinit
(
void
);
void
procdumpall
(
void
);
void
scheduler
(
void
)
__attribute__
((
noreturn
));
void
sched
(
void
);
void
userinit
(
void
);
int
wait
(
void
);
void
yield
(
void
);
void
migrate
(
struct
proc
*
);
// rcu.c
void
rcuinit
(
void
);
void
rcu_begin_write
(
struct
spinlock
*
);
void
rcu_end_write
(
struct
spinlock
*
);
void
rcu_begin_read
(
void
);
void
rcu_end_read
(
void
);
void
rcu_delayed
(
void
*
,
void
(
*
dofree
)(
void
*
));
void
rcu_delayed2
(
int
,
uint
,
void
(
*
dofree
)(
int
,
uint
));
void
rcu_gc
(
void
);
void
rcu_gc_worker
(
void
);
// swtch.S
void
swtch
(
struct
context
**
,
struct
context
*
);
// spinlock.c
void
acquire
(
struct
spinlock
*
);
void
getcallerpcs
(
void
*
,
uint
*
);
int
holding
(
struct
spinlock
*
);
void
initlock
(
struct
spinlock
*
,
char
*
);
void
release
(
struct
spinlock
*
);
void
pushcli
(
void
);
void
popcli
(
void
);
// string.c
int
memcmp
(
const
void
*
,
const
void
*
,
uint
);
void
*
memmove
(
void
*
,
const
void
*
,
uint
);
void
*
memset
(
void
*
,
int
,
uint
);
char
*
safestrcpy
(
char
*
,
const
char
*
,
int
);
int
strlen
(
const
char
*
);
int
strncmp
(
const
char
*
,
const
char
*
,
uint
);
char
*
strncpy
(
char
*
,
const
char
*
,
int
);
int
strcmp
(
const
char
*
p
,
const
char
*
q
);
// syscall.c
int
argint
(
int
,
int
*
);
int
argptr
(
int
,
char
**
,
int
);
int
argstr
(
int
,
char
**
);
int
fetchint
(
uint
,
int
*
);
int
fetchstr
(
uint
,
char
**
);
void
syscall
(
void
);
// timer.c
void
timerinit
(
void
);
// trap.c
void
idtinit
(
void
);
extern
uint
ticks
;
void
tvinit
(
void
);
extern
struct
spinlock
tickslock
;
extern
struct
condvar
cv_ticks
;
// uart.c
void
uartinit
(
void
);
void
uartintr
(
void
);
void
uartputc
(
int
);
// vm.c
void
printpgdir
(
pde_t
*
);
void
pginit
(
char
*
(
*
alloc
)());
void
seginit
(
void
);
void
kvmalloc
(
void
);
void
vmenable
(
void
);
char
*
uva2ka
(
pde_t
*
,
char
*
);
struct
vmnode
*
vmn_alloc
(
uint
,
uint
);
struct
vmnode
*
vmn_allocpg
(
uint
);
void
vmn_free
(
struct
vmnode
*
);
int
vmn_load
(
struct
vmnode
*
,
struct
inode
*
,
uint
,
uint
);
struct
vmap
*
vmap_alloc
(
void
);
void
vmap_decref
(
struct
vmap
*
);
struct
vma
*
vmap_lookup
(
struct
vmap
*
m
,
uint
start
,
uint
end
);
int
vmap_insert
(
struct
vmap
*
,
struct
vmnode
*
n
,
uint
);
int
vmap_remove
(
struct
vmap
*
,
uint
va_start
,
uint
len
);
struct
vmap
*
vmap_copy
(
struct
vmap
*
,
int
);
void
switchuvm
(
struct
proc
*
);
void
switchkvm
(
void
);
int
copyout
(
struct
vmap
*
,
uint
,
void
*
,
uint
);
int
copyin
(
struct
vmap
*
,
uint
,
void
*
,
uint
);
int
pagefault
(
struct
vmap
*
,
uint
,
uint
);
void
updatepages
(
pde_t
*
pgdir
,
void
*
begin
,
void
*
end
,
int
perm
);
// namecache.c
void
nc_init
();
struct
inode
*
nc_lookup
(
struct
inode
*
,
char
*
);
void
nc_insert
(
struct
inode
*
,
char
*
,
struct
inode
*
);
void
nc_invalidate
(
struct
inode
*
dir
,
char
*
name
);
// number of elements in fixed-size array
#define NELEM(x) (sizeof(x)/sizeof((x)[0]))
#define NULL 0
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论