aboutsummaryrefslogtreecommitdiffstats
path: root/memdisk/e820func.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-05-21 16:03:15 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-05-21 16:03:15 -0700
commitafef2c845b93ebe52c178a5a42d498be75fb4c8c (patch)
tree8e914b01ea0cc2931a4cb0c8455223405fea642b /memdisk/e820func.c
parent044154a0479cd365597846dd7025755eb852d76f (diff)
downloadsyslinux.git-afef2c845b93ebe52c178a5a42d498be75fb4c8c.tar.gz
syslinux.git-afef2c845b93ebe52c178a5a42d498be75fb4c8c.tar.xz
syslinux.git-afef2c845b93ebe52c178a5a42d498be75fb4c8c.zip
Drop support for ACPI 3 E820 extended memory attributes
Drop all support for ACPI 3 E820 extended memory attributes. There are BIOSes in the field that report completely bogus information here, resulting in no memory at all being detected (we then fall back to E801 detection, but that is problematic in its own ways.) There is strong reasons to believe at this point that the extended memory attributes are not usable in their current form, so drop them and revert back to simple 20-byte support, including for MEMDISK spoofing. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
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++;