Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
227f0486
提交
227f0486
2月 09, 2012
创建
作者:
Nickolai Zeldovich
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
^E to print out current PCs on each CPU at next timer intr
上级
71ecfe98
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
15 行增加
和
3 行删除
+15
-3
console.c
console.c
+6
-2
cpu.h
cpu.h
+1
-0
trap.c
trap.c
+8
-1
没有找到文件。
console.c
浏览文件 @
227f0486
...
@@ -162,10 +162,10 @@ kerneltrap(struct trapframe *tf)
...
@@ -162,10 +162,10 @@ kerneltrap(struct trapframe *tf)
kstack
=
myproc
()
->
kstack
;
kstack
=
myproc
()
->
kstack
;
}
}
__cprintf
(
"kernel trap %u cpu %u
\n
"
__cprintf
(
"kernel trap %u cpu %u
\n
"
" tf: rip %p rsp %p cr2 %p cs %p
\n
"
" tf: rip %p rsp %p
rbp %p
cr2 %p cs %p
\n
"
" proc: name %s pid %u kstack %p
\n
"
,
" proc: name %s pid %u kstack %p
\n
"
,
tf
->
trapno
,
mycpu
()
->
id
,
tf
->
trapno
,
mycpu
()
->
id
,
tf
->
rip
,
tf
->
rsp
,
rcr2
(),
tf
->
cs
,
tf
->
rip
,
tf
->
rsp
,
tf
->
rbp
,
rcr2
(),
tf
->
cs
,
name
,
pid
,
kstack
);
name
,
pid
,
kstack
);
printtrace
(
tf
->
rbp
);
printtrace
(
tf
->
rbp
);
...
@@ -235,6 +235,10 @@ consoleintr(int (*getc)(void))
...
@@ -235,6 +235,10 @@ consoleintr(int (*getc)(void))
case
C
(
'P'
):
// Process listing.
case
C
(
'P'
):
// Process listing.
procdumpall
();
procdumpall
();
break
;
break
;
case
C
(
'E'
):
// Print user-space PCs.
for
(
u32
i
=
0
;
i
<
NCPU
;
i
++
)
cpus
[
i
].
timer_printpc
=
1
;
break
;
case
C
(
'U'
):
// Kill line.
case
C
(
'U'
):
// Kill line.
while
(
input
.
e
!=
input
.
w
&&
while
(
input
.
e
!=
input
.
w
&&
input
.
buf
[(
input
.
e
-
1
)
%
INPUT_BUF
]
!=
'\n'
){
input
.
buf
[(
input
.
e
-
1
)
%
INPUT_BUF
]
!=
'\n'
){
...
...
cpu.h
浏览文件 @
227f0486
...
@@ -11,6 +11,7 @@ struct cpu {
...
@@ -11,6 +11,7 @@ struct cpu {
struct
taskstate
ts
;
// Used by x86 to find stack for interrupt
struct
taskstate
ts
;
// Used by x86 to find stack for interrupt
struct
context
*
scheduler
;
// swtch() here to enter scheduler
struct
context
*
scheduler
;
// swtch() here to enter scheduler
struct
wqframe
*
wqframe
;
struct
wqframe
*
wqframe
;
int
timer_printpc
;
// Cpu-local storage variables; see below
// Cpu-local storage variables; see below
struct
cpu
*
cpu
;
struct
cpu
*
cpu
;
...
...
trap.c
浏览文件 @
227f0486
...
@@ -71,8 +71,15 @@ trap(struct trapframe *tf)
...
@@ -71,8 +71,15 @@ trap(struct trapframe *tf)
switch
(
tf
->
trapno
){
switch
(
tf
->
trapno
){
case
T_IRQ0
+
IRQ_TIMER
:
case
T_IRQ0
+
IRQ_TIMER
:
if
(
mycpu
()
->
timer_printpc
)
{
cprintf
(
"cpu%d: proc %s rip %lx rsp %lx cs %x
\n
"
,
mycpu
()
->
id
,
myproc
()
?
myproc
()
->
name
:
"(none)"
,
tf
->
rip
,
tf
->
rsp
,
tf
->
cs
);
mycpu
()
->
timer_printpc
=
0
;
}
if
(
mycpu
()
->
id
==
0
)
if
(
mycpu
()
->
id
==
0
)
cv_tick
();
cv_tick
();
lapiceoi
();
lapiceoi
();
break
;
break
;
case
T_IRQ0
+
IRQ_IDE
:
case
T_IRQ0
+
IRQ_IDE
:
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论