Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
5516be1f
提交
5516be1f
8月 28, 2007
创建
作者:
rsc
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
spaces around else for rtm
上级
e4d6a211
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
23 行增加
和
24 行删除
+23
-24
console.c
console.c
+2
-2
fs.c
fs.c
+1
-2
ide.c
ide.c
+1
-1
kbd.c
kbd.c
+2
-2
mp.c
mp.c
+1
-1
pipe.c
pipe.c
+1
-1
printf.c
printf.c
+8
-8
proc.c
proc.c
+1
-1
string.c
string.c
+1
-1
syscall.c
syscall.c
+1
-1
sysfile.c
sysfile.c
+1
-1
umalloc.c
umalloc.c
+3
-3
没有找到文件。
console.c
浏览文件 @
5516be1f
...
...
@@ -51,7 +51,7 @@ cga_putc(int c)
else
if
(
c
==
BACKSPACE
){
if
(
pos
>
0
)
crt
[
--
pos
]
=
' '
|
0x0700
;
}
else
}
else
crt
[
pos
++
]
=
(
c
&
0xff
)
|
0x0700
;
// black on white
if
((
pos
/
80
)
>=
24
){
// Scroll up.
...
...
@@ -91,7 +91,7 @@ printint(int xx, int base, int sgn)
if
(
sgn
&&
xx
<
0
){
neg
=
1
;
x
=
0
-
xx
;
}
else
{
}
else
{
x
=
xx
;
}
...
...
fs.c
浏览文件 @
5516be1f
...
...
@@ -358,7 +358,6 @@ bmap(struct inode *ip, uint bn, int alloc)
panic
(
"bmap: out of range"
);
}
// PAGEBREAK: 30
// Truncate inode (discard contents).
static
void
itrunc
(
struct
inode
*
ip
)
...
...
@@ -565,7 +564,7 @@ skipelem(char *path, char *name)
len
=
path
-
s
;
if
(
len
>=
DIRSIZ
)
memmove
(
name
,
s
,
DIRSIZ
);
else
{
else
{
memmove
(
name
,
s
,
len
);
name
[
len
]
=
0
;
}
...
...
ide.c
浏览文件 @
5516be1f
...
...
@@ -81,7 +81,7 @@ ide_start_request(struct buf *b)
if
(
b
->
flags
&
B_DIRTY
){
outb
(
0x1f7
,
IDE_CMD_WRITE
);
outsl
(
0x1f0
,
b
->
data
,
512
/
4
);
}
else
{
}
else
{
outb
(
0x1f7
,
IDE_CMD_READ
);
}
}
...
...
kbd.c
浏览文件 @
5516be1f
...
...
@@ -20,12 +20,12 @@ kbd_getc(void)
if
(
data
==
0xE0
){
shift
|=
E0ESC
;
return
0
;
}
else
if
(
data
&
0x80
){
}
else
if
(
data
&
0x80
){
// Key released
data
=
(
shift
&
E0ESC
?
data
:
data
&
0x7F
);
shift
&=
~
(
shiftcode
[
data
]
|
E0ESC
);
return
0
;
}
else
if
(
shift
&
E0ESC
){
}
else
if
(
shift
&
E0ESC
){
// Last character was an E0 escape; or with 0x80
data
|=
0x80
;
shift
&=
~
E0ESC
;
...
...
mp.c
浏览文件 @
5516be1f
...
...
@@ -60,7 +60,7 @@ mp_search(void)
if
((
p
=
(
bda
[
0x0F
]
<<
8
)
|
bda
[
0x0E
])){
if
((
mp
=
mp_search1
((
uchar
*
)
p
,
1024
)))
return
mp
;
}
else
{
}
else
{
p
=
((
bda
[
0x14
]
<<
8
)
|
bda
[
0x13
])
*
1024
;
if
((
mp
=
mp_search1
((
uchar
*
)
p
-
1024
,
1024
)))
return
mp
;
...
...
pipe.c
浏览文件 @
5516be1f
...
...
@@ -65,7 +65,7 @@ pipeclose(struct pipe *p, int writable)
if
(
writable
){
p
->
writeopen
=
0
;
wakeup
(
&
p
->
readp
);
}
else
{
}
else
{
p
->
readopen
=
0
;
wakeup
(
&
p
->
writep
);
}
...
...
printf.c
浏览文件 @
5516be1f
...
...
@@ -20,7 +20,7 @@ printint(int fd, int xx, int base, int sgn)
if
(
sgn
&&
xx
<
0
){
neg
=
1
;
x
=
-
xx
;
}
else
{
}
else
{
x
=
xx
;
}
...
...
@@ -50,17 +50,17 @@ printf(int fd, char *fmt, ...)
if
(
state
==
0
){
if
(
c
==
'%'
){
state
=
'%'
;
}
else
{
}
else
{
putc
(
fd
,
c
);
}
}
else
if
(
state
==
'%'
){
}
else
if
(
state
==
'%'
){
if
(
c
==
'd'
){
printint
(
fd
,
*
ap
,
10
,
1
);
ap
++
;
}
else
if
(
c
==
'x'
||
c
==
'p'
){
}
else
if
(
c
==
'x'
||
c
==
'p'
){
printint
(
fd
,
*
ap
,
16
,
0
);
ap
++
;
}
else
if
(
c
==
's'
){
}
else
if
(
c
==
's'
){
s
=
(
char
*
)
*
ap
;
ap
++
;
if
(
s
==
0
)
...
...
@@ -69,12 +69,12 @@ printf(int fd, char *fmt, ...)
putc
(
fd
,
*
s
);
s
++
;
}
}
else
if
(
c
==
'c'
){
}
else
if
(
c
==
'c'
){
putc
(
fd
,
*
ap
);
ap
++
;
}
else
if
(
c
==
'%'
){
}
else
if
(
c
==
'%'
){
putc
(
fd
,
c
);
}
else
{
}
else
{
// Unknown % sequence. Print it to draw attention.
putc
(
fd
,
'%'
);
putc
(
fd
,
c
);
...
...
proc.c
浏览文件 @
5516be1f
...
...
@@ -86,7 +86,7 @@ setupsegs(struct proc *p)
if
(
p
){
c
->
gdt
[
SEG_UCODE
]
=
SEG
(
STA_X
|
STA_R
,
(
uint
)
p
->
mem
,
p
->
sz
-
1
,
DPL_USER
);
c
->
gdt
[
SEG_UDATA
]
=
SEG
(
STA_W
,
(
uint
)
p
->
mem
,
p
->
sz
-
1
,
DPL_USER
);
}
else
{
}
else
{
c
->
gdt
[
SEG_UCODE
]
=
SEG_NULL
;
c
->
gdt
[
SEG_UDATA
]
=
SEG_NULL
;
}
...
...
string.c
浏览文件 @
5516be1f
...
...
@@ -41,7 +41,7 @@ memmove(void *dst, const void *src, uint n)
d
+=
n
;
while
(
n
--
>
0
)
*--
d
=
*--
s
;
}
else
}
else
while
(
n
--
>
0
)
*
d
++
=
*
s
++
;
...
...
syscall.c
浏览文件 @
5516be1f
...
...
@@ -128,7 +128,7 @@ syscall(void)
num
=
cp
->
tf
->
eax
;
if
(
num
>=
0
&&
num
<
NELEM
(
syscalls
)
&&
syscalls
[
num
])
cp
->
tf
->
eax
=
syscalls
[
num
]();
else
{
else
{
cprintf
(
"%d %s: unknown sys call %d
\n
"
,
cp
->
pid
,
cp
->
name
,
num
);
cp
->
tf
->
eax
=
-
1
;
...
...
sysfile.c
浏览文件 @
5516be1f
...
...
@@ -270,7 +270,7 @@ sys_open(void)
if
(
omode
&
O_CREATE
){
if
((
ip
=
create
(
path
,
1
,
T_FILE
,
0
,
0
))
==
0
)
return
-
1
;
}
else
{
}
else
{
if
((
ip
=
namei
(
path
))
==
0
)
return
-
1
;
ilock
(
ip
);
...
...
umalloc.c
浏览文件 @
5516be1f
...
...
@@ -33,12 +33,12 @@ free(void *ap)
if
(
bp
+
bp
->
s
.
size
==
p
->
s
.
ptr
){
bp
->
s
.
size
+=
p
->
s
.
ptr
->
s
.
size
;
bp
->
s
.
ptr
=
p
->
s
.
ptr
->
s
.
ptr
;
}
else
}
else
bp
->
s
.
ptr
=
p
->
s
.
ptr
;
if
(
p
+
p
->
s
.
size
==
bp
){
p
->
s
.
size
+=
bp
->
s
.
size
;
p
->
s
.
ptr
=
bp
->
s
.
ptr
;
}
else
}
else
p
->
s
.
ptr
=
bp
;
freep
=
p
;
}
...
...
@@ -75,7 +75,7 @@ malloc(uint nbytes)
if
(
p
->
s
.
size
>=
nunits
){
if
(
p
->
s
.
size
==
nunits
)
prevp
->
s
.
ptr
=
p
->
s
.
ptr
;
else
{
else
{
p
->
s
.
size
-=
nunits
;
p
+=
p
->
s
.
size
;
p
->
s
.
size
=
nunits
;
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论