diff options
42 files changed, 474 insertions, 341 deletions
diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c index 4b873527ce1c..02c2db08114a 100644 --- a/arch/alpha/kernel/smp.c +++ b/arch/alpha/kernel/smp.c | |||
| @@ -73,9 +73,6 @@ cpumask_t cpu_online_map; | |||
| 73 | 73 | ||
| 74 | EXPORT_SYMBOL(cpu_online_map); | 74 | EXPORT_SYMBOL(cpu_online_map); |
| 75 | 75 | ||
| 76 | /* cpus reported in the hwrpb */ | ||
| 77 | static unsigned long hwrpb_cpu_present_mask __initdata = 0; | ||
| 78 | |||
| 79 | int smp_num_probed; /* Internal processor count */ | 76 | int smp_num_probed; /* Internal processor count */ |
| 80 | int smp_num_cpus = 1; /* Number that came online. */ | 77 | int smp_num_cpus = 1; /* Number that came online. */ |
| 81 | 78 | ||
| @@ -442,7 +439,7 @@ setup_smp(void) | |||
| 442 | if ((cpu->flags & 0x1cc) == 0x1cc) { | 439 | if ((cpu->flags & 0x1cc) == 0x1cc) { |
| 443 | smp_num_probed++; | 440 | smp_num_probed++; |
| 444 | /* Assume here that "whami" == index */ | 441 | /* Assume here that "whami" == index */ |
| 445 | hwrpb_cpu_present_mask |= (1UL << i); | 442 | cpu_set(i, cpu_possible_map); |
| 446 | cpu->pal_revision = boot_cpu_palrev; | 443 | cpu->pal_revision = boot_cpu_palrev; |
| 447 | } | 444 | } |
| 448 | 445 | ||
| @@ -453,12 +450,12 @@ setup_smp(void) | |||
| 453 | } | 450 | } |
| 454 | } else { | 451 | } else { |
| 455 | smp_num_probed = 1; | 452 | smp_num_probed = 1; |
| 456 | hwrpb_cpu_present_mask = (1UL << boot_cpuid); | 453 | cpu_set(boot_cpuid, cpu_possible_map); |
| 457 | } | 454 | } |
| 458 | cpu_present_mask = cpumask_of_cpu(boot_cpuid); | 455 | cpu_present_mask = cpumask_of_cpu(boot_cpuid); |
| 459 | 456 | ||
| 460 | printk(KERN_INFO "SMP: %d CPUs probed -- cpu_present_mask = %lx\n", | 457 | printk(KERN_INFO "SMP: %d CPUs probed -- cpu_present_mask = %lx\n", |
| 461 | smp_num_probed, hwrpb_cpu_present_mask); | 458 | smp_num_probed, cpu_possible_map.bits[0]); |
| 462 | } | 459 | } |
| 463 | 460 | ||
| 464 | /* | 461 | /* |
| @@ -467,8 +464,6 @@ setup_smp(void) | |||
| 467 | void __init | 464 | void __init |
| 468 | smp_prepare_cpus(unsigned int max_cpus) | 465 | smp_prepare_cpus(unsigned int max_cpus) |
| 469 | { | 466 | { |
| 470 | int cpu_count, i; | ||
| 471 | |||
| 472 | /* Take care of some initial bookkeeping. */ | 467 | /* Take care of some initial bookkeeping. */ |
| 473 | memset(ipi_data, 0, sizeof(ipi_data)); | 468 | memset(ipi_data, 0, sizeof(ipi_data)); |
| 474 | 469 | ||
| @@ -486,19 +481,7 @@ smp_prepare_cpus(unsigned int max_cpus) | |||
| 486 | 481 | ||
| 487 | printk(KERN_INFO "SMP starting up secondaries.\n"); | 482 | printk(KERN_INFO "SMP starting up secondaries.\n"); |
| 488 | 483 | ||
| 489 | cpu_count = 1; | 484 | smp_num_cpus = smp_num_probed; |
| 490 | for (i = 0; (i < NR_CPUS) && (cpu_count < max_cpus); i++) { | ||
| 491 | if (i == boot_cpuid) | ||
| 492 | continue; | ||
| 493 | |||
| 494 | if (((hwrpb_cpu_present_mask >> i) & 1) == 0) | ||
| 495 | continue; | ||
| 496 | |||
| 497 | cpu_set(i, cpu_possible_map); | ||
| 498 | cpu_count++; | ||
| 499 | } | ||
| 500 | |||
| 501 | smp_num_cpus = cpu_count; | ||
| 502 | } | 485 | } |
| 503 | 486 | ||
| 504 | void __devinit | 487 | void __devinit |
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 77eee38762d6..15dc1a0dffbb 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
| @@ -69,6 +69,9 @@ config GENERIC_ISA_DMA | |||
| 69 | config FIQ | 69 | config FIQ |
| 70 | bool | 70 | bool |
| 71 | 71 | ||
| 72 | config ARCH_MTD_XIP | ||
| 73 | bool | ||
| 74 | |||
| 72 | source "init/Kconfig" | 75 | source "init/Kconfig" |
| 73 | 76 | ||
| 74 | menu "System Type" | 77 | menu "System Type" |
| @@ -153,6 +156,7 @@ config ARCH_L7200 | |||
| 153 | 156 | ||
| 154 | config ARCH_PXA | 157 | config ARCH_PXA |
| 155 | bool "PXA2xx-based" | 158 | bool "PXA2xx-based" |
| 159 | select ARCH_MTD_XIP | ||
| 156 | help | 160 | help |
| 157 | Support for Intel's PXA2XX processor line. | 161 | Support for Intel's PXA2XX processor line. |
| 158 | 162 | ||
| @@ -171,6 +175,7 @@ config ARCH_SA1100 | |||
| 171 | bool "SA1100-based" | 175 | bool "SA1100-based" |
| 172 | select ISA | 176 | select ISA |
| 173 | select ARCH_DISCONTIGMEM_ENABLE | 177 | select ARCH_DISCONTIGMEM_ENABLE |
| 178 | select ARCH_MTD_XIP | ||
| 174 | help | 179 | help |
| 175 | Support for StrongARM 11x0 based boards. | 180 | Support for StrongARM 11x0 based boards. |
| 176 | 181 | ||
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c index fa98f10d0132..5232fc752935 100644 --- a/arch/mips/kernel/process.c +++ b/arch/mips/kernel/process.c | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | * for more details. | 4 | * for more details. |
| 5 | * | 5 | * |
| 6 | * Copyright (C) 1994 - 1999, 2000 by Ralf Baechle and others. | 6 | * Copyright (C) 1994 - 1999, 2000 by Ralf Baechle and others. |
| 7 | * Copyright (C) 2005, 2006 by Ralf Baechle (ralf@linux-mips.org) | ||
| 7 | * Copyright (C) 1999, 2000 Silicon Graphics, Inc. | 8 | * Copyright (C) 1999, 2000 Silicon Graphics, Inc. |
| 8 | * Copyright (C) 2004 Thiemo Seufer | 9 | * Copyright (C) 2004 Thiemo Seufer |
| 9 | */ | 10 | */ |
| @@ -58,8 +59,8 @@ ATTRIB_NORET void cpu_idle(void) | |||
| 58 | } | 59 | } |
| 59 | } | 60 | } |
| 60 | 61 | ||
| 61 | extern int do_signal(sigset_t *oldset, struct pt_regs *regs); | 62 | extern void do_signal(struct pt_regs *regs); |
| 62 | extern int do_signal32(sigset_t *oldset, struct pt_regs *regs); | 63 | extern void do_signal32(struct pt_regs *regs); |
| 63 | 64 | ||
| 64 | /* | 65 | /* |
| 65 | * Native o32 and N64 ABI without DSP ASE | 66 | * Native o32 and N64 ABI without DSP ASE |
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S index a42e0e8caa7b..d7c4a38ed5ae 100644 --- a/arch/mips/kernel/scall32-o32.S +++ b/arch/mips/kernel/scall32-o32.S | |||
| @@ -617,6 +617,23 @@ einval: li v0, -EINVAL | |||
| 617 | sys sys_inotify_init 0 | 617 | sys sys_inotify_init 0 |
| 618 | sys sys_inotify_add_watch 3 /* 4285 */ | 618 | sys sys_inotify_add_watch 3 /* 4285 */ |
| 619 | sys sys_inotify_rm_watch 2 | 619 | sys sys_inotify_rm_watch 2 |
| 620 | sys sys_migrate_pages 4 | ||
| 621 | sys sys_openat 4 | ||
| 622 | sys sys_mkdirat 3 | ||
| 623 | sys sys_mknodat 4 /* 4290 */ | ||
| 624 | sys sys_fchownat 5 | ||
| 625 | sys sys_futimesat 3 | ||
| 626 | sys sys_newfstatat 4 | ||
| 627 | sys sys_unlinkat 3 | ||
| 628 | sys sys_renameat 4 /* 4295 */ | ||
| 629 | sys sys_linkat 4 | ||
| 630 | sys sys_symlinkat 3 | ||
| 631 | sys sys_readlinkat 4 | ||
| 632 | sys sys_fchmodat 3 | ||
| 633 | sys sys_faccessat 3 /* 4300 */ | ||
| 634 | sys sys_pselect6 6 | ||
| 635 | sys sys_ppoll 5 | ||
| 636 | sys sys_unshare 1 | ||
| 620 | .endm | 637 | .endm |
| 621 | 638 | ||
| 622 | /* We pre-compute the number of _instruction_ bytes needed to | 639 | /* We pre-compute the number of _instruction_ bytes needed to |
diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S index 47bfbd416709..98bf25df56f3 100644 --- a/arch/mips/kernel/scall64-64.S +++ b/arch/mips/kernel/scall64-64.S | |||
| @@ -443,3 +443,20 @@ sys_call_table: | |||
| 443 | PTR sys_inotify_init | 443 | PTR sys_inotify_init |
| 444 | PTR sys_inotify_add_watch | 444 | PTR sys_inotify_add_watch |
| 445 | PTR sys_inotify_rm_watch /* 5245 */ | 445 | PTR sys_inotify_rm_watch /* 5245 */ |
| 446 | PTR sys_migrate_pages | ||
| 447 | PTR sys_openat | ||
| 448 | PTR sys_mkdirat | ||
| 449 | PTR sys_mknodat | ||
| 450 | PTR sys_fchownat /* 5250 */ | ||
| 451 | PTR sys_futimesat | ||
| 452 | PTR sys_newfstatat | ||
| 453 | PTR sys_unlinkat | ||
| 454 | PTR sys_renameat | ||
| 455 | PTR sys_linkat /* 5255 */ | ||
| 456 | PTR sys_symlinkat | ||
| 457 | PTR sys_readlinkat | ||
| 458 | PTR sys_fchmodat | ||
| 459 | PTR sys_faccessat | ||
| 460 | PTR sys_pselect6 /* 5260 */ | ||
| 461 | PTR sys_ppoll | ||
| 462 | PTR sys_unshare | ||
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S index b465ced1758f..bc4980cefc8b 100644 --- a/arch/mips/kernel/scall64-n32.S +++ b/arch/mips/kernel/scall64-n32.S | |||
| @@ -369,3 +369,20 @@ EXPORT(sysn32_call_table) | |||
| 369 | PTR sys_inotify_init | 369 | PTR sys_inotify_init |
| 370 | PTR sys_inotify_add_watch | 370 | PTR sys_inotify_add_watch |
| 371 | PTR sys_inotify_rm_watch | 371 | PTR sys_inotify_rm_watch |
| 372 | PTR sys_migrate_pages /* 6250 */ | ||
| 373 | PTR sys_openat | ||
| 374 | PTR sys_mkdirat | ||
| 375 | PTR sys_mknodat | ||
| 376 | PTR sys_fchownat | ||
| 377 | PTR sys_futimesat /* 6255 */ | ||
| 378 | PTR sys_newfstatat | ||
| 379 | PTR sys_unlinkat | ||
| 380 | PTR sys_renameat | ||
| 381 | PTR sys_linkat | ||
| 382 | PTR sys_symlinkat /* 6260 */ | ||
| 383 | PTR sys_readlinkat | ||
| 384 | PTR sys_fchmodat | ||
| 385 | PTR sys_faccessat | ||
| 386 | PTR sys_pselect6 | ||
| 387 | PTR sys_ppoll /* 6265 */ | ||
| 388 | PTR sys_unshare | ||
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S index 3d338ca7eeeb..5b0414018c9a 100644 --- a/arch/mips/kernel/scall64-o32.S +++ b/arch/mips/kernel/scall64-o32.S | |||
| @@ -491,4 +491,21 @@ sys_call_table: | |||
| 491 | PTR sys_inotify_init | 491 | PTR sys_inotify_init |
| 492 | PTR sys_inotify_add_watch /* 4285 */ | 492 | PTR sys_inotify_add_watch /* 4285 */ |
| 493 | PTR sys_inotify_rm_watch | 493 | PTR sys_inotify_rm_watch |
| 494 | PTR sys_migrate_pages | ||
| 495 | PTR compat_sys_openat | ||
| 496 | PTR sys_mkdirat | ||
| 497 | PTR sys_mknodat /* 4290 */ | ||
| 498 | PTR sys_fchownat | ||
| 499 | PTR compat_sys_futimesat | ||
| 500 | PTR compat_sys_newfstatat | ||
| 501 | PTR sys_unlinkat | ||
| 502 | PTR sys_renameat /* 4295 */ | ||
| 503 | PTR sys_linkat | ||
| 504 | PTR sys_symlinkat | ||
| 505 | PTR sys_readlinkat | ||
| 506 | PTR sys_fchmodat | ||
| 507 | PTR sys_faccessat /* 4300 */ | ||
| 508 | PTR sys_pselect6 | ||
| 509 | PTR sys_ppoll | ||
| 510 | PTR sys_unshare | ||
| 494 | .size sys_call_table,.-sys_call_table | 511 | .size sys_call_table,.-sys_call_table |
diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c index aaec4785e9a6..c974cc9b30eb 100644 --- a/arch/mips/kernel/signal.c +++ b/arch/mips/kernel/signal.c | |||
| @@ -39,8 +39,6 @@ | |||
| 39 | 39 | ||
| 40 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | 40 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) |
| 41 | 41 | ||
| 42 | int do_signal(sigset_t *oldset, struct pt_regs *regs); | ||
| 43 | |||
| 44 | /* | 42 | /* |
| 45 | * Atomically swap in the new signal mask, and wait for a signal. | 43 | * Atomically swap in the new signal mask, and wait for a signal. |
| 46 | */ | 44 | */ |
| @@ -50,7 +48,7 @@ save_static_function(sys_sigsuspend); | |||
| 50 | __attribute_used__ noinline static int | 48 | __attribute_used__ noinline static int |
| 51 | _sys_sigsuspend(nabi_no_regargs struct pt_regs regs) | 49 | _sys_sigsuspend(nabi_no_regargs struct pt_regs regs) |
| 52 | { | 50 | { |
| 53 | sigset_t saveset, newset; | 51 | sigset_t newset; |
| 54 | sigset_t __user *uset; | 52 | sigset_t __user *uset; |
| 55 | 53 | ||
| 56 | uset = (sigset_t __user *) regs.regs[4]; | 54 | uset = (sigset_t __user *) regs.regs[4]; |
| @@ -59,19 +57,15 @@ _sys_sigsuspend(nabi_no_regargs struct pt_regs regs) | |||
| 59 | sigdelsetmask(&newset, ~_BLOCKABLE); | 57 | sigdelsetmask(&newset, ~_BLOCKABLE); |
| 60 | 58 | ||
| 61 | spin_lock_irq(¤t->sighand->siglock); | 59 | spin_lock_irq(¤t->sighand->siglock); |
| 62 | saveset = current->blocked; | 60 | current->saved_sigmask = current->blocked; |
| 63 | current->blocked = newset; | 61 | current->blocked = newset; |
| 64 | recalc_sigpending(); | 62 | recalc_sigpending(); |
| 65 | spin_unlock_irq(¤t->sighand->siglock); | 63 | spin_unlock_irq(¤t->sighand->siglock); |
| 66 | 64 | ||
| 67 | regs.regs[2] = EINTR; | 65 | current->state = TASK_INTERRUPTIBLE; |
| 68 | regs.regs[7] = 1; | 66 | schedule(); |
| 69 | while (1) { | 67 | set_thread_flag(TIF_RESTORE_SIGMASK); |
| 70 | current->state = TASK_INTERRUPTIBLE; | 68 | return -ERESTARTNOHAND; |
| 71 | schedule(); | ||
| 72 | if (do_signal(&saveset, ®s)) | ||
| 73 | return -EINTR; | ||
| 74 | } | ||
| 75 | } | 69 | } |
| 76 | #endif | 70 | #endif |
| 77 | 71 | ||
| @@ -79,7 +73,7 @@ save_static_function(sys_rt_sigsuspend); | |||
| 79 | __attribute_used__ noinline static int | 73 | __attribute_used__ noinline static int |
| 80 | _sys_rt_sigsuspend(nabi_no_regargs struct pt_regs regs) | 74 | _sys_rt_sigsuspend(nabi_no_regargs struct pt_regs regs) |
| 81 | { | 75 | { |
| 82 | sigset_t saveset, newset; | 76 | sigset_t newset; |
| 83 | sigset_t __user *unewset; | 77 | sigset_t __user *unewset; |
| 84 | size_t sigsetsize; | 78 | size_t sigsetsize; |
| 85 | 79 | ||
| @@ -94,19 +88,15 @@ _sys_rt_sigsuspend(nabi_no_regargs struct pt_regs regs) | |||
| 94 | sigdelsetmask(&newset, ~_BLOCKABLE); | 88 | sigdelsetmask(&newset, ~_BLOCKABLE); |
| 95 | 89 | ||
| 96 | spin_lock_irq(¤t->sighand->siglock); | 90 | spin_lock_irq(¤t->sighand->siglock); |
| 97 | saveset = current->blocked; | 91 | current->saved_sigmask = current->blocked; |
| 98 | current->blocked = newset; | 92 | current->blocked = newset; |
| 99 | recalc_sigpending(); | 93 | recalc_sigpending(); |
| 100 | spin_unlock_irq(¤t->sighand->siglock); | 94 | spin_unlock_irq(¤t->sighand->siglock); |
| 101 | 95 | ||
| 102 | regs.regs[2] = EINTR; | 96 | current->state = TASK_INTERRUPTIBLE; |
| 103 | regs.regs[7] = 1; | 97 | schedule(); |
| 104 | while (1) { | 98 | set_thread_flag(TIF_RESTORE_SIGMASK); |
| 105 | current->state = TASK_INTERRUPTIBLE; | 99 | return -ERESTARTNOHAND; |
| 106 | schedule(); | ||
| 107 | if (do_signal(&saveset, ®s)) | ||
| 108 | return -EINTR; | ||
| 109 | } | ||
| 110 | } | 100 | } |
| 111 | 101 | ||
| 112 | #ifdef CONFIG_TRAD_SIGNALS | 102 | #ifdef CONFIG_TRAD_SIGNALS |
| @@ -315,11 +305,11 @@ int setup_frame(struct k_sigaction * ka, struct pt_regs *regs, | |||
| 315 | current->comm, current->pid, | 305 | current->comm, current->pid, |
| 316 | frame, regs->cp0_epc, frame->regs[31]); | 306 | frame, regs->cp0_epc, frame->regs[31]); |
| 317 | #endif | 307 | #endif |
| 318 | return 1; | 308 | return 0; |
| 319 | 309 | ||
| 320 | give_sigsegv: | 310 | give_sigsegv: |
| 321 | force_sigsegv(signr, current); | 311 | force_sigsegv(signr, current); |
| 322 | return 0; | 312 | return -EFAULT; |
| 323 | } | 313 | } |
| 324 | #endif | 314 | #endif |
| 325 | 315 | ||
| @@ -375,11 +365,11 @@ int setup_rt_frame(struct k_sigaction * ka, struct pt_regs *regs, | |||
| 375 | current->comm, current->pid, | 365 | current->comm, current->pid, |
| 376 | frame, regs->cp0_epc, regs->regs[31]); | 366 | frame, regs->cp0_epc, regs->regs[31]); |
| 377 | #endif | 367 | #endif |
| 378 | return 1; | 368 | return 0; |
| 379 | 369 | ||
| 380 | give_sigsegv: | 370 | give_sigsegv: |
| 381 | force_sigsegv(signr, current); | 371 | force_sigsegv(signr, current); |
| 382 | return 0; | 372 | return -EFAULT; |
| 383 | } | 373 | } |
| 384 | 374 | ||
| 385 | static inline int handle_signal(unsigned long sig, siginfo_t *info, | 375 | static inline int handle_signal(unsigned long sig, siginfo_t *info, |
| @@ -393,7 +383,7 @@ static inline int handle_signal(unsigned long sig, siginfo_t *info, | |||
| 393 | regs->regs[2] = EINTR; | 383 | regs->regs[2] = EINTR; |
| 394 | break; | 384 | break; |
| 395 | case ERESTARTSYS: | 385 | case ERESTARTSYS: |
| 396 | if(!(ka->sa.sa_flags & SA_RESTART)) { | 386 | if (!(ka->sa.sa_flags & SA_RESTART)) { |
| 397 | regs->regs[2] = EINTR; | 387 | regs->regs[2] = EINTR; |
| 398 | break; | 388 | break; |
| 399 | } | 389 | } |
| @@ -420,9 +410,10 @@ static inline int handle_signal(unsigned long sig, siginfo_t *info, | |||
| 420 | return ret; | 410 | return ret; |
| 421 | } | 411 | } |
| 422 | 412 | ||
| 423 | int do_signal(sigset_t *oldset, struct pt_regs *regs) | 413 | void do_signal(struct pt_regs *regs) |
| 424 | { | 414 | { |
| 425 | struct k_sigaction ka; | 415 | struct k_sigaction ka; |
| 416 | sigset_t *oldset; | ||
| 426 | siginfo_t info; | 417 | siginfo_t info; |
| 427 | int signr; | 418 | int signr; |
| 428 | 419 | ||
| @@ -432,17 +423,31 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs) | |||
| 432 | * if so. | 423 | * if so. |
| 433 | */ | 424 | */ |
| 434 | if (!user_mode(regs)) | 425 | if (!user_mode(regs)) |
| 435 | return 1; | 426 | return; |
| 436 | 427 | ||
| 437 | if (try_to_freeze()) | 428 | if (try_to_freeze()) |
| 438 | goto no_signal; | 429 | goto no_signal; |
| 439 | 430 | ||
| 440 | if (!oldset) | 431 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) |
| 432 | oldset = ¤t->saved_sigmask; | ||
| 433 | else | ||
| 441 | oldset = ¤t->blocked; | 434 | oldset = ¤t->blocked; |
| 442 | 435 | ||
| 436 | |||
| 443 | signr = get_signal_to_deliver(&info, &ka, regs, NULL); | 437 | signr = get_signal_to_deliver(&info, &ka, regs, NULL); |
| 444 | if (signr > 0) | 438 | if (signr > 0) { |
| 445 | return handle_signal(signr, &info, &ka, oldset, regs); | 439 | /* Whee! Actually deliver the signal. */ |
| 440 | if (handle_signal(signr, &info, &ka, oldset, regs) == 0) { | ||
| 441 | /* | ||
| 442 | * A signal was successfully delivered; the saved | ||
| 443 | * sigmask will have been stored in the signal frame, | ||
| 444 | * and will be restored by sigreturn, so we can simply | ||
| 445 | * clear the TIF_RESTORE_SIGMASK flag. | ||
| 446 | */ | ||
| 447 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) | ||
| 448 | clear_thread_flag(TIF_RESTORE_SIGMASK); | ||
| 449 | } | ||
| 450 | } | ||
| 446 | 451 | ||
| 447 | no_signal: | 452 | no_signal: |
| 448 | /* | 453 | /* |
| @@ -463,18 +468,25 @@ no_signal: | |||
| 463 | regs->cp0_epc -= 4; | 468 | regs->cp0_epc -= 4; |
| 464 | } | 469 | } |
| 465 | } | 470 | } |
| 466 | return 0; | 471 | |
| 472 | /* | ||
| 473 | * If there's no signal to deliver, we just put the saved sigmask | ||
| 474 | * back | ||
| 475 | */ | ||
| 476 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) { | ||
| 477 | clear_thread_flag(TIF_RESTORE_SIGMASK); | ||
| 478 | sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); | ||
| 479 | } | ||
| 467 | } | 480 | } |
| 468 | 481 | ||
| 469 | /* | 482 | /* |
| 470 | * notification of userspace execution resumption | 483 | * notification of userspace execution resumption |
| 471 | * - triggered by current->work.notify_resume | 484 | * - triggered by the TIF_WORK_MASK flags |
| 472 | */ | 485 | */ |
| 473 | asmlinkage void do_notify_resume(struct pt_regs *regs, sigset_t *oldset, | 486 | asmlinkage void do_notify_resume(struct pt_regs *regs, void *unused, |
| 474 | __u32 thread_info_flags) | 487 | __u32 thread_info_flags) |
| 475 | { | 488 | { |
| 476 | /* deal with pending signal delivery */ | 489 | /* deal with pending signal delivery */ |
| 477 | if (thread_info_flags & _TIF_SIGPENDING) { | 490 | if (thread_info_flags & (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK)) |
| 478 | current->thread.abi->do_signal(oldset, regs); | 491 | current->thread.abi->do_signal(regs); |
| 479 | } | ||
| 480 | } | 492 | } |
diff --git a/arch/mips/kernel/signal32.c b/arch/mips/kernel/signal32.c index 136260c8f756..da3271e1fdac 100644 --- a/arch/mips/kernel/signal32.c +++ b/arch/mips/kernel/signal32.c | |||
| @@ -694,11 +694,11 @@ int setup_frame_32(struct k_sigaction * ka, struct pt_regs *regs, | |||
| 694 | current->comm, current->pid, | 694 | current->comm, current->pid, |
| 695 | frame, regs->cp0_epc, frame->sf_code); | 695 | frame, regs->cp0_epc, frame->sf_code); |
| 696 | #endif | 696 | #endif |
| 697 | return 1; | 697 | return 0; |
| 698 | 698 | ||
| 699 | give_sigsegv: | 699 | give_sigsegv: |
| 700 | force_sigsegv(signr, current); | 700 | force_sigsegv(signr, current); |
| 701 | return 0; | 701 | return -EFAULT; |
| 702 | } | 702 | } |
| 703 | 703 | ||
| 704 | int setup_rt_frame_32(struct k_sigaction * ka, struct pt_regs *regs, | 704 | int setup_rt_frame_32(struct k_sigaction * ka, struct pt_regs *regs, |
| @@ -765,11 +765,11 @@ int setup_rt_frame_32(struct k_sigaction * ka, struct pt_regs *regs, | |||
| 765 | current->comm, current->pid, | 765 | current->comm, current->pid, |
| 766 | frame, regs->cp0_epc, frame->rs_code); | 766 | frame, regs->cp0_epc, frame->rs_code); |
| 767 | #endif | 767 | #endif |
| 768 | return 1; | 768 | return 0; |
| 769 | 769 | ||
| 770 | give_sigsegv: | 770 | give_sigsegv: |
| 771 | force_sigsegv(signr, current); | 771 | force_sigsegv(signr, current); |
| 772 | return 0; | 772 | return -EFAULT; |
| 773 | } | 773 | } |
| 774 | 774 | ||
| 775 | static inline int handle_signal(unsigned long sig, siginfo_t *info, | 775 | static inline int handle_signal(unsigned long sig, siginfo_t *info, |
diff --git a/arch/mips/kernel/signal_n32.c b/arch/mips/kernel/signal_n32.c index 9156863c1a5d..384fc4a639a4 100644 --- a/arch/mips/kernel/signal_n32.c +++ b/arch/mips/kernel/signal_n32.c | |||
| @@ -186,9 +186,9 @@ int setup_rt_frame_n32(struct k_sigaction * ka, | |||
| 186 | current->comm, current->pid, | 186 | current->comm, current->pid, |
| 187 | frame, regs->cp0_epc, regs->regs[31]); | 187 | frame, regs->cp0_epc, regs->regs[31]); |
| 188 | #endif | 188 | #endif |
| 189 | return 1; | 189 | return 0; |
| 190 | 190 | ||
| 191 | give_sigsegv: | 191 | give_sigsegv: |
| 192 | force_sigsegv(signr, current); | 192 | force_sigsegv(signr, current); |
| 193 | return 0; | 193 | return -EFAULT; |
| 194 | } | 194 | } |
diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c index 332358430ff5..1da2eeb3ef9e 100644 --- a/arch/mips/kernel/syscall.c +++ b/arch/mips/kernel/syscall.c | |||
| @@ -212,12 +212,12 @@ asmlinkage int sys_execve(nabi_no_regargs struct pt_regs regs) | |||
| 212 | int error; | 212 | int error; |
| 213 | char * filename; | 213 | char * filename; |
| 214 | 214 | ||
| 215 | filename = getname((char *) (long)regs.regs[4]); | 215 | filename = getname((char __user *) (long)regs.regs[4]); |
| 216 | error = PTR_ERR(filename); | 216 | error = PTR_ERR(filename); |
| 217 | if (IS_ERR(filename)) | 217 | if (IS_ERR(filename)) |
| 218 | goto out; | 218 | goto out; |
| 219 | error = do_execve(filename, (char **) (long)regs.regs[5], | 219 | error = do_execve(filename, (char __user *__user *) (long)regs.regs[5], |
| 220 | (char **) (long)regs.regs[6], ®s); | 220 | (char __user *__user *) (long)regs.regs[6], ®s); |
| 221 | putname(filename); | 221 | putname(filename); |
| 222 | 222 | ||
| 223 | out: | 223 | out: |
| @@ -227,7 +227,7 @@ out: | |||
| 227 | /* | 227 | /* |
| 228 | * Compacrapability ... | 228 | * Compacrapability ... |
| 229 | */ | 229 | */ |
| 230 | asmlinkage int sys_uname(struct old_utsname * name) | 230 | asmlinkage int sys_uname(struct old_utsname __user * name) |
| 231 | { | 231 | { |
| 232 | if (name && !copy_to_user(name, &system_utsname, sizeof (*name))) | 232 | if (name && !copy_to_user(name, &system_utsname, sizeof (*name))) |
| 233 | return 0; | 233 | return 0; |
| @@ -237,7 +237,7 @@ asmlinkage int sys_uname(struct old_utsname * name) | |||
| 237 | /* | 237 | /* |
| 238 | * Compacrapability ... | 238 | * Compacrapability ... |
| 239 | */ | 239 | */ |
| 240 | asmlinkage int sys_olduname(struct oldold_utsname * name) | 240 | asmlinkage int sys_olduname(struct oldold_utsname __user * name) |
| 241 | { | 241 | { |
| 242 | int error; | 242 | int error; |
| 243 | 243 | ||
| @@ -274,7 +274,7 @@ void sys_set_thread_area(unsigned long addr) | |||
| 274 | asmlinkage int _sys_sysmips(int cmd, long arg1, int arg2, int arg3) | 274 | asmlinkage int _sys_sysmips(int cmd, long arg1, int arg2, int arg3) |
| 275 | { | 275 | { |
| 276 | int tmp, len; | 276 | int tmp, len; |
| 277 | char *name; | 277 | char __user *name; |
| 278 | 278 | ||
| 279 | switch(cmd) { | 279 | switch(cmd) { |
| 280 | case SETNAME: { | 280 | case SETNAME: { |
| @@ -283,7 +283,7 @@ asmlinkage int _sys_sysmips(int cmd, long arg1, int arg2, int arg3) | |||
| 283 | if (!capable(CAP_SYS_ADMIN)) | 283 | if (!capable(CAP_SYS_ADMIN)) |
| 284 | return -EPERM; | 284 | return -EPERM; |
| 285 | 285 | ||
| 286 | name = (char *) arg1; | 286 | name = (char __user *) arg1; |
| 287 | 287 | ||
| 288 | len = strncpy_from_user(nodename, name, __NEW_UTS_LEN); | 288 | len = strncpy_from_user(nodename, name, __NEW_UTS_LEN); |
| 289 | if (len < 0) | 289 | if (len < 0) |
| @@ -324,7 +324,7 @@ asmlinkage int _sys_sysmips(int cmd, long arg1, int arg2, int arg3) | |||
| 324 | * This is really horribly ugly. | 324 | * This is really horribly ugly. |
| 325 | */ | 325 | */ |
| 326 | asmlinkage int sys_ipc (uint call, int first, int second, | 326 | asmlinkage int sys_ipc (uint call, int first, int second, |
| 327 | unsigned long third, void *ptr, long fifth) | 327 | unsigned long third, void __user *ptr, long fifth) |
| 328 | { | 328 | { |
| 329 | int version, ret; | 329 | int version, ret; |
| 330 | 330 | ||
| @@ -333,24 +333,25 @@ asmlinkage int sys_ipc (uint call, int first, int second, | |||
| 333 | 333 | ||
| 334 | switch (call) { | 334 | switch (call) { |
| 335 | case SEMOP: | 335 | case SEMOP: |
| 336 | return sys_semtimedop (first, (struct sembuf *)ptr, second, | 336 | return sys_semtimedop (first, (struct sembuf __user *)ptr, |
| 337 | NULL); | 337 | second, NULL); |
| 338 | case SEMTIMEDOP: | 338 | case SEMTIMEDOP: |
| 339 | return sys_semtimedop (first, (struct sembuf *)ptr, second, | 339 | return sys_semtimedop (first, (struct sembuf __user *)ptr, |
| 340 | (const struct timespec __user *)fifth); | 340 | second, |
| 341 | (const struct timespec __user *)fifth); | ||
| 341 | case SEMGET: | 342 | case SEMGET: |
| 342 | return sys_semget (first, second, third); | 343 | return sys_semget (first, second, third); |
| 343 | case SEMCTL: { | 344 | case SEMCTL: { |
| 344 | union semun fourth; | 345 | union semun fourth; |
| 345 | if (!ptr) | 346 | if (!ptr) |
| 346 | return -EINVAL; | 347 | return -EINVAL; |
| 347 | if (get_user(fourth.__pad, (void **) ptr)) | 348 | if (get_user(fourth.__pad, (void *__user *) ptr)) |
| 348 | return -EFAULT; | 349 | return -EFAULT; |
| 349 | return sys_semctl (first, second, third, fourth); | 350 | return sys_semctl (first, second, third, fourth); |
| 350 | } | 351 | } |
| 351 | 352 | ||
| 352 | case MSGSND: | 353 | case MSGSND: |
| 353 | return sys_msgsnd (first, (struct msgbuf *) ptr, | 354 | return sys_msgsnd (first, (struct msgbuf __user *) ptr, |
| 354 | second, third); | 355 | second, third); |
| 355 | case MSGRCV: | 356 | case MSGRCV: |
| 356 | switch (version) { | 357 | switch (version) { |
| @@ -360,7 +361,7 @@ asmlinkage int sys_ipc (uint call, int first, int second, | |||
| 360 | return -EINVAL; | 361 | return -EINVAL; |
| 361 | 362 | ||
| 362 | if (copy_from_user(&tmp, | 363 | if (copy_from_user(&tmp, |
| 363 | (struct ipc_kludge *) ptr, | 364 | (struct ipc_kludge __user *) ptr, |
| 364 | sizeof (tmp))) | 365 | sizeof (tmp))) |
| 365 | return -EFAULT; | 366 | return -EFAULT; |
| 366 | return sys_msgrcv (first, tmp.msgp, second, | 367 | return sys_msgrcv (first, tmp.msgp, second, |
| @@ -368,35 +369,38 @@ asmlinkage int sys_ipc (uint call, int first, int second, | |||
| 368 | } | 369 | } |
| 369 | default: | 370 | default: |
| 370 | return sys_msgrcv (first, | 371 | return sys_msgrcv (first, |
| 371 | (struct msgbuf *) ptr, | 372 | (struct msgbuf __user *) ptr, |
| 372 | second, fifth, third); | 373 | second, fifth, third); |
| 373 | } | 374 | } |
| 374 | case MSGGET: | 375 | case MSGGET: |
| 375 | return sys_msgget ((key_t) first, second); | 376 | return sys_msgget ((key_t) first, second); |
| 376 | case MSGCTL: | 377 | case MSGCTL: |
| 377 | return sys_msgctl (first, second, (struct msqid_ds *) ptr); | 378 | return sys_msgctl (first, second, |
| 379 | (struct msqid_ds __user *) ptr); | ||
| 378 | 380 | ||
| 379 | case SHMAT: | 381 | case SHMAT: |
| 380 | switch (version) { | 382 | switch (version) { |
| 381 | default: { | 383 | default: { |
| 382 | ulong raddr; | 384 | ulong raddr; |
| 383 | ret = do_shmat (first, (char *) ptr, second, &raddr); | 385 | ret = do_shmat (first, (char __user *) ptr, second, |
| 386 | &raddr); | ||
| 384 | if (ret) | 387 | if (ret) |
| 385 | return ret; | 388 | return ret; |
| 386 | return put_user (raddr, (ulong *) third); | 389 | return put_user (raddr, (ulong __user *) third); |
| 387 | } | 390 | } |
| 388 | case 1: /* iBCS2 emulator entry point */ | 391 | case 1: /* iBCS2 emulator entry point */ |
| 389 | if (!segment_eq(get_fs(), get_ds())) | 392 | if (!segment_eq(get_fs(), get_ds())) |
| 390 | return -EINVAL; | 393 | return -EINVAL; |
| 391 | return do_shmat (first, (char *) ptr, second, (ulong *) third); | 394 | return do_shmat (first, (char __user *) ptr, second, |
| 395 | (ulong *) third); | ||
| 392 | } | 396 | } |
| 393 | case SHMDT: | 397 | case SHMDT: |
| 394 | return sys_shmdt ((char *)ptr); | 398 | return sys_shmdt ((char __user *)ptr); |
| 395 | case SHMGET: | 399 | case SHMGET: |
| 396 | return sys_shmget (first, second, third); | 400 | return sys_shmget (first, second, third); |
| 397 | case SHMCTL: | 401 | case SHMCTL: |
| 398 | return sys_shmctl (first, second, | 402 | return sys_shmctl (first, second, |
| 399 | (struct shmid_ds *) ptr); | 403 | (struct shmid_ds __user *) ptr); |
| 400 | default: | 404 | default: |
| 401 | return -ENOSYS; | 405 | return -ENOSYS; |
| 402 | } | 406 | } |
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c index c6d0595da6b5..bd837b5dbf06 100644 --- a/arch/powerpc/kernel/signal_32.c +++ b/arch/powerpc/kernel/signal_32.c | |||
| @@ -142,11 +142,7 @@ static inline int get_old_sigaction(struct k_sigaction *new_ka, | |||
| 142 | return 0; | 142 | return 0; |
| 143 | } | 143 | } |
| 144 | 144 | ||
| 145 | static inline compat_uptr_t to_user_ptr(void *kp) | 145 | #define to_user_ptr(p) ptr_to_compat(p) |
| 146 | { | ||
| 147 | return (compat_uptr_t)(u64)kp; | ||
| 148 | } | ||
| 149 | |||
| 150 | #define from_user_ptr(p) compat_ptr(p) | 146 | #define from_user_ptr(p) compat_ptr(p) |
| 151 | 147 | ||
| 152 | static inline int save_general_regs(struct pt_regs *regs, | 148 | static inline int save_general_regs(struct pt_regs *regs, |
| @@ -213,8 +209,8 @@ static inline int get_old_sigaction(struct k_sigaction *new_ka, | |||
| 213 | return 0; | 209 | return 0; |
| 214 | } | 210 | } |
| 215 | 211 | ||
| 216 | #define to_user_ptr(p) (p) | 212 | #define to_user_ptr(p) ((unsigned long)(p)) |
| 217 | #define from_user_ptr(p) (p) | 213 | #define from_user_ptr(p) ((void __user *)(p)) |
| 218 | 214 | ||
| 219 | static inline int save_general_regs(struct pt_regs *regs, | 215 | static inline int save_general_regs(struct pt_regs *regs, |
| 220 | struct mcontext __user *frame) | 216 | struct mcontext __user *frame) |
| @@ -526,7 +522,7 @@ long compat_sys_rt_sigaction(int sig, const struct sigaction32 __user *act, | |||
| 526 | 522 | ||
| 527 | ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); | 523 | ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); |
| 528 | if (!ret && oact) { | 524 | if (!ret && oact) { |
| 529 | ret = put_user((long)old_ka.sa.sa_handler, &oact->sa_handler); | 525 | ret = put_user(to_user_ptr(old_ka.sa.sa_handler), &oact->sa_handler); |
| 530 | ret |= put_sigset_t(&oact->sa_mask, &old_ka.sa.sa_mask); | 526 | ret |= put_sigset_t(&oact->sa_mask, &old_ka.sa.sa_mask); |
| 531 | ret |= __put_user(old_ka.sa.sa_flags, &oact->sa_flags); | 527 | ret |= __put_user(old_ka.sa.sa_flags, &oact->sa_flags); |
| 532 | } | 528 | } |
| @@ -675,8 +671,8 @@ long compat_sys_rt_sigqueueinfo(u32 pid, u32 sig, compat_siginfo_t __user *uinfo | |||
| 675 | int compat_sys_sigaltstack(u32 __new, u32 __old, int r5, | 671 | int compat_sys_sigaltstack(u32 __new, u32 __old, int r5, |
| 676 | int r6, int r7, int r8, struct pt_regs *regs) | 672 | int r6, int r7, int r8, struct pt_regs *regs) |
| 677 | { | 673 | { |
| 678 | stack_32_t __user * newstack = (stack_32_t __user *)(long) __new; | 674 | stack_32_t __user * newstack = compat_ptr(__new); |
| 679 | stack_32_t __user * oldstack = (stack_32_t __user *)(long) __old; | 675 | stack_32_t __user * oldstack = compat_ptr(__old); |
| 680 | stack_t uss, uoss; | 676 | stack_t uss, uoss; |
| 681 | int ret; | 677 | int ret; |
| 682 | mm_segment_t old_fs; | 678 | mm_segment_t old_fs; |
| @@ -708,7 +704,7 @@ int compat_sys_sigaltstack(u32 __new, u32 __old, int r5, | |||
| 708 | set_fs(old_fs); | 704 | set_fs(old_fs); |
| 709 | /* Copy the stack information to the user output buffer */ | 705 | /* Copy the stack information to the user output buffer */ |
| 710 | if (!ret && oldstack && | 706 | if (!ret && oldstack && |
| 711 | (put_user((long)uoss.ss_sp, &oldstack->ss_sp) || | 707 | (put_user(ptr_to_compat(uoss.ss_sp), &oldstack->ss_sp) || |
| 712 | __put_user(uoss.ss_flags, &oldstack->ss_flags) || | 708 | __put_user(uoss.ss_flags, &oldstack->ss_flags) || |
| 713 | __put_user(uoss.ss_size, &oldstack->ss_size))) | 709 | __put_user(uoss.ss_size, &oldstack->ss_size))) |
| 714 | return -EFAULT; | 710 | return -EFAULT; |
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c index b3193116e686..497a5d3df359 100644 --- a/arch/powerpc/kernel/signal_64.c +++ b/arch/powerpc/kernel/signal_64.c | |||
| @@ -60,8 +60,8 @@ struct rt_sigframe { | |||
| 60 | struct ucontext uc; | 60 | struct ucontext uc; |
| 61 | unsigned long _unused[2]; | 61 | unsigned long _unused[2]; |
| 62 | unsigned int tramp[TRAMP_SIZE]; | 62 | unsigned int tramp[TRAMP_SIZE]; |
| 63 | struct siginfo *pinfo; | 63 | struct siginfo __user *pinfo; |
| 64 | void *puc; | 64 | void __user *puc; |
| 65 | struct siginfo info; | 65 | struct siginfo info; |
| 66 | /* 64 bit ABI allows for 288 bytes below sp before decrementing it. */ | 66 | /* 64 bit ABI allows for 288 bytes below sp before decrementing it. */ |
| 67 | char abigap[288]; | 67 | char abigap[288]; |
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c index f671ed253901..de3f30e6b333 100644 --- a/arch/powerpc/platforms/powermac/pci.c +++ b/arch/powerpc/platforms/powermac/pci.c | |||
| @@ -136,14 +136,14 @@ static void __init fixup_bus_range(struct device_node *bridge) | |||
| 136 | |(((unsigned int)(off)) & 0xFCUL) \ | 136 | |(((unsigned int)(off)) & 0xFCUL) \ |
| 137 | |1UL) | 137 | |1UL) |
| 138 | 138 | ||
| 139 | static unsigned long macrisc_cfg_access(struct pci_controller* hose, | 139 | static volatile void __iomem *macrisc_cfg_access(struct pci_controller* hose, |
| 140 | u8 bus, u8 dev_fn, u8 offset) | 140 | u8 bus, u8 dev_fn, u8 offset) |
| 141 | { | 141 | { |
| 142 | unsigned int caddr; | 142 | unsigned int caddr; |
| 143 | 143 | ||
| 144 | if (bus == hose->first_busno) { | 144 | if (bus == hose->first_busno) { |
| 145 | if (dev_fn < (11 << 3)) | 145 | if (dev_fn < (11 << 3)) |
| 146 | return 0; | 146 | return NULL; |
| 147 | caddr = MACRISC_CFA0(dev_fn, offset); | 147 | caddr = MACRISC_CFA0(dev_fn, offset); |
| 148 | } else | 148 | } else |
| 149 | caddr = MACRISC_CFA1(bus, dev_fn, offset); | 149 | caddr = MACRISC_CFA1(bus, dev_fn, offset); |
| @@ -154,14 +154,14 @@ static unsigned long macrisc_cfg_access(struct pci_controller* hose, | |||
| 154 | } while (in_le32(hose->cfg_addr) != caddr); | 154 | } while (in_le32(hose->cfg_addr) != caddr); |
| 155 | 155 | ||
| 156 | offset &= has_uninorth ? 0x07 : 0x03; | 156 | offset &= has_uninorth ? 0x07 : 0x03; |
| 157 | return ((unsigned long)hose->cfg_data) + offset; | 157 | return hose->cfg_data + offset; |
| 158 | } | 158 | } |
| 159 | 159 | ||
| 160 | static int macrisc_read_config(struct pci_bus *bus, unsigned int devfn, | 160 | static int macrisc_read_config(struct pci_bus *bus, unsigned int devfn, |
| 161 | int offset, int len, u32 *val) | 161 | int offset, int len, u32 *val) |
| 162 | { | 162 | { |
| 163 | struct pci_controller *hose; | 163 | struct pci_controller *hose; |
| 164 | unsigned long addr; | 164 | volatile void __iomem *addr; |
| 165 | 165 | ||
| 166 | hose = pci_bus_to_host(bus); | 166 | hose = pci_bus_to_host(bus); |
| 167 | if (hose == NULL) | 167 | if (hose == NULL) |
| @@ -177,13 +177,13 @@ static int macrisc_read_config(struct pci_bus *bus, unsigned int devfn, | |||
| 177 | */ | 177 | */ |
| 178 | switch (len) { | 178 | switch (len) { |
| 179 | case 1: | 179 | case 1: |
| 180 | *val = in_8((u8 *)addr); | 180 | *val = in_8(addr); |
| 181 | break; | 181 | break; |
| 182 | case 2: | 182 | case 2: |
| 183 | *val = in_le16((u16 *)addr); | 183 | *val = in_le16(addr); |
| 184 | break; | 184 | break; |
| 185 | default: | 185 | default: |
| 186 | *val = in_le32((u32 *)addr); | 186 | *val = in_le32(addr); |
| 187 | break; | 187 | break; |
| 188 | } | 188 | } |
| 189 | return PCIBIOS_SUCCESSFUL; | 189 | return PCIBIOS_SUCCESSFUL; |
| @@ -193,7 +193,7 @@ static int macrisc_write_config(struct pci_bus *bus, unsigned int devfn, | |||
| 193 | int offset, int len, u32 val) | 193 | int offset, int len, u32 val) |
| 194 | { | 194 | { |
| 195 | struct pci_controller *hose; | 195 | struct pci_controller *hose; |
| 196 | unsigned long addr; | 196 | volatile void __iomem *addr; |
| 197 | 197 | ||
| 198 | hose = pci_bus_to_host(bus); | 198 | hose = pci_bus_to_host(bus); |
| 199 | if (hose == NULL) | 199 | if (hose == NULL) |
| @@ -209,16 +209,16 @@ static int macrisc_write_config(struct pci_bus *bus, unsigned int devfn, | |||
| 209 | */ | 209 | */ |
| 210 | switch (len) { | 210 | switch (len) { |
| 211 | case 1: | 211 | case 1: |
| 212 | out_8((u8 *)addr, val); | 212 | out_8(addr, val); |
| 213 | (void) in_8((u8 *)addr); | 213 | (void) in_8(addr); |
| 214 | break; | 214 | break; |
| 215 | case 2: | 215 | case 2: |
| 216 | out_le16((u16 *)addr, val); | 216 | out_le16(addr, val); |
| 217 | (void) in_le16((u16 *)addr); | 217 | (void) in_le16(addr); |
| 218 | break; | 218 | break; |
| 219 | default: | 219 | default: |
| 220 | out_le32((u32 *)addr, val); | 220 | out_le32(addr, val); |
| 221 | (void) in_le32((u32 *)addr); | 221 | (void) in_le32(addr); |
| 222 | break; | 222 | break; |
| 223 | } | 223 | } |
| 224 | return PCIBIOS_SUCCESSFUL; | 224 | return PCIBIOS_SUCCESSFUL; |
| @@ -348,25 +348,23 @@ static int u3_ht_skip_device(struct pci_controller *hose, | |||
| 348 | + (((unsigned int)bus) << 16) \ | 348 | + (((unsigned int)bus) << 16) \ |
| 349 | + 0x01000000UL) | 349 | + 0x01000000UL) |
| 350 | 350 | ||
| 351 | static unsigned long u3_ht_cfg_access(struct pci_controller* hose, | 351 | static volatile void __iomem *u3_ht_cfg_access(struct pci_controller* hose, |
| 352 | u8 bus, u8 devfn, u8 offset) | 352 | u8 bus, u8 devfn, u8 offset) |
| 353 | { | 353 | { |
| 354 | if (bus == hose->first_busno) { | 354 | if (bus == hose->first_busno) { |
| 355 | /* For now, we don't self probe U3 HT bridge */ | 355 | /* For now, we don't self probe U3 HT bridge */ |
| 356 | if (PCI_SLOT(devfn) == 0) | 356 | if (PCI_SLOT(devfn) == 0) |
| 357 | return 0; | 357 | return NULL; |
| 358 | return ((unsigned long)hose->cfg_data) + | 358 | return hose->cfg_data + U3_HT_CFA0(devfn, offset); |
| 359 | U3_HT_CFA0(devfn, offset); | ||
| 360 | } else | 359 | } else |
| 361 | return ((unsigned long)hose->cfg_data) + | 360 | return hose->cfg_data + U3_HT_CFA1(bus, devfn, offset); |
| 362 | U3_HT_CFA1(bus, devfn, offset); | ||
| 363 | } | 361 | } |
| 364 | 362 | ||
| 365 | static int u3_ht_read_config(struct pci_bus *bus, unsigned int devfn, | 363 | static int u3_ht_read_config(struct pci_bus *bus, unsigned int devfn, |
| 366 | int offset, int len, u32 *val) | 364 | int offset, int len, u32 *val) |
| 367 | { | 365 | { |
| 368 | struct pci_controller *hose; | 366 | struct pci_controller *hose; |
| 369 | unsigned long addr; | 367 | volatile void __iomem *addr; |
| 370 | 368 | ||
| 371 | hose = pci_bus_to_host(bus); | 369 | hose = pci_bus_to_host(bus); |
| 372 | if (hose == NULL) | 370 | if (hose == NULL) |
| @@ -400,13 +398,13 @@ static int u3_ht_read_config(struct pci_bus *bus, unsigned int devfn, | |||
| 400 | */ | 398 | */ |
| 401 | switch (len) { | 399 | switch (len) { |
| 402 | case 1: | 400 | case 1: |
| 403 | *val = in_8((u8 *)addr); | 401 | *val = in_8(addr); |
| 404 | break; | 402 | break; |
| 405 | case 2: | 403 | case 2: |
| 406 | *val = in_le16((u16 *)addr); | 404 | *val = in_le16(addr); |
| 407 | break; | 405 | break; |
| 408 | default: | 406 | default: |
| 409 | *val = in_le32((u32 *)addr); | 407 | *val = in_le32(addr); |
| 410 | break; | 408 | break; |
| 411 | } | 409 | } |
| 412 | return PCIBIOS_SUCCESSFUL; | 410 | return PCIBIOS_SUCCESSFUL; |
| @@ -416,7 +414,7 @@ static int u3_ht_write_config(struct pci_bus *bus, unsigned int devfn, | |||
| 416 | int offset, int len, u32 val) | 414 | int offset, int len, u32 val) |
| 417 | { | 415 | { |
| 418 | struct pci_controller *hose; | 416 | struct pci_controller *hose; |
| 419 | unsigned long addr; | 417 | volatile void __iomem *addr; |
| 420 | 418 | ||
| 421 | hose = pci_bus_to_host(bus); | 419 | hose = pci_bus_to_host(bus); |
| 422 | if (hose == NULL) | 420 | if (hose == NULL) |
| @@ -442,16 +440,16 @@ static int u3_ht_write_config(struct pci_bus *bus, unsigned int devfn, | |||
| 442 | */ | 440 | */ |
| 443 | switch (len) { | 441 | switch (len) { |
| 444 | case 1: | 442 | case 1: |
| 445 | out_8((u8 *)addr, val); | 443 | out_8(addr, val); |
| 446 | (void) in_8((u8 *)addr); | 444 | (void) in_8(addr); |
| 447 | break; | 445 | break; |
| 448 | case 2: | 446 | case 2: |
| 449 | out_le16((u16 *)addr, val); | 447 | out_le16(addr, val); |
| 450 | (void) in_le16((u16 *)addr); | 448 | (void) in_le16(addr); |
| 451 | break; | 449 | break; |
| 452 | default: | 450 | default: |
| 453 | out_le32((u32 *)addr, val); | 451 | out_le32((u32 __iomem *)addr, val); |
| 454 | (void) in_le32((u32 *)addr); | 452 | (void) in_le32(addr); |
| 455 | break; | 453 | break; |
| 456 | } | 454 | } |
| 457 | return PCIBIOS_SUCCESSFUL; | 455 | return PCIBIOS_SUCCESSFUL; |
| @@ -476,7 +474,7 @@ static struct pci_ops u3_ht_pci_ops = | |||
| 476 | |(((unsigned int)(off)) & 0xfcU) \ | 474 | |(((unsigned int)(off)) & 0xfcU) \ |
| 477 | |1UL) | 475 | |1UL) |
| 478 | 476 | ||
| 479 | static unsigned long u4_pcie_cfg_access(struct pci_controller* hose, | 477 | static volatile void __iomem *u4_pcie_cfg_access(struct pci_controller* hose, |
| 480 | u8 bus, u8 dev_fn, int offset) | 478 | u8 bus, u8 dev_fn, int offset) |
| 481 | { | 479 | { |
| 482 | unsigned int caddr; | 480 | unsigned int caddr; |
| @@ -492,14 +490,14 @@ static unsigned long u4_pcie_cfg_access(struct pci_controller* hose, | |||
| 492 | } while (in_le32(hose->cfg_addr) != caddr); | 490 | } while (in_le32(hose->cfg_addr) != caddr); |
| 493 | 491 | ||
| 494 | offset &= 0x03; | 492 | offset &= 0x03; |
| 495 | return ((unsigned long)hose->cfg_data) + offset; | 493 | return hose->cfg_data + offset; |
| 496 | } | 494 | } |
| 497 | 495 | ||
| 498 | static int u4_pcie_read_config(struct pci_bus *bus, unsigned int devfn, | 496 | static int u4_pcie_read_config(struct pci_bus *bus, unsigned int devfn, |
| 499 | int offset, int len, u32 *val) | 497 | int offset, int len, u32 *val) |
| 500 | { | 498 | { |
| 501 | struct pci_controller *hose; | 499 | struct pci_controller *hose; |
| 502 | unsigned long addr; | 500 | volatile void __iomem *addr; |
| 503 | 501 | ||
| 504 | hose = pci_bus_to_host(bus); | 502 | hose = pci_bus_to_host(bus); |
| 505 | if (hose == NULL) | 503 | if (hose == NULL) |
| @@ -515,13 +513,13 @@ static int u4_pcie_read_config(struct pci_bus *bus, unsigned int devfn, | |||
| 515 | */ | 513 | */ |
| 516 | switch (len) { | 514 | switch (len) { |
| 517 | case 1: | 515 | case 1: |
| 518 | *val = in_8((u8 *)addr); | 516 | *val = in_8(addr); |
| 519 | break; | 517 | break; |
| 520 | case 2: | 518 | case 2: |
| 521 | *val = in_le16((u16 *)addr); | 519 | *val = in_le16(addr); |
| 522 | break; | 520 | break; |
| 523 | default: | 521 | default: |
| 524 | *val = in_le32((u32 *)addr); | 522 | *val = in_le32(addr); |
| 525 | break; | 523 | break; |
| 526 | } | 524 | } |
| 527 | return PCIBIOS_SUCCESSFUL; | 525 | return PCIBIOS_SUCCESSFUL; |
| @@ -531,7 +529,7 @@ static int u4_pcie_write_config(struct pci_bus *bus, unsigned int devfn, | |||
| 531 | int offset, int len, u32 val) | 529 | int offset, int len, u32 val) |
| 532 | { | 530 | { |
| 533 | struct pci_controller *hose; | 531 | struct pci_controller *hose; |
| 534 | unsigned long addr; | 532 | volatile void __iomem *addr; |
| 535 | 533 | ||
| 536 | hose = pci_bus_to_host(bus); | 534 | hose = pci_bus_to_host(bus); |
| 537 | if (hose == NULL) | 535 | if (hose == NULL) |
| @@ -547,16 +545,16 @@ static int u4_pcie_write_config(struct pci_bus *bus, unsigned int devfn, | |||
| 547 | */ | 545 | */ |
| 548 | switch (len) { | 546 | switch (len) { |
| 549 | case 1: | 547 | case 1: |
| 550 | out_8((u8 *)addr, val); | 548 | out_8(addr, val); |
| 551 | (void) in_8((u8 *)addr); | 549 | (void) in_8(addr); |
| 552 | break; | 550 | break; |
| 553 | case 2: | 551 | case 2: |
| 554 | out_le16((u16 *)addr, val); | 552 | out_le16(addr, val); |
| 555 | (void) in_le16((u16 *)addr); | 553 | (void) in_le16(addr); |
| 556 | break; | 554 | break; |
| 557 | default: | 555 | default: |
| 558 | out_le32((u32 *)addr, val); | 556 | out_le32(addr, val); |
| 559 | (void) in_le32((u32 *)addr); | 557 | (void) in_le32(addr); |
| 560 | break; | 558 | break; |
| 561 | } | 559 | } |
| 562 | return PCIBIOS_SUCCESSFUL; | 560 | return PCIBIOS_SUCCESSFUL; |
| @@ -773,8 +771,7 @@ static void __init setup_u3_ht(struct pci_controller* hose) | |||
| 773 | * the reg address cell, we shall fix that by killing struct | 771 | * the reg address cell, we shall fix that by killing struct |
| 774 | * reg_property and using some accessor functions instead | 772 | * reg_property and using some accessor functions instead |
| 775 | */ | 773 | */ |
| 776 | hose->cfg_data = (volatile unsigned char *)ioremap(0xf2000000, | 774 | hose->cfg_data = ioremap(0xf2000000, 0x02000000); |
| 777 | 0x02000000); | ||
| 778 | 775 | ||
| 779 | /* | 776 | /* |
| 780 | * /ht node doesn't expose a "ranges" property, so we "remove" | 777 | * /ht node doesn't expose a "ranges" property, so we "remove" |
diff --git a/arch/powerpc/sysdev/dart_iommu.c b/arch/powerpc/sysdev/dart_iommu.c index 977de9db8754..6298264efe36 100644 --- a/arch/powerpc/sysdev/dart_iommu.c +++ b/arch/powerpc/sysdev/dart_iommu.c | |||
| @@ -59,7 +59,7 @@ static unsigned long dart_tablesize; | |||
| 59 | static u32 *dart_vbase; | 59 | static u32 *dart_vbase; |
| 60 | 60 | ||
| 61 | /* Mapped base address for the dart */ | 61 | /* Mapped base address for the dart */ |
| 62 | static unsigned int *__iomem dart; | 62 | static unsigned int __iomem *dart; |
| 63 | 63 | ||
| 64 | /* Dummy val that entries are set to when unused */ | 64 | /* Dummy val that entries are set to when unused */ |
| 65 | static unsigned int dart_emptyval; | 65 | static unsigned int dart_emptyval; |
diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c index bf9a7a361b34..cc20f0e3a7d3 100644 --- a/arch/s390/kernel/compat_linux.c +++ b/arch/s390/kernel/compat_linux.c | |||
| @@ -100,12 +100,12 @@ | |||
| 100 | #define SET_STAT_UID(stat, uid) (stat).st_uid = high2lowuid(uid) | 100 | #define SET_STAT_UID(stat, uid) (stat).st_uid = high2lowuid(uid) |
| 101 | #define SET_STAT_GID(stat, gid) (stat).st_gid = high2lowgid(gid) | 101 | #define SET_STAT_GID(stat, gid) (stat).st_gid = high2lowgid(gid) |
| 102 | 102 | ||
| 103 | asmlinkage long sys32_chown16(const char * filename, u16 user, u16 group) | 103 | asmlinkage long sys32_chown16(const char __user * filename, u16 user, u16 group) |
| 104 | { | 104 | { |
| 105 | return sys_chown(filename, low2highuid(user), low2highgid(group)); | 105 | return sys_chown(filename, low2highuid(user), low2highgid(group)); |
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | asmlinkage long sys32_lchown16(const char * filename, u16 user, u16 group) | 108 | asmlinkage long sys32_lchown16(const char __user * filename, u16 user, u16 group) |
| 109 | { | 109 | { |
| 110 | return sys_lchown(filename, low2highuid(user), low2highgid(group)); | 110 | return sys_lchown(filename, low2highuid(user), low2highgid(group)); |
| 111 | } | 111 | } |
| @@ -141,7 +141,7 @@ asmlinkage long sys32_setresuid16(u16 ruid, u16 euid, u16 suid) | |||
| 141 | low2highuid(suid)); | 141 | low2highuid(suid)); |
| 142 | } | 142 | } |
| 143 | 143 | ||
| 144 | asmlinkage long sys32_getresuid16(u16 *ruid, u16 *euid, u16 *suid) | 144 | asmlinkage long sys32_getresuid16(u16 __user *ruid, u16 __user *euid, u16 __user *suid) |
| 145 | { | 145 | { |
| 146 | int retval; | 146 | int retval; |
| 147 | 147 | ||
| @@ -158,7 +158,7 @@ asmlinkage long sys32_setresgid16(u16 rgid, u16 egid, u16 sgid) | |||
| 158 | low2highgid(sgid)); | 158 | low2highgid(sgid)); |
| 159 | } | 159 | } |
| 160 | 160 | ||
| 161 | asmlinkage long sys32_getresgid16(u16 *rgid, u16 *egid, u16 *sgid) | 161 | asmlinkage long sys32_getresgid16(u16 __user *rgid, u16 __user *egid, u16 __user *sgid) |
| 162 | { | 162 | { |
| 163 | int retval; | 163 | int retval; |
| 164 | 164 | ||
| @@ -179,7 +179,7 @@ asmlinkage long sys32_setfsgid16(u16 gid) | |||
| 179 | return sys_setfsgid((gid_t)gid); | 179 | return sys_setfsgid((gid_t)gid); |
| 180 | } | 180 | } |
| 181 | 181 | ||
| 182 | static int groups16_to_user(u16 *grouplist, struct group_info *group_info) | 182 | static int groups16_to_user(u16 __user *grouplist, struct group_info *group_info) |
| 183 | { | 183 | { |
| 184 | int i; | 184 | int i; |
| 185 | u16 group; | 185 | u16 group; |
| @@ -193,7 +193,7 @@ static int groups16_to_user(u16 *grouplist, struct group_info *group_info) | |||
| 193 | return 0; | 193 | return 0; |
| 194 | } | 194 | } |
| 195 | 195 | ||
| 196 | static int groups16_from_user(struct group_info *group_info, u16 *grouplist) | 196 | static int groups16_from_user(struct group_info *group_info, u16 __user *grouplist) |
| 197 | { | 197 | { |
| 198 | int i; | 198 | int i; |
| 199 | u16 group; | 199 | u16 group; |
| @@ -207,7 +207,7 @@ static int groups16_from_user(struct group_info *group_info, u16 *grouplist) | |||
| 207 | return 0; | 207 | return 0; |
| 208 | } | 208 | } |
| 209 | 209 | ||
| 210 | asmlinkage long sys32_getgroups16(int gidsetsize, u16 *grouplist) | 210 | asmlinkage long sys32_getgroups16(int gidsetsize, u16 __user *grouplist) |
| 211 | { | 211 | { |
| 212 | int i; | 212 | int i; |
| 213 | 213 | ||
| @@ -231,7 +231,7 @@ out: | |||
| 231 | return i; | 231 | return i; |
| 232 | } | 232 | } |
| 233 | 233 | ||
| 234 | asmlinkage long sys32_setgroups16(int gidsetsize, u16 *grouplist) | 234 | asmlinkage long sys32_setgroups16(int gidsetsize, u16 __user *grouplist) |
| 235 | { | 235 | { |
| 236 | struct group_info *group_info; | 236 | struct group_info *group_info; |
| 237 | int retval; | 237 | int retval; |
| @@ -278,14 +278,14 @@ asmlinkage long sys32_getegid16(void) | |||
| 278 | 278 | ||
| 279 | /* 32-bit timeval and related flotsam. */ | 279 | /* 32-bit timeval and related flotsam. */ |
| 280 | 280 | ||
| 281 | static inline long get_tv32(struct timeval *o, struct compat_timeval *i) | 281 | static inline long get_tv32(struct timeval *o, struct compat_timeval __user *i) |
| 282 | { | 282 | { |
| 283 | return (!access_ok(VERIFY_READ, o, sizeof(*o)) || | 283 | return (!access_ok(VERIFY_READ, o, sizeof(*o)) || |
| 284 | (__get_user(o->tv_sec, &i->tv_sec) || | 284 | (__get_user(o->tv_sec, &i->tv_sec) || |
| 285 | __get_user(o->tv_usec, &i->tv_usec))); | 285 | __get_user(o->tv_usec, &i->tv_usec))); |
| 286 | } | 286 | } |
| 287 | 287 | ||
| 288 | static inline long put_tv32(struct compat_timeval *o, struct timeval *i) | 288 | static inline long put_tv32(struct compat_timeval __user *o, struct timeval *i) |
| 289 | { | 289 | { |
| 290 | return (!access_ok(VERIFY_WRITE, o, sizeof(*o)) || | 290 | return (!access_ok(VERIFY_WRITE, o, sizeof(*o)) || |
| 291 | (__put_user(i->tv_sec, &o->tv_sec) || | 291 | (__put_user(i->tv_sec, &o->tv_sec) || |
| @@ -341,7 +341,7 @@ asmlinkage long sys32_ipc(u32 call, int first, int second, int third, u32 ptr) | |||
| 341 | return -ENOSYS; | 341 | return -ENOSYS; |
| 342 | } | 342 | } |
| 343 | 343 | ||
| 344 | asmlinkage long sys32_truncate64(const char * path, unsigned long high, unsigned long low) | 344 | asmlinkage long sys32_truncate64(const char __user * path, unsigned long high, unsigned long low) |
| 345 | { | 345 | { |
| 346 | if ((int)high < 0) | 346 | if ((int)high < 0) |
| 347 | return -EINVAL; | 347 | return -EINVAL; |
| @@ -357,7 +357,7 @@ asmlinkage long sys32_ftruncate64(unsigned int fd, unsigned long high, unsigned | |||
| 357 | return sys_ftruncate(fd, (high << 32) | low); | 357 | return sys_ftruncate(fd, (high << 32) | low); |
| 358 | } | 358 | } |
| 359 | 359 | ||
| 360 | int cp_compat_stat(struct kstat *stat, struct compat_stat *statbuf) | 360 | int cp_compat_stat(struct kstat *stat, struct compat_stat __user *statbuf) |
| 361 | { | 361 | { |
| 362 | int err; | 362 | int err; |
| 363 | 363 | ||
| @@ -591,7 +591,7 @@ sys32_delete_module(const char __user *name_user, unsigned int flags) | |||
| 591 | 591 | ||
| 592 | extern struct timezone sys_tz; | 592 | extern struct timezone sys_tz; |
| 593 | 593 | ||
| 594 | asmlinkage long sys32_gettimeofday(struct compat_timeval *tv, struct timezone *tz) | 594 | asmlinkage long sys32_gettimeofday(struct compat_timeval __user *tv, struct timezone __user *tz) |
| 595 | { | 595 | { |
| 596 | if (tv) { | 596 | if (tv) { |
| 597 | struct timeval ktv; | 597 | struct timeval ktv; |
| @@ -606,7 +606,7 @@ asmlinkage long sys32_gettimeofday(struct compat_timeval *tv, struct timezone *t | |||
| 606 | return 0; | 606 | return 0; |
| 607 | } | 607 | } |
| 608 | 608 | ||
| 609 | static inline long get_ts32(struct timespec *o, struct compat_timeval *i) | 609 | static inline long get_ts32(struct timespec *o, struct compat_timeval __user *i) |
| 610 | { | 610 | { |
| 611 | long usec; | 611 | long usec; |
| 612 | 612 | ||
| @@ -620,7 +620,7 @@ static inline long get_ts32(struct timespec *o, struct compat_timeval *i) | |||
| 620 | return 0; | 620 | return 0; |
| 621 | } | 621 | } |
| 622 | 622 | ||
| 623 | asmlinkage long sys32_settimeofday(struct compat_timeval *tv, struct timezone *tz) | 623 | asmlinkage long sys32_settimeofday(struct compat_timeval __user *tv, struct timezone __user *tz) |
| 624 | { | 624 | { |
| 625 | struct timespec kts; | 625 | struct timespec kts; |
| 626 | struct timezone ktz; | 626 | struct timezone ktz; |
| @@ -645,7 +645,7 @@ asmlinkage long sys32_pause(void) | |||
| 645 | return -ERESTARTNOHAND; | 645 | return -ERESTARTNOHAND; |
| 646 | } | 646 | } |
| 647 | 647 | ||
| 648 | asmlinkage long sys32_pread64(unsigned int fd, char *ubuf, | 648 | asmlinkage long sys32_pread64(unsigned int fd, char __user *ubuf, |
| 649 | size_t count, u32 poshi, u32 poslo) | 649 | size_t count, u32 poshi, u32 poslo) |
| 650 | { | 650 | { |
| 651 | if ((compat_ssize_t) count < 0) | 651 | if ((compat_ssize_t) count < 0) |
| @@ -653,7 +653,7 @@ asmlinkage long sys32_pread64(unsigned int fd, char *ubuf, | |||
| 653 | return sys_pread64(fd, ubuf, count, ((loff_t)AA(poshi) << 32) | AA(poslo)); | 653 | return sys_pread64(fd, ubuf, count, ((loff_t)AA(poshi) << 32) | AA(poslo)); |
| 654 | } | 654 | } |
| 655 | 655 | ||
| 656 | asmlinkage long sys32_pwrite64(unsigned int fd, const char *ubuf, | 656 | asmlinkage long sys32_pwrite64(unsigned int fd, const char __user *ubuf, |
| 657 | size_t count, u32 poshi, u32 poslo) | 657 | size_t count, u32 poshi, u32 poslo) |
| 658 | { | 658 | { |
| 659 | if ((compat_ssize_t) count < 0) | 659 | if ((compat_ssize_t) count < 0) |
| @@ -666,7 +666,7 @@ asmlinkage compat_ssize_t sys32_readahead(int fd, u32 offhi, u32 offlo, s32 coun | |||
| 666 | return sys_readahead(fd, ((loff_t)AA(offhi) << 32) | AA(offlo), count); | 666 | return sys_readahead(fd, ((loff_t)AA(offhi) << 32) | AA(offlo), count); |
| 667 | } | 667 | } |
| 668 | 668 | ||
| 669 | asmlinkage long sys32_sendfile(int out_fd, int in_fd, compat_off_t *offset, size_t count) | 669 | asmlinkage long sys32_sendfile(int out_fd, int in_fd, compat_off_t __user *offset, size_t count) |
| 670 | { | 670 | { |
| 671 | mm_segment_t old_fs = get_fs(); | 671 | mm_segment_t old_fs = get_fs(); |
| 672 | int ret; | 672 | int ret; |
| @@ -686,7 +686,7 @@ asmlinkage long sys32_sendfile(int out_fd, int in_fd, compat_off_t *offset, size | |||
| 686 | } | 686 | } |
| 687 | 687 | ||
| 688 | asmlinkage long sys32_sendfile64(int out_fd, int in_fd, | 688 | asmlinkage long sys32_sendfile64(int out_fd, int in_fd, |
| 689 | compat_loff_t *offset, s32 count) | 689 | compat_loff_t __user *offset, s32 count) |
| 690 | { | 690 | { |
| 691 | mm_segment_t old_fs = get_fs(); | 691 | mm_segment_t old_fs = get_fs(); |
| 692 | int ret; | 692 | int ret; |
| @@ -722,7 +722,7 @@ struct timex32 { | |||
| 722 | 722 | ||
| 723 | extern int do_adjtimex(struct timex *); | 723 | extern int do_adjtimex(struct timex *); |
| 724 | 724 | ||
| 725 | asmlinkage long sys32_adjtimex(struct timex32 *utp) | 725 | asmlinkage long sys32_adjtimex(struct timex32 __user *utp) |
| 726 | { | 726 | { |
| 727 | struct timex txc; | 727 | struct timex txc; |
| 728 | int ret; | 728 | int ret; |
| @@ -789,12 +789,13 @@ struct __sysctl_args32 { | |||
| 789 | u32 __unused[4]; | 789 | u32 __unused[4]; |
| 790 | }; | 790 | }; |
| 791 | 791 | ||
| 792 | asmlinkage long sys32_sysctl(struct __sysctl_args32 *args) | 792 | asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args) |
| 793 | { | 793 | { |
| 794 | struct __sysctl_args32 tmp; | 794 | struct __sysctl_args32 tmp; |
| 795 | int error; | 795 | int error; |
| 796 | size_t oldlen, *oldlenp = NULL; | 796 | size_t oldlen; |
| 797 | unsigned long addr = (((long)&args->__unused[0]) + 7) & ~7; | 797 | size_t __user *oldlenp = NULL; |
| 798 | unsigned long addr = (((unsigned long)&args->__unused[0]) + 7) & ~7; | ||
| 798 | 799 | ||
| 799 | if (copy_from_user(&tmp, args, sizeof(tmp))) | 800 | if (copy_from_user(&tmp, args, sizeof(tmp))) |
| 800 | return -EFAULT; | 801 | return -EFAULT; |
| @@ -806,20 +807,20 @@ asmlinkage long sys32_sysctl(struct __sysctl_args32 *args) | |||
| 806 | basically copy the whole sysctl.c here, and | 807 | basically copy the whole sysctl.c here, and |
| 807 | glibc's __sysctl uses rw memory for the structure | 808 | glibc's __sysctl uses rw memory for the structure |
| 808 | anyway. */ | 809 | anyway. */ |
| 809 | if (get_user(oldlen, (u32 *)A(tmp.oldlenp)) || | 810 | if (get_user(oldlen, (u32 __user *)compat_ptr(tmp.oldlenp)) || |
| 810 | put_user(oldlen, (size_t *)addr)) | 811 | put_user(oldlen, (size_t __user *)addr)) |
| 811 | return -EFAULT; | 812 | return -EFAULT; |
| 812 | oldlenp = (size_t *)addr; | 813 | oldlenp = (size_t __user *)addr; |
| 813 | } | 814 | } |
| 814 | 815 | ||
| 815 | lock_kernel(); | 816 | lock_kernel(); |
| 816 | error = do_sysctl((int *)A(tmp.name), tmp.nlen, (void *)A(tmp.oldval), | 817 | error = do_sysctl(compat_ptr(tmp.name), tmp.nlen, compat_ptr(tmp.oldval), |
| 817 | oldlenp, (void *)A(tmp.newval), tmp.newlen); | 818 | oldlenp, compat_ptr(tmp.newval), tmp.newlen); |
| 818 | unlock_kernel(); | 819 | unlock_kernel(); |
| 819 | if (oldlenp) { | 820 | if (oldlenp) { |
| 820 | if (!error) { | 821 | if (!error) { |
| 821 | if (get_user(oldlen, (size_t *)addr) || | 822 | if (get_user(oldlen, (size_t __user *)addr) || |
| 822 | put_user(oldlen, (u32 *)A(tmp.oldlenp))) | 823 | put_user(oldlen, (u32 __user *)compat_ptr(tmp.oldlenp))) |
| 823 | error = -EFAULT; | 824 | error = -EFAULT; |
| 824 | } | 825 | } |
| 825 | copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused)); | 826 | copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused)); |
| @@ -853,7 +854,7 @@ struct stat64_emu31 { | |||
| 853 | unsigned long st_ino; | 854 | unsigned long st_ino; |
| 854 | }; | 855 | }; |
| 855 | 856 | ||
| 856 | static int cp_stat64(struct stat64_emu31 *ubuf, struct kstat *stat) | 857 | static int cp_stat64(struct stat64_emu31 __user *ubuf, struct kstat *stat) |
| 857 | { | 858 | { |
| 858 | struct stat64_emu31 tmp; | 859 | struct stat64_emu31 tmp; |
| 859 | 860 | ||
| @@ -877,7 +878,7 @@ static int cp_stat64(struct stat64_emu31 *ubuf, struct kstat *stat) | |||
| 877 | return copy_to_user(ubuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; | 878 | return copy_to_user(ubuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; |
| 878 | } | 879 | } |
| 879 | 880 | ||
| 880 | asmlinkage long sys32_stat64(char * filename, struct stat64_emu31 * statbuf) | 881 | asmlinkage long sys32_stat64(char __user * filename, struct stat64_emu31 __user * statbuf) |
| 881 | { | 882 | { |
| 882 | struct kstat stat; | 883 | struct kstat stat; |
| 883 | int ret = vfs_stat(filename, &stat); | 884 | int ret = vfs_stat(filename, &stat); |
| @@ -886,7 +887,7 @@ asmlinkage long sys32_stat64(char * filename, struct stat64_emu31 * statbuf) | |||
| 886 | return ret; | 887 | return ret; |
| 887 | } | 888 | } |
| 888 | 889 | ||
| 889 | asmlinkage long sys32_lstat64(char * filename, struct stat64_emu31 * statbuf) | 890 | asmlinkage long sys32_lstat64(char __user * filename, struct stat64_emu31 __user * statbuf) |
| 890 | { | 891 | { |
| 891 | struct kstat stat; | 892 | struct kstat stat; |
| 892 | int ret = vfs_lstat(filename, &stat); | 893 | int ret = vfs_lstat(filename, &stat); |
| @@ -895,7 +896,7 @@ asmlinkage long sys32_lstat64(char * filename, struct stat64_emu31 * statbuf) | |||
| 895 | return ret; | 896 | return ret; |
| 896 | } | 897 | } |
| 897 | 898 | ||
| 898 | asmlinkage long sys32_fstat64(unsigned long fd, struct stat64_emu31 * statbuf) | 899 | asmlinkage long sys32_fstat64(unsigned long fd, struct stat64_emu31 __user * statbuf) |
| 899 | { | 900 | { |
| 900 | struct kstat stat; | 901 | struct kstat stat; |
| 901 | int ret = vfs_fstat(fd, &stat); | 902 | int ret = vfs_fstat(fd, &stat); |
| @@ -952,7 +953,7 @@ out: | |||
| 952 | 953 | ||
| 953 | 954 | ||
| 954 | asmlinkage unsigned long | 955 | asmlinkage unsigned long |
| 955 | old32_mmap(struct mmap_arg_struct_emu31 *arg) | 956 | old32_mmap(struct mmap_arg_struct_emu31 __user *arg) |
| 956 | { | 957 | { |
| 957 | struct mmap_arg_struct_emu31 a; | 958 | struct mmap_arg_struct_emu31 a; |
| 958 | int error = -EFAULT; | 959 | int error = -EFAULT; |
| @@ -970,7 +971,7 @@ out: | |||
| 970 | } | 971 | } |
| 971 | 972 | ||
| 972 | asmlinkage long | 973 | asmlinkage long |
| 973 | sys32_mmap2(struct mmap_arg_struct_emu31 *arg) | 974 | sys32_mmap2(struct mmap_arg_struct_emu31 __user *arg) |
| 974 | { | 975 | { |
| 975 | struct mmap_arg_struct_emu31 a; | 976 | struct mmap_arg_struct_emu31 a; |
| 976 | int error = -EFAULT; | 977 | int error = -EFAULT; |
| @@ -982,7 +983,7 @@ out: | |||
| 982 | return error; | 983 | return error; |
| 983 | } | 984 | } |
| 984 | 985 | ||
| 985 | asmlinkage long sys32_read(unsigned int fd, char * buf, size_t count) | 986 | asmlinkage long sys32_read(unsigned int fd, char __user * buf, size_t count) |
| 986 | { | 987 | { |
| 987 | if ((compat_ssize_t) count < 0) | 988 | if ((compat_ssize_t) count < 0) |
| 988 | return -EINVAL; | 989 | return -EINVAL; |
| @@ -990,7 +991,7 @@ asmlinkage long sys32_read(unsigned int fd, char * buf, size_t count) | |||
| 990 | return sys_read(fd, buf, count); | 991 | return sys_read(fd, buf, count); |
| 991 | } | 992 | } |
| 992 | 993 | ||
| 993 | asmlinkage long sys32_write(unsigned int fd, char * buf, size_t count) | 994 | asmlinkage long sys32_write(unsigned int fd, char __user * buf, size_t count) |
| 994 | { | 995 | { |
| 995 | if ((compat_ssize_t) count < 0) | 996 | if ((compat_ssize_t) count < 0) |
| 996 | return -EINVAL; | 997 | return -EINVAL; |
| @@ -1002,12 +1003,12 @@ asmlinkage long sys32_clone(struct pt_regs regs) | |||
| 1002 | { | 1003 | { |
| 1003 | unsigned long clone_flags; | 1004 | unsigned long clone_flags; |
| 1004 | unsigned long newsp; | 1005 | unsigned long newsp; |
| 1005 | int *parent_tidptr, *child_tidptr; | 1006 | int __user *parent_tidptr, *child_tidptr; |
| 1006 | 1007 | ||
| 1007 | clone_flags = regs.gprs[3] & 0xffffffffUL; | 1008 | clone_flags = regs.gprs[3] & 0xffffffffUL; |
| 1008 | newsp = regs.orig_gpr2 & 0x7fffffffUL; | 1009 | newsp = regs.orig_gpr2 & 0x7fffffffUL; |
| 1009 | parent_tidptr = (int *) (regs.gprs[4] & 0x7fffffffUL); | 1010 | parent_tidptr = compat_ptr(regs.gprs[4]); |
| 1010 | child_tidptr = (int *) (regs.gprs[5] & 0x7fffffffUL); | 1011 | child_tidptr = compat_ptr(regs.gprs[5]); |
| 1011 | if (!newsp) | 1012 | if (!newsp) |
| 1012 | newsp = regs.gprs[15]; | 1013 | newsp = regs.gprs[15]; |
| 1013 | return do_fork(clone_flags, newsp, ®s, 0, | 1014 | return do_fork(clone_flags, newsp, ®s, 0, |
diff --git a/arch/s390/kernel/sys_s390.c b/arch/s390/kernel/sys_s390.c index 6a63553493c5..e351780bb660 100644 --- a/arch/s390/kernel/sys_s390.c +++ b/arch/s390/kernel/sys_s390.c | |||
| @@ -122,8 +122,8 @@ out: | |||
| 122 | #ifndef CONFIG_64BIT | 122 | #ifndef CONFIG_64BIT |
| 123 | struct sel_arg_struct { | 123 | struct sel_arg_struct { |
| 124 | unsigned long n; | 124 | unsigned long n; |
| 125 | fd_set *inp, *outp, *exp; | 125 | fd_set __user *inp, *outp, *exp; |
| 126 | struct timeval *tvp; | 126 | struct timeval __user *tvp; |
| 127 | }; | 127 | }; |
| 128 | 128 | ||
| 129 | asmlinkage long old_select(struct sel_arg_struct __user *arg) | 129 | asmlinkage long old_select(struct sel_arg_struct __user *arg) |
diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c index 5d21e9e6e7b4..a46793beeddd 100644 --- a/arch/s390/kernel/traps.c +++ b/arch/s390/kernel/traps.c | |||
| @@ -486,7 +486,7 @@ asmlinkage void illegal_op(struct pt_regs * regs, long interruption_code) | |||
| 486 | info.si_signo = signal; | 486 | info.si_signo = signal; |
| 487 | info.si_errno = 0; | 487 | info.si_errno = 0; |
| 488 | info.si_code = ILL_ILLOPC; | 488 | info.si_code = ILL_ILLOPC; |
| 489 | info.si_addr = (void *) location; | 489 | info.si_addr = (void __user *) location; |
| 490 | do_trap(interruption_code, signal, | 490 | do_trap(interruption_code, signal, |
| 491 | "illegal operation", regs, &info); | 491 | "illegal operation", regs, &info); |
| 492 | } | 492 | } |
diff --git a/arch/sh/boards/renesas/rts7751r2d/io.c b/arch/sh/boards/renesas/rts7751r2d/io.c index c46f9154cfd5..123abbbc91e0 100644 --- a/arch/sh/boards/renesas/rts7751r2d/io.c +++ b/arch/sh/boards/renesas/rts7751r2d/io.c | |||
| @@ -216,24 +216,26 @@ void rts7751r2d_insb(unsigned long port, void *addr, unsigned long count) | |||
| 216 | { | 216 | { |
| 217 | volatile __u8 *bp; | 217 | volatile __u8 *bp; |
| 218 | volatile __u16 *p; | 218 | volatile __u16 *p; |
| 219 | unsigned char *s = addr; | ||
| 219 | 220 | ||
| 220 | if (CHECK_AX88796L_PORT(port)) { | 221 | if (CHECK_AX88796L_PORT(port)) { |
| 221 | p = (volatile unsigned short *)port88796l(port, 0); | 222 | p = (volatile unsigned short *)port88796l(port, 0); |
| 222 | while (count--) *((unsigned char *) addr)++ = *p & 0xff; | 223 | while (count--) *s++ = *p & 0xff; |
| 223 | } else if (PXSEG(port)) | 224 | } else if (PXSEG(port)) |
| 224 | while (count--) *((unsigned char *) addr)++ = *(volatile unsigned char *)port; | 225 | while (count--) *s++ = *(volatile unsigned char *)port; |
| 225 | else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) { | 226 | else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) { |
| 226 | bp = (__u8 *)PCI_IOMAP(port); | 227 | bp = (__u8 *)PCI_IOMAP(port); |
| 227 | while (count--) *((volatile unsigned char *) addr)++ = *bp; | 228 | while (count--) *s++ = *bp; |
| 228 | } else { | 229 | } else { |
| 229 | p = (volatile unsigned short *)port2adr(port); | 230 | p = (volatile unsigned short *)port2adr(port); |
| 230 | while (count--) *((unsigned char *) addr)++ = *p & 0xff; | 231 | while (count--) *s++ = *p & 0xff; |
| 231 | } | 232 | } |
| 232 | } | 233 | } |
| 233 | 234 | ||
| 234 | void rts7751r2d_insw(unsigned long port, void *addr, unsigned long count) | 235 | void rts7751r2d_insw(unsigned long port, void *addr, unsigned long count) |
| 235 | { | 236 | { |
| 236 | volatile __u16 *p; | 237 | volatile __u16 *p; |
| 238 | __u16 *s = addr; | ||
| 237 | 239 | ||
| 238 | if (CHECK_AX88796L_PORT(port)) | 240 | if (CHECK_AX88796L_PORT(port)) |
| 239 | p = (volatile unsigned short *)port88796l(port, 1); | 241 | p = (volatile unsigned short *)port88796l(port, 1); |
| @@ -243,7 +245,7 @@ void rts7751r2d_insw(unsigned long port, void *addr, unsigned long count) | |||
| 243 | p = (volatile unsigned short *)PCI_IOMAP(port); | 245 | p = (volatile unsigned short *)PCI_IOMAP(port); |
| 244 | else | 246 | else |
| 245 | p = (volatile unsigned short *)port2adr(port); | 247 | p = (volatile unsigned short *)port2adr(port); |
| 246 | while (count--) *((__u16 *) addr)++ = *p; | 248 | while (count--) *s++ = *p; |
| 247 | } | 249 | } |
| 248 | 250 | ||
| 249 | void rts7751r2d_insl(unsigned long port, void *addr, unsigned long count) | 251 | void rts7751r2d_insl(unsigned long port, void *addr, unsigned long count) |
| @@ -252,8 +254,9 @@ void rts7751r2d_insl(unsigned long port, void *addr, unsigned long count) | |||
| 252 | maybebadio(insl, port); | 254 | maybebadio(insl, port); |
| 253 | else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) { | 255 | else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) { |
| 254 | volatile __u32 *p = (__u32 *)PCI_IOMAP(port); | 256 | volatile __u32 *p = (__u32 *)PCI_IOMAP(port); |
| 257 | __u32 *s = addr; | ||
| 255 | 258 | ||
| 256 | while (count--) *((__u32 *) addr)++ = *p; | 259 | while (count--) *s++ = *p; |
| 257 | } else | 260 | } else |
| 258 | maybebadio(insl, port); | 261 | maybebadio(insl, port); |
| 259 | } | 262 | } |
| @@ -262,24 +265,26 @@ void rts7751r2d_outsb(unsigned long port, const void *addr, unsigned long count) | |||
| 262 | { | 265 | { |
| 263 | volatile __u8 *bp; | 266 | volatile __u8 *bp; |
| 264 | volatile __u16 *p; | 267 | volatile __u16 *p; |
| 268 | const __u8 *s = addr; | ||
| 265 | 269 | ||
| 266 | if (CHECK_AX88796L_PORT(port)) { | 270 | if (CHECK_AX88796L_PORT(port)) { |
| 267 | p = (volatile unsigned short *)port88796l(port, 0); | 271 | p = (volatile unsigned short *)port88796l(port, 0); |
| 268 | while (count--) *p = *((unsigned char *) addr)++; | 272 | while (count--) *p = *s++; |
| 269 | } else if (PXSEG(port)) | 273 | } else if (PXSEG(port)) |
| 270 | while (count--) *(volatile unsigned char *)port = *((unsigned char *) addr)++; | 274 | while (count--) *(volatile unsigned char *)port = *s++; |
| 271 | else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) { | 275 | else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) { |
| 272 | bp = (__u8 *)PCI_IOMAP(port); | 276 | bp = (__u8 *)PCI_IOMAP(port); |
| 273 | while (count--) *bp = *((volatile unsigned char *) addr)++; | 277 | while (count--) *bp = *s++; |
| 274 | } else { | 278 | } else { |
| 275 | p = (volatile unsigned short *)port2adr(port); | 279 | p = (volatile unsigned short *)port2adr(port); |
| 276 | while (count--) *p = *((unsigned char *) addr)++; | 280 | while (count--) *p = *s++; |
| 277 | } | 281 | } |
| 278 | } | 282 | } |
| 279 | 283 | ||
| 280 | void rts7751r2d_outsw(unsigned long port, const void *addr, unsigned long count) | 284 | void rts7751r2d_outsw(unsigned long port, const void *addr, unsigned long count) |
| 281 | { | 285 | { |
| 282 | volatile __u16 *p; | 286 | volatile __u16 *p; |
| 287 | const __u16 *s = addr; | ||
| 283 | 288 | ||
| 284 | if (CHECK_AX88796L_PORT(port)) | 289 | if (CHECK_AX88796L_PORT(port)) |
| 285 | p = (volatile unsigned short *)port88796l(port, 1); | 290 | p = (volatile unsigned short *)port88796l(port, 1); |
| @@ -289,7 +294,7 @@ void rts7751r2d_outsw(unsigned long port, const void *addr, unsigned long count) | |||
| 289 | p = (volatile unsigned short *)PCI_IOMAP(port); | 294 | p = (volatile unsigned short *)PCI_IOMAP(port); |
| 290 | else | 295 | else |
| 291 | p = (volatile unsigned short *)port2adr(port); | 296 | p = (volatile unsigned short *)port2adr(port); |
| 292 | while (count--) *p = *((__u16 *) addr)++; | 297 | while (count--) *p = *s++; |
| 293 | } | 298 | } |
| 294 | 299 | ||
| 295 | void rts7751r2d_outsl(unsigned long port, const void *addr, unsigned long count) | 300 | void rts7751r2d_outsl(unsigned long port, const void *addr, unsigned long count) |
| @@ -298,8 +303,9 @@ void rts7751r2d_outsl(unsigned long port, const void *addr, unsigned long count) | |||
| 298 | maybebadio(outsl, port); | 303 | maybebadio(outsl, port); |
| 299 | else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) { | 304 | else if (CHECK_SH7751_PCIIO(port) || shifted_port(port)) { |
| 300 | volatile __u32 *p = (__u32 *)PCI_IOMAP(port); | 305 | volatile __u32 *p = (__u32 *)PCI_IOMAP(port); |
| 306 | const __u32 *s = addr; | ||
| 301 | 307 | ||
| 302 | while (count--) *p = *((__u32 *) addr)++; | 308 | while (count--) *p = *s++; |
| 303 | } else | 309 | } else |
| 304 | maybebadio(outsl, port); | 310 | maybebadio(outsl, port); |
| 305 | } | 311 | } |
diff --git a/block/elevator.c b/block/elevator.c index 2fc269f69726..24b702d649a9 100644 --- a/block/elevator.c +++ b/block/elevator.c | |||
| @@ -293,7 +293,7 @@ void elv_requeue_request(request_queue_t *q, struct request *rq) | |||
| 293 | 293 | ||
| 294 | rq->flags &= ~REQ_STARTED; | 294 | rq->flags &= ~REQ_STARTED; |
| 295 | 295 | ||
| 296 | __elv_add_request(q, rq, ELEVATOR_INSERT_REQUEUE, 0); | 296 | elv_insert(q, rq, ELEVATOR_INSERT_REQUEUE); |
| 297 | } | 297 | } |
| 298 | 298 | ||
| 299 | static void elv_drain_elevator(request_queue_t *q) | 299 | static void elv_drain_elevator(request_queue_t *q) |
| @@ -310,41 +310,11 @@ static void elv_drain_elevator(request_queue_t *q) | |||
| 310 | } | 310 | } |
| 311 | } | 311 | } |
| 312 | 312 | ||
| 313 | void __elv_add_request(request_queue_t *q, struct request *rq, int where, | 313 | void elv_insert(request_queue_t *q, struct request *rq, int where) |
| 314 | int plug) | ||
| 315 | { | 314 | { |
| 316 | struct list_head *pos; | 315 | struct list_head *pos; |
| 317 | unsigned ordseq; | 316 | unsigned ordseq; |
| 318 | 317 | ||
| 319 | if (q->ordcolor) | ||
| 320 | rq->flags |= REQ_ORDERED_COLOR; | ||
| 321 | |||
| 322 | if (rq->flags & (REQ_SOFTBARRIER | REQ_HARDBARRIER)) { | ||
| 323 | /* | ||
| 324 | * toggle ordered color | ||
| 325 | */ | ||
| 326 | if (blk_barrier_rq(rq)) | ||
| 327 | q->ordcolor ^= 1; | ||
| 328 | |||
| 329 | /* | ||
| 330 | * barriers implicitly indicate back insertion | ||
| 331 | */ | ||
| 332 | if (where == ELEVATOR_INSERT_SORT) | ||
| 333 | where = ELEVATOR_INSERT_BACK; | ||
| 334 | |||
| 335 | /* | ||
| 336 | * this request is scheduling boundary, update end_sector | ||
| 337 | */ | ||
| 338 | if (blk_fs_request(rq)) { | ||
| 339 | q->end_sector = rq_end_sector(rq); | ||
| 340 | q->boundary_rq = rq; | ||
| 341 | } | ||
| 342 | } else if (!(rq->flags & REQ_ELVPRIV) && where == ELEVATOR_INSERT_SORT) | ||
| 343 | where = ELEVATOR_INSERT_BACK; | ||
| 344 | |||
| 345 | if (plug) | ||
| 346 | blk_plug_device(q); | ||
| 347 | |||
| 348 | rq->q = q; | 318 | rq->q = q; |
| 349 | 319 | ||
| 350 | switch (where) { | 320 | switch (where) { |
| @@ -425,6 +395,42 @@ void __elv_add_request(request_queue_t *q, struct request *rq, int where, | |||
| 425 | } | 395 | } |
| 426 | } | 396 | } |
| 427 | 397 | ||
| 398 | void __elv_add_request(request_queue_t *q, struct request *rq, int where, | ||
| 399 | int plug) | ||
| 400 | { | ||
| 401 | if (q->ordcolor) | ||
| 402 | rq->flags |= REQ_ORDERED_COLOR; | ||
| 403 | |||
| 404 | if (rq->flags & (REQ_SOFTBARRIER | REQ_HARDBARRIER)) { | ||
| 405 | /* | ||
| 406 | * toggle ordered color | ||
| 407 | */ | ||
| 408 | if (blk_barrier_rq(rq)) | ||
| 409 | q->ordcolor ^= 1; | ||
| 410 | |||
| 411 | /* | ||
| 412 | * barriers implicitly indicate back insertion | ||
| 413 | */ | ||
| 414 | if (where == ELEVATOR_INSERT_SORT) | ||
| 415 | where = ELEVATOR_INSERT_BACK; | ||
| 416 | |||
| 417 | /* | ||
| 418 | * this request is scheduling boundary, update | ||
| 419 | * end_sector | ||
| 420 | */ | ||
| 421 | if (blk_fs_request(rq)) { | ||
| 422 | q->end_sector = rq_end_sector(rq); | ||
| 423 | q->boundary_rq = rq; | ||
| 424 | } | ||
| 425 | } else if (!(rq->flags & REQ_ELVPRIV) && where == ELEVATOR_INSERT_SORT) | ||
| 426 | where = ELEVATOR_INSERT_BACK; | ||
| 427 | |||
| 428 | if (plug) | ||
| 429 | blk_plug_device(q); | ||
| 430 | |||
| 431 | elv_insert(q, rq, where); | ||
| 432 | } | ||
| 433 | |||
| 428 | void elv_add_request(request_queue_t *q, struct request *rq, int where, | 434 | void elv_add_request(request_queue_t *q, struct request *rq, int where, |
| 429 | int plug) | 435 | int plug) |
| 430 | { | 436 | { |
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c index ee5ed98db4cd..03d9c82b0fe7 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c | |||
| @@ -454,7 +454,7 @@ static void queue_flush(request_queue_t *q, unsigned which) | |||
| 454 | rq->end_io = end_io; | 454 | rq->end_io = end_io; |
| 455 | q->prepare_flush_fn(q, rq); | 455 | q->prepare_flush_fn(q, rq); |
| 456 | 456 | ||
| 457 | __elv_add_request(q, rq, ELEVATOR_INSERT_FRONT, 0); | 457 | elv_insert(q, rq, ELEVATOR_INSERT_FRONT); |
| 458 | } | 458 | } |
| 459 | 459 | ||
| 460 | static inline struct request *start_ordered(request_queue_t *q, | 460 | static inline struct request *start_ordered(request_queue_t *q, |
| @@ -490,7 +490,7 @@ static inline struct request *start_ordered(request_queue_t *q, | |||
| 490 | else | 490 | else |
| 491 | q->ordseq |= QUEUE_ORDSEQ_POSTFLUSH; | 491 | q->ordseq |= QUEUE_ORDSEQ_POSTFLUSH; |
| 492 | 492 | ||
| 493 | __elv_add_request(q, rq, ELEVATOR_INSERT_FRONT, 0); | 493 | elv_insert(q, rq, ELEVATOR_INSERT_FRONT); |
| 494 | 494 | ||
| 495 | if (q->ordered & QUEUE_ORDERED_PREFLUSH) { | 495 | if (q->ordered & QUEUE_ORDERED_PREFLUSH) { |
| 496 | queue_flush(q, QUEUE_ORDERED_PREFLUSH); | 496 | queue_flush(q, QUEUE_ORDERED_PREFLUSH); |
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c index cc72210687eb..24f7af9d0abc 100644 --- a/block/scsi_ioctl.c +++ b/block/scsi_ioctl.c | |||
| @@ -310,6 +310,8 @@ static int sg_io(struct file *file, request_queue_t *q, | |||
| 310 | if (!rq->timeout) | 310 | if (!rq->timeout) |
| 311 | rq->timeout = BLK_DEFAULT_TIMEOUT; | 311 | rq->timeout = BLK_DEFAULT_TIMEOUT; |
| 312 | 312 | ||
| 313 | rq->retries = 0; | ||
| 314 | |||
| 313 | start_time = jiffies; | 315 | start_time = jiffies; |
| 314 | 316 | ||
| 315 | /* ignore return value. All information is passed back to caller | 317 | /* ignore return value. All information is passed back to caller |
| @@ -427,6 +429,7 @@ static int sg_scsi_ioctl(struct file *file, request_queue_t *q, | |||
| 427 | rq->data = buffer; | 429 | rq->data = buffer; |
| 428 | rq->data_len = bytes; | 430 | rq->data_len = bytes; |
| 429 | rq->flags |= REQ_BLOCK_PC; | 431 | rq->flags |= REQ_BLOCK_PC; |
| 432 | rq->retries = 0; | ||
| 430 | 433 | ||
| 431 | blk_execute_rq(q, bd_disk, rq, 0); | 434 | blk_execute_rq(q, bd_disk, rq, 0); |
| 432 | err = rq->errors & 0xff; /* only 8 bit SCSI status */ | 435 | err = rq->errors & 0xff; /* only 8 bit SCSI status */ |
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig index 4c67727d75b1..05ba410682a3 100644 --- a/drivers/char/Kconfig +++ b/drivers/char/Kconfig | |||
| @@ -222,7 +222,7 @@ config SYNCLINKMP | |||
| 222 | 222 | ||
| 223 | config SYNCLINK_GT | 223 | config SYNCLINK_GT |
| 224 | tristate "SyncLink GT/AC support" | 224 | tristate "SyncLink GT/AC support" |
| 225 | depends on SERIAL_NONSTANDARD | 225 | depends on SERIAL_NONSTANDARD && PCI |
| 226 | help | 226 | help |
| 227 | Support for SyncLink GT and SyncLink AC families of | 227 | Support for SyncLink GT and SyncLink AC families of |
| 228 | synchronous and asynchronous serial adapters | 228 | synchronous and asynchronous serial adapters |
diff --git a/drivers/isdn/hisax/Kconfig b/drivers/isdn/hisax/Kconfig index 0ef560144be3..6dfc94122dd9 100644 --- a/drivers/isdn/hisax/Kconfig +++ b/drivers/isdn/hisax/Kconfig | |||
| @@ -351,7 +351,7 @@ config HISAX_ENTERNOW_PCI | |||
| 351 | 351 | ||
| 352 | config HISAX_AMD7930 | 352 | config HISAX_AMD7930 |
| 353 | bool "Am7930 (EXPERIMENTAL)" | 353 | bool "Am7930 (EXPERIMENTAL)" |
| 354 | depends on EXPERIMENTAL && SPARC | 354 | depends on EXPERIMENTAL && SPARC && BROKEN |
| 355 | help | 355 | help |
| 356 | This enables HiSax support for the AMD7930 chips on some SPARCs. | 356 | This enables HiSax support for the AMD7930 chips on some SPARCs. |
| 357 | This code is not finished yet. | 357 | This code is not finished yet. |
diff --git a/drivers/macintosh/Kconfig b/drivers/macintosh/Kconfig index b11cd31d8d27..12ad462737ba 100644 --- a/drivers/macintosh/Kconfig +++ b/drivers/macintosh/Kconfig | |||
| @@ -190,7 +190,7 @@ config WINDFARM_PM91 | |||
| 190 | config WINDFARM_PM112 | 190 | config WINDFARM_PM112 |
| 191 | tristate "Support for thermal management on PowerMac11,2" | 191 | tristate "Support for thermal management on PowerMac11,2" |
| 192 | depends on WINDFARM && I2C && PMAC_SMU | 192 | depends on WINDFARM && I2C && PMAC_SMU |
| 193 | select I2C_PMAC_SMU | 193 | select I2C_POWERMAC |
| 194 | help | 194 | help |
| 195 | This driver provides thermal control for the PowerMac11,2 | 195 | This driver provides thermal control for the PowerMac11,2 |
| 196 | which are the recent dual and quad G5 machines using the | 196 | which are the recent dual and quad G5 machines using the |
diff --git a/drivers/media/video/compat_ioctl32.c b/drivers/media/video/compat_ioctl32.c index 297c32ab51e3..840fe0177121 100644 --- a/drivers/media/video/compat_ioctl32.c +++ b/drivers/media/video/compat_ioctl32.c | |||
| @@ -167,29 +167,32 @@ static int get_v4l2_window32(struct v4l2_window *kp, struct v4l2_window32 __user | |||
| 167 | if (kp->clipcount > 2048) | 167 | if (kp->clipcount > 2048) |
| 168 | return -EINVAL; | 168 | return -EINVAL; |
| 169 | if (kp->clipcount) { | 169 | if (kp->clipcount) { |
| 170 | struct v4l2_clip32 *uclips = compat_ptr(up->clips); | 170 | struct v4l2_clip32 __user *uclips; |
| 171 | struct v4l2_clip *kclips; | 171 | struct v4l2_clip __user *kclips; |
| 172 | int n = kp->clipcount; | 172 | int n = kp->clipcount; |
| 173 | compat_caddr_t p; | ||
| 173 | 174 | ||
| 175 | if (get_user(p, &up->clips)) | ||
| 176 | return -EFAULT; | ||
| 177 | uclips = compat_ptr(p); | ||
| 174 | kclips = compat_alloc_user_space(n * sizeof(struct v4l2_clip)); | 178 | kclips = compat_alloc_user_space(n * sizeof(struct v4l2_clip)); |
| 175 | kp->clips = kclips; | 179 | kp->clips = kclips; |
| 176 | while (--n >= 0) { | 180 | while (--n >= 0) { |
| 177 | if (!access_ok(VERIFY_READ, &uclips->c, sizeof(uclips->c)) || | 181 | if (copy_in_user(&kclips->c, &uclips->c, sizeof(uclips->c))) |
| 178 | copy_from_user(&kclips->c, &uclips->c, sizeof(uclips->c))) | 182 | return -EFAULT; |
| 183 | if (put_user(n ? kclips + 1 : NULL, &kclips->next)) | ||
| 179 | return -EFAULT; | 184 | return -EFAULT; |
| 180 | kclips->next = n ? kclips + 1 : 0; | ||
| 181 | uclips += 1; | 185 | uclips += 1; |
| 182 | kclips += 1; | 186 | kclips += 1; |
| 183 | } | 187 | } |
| 184 | } else | 188 | } else |
| 185 | kp->clips = 0; | 189 | kp->clips = NULL; |
| 186 | return 0; | 190 | return 0; |
| 187 | } | 191 | } |
| 188 | 192 | ||
| 189 | static int put_v4l2_window32(struct v4l2_window *kp, struct v4l2_window32 __user *up) | 193 | static int put_v4l2_window32(struct v4l2_window *kp, struct v4l2_window32 __user *up) |
| 190 | { | 194 | { |
| 191 | if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_window32)) || | 195 | if (copy_to_user(&up->w, &kp->w, sizeof(up->w)) || |
| 192 | copy_to_user(&up->w, &kp->w, sizeof(up->w)) || | ||
| 193 | put_user(kp->field, &up->field) || | 196 | put_user(kp->field, &up->field) || |
| 194 | put_user(kp->chromakey, &up->chromakey) || | 197 | put_user(kp->chromakey, &up->chromakey) || |
| 195 | put_user(kp->clipcount, &up->clipcount)) | 198 | put_user(kp->clipcount, &up->clipcount)) |
| @@ -199,33 +202,29 @@ static int put_v4l2_window32(struct v4l2_window *kp, struct v4l2_window32 __user | |||
| 199 | 202 | ||
| 200 | static inline int get_v4l2_pix_format(struct v4l2_pix_format *kp, struct v4l2_pix_format __user *up) | 203 | static inline int get_v4l2_pix_format(struct v4l2_pix_format *kp, struct v4l2_pix_format __user *up) |
| 201 | { | 204 | { |
| 202 | if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_pix_format)) || | 205 | if (copy_from_user(kp, up, sizeof(struct v4l2_pix_format))) |
| 203 | copy_from_user(kp, up, sizeof(struct v4l2_pix_format))) | 206 | return -EFAULT; |
| 204 | return -EFAULT; | ||
| 205 | return 0; | 207 | return 0; |
| 206 | } | 208 | } |
| 207 | 209 | ||
| 208 | static inline int put_v4l2_pix_format(struct v4l2_pix_format *kp, struct v4l2_pix_format __user *up) | 210 | static inline int put_v4l2_pix_format(struct v4l2_pix_format *kp, struct v4l2_pix_format __user *up) |
| 209 | { | 211 | { |
| 210 | if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_pix_format)) || | 212 | if (copy_to_user(up, kp, sizeof(struct v4l2_pix_format))) |
| 211 | copy_to_user(up, kp, sizeof(struct v4l2_pix_format))) | 213 | return -EFAULT; |
| 212 | return -EFAULT; | ||
| 213 | return 0; | 214 | return 0; |
| 214 | } | 215 | } |
| 215 | 216 | ||
| 216 | static inline int get_v4l2_vbi_format(struct v4l2_vbi_format *kp, struct v4l2_vbi_format __user *up) | 217 | static inline int get_v4l2_vbi_format(struct v4l2_vbi_format *kp, struct v4l2_vbi_format __user *up) |
| 217 | { | 218 | { |
| 218 | if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_vbi_format)) || | 219 | if (copy_from_user(kp, up, sizeof(struct v4l2_vbi_format))) |
| 219 | copy_from_user(kp, up, sizeof(struct v4l2_vbi_format))) | 220 | return -EFAULT; |
| 220 | return -EFAULT; | ||
| 221 | return 0; | 221 | return 0; |
| 222 | } | 222 | } |
| 223 | 223 | ||
| 224 | static inline int put_v4l2_vbi_format(struct v4l2_vbi_format *kp, struct v4l2_vbi_format __user *up) | 224 | static inline int put_v4l2_vbi_format(struct v4l2_vbi_format *kp, struct v4l2_vbi_format __user *up) |
| 225 | { | 225 | { |
| 226 | if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_vbi_format)) || | 226 | if (copy_to_user(up, kp, sizeof(struct v4l2_vbi_format))) |
| 227 | copy_to_user(up, kp, sizeof(struct v4l2_vbi_format))) | 227 | return -EFAULT; |
| 228 | return -EFAULT; | ||
| 229 | return 0; | 228 | return 0; |
| 230 | } | 229 | } |
| 231 | 230 | ||
| @@ -279,18 +278,16 @@ static int put_v4l2_format32(struct v4l2_format *kp, struct v4l2_format32 __user | |||
| 279 | 278 | ||
| 280 | static inline int get_v4l2_standard(struct v4l2_standard *kp, struct v4l2_standard __user *up) | 279 | static inline int get_v4l2_standard(struct v4l2_standard *kp, struct v4l2_standard __user *up) |
| 281 | { | 280 | { |
| 282 | if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_standard)) || | 281 | if (copy_from_user(kp, up, sizeof(struct v4l2_standard))) |
| 283 | copy_from_user(kp, up, sizeof(struct v4l2_standard))) | 282 | return -EFAULT; |
| 284 | return -EFAULT; | ||
| 285 | return 0; | 283 | return 0; |
| 286 | 284 | ||
| 287 | } | 285 | } |
| 288 | 286 | ||
| 289 | static inline int put_v4l2_standard(struct v4l2_standard *kp, struct v4l2_standard __user *up) | 287 | static inline int put_v4l2_standard(struct v4l2_standard *kp, struct v4l2_standard __user *up) |
| 290 | { | 288 | { |
| 291 | if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_standard)) || | 289 | if (copy_to_user(up, kp, sizeof(struct v4l2_standard))) |
| 292 | copy_to_user(up, kp, sizeof(struct v4l2_standard))) | 290 | return -EFAULT; |
| 293 | return -EFAULT; | ||
| 294 | return 0; | 291 | return 0; |
| 295 | } | 292 | } |
| 296 | 293 | ||
| @@ -328,18 +325,16 @@ static int put_v4l2_standard32(struct v4l2_standard *kp, struct v4l2_standard32 | |||
| 328 | 325 | ||
| 329 | static inline int get_v4l2_tuner(struct v4l2_tuner *kp, struct v4l2_tuner __user *up) | 326 | static inline int get_v4l2_tuner(struct v4l2_tuner *kp, struct v4l2_tuner __user *up) |
| 330 | { | 327 | { |
| 331 | if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_tuner)) || | 328 | if (copy_from_user(kp, up, sizeof(struct v4l2_tuner))) |
| 332 | copy_from_user(kp, up, sizeof(struct v4l2_tuner))) | 329 | return -EFAULT; |
| 333 | return -EFAULT; | ||
| 334 | return 0; | 330 | return 0; |
| 335 | 331 | ||
| 336 | } | 332 | } |
| 337 | 333 | ||
| 338 | static inline int put_v4l2_tuner(struct v4l2_tuner *kp, struct v4l2_tuner __user *up) | 334 | static inline int put_v4l2_tuner(struct v4l2_tuner *kp, struct v4l2_tuner __user *up) |
| 339 | { | 335 | { |
| 340 | if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_tuner)) || | 336 | if (copy_to_user(up, kp, sizeof(struct v4l2_tuner))) |
| 341 | copy_to_user(up, kp, sizeof(struct v4l2_tuner))) | 337 | return -EFAULT; |
| 342 | return -EFAULT; | ||
| 343 | return 0; | 338 | return 0; |
| 344 | } | 339 | } |
| 345 | 340 | ||
| @@ -380,11 +375,13 @@ static int get_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user | |||
| 380 | break; | 375 | break; |
| 381 | case V4L2_MEMORY_USERPTR: | 376 | case V4L2_MEMORY_USERPTR: |
| 382 | { | 377 | { |
| 383 | unsigned long tmp = (unsigned long)compat_ptr(up->m.userptr); | 378 | compat_long_t tmp; |
| 384 | 379 | ||
| 385 | if(get_user(kp->length, &up->length) || | 380 | if (get_user(kp->length, &up->length) || |
| 386 | get_user(kp->m.userptr, &tmp)) | 381 | get_user(tmp, &up->m.userptr)) |
| 387 | return -EFAULT; | 382 | return -EFAULT; |
| 383 | |||
| 384 | kp->m.userptr = (unsigned long)compat_ptr(tmp); | ||
| 388 | } | 385 | } |
| 389 | break; | 386 | break; |
| 390 | case V4L2_MEMORY_OVERLAY: | 387 | case V4L2_MEMORY_OVERLAY: |
| @@ -468,33 +465,29 @@ static int put_v4l2_framebuffer32(struct v4l2_framebuffer *kp, struct v4l2_frame | |||
| 468 | 465 | ||
| 469 | static inline int get_v4l2_input32(struct v4l2_input *kp, struct v4l2_input __user *up) | 466 | static inline int get_v4l2_input32(struct v4l2_input *kp, struct v4l2_input __user *up) |
| 470 | { | 467 | { |
| 471 | if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_input) - 4) || | 468 | if (copy_from_user(kp, up, sizeof(struct v4l2_input) - 4)) |
| 472 | copy_from_user(kp, up, sizeof(struct v4l2_input) - 4)) | 469 | return -EFAULT; |
| 473 | return -EFAULT; | ||
| 474 | return 0; | 470 | return 0; |
| 475 | } | 471 | } |
| 476 | 472 | ||
| 477 | static inline int put_v4l2_input32(struct v4l2_input *kp, struct v4l2_input __user *up) | 473 | static inline int put_v4l2_input32(struct v4l2_input *kp, struct v4l2_input __user *up) |
| 478 | { | 474 | { |
| 479 | if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_input) - 4) || | 475 | if (copy_to_user(up, kp, sizeof(struct v4l2_input) - 4)) |
| 480 | copy_to_user(up, kp, sizeof(struct v4l2_input) - 4)) | 476 | return -EFAULT; |
| 481 | return -EFAULT; | ||
| 482 | return 0; | 477 | return 0; |
| 483 | } | 478 | } |
| 484 | 479 | ||
| 485 | static inline int get_v4l2_input(struct v4l2_input *kp, struct v4l2_input __user *up) | 480 | static inline int get_v4l2_input(struct v4l2_input *kp, struct v4l2_input __user *up) |
| 486 | { | 481 | { |
| 487 | if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_input)) || | 482 | if (copy_from_user(kp, up, sizeof(struct v4l2_input))) |
| 488 | copy_from_user(kp, up, sizeof(struct v4l2_input))) | 483 | return -EFAULT; |
| 489 | return -EFAULT; | ||
| 490 | return 0; | 484 | return 0; |
| 491 | } | 485 | } |
| 492 | 486 | ||
| 493 | static inline int put_v4l2_input(struct v4l2_input *kp, struct v4l2_input __user *up) | 487 | static inline int put_v4l2_input(struct v4l2_input *kp, struct v4l2_input __user *up) |
| 494 | { | 488 | { |
| 495 | if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_input)) || | 489 | if (copy_to_user(up, kp, sizeof(struct v4l2_input))) |
| 496 | copy_to_user(up, kp, sizeof(struct v4l2_input))) | 490 | return -EFAULT; |
| 497 | return -EFAULT; | ||
| 498 | return 0; | 491 | return 0; |
| 499 | } | 492 | } |
| 500 | 493 | ||
diff --git a/drivers/mtd/chips/Kconfig b/drivers/mtd/chips/Kconfig index effa0d7a73ac..205bb7083335 100644 --- a/drivers/mtd/chips/Kconfig +++ b/drivers/mtd/chips/Kconfig | |||
| @@ -301,7 +301,7 @@ config MTD_JEDEC | |||
| 301 | 301 | ||
| 302 | config MTD_XIP | 302 | config MTD_XIP |
| 303 | bool "XIP aware MTD support" | 303 | bool "XIP aware MTD support" |
| 304 | depends on !SMP && (MTD_CFI_INTELEXT || MTD_CFI_AMDSTD) && EXPERIMENTAL && ARM | 304 | depends on !SMP && (MTD_CFI_INTELEXT || MTD_CFI_AMDSTD) && EXPERIMENTAL && ARCH_MTD_XIP |
| 305 | default y if XIP_KERNEL | 305 | default y if XIP_KERNEL |
| 306 | help | 306 | help |
| 307 | This allows MTD support to work with flash memory which is also | 307 | This allows MTD support to work with flash memory which is also |
diff --git a/drivers/net/wireless/prism54/isl_ioctl.c b/drivers/net/wireless/prism54/isl_ioctl.c index c5cd61c7f927..e5bb9f5ae429 100644 --- a/drivers/net/wireless/prism54/isl_ioctl.c +++ b/drivers/net/wireless/prism54/isl_ioctl.c | |||
| @@ -748,7 +748,7 @@ prism54_get_essid(struct net_device *ndev, struct iw_request_info *info, | |||
| 748 | if (essid->length) { | 748 | if (essid->length) { |
| 749 | dwrq->flags = 1; /* set ESSID to ON for Wireless Extensions */ | 749 | dwrq->flags = 1; /* set ESSID to ON for Wireless Extensions */ |
| 750 | /* if it is to big, trunk it */ | 750 | /* if it is to big, trunk it */ |
| 751 | dwrq->length = min(IW_ESSID_MAX_SIZE, essid->length); | 751 | dwrq->length = min((u8)IW_ESSID_MAX_SIZE, essid->length); |
| 752 | } else { | 752 | } else { |
| 753 | dwrq->flags = 0; | 753 | dwrq->flags = 0; |
| 754 | dwrq->length = 0; | 754 | dwrq->length = 0; |
diff --git a/drivers/serial/m32r_sio.h b/drivers/serial/m32r_sio.h index 07d0dd80aa3d..7c3ec24f7e50 100644 --- a/drivers/serial/m32r_sio.h +++ b/drivers/serial/m32r_sio.h | |||
| @@ -37,7 +37,7 @@ struct old_serial_port { | |||
| 37 | unsigned int irq; | 37 | unsigned int irq; |
| 38 | unsigned int flags; | 38 | unsigned int flags; |
| 39 | unsigned char io_type; | 39 | unsigned char io_type; |
| 40 | unsigned char *iomem_base; | 40 | unsigned char __iomem *iomem_base; |
| 41 | unsigned short iomem_reg_shift; | 41 | unsigned short iomem_reg_shift; |
| 42 | }; | 42 | }; |
| 43 | 43 | ||
diff --git a/drivers/sn/ioc3.c b/drivers/sn/ioc3.c index c70ae81b5d98..12357e1fa558 100644 --- a/drivers/sn/ioc3.c +++ b/drivers/sn/ioc3.c | |||
| @@ -38,10 +38,10 @@ static inline unsigned mcr_pack(unsigned pulse, unsigned sample) | |||
| 38 | 38 | ||
| 39 | static int nic_wait(struct ioc3_driver_data *idd) | 39 | static int nic_wait(struct ioc3_driver_data *idd) |
| 40 | { | 40 | { |
| 41 | volatile unsigned mcr; | 41 | unsigned mcr; |
| 42 | 42 | ||
| 43 | do { | 43 | do { |
| 44 | mcr = (volatile unsigned)idd->vma->mcr; | 44 | mcr = readl(&idd->vma->mcr); |
| 45 | } while (!(mcr & 2)); | 45 | } while (!(mcr & 2)); |
| 46 | 46 | ||
| 47 | return mcr & 1; | 47 | return mcr & 1; |
| @@ -53,7 +53,7 @@ static int nic_reset(struct ioc3_driver_data *idd) | |||
| 53 | unsigned long flags; | 53 | unsigned long flags; |
| 54 | 54 | ||
| 55 | local_irq_save(flags); | 55 | local_irq_save(flags); |
| 56 | idd->vma->mcr = mcr_pack(500, 65); | 56 | writel(mcr_pack(500, 65), &idd->vma->mcr); |
| 57 | presence = nic_wait(idd); | 57 | presence = nic_wait(idd); |
| 58 | local_irq_restore(flags); | 58 | local_irq_restore(flags); |
| 59 | 59 | ||
| @@ -68,7 +68,7 @@ static inline int nic_read_bit(struct ioc3_driver_data *idd) | |||
| 68 | unsigned long flags; | 68 | unsigned long flags; |
| 69 | 69 | ||
| 70 | local_irq_save(flags); | 70 | local_irq_save(flags); |
| 71 | idd->vma->mcr = mcr_pack(6, 13); | 71 | writel(mcr_pack(6, 13), &idd->vma->mcr); |
| 72 | result = nic_wait(idd); | 72 | result = nic_wait(idd); |
| 73 | local_irq_restore(flags); | 73 | local_irq_restore(flags); |
| 74 | 74 | ||
| @@ -80,9 +80,9 @@ static inline int nic_read_bit(struct ioc3_driver_data *idd) | |||
| 80 | static inline void nic_write_bit(struct ioc3_driver_data *idd, int bit) | 80 | static inline void nic_write_bit(struct ioc3_driver_data *idd, int bit) |
| 81 | { | 81 | { |
| 82 | if (bit) | 82 | if (bit) |
| 83 | idd->vma->mcr = mcr_pack(6, 110); | 83 | writel(mcr_pack(6, 110), &idd->vma->mcr); |
| 84 | else | 84 | else |
| 85 | idd->vma->mcr = mcr_pack(80, 30); | 85 | writel(mcr_pack(80, 30), &idd->vma->mcr); |
| 86 | 86 | ||
| 87 | nic_wait(idd); | 87 | nic_wait(idd); |
| 88 | } | 88 | } |
| @@ -337,7 +337,7 @@ static void probe_nic(struct ioc3_driver_data *idd) | |||
| 337 | int save = 0, loops = 3; | 337 | int save = 0, loops = 3; |
| 338 | unsigned long first, addr; | 338 | unsigned long first, addr; |
| 339 | 339 | ||
| 340 | idd->vma->gpcr_s = GPCR_MLAN_EN; | 340 | writel(GPCR_MLAN_EN, &idd->vma->gpcr_s); |
| 341 | 341 | ||
| 342 | while(loops>0) { | 342 | while(loops>0) { |
| 343 | idd->nic_part[0] = 0; | 343 | idd->nic_part[0] = 0; |
| @@ -408,7 +408,7 @@ static irqreturn_t ioc3_intr_io(int irq, void *arg, struct pt_regs *regs) | |||
| 408 | 408 | ||
| 409 | read_lock_irqsave(&ioc3_submodules_lock, flags); | 409 | read_lock_irqsave(&ioc3_submodules_lock, flags); |
| 410 | 410 | ||
| 411 | if(idd->dual_irq && idd->vma->eisr) { | 411 | if(idd->dual_irq && readb(&idd->vma->eisr)) { |
| 412 | /* send Ethernet IRQ to the driver */ | 412 | /* send Ethernet IRQ to the driver */ |
| 413 | if(ioc3_ethernet && idd->active[ioc3_ethernet->id] && | 413 | if(ioc3_ethernet && idd->active[ioc3_ethernet->id] && |
| 414 | ioc3_ethernet->intr) { | 414 | ioc3_ethernet->intr) { |
| @@ -682,7 +682,7 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id) | |||
| 682 | idd->id = ioc3_counter++; | 682 | idd->id = ioc3_counter++; |
| 683 | up_write(&ioc3_devices_rwsem); | 683 | up_write(&ioc3_devices_rwsem); |
| 684 | 684 | ||
| 685 | idd->gpdr_shadow = idd->vma->gpdr; | 685 | idd->gpdr_shadow = readl(&idd->vma->gpdr); |
| 686 | 686 | ||
| 687 | /* Read IOC3 NIC contents */ | 687 | /* Read IOC3 NIC contents */ |
| 688 | probe_nic(idd); | 688 | probe_nic(idd); |
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c index 5dd0207ffd46..057e60217fc5 100644 --- a/fs/compat_ioctl.c +++ b/fs/compat_ioctl.c | |||
| @@ -931,8 +931,8 @@ struct compat_sg_req_info { /* used by SG_GET_REQUEST_TABLE ioctl() */ | |||
| 931 | static int sg_grt_trans(unsigned int fd, unsigned int cmd, unsigned long arg) | 931 | static int sg_grt_trans(unsigned int fd, unsigned int cmd, unsigned long arg) |
| 932 | { | 932 | { |
| 933 | int err, i; | 933 | int err, i; |
| 934 | sg_req_info_t *r; | 934 | sg_req_info_t __user *r; |
| 935 | struct compat_sg_req_info *o = (struct compat_sg_req_info *)arg; | 935 | struct compat_sg_req_info __user *o = (void __user *)arg; |
| 936 | r = compat_alloc_user_space(sizeof(sg_req_info_t)*SG_MAX_QUEUE); | 936 | r = compat_alloc_user_space(sizeof(sg_req_info_t)*SG_MAX_QUEUE); |
| 937 | err = sys_ioctl(fd,cmd,(unsigned long)r); | 937 | err = sys_ioctl(fd,cmd,(unsigned long)r); |
| 938 | if (err < 0) | 938 | if (err < 0) |
| @@ -2739,8 +2739,8 @@ static int do_ncp_setprivatedata(unsigned int fd, unsigned int cmd, unsigned lon | |||
| 2739 | static int | 2739 | static int |
| 2740 | lp_timeout_trans(unsigned int fd, unsigned int cmd, unsigned long arg) | 2740 | lp_timeout_trans(unsigned int fd, unsigned int cmd, unsigned long arg) |
| 2741 | { | 2741 | { |
| 2742 | struct compat_timeval *tc = (struct compat_timeval *)arg; | 2742 | struct compat_timeval __user *tc = (struct compat_timeval __user *)arg; |
| 2743 | struct timeval *tn = compat_alloc_user_space(sizeof(struct timeval)); | 2743 | struct timeval __user *tn = compat_alloc_user_space(sizeof(struct timeval)); |
| 2744 | struct timeval ts; | 2744 | struct timeval ts; |
| 2745 | if (get_user(ts.tv_sec, &tc->tv_sec) || | 2745 | if (get_user(ts.tv_sec, &tc->tv_sec) || |
| 2746 | get_user(ts.tv_usec, &tc->tv_usec) || | 2746 | get_user(ts.tv_usec, &tc->tv_usec) || |
diff --git a/include/asm-mips/abi.h b/include/asm-mips/abi.h index 2e7e651c3e3f..1ce0518ace2e 100644 --- a/include/asm-mips/abi.h +++ b/include/asm-mips/abi.h | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | * License. See the file "COPYING" in the main directory of this archive | 3 | * License. See the file "COPYING" in the main directory of this archive |
| 4 | * for more details. | 4 | * for more details. |
| 5 | * | 5 | * |
| 6 | * Copyright (C) 2005 by Ralf Baechle | 6 | * Copyright (C) 2005, 06 by Ralf Baechle (ralf@linux-mips.org) |
| 7 | * Copyright (C) 2005 MIPS Technologies, Inc. | 7 | * Copyright (C) 2005 MIPS Technologies, Inc. |
| 8 | */ | 8 | */ |
| 9 | #ifndef _ASM_ABI_H | 9 | #ifndef _ASM_ABI_H |
| @@ -13,7 +13,7 @@ | |||
| 13 | #include <asm/siginfo.h> | 13 | #include <asm/siginfo.h> |
| 14 | 14 | ||
| 15 | struct mips_abi { | 15 | struct mips_abi { |
| 16 | int (* const do_signal)(sigset_t *oldset, struct pt_regs *regs); | 16 | void (* const do_signal)(struct pt_regs *regs); |
| 17 | int (* const setup_frame)(struct k_sigaction * ka, | 17 | int (* const setup_frame)(struct k_sigaction * ka, |
| 18 | struct pt_regs *regs, int signr, | 18 | struct pt_regs *regs, int signr, |
| 19 | sigset_t *set); | 19 | sigset_t *set); |
diff --git a/include/asm-mips/io.h b/include/asm-mips/io.h index a9fa1254894a..5a4c8a54b8f4 100644 --- a/include/asm-mips/io.h +++ b/include/asm-mips/io.h | |||
| @@ -56,38 +56,38 @@ | |||
| 56 | * variations of functions: non-prefixed ones that preserve the value | 56 | * variations of functions: non-prefixed ones that preserve the value |
| 57 | * and prefixed ones that preserve byte addresses. The latters are | 57 | * and prefixed ones that preserve byte addresses. The latters are |
| 58 | * typically used for moving raw data between a peripheral and memory (cf. | 58 | * typically used for moving raw data between a peripheral and memory (cf. |
| 59 | * string I/O functions), hence the "mem_" prefix. | 59 | * string I/O functions), hence the "__mem_" prefix. |
| 60 | */ | 60 | */ |
| 61 | #if defined(CONFIG_SWAP_IO_SPACE) | 61 | #if defined(CONFIG_SWAP_IO_SPACE) |
| 62 | 62 | ||
| 63 | # define ioswabb(x) (x) | 63 | # define ioswabb(x) (x) |
| 64 | # define mem_ioswabb(x) (x) | 64 | # define __mem_ioswabb(x) (x) |
| 65 | # ifdef CONFIG_SGI_IP22 | 65 | # ifdef CONFIG_SGI_IP22 |
| 66 | /* | 66 | /* |
| 67 | * IP22 seems braindead enough to swap 16bits values in hardware, but | 67 | * IP22 seems braindead enough to swap 16bits values in hardware, but |
| 68 | * not 32bits. Go figure... Can't tell without documentation. | 68 | * not 32bits. Go figure... Can't tell without documentation. |
| 69 | */ | 69 | */ |
| 70 | # define ioswabw(x) (x) | 70 | # define ioswabw(x) (x) |
| 71 | # define mem_ioswabw(x) le16_to_cpu(x) | 71 | # define __mem_ioswabw(x) le16_to_cpu(x) |
| 72 | # else | 72 | # else |
| 73 | # define ioswabw(x) le16_to_cpu(x) | 73 | # define ioswabw(x) le16_to_cpu(x) |
| 74 | # define mem_ioswabw(x) (x) | 74 | # define __mem_ioswabw(x) (x) |
| 75 | # endif | 75 | # endif |
| 76 | # define ioswabl(x) le32_to_cpu(x) | 76 | # define ioswabl(x) le32_to_cpu(x) |
| 77 | # define mem_ioswabl(x) (x) | 77 | # define __mem_ioswabl(x) (x) |
| 78 | # define ioswabq(x) le64_to_cpu(x) | 78 | # define ioswabq(x) le64_to_cpu(x) |
| 79 | # define mem_ioswabq(x) (x) | 79 | # define __mem_ioswabq(x) (x) |
| 80 | 80 | ||
| 81 | #else | 81 | #else |
| 82 | 82 | ||
| 83 | # define ioswabb(x) (x) | 83 | # define ioswabb(x) (x) |
| 84 | # define mem_ioswabb(x) (x) | 84 | # define __mem_ioswabb(x) (x) |
| 85 | # define ioswabw(x) (x) | 85 | # define ioswabw(x) (x) |
| 86 | # define mem_ioswabw(x) cpu_to_le16(x) | 86 | # define __mem_ioswabw(x) cpu_to_le16(x) |
| 87 | # define ioswabl(x) (x) | 87 | # define ioswabl(x) (x) |
| 88 | # define mem_ioswabl(x) cpu_to_le32(x) | 88 | # define __mem_ioswabl(x) cpu_to_le32(x) |
| 89 | # define ioswabq(x) (x) | 89 | # define ioswabq(x) (x) |
| 90 | # define mem_ioswabq(x) cpu_to_le32(x) | 90 | # define __mem_ioswabq(x) cpu_to_le32(x) |
| 91 | 91 | ||
| 92 | #endif | 92 | #endif |
| 93 | 93 | ||
| @@ -342,7 +342,7 @@ static inline void pfx##write##bwlq(type val, \ | |||
| 342 | BUG(); \ | 342 | BUG(); \ |
| 343 | } \ | 343 | } \ |
| 344 | \ | 344 | \ |
| 345 | static inline type pfx##read##bwlq(volatile void __iomem *mem) \ | 345 | static inline type pfx##read##bwlq(const volatile void __iomem *mem) \ |
| 346 | { \ | 346 | { \ |
| 347 | volatile type *__mem; \ | 347 | volatile type *__mem; \ |
| 348 | type __val; \ | 348 | type __val; \ |
| @@ -417,7 +417,7 @@ __BUILD_MEMORY_SINGLE(bus, bwlq, type, 1) | |||
| 417 | \ | 417 | \ |
| 418 | __BUILD_MEMORY_PFX(__raw_, bwlq, type) \ | 418 | __BUILD_MEMORY_PFX(__raw_, bwlq, type) \ |
| 419 | __BUILD_MEMORY_PFX(, bwlq, type) \ | 419 | __BUILD_MEMORY_PFX(, bwlq, type) \ |
| 420 | __BUILD_MEMORY_PFX(mem_, bwlq, type) \ | 420 | __BUILD_MEMORY_PFX(__mem_, bwlq, type) \ |
| 421 | 421 | ||
| 422 | BUILDIO_MEM(b, u8) | 422 | BUILDIO_MEM(b, u8) |
| 423 | BUILDIO_MEM(w, u16) | 423 | BUILDIO_MEM(w, u16) |
| @@ -430,7 +430,7 @@ BUILDIO_MEM(q, u64) | |||
| 430 | 430 | ||
| 431 | #define BUILDIO_IOPORT(bwlq, type) \ | 431 | #define BUILDIO_IOPORT(bwlq, type) \ |
| 432 | __BUILD_IOPORT_PFX(, bwlq, type) \ | 432 | __BUILD_IOPORT_PFX(, bwlq, type) \ |
| 433 | __BUILD_IOPORT_PFX(mem_, bwlq, type) | 433 | __BUILD_IOPORT_PFX(__mem_, bwlq, type) |
| 434 | 434 | ||
| 435 | BUILDIO_IOPORT(b, u8) | 435 | BUILDIO_IOPORT(b, u8) |
| 436 | BUILDIO_IOPORT(w, u16) | 436 | BUILDIO_IOPORT(w, u16) |
| @@ -464,7 +464,7 @@ static inline void writes##bwlq(volatile void __iomem *mem, \ | |||
| 464 | const volatile type *__addr = addr; \ | 464 | const volatile type *__addr = addr; \ |
| 465 | \ | 465 | \ |
| 466 | while (count--) { \ | 466 | while (count--) { \ |
| 467 | mem_write##bwlq(*__addr, mem); \ | 467 | __mem_write##bwlq(*__addr, mem); \ |
| 468 | __addr++; \ | 468 | __addr++; \ |
| 469 | } \ | 469 | } \ |
| 470 | } \ | 470 | } \ |
| @@ -475,7 +475,7 @@ static inline void reads##bwlq(volatile void __iomem *mem, void *addr, \ | |||
| 475 | volatile type *__addr = addr; \ | 475 | volatile type *__addr = addr; \ |
| 476 | \ | 476 | \ |
| 477 | while (count--) { \ | 477 | while (count--) { \ |
| 478 | *__addr = mem_read##bwlq(mem); \ | 478 | *__addr = __mem_read##bwlq(mem); \ |
| 479 | __addr++; \ | 479 | __addr++; \ |
| 480 | } \ | 480 | } \ |
| 481 | } | 481 | } |
| @@ -488,7 +488,7 @@ static inline void outs##bwlq(unsigned long port, const void *addr, \ | |||
| 488 | const volatile type *__addr = addr; \ | 488 | const volatile type *__addr = addr; \ |
| 489 | \ | 489 | \ |
| 490 | while (count--) { \ | 490 | while (count--) { \ |
| 491 | mem_out##bwlq(*__addr, port); \ | 491 | __mem_out##bwlq(*__addr, port); \ |
| 492 | __addr++; \ | 492 | __addr++; \ |
| 493 | } \ | 493 | } \ |
| 494 | } \ | 494 | } \ |
| @@ -499,7 +499,7 @@ static inline void ins##bwlq(unsigned long port, void *addr, \ | |||
| 499 | volatile type *__addr = addr; \ | 499 | volatile type *__addr = addr; \ |
| 500 | \ | 500 | \ |
| 501 | while (count--) { \ | 501 | while (count--) { \ |
| 502 | *__addr = mem_in##bwlq(port); \ | 502 | *__addr = __mem_in##bwlq(port); \ |
| 503 | __addr++; \ | 503 | __addr++; \ |
| 504 | } \ | 504 | } \ |
| 505 | } | 505 | } |
diff --git a/include/asm-mips/thread_info.h b/include/asm-mips/thread_info.h index 1612b3fe1080..fa193f861e71 100644 --- a/include/asm-mips/thread_info.h +++ b/include/asm-mips/thread_info.h | |||
| @@ -114,6 +114,7 @@ register struct thread_info *__current_thread_info __asm__("$28"); | |||
| 114 | #define TIF_NEED_RESCHED 3 /* rescheduling necessary */ | 114 | #define TIF_NEED_RESCHED 3 /* rescheduling necessary */ |
| 115 | #define TIF_SYSCALL_AUDIT 4 /* syscall auditing active */ | 115 | #define TIF_SYSCALL_AUDIT 4 /* syscall auditing active */ |
| 116 | #define TIF_SECCOMP 5 /* secure computing */ | 116 | #define TIF_SECCOMP 5 /* secure computing */ |
| 117 | #define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal() */ | ||
| 117 | #define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */ | 118 | #define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */ |
| 118 | #define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */ | 119 | #define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */ |
| 119 | #define TIF_MEMDIE 18 | 120 | #define TIF_MEMDIE 18 |
| @@ -125,6 +126,7 @@ register struct thread_info *__current_thread_info __asm__("$28"); | |||
| 125 | #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) | 126 | #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) |
| 126 | #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) | 127 | #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) |
| 127 | #define _TIF_SECCOMP (1<<TIF_SECCOMP) | 128 | #define _TIF_SECCOMP (1<<TIF_SECCOMP) |
| 129 | #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) | ||
| 128 | #define _TIF_USEDFPU (1<<TIF_USEDFPU) | 130 | #define _TIF_USEDFPU (1<<TIF_USEDFPU) |
| 129 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) | 131 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) |
| 130 | 132 | ||
diff --git a/include/asm-mips/unistd.h b/include/asm-mips/unistd.h index 89ea8b60e945..e7ff9b187783 100644 --- a/include/asm-mips/unistd.h +++ b/include/asm-mips/unistd.h | |||
| @@ -307,17 +307,33 @@ | |||
| 307 | #define __NR_inotify_init (__NR_Linux + 284) | 307 | #define __NR_inotify_init (__NR_Linux + 284) |
| 308 | #define __NR_inotify_add_watch (__NR_Linux + 285) | 308 | #define __NR_inotify_add_watch (__NR_Linux + 285) |
| 309 | #define __NR_inotify_rm_watch (__NR_Linux + 286) | 309 | #define __NR_inotify_rm_watch (__NR_Linux + 286) |
| 310 | 310 | #define __NR_migrate_pages (__NR_Linux + 287) | |
| 311 | #define __NR_openat (__NR_Linux + 288) | ||
| 312 | #define __NR_mkdirat (__NR_Linux + 289) | ||
| 313 | #define __NR_mknodat (__NR_Linux + 290) | ||
| 314 | #define __NR_fchownat (__NR_Linux + 291) | ||
| 315 | #define __NR_futimesat (__NR_Linux + 292) | ||
| 316 | #define __NR_newfstatat (__NR_Linux + 293) | ||
| 317 | #define __NR_unlinkat (__NR_Linux + 294) | ||
| 318 | #define __NR_renameat (__NR_Linux + 295) | ||
| 319 | #define __NR_linkat (__NR_Linux + 296) | ||
| 320 | #define __NR_symlinkat (__NR_Linux + 297) | ||
| 321 | #define __NR_readlinkat (__NR_Linux + 298) | ||
| 322 | #define __NR_fchmodat (__NR_Linux + 299) | ||
| 323 | #define __NR_faccessat (__NR_Linux + 300) | ||
| 324 | #define __NR_pselect6 (__NR_Linux + 301) | ||
| 325 | #define __NR_ppoll (__NR_Linux + 302) | ||
| 326 | #define __NR_unshare (__NR_Linux + 303) | ||
| 311 | 327 | ||
| 312 | /* | 328 | /* |
| 313 | * Offset of the last Linux o32 flavoured syscall | 329 | * Offset of the last Linux o32 flavoured syscall |
| 314 | */ | 330 | */ |
| 315 | #define __NR_Linux_syscalls 286 | 331 | #define __NR_Linux_syscalls 303 |
| 316 | 332 | ||
| 317 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ | 333 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ |
| 318 | 334 | ||
| 319 | #define __NR_O32_Linux 4000 | 335 | #define __NR_O32_Linux 4000 |
| 320 | #define __NR_O32_Linux_syscalls 283 | 336 | #define __NR_O32_Linux_syscalls 303 |
| 321 | 337 | ||
| 322 | #if _MIPS_SIM == _MIPS_SIM_ABI64 | 338 | #if _MIPS_SIM == _MIPS_SIM_ABI64 |
| 323 | 339 | ||
| @@ -571,16 +587,33 @@ | |||
| 571 | #define __NR_inotify_init (__NR_Linux + 243) | 587 | #define __NR_inotify_init (__NR_Linux + 243) |
| 572 | #define __NR_inotify_add_watch (__NR_Linux + 244) | 588 | #define __NR_inotify_add_watch (__NR_Linux + 244) |
| 573 | #define __NR_inotify_rm_watch (__NR_Linux + 245) | 589 | #define __NR_inotify_rm_watch (__NR_Linux + 245) |
| 590 | #define __NR_migrate_pages (__NR_Linux + 246) | ||
| 591 | #define __NR_openat (__NR_Linux + 247) | ||
| 592 | #define __NR_mkdirat (__NR_Linux + 248) | ||
| 593 | #define __NR_mknodat (__NR_Linux + 249) | ||
| 594 | #define __NR_fchownat (__NR_Linux + 250) | ||
| 595 | #define __NR_futimesat (__NR_Linux + 251) | ||
| 596 | #define __NR_newfstatat (__NR_Linux + 252) | ||
| 597 | #define __NR_unlinkat (__NR_Linux + 253) | ||
| 598 | #define __NR_renameat (__NR_Linux + 254) | ||
| 599 | #define __NR_linkat (__NR_Linux + 255) | ||
| 600 | #define __NR_symlinkat (__NR_Linux + 256) | ||
| 601 | #define __NR_readlinkat (__NR_Linux + 257) | ||
| 602 | #define __NR_fchmodat (__NR_Linux + 258) | ||
| 603 | #define __NR_faccessat (__NR_Linux + 259) | ||
| 604 | #define __NR_pselect6 (__NR_Linux + 260) | ||
| 605 | #define __NR_ppoll (__NR_Linux + 261) | ||
| 606 | #define __NR_unshare (__NR_Linux + 262) | ||
| 574 | 607 | ||
| 575 | /* | 608 | /* |
| 576 | * Offset of the last Linux 64-bit flavoured syscall | 609 | * Offset of the last Linux 64-bit flavoured syscall |
| 577 | */ | 610 | */ |
| 578 | #define __NR_Linux_syscalls 245 | 611 | #define __NR_Linux_syscalls 262 |
| 579 | 612 | ||
| 580 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ | 613 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ |
| 581 | 614 | ||
| 582 | #define __NR_64_Linux 5000 | 615 | #define __NR_64_Linux 5000 |
| 583 | #define __NR_64_Linux_syscalls 242 | 616 | #define __NR_64_Linux_syscalls 262 |
| 584 | 617 | ||
| 585 | #if _MIPS_SIM == _MIPS_SIM_NABI32 | 618 | #if _MIPS_SIM == _MIPS_SIM_NABI32 |
| 586 | 619 | ||
| @@ -838,16 +871,33 @@ | |||
| 838 | #define __NR_inotify_init (__NR_Linux + 247) | 871 | #define __NR_inotify_init (__NR_Linux + 247) |
| 839 | #define __NR_inotify_add_watch (__NR_Linux + 248) | 872 | #define __NR_inotify_add_watch (__NR_Linux + 248) |
| 840 | #define __NR_inotify_rm_watch (__NR_Linux + 249) | 873 | #define __NR_inotify_rm_watch (__NR_Linux + 249) |
| 874 | #define __NR_migrate_pages (__NR_Linux + 250) | ||
| 875 | #define __NR_openat (__NR_Linux + 251) | ||
| 876 | #define __NR_mkdirat (__NR_Linux + 252) | ||
| 877 | #define __NR_mknodat (__NR_Linux + 253) | ||
| 878 | #define __NR_fchownat (__NR_Linux + 254) | ||
| 879 | #define __NR_futimesat (__NR_Linux + 255) | ||
| 880 | #define __NR_newfstatat (__NR_Linux + 256) | ||
| 881 | #define __NR_unlinkat (__NR_Linux + 257) | ||
| 882 | #define __NR_renameat (__NR_Linux + 258) | ||
| 883 | #define __NR_linkat (__NR_Linux + 259) | ||
| 884 | #define __NR_symlinkat (__NR_Linux + 260) | ||
| 885 | #define __NR_readlinkat (__NR_Linux + 261) | ||
| 886 | #define __NR_fchmodat (__NR_Linux + 262) | ||
| 887 | #define __NR_faccessat (__NR_Linux + 263) | ||
| 888 | #define __NR_pselect6 (__NR_Linux + 264) | ||
| 889 | #define __NR_ppoll (__NR_Linux + 265) | ||
| 890 | #define __NR_unshare (__NR_Linux + 266) | ||
| 841 | 891 | ||
| 842 | /* | 892 | /* |
| 843 | * Offset of the last N32 flavoured syscall | 893 | * Offset of the last N32 flavoured syscall |
| 844 | */ | 894 | */ |
| 845 | #define __NR_Linux_syscalls 249 | 895 | #define __NR_Linux_syscalls 266 |
| 846 | 896 | ||
| 847 | #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ | 897 | #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ |
| 848 | 898 | ||
| 849 | #define __NR_N32_Linux 6000 | 899 | #define __NR_N32_Linux 6000 |
| 850 | #define __NR_N32_Linux_syscalls 246 | 900 | #define __NR_N32_Linux_syscalls 266 |
| 851 | 901 | ||
| 852 | #ifndef __ASSEMBLY__ | 902 | #ifndef __ASSEMBLY__ |
| 853 | 903 | ||
diff --git a/include/asm-powerpc/compat.h b/include/asm-powerpc/compat.h index accb80c9a339..aacaabd28ac1 100644 --- a/include/asm-powerpc/compat.h +++ b/include/asm-powerpc/compat.h | |||
| @@ -126,6 +126,11 @@ static inline void __user *compat_ptr(compat_uptr_t uptr) | |||
| 126 | return (void __user *)(unsigned long)uptr; | 126 | return (void __user *)(unsigned long)uptr; |
| 127 | } | 127 | } |
| 128 | 128 | ||
| 129 | static inline compat_uptr_t ptr_to_compat(void __user *uptr) | ||
| 130 | { | ||
| 131 | return (u32)(unsigned long)uptr; | ||
| 132 | } | ||
| 133 | |||
| 129 | static inline void __user *compat_alloc_user_space(long len) | 134 | static inline void __user *compat_alloc_user_space(long len) |
| 130 | { | 135 | { |
| 131 | struct pt_regs *regs = current->thread.regs; | 136 | struct pt_regs *regs = current->thread.regs; |
diff --git a/include/asm-powerpc/thread_info.h b/include/asm-powerpc/thread_info.h index 67cdaf3ae9fc..c044ec16a879 100644 --- a/include/asm-powerpc/thread_info.h +++ b/include/asm-powerpc/thread_info.h | |||
| @@ -37,7 +37,7 @@ struct thread_info { | |||
| 37 | int preempt_count; /* 0 => preemptable, | 37 | int preempt_count; /* 0 => preemptable, |
| 38 | <0 => BUG */ | 38 | <0 => BUG */ |
| 39 | struct restart_block restart_block; | 39 | struct restart_block restart_block; |
| 40 | void *nvgprs_frame; | 40 | void __user *nvgprs_frame; |
| 41 | /* low level flags - has atomic operations done on it */ | 41 | /* low level flags - has atomic operations done on it */ |
| 42 | unsigned long flags ____cacheline_aligned_in_smp; | 42 | unsigned long flags ____cacheline_aligned_in_smp; |
| 43 | }; | 43 | }; |
diff --git a/include/asm-s390/uaccess.h b/include/asm-s390/uaccess.h index be104f21c70a..0b7c0ca4c3d7 100644 --- a/include/asm-s390/uaccess.h +++ b/include/asm-s390/uaccess.h | |||
| @@ -61,7 +61,7 @@ | |||
| 61 | #define segment_eq(a,b) ((a).ar4 == (b).ar4) | 61 | #define segment_eq(a,b) ((a).ar4 == (b).ar4) |
| 62 | 62 | ||
| 63 | 63 | ||
| 64 | static inline int __access_ok(const void *addr, unsigned long size) | 64 | static inline int __access_ok(const void __user *addr, unsigned long size) |
| 65 | { | 65 | { |
| 66 | return 1; | 66 | return 1; |
| 67 | } | 67 | } |
| @@ -208,25 +208,25 @@ extern int __put_user_bad(void) __attribute__((noreturn)); | |||
| 208 | case 1: { \ | 208 | case 1: { \ |
| 209 | unsigned char __x; \ | 209 | unsigned char __x; \ |
| 210 | __get_user_asm(__x, ptr, __gu_err); \ | 210 | __get_user_asm(__x, ptr, __gu_err); \ |
| 211 | (x) = *(__typeof__(*(ptr)) *) &__x; \ | 211 | (x) = *(__force __typeof__(*(ptr)) *) &__x; \ |
| 212 | break; \ | 212 | break; \ |
| 213 | }; \ | 213 | }; \ |
| 214 | case 2: { \ | 214 | case 2: { \ |
| 215 | unsigned short __x; \ | 215 | unsigned short __x; \ |
| 216 | __get_user_asm(__x, ptr, __gu_err); \ | 216 | __get_user_asm(__x, ptr, __gu_err); \ |
| 217 | (x) = *(__typeof__(*(ptr)) *) &__x; \ | 217 | (x) = *(__force __typeof__(*(ptr)) *) &__x; \ |
| 218 | break; \ | 218 | break; \ |
| 219 | }; \ | 219 | }; \ |
| 220 | case 4: { \ | 220 | case 4: { \ |
| 221 | unsigned int __x; \ | 221 | unsigned int __x; \ |
| 222 | __get_user_asm(__x, ptr, __gu_err); \ | 222 | __get_user_asm(__x, ptr, __gu_err); \ |
| 223 | (x) = *(__typeof__(*(ptr)) *) &__x; \ | 223 | (x) = *(__force __typeof__(*(ptr)) *) &__x; \ |
| 224 | break; \ | 224 | break; \ |
| 225 | }; \ | 225 | }; \ |
| 226 | case 8: { \ | 226 | case 8: { \ |
| 227 | unsigned long long __x; \ | 227 | unsigned long long __x; \ |
| 228 | __get_user_asm(__x, ptr, __gu_err); \ | 228 | __get_user_asm(__x, ptr, __gu_err); \ |
| 229 | (x) = *(__typeof__(*(ptr)) *) &__x; \ | 229 | (x) = *(__force __typeof__(*(ptr)) *) &__x; \ |
| 230 | break; \ | 230 | break; \ |
| 231 | }; \ | 231 | }; \ |
| 232 | default: \ | 232 | default: \ |
diff --git a/include/linux/elevator.h b/include/linux/elevator.h index 23fe746a1d51..18cf1f3e1184 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h | |||
| @@ -82,6 +82,7 @@ struct elevator_queue | |||
| 82 | extern void elv_dispatch_sort(request_queue_t *, struct request *); | 82 | extern void elv_dispatch_sort(request_queue_t *, struct request *); |
| 83 | extern void elv_add_request(request_queue_t *, struct request *, int, int); | 83 | extern void elv_add_request(request_queue_t *, struct request *, int, int); |
| 84 | extern void __elv_add_request(request_queue_t *, struct request *, int, int); | 84 | extern void __elv_add_request(request_queue_t *, struct request *, int, int); |
| 85 | extern void elv_insert(request_queue_t *, struct request *, int); | ||
| 85 | extern int elv_merge(request_queue_t *, struct request **, struct bio *); | 86 | extern int elv_merge(request_queue_t *, struct request **, struct bio *); |
| 86 | extern void elv_merge_requests(request_queue_t *, struct request *, | 87 | extern void elv_merge_requests(request_queue_t *, struct request *, |
| 87 | struct request *); | 88 | struct request *); |
diff --git a/include/linux/ioc3.h b/include/linux/ioc3.h index e7906a72a4f1..da7c09e4ede6 100644 --- a/include/linux/ioc3.h +++ b/include/linux/ioc3.h | |||
| @@ -27,7 +27,7 @@ struct ioc3_driver_data { | |||
| 27 | int id; /* IOC3 sequence number */ | 27 | int id; /* IOC3 sequence number */ |
| 28 | /* PCI mapping */ | 28 | /* PCI mapping */ |
| 29 | unsigned long pma; /* physical address */ | 29 | unsigned long pma; /* physical address */ |
| 30 | struct __iomem ioc3 *vma; /* pointer to registers */ | 30 | struct ioc3 __iomem *vma; /* pointer to registers */ |
| 31 | struct pci_dev *pdev; /* PCI device */ | 31 | struct pci_dev *pdev; /* PCI device */ |
| 32 | /* IRQ stuff */ | 32 | /* IRQ stuff */ |
| 33 | int dual_irq; /* set if separate IRQs are used */ | 33 | int dual_irq; /* set if separate IRQs are used */ |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index b23be44cbea8..5208b12d5550 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
| @@ -549,7 +549,7 @@ struct v4l2_framebuffer | |||
| 549 | struct v4l2_clip | 549 | struct v4l2_clip |
| 550 | { | 550 | { |
| 551 | struct v4l2_rect c; | 551 | struct v4l2_rect c; |
| 552 | struct v4l2_clip *next; | 552 | struct v4l2_clip __user *next; |
| 553 | }; | 553 | }; |
| 554 | 554 | ||
| 555 | struct v4l2_window | 555 | struct v4l2_window |
| @@ -336,7 +336,7 @@ EXPORT_SYMBOL(slab_reclaim_pages); | |||
| 336 | 336 | ||
| 337 | #ifdef CONFIG_SMP | 337 | #ifdef CONFIG_SMP |
| 338 | 338 | ||
| 339 | void *__alloc_percpu(size_t size, size_t align) | 339 | void *__alloc_percpu(size_t size) |
| 340 | { | 340 | { |
| 341 | int i; | 341 | int i; |
| 342 | struct percpu_data *pdata = kmalloc(sizeof (*pdata), GFP_KERNEL); | 342 | struct percpu_data *pdata = kmalloc(sizeof (*pdata), GFP_KERNEL); |
