Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
00049a12
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,发现更多精彩内容 >>
提交
00049a12
编写于
11月 14, 2011
作者:
A
Avi Kivity
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
pxa2xx_dma: convert to memory API
Signed-off-by:
N
Avi Kivity
<
avi@redhat.com
>
上级
838335ec
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
24 addition
and
30 deletion
+24
-30
hw/pxa2xx_dma.c
hw/pxa2xx_dma.c
+24
-30
未找到文件。
hw/pxa2xx_dma.c
浏览文件 @
00049a12
...
...
@@ -28,6 +28,7 @@ typedef struct {
typedef
struct
PXA2xxDMAState
{
SysBusDevice
busdev
;
MemoryRegion
iomem
;
qemu_irq
irq
;
uint32_t
stopintr
;
...
...
@@ -250,11 +251,17 @@ static void pxa2xx_dma_run(PXA2xxDMAState *s)
}
}
static
uint32_t
pxa2xx_dma_read
(
void
*
opaque
,
target_phys_addr_t
offset
)
static
uint64_t
pxa2xx_dma_read
(
void
*
opaque
,
target_phys_addr_t
offset
,
unsigned
size
)
{
PXA2xxDMAState
*
s
=
(
PXA2xxDMAState
*
)
opaque
;
unsigned
int
channel
;
if
(
size
!=
4
)
{
hw_error
(
"%s: Bad access width
\n
"
,
__FUNCTION__
);
return
5
;
}
switch
(
offset
)
{
case
DRCMR64
...
DRCMR74
:
offset
-=
DRCMR64
-
DRCMR0
-
(
64
<<
2
);
...
...
@@ -303,12 +310,17 @@ static uint32_t pxa2xx_dma_read(void *opaque, target_phys_addr_t offset)
return
7
;
}
static
void
pxa2xx_dma_write
(
void
*
opaque
,
target_phys_addr_t
offset
,
uint32_t
valu
e
)
static
void
pxa2xx_dma_write
(
void
*
opaque
,
target_phys_addr_t
offset
,
uint64_t
value
,
unsigned
siz
e
)
{
PXA2xxDMAState
*
s
=
(
PXA2xxDMAState
*
)
opaque
;
unsigned
int
channel
;
if
(
size
!=
4
)
{
hw_error
(
"%s: Bad access width
\n
"
,
__FUNCTION__
);
return
;
}
switch
(
offset
)
{
case
DRCMR64
...
DRCMR74
:
offset
-=
DRCMR64
-
DRCMR0
-
(
64
<<
2
);
...
...
@@ -319,7 +331,7 @@ static void pxa2xx_dma_write(void *opaque,
if
(
value
&
DRCMR_MAPVLD
)
if
((
value
&
DRCMR_CHLNUM
)
>
s
->
channels
)
hw_error
(
"%s: Bad DMA channel %i
\n
"
,
__FUNCTION__
,
value
&
DRCMR_CHLNUM
);
__FUNCTION__
,
(
unsigned
)
value
&
DRCMR_CHLNUM
);
s
->
req
[
channel
]
=
value
;
break
;
...
...
@@ -402,28 +414,10 @@ static void pxa2xx_dma_write(void *opaque,
}
}
static
uint32_t
pxa2xx_dma_readbad
(
void
*
opaque
,
target_phys_addr_t
offset
)
{
hw_error
(
"%s: Bad access width
\n
"
,
__FUNCTION__
);
return
5
;
}
static
void
pxa2xx_dma_writebad
(
void
*
opaque
,
target_phys_addr_t
offset
,
uint32_t
value
)
{
hw_error
(
"%s: Bad access width
\n
"
,
__FUNCTION__
);
}
static
CPUReadMemoryFunc
*
const
pxa2xx_dma_readfn
[]
=
{
pxa2xx_dma_readbad
,
pxa2xx_dma_readbad
,
pxa2xx_dma_read
};
static
CPUWriteMemoryFunc
*
const
pxa2xx_dma_writefn
[]
=
{
pxa2xx_dma_writebad
,
pxa2xx_dma_writebad
,
pxa2xx_dma_write
static
const
MemoryRegionOps
pxa2xx_dma_ops
=
{
.
read
=
pxa2xx_dma_read
,
.
write
=
pxa2xx_dma_write
,
.
endianness
=
DEVICE_NATIVE_ENDIAN
,
};
static
void
pxa2xx_dma_request
(
void
*
opaque
,
int
req_num
,
int
on
)
...
...
@@ -453,7 +447,7 @@ static void pxa2xx_dma_request(void *opaque, int req_num, int on)
static
int
pxa2xx_dma_init
(
SysBusDevice
*
dev
)
{
int
i
,
iomemtype
;
int
i
;
PXA2xxDMAState
*
s
;
s
=
FROM_SYSBUS
(
PXA2xxDMAState
,
dev
);
...
...
@@ -471,9 +465,9 @@ static int pxa2xx_dma_init(SysBusDevice *dev)
qdev_init_gpio_in
(
&
dev
->
qdev
,
pxa2xx_dma_request
,
PXA2XX_DMA_NUM_REQUESTS
);
iomemtype
=
cpu_register_io_memory
(
pxa2xx_dma_readfn
,
pxa2xx_dma_writefn
,
s
,
DEVICE_NATIVE_ENDIAN
);
sysbus_init_mmio
(
dev
,
0x00010000
,
iomemtype
);
memory_region_init_io
(
&
s
->
iomem
,
&
pxa2xx_dma_ops
,
s
,
"pxa2xx.dma"
,
0x00010000
);
sysbus_init_mmio
_region
(
dev
,
&
s
->
iomem
);
sysbus_init_irq
(
dev
,
&
s
->
irq
);
return
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录