aboutsummaryrefslogtreecommitdiffstats
path: root/arch/cris/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/cris/kernel')
-rw-r--r--arch/cris/kernel/asm-offsets.c64
-rw-r--r--arch/cris/kernel/vmlinux.lds.S151
2 files changed, 215 insertions, 0 deletions
diff --git a/arch/cris/kernel/asm-offsets.c b/arch/cris/kernel/asm-offsets.c
new file mode 100644
index 000000000000..ddd6fbbe75de
--- /dev/null
+++ b/arch/cris/kernel/asm-offsets.c
@@ -0,0 +1,64 @@
1#include <linux/sched.h>
2#include <asm/thread_info.h>
3#include <linux/autoconf.h>
4
5/*
6 * Generate definitions needed by assembly language modules.
7 * This code generates raw asm output which is post-processed to extract
8 * and format the required data.
9 */
10
11#define DEFINE(sym, val) \
12 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
13
14#define BLANK() asm volatile("\n->" : : )
15
16#if !defined(CONFIG_ETRAX_ARCH_V10) && !defined(CONFIG_ETRAX_ARCH_V32)
17#error One of ARCH v10 and ARCH v32 must be true!
18#endif
19
20int main(void)
21{
22#define ENTRY(entry) DEFINE(PT_ ## entry, offsetof(struct pt_regs, entry))
23 ENTRY(orig_r10);
24 ENTRY(r13);
25 ENTRY(r12);
26 ENTRY(r11);
27 ENTRY(r10);
28 ENTRY(r9);
29#ifdef CONFIG_ETRAX_ARCH_V32
30 ENTRY(acr);
31 ENTRY(srs);
32#endif
33 ENTRY(mof);
34#ifdef CONFIG_ETRAX_ARCH_V10
35 ENTRY(dccr);
36#else
37 ENTRY(ccs);
38#endif
39 ENTRY(srp);
40 BLANK();
41#undef ENTRY
42#define ENTRY(entry) DEFINE(TI_ ## entry, offsetof(struct thread_info, entry))
43 ENTRY(task);
44 ENTRY(flags);
45 ENTRY(preempt_count);
46 BLANK();
47#undef ENTRY
48#define ENTRY(entry) DEFINE(THREAD_ ## entry, offsetof(struct thread_struct, entry))
49 ENTRY(ksp);
50 ENTRY(usp);
51#ifdef CONFIG_ETRAX_ARCH_V10
52 ENTRY(dccr);
53#else
54 ENTRY(ccs);
55#endif
56 BLANK();
57#undef ENTRY
58#define ENTRY(entry) DEFINE(TASK_ ## entry, offsetof(struct task_struct, entry))
59 ENTRY(pid);
60 BLANK();
61 DEFINE(LCLONE_VM, CLONE_VM);
62 DEFINE(LCLONE_UNTRACED, CLONE_UNTRACED);
63 return 0;
64}
diff --git a/arch/cris/kernel/vmlinux.lds.S b/arch/cris/kernel/vmlinux.lds.S
new file mode 100644
index 000000000000..0d2adfc794d4
--- /dev/null
+++ b/arch/cris/kernel/vmlinux.lds.S
@@ -0,0 +1,151 @@
1/* ld script to make the Linux/CRIS kernel
2 * Authors: Bjorn Wesen (bjornw@axis.com)
3 *
4 * It is VERY DANGEROUS to fiddle around with the symbols in this
5 * script. It is for example quite vital that all generated sections
6 * that are used are actually named here, otherwise the linker will
7 * put them at the end, where the init stuff is which is FREED after
8 * the kernel has booted.
9 */
10
11#include <linux/autoconf.h>
12#include <asm-generic/vmlinux.lds.h>
13#include <asm/page.h>
14
15#ifdef CONFIG_ETRAX_VMEM_SIZE
16#define __CONFIG_ETRAX_VMEM_SIZE CONFIG_ETRAX_VMEM_SIZE
17#else
18#define __CONFIG_ETRAX_VMEM_SIZE 0
19#endif
20
21
22jiffies = jiffies_64;
23SECTIONS
24{
25 . = DRAM_VIRTUAL_BASE;
26 dram_start = .;
27#ifdef CONFIG_ETRAX_ARCH_V10
28 ibr_start = .;
29#else
30 ebp_start = .;
31 /* The boot section is only necessary until the VCS top */
32 /* level testbench includes both flash and DRAM. */
33 .boot : { *(.boot) }
34#endif
35
36 /* see head.S and pages reserved at the start */
37 . = DRAM_VIRTUAL_BASE + 0x4000;
38
39 _text = .; /* Text and read-only data. */
40 text_start = .; /* Lots of aliases. */
41 _stext = .;
42 __stext = .;
43 .text : {
44 TEXT_TEXT
45 SCHED_TEXT
46 LOCK_TEXT
47 *(.fixup)
48 *(.text.__*)
49 }
50
51 _etext = . ; /* End of text section. */
52 __etext = .;
53
54 . = ALIGN(4); /* Exception table. */
55 __start___ex_table = .;
56 __ex_table : { *(__ex_table) }
57 __stop___ex_table = .;
58
59 RODATA
60
61 . = ALIGN (4);
62 ___data_start = . ;
63 __Sdata = . ;
64 .data : { /* Data */
65 DATA_DATA
66 }
67 __edata = . ; /* End of data section. */
68 _edata = . ;
69
70 . = ALIGN(PAGE_SIZE); /* init_task and stack, must be aligned. */
71 .data.init_task : { *(.data.init_task) }
72
73 . = ALIGN(PAGE_SIZE); /* Init code and data. */
74 __init_begin = .;
75 .init.text : {
76 _sinittext = .;
77 INIT_TEXT
78 _einittext = .;
79 }
80 .init.data : { INIT_DATA }
81 . = ALIGN(16);
82 __setup_start = .;
83 .init.setup : { *(.init.setup) }
84 __setup_end = .;
85#ifdef CONFIG_ETRAX_ARCH_V32
86 __start___param = .;
87 __param : { *(__param) }
88 __stop___param = .;
89#endif
90 .initcall.init : {
91 __initcall_start = .;
92 INITCALLS
93 __initcall_end = .;
94 }
95
96 .con_initcall.init : {
97 __con_initcall_start = .;
98 *(.con_initcall.init)
99 __con_initcall_end = .;
100 }
101 SECURITY_INIT
102
103#ifdef CONFIG_ETRAX_ARCH_V10
104#ifdef CONFIG_BLK_DEV_INITRD
105 .init.ramfs : {
106 __initramfs_start = .;
107 *(.init.ramfs)
108 __initramfs_end = .;
109 }
110#endif
111#endif
112 __vmlinux_end = .; /* Last address of the physical file. */
113#ifdef CONFIG_ETRAX_ARCH_V32
114 PERCPU(PAGE_SIZE)
115
116 .init.ramfs : {
117 __initramfs_start = .;
118 *(.init.ramfs)
119 __initramfs_end = .;
120 }
121#endif
122
123 /*
124 * We fill to the next page, so we can discard all init
125 * pages without needing to consider what payload might be
126 * appended to the kernel image.
127 */
128 . = ALIGN(PAGE_SIZE);
129
130 __init_end = .;
131
132 __data_end = . ; /* Move to _edata ? */
133 __bss_start = .; /* BSS. */
134 .bss : {
135 *(COMMON)
136 *(.bss)
137 }
138
139 . = ALIGN (0x20);
140 _end = .;
141 __end = .;
142
143 /* Sections to be discarded */
144 /DISCARD/ : {
145 EXIT_TEXT
146 EXIT_DATA
147 *(.exitcall.exit)
148 }
149
150 dram_end = dram_start + (CONFIG_ETRAX_DRAM_SIZE - __CONFIG_ETRAX_VMEM_SIZE)*1024*1024;
151}