Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
7abad863
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看板
提交
7abad863
编写于
7月 26, 2013
作者:
A
Andreas Färber
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
slavio_intctl: QOM cast cleanup
Signed-off-by:
N
Andreas Färber
<
afaerber@suse.de
>
上级
b09a6f7b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
17 deletion
+18
-17
hw/intc/slavio_intctl.c
hw/intc/slavio_intctl.c
+18
-17
未找到文件。
hw/intc/slavio_intctl.c
浏览文件 @
7abad863
...
...
@@ -53,8 +53,13 @@ typedef struct SLAVIO_CPUINTCTLState {
uint32_t
irl_out
;
}
SLAVIO_CPUINTCTLState
;
#define TYPE_SLAVIO_INTCTL "slavio_intctl"
#define SLAVIO_INTCTL(obj) \
OBJECT_CHECK(SLAVIO_INTCTLState, (obj), TYPE_SLAVIO_INTCTL)
typedef
struct
SLAVIO_INTCTLState
{
SysBusDevice
busdev
;
SysBusDevice
parent_obj
;
MemoryRegion
iomem
;
#ifdef DEBUG_IRQ_COUNT
uint64_t
irq_count
[
32
];
...
...
@@ -206,12 +211,9 @@ static const MemoryRegionOps slavio_intctlm_mem_ops = {
void
slavio_pic_info
(
Monitor
*
mon
,
DeviceState
*
dev
)
{
SysBusDevice
*
sd
;
SLAVIO_INTCTLState
*
s
;
SLAVIO_INTCTLState
*
s
=
SLAVIO_INTCTL
(
dev
);
int
i
;
sd
=
SYS_BUS_DEVICE
(
dev
);
s
=
FROM_SYSBUS
(
SLAVIO_INTCTLState
,
sd
);
for
(
i
=
0
;
i
<
MAX_CPUS
;
i
++
)
{
monitor_printf
(
mon
,
"per-cpu %d: pending 0x%08x
\n
"
,
i
,
s
->
slaves
[
i
].
intreg_pending
);
...
...
@@ -225,13 +227,11 @@ void slavio_irq_info(Monitor *mon, DeviceState *dev)
#ifndef DEBUG_IRQ_COUNT
monitor_printf
(
mon
,
"irq statistic code not compiled.
\n
"
);
#else
SysBusDevice
*
sd
;
SLAVIO_INTCTLState
*
s
;
SLAVIO_INTCTLState
*
s
=
SLAVIO_INTCTL
(
dev
);
int
i
;
int64_t
count
;
sd
=
SYS_BUS_DEVICE
(
dev
);
s
=
FROM_SYSBUS
(
SLAVIO_INTCTLState
,
sd
);
s
=
SLAVIO_INTCTL
(
dev
);
monitor_printf
(
mon
,
"IRQ statistics:
\n
"
);
for
(
i
=
0
;
i
<
32
;
i
++
)
{
count
=
s
->
irq_count
[
i
];
...
...
@@ -406,7 +406,7 @@ static const VMStateDescription vmstate_intctl = {
static
void
slavio_intctl_reset
(
DeviceState
*
d
)
{
SLAVIO_INTCTLState
*
s
=
container_of
(
d
,
SLAVIO_INTCTLState
,
busdev
.
qdev
);
SLAVIO_INTCTLState
*
s
=
SLAVIO_INTCTL
(
d
);
int
i
;
for
(
i
=
0
;
i
<
MAX_CPUS
;
i
++
)
{
...
...
@@ -419,27 +419,28 @@ static void slavio_intctl_reset(DeviceState *d)
slavio_check_interrupts
(
s
,
0
);
}
static
int
slavio_intctl_init1
(
SysBusDevice
*
dev
)
static
int
slavio_intctl_init1
(
SysBusDevice
*
sbd
)
{
SLAVIO_INTCTLState
*
s
=
FROM_SYSBUS
(
SLAVIO_INTCTLState
,
dev
);
DeviceState
*
dev
=
DEVICE
(
sbd
);
SLAVIO_INTCTLState
*
s
=
SLAVIO_INTCTL
(
dev
);
unsigned
int
i
,
j
;
char
slave_name
[
45
];
qdev_init_gpio_in
(
&
dev
->
q
dev
,
slavio_set_irq_all
,
32
+
MAX_CPUS
);
qdev_init_gpio_in
(
dev
,
slavio_set_irq_all
,
32
+
MAX_CPUS
);
memory_region_init_io
(
&
s
->
iomem
,
OBJECT
(
s
),
&
slavio_intctlm_mem_ops
,
s
,
"master-interrupt-controller"
,
INTCTLM_SIZE
);
sysbus_init_mmio
(
dev
,
&
s
->
iomem
);
sysbus_init_mmio
(
sbd
,
&
s
->
iomem
);
for
(
i
=
0
;
i
<
MAX_CPUS
;
i
++
)
{
snprintf
(
slave_name
,
sizeof
(
slave_name
),
"slave-interrupt-controller-%i"
,
i
);
for
(
j
=
0
;
j
<
MAX_PILS
;
j
++
)
{
sysbus_init_irq
(
dev
,
&
s
->
cpu_irqs
[
i
][
j
]);
sysbus_init_irq
(
sbd
,
&
s
->
cpu_irqs
[
i
][
j
]);
}
memory_region_init_io
(
&
s
->
slaves
[
i
].
iomem
,
OBJECT
(
s
),
&
slavio_intctl_mem_ops
,
&
s
->
slaves
[
i
],
slave_name
,
INTCTL_SIZE
);
sysbus_init_mmio
(
dev
,
&
s
->
slaves
[
i
].
iomem
);
sysbus_init_mmio
(
sbd
,
&
s
->
slaves
[
i
].
iomem
);
s
->
slaves
[
i
].
cpu
=
i
;
s
->
slaves
[
i
].
master
=
s
;
}
...
...
@@ -458,7 +459,7 @@ static void slavio_intctl_class_init(ObjectClass *klass, void *data)
}
static
const
TypeInfo
slavio_intctl_info
=
{
.
name
=
"slavio_intctl"
,
.
name
=
TYPE_SLAVIO_INTCTL
,
.
parent
=
TYPE_SYS_BUS_DEVICE
,
.
instance_size
=
sizeof
(
SLAVIO_INTCTLState
),
.
class_init
=
slavio_intctl_class_init
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录