Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
b86bda5b
Q
qemu
项目概览
openeuler
/
qemu
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Q
qemu
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b86bda5b
编写于
9月 18, 2004
作者:
B
bellard
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
adde TLB dump
git-svn-id:
svn://svn.savannah.nongnu.org/qemu/trunk@1069
c046a42c-6fe2-441c-8c8c-71466251a162
上级
e2731add
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
117 addition
and
0 deletion
+117
-0
monitor.c
monitor.c
+117
-0
未找到文件。
monitor.c
浏览文件 @
b86bda5b
...
...
@@ -695,6 +695,117 @@ static void do_system_reset(void)
qemu_system_reset_request
();
}
#if defined(TARGET_I386)
static
void
print_pte
(
uint32_t
addr
,
uint32_t
pte
,
uint32_t
mask
)
{
term_printf
(
"%08x: %08x %c%c%c%c%c%c%c%c
\n
"
,
addr
,
pte
&
mask
,
pte
&
PG_GLOBAL_MASK
?
'G'
:
'-'
,
pte
&
PG_PSE_MASK
?
'P'
:
'-'
,
pte
&
PG_DIRTY_MASK
?
'D'
:
'-'
,
pte
&
PG_ACCESSED_MASK
?
'A'
:
'-'
,
pte
&
PG_PCD_MASK
?
'C'
:
'-'
,
pte
&
PG_PWT_MASK
?
'T'
:
'-'
,
pte
&
PG_USER_MASK
?
'U'
:
'-'
,
pte
&
PG_RW_MASK
?
'W'
:
'-'
);
}
static
void
tlb_info
(
void
)
{
CPUState
*
env
=
cpu_single_env
;
int
l1
,
l2
;
uint32_t
pgd
,
pde
,
pte
;
if
(
!
(
env
->
cr
[
0
]
&
CR0_PG_MASK
))
{
term_printf
(
"PG disabled
\n
"
);
return
;
}
pgd
=
env
->
cr
[
3
]
&
~
0xfff
;
for
(
l1
=
0
;
l1
<
1024
;
l1
++
)
{
cpu_physical_memory_read
(
pgd
+
l1
*
4
,
(
uint8_t
*
)
&
pde
,
4
);
pde
=
le32_to_cpu
(
pde
);
if
(
pde
&
PG_PRESENT_MASK
)
{
if
((
pde
&
PG_PSE_MASK
)
&&
(
env
->
cr
[
4
]
&
CR4_PSE_MASK
))
{
print_pte
((
l1
<<
22
),
pde
,
~
((
1
<<
20
)
-
1
));
}
else
{
for
(
l2
=
0
;
l2
<
1024
;
l2
++
)
{
cpu_physical_memory_read
((
pde
&
~
0xfff
)
+
l2
*
4
,
(
uint8_t
*
)
&
pte
,
4
);
pte
=
le32_to_cpu
(
pte
);
if
(
pte
&
PG_PRESENT_MASK
)
{
print_pte
((
l1
<<
22
)
+
(
l2
<<
12
),
pte
&
~
PG_PSE_MASK
,
~
0xfff
);
}
}
}
}
}
}
static
void
mem_print
(
uint32_t
*
pstart
,
int
*
plast_prot
,
uint32_t
end
,
int
prot
)
{
if
(
prot
!=
*
plast_prot
)
{
if
(
*
pstart
!=
-
1
)
{
term_printf
(
"%08x-%08x %08x %c%c%c
\n
"
,
*
pstart
,
end
,
end
-
*
pstart
,
prot
&
PG_USER_MASK
?
'u'
:
'-'
,
'r'
,
prot
&
PG_RW_MASK
?
'w'
:
'-'
);
}
if
(
prot
!=
0
)
*
pstart
=
end
;
else
*
pstart
=
-
1
;
*
plast_prot
=
prot
;
}
}
static
void
mem_info
(
void
)
{
CPUState
*
env
=
cpu_single_env
;
int
l1
,
l2
,
prot
,
last_prot
;
uint32_t
pgd
,
pde
,
pte
,
start
,
end
;
if
(
!
(
env
->
cr
[
0
]
&
CR0_PG_MASK
))
{
term_printf
(
"PG disabled
\n
"
);
return
;
}
pgd
=
env
->
cr
[
3
]
&
~
0xfff
;
last_prot
=
0
;
start
=
-
1
;
for
(
l1
=
0
;
l1
<
1024
;
l1
++
)
{
cpu_physical_memory_read
(
pgd
+
l1
*
4
,
(
uint8_t
*
)
&
pde
,
4
);
pde
=
le32_to_cpu
(
pde
);
end
=
l1
<<
22
;
if
(
pde
&
PG_PRESENT_MASK
)
{
if
((
pde
&
PG_PSE_MASK
)
&&
(
env
->
cr
[
4
]
&
CR4_PSE_MASK
))
{
prot
=
pde
&
(
PG_USER_MASK
|
PG_RW_MASK
|
PG_PRESENT_MASK
);
mem_print
(
&
start
,
&
last_prot
,
end
,
prot
);
}
else
{
for
(
l2
=
0
;
l2
<
1024
;
l2
++
)
{
cpu_physical_memory_read
((
pde
&
~
0xfff
)
+
l2
*
4
,
(
uint8_t
*
)
&
pte
,
4
);
pte
=
le32_to_cpu
(
pte
);
end
=
(
l1
<<
22
)
+
(
l2
<<
12
);
if
(
pte
&
PG_PRESENT_MASK
)
{
prot
=
pte
&
(
PG_USER_MASK
|
PG_RW_MASK
|
PG_PRESENT_MASK
);
}
else
{
prot
=
0
;
}
mem_print
(
&
start
,
&
last_prot
,
end
,
prot
);
}
}
}
else
{
prot
=
0
;
mem_print
(
&
start
,
&
last_prot
,
end
,
prot
);
}
}
}
#endif
static
term_cmd_t
term_cmds
[]
=
{
{
"help|?"
,
"s?"
,
do_help
,
"[cmd]"
,
"show the help"
},
...
...
@@ -755,6 +866,12 @@ static term_cmd_t info_cmds[] = {
""
,
"show i8259 (PIC) state"
,
},
{
"pci"
,
""
,
pci_info
,
""
,
"show PCI info"
,
},
#if defined(TARGET_I386)
{
"tlb"
,
""
,
tlb_info
,
""
,
"show virtual to physical memory mappings"
,
},
{
"mem"
,
""
,
mem_info
,
""
,
"show the active virtual memory mappings"
,
},
#endif
{
NULL
,
NULL
,
},
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录