Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
024e5bb6
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看板
提交
024e5bb6
编写于
11月 09, 2011
作者:
A
Avi Kivity
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
dp8393x: convert to memory API
Fixes address space leak on hotunplug. Signed-off-by:
N
Avi Kivity
<
avi@redhat.com
>
上级
df182043
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
17 addition
and
16 deletion
+17
-16
hw/dp8393x.c
hw/dp8393x.c
+15
-15
hw/mips.h
hw/mips.h
+1
-0
hw/mips_jazz.c
hw/mips_jazz.c
+1
-1
未找到文件。
hw/dp8393x.c
浏览文件 @
024e5bb6
...
...
@@ -156,7 +156,8 @@ typedef struct dp8393xState {
int64_t
wt_last_update
;
NICConf
conf
;
NICState
*
nic
;
int
mmio_index
;
MemoryRegion
*
address_space
;
MemoryRegion
mmio
;
/* Registers */
uint8_t
cam
[
16
][
6
];
...
...
@@ -664,16 +665,12 @@ static void dp8393x_writel(void *opaque, target_phys_addr_t addr, uint32_t val)
dp8393x_writew
(
opaque
,
addr
+
2
,
(
val
>>
16
)
&
0xffff
);
}
static
CPUReadMemoryFunc
*
const
dp8393x_read
[
3
]
=
{
dp8393x_readb
,
dp8393x_readw
,
dp8393x_readl
,
};
static
CPUWriteMemoryFunc
*
const
dp8393x_write
[
3
]
=
{
dp8393x_writeb
,
dp8393x_writew
,
dp8393x_writel
,
static
const
MemoryRegionOps
dp8393x_ops
=
{
.
old_mmio
=
{
.
read
=
{
dp8393x_readb
,
dp8393x_readw
,
dp8393x_readl
,
},
.
write
=
{
dp8393x_writeb
,
dp8393x_writew
,
dp8393x_writel
,
},
},
.
endianness
=
DEVICE_NATIVE_ENDIAN
,
};
static
int
nic_can_receive
(
VLANClientState
*
nc
)
...
...
@@ -865,7 +862,8 @@ static void nic_cleanup(VLANClientState *nc)
{
dp8393xState
*
s
=
DO_UPCAST
(
NICState
,
nc
,
nc
)
->
opaque
;
cpu_unregister_io_memory
(
s
->
mmio_index
);
memory_region_del_subregion
(
s
->
address_space
,
&
s
->
mmio
);
memory_region_destroy
(
&
s
->
mmio
);
qemu_del_timer
(
s
->
watchdog
);
qemu_free_timer
(
s
->
watchdog
);
...
...
@@ -882,6 +880,7 @@ static NetClientInfo net_dp83932_info = {
};
void
dp83932_init
(
NICInfo
*
nd
,
target_phys_addr_t
base
,
int
it_shift
,
MemoryRegion
*
address_space
,
qemu_irq
irq
,
void
*
mem_opaque
,
void
(
*
memory_rw
)(
void
*
opaque
,
target_phys_addr_t
addr
,
uint8_t
*
buf
,
int
len
,
int
is_write
))
{
...
...
@@ -891,6 +890,7 @@ void dp83932_init(NICInfo *nd, target_phys_addr_t base, int it_shift,
s
=
g_malloc0
(
sizeof
(
dp8393xState
));
s
->
address_space
=
address_space
;
s
->
mem_opaque
=
mem_opaque
;
s
->
memory_rw
=
memory_rw
;
s
->
it_shift
=
it_shift
;
...
...
@@ -908,7 +908,7 @@ void dp83932_init(NICInfo *nd, target_phys_addr_t base, int it_shift,
qemu_register_reset
(
nic_reset
,
s
);
nic_reset
(
s
);
s
->
mmio_index
=
cpu_register_io_memory
(
dp8393x_read
,
dp8393x_write
,
s
,
DEVICE_NATIVE_ENDIAN
);
cpu_register_physical_memory
(
base
,
0x40
<<
it_shift
,
s
->
mmio_index
);
memory_region_init_io
(
&
s
->
mmio
,
&
dp8393x_ops
,
s
,
"dp8393x"
,
0x40
<<
it_shift
);
memory_region_add_subregion
(
address_space
,
base
,
&
s
->
mmio
);
}
hw/mips.h
浏览文件 @
024e5bb6
...
...
@@ -25,6 +25,7 @@ void *rc4030_init(qemu_irq timer, qemu_irq jazz_bus,
/* dp8393x.c */
void
dp83932_init
(
NICInfo
*
nd
,
target_phys_addr_t
base
,
int
it_shift
,
MemoryRegion
*
address_space
,
qemu_irq
irq
,
void
*
mem_opaque
,
void
(
*
memory_rw
)(
void
*
opaque
,
target_phys_addr_t
addr
,
uint8_t
*
buf
,
int
len
,
int
is_write
));
...
...
hw/mips_jazz.c
浏览文件 @
024e5bb6
...
...
@@ -227,7 +227,7 @@ static void mips_jazz_init(MemoryRegion *address_space,
if
(
!
nd
->
model
)
nd
->
model
=
g_strdup
(
"dp83932"
);
if
(
strcmp
(
nd
->
model
,
"dp83932"
)
==
0
)
{
dp83932_init
(
nd
,
0x80001000
,
2
,
rc4030
[
4
],
dp83932_init
(
nd
,
0x80001000
,
2
,
get_system_memory
(),
rc4030
[
4
],
rc4030_opaque
,
rc4030_dma_memory_rw
);
break
;
}
else
if
(
strcmp
(
nd
->
model
,
"?"
)
==
0
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录