Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
b65b93f2
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,发现更多精彩内容 >>
提交
b65b93f2
编写于
11月 23, 2012
作者:
G
Gerd Hoffmann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
apci: switch piix4 gpe to memory api
Signed-off-by:
N
Gerd Hoffmann
<
kraxel@redhat.com
>
上级
24fe083d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
6 deletion
+18
-6
hw/acpi_piix4.c
hw/acpi_piix4.c
+18
-6
未找到文件。
hw/acpi_piix4.c
浏览文件 @
b65b93f2
...
...
@@ -57,6 +57,7 @@ struct pci_status {
typedef
struct
PIIX4PMState
{
PCIDevice
dev
;
MemoryRegion
io
;
MemoryRegion
io_gpe
;
ACPIREGS
ar
;
APMState
apm
;
...
...
@@ -500,7 +501,7 @@ static void piix4_pm_register_types(void)
type_init
(
piix4_pm_register_types
)
static
uint
32_t
gpe_readb
(
void
*
opaque
,
uint32_t
addr
)
static
uint
64_t
gpe_readb
(
void
*
opaque
,
hwaddr
addr
,
unsigned
width
)
{
PIIX4PMState
*
s
=
opaque
;
uint32_t
val
=
acpi_gpe_ioport_readb
(
&
s
->
ar
,
addr
);
...
...
@@ -509,7 +510,8 @@ static uint32_t gpe_readb(void *opaque, uint32_t addr)
return
val
;
}
static
void
gpe_writeb
(
void
*
opaque
,
uint32_t
addr
,
uint32_t
val
)
static
void
gpe_writeb
(
void
*
opaque
,
hwaddr
addr
,
uint64_t
val
,
unsigned
width
)
{
PIIX4PMState
*
s
=
opaque
;
...
...
@@ -519,6 +521,16 @@ static void gpe_writeb(void *opaque, uint32_t addr, uint32_t val)
PIIX4_DPRINTF
(
"gpe write %x <== %d
\n
"
,
addr
,
val
);
}
static
const
MemoryRegionOps
piix4_gpe_ops
=
{
.
read
=
gpe_readb
,
.
write
=
gpe_writeb
,
.
valid
.
min_access_size
=
1
,
.
valid
.
max_access_size
=
4
,
.
impl
.
min_access_size
=
1
,
.
impl
.
max_access_size
=
1
,
.
endianness
=
DEVICE_LITTLE_ENDIAN
,
};
static
uint32_t
pci_up_read
(
void
*
opaque
,
uint32_t
addr
)
{
PIIX4PMState
*
s
=
opaque
;
...
...
@@ -567,10 +579,10 @@ static int piix4_device_hotplug(DeviceState *qdev, PCIDevice *dev,
static
void
piix4_acpi_system_hot_add_init
(
PCIBus
*
bus
,
PIIX4PMState
*
s
)
{
register_ioport_write
(
GPE_BASE
,
GPE_LEN
,
1
,
gpe_writeb
,
s
);
register_ioport_read
(
GPE_BASE
,
GPE_LEN
,
1
,
gpe_readb
,
s
);
acpi_gpe_blk
(
&
s
->
ar
,
GPE_BASE
);
memory_region_init_io
(
&
s
->
io_gpe
,
&
piix4_gpe_ops
,
s
,
"apci-gpe0"
,
GPE_LEN
);
memory_region_add_subregion
(
get_system_io
(),
GPE_BASE
,
&
s
->
io_gpe
);
acpi_gpe_blk
(
&
s
->
ar
,
0
);
register_ioport_read
(
PCI_UP_BASE
,
4
,
4
,
pci_up_read
,
s
);
register_ioport_read
(
PCI_DOWN_BASE
,
4
,
4
,
pci_down_read
,
s
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录