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
da3922ef
Commit
da3922ef
authored
Feb 26, 2003
by
Dave Jones
Committed by
Linus Torvalds
Feb 26, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] Handle empty E820 regions correctly.
parent
bde1c93c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
8 deletions
+15
-8
arch/i386/kernel/setup.c
arch/i386/kernel/setup.c
+15
-8
No files found.
arch/i386/kernel/setup.c
View file @
da3922ef
...
...
@@ -14,6 +14,9 @@
* Moved CPU detection code to cpu/${cpu}.c
* Patrick Mochel <mochel@osdl.org>, March 2002
*
* Provisions for empty E820 memory regions (reported by certain BIOSes).
* Alex Achenbach <xela@slit.de>, December 2002.
*
*/
/*
...
...
@@ -279,7 +282,7 @@ static int __init sanitize_e820_map(struct e820entry * biosmap, char * pnr_map)
int
chgidx
,
still_changing
;
int
overlap_entries
;
int
new_bios_entry
;
int
old_nr
,
new_nr
;
int
old_nr
,
new_nr
,
chg_nr
;
int
i
;
/*
...
...
@@ -333,20 +336,24 @@ static int __init sanitize_e820_map(struct e820entry * biosmap, char * pnr_map)
for
(
i
=
0
;
i
<
2
*
old_nr
;
i
++
)
change_point
[
i
]
=
&
change_point_list
[
i
];
/* record all known change-points (starting and ending addresses) */
/* record all known change-points (starting and ending addresses),
omitting those that are for empty memory regions */
chgidx
=
0
;
for
(
i
=
0
;
i
<
old_nr
;
i
++
)
{
change_point
[
chgidx
]
->
addr
=
biosmap
[
i
].
addr
;
change_point
[
chgidx
++
]
->
pbios
=
&
biosmap
[
i
];
change_point
[
chgidx
]
->
addr
=
biosmap
[
i
].
addr
+
biosmap
[
i
].
size
;
change_point
[
chgidx
++
]
->
pbios
=
&
biosmap
[
i
];
if
(
biosmap
[
i
].
size
!=
0
)
{
change_point
[
chgidx
]
->
addr
=
biosmap
[
i
].
addr
;
change_point
[
chgidx
++
]
->
pbios
=
&
biosmap
[
i
];
change_point
[
chgidx
]
->
addr
=
biosmap
[
i
].
addr
+
biosmap
[
i
].
size
;
change_point
[
chgidx
++
]
->
pbios
=
&
biosmap
[
i
];
}
}
chg_nr
=
chgidx
;
/* true number of change-points */
/* sort change-point list by memory addresses (low -> high) */
still_changing
=
1
;
while
(
still_changing
)
{
still_changing
=
0
;
for
(
i
=
1
;
i
<
2
*
old
_nr
;
i
++
)
{
for
(
i
=
1
;
i
<
chg
_nr
;
i
++
)
{
/* if <current_addr> > <last_addr>, swap */
/* or, if current=<start_addr> & last=<end_addr>, swap */
if
((
change_point
[
i
]
->
addr
<
change_point
[
i
-
1
]
->
addr
)
||
...
...
@@ -369,7 +376,7 @@ static int __init sanitize_e820_map(struct e820entry * biosmap, char * pnr_map)
last_type
=
0
;
/* start with undefined memory type */
last_addr
=
0
;
/* start with 0 as last starting address */
/* loop through change-points, determining affect on the new bios map */
for
(
chgidx
=
0
;
chgidx
<
2
*
old
_nr
;
chgidx
++
)
for
(
chgidx
=
0
;
chgidx
<
chg
_nr
;
chgidx
++
)
{
/* keep track of all overlapping bios entries */
if
(
change_point
[
chgidx
]
->
addr
==
change_point
[
chgidx
]
->
pbios
->
addr
)
...
...
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