|
25 | 25 | #include <asm/pgtable.h> |
26 | 26 | #include <asm/io.h> |
27 | 27 |
|
| 28 | +unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)] |
| 29 | + __page_aligned_bss; |
| 30 | +EXPORT_SYMBOL(empty_zero_page); |
| 31 | + |
28 | 32 | static void __init zone_sizes_init(void) |
29 | 33 | { |
30 | 34 | unsigned long max_zone_pfns[MAX_NR_ZONES] = { 0, }; |
@@ -143,6 +147,11 @@ void __init setup_bootmem(void) |
143 | 147 | } |
144 | 148 | } |
145 | 149 |
|
| 150 | +unsigned long va_pa_offset; |
| 151 | +EXPORT_SYMBOL(va_pa_offset); |
| 152 | +unsigned long pfn_base; |
| 153 | +EXPORT_SYMBOL(pfn_base); |
| 154 | + |
146 | 155 | pgd_t swapper_pg_dir[PTRS_PER_PGD] __page_aligned_bss; |
147 | 156 | pgd_t trampoline_pg_dir[PTRS_PER_PGD] __initdata __aligned(PAGE_SIZE); |
148 | 157 |
|
@@ -172,6 +181,25 @@ void __set_fixmap(enum fixed_addresses idx, phys_addr_t phys, pgprot_t prot) |
172 | 181 | } |
173 | 182 | } |
174 | 183 |
|
| 184 | +/* |
| 185 | + * setup_vm() is called from head.S with MMU-off. |
| 186 | + * |
| 187 | + * Following requirements should be honoured for setup_vm() to work |
| 188 | + * correctly: |
| 189 | + * 1) It should use PC-relative addressing for accessing kernel symbols. |
| 190 | + * To achieve this we always use GCC cmodel=medany. |
| 191 | + * 2) The compiler instrumentation for FTRACE will not work for setup_vm() |
| 192 | + * so disable compiler instrumentation when FTRACE is enabled. |
| 193 | + * |
| 194 | + * Currently, the above requirements are honoured by using custom CFLAGS |
| 195 | + * for init.o in mm/Makefile. |
| 196 | + */ |
| 197 | + |
| 198 | +#ifndef __riscv_cmodel_medany |
| 199 | +#error "setup_vm() is called from head.S before relocate so it should " |
| 200 | + "not use absolute addressing." |
| 201 | +#endif |
| 202 | + |
175 | 203 | asmlinkage void __init setup_vm(void) |
176 | 204 | { |
177 | 205 | extern char _start; |
|
0 commit comments