This source file includes following definitions.
- m68k_setup_node
- paging_init
- free_initmem
- init_pointer_tables
- mem_init
1
2
3
4
5
6
7
8
9
10
11 #include <linux/module.h>
12 #include <linux/signal.h>
13 #include <linux/sched.h>
14 #include <linux/mm.h>
15 #include <linux/swap.h>
16 #include <linux/kernel.h>
17 #include <linux/string.h>
18 #include <linux/types.h>
19 #include <linux/init.h>
20 #include <linux/memblock.h>
21 #include <linux/gfp.h>
22
23 #include <asm/setup.h>
24 #include <linux/uaccess.h>
25 #include <asm/page.h>
26 #include <asm/pgalloc.h>
27 #include <asm/traps.h>
28 #include <asm/machdep.h>
29 #include <asm/io.h>
30 #ifdef CONFIG_ATARI
31 #include <asm/atari_stram.h>
32 #endif
33 #include <asm/sections.h>
34 #include <asm/tlb.h>
35
36
37
38
39
40 void *empty_zero_page;
41 EXPORT_SYMBOL(empty_zero_page);
42
43 #if !defined(CONFIG_SUN3) && !defined(CONFIG_COLDFIRE)
44 extern void init_pointer_table(unsigned long ptable);
45 extern pmd_t *zero_pgtable;
46 #endif
47
48 #ifdef CONFIG_MMU
49
50 pg_data_t pg_data_map[MAX_NUMNODES];
51 EXPORT_SYMBOL(pg_data_map);
52
53 int m68k_virt_to_node_shift;
54
55 #ifndef CONFIG_SINGLE_MEMORY_CHUNK
56 pg_data_t *pg_data_table[65];
57 EXPORT_SYMBOL(pg_data_table);
58 #endif
59
60 void __init m68k_setup_node(int node)
61 {
62 #ifndef CONFIG_SINGLE_MEMORY_CHUNK
63 struct m68k_mem_info *info = m68k_memory + node;
64 int i, end;
65
66 i = (unsigned long)phys_to_virt(info->addr) >> __virt_to_node_shift();
67 end = (unsigned long)phys_to_virt(info->addr + info->size - 1) >> __virt_to_node_shift();
68 for (; i <= end; i++) {
69 if (pg_data_table[i])
70 pr_warn("overlap at %u for chunk %u\n", i, node);
71 pg_data_table[i] = pg_data_map + node;
72 }
73 #endif
74 node_set_online(node);
75 }
76
77 #else
78
79
80
81
82
83
84
85 void __init paging_init(void)
86 {
87
88
89
90
91 unsigned long end_mem = memory_end & PAGE_MASK;
92 unsigned long zones_size[MAX_NR_ZONES] = { 0, };
93
94 high_memory = (void *) end_mem;
95
96 empty_zero_page = memblock_alloc(PAGE_SIZE, PAGE_SIZE);
97 if (!empty_zero_page)
98 panic("%s: Failed to allocate %lu bytes align=0x%lx\n",
99 __func__, PAGE_SIZE, PAGE_SIZE);
100
101
102
103
104 set_fs (USER_DS);
105
106 zones_size[ZONE_DMA] = (end_mem - PAGE_OFFSET) >> PAGE_SHIFT;
107 free_area_init(zones_size);
108 }
109
110 #endif
111
112 void free_initmem(void)
113 {
114 #ifndef CONFIG_MMU_SUN3
115 free_initmem_default(-1);
116 #endif
117 }
118
119 #if defined(CONFIG_MMU) && !defined(CONFIG_COLDFIRE)
120 #define VECTORS &vectors[0]
121 #else
122 #define VECTORS _ramvec
123 #endif
124
125 static inline void init_pointer_tables(void)
126 {
127 #if defined(CONFIG_MMU) && !defined(CONFIG_SUN3) && !defined(CONFIG_COLDFIRE)
128 int i;
129
130
131 init_pointer_table((unsigned long)kernel_pg_dir);
132 for (i = 0; i < PTRS_PER_PGD; i++) {
133 if (pgd_present(kernel_pg_dir[i]))
134 init_pointer_table(__pgd_page(kernel_pg_dir[i]));
135 }
136
137
138 if (zero_pgtable)
139 init_pointer_table((unsigned long)zero_pgtable);
140 #endif
141 }
142
143 void __init mem_init(void)
144 {
145
146 memblock_free_all();
147 init_pointer_tables();
148 mem_init_print_info(NULL);
149 }