Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
afafe4bb
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看板
提交
afafe4bb
编写于
11月 22, 2012
作者:
G
Gerd Hoffmann
1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
apci: switch cnt to memory api
Signed-off-by:
N
Gerd Hoffmann
<
kraxel@redhat.com
>
上级
77d58b1e
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
36 addition
and
31 deletion
+36
-31
hw/acpi.c
hw/acpi.c
+30
-8
hw/acpi.h
hw/acpi.h
+3
-2
hw/acpi_ich9.c
hw/acpi_ich9.c
+1
-7
hw/acpi_piix4.c
hw/acpi_piix4.c
+1
-7
hw/vt82c686.c
hw/vt82c686.c
+1
-7
未找到文件。
hw/acpi.c
浏览文件 @
afafe4bb
...
...
@@ -372,13 +372,7 @@ void acpi_pm_tmr_reset(ACPIREGS *ar)
}
/* ACPI PM1aCNT */
void
acpi_pm1_cnt_init
(
ACPIREGS
*
ar
)
{
ar
->
wakeup
.
notify
=
acpi_notify_wakeup
;
qemu_register_wakeup_notifier
(
&
ar
->
wakeup
);
}
void
acpi_pm1_cnt_write
(
ACPIREGS
*
ar
,
uint16_t
val
,
char
s4
)
static
void
acpi_pm1_cnt_write
(
ACPIREGS
*
ar
,
uint16_t
val
)
{
ar
->
pm1
.
cnt
.
cnt
=
val
&
~
(
ACPI_BITMASK_SLEEP_ENABLE
);
...
...
@@ -393,7 +387,7 @@ void acpi_pm1_cnt_write(ACPIREGS *ar, uint16_t val, char s4)
qemu_system_suspend_request
();
break
;
default:
if
(
sus_typ
==
s4
)
{
/* S4 request */
if
(
sus_typ
==
ar
->
pm1
.
cnt
.
s4_val
)
{
/* S4 request */
monitor_protocol_event
(
QEVENT_SUSPEND_DISK
,
NULL
);
qemu_system_shutdown_request
();
}
...
...
@@ -413,6 +407,34 @@ void acpi_pm1_cnt_update(ACPIREGS *ar,
}
}
static
uint64_t
acpi_pm_cnt_read
(
void
*
opaque
,
hwaddr
addr
,
unsigned
width
)
{
ACPIREGS
*
ar
=
opaque
;
return
ar
->
pm1
.
cnt
.
cnt
;
}
static
void
acpi_pm_cnt_write
(
void
*
opaque
,
hwaddr
addr
,
uint64_t
val
,
unsigned
width
)
{
acpi_pm1_cnt_write
(
opaque
,
val
);
}
static
const
MemoryRegionOps
acpi_pm_cnt_ops
=
{
.
read
=
acpi_pm_cnt_read
,
.
write
=
acpi_pm_cnt_write
,
.
valid
.
min_access_size
=
2
,
.
valid
.
max_access_size
=
2
,
.
endianness
=
DEVICE_LITTLE_ENDIAN
,
};
void
acpi_pm1_cnt_init
(
ACPIREGS
*
ar
,
MemoryRegion
*
parent
)
{
ar
->
wakeup
.
notify
=
acpi_notify_wakeup
;
qemu_register_wakeup_notifier
(
&
ar
->
wakeup
);
memory_region_init_io
(
&
ar
->
pm1
.
cnt
.
io
,
&
acpi_pm_cnt_ops
,
ar
,
"acpi-cnt"
,
2
);
memory_region_add_subregion
(
parent
,
4
,
&
ar
->
pm1
.
cnt
.
io
);
}
void
acpi_pm1_cnt_reset
(
ACPIREGS
*
ar
)
{
ar
->
pm1
.
cnt
.
cnt
=
0
;
...
...
hw/acpi.h
浏览文件 @
afafe4bb
...
...
@@ -96,7 +96,9 @@ struct ACPIPM1EVT {
};
struct
ACPIPM1CNT
{
MemoryRegion
io
;
uint16_t
cnt
;
uint8_t
s4_val
;
};
struct
ACPIGPE
{
...
...
@@ -139,8 +141,7 @@ void acpi_pm1_evt_power_down(ACPIREGS *ar);
void
acpi_pm1_evt_reset
(
ACPIREGS
*
ar
);
/* PM1a_CNT: piix and ich9 don't implement PM1b CNT. */
void
acpi_pm1_cnt_init
(
ACPIREGS
*
ar
);
void
acpi_pm1_cnt_write
(
ACPIREGS
*
ar
,
uint16_t
val
,
char
s4
);
void
acpi_pm1_cnt_init
(
ACPIREGS
*
ar
,
MemoryRegion
*
parent
);
void
acpi_pm1_cnt_update
(
ACPIREGS
*
ar
,
bool
sci_enable
,
bool
sci_disable
);
void
acpi_pm1_cnt_reset
(
ACPIREGS
*
ar
);
...
...
hw/acpi_ich9.c
浏览文件 @
afafe4bb
...
...
@@ -116,9 +116,6 @@ static void pm_ioport_writew(void *opaque, uint32_t addr, uint32_t val)
pm
->
acpi_regs
.
pm1
.
evt
.
en
=
val
;
pm_update_sci
(
pm
);
break
;
case
ICH9_PMIO_PM1_CNT
:
acpi_pm1_cnt_write
(
&
pm
->
acpi_regs
,
val
,
0
);
break
;
default:
pm_ioport_write_fallback
(
opaque
,
addr
,
2
,
val
);
break
;
...
...
@@ -138,9 +135,6 @@ static uint32_t pm_ioport_readw(void *opaque, uint32_t addr)
case
ICH9_PMIO_PM1_EN
:
val
=
pm
->
acpi_regs
.
pm1
.
evt
.
en
;
break
;
case
ICH9_PMIO_PM1_CNT
:
val
=
pm
->
acpi_regs
.
pm1
.
cnt
.
cnt
;
break
;
default:
val
=
pm_ioport_read_fallback
(
opaque
,
addr
,
2
);
break
;
...
...
@@ -318,7 +312,7 @@ void ich9_pm_init(ICH9LPCPMRegs *pm, qemu_irq sci_irq, qemu_irq cmos_s3)
memory_region_add_subregion
(
get_system_io
(),
0
,
&
pm
->
io
);
acpi_pm_tmr_init
(
&
pm
->
acpi_regs
,
ich9_pm_update_sci_fn
,
&
pm
->
io
);
acpi_pm1_cnt_init
(
&
pm
->
acpi_regs
);
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
);
...
...
hw/acpi_piix4.c
浏览文件 @
afafe4bb
...
...
@@ -129,9 +129,6 @@ static void pm_ioport_write(void *opaque, hwaddr addr, uint64_t val,
acpi_pm1_evt_write_en
(
&
s
->
ar
,
val
);
pm_update_sci
(
s
);
break
;
case
0x04
:
acpi_pm1_cnt_write
(
&
s
->
ar
,
val
,
s
->
s4_val
);
break
;
default:
break
;
}
...
...
@@ -151,9 +148,6 @@ static uint64_t pm_ioport_read(void *opaque, hwaddr addr, unsigned width)
case
0x02
:
val
=
s
->
ar
.
pm1
.
evt
.
en
;
break
;
case
0x04
:
val
=
s
->
ar
.
pm1
.
cnt
.
cnt
;
break
;
default:
val
=
0
;
break
;
...
...
@@ -461,6 +455,7 @@ static int piix4_pm_initfn(PCIDevice *dev)
memory_region_add_subregion
(
get_system_io
(),
0
,
&
s
->
io
);
acpi_pm_tmr_init
(
&
s
->
ar
,
pm_tmr_timer
,
&
s
->
io
);
acpi_pm1_cnt_init
(
&
s
->
ar
,
&
s
->
io
);
acpi_gpe_init
(
&
s
->
ar
,
GPE_LEN
);
s
->
powerdown_notifier
.
notify
=
piix4_pm_powerdown_req
;
...
...
@@ -487,7 +482,6 @@ i2c_bus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base,
s
=
DO_UPCAST
(
PIIX4PMState
,
dev
,
dev
);
s
->
irq
=
sci_irq
;
acpi_pm1_cnt_init
(
&
s
->
ar
);
s
->
smi_irq
=
smi_irq
;
s
->
kvm_enabled
=
kvm_enabled
;
...
...
hw/vt82c686.c
浏览文件 @
afafe4bb
...
...
@@ -211,9 +211,6 @@ static void pm_ioport_writew(void *opaque, uint32_t addr, uint32_t val)
acpi_pm1_evt_write_en
(
&
s
->
ar
,
val
);
pm_update_sci
(
s
);
break
;
case
0x04
:
acpi_pm1_cnt_write
(
&
s
->
ar
,
val
,
0
);
break
;
default:
break
;
}
...
...
@@ -233,9 +230,6 @@ static uint32_t pm_ioport_readw(void *opaque, uint32_t addr)
case
0x02
:
val
=
s
->
ar
.
pm1
.
evt
.
en
;
break
;
case
0x04
:
val
=
s
->
ar
.
pm1
.
cnt
.
cnt
;
break
;
default:
val
=
0
;
break
;
...
...
@@ -443,7 +437,7 @@ static int vt82c686b_pm_initfn(PCIDevice *dev)
memory_region_add_subregion
(
get_system_io
(),
0
,
&
s
->
io
);
acpi_pm_tmr_init
(
&
s
->
ar
,
pm_tmr_timer
,
&
s
->
io
);
acpi_pm1_cnt_init
(
&
s
->
ar
);
acpi_pm1_cnt_init
(
&
s
->
ar
,
&
s
->
io
);
pm_smbus_init
(
&
s
->
dev
.
qdev
,
&
s
->
smb
);
...
...
tester丶
🤺
@ssszwink
mentioned in commit
888e036e
·
9月 10, 2020
mentioned in commit
888e036e
mentioned in commit 888e036eb4f03ec266be05cec3d047488dcaa165
开关提交列表
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录