Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 145240
b: refs/heads/master
c: bca23db
h: refs/heads/master
v: v3
  • Loading branch information
H. Peter Anvin committed May 22, 2009
1 parent 1df1948 commit bf1bc21
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 88dff4936c0a5fa53080cca68dc963a8a2a674b0
refs/heads/master: bca23dba760d6705c013f89113c46570378fb626
29 changes: 13 additions & 16 deletions trunk/arch/x86/boot/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,28 @@

#define SMAP 0x534d4150 /* ASCII "SMAP" */

struct e820_ext_entry {
struct e820entry std;
u32 ext_flags;
} __attribute__((packed));

static int detect_memory_e820(void)
{
int count = 0;
u32 next = 0;
u32 size, id, edi;
u8 err;
struct e820entry *desc = boot_params.e820_map;
static struct e820_ext_entry buf; /* static so it is zeroed */
static struct e820entry buf; /* static so it is zeroed */

/*
* Set this here so that if the BIOS doesn't change this field
* but still doesn't change %ecx, we're still okay...
* Note: at least one BIOS is known which assumes that the
* buffer pointed to by one e820 call is the same one as
* the previous call, and only changes modified fields. Therefore,
* we use a temporary buffer and copy the results entry by entry.
*
* This routine deliberately does not try to account for
* ACPI 3+ extended attributes. This is because there are
* BIOSes in the field which report zero for the valid bit for
* all ranges, and we don't currently make any use of the
* other attribute bits. Revisit this if we see the extended
* attribute bits deployed in a meaningful way in the future.
*/
buf.ext_flags = 1;

do {
size = sizeof buf;
Expand Down Expand Up @@ -66,13 +69,7 @@ static int detect_memory_e820(void)
break;
}

/* ACPI 3.0 added the extended flags support. If bit 0
in the extended flags is zero, we're supposed to simply
ignore the entry -- a backwards incompatible change! */
if (size > 20 && !(buf.ext_flags & 1))
continue;

*desc++ = buf.std;
*desc++ = buf;
count++;
} while (next && count < ARRAY_SIZE(boot_params.e820_map));

Expand Down

0 comments on commit bf1bc21

Please sign in to comment.