Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
3150fa50
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看板
提交
3150fa50
编写于
10月 03, 2011
作者:
A
Avi Kivity
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sun4m: convert to memory API
Signed-off-by:
N
Avi Kivity
<
avi@redhat.com
>
上级
eb2fefbc
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
32 addition
and
17 deletion
+32
-17
hw/sun4m.c
hw/sun4m.c
+32
-17
未找到文件。
hw/sun4m.c
浏览文件 @
3150fa50
...
@@ -593,19 +593,25 @@ static void idreg_init(target_phys_addr_t addr)
...
@@ -593,19 +593,25 @@ static void idreg_init(target_phys_addr_t addr)
cpu_physical_memory_write_rom
(
addr
,
idreg_data
,
sizeof
(
idreg_data
));
cpu_physical_memory_write_rom
(
addr
,
idreg_data
,
sizeof
(
idreg_data
));
}
}
typedef
struct
IDRegState
{
SysBusDevice
busdev
;
MemoryRegion
mem
;
}
IDRegState
;
static
int
idreg_init1
(
SysBusDevice
*
dev
)
static
int
idreg_init1
(
SysBusDevice
*
dev
)
{
{
ram_addr_t
idreg_offset
;
IDRegState
*
s
=
FROM_SYSBUS
(
IDRegState
,
dev
)
;
idreg_offset
=
qemu_ram_alloc
(
NULL
,
"sun4m.idreg"
,
sizeof
(
idreg_data
));
memory_region_init_ram
(
&
s
->
mem
,
NULL
,
"sun4m.idreg"
,
sizeof
(
idreg_data
));
sysbus_init_mmio
(
dev
,
sizeof
(
idreg_data
),
idreg_offset
|
IO_MEM_ROM
);
memory_region_set_readonly
(
&
s
->
mem
,
true
);
sysbus_init_mmio_region
(
dev
,
&
s
->
mem
);
return
0
;
return
0
;
}
}
static
SysBusDeviceInfo
idreg_info
=
{
static
SysBusDeviceInfo
idreg_info
=
{
.
init
=
idreg_init1
,
.
init
=
idreg_init1
,
.
qdev
.
name
=
"macio_idreg"
,
.
qdev
.
name
=
"macio_idreg"
,
.
qdev
.
size
=
sizeof
(
SysBusDevic
e
),
.
qdev
.
size
=
sizeof
(
IDRegStat
e
),
};
};
static
void
idreg_register_devices
(
void
)
static
void
idreg_register_devices
(
void
)
...
@@ -615,6 +621,11 @@ static void idreg_register_devices(void)
...
@@ -615,6 +621,11 @@ static void idreg_register_devices(void)
device_init
(
idreg_register_devices
);
device_init
(
idreg_register_devices
);
typedef
struct
AFXState
{
SysBusDevice
busdev
;
MemoryRegion
mem
;
}
AFXState
;
/* SS-5 TCX AFX register */
/* SS-5 TCX AFX register */
static
void
afx_init
(
target_phys_addr_t
addr
)
static
void
afx_init
(
target_phys_addr_t
addr
)
{
{
...
@@ -630,17 +641,17 @@ static void afx_init(target_phys_addr_t addr)
...
@@ -630,17 +641,17 @@ static void afx_init(target_phys_addr_t addr)
static
int
afx_init1
(
SysBusDevice
*
dev
)
static
int
afx_init1
(
SysBusDevice
*
dev
)
{
{
ram_addr_t
afx_offset
;
AFXState
*
s
=
FROM_SYSBUS
(
AFXState
,
dev
)
;
afx_offset
=
qemu_ram_alloc
(
NULL
,
"sun4m.afx"
,
4
);
memory_region_init_ram
(
&
s
->
mem
,
NULL
,
"sun4m.afx"
,
4
);
sysbus_init_mmio
(
dev
,
4
,
afx_offset
|
IO_MEM_RAM
);
sysbus_init_mmio
_region
(
dev
,
&
s
->
mem
);
return
0
;
return
0
;
}
}
static
SysBusDeviceInfo
afx_info
=
{
static
SysBusDeviceInfo
afx_info
=
{
.
init
=
afx_init1
,
.
init
=
afx_init1
,
.
qdev
.
name
=
"tcx_afx"
,
.
qdev
.
name
=
"tcx_afx"
,
.
qdev
.
size
=
sizeof
(
SysBusDevic
e
),
.
qdev
.
size
=
sizeof
(
AFXStat
e
),
};
};
static
void
afx_register_devices
(
void
)
static
void
afx_register_devices
(
void
)
...
@@ -650,6 +661,11 @@ static void afx_register_devices(void)
...
@@ -650,6 +661,11 @@ static void afx_register_devices(void)
device_init
(
afx_register_devices
);
device_init
(
afx_register_devices
);
typedef
struct
PROMState
{
SysBusDevice
busdev
;
MemoryRegion
prom
;
}
PROMState
;
/* Boot PROM (OpenBIOS) */
/* Boot PROM (OpenBIOS) */
static
uint64_t
translate_prom_address
(
void
*
opaque
,
uint64_t
addr
)
static
uint64_t
translate_prom_address
(
void
*
opaque
,
uint64_t
addr
)
{
{
...
@@ -693,17 +709,18 @@ static void prom_init(target_phys_addr_t addr, const char *bios_name)
...
@@ -693,17 +709,18 @@ static void prom_init(target_phys_addr_t addr, const char *bios_name)
static
int
prom_init1
(
SysBusDevice
*
dev
)
static
int
prom_init1
(
SysBusDevice
*
dev
)
{
{
ram_addr_t
prom_offset
;
PROMState
*
s
=
FROM_SYSBUS
(
PROMState
,
dev
)
;
prom_offset
=
qemu_ram_alloc
(
NULL
,
"sun4m.prom"
,
PROM_SIZE_MAX
);
memory_region_init_ram
(
&
s
->
prom
,
NULL
,
"sun4m.prom"
,
PROM_SIZE_MAX
);
sysbus_init_mmio
(
dev
,
PROM_SIZE_MAX
,
prom_offset
|
IO_MEM_ROM
);
memory_region_set_readonly
(
&
s
->
prom
,
true
);
sysbus_init_mmio_region
(
dev
,
&
s
->
prom
);
return
0
;
return
0
;
}
}
static
SysBusDeviceInfo
prom_info
=
{
static
SysBusDeviceInfo
prom_info
=
{
.
init
=
prom_init1
,
.
init
=
prom_init1
,
.
qdev
.
name
=
"openprom"
,
.
qdev
.
name
=
"openprom"
,
.
qdev
.
size
=
sizeof
(
SysBusDevic
e
),
.
qdev
.
size
=
sizeof
(
PROMStat
e
),
.
qdev
.
props
=
(
Property
[])
{
.
qdev
.
props
=
(
Property
[])
{
{
/* end of property list */
}
{
/* end of property list */
}
}
}
...
@@ -719,19 +736,17 @@ device_init(prom_register_devices);
...
@@ -719,19 +736,17 @@ device_init(prom_register_devices);
typedef
struct
RamDevice
typedef
struct
RamDevice
{
{
SysBusDevice
busdev
;
SysBusDevice
busdev
;
MemoryRegion
ram
;
uint64_t
size
;
uint64_t
size
;
}
RamDevice
;
}
RamDevice
;
/* System RAM */
/* System RAM */
static
int
ram_init1
(
SysBusDevice
*
dev
)
static
int
ram_init1
(
SysBusDevice
*
dev
)
{
{
ram_addr_t
RAM_size
,
ram_offset
;
RamDevice
*
d
=
FROM_SYSBUS
(
RamDevice
,
dev
);
RamDevice
*
d
=
FROM_SYSBUS
(
RamDevice
,
dev
);
RAM_size
=
d
->
size
;
memory_region_init_ram
(
&
d
->
ram
,
NULL
,
"sun4m.ram"
,
d
->
size
);
sysbus_init_mmio_region
(
dev
,
&
d
->
ram
);
ram_offset
=
qemu_ram_alloc
(
NULL
,
"sun4m.ram"
,
RAM_size
);
sysbus_init_mmio
(
dev
,
RAM_size
,
ram_offset
);
return
0
;
return
0
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录