Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
3054434d
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看板
提交
3054434d
编写于
11月 06, 2011
作者:
A
Avi Kivity
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rc4030: convert to memory API
Signed-off-by:
N
Avi Kivity
<
avi@redhat.com
>
上级
5a6fdd91
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
27 addition
and
30 deletion
+27
-30
hw/mips.h
hw/mips.h
+2
-1
hw/mips_jazz.c
hw/mips_jazz.c
+2
-1
hw/rc4030.c
hw/rc4030.c
+23
-28
未找到文件。
hw/mips.h
浏览文件 @
3054434d
...
...
@@ -20,7 +20,8 @@ void rc4030_dma_read(void *dma, uint8_t *buf, int len);
void
rc4030_dma_write
(
void
*
dma
,
uint8_t
*
buf
,
int
len
);
void
*
rc4030_init
(
qemu_irq
timer
,
qemu_irq
jazz_bus
,
qemu_irq
**
irqs
,
rc4030_dma
**
dmas
);
qemu_irq
**
irqs
,
rc4030_dma
**
dmas
,
MemoryRegion
*
sysmem
);
/* dp8393x.c */
void
dp83932_init
(
NICInfo
*
nd
,
target_phys_addr_t
base
,
int
it_shift
,
...
...
hw/mips_jazz.c
浏览文件 @
3054434d
...
...
@@ -177,7 +177,8 @@ static void mips_jazz_init(MemoryRegion *address_space,
cpu_mips_clock_init
(
env
);
/* Chipset */
rc4030_opaque
=
rc4030_init
(
env
->
irq
[
6
],
env
->
irq
[
3
],
&
rc4030
,
&
dmas
);
rc4030_opaque
=
rc4030_init
(
env
->
irq
[
6
],
env
->
irq
[
3
],
&
rc4030
,
&
dmas
,
address_space
);
memory_region_init_io
(
dma_dummy
,
&
dma_dummy_ops
,
NULL
,
"dummy_dma"
,
0x1000
);
memory_region_add_subregion
(
address_space
,
0x8000d000
,
dma_dummy
);
...
...
hw/rc4030.c
浏览文件 @
3054434d
...
...
@@ -95,6 +95,9 @@ typedef struct rc4030State
qemu_irq
timer_irq
;
qemu_irq
jazz_bus_irq
;
MemoryRegion
iomem_chipset
;
MemoryRegion
iomem_jazzio
;
}
rc4030State
;
static
void
set_next_tick
(
rc4030State
*
s
)
...
...
@@ -419,16 +422,12 @@ static void rc4030_writeb(void *opaque, target_phys_addr_t addr, uint32_t val)
rc4030_writel
(
opaque
,
addr
&
~
0x3
,
val
);
}
static
CPUReadMemoryFunc
*
const
rc4030_read
[
3
]
=
{
rc4030_readb
,
rc4030_readw
,
rc4030_readl
,
};
static
CPUWriteMemoryFunc
*
const
rc4030_write
[
3
]
=
{
rc4030_writeb
,
rc4030_writew
,
rc4030_writel
,
static
const
MemoryRegionOps
rc4030_ops
=
{
.
old_mmio
=
{
.
read
=
{
rc4030_readb
,
rc4030_readw
,
rc4030_readl
,
},
.
write
=
{
rc4030_writeb
,
rc4030_writew
,
rc4030_writel
,
},
},
.
endianness
=
DEVICE_NATIVE_ENDIAN
,
};
static
void
update_jazz_irq
(
rc4030State
*
s
)
...
...
@@ -573,16 +572,12 @@ static void jazzio_writel(void *opaque, target_phys_addr_t addr, uint32_t val)
jazzio_writew
(
opaque
,
addr
+
2
,
(
val
>>
16
)
&
0xffff
);
}
static
CPUReadMemoryFunc
*
const
jazzio_read
[
3
]
=
{
jazzio_readb
,
jazzio_readw
,
jazzio_readl
,
};
static
CPUWriteMemoryFunc
*
const
jazzio_write
[
3
]
=
{
jazzio_writeb
,
jazzio_writew
,
jazzio_writel
,
static
const
MemoryRegionOps
jazzio_ops
=
{
.
old_mmio
=
{
.
read
=
{
jazzio_readb
,
jazzio_readw
,
jazzio_readl
,
},
.
write
=
{
jazzio_writeb
,
jazzio_writew
,
jazzio_writel
,
},
},
.
endianness
=
DEVICE_NATIVE_ENDIAN
,
};
static
void
rc4030_reset
(
void
*
opaque
)
...
...
@@ -801,10 +796,10 @@ static rc4030_dma *rc4030_allocate_dmas(void *opaque, int n)
}
void
*
rc4030_init
(
qemu_irq
timer
,
qemu_irq
jazz_bus
,
qemu_irq
**
irqs
,
rc4030_dma
**
dmas
)
qemu_irq
**
irqs
,
rc4030_dma
**
dmas
,
MemoryRegion
*
sysmem
)
{
rc4030State
*
s
;
int
s_chipset
,
s_jazzio
;
s
=
g_malloc0
(
sizeof
(
rc4030State
));
...
...
@@ -819,12 +814,12 @@ void *rc4030_init(qemu_irq timer, qemu_irq jazz_bus,
register_savevm
(
NULL
,
"rc4030"
,
0
,
2
,
rc4030_save
,
rc4030_load
,
s
);
rc4030_reset
(
s
);
s_chipset
=
cpu_register_io_memory
(
rc4030_read
,
rc4030_write
,
s
,
DEVICE_NATIVE_ENDIAN
);
cpu_register_physical_memory
(
0x80000000
,
0x300
,
s
_chipset
);
s_jazzio
=
cpu_register_io_memory
(
jazzio_read
,
jazzio_write
,
s
,
DEVICE_NATIVE_ENDIAN
);
cpu_register_physical_memory
(
0xf0000000
,
0x00001000
,
s
_jazzio
);
memory_region_init_io
(
&
s
->
iomem_chipset
,
&
rc4030_ops
,
s
,
"rc4030.chipset"
,
0x300
);
memory_region_add_subregion
(
sysmem
,
0x80000000
,
&
s
->
iomem
_chipset
);
memory_region_init_io
(
&
s
->
iomem_jazzio
,
&
jazzio_ops
,
s
,
"rc4030.jazzio"
,
0x00001000
);
memory_region_add_subregion
(
sysmem
,
0xf0000000
,
&
s
->
iomem
_jazzio
);
return
s
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录