Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
7ef57cca
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,发现更多精彩内容 >>
提交
7ef57cca
编写于
11月 14, 2011
作者:
A
Avi Kivity
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
eccmemctl: convert to memory API
Signed-off-by:
N
Avi Kivity
<
avi@redhat.com
>
上级
b0a941b0
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
30 addition
and
33 deletion
+30
-33
hw/eccmemctl.c
hw/eccmemctl.c
+30
-33
未找到文件。
hw/eccmemctl.c
浏览文件 @
7ef57cca
...
...
@@ -122,13 +122,15 @@
typedef
struct
ECCState
{
SysBusDevice
busdev
;
MemoryRegion
iomem
,
iomem_diag
;
qemu_irq
irq
;
uint32_t
regs
[
ECC_NREGS
];
uint8_t
diag
[
ECC_DIAG_SIZE
];
uint32_t
version
;
}
ECCState
;
static
void
ecc_mem_writel
(
void
*
opaque
,
target_phys_addr_t
addr
,
uint32_t
val
)
static
void
ecc_mem_write
(
void
*
opaque
,
target_phys_addr_t
addr
,
uint64_t
val
,
unsigned
size
)
{
ECCState
*
s
=
opaque
;
...
...
@@ -170,7 +172,8 @@ static void ecc_mem_writel(void *opaque, target_phys_addr_t addr, uint32_t val)
}
}
static
uint32_t
ecc_mem_readl
(
void
*
opaque
,
target_phys_addr_t
addr
)
static
uint64_t
ecc_mem_read
(
void
*
opaque
,
target_phys_addr_t
addr
,
unsigned
size
)
{
ECCState
*
s
=
opaque
;
uint32_t
ret
=
0
;
...
...
@@ -216,20 +219,18 @@ static uint32_t ecc_mem_readl(void *opaque, target_phys_addr_t addr)
return
ret
;
}
static
CPUReadMemoryFunc
*
const
ecc_mem_read
[
3
]
=
{
NULL
,
NULL
,
ecc_mem_readl
,
static
const
MemoryRegionOps
ecc_mem_ops
=
{
.
read
=
ecc_mem_read
,
.
write
=
ecc_mem_write
,
.
endianness
=
DEVICE_NATIVE_ENDIAN
,
.
valid
=
{
.
min_access_size
=
4
,
.
max_access_size
=
4
,
},
};
static
CPUWriteMemoryFunc
*
const
ecc_mem_write
[
3
]
=
{
NULL
,
NULL
,
ecc_mem_writel
,
};
static
void
ecc_diag_mem_writeb
(
void
*
opaque
,
target_phys_addr_t
addr
,
uint32_t
val
)
static
void
ecc_diag_mem_write
(
void
*
opaque
,
target_phys_addr_t
addr
,
uint64_t
val
,
unsigned
size
)
{
ECCState
*
s
=
opaque
;
...
...
@@ -237,7 +238,8 @@ static void ecc_diag_mem_writeb(void *opaque, target_phys_addr_t addr,
s
->
diag
[
addr
&
ECC_DIAG_MASK
]
=
val
;
}
static
uint32_t
ecc_diag_mem_readb
(
void
*
opaque
,
target_phys_addr_t
addr
)
static
uint64_t
ecc_diag_mem_read
(
void
*
opaque
,
target_phys_addr_t
addr
,
unsigned
size
)
{
ECCState
*
s
=
opaque
;
uint32_t
ret
=
s
->
diag
[(
int
)
addr
];
...
...
@@ -246,16 +248,14 @@ static uint32_t ecc_diag_mem_readb(void *opaque, target_phys_addr_t addr)
return
ret
;
}
static
CPUReadMemoryFunc
*
const
ecc_diag_mem_read
[
3
]
=
{
ecc_diag_mem_readb
,
NULL
,
NULL
,
};
static
CPUWriteMemoryFunc
*
const
ecc_diag_mem_write
[
3
]
=
{
ecc_diag_mem_writeb
,
NULL
,
NULL
,
static
const
MemoryRegionOps
ecc_diag_mem_ops
=
{
.
read
=
ecc_diag_mem_read
,
.
write
=
ecc_diag_mem_write
,
.
endianness
=
DEVICE_NATIVE_ENDIAN
,
.
valid
=
{
.
min_access_size
=
1
,
.
max_access_size
=
1
,
},
};
static
const
VMStateDescription
vmstate_ecc
=
{
...
...
@@ -292,20 +292,17 @@ static void ecc_reset(DeviceState *d)
static
int
ecc_init1
(
SysBusDevice
*
dev
)
{
int
ecc_io_memory
;
ECCState
*
s
=
FROM_SYSBUS
(
ECCState
,
dev
);
sysbus_init_irq
(
dev
,
&
s
->
irq
);
s
->
regs
[
0
]
=
s
->
version
;
ecc_io_memory
=
cpu_register_io_memory
(
ecc_mem_read
,
ecc_mem_write
,
s
,
DEVICE_NATIVE_ENDIAN
);
sysbus_init_mmio
(
dev
,
ECC_SIZE
,
ecc_io_memory
);
memory_region_init_io
(
&
s
->
iomem
,
&
ecc_mem_ops
,
s
,
"ecc"
,
ECC_SIZE
);
sysbus_init_mmio_region
(
dev
,
&
s
->
iomem
);
if
(
s
->
version
==
ECC_MCC
)
{
// SS-600MP only
ecc_io_memory
=
cpu_register_io_memory
(
ecc_diag_mem_read
,
ecc_diag_mem_write
,
s
,
DEVICE_NATIVE_ENDIAN
);
sysbus_init_mmio
(
dev
,
ECC_DIAG_SIZE
,
ecc_io_memory
);
memory_region_init_io
(
&
s
->
iomem_diag
,
&
ecc_diag_mem_ops
,
s
,
"ecc.diag"
,
ECC_DIAG_SIZE
);
sysbus_init_mmio_region
(
dev
,
&
s
->
iomem_diag
);
}
return
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录