Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
76a7daf9
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看板
提交
76a7daf9
编写于
12年前
作者:
G
Gerd Hoffmann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
apci: switch ich9 gpe to memory api
Signed-off-by:
N
Gerd Hoffmann
<
kraxel@redhat.com
>
上级
a0f95659
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
29 addition
and
10 deletion
+29
-10
hw/acpi_ich9.c
hw/acpi_ich9.c
+28
-10
hw/acpi_ich9.h
hw/acpi_ich9.h
+1
-0
未找到文件。
hw/acpi_ich9.c
浏览文件 @
76a7daf9
...
...
@@ -73,12 +73,7 @@ static void ich9_pm_update_sci_fn(ACPIREGS *regs)
static
void
pm_ioport_writeb
(
void
*
opaque
,
uint32_t
addr
,
uint32_t
val
)
{
ICH9LPCPMRegs
*
pm
=
opaque
;
switch
(
addr
&
ICH9_PMIO_MASK
)
{
case
ICH9_PMIO_GPE0_STS
...
(
ICH9_PMIO_GPE0_STS
+
ICH9_PMIO_GPE0_LEN
-
1
):
acpi_gpe_ioport_writeb
(
&
pm
->
acpi_regs
,
addr
,
val
);
break
;
default:
break
;
}
...
...
@@ -88,13 +83,9 @@ static void pm_ioport_writeb(void *opaque, uint32_t addr, uint32_t val)
static
uint32_t
pm_ioport_readb
(
void
*
opaque
,
uint32_t
addr
)
{
ICH9LPCPMRegs
*
pm
=
opaque
;
uint32_t
val
=
0
;
switch
(
addr
&
ICH9_PMIO_MASK
)
{
case
ICH9_PMIO_GPE0_STS
...
(
ICH9_PMIO_GPE0_STS
+
ICH9_PMIO_GPE0_LEN
-
1
):
val
=
acpi_gpe_ioport_readb
(
&
pm
->
acpi_regs
,
addr
);
break
;
default:
val
=
0
;
break
;
...
...
@@ -209,6 +200,29 @@ static const MemoryRegionOps pm_io_ops = {
.
endianness
=
DEVICE_LITTLE_ENDIAN
,
};
static
uint64_t
ich9_gpe_readb
(
void
*
opaque
,
hwaddr
addr
,
unsigned
width
)
{
ICH9LPCPMRegs
*
pm
=
opaque
;
return
acpi_gpe_ioport_readb
(
&
pm
->
acpi_regs
,
addr
);
}
static
void
ich9_gpe_writeb
(
void
*
opaque
,
hwaddr
addr
,
uint64_t
val
,
unsigned
width
)
{
ICH9LPCPMRegs
*
pm
=
opaque
;
acpi_gpe_ioport_writeb
(
&
pm
->
acpi_regs
,
addr
,
val
);
}
static
const
MemoryRegionOps
ich9_gpe_ops
=
{
.
read
=
ich9_gpe_readb
,
.
write
=
ich9_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
,
};
void
ich9_pm_iospace_update
(
ICH9LPCPMRegs
*
pm
,
uint32_t
pm_io_base
)
{
ICH9_DEBUG
(
"to 0x%x
\n
"
,
pm_io_base
);
...
...
@@ -297,8 +311,12 @@ void ich9_pm_init(ICH9LPCPMRegs *pm, qemu_irq sci_irq, qemu_irq cmos_s3)
acpi_pm_tmr_init
(
&
pm
->
acpi_regs
,
ich9_pm_update_sci_fn
,
&
pm
->
io
);
acpi_pm1_evt_init
(
&
pm
->
acpi_regs
,
ich9_pm_update_sci_fn
,
&
pm
->
io
);
acpi_pm1_cnt_init
(
&
pm
->
acpi_regs
,
&
pm
->
io
);
acpi_gpe_init
(
&
pm
->
acpi_regs
,
ICH9_PMIO_GPE0_LEN
);
acpi_gpe_blk
(
&
pm
->
acpi_regs
,
ICH9_PMIO_GPE0_STS
);
acpi_gpe_blk
(
&
pm
->
acpi_regs
,
0
);
memory_region_init_io
(
&
pm
->
io_gpe
,
&
ich9_gpe_ops
,
pm
,
"apci-gpe0"
,
ICH9_PMIO_GPE0_LEN
);
memory_region_add_subregion
(
&
pm
->
io
,
ICH9_PMIO_GPE0_STS
,
&
pm
->
io_gpe
);
pm
->
irq
=
sci_irq
;
qemu_register_reset
(
pm_reset
,
pm
);
...
...
This diff is collapsed.
Click to expand it.
hw/acpi_ich9.h
浏览文件 @
76a7daf9
...
...
@@ -31,6 +31,7 @@ typedef struct ICH9LPCPMRegs {
*/
ACPIREGS
acpi_regs
;
MemoryRegion
io
;
MemoryRegion
io_gpe
;
uint32_t
smi_en
;
uint32_t
smi_sts
;
...
...
This diff is collapsed.
Click to expand it.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
新手
引导
客服
返回
顶部