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