Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
62ceeb2c
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看板
提交
62ceeb2c
编写于
10月 05, 2011
作者:
A
Avi Kivity
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
versatilepb: convert to memory API
Signed-off-by:
N
Avi Kivity
<
avi@redhat.com
>
上级
04d66689
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
15 addition
and
20 deletion
+15
-20
hw/versatilepb.c
hw/versatilepb.c
+15
-20
未找到文件。
hw/versatilepb.c
浏览文件 @
62ceeb2c
...
...
@@ -17,12 +17,14 @@
#include "usb-ohci.h"
#include "boards.h"
#include "blockdev.h"
#include "exec-memory.h"
/* Primary interrupt controller. */
typedef
struct
vpb_sic_state
{
SysBusDevice
busdev
;
MemoryRegion
iomem
;
uint32_t
level
;
uint32_t
mask
;
uint32_t
pic_enable
;
...
...
@@ -75,7 +77,8 @@ static void vpb_sic_set_irq(void *opaque, int irq, int level)
vpb_sic_update
(
s
);
}
static
uint32_t
vpb_sic_read
(
void
*
opaque
,
target_phys_addr_t
offset
)
static
uint64_t
vpb_sic_read
(
void
*
opaque
,
target_phys_addr_t
offset
,
unsigned
size
)
{
vpb_sic_state
*
s
=
(
vpb_sic_state
*
)
opaque
;
...
...
@@ -97,7 +100,7 @@ static uint32_t vpb_sic_read(void *opaque, target_phys_addr_t offset)
}
static
void
vpb_sic_write
(
void
*
opaque
,
target_phys_addr_t
offset
,
uint
32_t
valu
e
)
uint
64_t
value
,
unsigned
siz
e
)
{
vpb_sic_state
*
s
=
(
vpb_sic_state
*
)
opaque
;
...
...
@@ -131,22 +134,15 @@ static void vpb_sic_write(void *opaque, target_phys_addr_t offset,
vpb_sic_update
(
s
);
}
static
CPUReadMemoryFunc
*
const
vpb_sic_readfn
[]
=
{
vpb_sic_read
,
vpb_sic_read
,
vpb_sic_read
};
static
CPUWriteMemoryFunc
*
const
vpb_sic_writefn
[]
=
{
vpb_sic_write
,
vpb_sic_write
,
vpb_sic_write
static
const
MemoryRegionOps
vpb_sic_ops
=
{
.
read
=
vpb_sic_read
,
.
write
=
vpb_sic_write
,
.
endianness
=
DEVICE_NATIVE_ENDIAN
,
};
static
int
vpb_sic_init
(
SysBusDevice
*
dev
)
{
vpb_sic_state
*
s
=
FROM_SYSBUS
(
vpb_sic_state
,
dev
);
int
iomemtype
;
int
i
;
qdev_init_gpio_in
(
&
dev
->
qdev
,
vpb_sic_set_irq
,
32
);
...
...
@@ -154,10 +150,8 @@ static int vpb_sic_init(SysBusDevice *dev)
sysbus_init_irq
(
dev
,
&
s
->
parent
[
i
]);
}
s
->
irq
=
31
;
iomemtype
=
cpu_register_io_memory
(
vpb_sic_readfn
,
vpb_sic_writefn
,
s
,
DEVICE_NATIVE_ENDIAN
);
sysbus_init_mmio
(
dev
,
0x1000
,
iomemtype
);
memory_region_init_io
(
&
s
->
iomem
,
&
vpb_sic_ops
,
s
,
"vpb-sic"
,
0x1000
);
sysbus_init_mmio_region
(
dev
,
&
s
->
iomem
);
return
0
;
}
...
...
@@ -176,7 +170,8 @@ static void versatile_init(ram_addr_t ram_size,
int
board_id
)
{
CPUState
*
env
;
ram_addr_t
ram_offset
;
MemoryRegion
*
sysmem
=
get_system_memory
();
MemoryRegion
*
ram
=
g_new
(
MemoryRegion
,
1
);
qemu_irq
*
cpu_pic
;
qemu_irq
pic
[
32
];
qemu_irq
sic
[
32
];
...
...
@@ -195,10 +190,10 @@ static void versatile_init(ram_addr_t ram_size,
fprintf
(
stderr
,
"Unable to find CPU definition
\n
"
);
exit
(
1
);
}
ram_offset
=
qemu_ram_alloc
(
NULL
,
"versatile.ram"
,
ram_size
);
memory_region_init_ram
(
ram
,
NULL
,
"versatile.ram"
,
ram_size
);
/* ??? RAM should repeat to fill physical memory space. */
/* SDRAM at address zero. */
cpu_register_physical_memory
(
0
,
ram_size
,
ram_offset
|
IO_MEM_RAM
);
memory_region_add_subregion
(
sysmem
,
0
,
ram
);
sysctl
=
qdev_create
(
NULL
,
"realview_sysctl"
);
qdev_prop_set_uint32
(
sysctl
,
"sys_id"
,
0x41007004
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录