Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
666713c0
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看板
提交
666713c0
编写于
7月 16, 2009
作者:
B
Blue Swirl
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Sparc32: refactor CPU init
Signed-off-by:
N
Blue Swirl
<
blauwirbel@gmail.com
>
上级
a350db85
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
30 addition
and
45 deletion
+30
-45
hw/sun4m.c
hw/sun4m.c
+30
-45
未找到文件。
hw/sun4m.c
浏览文件 @
666713c0
...
...
@@ -530,14 +530,37 @@ static void ram_register_devices(void)
device_init
(
ram_register_devices
);
static
CPUState
*
cpu_devinit
(
const
char
*
cpu_model
,
unsigned
int
id
,
uint64_t
prom_addr
,
qemu_irq
**
cpu_irqs
)
{
CPUState
*
env
;
env
=
cpu_init
(
cpu_model
);
if
(
!
env
)
{
fprintf
(
stderr
,
"qemu: Unable to find Sparc CPU definition
\n
"
);
exit
(
1
);
}
cpu_sparc_set_id
(
env
,
id
);
if
(
id
==
0
)
{
qemu_register_reset
(
main_cpu_reset
,
env
);
}
else
{
qemu_register_reset
(
secondary_cpu_reset
,
env
);
env
->
halted
=
1
;
}
*
cpu_irqs
=
qemu_allocate_irqs
(
cpu_set_irq
,
env
,
MAX_PILS
);
env
->
prom_addr
=
prom_addr
;
return
env
;
}
static
void
sun4m_hw_init
(
const
struct
sun4m_hwdef
*
hwdef
,
ram_addr_t
RAM_size
,
const
char
*
boot_device
,
const
char
*
kernel_filename
,
const
char
*
kernel_cmdline
,
const
char
*
initrd_filename
,
const
char
*
cpu_model
)
{
CPUState
*
env
,
*
env
s
[
MAX_CPUS
];
CPUState
*
envs
[
MAX_CPUS
];
unsigned
int
i
;
void
*
iommu
,
*
espdma
,
*
ledma
,
*
nvram
;
qemu_irq
*
cpu_irqs
[
MAX_CPUS
],
*
slavio_irq
,
*
slavio_cpu_irq
,
...
...
@@ -555,21 +578,7 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef, ram_addr_t RAM_size,
cpu_model
=
hwdef
->
default_cpu_model
;
for
(
i
=
0
;
i
<
smp_cpus
;
i
++
)
{
env
=
cpu_init
(
cpu_model
);
if
(
!
env
)
{
fprintf
(
stderr
,
"qemu: Unable to find Sparc CPU definition
\n
"
);
exit
(
1
);
}
cpu_sparc_set_id
(
env
,
i
);
envs
[
i
]
=
env
;
if
(
i
==
0
)
{
qemu_register_reset
(
main_cpu_reset
,
env
);
}
else
{
qemu_register_reset
(
secondary_cpu_reset
,
env
);
env
->
halted
=
1
;
}
cpu_irqs
[
i
]
=
qemu_allocate_irqs
(
cpu_set_irq
,
envs
[
i
],
MAX_PILS
);
env
->
prom_addr
=
hwdef
->
slavio_base
;
envs
[
i
]
=
cpu_devinit
(
cpu_model
,
i
,
hwdef
->
slavio_base
,
&
cpu_irqs
[
i
]);
}
for
(
i
=
smp_cpus
;
i
<
MAX_CPUS
;
i
++
)
...
...
@@ -1293,7 +1302,7 @@ static void sun4d_hw_init(const struct sun4d_hwdef *hwdef, ram_addr_t RAM_size,
const
char
*
kernel_cmdline
,
const
char
*
initrd_filename
,
const
char
*
cpu_model
)
{
CPUState
*
env
,
*
env
s
[
MAX_CPUS
];
CPUState
*
envs
[
MAX_CPUS
];
unsigned
int
i
;
void
*
iounits
[
MAX_IOUNITS
],
*
espdma
,
*
ledma
,
*
nvram
,
*
sbi
;
qemu_irq
*
cpu_irqs
[
MAX_CPUS
],
*
sbi_irq
,
*
sbi_cpu_irq
,
...
...
@@ -1306,22 +1315,8 @@ static void sun4d_hw_init(const struct sun4d_hwdef *hwdef, ram_addr_t RAM_size,
if
(
!
cpu_model
)
cpu_model
=
hwdef
->
default_cpu_model
;
for
(
i
=
0
;
i
<
smp_cpus
;
i
++
)
{
env
=
cpu_init
(
cpu_model
);
if
(
!
env
)
{
fprintf
(
stderr
,
"qemu: Unable to find Sparc CPU definition
\n
"
);
exit
(
1
);
}
cpu_sparc_set_id
(
env
,
i
);
envs
[
i
]
=
env
;
if
(
i
==
0
)
{
qemu_register_reset
(
main_cpu_reset
,
env
);
}
else
{
qemu_register_reset
(
secondary_cpu_reset
,
env
);
env
->
halted
=
1
;
}
cpu_irqs
[
i
]
=
qemu_allocate_irqs
(
cpu_set_irq
,
envs
[
i
],
MAX_PILS
);
env
->
prom_addr
=
hwdef
->
slavio_base
;
for
(
i
=
0
;
i
<
smp_cpus
;
i
++
)
{
envs
[
i
]
=
cpu_devinit
(
cpu_model
,
i
,
hwdef
->
slavio_base
,
&
cpu_irqs
[
i
]);
}
for
(
i
=
smp_cpus
;
i
<
MAX_CPUS
;
i
++
)
...
...
@@ -1493,17 +1488,7 @@ static void sun4c_hw_init(const struct sun4c_hwdef *hwdef, ram_addr_t RAM_size,
if
(
!
cpu_model
)
cpu_model
=
hwdef
->
default_cpu_model
;
env
=
cpu_init
(
cpu_model
);
if
(
!
env
)
{
fprintf
(
stderr
,
"qemu: Unable to find Sparc CPU definition
\n
"
);
exit
(
1
);
}
cpu_sparc_set_id
(
env
,
0
);
qemu_register_reset
(
main_cpu_reset
,
env
);
cpu_irqs
=
qemu_allocate_irqs
(
cpu_set_irq
,
env
,
MAX_PILS
);
env
->
prom_addr
=
hwdef
->
slavio_base
;
env
=
cpu_devinit
(
cpu_model
,
0
,
hwdef
->
slavio_base
,
&
cpu_irqs
);
/* set up devices */
ram_init
(
0
,
RAM_size
,
hwdef
->
max_mem
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录