Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
a2902821
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看板
提交
a2902821
编写于
11月 23, 2012
作者:
G
Gerd Hoffmann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
apci: switch vt82c686 to memory api
Signed-off-by:
N
Gerd Hoffmann
<
kraxel@redhat.com
>
上级
cacaab8b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
27 addition
and
10 deletion
+27
-10
hw/vt82c686.c
hw/vt82c686.c
+27
-10
未找到文件。
hw/vt82c686.c
浏览文件 @
a2902821
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
#include "pm_smbus.h"
#include "pm_smbus.h"
#include "sysemu.h"
#include "sysemu.h"
#include "qemu-timer.h"
#include "qemu-timer.h"
#include "exec-memory.h"
typedef
uint32_t
pci_addr_t
;
typedef
uint32_t
pci_addr_t
;
#include "pci_host.h"
#include "pci_host.h"
...
@@ -159,6 +160,7 @@ static void vt82c686b_write_config(PCIDevice * d, uint32_t address,
...
@@ -159,6 +160,7 @@ static void vt82c686b_write_config(PCIDevice * d, uint32_t address,
typedef
struct
VT686PMState
{
typedef
struct
VT686PMState
{
PCIDevice
dev
;
PCIDevice
dev
;
MemoryRegion
io
;
ACPIREGS
ar
;
ACPIREGS
ar
;
APMState
apm
;
APMState
apm
;
PMSMBus
smb
;
PMSMBus
smb
;
...
@@ -266,21 +268,32 @@ static uint32_t pm_ioport_readl(void *opaque, uint32_t addr)
...
@@ -266,21 +268,32 @@ static uint32_t pm_ioport_readl(void *opaque, uint32_t addr)
return
val
;
return
val
;
}
}
static
const
MemoryRegionOps
pm_io_ops
=
{
.
old_portio
=
(
MemoryRegionPortio
[])
{
{
.
offset
=
0
,
.
len
=
64
,
.
size
=
2
,
.
read
=
pm_ioport_readw
,
.
write
=
pm_ioport_writew
},
{
.
offset
=
0
,
.
len
=
64
,
.
size
=
4
,
.
read
=
pm_ioport_readl
,
.
write
=
pm_ioport_writel
},
PORTIO_END_OF_LIST
(),
},
.
valid
.
min_access_size
=
1
,
.
valid
.
max_access_size
=
4
,
.
impl
.
min_access_size
=
1
,
.
impl
.
max_access_size
=
4
,
.
endianness
=
DEVICE_LITTLE_ENDIAN
,
};
static
void
pm_io_space_update
(
VT686PMState
*
s
)
static
void
pm_io_space_update
(
VT686PMState
*
s
)
{
{
uint32_t
pm_io_base
;
uint32_t
pm_io_base
;
if
(
s
->
dev
.
config
[
0x80
]
&
1
)
{
pm_io_base
=
pci_get_long
(
s
->
dev
.
config
+
0x40
);
pm_io_base
=
pci_get_long
(
s
->
dev
.
config
+
0x40
);
pm_io_base
&=
0xffc0
;
pm_io_base
&=
0xffc0
;
/* XXX: need to improve memory and ioport allocation */
memory_region_transaction_begin
();
DPRINTF
(
"PM: mapping to 0x%x
\n
"
,
pm_io_base
);
memory_region_set_enabled
(
&
s
->
io
,
s
->
dev
.
config
[
0x80
]
&
1
);
register_ioport_write
(
pm_io_base
,
64
,
2
,
pm_ioport_writew
,
s
);
memory_region_set_address
(
&
s
->
io
,
pm_io_base
);
register_ioport_read
(
pm_io_base
,
64
,
2
,
pm_ioport_readw
,
s
);
memory_region_transaction_commit
();
register_ioport_write
(
pm_io_base
,
64
,
4
,
pm_ioport_writel
,
s
);
register_ioport_read
(
pm_io_base
,
64
,
4
,
pm_ioport_readl
,
s
);
}
}
}
static
void
pm_write_config
(
PCIDevice
*
d
,
static
void
pm_write_config
(
PCIDevice
*
d
,
...
@@ -429,6 +442,10 @@ static int vt82c686b_pm_initfn(PCIDevice *dev)
...
@@ -429,6 +442,10 @@ static int vt82c686b_pm_initfn(PCIDevice *dev)
apm_init
(
&
s
->
apm
,
NULL
,
s
);
apm_init
(
&
s
->
apm
,
NULL
,
s
);
memory_region_init_io
(
&
s
->
io
,
&
pm_io_ops
,
s
,
"vt82c686-pm"
,
64
);
memory_region_set_enabled
(
&
s
->
io
,
false
);
memory_region_add_subregion
(
get_system_io
(),
0
,
&
s
->
io
);
acpi_pm_tmr_init
(
&
s
->
ar
,
pm_tmr_timer
);
acpi_pm_tmr_init
(
&
s
->
ar
,
pm_tmr_timer
);
acpi_pm1_cnt_init
(
&
s
->
ar
);
acpi_pm1_cnt_init
(
&
s
->
ar
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录