This source file includes following definitions.
- memory_present
- initmem_init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 #include <linux/memblock.h>
26 #include <linux/init.h>
27
28 #include "numa_internal.h"
29
30 #ifdef CONFIG_DISCONTIGMEM
31
32
33
34
35
36
37
38
39
40
41
42
43 s8 physnode_map[MAX_SECTIONS] __read_mostly = { [0 ... (MAX_SECTIONS - 1)] = -1};
44 EXPORT_SYMBOL(physnode_map);
45
46 void memory_present(int nid, unsigned long start, unsigned long end)
47 {
48 unsigned long pfn;
49
50 printk(KERN_INFO "Node: %d, start_pfn: %lx, end_pfn: %lx\n",
51 nid, start, end);
52 printk(KERN_DEBUG " Setting physnode_map array to node %d for pfns:\n", nid);
53 printk(KERN_DEBUG " ");
54 start = round_down(start, PAGES_PER_SECTION);
55 end = round_up(end, PAGES_PER_SECTION);
56 for (pfn = start; pfn < end; pfn += PAGES_PER_SECTION) {
57 physnode_map[pfn / PAGES_PER_SECTION] = nid;
58 printk(KERN_CONT "%lx ", pfn);
59 }
60 printk(KERN_CONT "\n");
61 }
62 #endif
63
64 extern unsigned long highend_pfn, highstart_pfn;
65
66 void __init initmem_init(void)
67 {
68 x86_numa_init();
69
70 #ifdef CONFIG_HIGHMEM
71 highstart_pfn = highend_pfn = max_pfn;
72 if (max_pfn > max_low_pfn)
73 highstart_pfn = max_low_pfn;
74 printk(KERN_NOTICE "%ldMB HIGHMEM available.\n",
75 pages_to_mb(highend_pfn - highstart_pfn));
76 high_memory = (void *) __va(highstart_pfn * PAGE_SIZE - 1) + 1;
77 #else
78 high_memory = (void *) __va(max_low_pfn * PAGE_SIZE - 1) + 1;
79 #endif
80 printk(KERN_NOTICE "%ldMB LOWMEM available.\n",
81 pages_to_mb(max_low_pfn));
82 printk(KERN_DEBUG "max_low_pfn = %lx, highstart_pfn = %lx\n",
83 max_low_pfn, highstart_pfn);
84
85 printk(KERN_DEBUG "Low memory ends at vaddr %08lx\n",
86 (ulong) pfn_to_kaddr(max_low_pfn));
87
88 printk(KERN_DEBUG "High memory starts at vaddr %08lx\n",
89 (ulong) pfn_to_kaddr(highstart_pfn));
90
91 __vmalloc_start_set = true;
92 setup_bootmem_allocator();
93 }