Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
35e8ddd5
Commit
35e8ddd5
authored
Jan 06, 2003
by
Tom Rini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PPC32: Fix a problem in the bootloader/wrapper where we might
overwrite part of the initrd.
parent
5d49b2c3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
99 additions
and
16 deletions
+99
-16
arch/ppc/boot/prep/misc.c
arch/ppc/boot/prep/misc.c
+25
-3
arch/ppc/boot/simple/misc-embedded.c
arch/ppc/boot/simple/misc-embedded.c
+24
-3
arch/ppc/boot/simple/misc-spruce.c
arch/ppc/boot/simple/misc-spruce.c
+25
-4
arch/ppc/boot/simple/misc.c
arch/ppc/boot/simple/misc.c
+25
-6
No files found.
arch/ppc/boot/prep/misc.c
View file @
35e8ddd5
...
@@ -316,9 +316,31 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum,
...
@@ -316,9 +316,31 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum,
{
{
struct
bi_record
*
rec
;
struct
bi_record
*
rec
;
unsigned
long
initrd_loc
;
rec
=
(
struct
bi_record
*
)
_ALIGN
((
unsigned
long
)(
zimage_size
)
+
unsigned
long
rec_loc
=
_ALIGN
((
unsigned
long
)(
zimage_size
)
+
(
1
<<
20
)
-
1
,
(
1
<<
20
));
(
1
<<
20
)
-
1
,
(
1
<<
20
));
rec
=
(
struct
bi_record
*
)
rec_loc
;
/* We need to make sure that the initrd and bi_recs do not
* overlap. */
if
(
initrd_size
)
{
initrd_loc
=
(
unsigned
long
)(
&
__ramdisk_begin
);
/* If the bi_recs are in the middle of the current
* initrd, move the initrd to the next MB
* boundary. */
if
((
rec_loc
>
initrd_loc
)
&&
((
initrd_loc
+
initrd_size
)
>
rec_loc
))
{
initrd_loc
=
_ALIGN
((
unsigned
long
)(
zimage_size
)
+
(
2
<<
20
)
-
1
,
(
2
<<
20
));
memmove
((
void
*
)
initrd_loc
,
&
__ramdisk_begin
,
initrd_size
);
puts
(
"initrd moved: "
);
puthex
(
initrd_loc
);
puts
(
" "
);
puthex
(
initrd_loc
+
initrd_size
);
puts
(
"
\n
"
);
}
}
rec
->
tag
=
BI_FIRST
;
rec
->
tag
=
BI_FIRST
;
rec
->
size
=
sizeof
(
struct
bi_record
);
rec
->
size
=
sizeof
(
struct
bi_record
);
...
@@ -348,7 +370,7 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum,
...
@@ -348,7 +370,7 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum,
if
(
initrd_size
)
{
if
(
initrd_size
)
{
rec
->
tag
=
BI_INITRD
;
rec
->
tag
=
BI_INITRD
;
rec
->
data
[
0
]
=
(
unsigned
long
)(
&
__ramdisk_begin
)
;
rec
->
data
[
0
]
=
initrd_loc
;
rec
->
data
[
1
]
=
initrd_size
;
rec
->
data
[
1
]
=
initrd_size
;
rec
->
size
=
sizeof
(
struct
bi_record
)
+
2
*
rec
->
size
=
sizeof
(
struct
bi_record
)
+
2
*
sizeof
(
unsigned
long
);
sizeof
(
unsigned
long
);
...
...
arch/ppc/boot/simple/misc-embedded.c
View file @
35e8ddd5
...
@@ -209,9 +209,30 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum, b
...
@@ -209,9 +209,30 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum, b
puts
(
"done.
\n
"
);
puts
(
"done.
\n
"
);
{
{
struct
bi_record
*
rec
;
struct
bi_record
*
rec
;
unsigned
long
initrd_loc
;
unsigned
long
rec_loc
=
_ALIGN
((
unsigned
long
)(
zimage_size
)
+
(
1
<<
20
)
-
1
,
(
1
<<
20
));
rec
=
(
struct
bi_record
*
)
rec_loc
;
rec
=
(
struct
bi_record
*
)
_ALIGN
((
unsigned
long
)
zimage_size
+
/* We need to make sure that the initrd and bi_recs do not
(
1
<<
20
)
-
1
,(
1
<<
20
));
* overlap. */
if
(
initrd_size
)
{
initrd_loc
=
(
unsigned
long
)(
&
__ramdisk_begin
);
/* If the bi_recs are in the middle of the current
* initrd, move the initrd to the next MB
* boundary. */
if
((
rec_loc
>
initrd_loc
)
&&
((
initrd_loc
+
initrd_size
)
>
rec_loc
))
{
initrd_loc
=
_ALIGN
((
unsigned
long
)(
zimage_size
)
+
(
2
<<
20
)
-
1
,
(
2
<<
20
));
memmove
((
void
*
)
initrd_loc
,
&
__ramdisk_begin
,
initrd_size
);
puts
(
"initrd moved: "
);
puthex
(
initrd_loc
);
puts
(
" "
);
puthex
(
initrd_loc
+
initrd_size
);
puts
(
"
\n
"
);
}
}
rec
->
tag
=
BI_FIRST
;
rec
->
tag
=
BI_FIRST
;
rec
->
size
=
sizeof
(
struct
bi_record
);
rec
->
size
=
sizeof
(
struct
bi_record
);
...
@@ -224,7 +245,7 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum, b
...
@@ -224,7 +245,7 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum, b
if
(
initrd_size
)
{
if
(
initrd_size
)
{
rec
->
tag
=
BI_INITRD
;
rec
->
tag
=
BI_INITRD
;
rec
->
data
[
0
]
=
(
unsigned
long
)(
&
__ramdisk_begin
)
;
rec
->
data
[
0
]
=
initrd_loc
;
rec
->
data
[
1
]
=
initrd_size
;
rec
->
data
[
1
]
=
initrd_size
;
rec
->
size
=
sizeof
(
struct
bi_record
)
+
2
*
rec
->
size
=
sizeof
(
struct
bi_record
)
+
2
*
sizeof
(
unsigned
long
);
sizeof
(
unsigned
long
);
...
...
arch/ppc/boot/simple/misc-spruce.c
View file @
35e8ddd5
...
@@ -396,9 +396,30 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum)
...
@@ -396,9 +396,30 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum)
{
{
struct
bi_record
*
rec
;
struct
bi_record
*
rec
;
unsigned
long
initrd_loc
;
rec
=
(
struct
bi_record
*
)
_ALIGN
((
ulong
)
zimage_size
+
unsigned
long
rec_loc
=
_ALIGN
((
unsigned
long
)(
zimage_size
)
+
(
1
<<
20
)
-
1
,(
1
<<
20
));
(
1
<<
20
)
-
1
,
(
1
<<
20
));
rec
=
(
struct
bi_record
*
)
rec_loc
;
/* We need to make sure that the initrd and bi_recs do not
* overlap. */
if
(
initrd_size
)
{
initrd_loc
=
(
unsigned
long
)(
&
__ramdisk_begin
);
/* If the bi_recs are in the middle of the current
* initrd, move the initrd to the next MB
* boundary. */
if
((
rec_loc
>
initrd_loc
)
&&
((
initrd_loc
+
initrd_size
)
>
rec_loc
))
{
initrd_loc
=
_ALIGN
((
unsigned
long
)(
zimage_size
)
+
(
2
<<
20
)
-
1
,
(
2
<<
20
));
memmove
((
void
*
)
initrd_loc
,
&
__ramdisk_begin
,
initrd_size
);
puts
(
"initrd moved: "
);
puthex
(
initrd_loc
);
puts
(
" "
);
puthex
(
initrd_loc
+
initrd_size
);
puts
(
"
\n
"
);
}
}
rec
->
tag
=
BI_FIRST
;
rec
->
tag
=
BI_FIRST
;
rec
->
size
=
sizeof
(
struct
bi_record
);
rec
->
size
=
sizeof
(
struct
bi_record
);
...
@@ -421,7 +442,7 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum)
...
@@ -421,7 +442,7 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum)
if
(
initrd_size
)
{
if
(
initrd_size
)
{
rec
->
tag
=
BI_INITRD
;
rec
->
tag
=
BI_INITRD
;
rec
->
data
[
0
]
=
(
unsigned
long
)(
&
__ramdisk_begin
)
;
rec
->
data
[
0
]
=
initrd_loc
;
rec
->
data
[
1
]
=
initrd_size
;
rec
->
data
[
1
]
=
initrd_size
;
rec
->
size
=
sizeof
(
struct
bi_record
)
+
2
*
rec
->
size
=
sizeof
(
struct
bi_record
)
+
2
*
sizeof
(
unsigned
long
);
sizeof
(
unsigned
long
);
...
...
arch/ppc/boot/simple/misc.c
View file @
35e8ddd5
...
@@ -76,8 +76,8 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum)
...
@@ -76,8 +76,8 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum)
{
{
int
timer
=
0
;
int
timer
=
0
;
char
*
cp
,
ch
;
char
*
cp
,
ch
;
struct
bi_record
*
rec
,
*
birecs
;
struct
bi_record
*
rec
;
unsigned
long
TotalMemory
=
0
;
unsigned
long
TotalMemory
=
0
,
rec_loc
,
initrd_loc
;
serial_fixups
();
serial_fixups
();
com_port
=
serial_init
(
0
,
NULL
);
com_port
=
serial_init
(
0
,
NULL
);
...
@@ -197,10 +197,29 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum)
...
@@ -197,10 +197,29 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum)
/*
/*
* Create bi_recs for cmd_line and initrds
* Create bi_recs for cmd_line and initrds
*/
*/
rec
=
(
struct
bi_record
*
)
_ALIGN
((
unsigned
long
)(
zimage_size
)
+
rec
_loc
=
_ALIGN
((
unsigned
long
)(
zimage_size
)
+
(
1
<<
20
)
-
1
,
(
1
<<
20
));
(
1
<<
20
)
-
1
,
(
1
<<
20
));
birecs
=
re
c
;
rec
=
(
struct
bi_record
*
)
rec_lo
c
;
/* We need to make sure that the initrd and bi_recs do not
* overlap. */
if
(
initrd_size
)
{
initrd_loc
=
(
unsigned
long
)(
&
__ramdisk_begin
);
/* If the bi_recs are in the middle of the current
* initrd, move the initrd to the next MB
* boundary. */
if
((
rec_loc
>
initrd_loc
)
&&
((
initrd_loc
+
initrd_size
)
>
rec_loc
))
{
initrd_loc
=
_ALIGN
((
unsigned
long
)(
zimage_size
)
+
(
2
<<
20
)
-
1
,
(
2
<<
20
));
memmove
((
void
*
)
initrd_loc
,
&
__ramdisk_begin
,
initrd_size
);
puts
(
"initrd moved: "
);
puthex
(
initrd_loc
);
puts
(
" "
);
puthex
(
initrd_loc
+
initrd_size
);
puts
(
"
\n
"
);
}
}
rec
->
tag
=
BI_FIRST
;
rec
->
tag
=
BI_FIRST
;
rec
->
size
=
sizeof
(
struct
bi_record
);
rec
->
size
=
sizeof
(
struct
bi_record
);
rec
=
(
struct
bi_record
*
)((
unsigned
long
)
rec
+
rec
->
size
);
rec
=
(
struct
bi_record
*
)((
unsigned
long
)
rec
+
rec
->
size
);
...
@@ -219,7 +238,7 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum)
...
@@ -219,7 +238,7 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum)
if
(
initrd_size
)
{
if
(
initrd_size
)
{
rec
->
tag
=
BI_INITRD
;
rec
->
tag
=
BI_INITRD
;
rec
->
data
[
0
]
=
(
unsigned
long
)(
&
__ramdisk_begin
)
;
rec
->
data
[
0
]
=
initrd_loc
;
rec
->
data
[
1
]
=
initrd_size
;
rec
->
data
[
1
]
=
initrd_size
;
rec
->
size
=
sizeof
(
struct
bi_record
)
+
2
*
rec
->
size
=
sizeof
(
struct
bi_record
)
+
2
*
sizeof
(
unsigned
long
);
sizeof
(
unsigned
long
);
...
@@ -233,5 +252,5 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum)
...
@@ -233,5 +252,5 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum)
puts
(
"Now booting the kernel
\n
"
);
puts
(
"Now booting the kernel
\n
"
);
serial_close
(
com_port
);
serial_close
(
com_port
);
return
birecs
;
return
(
struct
bi_record
*
)
rec_loc
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment