10 #include <linux/signal.h>
11 #include <linux/sched.h>
12 #include <linux/kernel.h>
13 #include <linux/errno.h>
14 #include <linux/string.h>
15 #include <linux/types.h>
16 #include <linux/ptrace.h>
17 #include <linux/mman.h>
25 #include <linux/poison.h>
27 #include <linux/export.h>
29 #include <asm/processor.h>
30 #include <asm/uaccess.h>
31 #include <asm/pgtable.h>
32 #include <asm/pgalloc.h>
36 #include <asm/tlbflush.h>
37 #include <asm/sections.h>
73 panic(
"Out of memory in setup_zero_pages");
77 for (i = 1 << order; i > 0; i--) {
78 SetPageReserved(page);
93 unsigned long max_zone_pfns[MAX_NR_ZONES];
94 unsigned long pgd_type, asce_bits;
100 pgd_type = _REGION2_ENTRY_EMPTY;
103 pgd_type = _REGION3_ENTRY_EMPTY;
110 clear_table((
unsigned long *)
init_mm.pgd, pgd_type,
111 sizeof(
unsigned long)*2048);
122 sparse_memory_present_with_active_regions(
MAX_NUMNODES);
124 memset(max_zone_pfns, 0,
sizeof(max_zone_pfns));
127 free_area_init_nodes(max_zone_pfns);
133 unsigned long codesize, reservedpages, datasize, initsize;
150 printk(
"Memory: %luk/%luk available (%ldk kernel code, %ldk reserved, %ldk data, %ldk init)\n",
157 printk(
"Write protected kernel read-only data: %#lx - %#lx\n",
162 #ifdef CONFIG_DEBUG_PAGEALLOC
172 for (i = 0; i < numpages; i++) {
179 __ptep_ipte(address, pte);
192 unsigned long addr = begin;
204 printk(
KERN_INFO "Freeing %s: %luk freed\n", what, (end - begin) >> 10);
214 #ifdef CONFIG_BLK_DEV_INITRD
221 #ifdef CONFIG_MEMORY_HOTPLUG
224 unsigned long zone_start_pfn, zone_end_pfn, nr_pages;
225 unsigned long start_pfn =
PFN_DOWN(start);
226 unsigned long size_pages =
PFN_DOWN(size);
241 zone_start_pfn = start_pfn;
242 zone_end_pfn = start_pfn + size_pages;
244 if (start_pfn < zone_start_pfn || start_pfn >= zone_end_pfn)
246 nr_pages = (start_pfn + size_pages > zone_end_pfn) ?
247 zone_end_pfn - start_pfn : size_pages;
248 rc = __add_pages(nid, zone, start_pfn, nr_pages);
251 start_pfn += nr_pages;
252 size_pages -= nr_pages;