aboutsummaryrefslogtreecommitdiffstats
path: root/arch/cris
diff options
context:
space:
mode:
authorJesper Nilsson <jesper.nilsson@axis.com>2008-01-30 06:57:31 -0500
committerJesper Nilsson <jesper.nilsson@axis.com>2008-02-08 05:06:36 -0500
commitbaa69b121a32f2b8ee388b651030f7f3c16df463 (patch)
treeb4788cdcb61636845713fa0fd21ca8f993c03e0b /arch/cris
parent52d82ef12a172124ee4aab06656c877868efc407 (diff)
CRIS v32: Fix startup oops and replace hardcoded pagesize in vmlinux.lds.S
- Move alignment of init data to page size outside define CONFIG_BLK_DEV_INITRD This avoids oops due to memory on the same page as init data being freed. - Change hardcoded page size to use macro from asm/page.h - Add reserved memory via CONFIG_ETRAX_VMEM_SIZE. - Use available defines for TEXT_TEXT and INITCALLS. - Cleanup whitespace.
Diffstat (limited to 'arch/cris')
-rw-r--r--arch/cris/arch-v32/vmlinux.lds.S74
1 files changed, 37 insertions, 37 deletions
diff --git a/arch/cris/arch-v32/vmlinux.lds.S b/arch/cris/arch-v32/vmlinux.lds.S
index fead8c59ea63..d5f28e40717c 100644
--- a/arch/cris/arch-v32/vmlinux.lds.S
+++ b/arch/cris/arch-v32/vmlinux.lds.S
@@ -9,6 +9,13 @@
9 */ 9 */
10 10
11#include <asm-generic/vmlinux.lds.h> 11#include <asm-generic/vmlinux.lds.h>
12#include <asm/page.h>
13
14#ifdef CONFIG_ETRAX_VMEM_SIZE
15#define __CONFIG_ETRAX_VMEM_SIZE CONFIG_ETRAX_VMEM_SIZE
16#else
17#define __CONFIG_ETRAX_VMEM_SIZE 0
18#endif
12 19
13jiffies = jiffies_64; 20jiffies = jiffies_64;
14SECTIONS 21SECTIONS
@@ -17,18 +24,19 @@ SECTIONS
17 dram_start = .; 24 dram_start = .;
18 ebp_start = .; 25 ebp_start = .;
19 26
20 /* The boot section is only necessary until the VCS top level testbench */ 27 /* The boot section is only necessary until the VCS top */
21 /* includes both flash and DRAM. */ 28 /* level testbench includes both flash and DRAM. */
22 .boot : { *(.boot) } 29 .boot : { *(.boot) }
23 30
24 . = DRAM_VIRTUAL_BASE + 0x4000; /* See head.S and pages reserved at the start. */ 31 /* See head.S and pages reserved at the start. */
32 . = DRAM_VIRTUAL_BASE + 0x4000;
25 33
26 _text = .; /* Text and read-only data. */ 34 _text = .; /* Text and read-only data. */
27 text_start = .; /* Lots of aliases. */ 35 text_start = .; /* Lots of aliases. */
28 _stext = .; 36 _stext = .;
29 __stext = .; 37 __stext = .;
30 .text : { 38 .text : {
31 *(.text) 39 TEXT_TEXT
32 SCHED_TEXT 40 SCHED_TEXT
33 LOCK_TEXT 41 LOCK_TEXT
34 *(.fixup) 42 *(.fixup)
@@ -39,9 +47,9 @@ SECTIONS
39 __etext = .; 47 __etext = .;
40 48
41 . = ALIGN(4); /* Exception table. */ 49 . = ALIGN(4); /* Exception table. */
42 __start___ex_table = .; 50 __start___ex_table = .;
43 __ex_table : { *(__ex_table) } 51 __ex_table : { *(__ex_table) }
44 __stop___ex_table = .; 52 __stop___ex_table = .;
45 53
46 RODATA 54 RODATA
47 55
@@ -54,33 +62,27 @@ SECTIONS
54 __edata = . ; /* End of data section. */ 62 __edata = . ; /* End of data section. */
55 _edata = . ; 63 _edata = . ;
56 64
57 . = ALIGN(8192); /* init_task and stack, must be aligned. */ 65 . = ALIGN(PAGE_SIZE); /* init_task and stack, must be aligned. */
58 .data.init_task : { *(.data.init_task) } 66 .data.init_task : { *(.data.init_task) }
59 67
60 . = ALIGN(8192); /* Init code and data. */ 68 . = ALIGN(PAGE_SIZE); /* Init code and data. */
61 __init_begin = .; 69 __init_begin = .;
62 .init.text : { 70 .init.text : {
63 _sinittext = .; 71 _sinittext = .;
64 INIT_TEXT 72 INIT_TEXT
65 _einittext = .; 73 _einittext = .;
66 } 74 }
67 .init.data : { INIT_DATA } 75 .init.data : { INIT_DATA }
68 . = ALIGN(16); 76 . = ALIGN(16);
69 __setup_start = .; 77 __setup_start = .;
70 .init.setup : { *(.init.setup) } 78 .init.setup : { *(.init.setup) }
71 __setup_end = .; 79 __setup_end = .;
72 __start___param = .; 80 __start___param = .;
73 __param : { *(__param) } 81 __param : { *(__param) }
74 __stop___param = .; 82 __stop___param = .;
75 .initcall.init : { 83 .initcall.init : {
76 __initcall_start = .; 84 __initcall_start = .;
77 *(.initcall1.init); 85 INITCALLS
78 *(.initcall2.init);
79 *(.initcall3.init);
80 *(.initcall4.init);
81 *(.initcall5.init);
82 *(.initcall6.init);
83 *(.initcall7.init);
84 __initcall_end = .; 86 __initcall_end = .;
85 } 87 }
86 88
@@ -91,25 +93,23 @@ SECTIONS
91 } 93 }
92 SECURITY_INIT 94 SECURITY_INIT
93 95
94 PERCPU(8192) 96 __vmlinux_end = .; /* Last address of the physical file. */
97 PERCPU(PAGE_SIZE)
95 98
96#ifdef CONFIG_BLK_DEV_INITRD
97 .init.ramfs : { 99 .init.ramfs : {
98 __initramfs_start = .; 100 __initramfs_start = .;
99 *(.init.ramfs) 101 *(.init.ramfs)
100 __initramfs_end = .; 102 __initramfs_end = .;
101 /*
102 * We fill to the next page, so we can discard all init
103 * pages without needing to consider what payload might be
104 * appended to the kernel image.
105 */
106 FILL (0);
107 . = ALIGN (8192);
108 } 103 }
109#endif
110 104
111 __vmlinux_end = .; /* Last address of the physical file. */ 105 /*
112 __init_end = .; 106 * We fill to the next page, so we can discard all init
107 * pages without needing to consider what payload might be
108 * appended to the kernel image.
109 */
110 . = ALIGN (PAGE_SIZE);
111
112 __init_end = .;
113 113
114 __data_end = . ; /* Move to _edata? */ 114 __data_end = . ; /* Move to _edata? */
115 __bss_start = .; /* BSS. */ 115 __bss_start = .; /* BSS. */
@@ -123,11 +123,11 @@ SECTIONS
123 __end = .; 123 __end = .;
124 124
125 /* Sections to be discarded */ 125 /* Sections to be discarded */
126 /DISCARD/ : { 126 /DISCARD/ : {
127 EXIT_TEXT 127 EXIT_TEXT
128 EXIT_DATA 128 EXIT_DATA
129 *(.exitcall.exit) 129 *(.exitcall.exit)
130 } 130 }
131 131
132 dram_end = dram_start + CONFIG_ETRAX_DRAM_SIZE*1024*1024; 132 dram_end = dram_start + (CONFIG_ETRAX_DRAM_SIZE - __CONFIG_ETRAX_VMEM_SIZE)*1024*1024;
133} 133}