vmlinux.lds cleanup
Subsystems (7)
cover vmlinux.lds cleanup
This series of patches is made in purpose to use PAGE_SIZE and THREAD_SIZE macroses in vmlinux linker scripts as much as possible instead of numeric constants. Please review.
WARNING: the patches are UNTESTED COMPLETELY - I've no access to that architectures and errors is highly possible ;)
If you have an ability to test this patches - please do it. What is most important on review - these macroses *must* be placed into appropriate places - check it please.
ANY comments are welcome.
- Cyrill -
RFC 1/10 arm: vmlinux.lds.S cleanup - use PERCPU, PAGE_SIZE macroses
This patch modifies PAGE_SIZE definition to be able to include it into vmlinux.lds.S script and use it then
Also PERCPU macros is used instead of explicit section declaration
---
WARNING: COMPLETELY UNTESTED !!!
arch/arm/kernel/vmlinux.lds.S | 21 ++++++++++----------- include/asm-arm/page.h | 4 +++- 2 files changed, 13 insertions(+), 12 deletions(-)
arch/arm/kernel/vmlinux.lds.S +10 -11
@@ -5,8 +5,9 @@ #include <asm-generic/vmlinux.lds.h> #include <asm/thread_info.h> +#include <asm/page.h> #include <asm/memory.h> - + OUTPUT_ARCH(arm) ENTRY(stext)
@@ -63,15 +64,13 @@ SECTIONS usr/built-in.o(.init.ramfs) __initramfs_end = .; #endif - . = ALIGN(4096); - __per_cpu_start = .; - *(.data.percpu) - *(.data.percpu.shared_aligned) - __per_cpu_end = .; + + PERCPU(PAGE_SIZE) + #ifndef CONFIG_XIP_KERNEL __init_begin = _stext; INIT_DATA - . = ALIGN(4096); + . = ALIGN(PAGE_SIZE); __init_end = .; #endif }
@@ -128,17 +127,17 @@ SECTIONS *(.data.init_task) #ifdef CONFIG_XIP_KERNEL - . = ALIGN(4096); + . = ALIGN(PAGE_SIZE); __init_begin = .; INIT_DATA - . = ALIGN(4096); + . = ALIGN(PAGE_SIZE); __init_end = .; #endif - . = ALIGN(4096); + . = ALIGN(PAGE_SIZE); __nosave_begin = .; *(.data.nosave) - . = ALIGN(4096); + . = ALIGN(PAGE_SIZE); __nosave_end = .; /*
include/asm-arm/page.h +3 -1
@@ -10,9 +10,11 @@#ifndef _ASMARM_PAGE_H#define _ASMARM_PAGE_H +#include <linux/const.h> +/* PAGE_SHIFT determines the page size */ #define PAGE_SHIFT 12 -#define PAGE_SIZE (1UL << PAGE_SHIFT) +#define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT)#define PAGE_MASK (~(PAGE_SIZE-1))/* to align the pointer to the (next) page boundary */
RFC 2/10 m32r: vmlinux.lds.S cleanup - use PAGE_SIZE, THREAD_SIZE macroses
In reply to [email protected]This patch modifies PAGE_SIZE definition to be able to include it in vmlinux.lds.S script and use it then
Also THREAD_SIZE macro is used to replace numeric constant
---
WARNING: COMPLETELY UNTESTED !!!
arch/m32r/kernel/vmlinux.lds.S | 19 ++++++++++--------- include/asm-m32r/page.h | 4 +++- 2 files changed, 13 insertions(+), 10 deletions(-)
arch/m32r/kernel/vmlinux.lds.S +10 -9
@@ -4,6 +4,7 @@ #include <asm-generic/vmlinux.lds.h> #include <asm/addrspace.h> #include <asm/page.h> +#include <asm/thread_info.h> OUTPUT_ARCH(m32r) #if defined(__LITTLE_ENDIAN__)
@@ -20,7 +21,7 @@ SECTIONS . = CONFIG_MEMORY_START + __PAGE_OFFSET; eit_vector = .; - . = . + 0x1000; + . = . + PAGE_SIZE; .empty_zero_page : { *(.empty_zero_page) } = 0 /* read-only */
@@ -54,13 +55,13 @@ SECTIONS CONSTRUCTORS } - . = ALIGN(4096); + . = ALIGN(PAGE_SIZE); __nosave_begin = .; .data_nosave : { *(.data.nosave) } - . = ALIGN(4096); + . = ALIGN(PAGE_SIZE); __nosave_end = .; - . = ALIGN(4096); + . = ALIGN(PAGE_SIZE); .data.page_aligned : { *(.data.idt) } . = ALIGN(32);
@@ -68,11 +69,11 @@ SECTIONS _edata = .; /* End of data section */ - . = ALIGN(8192); /* init_task */ + . = ALIGN(THREAD_SIZE); /* init_task */ .data.init_task : { *(.data.init_task) } /* will be freed after init */ - . = ALIGN(4096); /* Init code and data */ + . = ALIGN(PAGE_SIZE); /* Init code and data */ __init_begin = .; .init.text : { _sinittext = .;
@@ -104,14 +105,14 @@ SECTIONS .exit.data : { EXIT_DATA } #ifdef CONFIG_BLK_DEV_INITRD - . = ALIGN(4096); + . = ALIGN(PAGE_SIZE); __initramfs_start = .; .init.ramfs : { *(.init.ramfs) } __initramfs_end = .; #endif - PERCPU(4096) - . = ALIGN(4096); + PERCPU(PAGE_SIZE) + . = ALIGN(PAGE_SIZE); __init_end = .; /* freed after init ends here */
include/asm-m32r/page.h +3 -1
@@ -1,9 +1,11 @@#ifndef _ASM_M32R_PAGE_H#define _ASM_M32R_PAGE_H +#include <linux/const.h> +/* PAGE_SHIFT determines the page size */ #define PAGE_SHIFT 12 -#define PAGE_SIZE (1UL << PAGE_SHIFT) +#define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT)#define PAGE_MASK (~(PAGE_SIZE-1))#ifndef __ASSEMBLY__
RFC 3/10 m68k: vmlinux-std/sun3.lds.S cleanup - use PAGE_SIZE macro
In reply to [email protected]This patch includes page.h header into liker script that allow us to use PAGE_SIZE macro instead of numeric constant
---
WARNING: COMPLETELY UNTESTED !!!
vmlinux-std.lds | 3 ++- vmlinux-sun3.lds | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-)
arch/m68k/kernel/vmlinux-std.lds +2 -1
@@ -1,6 +1,7 @@ /* ld script to make m68k Linux kernel */ #include <asm-generic/vmlinux.lds.h> +#include <asm/page.h> OUTPUT_FORMAT("elf32-m68k", "elf32-m68k", "elf32-m68k") OUTPUT_ARCH(m68k)
@@ -41,7 +42,7 @@ SECTIONS _edata = .; /* End of data section */ /* will be freed after init */ - . = ALIGN(4096); /* Init code and data */ + . = ALIGN(PAGE_SIZE); /* Init code and data */ __init_begin = .; .init.text : { _sinittext = .;
arch/m68k/kernel/vmlinux-sun3.lds +4 -3
@@ -1,6 +1,7 @@ /* ld script to make m68k Linux kernel */ #include <asm-generic/vmlinux.lds.h> +#include <asm/page.h> OUTPUT_FORMAT("elf32-m68k", "elf32-m68k", "elf32-m68k") OUTPUT_ARCH(m68k)
@@ -34,7 +35,7 @@ SECTIONS _edata = .; /* will be freed after init */ - . = ALIGN(8192); /* Init code and data */ + . = ALIGN(PAGE_SIZE); /* Init code and data */ __init_begin = .; .init.text : { _sinittext = .;
@@ -61,12 +62,12 @@ __init_begin = .; } SECURITY_INIT #ifdef CONFIG_BLK_DEV_INITRD - . = ALIGN(8192); + . = ALIGN(PAGE_SIZE); __initramfs_start = .; .init.ramfs : { *(.init.ramfs) } __initramfs_end = .; #endif - . = ALIGN(8192); + . = ALIGN(PAGE_SIZE); __init_end = .; .data.init.task : { *(.data.init_task) }
Re: [RFC 03/10] m68k: vmlinux-std/sun3.lds.S cleanup - use PAGE_SIZE macro
Quoted 4 lines · On Wed, 27 Feb 2008, [email protected] wrote:
This patch includes
page.hheader into liker script that allow us to usePAGE_SIZEmacro instead of numeric constantSigned-off-by Cyrill Gorcunov <[email protected]>
Atari kernel built and booted on Aranym.
Sun-3 kernel built.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
RFC 4/10 m68knommu: vmlinux.lds cleanup - use PAGE_SIZE macro
In reply to [email protected]This patch modifies page.h header to be able to include it into linker script and then we're able to use PAGE_SIZE in vmlinux.lds
---
WARNING: COMPLETELY UNTESTED !!!
arch/m68knommu/kernel/vmlinux.lds.S | 5 +++-- include/asm-m68knommu/page.h | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-)
arch/m68knommu/kernel/vmlinux.lds.S +3 -2
@@ -8,6 +8,7 @@ */ #include <asm-generic/vmlinux.lds.h> +#include <asm/page.h> #if defined(CONFIG_RAMKERNEL) #define RAM_START CONFIG_KERNELBASE
@@ -140,7 +141,7 @@ SECTIONS { } > DATA .init : { - . = ALIGN(4096); + . = ALIGN(PAGE_SIZE); __init_begin = .; _sinittext = .; INIT_TEXT
@@ -165,7 +166,7 @@ SECTIONS { *(.init.ramfs) __initramfs_end = .; #endif - . = ALIGN(4096); + . = ALIGN(PAGE_SIZE); __init_end = .; } > INIT
include/asm-m68knommu/page.h +4 -2
@@ -1,16 +1,18 @@#ifndef _M68KNOMMU_PAGE_H#define _M68KNOMMU_PAGE_H +#include <linux/const.h> +/* PAGE_SHIFT determines the page size */ #define PAGE_SHIFT (12) -#define PAGE_SIZE (1UL << PAGE_SHIFT) +#define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT)#define PAGE_MASK (~(PAGE_SIZE-1))#include <asm/setup.h> #ifndef __ASSEMBLY__ - +#define get_user_page (vaddr) __get_free_page(GFP_KERNEL)#define free_user_page (page, addr) free_page(addr)
RFC 5/10 mn10300: vmlinux.lds.S cleanup - use PAGE_SIZE, PERCPU macroses
In reply to [email protected]This patch includes page.h header into liker script that allow us to use PAGE_SIZE macro instead of numeric constant
Also PERCPU macro is used instead of explicit section definition
---
WARNING: COMPLETELY UNTESTED !!!
vmlinux.lds.S | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-)
arch/mn10300/kernel/vmlinux.lds.S +10 -12
@@ -11,6 +11,7 @@ #define __VMLINUX_LDS__ #include <asm-generic/vmlinux.lds.h> #include <asm/thread_info.h> +#include <asm/page.h> OUTPUT_FORMAT("elf32-am33lin", "elf32-am33lin", "elf32-am33lin") OUTPUT_ARCH(mn10300)
@@ -55,13 +56,13 @@ SECTIONS CONSTRUCTORS } - . = ALIGN(4096); + . = ALIGN(PAGE_SIZE); __nosave_begin = .; .data_nosave : { *(.data.nosave) } - . = ALIGN(4096); + . = ALIGN(PAGE_SIZE); __nosave_end = .; - . = ALIGN(4096); + . = ALIGN(PAGE_SIZE); .data.page_aligned : { *(.data.idt) } . = ALIGN(32);
@@ -78,7 +79,7 @@ SECTIONS .data.init_task : { *(.data.init_task) } /* might get freed after init */ - . = ALIGN(4096); + . = ALIGN(PAGE_SIZE); .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) { __smp_locks = .; *(.smp_locks)
@@ -86,7 +87,7 @@ SECTIONS } /* will be freed after init */ - . = ALIGN(4096); /* Init code and data */ + . = ALIGN(PAGE_SIZE); /* Init code and data */ __init_begin = .; .init.text : { _sinittext = .;
@@ -120,17 +121,14 @@ SECTIONS .exit.data : { *(.exit.data) } #ifdef CONFIG_BLK_DEV_INITRD - . = ALIGN(4096); + . = ALIGN(PAGE_SIZE); __initramfs_start = .; .init.ramfs : { *(.init.ramfs) } __initramfs_end = .; #endif - . = ALIGN(32); - __per_cpu_start = .; - .data.percpu : { *(.data.percpu) } - __per_cpu_end = .; - . = ALIGN(4096); + PERCPU(32) + . = ALIGN(PAGE_SIZE); __init_end = .; /* freed after init ends here */
@@ -145,7 +143,7 @@ SECTIONS _end = . ; /* This is where the kernel creates the early boot page tables */ - . = ALIGN(4096); + . = ALIGN(PAGE_SIZE); pg0 = .; /* Sections to be discarded */
Re: [RFC 05/10] mn10300: vmlinux.lds.S cleanup - use PAGE_SIZE, PERCPU macroses
Quoted 9 lines · [email protected] wrote:
Subject: [RFC 05/10] mn10300:
vmlinux.lds.Scleanup - usePAGE_SIZE, PERCPU macroses
X-RedHat-Spam-Score: -1.005This patch includes
page.hheader into liker script that allow us to usePAGE_SIZEmacro instead of numeric constantAlso PERCPU macro is used instead of explicit section definition
Signed-off-by Cyrill Gorcunov <[email protected]>
RFC 6/10 powerpc: vmlinux.lds.S cleanup - use PERCPU, THREAD_SIZE macroses
In reply to [email protected]This patch includes thread_info.h header into liker script that allow us to use THREAD_SIZE macro instead of numeric constant
Also PERCPU macro is used instead of explicit section definition
---
WARNING: COMPLETELY UNTESTED !!!
vmlinux.lds.S | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-)
arch/powerpc/kernel/vmlinux.lds.S +4 -12
@@ -8,6 +8,7 @@ #endif #include <asm-generic/vmlinux.lds.h> #include <asm/cache.h> +#include <asm/thread_info.h> ENTRY(_stext)
@@ -145,13 +146,8 @@ SECTIONS __initramfs_end = .; } #endif - . = ALIGN(PAGE_SIZE); - .data.percpu : { - __per_cpu_start = .; - *(.data.percpu) - *(.data.percpu.shared_aligned) - __per_cpu_end = .; - } + + PERCPU(PAGE_SIZE) . = ALIGN(8); .machine.desc : {
@@ -202,11 +198,7 @@ SECTIONS PROVIDE32 (edata = .); /* The initial task and kernel stack */ -#ifdef CONFIG_PPC32 - . = ALIGN(8192); -#else - . = ALIGN(16384); -#endif + . = ALIGN(THREAD_SIZE); .data.init_task : { *(.data.init_task) }
RFC 7/10 ppc: vmlinux.lds.S cleanup - use PAGE_SIZE macro
In reply to [email protected]This patch includes page.h header into liker script that allow us to use PAGE_SIZE macro instead of numeric constant
Also a few tabs deleted to align braces
---
WARNING: COMPLETELY UNTESTED !!!
vmlinux.lds.S | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-)
arch/ppc/kernel/vmlinux.lds.S +17 -16
@@ -1,4 +1,5 @@ #include <asm-generic/vmlinux.lds.h> +#include <asm/page.h> OUTPUT_ARCH(powerpc:common) jiffies = jiffies_64 + 4;
@@ -11,22 +12,22 @@ SECTIONS .gnu.hash : { *(.gnu.hash) } .dynsym : { *(.dynsym) } .dynstr : { *(.dynstr) } - .rel.text : { *(.rel.text) } + .rel.text : { *(.rel.text) } .rela.text : { *(.rela.text) } - .rel.data : { *(.rel.data) } + .rel.data : { *(.rel.data) } .rela.data : { *(.rela.data) } .rel.rodata : { *(.rel.rodata) } .rela.rodata : { *(.rela.rodata) } - .rel.got : { *(.rel.got) } - .rela.got : { *(.rela.got) } + .rel.got : { *(.rel.got) } + .rela.got : { *(.rela.got) } .rel.ctors : { *(.rel.ctors) } .rela.ctors : { *(.rela.ctors) } .rel.dtors : { *(.rel.dtors) } .rela.dtors : { *(.rela.dtors) } - .rel.bss : { *(.rel.bss) } - .rela.bss : { *(.rela.bss) } - .rel.plt : { *(.rel.plt) } - .rela.plt : { *(.rela.plt) } + .rel.bss : { *(.rel.bss) } + .rela.bss : { *(.rela.bss) } + .rel.plt : { *(.rel.plt) } + .rela.plt : { *(.rela.plt) } /* .init : { *(.init) } =0*/ .plt : { *(.plt) } .text :
@@ -64,7 +65,7 @@ SECTIONS } /* Read-write section, merged into data segment: */ - . = ALIGN(4096); + . = ALIGN(PAGE_SIZE); .data : { DATA_DATA
@@ -76,10 +77,10 @@ SECTIONS CONSTRUCTORS } - . = ALIGN(4096); + . = ALIGN(PAGE_SIZE); __nosave_begin = .; .data_nosave : { *(.data.nosave) } - . = ALIGN(4096); + . = ALIGN(PAGE_SIZE); __nosave_end = .; . = ALIGN(32);
@@ -88,12 +89,12 @@ SECTIONS _edata = .; PROVIDE (edata = .); - . = ALIGN(8192); + . = ALIGN(2 * PAGE_SIZE); .data.init_task : { *(.data.init_task) } NOTES - . = ALIGN(4096); + . = ALIGN(PAGE_SIZE); __init_begin = .; .init.text : { _sinittext = .;
@@ -132,16 +133,16 @@ SECTIONS __ftr_fixup : { *(__ftr_fixup) } __stop___ftr_fixup = .; - PERCPU(4096) + PERCPU(PAGE_SIZE) #ifdef CONFIG_BLK_DEV_INITRD - . = ALIGN(4096); + . = ALIGN(PAGE_SIZE); __initramfs_start = .; .init.ramfs : { *(.init.ramfs) } __initramfs_end = .; #endif - . = ALIGN(4096); + . = ALIGN(PAGE_SIZE); __init_end = .; __bss_start = .; .bss :
RFC 8/10 um: dyn/uml.lds.S cleanup - use PAGE_SIZE macro
In reply to [email protected]This patch includes page.h header into liker scripts that allow us to use PAGE_SIZE macro instead of numeric constant.
To be able to include page.h into linker scripts page.h is needed for some modification - i.e. we need to use __ASSEMBLY__ and _AC macro
---
WARNING: COMPLETELY UNTESTED !!!
arch/um/kernel/dyn.lds.S | 7 ++++--- arch/um/kernel/uml.lds.S | 7 ++++--- include/asm-um/page.h | 17 +++++++++++------ 3 files changed, 19 insertions(+), 12 deletions(-)
arch/um/kernel/dyn.lds.S +4 -3
@@ -1,4 +1,5 @@ #include <asm-generic/vmlinux.lds.h> +#include <asm/page.h> OUTPUT_FORMAT(ELF_FORMAT) OUTPUT_ARCH(ELF_ARCH)
@@ -21,7 +22,7 @@ SECTIONS _einittext = .; } - . = ALIGN(4096); + . = ALIGN(PAGE_SIZE); /* Read-only sections, merged into text segment: */ .hash : { *(.hash) }
@@ -68,9 +69,9 @@ SECTIONS /* .gnu.warning sections are handled specially by elf32.em. */ *(.gnu.warning) - . = ALIGN(4096); + . = ALIGN(PAGE_SIZE); } =0x90909090 - . = ALIGN(4096); + . = ALIGN(PAGE_SIZE); .syscall_stub : { __syscall_stub_start = .; *(.__syscall_stub*)
arch/um/kernel/uml.lds.S +4 -3
@@ -1,4 +1,5 @@ #include <asm-generic/vmlinux.lds.h> +#include <asm/page.h> OUTPUT_FORMAT(ELF_FORMAT) OUTPUT_ARCH(ELF_ARCH)
@@ -26,7 +27,7 @@ SECTIONS INIT_TEXT _einittext = .; } - . = ALIGN(4096); + . = ALIGN(PAGE_SIZE); .text : {
@@ -39,7 +40,7 @@ SECTIONS *(.gnu.linkonce.t*) } - . = ALIGN(4096); + . = ALIGN(PAGE_SIZE); .syscall_stub : { __syscall_stub_start = .; *(.__syscall_stub*)
@@ -79,7 +80,7 @@ SECTIONS .sdata : { *(.sdata) } _edata = .; PROVIDE (edata = .); - . = ALIGN(0x1000); + . = ALIGN(PAGE_SIZE); .sbss : { __bss_start = .;
include/asm-um/page.h +11 -6
@@ -7,16 +7,20 @@#ifndef __UM_PAGE_H#define __UM_PAGE_H -struct page ; - -#include <linux/types.h> -#include <asm/vm-flags.h> +#include <linux/const.h> /* PAGE_SHIFT determines the page size */ #define PAGE_SHIFT 12 -#define PAGE_SIZE (1UL << PAGE_SHIFT) +#define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT)#define PAGE_MASK (~(PAGE_SIZE-1)) +#ifndef __ASSEMBLY__ + +struct page ; + +#include <linux/types.h> +#include <asm/vm-flags.h> +/* * These are used to make use of C type-checking.. */
@@ -120,4 +124,5 @@ extern struct page *arch_validate(struct#include <asm-generic/memory_model.h> #include <asm-generic/page.h> -#endif +#endif /* __ASSEMBLY__ */ +#endif /* __UM_PAGE_H */
Re: [RFC 08/10] um: dyn/uml.lds.S cleanup - use PAGE_SIZE macro
Quoted 8 lines · On Wed, Feb 27, 2008 at 11:58:39PM +0300, [email protected] wrote:
This patch includes
page.hheader into liker scripts that allow us to usePAGE_SIZEmacro instead of numeric constant.To be able to include
page.hinto linker scriptspage.his needed for some modification - i.e. we need to use__ASSEMBLY__and_ACmacroSigned-off-by Cyrill Gorcunov <[email protected]>
Needed some fixing, but it's OK. I'll forward it on.
Jeff
Signature · 1 line
Work email - jdike at linux dot intel dot com
Re: [RFC 08/10] um: dyn/uml.lds.S cleanup - use PAGE_SIZE macro
[Jeff Dike - Fri, Feb 29, 2008 at 10:43:03AM -0500]
| On Wed, Feb 27, 2008 at 11:58:39PM +0300, [email protected] wrote: | > This patch includes page.h header into liker scripts that | > allow us to use PAGE_SIZE macro instead of numeric constant. | > | > To be able to include page.h into linker scripts page.h is | > needed for some modification - i.e. we need to use __ASSEMBLY__ | > and _AC macro | > | > Signed-off-by: Cyrill Gorcunov <[email protected]> | | Needed some fixing, but it's OK. I'll forward it on. | | Jeff | | -- | Work email - jdike at linux dot intel dot com |
Thank you
- Cyrill -
RFC 9/10 alpha: vmlinux.lds cleanup - use THREAD_SIZE macro
In reply to [email protected]This patch modifies thread_info.h header to be able to include it into linker script and then we're able to use THREAD_SIZE in vmlinux.lds
---
arch/alpha/kernel/vmlinux.lds.S | 3 ++- include/asm-alpha/thread_info.h | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-)
arch/alpha/kernel/vmlinux.lds.S +2 -1
@@ -1,5 +1,6 @@ #include <asm-generic/vmlinux.lds.h> #include <asm/page.h> +#include <asm/thread_info.h> OUTPUT_FORMAT("elf64-alpha") OUTPUT_ARCH(alpha)
@@ -88,7 +89,7 @@ SECTIONS PERCPU(PAGE_SIZE) - . = ALIGN(2 * PAGE_SIZE); + . = ALIGN(THREAD_SIZE); __init_end = .; /* Freed after init ends here */
include/asm-alpha/thread_info.h +6 -3
@@ -7,9 +7,7 @@#include <asm/processor.h> #include <asm/types.h> #include <asm/hwrpb.h> -#endif -#ifndef __ASSEMBLY__struct thread_info {struct pcb_struct pcb;/* palcode state */
@@ -50,13 +48,14 @@ register struct thread_info *__current_t#define current_thread_info () __current_thread_info/* Thread information allocation. */ -#define THREAD_SIZE (2*PAGE_SIZE)#define alloc_thread_info (tsk) \ ((struct thread_info *) __get_free_pages(GFP_KERNEL,1))#define free_thread_info (ti) free_pages((unsigned long) (ti), 1)#endif /* __ASSEMBLY__ */ +#define THREAD_SIZE (2 * PAGE_SIZE) +#define PREEMPT_ACTIVE 0x40000000/*
@@ -94,6 +93,8 @@ register struct thread_info *__current_t#define ALPHA_UAC_MASK (1 << TIF_UAC_NOPRINT | 1 << TIF_UAC_NOFIX | \ 1 << TIF_UAC_SIGBUS) +#ifndef __ASSEMBLY__ +#define SET_UNALIGN_CTL (task,value) ({ \ task_thread_info(task)->flags = ((task_thread_info(task)->flags & \ ~ALPHA_UAC_MASK) \
@@ -112,5 +113,7 @@ register struct thread_info *__current_t (int __user *)(value)); \ }) +#endif /* __ASSEMBLY__ */ +#endif /* __KERNEL__ */ #endif /* _ALPHA_THREAD_INFO_H */
RFC 10/10 xtensa: vmlinux.lds.S - use PAGE_SIZE, THREAD_SIZE macroses
In reply to [email protected]This patch includes page.h and thread_info.h headers into the linker script that allow us to use PAGE_SIZE and THREAD_SIZE macroses instead of numeric constants
Also a few spaces removed
---
WARNING: COMPLETELY UNTESTED !!!
vmlinux.lds.S | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)
arch/xtensa/kernel/vmlinux.lds.S +10 -9
@@ -15,6 +15,8 @@ */ #include <asm-generic/vmlinux.lds.h> +#include <asm/page.h> +#include <asm/thread_info.h> #include <asm/variant/core.h> OUTPUT_ARCH(xtensa)
@@ -127,16 +129,16 @@ SECTIONS _edata = .; /* The initial task */ - . = ALIGN(8192); + . = ALIGN(THREAD_SIZE); .data.init_task : { *(.data.init_task) } /* Initialization code and data: */ - . = ALIGN(1 << 12); + . = ALIGN(PAGE_SIZE); __init_begin = .; .init.text : { _sinittext = .; - *(.init.literal) *(.cpuinit.literal) + *(.init.literal) *(.cpuinit.literal) *(.devinit.literal) *(.meminit.literal) INIT_TEXT _einittext = .;
@@ -165,7 +167,7 @@ SECTIONS .DoubleExceptionVector.text); RELOCATE_ENTRY(_DebugInterruptVector_text, .DebugInterruptVector.text); - + __boot_reloc_table_end = ABSOLUTE(.) ; }
@@ -189,14 +191,13 @@ SECTIONS #ifdef CONFIG_BLK_DEV_INITRD - . = ALIGN(4096); + . = ALIGN(PAGE_SIZE); __initramfs_start =.; .init.ramfs : { *(.init.ramfs) } __initramfs_end = .; #endif - PERCPU(4096) - + PERCPU(PAGE_SIZE) /* We need this dummy segment here */
@@ -251,7 +252,7 @@ SECTIONS .DoubleExceptionVector.literal) . = (LOADADDR( .DoubleExceptionVector.text ) + SIZEOF( .DoubleExceptionVector.text ) + 3) & ~ 3; - . = ALIGN(1 << 12); + . = ALIGN(PAGE_SIZE); __init_end = .;
@@ -269,7 +270,7 @@ SECTIONS . = ALIGN(0x10); .bootstrap : { *(.bootstrap.literal .bootstrap.text .bootstrap.data) } - . = ALIGN(0x1000); + . = ALIGN(PAGE_SIZE); __initrd_start = .; .initrd : { *(.initrd) } __initrd_end = .;