Skip to content

Commit 69a6c31

Browse files
atsushi-nemotoralfbaechle
authored andcommitted
[MIPS] Move some kernel globals from asm file to C file.
This get rid of some undesirable hole in BSS section due to random order of placement. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
1 parent 907e193 commit 69a6c31

4 files changed

Lines changed: 18 additions & 29 deletions

File tree

‎arch/mips/kernel/asm-offsets.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,6 @@ void output_mm_defines(void)
234234
constant("#define _PMD_SHIFT ", PMD_SHIFT);
235235
constant("#define _PGDIR_SHIFT ", PGDIR_SHIFT);
236236
linefeed;
237-
constant("#define _PGD_ORDER ", PGD_ORDER);
238-
constant("#define _PMD_ORDER ", PMD_ORDER);
239-
constant("#define _PTE_ORDER ", PTE_ORDER);
240-
linefeed;
241237
constant("#define _PTRS_PER_PGD ", PTRS_PER_PGD);
242238
constant("#define _PTRS_PER_PMD ", PTRS_PER_PMD);
243239
constant("#define _PTRS_PER_PTE ", PTRS_PER_PTE);

‎arch/mips/kernel/head.S‎

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -231,28 +231,3 @@ NESTED(smp_bootstrap, 16, sp)
231231
#endif /* CONFIG_SMP */
232232

233233
__FINIT
234-
235-
.comm kernelsp, NR_CPUS * 8, 8
236-
.comm pgd_current, NR_CPUS * 8, 8
237-
238-
.comm fw_arg0, SZREG, SZREG # firmware arguments
239-
.comm fw_arg1, SZREG, SZREG
240-
.comm fw_arg2, SZREG, SZREG
241-
.comm fw_arg3, SZREG, SZREG
242-
243-
.macro page name, order
244-
.comm \name, (_PAGE_SIZE << \order), (_PAGE_SIZE << \order)
245-
.endm
246-
247-
/*
248-
* On 64-bit we've got three-level pagetables with a slightly
249-
* different layout ...
250-
*/
251-
page swapper_pg_dir, _PGD_ORDER
252-
#ifdef CONFIG_64BIT
253-
#if defined(CONFIG_MODULES) && !defined(CONFIG_BUILD_ELF64)
254-
page module_pg_dir, _PGD_ORDER
255-
#endif
256-
page invalid_pmd_table, _PMD_ORDER
257-
#endif
258-
page invalid_pte_table, _PTE_ORDER

‎arch/mips/kernel/setup.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,3 +563,6 @@ int __init dsp_disable(char *s)
563563
}
564564

565565
__setup("nodsp", dsp_disable);
566+
567+
unsigned long kernelsp[NR_CPUS];
568+
unsigned long fw_arg0, fw_arg1, fw_arg2, fw_arg3;

‎arch/mips/mm/init.c‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,3 +499,18 @@ void free_initmem(void)
499499
__pa_symbol(&__init_begin),
500500
__pa_symbol(&__init_end));
501501
}
502+
503+
unsigned long pgd_current[NR_CPUS];
504+
/*
505+
* On 64-bit we've got three-level pagetables with a slightly
506+
* different layout ...
507+
*/
508+
#define __page_aligned(order) __attribute__((__aligned__(PAGE_SIZE<<order)))
509+
pgd_t swapper_pg_dir[PTRS_PER_PGD] __page_aligned(PGD_ORDER);
510+
#ifdef CONFIG_64BIT
511+
#ifdef MODULE_START
512+
pgd_t module_pg_dir[PTRS_PER_PGD] __page_aligned(PGD_ORDER);
513+
#endif
514+
pmd_t invalid_pmd_table[PTRS_PER_PMD] __page_aligned(PMD_ORDER);
515+
#endif
516+
pte_t invalid_pte_table[PTRS_PER_PTE] __page_aligned(PTE_ORDER);

0 commit comments

Comments
 (0)