Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
02a59c37
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
02a59c37
编写于
10月 10, 2011
作者:
A
Avi Kivity
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
pl022: convert to memory API
Signed-off-by:
N
Avi Kivity
<
avi@redhat.com
>
上级
48484757
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
11 addition
and
18 deletion
+11
-18
hw/pl022.c
hw/pl022.c
+11
-18
未找到文件。
hw/pl022.c
浏览文件 @
02a59c37
...
...
@@ -42,6 +42,7 @@ do { fprintf(stderr, "pl022: error: " fmt , ## __VA_ARGS__);} while (0)
typedef
struct
{
SysBusDevice
busdev
;
MemoryRegion
iomem
;
uint32_t
cr0
;
uint32_t
cr1
;
uint32_t
bitmask
;
...
...
@@ -130,7 +131,8 @@ static void pl022_xfer(pl022_state *s)
pl022_update
(
s
);
}
static
uint32_t
pl022_read
(
void
*
opaque
,
target_phys_addr_t
offset
)
static
uint64_t
pl022_read
(
void
*
opaque
,
target_phys_addr_t
offset
,
unsigned
size
)
{
pl022_state
*
s
=
(
pl022_state
*
)
opaque
;
int
val
;
...
...
@@ -173,7 +175,7 @@ static uint32_t pl022_read(void *opaque, target_phys_addr_t offset)
}
static
void
pl022_write
(
void
*
opaque
,
target_phys_addr_t
offset
,
uint
32_t
valu
e
)
uint
64_t
value
,
unsigned
siz
e
)
{
pl022_state
*
s
=
(
pl022_state
*
)
opaque
;
...
...
@@ -193,7 +195,7 @@ static void pl022_write(void *opaque, target_phys_addr_t offset,
break
;
case
0x08
:
/* DR */
if
(
s
->
tx_fifo_len
<
8
)
{
DPRINTF
(
"TX %02x
\n
"
,
value
);
DPRINTF
(
"TX %02x
\n
"
,
(
unsigned
)
value
);
s
->
tx_fifo
[
s
->
tx_fifo_head
]
=
value
&
s
->
bitmask
;
s
->
tx_fifo_head
=
(
s
->
tx_fifo_head
+
1
)
&
7
;
s
->
tx_fifo_len
++
;
...
...
@@ -227,16 +229,10 @@ static void pl022_reset(pl022_state *s)
s
->
sr
=
PL022_SR_TFE
|
PL022_SR_TNF
;
}
static
CPUReadMemoryFunc
*
const
pl022_readfn
[]
=
{
pl022_read
,
pl022_read
,
pl022_read
};
static
CPUWriteMemoryFunc
*
const
pl022_writefn
[]
=
{
pl022_write
,
pl022_write
,
pl022_write
static
const
MemoryRegionOps
pl022_ops
=
{
.
read
=
pl022_read
,
.
write
=
pl022_write
,
.
endianness
=
DEVICE_NATIVE_ENDIAN
,
};
static
const
VMStateDescription
vmstate_pl022
=
{
...
...
@@ -279,12 +275,9 @@ static const VMStateDescription vmstate_pl022 = {
static
int
pl022_init
(
SysBusDevice
*
dev
)
{
pl022_state
*
s
=
FROM_SYSBUS
(
pl022_state
,
dev
);
int
iomemtype
;
iomemtype
=
cpu_register_io_memory
(
pl022_readfn
,
pl022_writefn
,
s
,
DEVICE_NATIVE_ENDIAN
);
sysbus_init_mmio
(
dev
,
0x1000
,
iomemtype
);
memory_region_init_io
(
&
s
->
iomem
,
&
pl022_ops
,
s
,
"pl022"
,
0x1000
);
sysbus_init_mmio_region
(
dev
,
&
s
->
iomem
);
sysbus_init_irq
(
dev
,
&
s
->
irq
);
s
->
ssi
=
ssi_create_bus
(
&
dev
->
qdev
,
"ssi"
);
pl022_reset
(
s
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录