Merge branch 'for-linus' of git://www.linux-m32r.org/git/takata/linux-2.6_dev

* 'for-linus' of git://www.linux-m32r.org/git/takata/linux-2.6_dev:
m32r: Cleanup linker script using new linker script macros.
m32r: Move the spi_stack_top and spu_stack_top into .init.data section.
m32r: Remove unused .altinstructions and .exit.* code from linker script.
m32r: Move GET_THREAD_INFO definition out of asm/thread_info.h.
m32r: Define THREAD_SIZE only once.
m32r: make PAGE_SIZE available to assembly.

+23 -87
+3 -1
arch/m32r/include/asm/page.h
··· 1 1 #ifndef _ASM_M32R_PAGE_H 2 2 #define _ASM_M32R_PAGE_H 3 3 4 + #include <linux/const.h> 5 + 4 6 /* PAGE_SHIFT determines the page size */ 5 7 #define PAGE_SHIFT 12 6 - #define PAGE_SIZE (1UL << PAGE_SHIFT) 8 + #define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT) 7 9 #define PAGE_MASK (~(PAGE_SIZE-1)) 8 10 9 11 #ifndef __ASSEMBLY__
-2
arch/m32r/include/asm/processor.h
··· 140 140 #define KSTK_EIP(tsk) ((tsk)->thread.lr) 141 141 #define KSTK_ESP(tsk) ((tsk)->thread.sp) 142 142 143 - #define THREAD_SIZE (2*PAGE_SIZE) 144 - 145 143 #define cpu_relax() barrier() 146 144 147 145 #endif /* _ASM_M32R_PROCESSOR_H */
+2 -13
arch/m32r/include/asm/thread_info.h
··· 55 55 56 56 #define PREEMPT_ACTIVE 0x10000000 57 57 58 + #define THREAD_SIZE (PAGE_SIZE << 1) 59 + 58 60 /* 59 61 * macros/functions for gaining access to the thread information structure 60 62 */ ··· 77 75 78 76 #define init_thread_info (init_thread_union.thread_info) 79 77 #define init_stack (init_thread_union.stack) 80 - 81 - #define THREAD_SIZE (2*PAGE_SIZE) 82 78 83 79 /* how to get the thread information struct from C */ 84 80 static inline struct thread_info *current_thread_info(void) ··· 124 124 struct thread_info *ti = current_thread_info(); 125 125 return ti->flags >> TI_FLAG_FAULT_CODE_SHIFT; 126 126 } 127 - 128 - #else /* !__ASSEMBLY__ */ 129 - 130 - #define THREAD_SIZE 8192 131 - 132 - /* how to get the thread information struct from ASM */ 133 - #define GET_THREAD_INFO(reg) GET_THREAD_INFO reg 134 - .macro GET_THREAD_INFO reg 135 - ldi \reg, #-THREAD_SIZE 136 - and \reg, sp 137 - .endm 138 127 139 128 #endif 140 129
+7
arch/m32r/kernel/entry.S
··· 118 118 #define resume_kernel restore_all 119 119 #endif 120 120 121 + /* how to get the thread information struct from ASM */ 122 + #define GET_THREAD_INFO(reg) GET_THREAD_INFO reg 123 + .macro GET_THREAD_INFO reg 124 + ldi \reg, #-THREAD_SIZE 125 + and \reg, sp 126 + .endm 127 + 121 128 ENTRY(ret_from_fork) 122 129 pop r0 123 130 bl schedule_tail
+2 -2
arch/m32r/kernel/head.S
··· 268 268 /*------------------------------------------------------------------------ 269 269 * Stack area 270 270 */ 271 - .section .spi 271 + .section .init.data, "aw" 272 272 ALIGN 273 273 .global spi_stack_top 274 274 .zero 1024 275 275 spi_stack_top: 276 276 277 - .section .spu 277 + .section .init.data, "aw" 278 278 ALIGN 279 279 .global spu_stack_top 280 280 .zero 1024
+9 -69
arch/m32r/kernel/vmlinux.lds.S
··· 4 4 #include <asm-generic/vmlinux.lds.h> 5 5 #include <asm/addrspace.h> 6 6 #include <asm/page.h> 7 + #include <asm/thread_info.h> 7 8 8 9 OUTPUT_ARCH(m32r) 9 10 #if defined(__LITTLE_ENDIAN__) ··· 41 40 #endif 42 41 _etext = .; /* End of text section */ 43 42 44 - . = ALIGN(16); /* Exception table */ 45 - __start___ex_table = .; 46 - __ex_table : { *(__ex_table) } 47 - __stop___ex_table = .; 48 - 43 + EXCEPTION_TABLE(16) 49 44 RODATA 50 - 51 - /* writeable */ 52 - .data : { /* Data */ 53 - *(.spu) 54 - *(.spi) 55 - DATA_DATA 56 - CONSTRUCTORS 57 - } 58 - 59 - . = ALIGN(4096); 60 - __nosave_begin = .; 61 - .data_nosave : { *(.data.nosave) } 62 - . = ALIGN(4096); 63 - __nosave_end = .; 64 - 65 - . = ALIGN(32); 66 - .data.cacheline_aligned : { *(.data.cacheline_aligned) } 67 - 45 + RW_DATA_SECTION(32, PAGE_SIZE, THREAD_SIZE) 68 46 _edata = .; /* End of data section */ 69 47 70 - . = ALIGN(8192); /* init_task */ 71 - .data.init_task : { *(.data.init_task) } 72 - 73 48 /* will be freed after init */ 74 - . = ALIGN(4096); /* Init code and data */ 49 + . = ALIGN(PAGE_SIZE); /* Init code and data */ 75 50 __init_begin = .; 76 - .init.text : { 77 - _sinittext = .; 78 - INIT_TEXT 79 - _einittext = .; 80 - } 81 - .init.data : { INIT_DATA } 82 - . = ALIGN(16); 83 - __setup_start = .; 84 - .init.setup : { *(.init.setup) } 85 - __setup_end = .; 86 - __initcall_start = .; 87 - .initcall.init : { 88 - INITCALLS 89 - } 90 - __initcall_end = .; 91 - __con_initcall_start = .; 92 - .con_initcall.init : { *(.con_initcall.init) } 93 - __con_initcall_end = .; 94 - SECURITY_INIT 95 - . = ALIGN(4); 96 - __alt_instructions = .; 97 - .altinstructions : { *(.altinstructions) } 98 - __alt_instructions_end = .; 99 - .altinstr_replacement : { *(.altinstr_replacement) } 100 - /* .exit.text is discard at runtime, not link time, to deal with references 101 - from .altinstructions and .eh_frame */ 102 - .exit.text : { EXIT_TEXT } 103 - .exit.data : { EXIT_DATA } 104 - 105 - #ifdef CONFIG_BLK_DEV_INITRD 106 - . = ALIGN(4096); 107 - __initramfs_start = .; 108 - .init.ramfs : { *(.init.ramfs) } 109 - __initramfs_end = .; 110 - #endif 111 - 112 - PERCPU(4096) 113 - . = ALIGN(4096); 51 + INIT_TEXT_SECTION(PAGE_SIZE) 52 + INIT_DATA_SECTION(16) 53 + PERCPU(PAGE_SIZE) 54 + . = ALIGN(PAGE_SIZE); 114 55 __init_end = .; 115 56 /* freed after init ends here */ 116 57 117 - __bss_start = .; /* BSS */ 118 - .bss : { *(.bss) } 119 - . = ALIGN(4); 120 - __bss_stop = .; 58 + BSS_SECTION(0, 0, 4) 121 59 122 60 _end = . ; 123 61