This source file includes following definitions.
- paging_init
- mem_init
1
2
3
4
5
6
7
8 #include <linux/mm.h>
9 #include <linux/swap.h>
10 #include <linux/module.h>
11 #include <linux/memblock.h>
12 #ifdef CONFIG_BLK_DEV_RAM
13 #include <linux/blkdev.h>
14 #endif
15 #include <linux/initrd.h>
16
17 #include <asm/sections.h>
18 #include <linux/uaccess.h>
19
20
21
22
23
24 unsigned long empty_zero_page;
25 EXPORT_SYMBOL(empty_zero_page);
26
27
28
29
30
31
32
33 void __init paging_init(void)
34 {
35 struct pglist_data *pgdat = NODE_DATA(0);
36 unsigned long zones_size[MAX_NR_ZONES] = {0, };
37
38 empty_zero_page = (unsigned long) memblock_alloc(PAGE_SIZE,
39 PAGE_SIZE);
40 if (!empty_zero_page)
41 panic("%s: Failed to allocate %lu bytes align=0x%lx\n",
42 __func__, PAGE_SIZE, PAGE_SIZE);
43
44
45
46
47 set_fs(KERNEL_DS);
48
49
50
51
52 zones_size[ZONE_NORMAL] = (memory_end - PAGE_OFFSET) >> PAGE_SHIFT;
53 pgdat->node_zones[ZONE_NORMAL].zone_start_pfn =
54 __pa(PAGE_OFFSET) >> PAGE_SHIFT;
55
56 free_area_init(zones_size);
57 }
58
59 void __init mem_init(void)
60 {
61 high_memory = (void *)(memory_end & PAGE_MASK);
62
63
64 memblock_free_all();
65
66 mem_init_print_info(NULL);
67 }