diff options
Diffstat (limited to 'arch/avr32/kernel')
-rw-r--r-- | arch/avr32/kernel/.gitignore | 1 | ||||
-rw-r--r-- | arch/avr32/kernel/asm-offsets.c | 6 | ||||
-rw-r--r-- | arch/avr32/kernel/avr32_ksyms.c | 1 | ||||
-rw-r--r-- | arch/avr32/kernel/entry-avr32b.S | 59 | ||||
-rw-r--r-- | arch/avr32/kernel/process.c | 3 | ||||
-rw-r--r-- | arch/avr32/kernel/setup.c | 19 | ||||
-rw-r--r-- | arch/avr32/kernel/syscall-stubs.S | 9 | ||||
-rw-r--r-- | arch/avr32/kernel/syscall_table.S | 2 | ||||
-rw-r--r-- | arch/avr32/kernel/traps.c | 8 |
9 files changed, 100 insertions, 8 deletions
diff --git a/arch/avr32/kernel/.gitignore b/arch/avr32/kernel/.gitignore new file mode 100644 index 000000000000..c5f676c3c224 --- /dev/null +++ b/arch/avr32/kernel/.gitignore | |||
@@ -0,0 +1 @@ | |||
vmlinux.lds | |||
diff --git a/arch/avr32/kernel/asm-offsets.c b/arch/avr32/kernel/asm-offsets.c index e4796c67a831..d6a8193a1d2f 100644 --- a/arch/avr32/kernel/asm-offsets.c +++ b/arch/avr32/kernel/asm-offsets.c | |||
@@ -4,6 +4,8 @@ | |||
4 | * to extract and format the required data. | 4 | * to extract and format the required data. |
5 | */ | 5 | */ |
6 | 6 | ||
7 | #include <linux/mm.h> | ||
8 | #include <linux/sched.h> | ||
7 | #include <linux/thread_info.h> | 9 | #include <linux/thread_info.h> |
8 | #include <linux/kbuild.h> | 10 | #include <linux/kbuild.h> |
9 | 11 | ||
@@ -17,4 +19,8 @@ void foo(void) | |||
17 | OFFSET(TI_rar_saved, thread_info, rar_saved); | 19 | OFFSET(TI_rar_saved, thread_info, rar_saved); |
18 | OFFSET(TI_rsr_saved, thread_info, rsr_saved); | 20 | OFFSET(TI_rsr_saved, thread_info, rsr_saved); |
19 | OFFSET(TI_restart_block, thread_info, restart_block); | 21 | OFFSET(TI_restart_block, thread_info, restart_block); |
22 | BLANK(); | ||
23 | OFFSET(TSK_active_mm, task_struct, active_mm); | ||
24 | BLANK(); | ||
25 | OFFSET(MM_pgd, mm_struct, pgd); | ||
20 | } | 26 | } |
diff --git a/arch/avr32/kernel/avr32_ksyms.c b/arch/avr32/kernel/avr32_ksyms.c index 84a7d44edc67..11e310c567a9 100644 --- a/arch/avr32/kernel/avr32_ksyms.c +++ b/arch/avr32/kernel/avr32_ksyms.c | |||
@@ -58,6 +58,7 @@ EXPORT_SYMBOL(find_first_zero_bit); | |||
58 | EXPORT_SYMBOL(find_next_zero_bit); | 58 | EXPORT_SYMBOL(find_next_zero_bit); |
59 | EXPORT_SYMBOL(find_first_bit); | 59 | EXPORT_SYMBOL(find_first_bit); |
60 | EXPORT_SYMBOL(find_next_bit); | 60 | EXPORT_SYMBOL(find_next_bit); |
61 | EXPORT_SYMBOL(generic_find_next_le_bit); | ||
61 | EXPORT_SYMBOL(generic_find_next_zero_le_bit); | 62 | EXPORT_SYMBOL(generic_find_next_zero_le_bit); |
62 | 63 | ||
63 | /* I/O primitives (lib/io-*.S) */ | 64 | /* I/O primitives (lib/io-*.S) */ |
diff --git a/arch/avr32/kernel/entry-avr32b.S b/arch/avr32/kernel/entry-avr32b.S index 2b398cae110c..33d49377b8be 100644 --- a/arch/avr32/kernel/entry-avr32b.S +++ b/arch/avr32/kernel/entry-avr32b.S | |||
@@ -334,9 +334,64 @@ save_full_context_ex: | |||
334 | 334 | ||
335 | /* Low-level exception handlers */ | 335 | /* Low-level exception handlers */ |
336 | handle_critical: | 336 | handle_critical: |
337 | /* | ||
338 | * AT32AP700x errata: | ||
339 | * | ||
340 | * After a Java stack overflow or underflow trap, any CPU | ||
341 | * memory access may cause erratic behavior. This will happen | ||
342 | * when the four least significant bits of the JOSP system | ||
343 | * register contains any value between 9 and 15 (inclusive). | ||
344 | * | ||
345 | * Possible workarounds: | ||
346 | * - Don't use the Java Extension Module | ||
347 | * - Ensure that the stack overflow and underflow trap | ||
348 | * handlers do not do any memory access or trigger any | ||
349 | * exceptions before the overflow/underflow condition is | ||
350 | * cleared (by incrementing or decrementing the JOSP) | ||
351 | * - Make sure that JOSP does not contain any problematic | ||
352 | * value before doing any exception or interrupt | ||
353 | * processing. | ||
354 | * - Set up a critical exception handler which writes a | ||
355 | * known-to-be-safe value, e.g. 4, to JOSP before doing | ||
356 | * any further processing. | ||
357 | * | ||
358 | * We'll use the last workaround for now since we cannot | ||
359 | * guarantee that user space processes don't use Java mode. | ||
360 | * Non-well-behaving userland will be terminated with extreme | ||
361 | * prejudice. | ||
362 | */ | ||
363 | #ifdef CONFIG_CPU_AT32AP700X | ||
364 | /* | ||
365 | * There's a chance we can't touch memory, so temporarily | ||
366 | * borrow PTBR to save the stack pointer while we fix things | ||
367 | * up... | ||
368 | */ | ||
369 | mtsr SYSREG_PTBR, sp | ||
370 | mov sp, 4 | ||
371 | mtsr SYSREG_JOSP, sp | ||
372 | mfsr sp, SYSREG_PTBR | ||
373 | sub pc, -2 | ||
374 | |||
375 | /* Push most of pt_regs on stack. We'll do the rest later */ | ||
337 | sub sp, 4 | 376 | sub sp, 4 |
338 | stmts --sp, r0-lr | 377 | pushm r0-r12 |
339 | rcall save_full_context_ex | 378 | |
379 | /* PTBR mirrors current_thread_info()->task->active_mm->pgd */ | ||
380 | get_thread_info r0 | ||
381 | ld.w r1, r0[TI_task] | ||
382 | ld.w r2, r1[TSK_active_mm] | ||
383 | ld.w r3, r2[MM_pgd] | ||
384 | mtsr SYSREG_PTBR, r3 | ||
385 | #else | ||
386 | sub sp, 4 | ||
387 | pushm r0-r12 | ||
388 | #endif | ||
389 | sub r0, sp, -(14 * 4) | ||
390 | mov r1, lr | ||
391 | mfsr r2, SYSREG_RAR_EX | ||
392 | mfsr r3, SYSREG_RSR_EX | ||
393 | pushm r0-r3 | ||
394 | |||
340 | mfsr r12, SYSREG_ECR | 395 | mfsr r12, SYSREG_ECR |
341 | mov r11, sp | 396 | mov r11, sp |
342 | rcall do_critical_exception | 397 | rcall do_critical_exception |
diff --git a/arch/avr32/kernel/process.c b/arch/avr32/kernel/process.c index 2c08ac992ac3..134d5302b6dd 100644 --- a/arch/avr32/kernel/process.c +++ b/arch/avr32/kernel/process.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/module.h> | 9 | #include <linux/module.h> |
10 | #include <linux/kallsyms.h> | 10 | #include <linux/kallsyms.h> |
11 | #include <linux/fs.h> | 11 | #include <linux/fs.h> |
12 | #include <linux/pm.h> | ||
12 | #include <linux/ptrace.h> | 13 | #include <linux/ptrace.h> |
13 | #include <linux/reboot.h> | 14 | #include <linux/reboot.h> |
14 | #include <linux/tick.h> | 15 | #include <linux/tick.h> |
@@ -20,7 +21,7 @@ | |||
20 | 21 | ||
21 | #include <mach/pm.h> | 22 | #include <mach/pm.h> |
22 | 23 | ||
23 | void (*pm_power_off)(void) = NULL; | 24 | void (*pm_power_off)(void); |
24 | EXPORT_SYMBOL(pm_power_off); | 25 | EXPORT_SYMBOL(pm_power_off); |
25 | 26 | ||
26 | /* | 27 | /* |
diff --git a/arch/avr32/kernel/setup.c b/arch/avr32/kernel/setup.c index d8e623c426c1..5c7083916c33 100644 --- a/arch/avr32/kernel/setup.c +++ b/arch/avr32/kernel/setup.c | |||
@@ -283,6 +283,25 @@ static int __init early_parse_fbmem(char *p) | |||
283 | } | 283 | } |
284 | early_param("fbmem", early_parse_fbmem); | 284 | early_param("fbmem", early_parse_fbmem); |
285 | 285 | ||
286 | /* | ||
287 | * Pick out the memory size. We look for mem=size@start, | ||
288 | * where start and size are "size[KkMmGg]" | ||
289 | */ | ||
290 | static int __init early_mem(char *p) | ||
291 | { | ||
292 | resource_size_t size, start; | ||
293 | |||
294 | start = system_ram->start; | ||
295 | size = memparse(p, &p); | ||
296 | if (*p == '@') | ||
297 | start = memparse(p + 1, &p); | ||
298 | |||
299 | system_ram->start = start; | ||
300 | system_ram->end = system_ram->start + size - 1; | ||
301 | return 0; | ||
302 | } | ||
303 | early_param("mem", early_mem); | ||
304 | |||
286 | static int __init parse_tag_core(struct tag *tag) | 305 | static int __init parse_tag_core(struct tag *tag) |
287 | { | 306 | { |
288 | if (tag->hdr.size > 2) { | 307 | if (tag->hdr.size > 2) { |
diff --git a/arch/avr32/kernel/syscall-stubs.S b/arch/avr32/kernel/syscall-stubs.S index 890286a1e62b..673178e235f3 100644 --- a/arch/avr32/kernel/syscall-stubs.S +++ b/arch/avr32/kernel/syscall-stubs.S | |||
@@ -109,3 +109,12 @@ __sys_epoll_pwait: | |||
109 | rcall sys_epoll_pwait | 109 | rcall sys_epoll_pwait |
110 | sub sp, -4 | 110 | sub sp, -4 |
111 | popm pc | 111 | popm pc |
112 | |||
113 | .global __sys_sync_file_range | ||
114 | .type __sys_sync_file_range,@function | ||
115 | __sys_sync_file_range: | ||
116 | pushm lr | ||
117 | st.w --sp, ARG6 | ||
118 | rcall sys_sync_file_range | ||
119 | sub sp, -4 | ||
120 | popm pc | ||
diff --git a/arch/avr32/kernel/syscall_table.S b/arch/avr32/kernel/syscall_table.S index 478bda4c4a09..7ee0057613b3 100644 --- a/arch/avr32/kernel/syscall_table.S +++ b/arch/avr32/kernel/syscall_table.S | |||
@@ -275,7 +275,7 @@ sys_call_table: | |||
275 | .long sys_set_robust_list | 275 | .long sys_set_robust_list |
276 | .long sys_get_robust_list /* 260 */ | 276 | .long sys_get_robust_list /* 260 */ |
277 | .long __sys_splice | 277 | .long __sys_splice |
278 | .long sys_sync_file_range | 278 | .long __sys_sync_file_range |
279 | .long sys_tee | 279 | .long sys_tee |
280 | .long sys_vmsplice | 280 | .long sys_vmsplice |
281 | .long __sys_epoll_pwait /* 265 */ | 281 | .long __sys_epoll_pwait /* 265 */ |
diff --git a/arch/avr32/kernel/traps.c b/arch/avr32/kernel/traps.c index b835c4c01368..0d987373bc01 100644 --- a/arch/avr32/kernel/traps.c +++ b/arch/avr32/kernel/traps.c | |||
@@ -116,15 +116,15 @@ asmlinkage void do_nmi(unsigned long ecr, struct pt_regs *regs) | |||
116 | switch (ret) { | 116 | switch (ret) { |
117 | case NOTIFY_OK: | 117 | case NOTIFY_OK: |
118 | case NOTIFY_STOP: | 118 | case NOTIFY_STOP: |
119 | return; | 119 | break; |
120 | case NOTIFY_BAD: | 120 | case NOTIFY_BAD: |
121 | die("Fatal Non-Maskable Interrupt", regs, SIGINT); | 121 | die("Fatal Non-Maskable Interrupt", regs, SIGINT); |
122 | default: | 122 | default: |
123 | printk(KERN_ALERT "Got NMI, but nobody cared. Disabling...\n"); | ||
124 | nmi_disable(); | ||
123 | break; | 125 | break; |
124 | } | 126 | } |
125 | 127 | nmi_exit(); | |
126 | printk(KERN_ALERT "Got NMI, but nobody cared. Disabling...\n"); | ||
127 | nmi_disable(); | ||
128 | } | 128 | } |
129 | 129 | ||
130 | asmlinkage void do_critical_exception(unsigned long ecr, struct pt_regs *regs) | 130 | asmlinkage void do_critical_exception(unsigned long ecr, struct pt_regs *regs) |