Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 26561
b: refs/heads/master
c: ac71d12
h: refs/heads/master
i:
  26559: 6db1b83
v: v3
  • Loading branch information
Andi Kleen authored and Linus Torvalds committed May 8, 2006
1 parent 32d9166 commit 882d12b
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 9 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: 8b1ffe9550e71224c43d8c754245bd76f4ea9bb8
refs/heads/master: ac71d12c990526b01ef6cfe50907ef8530a30331
6 changes: 6 additions & 0 deletions trunk/arch/x86_64/kernel/e820.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ static inline int bad_addr(unsigned long *addrp, unsigned long size)
*addrp = __pa_symbol(&_end);
return 1;
}

if (last >= ebda_addr && addr < ebda_addr + ebda_size) {
*addrp = ebda_addr + ebda_size;
return 1;
}

/* XXX ramdisk image here? */
return 0;
}
Expand Down
30 changes: 22 additions & 8 deletions trunk/arch/x86_64/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -571,17 +571,28 @@ static inline void copy_edd(void)
#endif

#define EBDA_ADDR_POINTER 0x40E
static void __init reserve_ebda_region(void)

unsigned __initdata ebda_addr;
unsigned __initdata ebda_size;

static void discover_ebda(void)
{
unsigned int addr;
/**
/*
* there is a real-mode segmented pointer pointing to the
* 4K EBDA area at 0x40E
*/
addr = *(unsigned short *)phys_to_virt(EBDA_ADDR_POINTER);
addr <<= 4;
if (addr)
reserve_bootmem_generic(addr, PAGE_SIZE);
ebda_addr = *(unsigned short *)EBDA_ADDR_POINTER;
ebda_addr <<= 4;

ebda_size = *(unsigned short *)(unsigned long)ebda_addr;

/* Round EBDA up to pages */
if (ebda_size == 0)
ebda_size = 1;
ebda_size <<= 10;
ebda_size = round_up(ebda_size + (ebda_addr & ~PAGE_MASK), PAGE_SIZE);
if (ebda_size > 64*1024)
ebda_size = 64*1024;
}

void __init setup_arch(char **cmdline_p)
Expand Down Expand Up @@ -627,6 +638,8 @@ void __init setup_arch(char **cmdline_p)

check_efer();

discover_ebda();

init_memory_mapping(0, (end_pfn_map << PAGE_SHIFT));

dmi_scan_machine();
Expand Down Expand Up @@ -669,7 +682,8 @@ void __init setup_arch(char **cmdline_p)
reserve_bootmem_generic(0, PAGE_SIZE);

/* reserve ebda region */
reserve_ebda_region();
if (ebda_addr)
reserve_bootmem_generic(ebda_addr, ebda_size);

#ifdef CONFIG_SMP
/*
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/asm-x86_64/e820.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ extern void __init parse_memopt(char *p, char **end);
extern void __init parse_memmapopt(char *p, char **end);

extern struct e820map e820;

extern unsigned ebda_addr, ebda_size;
#endif/*!__ASSEMBLY__*/

#endif/*__E820_HEADER*/

0 comments on commit 882d12b

Please sign in to comment.