Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
2999097b
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看板
提交
2999097b
编写于
2月 13, 2012
作者:
A
Avi Kivity
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
memory: change phys_page_set() to set multiple pages
Signed-off-by:
N
Avi Kivity
<
avi@redhat.com
>
上级
f7bf5461
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
23 addition
and
18 deletion
+23
-18
exec.c
exec.c
+23
-18
未找到文件。
exec.c
浏览文件 @
2999097b
...
...
@@ -436,8 +436,9 @@ static void phys_map_nodes_reset(void)
}
static
void
phys_page_set_level
(
PhysPageEntry
*
lp
,
target_phys_addr_t
index
,
uint16_t
leaf
,
int
level
)
static
void
phys_page_set_level
(
PhysPageEntry
*
lp
,
target_phys_addr_t
*
index
,
target_phys_addr_t
*
nb
,
uint16_t
leaf
,
int
level
)
{
PhysPageEntry
*
p
;
int
i
;
...
...
@@ -453,20 +454,27 @@ static void phys_page_set_level(PhysPageEntry *lp, target_phys_addr_t index,
}
else
{
p
=
phys_map_nodes
[
lp
->
u
.
node
];
}
lp
=
&
p
[(
index
>>
(
level
*
L2_BITS
))
&
(
L2_SIZE
-
1
)];
lp
=
&
p
[(
*
index
>>
(
level
*
L2_BITS
))
&
(
L2_SIZE
-
1
)];
if
(
level
==
0
)
{
lp
->
u
.
leaf
=
leaf
;
}
else
{
phys_page_set_level
(
lp
,
index
,
leaf
,
level
-
1
);
while
(
*
nb
&&
lp
<
&
p
[
L2_SIZE
])
{
if
(
level
==
0
)
{
lp
->
u
.
leaf
=
leaf
;
++*
index
;
--*
nb
;
}
else
{
phys_page_set_level
(
lp
,
index
,
nb
,
leaf
,
level
-
1
);
}
++
lp
;
}
}
static
void
phys_page_set
(
target_phys_addr_t
index
,
uint16_t
leaf
)
static
void
phys_page_set
(
target_phys_addr_t
index
,
target_phys_addr_t
nb
,
uint16_t
leaf
)
{
phys_map_node_reserve
(
P_L2_LEVELS
);
/* Wildly overreserve - it doesn't matter much. */
phys_map_node_reserve
((
nb
+
L2_SIZE
-
1
)
/
L2_SIZE
*
P_L2_LEVELS
);
phys_page_set_level
(
&
phys_map
,
index
,
leaf
,
P_L2_LEVELS
-
1
);
phys_page_set_level
(
&
phys_map
,
&
index
,
&
nb
,
leaf
,
P_L2_LEVELS
-
1
);
}
static
MemoryRegionSection
phys_page_find
(
target_phys_addr_t
index
)
...
...
@@ -2630,7 +2638,8 @@ static void register_subpage(MemoryRegionSection *section)
if
(
!
(
existing
.
mr
->
subpage
))
{
subpage
=
subpage_init
(
base
);
subsection
.
mr
=
&
subpage
->
iomem
;
phys_page_set
(
base
>>
TARGET_PAGE_BITS
,
phys_section_add
(
&
subsection
));
phys_page_set
(
base
>>
TARGET_PAGE_BITS
,
1
,
phys_section_add
(
&
subsection
));
}
else
{
subpage
=
container_of
(
existing
.
mr
,
subpage_t
,
iomem
);
}
...
...
@@ -2644,18 +2653,14 @@ static void register_multipage(MemoryRegionSection *section)
{
target_phys_addr_t
start_addr
=
section
->
offset_within_address_space
;
ram_addr_t
size
=
section
->
size
;
target_phys_addr_t
addr
,
end_addr
;
target_phys_addr_t
addr
;
uint16_t
section_index
=
phys_section_add
(
section
);
assert
(
size
);
end_addr
=
start_addr
+
(
target_phys_addr_t
)
size
;
addr
=
start_addr
;
do
{
phys_page_set
(
addr
>>
TARGET_PAGE_BITS
,
section_index
);
addr
+=
TARGET_PAGE_SIZE
;
}
while
(
addr
!=
end_addr
);
phys_page_set
(
addr
>>
TARGET_PAGE_BITS
,
size
>>
TARGET_PAGE_BITS
,
section_index
);
}
void
cpu_register_physical_memory_log
(
MemoryRegionSection
*
section
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录