]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86_64/kernel/e820.c
[PATCH] x86_64: Disallow kprobes on NMI handlers
[linux-2.6-omap-h63xx.git] / arch / x86_64 / kernel / e820.c
index bb0ae18ec02b90efd04cbf7cce43f0490095fa88..293cd71a266aa221800c6e3246ee768cce5a71cd 100644 (file)
 #include <linux/ioport.h>
 #include <linux/string.h>
 #include <linux/kexec.h>
+#include <linux/module.h>
+
 #include <asm/page.h>
 #include <asm/e820.h>
 #include <asm/proto.h>
 #include <asm/bootsetup.h>
-
-extern char _end[];
+#include <asm/sections.h>
 
 /* 
  * PFN of last memory page.
  */
 unsigned long end_pfn; 
+EXPORT_SYMBOL(end_pfn);
 
 /* 
  * end_pfn only includes RAM, while end_pfn_map includes all e820 entries.
@@ -131,7 +133,7 @@ void __init e820_bootmem_free(pg_data_t *pgdat, unsigned long start,unsigned lon
 
                if (ei->type != E820_RAM || 
                    ei->addr+ei->size <= start || 
-                   ei->addr > end)
+                   ei->addr >= end)
                        continue;
 
                addr = round_up(ei->addr, PAGE_SIZE);
@@ -557,6 +559,27 @@ void __init parse_memopt(char *p, char **from)
        end_user_pfn >>= PAGE_SHIFT;    
 } 
 
+void __init parse_memmapopt(char *p, char **from)
+{
+       unsigned long long start_at, mem_size;
+
+       mem_size = memparse(p, from);
+       p = *from;
+       if (*p == '@') {
+               start_at = memparse(p+1, from);
+               add_memory_region(start_at, mem_size, E820_RAM);
+       } else if (*p == '#') {
+               start_at = memparse(p+1, from);
+               add_memory_region(start_at, mem_size, E820_ACPI);
+       } else if (*p == '$') {
+               start_at = memparse(p+1, from);
+               add_memory_region(start_at, mem_size, E820_RESERVED);
+       } else {
+               end_user_pfn = (mem_size >> PAGE_SHIFT);
+       }
+       p = *from;
+}
+
 unsigned long pci_mem_start = 0xaeedbabe;
 
 /*