Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
7fd7b91f
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看板
提交
7fd7b91f
编写于
4月 26, 2004
作者:
B
bellard
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
amd64 port
git-svn-id:
svn://svn.savannah.nongnu.org/qemu/trunk@764
c046a42c-6fe2-441c-8c8c-71466251a162
上级
d927637d
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
22 addition
and
20 deletion
+22
-20
hw/ppc_prep.c
hw/ppc_prep.c
+22
-20
未找到文件。
hw/ppc_prep.c
浏览文件 @
7fd7b91f
...
...
@@ -55,7 +55,6 @@ do { \
#endif
#define BIOS_FILENAME "ppc_rom.bin"
#define LINUX_BOOT_FILENAME "linux_boot.bin"
#define KERNEL_LOAD_ADDR 0x00000000
#define KERNEL_STACK_ADDR 0x00400000
...
...
@@ -677,13 +676,18 @@ static void VGA_init (void)
extern
CPUPPCState
*
global_env
;
static
uint32_t
get_le32
(
void
*
addr
)
{
return
le32_to_cpu
(
*
((
uint32_t
*
)
addr
));
}
void
PPC_init_hw
(
/*CPUPPCState *env,*/
uint32_t
mem_size
,
uint32_t
kernel_addr
,
uint32_t
kernel_size
,
uint32_t
stack_addr
,
int
boot_device
,
const
unsigned
char
*
initrd_file
)
{
CPUPPCState
*
env
=
global_env
;
char
*
p
;
uint8_t
*
p
;
#if !defined (USE_OPEN_FIRMWARE)
char
*
tmp
;
uint32_t
tmpi
[
2
];
...
...
@@ -697,8 +701,7 @@ void PPC_init_hw (/*CPUPPCState *env,*/ uint32_t mem_size,
/* Fake bootloader */
{
#if 1
uint32_t
offset
=
*
((
uint32_t
*
)(
phys_ram_base
+
kernel_addr
));
uint32_t
offset
=
get_le32
(
phys_ram_base
+
kernel_addr
);
#else
uint32_t
offset
=
12
;
#endif
...
...
@@ -723,7 +726,7 @@ void PPC_init_hw (/*CPUPPCState *env,*/ uint32_t mem_size,
* it's not ready to handle it...
*/
env
->
decr
=
0xFFFFFFFF
;
p
=
(
void
*
)(
phys_ram_base
+
kernel_addr
)
;
p
=
phys_ram_base
+
kernel_addr
;
#if !defined (USE_OPEN_FIRMWARE)
/* Let's register the whole memory available only in supervisor mode */
setup_BAT
(
env
,
0
,
0x00000000
,
0x00000000
,
mem_size
,
1
,
0
,
2
);
...
...
@@ -732,7 +735,7 @@ void PPC_init_hw (/*CPUPPCState *env,*/ uint32_t mem_size,
*/
put_long
(
p
,
0xdeadc0de
);
/* Build a real stack room */
p
=
(
void
*
)(
phys_ram_base
+
stack_addr
)
;
p
=
phys_ram_base
+
stack_addr
;
put_long
(
p
,
stack_addr
);
p
-=
32
;
env
->
gpr
[
1
]
-=
32
;
...
...
@@ -742,7 +745,7 @@ void PPC_init_hw (/*CPUPPCState *env,*/ uint32_t mem_size,
int
size
;
env
->
gpr
[
4
]
=
(
kernel_addr
+
kernel_size
+
4095
)
&
~
4095
;
size
=
load_initrd
(
initrd_file
,
(
void
*
)((
uint32_t
)
phys_ram_base
+
env
->
gpr
[
4
])
);
phys_ram_base
+
env
->
gpr
[
4
]
);
if
(
size
<
0
)
{
/* No initrd */
env
->
gpr
[
4
]
=
env
->
gpr
[
5
]
=
0
;
...
...
@@ -759,17 +762,17 @@ void PPC_init_hw (/*CPUPPCState *env,*/ uint32_t mem_size,
* The BSS starts after the kernel end.
*/
#if 0
p =
(void *)(((uint32_t)
phys_ram_base + kernel_addr +
kernel_size + (1 << 20) - 1) & ~((1 << 20) - 1)
);
p = phys_ram_base + kernel_addr +
kernel_size + (1 << 20) - 1) & ~((1 << 20) - 1
);
#else
p
=
(
void
*
)((
uint32_t
)
phys_ram_base
+
kernel_addr
+
0x400000
)
;
p
=
phys_ram_base
+
kernel_addr
+
0x400000
;
#endif
if
(
loglevel
>
0
)
{
fprintf
(
logfile
,
"bootinfos: %p 0x%08x
\n
"
,
p
,
(
uint32_t
)
p
-
(
uint32_t
)
phys_ram_base
);
p
,
(
int
)(
p
-
phys_ram_base
)
);
}
else
{
printf
(
"bootinfos: %p 0x%08x
\n
"
,
p
,
(
uint32_t
)
p
-
(
uint32_t
)
phys_ram_base
);
p
,
(
int
)(
p
-
phys_ram_base
)
);
}
/* Command line: let's put it after bootinfos */
#if 0
...
...
@@ -782,7 +785,7 @@ void PPC_init_hw (/*CPUPPCState *env,*/ uint32_t mem_size,
boot_devs
[
boot_device
-
'a'
].
name
,
mem_size
>>
20
);
#endif
env
->
gpr
[
6
]
=
(
uint32_t
)
p
+
0x1000
-
(
uint32_t
)
phys_ram_base
;
env
->
gpr
[
6
]
=
p
+
0x1000
-
phys_ram_base
;
env
->
gpr
[
7
]
=
env
->
gpr
[
6
]
+
strlen
(
p
+
0x1000
);
if
(
loglevel
>
0
)
{
fprintf
(
logfile
,
"cmdline: %p 0x%08x [%s]
\n
"
,
...
...
@@ -795,7 +798,7 @@ void PPC_init_hw (/*CPUPPCState *env,*/ uint32_t mem_size,
p
=
set_bootinfo_tag
(
p
,
0x1010
,
0
,
0
);
/* BI_CMD_LINE */
p
=
set_bootinfo_tag
(
p
,
0x1012
,
env
->
gpr
[
7
]
-
env
->
gpr
[
6
],
(
void
*
)(
env
->
gpr
[
6
]
+
(
uint32_t
)
phys_ram_base
)
);
env
->
gpr
[
6
]
+
phys_ram_base
);
/* BI_MEM_SIZE */
tmp
=
(
void
*
)
tmpi
;
tmp
[
0
]
=
(
mem_size
>>
24
)
&
0xFF
;
...
...
@@ -823,8 +826,7 @@ void PPC_init_hw (/*CPUPPCState *env,*/ uint32_t mem_size,
setup_BAT
(
env
,
0
,
0x01000000
,
kernel_addr
,
0x00400000
,
1
,
0
,
2
);
{
#if 0
uint32_t offset =
*((uint32_t *)(phys_ram_base + kernel_addr));
uint32_t offset = get_le32(phys_ram_base + kernel_addr);
#else
uint32_t
offset
=
12
;
#endif
...
...
@@ -832,7 +834,7 @@ void PPC_init_hw (/*CPUPPCState *env,*/ uint32_t mem_size,
printf
(
"Start address: 0x%08x
\n
"
,
env
->
nip
);
}
env
->
gpr
[
1
]
=
env
->
nip
+
(
1
<<
22
);
p
=
(
void
*
)(
phys_ram_base
+
stack_addr
)
;
p
=
phys_ram_base
+
stack_addr
;
put_long
(
p
-
32
,
stack_addr
);
env
->
gpr
[
1
]
-=
32
;
printf
(
"Kernel starts at 0x%08x stack 0x%08x
\n
"
,
env
->
nip
,
env
->
gpr
[
1
]);
...
...
@@ -869,10 +871,10 @@ void PPC_init_hw (/*CPUPPCState *env,*/ uint32_t mem_size,
/* Command line: let's put it just over the stack */
#if 0
#if 0
p =
(void *)(((uint32_t)
phys_ram_base + kernel_addr +
kernel_size + (1 << 20) - 1) & ~((1 << 20) - 1)
);
p = phys_ram_base + kernel_addr +
kernel_size + (1 << 20) - 1) & ~((1 << 20) - 1
);
#else
p =
(void *)((uint32_t)phys_ram_base + kernel_addr + 0x400000)
;
p =
phys_ram_base + kernel_addr + 0x400000
;
#endif
#if 1
sprintf
(
p
,
"console=ttyS0,9600 root=%02x%02x mem=%dM"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录