Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
dc6c1b37
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看板
提交
dc6c1b37
编写于
10月 11, 2011
作者:
A
Avi Kivity
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fdc: convert to memory API
FIXME: instance ID for migration Signed-off-by:
N
Avi Kivity
<
avi@redhat.com
>
上级
7f8293bf
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
24 addition
and
34 deletion
+24
-34
hw/fdc.c
hw/fdc.c
+24
-34
未找到文件。
hw/fdc.c
浏览文件 @
dc6c1b37
...
...
@@ -373,6 +373,7 @@ enum {
#define FD_FORMAT_CMD(state) ((state) & FD_STATE_FORMAT)
struct
FDCtrl
{
MemoryRegion
iomem
;
qemu_irq
irq
;
/* Controller state */
QEMUTimer
*
result_timer
;
...
...
@@ -491,39 +492,32 @@ static void fdctrl_write (void *opaque, uint32_t reg, uint32_t value)
}
}
static
uint32_t
fdctrl_read_mem
(
void
*
opaque
,
target_phys_addr_t
reg
)
static
uint64_t
fdctrl_read_mem
(
void
*
opaque
,
target_phys_addr_t
reg
,
unsigned
ize
)
{
return
fdctrl_read
(
opaque
,
(
uint32_t
)
reg
);
}
static
void
fdctrl_write_mem
(
void
*
opaque
,
target_phys_addr_t
reg
,
uint32_t
valu
e
)
static
void
fdctrl_write_mem
(
void
*
opaque
,
target_phys_addr_t
reg
,
uint64_t
value
,
unsigned
siz
e
)
{
fdctrl_write
(
opaque
,
(
uint32_t
)
reg
,
value
);
}
static
CPUReadMemoryFunc
*
const
fdctrl_mem_read
[
3
]
=
{
fdctrl_read_mem
,
fdctrl_read
_mem
,
fdctrl_read_mem
,
static
const
MemoryRegionOps
fdctrl_mem_ops
=
{
.
read
=
fdctrl_read_mem
,
.
write
=
fdctrl_write
_mem
,
.
endianness
=
DEVICE_NATIVE_ENDIAN
,
};
static
CPUWriteMemoryFunc
*
const
fdctrl_mem_write
[
3
]
=
{
fdctrl_write_mem
,
fdctrl_write_mem
,
fdctrl_write_mem
,
};
static
CPUReadMemoryFunc
*
const
fdctrl_mem_read_strict
[
3
]
=
{
fdctrl_read_mem
,
NULL
,
NULL
,
};
static
CPUWriteMemoryFunc
*
const
fdctrl_mem_write_strict
[
3
]
=
{
fdctrl_write_mem
,
NULL
,
NULL
,
static
const
MemoryRegionOps
fdctrl_mem_strict_ops
=
{
.
read
=
fdctrl_read_mem
,
.
write
=
fdctrl_write_mem
,
.
endianness
=
DEVICE_NATIVE_ENDIAN
,
.
valid
=
{
.
min_access_size
=
1
,
.
max_access_size
=
1
,
},
};
static
bool
fdrive_media_changed_needed
(
void
*
opaque
)
...
...
@@ -1914,17 +1908,15 @@ static int sysbus_fdc_init1(SysBusDevice *dev)
{
FDCtrlSysBus
*
sys
=
DO_UPCAST
(
FDCtrlSysBus
,
busdev
,
dev
);
FDCtrl
*
fdctrl
=
&
sys
->
state
;
int
io
;
int
ret
;
io
=
cpu_register_io_memory
(
fdctrl_mem_read
,
fdctrl_mem_write
,
fdctrl
,
DEVICE_NATIVE_ENDIAN
);
sysbus_init_mmio
(
dev
,
0x08
,
io
);
memory_region_init_io
(
&
fdctrl
->
iomem
,
&
fdctrl_mem_ops
,
fdctrl
,
"fdc"
,
0x08
);
sysbus_init_mmio_region
(
dev
,
&
fdctrl
->
iomem
);
sysbus_init_irq
(
dev
,
&
fdctrl
->
irq
);
qdev_init_gpio_in
(
&
dev
->
qdev
,
fdctrl_handle_tc
,
1
);
fdctrl
->
dma_chann
=
-
1
;
qdev_set_legacy_instance_id
(
&
dev
->
qdev
,
io
,
2
);
qdev_set_legacy_instance_id
(
&
dev
->
qdev
,
0
/* io */
,
2
);
/* FIXME */
ret
=
fdctrl_init_common
(
fdctrl
);
return
ret
;
...
...
@@ -1933,17 +1925,15 @@ static int sysbus_fdc_init1(SysBusDevice *dev)
static
int
sun4m_fdc_init1
(
SysBusDevice
*
dev
)
{
FDCtrl
*
fdctrl
=
&
(
FROM_SYSBUS
(
FDCtrlSysBus
,
dev
)
->
state
);
int
io
;
io
=
cpu_register_io_memory
(
fdctrl_mem_read_strict
,
fdctrl_mem_write_strict
,
fdctrl
,
DEVICE_NATIVE_ENDIAN
);
sysbus_init_mmio
(
dev
,
0x08
,
io
);
memory_region_init_io
(
&
fdctrl
->
iomem
,
&
fdctrl_mem_strict_ops
,
fdctrl
,
"fdctrl"
,
0x08
);
sysbus_init_mmio_region
(
dev
,
&
fdctrl
->
iomem
);
sysbus_init_irq
(
dev
,
&
fdctrl
->
irq
);
qdev_init_gpio_in
(
&
dev
->
qdev
,
fdctrl_handle_tc
,
1
);
fdctrl
->
sun4m
=
1
;
qdev_set_legacy_instance_id
(
&
dev
->
qdev
,
io
,
2
);
qdev_set_legacy_instance_id
(
&
dev
->
qdev
,
0
/* io */
,
2
);
/* FIXME */
return
fdctrl_init_common
(
fdctrl
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录