Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
f336c8cd
提交
f336c8cd
2月 16, 2012
创建
作者:
Nickolai Zeldovich
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
nearly-complete c++ conversion
上级
b2705655
隐藏空白字符变更
内嵌
并排
正在显示
59 个修改的文件
包含
199 行增加
和
262 行删除
+199
-262
bio.cc
bio.cc
+2
-4
bootdata.c
bootdata.c
+1
-1
cga.cc
cga.cc
+1
-3
condvar.cc
condvar.cc
+4
-6
condvar.hh
condvar.hh
+0
-0
console.cc
console.cc
+5
-11
cpprt.cc
cpprt.cc
+1
-4
cpu.hh
cpu.hh
+0
-0
crange.cc
crange.cc
+10
-10
crange.hh
crange.hh
+1
-1
e1000.cc
e1000.cc
+3
-5
e1000reg.hh
e1000reg.hh
+0
-0
exec.cc
exec.cc
+5
-11
file.cc
file.cc
+3
-9
fmt.cc
fmt.cc
+3
-4
fmt.hh
fmt.hh
+0
-0
fs.cc
fs.cc
+4
-10
gc.cc
gc.cc
+4
-7
hwvm.cc
hwvm.cc
+5
-8
hz.cc
hz.cc
+1
-3
ioapic.cc
ioapic.cc
+1
-3
ipc.hh
ipc.hh
+0
-0
kalloc.cc
kalloc.cc
+2
-4
kbd.c
kbd.c
+1
-1
kern_c.h
kern_c.h
+59
-0
kernel.hh
kernel.hh
+4
-4
kernlet.cc
kernlet.cc
+6
-9
kmalloc.cc
kmalloc.cc
+2
-4
lapic.cc
lapic.cc
+1
-3
main.cc
main.cc
+2
-4
memide.cc
memide.cc
+3
-5
mp.cc
mp.cc
+2
-4
net.cc
net.cc
+6
-10
net.hh
net.hh
+0
-0
pci.cc
pci.cc
+3
-5
pci.hh
pci.hh
+0
-0
pcireg.hh
pcireg.hh
+0
-0
picirq.cc
picirq.cc
+1
-3
pipe.cc
pipe.cc
+4
-10
preadtest.cc
preadtest.cc
+1
-1
printf.cc
printf.cc
+1
-3
proc.cc
proc.cc
+5
-8
proc.hh
proc.hh
+0
-0
prof.cc
prof.cc
+3
-9
prof.hh
prof.hh
+0
-0
rnd.cc
rnd.cc
+2
-4
sampler.cc
sampler.cc
+3
-9
sched.cc
sched.cc
+5
-8
sched.hh
sched.hh
+0
-0
spinlock.cc
spinlock.cc
+3
-6
string.cc
string.cc
+1
-3
syscall.cc
syscall.cc
+4
-6
sysfile.cc
sysfile.cc
+5
-11
sysproc.cc
sysproc.cc
+4
-7
trap.cc
trap.cc
+4
-6
uart.cc
uart.cc
+1
-3
vm.cc
vm.cc
+4
-7
wq.cc
wq.cc
+3
-5
wq.hh
wq.hh
+0
-0
没有找到文件。
bio.cc
浏览文件 @
f336c8cd
...
...
@@ -21,12 +21,10 @@
// * B_DIRTY: the buffer data has been modified
// and needs to be written to disk.
extern
"C"
{
#include "types.h"
#include "kernel.h"
#include "kernel.h
h
"
#include "spinlock.h"
#include "condvar.h"
}
#include "condvar.hh"
#include "buf.hh"
#include "cpputil.hh"
...
...
bootdata.c
浏览文件 @
f336c8cd
...
...
@@ -3,7 +3,7 @@
#include "spinlock.h"
#include "kalloc.h"
#include "syscall.h"
#include "kern
el
.h"
#include "kern
_c
.h"
/*
* Data structures that use C99 designated initializers,
...
...
cga.cc
浏览文件 @
f336c8cd
extern
"C"
{
#include "types.h"
#include "kernel.h"
#include "kernel.h
h
"
#include "amd64.h"
}
#define BACKSPACE 0x100
#define CRTPORT 0x3d4
...
...
condvar.cc
浏览文件 @
f336c8cd
extern
"C"
{
#include "types.h"
#include "amd64.h"
#include "mmu.h"
#include "spinlock.h"
#include "condvar.h"
#include "condvar.h
h
"
#include "queue.h"
#include "proc.h"
#include "kernel.h"
#include "cpu.h"
}
#include "proc.hh"
#include "kernel.hh"
#include "cpu.hh"
struct
spinlock
tickslock
__mpalign__
;
struct
condvar
cv_ticks
__mpalign__
;
...
...
condvar.h
→
condvar.h
h
浏览文件 @
f336c8cd
移动文件
console.cc
浏览文件 @
f336c8cd
...
...
@@ -2,27 +2,21 @@
// Input is from the keyboard or serial port.
// Output is written to the screen and serial port.
extern
"C"
{
#include "types.h"
#include "cpu.h"
#include "kernel.h"
#include "cpu.h
h
"
#include "kernel.h
h
"
#include "spinlock.h"
#include "fs.h"
#include "condvar.h"
}
#include "condvar.hh"
#include "file.hh"
extern
"C"
{
#include "amd64.h"
#include "queue.h"
#include "proc.h"
#include "proc.h
h
"
#include "traps.h"
#include "lib.h"
#include <stdarg.h>
#include "fmt.h"
#include "fmt.h
h
"
#include <stddef.h>
}
#define BACKSPACE 0x100
...
...
cpprt.cc
浏览文件 @
f336c8cd
extern
"C"
{
#include "types.h"
#include "kernel.h"
}
#include "kernel.hh"
#include "cpputil.hh"
void
*
...
...
cpu.h
→
cpu.h
h
浏览文件 @
f336c8cd
移动文件
crange.cc
浏览文件 @
f336c8cd
extern
"C"
{
#include "types.h"
#include "kernel.h"
#include "kernel.h
h
"
#include "mmu.h"
#include "spinlock.h"
#include "condvar.h"
#include "condvar.h
h
"
#include "queue.h"
#include "proc.h"
#include "cpu.h"
}
#include "proc.hh"
#include "cpu.hh"
#include "gc.hh"
#include "crange.hh"
#include "cpputil.hh"
...
...
@@ -110,7 +108,7 @@ void range::dec_ref(void)
}
}
range
::
range
(
crange
*
crarg
,
u64
k
,
u64
sz
,
void
*
v
,
markptr
<
range
>
n
,
int
nl
)
range
::
range
(
crange
*
crarg
,
u64
k
,
u64
sz
,
void
*
v
,
range
*
n
,
int
nl
)
:
rcu_freed
(
"range_delayed"
)
{
dprintf
(
"range:range:: %lu %lu %d
\n
"
,
k
,
sz
,
nl
);
...
...
@@ -227,10 +225,12 @@ static range *replace(u64 k, u64 sz, void *v, range *f, range *l, range *s)
r
=
left
;
}
else
if
(
k
<=
f
->
key
)
{
// cut front?
assert
(
k
+
sz
<=
f
->
key
+
f
->
size
);
r
=
new
range
(
f
->
cr
,
k
+
sz
,
f
->
key
+
f
->
size
-
k
-
sz
,
v
,
f
->
next
[
0
]);
assert
(
!
f
->
next
[
0
].
mark
());
r
=
new
range
(
f
->
cr
,
k
+
sz
,
f
->
key
+
f
->
size
-
k
-
sz
,
v
,
f
->
next
[
0
].
ptr
());
}
else
{
// cut end
assert
(
k
>
f
->
key
);
r
=
new
range
(
f
->
cr
,
f
->
key
,
k
-
f
->
key
,
v
,
f
->
next
[
0
]);
assert
(
!
f
->
next
[
0
].
mark
());
r
=
new
range
(
f
->
cr
,
f
->
key
,
k
-
f
->
key
,
v
,
f
->
next
[
0
].
ptr
());
}
}
}
else
if
(
k
<=
f
->
key
&&
k
+
sz
>=
l
->
key
+
l
->
size
)
{
// delete complete range?
...
...
@@ -383,7 +383,7 @@ void crange::add_index(int l, range *e, range *p1, markptr<range> s1)
if
(
cmpxch
(
&
e
->
curlevel
,
l
,
l
+
1
))
{
assert
(
e
->
curlevel
<
e
->
nlevel
);
// this is the core inserting at level l+1, but some core may be deleting
struct
range
*
s
=
s1
.
ptr
();
struct
range
*
s
=
s1
.
ptr
();
// XXX losing the mark bit ???
do
{
markptr
<
range
>
n
=
e
->
next
[
l
+
1
];
// Null and perhaps marked
if
(
n
.
mark
())
{
...
...
crange.hh
浏览文件 @
f336c8cd
...
...
@@ -93,7 +93,7 @@ struct range : public rcu_freed {
markptr
<
range
>*
next
;
// one next pointer per level
spinlock
*
lock
;
// on separate cache line?
range
(
crange
*
cr
,
u64
k
,
u64
sz
,
void
*
v
,
markptr
<
range
>
n
,
int
nlevel
=
0
);
range
(
crange
*
cr
,
u64
k
,
u64
sz
,
void
*
v
,
range
*
n
,
int
nlevel
=
0
);
~
range
();
virtual
void
do_gc
()
{
delete
this
;
...
...
e1000.cc
浏览文件 @
f336c8cd
extern
"C"
{
#include "types.h"
#include "amd64.h"
#include "kernel.h"
#include "pci.h"
#include "kernel.h
h
"
#include "pci.h
h
"
#include "spinlock.h"
#include "e1000reg.h"
}
#include "e1000reg.hh"
#define TX_RING_SIZE 64
#define RX_RING_SIZE 64
...
...
e1000reg.h
→
e1000reg.h
h
浏览文件 @
f336c8cd
移动文件
exec.cc
浏览文件 @
f336c8cd
extern
"C"
{
#include "types.h"
#include "mmu.h"
#include "spinlock.h"
#include "condvar.h"
#include "condvar.h
h
"
#include "queue.h"
#include "proc.h"
#include "kernel.h"
#include "proc.h
h
"
#include "kernel.h
h
"
#include "amd64.h"
#include "stat.h"
#include "fs.h"
}
#include "file.hh"
#include "vm.hh"
extern
"C"
{
#include "elf.h"
#include "cpu.h"
#include "prof.h"
#include "cpu.h
h
"
#include "prof.h
h
"
#include <stddef.h>
}
#define USTACKPAGES 2
#define BRK (USERTOP >> 1)
...
...
file.cc
浏览文件 @
f336c8cd
extern
"C"
{
#include "types.h"
#include "spinlock.h"
#include "condvar.h"
#include "kernel.h"
#include "condvar.h
h
"
#include "kernel.h
h
"
#include "fs.h"
}
#include "file.hh"
extern
"C"
{
#include "stat.h"
#include "net.h"
}
#include "net.hh"
struct
devsw
__mpalign__
devsw
[
NDEV
];
...
...
fmt.cc
浏览文件 @
f336c8cd
extern
"C"
{
#include "types.h"
#include <stddef.h>
#include <stdarg.h>
#include "fmt.h"
#include "fmt.h
h
"
#include "lib.h"
unsigned
int
strlen
(
const
char
*
);
}
extern
"C"
unsigned
int
strlen
(
const
char
*
);
//
// Print a number (base <= 16) in reverse order,
...
...
fmt.h
→
fmt.h
h
浏览文件 @
f336c8cd
移动文件
fs.cc
浏览文件 @
f336c8cd
...
...
@@ -10,24 +10,18 @@
// routines. The (higher-level) system call implementations
// are in sysfile.c.
extern
"C"
{
#include "types.h"
#include "stat.h"
#include "mmu.h"
#include "kernel.h"
#include "kernel.h
h
"
#include "spinlock.h"
#include "condvar.h"
#include "condvar.h
h
"
#include "queue.h"
#include "proc.h"
#include "proc.h
h
"
#include "fs.h"
}
#include "buf.hh"
#include "file.hh"
extern
"C"
{
#include "cpu.h"
}
#include "cpu.hh"
#define min(a, b) ((a) < (b) ? (a) : (b))
static
void
itrunc
(
struct
inode
*
);
...
...
gc.cc
浏览文件 @
f336c8cd
extern
"C"
{
#include "types.h"
#include "kernel.h"
#include "kernel.h
h
"
#include "mmu.h"
#include "amd64.h"
#include "spinlock.h"
#include "condvar.h"
#include "condvar.h
h
"
#include "queue.h"
#include "proc.h"
#include "cpu.h"
}
#include "proc.hh"
#include "cpu.hh"
#include "ns.hh"
#include "atomic.hh"
...
...
hwvm.cc
浏览文件 @
f336c8cd
extern
"C"
{
#include "types.h"
#include "amd64.h"
#include "mmu.h"
#include "cpu.h"
#include "kernel.h"
#include "cpu.h
h
"
#include "kernel.h
h
"
#include "bits.h"
#include "spinlock.h"
#include "kalloc.h"
#include "queue.h"
#include "condvar.h"
#include "proc.h"
#include <stddef.h>
}
#include "condvar.hh"
#include "proc.hh"
#include "vm.hh"
#include <stddef.h>
extern
pml4e_t
kpml4
[];
...
...
hz.cc
浏览文件 @
f336c8cd
// Intel 8253/8254/82C54 Programmable Interval Timer (PIT).
// http://en.wikipedia.org/wiki/Intel_8253
extern
"C"
{
#include "types.h"
#include "amd64.h"
#include "kernel.h"
}
#include "kernel.hh"
#define IO_TIMER1 0x040 // 8253 Timer #1
#define TIMER_FREQ 1193182
...
...
ioapic.cc
浏览文件 @
f336c8cd
...
...
@@ -2,11 +2,9 @@
// http://www.intel.com/design/chipsets/datashts/29056601.pdf
// See also picirq.c.
extern
"C"
{
#include "types.h"
#include "traps.h"
#include "kernel.h"
}
#include "kernel.hh"
#define IOAPIC (KBASE + 0xFEC00000) // Default physical address of IO APIC
...
...
ipc.h
→
ipc.h
h
浏览文件 @
f336c8cd
移动文件
kalloc.cc
浏览文件 @
f336c8cd
...
...
@@ -3,16 +3,14 @@
// Slab allocator, for chunks larger than one page.
//
extern
"C"
{
#include "types.h"
#include "mmu.h"
#include "kernel.h"
#include "kernel.h
h
"
#include "spinlock.h"
#include "kalloc.h"
#include "mtrace.h"
#include "cpu.h"
#include "cpu.h
h
"
#include "multiboot.h"
}
static
struct
Mbmem
mem
[
128
];
static
u64
nmem
;
...
...
kbd.c
浏览文件 @
f336c8cd
#include "types.h"
#include "amd64.h"
#include "kern
el
.h"
#include "kern
_c
.h"
#include "kbd.h"
int
...
...
kern_c.h
0 → 100644
浏览文件 @
f336c8cd
#include "mmu.h"
#include "lib.h"
// console.c
void
consoleintr
(
int
(
*
)(
void
));
// kbd.c
void
kbdintr
(
void
);
// swtch.S
struct
context
;
void
swtch
(
struct
context
**
,
struct
context
*
);
// trap.c
extern
struct
segdesc
bootgdt
[
NSEGS
];
// syscalls
long
sys_chdir
(
void
);
long
sys_close
(
void
);
long
sys_dup
(
void
);
long
sys_exec
(
void
);
long
sys_exit
(
void
);
long
sys_fork
(
void
);
long
sys_fstat
(
void
);
long
sys_getpid
(
void
);
long
sys_kill
(
void
);
long
sys_link
(
void
);
long
sys_mkdir
(
void
);
long
sys_mknod
(
void
);
long
sys_open
(
void
);
long
sys_pipe
(
void
);
long
sys_read
(
void
);
long
sys_sbrk
(
void
);
long
sys_sleep
(
void
);
long
sys_unlink
(
void
);
long
sys_wait
(
void
);
long
sys_write
(
void
);
long
sys_uptime
(
void
);
long
sys_map
(
void
);
long
sys_unmap
(
void
);
long
sys_halt
(
void
);
long
sys_socket
(
int
,
int
,
int
);
long
sys_bind
(
int
,
void
*
,
int
);
long
sys_listen
(
int
,
int
);
long
sys_accept
(
int
,
void
*
,
void
*
);
long
sys_pread
(
int
fd
,
void
*
ubuf
,
size_t
count
,
off_t
offset
);
long
sys_kernlet
(
int
,
size_t
,
off_t
);
extern
long
(
*
syscalls
[])(
u64
,
u64
,
u64
,
u64
,
u64
,
u64
);
// other exported/imported functions
void
cmain
(
u64
mbmagic
,
u64
mbaddr
);
void
mpboot
(
void
);
void
trapret
(
void
);
void
threadstub
(
void
);
void
threadhelper
(
void
(
*
fn
)(
void
*
),
void
*
arg
);
struct
trapframe
;
void
trap
(
struct
trapframe
*
tf
);
kernel.h
→
kernel.h
h
浏览文件 @
f336c8cd
#include "mmu.h"
#include "lib.h"
extern
"C"
{
#include "kern_c.h"
}
#define KBASE 0xFFFFFF0000000000ull
#define KSHARED 0xFFFFF00000000000ull
...
...
@@ -51,7 +52,6 @@ void panic(const char*, ...)
__noret__
__attribute__
((
format
(
printf
,
1
,
2
)));
void
kerneltrap
(
struct
trapframe
*
tf
)
__noret__
;
void
snprintf
(
char
*
buf
,
u32
n
,
const
char
*
fmt
,
...);
void
consoleintr
(
int
(
*
)(
void
));
#define assert(c) if (!(c)) { cprintf("%s:%d: ", __FILE__, __LINE__); panic("assertion failure"); }
...
...
@@ -224,7 +224,7 @@ void* memmove(void*, const void*, u32);
void
*
memset
(
void
*
,
int
,
u32
);
void
*
memcpy
(
void
*
,
const
void
*
,
u32
);
char
*
safestrcpy
(
char
*
,
const
char
*
,
u32
);
unsigned
int
strlen
(
const
char
*
);
extern
"C"
unsigned
int
strlen
(
const
char
*
);
int
strncmp
(
const
char
*
,
const
char
*
,
u32
);
char
*
strncpy
(
char
*
,
const
char
*
,
u32
);
int
strcmp
(
const
char
*
p
,
const
char
*
q
);
...
...
kernlet.cc
浏览文件 @
f336c8cd
extern
"C"
{
#include "types.h"
#include "kernel.h"
#include "kernel.h
h
"
#include "spinlock.h"
#include "condvar.h"
#include "cpu.h"
#include "proc.h"
#include "condvar.h
h
"
#include "cpu.h
h
"
#include "proc.h
h
"
#include "fs.h"
#include "wq.h"
#include "ipc.h"
}
#include "wq.hh"
#include "ipc.hh"
#include "vm.hh"
#include "file.hh"
...
...
kmalloc.cc
浏览文件 @
f336c8cd
...
...
@@ -2,15 +2,13 @@
// Allocate objects smaller than a page.
//
extern
"C"
{
#include "types.h"
#include "mmu.h"
#include "kernel.h"
#include "kernel.h
h
"
#include "spinlock.h"
#include "kalloc.h"
#include "mtrace.h"
#include "cpu.h"
}
#include "cpu.hh"
// allocate in power-of-two sizes up to 2^KMMAX
// must be < 12
...
...
lapic.cc
浏览文件 @
f336c8cd
// The local APIC manages internal (non-I/O) interrupts.
// See Chapter 8 & Appendix C of Intel processor manual volume 3.
extern
"C"
{
#include "types.h"
#include "amd64.h"
#include "kernel.h"
#include "kernel.h
h
"
#include "traps.h"
#include "bits.h"
}
// Local APIC registers, divided by 4 for use as uint[] indices.
#define ID (0x0020/4) // ID
...
...
main.cc
浏览文件 @
f336c8cd
extern
"C"
{
#include "types.h"
#include "multiboot.h"
#include "kernel.h"
#include "kernel.h
h
"
#include "spinlock.h"
#include "kalloc.h"
#include "cpu.h"
#include "cpu.h
h
"
#include "amd64.h"
}
static
volatile
int
bstate
;
...
...
memide.cc
浏览文件 @
f336c8cd
// Fake IDE disk; stores blocks in memory.
// Useful for running kernel without scratch disk.
extern
"C"
{
#include "types.h"
#include "mmu.h"
#include "kernel.h"
#include "kernel.h
h
"
#include "spinlock.h"
#include "queue.h"
#include "condvar.h"
#include "proc.h"
#include "condvar.h
h
"
#include "proc.h
h
"
#include "amd64.h"
#include "traps.h"
}
#include "buf.hh"
...
...
mp.cc
浏览文件 @
f336c8cd
...
...
@@ -2,13 +2,11 @@
// Search memory for MP description structures.
// http://developer.intel.com/design/pentium/datashts/24201606.pdf
extern
"C"
{
#include "types.h"
#include "amd64.h"
#include "mp.h"
#include "kernel.h"
#include "cpu.h"
}
#include "kernel.hh"
#include "cpu.hh"
struct
cpu
cpus
[
NCPU
];
static
struct
cpu
*
bcpu
__mpalign__
;
...
...
net.cc
浏览文件 @
f336c8cd
...
...
@@ -10,28 +10,24 @@ extern "C" {
}
#endif
extern
"C"
{
#include "types.h"
#include "kernel.h"
#include "kernel.h
h
"
#include "queue.h"
#ifndef LWIP
#include "spinlock.h"
#include "condvar.h"
#include "condvar.h
h
"
#endif
#include "proc.h"
#include "proc.h
h
"
#include "fs.h"
}
#include "file.hh"
extern
"C"
{
#include "net.h"
#include "net.hh"
#ifdef LWIP
extern
"C"
{
err_t
if_init
(
struct
netif
*
netif
);
void
if_input
(
struct
netif
*
netif
,
void
*
buf
,
u16
len
);
#endif
}
#endif
void
netfree
(
void
*
va
)
...
...
net.h
→
net.h
h
浏览文件 @
f336c8cd
移动文件
pci.cc
浏览文件 @
f336c8cd
extern
"C"
{
#include "types.h"
#include "amd64.h"
#include "kernel.h"
#include "pci.h"
#include "pcireg.h"
}
#include "kernel.hh"
#include "pci.hh"
#include "pcireg.hh"
extern
int
e1000attach
(
struct
pci_func
*
pcif
);
extern
int
e1000eattach
(
struct
pci_func
*
pcif
);
...
...
pci.h
→
pci.h
h
浏览文件 @
f336c8cd
移动文件
pcireg.h
→
pcireg.h
h
浏览文件 @
f336c8cd
移动文件
picirq.cc
浏览文件 @
f336c8cd
// Intel 8259A programmable interrupt controllers.
extern
"C"
{
#include "types.h"
#include "amd64.h"
#include "traps.h"
#include "kernel.h"
}
#include "kernel.hh"
// I/O Addresses of the two programmable interrupt controllers
#define IO_PIC1 0x20 // Master (IRQs 0-7)
...
...
pipe.cc
浏览文件 @
f336c8cd
extern
"C"
{
#include "types.h"
#include "mmu.h"
#include "kernel.h"
#include "kernel.h
h
"
#include "spinlock.h"
#include "condvar.h"
#include "condvar.h
h
"
#include "queue.h"
#include "proc.h"
#include "proc.h
h
"
#include "fs.h"
}
#include "file.hh"
extern
"C"
{
#include "cpu.h"
}
#include "cpu.hh"
#define PIPESIZE 512
...
...
preadtest.cc
浏览文件 @
f336c8cd
...
...
@@ -4,7 +4,7 @@
#include "user.h"
#include "lib.h"
#include "amd64.h"
#include "ipc.h"
#include "ipc.h
h
"
// XXX(sbw) add a memlayout.h?
#define KSHARED 0xFFFFF00000000000ull
...
...
printf.cc
浏览文件 @
f336c8cd
#include "types.h"
#include "stat.h"
#include "user.h"
extern
"C"
{
#include <stdarg.h>
#include "fmt.h"
}
#include "fmt.hh"
// Print to the given fd.
static
void
...
...
proc.cc
浏览文件 @
f336c8cd
extern
"C"
{
#include "types.h"
#include "kernel.h"
#include "kernel.h
h
"
#include "mmu.h"
#include "amd64.h"
#include "spinlock.h"
#include "condvar.h"
#include "condvar.h
h
"
#include "queue.h"
#include "proc.h"
#include "cpu.h"
#include "proc.h
h
"
#include "cpu.h
h
"
#include "bits.h"
#include "kmtrace.h"
#include "sched.h"
#include "sched.h
h
"
#include "kalloc.h"
}
#include "vm.hh"
#include "ns.hh"
...
...
proc.h
→
proc.h
h
浏览文件 @
f336c8cd
移动文件
prof.cc
浏览文件 @
f336c8cd
extern
"C"
{
#include "types.h"
#include "kernel.h"
#include "kernel.h
h
"
#include "spinlock.h"
#include "condvar.h"
#include "condvar.h
h
"
#include "fs.h"
}
#include "file.hh"
extern
"C"
{
#include "prof.h"
#include "prof.hh"
#include "bits.h"
#include "amd64.h"
}
extern
profctr_t
sprof
[];
extern
profctr_t
eprof
[];
...
...
prof.h
→
prof.h
h
浏览文件 @
f336c8cd
移动文件
rnd.cc
浏览文件 @
f336c8cd
extern
"C"
{
#include "param.h"
#include "types.h"
#include "kernel.h"
#include "cpu.h"
}
#include "kernel.hh"
#include "cpu.hh"
struct
seed
{
u64
v
;
...
...
sampler.cc
浏览文件 @
f336c8cd
extern
"C"
{
#include "types.h"
#include "spinlock.h"
#include "condvar.h"
#include "condvar.h
h
"
#include "fs.h"
#include "kernel.h"
#include "kernel.h
h
"
#include "stat.h"
#include "kalloc.h"
}
#include "file.hh"
extern
"C"
{
#include "bits.h"
#include "amd64.h"
#include "cpu.h"
#include "cpu.h
h
"
#include "sampler.h"
}
#define LOGHEADER_SZ (sizeof(struct logheader) + \
sizeof(((struct logheader*)0)->cpu[0])*NCPU)
...
...
sched.cc
浏览文件 @
f336c8cd
extern
"C"
{
#include "types.h"
#include "kernel.h"
#include "kernel.h
h
"
#include "mmu.h"
#include "amd64.h"
#include "spinlock.h"
#include "condvar.h"
#include "condvar.h
h
"
#include "queue.h"
#include "proc.h"
#include "cpu.h"
#include "proc.h
h
"
#include "cpu.h
h
"
#include "bits.h"
#include "kmtrace.h"
#include "sched.h"
#include <stddef.h>
}
#include "vm.hh"
#include <stddef.h>
enum
{
sched_debug
=
0
};
...
...
sched.h
→
sched.h
h
浏览文件 @
f336c8cd
移动文件
spinlock.cc
浏览文件 @
f336c8cd
// Mutual exclusion spin locks.
extern
"C"
{
#include "types.h"
#include "kernel.h"
#include "kernel.h
h
"
#include "amd64.h"
#include "cpu.h"
#include "cpu.h
h
"
#include "bits.h"
#include "spinlock.h"
#include "mtrace.h"
#include "condvar.h"
#include "condvar.h
h
"
#include "fs.h"
}
#include "file.hh"
#if LOCKSTAT
...
...
string.cc
浏览文件 @
f336c8cd
extern
"C"
{
#include "types.h"
#include "amd64.h"
#include "kernel.h"
}
#include "kernel.hh"
void
*
memset
(
void
*
dst
,
int
c
,
u32
n
)
...
...
syscall.cc
浏览文件 @
f336c8cd
extern
"C"
{
#include "types.h"
#include "mmu.h"
#include "kernel.h"
#include "kernel.h
h
"
#include "spinlock.h"
#include "condvar.h"
#include "condvar.h
h
"
#include "queue.h"
#include "proc.h"
#include "proc.h
h
"
#include "amd64.h"
#include "syscall.h"
#include "cpu.h"
#include "cpu.h
h
"
#include "kmtrace.h"
}
// User code makes a system call with INT T_SYSCALL.
// System call number in %eax.
...
...
sysfile.cc
浏览文件 @
f336c8cd
extern
"C"
{
#include "types.h"
#include "stat.h"
#include "mmu.h"
#include "kernel.h"
#include "kernel.h
h
"
#include "spinlock.h"
#include "condvar.h"
#include "condvar.h
h
"
#include "queue.h"
#include "proc.h"
#include "proc.h
h
"
#include "fs.h"
}
#include "file.hh"
extern
"C"
{
#include "fcntl.h"
#include "cpu.h"
#include "net.h"
}
#include "cpu.hh"
#include "net.hh"
// Fetch the nth word-sized system call argument as a file descriptor
// and return both the descriptor and the corresponding struct file.
...
...
sysproc.cc
浏览文件 @
f336c8cd
extern
"C"
{
#include "types.h"
#include "amd64.h"
#include "kernel.h"
#include "kernel.h
h
"
#include "mmu.h"
#include "spinlock.h"
#include "condvar.h"
#include "condvar.h
h
"
#include "queue.h"
#include "proc.h"
#include "cpu.h"
}
#include "proc.hh"
#include "cpu.hh"
#include "vm.hh"
long
...
...
trap.cc
浏览文件 @
f336c8cd
extern
"C"
{
#include "types.h"
#include "mmu.h"
#include "kernel.h"
#include "kernel.h
h
"
#include "amd64.h"
#include "cpu.h"
#include "cpu.h
h
"
#include "traps.h"
#include "queue.h"
#include "spinlock.h"
#include "condvar.h"
#include "proc.h"
#include "condvar.h
h
"
#include "proc.h
h
"
#include "kmtrace.h"
#include "bits.h"
}
struct
intdesc
idt
[
256
]
__attribute__
((
aligned
(
16
)));
...
...
uart.cc
浏览文件 @
f336c8cd
// Intel 8250 serial port (UART).
// http://en.wikibooks.org/wiki/Serial_Programming/8250_UART_Programming
extern
"C"
{
#include "types.h"
#include "kernel.h"
#include "kernel.h
h
"
#include "amd64.h"
#include "traps.h"
}
#define COM2 0x2f8
#define COM1 0x3f8
...
...
vm.cc
浏览文件 @
f336c8cd
extern
"C"
{
#include "types.h"
#include "amd64.h"
#include "mmu.h"
#include "cpu.h"
#include "kernel.h"
#include "cpu.h
h
"
#include "kernel.h
h
"
#include "bits.h"
#include "spinlock.h"
#include "kalloc.h"
#include "queue.h"
#include "condvar.h"
#include "proc.h"
}
#include "condvar.hh"
#include "proc.hh"
#include "vm.hh"
#include "gc.hh"
#include "crange.hh"
...
...
wq.cc
浏览文件 @
f336c8cd
extern
"C"
{
#include "types.h"
#include "kernel.h"
#include "kernel.h
h
"
#include "spinlock.h"
#include "amd64.h"
#include "cpu.h"
#include "wq.h"
}
#include "cpu.hh"
#include "wq.hh"
#define NSLOTS (1 << WQSHIFT)
...
...
wq.h
→
wq.h
h
浏览文件 @
f336c8cd
移动文件
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论