Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
d09510b2
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看板
提交
d09510b2
编写于
11月 20, 2011
作者:
A
Avi Kivity
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
lm32_timer: convert to memory API
Signed-off-by:
N
Avi Kivity
<
avi@redhat.com
>
上级
9a9d0b81
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
14 addition
and
16 deletion
+14
-16
hw/lm32_timer.c
hw/lm32_timer.c
+14
-16
未找到文件。
hw/lm32_timer.c
浏览文件 @
d09510b2
...
...
@@ -51,6 +51,7 @@ enum {
struct
LM32TimerState
{
SysBusDevice
busdev
;
MemoryRegion
iomem
;
QEMUBH
*
bh
;
ptimer_state
*
ptimer
;
...
...
@@ -70,7 +71,7 @@ static void timer_update_irq(LM32TimerState *s)
qemu_set_irq
(
s
->
irq
,
state
);
}
static
uint
32_t
timer_read
(
void
*
opaque
,
target_phys_addr_t
addr
)
static
uint
64_t
timer_read
(
void
*
opaque
,
target_phys_addr_t
addr
,
unsigned
size
)
{
LM32TimerState
*
s
=
opaque
;
uint32_t
r
=
0
;
...
...
@@ -95,7 +96,8 @@ static uint32_t timer_read(void *opaque, target_phys_addr_t addr)
return
r
;
}
static
void
timer_write
(
void
*
opaque
,
target_phys_addr_t
addr
,
uint32_t
value
)
static
void
timer_write
(
void
*
opaque
,
target_phys_addr_t
addr
,
uint64_t
value
,
unsigned
size
)
{
LM32TimerState
*
s
=
opaque
;
...
...
@@ -131,16 +133,14 @@ static void timer_write(void *opaque, target_phys_addr_t addr, uint32_t value)
timer_update_irq
(
s
);
}
static
CPUReadMemoryFunc
*
const
timer_read_fn
[]
=
{
NULL
,
NULL
,
&
timer_read
,
};
static
CPUWriteMemoryFunc
*
const
timer_write_fn
[]
=
{
NULL
,
NULL
,
&
timer_write
,
static
const
MemoryRegionOps
timer_ops
=
{
.
read
=
timer_read
,
.
write
=
timer_write
,
.
endianness
=
DEVICE_NATIVE_ENDIAN
,
.
valid
=
{
.
min_access_size
=
4
,
.
max_access_size
=
4
,
},
};
static
void
timer_hit
(
void
*
opaque
)
...
...
@@ -172,7 +172,6 @@ static void timer_reset(DeviceState *d)
static
int
lm32_timer_init
(
SysBusDevice
*
dev
)
{
LM32TimerState
*
s
=
FROM_SYSBUS
(
typeof
(
*
s
),
dev
);
int
timer_regs
;
sysbus_init_irq
(
dev
,
&
s
->
irq
);
...
...
@@ -180,9 +179,8 @@ static int lm32_timer_init(SysBusDevice *dev)
s
->
ptimer
=
ptimer_init
(
s
->
bh
);
ptimer_set_freq
(
s
->
ptimer
,
s
->
freq_hz
);
timer_regs
=
cpu_register_io_memory
(
timer_read_fn
,
timer_write_fn
,
s
,
DEVICE_NATIVE_ENDIAN
);
sysbus_init_mmio
(
dev
,
R_MAX
*
4
,
timer_regs
);
memory_region_init_io
(
&
s
->
iomem
,
&
timer_ops
,
s
,
"timer"
,
R_MAX
*
4
);
sysbus_init_mmio_region
(
dev
,
&
s
->
iomem
);
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录