Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
95eb2084
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看板
提交
95eb2084
编写于
7月 26, 2013
作者:
A
Andreas Färber
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
slavio_misc: QOM cast cleanup for MiscState
Signed-off-by:
N
Andreas Färber
<
afaerber@suse.de
>
上级
af89a444
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
20 addition
and
15 deletion
+20
-15
hw/misc/slavio_misc.c
hw/misc/slavio_misc.c
+20
-15
未找到文件。
hw/misc/slavio_misc.c
浏览文件 @
95eb2084
...
...
@@ -34,8 +34,12 @@
* This also includes the PMC CPU idle controller.
*/
#define TYPE_SLAVIO_MISC "slavio_misc"
#define SLAVIO_MISC(obj) OBJECT_CHECK(MiscState, (obj), TYPE_SLAVIO_MISC)
typedef
struct
MiscState
{
SysBusDevice
busdev
;
SysBusDevice
parent_obj
;
MemoryRegion
cfg_iomem
;
MemoryRegion
diag_iomem
;
MemoryRegion
mdm_iomem
;
...
...
@@ -88,7 +92,7 @@ static void slavio_misc_update_irq(void *opaque)
static
void
slavio_misc_reset
(
DeviceState
*
d
)
{
MiscState
*
s
=
container_of
(
d
,
MiscState
,
busdev
.
qdev
);
MiscState
*
s
=
SLAVIO_MISC
(
d
);
// Diagnostic and system control registers not cleared in reset
s
->
config
=
s
->
aux1
=
s
->
aux2
=
s
->
mctrl
=
0
;
...
...
@@ -418,52 +422,53 @@ static int apc_init1(SysBusDevice *dev)
return
0
;
}
static
int
slavio_misc_init1
(
SysBusDevice
*
dev
)
static
int
slavio_misc_init1
(
SysBusDevice
*
sbd
)
{
MiscState
*
s
=
FROM_SYSBUS
(
MiscState
,
dev
);
DeviceState
*
dev
=
DEVICE
(
sbd
);
MiscState
*
s
=
SLAVIO_MISC
(
dev
);
sysbus_init_irq
(
dev
,
&
s
->
irq
);
sysbus_init_irq
(
dev
,
&
s
->
fdc_tc
);
sysbus_init_irq
(
sbd
,
&
s
->
irq
);
sysbus_init_irq
(
sbd
,
&
s
->
fdc_tc
);
/* 8 bit registers */
/* Slavio control */
memory_region_init_io
(
&
s
->
cfg_iomem
,
OBJECT
(
s
),
&
slavio_cfg_mem_ops
,
s
,
"configuration"
,
MISC_SIZE
);
sysbus_init_mmio
(
dev
,
&
s
->
cfg_iomem
);
sysbus_init_mmio
(
sbd
,
&
s
->
cfg_iomem
);
/* Diagnostics */
memory_region_init_io
(
&
s
->
diag_iomem
,
OBJECT
(
s
),
&
slavio_diag_mem_ops
,
s
,
"diagnostic"
,
MISC_SIZE
);
sysbus_init_mmio
(
dev
,
&
s
->
diag_iomem
);
sysbus_init_mmio
(
sbd
,
&
s
->
diag_iomem
);
/* Modem control */
memory_region_init_io
(
&
s
->
mdm_iomem
,
OBJECT
(
s
),
&
slavio_mdm_mem_ops
,
s
,
"modem"
,
MISC_SIZE
);
sysbus_init_mmio
(
dev
,
&
s
->
mdm_iomem
);
sysbus_init_mmio
(
sbd
,
&
s
->
mdm_iomem
);
/* 16 bit registers */
/* ss600mp diag LEDs */
memory_region_init_io
(
&
s
->
led_iomem
,
OBJECT
(
s
),
&
slavio_led_mem_ops
,
s
,
"leds"
,
MISC_SIZE
);
sysbus_init_mmio
(
dev
,
&
s
->
led_iomem
);
sysbus_init_mmio
(
sbd
,
&
s
->
led_iomem
);
/* 32 bit registers */
/* System control */
memory_region_init_io
(
&
s
->
sysctrl_iomem
,
OBJECT
(
s
),
&
slavio_sysctrl_mem_ops
,
s
,
"system-control"
,
MISC_SIZE
);
sysbus_init_mmio
(
dev
,
&
s
->
sysctrl_iomem
);
sysbus_init_mmio
(
sbd
,
&
s
->
sysctrl_iomem
);
/* AUX 1 (Misc System Functions) */
memory_region_init_io
(
&
s
->
aux1_iomem
,
OBJECT
(
s
),
&
slavio_aux1_mem_ops
,
s
,
"misc-system-functions"
,
MISC_SIZE
);
sysbus_init_mmio
(
dev
,
&
s
->
aux1_iomem
);
sysbus_init_mmio
(
sbd
,
&
s
->
aux1_iomem
);
/* AUX 2 (Software Powerdown Control) */
memory_region_init_io
(
&
s
->
aux2_iomem
,
OBJECT
(
s
),
&
slavio_aux2_mem_ops
,
s
,
"software-powerdown-control"
,
MISC_SIZE
);
sysbus_init_mmio
(
dev
,
&
s
->
aux2_iomem
);
sysbus_init_mmio
(
sbd
,
&
s
->
aux2_iomem
);
qdev_init_gpio_in
(
&
dev
->
q
dev
,
slavio_set_power_fail
,
1
);
qdev_init_gpio_in
(
dev
,
slavio_set_power_fail
,
1
);
return
0
;
}
...
...
@@ -479,7 +484,7 @@ static void slavio_misc_class_init(ObjectClass *klass, void *data)
}
static
const
TypeInfo
slavio_misc_info
=
{
.
name
=
"slavio_misc"
,
.
name
=
TYPE_SLAVIO_MISC
,
.
parent
=
TYPE_SYS_BUS_DEVICE
,
.
instance_size
=
sizeof
(
MiscState
),
.
class_init
=
slavio_misc_class_init
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录