Commit d8c97d5f authored by Tony Luck's avatar Tony Luck

[IA64] simplified efi memory map parsing

New version leaves the original memory map unmodified.
Also saves any granule trimmings for use by the uncached
memory allocator.

Inspired by Khalid Aziz (various traces of his patch still
remain).  Fixes to uncached_build_memmap() and sn2 testing
by Martin Hicks.
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent 4706df3d
This diff is collapsed.
...@@ -211,6 +211,9 @@ reserve_memory (void) ...@@ -211,6 +211,9 @@ reserve_memory (void)
} }
#endif #endif
efi_memmap_init(&rsvd_region[n].start, &rsvd_region[n].end);
n++;
/* end of memory marker */ /* end of memory marker */
rsvd_region[n].start = ~0UL; rsvd_region[n].start = ~0UL;
rsvd_region[n].end = ~0UL; rsvd_region[n].end = ~0UL;
......
...@@ -205,23 +205,18 @@ EXPORT_SYMBOL(uncached_free_page); ...@@ -205,23 +205,18 @@ EXPORT_SYMBOL(uncached_free_page);
static int __init static int __init
uncached_build_memmap(unsigned long start, unsigned long end, void *arg) uncached_build_memmap(unsigned long start, unsigned long end, void *arg)
{ {
long length; long length = end - start;
unsigned long vstart, vend;
int node; int node;
length = end - start;
vstart = start + __IA64_UNCACHED_OFFSET;
vend = end + __IA64_UNCACHED_OFFSET;
dprintk(KERN_ERR "uncached_build_memmap(%lx %lx)\n", start, end); dprintk(KERN_ERR "uncached_build_memmap(%lx %lx)\n", start, end);
memset((char *)vstart, 0, length); memset((char *)start, 0, length);
node = paddr_to_nid(start); node = paddr_to_nid(start - __IA64_UNCACHED_OFFSET);
for (; vstart < vend ; vstart += PAGE_SIZE) { for (; start < end ; start += PAGE_SIZE) {
dprintk(KERN_INFO "sticking %lx into the pool!\n", vstart); dprintk(KERN_INFO "sticking %lx into the pool!\n", start);
gen_pool_free(uncached_pool[node], vstart, PAGE_SIZE); gen_pool_free(uncached_pool[node], start, PAGE_SIZE);
} }
return 0; return 0;
......
...@@ -16,10 +16,11 @@ ...@@ -16,10 +16,11 @@
* - initrd (optional) * - initrd (optional)
* - command line string * - command line string
* - kernel code & data * - kernel code & data
* - Kernel memory map built from EFI memory map
* *
* More could be added if necessary * More could be added if necessary
*/ */
#define IA64_MAX_RSVD_REGIONS 5 #define IA64_MAX_RSVD_REGIONS 6
struct rsvd_region { struct rsvd_region {
unsigned long start; /* virtual address of beginning of element */ unsigned long start; /* virtual address of beginning of element */
...@@ -33,6 +34,7 @@ extern void find_memory (void); ...@@ -33,6 +34,7 @@ extern void find_memory (void);
extern void reserve_memory (void); extern void reserve_memory (void);
extern void find_initrd (void); extern void find_initrd (void);
extern int filter_rsvd_memory (unsigned long start, unsigned long end, void *arg); extern int filter_rsvd_memory (unsigned long start, unsigned long end, void *arg);
extern void efi_memmap_init(unsigned long *, unsigned long *);
/* /*
* For rounding an address to the next IA64_GRANULE_SIZE or order * For rounding an address to the next IA64_GRANULE_SIZE or order
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment