Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
04970fd9
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看板
提交
04970fd9
编写于
9月 26, 2011
作者:
A
Anthony Liguori
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'qemu-kvm-tmp/memory/core' into staging
上级
2f977dd7
fb1cd6f9
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
23 addition
and
7 deletion
+23
-7
memory.c
memory.c
+22
-7
memory.h
memory.h
+1
-0
未找到文件。
memory.c
浏览文件 @
04970fd9
...
...
@@ -126,6 +126,7 @@ struct FlatRange {
AddrRange
addr
;
uint8_t
dirty_log_mask
;
bool
readable
;
bool
readonly
;
};
/* Flattened global view of current active memory hierarchy. Kept in sorted
...
...
@@ -166,7 +167,8 @@ static bool flatrange_equal(FlatRange *a, FlatRange *b)
return
a
->
mr
==
b
->
mr
&&
addrrange_equal
(
a
->
addr
,
b
->
addr
)
&&
a
->
offset_in_region
==
b
->
offset_in_region
&&
a
->
readable
==
b
->
readable
;
&&
a
->
readable
==
b
->
readable
&&
a
->
readonly
==
b
->
readonly
;
}
static
void
flatview_init
(
FlatView
*
view
)
...
...
@@ -203,7 +205,8 @@ static bool can_merge(FlatRange *r1, FlatRange *r2)
&&
r1
->
mr
==
r2
->
mr
&&
r1
->
offset_in_region
+
r1
->
addr
.
size
==
r2
->
offset_in_region
&&
r1
->
dirty_log_mask
==
r2
->
dirty_log_mask
&&
r1
->
readable
==
r2
->
readable
;
&&
r1
->
readable
==
r2
->
readable
&&
r1
->
readonly
==
r2
->
readonly
;
}
/* Attempt to simplify a view by merging ajacent ranges */
...
...
@@ -307,6 +310,10 @@ static void as_memory_range_add(AddressSpace *as, FlatRange *fr)
phys_offset
&=
~
TARGET_PAGE_MASK
&
~
IO_MEM_ROMD
;
}
if
(
fr
->
readonly
)
{
phys_offset
|=
IO_MEM_ROM
;
}
cpu_register_physical_memory_log
(
fr
->
addr
.
start
,
fr
->
addr
.
size
,
phys_offset
,
...
...
@@ -484,7 +491,8 @@ static AddressSpace address_space_io = {
static
void
render_memory_region
(
FlatView
*
view
,
MemoryRegion
*
mr
,
target_phys_addr_t
base
,
AddrRange
clip
)
AddrRange
clip
,
bool
readonly
)
{
MemoryRegion
*
subregion
;
unsigned
i
;
...
...
@@ -495,6 +503,7 @@ static void render_memory_region(FlatView *view,
AddrRange
tmp
;
base
+=
mr
->
addr
;
readonly
|=
mr
->
readonly
;
tmp
=
addrrange_make
(
base
,
mr
->
size
);
...
...
@@ -507,13 +516,13 @@ static void render_memory_region(FlatView *view,
if
(
mr
->
alias
)
{
base
-=
mr
->
alias
->
addr
;
base
-=
mr
->
alias_offset
;
render_memory_region
(
view
,
mr
->
alias
,
base
,
clip
);
render_memory_region
(
view
,
mr
->
alias
,
base
,
clip
,
readonly
);
return
;
}
/* Render subregions in priority order. */
QTAILQ_FOREACH
(
subregion
,
&
mr
->
subregions
,
subregions_link
)
{
render_memory_region
(
view
,
subregion
,
base
,
clip
);
render_memory_region
(
view
,
subregion
,
base
,
clip
,
readonly
);
}
if
(
!
mr
->
terminates
)
{
...
...
@@ -536,6 +545,7 @@ static void render_memory_region(FlatView *view,
fr
.
addr
=
addrrange_make
(
base
,
now
);
fr
.
dirty_log_mask
=
mr
->
dirty_log_mask
;
fr
.
readable
=
mr
->
readable
;
fr
.
readonly
=
readonly
;
flatview_insert
(
view
,
i
,
&
fr
);
++
i
;
base
+=
now
;
...
...
@@ -555,6 +565,7 @@ static void render_memory_region(FlatView *view,
fr
.
addr
=
addrrange_make
(
base
,
remain
);
fr
.
dirty_log_mask
=
mr
->
dirty_log_mask
;
fr
.
readable
=
mr
->
readable
;
fr
.
readonly
=
readonly
;
flatview_insert
(
view
,
i
,
&
fr
);
}
}
...
...
@@ -566,7 +577,7 @@ static FlatView generate_memory_topology(MemoryRegion *mr)
flatview_init
(
&
view
);
render_memory_region
(
&
view
,
mr
,
0
,
addrrange_make
(
0
,
INT64_MAX
));
render_memory_region
(
&
view
,
mr
,
0
,
addrrange_make
(
0
,
INT64_MAX
)
,
false
);
flatview_simplify
(
&
view
);
return
view
;
...
...
@@ -772,6 +783,7 @@ void memory_region_init(MemoryRegion *mr,
mr
->
offset
=
0
;
mr
->
terminates
=
false
;
mr
->
readable
=
true
;
mr
->
readonly
=
false
;
mr
->
destructor
=
memory_region_destructor_none
;
mr
->
priority
=
0
;
mr
->
may_overlap
=
false
;
...
...
@@ -1035,7 +1047,10 @@ void memory_region_sync_dirty_bitmap(MemoryRegion *mr)
void
memory_region_set_readonly
(
MemoryRegion
*
mr
,
bool
readonly
)
{
/* FIXME */
if
(
mr
->
readonly
!=
readonly
)
{
mr
->
readonly
=
readonly
;
memory_region_update_topology
();
}
}
void
memory_region_rom_device_set_readable
(
MemoryRegion
*
mr
,
bool
readable
)
...
...
memory.h
浏览文件 @
04970fd9
...
...
@@ -114,6 +114,7 @@ struct MemoryRegion {
IORange
iorange
;
bool
terminates
;
bool
readable
;
bool
readonly
;
/* For RAM regions */
MemoryRegion
*
alias
;
target_phys_addr_t
alias_offset
;
unsigned
priority
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录