Commit 5833f142 authored by Tony Luck's avatar Tony Luck

Pull new-efi-memmap into release branch

parents a1e78db3 d719948e
This diff is collapsed.
...@@ -78,6 +78,19 @@ struct screen_info screen_info; ...@@ -78,6 +78,19 @@ struct screen_info screen_info;
unsigned long vga_console_iobase; unsigned long vga_console_iobase;
unsigned long vga_console_membase; unsigned long vga_console_membase;
static struct resource data_resource = {
.name = "Kernel data",
.flags = IORESOURCE_BUSY | IORESOURCE_MEM
};
static struct resource code_resource = {
.name = "Kernel code",
.flags = IORESOURCE_BUSY | IORESOURCE_MEM
};
extern void efi_initialize_iomem_resources(struct resource *,
struct resource *);
extern char _text[], _end[], _etext[];
unsigned long ia64_max_cacheline_size; unsigned long ia64_max_cacheline_size;
unsigned long ia64_iobase; /* virtual address for I/O accesses */ unsigned long ia64_iobase; /* virtual address for I/O accesses */
EXPORT_SYMBOL(ia64_iobase); EXPORT_SYMBOL(ia64_iobase);
...@@ -171,6 +184,22 @@ sort_regions (struct rsvd_region *rsvd_region, int max) ...@@ -171,6 +184,22 @@ sort_regions (struct rsvd_region *rsvd_region, int max)
} }
} }
/*
* Request address space for all standard resources
*/
static int __init register_memory(void)
{
code_resource.start = ia64_tpa(_text);
code_resource.end = ia64_tpa(_etext) - 1;
data_resource.start = ia64_tpa(_etext);
data_resource.end = ia64_tpa(_end) - 1;
efi_initialize_iomem_resources(&code_resource, &data_resource);
return 0;
}
__initcall(register_memory);
/** /**
* reserve_memory - setup reserved memory areas * reserve_memory - setup reserved memory areas
* *
...@@ -211,6 +240,9 @@ reserve_memory (void) ...@@ -211,6 +240,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