diff options
71 files changed, 685 insertions, 519 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 6e92ba61f7c0..914119309ddb 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -79,6 +79,7 @@ parameter is applicable: | |||
79 | Documentation/scsi/. | 79 | Documentation/scsi/. |
80 | SELINUX SELinux support is enabled. | 80 | SELINUX SELinux support is enabled. |
81 | SERIAL Serial support is enabled. | 81 | SERIAL Serial support is enabled. |
82 | SH SuperH architecture is enabled. | ||
82 | SMP The kernel is an SMP kernel. | 83 | SMP The kernel is an SMP kernel. |
83 | SPARC Sparc architecture is enabled. | 84 | SPARC Sparc architecture is enabled. |
84 | SWSUSP Software suspend is enabled. | 85 | SWSUSP Software suspend is enabled. |
@@ -485,7 +486,7 @@ and is between 256 and 4096 characters. It is defined in the file | |||
485 | 486 | ||
486 | dtc3181e= [HW,SCSI] | 487 | dtc3181e= [HW,SCSI] |
487 | 488 | ||
488 | earlyprintk= [IA-32,X86-64] | 489 | earlyprintk= [IA-32,X86-64,SH] |
489 | earlyprintk=vga | 490 | earlyprintk=vga |
490 | earlyprintk=serial[,ttySn[,baudrate]] | 491 | earlyprintk=serial[,ttySn[,baudrate]] |
491 | 492 | ||
@@ -1784,7 +1785,7 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1784 | usbhid.mousepoll= | 1785 | usbhid.mousepoll= |
1785 | [USBHID] The interval which mice are to be polled at. | 1786 | [USBHID] The interval which mice are to be polled at. |
1786 | 1787 | ||
1787 | vdso= [IA-32] | 1788 | vdso= [IA-32,SH] |
1788 | vdso=1: enable VDSO (default) | 1789 | vdso=1: enable VDSO (default) |
1789 | vdso=0: disable VDSO mapping | 1790 | vdso=0: disable VDSO mapping |
1790 | 1791 | ||
diff --git a/arch/arm/common/Kconfig b/arch/arm/common/Kconfig index 5e34ca6d38b6..3e073467caca 100644 --- a/arch/arm/common/Kconfig +++ b/arch/arm/common/Kconfig | |||
@@ -28,6 +28,7 @@ config SHARP_PARAM | |||
28 | 28 | ||
29 | config SHARPSL_PM | 29 | config SHARPSL_PM |
30 | bool | 30 | bool |
31 | select APM_EMULATION | ||
31 | 32 | ||
32 | config SHARP_SCOOP | 33 | config SHARP_SCOOP |
33 | bool | 34 | bool |
diff --git a/arch/arm/mach-ns9xxx/mach-cc9p9360dev.c b/arch/arm/mach-ns9xxx/mach-cc9p9360dev.c index a193dd931512..760c9d0db7c3 100644 --- a/arch/arm/mach-ns9xxx/mach-cc9p9360dev.c +++ b/arch/arm/mach-ns9xxx/mach-cc9p9360dev.c | |||
@@ -32,7 +32,7 @@ static void __init mach_cc9p9360dev_init_machine(void) | |||
32 | board_a9m9750dev_init_machine(); | 32 | board_a9m9750dev_init_machine(); |
33 | } | 33 | } |
34 | 34 | ||
35 | MACHINE_START(CC9P9360DEV, "Connect Core 9P 9360 on an A9M9750 Devboard") | 35 | MACHINE_START(CC9P9360DEV, "Digi ConnectCore 9P 9360 on an A9M9750 Devboard") |
36 | .map_io = mach_cc9p9360dev_map_io, | 36 | .map_io = mach_cc9p9360dev_map_io, |
37 | .init_irq = mach_cc9p9360dev_init_irq, | 37 | .init_irq = mach_cc9p9360dev_init_irq, |
38 | .init_machine = mach_cc9p9360dev_init_machine, | 38 | .init_machine = mach_cc9p9360dev_init_machine, |
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c index 7915a5a22865..72738771fb57 100644 --- a/arch/arm/mach-pxa/tosa.c +++ b/arch/arm/mach-pxa/tosa.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <asm/hardware.h> | 28 | #include <asm/hardware.h> |
29 | #include <asm/irq.h> | 29 | #include <asm/irq.h> |
30 | #include <asm/system.h> | 30 | #include <asm/system.h> |
31 | #include <asm/arch/pxa-regs.h> | ||
31 | #include <asm/arch/irda.h> | 32 | #include <asm/arch/irda.h> |
32 | #include <asm/arch/mmc.h> | 33 | #include <asm/arch/mmc.h> |
33 | #include <asm/arch/udc.h> | 34 | #include <asm/arch/udc.h> |
@@ -35,8 +36,6 @@ | |||
35 | #include <asm/mach/arch.h> | 36 | #include <asm/mach/arch.h> |
36 | #include <asm/mach/map.h> | 37 | #include <asm/mach/map.h> |
37 | #include <asm/mach/irq.h> | 38 | #include <asm/mach/irq.h> |
38 | |||
39 | #include <asm/arch/pxa-regs.h> | ||
40 | #include <asm/arch/tosa.h> | 39 | #include <asm/arch/tosa.h> |
41 | 40 | ||
42 | #include <asm/hardware/scoop.h> | 41 | #include <asm/hardware/scoop.h> |
diff --git a/arch/avr32/kernel/ptrace.c b/arch/avr32/kernel/ptrace.c index f2e81cd79002..6f4388f7c20b 100644 --- a/arch/avr32/kernel/ptrace.c +++ b/arch/avr32/kernel/ptrace.c | |||
@@ -313,7 +313,7 @@ asmlinkage void do_debug_priv(struct pt_regs *regs) | |||
313 | __mtdr(DBGREG_DC, dc); | 313 | __mtdr(DBGREG_DC, dc); |
314 | 314 | ||
315 | ti = current_thread_info(); | 315 | ti = current_thread_info(); |
316 | ti->flags |= _TIF_BREAKPOINT; | 316 | set_ti_thread_flag(ti, TIF_BREAKPOINT); |
317 | 317 | ||
318 | /* The TLB miss handlers don't check thread flags */ | 318 | /* The TLB miss handlers don't check thread flags */ |
319 | if ((regs->pc >= (unsigned long)&itlb_miss) | 319 | if ((regs->pc >= (unsigned long)&itlb_miss) |
@@ -328,7 +328,7 @@ asmlinkage void do_debug_priv(struct pt_regs *regs) | |||
328 | * single step. | 328 | * single step. |
329 | */ | 329 | */ |
330 | if ((regs->sr & MODE_MASK) != MODE_SUPERVISOR) | 330 | if ((regs->sr & MODE_MASK) != MODE_SUPERVISOR) |
331 | ti->flags |= TIF_SINGLE_STEP; | 331 | set_ti_thread_flag(ti, TIF_SINGLE_STEP); |
332 | } else { | 332 | } else { |
333 | panic("Unable to handle debug trap at pc = %08lx\n", | 333 | panic("Unable to handle debug trap at pc = %08lx\n", |
334 | regs->pc); | 334 | regs->pc); |
diff --git a/arch/avr32/kernel/traps.c b/arch/avr32/kernel/traps.c index 7e803f4d7a12..adc01a12d154 100644 --- a/arch/avr32/kernel/traps.c +++ b/arch/avr32/kernel/traps.c | |||
@@ -49,39 +49,45 @@ out: | |||
49 | return; | 49 | return; |
50 | } | 50 | } |
51 | 51 | ||
52 | static inline int valid_stack_ptr(struct thread_info *tinfo, unsigned long p) | ||
53 | { | ||
54 | return (p > (unsigned long)tinfo) | ||
55 | && (p < (unsigned long)tinfo + THREAD_SIZE - 3); | ||
56 | } | ||
57 | |||
52 | #ifdef CONFIG_FRAME_POINTER | 58 | #ifdef CONFIG_FRAME_POINTER |
53 | static inline void __show_trace(struct task_struct *tsk, unsigned long *sp, | 59 | static inline void __show_trace(struct task_struct *tsk, unsigned long *sp, |
54 | struct pt_regs *regs) | 60 | struct pt_regs *regs) |
55 | { | 61 | { |
56 | unsigned long __user *fp; | 62 | unsigned long lr, fp; |
57 | unsigned long __user *last_fp = NULL; | 63 | struct thread_info *tinfo; |
58 | 64 | ||
59 | if (regs) { | 65 | tinfo = (struct thread_info *) |
60 | fp = (unsigned long __user *)regs->r7; | 66 | ((unsigned long)sp & ~(THREAD_SIZE - 1)); |
61 | } else if (tsk == current) { | 67 | |
62 | register unsigned long __user *real_fp __asm__("r7"); | 68 | if (regs) |
63 | fp = real_fp; | 69 | fp = regs->r7; |
64 | } else { | 70 | else if (tsk == current) |
65 | fp = (unsigned long __user *)tsk->thread.cpu_context.r7; | 71 | asm("mov %0, r7" : "=r"(fp)); |
66 | } | 72 | else |
73 | fp = tsk->thread.cpu_context.r7; | ||
67 | 74 | ||
68 | /* | 75 | /* |
69 | * Walk the stack until (a) we get an exception, (b) the frame | 76 | * Walk the stack as long as the frame pointer (a) is within |
70 | * pointer becomes zero, or (c) the frame pointer gets stuck | 77 | * the kernel stack of the task, and (b) it doesn't move |
71 | * at the same value. | 78 | * downwards. |
72 | */ | 79 | */ |
73 | while (fp && fp != last_fp) { | 80 | while (valid_stack_ptr(tinfo, fp)) { |
74 | unsigned long lr, new_fp = 0; | 81 | unsigned long new_fp; |
75 | |||
76 | last_fp = fp; | ||
77 | if (__get_user(lr, fp)) | ||
78 | break; | ||
79 | if (fp && __get_user(new_fp, fp + 1)) | ||
80 | break; | ||
81 | fp = (unsigned long __user *)new_fp; | ||
82 | 82 | ||
83 | lr = *(unsigned long *)fp; | ||
83 | printk(" [<%08lx>] ", lr); | 84 | printk(" [<%08lx>] ", lr); |
84 | print_symbol("%s\n", lr); | 85 | print_symbol("%s\n", lr); |
86 | |||
87 | new_fp = *(unsigned long *)(fp + 4); | ||
88 | if (new_fp <= fp) | ||
89 | break; | ||
90 | fp = new_fp; | ||
85 | } | 91 | } |
86 | printk("\n"); | 92 | printk("\n"); |
87 | } | 93 | } |
diff --git a/arch/avr32/mach-at32ap/at32ap7000.c b/arch/avr32/mach-at32ap/at32ap7000.c index bc235507c5c7..472703f90c22 100644 --- a/arch/avr32/mach-at32ap/at32ap7000.c +++ b/arch/avr32/mach-at32ap/at32ap7000.c | |||
@@ -752,7 +752,7 @@ static struct resource atmel_spi1_resource[] = { | |||
752 | DEFINE_DEV(atmel_spi, 1); | 752 | DEFINE_DEV(atmel_spi, 1); |
753 | DEV_CLK(spi_clk, atmel_spi1, pba, 1); | 753 | DEV_CLK(spi_clk, atmel_spi1, pba, 1); |
754 | 754 | ||
755 | static void | 755 | static void __init |
756 | at32_spi_setup_slaves(unsigned int bus_num, struct spi_board_info *b, | 756 | at32_spi_setup_slaves(unsigned int bus_num, struct spi_board_info *b, |
757 | unsigned int n, const u8 *pins) | 757 | unsigned int n, const u8 *pins) |
758 | { | 758 | { |
diff --git a/arch/avr32/mm/cache.c b/arch/avr32/mm/cache.c index fb13f72e9a02..8f7b1c3cd0f9 100644 --- a/arch/avr32/mm/cache.c +++ b/arch/avr32/mm/cache.c | |||
@@ -121,9 +121,8 @@ void flush_icache_range(unsigned long start, unsigned long end) | |||
121 | void flush_icache_page(struct vm_area_struct *vma, struct page *page) | 121 | void flush_icache_page(struct vm_area_struct *vma, struct page *page) |
122 | { | 122 | { |
123 | if (vma->vm_flags & VM_EXEC) { | 123 | if (vma->vm_flags & VM_EXEC) { |
124 | void *v = kmap(page); | 124 | void *v = page_address(page); |
125 | __flush_icache_range((unsigned long)v, (unsigned long)v + PAGE_SIZE); | 125 | __flush_icache_range((unsigned long)v, (unsigned long)v + PAGE_SIZE); |
126 | kunmap(v); | ||
127 | } | 126 | } |
128 | } | 127 | } |
129 | 128 | ||
diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c index 9b0dd2744c82..4ff55e675576 100644 --- a/arch/i386/kernel/smpboot.c +++ b/arch/i386/kernel/smpboot.c | |||
@@ -45,6 +45,7 @@ | |||
45 | #include <linux/notifier.h> | 45 | #include <linux/notifier.h> |
46 | #include <linux/cpu.h> | 46 | #include <linux/cpu.h> |
47 | #include <linux/percpu.h> | 47 | #include <linux/percpu.h> |
48 | #include <linux/nmi.h> | ||
48 | 49 | ||
49 | #include <linux/delay.h> | 50 | #include <linux/delay.h> |
50 | #include <linux/mc146818rtc.h> | 51 | #include <linux/mc146818rtc.h> |
@@ -1278,8 +1279,9 @@ void __cpu_die(unsigned int cpu) | |||
1278 | 1279 | ||
1279 | int __cpuinit __cpu_up(unsigned int cpu) | 1280 | int __cpuinit __cpu_up(unsigned int cpu) |
1280 | { | 1281 | { |
1282 | unsigned long flags; | ||
1281 | #ifdef CONFIG_HOTPLUG_CPU | 1283 | #ifdef CONFIG_HOTPLUG_CPU |
1282 | int ret=0; | 1284 | int ret = 0; |
1283 | 1285 | ||
1284 | /* | 1286 | /* |
1285 | * We do warm boot only on cpus that had booted earlier | 1287 | * We do warm boot only on cpus that had booted earlier |
@@ -1297,23 +1299,25 @@ int __cpuinit __cpu_up(unsigned int cpu) | |||
1297 | /* In case one didn't come up */ | 1299 | /* In case one didn't come up */ |
1298 | if (!cpu_isset(cpu, cpu_callin_map)) { | 1300 | if (!cpu_isset(cpu, cpu_callin_map)) { |
1299 | printk(KERN_DEBUG "skipping cpu%d, didn't come online\n", cpu); | 1301 | printk(KERN_DEBUG "skipping cpu%d, didn't come online\n", cpu); |
1300 | local_irq_enable(); | ||
1301 | return -EIO; | 1302 | return -EIO; |
1302 | } | 1303 | } |
1303 | 1304 | ||
1304 | local_irq_enable(); | ||
1305 | |||
1306 | per_cpu(cpu_state, cpu) = CPU_UP_PREPARE; | 1305 | per_cpu(cpu_state, cpu) = CPU_UP_PREPARE; |
1307 | /* Unleash the CPU! */ | 1306 | /* Unleash the CPU! */ |
1308 | cpu_set(cpu, smp_commenced_mask); | 1307 | cpu_set(cpu, smp_commenced_mask); |
1309 | 1308 | ||
1310 | /* | 1309 | /* |
1311 | * Check TSC synchronization with the AP: | 1310 | * Check TSC synchronization with the AP (keep irqs disabled |
1311 | * while doing so): | ||
1312 | */ | 1312 | */ |
1313 | local_irq_save(flags); | ||
1313 | check_tsc_sync_source(cpu); | 1314 | check_tsc_sync_source(cpu); |
1315 | local_irq_restore(flags); | ||
1314 | 1316 | ||
1315 | while (!cpu_isset(cpu, cpu_online_map)) | 1317 | while (!cpu_isset(cpu, cpu_online_map)) { |
1316 | cpu_relax(); | 1318 | cpu_relax(); |
1319 | touch_nmi_watchdog(); | ||
1320 | } | ||
1317 | 1321 | ||
1318 | #ifdef CONFIG_X86_GENERICARCH | 1322 | #ifdef CONFIG_X86_GENERICARCH |
1319 | if (num_online_cpus() > 8 && genapic == &apic_default) | 1323 | if (num_online_cpus() > 8 && genapic == &apic_default) |
diff --git a/arch/ia64/kernel/asm-offsets.c b/arch/ia64/kernel/asm-offsets.c index 75a2a2c12258..2236fabbb3c6 100644 --- a/arch/ia64/kernel/asm-offsets.c +++ b/arch/ia64/kernel/asm-offsets.c | |||
@@ -35,6 +35,7 @@ void foo(void) | |||
35 | BLANK(); | 35 | BLANK(); |
36 | 36 | ||
37 | DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); | 37 | DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); |
38 | DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); | ||
38 | DEFINE(TI_PRE_COUNT, offsetof(struct thread_info, preempt_count)); | 39 | DEFINE(TI_PRE_COUNT, offsetof(struct thread_info, preempt_count)); |
39 | 40 | ||
40 | BLANK(); | 41 | BLANK(); |
diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c index 4061593e5b17..49b93682c752 100644 --- a/arch/ia64/kernel/efi.c +++ b/arch/ia64/kernel/efi.c | |||
@@ -971,6 +971,11 @@ efi_memmap_init(unsigned long *s, unsigned long *e) | |||
971 | if (!is_memory_available(md)) | 971 | if (!is_memory_available(md)) |
972 | continue; | 972 | continue; |
973 | 973 | ||
974 | #ifdef CONFIG_CRASH_DUMP | ||
975 | /* saved_max_pfn should ignore max_addr= command line arg */ | ||
976 | if (saved_max_pfn < (efi_md_end(md) >> PAGE_SHIFT)) | ||
977 | saved_max_pfn = (efi_md_end(md) >> PAGE_SHIFT); | ||
978 | #endif | ||
974 | /* | 979 | /* |
975 | * Round ends inward to granule boundaries | 980 | * Round ends inward to granule boundaries |
976 | * Give trimmings to uncached allocator | 981 | * Give trimmings to uncached allocator |
@@ -1010,11 +1015,6 @@ efi_memmap_init(unsigned long *s, unsigned long *e) | |||
1010 | } else | 1015 | } else |
1011 | ae = efi_md_end(md); | 1016 | ae = efi_md_end(md); |
1012 | 1017 | ||
1013 | #ifdef CONFIG_CRASH_DUMP | ||
1014 | /* saved_max_pfn should ignore max_addr= command line arg */ | ||
1015 | if (saved_max_pfn < (ae >> PAGE_SHIFT)) | ||
1016 | saved_max_pfn = (ae >> PAGE_SHIFT); | ||
1017 | #endif | ||
1018 | /* keep within max_addr= and min_addr= command line arg */ | 1018 | /* keep within max_addr= and min_addr= command line arg */ |
1019 | as = max(as, min_addr); | 1019 | as = max(as, min_addr); |
1020 | ae = min(ae, max_addr); | 1020 | ae = min(ae, max_addr); |
diff --git a/arch/ia64/kernel/fsys.S b/arch/ia64/kernel/fsys.S index 7a05b1cb2ad5..8589e84a27c6 100644 --- a/arch/ia64/kernel/fsys.S +++ b/arch/ia64/kernel/fsys.S | |||
@@ -10,6 +10,8 @@ | |||
10 | * probably broke it along the way... ;-) | 10 | * probably broke it along the way... ;-) |
11 | * 13-Jul-04 clameter Implement fsys_clock_gettime and revise fsys_gettimeofday to make | 11 | * 13-Jul-04 clameter Implement fsys_clock_gettime and revise fsys_gettimeofday to make |
12 | * it capable of using memory based clocks without falling back to C code. | 12 | * it capable of using memory based clocks without falling back to C code. |
13 | * 08-Feb-07 Fenghua Yu Implement fsys_getcpu. | ||
14 | * | ||
13 | */ | 15 | */ |
14 | 16 | ||
15 | #include <asm/asmmacro.h> | 17 | #include <asm/asmmacro.h> |
@@ -505,6 +507,59 @@ EX(.fail_efault, (p15) st8 [r34]=r3) | |||
505 | #endif | 507 | #endif |
506 | END(fsys_rt_sigprocmask) | 508 | END(fsys_rt_sigprocmask) |
507 | 509 | ||
510 | /* | ||
511 | * fsys_getcpu doesn't use the third parameter in this implementation. It reads | ||
512 | * current_thread_info()->cpu and corresponding node in cpu_to_node_map. | ||
513 | */ | ||
514 | ENTRY(fsys_getcpu) | ||
515 | .prologue | ||
516 | .altrp b6 | ||
517 | .body | ||
518 | ;; | ||
519 | add r2=TI_FLAGS+IA64_TASK_SIZE,r16 | ||
520 | tnat.nz p6,p0 = r32 // guard against NaT argument | ||
521 | add r3=TI_CPU+IA64_TASK_SIZE,r16 | ||
522 | ;; | ||
523 | ld4 r3=[r3] // M r3 = thread_info->cpu | ||
524 | ld4 r2=[r2] // M r2 = thread_info->flags | ||
525 | (p6) br.cond.spnt.few .fail_einval // B | ||
526 | ;; | ||
527 | tnat.nz p7,p0 = r33 // I guard against NaT argument | ||
528 | (p7) br.cond.spnt.few .fail_einval // B | ||
529 | #ifdef CONFIG_NUMA | ||
530 | movl r17=cpu_to_node_map | ||
531 | ;; | ||
532 | EX(.fail_efault, probe.w.fault r32, 3) // M This takes 5 cycles | ||
533 | EX(.fail_efault, probe.w.fault r33, 3) // M This takes 5 cycles | ||
534 | shladd r18=r3,1,r17 | ||
535 | ;; | ||
536 | ld2 r20=[r18] // r20 = cpu_to_node_map[cpu] | ||
537 | and r2 = TIF_ALLWORK_MASK,r2 | ||
538 | ;; | ||
539 | cmp.ne p8,p0=0,r2 | ||
540 | (p8) br.spnt.many fsys_fallback_syscall | ||
541 | ;; | ||
542 | ;; | ||
543 | EX(.fail_efault, st4 [r32] = r3) | ||
544 | EX(.fail_efault, st2 [r33] = r20) | ||
545 | mov r8=0 | ||
546 | ;; | ||
547 | #else | ||
548 | EX(.fail_efault, probe.w.fault r32, 3) // M This takes 5 cycles | ||
549 | EX(.fail_efault, probe.w.fault r33, 3) // M This takes 5 cycles | ||
550 | and r2 = TIF_ALLWORK_MASK,r2 | ||
551 | ;; | ||
552 | cmp.ne p8,p0=0,r2 | ||
553 | (p8) br.spnt.many fsys_fallback_syscall | ||
554 | ;; | ||
555 | EX(.fail_efault, st4 [r32] = r3) | ||
556 | EX(.fail_efault, st2 [r33] = r0) | ||
557 | mov r8=0 | ||
558 | ;; | ||
559 | #endif | ||
560 | FSYS_RETURN | ||
561 | END(fsys_getcpu) | ||
562 | |||
508 | ENTRY(fsys_fallback_syscall) | 563 | ENTRY(fsys_fallback_syscall) |
509 | .prologue | 564 | .prologue |
510 | .altrp b6 | 565 | .altrp b6 |
@@ -878,6 +933,56 @@ fsyscall_table: | |||
878 | data8 0 // timer_delete | 933 | data8 0 // timer_delete |
879 | data8 0 // clock_settime | 934 | data8 0 // clock_settime |
880 | data8 fsys_clock_gettime // clock_gettime | 935 | data8 fsys_clock_gettime // clock_gettime |
936 | data8 0 // clock_getres // 1255 | ||
937 | data8 0 // clock_nanosleep | ||
938 | data8 0 // fstatfs64 | ||
939 | data8 0 // statfs64 | ||
940 | data8 0 // mbind | ||
941 | data8 0 // get_mempolicy // 1260 | ||
942 | data8 0 // set_mempolicy | ||
943 | data8 0 // mq_open | ||
944 | data8 0 // mq_unlink | ||
945 | data8 0 // mq_timedsend | ||
946 | data8 0 // mq_timedreceive // 1265 | ||
947 | data8 0 // mq_notify | ||
948 | data8 0 // mq_getsetattr | ||
949 | data8 0 // kexec_load | ||
950 | data8 0 // vserver | ||
951 | data8 0 // waitid // 1270 | ||
952 | data8 0 // add_key | ||
953 | data8 0 // request_key | ||
954 | data8 0 // keyctl | ||
955 | data8 0 // ioprio_set | ||
956 | data8 0 // ioprio_get // 1275 | ||
957 | data8 0 // move_pages | ||
958 | data8 0 // inotify_init | ||
959 | data8 0 // inotify_add_watch | ||
960 | data8 0 // inotify_rm_watch | ||
961 | data8 0 // migrate_pages // 1280 | ||
962 | data8 0 // openat | ||
963 | data8 0 // mkdirat | ||
964 | data8 0 // mknodat | ||
965 | data8 0 // fchownat | ||
966 | data8 0 // futimesat // 1285 | ||
967 | data8 0 // newfstatat | ||
968 | data8 0 // unlinkat | ||
969 | data8 0 // renameat | ||
970 | data8 0 // linkat | ||
971 | data8 0 // symlinkat // 1290 | ||
972 | data8 0 // readlinkat | ||
973 | data8 0 // fchmodat | ||
974 | data8 0 // faccessat | ||
975 | data8 0 | ||
976 | data8 0 // 1295 | ||
977 | data8 0 // unshare | ||
978 | data8 0 // splice | ||
979 | data8 0 // set_robust_list | ||
980 | data8 0 // get_robust_list | ||
981 | data8 0 // sync_file_range // 1300 | ||
982 | data8 0 // tee | ||
983 | data8 0 // vmsplice | ||
984 | data8 0 | ||
985 | data8 fsys_getcpu // getcpu // 1304 | ||
881 | 986 | ||
882 | // fill in zeros for the remaining entries | 987 | // fill in zeros for the remaining entries |
883 | .zero: | 988 | .zero: |
diff --git a/arch/ia64/kernel/iosapic.c b/arch/ia64/kernel/iosapic.c index d6aab40c6416..dcfbf3e7a9ef 100644 --- a/arch/ia64/kernel/iosapic.c +++ b/arch/ia64/kernel/iosapic.c | |||
@@ -446,7 +446,7 @@ iosapic_end_level_irq (unsigned int irq) | |||
446 | #define iosapic_disable_level_irq mask_irq | 446 | #define iosapic_disable_level_irq mask_irq |
447 | #define iosapic_ack_level_irq nop | 447 | #define iosapic_ack_level_irq nop |
448 | 448 | ||
449 | struct hw_interrupt_type irq_type_iosapic_level = { | 449 | struct irq_chip irq_type_iosapic_level = { |
450 | .name = "IO-SAPIC-level", | 450 | .name = "IO-SAPIC-level", |
451 | .startup = iosapic_startup_level_irq, | 451 | .startup = iosapic_startup_level_irq, |
452 | .shutdown = iosapic_shutdown_level_irq, | 452 | .shutdown = iosapic_shutdown_level_irq, |
@@ -454,6 +454,8 @@ struct hw_interrupt_type irq_type_iosapic_level = { | |||
454 | .disable = iosapic_disable_level_irq, | 454 | .disable = iosapic_disable_level_irq, |
455 | .ack = iosapic_ack_level_irq, | 455 | .ack = iosapic_ack_level_irq, |
456 | .end = iosapic_end_level_irq, | 456 | .end = iosapic_end_level_irq, |
457 | .mask = mask_irq, | ||
458 | .unmask = unmask_irq, | ||
457 | .set_affinity = iosapic_set_affinity | 459 | .set_affinity = iosapic_set_affinity |
458 | }; | 460 | }; |
459 | 461 | ||
@@ -493,7 +495,7 @@ iosapic_ack_edge_irq (unsigned int irq) | |||
493 | #define iosapic_disable_edge_irq nop | 495 | #define iosapic_disable_edge_irq nop |
494 | #define iosapic_end_edge_irq nop | 496 | #define iosapic_end_edge_irq nop |
495 | 497 | ||
496 | struct hw_interrupt_type irq_type_iosapic_edge = { | 498 | struct irq_chip irq_type_iosapic_edge = { |
497 | .name = "IO-SAPIC-edge", | 499 | .name = "IO-SAPIC-edge", |
498 | .startup = iosapic_startup_edge_irq, | 500 | .startup = iosapic_startup_edge_irq, |
499 | .shutdown = iosapic_disable_edge_irq, | 501 | .shutdown = iosapic_disable_edge_irq, |
@@ -501,6 +503,8 @@ struct hw_interrupt_type irq_type_iosapic_edge = { | |||
501 | .disable = iosapic_disable_edge_irq, | 503 | .disable = iosapic_disable_edge_irq, |
502 | .ack = iosapic_ack_edge_irq, | 504 | .ack = iosapic_ack_edge_irq, |
503 | .end = iosapic_end_edge_irq, | 505 | .end = iosapic_end_edge_irq, |
506 | .mask = mask_irq, | ||
507 | .unmask = unmask_irq, | ||
504 | .set_affinity = iosapic_set_affinity | 508 | .set_affinity = iosapic_set_affinity |
505 | }; | 509 | }; |
506 | 510 | ||
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c index 7d6fe65c93f4..339e8a54c2f1 100644 --- a/arch/ia64/kernel/setup.c +++ b/arch/ia64/kernel/setup.c | |||
@@ -91,8 +91,6 @@ static struct resource code_resource = { | |||
91 | .name = "Kernel code", | 91 | .name = "Kernel code", |
92 | .flags = IORESOURCE_BUSY | IORESOURCE_MEM | 92 | .flags = IORESOURCE_BUSY | IORESOURCE_MEM |
93 | }; | 93 | }; |
94 | extern void efi_initialize_iomem_resources(struct resource *, | ||
95 | struct resource *); | ||
96 | extern char _text[], _end[], _etext[]; | 94 | extern char _text[], _end[], _etext[]; |
97 | 95 | ||
98 | unsigned long ia64_max_cacheline_size; | 96 | unsigned long ia64_max_cacheline_size; |
diff --git a/arch/ia64/sn/kernel/irq.c b/arch/ia64/sn/kernel/irq.c index 8c5bee01eaa2..8d2a1bfbfe7c 100644 --- a/arch/ia64/sn/kernel/irq.c +++ b/arch/ia64/sn/kernel/irq.c | |||
@@ -205,7 +205,17 @@ static void sn_set_affinity_irq(unsigned int irq, cpumask_t mask) | |||
205 | (void)sn_retarget_vector(sn_irq_info, nasid, slice); | 205 | (void)sn_retarget_vector(sn_irq_info, nasid, slice); |
206 | } | 206 | } |
207 | 207 | ||
208 | struct hw_interrupt_type irq_type_sn = { | 208 | static void |
209 | sn_mask_irq(unsigned int irq) | ||
210 | { | ||
211 | } | ||
212 | |||
213 | static void | ||
214 | sn_unmask_irq(unsigned int irq) | ||
215 | { | ||
216 | } | ||
217 | |||
218 | struct irq_chip irq_type_sn = { | ||
209 | .name = "SN hub", | 219 | .name = "SN hub", |
210 | .startup = sn_startup_irq, | 220 | .startup = sn_startup_irq, |
211 | .shutdown = sn_shutdown_irq, | 221 | .shutdown = sn_shutdown_irq, |
@@ -213,6 +223,8 @@ struct hw_interrupt_type irq_type_sn = { | |||
213 | .disable = sn_disable_irq, | 223 | .disable = sn_disable_irq, |
214 | .ack = sn_ack_irq, | 224 | .ack = sn_ack_irq, |
215 | .end = sn_end_irq, | 225 | .end = sn_end_irq, |
226 | .mask = sn_mask_irq, | ||
227 | .unmask = sn_unmask_irq, | ||
216 | .set_affinity = sn_set_affinity_irq | 228 | .set_affinity = sn_set_affinity_irq |
217 | }; | 229 | }; |
218 | 230 | ||
diff --git a/arch/mips/arc/init.c b/arch/mips/arc/init.c index 0ac8f42d3752..e2f75b13312f 100644 --- a/arch/mips/arc/init.c +++ b/arch/mips/arc/init.c | |||
@@ -23,16 +23,16 @@ LONG *_prom_argv, *_prom_envp; | |||
23 | void __init prom_init(void) | 23 | void __init prom_init(void) |
24 | { | 24 | { |
25 | PSYSTEM_PARAMETER_BLOCK pb = PROMBLOCK; | 25 | PSYSTEM_PARAMETER_BLOCK pb = PROMBLOCK; |
26 | |||
26 | romvec = ROMVECTOR; | 27 | romvec = ROMVECTOR; |
27 | ULONG cnt; | ||
28 | CHAR c; | ||
29 | 28 | ||
30 | prom_argc = fw_arg0; | 29 | prom_argc = fw_arg0; |
31 | _prom_argv = (LONG *) fw_arg1; | 30 | _prom_argv = (LONG *) fw_arg1; |
32 | _prom_envp = (LONG *) fw_arg2; | 31 | _prom_envp = (LONG *) fw_arg2; |
33 | 32 | ||
34 | if (pb->magic != 0x53435241) { | 33 | if (pb->magic != 0x53435241) { |
35 | printk(KERN_CRIT "Aieee, bad prom vector magic %08lx\n", pb->magic); | 34 | printk(KERN_CRIT "Aieee, bad prom vector magic %08lx\n", |
35 | (unsigned long) pb->magic); | ||
36 | while(1) | 36 | while(1) |
37 | ; | 37 | ; |
38 | } | 38 | } |
diff --git a/arch/sh/boards/renesas/r7780rp/Makefile b/arch/sh/boards/renesas/r7780rp/Makefile index 3c93012e91a3..ed5f5a9a3b3e 100644 --- a/arch/sh/boards/renesas/r7780rp/Makefile +++ b/arch/sh/boards/renesas/r7780rp/Makefile | |||
@@ -2,6 +2,6 @@ | |||
2 | # Makefile for the R7780RP-1 specific parts of the kernel | 2 | # Makefile for the R7780RP-1 specific parts of the kernel |
3 | # | 3 | # |
4 | 4 | ||
5 | obj-y := setup.o io.o irq.o | 5 | obj-y := setup.o irq.o |
6 | 6 | ||
7 | obj-$(CONFIG_PUSH_SWITCH) += psw.o | 7 | obj-$(CONFIG_PUSH_SWITCH) += psw.o |
diff --git a/arch/sh/boards/renesas/r7780rp/io.c b/arch/sh/boards/renesas/r7780rp/io.c deleted file mode 100644 index f74d2ffb3851..000000000000 --- a/arch/sh/boards/renesas/r7780rp/io.c +++ /dev/null | |||
@@ -1,233 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2001 Ian da Silva, Jeremy Siegel | ||
3 | * Based largely on io_se.c. | ||
4 | * | ||
5 | * I/O routine for Renesas Solutions Highlander R7780RP-1 | ||
6 | * | ||
7 | * Initial version only to support LAN access; some | ||
8 | * placeholder code from io_r7780rp.c left in with the | ||
9 | * expectation of later SuperIO and PCMCIA access. | ||
10 | */ | ||
11 | #include <linux/pci.h> | ||
12 | #include <linux/kernel.h> | ||
13 | #include <linux/types.h> | ||
14 | #include <linux/io.h> | ||
15 | #include <asm/r7780rp.h> | ||
16 | #include <asm/addrspace.h> | ||
17 | |||
18 | static inline unsigned long port88796l(unsigned int port, int flag) | ||
19 | { | ||
20 | unsigned long addr; | ||
21 | |||
22 | if (flag) | ||
23 | addr = PA_AX88796L + ((port - AX88796L_IO_BASE) << 1); | ||
24 | else | ||
25 | addr = PA_AX88796L + ((port - AX88796L_IO_BASE) << 1) + 0x1000; | ||
26 | |||
27 | return addr; | ||
28 | } | ||
29 | |||
30 | #if defined(CONFIG_NE2000) || defined(CONFIG_NE2000_MODULE) | ||
31 | #define CHECK_AX88796L_PORT(port) \ | ||
32 | ((port >= AX88796L_IO_BASE) && (port < (AX88796L_IO_BASE+0x20))) | ||
33 | #else | ||
34 | #define CHECK_AX88796L_PORT(port) (0) | ||
35 | #endif | ||
36 | |||
37 | /* | ||
38 | * General outline: remap really low stuff [eventually] to SuperIO, | ||
39 | * stuff in PCI IO space (at or above window at pci.h:PCIBIOS_MIN_IO) | ||
40 | * is mapped through the PCI IO window. Stuff with high bits (PXSEG) | ||
41 | * should be way beyond the window, and is used w/o translation for | ||
42 | * compatibility. | ||
43 | */ | ||
44 | u8 r7780rp_inb(unsigned long port) | ||
45 | { | ||
46 | if (CHECK_AX88796L_PORT(port)) | ||
47 | return ctrl_inw(port88796l(port, 0)) & 0xff; | ||
48 | else if (is_pci_ioaddr(port)) | ||
49 | return ctrl_inb(pci_ioaddr(port)); | ||
50 | |||
51 | return ctrl_inw(port) & 0xff; | ||
52 | } | ||
53 | |||
54 | u8 r7780rp_inb_p(unsigned long port) | ||
55 | { | ||
56 | u8 v; | ||
57 | |||
58 | if (CHECK_AX88796L_PORT(port)) | ||
59 | v = ctrl_inw(port88796l(port, 0)) & 0xff; | ||
60 | else if (is_pci_ioaddr(port)) | ||
61 | v = ctrl_inb(pci_ioaddr(port)); | ||
62 | else | ||
63 | v = ctrl_inw(port) & 0xff; | ||
64 | |||
65 | ctrl_delay(); | ||
66 | |||
67 | return v; | ||
68 | } | ||
69 | |||
70 | u16 r7780rp_inw(unsigned long port) | ||
71 | { | ||
72 | if (is_pci_ioaddr(port)) | ||
73 | return ctrl_inw(pci_ioaddr(port)); | ||
74 | |||
75 | return ctrl_inw(port); | ||
76 | } | ||
77 | |||
78 | u32 r7780rp_inl(unsigned long port) | ||
79 | { | ||
80 | if (is_pci_ioaddr(port)) | ||
81 | return ctrl_inl(pci_ioaddr(port)); | ||
82 | |||
83 | return ctrl_inl(port); | ||
84 | } | ||
85 | |||
86 | void r7780rp_outb(u8 value, unsigned long port) | ||
87 | { | ||
88 | if (CHECK_AX88796L_PORT(port)) | ||
89 | ctrl_outw(value, port88796l(port, 0)); | ||
90 | else if (is_pci_ioaddr(port)) | ||
91 | ctrl_outb(value, pci_ioaddr(port)); | ||
92 | else | ||
93 | ctrl_outb(value, port); | ||
94 | } | ||
95 | |||
96 | void r7780rp_outb_p(u8 value, unsigned long port) | ||
97 | { | ||
98 | if (CHECK_AX88796L_PORT(port)) | ||
99 | ctrl_outw(value, port88796l(port, 0)); | ||
100 | else if (is_pci_ioaddr(port)) | ||
101 | ctrl_outb(value, pci_ioaddr(port)); | ||
102 | else | ||
103 | ctrl_outb(value, port); | ||
104 | |||
105 | ctrl_delay(); | ||
106 | } | ||
107 | |||
108 | void r7780rp_outw(u16 value, unsigned long port) | ||
109 | { | ||
110 | if (is_pci_ioaddr(port)) | ||
111 | ctrl_outw(value, pci_ioaddr(port)); | ||
112 | else | ||
113 | ctrl_outw(value, port); | ||
114 | } | ||
115 | |||
116 | void r7780rp_outl(u32 value, unsigned long port) | ||
117 | { | ||
118 | if (is_pci_ioaddr(port)) | ||
119 | ctrl_outl(value, pci_ioaddr(port)); | ||
120 | else | ||
121 | ctrl_outl(value, port); | ||
122 | } | ||
123 | |||
124 | void r7780rp_insb(unsigned long port, void *dst, unsigned long count) | ||
125 | { | ||
126 | volatile u16 *p; | ||
127 | u8 *buf = dst; | ||
128 | |||
129 | if (CHECK_AX88796L_PORT(port)) { | ||
130 | p = (volatile u16 *)port88796l(port, 0); | ||
131 | while (count--) | ||
132 | *buf++ = *p & 0xff; | ||
133 | } else if (is_pci_ioaddr(port)) { | ||
134 | volatile u8 *bp = (volatile u8 *)pci_ioaddr(port); | ||
135 | |||
136 | while (count--) | ||
137 | *buf++ = *bp; | ||
138 | } else { | ||
139 | p = (volatile u16 *)port; | ||
140 | while (count--) | ||
141 | *buf++ = *p & 0xff; | ||
142 | } | ||
143 | } | ||
144 | |||
145 | void r7780rp_insw(unsigned long port, void *dst, unsigned long count) | ||
146 | { | ||
147 | volatile u16 *p; | ||
148 | u16 *buf = dst; | ||
149 | |||
150 | if (CHECK_AX88796L_PORT(port)) | ||
151 | p = (volatile u16 *)port88796l(port, 1); | ||
152 | else if (is_pci_ioaddr(port)) | ||
153 | p = (volatile u16 *)pci_ioaddr(port); | ||
154 | else | ||
155 | p = (volatile u16 *)port; | ||
156 | |||
157 | while (count--) | ||
158 | *buf++ = *p; | ||
159 | |||
160 | flush_dcache_all(); | ||
161 | } | ||
162 | |||
163 | void r7780rp_insl(unsigned long port, void *dst, unsigned long count) | ||
164 | { | ||
165 | if (is_pci_ioaddr(port)) { | ||
166 | volatile u32 *p = (volatile u32 *)pci_ioaddr(port); | ||
167 | u32 *buf = dst; | ||
168 | |||
169 | while (count--) | ||
170 | *buf++ = *p; | ||
171 | } | ||
172 | } | ||
173 | |||
174 | void r7780rp_outsb(unsigned long port, const void *src, unsigned long count) | ||
175 | { | ||
176 | volatile u16 *p; | ||
177 | const u8 *buf = src; | ||
178 | |||
179 | if (CHECK_AX88796L_PORT(port)) { | ||
180 | p = (volatile u16 *)port88796l(port, 0); | ||
181 | while (count--) | ||
182 | *p = *buf++; | ||
183 | } else if (is_pci_ioaddr(port)) { | ||
184 | volatile u8 *bp = (volatile u8 *)pci_ioaddr(port); | ||
185 | |||
186 | while (count--) | ||
187 | *bp = *buf++; | ||
188 | } else | ||
189 | while (count--) | ||
190 | ctrl_outb(*buf++, port); | ||
191 | } | ||
192 | |||
193 | void r7780rp_outsw(unsigned long port, const void *src, unsigned long count) | ||
194 | { | ||
195 | volatile u16 *p; | ||
196 | const u16 *buf = src; | ||
197 | |||
198 | if (CHECK_AX88796L_PORT(port)) | ||
199 | p = (volatile u16 *)port88796l(port, 1); | ||
200 | else if (is_pci_ioaddr(port)) | ||
201 | p = (volatile u16 *)pci_ioaddr(port); | ||
202 | else | ||
203 | p = (volatile u16 *)port; | ||
204 | |||
205 | while (count--) | ||
206 | *p = *buf++; | ||
207 | |||
208 | flush_dcache_all(); | ||
209 | } | ||
210 | |||
211 | void r7780rp_outsl(unsigned long port, const void *src, unsigned long count) | ||
212 | { | ||
213 | const u32 *buf = src; | ||
214 | u32 *p; | ||
215 | |||
216 | if (is_pci_ioaddr(port)) | ||
217 | p = (u32 *)pci_ioaddr(port); | ||
218 | else | ||
219 | p = (u32 *)port; | ||
220 | |||
221 | while (count--) | ||
222 | ctrl_outl(*buf++, (unsigned long)p); | ||
223 | } | ||
224 | |||
225 | void __iomem *r7780rp_ioport_map(unsigned long port, unsigned int size) | ||
226 | { | ||
227 | if (CHECK_AX88796L_PORT(port)) | ||
228 | return (void __iomem *)port88796l(port, size > 1); | ||
229 | else if (is_pci_ioaddr(port)) | ||
230 | return (void __iomem *)pci_ioaddr(port); | ||
231 | |||
232 | return (void __iomem *)port; | ||
233 | } | ||
diff --git a/arch/sh/boards/renesas/r7780rp/setup.c b/arch/sh/boards/renesas/r7780rp/setup.c index 0d74db9f1792..2faba6679e64 100644 --- a/arch/sh/boards/renesas/r7780rp/setup.c +++ b/arch/sh/boards/renesas/r7780rp/setup.c | |||
@@ -187,31 +187,7 @@ static void __init r7780rp_setup(char **cmdline_p) | |||
187 | struct sh_machine_vector mv_r7780rp __initmv = { | 187 | struct sh_machine_vector mv_r7780rp __initmv = { |
188 | .mv_name = "Highlander R7780RP-1", | 188 | .mv_name = "Highlander R7780RP-1", |
189 | .mv_setup = r7780rp_setup, | 189 | .mv_setup = r7780rp_setup, |
190 | |||
191 | .mv_nr_irqs = 109, | 190 | .mv_nr_irqs = 109, |
192 | |||
193 | .mv_inb = r7780rp_inb, | ||
194 | .mv_inw = r7780rp_inw, | ||
195 | .mv_inl = r7780rp_inl, | ||
196 | .mv_outb = r7780rp_outb, | ||
197 | .mv_outw = r7780rp_outw, | ||
198 | .mv_outl = r7780rp_outl, | ||
199 | |||
200 | .mv_inb_p = r7780rp_inb_p, | ||
201 | .mv_inw_p = r7780rp_inw, | ||
202 | .mv_inl_p = r7780rp_inl, | ||
203 | .mv_outb_p = r7780rp_outb_p, | ||
204 | .mv_outw_p = r7780rp_outw, | ||
205 | .mv_outl_p = r7780rp_outl, | ||
206 | |||
207 | .mv_insb = r7780rp_insb, | ||
208 | .mv_insw = r7780rp_insw, | ||
209 | .mv_insl = r7780rp_insl, | ||
210 | .mv_outsb = r7780rp_outsb, | ||
211 | .mv_outsw = r7780rp_outsw, | ||
212 | .mv_outsl = r7780rp_outsl, | ||
213 | |||
214 | .mv_ioport_map = r7780rp_ioport_map, | ||
215 | .mv_init_irq = init_r7780rp_IRQ, | 191 | .mv_init_irq = init_r7780rp_IRQ, |
216 | }; | 192 | }; |
217 | ALIAS_MV(r7780rp) | 193 | ALIAS_MV(r7780rp) |
diff --git a/arch/sh/boards/renesas/rts7751r2d/setup.c b/arch/sh/boards/renesas/rts7751r2d/setup.c index 44b42082a0af..593f26a85e9c 100644 --- a/arch/sh/boards/renesas/rts7751r2d/setup.c +++ b/arch/sh/boards/renesas/rts7751r2d/setup.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/platform_device.h> | 12 | #include <linux/platform_device.h> |
13 | #include <linux/pata_platform.h> | 13 | #include <linux/pata_platform.h> |
14 | #include <linux/serial_8250.h> | 14 | #include <linux/serial_8250.h> |
15 | #include <linux/sm501.h> | ||
15 | #include <linux/pm.h> | 16 | #include <linux/pm.h> |
16 | #include <asm/machvec.h> | 17 | #include <asm/machvec.h> |
17 | #include <asm/rts7751r2d.h> | 18 | #include <asm/rts7751r2d.h> |
@@ -111,10 +112,35 @@ static struct platform_device heartbeat_device = { | |||
111 | .resource = heartbeat_resources, | 112 | .resource = heartbeat_resources, |
112 | }; | 113 | }; |
113 | 114 | ||
115 | static struct resource sm501_resources[] = { | ||
116 | [0] = { | ||
117 | .start = 0x10000000, | ||
118 | .end = 0x13e00000 - 1, | ||
119 | .flags = IORESOURCE_MEM, | ||
120 | }, | ||
121 | [1] = { | ||
122 | .start = 0x13e00000, | ||
123 | .end = 0x13ffffff, | ||
124 | .flags = IORESOURCE_MEM, | ||
125 | }, | ||
126 | [2] = { | ||
127 | .start = 32, | ||
128 | .flags = IORESOURCE_IRQ, | ||
129 | }, | ||
130 | }; | ||
131 | |||
132 | static struct platform_device sm501_device = { | ||
133 | .name = "sm501", | ||
134 | .id = -1, | ||
135 | .num_resources = ARRAY_SIZE(sm501_resources), | ||
136 | .resource = sm501_resources, | ||
137 | }; | ||
138 | |||
114 | static struct platform_device *rts7751r2d_devices[] __initdata = { | 139 | static struct platform_device *rts7751r2d_devices[] __initdata = { |
115 | &uart_device, | 140 | &uart_device, |
116 | &heartbeat_device, | 141 | &heartbeat_device, |
117 | &cf_ide_device, | 142 | &cf_ide_device, |
143 | &sm501_device, | ||
118 | }; | 144 | }; |
119 | 145 | ||
120 | static int __init rts7751r2d_devices_setup(void) | 146 | static int __init rts7751r2d_devices_setup(void) |
diff --git a/arch/sh/configs/rts7751r2d_defconfig b/arch/sh/configs/rts7751r2d_defconfig index db6a02df5af6..a59bb78bd071 100644 --- a/arch/sh/configs/rts7751r2d_defconfig +++ b/arch/sh/configs/rts7751r2d_defconfig | |||
@@ -1,14 +1,13 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.20 | 3 | # Linux kernel version: 2.6.21-rc1 |
4 | # Thu Feb 15 17:17:29 2007 | 4 | # Thu Mar 1 16:42:40 2007 |
5 | # | 5 | # |
6 | CONFIG_SUPERH=y | 6 | CONFIG_SUPERH=y |
7 | CONFIG_RWSEM_GENERIC_SPINLOCK=y | 7 | CONFIG_RWSEM_GENERIC_SPINLOCK=y |
8 | CONFIG_GENERIC_FIND_NEXT_BIT=y | 8 | CONFIG_GENERIC_FIND_NEXT_BIT=y |
9 | CONFIG_GENERIC_HWEIGHT=y | 9 | CONFIG_GENERIC_HWEIGHT=y |
10 | CONFIG_GENERIC_HARDIRQS=y | 10 | CONFIG_GENERIC_HARDIRQS=y |
11 | CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y | ||
12 | CONFIG_GENERIC_IRQ_PROBE=y | 11 | CONFIG_GENERIC_IRQ_PROBE=y |
13 | CONFIG_GENERIC_CALIBRATE_DELAY=y | 12 | CONFIG_GENERIC_CALIBRATE_DELAY=y |
14 | # CONFIG_GENERIC_TIME is not set | 13 | # CONFIG_GENERIC_TIME is not set |
@@ -33,6 +32,7 @@ CONFIG_LOCALVERSION_AUTO=y | |||
33 | CONFIG_SWAP=y | 32 | CONFIG_SWAP=y |
34 | CONFIG_SYSVIPC=y | 33 | CONFIG_SYSVIPC=y |
35 | # CONFIG_IPC_NS is not set | 34 | # CONFIG_IPC_NS is not set |
35 | CONFIG_SYSVIPC_SYSCTL=y | ||
36 | # CONFIG_POSIX_MQUEUE is not set | 36 | # CONFIG_POSIX_MQUEUE is not set |
37 | # CONFIG_BSD_PROCESS_ACCT is not set | 37 | # CONFIG_BSD_PROCESS_ACCT is not set |
38 | # CONFIG_TASKSTATS is not set | 38 | # CONFIG_TASKSTATS is not set |
@@ -119,7 +119,6 @@ CONFIG_SH_RTS7751R2D=y | |||
119 | # CONFIG_SH_SHMIN is not set | 119 | # CONFIG_SH_SHMIN is not set |
120 | # CONFIG_SH_7206_SOLUTION_ENGINE is not set | 120 | # CONFIG_SH_7206_SOLUTION_ENGINE is not set |
121 | # CONFIG_SH_7619_SOLUTION_ENGINE is not set | 121 | # CONFIG_SH_7619_SOLUTION_ENGINE is not set |
122 | # CONFIG_SH_ASDAP310 is not set | ||
123 | # CONFIG_SH_UNKNOWN is not set | 122 | # CONFIG_SH_UNKNOWN is not set |
124 | 123 | ||
125 | # | 124 | # |
@@ -281,7 +280,7 @@ CONFIG_ZERO_PAGE_OFFSET=0x00010000 | |||
281 | CONFIG_BOOT_LINK_OFFSET=0x00800000 | 280 | CONFIG_BOOT_LINK_OFFSET=0x00800000 |
282 | # CONFIG_UBC_WAKEUP is not set | 281 | # CONFIG_UBC_WAKEUP is not set |
283 | CONFIG_CMDLINE_BOOL=y | 282 | CONFIG_CMDLINE_BOOL=y |
284 | CONFIG_CMDLINE="console=ttySC0,115200 root=/dev/sda1" | 283 | CONFIG_CMDLINE="console=tty0 console=ttySC0,115200 root=/dev/sda1" |
285 | 284 | ||
286 | # | 285 | # |
287 | # Bus options | 286 | # Bus options |
@@ -433,6 +432,7 @@ CONFIG_FW_LOADER=m | |||
433 | # | 432 | # |
434 | # Plug and Play support | 433 | # Plug and Play support |
435 | # | 434 | # |
435 | # CONFIG_PNPACPI is not set | ||
436 | 436 | ||
437 | # | 437 | # |
438 | # Block devices | 438 | # Block devices |
@@ -770,7 +770,26 @@ CONFIG_NET_WIRELESS=y | |||
770 | # | 770 | # |
771 | # Input device support | 771 | # Input device support |
772 | # | 772 | # |
773 | # CONFIG_INPUT is not set | 773 | CONFIG_INPUT=y |
774 | # CONFIG_INPUT_FF_MEMLESS is not set | ||
775 | |||
776 | # | ||
777 | # Userland interfaces | ||
778 | # | ||
779 | # CONFIG_INPUT_MOUSEDEV is not set | ||
780 | # CONFIG_INPUT_JOYDEV is not set | ||
781 | # CONFIG_INPUT_TSDEV is not set | ||
782 | # CONFIG_INPUT_EVDEV is not set | ||
783 | # CONFIG_INPUT_EVBUG is not set | ||
784 | |||
785 | # | ||
786 | # Input Device Drivers | ||
787 | # | ||
788 | # CONFIG_INPUT_KEYBOARD is not set | ||
789 | # CONFIG_INPUT_MOUSE is not set | ||
790 | # CONFIG_INPUT_JOYSTICK is not set | ||
791 | # CONFIG_INPUT_TOUCHSCREEN is not set | ||
792 | # CONFIG_INPUT_MISC is not set | ||
774 | 793 | ||
775 | # | 794 | # |
776 | # Hardware I/O ports | 795 | # Hardware I/O ports |
@@ -781,7 +800,10 @@ CONFIG_NET_WIRELESS=y | |||
781 | # | 800 | # |
782 | # Character devices | 801 | # Character devices |
783 | # | 802 | # |
784 | # CONFIG_VT is not set | 803 | CONFIG_VT=y |
804 | CONFIG_VT_CONSOLE=y | ||
805 | CONFIG_HW_CONSOLE=y | ||
806 | CONFIG_VT_HW_CONSOLE_BINDING=y | ||
785 | # CONFIG_SERIAL_NONSTANDARD is not set | 807 | # CONFIG_SERIAL_NONSTANDARD is not set |
786 | 808 | ||
787 | # | 809 | # |
@@ -857,6 +879,11 @@ CONFIG_HWMON=y | |||
857 | # CONFIG_HWMON_DEBUG_CHIP is not set | 879 | # CONFIG_HWMON_DEBUG_CHIP is not set |
858 | 880 | ||
859 | # | 881 | # |
882 | # Multifunction device drivers | ||
883 | # | ||
884 | CONFIG_MFD_SM501=y | ||
885 | |||
886 | # | ||
860 | # Multimedia devices | 887 | # Multimedia devices |
861 | # | 888 | # |
862 | # CONFIG_VIDEO_DEV is not set | 889 | # CONFIG_VIDEO_DEV is not set |
@@ -869,9 +896,66 @@ CONFIG_HWMON=y | |||
869 | # | 896 | # |
870 | # Graphics support | 897 | # Graphics support |
871 | # | 898 | # |
872 | CONFIG_FIRMWARE_EDID=y | ||
873 | # CONFIG_FB is not set | ||
874 | # CONFIG_BACKLIGHT_LCD_SUPPORT is not set | 899 | # CONFIG_BACKLIGHT_LCD_SUPPORT is not set |
900 | CONFIG_FB=y | ||
901 | # CONFIG_FIRMWARE_EDID is not set | ||
902 | # CONFIG_FB_DDC is not set | ||
903 | CONFIG_FB_CFB_FILLRECT=y | ||
904 | CONFIG_FB_CFB_COPYAREA=y | ||
905 | CONFIG_FB_CFB_IMAGEBLIT=y | ||
906 | # CONFIG_FB_SVGALIB is not set | ||
907 | # CONFIG_FB_MACMODES is not set | ||
908 | # CONFIG_FB_BACKLIGHT is not set | ||
909 | # CONFIG_FB_MODE_HELPERS is not set | ||
910 | # CONFIG_FB_TILEBLITTING is not set | ||
911 | |||
912 | # | ||
913 | # Frambuffer hardware drivers | ||
914 | # | ||
915 | # CONFIG_FB_CIRRUS is not set | ||
916 | # CONFIG_FB_PM2 is not set | ||
917 | # CONFIG_FB_CYBER2000 is not set | ||
918 | # CONFIG_FB_ASILIANT is not set | ||
919 | # CONFIG_FB_IMSTT is not set | ||
920 | # CONFIG_FB_EPSON1355 is not set | ||
921 | # CONFIG_FB_S1D13XXX is not set | ||
922 | # CONFIG_FB_NVIDIA is not set | ||
923 | # CONFIG_FB_RIVA is not set | ||
924 | # CONFIG_FB_MATROX is not set | ||
925 | # CONFIG_FB_RADEON is not set | ||
926 | # CONFIG_FB_ATY128 is not set | ||
927 | # CONFIG_FB_ATY is not set | ||
928 | # CONFIG_FB_S3 is not set | ||
929 | # CONFIG_FB_SAVAGE is not set | ||
930 | # CONFIG_FB_SIS is not set | ||
931 | # CONFIG_FB_NEOMAGIC is not set | ||
932 | # CONFIG_FB_KYRO is not set | ||
933 | # CONFIG_FB_3DFX is not set | ||
934 | # CONFIG_FB_VOODOO1 is not set | ||
935 | # CONFIG_FB_TRIDENT is not set | ||
936 | CONFIG_FB_SM501=y | ||
937 | # CONFIG_FB_VIRTUAL is not set | ||
938 | |||
939 | # | ||
940 | # Console display driver support | ||
941 | # | ||
942 | CONFIG_DUMMY_CONSOLE=y | ||
943 | CONFIG_FRAMEBUFFER_CONSOLE=y | ||
944 | # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set | ||
945 | # CONFIG_FONTS is not set | ||
946 | CONFIG_FONT_8x8=y | ||
947 | CONFIG_FONT_8x16=y | ||
948 | |||
949 | # | ||
950 | # Logo configuration | ||
951 | # | ||
952 | CONFIG_LOGO=y | ||
953 | # CONFIG_LOGO_LINUX_MONO is not set | ||
954 | # CONFIG_LOGO_LINUX_VGA16 is not set | ||
955 | # CONFIG_LOGO_LINUX_CLUT224 is not set | ||
956 | # CONFIG_LOGO_SUPERH_MONO is not set | ||
957 | # CONFIG_LOGO_SUPERH_VGA16 is not set | ||
958 | CONFIG_LOGO_SUPERH_CLUT224=y | ||
875 | 959 | ||
876 | # | 960 | # |
877 | # Sound | 961 | # Sound |
@@ -985,6 +1069,12 @@ CONFIG_SOUND_PRIME=m | |||
985 | CONFIG_AC97_BUS=m | 1069 | CONFIG_AC97_BUS=m |
986 | 1070 | ||
987 | # | 1071 | # |
1072 | # HID Devices | ||
1073 | # | ||
1074 | CONFIG_HID=y | ||
1075 | # CONFIG_HID_DEBUG is not set | ||
1076 | |||
1077 | # | ||
988 | # USB support | 1078 | # USB support |
989 | # | 1079 | # |
990 | CONFIG_USB_ARCH_HAS_HCD=y | 1080 | CONFIG_USB_ARCH_HAS_HCD=y |
@@ -1237,7 +1327,7 @@ CONFIG_LOG_BUF_SHIFT=14 | |||
1237 | CONFIG_EARLY_SCIF_CONSOLE=y | 1327 | CONFIG_EARLY_SCIF_CONSOLE=y |
1238 | CONFIG_EARLY_SCIF_CONSOLE_PORT=0xffe80000 | 1328 | CONFIG_EARLY_SCIF_CONSOLE_PORT=0xffe80000 |
1239 | CONFIG_EARLY_PRINTK=y | 1329 | CONFIG_EARLY_PRINTK=y |
1240 | # CONFIG_KGDB is not set | 1330 | # CONFIG_SH_KGDB is not set |
1241 | 1331 | ||
1242 | # | 1332 | # |
1243 | # Security options | 1333 | # Security options |
diff --git a/arch/sh/kernel/entry-common.S b/arch/sh/kernel/entry-common.S index ab4ebb856c2a..b46728027195 100644 --- a/arch/sh/kernel/entry-common.S +++ b/arch/sh/kernel/entry-common.S | |||
@@ -224,7 +224,7 @@ work_resched: | |||
224 | syscall_exit_work: | 224 | syscall_exit_work: |
225 | ! r0: current_thread_info->flags | 225 | ! r0: current_thread_info->flags |
226 | ! r8: current_thread_info | 226 | ! r8: current_thread_info |
227 | tst #_TIF_SYSCALL_TRACE, r0 | 227 | tst #_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP, r0 |
228 | bt/s work_pending | 228 | bt/s work_pending |
229 | tst #_TIF_NEED_RESCHED, r0 | 229 | tst #_TIF_NEED_RESCHED, r0 |
230 | #ifdef CONFIG_TRACE_IRQFLAGS | 230 | #ifdef CONFIG_TRACE_IRQFLAGS |
diff --git a/arch/sh/kernel/io_generic.c b/arch/sh/kernel/io_generic.c index 66626c03e1ee..771ea4230441 100644 --- a/arch/sh/kernel/io_generic.c +++ b/arch/sh/kernel/io_generic.c | |||
@@ -14,7 +14,6 @@ | |||
14 | #include <linux/module.h> | 14 | #include <linux/module.h> |
15 | #include <linux/io.h> | 15 | #include <linux/io.h> |
16 | #include <asm/machvec.h> | 16 | #include <asm/machvec.h> |
17 | #include <asm/cacheflush.h> | ||
18 | 17 | ||
19 | #ifdef CONFIG_CPU_SH3 | 18 | #ifdef CONFIG_CPU_SH3 |
20 | /* SH3 has a PCMCIA bug that needs a dummy read from area 6 for a | 19 | /* SH3 has a PCMCIA bug that needs a dummy read from area 6 for a |
@@ -96,7 +95,6 @@ void generic_insw(unsigned long port, void *dst, unsigned long count) | |||
96 | while (count--) | 95 | while (count--) |
97 | *buf++ = *port_addr; | 96 | *buf++ = *port_addr; |
98 | 97 | ||
99 | flush_dcache_all(); | ||
100 | dummy_read(); | 98 | dummy_read(); |
101 | } | 99 | } |
102 | 100 | ||
@@ -171,7 +169,6 @@ void generic_outsw(unsigned long port, const void *src, unsigned long count) | |||
171 | while (count--) | 169 | while (count--) |
172 | *port_addr = *buf++; | 170 | *port_addr = *buf++; |
173 | 171 | ||
174 | flush_dcache_all(); | ||
175 | dummy_read(); | 172 | dummy_read(); |
176 | } | 173 | } |
177 | 174 | ||
diff --git a/arch/sh/kernel/process.c b/arch/sh/kernel/process.c index 9d6a438b3eaf..e7607366ac4e 100644 --- a/arch/sh/kernel/process.c +++ b/arch/sh/kernel/process.c | |||
@@ -250,12 +250,11 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, | |||
250 | childregs->regs[15] = usp; | 250 | childregs->regs[15] = usp; |
251 | ti->addr_limit = USER_DS; | 251 | ti->addr_limit = USER_DS; |
252 | } else { | 252 | } else { |
253 | childregs->regs[15] = (unsigned long)task_stack_page(p) + | 253 | childregs->regs[15] = (unsigned long)childregs; |
254 | THREAD_SIZE; | ||
255 | ti->addr_limit = KERNEL_DS; | 254 | ti->addr_limit = KERNEL_DS; |
256 | } | 255 | } |
257 | 256 | ||
258 | if (clone_flags & CLONE_SETTLS) | 257 | if (clone_flags & CLONE_SETTLS) |
259 | childregs->gbr = childregs->regs[0]; | 258 | childregs->gbr = childregs->regs[0]; |
260 | 259 | ||
261 | childregs->regs[0] = 0; /* Set return value for child */ | 260 | childregs->regs[0] = 0; /* Set return value for child */ |
diff --git a/arch/sh/kernel/ptrace.c b/arch/sh/kernel/ptrace.c index 04ca13a041c1..855f7246cfff 100644 --- a/arch/sh/kernel/ptrace.c +++ b/arch/sh/kernel/ptrace.c | |||
@@ -8,7 +8,6 @@ | |||
8 | * SuperH version: Copyright (C) 1999, 2000 Kaz Kojima & Niibe Yutaka | 8 | * SuperH version: Copyright (C) 1999, 2000 Kaz Kojima & Niibe Yutaka |
9 | * | 9 | * |
10 | */ | 10 | */ |
11 | |||
12 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
13 | #include <linux/sched.h> | 12 | #include <linux/sched.h> |
14 | #include <linux/mm.h> | 13 | #include <linux/mm.h> |
@@ -20,8 +19,7 @@ | |||
20 | #include <linux/slab.h> | 19 | #include <linux/slab.h> |
21 | #include <linux/security.h> | 20 | #include <linux/security.h> |
22 | #include <linux/signal.h> | 21 | #include <linux/signal.h> |
23 | 22 | #include <linux/io.h> | |
24 | #include <asm/io.h> | ||
25 | #include <asm/uaccess.h> | 23 | #include <asm/uaccess.h> |
26 | #include <asm/pgtable.h> | 24 | #include <asm/pgtable.h> |
27 | #include <asm/system.h> | 25 | #include <asm/system.h> |
@@ -59,6 +57,23 @@ static inline int put_stack_long(struct task_struct *task, int offset, | |||
59 | return 0; | 57 | return 0; |
60 | } | 58 | } |
61 | 59 | ||
60 | static void ptrace_disable_singlestep(struct task_struct *child) | ||
61 | { | ||
62 | clear_tsk_thread_flag(child, TIF_SINGLESTEP); | ||
63 | |||
64 | /* | ||
65 | * Ensure the UBC is not programmed at the next context switch. | ||
66 | * | ||
67 | * Normally this is not needed but there are sequences such as | ||
68 | * singlestep, signal delivery, and continue that leave the | ||
69 | * ubc_pc non-zero leading to spurious SIGTRAPs. | ||
70 | */ | ||
71 | if (child->thread.ubc_pc != 0) { | ||
72 | ubc_usercnt -= 1; | ||
73 | child->thread.ubc_pc = 0; | ||
74 | } | ||
75 | } | ||
76 | |||
62 | /* | 77 | /* |
63 | * Called by kernel/ptrace.c when detaching.. | 78 | * Called by kernel/ptrace.c when detaching.. |
64 | * | 79 | * |
@@ -66,7 +81,7 @@ static inline int put_stack_long(struct task_struct *task, int offset, | |||
66 | */ | 81 | */ |
67 | void ptrace_disable(struct task_struct *child) | 82 | void ptrace_disable(struct task_struct *child) |
68 | { | 83 | { |
69 | /* nothing to do.. */ | 84 | ptrace_disable_singlestep(child); |
70 | } | 85 | } |
71 | 86 | ||
72 | long arch_ptrace(struct task_struct *child, long request, long addr, long data) | 87 | long arch_ptrace(struct task_struct *child, long request, long addr, long data) |
@@ -76,7 +91,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
76 | 91 | ||
77 | switch (request) { | 92 | switch (request) { |
78 | /* when I and D space are separate, these will need to be fixed. */ | 93 | /* when I and D space are separate, these will need to be fixed. */ |
79 | case PTRACE_PEEKTEXT: /* read word at location addr. */ | 94 | case PTRACE_PEEKTEXT: /* read word at location addr. */ |
80 | case PTRACE_PEEKDATA: { | 95 | case PTRACE_PEEKDATA: { |
81 | unsigned long tmp; | 96 | unsigned long tmp; |
82 | int copied; | 97 | int copied; |
@@ -94,7 +109,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
94 | unsigned long tmp; | 109 | unsigned long tmp; |
95 | 110 | ||
96 | ret = -EIO; | 111 | ret = -EIO; |
97 | if ((addr & 3) || addr < 0 || | 112 | if ((addr & 3) || addr < 0 || |
98 | addr > sizeof(struct user) - 3) | 113 | addr > sizeof(struct user) - 3) |
99 | break; | 114 | break; |
100 | 115 | ||
@@ -129,7 +144,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
129 | 144 | ||
130 | case PTRACE_POKEUSR: /* write the word at location addr in the USER area */ | 145 | case PTRACE_POKEUSR: /* write the word at location addr in the USER area */ |
131 | ret = -EIO; | 146 | ret = -EIO; |
132 | if ((addr & 3) || addr < 0 || | 147 | if ((addr & 3) || addr < 0 || |
133 | addr > sizeof(struct user) - 3) | 148 | addr > sizeof(struct user) - 3) |
134 | break; | 149 | break; |
135 | 150 | ||
@@ -156,6 +171,9 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
156 | set_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | 171 | set_tsk_thread_flag(child, TIF_SYSCALL_TRACE); |
157 | else | 172 | else |
158 | clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | 173 | clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); |
174 | |||
175 | ptrace_disable_singlestep(child); | ||
176 | |||
159 | child->exit_code = data; | 177 | child->exit_code = data; |
160 | wake_up_process(child); | 178 | wake_up_process(child); |
161 | ret = 0; | 179 | ret = 0; |
@@ -163,14 +181,15 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
163 | } | 181 | } |
164 | 182 | ||
165 | /* | 183 | /* |
166 | * make the child exit. Best I can do is send it a sigkill. | 184 | * make the child exit. Best I can do is send it a sigkill. |
167 | * perhaps it should be put in the status that it wants to | 185 | * perhaps it should be put in the status that it wants to |
168 | * exit. | 186 | * exit. |
169 | */ | 187 | */ |
170 | case PTRACE_KILL: { | 188 | case PTRACE_KILL: { |
171 | ret = 0; | 189 | ret = 0; |
172 | if (child->exit_state == EXIT_ZOMBIE) /* already dead */ | 190 | if (child->exit_state == EXIT_ZOMBIE) /* already dead */ |
173 | break; | 191 | break; |
192 | ptrace_disable_singlestep(child); | ||
174 | child->exit_code = SIGKILL; | 193 | child->exit_code = SIGKILL; |
175 | wake_up_process(child); | 194 | wake_up_process(child); |
176 | break; | 195 | break; |
@@ -196,6 +215,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
196 | ubc_usercnt += 1; | 215 | ubc_usercnt += 1; |
197 | child->thread.ubc_pc = pc; | 216 | child->thread.ubc_pc = pc; |
198 | 217 | ||
218 | set_tsk_thread_flag(child, TIF_SINGLESTEP); | ||
199 | child->exit_code = data; | 219 | child->exit_code = data; |
200 | /* give it a chance to run. */ | 220 | /* give it a chance to run. */ |
201 | wake_up_process(child); | 221 | wake_up_process(child); |
@@ -248,14 +268,15 @@ asmlinkage void do_syscall_trace(void) | |||
248 | { | 268 | { |
249 | struct task_struct *tsk = current; | 269 | struct task_struct *tsk = current; |
250 | 270 | ||
251 | if (!test_thread_flag(TIF_SYSCALL_TRACE)) | 271 | if (!test_thread_flag(TIF_SYSCALL_TRACE) && |
272 | !test_thread_flag(TIF_SINGLESTEP)) | ||
252 | return; | 273 | return; |
253 | if (!(tsk->ptrace & PT_PTRACED)) | 274 | if (!(tsk->ptrace & PT_PTRACED)) |
254 | return; | 275 | return; |
255 | /* the 0x80 provides a way for the tracing parent to distinguish | 276 | /* the 0x80 provides a way for the tracing parent to distinguish |
256 | between a syscall stop and SIGTRAP delivery */ | 277 | between a syscall stop and SIGTRAP delivery */ |
257 | ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) | 278 | ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) && |
258 | ? 0x80 : 0)); | 279 | !test_thread_flag(TIF_SINGLESTEP) ? 0x80 : 0)); |
259 | 280 | ||
260 | /* | 281 | /* |
261 | * this isn't the same as continuing with a signal, but it will do | 282 | * this isn't the same as continuing with a signal, but it will do |
diff --git a/arch/sh/kernel/signal.c b/arch/sh/kernel/signal.c index 32f10a03fbb5..9f39ef1f73da 100644 --- a/arch/sh/kernel/signal.c +++ b/arch/sh/kernel/signal.c | |||
@@ -589,6 +589,8 @@ static void do_signal(struct pt_regs *regs, unsigned int save_r0) | |||
589 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) | 589 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) |
590 | clear_thread_flag(TIF_RESTORE_SIGMASK); | 590 | clear_thread_flag(TIF_RESTORE_SIGMASK); |
591 | } | 591 | } |
592 | |||
593 | return; | ||
592 | } | 594 | } |
593 | 595 | ||
594 | no_signal: | 596 | no_signal: |
@@ -598,7 +600,7 @@ static void do_signal(struct pt_regs *regs, unsigned int save_r0) | |||
598 | if (regs->regs[0] == -ERESTARTNOHAND || | 600 | if (regs->regs[0] == -ERESTARTNOHAND || |
599 | regs->regs[0] == -ERESTARTSYS || | 601 | regs->regs[0] == -ERESTARTSYS || |
600 | regs->regs[0] == -ERESTARTNOINTR) { | 602 | regs->regs[0] == -ERESTARTNOINTR) { |
601 | regs->regs[0] = save_r0; | 603 | regs->regs[0] = save_r0; |
602 | regs->pc -= 2; | 604 | regs->pc -= 2; |
603 | } else if (regs->regs[0] == -ERESTART_RESTARTBLOCK) { | 605 | } else if (regs->regs[0] == -ERESTART_RESTARTBLOCK) { |
604 | regs->pc -= 2; | 606 | regs->pc -= 2; |
diff --git a/arch/sh/kernel/vmlinux.lds.S b/arch/sh/kernel/vmlinux.lds.S index 75de165867a0..78a6c09875b2 100644 --- a/arch/sh/kernel/vmlinux.lds.S +++ b/arch/sh/kernel/vmlinux.lds.S | |||
@@ -3,6 +3,7 @@ | |||
3 | * Written by Niibe Yutaka | 3 | * Written by Niibe Yutaka |
4 | */ | 4 | */ |
5 | #include <asm/thread_info.h> | 5 | #include <asm/thread_info.h> |
6 | #include <asm/cache.h> | ||
6 | #include <asm-generic/vmlinux.lds.h> | 7 | #include <asm-generic/vmlinux.lds.h> |
7 | 8 | ||
8 | #ifdef CONFIG_CPU_LITTLE_ENDIAN | 9 | #ifdef CONFIG_CPU_LITTLE_ENDIAN |
@@ -53,7 +54,7 @@ SECTIONS | |||
53 | . = ALIGN(PAGE_SIZE); | 54 | . = ALIGN(PAGE_SIZE); |
54 | .data.page_aligned : { *(.data.page_aligned) } | 55 | .data.page_aligned : { *(.data.page_aligned) } |
55 | 56 | ||
56 | . = ALIGN(32); | 57 | . = ALIGN(L1_CACHE_BYTES); |
57 | __per_cpu_start = .; | 58 | __per_cpu_start = .; |
58 | .data.percpu : { *(.data.percpu) } | 59 | .data.percpu : { *(.data.percpu) } |
59 | __per_cpu_end = .; | 60 | __per_cpu_end = .; |
diff --git a/arch/sh/mm/cache-sh4.c b/arch/sh/mm/cache-sh4.c index e0cd4b7f4aeb..981b04089055 100644 --- a/arch/sh/mm/cache-sh4.c +++ b/arch/sh/mm/cache-sh4.c | |||
@@ -237,20 +237,10 @@ static inline void flush_cache_4096(unsigned long start, | |||
237 | /* | 237 | /* |
238 | * Write back & invalidate the D-cache of the page. | 238 | * Write back & invalidate the D-cache of the page. |
239 | * (To avoid "alias" issues) | 239 | * (To avoid "alias" issues) |
240 | * | ||
241 | * This uses a lazy write-back on UP, which is explicitly | ||
242 | * disabled on SMP. | ||
243 | */ | 240 | */ |
244 | void flush_dcache_page(struct page *page) | 241 | void flush_dcache_page(struct page *page) |
245 | { | 242 | { |
246 | #ifndef CONFIG_SMP | 243 | if (test_bit(PG_mapped, &page->flags)) { |
247 | struct address_space *mapping = page_mapping(page); | ||
248 | |||
249 | if (mapping && !mapping_mapped(mapping)) | ||
250 | set_bit(PG_dcache_dirty, &page->flags); | ||
251 | else | ||
252 | #endif | ||
253 | { | ||
254 | unsigned long phys = PHYSADDR(page_address(page)); | 244 | unsigned long phys = PHYSADDR(page_address(page)); |
255 | unsigned long addr = CACHE_OC_ADDRESS_ARRAY; | 245 | unsigned long addr = CACHE_OC_ADDRESS_ARRAY; |
256 | int i, n; | 246 | int i, n; |
diff --git a/arch/sh/mm/cache-sh7705.c b/arch/sh/mm/cache-sh7705.c index 31f8deb7a158..4896d7376926 100644 --- a/arch/sh/mm/cache-sh7705.c +++ b/arch/sh/mm/cache-sh7705.c | |||
@@ -3,11 +3,11 @@ | |||
3 | * | 3 | * |
4 | * Copyright (C) 1999, 2000 Niibe Yutaka | 4 | * Copyright (C) 1999, 2000 Niibe Yutaka |
5 | * Copyright (C) 2004 Alex Song | 5 | * Copyright (C) 2004 Alex Song |
6 | * Copyright (C) 2006 Paul Mundt | ||
7 | * | 6 | * |
8 | * This file is subject to the terms and conditions of the GNU General Public | 7 | * This file is subject to the terms and conditions of the GNU General Public |
9 | * License. See the file "COPYING" in the main directory of this archive | 8 | * License. See the file "COPYING" in the main directory of this archive |
10 | * for more details. | 9 | * for more details. |
10 | * | ||
11 | */ | 11 | */ |
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/mman.h> | 13 | #include <linux/mman.h> |
@@ -51,6 +51,7 @@ static inline void cache_wback_all(void) | |||
51 | 51 | ||
52 | if ((data & v) == v) | 52 | if ((data & v) == v) |
53 | ctrl_outl(data & ~v, addr); | 53 | ctrl_outl(data & ~v, addr); |
54 | |||
54 | } | 55 | } |
55 | 56 | ||
56 | addrstart += current_cpu_data.dcache.way_incr; | 57 | addrstart += current_cpu_data.dcache.way_incr; |
@@ -127,11 +128,7 @@ static void __flush_dcache_page(unsigned long phys) | |||
127 | */ | 128 | */ |
128 | void flush_dcache_page(struct page *page) | 129 | void flush_dcache_page(struct page *page) |
129 | { | 130 | { |
130 | struct address_space *mapping = page_mapping(page); | 131 | if (test_bit(PG_mapped, &page->flags)) |
131 | |||
132 | if (mapping && !mapping_mapped(mapping)) | ||
133 | set_bit(PG_dcache_dirty, &page->flags); | ||
134 | else | ||
135 | __flush_dcache_page(PHYSADDR(page_address(page))); | 132 | __flush_dcache_page(PHYSADDR(page_address(page))); |
136 | } | 133 | } |
137 | 134 | ||
diff --git a/arch/sh/mm/pg-sh4.c b/arch/sh/mm/pg-sh4.c index 969efeceb928..df69da9ca69c 100644 --- a/arch/sh/mm/pg-sh4.c +++ b/arch/sh/mm/pg-sh4.c | |||
@@ -23,6 +23,7 @@ extern struct mutex p3map_mutex[]; | |||
23 | */ | 23 | */ |
24 | void clear_user_page(void *to, unsigned long address, struct page *page) | 24 | void clear_user_page(void *to, unsigned long address, struct page *page) |
25 | { | 25 | { |
26 | __set_bit(PG_mapped, &page->flags); | ||
26 | if (((address ^ (unsigned long)to) & CACHE_ALIAS) == 0) | 27 | if (((address ^ (unsigned long)to) & CACHE_ALIAS) == 0) |
27 | clear_page(to); | 28 | clear_page(to); |
28 | else { | 29 | else { |
@@ -58,6 +59,7 @@ void clear_user_page(void *to, unsigned long address, struct page *page) | |||
58 | void copy_user_page(void *to, void *from, unsigned long address, | 59 | void copy_user_page(void *to, void *from, unsigned long address, |
59 | struct page *page) | 60 | struct page *page) |
60 | { | 61 | { |
62 | __set_bit(PG_mapped, &page->flags); | ||
61 | if (((address ^ (unsigned long)to) & CACHE_ALIAS) == 0) | 63 | if (((address ^ (unsigned long)to) & CACHE_ALIAS) == 0) |
62 | copy_page(to, from); | 64 | copy_page(to, from); |
63 | else { | 65 | else { |
@@ -82,3 +84,23 @@ void copy_user_page(void *to, void *from, unsigned long address, | |||
82 | mutex_unlock(&p3map_mutex[(address & CACHE_ALIAS)>>12]); | 84 | mutex_unlock(&p3map_mutex[(address & CACHE_ALIAS)>>12]); |
83 | } | 85 | } |
84 | } | 86 | } |
87 | |||
88 | /* | ||
89 | * For SH-4, we have our own implementation for ptep_get_and_clear | ||
90 | */ | ||
91 | inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) | ||
92 | { | ||
93 | pte_t pte = *ptep; | ||
94 | |||
95 | pte_clear(mm, addr, ptep); | ||
96 | if (!pte_not_present(pte)) { | ||
97 | unsigned long pfn = pte_pfn(pte); | ||
98 | if (pfn_valid(pfn)) { | ||
99 | struct page *page = pfn_to_page(pfn); | ||
100 | struct address_space *mapping = page_mapping(page); | ||
101 | if (!mapping || !mapping_writably_mapped(mapping)) | ||
102 | __clear_bit(PG_mapped, &page->flags); | ||
103 | } | ||
104 | } | ||
105 | return pte; | ||
106 | } | ||
diff --git a/arch/sh/mm/pg-sh7705.c b/arch/sh/mm/pg-sh7705.c index 887ab9d18ccd..a4b015f95a3a 100644 --- a/arch/sh/mm/pg-sh7705.c +++ b/arch/sh/mm/pg-sh7705.c | |||
@@ -7,7 +7,9 @@ | |||
7 | * This file is subject to the terms and conditions of the GNU General Public | 7 | * This file is subject to the terms and conditions of the GNU General Public |
8 | * License. See the file "COPYING" in the main directory of this archive | 8 | * License. See the file "COPYING" in the main directory of this archive |
9 | * for more details. | 9 | * for more details. |
10 | * | ||
10 | */ | 11 | */ |
12 | |||
11 | #include <linux/init.h> | 13 | #include <linux/init.h> |
12 | #include <linux/mman.h> | 14 | #include <linux/mman.h> |
13 | #include <linux/mm.h> | 15 | #include <linux/mm.h> |
@@ -74,6 +76,7 @@ void clear_user_page(void *to, unsigned long address, struct page *pg) | |||
74 | { | 76 | { |
75 | struct page *page = virt_to_page(to); | 77 | struct page *page = virt_to_page(to); |
76 | 78 | ||
79 | __set_bit(PG_mapped, &page->flags); | ||
77 | if (((address ^ (unsigned long)to) & CACHE_ALIAS) == 0) { | 80 | if (((address ^ (unsigned long)to) & CACHE_ALIAS) == 0) { |
78 | clear_page(to); | 81 | clear_page(to); |
79 | __flush_wback_region(to, PAGE_SIZE); | 82 | __flush_wback_region(to, PAGE_SIZE); |
@@ -92,11 +95,12 @@ void clear_user_page(void *to, unsigned long address, struct page *pg) | |||
92 | * @from: P1 address | 95 | * @from: P1 address |
93 | * @address: U0 address to be mapped | 96 | * @address: U0 address to be mapped |
94 | */ | 97 | */ |
95 | void copy_user_page(void *to, void *from, unsigned long address, | 98 | void copy_user_page(void *to, void *from, unsigned long address, struct page *pg) |
96 | struct page *pg) | ||
97 | { | 99 | { |
98 | struct page *page = virt_to_page(to); | 100 | struct page *page = virt_to_page(to); |
99 | 101 | ||
102 | |||
103 | __set_bit(PG_mapped, &page->flags); | ||
100 | if (((address ^ (unsigned long)to) & CACHE_ALIAS) == 0) { | 104 | if (((address ^ (unsigned long)to) & CACHE_ALIAS) == 0) { |
101 | copy_page(to, from); | 105 | copy_page(to, from); |
102 | __flush_wback_region(to, PAGE_SIZE); | 106 | __flush_wback_region(to, PAGE_SIZE); |
@@ -108,3 +112,26 @@ void copy_user_page(void *to, void *from, unsigned long address, | |||
108 | __flush_wback_region(to, PAGE_SIZE); | 112 | __flush_wback_region(to, PAGE_SIZE); |
109 | } | 113 | } |
110 | } | 114 | } |
115 | |||
116 | /* | ||
117 | * For SH7705, we have our own implementation for ptep_get_and_clear | ||
118 | * Copied from pg-sh4.c | ||
119 | */ | ||
120 | inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) | ||
121 | { | ||
122 | pte_t pte = *ptep; | ||
123 | |||
124 | pte_clear(mm, addr, ptep); | ||
125 | if (!pte_not_present(pte)) { | ||
126 | unsigned long pfn = pte_pfn(pte); | ||
127 | if (pfn_valid(pfn)) { | ||
128 | struct page *page = pfn_to_page(pfn); | ||
129 | struct address_space *mapping = page_mapping(page); | ||
130 | if (!mapping || !mapping_writably_mapped(mapping)) | ||
131 | __clear_bit(PG_mapped, &page->flags); | ||
132 | } | ||
133 | } | ||
134 | |||
135 | return pte; | ||
136 | } | ||
137 | |||
diff --git a/arch/sh/mm/tlb-flush.c b/arch/sh/mm/tlb-flush.c index d2f7b4a2eb05..6f45c1f8a7fe 100644 --- a/arch/sh/mm/tlb-flush.c +++ b/arch/sh/mm/tlb-flush.c | |||
@@ -2,17 +2,15 @@ | |||
2 | * TLB flushing operations for SH with an MMU. | 2 | * TLB flushing operations for SH with an MMU. |
3 | * | 3 | * |
4 | * Copyright (C) 1999 Niibe Yutaka | 4 | * Copyright (C) 1999 Niibe Yutaka |
5 | * Copyright (C) 2003 - 2006 Paul Mundt | 5 | * Copyright (C) 2003 Paul Mundt |
6 | * | 6 | * |
7 | * This file is subject to the terms and conditions of the GNU General Public | 7 | * This file is subject to the terms and conditions of the GNU General Public |
8 | * License. See the file "COPYING" in the main directory of this archive | 8 | * License. See the file "COPYING" in the main directory of this archive |
9 | * for more details. | 9 | * for more details. |
10 | */ | 10 | */ |
11 | #include <linux/mm.h> | 11 | #include <linux/mm.h> |
12 | #include <linux/io.h> | ||
13 | #include <asm/mmu_context.h> | 12 | #include <asm/mmu_context.h> |
14 | #include <asm/tlbflush.h> | 13 | #include <asm/tlbflush.h> |
15 | #include <asm/cacheflush.h> | ||
16 | 14 | ||
17 | void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long page) | 15 | void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long page) |
18 | { | 16 | { |
@@ -140,54 +138,3 @@ void local_flush_tlb_all(void) | |||
140 | ctrl_barrier(); | 138 | ctrl_barrier(); |
141 | local_irq_restore(flags); | 139 | local_irq_restore(flags); |
142 | } | 140 | } |
143 | |||
144 | void update_mmu_cache(struct vm_area_struct *vma, | ||
145 | unsigned long address, pte_t pte) | ||
146 | { | ||
147 | unsigned long flags; | ||
148 | unsigned long pteval; | ||
149 | unsigned long vpn; | ||
150 | struct page *page; | ||
151 | unsigned long pfn = pte_pfn(pte); | ||
152 | struct address_space *mapping; | ||
153 | |||
154 | if (!pfn_valid(pfn)) | ||
155 | return; | ||
156 | |||
157 | page = pfn_to_page(pfn); | ||
158 | mapping = page_mapping(page); | ||
159 | if (mapping) { | ||
160 | unsigned long phys = pte_val(pte) & PTE_PHYS_MASK; | ||
161 | int dirty = test_and_clear_bit(PG_dcache_dirty, &page->flags); | ||
162 | |||
163 | if (dirty) | ||
164 | __flush_wback_region((void *)P1SEGADDR(phys), | ||
165 | PAGE_SIZE); | ||
166 | } | ||
167 | |||
168 | local_irq_save(flags); | ||
169 | |||
170 | /* Set PTEH register */ | ||
171 | vpn = (address & MMU_VPN_MASK) | get_asid(); | ||
172 | ctrl_outl(vpn, MMU_PTEH); | ||
173 | |||
174 | pteval = pte_val(pte); | ||
175 | |||
176 | #ifdef CONFIG_CPU_HAS_PTEA | ||
177 | /* Set PTEA register */ | ||
178 | /* TODO: make this look less hacky */ | ||
179 | ctrl_outl(((pteval >> 28) & 0xe) | (pteval & 0x1), MMU_PTEA); | ||
180 | #endif | ||
181 | |||
182 | /* Set PTEL register */ | ||
183 | pteval &= _PAGE_FLAGS_HARDWARE_MASK; /* drop software flags */ | ||
184 | #if defined(CONFIG_SH_WRITETHROUGH) && defined(CONFIG_CPU_SH4) | ||
185 | pteval |= _PAGE_WT; | ||
186 | #endif | ||
187 | /* conveniently, we want all the software flags to be 0 anyway */ | ||
188 | ctrl_outl(pteval, MMU_PTEL); | ||
189 | |||
190 | /* Load the TLB */ | ||
191 | asm volatile("ldtlb": /* no output */ : /* no input */ : "memory"); | ||
192 | local_irq_restore(flags); | ||
193 | } | ||
diff --git a/arch/sh/mm/tlb-sh3.c b/arch/sh/mm/tlb-sh3.c index e5e76eb7ee09..7fbfd5a11ffa 100644 --- a/arch/sh/mm/tlb-sh3.c +++ b/arch/sh/mm/tlb-sh3.c | |||
@@ -8,9 +8,69 @@ | |||
8 | * | 8 | * |
9 | * Released under the terms of the GNU GPL v2.0. | 9 | * Released under the terms of the GNU GPL v2.0. |
10 | */ | 10 | */ |
11 | #include <linux/io.h> | 11 | #include <linux/signal.h> |
12 | #include <linux/sched.h> | ||
13 | #include <linux/kernel.h> | ||
14 | #include <linux/errno.h> | ||
15 | #include <linux/string.h> | ||
16 | #include <linux/types.h> | ||
17 | #include <linux/ptrace.h> | ||
18 | #include <linux/mman.h> | ||
19 | #include <linux/mm.h> | ||
20 | #include <linux/smp.h> | ||
21 | #include <linux/smp_lock.h> | ||
22 | #include <linux/interrupt.h> | ||
23 | |||
12 | #include <asm/system.h> | 24 | #include <asm/system.h> |
25 | #include <asm/io.h> | ||
26 | #include <asm/uaccess.h> | ||
27 | #include <asm/pgalloc.h> | ||
13 | #include <asm/mmu_context.h> | 28 | #include <asm/mmu_context.h> |
29 | #include <asm/cacheflush.h> | ||
30 | |||
31 | void update_mmu_cache(struct vm_area_struct * vma, | ||
32 | unsigned long address, pte_t pte) | ||
33 | { | ||
34 | unsigned long flags; | ||
35 | unsigned long pteval; | ||
36 | unsigned long vpn; | ||
37 | |||
38 | /* Ptrace may call this routine. */ | ||
39 | if (vma && current->active_mm != vma->vm_mm) | ||
40 | return; | ||
41 | |||
42 | #if defined(CONFIG_SH7705_CACHE_32KB) | ||
43 | { | ||
44 | struct page *page = pte_page(pte); | ||
45 | unsigned long pfn = pte_pfn(pte); | ||
46 | |||
47 | if (pfn_valid(pfn) && !test_bit(PG_mapped, &page->flags)) { | ||
48 | unsigned long phys = pte_val(pte) & PTE_PHYS_MASK; | ||
49 | |||
50 | __flush_wback_region((void *)P1SEGADDR(phys), | ||
51 | PAGE_SIZE); | ||
52 | __set_bit(PG_mapped, &page->flags); | ||
53 | } | ||
54 | } | ||
55 | #endif | ||
56 | |||
57 | local_irq_save(flags); | ||
58 | |||
59 | /* Set PTEH register */ | ||
60 | vpn = (address & MMU_VPN_MASK) | get_asid(); | ||
61 | ctrl_outl(vpn, MMU_PTEH); | ||
62 | |||
63 | pteval = pte_val(pte); | ||
64 | |||
65 | /* Set PTEL register */ | ||
66 | pteval &= _PAGE_FLAGS_HARDWARE_MASK; /* drop software flags */ | ||
67 | /* conveniently, we want all the software flags to be 0 anyway */ | ||
68 | ctrl_outl(pteval, MMU_PTEL); | ||
69 | |||
70 | /* Load the TLB */ | ||
71 | asm volatile("ldtlb": /* no output */ : /* no input */ : "memory"); | ||
72 | local_irq_restore(flags); | ||
73 | } | ||
14 | 74 | ||
15 | void local_flush_tlb_one(unsigned long asid, unsigned long page) | 75 | void local_flush_tlb_one(unsigned long asid, unsigned long page) |
16 | { | 76 | { |
@@ -34,3 +94,4 @@ void local_flush_tlb_one(unsigned long asid, unsigned long page) | |||
34 | for (i = 0; i < ways; i++) | 94 | for (i = 0; i < ways; i++) |
35 | ctrl_outl(data, addr + (i << 8)); | 95 | ctrl_outl(data, addr + (i << 8)); |
36 | } | 96 | } |
97 | |||
diff --git a/arch/sh/mm/tlb-sh4.c b/arch/sh/mm/tlb-sh4.c index 221e7095473d..f74cf667c8fa 100644 --- a/arch/sh/mm/tlb-sh4.c +++ b/arch/sh/mm/tlb-sh4.c | |||
@@ -8,9 +8,74 @@ | |||
8 | * | 8 | * |
9 | * Released under the terms of the GNU GPL v2.0. | 9 | * Released under the terms of the GNU GPL v2.0. |
10 | */ | 10 | */ |
11 | #include <linux/io.h> | 11 | #include <linux/signal.h> |
12 | #include <linux/sched.h> | ||
13 | #include <linux/kernel.h> | ||
14 | #include <linux/errno.h> | ||
15 | #include <linux/string.h> | ||
16 | #include <linux/types.h> | ||
17 | #include <linux/ptrace.h> | ||
18 | #include <linux/mman.h> | ||
19 | #include <linux/mm.h> | ||
20 | #include <linux/smp.h> | ||
21 | #include <linux/smp_lock.h> | ||
22 | #include <linux/interrupt.h> | ||
23 | |||
12 | #include <asm/system.h> | 24 | #include <asm/system.h> |
25 | #include <asm/io.h> | ||
26 | #include <asm/uaccess.h> | ||
27 | #include <asm/pgalloc.h> | ||
13 | #include <asm/mmu_context.h> | 28 | #include <asm/mmu_context.h> |
29 | #include <asm/cacheflush.h> | ||
30 | |||
31 | void update_mmu_cache(struct vm_area_struct * vma, | ||
32 | unsigned long address, pte_t pte) | ||
33 | { | ||
34 | unsigned long flags; | ||
35 | unsigned long pteval; | ||
36 | unsigned long vpn; | ||
37 | struct page *page; | ||
38 | unsigned long pfn; | ||
39 | |||
40 | /* Ptrace may call this routine. */ | ||
41 | if (vma && current->active_mm != vma->vm_mm) | ||
42 | return; | ||
43 | |||
44 | pfn = pte_pfn(pte); | ||
45 | if (pfn_valid(pfn)) { | ||
46 | page = pfn_to_page(pfn); | ||
47 | if (!test_bit(PG_mapped, &page->flags)) { | ||
48 | unsigned long phys = pte_val(pte) & PTE_PHYS_MASK; | ||
49 | __flush_wback_region((void *)P1SEGADDR(phys), PAGE_SIZE); | ||
50 | __set_bit(PG_mapped, &page->flags); | ||
51 | } | ||
52 | } | ||
53 | |||
54 | local_irq_save(flags); | ||
55 | |||
56 | /* Set PTEH register */ | ||
57 | vpn = (address & MMU_VPN_MASK) | get_asid(); | ||
58 | ctrl_outl(vpn, MMU_PTEH); | ||
59 | |||
60 | pteval = pte_val(pte); | ||
61 | |||
62 | /* Set PTEA register */ | ||
63 | if (cpu_data->flags & CPU_HAS_PTEA) | ||
64 | /* TODO: make this look less hacky */ | ||
65 | ctrl_outl(((pteval >> 28) & 0xe) | (pteval & 0x1), MMU_PTEA); | ||
66 | |||
67 | /* Set PTEL register */ | ||
68 | pteval &= _PAGE_FLAGS_HARDWARE_MASK; /* drop software flags */ | ||
69 | #ifdef CONFIG_SH_WRITETHROUGH | ||
70 | pteval |= _PAGE_WT; | ||
71 | #endif | ||
72 | /* conveniently, we want all the software flags to be 0 anyway */ | ||
73 | ctrl_outl(pteval, MMU_PTEL); | ||
74 | |||
75 | /* Load the TLB */ | ||
76 | asm volatile("ldtlb": /* no output */ : /* no input */ : "memory"); | ||
77 | local_irq_restore(flags); | ||
78 | } | ||
14 | 79 | ||
15 | void local_flush_tlb_one(unsigned long asid, unsigned long page) | 80 | void local_flush_tlb_one(unsigned long asid, unsigned long page) |
16 | { | 81 | { |
@@ -28,3 +93,4 @@ void local_flush_tlb_one(unsigned long asid, unsigned long page) | |||
28 | ctrl_outl(data, addr); | 93 | ctrl_outl(data, addr); |
29 | back_to_P1(); | 94 | back_to_P1(); |
30 | } | 95 | } |
96 | |||
diff --git a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c index 35443729aad8..cd4643a37022 100644 --- a/arch/x86_64/kernel/smpboot.c +++ b/arch/x86_64/kernel/smpboot.c | |||
@@ -923,8 +923,9 @@ void __init smp_prepare_boot_cpu(void) | |||
923 | */ | 923 | */ |
924 | int __cpuinit __cpu_up(unsigned int cpu) | 924 | int __cpuinit __cpu_up(unsigned int cpu) |
925 | { | 925 | { |
926 | int err; | ||
927 | int apicid = cpu_present_to_apicid(cpu); | 926 | int apicid = cpu_present_to_apicid(cpu); |
927 | unsigned long flags; | ||
928 | int err; | ||
928 | 929 | ||
929 | WARN_ON(irqs_disabled()); | 930 | WARN_ON(irqs_disabled()); |
930 | 931 | ||
@@ -958,7 +959,9 @@ int __cpuinit __cpu_up(unsigned int cpu) | |||
958 | /* | 959 | /* |
959 | * Make sure and check TSC sync: | 960 | * Make sure and check TSC sync: |
960 | */ | 961 | */ |
962 | local_irq_save(flags); | ||
961 | check_tsc_sync_source(cpu); | 963 | check_tsc_sync_source(cpu); |
964 | local_irq_restore(flags); | ||
962 | 965 | ||
963 | while (!cpu_isset(cpu, cpu_online_map)) | 966 | while (!cpu_isset(cpu, cpu_online_map)) |
964 | cpu_relax(); | 967 | cpu_relax(); |
diff --git a/drivers/char/ds1286.c b/drivers/char/ds1286.c index 6d58b0370802..59146e3365ba 100644 --- a/drivers/char/ds1286.c +++ b/drivers/char/ds1286.c | |||
@@ -197,6 +197,7 @@ static int ds1286_ioctl(struct inode *inode, struct file *file, | |||
197 | 197 | ||
198 | hrs = alm_tm.tm_hour; | 198 | hrs = alm_tm.tm_hour; |
199 | min = alm_tm.tm_min; | 199 | min = alm_tm.tm_min; |
200 | sec = alm_tm.tm_sec; | ||
200 | 201 | ||
201 | if (hrs >= 24) | 202 | if (hrs >= 24) |
202 | hrs = 0xff; | 203 | hrs = 0xff; |
@@ -204,9 +205,11 @@ static int ds1286_ioctl(struct inode *inode, struct file *file, | |||
204 | if (min >= 60) | 205 | if (min >= 60) |
205 | min = 0xff; | 206 | min = 0xff; |
206 | 207 | ||
207 | BIN_TO_BCD(sec); | 208 | if (sec != 0) |
208 | BIN_TO_BCD(min); | 209 | return -EINVAL; |
209 | BIN_TO_BCD(hrs); | 210 | |
211 | min = BIN2BCD(min); | ||
212 | min = BIN2BCD(hrs); | ||
210 | 213 | ||
211 | spin_lock(&ds1286_lock); | 214 | spin_lock(&ds1286_lock); |
212 | rtc_write(hrs, RTC_HOURS_ALARM); | 215 | rtc_write(hrs, RTC_HOURS_ALARM); |
diff --git a/drivers/connector/connector.c b/drivers/connector/connector.c index a44db75bc25b..a905f7820331 100644 --- a/drivers/connector/connector.c +++ b/drivers/connector/connector.c | |||
@@ -128,7 +128,7 @@ EXPORT_SYMBOL_GPL(cn_netlink_send); | |||
128 | */ | 128 | */ |
129 | static int cn_call_callback(struct cn_msg *msg, void (*destruct_data)(void *), void *data) | 129 | static int cn_call_callback(struct cn_msg *msg, void (*destruct_data)(void *), void *data) |
130 | { | 130 | { |
131 | struct cn_callback_entry *__cbq; | 131 | struct cn_callback_entry *__cbq, *__new_cbq; |
132 | struct cn_dev *dev = &cdev; | 132 | struct cn_dev *dev = &cdev; |
133 | int err = -ENODEV; | 133 | int err = -ENODEV; |
134 | 134 | ||
@@ -148,27 +148,27 @@ static int cn_call_callback(struct cn_msg *msg, void (*destruct_data)(void *), v | |||
148 | } else { | 148 | } else { |
149 | struct cn_callback_data *d; | 149 | struct cn_callback_data *d; |
150 | 150 | ||
151 | __cbq = kzalloc(sizeof(*__cbq), GFP_ATOMIC); | 151 | err = -ENOMEM; |
152 | if (__cbq) { | 152 | __new_cbq = kzalloc(sizeof(struct cn_callback_entry), GFP_ATOMIC); |
153 | d = &__cbq->data; | 153 | if (__new_cbq) { |
154 | d = &__new_cbq->data; | ||
154 | d->callback_priv = msg; | 155 | d->callback_priv = msg; |
155 | d->callback = __cbq->data.callback; | 156 | d->callback = __cbq->data.callback; |
156 | d->ddata = data; | 157 | d->ddata = data; |
157 | d->destruct_data = destruct_data; | 158 | d->destruct_data = destruct_data; |
158 | d->free = __cbq; | 159 | d->free = __new_cbq; |
159 | 160 | ||
160 | INIT_WORK(&__cbq->work, | 161 | INIT_WORK(&__new_cbq->work, |
161 | &cn_queue_wrapper); | 162 | &cn_queue_wrapper); |
162 | 163 | ||
163 | if (queue_work(dev->cbdev->cn_queue, | 164 | if (queue_work(dev->cbdev->cn_queue, |
164 | &__cbq->work)) | 165 | &__new_cbq->work)) |
165 | err = 0; | 166 | err = 0; |
166 | else { | 167 | else { |
167 | kfree(__cbq); | 168 | kfree(__new_cbq); |
168 | err = -EINVAL; | 169 | err = -EINVAL; |
169 | } | 170 | } |
170 | } else | 171 | } |
171 | err = -ENOMEM; | ||
172 | } | 172 | } |
173 | break; | 173 | break; |
174 | } | 174 | } |
diff --git a/drivers/video/backlight/locomolcd.c b/drivers/video/backlight/locomolcd.c index d1312477813e..6b488b8a7eee 100644 --- a/drivers/video/backlight/locomolcd.c +++ b/drivers/video/backlight/locomolcd.c | |||
@@ -199,8 +199,8 @@ static int locomolcd_remove(struct locomo_dev *dev) | |||
199 | { | 199 | { |
200 | unsigned long flags; | 200 | unsigned long flags; |
201 | 201 | ||
202 | locomobl_data.brightness = 0; | 202 | locomolcd_bl_device->props.brightness = 0; |
203 | locomobl_data.power = 0; | 203 | locomolcd_bl_device->props.power = 0; |
204 | locomolcd_set_intensity(locomolcd_bl_device); | 204 | locomolcd_set_intensity(locomolcd_bl_device); |
205 | 205 | ||
206 | backlight_device_unregister(locomolcd_bl_device); | 206 | backlight_device_unregister(locomolcd_bl_device); |
diff --git a/fs/dlm/user.c b/fs/dlm/user.c index 40db61dc95f2..3870150b83a4 100644 --- a/fs/dlm/user.c +++ b/fs/dlm/user.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include "lockspace.h" | 22 | #include "lockspace.h" |
23 | #include "lock.h" | 23 | #include "lock.h" |
24 | #include "lvb_table.h" | 24 | #include "lvb_table.h" |
25 | #include "user.h" | ||
25 | 26 | ||
26 | static const char *name_prefix="dlm"; | 27 | static const char *name_prefix="dlm"; |
27 | static struct miscdevice ctl_device; | 28 | static struct miscdevice ctl_device; |
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 6618c1190252..12accb08fe02 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/list.h> | 20 | #include <linux/list.h> |
21 | #include <linux/lm_interface.h> | 21 | #include <linux/lm_interface.h> |
22 | #include <linux/wait.h> | 22 | #include <linux/wait.h> |
23 | #include <linux/module.h> | ||
23 | #include <linux/rwsem.h> | 24 | #include <linux/rwsem.h> |
24 | #include <asm/uaccess.h> | 25 | #include <asm/uaccess.h> |
25 | 26 | ||
@@ -953,9 +954,6 @@ static void drop_bh(struct gfs2_glock *gl, unsigned int ret) | |||
953 | spin_unlock(&gl->gl_spin); | 954 | spin_unlock(&gl->gl_spin); |
954 | } | 955 | } |
955 | 956 | ||
956 | if (glops->go_drop_bh) | ||
957 | glops->go_drop_bh(gl); | ||
958 | |||
959 | spin_lock(&gl->gl_spin); | 957 | spin_lock(&gl->gl_spin); |
960 | gl->gl_req_gh = NULL; | 958 | gl->gl_req_gh = NULL; |
961 | gl->gl_req_bh = NULL; | 959 | gl->gl_req_bh = NULL; |
diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c index 46af55355513..39c8ae23bd9c 100644 --- a/fs/gfs2/glops.c +++ b/fs/gfs2/glops.c | |||
@@ -245,7 +245,6 @@ static void inode_go_inval(struct gfs2_glock *gl, int flags) | |||
245 | 245 | ||
246 | if (ip && S_ISREG(ip->i_inode.i_mode)) { | 246 | if (ip && S_ISREG(ip->i_inode.i_mode)) { |
247 | truncate_inode_pages(ip->i_inode.i_mapping, 0); | 247 | truncate_inode_pages(ip->i_inode.i_mapping, 0); |
248 | gfs2_assert_withdraw(GFS2_SB(&ip->i_inode), !ip->i_inode.i_mapping->nrpages); | ||
249 | clear_bit(GIF_PAGED, &ip->i_flags); | 248 | clear_bit(GIF_PAGED, &ip->i_flags); |
250 | } | 249 | } |
251 | } | 250 | } |
@@ -459,6 +458,8 @@ const struct gfs2_glock_operations gfs2_inode_glops = { | |||
459 | }; | 458 | }; |
460 | 459 | ||
461 | const struct gfs2_glock_operations gfs2_rgrp_glops = { | 460 | const struct gfs2_glock_operations gfs2_rgrp_glops = { |
461 | .go_xmote_th = meta_go_sync, | ||
462 | .go_drop_th = meta_go_sync, | ||
462 | .go_inval = meta_go_inval, | 463 | .go_inval = meta_go_inval, |
463 | .go_demote_ok = rgrp_go_demote_ok, | 464 | .go_demote_ok = rgrp_go_demote_ok, |
464 | .go_lock = rgrp_go_lock, | 465 | .go_lock = rgrp_go_lock, |
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h index 12c80fd28db5..49f0dbf40d86 100644 --- a/fs/gfs2/incore.h +++ b/fs/gfs2/incore.h | |||
@@ -104,7 +104,6 @@ struct gfs2_glock_operations { | |||
104 | void (*go_xmote_th) (struct gfs2_glock *gl); | 104 | void (*go_xmote_th) (struct gfs2_glock *gl); |
105 | void (*go_xmote_bh) (struct gfs2_glock *gl); | 105 | void (*go_xmote_bh) (struct gfs2_glock *gl); |
106 | void (*go_drop_th) (struct gfs2_glock *gl); | 106 | void (*go_drop_th) (struct gfs2_glock *gl); |
107 | void (*go_drop_bh) (struct gfs2_glock *gl); | ||
108 | void (*go_inval) (struct gfs2_glock *gl, int flags); | 107 | void (*go_inval) (struct gfs2_glock *gl, int flags); |
109 | int (*go_demote_ok) (struct gfs2_glock *gl); | 108 | int (*go_demote_ok) (struct gfs2_glock *gl); |
110 | int (*go_lock) (struct gfs2_holder *gh); | 109 | int (*go_lock) (struct gfs2_holder *gh); |
@@ -416,7 +415,6 @@ struct gfs2_tune { | |||
416 | unsigned int gt_stall_secs; /* Detects trouble! */ | 415 | unsigned int gt_stall_secs; /* Detects trouble! */ |
417 | unsigned int gt_complain_secs; | 416 | unsigned int gt_complain_secs; |
418 | unsigned int gt_reclaim_limit; /* Max num of glocks in reclaim list */ | 417 | unsigned int gt_reclaim_limit; /* Max num of glocks in reclaim list */ |
419 | unsigned int gt_entries_per_readdir; | ||
420 | unsigned int gt_statfs_quantum; | 418 | unsigned int gt_statfs_quantum; |
421 | unsigned int gt_statfs_slow; | 419 | unsigned int gt_statfs_slow; |
422 | }; | 420 | }; |
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index 0d6831a40565..df0b8b3018b9 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c | |||
@@ -43,7 +43,8 @@ static int iget_test(struct inode *inode, void *opaque) | |||
43 | struct gfs2_inode *ip = GFS2_I(inode); | 43 | struct gfs2_inode *ip = GFS2_I(inode); |
44 | struct gfs2_inum_host *inum = opaque; | 44 | struct gfs2_inum_host *inum = opaque; |
45 | 45 | ||
46 | if (ip->i_num.no_addr == inum->no_addr) | 46 | if (ip->i_num.no_addr == inum->no_addr && |
47 | inode->i_private != NULL) | ||
47 | return 1; | 48 | return 1; |
48 | 49 | ||
49 | return 0; | 50 | return 0; |
@@ -61,13 +62,13 @@ static int iget_set(struct inode *inode, void *opaque) | |||
61 | 62 | ||
62 | struct inode *gfs2_ilookup(struct super_block *sb, struct gfs2_inum_host *inum) | 63 | struct inode *gfs2_ilookup(struct super_block *sb, struct gfs2_inum_host *inum) |
63 | { | 64 | { |
64 | return ilookup5(sb, (unsigned long)inum->no_formal_ino, | 65 | return ilookup5(sb, (unsigned long)inum->no_addr, |
65 | iget_test, inum); | 66 | iget_test, inum); |
66 | } | 67 | } |
67 | 68 | ||
68 | static struct inode *gfs2_iget(struct super_block *sb, struct gfs2_inum_host *inum) | 69 | static struct inode *gfs2_iget(struct super_block *sb, struct gfs2_inum_host *inum) |
69 | { | 70 | { |
70 | return iget5_locked(sb, (unsigned long)inum->no_formal_ino, | 71 | return iget5_locked(sb, (unsigned long)inum->no_addr, |
71 | iget_test, iget_set, inum); | 72 | iget_test, iget_set, inum); |
72 | } | 73 | } |
73 | 74 | ||
diff --git a/fs/gfs2/ops_address.c b/fs/gfs2/ops_address.c index 56e33590b656..b3b7e8475359 100644 --- a/fs/gfs2/ops_address.c +++ b/fs/gfs2/ops_address.c | |||
@@ -266,9 +266,11 @@ skip_lock: | |||
266 | out: | 266 | out: |
267 | return error; | 267 | return error; |
268 | out_unlock: | 268 | out_unlock: |
269 | if (error == GLR_TRYFAILED) | ||
270 | error = AOP_TRUNCATED_PAGE; | ||
271 | unlock_page(page); | 269 | unlock_page(page); |
270 | if (error == GLR_TRYFAILED) { | ||
271 | error = AOP_TRUNCATED_PAGE; | ||
272 | yield(); | ||
273 | } | ||
272 | if (do_unlock) | 274 | if (do_unlock) |
273 | gfs2_holder_uninit(&gh); | 275 | gfs2_holder_uninit(&gh); |
274 | goto out; | 276 | goto out; |
@@ -364,6 +366,7 @@ static int gfs2_prepare_write(struct file *file, struct page *page, | |||
364 | if (error == GLR_TRYFAILED) { | 366 | if (error == GLR_TRYFAILED) { |
365 | unlock_page(page); | 367 | unlock_page(page); |
366 | error = AOP_TRUNCATED_PAGE; | 368 | error = AOP_TRUNCATED_PAGE; |
369 | yield(); | ||
367 | } | 370 | } |
368 | goto out_uninit; | 371 | goto out_uninit; |
369 | } | 372 | } |
diff --git a/fs/gfs2/ops_export.c b/fs/gfs2/ops_export.c index 1de05b63d43a..aad918337a46 100644 --- a/fs/gfs2/ops_export.c +++ b/fs/gfs2/ops_export.c | |||
@@ -38,14 +38,11 @@ static struct dentry *gfs2_decode_fh(struct super_block *sb, | |||
38 | struct gfs2_fh_obj fh_obj; | 38 | struct gfs2_fh_obj fh_obj; |
39 | struct gfs2_inum_host *this, parent; | 39 | struct gfs2_inum_host *this, parent; |
40 | 40 | ||
41 | if (fh_type != fh_len) | ||
42 | return NULL; | ||
43 | |||
44 | this = &fh_obj.this; | 41 | this = &fh_obj.this; |
45 | fh_obj.imode = DT_UNKNOWN; | 42 | fh_obj.imode = DT_UNKNOWN; |
46 | memset(&parent, 0, sizeof(struct gfs2_inum)); | 43 | memset(&parent, 0, sizeof(struct gfs2_inum)); |
47 | 44 | ||
48 | switch (fh_type) { | 45 | switch (fh_len) { |
49 | case GFS2_LARGE_FH_SIZE: | 46 | case GFS2_LARGE_FH_SIZE: |
50 | parent.no_formal_ino = ((u64)be32_to_cpu(fh[4])) << 32; | 47 | parent.no_formal_ino = ((u64)be32_to_cpu(fh[4])) << 32; |
51 | parent.no_formal_ino |= be32_to_cpu(fh[5]); | 48 | parent.no_formal_ino |= be32_to_cpu(fh[5]); |
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index ee80b8a5e7bc..ee54cb667083 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c | |||
@@ -840,7 +840,7 @@ static struct super_block* get_gfs2_sb(const char *dev_name) | |||
840 | } | 840 | } |
841 | 841 | ||
842 | printk(KERN_WARNING "GFS2: Unrecognized block device or " | 842 | printk(KERN_WARNING "GFS2: Unrecognized block device or " |
843 | "mount point %s", dev_name); | 843 | "mount point %s\n", dev_name); |
844 | 844 | ||
845 | free_nd: | 845 | free_nd: |
846 | path_release(&nd); | 846 | path_release(&nd); |
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index d0db881b55d2..c186857e48a8 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c | |||
@@ -279,7 +279,7 @@ static int bh_get(struct gfs2_quota_data *qd) | |||
279 | (bh->b_data + sizeof(struct gfs2_meta_header) + | 279 | (bh->b_data + sizeof(struct gfs2_meta_header) + |
280 | offset * sizeof(struct gfs2_quota_change)); | 280 | offset * sizeof(struct gfs2_quota_change)); |
281 | 281 | ||
282 | mutex_lock(&sdp->sd_quota_mutex); | 282 | mutex_unlock(&sdp->sd_quota_mutex); |
283 | 283 | ||
284 | return 0; | 284 | return 0; |
285 | 285 | ||
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index 70f424fcf1cd..4fdda974dc83 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c | |||
@@ -76,7 +76,6 @@ void gfs2_tune_init(struct gfs2_tune *gt) | |||
76 | gt->gt_stall_secs = 600; | 76 | gt->gt_stall_secs = 600; |
77 | gt->gt_complain_secs = 10; | 77 | gt->gt_complain_secs = 10; |
78 | gt->gt_reclaim_limit = 5000; | 78 | gt->gt_reclaim_limit = 5000; |
79 | gt->gt_entries_per_readdir = 32; | ||
80 | gt->gt_statfs_quantum = 30; | 79 | gt->gt_statfs_quantum = 30; |
81 | gt->gt_statfs_slow = 0; | 80 | gt->gt_statfs_slow = 0; |
82 | } | 81 | } |
diff --git a/include/asm-arm/arch-lh7a40x/entry-macro.S b/include/asm-arm/arch-lh7a40x/entry-macro.S index 502700604e00..ffe397250f0c 100644 --- a/include/asm-arm/arch-lh7a40x/entry-macro.S +++ b/include/asm-arm/arch-lh7a40x/entry-macro.S | |||
@@ -86,6 +86,12 @@ branch_irq_lh7a400: b 1000f | |||
86 | .macro disable_fiq | 86 | .macro disable_fiq |
87 | .endm | 87 | .endm |
88 | 88 | ||
89 | .macro get_irqnr_preamble, base, tmp | ||
90 | .endm | ||
91 | |||
92 | .macro arch_ret_to_user, tmp1, tmp2 | ||
93 | .endm | ||
94 | |||
89 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | 95 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
90 | mov \irqnr, #0 | 96 | mov \irqnr, #0 |
91 | mov \base, #io_p2v(0x80000000) @ APB registers | 97 | mov \base, #io_p2v(0x80000000) @ APB registers |
@@ -105,6 +111,12 @@ branch_irq_lh7a400: b 1000f | |||
105 | .macro disable_fiq | 111 | .macro disable_fiq |
106 | .endm | 112 | .endm |
107 | 113 | ||
114 | .macro get_irqnr_preamble, base, tmp | ||
115 | .endm | ||
116 | |||
117 | .macro arch_ret_to_user, tmp1, tmp2 | ||
118 | .endm | ||
119 | |||
108 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | 120 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
109 | mov \irqnr, #0 @ VIC1 irq base | 121 | mov \irqnr, #0 @ VIC1 irq base |
110 | mov \base, #io_p2v(0x80000000) @ APB registers | 122 | mov \base, #io_p2v(0x80000000) @ APB registers |
diff --git a/include/asm-avr32/Kbuild b/include/asm-avr32/Kbuild index 8770e73ce938..3136628ba8d2 100644 --- a/include/asm-avr32/Kbuild +++ b/include/asm-avr32/Kbuild | |||
@@ -1,3 +1,3 @@ | |||
1 | include include/asm-generic/Kbuild.asm | 1 | include include/asm-generic/Kbuild.asm |
2 | 2 | ||
3 | headers-y += cachectl.h | 3 | header-y += cachectl.h |
diff --git a/include/asm-avr32/dma-mapping.h b/include/asm-avr32/dma-mapping.h index 115813e48fe0..21bb60bbb9a1 100644 --- a/include/asm-avr32/dma-mapping.h +++ b/include/asm-avr32/dma-mapping.h | |||
@@ -274,6 +274,24 @@ dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, | |||
274 | dma_cache_sync(dev, bus_to_virt(dma_handle), size, direction); | 274 | dma_cache_sync(dev, bus_to_virt(dma_handle), size, direction); |
275 | } | 275 | } |
276 | 276 | ||
277 | static inline void | ||
278 | dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t dma_handle, | ||
279 | unsigned long offset, size_t size, | ||
280 | enum dma_data_direction direction) | ||
281 | { | ||
282 | /* just sync everything, that's all the pci API can do */ | ||
283 | dma_sync_single_for_cpu(dev, dma_handle, offset+size, direction); | ||
284 | } | ||
285 | |||
286 | static inline void | ||
287 | dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_handle, | ||
288 | unsigned long offset, size_t size, | ||
289 | enum dma_data_direction direction) | ||
290 | { | ||
291 | /* just sync everything, that's all the pci API can do */ | ||
292 | dma_sync_single_for_device(dev, dma_handle, offset+size, direction); | ||
293 | } | ||
294 | |||
277 | /** | 295 | /** |
278 | * dma_sync_sg_for_cpu | 296 | * dma_sync_sg_for_cpu |
279 | * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices | 297 | * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices |
diff --git a/include/asm-mips/dma.h b/include/asm-mips/dma.h index e06ef0776d48..833437d31ef1 100644 --- a/include/asm-mips/dma.h +++ b/include/asm-mips/dma.h | |||
@@ -74,7 +74,7 @@ | |||
74 | * | 74 | * |
75 | */ | 75 | */ |
76 | 76 | ||
77 | #ifndef GENERIC_ISA_DMA_SUPPORT_BROKEN | 77 | #ifndef CONFIG_GENERIC_ISA_DMA_SUPPORT_BROKEN |
78 | #define MAX_DMA_CHANNELS 8 | 78 | #define MAX_DMA_CHANNELS 8 |
79 | #endif | 79 | #endif |
80 | 80 | ||
diff --git a/include/asm-sh/cache.h b/include/asm-sh/cache.h index e3a180cf5062..9a3cb6ba9d15 100644 --- a/include/asm-sh/cache.h +++ b/include/asm-sh/cache.h | |||
@@ -21,6 +21,7 @@ | |||
21 | 21 | ||
22 | #define L1_CACHE_ALIGN(x) (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1)) | 22 | #define L1_CACHE_ALIGN(x) (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1)) |
23 | 23 | ||
24 | #ifndef __ASSEMBLY__ | ||
24 | struct cache_info { | 25 | struct cache_info { |
25 | unsigned int ways; /* Number of cache ways */ | 26 | unsigned int ways; /* Number of cache ways */ |
26 | unsigned int sets; /* Number of cache sets */ | 27 | unsigned int sets; /* Number of cache sets */ |
@@ -47,6 +48,6 @@ struct cache_info { | |||
47 | 48 | ||
48 | unsigned long flags; | 49 | unsigned long flags; |
49 | }; | 50 | }; |
50 | 51 | #endif /* __ASSEMBLY__ */ | |
51 | #endif /* __KERNEL__ */ | 52 | #endif /* __KERNEL__ */ |
52 | #endif /* __ASM_SH_CACHE_H */ | 53 | #endif /* __ASM_SH_CACHE_H */ |
diff --git a/include/asm-sh/cacheflush.h b/include/asm-sh/cacheflush.h index 22f12634975b..07f62ec9ff0c 100644 --- a/include/asm-sh/cacheflush.h +++ b/include/asm-sh/cacheflush.h | |||
@@ -30,8 +30,5 @@ extern void __flush_invalidate_region(void *start, int size); | |||
30 | 30 | ||
31 | #define HAVE_ARCH_UNMAPPED_AREA | 31 | #define HAVE_ARCH_UNMAPPED_AREA |
32 | 32 | ||
33 | /* Page flag for lazy dcache write-back for the aliasing UP caches */ | ||
34 | #define PG_dcache_dirty PG_arch_1 | ||
35 | |||
36 | #endif /* __KERNEL__ */ | 33 | #endif /* __KERNEL__ */ |
37 | #endif /* __ASM_SH_CACHEFLUSH_H */ | 34 | #endif /* __ASM_SH_CACHEFLUSH_H */ |
diff --git a/include/asm-sh/cpu-sh3/cacheflush.h b/include/asm-sh/cpu-sh3/cacheflush.h index 6fabbba228de..f70d8ef76a15 100644 --- a/include/asm-sh/cpu-sh3/cacheflush.h +++ b/include/asm-sh/cpu-sh3/cacheflush.h | |||
@@ -36,6 +36,8 @@ | |||
36 | /* 32KB cache, 4kb PAGE sizes need to check bit 12 */ | 36 | /* 32KB cache, 4kb PAGE sizes need to check bit 12 */ |
37 | #define CACHE_ALIAS 0x00001000 | 37 | #define CACHE_ALIAS 0x00001000 |
38 | 38 | ||
39 | #define PG_mapped PG_arch_1 | ||
40 | |||
39 | void flush_cache_all(void); | 41 | void flush_cache_all(void); |
40 | void flush_cache_mm(struct mm_struct *mm); | 42 | void flush_cache_mm(struct mm_struct *mm); |
41 | #define flush_cache_dup_mm(mm) flush_cache_mm(mm) | 43 | #define flush_cache_dup_mm(mm) flush_cache_mm(mm) |
diff --git a/include/asm-sh/cpu-sh4/cacheflush.h b/include/asm-sh/cpu-sh4/cacheflush.h index b3746a936a09..5fd5c89ef86a 100644 --- a/include/asm-sh/cpu-sh4/cacheflush.h +++ b/include/asm-sh/cpu-sh4/cacheflush.h | |||
@@ -39,4 +39,6 @@ void flush_icache_user_range(struct vm_area_struct *vma, struct page *page, | |||
39 | /* Initialization of P3 area for copy_user_page */ | 39 | /* Initialization of P3 area for copy_user_page */ |
40 | void p3_cache_init(void); | 40 | void p3_cache_init(void); |
41 | 41 | ||
42 | #define PG_mapped PG_arch_1 | ||
43 | |||
42 | #endif /* __ASM_CPU_SH4_CACHEFLUSH_H */ | 44 | #endif /* __ASM_CPU_SH4_CACHEFLUSH_H */ |
diff --git a/include/asm-sh/pgtable.h b/include/asm-sh/pgtable.h index 9214c015fe14..184d7fcaaf10 100644 --- a/include/asm-sh/pgtable.h +++ b/include/asm-sh/pgtable.h | |||
@@ -583,6 +583,11 @@ struct mm_struct; | |||
583 | extern unsigned int kobjsize(const void *objp); | 583 | extern unsigned int kobjsize(const void *objp); |
584 | #endif /* !CONFIG_MMU */ | 584 | #endif /* !CONFIG_MMU */ |
585 | 585 | ||
586 | #if defined(CONFIG_CPU_SH4) || defined(CONFIG_SH7705_CACHE_32KB) | ||
587 | #define __HAVE_ARCH_PTEP_GET_AND_CLEAR | ||
588 | extern pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep); | ||
589 | #endif | ||
590 | |||
586 | extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; | 591 | extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; |
587 | extern void paging_init(void); | 592 | extern void paging_init(void); |
588 | 593 | ||
diff --git a/include/asm-sh/thread_info.h b/include/asm-sh/thread_info.h index 279e70a77c75..31d55e3782d5 100644 --- a/include/asm-sh/thread_info.h +++ b/include/asm-sh/thread_info.h | |||
@@ -111,6 +111,7 @@ static inline struct thread_info *current_thread_info(void) | |||
111 | #define TIF_SIGPENDING 2 /* signal pending */ | 111 | #define TIF_SIGPENDING 2 /* signal pending */ |
112 | #define TIF_NEED_RESCHED 3 /* rescheduling necessary */ | 112 | #define TIF_NEED_RESCHED 3 /* rescheduling necessary */ |
113 | #define TIF_RESTORE_SIGMASK 4 /* restore signal mask in do_signal() */ | 113 | #define TIF_RESTORE_SIGMASK 4 /* restore signal mask in do_signal() */ |
114 | #define TIF_SINGLESTEP 5 /* singlestepping active */ | ||
114 | #define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */ | 115 | #define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */ |
115 | #define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */ | 116 | #define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */ |
116 | #define TIF_MEMDIE 18 | 117 | #define TIF_MEMDIE 18 |
@@ -121,6 +122,7 @@ static inline struct thread_info *current_thread_info(void) | |||
121 | #define _TIF_SIGPENDING (1<<TIF_SIGPENDING) | 122 | #define _TIF_SIGPENDING (1<<TIF_SIGPENDING) |
122 | #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) | 123 | #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) |
123 | #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) | 124 | #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) |
125 | #define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP) | ||
124 | #define _TIF_USEDFPU (1<<TIF_USEDFPU) | 126 | #define _TIF_USEDFPU (1<<TIF_USEDFPU) |
125 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) | 127 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) |
126 | #define _TIF_FREEZE (1<<TIF_FREEZE) | 128 | #define _TIF_FREEZE (1<<TIF_FREEZE) |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 92a1fc46ea59..5a00aa85b756 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -988,8 +988,9 @@ extern int xfrm_policy_walk(u8 type, int (*func)(struct xfrm_policy *, int, int, | |||
988 | int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl); | 988 | int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl); |
989 | struct xfrm_policy *xfrm_policy_bysel_ctx(u8 type, int dir, | 989 | struct xfrm_policy *xfrm_policy_bysel_ctx(u8 type, int dir, |
990 | struct xfrm_selector *sel, | 990 | struct xfrm_selector *sel, |
991 | struct xfrm_sec_ctx *ctx, int delete); | 991 | struct xfrm_sec_ctx *ctx, int delete, |
992 | struct xfrm_policy *xfrm_policy_byid(u8, int dir, u32 id, int delete); | 992 | int *err); |
993 | struct xfrm_policy *xfrm_policy_byid(u8, int dir, u32 id, int delete, int *err); | ||
993 | void xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info); | 994 | void xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info); |
994 | u32 xfrm_get_acqseq(void); | 995 | u32 xfrm_get_acqseq(void); |
995 | void xfrm_alloc_spi(struct xfrm_state *x, __be32 minspi, __be32 maxspi); | 996 | void xfrm_alloc_spi(struct xfrm_state *x, __be32 minspi, __be32 maxspi); |
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 34b2301276ce..1b255df4fcd0 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -846,7 +846,8 @@ static ctl_table vm_table[] = { | |||
846 | .extra2 = &one_hundred, | 846 | .extra2 = &one_hundred, |
847 | }, | 847 | }, |
848 | #endif | 848 | #endif |
849 | #ifdef CONFIG_X86_32 | 849 | #if defined(CONFIG_X86_32) || \ |
850 | (defined(CONFIG_SUPERH) && defined(CONFIG_VSYSCALL)) | ||
850 | { | 851 | { |
851 | .ctl_name = VM_VDSO_ENABLED, | 852 | .ctl_name = VM_VDSO_ENABLED, |
852 | .procname = "vdso_enabled", | 853 | .procname = "vdso_enabled", |
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index 6845a258408f..f3a2e29be40c 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c | |||
@@ -428,6 +428,10 @@ int br_add_if(struct net_bridge *br, struct net_device *dev) | |||
428 | spin_lock_bh(&br->lock); | 428 | spin_lock_bh(&br->lock); |
429 | br_stp_recalculate_bridge_id(br); | 429 | br_stp_recalculate_bridge_id(br); |
430 | br_features_recompute(br); | 430 | br_features_recompute(br); |
431 | |||
432 | if ((dev->flags & IFF_UP) && netif_carrier_ok(dev) && | ||
433 | (br->dev->flags & IFF_UP)) | ||
434 | br_stp_enable_port(p); | ||
431 | spin_unlock_bh(&br->lock); | 435 | spin_unlock_bh(&br->lock); |
432 | 436 | ||
433 | dev_set_mtu(br->dev, br_min_mtu(br)); | 437 | dev_set_mtu(br->dev, br_min_mtu(br)); |
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c index 5361a4d8e13b..746f79d104b3 100644 --- a/net/dccp/ccids/ccid3.c +++ b/net/dccp/ccids/ccid3.c | |||
@@ -545,12 +545,7 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb) | |||
545 | /* set idle flag */ | 545 | /* set idle flag */ |
546 | hctx->ccid3hctx_idle = 1; | 546 | hctx->ccid3hctx_idle = 1; |
547 | break; | 547 | break; |
548 | case TFRC_SSTATE_NO_SENT: | 548 | case TFRC_SSTATE_NO_SENT: /* fall through */ |
549 | /* | ||
550 | * XXX when implementing bidirectional rx/tx check this again | ||
551 | */ | ||
552 | DCCP_WARN("Illegal ACK received - no packet sent\n"); | ||
553 | /* fall through */ | ||
554 | case TFRC_SSTATE_TERM: /* ignore feedback when closing */ | 549 | case TFRC_SSTATE_TERM: /* ignore feedback when closing */ |
555 | break; | 550 | break; |
556 | } | 551 | } |
diff --git a/net/dccp/input.c b/net/dccp/input.c index 287099f7f042..78b043c458bf 100644 --- a/net/dccp/input.c +++ b/net/dccp/input.c | |||
@@ -248,18 +248,8 @@ int dccp_rcv_established(struct sock *sk, struct sk_buff *skb, | |||
248 | DCCP_ACKVEC_STATE_RECEIVED)) | 248 | DCCP_ACKVEC_STATE_RECEIVED)) |
249 | goto discard; | 249 | goto discard; |
250 | 250 | ||
251 | /* | 251 | ccid_hc_rx_packet_recv(dp->dccps_hc_rx_ccid, sk, skb); |
252 | * Deliver to the CCID module in charge. | 252 | ccid_hc_tx_packet_recv(dp->dccps_hc_tx_ccid, sk, skb); |
253 | * FIXME: Currently DCCP operates one-directional only, i.e. a listening | ||
254 | * server is not at the same time a connecting client. There is | ||
255 | * not much sense in delivering to both rx/tx sides at the moment | ||
256 | * (only one is active at a time); when moving to bidirectional | ||
257 | * service, this needs to be revised. | ||
258 | */ | ||
259 | if (dccp_sk(sk)->dccps_role == DCCP_ROLE_CLIENT) | ||
260 | ccid_hc_tx_packet_recv(dp->dccps_hc_tx_ccid, sk, skb); | ||
261 | else /* listening or connected server */ | ||
262 | ccid_hc_rx_packet_recv(dp->dccps_hc_rx_ccid, sk, skb); | ||
263 | 253 | ||
264 | return __dccp_rcv_established(sk, skb, dh, len); | 254 | return __dccp_rcv_established(sk, skb, dh, len); |
265 | discard: | 255 | discard: |
@@ -494,11 +484,8 @@ int dccp_rcv_state_process(struct sock *sk, struct sk_buff *skb, | |||
494 | DCCP_ACKVEC_STATE_RECEIVED)) | 484 | DCCP_ACKVEC_STATE_RECEIVED)) |
495 | goto discard; | 485 | goto discard; |
496 | 486 | ||
497 | /* XXX see the comments in dccp_rcv_established about this */ | 487 | ccid_hc_rx_packet_recv(dp->dccps_hc_rx_ccid, sk, skb); |
498 | if (dccp_sk(sk)->dccps_role == DCCP_ROLE_CLIENT) | 488 | ccid_hc_tx_packet_recv(dp->dccps_hc_tx_ccid, sk, skb); |
499 | ccid_hc_tx_packet_recv(dp->dccps_hc_tx_ccid, sk, skb); | ||
500 | else | ||
501 | ccid_hc_rx_packet_recv(dp->dccps_hc_rx_ccid, sk, skb); | ||
502 | } | 489 | } |
503 | 490 | ||
504 | /* | 491 | /* |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index ce6c46034314..fc620a7c1db4 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -1215,6 +1215,7 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct hlist_head udptable[], | |||
1215 | 1215 | ||
1216 | if (ulen < sizeof(*uh) || pskb_trim_rcsum(skb, ulen)) | 1216 | if (ulen < sizeof(*uh) || pskb_trim_rcsum(skb, ulen)) |
1217 | goto short_packet; | 1217 | goto short_packet; |
1218 | uh = skb->h.uh; | ||
1218 | 1219 | ||
1219 | udp4_csum_init(skb, uh); | 1220 | udp4_csum_init(skb, uh); |
1220 | 1221 | ||
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index e16f1bba5dff..a7fee6b27320 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -342,10 +342,6 @@ static struct inet6_dev * ipv6_add_dev(struct net_device *dev) | |||
342 | } | 342 | } |
343 | #endif | 343 | #endif |
344 | 344 | ||
345 | if (netif_carrier_ok(dev)) | ||
346 | ndev->if_flags |= IF_READY; | ||
347 | |||
348 | |||
349 | ipv6_mc_init_dev(ndev); | 345 | ipv6_mc_init_dev(ndev); |
350 | ndev->tstamp = jiffies; | 346 | ndev->tstamp = jiffies; |
351 | #ifdef CONFIG_SYSCTL | 347 | #ifdef CONFIG_SYSCTL |
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index 286c86735aed..4e0561a082d0 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c | |||
@@ -795,11 +795,15 @@ int compat_ipv6_setsockopt(struct sock *sk, int level, int optname, | |||
795 | EXPORT_SYMBOL(compat_ipv6_setsockopt); | 795 | EXPORT_SYMBOL(compat_ipv6_setsockopt); |
796 | #endif | 796 | #endif |
797 | 797 | ||
798 | static int ipv6_getsockopt_sticky(struct sock *sk, struct ipv6_opt_hdr *hdr, | 798 | static int ipv6_getsockopt_sticky(struct sock *sk, struct ipv6_txoptions *opt, |
799 | char __user *optval, int len) | 799 | char __user *optval, int len) |
800 | { | 800 | { |
801 | if (!hdr) | 801 | struct ipv6_opt_hdr *hdr; |
802 | |||
803 | if (!opt || !opt->hopopt) | ||
802 | return 0; | 804 | return 0; |
805 | hdr = opt->hopopt; | ||
806 | |||
803 | len = min_t(int, len, ipv6_optlen(hdr)); | 807 | len = min_t(int, len, ipv6_optlen(hdr)); |
804 | if (copy_to_user(optval, hdr, ipv6_optlen(hdr))) | 808 | if (copy_to_user(optval, hdr, ipv6_optlen(hdr))) |
805 | return -EFAULT; | 809 | return -EFAULT; |
@@ -940,7 +944,7 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname, | |||
940 | { | 944 | { |
941 | 945 | ||
942 | lock_sock(sk); | 946 | lock_sock(sk); |
943 | len = ipv6_getsockopt_sticky(sk, np->opt->hopopt, | 947 | len = ipv6_getsockopt_sticky(sk, np->opt, |
944 | optval, len); | 948 | optval, len); |
945 | release_sock(sk); | 949 | release_sock(sk); |
946 | return put_user(len, optlen); | 950 | return put_user(len, optlen); |
diff --git a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c index 6f19c4a49560..d1102455668d 100644 --- a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c +++ b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c | |||
@@ -257,6 +257,7 @@ static unsigned int ipv6_conntrack_in(unsigned int hooknum, | |||
257 | } | 257 | } |
258 | nf_conntrack_get(reasm->nfct); | 258 | nf_conntrack_get(reasm->nfct); |
259 | (*pskb)->nfct = reasm->nfct; | 259 | (*pskb)->nfct = reasm->nfct; |
260 | (*pskb)->nfctinfo = reasm->nfctinfo; | ||
260 | return NF_ACCEPT; | 261 | return NF_ACCEPT; |
261 | } | 262 | } |
262 | 263 | ||
diff --git a/net/key/af_key.c b/net/key/af_key.c index 1c58204d767e..a4e7e2db0ff3 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c | |||
@@ -1467,9 +1467,6 @@ static int pfkey_delete(struct sock *sk, struct sk_buff *skb, struct sadb_msg *h | |||
1467 | 1467 | ||
1468 | err = xfrm_state_delete(x); | 1468 | err = xfrm_state_delete(x); |
1469 | 1469 | ||
1470 | xfrm_audit_log(audit_get_loginuid(current->audit_context), 0, | ||
1471 | AUDIT_MAC_IPSEC_DELSA, err ? 0 : 1, NULL, x); | ||
1472 | |||
1473 | if (err < 0) | 1470 | if (err < 0) |
1474 | goto out; | 1471 | goto out; |
1475 | 1472 | ||
@@ -1478,6 +1475,8 @@ static int pfkey_delete(struct sock *sk, struct sk_buff *skb, struct sadb_msg *h | |||
1478 | c.event = XFRM_MSG_DELSA; | 1475 | c.event = XFRM_MSG_DELSA; |
1479 | km_state_notify(x, &c); | 1476 | km_state_notify(x, &c); |
1480 | out: | 1477 | out: |
1478 | xfrm_audit_log(audit_get_loginuid(current->audit_context), 0, | ||
1479 | AUDIT_MAC_IPSEC_DELSA, err ? 0 : 1, NULL, x); | ||
1481 | xfrm_state_put(x); | 1480 | xfrm_state_put(x); |
1482 | 1481 | ||
1483 | return err; | 1482 | return err; |
@@ -2294,14 +2293,12 @@ static int pfkey_spddelete(struct sock *sk, struct sk_buff *skb, struct sadb_msg | |||
2294 | } | 2293 | } |
2295 | 2294 | ||
2296 | xp = xfrm_policy_bysel_ctx(XFRM_POLICY_TYPE_MAIN, pol->sadb_x_policy_dir-1, | 2295 | xp = xfrm_policy_bysel_ctx(XFRM_POLICY_TYPE_MAIN, pol->sadb_x_policy_dir-1, |
2297 | &sel, tmp.security, 1); | 2296 | &sel, tmp.security, 1, &err); |
2298 | security_xfrm_policy_free(&tmp); | 2297 | security_xfrm_policy_free(&tmp); |
2299 | 2298 | ||
2300 | if (xp == NULL) | 2299 | if (xp == NULL) |
2301 | return -ENOENT; | 2300 | return -ENOENT; |
2302 | 2301 | ||
2303 | err = security_xfrm_policy_delete(xp); | ||
2304 | |||
2305 | xfrm_audit_log(audit_get_loginuid(current->audit_context), 0, | 2302 | xfrm_audit_log(audit_get_loginuid(current->audit_context), 0, |
2306 | AUDIT_MAC_IPSEC_DELSPD, err ? 0 : 1, xp, NULL); | 2303 | AUDIT_MAC_IPSEC_DELSPD, err ? 0 : 1, xp, NULL); |
2307 | 2304 | ||
@@ -2539,7 +2536,7 @@ static int pfkey_migrate(struct sock *sk, struct sk_buff *skb, | |||
2539 | static int pfkey_spdget(struct sock *sk, struct sk_buff *skb, struct sadb_msg *hdr, void **ext_hdrs) | 2536 | static int pfkey_spdget(struct sock *sk, struct sk_buff *skb, struct sadb_msg *hdr, void **ext_hdrs) |
2540 | { | 2537 | { |
2541 | unsigned int dir; | 2538 | unsigned int dir; |
2542 | int err; | 2539 | int err = 0, delete; |
2543 | struct sadb_x_policy *pol; | 2540 | struct sadb_x_policy *pol; |
2544 | struct xfrm_policy *xp; | 2541 | struct xfrm_policy *xp; |
2545 | struct km_event c; | 2542 | struct km_event c; |
@@ -2551,16 +2548,20 @@ static int pfkey_spdget(struct sock *sk, struct sk_buff *skb, struct sadb_msg *h | |||
2551 | if (dir >= XFRM_POLICY_MAX) | 2548 | if (dir >= XFRM_POLICY_MAX) |
2552 | return -EINVAL; | 2549 | return -EINVAL; |
2553 | 2550 | ||
2551 | delete = (hdr->sadb_msg_type == SADB_X_SPDDELETE2); | ||
2554 | xp = xfrm_policy_byid(XFRM_POLICY_TYPE_MAIN, dir, pol->sadb_x_policy_id, | 2552 | xp = xfrm_policy_byid(XFRM_POLICY_TYPE_MAIN, dir, pol->sadb_x_policy_id, |
2555 | hdr->sadb_msg_type == SADB_X_SPDDELETE2); | 2553 | delete, &err); |
2556 | if (xp == NULL) | 2554 | if (xp == NULL) |
2557 | return -ENOENT; | 2555 | return -ENOENT; |
2558 | 2556 | ||
2559 | err = 0; | 2557 | if (delete) { |
2558 | xfrm_audit_log(audit_get_loginuid(current->audit_context), 0, | ||
2559 | AUDIT_MAC_IPSEC_DELSPD, err ? 0 : 1, xp, NULL); | ||
2560 | 2560 | ||
2561 | c.seq = hdr->sadb_msg_seq; | 2561 | if (err) |
2562 | c.pid = hdr->sadb_msg_pid; | 2562 | goto out; |
2563 | if (hdr->sadb_msg_type == SADB_X_SPDDELETE2) { | 2563 | c.seq = hdr->sadb_msg_seq; |
2564 | c.pid = hdr->sadb_msg_pid; | ||
2564 | c.data.byid = 1; | 2565 | c.data.byid = 1; |
2565 | c.event = XFRM_MSG_DELPOLICY; | 2566 | c.event = XFRM_MSG_DELPOLICY; |
2566 | km_policy_notify(xp, dir, &c); | 2567 | km_policy_notify(xp, dir, &c); |
@@ -2568,6 +2569,7 @@ static int pfkey_spdget(struct sock *sk, struct sk_buff *skb, struct sadb_msg *h | |||
2568 | err = key_pol_get_resp(sk, xp, hdr, dir); | 2569 | err = key_pol_get_resp(sk, xp, hdr, dir); |
2569 | } | 2570 | } |
2570 | 2571 | ||
2572 | out: | ||
2571 | xfrm_pol_put(xp); | 2573 | xfrm_pol_put(xp); |
2572 | return err; | 2574 | return err; |
2573 | } | 2575 | } |
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c index 91a0972ec117..5cb30ebba0f4 100644 --- a/net/netfilter/nfnetlink_log.c +++ b/net/netfilter/nfnetlink_log.c | |||
@@ -486,7 +486,7 @@ __build_packet_message(struct nfulnl_instance *inst, | |||
486 | * for physical device (when called from ipv4) */ | 486 | * for physical device (when called from ipv4) */ |
487 | NFA_PUT(inst->skb, NFULA_IFINDEX_OUTDEV, | 487 | NFA_PUT(inst->skb, NFULA_IFINDEX_OUTDEV, |
488 | sizeof(tmp_uint), &tmp_uint); | 488 | sizeof(tmp_uint), &tmp_uint); |
489 | if (skb->nf_bridge) { | 489 | if (skb->nf_bridge && skb->nf_bridge->physoutdev) { |
490 | tmp_uint = | 490 | tmp_uint = |
491 | htonl(skb->nf_bridge->physoutdev->ifindex); | 491 | htonl(skb->nf_bridge->physoutdev->ifindex); |
492 | NFA_PUT(inst->skb, NFULA_IFINDEX_PHYSOUTDEV, | 492 | NFA_PUT(inst->skb, NFULA_IFINDEX_PHYSOUTDEV, |
@@ -615,7 +615,7 @@ nfulnl_log_packet(unsigned int pf, | |||
615 | 615 | ||
616 | plen = 0; | 616 | plen = 0; |
617 | if (prefix) | 617 | if (prefix) |
618 | plen = strlen(prefix); | 618 | plen = strlen(prefix) + 1; |
619 | 619 | ||
620 | /* all macros expand to constant values at compile time */ | 620 | /* all macros expand to constant values at compile time */ |
621 | /* FIXME: do we want to make the size calculation conditional based on | 621 | /* FIXME: do we want to make the size calculation conditional based on |
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 946b715db5ec..0c3a70ac5075 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
@@ -735,12 +735,14 @@ EXPORT_SYMBOL(xfrm_policy_insert); | |||
735 | 735 | ||
736 | struct xfrm_policy *xfrm_policy_bysel_ctx(u8 type, int dir, | 736 | struct xfrm_policy *xfrm_policy_bysel_ctx(u8 type, int dir, |
737 | struct xfrm_selector *sel, | 737 | struct xfrm_selector *sel, |
738 | struct xfrm_sec_ctx *ctx, int delete) | 738 | struct xfrm_sec_ctx *ctx, int delete, |
739 | int *err) | ||
739 | { | 740 | { |
740 | struct xfrm_policy *pol, *ret; | 741 | struct xfrm_policy *pol, *ret; |
741 | struct hlist_head *chain; | 742 | struct hlist_head *chain; |
742 | struct hlist_node *entry; | 743 | struct hlist_node *entry; |
743 | 744 | ||
745 | *err = 0; | ||
744 | write_lock_bh(&xfrm_policy_lock); | 746 | write_lock_bh(&xfrm_policy_lock); |
745 | chain = policy_hash_bysel(sel, sel->family, dir); | 747 | chain = policy_hash_bysel(sel, sel->family, dir); |
746 | ret = NULL; | 748 | ret = NULL; |
@@ -750,6 +752,11 @@ struct xfrm_policy *xfrm_policy_bysel_ctx(u8 type, int dir, | |||
750 | xfrm_sec_ctx_match(ctx, pol->security)) { | 752 | xfrm_sec_ctx_match(ctx, pol->security)) { |
751 | xfrm_pol_hold(pol); | 753 | xfrm_pol_hold(pol); |
752 | if (delete) { | 754 | if (delete) { |
755 | *err = security_xfrm_policy_delete(pol); | ||
756 | if (*err) { | ||
757 | write_unlock_bh(&xfrm_policy_lock); | ||
758 | return pol; | ||
759 | } | ||
753 | hlist_del(&pol->bydst); | 760 | hlist_del(&pol->bydst); |
754 | hlist_del(&pol->byidx); | 761 | hlist_del(&pol->byidx); |
755 | xfrm_policy_count[dir]--; | 762 | xfrm_policy_count[dir]--; |
@@ -768,12 +775,14 @@ struct xfrm_policy *xfrm_policy_bysel_ctx(u8 type, int dir, | |||
768 | } | 775 | } |
769 | EXPORT_SYMBOL(xfrm_policy_bysel_ctx); | 776 | EXPORT_SYMBOL(xfrm_policy_bysel_ctx); |
770 | 777 | ||
771 | struct xfrm_policy *xfrm_policy_byid(u8 type, int dir, u32 id, int delete) | 778 | struct xfrm_policy *xfrm_policy_byid(u8 type, int dir, u32 id, int delete, |
779 | int *err) | ||
772 | { | 780 | { |
773 | struct xfrm_policy *pol, *ret; | 781 | struct xfrm_policy *pol, *ret; |
774 | struct hlist_head *chain; | 782 | struct hlist_head *chain; |
775 | struct hlist_node *entry; | 783 | struct hlist_node *entry; |
776 | 784 | ||
785 | *err = 0; | ||
777 | write_lock_bh(&xfrm_policy_lock); | 786 | write_lock_bh(&xfrm_policy_lock); |
778 | chain = xfrm_policy_byidx + idx_hash(id); | 787 | chain = xfrm_policy_byidx + idx_hash(id); |
779 | ret = NULL; | 788 | ret = NULL; |
@@ -781,6 +790,11 @@ struct xfrm_policy *xfrm_policy_byid(u8 type, int dir, u32 id, int delete) | |||
781 | if (pol->type == type && pol->index == id) { | 790 | if (pol->type == type && pol->index == id) { |
782 | xfrm_pol_hold(pol); | 791 | xfrm_pol_hold(pol); |
783 | if (delete) { | 792 | if (delete) { |
793 | *err = security_xfrm_policy_delete(pol); | ||
794 | if (*err) { | ||
795 | write_unlock_bh(&xfrm_policy_lock); | ||
796 | return pol; | ||
797 | } | ||
784 | hlist_del(&pol->bydst); | 798 | hlist_del(&pol->bydst); |
785 | hlist_del(&pol->byidx); | 799 | hlist_del(&pol->byidx); |
786 | xfrm_policy_count[dir]--; | 800 | xfrm_policy_count[dir]--; |
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index 956cfe0ff7f8..96789952f6a3 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c | |||
@@ -530,9 +530,6 @@ static int xfrm_del_sa(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
530 | 530 | ||
531 | err = xfrm_state_delete(x); | 531 | err = xfrm_state_delete(x); |
532 | 532 | ||
533 | xfrm_audit_log(NETLINK_CB(skb).loginuid, NETLINK_CB(skb).sid, | ||
534 | AUDIT_MAC_IPSEC_DELSA, err ? 0 : 1, NULL, x); | ||
535 | |||
536 | if (err < 0) | 533 | if (err < 0) |
537 | goto out; | 534 | goto out; |
538 | 535 | ||
@@ -542,6 +539,8 @@ static int xfrm_del_sa(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
542 | km_state_notify(x, &c); | 539 | km_state_notify(x, &c); |
543 | 540 | ||
544 | out: | 541 | out: |
542 | xfrm_audit_log(NETLINK_CB(skb).loginuid, NETLINK_CB(skb).sid, | ||
543 | AUDIT_MAC_IPSEC_DELSA, err ? 0 : 1, NULL, x); | ||
545 | xfrm_state_put(x); | 544 | xfrm_state_put(x); |
546 | return err; | 545 | return err; |
547 | } | 546 | } |
@@ -1254,7 +1253,7 @@ static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
1254 | return err; | 1253 | return err; |
1255 | 1254 | ||
1256 | if (p->index) | 1255 | if (p->index) |
1257 | xp = xfrm_policy_byid(type, p->dir, p->index, delete); | 1256 | xp = xfrm_policy_byid(type, p->dir, p->index, delete, &err); |
1258 | else { | 1257 | else { |
1259 | struct rtattr *rt = xfrma[XFRMA_SEC_CTX-1]; | 1258 | struct rtattr *rt = xfrma[XFRMA_SEC_CTX-1]; |
1260 | struct xfrm_policy tmp; | 1259 | struct xfrm_policy tmp; |
@@ -1270,7 +1269,8 @@ static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
1270 | if ((err = security_xfrm_policy_alloc(&tmp, uctx))) | 1269 | if ((err = security_xfrm_policy_alloc(&tmp, uctx))) |
1271 | return err; | 1270 | return err; |
1272 | } | 1271 | } |
1273 | xp = xfrm_policy_bysel_ctx(type, p->dir, &p->sel, tmp.security, delete); | 1272 | xp = xfrm_policy_bysel_ctx(type, p->dir, &p->sel, tmp.security, |
1273 | delete, &err); | ||
1274 | security_xfrm_policy_free(&tmp); | 1274 | security_xfrm_policy_free(&tmp); |
1275 | } | 1275 | } |
1276 | if (xp == NULL) | 1276 | if (xp == NULL) |
@@ -1288,8 +1288,6 @@ static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
1288 | MSG_DONTWAIT); | 1288 | MSG_DONTWAIT); |
1289 | } | 1289 | } |
1290 | } else { | 1290 | } else { |
1291 | err = security_xfrm_policy_delete(xp); | ||
1292 | |||
1293 | xfrm_audit_log(NETLINK_CB(skb).loginuid, NETLINK_CB(skb).sid, | 1291 | xfrm_audit_log(NETLINK_CB(skb).loginuid, NETLINK_CB(skb).sid, |
1294 | AUDIT_MAC_IPSEC_DELSPD, err ? 0 : 1, xp, NULL); | 1292 | AUDIT_MAC_IPSEC_DELSPD, err ? 0 : 1, xp, NULL); |
1295 | 1293 | ||
@@ -1303,9 +1301,8 @@ static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
1303 | km_policy_notify(xp, p->dir, &c); | 1301 | km_policy_notify(xp, p->dir, &c); |
1304 | } | 1302 | } |
1305 | 1303 | ||
1306 | xfrm_pol_put(xp); | ||
1307 | |||
1308 | out: | 1304 | out: |
1305 | xfrm_pol_put(xp); | ||
1309 | return err; | 1306 | return err; |
1310 | } | 1307 | } |
1311 | 1308 | ||
@@ -1502,7 +1499,7 @@ static int xfrm_add_pol_expire(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
1502 | return err; | 1499 | return err; |
1503 | 1500 | ||
1504 | if (p->index) | 1501 | if (p->index) |
1505 | xp = xfrm_policy_byid(type, p->dir, p->index, 0); | 1502 | xp = xfrm_policy_byid(type, p->dir, p->index, 0, &err); |
1506 | else { | 1503 | else { |
1507 | struct rtattr *rt = xfrma[XFRMA_SEC_CTX-1]; | 1504 | struct rtattr *rt = xfrma[XFRMA_SEC_CTX-1]; |
1508 | struct xfrm_policy tmp; | 1505 | struct xfrm_policy tmp; |
@@ -1518,13 +1515,14 @@ static int xfrm_add_pol_expire(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
1518 | if ((err = security_xfrm_policy_alloc(&tmp, uctx))) | 1515 | if ((err = security_xfrm_policy_alloc(&tmp, uctx))) |
1519 | return err; | 1516 | return err; |
1520 | } | 1517 | } |
1521 | xp = xfrm_policy_bysel_ctx(type, p->dir, &p->sel, tmp.security, 0); | 1518 | xp = xfrm_policy_bysel_ctx(type, p->dir, &p->sel, tmp.security, |
1519 | 0, &err); | ||
1522 | security_xfrm_policy_free(&tmp); | 1520 | security_xfrm_policy_free(&tmp); |
1523 | } | 1521 | } |
1524 | 1522 | ||
1525 | if (xp == NULL) | 1523 | if (xp == NULL) |
1526 | return err; | 1524 | return -ENOENT; |
1527 | read_lock(&xp->lock); | 1525 | read_lock(&xp->lock); |
1528 | if (xp->dead) { | 1526 | if (xp->dead) { |
1529 | read_unlock(&xp->lock); | 1527 | read_unlock(&xp->lock); |
1530 | goto out; | 1528 | goto out; |