aboutsummaryrefslogtreecommitdiffstats
path: root/memdisk/e820func.c
diff options
context:
space:
mode:
Diffstat (limited to 'memdisk/e820func.c')
-rw-r--r--memdisk/e820func.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/memdisk/e820func.c b/memdisk/e820func.c
index ccfc38ea..80471a9b 100644
--- a/memdisk/e820func.c
+++ b/memdisk/e820func.c
@@ -37,8 +37,7 @@ void e820map_init(void)
ranges[1].type = -1U;
}
-static void insertrange_at(int where, uint64_t start,
- uint32_t type, uint32_t extattr)
+static void insertrange_at(int where, uint64_t start, uint32_t type)
{
int i;
@@ -47,18 +46,16 @@ static void insertrange_at(int where, uint64_t start,
ranges[where].start = start;
ranges[where].type = type;
- ranges[where].extattr = extattr;
nranges++;
ranges[nranges].start = 0ULL;
ranges[nranges].type = -1U;
- ranges[nranges].extattr = 0;
}
-void insertrange(uint64_t start, uint64_t len, uint32_t type, uint32_t extattr)
+void insertrange(uint64_t start, uint64_t len, uint32_t type)
{
uint64_t last;
- uint32_t oldtype, oldattr;
+ uint32_t oldtype;
int i, j;
/* Remove this to make len == 0 mean all of memory */
@@ -69,40 +66,34 @@ void insertrange(uint64_t start, uint64_t len, uint32_t type, uint32_t extattr)
i = 0;
oldtype = -2U;
- oldattr = 0;
while ( start > ranges[i].start && ranges[i].type != -1U ) {
oldtype = ranges[i].type;
- oldattr = ranges[i].extattr;
i++;
}
/* Consider the replacement policy. This current one is "overwrite." */
if ( start < ranges[i].start || ranges[i].type == -1U )
- insertrange_at(i++, start, type, extattr);
+ insertrange_at(i++, start, type);
while ( i == 0 || last > ranges[i].start-1 ) {
oldtype = ranges[i].type;
- oldattr = ranges[i].extattr;
ranges[i].type = type;
- ranges[i].extattr = extattr;
i++;
}
if ( last < ranges[i].start-1 )
- insertrange_at(i, last+1, oldtype, oldattr);
+ insertrange_at(i, last+1, oldtype);
/* Now the map is correct, but quite possibly not optimal. Scan the
map for ranges which are redundant and remove them. */
i = j = 1;
oldtype = ranges[0].type;
- oldattr = ranges[0].extattr;
while ( i < nranges ) {
- if ( ranges[i].type == oldtype && ranges[i].extattr == oldattr ) {
+ if ( ranges[i].type == oldtype ) {
i++;
} else {
oldtype = ranges[i].type;
- oldattr = ranges[i].extattr;
if ( i != j )
ranges[j] = ranges[i];
i++; j++;