aboutsummaryrefslogtreecommitdiffstats
path: root/arch/alpha
diff options
context:
space:
mode:
Diffstat (limited to 'arch/alpha')
-rw-r--r--arch/alpha/Makefile83
-rw-r--r--arch/alpha/kernel/entry.S9
-rw-r--r--arch/alpha/kernel/ptrace.c46
-rw-r--r--arch/alpha/kernel/vmlinux.lds.S260
-rw-r--r--arch/alpha/mm/fault.c2
5 files changed, 157 insertions, 243 deletions
diff --git a/arch/alpha/Makefile b/arch/alpha/Makefile
index 2f283b2fb164..63104ebd1806 100644
--- a/arch/alpha/Makefile
+++ b/arch/alpha/Makefile
@@ -12,73 +12,22 @@ NM := $(NM) -B
12 12
13LDFLAGS_vmlinux := -static -N #-relax 13LDFLAGS_vmlinux := -static -N #-relax
14CHECKFLAGS += -D__alpha__ -m64 14CHECKFLAGS += -D__alpha__ -m64
15cflags-y := -pipe -mno-fp-regs -ffixed-8 15cflags-y := -pipe -mno-fp-regs -ffixed-8 -msmall-data
16 16
17# Determine if we can use the BWX instructions with GAS. 17cpuflags-$(CONFIG_ALPHA_EV67) := -mcpu=ev67
18old_gas := $(shell if $(AS) --version 2>&1 | grep 'version 2.7' > /dev/null; then echo y; else echo n; fi) 18cpuflags-$(CONFIG_ALPHA_EV6) := -mcpu=ev6
19 19cpuflags-$(CONFIG_ALPHA_POLARIS) := -mcpu=pca56
20ifeq ($(old_gas),y) 20cpuflags-$(CONFIG_ALPHA_SX164) := -mcpu=pca56
21$(error The assembler '$(AS)' does not support the BWX instruction) 21cpuflags-$(CONFIG_ALPHA_EV56) := -mcpu=ev56
22endif 22cpuflags-$(CONFIG_ALPHA_EV5) := -mcpu=ev5
23 23cpuflags-$(CONFIG_ALPHA_EV4) := -mcpu=ev4
24# Determine if GCC understands the -mcpu= option. 24# If GENERIC, make sure to turn off any instruction set extensions that
25have_mcpu := $(call cc-option-yn, -mcpu=ev5) 25# the host compiler might have on by default. Given that EV4 and EV5
26have_mcpu_pca56 := $(call cc-option-yn, -mcpu=pca56) 26# have the same instruction set, prefer EV5 because an EV5 schedule is
27have_mcpu_ev6 := $(call cc-option-yn, -mcpu=ev6) 27# more likely to keep an EV4 processor busy than vice-versa.
28have_mcpu_ev67 := $(call cc-option-yn, -mcpu=ev67) 28cpuflags-$(CONFIG_ALPHA_GENERIC) := -mcpu=ev5
29have_msmall_data := $(call cc-option-yn, -msmall-data) 29
30 30cflags-y += $(cpuflags-y)
31cflags-$(have_msmall_data) += -msmall-data
32
33# Turn on the proper cpu optimizations.
34ifeq ($(have_mcpu),y)
35 mcpu_done := n
36 # If GENERIC, make sure to turn off any instruction set extensions that
37 # the host compiler might have on by default. Given that EV4 and EV5
38 # have the same instruction set, prefer EV5 because an EV5 schedule is
39 # more likely to keep an EV4 processor busy than vice-versa.
40 ifeq ($(CONFIG_ALPHA_GENERIC),y)
41 mcpu := ev5
42 mcpu_done := y
43 endif
44 ifeq ($(mcpu_done)$(CONFIG_ALPHA_SX164)$(have_mcpu_pca56),nyy)
45 mcpu := pca56
46 mcpu_done := y
47 endif
48 ifeq ($(mcpu_done)$(CONFIG_ALPHA_POLARIS)$(have_mcpu_pca56),nyy)
49 mcpu := pca56
50 mcpu_done := y
51 endif
52 ifeq ($(mcpu_done)$(CONFIG_ALPHA_EV4),ny)
53 mcpu := ev4
54 mcpu_done := y
55 endif
56 ifeq ($(mcpu_done)$(CONFIG_ALPHA_EV56),ny)
57 mcpu := ev56
58 mcpu_done := y
59 endif
60 ifeq ($(mcpu_done)$(CONFIG_ALPHA_EV5),ny)
61 mcpu := ev5
62 mcpu_done := y
63 endif
64 ifeq ($(mcpu_done)$(CONFIG_ALPHA_EV67)$(have_mcpu_ev67),nyy)
65 mcpu := ev67
66 mcpu_done := y
67 endif
68 ifeq ($(mcpu_done)$(CONFIG_ALPHA_EV6),ny)
69 ifeq ($(have_mcpu_ev6),y)
70 mcpu := ev6
71 else
72 ifeq ($(have_mcpu_pca56),y)
73 mcpu := pca56
74 else
75 mcpu=ev56
76 endif
77 endif
78 mcpu_done := y
79 endif
80 cflags-$(mcpu_done) += -mcpu=$(mcpu)
81endif
82 31
83 32
84# For TSUNAMI, we must have the assembler not emulate our instructions. 33# For TSUNAMI, we must have the assembler not emulate our instructions.
diff --git a/arch/alpha/kernel/entry.S b/arch/alpha/kernel/entry.S
index debc8f03886c..5fc61e281ac7 100644
--- a/arch/alpha/kernel/entry.S
+++ b/arch/alpha/kernel/entry.S
@@ -917,15 +917,6 @@ sys_pipe:
917.end sys_pipe 917.end sys_pipe
918 918
919 .align 4 919 .align 4
920 .globl sys_ptrace
921 .ent sys_ptrace
922sys_ptrace:
923 .prologue 0
924 mov $sp, $20
925 jmp $31, do_sys_ptrace
926.end sys_ptrace
927
928 .align 4
929 .globl sys_execve 920 .globl sys_execve
930 .ent sys_execve 921 .ent sys_execve
931sys_execve: 922sys_execve:
diff --git a/arch/alpha/kernel/ptrace.c b/arch/alpha/kernel/ptrace.c
index 83a781842266..1e9ad52c460e 100644
--- a/arch/alpha/kernel/ptrace.c
+++ b/arch/alpha/kernel/ptrace.c
@@ -260,38 +260,12 @@ void ptrace_disable(struct task_struct *child)
260 ptrace_cancel_bpt(child); 260 ptrace_cancel_bpt(child);
261} 261}
262 262
263asmlinkage long 263long arch_ptrace(struct task_struct *child, long request, long addr, long data)
264do_sys_ptrace(long request, long pid, long addr, long data,
265 struct pt_regs *regs)
266{ 264{
267 struct task_struct *child;
268 unsigned long tmp; 265 unsigned long tmp;
269 size_t copied; 266 size_t copied;
270 long ret; 267 long ret;
271 268
272 lock_kernel();
273 DBG(DBG_MEM, ("request=%ld pid=%ld addr=0x%lx data=0x%lx\n",
274 request, pid, addr, data));
275 if (request == PTRACE_TRACEME) {
276 ret = ptrace_traceme();
277 goto out_notsk;
278 }
279
280 child = ptrace_get_task_struct(pid);
281 if (IS_ERR(child)) {
282 ret = PTR_ERR(child);
283 goto out_notsk;
284 }
285
286 if (request == PTRACE_ATTACH) {
287 ret = ptrace_attach(child);
288 goto out;
289 }
290
291 ret = ptrace_check_attach(child, request == PTRACE_KILL);
292 if (ret < 0)
293 goto out;
294
295 switch (request) { 269 switch (request) {
296 /* When I and D space are separate, these will need to be fixed. */ 270 /* When I and D space are separate, these will need to be fixed. */
297 case PTRACE_PEEKTEXT: /* read word at location addr. */ 271 case PTRACE_PEEKTEXT: /* read word at location addr. */
@@ -301,13 +275,13 @@ do_sys_ptrace(long request, long pid, long addr, long data,
301 if (copied != sizeof(tmp)) 275 if (copied != sizeof(tmp))
302 break; 276 break;
303 277
304 regs->r0 = 0; /* special return: no errors */ 278 force_successful_syscall_return();
305 ret = tmp; 279 ret = tmp;
306 break; 280 break;
307 281
308 /* Read register number ADDR. */ 282 /* Read register number ADDR. */
309 case PTRACE_PEEKUSR: 283 case PTRACE_PEEKUSR:
310 regs->r0 = 0; /* special return: no errors */ 284 force_successful_syscall_return();
311 ret = get_reg(child, addr); 285 ret = get_reg(child, addr);
312 DBG(DBG_MEM, ("peek $%ld->%#lx\n", addr, ret)); 286 DBG(DBG_MEM, ("peek $%ld->%#lx\n", addr, ret));
313 break; 287 break;
@@ -353,7 +327,7 @@ do_sys_ptrace(long request, long pid, long addr, long data,
353 /* make sure single-step breakpoint is gone. */ 327 /* make sure single-step breakpoint is gone. */
354 ptrace_cancel_bpt(child); 328 ptrace_cancel_bpt(child);
355 wake_up_process(child); 329 wake_up_process(child);
356 goto out; 330 break;
357 331
358 case PTRACE_SINGLESTEP: /* execute single instruction. */ 332 case PTRACE_SINGLESTEP: /* execute single instruction. */
359 ret = -EIO; 333 ret = -EIO;
@@ -366,20 +340,12 @@ do_sys_ptrace(long request, long pid, long addr, long data,
366 wake_up_process(child); 340 wake_up_process(child);
367 /* give it a chance to run. */ 341 /* give it a chance to run. */
368 ret = 0; 342 ret = 0;
369 goto out; 343 break;
370
371 case PTRACE_DETACH: /* detach a process that was attached. */
372 ret = ptrace_detach(child, data);
373 goto out;
374 344
375 default: 345 default:
376 ret = ptrace_request(child, request, addr, data); 346 ret = ptrace_request(child, request, addr, data);
377 goto out; 347 break;
378 } 348 }
379 out:
380 put_task_struct(child);
381 out_notsk:
382 unlock_kernel();
383 return ret; 349 return ret;
384} 350}
385 351
diff --git a/arch/alpha/kernel/vmlinux.lds.S b/arch/alpha/kernel/vmlinux.lds.S
index 7af07d3ad5f0..55c05b511f4c 100644
--- a/arch/alpha/kernel/vmlinux.lds.S
+++ b/arch/alpha/kernel/vmlinux.lds.S
@@ -1,4 +1,5 @@
1#include <asm-generic/vmlinux.lds.h> 1#include <asm-generic/vmlinux.lds.h>
2#include <asm/page.h>
2 3
3OUTPUT_FORMAT("elf64-alpha") 4OUTPUT_FORMAT("elf64-alpha")
4OUTPUT_ARCH(alpha) 5OUTPUT_ARCH(alpha)
@@ -8,138 +9,145 @@ jiffies = jiffies_64;
8SECTIONS 9SECTIONS
9{ 10{
10#ifdef CONFIG_ALPHA_LEGACY_START_ADDRESS 11#ifdef CONFIG_ALPHA_LEGACY_START_ADDRESS
11 . = 0xfffffc0000310000; 12 . = 0xfffffc0000310000;
12#else 13#else
13 . = 0xfffffc0001010000; 14 . = 0xfffffc0001010000;
14#endif 15#endif
15 16
16 _text = .; /* Text and read-only data */ 17 _text = .; /* Text and read-only data */
17 .text : { 18 .text : {
18 *(.text.head) 19 *(.text.head)
19 TEXT_TEXT 20 TEXT_TEXT
20 SCHED_TEXT 21 SCHED_TEXT
21 LOCK_TEXT 22 LOCK_TEXT
22 *(.fixup) 23 *(.fixup)
23 *(.gnu.warning) 24 *(.gnu.warning)
24 } :kernel 25 } :kernel
25 _etext = .; /* End of text section */ 26 _etext = .; /* End of text section */
26 27
27 . = ALIGN(16); 28 /* Exception table */
28 __start___ex_table = .; /* Exception table */ 29 . = ALIGN(16);
29 __ex_table : { *(__ex_table) } 30 __ex_table : {
30 __stop___ex_table = .; 31 __start___ex_table = .;
31 32 *(__ex_table)
32 NOTES :kernel :note 33 __stop___ex_table = .;
33 .dummy : { *(.dummy) } :kernel 34 }
34 35
35 RODATA 36 NOTES :kernel :note
36 37 .dummy : {
37 /* Will be freed after init */ 38 *(.dummy)
38 . = ALIGN(8192); /* Init code and data */ 39 } :kernel
39 __init_begin = .; 40
40 .init.text : { 41 RODATA
41 _sinittext = .; 42
42 *(.init.text) 43 /* Will be freed after init */
43 _einittext = .; 44 . = ALIGN(PAGE_SIZE);
44 } 45 /* Init code and data */
45 .init.data : { *(.init.data) } 46 __init_begin = .;
46 47 .init.text : {
47 . = ALIGN(16); 48 _sinittext = .;
48 __setup_start = .; 49 *(.init.text)
49 .init.setup : { *(.init.setup) } 50 _einittext = .;
50 __setup_end = .; 51 }
51 52 .init.data : {
52 . = ALIGN(8); 53 *(.init.data)
53 __initcall_start = .; 54 }
54 .initcall.init : { 55
55 INITCALLS 56 . = ALIGN(16);
56 } 57 .init.setup : {
57 __initcall_end = .; 58 __setup_start = .;
59 *(.init.setup)
60 __setup_end = .;
61 }
62
63 . = ALIGN(8);
64 .initcall.init : {
65 __initcall_start = .;
66 INITCALLS
67 __initcall_end = .;
68 }
58 69
59#ifdef CONFIG_BLK_DEV_INITRD 70#ifdef CONFIG_BLK_DEV_INITRD
60 . = ALIGN(8192); 71 . = ALIGN(PAGE_SIZE);
61 __initramfs_start = .; 72 .init.ramfs : {
62 .init.ramfs : { *(.init.ramfs) } 73 __initramfs_start = .;
63 __initramfs_end = .; 74 *(.init.ramfs)
75 __initramfs_end = .;
76 }
64#endif 77#endif
65 78
66 . = ALIGN(8); 79 . = ALIGN(8);
67 .con_initcall.init : { 80 .con_initcall.init : {
68 __con_initcall_start = .; 81 __con_initcall_start = .;
69 *(.con_initcall.init) 82 *(.con_initcall.init)
70 __con_initcall_end = .; 83 __con_initcall_end = .;
71 } 84 }
72 85
73 . = ALIGN(8); 86 . = ALIGN(8);
74 SECURITY_INIT 87 SECURITY_INIT
75 88
76 PERCPU(8192) 89 PERCPU(PAGE_SIZE)
77 90
78 . = ALIGN(2*8192); 91 . = ALIGN(2 * PAGE_SIZE);
79 __init_end = .; 92 __init_end = .;
80 /* Freed after init ends here */ 93 /* Freed after init ends here */
81 94
82 /* Note 2 page alignment above. */ 95 /* Note 2 page alignment above. */
83 .data.init_thread : { *(.data.init_thread) } 96 .data.init_thread : {
84 97 *(.data.init_thread)
85 . = ALIGN(8192); 98 }
86 .data.page_aligned : { *(.data.page_aligned) } 99
87 100 . = ALIGN(PAGE_SIZE);
88 . = ALIGN(64); 101 .data.page_aligned : {
89 .data.cacheline_aligned : { *(.data.cacheline_aligned) } 102 *(.data.page_aligned)
90 103 }
91 _data = .; 104
92 .data : { /* Data */ 105 . = ALIGN(64);
93 DATA_DATA 106 .data.cacheline_aligned : {
94 CONSTRUCTORS 107 *(.data.cacheline_aligned)
95 } 108 }
96 109
97 .got : { *(.got) } 110 _data = .;
98 .sdata : { *(.sdata) } 111 /* Data */
99 112 .data : {
100 _edata = .; /* End of data section */ 113 DATA_DATA
101 114 CONSTRUCTORS
102 __bss_start = .; 115 }
103 .sbss : { *(.sbss) *(.scommon) } 116
104 .bss : { *(.bss) *(COMMON) } 117 .got : {
105 __bss_stop = .; 118 *(.got)
106 119 }
107 _end = .; 120 .sdata : {
108 121 *(.sdata)
109 /* Sections to be discarded */ 122 }
110 /DISCARD/ : { *(.exit.text) *(.exit.data) *(.exitcall.exit) } 123 _edata = .; /* End of data section */
111 124
112 .mdebug 0 : { *(.mdebug) } 125 __bss_start = .;
113 .note 0 : { *(.note) } 126 .sbss : {
114 .comment 0 : { *(.comment) } 127 *(.sbss)
115 128 *(.scommon)
116 /* Stabs debugging sections */ 129 }
117 .stab 0 : { *(.stab) } 130 .bss : {
118 .stabstr 0 : { *(.stabstr) } 131 *(.bss)
119 .stab.excl 0 : { *(.stab.excl) } 132 *(COMMON)
120 .stab.exclstr 0 : { *(.stab.exclstr) } 133 }
121 .stab.index 0 : { *(.stab.index) } 134 __bss_stop = .;
122 .stab.indexstr 0 : { *(.stab.indexstr) } 135 _end = .;
123 /* DWARF 1 */ 136
124 .debug 0 : { *(.debug) } 137 /* Sections to be discarded */
125 .line 0 : { *(.line) } 138 /DISCARD/ : {
126 /* GNU DWARF 1 extensions */ 139 *(.exit.text)
127 .debug_srcinfo 0 : { *(.debug_srcinfo) } 140 *(.exit.data)
128 .debug_sfnames 0 : { *(.debug_sfnames) } 141 *(.exitcall.exit)
129 /* DWARF 1.1 and DWARF 2 */ 142 }
130 .debug_aranges 0 : { *(.debug_aranges) } 143
131 .debug_pubnames 0 : { *(.debug_pubnames) } 144 .mdebug 0 : {
132 /* DWARF 2 */ 145 *(.mdebug)
133 .debug_info 0 : { *(.debug_info) } 146 }
134 .debug_abbrev 0 : { *(.debug_abbrev) } 147 .note 0 : {
135 .debug_line 0 : { *(.debug_line) } 148 *(.note)
136 .debug_frame 0 : { *(.debug_frame) } 149 }
137 .debug_str 0 : { *(.debug_str) } 150
138 .debug_loc 0 : { *(.debug_loc) } 151 STABS_DEBUG
139 .debug_macinfo 0 : { *(.debug_macinfo) } 152 DWARF_DEBUG
140 /* SGI/MIPS DWARF 2 extensions */
141 .debug_weaknames 0 : { *(.debug_weaknames) }
142 .debug_funcnames 0 : { *(.debug_funcnames) }
143 .debug_typenames 0 : { *(.debug_typenames) }
144 .debug_varnames 0 : { *(.debug_varnames) }
145} 153}
diff --git a/arch/alpha/mm/fault.c b/arch/alpha/mm/fault.c
index a0e18da594d9..25154df3055a 100644
--- a/arch/alpha/mm/fault.c
+++ b/arch/alpha/mm/fault.c
@@ -197,7 +197,7 @@ do_page_fault(unsigned long address, unsigned long mmcsr,
197 current->comm, current->pid); 197 current->comm, current->pid);
198 if (!user_mode(regs)) 198 if (!user_mode(regs))
199 goto no_context; 199 goto no_context;
200 do_exit(SIGKILL); 200 do_group_exit(SIGKILL);
201 201
202 do_sigbus: 202 do_sigbus:
203 /* Send a sigbus, regardless of whether we were in kernel 203 /* Send a sigbus, regardless of whether we were in kernel