diff options
Diffstat (limited to 'include')
71 files changed, 749 insertions, 1340 deletions
diff --git a/include/asm-alpha/unistd.h b/include/asm-alpha/unistd.h index bc6e6a9259dc..2cabbd465c0c 100644 --- a/include/asm-alpha/unistd.h +++ b/include/asm-alpha/unistd.h | |||
@@ -580,75 +580,6 @@ type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5, type6 arg6)\ | |||
580 | #define __ARCH_WANT_SYS_OLDUMOUNT | 580 | #define __ARCH_WANT_SYS_OLDUMOUNT |
581 | #define __ARCH_WANT_SYS_SIGPENDING | 581 | #define __ARCH_WANT_SYS_SIGPENDING |
582 | 582 | ||
583 | #ifdef __KERNEL_SYSCALLS__ | ||
584 | |||
585 | #include <linux/compiler.h> | ||
586 | #include <linux/types.h> | ||
587 | #include <linux/string.h> | ||
588 | #include <linux/signal.h> | ||
589 | #include <linux/syscalls.h> | ||
590 | #include <asm/ptrace.h> | ||
591 | |||
592 | static inline long open(const char * name, int mode, int flags) | ||
593 | { | ||
594 | return sys_open(name, mode, flags); | ||
595 | } | ||
596 | |||
597 | static inline long dup(int fd) | ||
598 | { | ||
599 | return sys_dup(fd); | ||
600 | } | ||
601 | |||
602 | static inline long close(int fd) | ||
603 | { | ||
604 | return sys_close(fd); | ||
605 | } | ||
606 | |||
607 | static inline off_t lseek(int fd, off_t off, int whence) | ||
608 | { | ||
609 | return sys_lseek(fd, off, whence); | ||
610 | } | ||
611 | |||
612 | static inline void _exit(int value) | ||
613 | { | ||
614 | sys_exit(value); | ||
615 | } | ||
616 | |||
617 | #define exit(x) _exit(x) | ||
618 | |||
619 | static inline long write(int fd, const char * buf, size_t nr) | ||
620 | { | ||
621 | return sys_write(fd, buf, nr); | ||
622 | } | ||
623 | |||
624 | static inline long read(int fd, char * buf, size_t nr) | ||
625 | { | ||
626 | return sys_read(fd, buf, nr); | ||
627 | } | ||
628 | |||
629 | extern int execve(char *, char **, char **); | ||
630 | |||
631 | static inline long setsid(void) | ||
632 | { | ||
633 | return sys_setsid(); | ||
634 | } | ||
635 | |||
636 | static inline pid_t waitpid(int pid, int * wait_stat, int flags) | ||
637 | { | ||
638 | return sys_wait4(pid, wait_stat, flags, NULL); | ||
639 | } | ||
640 | |||
641 | asmlinkage int sys_execve(char *ufilename, char **argv, char **envp, | ||
642 | unsigned long a3, unsigned long a4, unsigned long a5, | ||
643 | struct pt_regs regs); | ||
644 | asmlinkage long sys_rt_sigaction(int sig, | ||
645 | const struct sigaction __user *act, | ||
646 | struct sigaction __user *oact, | ||
647 | size_t sigsetsize, | ||
648 | void *restorer); | ||
649 | |||
650 | #endif /* __KERNEL_SYSCALLS__ */ | ||
651 | |||
652 | /* "Conditional" syscalls. What we want is | 583 | /* "Conditional" syscalls. What we want is |
653 | 584 | ||
654 | __attribute__((weak,alias("sys_ni_syscall"))) | 585 | __attribute__((weak,alias("sys_ni_syscall"))) |
diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h index 2ab4078334bf..14a87eec5a2d 100644 --- a/include/asm-arm/unistd.h +++ b/include/asm-arm/unistd.h | |||
@@ -549,30 +549,6 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6 | |||
549 | #define __ARCH_WANT_SYS_SOCKETCALL | 549 | #define __ARCH_WANT_SYS_SOCKETCALL |
550 | #endif | 550 | #endif |
551 | 551 | ||
552 | #ifdef __KERNEL_SYSCALLS__ | ||
553 | |||
554 | #include <linux/compiler.h> | ||
555 | #include <linux/types.h> | ||
556 | #include <linux/syscalls.h> | ||
557 | |||
558 | extern long execve(const char *file, char **argv, char **envp); | ||
559 | |||
560 | struct pt_regs; | ||
561 | asmlinkage int sys_execve(char *filenamei, char **argv, char **envp, | ||
562 | struct pt_regs *regs); | ||
563 | asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp, | ||
564 | struct pt_regs *regs); | ||
565 | asmlinkage int sys_fork(struct pt_regs *regs); | ||
566 | asmlinkage int sys_vfork(struct pt_regs *regs); | ||
567 | asmlinkage int sys_pipe(unsigned long *fildes); | ||
568 | struct sigaction; | ||
569 | asmlinkage long sys_rt_sigaction(int sig, | ||
570 | const struct sigaction __user *act, | ||
571 | struct sigaction __user *oact, | ||
572 | size_t sigsetsize); | ||
573 | |||
574 | #endif /* __KERNEL_SYSCALLS__ */ | ||
575 | |||
576 | /* | 552 | /* |
577 | * "Conditional" syscalls | 553 | * "Conditional" syscalls |
578 | * | 554 | * |
diff --git a/include/asm-arm26/unistd.h b/include/asm-arm26/unistd.h index c6d2436c9d34..25a5eead85be 100644 --- a/include/asm-arm26/unistd.h +++ b/include/asm-arm26/unistd.h | |||
@@ -464,30 +464,6 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6 | |||
464 | #define __ARCH_WANT_SYS_SIGPROCMASK | 464 | #define __ARCH_WANT_SYS_SIGPROCMASK |
465 | #define __ARCH_WANT_SYS_RT_SIGACTION | 465 | #define __ARCH_WANT_SYS_RT_SIGACTION |
466 | 466 | ||
467 | #ifdef __KERNEL_SYSCALLS__ | ||
468 | |||
469 | #include <linux/compiler.h> | ||
470 | #include <linux/types.h> | ||
471 | #include <linux/syscalls.h> | ||
472 | |||
473 | extern long execve(const char *file, char **argv, char **envp); | ||
474 | |||
475 | struct pt_regs; | ||
476 | asmlinkage int sys_execve(char *filenamei, char **argv, char **envp, | ||
477 | struct pt_regs *regs); | ||
478 | asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp, | ||
479 | struct pt_regs *regs); | ||
480 | asmlinkage int sys_fork(struct pt_regs *regs); | ||
481 | asmlinkage int sys_vfork(struct pt_regs *regs); | ||
482 | asmlinkage int sys_pipe(unsigned long *fildes); | ||
483 | struct sigaction; | ||
484 | asmlinkage long sys_rt_sigaction(int sig, | ||
485 | const struct sigaction __user *act, | ||
486 | struct sigaction __user *oact, | ||
487 | size_t sigsetsize); | ||
488 | |||
489 | #endif /* __KERNEL_SYSCALLS__ */ | ||
490 | |||
491 | /* | 467 | /* |
492 | * "Conditional" syscalls | 468 | * "Conditional" syscalls |
493 | * | 469 | * |
diff --git a/include/asm-avr32/unistd.h b/include/asm-avr32/unistd.h index 1f528f92690d..a50e5004550c 100644 --- a/include/asm-avr32/unistd.h +++ b/include/asm-avr32/unistd.h | |||
@@ -281,30 +281,10 @@ | |||
281 | #define __NR_tee 263 | 281 | #define __NR_tee 263 |
282 | #define __NR_vmsplice 264 | 282 | #define __NR_vmsplice 264 |
283 | 283 | ||
284 | #ifdef __KERNEL__ | ||
284 | #define NR_syscalls 265 | 285 | #define NR_syscalls 265 |
285 | 286 | ||
286 | 287 | ||
287 | /* | ||
288 | * AVR32 calling convention for system calls: | ||
289 | * - System call number in r8 | ||
290 | * - Parameters in r12 and downwards to r9 as well as r6 and r5. | ||
291 | * - Return value in r12 | ||
292 | */ | ||
293 | |||
294 | /* | ||
295 | * user-visible error numbers are in the range -1 - -124: see | ||
296 | * <asm-generic/errno.h> | ||
297 | */ | ||
298 | |||
299 | #define __syscall_return(type, res) do { \ | ||
300 | if ((unsigned long)(res) >= (unsigned long)(-125)) { \ | ||
301 | errno = -(res); \ | ||
302 | res = -1; \ | ||
303 | } \ | ||
304 | return (type) (res); \ | ||
305 | } while (0) | ||
306 | |||
307 | #ifdef __KERNEL__ | ||
308 | #define __ARCH_WANT_IPC_PARSE_VERSION | 288 | #define __ARCH_WANT_IPC_PARSE_VERSION |
309 | #define __ARCH_WANT_STAT64 | 289 | #define __ARCH_WANT_STAT64 |
310 | #define __ARCH_WANT_SYS_ALARM | 290 | #define __ARCH_WANT_SYS_ALARM |
@@ -319,62 +299,6 @@ | |||
319 | #define __ARCH_WANT_SYS_GETPGRP | 299 | #define __ARCH_WANT_SYS_GETPGRP |
320 | #define __ARCH_WANT_SYS_RT_SIGACTION | 300 | #define __ARCH_WANT_SYS_RT_SIGACTION |
321 | #define __ARCH_WANT_SYS_RT_SIGSUSPEND | 301 | #define __ARCH_WANT_SYS_RT_SIGSUSPEND |
322 | #endif | ||
323 | |||
324 | #if defined(__KERNEL_SYSCALLS__) || defined(__CHECKER__) | ||
325 | |||
326 | #include <linux/types.h> | ||
327 | #include <linux/linkage.h> | ||
328 | #include <asm/signal.h> | ||
329 | |||
330 | struct pt_regs; | ||
331 | |||
332 | /* | ||
333 | * we need this inline - forking from kernel space will result | ||
334 | * in NO COPY ON WRITE (!!!), until an execve is executed. This | ||
335 | * is no problem, but for the stack. This is handled by not letting | ||
336 | * main() use the stack at all after fork(). Thus, no function | ||
337 | * calls - which means inline code for fork too, as otherwise we | ||
338 | * would use the stack upon exit from 'fork()'. | ||
339 | * | ||
340 | * Actually only pause and fork are needed inline, so that there | ||
341 | * won't be any messing with the stack from main(), but we define | ||
342 | * some others too. | ||
343 | */ | ||
344 | static inline int execve(const char *file, char **argv, char **envp) | ||
345 | { | ||
346 | register long scno asm("r8") = __NR_execve; | ||
347 | register long sc1 asm("r12") = (long)file; | ||
348 | register long sc2 asm("r11") = (long)argv; | ||
349 | register long sc3 asm("r10") = (long)envp; | ||
350 | int res; | ||
351 | |||
352 | asm volatile("scall" | ||
353 | : "=r"(sc1) | ||
354 | : "r"(scno), "0"(sc1), "r"(sc2), "r"(sc3) | ||
355 | : "lr", "memory"); | ||
356 | res = sc1; | ||
357 | __syscall_return(int, res); | ||
358 | } | ||
359 | |||
360 | asmlinkage long sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize); | ||
361 | asmlinkage int sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, | ||
362 | struct pt_regs *regs); | ||
363 | asmlinkage int sys_rt_sigreturn(struct pt_regs *regs); | ||
364 | asmlinkage int sys_pipe(unsigned long __user *filedes); | ||
365 | asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, | ||
366 | unsigned long prot, unsigned long flags, | ||
367 | unsigned long fd, off_t offset); | ||
368 | asmlinkage int sys_cacheflush(int operation, void __user *addr, size_t len); | ||
369 | asmlinkage int sys_fork(struct pt_regs *regs); | ||
370 | asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp, | ||
371 | unsigned long parent_tidptr, | ||
372 | unsigned long child_tidptr, struct pt_regs *regs); | ||
373 | asmlinkage int sys_vfork(struct pt_regs *regs); | ||
374 | asmlinkage int sys_execve(char __user *ufilename, char __user *__user *uargv, | ||
375 | char __user *__user *uenvp, struct pt_regs *regs); | ||
376 | |||
377 | #endif | ||
378 | 302 | ||
379 | /* | 303 | /* |
380 | * "Conditional" syscalls | 304 | * "Conditional" syscalls |
@@ -384,4 +308,6 @@ asmlinkage int sys_execve(char __user *ufilename, char __user *__user *uargv, | |||
384 | */ | 308 | */ |
385 | #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall"); | 309 | #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall"); |
386 | 310 | ||
311 | #endif /* __KERNEL__ */ | ||
312 | |||
387 | #endif /* __ASM_AVR32_UNISTD_H */ | 313 | #endif /* __ASM_AVR32_UNISTD_H */ |
diff --git a/include/asm-cris/unistd.h b/include/asm-cris/unistd.h index 7372efae0516..7c90fa970c38 100644 --- a/include/asm-cris/unistd.h +++ b/include/asm-cris/unistd.h | |||
@@ -322,67 +322,6 @@ | |||
322 | #define __ARCH_WANT_SYS_SIGPROCMASK | 322 | #define __ARCH_WANT_SYS_SIGPROCMASK |
323 | #define __ARCH_WANT_SYS_RT_SIGACTION | 323 | #define __ARCH_WANT_SYS_RT_SIGACTION |
324 | 324 | ||
325 | #ifdef __KERNEL_SYSCALLS__ | ||
326 | |||
327 | #include <linux/compiler.h> | ||
328 | #include <linux/types.h> | ||
329 | #include <linux/linkage.h> | ||
330 | |||
331 | /* | ||
332 | * we need this inline - forking from kernel space will result | ||
333 | * in NO COPY ON WRITE (!!!), until an execve is executed. This | ||
334 | * is no problem, but for the stack. This is handled by not letting | ||
335 | * main() use the stack at all after fork(). Thus, no function | ||
336 | * calls - which means inline code for fork too, as otherwise we | ||
337 | * would use the stack upon exit from 'fork()'. | ||
338 | * | ||
339 | * Actually only pause and fork are needed inline, so that there | ||
340 | * won't be any messing with the stack from main(), but we define | ||
341 | * some others too. | ||
342 | */ | ||
343 | #define __NR__exit __NR_exit | ||
344 | static inline _syscall0(pid_t,setsid) | ||
345 | static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count) | ||
346 | static inline _syscall3(int,read,int,fd,char *,buf,off_t,count) | ||
347 | static inline _syscall3(off_t,lseek,int,fd,off_t,offset,int,count) | ||
348 | static inline _syscall1(int,dup,int,fd) | ||
349 | static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp) | ||
350 | static inline _syscall3(int,open,const char *,file,int,flag,int,mode) | ||
351 | static inline _syscall1(int,close,int,fd) | ||
352 | |||
353 | struct pt_regs; | ||
354 | asmlinkage long sys_mmap2( | ||
355 | unsigned long addr, unsigned long len, | ||
356 | unsigned long prot, unsigned long flags, | ||
357 | unsigned long fd, unsigned long pgoff); | ||
358 | asmlinkage int sys_execve(const char *fname, char **argv, char **envp, | ||
359 | long r13, long mof, long srp, struct pt_regs *regs); | ||
360 | asmlinkage int sys_clone(unsigned long newusp, unsigned long flags, | ||
361 | int* parent_tid, int* child_tid, long mof, long srp, | ||
362 | struct pt_regs *regs); | ||
363 | asmlinkage int sys_fork(long r10, long r11, long r12, long r13, | ||
364 | long mof, long srp, struct pt_regs *regs); | ||
365 | asmlinkage int sys_vfork(long r10, long r11, long r12, long r13, | ||
366 | long mof, long srp, struct pt_regs *regs); | ||
367 | asmlinkage int sys_pipe(unsigned long __user *fildes); | ||
368 | struct sigaction; | ||
369 | asmlinkage long sys_rt_sigaction(int sig, | ||
370 | const struct sigaction __user *act, | ||
371 | struct sigaction __user *oact, | ||
372 | size_t sigsetsize); | ||
373 | |||
374 | /* | ||
375 | * Since we define it "external", it collides with the built-in | ||
376 | * definition, which has the "noreturn" attribute and will cause | ||
377 | * complaints. We don't want to use -fno-builtin, so just use a | ||
378 | * different name when in the kernel. | ||
379 | */ | ||
380 | #define _exit kernel_syscall_exit | ||
381 | static inline _syscall1(int,_exit,int,exitcode) | ||
382 | static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options) | ||
383 | #endif /* __KERNEL_SYSCALLS__ */ | ||
384 | |||
385 | |||
386 | /* | 325 | /* |
387 | * "Conditional" syscalls | 326 | * "Conditional" syscalls |
388 | * | 327 | * |
diff --git a/include/asm-frv/unistd.h b/include/asm-frv/unistd.h index d104d1b91d39..725e854928cf 100644 --- a/include/asm-frv/unistd.h +++ b/include/asm-frv/unistd.h | |||
@@ -440,31 +440,6 @@ type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg | |||
440 | __syscall_return(type, __sc0); \ | 440 | __syscall_return(type, __sc0); \ |
441 | } | 441 | } |
442 | 442 | ||
443 | |||
444 | #ifdef __KERNEL_SYSCALLS__ | ||
445 | |||
446 | #include <linux/compiler.h> | ||
447 | #include <linux/types.h> | ||
448 | #include <linux/linkage.h> | ||
449 | #include <asm/ptrace.h> | ||
450 | |||
451 | /* | ||
452 | * we need this inline - forking from kernel space will result | ||
453 | * in NO COPY ON WRITE (!!!), until an execve is executed. This | ||
454 | * is no problem, but for the stack. This is handled by not letting | ||
455 | * main() use the stack at all after fork(). Thus, no function | ||
456 | * calls - which means inline code for fork too, as otherwise we | ||
457 | * would use the stack upon exit from 'fork()'. | ||
458 | * | ||
459 | * Actually only pause and fork are needed inline, so that there | ||
460 | * won't be any messing with the stack from main(), but we define | ||
461 | * some others too. | ||
462 | */ | ||
463 | #define __NR__exit __NR_exit | ||
464 | static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp) | ||
465 | |||
466 | #endif /* __KERNEL_SYSCALLS__ */ | ||
467 | |||
468 | #define __ARCH_WANT_IPC_PARSE_VERSION | 443 | #define __ARCH_WANT_IPC_PARSE_VERSION |
469 | /* #define __ARCH_WANT_OLD_READDIR */ | 444 | /* #define __ARCH_WANT_OLD_READDIR */ |
470 | #define __ARCH_WANT_OLD_STAT | 445 | #define __ARCH_WANT_OLD_STAT |
diff --git a/include/asm-h8300/unistd.h b/include/asm-h8300/unistd.h index a2dd90462d80..747788d629ae 100644 --- a/include/asm-h8300/unistd.h +++ b/include/asm-h8300/unistd.h | |||
@@ -485,57 +485,6 @@ type name(atype a, btype b, ctype c, dtype d, etype e, ftype f) \ | |||
485 | #define __ARCH_WANT_SYS_SIGPROCMASK | 485 | #define __ARCH_WANT_SYS_SIGPROCMASK |
486 | #define __ARCH_WANT_SYS_RT_SIGACTION | 486 | #define __ARCH_WANT_SYS_RT_SIGACTION |
487 | 487 | ||
488 | #ifdef __KERNEL_SYSCALLS__ | ||
489 | |||
490 | #include <linux/compiler.h> | ||
491 | #include <linux/types.h> | ||
492 | |||
493 | /* | ||
494 | * we need this inline - forking from kernel space will result | ||
495 | * in NO COPY ON WRITE (!!!), until an execve is executed. This | ||
496 | * is no problem, but for the stack. This is handled by not letting | ||
497 | * main() use the stack at all after fork(). Thus, no function | ||
498 | * calls - which means inline code for fork too, as otherwise we | ||
499 | * would use the stack upon exit from 'fork()'. | ||
500 | * | ||
501 | * Actually only pause and fork are needed inline, so that there | ||
502 | * won't be any messing with the stack from main(), but we define | ||
503 | * some others too. | ||
504 | */ | ||
505 | #define __NR__exit __NR_exit | ||
506 | static inline _syscall0(int,pause) | ||
507 | static inline _syscall0(int,sync) | ||
508 | static inline _syscall0(pid_t,setsid) | ||
509 | static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count) | ||
510 | static inline _syscall3(int,read,int,fd,char *,buf,off_t,count) | ||
511 | static inline _syscall3(off_t,lseek,int,fd,off_t,offset,int,count) | ||
512 | static inline _syscall1(int,dup,int,fd) | ||
513 | static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp) | ||
514 | static inline _syscall3(int,open,const char *,file,int,flag,int,mode) | ||
515 | static inline _syscall1(int,close,int,fd) | ||
516 | static inline _syscall1(int,_exit,int,exitcode) | ||
517 | static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options) | ||
518 | static inline _syscall1(int,delete_module,const char *,name) | ||
519 | |||
520 | static inline pid_t wait(int * wait_stat) | ||
521 | { | ||
522 | return waitpid(-1,wait_stat,0); | ||
523 | } | ||
524 | |||
525 | asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, | ||
526 | unsigned long prot, unsigned long flags, | ||
527 | unsigned long fd, unsigned long pgoff); | ||
528 | asmlinkage int sys_execve(char *name, char **argv, char **envp, | ||
529 | int dummy, ...); | ||
530 | asmlinkage int sys_pipe(unsigned long *fildes); | ||
531 | struct sigaction; | ||
532 | asmlinkage long sys_rt_sigaction(int sig, | ||
533 | const struct sigaction __user *act, | ||
534 | struct sigaction __user *oact, | ||
535 | size_t sigsetsize); | ||
536 | |||
537 | #endif /* __KERNEL_SYSCALLS__ */ | ||
538 | |||
539 | /* | 488 | /* |
540 | * "Conditional" syscalls | 489 | * "Conditional" syscalls |
541 | */ | 490 | */ |
diff --git a/include/asm-i386/bugs.h b/include/asm-i386/bugs.h index 2a9e4ee5904d..592ffeeda45e 100644 --- a/include/asm-i386/bugs.h +++ b/include/asm-i386/bugs.h | |||
@@ -189,6 +189,6 @@ static void __init check_bugs(void) | |||
189 | check_fpu(); | 189 | check_fpu(); |
190 | check_hlt(); | 190 | check_hlt(); |
191 | check_popad(); | 191 | check_popad(); |
192 | system_utsname.machine[1] = '0' + (boot_cpu_data.x86 > 6 ? 6 : boot_cpu_data.x86); | 192 | init_utsname()->machine[1] = '0' + (boot_cpu_data.x86 > 6 ? 6 : boot_cpu_data.x86); |
193 | alternative_instructions(); | 193 | alternative_instructions(); |
194 | } | 194 | } |
diff --git a/include/asm-i386/elf.h b/include/asm-i386/elf.h index db4344d9f73f..3a05436f31c0 100644 --- a/include/asm-i386/elf.h +++ b/include/asm-i386/elf.h | |||
@@ -112,7 +112,7 @@ typedef struct user_fxsr_struct elf_fpxregset_t; | |||
112 | For the moment, we have only optimizations for the Intel generations, | 112 | For the moment, we have only optimizations for the Intel generations, |
113 | but that could change... */ | 113 | but that could change... */ |
114 | 114 | ||
115 | #define ELF_PLATFORM (system_utsname.machine) | 115 | #define ELF_PLATFORM (utsname()->machine) |
116 | 116 | ||
117 | #define SET_PERSONALITY(ex, ibcs2) do { } while (0) | 117 | #define SET_PERSONALITY(ex, ibcs2) do { } while (0) |
118 | 118 | ||
diff --git a/include/asm-i386/ptrace.h b/include/asm-i386/ptrace.h index a4a0e5207db5..d505f501077a 100644 --- a/include/asm-i386/ptrace.h +++ b/include/asm-i386/ptrace.h | |||
@@ -47,7 +47,10 @@ static inline int user_mode_vm(struct pt_regs *regs) | |||
47 | { | 47 | { |
48 | return ((regs->xcs & SEGMENT_RPL_MASK) | (regs->eflags & VM_MASK)) >= USER_RPL; | 48 | return ((regs->xcs & SEGMENT_RPL_MASK) | (regs->eflags & VM_MASK)) >= USER_RPL; |
49 | } | 49 | } |
50 | |||
50 | #define instruction_pointer(regs) ((regs)->eip) | 51 | #define instruction_pointer(regs) ((regs)->eip) |
52 | #define regs_return_value(regs) ((regs)->eax) | ||
53 | |||
51 | extern unsigned long profile_pc(struct pt_regs *regs); | 54 | extern unsigned long profile_pc(struct pt_regs *regs); |
52 | #endif /* __KERNEL__ */ | 55 | #endif /* __KERNEL__ */ |
53 | 56 | ||
diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h index bd9987087adc..3ca7ab963d7d 100644 --- a/include/asm-i386/unistd.h +++ b/include/asm-i386/unistd.h | |||
@@ -451,45 +451,6 @@ __syscall_return(type,__res); \ | |||
451 | #define __ARCH_WANT_SYS_RT_SIGACTION | 451 | #define __ARCH_WANT_SYS_RT_SIGACTION |
452 | #define __ARCH_WANT_SYS_RT_SIGSUSPEND | 452 | #define __ARCH_WANT_SYS_RT_SIGSUSPEND |
453 | 453 | ||
454 | #ifdef __KERNEL_SYSCALLS__ | ||
455 | |||
456 | #include <linux/compiler.h> | ||
457 | #include <linux/types.h> | ||
458 | #include <linux/linkage.h> | ||
459 | #include <asm/ptrace.h> | ||
460 | |||
461 | /* | ||
462 | * we need this inline - forking from kernel space will result | ||
463 | * in NO COPY ON WRITE (!!!), until an execve is executed. This | ||
464 | * is no problem, but for the stack. This is handled by not letting | ||
465 | * main() use the stack at all after fork(). Thus, no function | ||
466 | * calls - which means inline code for fork too, as otherwise we | ||
467 | * would use the stack upon exit from 'fork()'. | ||
468 | * | ||
469 | * Actually only pause and fork are needed inline, so that there | ||
470 | * won't be any messing with the stack from main(), but we define | ||
471 | * some others too. | ||
472 | */ | ||
473 | static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp) | ||
474 | |||
475 | asmlinkage int sys_modify_ldt(int func, void __user *ptr, unsigned long bytecount); | ||
476 | asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, | ||
477 | unsigned long prot, unsigned long flags, | ||
478 | unsigned long fd, unsigned long pgoff); | ||
479 | asmlinkage int sys_execve(struct pt_regs regs); | ||
480 | asmlinkage int sys_clone(struct pt_regs regs); | ||
481 | asmlinkage int sys_fork(struct pt_regs regs); | ||
482 | asmlinkage int sys_vfork(struct pt_regs regs); | ||
483 | asmlinkage int sys_pipe(unsigned long __user *fildes); | ||
484 | asmlinkage long sys_iopl(unsigned long unused); | ||
485 | struct sigaction; | ||
486 | asmlinkage long sys_rt_sigaction(int sig, | ||
487 | const struct sigaction __user *act, | ||
488 | struct sigaction __user *oact, | ||
489 | size_t sigsetsize); | ||
490 | |||
491 | #endif /* __KERNEL_SYSCALLS__ */ | ||
492 | |||
493 | /* | 454 | /* |
494 | * "Conditional" syscalls | 455 | * "Conditional" syscalls |
495 | * | 456 | * |
diff --git a/include/asm-ia64/ptrace.h b/include/asm-ia64/ptrace.h index 1414316efd40..f4ef87a36236 100644 --- a/include/asm-ia64/ptrace.h +++ b/include/asm-ia64/ptrace.h | |||
@@ -241,6 +241,9 @@ struct switch_stack { | |||
241 | * the canonical representation by adding to instruction pointer. | 241 | * the canonical representation by adding to instruction pointer. |
242 | */ | 242 | */ |
243 | # define instruction_pointer(regs) ((regs)->cr_iip + ia64_psr(regs)->ri) | 243 | # define instruction_pointer(regs) ((regs)->cr_iip + ia64_psr(regs)->ri) |
244 | |||
245 | #define regs_return_value(regs) ((regs)->r8) | ||
246 | |||
244 | /* Conserve space in histogram by encoding slot bits in address | 247 | /* Conserve space in histogram by encoding slot bits in address |
245 | * bits 2 and 3 rather than bits 0 and 1. | 248 | * bits 2 and 3 rather than bits 0 and 1. |
246 | */ | 249 | */ |
diff --git a/include/asm-ia64/unistd.h b/include/asm-ia64/unistd.h index bb0eb727dcd0..53c5c0ee122c 100644 --- a/include/asm-ia64/unistd.h +++ b/include/asm-ia64/unistd.h | |||
@@ -319,78 +319,6 @@ | |||
319 | 319 | ||
320 | extern long __ia64_syscall (long a0, long a1, long a2, long a3, long a4, long nr); | 320 | extern long __ia64_syscall (long a0, long a1, long a2, long a3, long a4, long nr); |
321 | 321 | ||
322 | #ifdef __KERNEL_SYSCALLS__ | ||
323 | |||
324 | #include <linux/compiler.h> | ||
325 | #include <linux/string.h> | ||
326 | #include <linux/signal.h> | ||
327 | #include <asm/ptrace.h> | ||
328 | #include <linux/stringify.h> | ||
329 | #include <linux/syscalls.h> | ||
330 | |||
331 | static inline long | ||
332 | open (const char * name, int mode, int flags) | ||
333 | { | ||
334 | return sys_open(name, mode, flags); | ||
335 | } | ||
336 | |||
337 | static inline long | ||
338 | dup (int fd) | ||
339 | { | ||
340 | return sys_dup(fd); | ||
341 | } | ||
342 | |||
343 | static inline long | ||
344 | close (int fd) | ||
345 | { | ||
346 | return sys_close(fd); | ||
347 | } | ||
348 | |||
349 | static inline off_t | ||
350 | lseek (int fd, off_t off, int whence) | ||
351 | { | ||
352 | return sys_lseek(fd, off, whence); | ||
353 | } | ||
354 | |||
355 | static inline void | ||
356 | _exit (int value) | ||
357 | { | ||
358 | sys_exit(value); | ||
359 | } | ||
360 | |||
361 | #define exit(x) _exit(x) | ||
362 | |||
363 | static inline long | ||
364 | write (int fd, const char * buf, size_t nr) | ||
365 | { | ||
366 | return sys_write(fd, buf, nr); | ||
367 | } | ||
368 | |||
369 | static inline long | ||
370 | read (int fd, char * buf, size_t nr) | ||
371 | { | ||
372 | return sys_read(fd, buf, nr); | ||
373 | } | ||
374 | |||
375 | |||
376 | static inline long | ||
377 | setsid (void) | ||
378 | { | ||
379 | return sys_setsid(); | ||
380 | } | ||
381 | |||
382 | static inline pid_t | ||
383 | waitpid (int pid, int * wait_stat, int flags) | ||
384 | { | ||
385 | return sys_wait4(pid, wait_stat, flags, NULL); | ||
386 | } | ||
387 | |||
388 | |||
389 | extern int execve (const char *filename, char *const av[], char *const ep[]); | ||
390 | extern pid_t clone (unsigned long flags, void *sp); | ||
391 | |||
392 | #endif /* __KERNEL_SYSCALLS__ */ | ||
393 | |||
394 | asmlinkage unsigned long sys_mmap( | 322 | asmlinkage unsigned long sys_mmap( |
395 | unsigned long addr, unsigned long len, | 323 | unsigned long addr, unsigned long len, |
396 | int prot, int flags, | 324 | int prot, int flags, |
diff --git a/include/asm-m32r/unistd.h b/include/asm-m32r/unistd.h index 5c6a9ac6cf1a..95aa34298d82 100644 --- a/include/asm-m32r/unistd.h +++ b/include/asm-m32r/unistd.h | |||
@@ -424,43 +424,6 @@ __syscall_return(type,__res); \ | |||
424 | #define __ARCH_WANT_SYS_OLDUMOUNT | 424 | #define __ARCH_WANT_SYS_OLDUMOUNT |
425 | #define __ARCH_WANT_SYS_RT_SIGACTION | 425 | #define __ARCH_WANT_SYS_RT_SIGACTION |
426 | 426 | ||
427 | #ifdef __KERNEL_SYSCALLS__ | ||
428 | |||
429 | #include <linux/compiler.h> | ||
430 | #include <linux/types.h> | ||
431 | #include <linux/linkage.h> | ||
432 | #include <asm/ptrace.h> | ||
433 | |||
434 | /* | ||
435 | * we need this inline - forking from kernel space will result | ||
436 | * in NO COPY ON WRITE (!!!), until an execve is executed. This | ||
437 | * is no problem, but for the stack. This is handled by not letting | ||
438 | * main() use the stack at all after fork(). Thus, no function | ||
439 | * calls - which means inline code for fork too, as otherwise we | ||
440 | * would use the stack upon exit from 'fork()'. | ||
441 | * | ||
442 | * Actually only pause and fork are needed inline, so that there | ||
443 | * won't be any messing with the stack from main(), but we define | ||
444 | * some others too. | ||
445 | */ | ||
446 | static __inline__ _syscall3(int,execve,const char *,file,char **,argv,char **,envp) | ||
447 | |||
448 | asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, | ||
449 | unsigned long prot, unsigned long flags, | ||
450 | unsigned long fd, unsigned long pgoff); | ||
451 | asmlinkage int sys_execve(struct pt_regs regs); | ||
452 | asmlinkage int sys_clone(struct pt_regs regs); | ||
453 | asmlinkage int sys_fork(struct pt_regs regs); | ||
454 | asmlinkage int sys_vfork(struct pt_regs regs); | ||
455 | asmlinkage int sys_pipe(unsigned long __user *fildes); | ||
456 | struct sigaction; | ||
457 | asmlinkage long sys_rt_sigaction(int sig, | ||
458 | const struct sigaction __user *act, | ||
459 | struct sigaction __user *oact, | ||
460 | size_t sigsetsize); | ||
461 | |||
462 | #endif /* __KERNEL_SYSCALLS__ */ | ||
463 | |||
464 | /* | 427 | /* |
465 | * "Conditional" syscalls | 428 | * "Conditional" syscalls |
466 | * | 429 | * |
diff --git a/include/asm-m68k/unistd.h b/include/asm-m68k/unistd.h index 751632b904db..3ab716f0fc18 100644 --- a/include/asm-m68k/unistd.h +++ b/include/asm-m68k/unistd.h | |||
@@ -409,12 +409,6 @@ __syscall_return(type,__res); \ | |||
409 | #define __ARCH_WANT_SYS_SIGPROCMASK | 409 | #define __ARCH_WANT_SYS_SIGPROCMASK |
410 | #define __ARCH_WANT_SYS_RT_SIGACTION | 410 | #define __ARCH_WANT_SYS_RT_SIGACTION |
411 | 411 | ||
412 | #ifdef __KERNEL_SYSCALLS__ | ||
413 | |||
414 | static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp) | ||
415 | |||
416 | #endif /* __KERNEL_SYSCALLS__ */ | ||
417 | |||
418 | /* | 412 | /* |
419 | * "Conditional" syscalls | 413 | * "Conditional" syscalls |
420 | * | 414 | * |
diff --git a/include/asm-m68knommu/unistd.h b/include/asm-m68knommu/unistd.h index 21fdc37c5c2c..daafb5d43ef1 100644 --- a/include/asm-m68knommu/unistd.h +++ b/include/asm-m68knommu/unistd.h | |||
@@ -463,61 +463,6 @@ type name(atype a, btype b, ctype c, dtype d, etype e) \ | |||
463 | #define __ARCH_WANT_SYS_SIGPROCMASK | 463 | #define __ARCH_WANT_SYS_SIGPROCMASK |
464 | #define __ARCH_WANT_SYS_RT_SIGACTION | 464 | #define __ARCH_WANT_SYS_RT_SIGACTION |
465 | 465 | ||
466 | #ifdef __KERNEL_SYSCALLS__ | ||
467 | |||
468 | #include <linux/compiler.h> | ||
469 | #include <linux/interrupt.h> | ||
470 | #include <linux/types.h> | ||
471 | |||
472 | /* | ||
473 | * we need this inline - forking from kernel space will result | ||
474 | * in NO COPY ON WRITE (!!!), until an execve is executed. This | ||
475 | * is no problem, but for the stack. This is handled by not letting | ||
476 | * main() use the stack at all after fork(). Thus, no function | ||
477 | * calls - which means inline code for fork too, as otherwise we | ||
478 | * would use the stack upon exit from 'fork()'. | ||
479 | * | ||
480 | * Actually only pause and fork are needed inline, so that there | ||
481 | * won't be any messing with the stack from main(), but we define | ||
482 | * some others too. | ||
483 | */ | ||
484 | #define __NR__exit __NR_exit | ||
485 | static inline _syscall0(int,pause) | ||
486 | static inline _syscall0(int,sync) | ||
487 | static inline _syscall0(pid_t,setsid) | ||
488 | static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count) | ||
489 | static inline _syscall3(int,read,int,fd,char *,buf,off_t,count) | ||
490 | static inline _syscall3(off_t,lseek,int,fd,off_t,offset,int,count) | ||
491 | static inline _syscall1(int,dup,int,fd) | ||
492 | static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp) | ||
493 | static inline _syscall3(int,open,const char *,file,int,flag,int,mode) | ||
494 | static inline _syscall1(int,close,int,fd) | ||
495 | static inline _syscall1(int,_exit,int,exitcode) | ||
496 | static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options) | ||
497 | static inline _syscall1(int,delete_module,const char *,name) | ||
498 | |||
499 | static inline pid_t wait(int * wait_stat) | ||
500 | { | ||
501 | return waitpid(-1,wait_stat,0); | ||
502 | } | ||
503 | asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, | ||
504 | unsigned long prot, unsigned long flags, | ||
505 | unsigned long fd, unsigned long pgoff); | ||
506 | asmlinkage int sys_execve(char *name, char **argv, char **envp); | ||
507 | asmlinkage int sys_pipe(unsigned long *fildes); | ||
508 | struct pt_regs; | ||
509 | int sys_request_irq(unsigned int, | ||
510 | irqreturn_t (*)(int, void *, struct pt_regs *), | ||
511 | unsigned long, const char *, void *); | ||
512 | void sys_free_irq(unsigned int, void *); | ||
513 | struct sigaction; | ||
514 | asmlinkage long sys_rt_sigaction(int sig, | ||
515 | const struct sigaction __user *act, | ||
516 | struct sigaction __user *oact, | ||
517 | size_t sigsetsize); | ||
518 | |||
519 | #endif /* __KERNEL_SYSCALLS__ */ | ||
520 | |||
521 | /* | 466 | /* |
522 | * "Conditional" syscalls | 467 | * "Conditional" syscalls |
523 | * | 468 | * |
diff --git a/include/asm-mips/cacheflush.h b/include/asm-mips/cacheflush.h index 36416fdfcf68..9ab59e2bb233 100644 --- a/include/asm-mips/cacheflush.h +++ b/include/asm-mips/cacheflush.h | |||
@@ -46,8 +46,6 @@ static inline void flush_dcache_page(struct page *page) | |||
46 | #define flush_dcache_mmap_lock(mapping) do { } while (0) | 46 | #define flush_dcache_mmap_lock(mapping) do { } while (0) |
47 | #define flush_dcache_mmap_unlock(mapping) do { } while (0) | 47 | #define flush_dcache_mmap_unlock(mapping) do { } while (0) |
48 | 48 | ||
49 | extern void (*__flush_icache_page)(struct vm_area_struct *vma, | ||
50 | struct page *page); | ||
51 | static inline void flush_icache_page(struct vm_area_struct *vma, | 49 | static inline void flush_icache_page(struct vm_area_struct *vma, |
52 | struct page *page) | 50 | struct page *page) |
53 | { | 51 | { |
diff --git a/include/asm-mips/galileo-boards/ev96100.h b/include/asm-mips/galileo-boards/ev96100.h deleted file mode 100644 index 070dfd84a8e8..000000000000 --- a/include/asm-mips/galileo-boards/ev96100.h +++ /dev/null | |||
@@ -1,55 +0,0 @@ | |||
1 | /* | ||
2 | * | ||
3 | */ | ||
4 | #ifndef _MIPS_EV96100_H | ||
5 | #define _MIPS_EV96100_H | ||
6 | |||
7 | #include <asm/addrspace.h> | ||
8 | |||
9 | /* | ||
10 | * GT64120 config space base address | ||
11 | */ | ||
12 | #define GT64120_BASE (KSEG1ADDR(0x14000000)) | ||
13 | #define MIPS_GT_BASE GT64120_BASE | ||
14 | |||
15 | /* | ||
16 | * PCI Bus allocation | ||
17 | */ | ||
18 | #define GT_PCI_MEM_BASE 0x12000000UL | ||
19 | #define GT_PCI_MEM_SIZE 0x02000000UL | ||
20 | #define GT_PCI_IO_BASE 0x10000000UL | ||
21 | #define GT_PCI_IO_SIZE 0x02000000UL | ||
22 | #define GT_ISA_IO_BASE PCI_IO_BASE | ||
23 | |||
24 | /* | ||
25 | * Duart I/O ports. | ||
26 | */ | ||
27 | #define EV96100_COM1_BASE_ADDR (0xBD000000 + 0x20) | ||
28 | #define EV96100_COM2_BASE_ADDR (0xBD000000 + 0x00) | ||
29 | |||
30 | |||
31 | /* | ||
32 | * EV96100 interrupt controller register base. | ||
33 | */ | ||
34 | #define EV96100_ICTRL_REGS_BASE (KSEG1ADDR(0x1f000000)) | ||
35 | |||
36 | /* | ||
37 | * EV96100 UART register base. | ||
38 | */ | ||
39 | #define EV96100_UART0_REGS_BASE EV96100_COM1_BASE_ADDR | ||
40 | #define EV96100_UART1_REGS_BASE EV96100_COM2_BASE_ADDR | ||
41 | #define EV96100_BASE_BAUD ( 3686400 / 16 ) | ||
42 | |||
43 | |||
44 | /* | ||
45 | * Because of an error/peculiarity in the Galileo chip, we need to swap the | ||
46 | * bytes when running bigendian. | ||
47 | */ | ||
48 | #define __GT_READ(ofs) \ | ||
49 | (*(volatile u32 *)(GT64120_BASE+(ofs))) | ||
50 | #define __GT_WRITE(ofs, data) \ | ||
51 | do { *(volatile u32 *)(GT64120_BASE+(ofs)) = (data); } while (0) | ||
52 | #define GT_READ(ofs) le32_to_cpu(__GT_READ(ofs)) | ||
53 | #define GT_WRITE(ofs, data) __GT_WRITE(ofs, cpu_to_le32(data)) | ||
54 | |||
55 | #endif /* !(_MIPS_EV96100_H) */ | ||
diff --git a/include/asm-mips/galileo-boards/ev96100int.h b/include/asm-mips/galileo-boards/ev96100int.h deleted file mode 100644 index c58b16d06d6e..000000000000 --- a/include/asm-mips/galileo-boards/ev96100int.h +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | /* | ||
2 | * | ||
3 | */ | ||
4 | #ifndef _MIPS_EV96100INT_H | ||
5 | #define _MIPS_EV96100INT_H | ||
6 | |||
7 | #define EV96100INT_UART_0 6 /* IP 6 */ | ||
8 | #define EV96100INT_TIMER 7 /* IP 7 */ | ||
9 | |||
10 | extern void ev96100int_init(void); | ||
11 | |||
12 | #endif /* !(_MIPS_EV96100_H) */ | ||
diff --git a/include/asm-mips/irqflags.h b/include/asm-mips/irqflags.h index 43ca09a3a3d0..46bf5de5ac72 100644 --- a/include/asm-mips/irqflags.h +++ b/include/asm-mips/irqflags.h | |||
@@ -213,12 +213,37 @@ static inline int raw_irqs_disabled_flags(unsigned long flags) | |||
213 | * Do the CPU's IRQ-state tracing from assembly code. | 213 | * Do the CPU's IRQ-state tracing from assembly code. |
214 | */ | 214 | */ |
215 | #ifdef CONFIG_TRACE_IRQFLAGS | 215 | #ifdef CONFIG_TRACE_IRQFLAGS |
216 | /* Reload some registers clobbered by trace_hardirqs_on */ | ||
217 | #ifdef CONFIG_64BIT | ||
218 | # define TRACE_IRQS_RELOAD_REGS \ | ||
219 | LONG_L $11, PT_R11(sp); \ | ||
220 | LONG_L $10, PT_R10(sp); \ | ||
221 | LONG_L $9, PT_R9(sp); \ | ||
222 | LONG_L $8, PT_R8(sp); \ | ||
223 | LONG_L $7, PT_R7(sp); \ | ||
224 | LONG_L $6, PT_R6(sp); \ | ||
225 | LONG_L $5, PT_R5(sp); \ | ||
226 | LONG_L $4, PT_R4(sp); \ | ||
227 | LONG_L $2, PT_R2(sp) | ||
228 | #else | ||
229 | # define TRACE_IRQS_RELOAD_REGS \ | ||
230 | LONG_L $7, PT_R7(sp); \ | ||
231 | LONG_L $6, PT_R6(sp); \ | ||
232 | LONG_L $5, PT_R5(sp); \ | ||
233 | LONG_L $4, PT_R4(sp); \ | ||
234 | LONG_L $2, PT_R2(sp) | ||
235 | #endif | ||
216 | # define TRACE_IRQS_ON \ | 236 | # define TRACE_IRQS_ON \ |
237 | CLI; /* make sure trace_hardirqs_on() is called in kernel level */ \ | ||
217 | jal trace_hardirqs_on | 238 | jal trace_hardirqs_on |
239 | # define TRACE_IRQS_ON_RELOAD \ | ||
240 | TRACE_IRQS_ON; \ | ||
241 | TRACE_IRQS_RELOAD_REGS | ||
218 | # define TRACE_IRQS_OFF \ | 242 | # define TRACE_IRQS_OFF \ |
219 | jal trace_hardirqs_off | 243 | jal trace_hardirqs_off |
220 | #else | 244 | #else |
221 | # define TRACE_IRQS_ON | 245 | # define TRACE_IRQS_ON |
246 | # define TRACE_IRQS_ON_RELOAD | ||
222 | # define TRACE_IRQS_OFF | 247 | # define TRACE_IRQS_OFF |
223 | #endif | 248 | #endif |
224 | 249 | ||
diff --git a/include/asm-mips/mach-ev64120/mach-gt64120.h b/include/asm-mips/mach-ev64120/mach-gt64120.h index 13b1443a7a65..7e272ce57ea3 100644 --- a/include/asm-mips/mach-ev64120/mach-gt64120.h +++ b/include/asm-mips/mach-ev64120/mach-gt64120.h | |||
@@ -42,6 +42,7 @@ extern unsigned long gt64120_base; | |||
42 | #define EV64120_UART0_REGS_BASE (KSEG1ADDR(EV64120_COM1_BASE_ADDR)) | 42 | #define EV64120_UART0_REGS_BASE (KSEG1ADDR(EV64120_COM1_BASE_ADDR)) |
43 | #define EV64120_UART1_REGS_BASE (KSEG1ADDR(EV64120_COM2_BASE_ADDR)) | 43 | #define EV64120_UART1_REGS_BASE (KSEG1ADDR(EV64120_COM2_BASE_ADDR)) |
44 | #define EV64120_BASE_BAUD ( 3686400 / 16 ) | 44 | #define EV64120_BASE_BAUD ( 3686400 / 16 ) |
45 | #define EV64120_UART_IRQ 6 | ||
45 | 46 | ||
46 | /* | 47 | /* |
47 | * PCI interrupts will come in on either the INTA or INTD interrups lines, | 48 | * PCI interrupts will come in on either the INTA or INTD interrups lines, |
diff --git a/include/asm-mips/serial.h b/include/asm-mips/serial.h index 035637c67e7c..c882e04e1497 100644 --- a/include/asm-mips/serial.h +++ b/include/asm-mips/serial.h | |||
@@ -55,19 +55,18 @@ | |||
55 | * Galileo EV64120 evaluation board | 55 | * Galileo EV64120 evaluation board |
56 | */ | 56 | */ |
57 | #ifdef CONFIG_MIPS_EV64120 | 57 | #ifdef CONFIG_MIPS_EV64120 |
58 | #include <asm/galileo-boards/ev96100.h> | 58 | #include <mach-gt64120.h> |
59 | #include <asm/galileo-boards/ev96100int.h> | 59 | #define EV64120_SERIAL_PORT_DEFNS \ |
60 | #define EV96100_SERIAL_PORT_DEFNS \ | 60 | { .baud_base = EV64120_BASE_BAUD, .irq = EV64120_UART_IRQ, \ |
61 | { .baud_base = EV96100_BASE_BAUD, .irq = EV96100INT_UART_0, \ | ||
62 | .flags = STD_COM_FLAGS, \ | 61 | .flags = STD_COM_FLAGS, \ |
63 | .iomem_base = EV96100_UART0_REGS_BASE, .iomem_reg_shift = 2, \ | 62 | .iomem_base = EV64120_UART0_REGS_BASE, .iomem_reg_shift = 2, \ |
64 | .io_type = SERIAL_IO_MEM }, \ | 63 | .io_type = SERIAL_IO_MEM }, \ |
65 | { .baud_base = EV96100_BASE_BAUD, .irq = EV96100INT_UART_0, \ | 64 | { .baud_base = EV64120_BASE_BAUD, .irq = EV64120_UART_IRQ, \ |
66 | .flags = STD_COM_FLAGS, \ | 65 | .flags = STD_COM_FLAGS, \ |
67 | .iomem_base = EV96100_UART1_REGS_BASE, .iomem_reg_shift = 2, \ | 66 | .iomem_base = EV64120_UART1_REGS_BASE, .iomem_reg_shift = 2, \ |
68 | .io_type = SERIAL_IO_MEM }, | 67 | .io_type = SERIAL_IO_MEM }, |
69 | #else | 68 | #else |
70 | #define EV96100_SERIAL_PORT_DEFNS | 69 | #define EV64120_SERIAL_PORT_DEFNS |
71 | #endif | 70 | #endif |
72 | 71 | ||
73 | #ifdef CONFIG_MIPS_ITE8172 | 72 | #ifdef CONFIG_MIPS_ITE8172 |
@@ -239,7 +238,7 @@ | |||
239 | 238 | ||
240 | #define SERIAL_PORT_DFNS \ | 239 | #define SERIAL_PORT_DFNS \ |
241 | DDB5477_SERIAL_PORT_DEFNS \ | 240 | DDB5477_SERIAL_PORT_DEFNS \ |
242 | EV96100_SERIAL_PORT_DEFNS \ | 241 | EV64120_SERIAL_PORT_DEFNS \ |
243 | IP32_SERIAL_PORT_DEFNS \ | 242 | IP32_SERIAL_PORT_DEFNS \ |
244 | ITE_SERIAL_PORT_DEFNS \ | 243 | ITE_SERIAL_PORT_DEFNS \ |
245 | IVR_SERIAL_PORT_DEFNS \ | 244 | IVR_SERIAL_PORT_DEFNS \ |
diff --git a/include/asm-mips/stacktrace.h b/include/asm-mips/stacktrace.h new file mode 100644 index 000000000000..07f873351a86 --- /dev/null +++ b/include/asm-mips/stacktrace.h | |||
@@ -0,0 +1,44 @@ | |||
1 | #ifndef _ASM_STACKTRACE_H | ||
2 | #define _ASM_STACKTRACE_H | ||
3 | |||
4 | #include <asm/ptrace.h> | ||
5 | |||
6 | #ifdef CONFIG_KALLSYMS | ||
7 | extern int raw_show_trace; | ||
8 | extern unsigned long unwind_stack(struct task_struct *task, unsigned long *sp, | ||
9 | unsigned long pc, unsigned long *ra); | ||
10 | #else | ||
11 | #define raw_show_trace 1 | ||
12 | #define unwind_stack(task, sp, pc, ra) 0 | ||
13 | #endif | ||
14 | |||
15 | static __always_inline void prepare_frametrace(struct pt_regs *regs) | ||
16 | { | ||
17 | #ifndef CONFIG_KALLSYMS | ||
18 | /* | ||
19 | * Remove any garbage that may be in regs (specially func | ||
20 | * addresses) to avoid show_raw_backtrace() to report them | ||
21 | */ | ||
22 | memset(regs, 0, sizeof(*regs)); | ||
23 | #endif | ||
24 | __asm__ __volatile__( | ||
25 | ".set push\n\t" | ||
26 | ".set noat\n\t" | ||
27 | #ifdef CONFIG_64BIT | ||
28 | "1: dla $1, 1b\n\t" | ||
29 | "sd $1, %0\n\t" | ||
30 | "sd $29, %1\n\t" | ||
31 | "sd $31, %2\n\t" | ||
32 | #else | ||
33 | "1: la $1, 1b\n\t" | ||
34 | "sw $1, %0\n\t" | ||
35 | "sw $29, %1\n\t" | ||
36 | "sw $31, %2\n\t" | ||
37 | #endif | ||
38 | ".set pop\n\t" | ||
39 | : "=m" (regs->cp0_epc), | ||
40 | "=m" (regs->regs[29]), "=m" (regs->regs[31]) | ||
41 | : : "memory"); | ||
42 | } | ||
43 | |||
44 | #endif /* _ASM_STACKTRACE_H */ | ||
diff --git a/include/asm-mips/unistd.h b/include/asm-mips/unistd.h index c39142920fe6..685c91467e63 100644 --- a/include/asm-mips/unistd.h +++ b/include/asm-mips/unistd.h | |||
@@ -1212,45 +1212,6 @@ type name (atype a,btype b,ctype c,dtype d,etype e,ftype f) \ | |||
1212 | # define __ARCH_WANT_COMPAT_SYS_TIME | 1212 | # define __ARCH_WANT_COMPAT_SYS_TIME |
1213 | # endif | 1213 | # endif |
1214 | 1214 | ||
1215 | #ifdef __KERNEL_SYSCALLS__ | ||
1216 | |||
1217 | #include <linux/compiler.h> | ||
1218 | #include <linux/types.h> | ||
1219 | #include <linux/linkage.h> | ||
1220 | #include <asm/ptrace.h> | ||
1221 | #include <asm/sim.h> | ||
1222 | |||
1223 | /* | ||
1224 | * we need this inline - forking from kernel space will result | ||
1225 | * in NO COPY ON WRITE (!!!), until an execve is executed. This | ||
1226 | * is no problem, but for the stack. This is handled by not letting | ||
1227 | * main() use the stack at all after fork(). Thus, no function | ||
1228 | * calls - which means inline code for fork too, as otherwise we | ||
1229 | * would use the stack upon exit from 'fork()'. | ||
1230 | * | ||
1231 | * Actually only pause and fork are needed inline, so that there | ||
1232 | * won't be any messing with the stack from main(), but we define | ||
1233 | * some others too. | ||
1234 | */ | ||
1235 | static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp) | ||
1236 | |||
1237 | asmlinkage unsigned long sys_mmap( | ||
1238 | unsigned long addr, size_t len, | ||
1239 | int prot, int flags, | ||
1240 | int fd, off_t offset); | ||
1241 | asmlinkage long sys_mmap2( | ||
1242 | unsigned long addr, unsigned long len, | ||
1243 | unsigned long prot, unsigned long flags, | ||
1244 | unsigned long fd, unsigned long pgoff); | ||
1245 | asmlinkage int sys_execve(nabi_no_regargs struct pt_regs regs); | ||
1246 | asmlinkage int sys_pipe(nabi_no_regargs struct pt_regs regs); | ||
1247 | struct sigaction; | ||
1248 | asmlinkage long sys_rt_sigaction(int sig, | ||
1249 | const struct sigaction __user *act, | ||
1250 | struct sigaction __user *oact, | ||
1251 | size_t sigsetsize); | ||
1252 | |||
1253 | #endif /* __KERNEL_SYSCALLS__ */ | ||
1254 | #endif /* !__ASSEMBLY__ */ | 1215 | #endif /* !__ASSEMBLY__ */ |
1255 | 1216 | ||
1256 | /* | 1217 | /* |
diff --git a/include/asm-parisc/unistd.h b/include/asm-parisc/unistd.h index 27bcfad1c3e3..53b0f5d290e4 100644 --- a/include/asm-parisc/unistd.h +++ b/include/asm-parisc/unistd.h | |||
@@ -952,92 +952,6 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \ | |||
952 | #define __ARCH_WANT_SYS_SIGPROCMASK | 952 | #define __ARCH_WANT_SYS_SIGPROCMASK |
953 | #define __ARCH_WANT_SYS_RT_SIGACTION | 953 | #define __ARCH_WANT_SYS_RT_SIGACTION |
954 | 954 | ||
955 | /* mmap & mmap2 take 6 arguments */ | ||
956 | #define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5,type6,arg6) \ | ||
957 | type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) \ | ||
958 | { \ | ||
959 | return K_INLINE_SYSCALL(name, 6, arg1, arg2, arg3, arg4, arg5, arg6); \ | ||
960 | } | ||
961 | |||
962 | #ifdef __KERNEL_SYSCALLS__ | ||
963 | |||
964 | #include <asm/current.h> | ||
965 | #include <linux/compiler.h> | ||
966 | #include <linux/types.h> | ||
967 | #include <linux/syscalls.h> | ||
968 | |||
969 | static inline pid_t setsid(void) | ||
970 | { | ||
971 | return sys_setsid(); | ||
972 | } | ||
973 | |||
974 | static inline int write(int fd, const char *buf, off_t count) | ||
975 | { | ||
976 | return sys_write(fd, buf, count); | ||
977 | } | ||
978 | |||
979 | static inline int read(int fd, char *buf, off_t count) | ||
980 | { | ||
981 | return sys_read(fd, buf, count); | ||
982 | } | ||
983 | |||
984 | static inline off_t lseek(int fd, off_t offset, int count) | ||
985 | { | ||
986 | return sys_lseek(fd, offset, count); | ||
987 | } | ||
988 | |||
989 | static inline int dup(int fd) | ||
990 | { | ||
991 | return sys_dup(fd); | ||
992 | } | ||
993 | |||
994 | static inline int execve(char *filename, char * argv [], | ||
995 | char * envp[]) | ||
996 | { | ||
997 | extern int __execve(char *, char **, char **, struct task_struct *); | ||
998 | return __execve(filename, argv, envp, current); | ||
999 | } | ||
1000 | |||
1001 | static inline int open(const char *file, int flag, int mode) | ||
1002 | { | ||
1003 | return sys_open(file, flag, mode); | ||
1004 | } | ||
1005 | |||
1006 | static inline int close(int fd) | ||
1007 | { | ||
1008 | return sys_close(fd); | ||
1009 | } | ||
1010 | |||
1011 | static inline void _exit(int exitcode) | ||
1012 | { | ||
1013 | sys_exit(exitcode); | ||
1014 | } | ||
1015 | |||
1016 | static inline pid_t waitpid(pid_t pid, int *wait_stat, int options) | ||
1017 | { | ||
1018 | return sys_wait4(pid, wait_stat, options, NULL); | ||
1019 | } | ||
1020 | |||
1021 | asmlinkage unsigned long sys_mmap(unsigned long addr, unsigned long len, | ||
1022 | unsigned long prot, unsigned long flags, | ||
1023 | unsigned long fd, unsigned long offset); | ||
1024 | asmlinkage unsigned long sys_mmap2(unsigned long addr, unsigned long len, | ||
1025 | unsigned long prot, unsigned long flags, | ||
1026 | unsigned long fd, unsigned long pgoff); | ||
1027 | struct pt_regs; | ||
1028 | asmlinkage int sys_execve(struct pt_regs *regs); | ||
1029 | int sys_clone(unsigned long clone_flags, unsigned long usp, | ||
1030 | struct pt_regs *regs); | ||
1031 | int sys_vfork(struct pt_regs *regs); | ||
1032 | int sys_pipe(int *fildes); | ||
1033 | struct sigaction; | ||
1034 | asmlinkage long sys_rt_sigaction(int sig, | ||
1035 | const struct sigaction __user *act, | ||
1036 | struct sigaction __user *oact, | ||
1037 | size_t sigsetsize); | ||
1038 | |||
1039 | #endif /* __KERNEL_SYSCALLS__ */ | ||
1040 | |||
1041 | #endif /* __ASSEMBLY__ */ | 955 | #endif /* __ASSEMBLY__ */ |
1042 | 956 | ||
1043 | #undef STR | 957 | #undef STR |
diff --git a/include/asm-powerpc/kprobes.h b/include/asm-powerpc/kprobes.h index 34e1f89a5fa0..2dafa376a63f 100644 --- a/include/asm-powerpc/kprobes.h +++ b/include/asm-powerpc/kprobes.h | |||
@@ -44,6 +44,28 @@ typedef unsigned int kprobe_opcode_t; | |||
44 | #define IS_TDI(instr) (((instr) & 0xfc000000) == 0x08000000) | 44 | #define IS_TDI(instr) (((instr) & 0xfc000000) == 0x08000000) |
45 | #define IS_TWI(instr) (((instr) & 0xfc000000) == 0x0c000000) | 45 | #define IS_TWI(instr) (((instr) & 0xfc000000) == 0x0c000000) |
46 | 46 | ||
47 | /* | ||
48 | * 64bit powerpc uses function descriptors. | ||
49 | * Handle cases where: | ||
50 | * - User passes a <.symbol> or <module:.symbol> | ||
51 | * - User passes a <symbol> or <module:symbol> | ||
52 | * - User passes a non-existant symbol, kallsyms_lookup_name | ||
53 | * returns 0. Don't deref the NULL pointer in that case | ||
54 | */ | ||
55 | #define kprobe_lookup_name(name, addr) \ | ||
56 | { \ | ||
57 | addr = (kprobe_opcode_t *)kallsyms_lookup_name(name); \ | ||
58 | if (addr) { \ | ||
59 | char *colon; \ | ||
60 | if ((colon = strchr(name, ':')) != NULL) { \ | ||
61 | colon++; \ | ||
62 | if (*colon != '\0' && *colon != '.') \ | ||
63 | addr = *(kprobe_opcode_t **)addr; \ | ||
64 | } else if (name[0] != '.') \ | ||
65 | addr = *(kprobe_opcode_t **)addr; \ | ||
66 | } \ | ||
67 | } | ||
68 | |||
47 | #define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)((func_descr_t *)pentry) | 69 | #define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)((func_descr_t *)pentry) |
48 | 70 | ||
49 | #define is_trap(instr) (IS_TW(instr) || IS_TD(instr) || \ | 71 | #define is_trap(instr) (IS_TW(instr) || IS_TD(instr) || \ |
diff --git a/include/asm-powerpc/ptrace.h b/include/asm-powerpc/ptrace.h index 4435efe85d0e..4ad77a13f865 100644 --- a/include/asm-powerpc/ptrace.h +++ b/include/asm-powerpc/ptrace.h | |||
@@ -73,6 +73,8 @@ struct pt_regs { | |||
73 | #ifndef __ASSEMBLY__ | 73 | #ifndef __ASSEMBLY__ |
74 | 74 | ||
75 | #define instruction_pointer(regs) ((regs)->nip) | 75 | #define instruction_pointer(regs) ((regs)->nip) |
76 | #define regs_return_value(regs) ((regs)->gpr[3]) | ||
77 | |||
76 | #ifdef CONFIG_SMP | 78 | #ifdef CONFIG_SMP |
77 | extern unsigned long profile_pc(struct pt_regs *regs); | 79 | extern unsigned long profile_pc(struct pt_regs *regs); |
78 | #else | 80 | #else |
diff --git a/include/asm-powerpc/unistd.h b/include/asm-powerpc/unistd.h index eb66eae6616f..464a48cce7f5 100644 --- a/include/asm-powerpc/unistd.h +++ b/include/asm-powerpc/unistd.h | |||
@@ -479,13 +479,6 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6 | |||
479 | #endif | 479 | #endif |
480 | 480 | ||
481 | /* | 481 | /* |
482 | * System call prototypes. | ||
483 | */ | ||
484 | #ifdef __KERNEL_SYSCALLS__ | ||
485 | extern int execve(const char *file, char **argv, char **envp); | ||
486 | #endif /* __KERNEL_SYSCALLS__ */ | ||
487 | |||
488 | /* | ||
489 | * "Conditional" syscalls | 482 | * "Conditional" syscalls |
490 | * | 483 | * |
491 | * What we want is __attribute__((weak,alias("sys_ni_syscall"))), | 484 | * What we want is __attribute__((weak,alias("sys_ni_syscall"))), |
diff --git a/include/asm-s390/ptrace.h b/include/asm-s390/ptrace.h index 8d2bf65b0b64..7b768c5c68a8 100644 --- a/include/asm-s390/ptrace.h +++ b/include/asm-s390/ptrace.h | |||
@@ -472,6 +472,7 @@ struct user_regs_struct | |||
472 | 472 | ||
473 | #define user_mode(regs) (((regs)->psw.mask & PSW_MASK_PSTATE) != 0) | 473 | #define user_mode(regs) (((regs)->psw.mask & PSW_MASK_PSTATE) != 0) |
474 | #define instruction_pointer(regs) ((regs)->psw.addr & PSW_ADDR_INSN) | 474 | #define instruction_pointer(regs) ((regs)->psw.addr & PSW_ADDR_INSN) |
475 | #define regs_return_value(regs)((regs)->gprs[2]) | ||
475 | #define profile_pc(regs) instruction_pointer(regs) | 476 | #define profile_pc(regs) instruction_pointer(regs) |
476 | extern void show_regs(struct pt_regs * regs); | 477 | extern void show_regs(struct pt_regs * regs); |
477 | #endif | 478 | #endif |
diff --git a/include/asm-s390/unistd.h b/include/asm-s390/unistd.h index 0361ac5dcde3..0cccfd83c457 100644 --- a/include/asm-s390/unistd.h +++ b/include/asm-s390/unistd.h | |||
@@ -523,57 +523,6 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \ | |||
523 | # define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND | 523 | # define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND |
524 | # endif | 524 | # endif |
525 | 525 | ||
526 | #ifdef __KERNEL_SYSCALLS__ | ||
527 | |||
528 | #include <linux/compiler.h> | ||
529 | #include <linux/types.h> | ||
530 | #include <asm/ptrace.h> | ||
531 | #include <asm/stat.h> | ||
532 | #include <linux/syscalls.h> | ||
533 | |||
534 | /* | ||
535 | * we need this inline - forking from kernel space will result | ||
536 | * in NO COPY ON WRITE (!!!), until an execve is executed. This | ||
537 | * is no problem, but for the stack. This is handled by not letting | ||
538 | * main() use the stack at all after fork(). Thus, no function | ||
539 | * calls - which means inline code for fork too, as otherwise we | ||
540 | * would use the stack upon exit from 'fork()'. | ||
541 | * | ||
542 | * Actually only pause and fork are needed inline, so that there | ||
543 | * won't be any messing with the stack from main(), but we define | ||
544 | * some others too. | ||
545 | */ | ||
546 | #define __NR__exit __NR_exit | ||
547 | static inline _syscall0(pid_t,setsid) | ||
548 | static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count) | ||
549 | static inline _syscall3(int,read,int,fd,char *,buf,off_t,count) | ||
550 | static inline _syscall3(off_t,lseek,int,fd,off_t,offset,int,count) | ||
551 | static inline _syscall1(int,dup,int,fd) | ||
552 | static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp) | ||
553 | static inline _syscall3(int,open,const char *,file,int,flag,int,mode) | ||
554 | static inline _syscall1(int,close,int,fd) | ||
555 | static inline _syscall2(long,stat,char *,filename,struct stat *,statbuf) | ||
556 | |||
557 | static inline pid_t waitpid(int pid, int *wait_stat, int flags) | ||
558 | { | ||
559 | return sys_wait4(pid, wait_stat, flags, NULL); | ||
560 | } | ||
561 | struct mmap_arg_struct; | ||
562 | asmlinkage long sys_mmap2(struct mmap_arg_struct __user *arg); | ||
563 | |||
564 | asmlinkage long sys_execve(struct pt_regs regs); | ||
565 | asmlinkage long sys_clone(struct pt_regs regs); | ||
566 | asmlinkage long sys_fork(struct pt_regs regs); | ||
567 | asmlinkage long sys_vfork(struct pt_regs regs); | ||
568 | asmlinkage long sys_pipe(unsigned long __user *fildes); | ||
569 | struct sigaction; | ||
570 | asmlinkage long sys_rt_sigaction(int sig, | ||
571 | const struct sigaction __user *act, | ||
572 | struct sigaction __user *oact, | ||
573 | size_t sigsetsize); | ||
574 | |||
575 | #endif /* __KERNEL_SYSCALLS__ */ | ||
576 | |||
577 | /* | 526 | /* |
578 | * "Conditional" syscalls | 527 | * "Conditional" syscalls |
579 | * | 528 | * |
diff --git a/include/asm-sh/bugs.h b/include/asm-sh/bugs.h index b4000c8bf31b..beeea40f549e 100644 --- a/include/asm-sh/bugs.h +++ b/include/asm-sh/bugs.h | |||
@@ -18,7 +18,7 @@ static void __init check_bugs(void) | |||
18 | { | 18 | { |
19 | extern char *get_cpu_subtype(void); | 19 | extern char *get_cpu_subtype(void); |
20 | extern unsigned long loops_per_jiffy; | 20 | extern unsigned long loops_per_jiffy; |
21 | char *p= &system_utsname.machine[2]; /* "sh" */ | 21 | char *p= &init_utsname()->machine[2]; /* "sh" */ |
22 | 22 | ||
23 | cpu_data->loops_per_jiffy = loops_per_jiffy; | 23 | cpu_data->loops_per_jiffy = loops_per_jiffy; |
24 | 24 | ||
diff --git a/include/asm-sh/unistd.h b/include/asm-sh/unistd.h index 5d5e9f94def5..f1a0cbc966be 100644 --- a/include/asm-sh/unistd.h +++ b/include/asm-sh/unistd.h | |||
@@ -472,76 +472,6 @@ __syscall_return(type,__sc0); \ | |||
472 | #define __ARCH_WANT_SYS_RT_SIGACTION | 472 | #define __ARCH_WANT_SYS_RT_SIGACTION |
473 | #define __ARCH_WANT_SYS_RT_SIGSUSPEND | 473 | #define __ARCH_WANT_SYS_RT_SIGSUSPEND |
474 | 474 | ||
475 | #ifdef __KERNEL_SYSCALLS__ | ||
476 | |||
477 | #include <linux/compiler.h> | ||
478 | #include <linux/types.h> | ||
479 | #include <linux/linkage.h> | ||
480 | #include <asm/ptrace.h> | ||
481 | |||
482 | /* | ||
483 | * we need this inline - forking from kernel space will result | ||
484 | * in NO COPY ON WRITE (!!!), until an execve is executed. This | ||
485 | * is no problem, but for the stack. This is handled by not letting | ||
486 | * main() use the stack at all after fork(). Thus, no function | ||
487 | * calls - which means inline code for fork too, as otherwise we | ||
488 | * would use the stack upon exit from 'fork()'. | ||
489 | * | ||
490 | * Actually only pause and fork are needed inline, so that there | ||
491 | * won't be any messing with the stack from main(), but we define | ||
492 | * some others too. | ||
493 | */ | ||
494 | #define __NR__exit __NR_exit | ||
495 | static __inline__ _syscall0(int,pause) | ||
496 | static __inline__ _syscall0(int,sync) | ||
497 | static __inline__ _syscall0(pid_t,setsid) | ||
498 | static __inline__ _syscall3(int,write,int,fd,const char *,buf,off_t,count) | ||
499 | static __inline__ _syscall3(int,read,int,fd,char *,buf,off_t,count) | ||
500 | static __inline__ _syscall3(off_t,lseek,int,fd,off_t,offset,int,count) | ||
501 | static __inline__ _syscall1(int,dup,int,fd) | ||
502 | static __inline__ _syscall3(int,execve,const char *,file,char **,argv,char **,envp) | ||
503 | static __inline__ _syscall3(int,open,const char *,file,int,flag,int,mode) | ||
504 | static __inline__ _syscall1(int,close,int,fd) | ||
505 | static __inline__ _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options) | ||
506 | static __inline__ _syscall1(int,delete_module,const char *,name) | ||
507 | |||
508 | static __inline__ pid_t wait(int * wait_stat) | ||
509 | { | ||
510 | return waitpid(-1,wait_stat,0); | ||
511 | } | ||
512 | |||
513 | asmlinkage long sys_mmap2( | ||
514 | unsigned long addr, unsigned long len, | ||
515 | unsigned long prot, unsigned long flags, | ||
516 | unsigned long fd, unsigned long pgoff); | ||
517 | asmlinkage int sys_execve(char *ufilename, char **uargv, | ||
518 | char **uenvp, unsigned long r7, | ||
519 | struct pt_regs regs); | ||
520 | asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp, | ||
521 | unsigned long parent_tidptr, | ||
522 | unsigned long child_tidptr, | ||
523 | struct pt_regs regs); | ||
524 | asmlinkage int sys_fork(unsigned long r4, unsigned long r5, | ||
525 | unsigned long r6, unsigned long r7, | ||
526 | struct pt_regs regs); | ||
527 | asmlinkage int sys_vfork(unsigned long r4, unsigned long r5, | ||
528 | unsigned long r6, unsigned long r7, | ||
529 | struct pt_regs regs); | ||
530 | asmlinkage int sys_pipe(unsigned long r4, unsigned long r5, | ||
531 | unsigned long r6, unsigned long r7, | ||
532 | struct pt_regs regs); | ||
533 | asmlinkage ssize_t sys_pread_wrapper(unsigned int fd, char *buf, | ||
534 | size_t count, long dummy, loff_t pos); | ||
535 | asmlinkage ssize_t sys_pwrite_wrapper(unsigned int fd, const char *buf, | ||
536 | size_t count, long dummy, loff_t pos); | ||
537 | struct sigaction; | ||
538 | asmlinkage long sys_rt_sigaction(int sig, | ||
539 | const struct sigaction __user *act, | ||
540 | struct sigaction __user *oact, | ||
541 | size_t sigsetsize); | ||
542 | |||
543 | #endif /* __KERNEL_SYSCALLS__ */ | ||
544 | |||
545 | /* | 475 | /* |
546 | * "Conditional" syscalls | 476 | * "Conditional" syscalls |
547 | * | 477 | * |
diff --git a/include/asm-sh64/unistd.h b/include/asm-sh64/unistd.h index c113566bef33..ee7828b27ad1 100644 --- a/include/asm-sh64/unistd.h +++ b/include/asm-sh64/unistd.h | |||
@@ -513,47 +513,6 @@ __syscall_return(type,__sc0); \ | |||
513 | #define __ARCH_WANT_SYS_SIGPROCMASK | 513 | #define __ARCH_WANT_SYS_SIGPROCMASK |
514 | #define __ARCH_WANT_SYS_RT_SIGACTION | 514 | #define __ARCH_WANT_SYS_RT_SIGACTION |
515 | 515 | ||
516 | #ifdef __KERNEL_SYSCALLS__ | ||
517 | |||
518 | /* Copy from sh */ | ||
519 | #include <linux/compiler.h> | ||
520 | #include <linux/types.h> | ||
521 | #include <asm/ptrace.h> | ||
522 | |||
523 | /* | ||
524 | * we need this inline - forking from kernel space will result | ||
525 | * in NO COPY ON WRITE (!!!), until an execve is executed. This | ||
526 | * is no problem, but for the stack. This is handled by not letting | ||
527 | * main() use the stack at all after fork(). Thus, no function | ||
528 | * calls - which means inline code for fork too, as otherwise we | ||
529 | * would use the stack upon exit from 'fork()'. | ||
530 | * | ||
531 | * Actually only pause and fork are needed inline, so that there | ||
532 | * won't be any messing with the stack from main(), but we define | ||
533 | * some others too. | ||
534 | */ | ||
535 | #define __NR__exit __NR_exit | ||
536 | static inline _syscall0(int,pause) | ||
537 | static inline _syscall1(int,setup,int,magic) | ||
538 | static inline _syscall0(int,sync) | ||
539 | static inline _syscall0(pid_t,setsid) | ||
540 | static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count) | ||
541 | static inline _syscall3(int,read,int,fd,char *,buf,off_t,count) | ||
542 | static inline _syscall3(off_t,lseek,int,fd,off_t,offset,int,count) | ||
543 | static inline _syscall1(int,dup,int,fd) | ||
544 | static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp) | ||
545 | static inline _syscall3(int,open,const char *,file,int,flag,int,mode) | ||
546 | static inline _syscall1(int,close,int,fd) | ||
547 | static inline _syscall1(int,_exit,int,exitcode) | ||
548 | static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options) | ||
549 | static inline _syscall1(int,delete_module,const char *,name) | ||
550 | |||
551 | static inline pid_t wait(int * wait_stat) | ||
552 | { | ||
553 | return waitpid(-1,wait_stat,0); | ||
554 | } | ||
555 | #endif /* __KERNEL_SYSCALLS__ */ | ||
556 | |||
557 | /* | 516 | /* |
558 | * "Conditional" syscalls | 517 | * "Conditional" syscalls |
559 | * | 518 | * |
diff --git a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h index 2553762465ca..c7a495afc82e 100644 --- a/include/asm-sparc/unistd.h +++ b/include/asm-sparc/unistd.h | |||
@@ -478,53 +478,6 @@ return -1; \ | |||
478 | #define __ARCH_WANT_SYS_SIGPROCMASK | 478 | #define __ARCH_WANT_SYS_SIGPROCMASK |
479 | #define __ARCH_WANT_SYS_RT_SIGSUSPEND | 479 | #define __ARCH_WANT_SYS_RT_SIGSUSPEND |
480 | 480 | ||
481 | #ifdef __KERNEL_SYSCALLS__ | ||
482 | |||
483 | #include <linux/compiler.h> | ||
484 | #include <linux/types.h> | ||
485 | |||
486 | /* | ||
487 | * we need this inline - forking from kernel space will result | ||
488 | * in NO COPY ON WRITE (!!!), until an execve is executed. This | ||
489 | * is no problem, but for the stack. This is handled by not letting | ||
490 | * main() use the stack at all after fork(). Thus, no function | ||
491 | * calls - which means inline code for fork too, as otherwise we | ||
492 | * would use the stack upon exit from 'fork()'. | ||
493 | * | ||
494 | * Actually only pause and fork are needed inline, so that there | ||
495 | * won't be any messing with the stack from main(), but we define | ||
496 | * some others too. | ||
497 | */ | ||
498 | #define __NR__exit __NR_exit | ||
499 | static __inline__ _syscall0(pid_t,setsid) | ||
500 | static __inline__ _syscall3(int,write,int,fd,__const__ char *,buf,off_t,count) | ||
501 | static __inline__ _syscall3(int,read,int,fd,char *,buf,off_t,count) | ||
502 | static __inline__ _syscall3(off_t,lseek,int,fd,off_t,offset,int,count) | ||
503 | static __inline__ _syscall1(int,dup,int,fd) | ||
504 | static __inline__ _syscall3(int,execve,__const__ char *,file,char **,argv,char **,envp) | ||
505 | static __inline__ _syscall3(int,open,__const__ char *,file,int,flag,int,mode) | ||
506 | static __inline__ _syscall1(int,close,int,fd) | ||
507 | static __inline__ _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options) | ||
508 | |||
509 | #include <linux/linkage.h> | ||
510 | |||
511 | asmlinkage unsigned long sys_mmap( | ||
512 | unsigned long addr, unsigned long len, | ||
513 | unsigned long prot, unsigned long flags, | ||
514 | unsigned long fd, unsigned long off); | ||
515 | asmlinkage unsigned long sys_mmap2( | ||
516 | unsigned long addr, unsigned long len, | ||
517 | unsigned long prot, unsigned long flags, | ||
518 | unsigned long fd, unsigned long pgoff); | ||
519 | struct sigaction; | ||
520 | asmlinkage long sys_rt_sigaction(int sig, | ||
521 | const struct sigaction __user *act, | ||
522 | struct sigaction __user *oact, | ||
523 | void __user *restorer, | ||
524 | size_t sigsetsize); | ||
525 | |||
526 | #endif /* __KERNEL_SYSCALLS__ */ | ||
527 | |||
528 | /* | 481 | /* |
529 | * "Conditional" syscalls | 482 | * "Conditional" syscalls |
530 | * | 483 | * |
diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h index badc73fdcb97..124cf076717f 100644 --- a/include/asm-sparc64/unistd.h +++ b/include/asm-sparc64/unistd.h | |||
@@ -445,48 +445,6 @@ if (__res>=0) \ | |||
445 | errno = -__res; \ | 445 | errno = -__res; \ |
446 | return -1; \ | 446 | return -1; \ |
447 | } | 447 | } |
448 | #ifdef __KERNEL_SYSCALLS__ | ||
449 | |||
450 | #include <linux/compiler.h> | ||
451 | #include <linux/types.h> | ||
452 | |||
453 | /* | ||
454 | * we need this inline - forking from kernel space will result | ||
455 | * in NO COPY ON WRITE (!!!), until an execve is executed. This | ||
456 | * is no problem, but for the stack. This is handled by not letting | ||
457 | * main() use the stack at all after fork(). Thus, no function | ||
458 | * calls - which means inline code for fork too, as otherwise we | ||
459 | * would use the stack upon exit from 'fork()'. | ||
460 | * | ||
461 | * Actually only pause and fork are needed inline, so that there | ||
462 | * won't be any messing with the stack from main(), but we define | ||
463 | * some others too. | ||
464 | */ | ||
465 | #define __NR__exit __NR_exit | ||
466 | static __inline__ _syscall0(pid_t,setsid) | ||
467 | static __inline__ _syscall3(int,write,int,fd,__const__ char *,buf,off_t,count) | ||
468 | static __inline__ _syscall3(int,read,int,fd,char *,buf,off_t,count) | ||
469 | static __inline__ _syscall3(off_t,lseek,int,fd,off_t,offset,int,count) | ||
470 | static __inline__ _syscall1(int,dup,int,fd) | ||
471 | static __inline__ _syscall3(int,execve,__const__ char *,file,char **,argv,char **,envp) | ||
472 | static __inline__ _syscall3(int,open,__const__ char *,file,int,flag,int,mode) | ||
473 | static __inline__ _syscall1(int,close,int,fd) | ||
474 | static __inline__ _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options) | ||
475 | |||
476 | #include <linux/linkage.h> | ||
477 | |||
478 | asmlinkage unsigned long sys_mmap( | ||
479 | unsigned long addr, unsigned long len, | ||
480 | unsigned long prot, unsigned long flags, | ||
481 | unsigned long fd, unsigned long off); | ||
482 | struct sigaction; | ||
483 | asmlinkage long sys_rt_sigaction(int sig, | ||
484 | const struct sigaction __user *act, | ||
485 | struct sigaction __user *oact, | ||
486 | void __user *restorer, | ||
487 | size_t sigsetsize); | ||
488 | |||
489 | #endif /* __KERNEL_SYSCALLS__ */ | ||
490 | 448 | ||
491 | /* sysconf options, for SunOS compatibility */ | 449 | /* sysconf options, for SunOS compatibility */ |
492 | #define _SC_ARG_MAX 1 | 450 | #define _SC_ARG_MAX 1 |
diff --git a/include/asm-um/unistd.h b/include/asm-um/unistd.h index afccfcaa9ea9..732c83f04c3d 100644 --- a/include/asm-um/unistd.h +++ b/include/asm-um/unistd.h | |||
@@ -37,34 +37,6 @@ extern int um_execve(const char *file, char *const argv[], char *const env[]); | |||
37 | #define __ARCH_WANT_SYS_RT_SIGSUSPEND | 37 | #define __ARCH_WANT_SYS_RT_SIGSUSPEND |
38 | #endif | 38 | #endif |
39 | 39 | ||
40 | #ifdef __KERNEL_SYSCALLS__ | ||
41 | |||
42 | #include <linux/compiler.h> | ||
43 | #include <linux/types.h> | ||
44 | |||
45 | static inline int execve(const char *filename, char *const argv[], | ||
46 | char *const envp[]) | ||
47 | { | ||
48 | mm_segment_t fs; | ||
49 | int ret; | ||
50 | |||
51 | fs = get_fs(); | ||
52 | set_fs(KERNEL_DS); | ||
53 | ret = um_execve(filename, argv, envp); | ||
54 | set_fs(fs); | ||
55 | |||
56 | if (ret >= 0) | ||
57 | return ret; | ||
58 | |||
59 | errno = -(long)ret; | ||
60 | return -1; | ||
61 | } | ||
62 | |||
63 | int sys_execve(char *file, char **argv, char **env); | ||
64 | |||
65 | #endif /* __KERNEL_SYSCALLS__ */ | ||
66 | |||
67 | #undef __KERNEL_SYSCALLS__ | ||
68 | #include "asm/arch/unistd.h" | 40 | #include "asm/arch/unistd.h" |
69 | 41 | ||
70 | #endif /* _UM_UNISTD_H_*/ | 42 | #endif /* _UM_UNISTD_H_*/ |
diff --git a/include/asm-v850/unistd.h b/include/asm-v850/unistd.h index 552b7c873a57..737401e7d3ad 100644 --- a/include/asm-v850/unistd.h +++ b/include/asm-v850/unistd.h | |||
@@ -387,57 +387,6 @@ type name (atype a, btype b, ctype c, dtype d, etype e, ftype f) \ | |||
387 | #define __ARCH_WANT_SYS_SIGPROCMASK | 387 | #define __ARCH_WANT_SYS_SIGPROCMASK |
388 | #define __ARCH_WANT_SYS_RT_SIGACTION | 388 | #define __ARCH_WANT_SYS_RT_SIGACTION |
389 | 389 | ||
390 | #ifdef __KERNEL_SYSCALLS__ | ||
391 | |||
392 | #include <linux/compiler.h> | ||
393 | #include <linux/types.h> | ||
394 | |||
395 | /* | ||
396 | * we need this inline - forking from kernel space will result | ||
397 | * in NO COPY ON WRITE (!!!), until an execve is executed. This | ||
398 | * is no problem, but for the stack. This is handled by not letting | ||
399 | * main() use the stack at all after fork(). Thus, no function | ||
400 | * calls - which means inline code for fork too, as otherwise we | ||
401 | * would use the stack upon exit from 'fork()'. | ||
402 | * | ||
403 | * Actually only pause and fork are needed inline, so that there | ||
404 | * won't be any messing with the stack from main(), but we define | ||
405 | * some others too. | ||
406 | */ | ||
407 | #define __NR__exit __NR_exit | ||
408 | extern inline _syscall0(pid_t,setsid) | ||
409 | extern inline _syscall3(int,write,int,fd,const char *,buf,off_t,count) | ||
410 | extern inline _syscall3(int,read,int,fd,char *,buf,off_t,count) | ||
411 | extern inline _syscall3(off_t,lseek,int,fd,off_t,offset,int,count) | ||
412 | extern inline _syscall1(int,dup,int,fd) | ||
413 | extern inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp) | ||
414 | extern inline _syscall3(int,open,const char *,file,int,flag,int,mode) | ||
415 | extern inline _syscall1(int,close,int,fd) | ||
416 | extern inline _syscall1(int,_exit,int,exitcode) | ||
417 | extern inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options) | ||
418 | |||
419 | extern inline pid_t wait(int * wait_stat) | ||
420 | { | ||
421 | return waitpid (-1, wait_stat, 0); | ||
422 | } | ||
423 | |||
424 | unsigned long sys_mmap(unsigned long addr, size_t len, | ||
425 | unsigned long prot, unsigned long flags, | ||
426 | unsigned long fd, off_t offset); | ||
427 | unsigned long sys_mmap2(unsigned long addr, size_t len, | ||
428 | unsigned long prot, unsigned long flags, | ||
429 | unsigned long fd, unsigned long pgoff); | ||
430 | struct pt_regs; | ||
431 | int sys_execve (char *name, char **argv, char **envp, struct pt_regs *regs); | ||
432 | int sys_pipe (int *fildes); | ||
433 | struct sigaction; | ||
434 | asmlinkage long sys_rt_sigaction(int sig, | ||
435 | const struct sigaction __user *act, | ||
436 | struct sigaction __user *oact, | ||
437 | size_t sigsetsize); | ||
438 | |||
439 | #endif /* __KERNEL_SYSCALLS__ */ | ||
440 | |||
441 | /* | 390 | /* |
442 | * "Conditional" syscalls | 391 | * "Conditional" syscalls |
443 | */ | 392 | */ |
diff --git a/include/asm-x86_64/ptrace.h b/include/asm-x86_64/ptrace.h index ab827dc381d7..5ea84dbb1e9c 100644 --- a/include/asm-x86_64/ptrace.h +++ b/include/asm-x86_64/ptrace.h | |||
@@ -39,6 +39,8 @@ struct pt_regs { | |||
39 | #define user_mode(regs) (!!((regs)->cs & 3)) | 39 | #define user_mode(regs) (!!((regs)->cs & 3)) |
40 | #define user_mode_vm(regs) user_mode(regs) | 40 | #define user_mode_vm(regs) user_mode(regs) |
41 | #define instruction_pointer(regs) ((regs)->rip) | 41 | #define instruction_pointer(regs) ((regs)->rip) |
42 | #define regs_return_value(regs) ((regs)->rax) | ||
43 | |||
42 | extern unsigned long profile_pc(struct pt_regs *regs); | 44 | extern unsigned long profile_pc(struct pt_regs *regs); |
43 | void signal_fault(struct pt_regs *regs, void __user *frame, char *where); | 45 | void signal_fault(struct pt_regs *regs, void __user *frame, char *where); |
44 | 46 | ||
diff --git a/include/asm-x86_64/unistd.h b/include/asm-x86_64/unistd.h index 6137146516d3..777288eb7e75 100644 --- a/include/asm-x86_64/unistd.h +++ b/include/asm-x86_64/unistd.h | |||
@@ -620,10 +620,11 @@ __SYSCALL(__NR_vmsplice, sys_vmsplice) | |||
620 | #define __NR_move_pages 279 | 620 | #define __NR_move_pages 279 |
621 | __SYSCALL(__NR_move_pages, sys_move_pages) | 621 | __SYSCALL(__NR_move_pages, sys_move_pages) |
622 | 622 | ||
623 | #ifdef __KERNEL__ | ||
624 | |||
625 | #define __NR_syscall_max __NR_move_pages | 623 | #define __NR_syscall_max __NR_move_pages |
624 | |||
625 | #ifdef __KERNEL__ | ||
626 | #include <linux/err.h> | 626 | #include <linux/err.h> |
627 | #endif | ||
627 | 628 | ||
628 | #ifndef __NO_STUBS | 629 | #ifndef __NO_STUBS |
629 | 630 | ||
@@ -663,8 +664,6 @@ do { \ | |||
663 | #define __ARCH_WANT_SYS_TIME | 664 | #define __ARCH_WANT_SYS_TIME |
664 | #define __ARCH_WANT_COMPAT_SYS_TIME | 665 | #define __ARCH_WANT_COMPAT_SYS_TIME |
665 | 666 | ||
666 | #ifndef __KERNEL_SYSCALLS__ | ||
667 | |||
668 | #define __syscall "syscall" | 667 | #define __syscall "syscall" |
669 | 668 | ||
670 | #define _syscall0(type,name) \ | 669 | #define _syscall0(type,name) \ |
@@ -746,83 +745,7 @@ __asm__ volatile ("movq %5,%%r10 ; movq %6,%%r8 ; movq %7,%%r9 ; " __syscall \ | |||
746 | __syscall_return(type,__res); \ | 745 | __syscall_return(type,__res); \ |
747 | } | 746 | } |
748 | 747 | ||
749 | #else /* __KERNEL_SYSCALLS__ */ | 748 | #ifdef __KERNEL__ |
750 | |||
751 | #include <linux/syscalls.h> | ||
752 | #include <asm/ptrace.h> | ||
753 | |||
754 | /* | ||
755 | * we need this inline - forking from kernel space will result | ||
756 | * in NO COPY ON WRITE (!!!), until an execve is executed. This | ||
757 | * is no problem, but for the stack. This is handled by not letting | ||
758 | * main() use the stack at all after fork(). Thus, no function | ||
759 | * calls - which means inline code for fork too, as otherwise we | ||
760 | * would use the stack upon exit from 'fork()'. | ||
761 | * | ||
762 | * Actually only pause and fork are needed inline, so that there | ||
763 | * won't be any messing with the stack from main(), but we define | ||
764 | * some others too. | ||
765 | */ | ||
766 | #define __NR__exit __NR_exit | ||
767 | |||
768 | static inline pid_t setsid(void) | ||
769 | { | ||
770 | return sys_setsid(); | ||
771 | } | ||
772 | |||
773 | static inline ssize_t write(unsigned int fd, char * buf, size_t count) | ||
774 | { | ||
775 | return sys_write(fd, buf, count); | ||
776 | } | ||
777 | |||
778 | static inline ssize_t read(unsigned int fd, char * buf, size_t count) | ||
779 | { | ||
780 | return sys_read(fd, buf, count); | ||
781 | } | ||
782 | |||
783 | static inline off_t lseek(unsigned int fd, off_t offset, unsigned int origin) | ||
784 | { | ||
785 | return sys_lseek(fd, offset, origin); | ||
786 | } | ||
787 | |||
788 | static inline long dup(unsigned int fd) | ||
789 | { | ||
790 | return sys_dup(fd); | ||
791 | } | ||
792 | |||
793 | /* implemented in asm in arch/x86_64/kernel/entry.S */ | ||
794 | extern int execve(const char *, char * const *, char * const *); | ||
795 | |||
796 | static inline long open(const char * filename, int flags, int mode) | ||
797 | { | ||
798 | return sys_open(filename, flags, mode); | ||
799 | } | ||
800 | |||
801 | static inline long close(unsigned int fd) | ||
802 | { | ||
803 | return sys_close(fd); | ||
804 | } | ||
805 | |||
806 | static inline pid_t waitpid(int pid, int * wait_stat, int flags) | ||
807 | { | ||
808 | return sys_wait4(pid, wait_stat, flags, NULL); | ||
809 | } | ||
810 | |||
811 | extern long sys_mmap(unsigned long addr, unsigned long len, | ||
812 | unsigned long prot, unsigned long flags, | ||
813 | unsigned long fd, unsigned long off); | ||
814 | |||
815 | extern int sys_modify_ldt(int func, void *ptr, unsigned long bytecount); | ||
816 | |||
817 | asmlinkage long sys_execve(char *name, char **argv, char **envp, | ||
818 | struct pt_regs regs); | ||
819 | asmlinkage long sys_clone(unsigned long clone_flags, unsigned long newsp, | ||
820 | void *parent_tid, void *child_tid, | ||
821 | struct pt_regs regs); | ||
822 | asmlinkage long sys_fork(struct pt_regs regs); | ||
823 | asmlinkage long sys_vfork(struct pt_regs regs); | ||
824 | asmlinkage long sys_pipe(int *fildes); | ||
825 | |||
826 | #ifndef __ASSEMBLY__ | 749 | #ifndef __ASSEMBLY__ |
827 | 750 | ||
828 | #include <linux/linkage.h> | 751 | #include <linux/linkage.h> |
@@ -839,8 +762,8 @@ asmlinkage long sys_rt_sigaction(int sig, | |||
839 | size_t sigsetsize); | 762 | size_t sigsetsize); |
840 | 763 | ||
841 | #endif /* __ASSEMBLY__ */ | 764 | #endif /* __ASSEMBLY__ */ |
842 | 765 | #endif /* __KERNEL__ */ | |
843 | #endif /* __KERNEL_SYSCALLS__ */ | 766 | #endif /* __NO_STUBS */ |
844 | 767 | ||
845 | /* | 768 | /* |
846 | * "Conditional" syscalls | 769 | * "Conditional" syscalls |
@@ -850,8 +773,4 @@ asmlinkage long sys_rt_sigaction(int sig, | |||
850 | */ | 773 | */ |
851 | #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") | 774 | #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") |
852 | 775 | ||
853 | #endif /* __NO_STUBS */ | ||
854 | |||
855 | #endif /* __KERNEL__ */ | ||
856 | |||
857 | #endif /* _ASM_X86_64_UNISTD_H_ */ | 776 | #endif /* _ASM_X86_64_UNISTD_H_ */ |
diff --git a/include/asm-xtensa/unistd.h b/include/asm-xtensa/unistd.h index 5e1b99dc4ab3..411f810a55c6 100644 --- a/include/asm-xtensa/unistd.h +++ b/include/asm-xtensa/unistd.h | |||
@@ -402,11 +402,6 @@ __asm__ __volatile__ ( \ | |||
402 | __syscall_return(type,__res); \ | 402 | __syscall_return(type,__res); \ |
403 | } | 403 | } |
404 | 404 | ||
405 | |||
406 | #ifdef __KERNEL_SYSCALLS__ | ||
407 | static __inline__ _syscall3(int,execve,const char*,file,char**,argv,char**,envp) | ||
408 | #endif | ||
409 | |||
410 | /* | 405 | /* |
411 | * "Conditional" syscalls | 406 | * "Conditional" syscalls |
412 | * | 407 | * |
diff --git a/include/linux/compat.h b/include/linux/compat.h index 9760753e662b..6f110957cc97 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
@@ -13,6 +13,7 @@ | |||
13 | 13 | ||
14 | #include <asm/compat.h> | 14 | #include <asm/compat.h> |
15 | #include <asm/siginfo.h> | 15 | #include <asm/siginfo.h> |
16 | #include <asm/signal.h> | ||
16 | 17 | ||
17 | #define compat_jiffies_to_clock_t(x) \ | 18 | #define compat_jiffies_to_clock_t(x) \ |
18 | (((unsigned long)(x) * COMPAT_USER_HZ) / HZ) | 19 | (((unsigned long)(x) * COMPAT_USER_HZ) / HZ) |
diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h index 25423f79bf9f..ed6c0fee1ac7 100644 --- a/include/linux/console_struct.h +++ b/include/linux/console_struct.h | |||
@@ -54,7 +54,7 @@ struct vc_data { | |||
54 | struct tty_struct *vc_tty; /* TTY we are attached to */ | 54 | struct tty_struct *vc_tty; /* TTY we are attached to */ |
55 | /* data for manual vt switching */ | 55 | /* data for manual vt switching */ |
56 | struct vt_mode vt_mode; | 56 | struct vt_mode vt_mode; |
57 | int vt_pid; | 57 | struct pid *vt_pid; |
58 | int vt_newvt; | 58 | int vt_newvt; |
59 | wait_queue_head_t paste_wait; | 59 | wait_queue_head_t paste_wait; |
60 | /* mode flags */ | 60 | /* mode flags */ |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 2e29a2edaeec..91c0b2a32a90 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -684,7 +684,8 @@ extern struct block_device *I_BDEV(struct inode *inode); | |||
684 | 684 | ||
685 | struct fown_struct { | 685 | struct fown_struct { |
686 | rwlock_t lock; /* protects pid, uid, euid fields */ | 686 | rwlock_t lock; /* protects pid, uid, euid fields */ |
687 | int pid; /* pid or -pgrp where SIGIO should be sent */ | 687 | struct pid *pid; /* pid or -pgrp where SIGIO should be sent */ |
688 | enum pid_type pid_type; /* Kind of process group SIGIO should be sent to */ | ||
688 | uid_t uid, euid; /* uid/euid of process setting the owner */ | 689 | uid_t uid, euid; /* uid/euid of process setting the owner */ |
689 | int signum; /* posix.1b rt signal to be delivered on IO */ | 690 | int signum; /* posix.1b rt signal to be delivered on IO */ |
690 | }; | 691 | }; |
@@ -880,8 +881,10 @@ extern void kill_fasync(struct fasync_struct **, int, int); | |||
880 | /* only for net: no internal synchronization */ | 881 | /* only for net: no internal synchronization */ |
881 | extern void __kill_fasync(struct fasync_struct *, int, int); | 882 | extern void __kill_fasync(struct fasync_struct *, int, int); |
882 | 883 | ||
884 | extern int __f_setown(struct file *filp, struct pid *, enum pid_type, int force); | ||
883 | extern int f_setown(struct file *filp, unsigned long arg, int force); | 885 | extern int f_setown(struct file *filp, unsigned long arg, int force); |
884 | extern void f_delown(struct file *filp); | 886 | extern void f_delown(struct file *filp); |
887 | extern pid_t f_getown(struct file *filp); | ||
885 | extern int send_sigurg(struct fown_struct *fown); | 888 | extern int send_sigurg(struct fown_struct *fown); |
886 | 889 | ||
887 | /* | 890 | /* |
diff --git a/include/linux/genalloc.h b/include/linux/genalloc.h index 690c42803d2e..9869ef3674ac 100644 --- a/include/linux/genalloc.h +++ b/include/linux/genalloc.h | |||
@@ -31,5 +31,6 @@ struct gen_pool_chunk { | |||
31 | 31 | ||
32 | extern struct gen_pool *gen_pool_create(int, int); | 32 | extern struct gen_pool *gen_pool_create(int, int); |
33 | extern int gen_pool_add(struct gen_pool *, unsigned long, size_t, int); | 33 | extern int gen_pool_add(struct gen_pool *, unsigned long, size_t, int); |
34 | extern void gen_pool_destroy(struct gen_pool *); | ||
34 | extern unsigned long gen_pool_alloc(struct gen_pool *, size_t); | 35 | extern unsigned long gen_pool_alloc(struct gen_pool *, size_t); |
35 | extern void gen_pool_free(struct gen_pool *, unsigned long, size_t); | 36 | extern void gen_pool_free(struct gen_pool *, unsigned long, size_t); |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 60aac2cea0cf..33c5daacc743 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -4,7 +4,9 @@ | |||
4 | #include <linux/file.h> | 4 | #include <linux/file.h> |
5 | #include <linux/rcupdate.h> | 5 | #include <linux/rcupdate.h> |
6 | #include <linux/irqflags.h> | 6 | #include <linux/irqflags.h> |
7 | #include <linux/utsname.h> | ||
7 | #include <linux/lockdep.h> | 8 | #include <linux/lockdep.h> |
9 | #include <linux/ipc.h> | ||
8 | 10 | ||
9 | #define INIT_FDTABLE \ | 11 | #define INIT_FDTABLE \ |
10 | { \ | 12 | { \ |
@@ -68,6 +70,15 @@ | |||
68 | .session = 1, \ | 70 | .session = 1, \ |
69 | } | 71 | } |
70 | 72 | ||
73 | extern struct nsproxy init_nsproxy; | ||
74 | #define INIT_NSPROXY(nsproxy) { \ | ||
75 | .count = ATOMIC_INIT(1), \ | ||
76 | .nslock = SPIN_LOCK_UNLOCKED, \ | ||
77 | .uts_ns = &init_uts_ns, \ | ||
78 | .namespace = NULL, \ | ||
79 | INIT_IPC_NS(ipc_ns) \ | ||
80 | } | ||
81 | |||
71 | #define INIT_SIGHAND(sighand) { \ | 82 | #define INIT_SIGHAND(sighand) { \ |
72 | .count = ATOMIC_INIT(1), \ | 83 | .count = ATOMIC_INIT(1), \ |
73 | .action = { { { .sa_handler = NULL, } }, }, \ | 84 | .action = { { { .sa_handler = NULL, } }, }, \ |
@@ -117,6 +128,7 @@ extern struct group_info init_groups; | |||
117 | .files = &init_files, \ | 128 | .files = &init_files, \ |
118 | .signal = &init_signals, \ | 129 | .signal = &init_signals, \ |
119 | .sighand = &init_sighand, \ | 130 | .sighand = &init_sighand, \ |
131 | .nsproxy = &init_nsproxy, \ | ||
120 | .pending = { \ | 132 | .pending = { \ |
121 | .list = LIST_HEAD_INIT(tsk.pending.list), \ | 133 | .list = LIST_HEAD_INIT(tsk.pending.list), \ |
122 | .signal = {{0}}}, \ | 134 | .signal = {{0}}}, \ |
diff --git a/include/linux/input.h b/include/linux/input.h index b3253ab72ff7..5770105471dd 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -349,6 +349,9 @@ struct input_absinfo { | |||
349 | 349 | ||
350 | #define KEY_BATTERY 236 | 350 | #define KEY_BATTERY 236 |
351 | 351 | ||
352 | #define KEY_BLUETOOTH 237 | ||
353 | #define KEY_WLAN 238 | ||
354 | |||
352 | #define KEY_UNKNOWN 240 | 355 | #define KEY_UNKNOWN 240 |
353 | 356 | ||
354 | #define BTN_MISC 0x100 | 357 | #define BTN_MISC 0x100 |
@@ -645,6 +648,7 @@ struct input_absinfo { | |||
645 | #define BUS_USB 0x03 | 648 | #define BUS_USB 0x03 |
646 | #define BUS_HIL 0x04 | 649 | #define BUS_HIL 0x04 |
647 | #define BUS_BLUETOOTH 0x05 | 650 | #define BUS_BLUETOOTH 0x05 |
651 | #define BUS_VIRTUAL 0x06 | ||
648 | 652 | ||
649 | #define BUS_ISA 0x10 | 653 | #define BUS_ISA 0x10 |
650 | #define BUS_I8042 0x11 | 654 | #define BUS_I8042 0x11 |
@@ -667,98 +671,167 @@ struct input_absinfo { | |||
667 | 671 | ||
668 | /* | 672 | /* |
669 | * Structures used in ioctls to upload effects to a device | 673 | * Structures used in ioctls to upload effects to a device |
670 | * The first structures are not passed directly by using ioctls. | 674 | * They are pieces of a bigger structure (called ff_effect) |
671 | * They are sub-structures of the actually sent structure (called ff_effect) | 675 | */ |
676 | |||
677 | /* | ||
678 | * All duration values are expressed in ms. Values above 32767 ms (0x7fff) | ||
679 | * should not be used and have unspecified results. | ||
672 | */ | 680 | */ |
673 | 681 | ||
682 | /** | ||
683 | * struct ff_replay - defines scheduling of the effect | ||
684 | * @length: duration of the effect | ||
685 | * @delay: delay before effect should start playing | ||
686 | */ | ||
674 | struct ff_replay { | 687 | struct ff_replay { |
675 | __u16 length; /* Duration of an effect in ms. All other times are also expressed in ms */ | 688 | __u16 length; |
676 | __u16 delay; /* Time to wait before to start playing an effect */ | 689 | __u16 delay; |
677 | }; | 690 | }; |
678 | 691 | ||
692 | /** | ||
693 | * struct ff_trigger - defines what triggers the effect | ||
694 | * @button: number of the button triggering the effect | ||
695 | * @interval: controls how soon the effect can be re-triggered | ||
696 | */ | ||
679 | struct ff_trigger { | 697 | struct ff_trigger { |
680 | __u16 button; /* Number of button triggering an effect */ | 698 | __u16 button; |
681 | __u16 interval; /* Time to wait before an effect can be re-triggered (ms) */ | 699 | __u16 interval; |
682 | }; | 700 | }; |
683 | 701 | ||
702 | /** | ||
703 | * struct ff_envelope - generic effect envelope | ||
704 | * @attack_length: duration of the attack (ms) | ||
705 | * @attack_level: level at the beginning of the attack | ||
706 | * @fade_length: duration of fade (ms) | ||
707 | * @fade_level: level at the end of fade | ||
708 | * | ||
709 | * The @attack_level and @fade_level are absolute values; when applying | ||
710 | * envelope force-feedback core will convert to positive/negative | ||
711 | * value based on polarity of the default level of the effect. | ||
712 | * Valid range for the attack and fade levels is 0x0000 - 0x7fff | ||
713 | */ | ||
684 | struct ff_envelope { | 714 | struct ff_envelope { |
685 | __u16 attack_length; /* Duration of attack (ms) */ | 715 | __u16 attack_length; |
686 | __u16 attack_level; /* Level at beginning of attack */ | 716 | __u16 attack_level; |
687 | __u16 fade_length; /* Duration of fade (ms) */ | 717 | __u16 fade_length; |
688 | __u16 fade_level; /* Level at end of fade */ | 718 | __u16 fade_level; |
689 | }; | 719 | }; |
690 | 720 | ||
691 | /* FF_CONSTANT */ | 721 | /** |
722 | * struct ff_constant_effect - defines parameters of a constant effect | ||
723 | * @level: strength of the effect; may be negative | ||
724 | * @envelope: envelope data | ||
725 | */ | ||
692 | struct ff_constant_effect { | 726 | struct ff_constant_effect { |
693 | __s16 level; /* Strength of effect. Negative values are OK */ | 727 | __s16 level; |
694 | struct ff_envelope envelope; | 728 | struct ff_envelope envelope; |
695 | }; | 729 | }; |
696 | 730 | ||
697 | /* FF_RAMP */ | 731 | /** |
732 | * struct ff_ramp_effect - defines parameters of a ramp effect | ||
733 | * @start_level: beginning strength of the effect; may be negative | ||
734 | * @end_level: final strength of the effect; may be negative | ||
735 | * @envelope: envelope data | ||
736 | */ | ||
698 | struct ff_ramp_effect { | 737 | struct ff_ramp_effect { |
699 | __s16 start_level; | 738 | __s16 start_level; |
700 | __s16 end_level; | 739 | __s16 end_level; |
701 | struct ff_envelope envelope; | 740 | struct ff_envelope envelope; |
702 | }; | 741 | }; |
703 | 742 | ||
704 | /* FF_SPRING of FF_FRICTION */ | 743 | /** |
744 | * struct ff_condition_effect - defines a spring or friction effect | ||
745 | * @right_saturation: maximum level when joystick moved all way to the right | ||
746 | * @left_saturation: same for the left side | ||
747 | * @right_coeff: controls how fast the force grows when the joystick moves | ||
748 | * to the right | ||
749 | * @left_coeff: same for the left side | ||
750 | * @deadband: size of the dead zone, where no force is produced | ||
751 | * @center: position of the dead zone | ||
752 | */ | ||
705 | struct ff_condition_effect { | 753 | struct ff_condition_effect { |
706 | __u16 right_saturation; /* Max level when joystick is on the right */ | 754 | __u16 right_saturation; |
707 | __u16 left_saturation; /* Max level when joystick in on the left */ | 755 | __u16 left_saturation; |
708 | |||
709 | __s16 right_coeff; /* Indicates how fast the force grows when the | ||
710 | joystick moves to the right */ | ||
711 | __s16 left_coeff; /* Same for left side */ | ||
712 | 756 | ||
713 | __u16 deadband; /* Size of area where no force is produced */ | 757 | __s16 right_coeff; |
714 | __s16 center; /* Position of dead zone */ | 758 | __s16 left_coeff; |
715 | 759 | ||
760 | __u16 deadband; | ||
761 | __s16 center; | ||
716 | }; | 762 | }; |
717 | 763 | ||
718 | /* FF_PERIODIC */ | 764 | /** |
765 | * struct ff_periodic_effect - defines parameters of a periodic effect | ||
766 | * @waveform: kind of the effect (wave) | ||
767 | * @period: period of the wave (ms) | ||
768 | * @magnitude: peak value | ||
769 | * @offset: mean value of the wave (roughly) | ||
770 | * @phase: 'horizontal' shift | ||
771 | * @envelope: envelope data | ||
772 | * @custom_len: number of samples (FF_CUSTOM only) | ||
773 | * @custom_data: buffer of samples (FF_CUSTOM only) | ||
774 | * | ||
775 | * Known waveforms - FF_SQUARE, FF_TRIANGLE, FF_SINE, FF_SAW_UP, | ||
776 | * FF_SAW_DOWN, FF_CUSTOM. The exact syntax FF_CUSTOM is undefined | ||
777 | * for the time being as no driver supports it yet. | ||
778 | * | ||
779 | * Note: the data pointed by custom_data is copied by the driver. | ||
780 | * You can therefore dispose of the memory after the upload/update. | ||
781 | */ | ||
719 | struct ff_periodic_effect { | 782 | struct ff_periodic_effect { |
720 | __u16 waveform; /* Kind of wave (sine, square...) */ | 783 | __u16 waveform; |
721 | __u16 period; /* in ms */ | 784 | __u16 period; |
722 | __s16 magnitude; /* Peak value */ | 785 | __s16 magnitude; |
723 | __s16 offset; /* Mean value of wave (roughly) */ | 786 | __s16 offset; |
724 | __u16 phase; /* 'Horizontal' shift */ | 787 | __u16 phase; |
725 | 788 | ||
726 | struct ff_envelope envelope; | 789 | struct ff_envelope envelope; |
727 | 790 | ||
728 | /* Only used if waveform == FF_CUSTOM */ | 791 | __u32 custom_len; |
729 | __u32 custom_len; /* Number of samples */ | 792 | __s16 *custom_data; |
730 | __s16 *custom_data; /* Buffer of samples */ | ||
731 | /* Note: the data pointed by custom_data is copied by the driver. You can | ||
732 | * therefore dispose of the memory after the upload/update */ | ||
733 | }; | 793 | }; |
734 | 794 | ||
735 | /* FF_RUMBLE */ | 795 | /** |
736 | /* Some rumble pads have two motors of different weight. | 796 | * struct ff_rumble_effect - defines parameters of a periodic effect |
737 | strong_magnitude represents the magnitude of the vibration generated | 797 | * @strong_magnitude: magnitude of the heavy motor |
738 | by the heavy motor. | 798 | * @weak_magnitude: magnitude of the light one |
739 | */ | 799 | * |
800 | * Some rumble pads have two motors of different weight. Strong_magnitude | ||
801 | * represents the magnitude of the vibration generated by the heavy one. | ||
802 | */ | ||
740 | struct ff_rumble_effect { | 803 | struct ff_rumble_effect { |
741 | __u16 strong_magnitude; /* Magnitude of the heavy motor */ | 804 | __u16 strong_magnitude; |
742 | __u16 weak_magnitude; /* Magnitude of the light one */ | 805 | __u16 weak_magnitude; |
743 | }; | 806 | }; |
744 | 807 | ||
745 | /* | 808 | /** |
746 | * Structure sent through ioctl from the application to the driver | 809 | * struct ff_effect - defines force feedback effect |
810 | * @type: type of the effect (FF_CONSTANT, FF_PERIODIC, FF_RAMP, FF_SPRING, | ||
811 | * FF_FRICTION, FF_DAMPER, FF_RUMBLE, FF_INERTIA, or FF_CUSTOM) | ||
812 | * @id: an unique id assigned to an effect | ||
813 | * @direction: direction of the effect | ||
814 | * @trigger: trigger conditions (struct ff_trigger) | ||
815 | * @replay: scheduling of the effect (struct ff_replay) | ||
816 | * @u: effect-specific structure (one of ff_constant_effect, ff_ramp_effect, | ||
817 | * ff_periodic_effect, ff_condition_effect, ff_rumble_effect) further | ||
818 | * defining effect parameters | ||
819 | * | ||
820 | * This structure is sent through ioctl from the application to the driver. | ||
821 | * To create a new effect aplication should set its @id to -1; the kernel | ||
822 | * will return assigned @id which can later be used to update or delete | ||
823 | * this effect. | ||
824 | * | ||
825 | * Direction of the effect is encoded as follows: | ||
826 | * 0 deg -> 0x0000 (down) | ||
827 | * 90 deg -> 0x4000 (left) | ||
828 | * 180 deg -> 0x8000 (up) | ||
829 | * 270 deg -> 0xC000 (right) | ||
747 | */ | 830 | */ |
748 | struct ff_effect { | 831 | struct ff_effect { |
749 | __u16 type; | 832 | __u16 type; |
750 | /* Following field denotes the unique id assigned to an effect. | ||
751 | * If user sets if to -1, a new effect is created, and its id is returned in the same field | ||
752 | * Else, the user sets it to the effect id it wants to update. | ||
753 | */ | ||
754 | __s16 id; | 833 | __s16 id; |
755 | 834 | __u16 direction; | |
756 | __u16 direction; /* Direction. 0 deg -> 0x0000 (down) | ||
757 | 90 deg -> 0x4000 (left) | ||
758 | 180 deg -> 0x8000 (up) | ||
759 | 270 deg -> 0xC000 (right) | ||
760 | */ | ||
761 | |||
762 | struct ff_trigger trigger; | 835 | struct ff_trigger trigger; |
763 | struct ff_replay replay; | 836 | struct ff_replay replay; |
764 | 837 | ||
@@ -784,6 +857,9 @@ struct ff_effect { | |||
784 | #define FF_INERTIA 0x56 | 857 | #define FF_INERTIA 0x56 |
785 | #define FF_RAMP 0x57 | 858 | #define FF_RAMP 0x57 |
786 | 859 | ||
860 | #define FF_EFFECT_MIN FF_RUMBLE | ||
861 | #define FF_EFFECT_MAX FF_RAMP | ||
862 | |||
787 | /* | 863 | /* |
788 | * Force feedback periodic effect types | 864 | * Force feedback periodic effect types |
789 | */ | 865 | */ |
@@ -795,6 +871,9 @@ struct ff_effect { | |||
795 | #define FF_SAW_DOWN 0x5c | 871 | #define FF_SAW_DOWN 0x5c |
796 | #define FF_CUSTOM 0x5d | 872 | #define FF_CUSTOM 0x5d |
797 | 873 | ||
874 | #define FF_WAVEFORM_MIN FF_SQUARE | ||
875 | #define FF_WAVEFORM_MAX FF_CUSTOM | ||
876 | |||
798 | /* | 877 | /* |
799 | * Set ff device properties | 878 | * Set ff device properties |
800 | */ | 879 | */ |
@@ -864,12 +943,13 @@ struct input_dev { | |||
864 | unsigned long sndbit[NBITS(SND_MAX)]; | 943 | unsigned long sndbit[NBITS(SND_MAX)]; |
865 | unsigned long ffbit[NBITS(FF_MAX)]; | 944 | unsigned long ffbit[NBITS(FF_MAX)]; |
866 | unsigned long swbit[NBITS(SW_MAX)]; | 945 | unsigned long swbit[NBITS(SW_MAX)]; |
867 | int ff_effects_max; | ||
868 | 946 | ||
869 | unsigned int keycodemax; | 947 | unsigned int keycodemax; |
870 | unsigned int keycodesize; | 948 | unsigned int keycodesize; |
871 | void *keycode; | 949 | void *keycode; |
872 | 950 | ||
951 | struct ff_device *ff; | ||
952 | |||
873 | unsigned int repeat_key; | 953 | unsigned int repeat_key; |
874 | struct timer_list timer; | 954 | struct timer_list timer; |
875 | 955 | ||
@@ -895,8 +975,6 @@ struct input_dev { | |||
895 | void (*close)(struct input_dev *dev); | 975 | void (*close)(struct input_dev *dev); |
896 | int (*flush)(struct input_dev *dev, struct file *file); | 976 | int (*flush)(struct input_dev *dev, struct file *file); |
897 | int (*event)(struct input_dev *dev, unsigned int type, unsigned int code, int value); | 977 | int (*event)(struct input_dev *dev, unsigned int type, unsigned int code, int value); |
898 | int (*upload_effect)(struct input_dev *dev, struct ff_effect *effect); | ||
899 | int (*erase_effect)(struct input_dev *dev, int effect_id); | ||
900 | 978 | ||
901 | struct input_handle *grab; | 979 | struct input_handle *grab; |
902 | 980 | ||
@@ -904,9 +982,6 @@ struct input_dev { | |||
904 | unsigned int users; | 982 | unsigned int users; |
905 | 983 | ||
906 | struct class_device cdev; | 984 | struct class_device cdev; |
907 | struct device *dev; /* will be removed soon */ | ||
908 | |||
909 | int dynalloc; /* temporarily */ | ||
910 | 985 | ||
911 | struct list_head h_list; | 986 | struct list_head h_list; |
912 | struct list_head node; | 987 | struct list_head node; |
@@ -985,16 +1060,16 @@ struct input_handler { | |||
985 | void *private; | 1060 | void *private; |
986 | 1061 | ||
987 | void (*event)(struct input_handle *handle, unsigned int type, unsigned int code, int value); | 1062 | void (*event)(struct input_handle *handle, unsigned int type, unsigned int code, int value); |
988 | struct input_handle* (*connect)(struct input_handler *handler, struct input_dev *dev, struct input_device_id *id); | 1063 | struct input_handle* (*connect)(struct input_handler *handler, struct input_dev *dev, const struct input_device_id *id); |
989 | void (*disconnect)(struct input_handle *handle); | 1064 | void (*disconnect)(struct input_handle *handle); |
990 | void (*start)(struct input_handle *handle); | 1065 | void (*start)(struct input_handle *handle); |
991 | 1066 | ||
992 | const struct file_operations *fops; | 1067 | const struct file_operations *fops; |
993 | int minor; | 1068 | int minor; |
994 | char *name; | 1069 | const char *name; |
995 | 1070 | ||
996 | struct input_device_id *id_table; | 1071 | const struct input_device_id *id_table; |
997 | struct input_device_id *blacklist; | 1072 | const struct input_device_id *blacklist; |
998 | 1073 | ||
999 | struct list_head h_list; | 1074 | struct list_head h_list; |
1000 | struct list_head node; | 1075 | struct list_head node; |
@@ -1005,7 +1080,7 @@ struct input_handle { | |||
1005 | void *private; | 1080 | void *private; |
1006 | 1081 | ||
1007 | int open; | 1082 | int open; |
1008 | char *name; | 1083 | const char *name; |
1009 | 1084 | ||
1010 | struct input_dev *dev; | 1085 | struct input_dev *dev; |
1011 | struct input_handler *handler; | 1086 | struct input_handler *handler; |
@@ -1019,12 +1094,6 @@ struct input_handle { | |||
1019 | #define to_handle(n) container_of(n,struct input_handle,d_node) | 1094 | #define to_handle(n) container_of(n,struct input_handle,d_node) |
1020 | #define to_handle_h(n) container_of(n,struct input_handle,h_node) | 1095 | #define to_handle_h(n) container_of(n,struct input_handle,h_node) |
1021 | 1096 | ||
1022 | static inline void init_input_dev(struct input_dev *dev) | ||
1023 | { | ||
1024 | INIT_LIST_HEAD(&dev->h_list); | ||
1025 | INIT_LIST_HEAD(&dev->node); | ||
1026 | } | ||
1027 | |||
1028 | struct input_dev *input_allocate_device(void); | 1097 | struct input_dev *input_allocate_device(void); |
1029 | void input_free_device(struct input_dev *dev); | 1098 | void input_free_device(struct input_dev *dev); |
1030 | 1099 | ||
@@ -1041,7 +1110,7 @@ static inline void input_put_device(struct input_dev *dev) | |||
1041 | int input_register_device(struct input_dev *); | 1110 | int input_register_device(struct input_dev *); |
1042 | void input_unregister_device(struct input_dev *); | 1111 | void input_unregister_device(struct input_dev *); |
1043 | 1112 | ||
1044 | void input_register_handler(struct input_handler *); | 1113 | int input_register_handler(struct input_handler *); |
1045 | void input_unregister_handler(struct input_handler *); | 1114 | void input_unregister_handler(struct input_handler *); |
1046 | 1115 | ||
1047 | int input_grab_device(struct input_handle *); | 1116 | int input_grab_device(struct input_handle *); |
@@ -1070,11 +1139,6 @@ static inline void input_report_abs(struct input_dev *dev, unsigned int code, in | |||
1070 | input_event(dev, EV_ABS, code, value); | 1139 | input_event(dev, EV_ABS, code, value); |
1071 | } | 1140 | } |
1072 | 1141 | ||
1073 | static inline void input_report_ff(struct input_dev *dev, unsigned int code, int value) | ||
1074 | { | ||
1075 | input_event(dev, EV_FF, code, value); | ||
1076 | } | ||
1077 | |||
1078 | static inline void input_report_ff_status(struct input_dev *dev, unsigned int code, int value) | 1142 | static inline void input_report_ff_status(struct input_dev *dev, unsigned int code, int value) |
1079 | { | 1143 | { |
1080 | input_event(dev, EV_FF_STATUS, code, value); | 1144 | input_event(dev, EV_FF_STATUS, code, value); |
@@ -1108,5 +1172,61 @@ static inline void input_set_abs_params(struct input_dev *dev, int axis, int min | |||
1108 | 1172 | ||
1109 | extern struct class input_class; | 1173 | extern struct class input_class; |
1110 | 1174 | ||
1175 | /** | ||
1176 | * struct ff_device - force-feedback part of an input device | ||
1177 | * @upload: Called to upload an new effect into device | ||
1178 | * @erase: Called to erase an effect from device | ||
1179 | * @playback: Called to request device to start playing specified effect | ||
1180 | * @set_gain: Called to set specified gain | ||
1181 | * @set_autocenter: Called to auto-center device | ||
1182 | * @destroy: called by input core when parent input device is being | ||
1183 | * destroyed | ||
1184 | * @private: driver-specific data, will be freed automatically | ||
1185 | * @ffbit: bitmap of force feedback capabilities truly supported by | ||
1186 | * device (not emulated like ones in input_dev->ffbit) | ||
1187 | * @mutex: mutex for serializing access to the device | ||
1188 | * @max_effects: maximum number of effects supported by device | ||
1189 | * @effects: pointer to an array of effects currently loaded into device | ||
1190 | * @effect_owners: array of effect owners; when file handle owning | ||
1191 | * an effect gets closed the effcet is automatically erased | ||
1192 | * | ||
1193 | * Every force-feedback device must implement upload() and playback() | ||
1194 | * methods; erase() is optional. set_gain() and set_autocenter() need | ||
1195 | * only be implemented if driver sets up FF_GAIN and FF_AUTOCENTER | ||
1196 | * bits. | ||
1197 | */ | ||
1198 | struct ff_device { | ||
1199 | int (*upload)(struct input_dev *dev, struct ff_effect *effect, | ||
1200 | struct ff_effect *old); | ||
1201 | int (*erase)(struct input_dev *dev, int effect_id); | ||
1202 | |||
1203 | int (*playback)(struct input_dev *dev, int effect_id, int value); | ||
1204 | void (*set_gain)(struct input_dev *dev, u16 gain); | ||
1205 | void (*set_autocenter)(struct input_dev *dev, u16 magnitude); | ||
1206 | |||
1207 | void (*destroy)(struct ff_device *); | ||
1208 | |||
1209 | void *private; | ||
1210 | |||
1211 | unsigned long ffbit[NBITS(FF_MAX)]; | ||
1212 | |||
1213 | struct mutex mutex; | ||
1214 | |||
1215 | int max_effects; | ||
1216 | struct ff_effect *effects; | ||
1217 | struct file *effect_owners[]; | ||
1218 | }; | ||
1219 | |||
1220 | int input_ff_create(struct input_dev *dev, int max_effects); | ||
1221 | void input_ff_destroy(struct input_dev *dev); | ||
1222 | |||
1223 | int input_ff_event(struct input_dev *dev, unsigned int type, unsigned int code, int value); | ||
1224 | |||
1225 | int input_ff_upload(struct input_dev *dev, struct ff_effect *effect, struct file *file); | ||
1226 | int input_ff_erase(struct input_dev *dev, int effect_id, struct file *file); | ||
1227 | |||
1228 | int input_ff_create_memless(struct input_dev *dev, void *data, | ||
1229 | int (*play_effect)(struct input_dev *, void *, struct ff_effect *)); | ||
1230 | |||
1111 | #endif | 1231 | #endif |
1112 | #endif | 1232 | #endif |
diff --git a/include/linux/ipc.h b/include/linux/ipc.h index b291189737e7..d9e2b3f36c35 100644 --- a/include/linux/ipc.h +++ b/include/linux/ipc.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _LINUX_IPC_H | 2 | #define _LINUX_IPC_H |
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/kref.h> | ||
5 | 6 | ||
6 | #define IPC_PRIVATE ((__kernel_key_t) 0) | 7 | #define IPC_PRIVATE ((__kernel_key_t) 0) |
7 | 8 | ||
@@ -68,6 +69,59 @@ struct kern_ipc_perm | |||
68 | void *security; | 69 | void *security; |
69 | }; | 70 | }; |
70 | 71 | ||
72 | struct ipc_ids; | ||
73 | struct ipc_namespace { | ||
74 | struct kref kref; | ||
75 | struct ipc_ids *ids[3]; | ||
76 | |||
77 | int sem_ctls[4]; | ||
78 | int used_sems; | ||
79 | |||
80 | int msg_ctlmax; | ||
81 | int msg_ctlmnb; | ||
82 | int msg_ctlmni; | ||
83 | |||
84 | size_t shm_ctlmax; | ||
85 | size_t shm_ctlall; | ||
86 | int shm_ctlmni; | ||
87 | int shm_tot; | ||
88 | }; | ||
89 | |||
90 | extern struct ipc_namespace init_ipc_ns; | ||
91 | |||
92 | #ifdef CONFIG_SYSVIPC | ||
93 | #define INIT_IPC_NS(ns) .ns = &init_ipc_ns, | ||
94 | #else | ||
95 | #define INIT_IPC_NS(ns) | ||
96 | #endif | ||
97 | |||
98 | #ifdef CONFIG_IPC_NS | ||
99 | extern void free_ipc_ns(struct kref *kref); | ||
100 | extern int copy_ipcs(unsigned long flags, struct task_struct *tsk); | ||
101 | extern int unshare_ipcs(unsigned long flags, struct ipc_namespace **ns); | ||
102 | #else | ||
103 | static inline int copy_ipcs(unsigned long flags, struct task_struct *tsk) | ||
104 | { | ||
105 | return 0; | ||
106 | } | ||
107 | #endif | ||
108 | |||
109 | static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) | ||
110 | { | ||
111 | #ifdef CONFIG_IPC_NS | ||
112 | if (ns) | ||
113 | kref_get(&ns->kref); | ||
114 | #endif | ||
115 | return ns; | ||
116 | } | ||
117 | |||
118 | static inline void put_ipc_ns(struct ipc_namespace *ns) | ||
119 | { | ||
120 | #ifdef CONFIG_IPC_NS | ||
121 | kref_put(&ns->kref, free_ipc_ns); | ||
122 | #endif | ||
123 | } | ||
124 | |||
71 | #endif /* __KERNEL__ */ | 125 | #endif /* __KERNEL__ */ |
72 | 126 | ||
73 | #endif /* _LINUX_IPC_H */ | 127 | #endif /* _LINUX_IPC_H */ |
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index 8bf6702da2a0..ac4c0559f751 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h | |||
@@ -77,6 +77,12 @@ struct kprobe { | |||
77 | /* location of the probe point */ | 77 | /* location of the probe point */ |
78 | kprobe_opcode_t *addr; | 78 | kprobe_opcode_t *addr; |
79 | 79 | ||
80 | /* Allow user to indicate symbol name of the probe point */ | ||
81 | char *symbol_name; | ||
82 | |||
83 | /* Offset into the symbol */ | ||
84 | unsigned int offset; | ||
85 | |||
80 | /* Called before addr is executed. */ | 86 | /* Called before addr is executed. */ |
81 | kprobe_pre_handler_t pre_handler; | 87 | kprobe_pre_handler_t pre_handler; |
82 | 88 | ||
@@ -196,7 +202,7 @@ void unregister_kretprobe(struct kretprobe *rp); | |||
196 | struct kretprobe_instance *get_free_rp_inst(struct kretprobe *rp); | 202 | struct kretprobe_instance *get_free_rp_inst(struct kretprobe *rp); |
197 | void add_rp_inst(struct kretprobe_instance *ri); | 203 | void add_rp_inst(struct kretprobe_instance *ri); |
198 | void kprobe_flush_task(struct task_struct *tk); | 204 | void kprobe_flush_task(struct task_struct *tk); |
199 | void recycle_rp_inst(struct kretprobe_instance *ri); | 205 | void recycle_rp_inst(struct kretprobe_instance *ri, struct hlist_head *head); |
200 | #else /* CONFIG_KPROBES */ | 206 | #else /* CONFIG_KPROBES */ |
201 | 207 | ||
202 | #define __kprobes /**/ | 208 | #define __kprobes /**/ |
diff --git a/include/linux/libps2.h b/include/linux/libps2.h index 08a450a9dbf7..f6f301e2b0f5 100644 --- a/include/linux/libps2.h +++ b/include/linux/libps2.h | |||
@@ -47,5 +47,6 @@ int ps2_schedule_command(struct ps2dev *ps2dev, unsigned char *param, int comman | |||
47 | int ps2_handle_ack(struct ps2dev *ps2dev, unsigned char data); | 47 | int ps2_handle_ack(struct ps2dev *ps2dev, unsigned char data); |
48 | int ps2_handle_response(struct ps2dev *ps2dev, unsigned char data); | 48 | int ps2_handle_response(struct ps2dev *ps2dev, unsigned char data); |
49 | void ps2_cmd_aborted(struct ps2dev *ps2dev); | 49 | void ps2_cmd_aborted(struct ps2dev *ps2dev); |
50 | int ps2_is_keyboard_id(char id); | ||
50 | 51 | ||
51 | #endif /* _LIBPS2_H */ | 52 | #endif /* _LIBPS2_H */ |
diff --git a/include/linux/lockd/bind.h b/include/linux/lockd/bind.h index b054debef2e0..81e3a185f951 100644 --- a/include/linux/lockd/bind.h +++ b/include/linux/lockd/bind.h | |||
@@ -30,7 +30,7 @@ extern struct nlmsvc_binding * nlmsvc_ops; | |||
30 | * Functions exported by the lockd module | 30 | * Functions exported by the lockd module |
31 | */ | 31 | */ |
32 | extern int nlmclnt_proc(struct inode *, int, struct file_lock *); | 32 | extern int nlmclnt_proc(struct inode *, int, struct file_lock *); |
33 | extern int lockd_up(void); | 33 | extern int lockd_up(int proto); |
34 | extern void lockd_down(void); | 34 | extern void lockd_down(void); |
35 | 35 | ||
36 | #endif /* LINUX_LOCKD_BIND_H */ | 36 | #endif /* LINUX_LOCKD_BIND_H */ |
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index 0d92c468d55a..47b7dbd647a6 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h | |||
@@ -80,7 +80,7 @@ struct nlm_wait; | |||
80 | /* | 80 | /* |
81 | * Memory chunk for NLM client RPC request. | 81 | * Memory chunk for NLM client RPC request. |
82 | */ | 82 | */ |
83 | #define NLMCLNT_OHSIZE (sizeof(system_utsname.nodename)+10) | 83 | #define NLMCLNT_OHSIZE (sizeof(utsname()->nodename)+10) |
84 | struct nlm_rqst { | 84 | struct nlm_rqst { |
85 | unsigned int a_flags; /* initial RPC task flags */ | 85 | unsigned int a_flags; /* initial RPC task flags */ |
86 | struct nlm_host * a_host; /* host handle */ | 86 | struct nlm_host * a_host; /* host handle */ |
diff --git a/include/linux/module.h b/include/linux/module.h index 2c599175c583..4b2d8091a410 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -320,6 +320,8 @@ struct module | |||
320 | /* Am I GPL-compatible */ | 320 | /* Am I GPL-compatible */ |
321 | int license_gplok; | 321 | int license_gplok; |
322 | 322 | ||
323 | unsigned int taints; /* same bits as kernel:tainted */ | ||
324 | |||
323 | #ifdef CONFIG_MODULE_UNLOAD | 325 | #ifdef CONFIG_MODULE_UNLOAD |
324 | /* Reference counts */ | 326 | /* Reference counts */ |
325 | struct module_ref ref[NR_CPUS]; | 327 | struct module_ref ref[NR_CPUS]; |
diff --git a/include/linux/namespace.h b/include/linux/namespace.h index 3abc8e3b4879..d137009f0b2b 100644 --- a/include/linux/namespace.h +++ b/include/linux/namespace.h | |||
@@ -4,6 +4,7 @@ | |||
4 | 4 | ||
5 | #include <linux/mount.h> | 5 | #include <linux/mount.h> |
6 | #include <linux/sched.h> | 6 | #include <linux/sched.h> |
7 | #include <linux/nsproxy.h> | ||
7 | 8 | ||
8 | struct namespace { | 9 | struct namespace { |
9 | atomic_t count; | 10 | atomic_t count; |
@@ -26,11 +27,8 @@ static inline void put_namespace(struct namespace *namespace) | |||
26 | 27 | ||
27 | static inline void exit_namespace(struct task_struct *p) | 28 | static inline void exit_namespace(struct task_struct *p) |
28 | { | 29 | { |
29 | struct namespace *namespace = p->namespace; | 30 | struct namespace *namespace = p->nsproxy->namespace; |
30 | if (namespace) { | 31 | if (namespace) { |
31 | task_lock(p); | ||
32 | p->namespace = NULL; | ||
33 | task_unlock(p); | ||
34 | put_namespace(namespace); | 32 | put_namespace(namespace); |
35 | } | 33 | } |
36 | } | 34 | } |
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h index 2dcad295fece..e1dbc86c270b 100644 --- a/include/linux/nfsd/nfsd.h +++ b/include/linux/nfsd/nfsd.h | |||
@@ -140,6 +140,11 @@ struct posix_acl *nfsd_get_posix_acl(struct svc_fh *, int); | |||
140 | int nfsd_set_posix_acl(struct svc_fh *, int, struct posix_acl *); | 140 | int nfsd_set_posix_acl(struct svc_fh *, int, struct posix_acl *); |
141 | #endif | 141 | #endif |
142 | 142 | ||
143 | enum vers_op {NFSD_SET, NFSD_CLEAR, NFSD_TEST, NFSD_AVAIL }; | ||
144 | int nfsd_vers(int vers, enum vers_op change); | ||
145 | void nfsd_reset_versions(void); | ||
146 | int nfsd_create_serv(void); | ||
147 | |||
143 | 148 | ||
144 | /* | 149 | /* |
145 | * NFSv4 State | 150 | * NFSv4 State |
diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h index 31a3cb617ce0..069257ea99a0 100644 --- a/include/linux/nfsd/nfsfh.h +++ b/include/linux/nfsd/nfsfh.h | |||
@@ -290,8 +290,9 @@ fill_post_wcc(struct svc_fh *fhp) | |||
290 | * vfs.c:nfsd_rename as it needs to grab 2 i_mutex's at once | 290 | * vfs.c:nfsd_rename as it needs to grab 2 i_mutex's at once |
291 | * so, any changes here should be reflected there. | 291 | * so, any changes here should be reflected there. |
292 | */ | 292 | */ |
293 | |||
293 | static inline void | 294 | static inline void |
294 | fh_lock(struct svc_fh *fhp) | 295 | fh_lock_nested(struct svc_fh *fhp, unsigned int subclass) |
295 | { | 296 | { |
296 | struct dentry *dentry = fhp->fh_dentry; | 297 | struct dentry *dentry = fhp->fh_dentry; |
297 | struct inode *inode; | 298 | struct inode *inode; |
@@ -310,11 +311,17 @@ fh_lock(struct svc_fh *fhp) | |||
310 | } | 311 | } |
311 | 312 | ||
312 | inode = dentry->d_inode; | 313 | inode = dentry->d_inode; |
313 | mutex_lock(&inode->i_mutex); | 314 | mutex_lock_nested(&inode->i_mutex, subclass); |
314 | fill_pre_wcc(fhp); | 315 | fill_pre_wcc(fhp); |
315 | fhp->fh_locked = 1; | 316 | fhp->fh_locked = 1; |
316 | } | 317 | } |
317 | 318 | ||
319 | static inline void | ||
320 | fh_lock(struct svc_fh *fhp) | ||
321 | { | ||
322 | fh_lock_nested(fhp, I_MUTEX_NORMAL); | ||
323 | } | ||
324 | |||
318 | /* | 325 | /* |
319 | * Unlock a file handle/inode | 326 | * Unlock a file handle/inode |
320 | */ | 327 | */ |
diff --git a/include/linux/nfsd/syscall.h b/include/linux/nfsd/syscall.h index dae0faea2807..8bcddccb6c42 100644 --- a/include/linux/nfsd/syscall.h +++ b/include/linux/nfsd/syscall.h | |||
@@ -38,21 +38,6 @@ | |||
38 | #define NFSCTL_GETFD 7 /* get an fh by path (used by mountd) */ | 38 | #define NFSCTL_GETFD 7 /* get an fh by path (used by mountd) */ |
39 | #define NFSCTL_GETFS 8 /* get an fh by path with max FH len */ | 39 | #define NFSCTL_GETFS 8 /* get an fh by path with max FH len */ |
40 | 40 | ||
41 | /* | ||
42 | * Macros used to set version | ||
43 | */ | ||
44 | #define NFSCTL_VERSET(_cltbits, _v) ((_cltbits) |= (1 << (_v))) | ||
45 | #define NFSCTL_VERUNSET(_cltbits, _v) ((_cltbits) &= ~(1 << (_v))) | ||
46 | #define NFSCTL_VERISSET(_cltbits, _v) ((_cltbits) & (1 << (_v))) | ||
47 | |||
48 | #if defined(CONFIG_NFSD_V4) | ||
49 | #define NFSCTL_VERALL (0x1c /* 0b011100 */) | ||
50 | #elif defined(CONFIG_NFSD_V3) | ||
51 | #define NFSCTL_VERALL (0x0c /* 0b001100 */) | ||
52 | #else | ||
53 | #define NFSCTL_VERALL (0x04 /* 0b000100 */) | ||
54 | #endif | ||
55 | |||
56 | /* SVC */ | 41 | /* SVC */ |
57 | struct nfsctl_svc { | 42 | struct nfsctl_svc { |
58 | unsigned short svc_port; | 43 | unsigned short svc_port; |
@@ -134,8 +119,6 @@ extern int exp_delclient(struct nfsctl_client *ncp); | |||
134 | extern int exp_export(struct nfsctl_export *nxp); | 119 | extern int exp_export(struct nfsctl_export *nxp); |
135 | extern int exp_unexport(struct nfsctl_export *nxp); | 120 | extern int exp_unexport(struct nfsctl_export *nxp); |
136 | 121 | ||
137 | extern unsigned int nfsd_versbits; | ||
138 | |||
139 | #endif /* __KERNEL__ */ | 122 | #endif /* __KERNEL__ */ |
140 | 123 | ||
141 | #endif /* NFSD_SYSCALL_H */ | 124 | #endif /* NFSD_SYSCALL_H */ |
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h index 1a9ef3e627d1..5dce5c21822c 100644 --- a/include/linux/nodemask.h +++ b/include/linux/nodemask.h | |||
@@ -352,6 +352,7 @@ extern nodemask_t node_possible_map; | |||
352 | #define node_possible(node) node_isset((node), node_possible_map) | 352 | #define node_possible(node) node_isset((node), node_possible_map) |
353 | #define first_online_node first_node(node_online_map) | 353 | #define first_online_node first_node(node_online_map) |
354 | #define next_online_node(nid) next_node((nid), node_online_map) | 354 | #define next_online_node(nid) next_node((nid), node_online_map) |
355 | int highest_possible_node_id(void); | ||
355 | #else | 356 | #else |
356 | #define num_online_nodes() 1 | 357 | #define num_online_nodes() 1 |
357 | #define num_possible_nodes() 1 | 358 | #define num_possible_nodes() 1 |
@@ -359,6 +360,7 @@ extern nodemask_t node_possible_map; | |||
359 | #define node_possible(node) ((node) == 0) | 360 | #define node_possible(node) ((node) == 0) |
360 | #define first_online_node 0 | 361 | #define first_online_node 0 |
361 | #define next_online_node(nid) (MAX_NUMNODES) | 362 | #define next_online_node(nid) (MAX_NUMNODES) |
363 | #define highest_possible_node_id() 0 | ||
362 | #endif | 364 | #endif |
363 | 365 | ||
364 | #define any_online_node(mask) \ | 366 | #define any_online_node(mask) \ |
diff --git a/include/linux/nsproxy.h b/include/linux/nsproxy.h new file mode 100644 index 000000000000..f6baecdeecd6 --- /dev/null +++ b/include/linux/nsproxy.h | |||
@@ -0,0 +1,52 @@ | |||
1 | #ifndef _LINUX_NSPROXY_H | ||
2 | #define _LINUX_NSPROXY_H | ||
3 | |||
4 | #include <linux/spinlock.h> | ||
5 | #include <linux/sched.h> | ||
6 | |||
7 | struct namespace; | ||
8 | struct uts_namespace; | ||
9 | struct ipc_namespace; | ||
10 | |||
11 | /* | ||
12 | * A structure to contain pointers to all per-process | ||
13 | * namespaces - fs (mount), uts, network, sysvipc, etc. | ||
14 | * | ||
15 | * 'count' is the number of tasks holding a reference. | ||
16 | * The count for each namespace, then, will be the number | ||
17 | * of nsproxies pointing to it, not the number of tasks. | ||
18 | * | ||
19 | * The nsproxy is shared by tasks which share all namespaces. | ||
20 | * As soon as a single namespace is cloned or unshared, the | ||
21 | * nsproxy is copied. | ||
22 | */ | ||
23 | struct nsproxy { | ||
24 | atomic_t count; | ||
25 | spinlock_t nslock; | ||
26 | struct uts_namespace *uts_ns; | ||
27 | struct ipc_namespace *ipc_ns; | ||
28 | struct namespace *namespace; | ||
29 | }; | ||
30 | extern struct nsproxy init_nsproxy; | ||
31 | |||
32 | struct nsproxy *dup_namespaces(struct nsproxy *orig); | ||
33 | int copy_namespaces(int flags, struct task_struct *tsk); | ||
34 | void get_task_namespaces(struct task_struct *tsk); | ||
35 | void free_nsproxy(struct nsproxy *ns); | ||
36 | |||
37 | static inline void put_nsproxy(struct nsproxy *ns) | ||
38 | { | ||
39 | if (atomic_dec_and_test(&ns->count)) { | ||
40 | free_nsproxy(ns); | ||
41 | } | ||
42 | } | ||
43 | |||
44 | static inline void exit_task_namespaces(struct task_struct *p) | ||
45 | { | ||
46 | struct nsproxy *ns = p->nsproxy; | ||
47 | if (ns) { | ||
48 | put_nsproxy(ns); | ||
49 | p->nsproxy = NULL; | ||
50 | } | ||
51 | } | ||
52 | #endif | ||
diff --git a/include/linux/pid.h b/include/linux/pid.h index 93da7e2d9f30..17b9e04d3586 100644 --- a/include/linux/pid.h +++ b/include/linux/pid.h | |||
@@ -68,6 +68,8 @@ extern struct task_struct *FASTCALL(pid_task(struct pid *pid, enum pid_type)); | |||
68 | extern struct task_struct *FASTCALL(get_pid_task(struct pid *pid, | 68 | extern struct task_struct *FASTCALL(get_pid_task(struct pid *pid, |
69 | enum pid_type)); | 69 | enum pid_type)); |
70 | 70 | ||
71 | extern struct pid *get_task_pid(struct task_struct *task, enum pid_type type); | ||
72 | |||
71 | /* | 73 | /* |
72 | * attach_pid() and detach_pid() must be called with the tasklist_lock | 74 | * attach_pid() and detach_pid() must be called with the tasklist_lock |
73 | * write-held. | 75 | * write-held. |
@@ -89,33 +91,42 @@ extern struct pid *FASTCALL(find_pid(int nr)); | |||
89 | * Lookup a PID in the hash table, and return with it's count elevated. | 91 | * Lookup a PID in the hash table, and return with it's count elevated. |
90 | */ | 92 | */ |
91 | extern struct pid *find_get_pid(int nr); | 93 | extern struct pid *find_get_pid(int nr); |
94 | extern struct pid *find_ge_pid(int nr); | ||
92 | 95 | ||
93 | extern struct pid *alloc_pid(void); | 96 | extern struct pid *alloc_pid(void); |
94 | extern void FASTCALL(free_pid(struct pid *pid)); | 97 | extern void FASTCALL(free_pid(struct pid *pid)); |
95 | 98 | ||
96 | #define pid_next(task, type) \ | 99 | static inline pid_t pid_nr(struct pid *pid) |
97 | ((task)->pids[(type)].node.next) | 100 | { |
101 | pid_t nr = 0; | ||
102 | if (pid) | ||
103 | nr = pid->nr; | ||
104 | return nr; | ||
105 | } | ||
106 | |||
98 | 107 | ||
99 | #define pid_next_task(task, type) \ | 108 | #define do_each_task_pid(who, type, task) \ |
100 | hlist_entry(pid_next(task, type), struct task_struct, \ | 109 | do { \ |
101 | pids[(type)].node) | 110 | struct hlist_node *pos___; \ |
111 | struct pid *pid___ = find_pid(who); \ | ||
112 | if (pid___ != NULL) \ | ||
113 | hlist_for_each_entry_rcu((task), pos___, \ | ||
114 | &pid___->tasks[type], pids[type].node) { | ||
102 | 115 | ||
116 | #define while_each_task_pid(who, type, task) \ | ||
117 | } \ | ||
118 | } while (0) | ||
103 | 119 | ||
104 | /* We could use hlist_for_each_entry_rcu here but it takes more arguments | 120 | |
105 | * than the do_each_task_pid/while_each_task_pid. So we roll our own | 121 | #define do_each_pid_task(pid, type, task) \ |
106 | * to preserve the existing interface. | 122 | do { \ |
107 | */ | 123 | struct hlist_node *pos___; \ |
108 | #define do_each_task_pid(who, type, task) \ | 124 | if (pid != NULL) \ |
109 | if ((task = find_task_by_pid_type(type, who))) { \ | 125 | hlist_for_each_entry_rcu((task), pos___, \ |
110 | prefetch(pid_next(task, type)); \ | 126 | &pid->tasks[type], pids[type].node) { |
111 | do { | 127 | |
112 | 128 | #define while_each_pid_task(pid, type, task) \ | |
113 | #define while_each_task_pid(who, type, task) \ | 129 | } \ |
114 | } while (pid_next(task, type) && ({ \ | 130 | } while (0) |
115 | task = pid_next_task(task, type); \ | ||
116 | rcu_dereference(task); \ | ||
117 | prefetch(pid_next(task, type)); \ | ||
118 | 1; }) ); \ | ||
119 | } | ||
120 | 131 | ||
121 | #endif /* _LINUX_PID_H */ | 132 | #endif /* _LINUX_PID_H */ |
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 57f70bc8b24b..87dec8fe6de9 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h | |||
@@ -244,13 +244,15 @@ static inline void kclist_add(struct kcore_list *new, void *addr, size_t size) | |||
244 | extern void kclist_add(struct kcore_list *, void *, size_t); | 244 | extern void kclist_add(struct kcore_list *, void *, size_t); |
245 | #endif | 245 | #endif |
246 | 246 | ||
247 | union proc_op { | ||
248 | int (*proc_get_link)(struct inode *, struct dentry **, struct vfsmount **); | ||
249 | int (*proc_read)(struct task_struct *task, char *page); | ||
250 | }; | ||
251 | |||
247 | struct proc_inode { | 252 | struct proc_inode { |
248 | struct pid *pid; | 253 | struct pid *pid; |
249 | int fd; | 254 | int fd; |
250 | union { | 255 | union proc_op op; |
251 | int (*proc_get_link)(struct inode *, struct dentry **, struct vfsmount **); | ||
252 | int (*proc_read)(struct task_struct *task, char *page); | ||
253 | } op; | ||
254 | struct proc_dir_entry *pde; | 256 | struct proc_dir_entry *pde; |
255 | struct inode vfs_inode; | 257 | struct inode vfs_inode; |
256 | }; | 258 | }; |
diff --git a/include/linux/pspace.h b/include/linux/pspace.h new file mode 100644 index 000000000000..91d48b8b2d99 --- /dev/null +++ b/include/linux/pspace.h | |||
@@ -0,0 +1,23 @@ | |||
1 | #ifndef _LINUX_PSPACE_H | ||
2 | #define _LINUX_PSPACE_H | ||
3 | |||
4 | #include <linux/sched.h> | ||
5 | #include <linux/mm.h> | ||
6 | #include <linux/threads.h> | ||
7 | #include <linux/pid.h> | ||
8 | |||
9 | struct pidmap { | ||
10 | atomic_t nr_free; | ||
11 | void *page; | ||
12 | }; | ||
13 | |||
14 | #define PIDMAP_ENTRIES ((PID_MAX_LIMIT + 8*PAGE_SIZE - 1)/PAGE_SIZE/8) | ||
15 | |||
16 | struct pspace { | ||
17 | struct pidmap pidmap[PIDMAP_ENTRIES]; | ||
18 | int last_pid; | ||
19 | }; | ||
20 | |||
21 | extern struct pspace init_pspace; | ||
22 | |||
23 | #endif /* _LINUX_PSPACE_H */ | ||
diff --git a/include/linux/sched.h b/include/linux/sched.h index 7ef899c47c29..38530232d92f 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -24,6 +24,8 @@ | |||
24 | #define CLONE_UNTRACED 0x00800000 /* set if the tracing process can't force CLONE_PTRACE on this clone */ | 24 | #define CLONE_UNTRACED 0x00800000 /* set if the tracing process can't force CLONE_PTRACE on this clone */ |
25 | #define CLONE_CHILD_SETTID 0x01000000 /* set the TID in the child */ | 25 | #define CLONE_CHILD_SETTID 0x01000000 /* set the TID in the child */ |
26 | #define CLONE_STOPPED 0x02000000 /* Start in stopped state */ | 26 | #define CLONE_STOPPED 0x02000000 /* Start in stopped state */ |
27 | #define CLONE_NEWUTS 0x04000000 /* New utsname group? */ | ||
28 | #define CLONE_NEWIPC 0x08000000 /* New ipcs */ | ||
27 | 29 | ||
28 | /* | 30 | /* |
29 | * Scheduling policies | 31 | * Scheduling policies |
@@ -118,7 +120,6 @@ extern unsigned long avenrun[]; /* Load averages */ | |||
118 | 120 | ||
119 | extern unsigned long total_forks; | 121 | extern unsigned long total_forks; |
120 | extern int nr_threads; | 122 | extern int nr_threads; |
121 | extern int last_pid; | ||
122 | DECLARE_PER_CPU(unsigned long, process_counts); | 123 | DECLARE_PER_CPU(unsigned long, process_counts); |
123 | extern int nr_processes(void); | 124 | extern int nr_processes(void); |
124 | extern unsigned long nr_running(void); | 125 | extern unsigned long nr_running(void); |
@@ -239,7 +240,7 @@ extern signed long schedule_timeout_interruptible(signed long timeout); | |||
239 | extern signed long schedule_timeout_uninterruptible(signed long timeout); | 240 | extern signed long schedule_timeout_uninterruptible(signed long timeout); |
240 | asmlinkage void schedule(void); | 241 | asmlinkage void schedule(void); |
241 | 242 | ||
242 | struct namespace; | 243 | struct nsproxy; |
243 | 244 | ||
244 | /* Maximum number of active map areas.. This is a random (large) number */ | 245 | /* Maximum number of active map areas.. This is a random (large) number */ |
245 | #define DEFAULT_MAX_MAP_COUNT 65536 | 246 | #define DEFAULT_MAX_MAP_COUNT 65536 |
@@ -754,6 +755,7 @@ static inline void prefetch_stack(struct task_struct *t) { } | |||
754 | struct audit_context; /* See audit.c */ | 755 | struct audit_context; /* See audit.c */ |
755 | struct mempolicy; | 756 | struct mempolicy; |
756 | struct pipe_inode_info; | 757 | struct pipe_inode_info; |
758 | struct uts_namespace; | ||
757 | 759 | ||
758 | enum sleep_type { | 760 | enum sleep_type { |
759 | SLEEP_NORMAL, | 761 | SLEEP_NORMAL, |
@@ -897,8 +899,8 @@ struct task_struct { | |||
897 | struct fs_struct *fs; | 899 | struct fs_struct *fs; |
898 | /* open file information */ | 900 | /* open file information */ |
899 | struct files_struct *files; | 901 | struct files_struct *files; |
900 | /* namespace */ | 902 | /* namespaces */ |
901 | struct namespace *namespace; | 903 | struct nsproxy *nsproxy; |
902 | /* signal handlers */ | 904 | /* signal handlers */ |
903 | struct signal_struct *signal; | 905 | struct signal_struct *signal; |
904 | struct sighand_struct *sighand; | 906 | struct sighand_struct *sighand; |
@@ -1020,6 +1022,26 @@ static inline pid_t process_group(struct task_struct *tsk) | |||
1020 | return tsk->signal->pgrp; | 1022 | return tsk->signal->pgrp; |
1021 | } | 1023 | } |
1022 | 1024 | ||
1025 | static inline struct pid *task_pid(struct task_struct *task) | ||
1026 | { | ||
1027 | return task->pids[PIDTYPE_PID].pid; | ||
1028 | } | ||
1029 | |||
1030 | static inline struct pid *task_tgid(struct task_struct *task) | ||
1031 | { | ||
1032 | return task->group_leader->pids[PIDTYPE_PID].pid; | ||
1033 | } | ||
1034 | |||
1035 | static inline struct pid *task_pgrp(struct task_struct *task) | ||
1036 | { | ||
1037 | return task->group_leader->pids[PIDTYPE_PGID].pid; | ||
1038 | } | ||
1039 | |||
1040 | static inline struct pid *task_session(struct task_struct *task) | ||
1041 | { | ||
1042 | return task->group_leader->pids[PIDTYPE_SID].pid; | ||
1043 | } | ||
1044 | |||
1023 | /** | 1045 | /** |
1024 | * pid_alive - check that a task structure is not stale | 1046 | * pid_alive - check that a task structure is not stale |
1025 | * @p: Task structure to be checked. | 1047 | * @p: Task structure to be checked. |
@@ -1043,6 +1065,8 @@ static inline int is_init(struct task_struct *tsk) | |||
1043 | return tsk->pid == 1; | 1065 | return tsk->pid == 1; |
1044 | } | 1066 | } |
1045 | 1067 | ||
1068 | extern struct pid *cad_pid; | ||
1069 | |||
1046 | extern void free_task(struct task_struct *tsk); | 1070 | extern void free_task(struct task_struct *tsk); |
1047 | #define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0) | 1071 | #define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0) |
1048 | 1072 | ||
@@ -1247,10 +1271,15 @@ extern int send_sig_info(int, struct siginfo *, struct task_struct *); | |||
1247 | extern int send_group_sig_info(int, struct siginfo *, struct task_struct *); | 1271 | extern int send_group_sig_info(int, struct siginfo *, struct task_struct *); |
1248 | extern int force_sigsegv(int, struct task_struct *); | 1272 | extern int force_sigsegv(int, struct task_struct *); |
1249 | extern int force_sig_info(int, struct siginfo *, struct task_struct *); | 1273 | extern int force_sig_info(int, struct siginfo *, struct task_struct *); |
1274 | extern int __kill_pgrp_info(int sig, struct siginfo *info, struct pid *pgrp); | ||
1275 | extern int kill_pgrp_info(int sig, struct siginfo *info, struct pid *pgrp); | ||
1276 | extern int kill_pid_info(int sig, struct siginfo *info, struct pid *pid); | ||
1277 | extern int kill_pid_info_as_uid(int, struct siginfo *, struct pid *, uid_t, uid_t, u32); | ||
1278 | extern int kill_pgrp(struct pid *pid, int sig, int priv); | ||
1279 | extern int kill_pid(struct pid *pid, int sig, int priv); | ||
1250 | extern int __kill_pg_info(int sig, struct siginfo *info, pid_t pgrp); | 1280 | extern int __kill_pg_info(int sig, struct siginfo *info, pid_t pgrp); |
1251 | extern int kill_pg_info(int, struct siginfo *, pid_t); | 1281 | extern int kill_pg_info(int, struct siginfo *, pid_t); |
1252 | extern int kill_proc_info(int, struct siginfo *, pid_t); | 1282 | extern int kill_proc_info(int, struct siginfo *, pid_t); |
1253 | extern int kill_proc_info_as_uid(int, struct siginfo *, pid_t, uid_t, uid_t, u32); | ||
1254 | extern void do_notify_parent(struct task_struct *, int); | 1283 | extern void do_notify_parent(struct task_struct *, int); |
1255 | extern void force_sig(int, struct task_struct *); | 1284 | extern void force_sig(int, struct task_struct *); |
1256 | extern void force_sig_specific(int, struct task_struct *); | 1285 | extern void force_sig_specific(int, struct task_struct *); |
@@ -1265,6 +1294,11 @@ extern int send_group_sigqueue(int, struct sigqueue *, struct task_struct *); | |||
1265 | extern int do_sigaction(int, struct k_sigaction *, struct k_sigaction *); | 1294 | extern int do_sigaction(int, struct k_sigaction *, struct k_sigaction *); |
1266 | extern int do_sigaltstack(const stack_t __user *, stack_t __user *, unsigned long); | 1295 | extern int do_sigaltstack(const stack_t __user *, stack_t __user *, unsigned long); |
1267 | 1296 | ||
1297 | static inline int kill_cad_pid(int sig, int priv) | ||
1298 | { | ||
1299 | return kill_pid(cad_pid, sig, priv); | ||
1300 | } | ||
1301 | |||
1268 | /* These can be the second arg to send_sig_info/send_group_sig_info. */ | 1302 | /* These can be the second arg to send_sig_info/send_group_sig_info. */ |
1269 | #define SEND_SIG_NOINFO ((struct siginfo *) 0) | 1303 | #define SEND_SIG_NOINFO ((struct siginfo *) 0) |
1270 | #define SEND_SIG_PRIV ((struct siginfo *) 1) | 1304 | #define SEND_SIG_PRIV ((struct siginfo *) 1) |
@@ -1358,6 +1392,17 @@ extern void wait_task_inactive(struct task_struct * p); | |||
1358 | /* de_thread depends on thread_group_leader not being a pid based check */ | 1392 | /* de_thread depends on thread_group_leader not being a pid based check */ |
1359 | #define thread_group_leader(p) (p == p->group_leader) | 1393 | #define thread_group_leader(p) (p == p->group_leader) |
1360 | 1394 | ||
1395 | /* Do to the insanities of de_thread it is possible for a process | ||
1396 | * to have the pid of the thread group leader without actually being | ||
1397 | * the thread group leader. For iteration through the pids in proc | ||
1398 | * all we care about is that we have a task with the appropriate | ||
1399 | * pid, we don't actually care if we have the right task. | ||
1400 | */ | ||
1401 | static inline int has_group_leader_pid(struct task_struct *p) | ||
1402 | { | ||
1403 | return p->pid == p->tgid; | ||
1404 | } | ||
1405 | |||
1361 | static inline struct task_struct *next_thread(const struct task_struct *p) | 1406 | static inline struct task_struct *next_thread(const struct task_struct *p) |
1362 | { | 1407 | { |
1363 | return list_entry(rcu_dereference(p->thread_group.next), | 1408 | return list_entry(rcu_dereference(p->thread_group.next), |
diff --git a/include/linux/serio.h b/include/linux/serio.h index 6348e8330897..c9069310b6ac 100644 --- a/include/linux/serio.h +++ b/include/linux/serio.h | |||
@@ -217,5 +217,8 @@ static inline void serio_unpin_driver(struct serio *serio) | |||
217 | #define SERIO_LKKBD 0x28 | 217 | #define SERIO_LKKBD 0x28 |
218 | #define SERIO_ELO 0x29 | 218 | #define SERIO_ELO 0x29 |
219 | #define SERIO_MICROTOUCH 0x30 | 219 | #define SERIO_MICROTOUCH 0x30 |
220 | #define SERIO_PENMOUNT 0x31 | ||
221 | #define SERIO_TOUCHRIGHT 0x32 | ||
222 | #define SERIO_TOUCHWIN 0x33 | ||
220 | 223 | ||
221 | #endif | 224 | #endif |
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 73140ee5c638..4ebcdf91f3b3 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
@@ -18,6 +18,30 @@ | |||
18 | #include <linux/mm.h> | 18 | #include <linux/mm.h> |
19 | 19 | ||
20 | /* | 20 | /* |
21 | * This is the RPC server thread function prototype | ||
22 | */ | ||
23 | typedef void (*svc_thread_fn)(struct svc_rqst *); | ||
24 | |||
25 | /* | ||
26 | * | ||
27 | * RPC service thread pool. | ||
28 | * | ||
29 | * Pool of threads and temporary sockets. Generally there is only | ||
30 | * a single one of these per RPC service, but on NUMA machines those | ||
31 | * services that can benefit from it (i.e. nfs but not lockd) will | ||
32 | * have one pool per NUMA node. This optimisation reduces cross- | ||
33 | * node traffic on multi-node NUMA NFS servers. | ||
34 | */ | ||
35 | struct svc_pool { | ||
36 | unsigned int sp_id; /* pool id; also node id on NUMA */ | ||
37 | spinlock_t sp_lock; /* protects all fields */ | ||
38 | struct list_head sp_threads; /* idle server threads */ | ||
39 | struct list_head sp_sockets; /* pending sockets */ | ||
40 | unsigned int sp_nrthreads; /* # of threads in pool */ | ||
41 | struct list_head sp_all_threads; /* all server threads */ | ||
42 | } ____cacheline_aligned_in_smp; | ||
43 | |||
44 | /* | ||
21 | * RPC service. | 45 | * RPC service. |
22 | * | 46 | * |
23 | * An RPC service is a ``daemon,'' possibly multithreaded, which | 47 | * An RPC service is a ``daemon,'' possibly multithreaded, which |
@@ -28,8 +52,6 @@ | |||
28 | * We currently do not support more than one RPC program per daemon. | 52 | * We currently do not support more than one RPC program per daemon. |
29 | */ | 53 | */ |
30 | struct svc_serv { | 54 | struct svc_serv { |
31 | struct list_head sv_threads; /* idle server threads */ | ||
32 | struct list_head sv_sockets; /* pending sockets */ | ||
33 | struct svc_program * sv_program; /* RPC program */ | 55 | struct svc_program * sv_program; /* RPC program */ |
34 | struct svc_stat * sv_stats; /* RPC statistics */ | 56 | struct svc_stat * sv_stats; /* RPC statistics */ |
35 | spinlock_t sv_lock; | 57 | spinlock_t sv_lock; |
@@ -40,11 +62,36 @@ struct svc_serv { | |||
40 | struct list_head sv_permsocks; /* all permanent sockets */ | 62 | struct list_head sv_permsocks; /* all permanent sockets */ |
41 | struct list_head sv_tempsocks; /* all temporary sockets */ | 63 | struct list_head sv_tempsocks; /* all temporary sockets */ |
42 | int sv_tmpcnt; /* count of temporary sockets */ | 64 | int sv_tmpcnt; /* count of temporary sockets */ |
65 | struct timer_list sv_temptimer; /* timer for aging temporary sockets */ | ||
43 | 66 | ||
44 | char * sv_name; /* service name */ | 67 | char * sv_name; /* service name */ |
68 | |||
69 | unsigned int sv_nrpools; /* number of thread pools */ | ||
70 | struct svc_pool * sv_pools; /* array of thread pools */ | ||
71 | |||
72 | void (*sv_shutdown)(struct svc_serv *serv); | ||
73 | /* Callback to use when last thread | ||
74 | * exits. | ||
75 | */ | ||
76 | |||
77 | struct module * sv_module; /* optional module to count when | ||
78 | * adding threads */ | ||
79 | svc_thread_fn sv_function; /* main function for threads */ | ||
80 | int sv_kill_signal; /* signal to kill threads */ | ||
45 | }; | 81 | }; |
46 | 82 | ||
47 | /* | 83 | /* |
84 | * We use sv_nrthreads as a reference count. svc_destroy() drops | ||
85 | * this refcount, so we need to bump it up around operations that | ||
86 | * change the number of threads. Horrible, but there it is. | ||
87 | * Should be called with the BKL held. | ||
88 | */ | ||
89 | static inline void svc_get(struct svc_serv *serv) | ||
90 | { | ||
91 | serv->sv_nrthreads++; | ||
92 | } | ||
93 | |||
94 | /* | ||
48 | * Maximum payload size supported by a kernel RPC server. | 95 | * Maximum payload size supported by a kernel RPC server. |
49 | * This is use to determine the max number of pages nfsd is | 96 | * This is use to determine the max number of pages nfsd is |
50 | * willing to return in a single READ operation. | 97 | * willing to return in a single READ operation. |
@@ -127,11 +174,13 @@ static inline void svc_putu32(struct kvec *iov, __be32 val) | |||
127 | */ | 174 | */ |
128 | struct svc_rqst { | 175 | struct svc_rqst { |
129 | struct list_head rq_list; /* idle list */ | 176 | struct list_head rq_list; /* idle list */ |
177 | struct list_head rq_all; /* all threads list */ | ||
130 | struct svc_sock * rq_sock; /* socket */ | 178 | struct svc_sock * rq_sock; /* socket */ |
131 | struct sockaddr_in rq_addr; /* peer address */ | 179 | struct sockaddr_in rq_addr; /* peer address */ |
132 | int rq_addrlen; | 180 | int rq_addrlen; |
133 | 181 | ||
134 | struct svc_serv * rq_server; /* RPC service definition */ | 182 | struct svc_serv * rq_server; /* RPC service definition */ |
183 | struct svc_pool * rq_pool; /* thread pool */ | ||
135 | struct svc_procedure * rq_procinfo; /* procedure info */ | 184 | struct svc_procedure * rq_procinfo; /* procedure info */ |
136 | struct auth_ops * rq_authop; /* authentication flavour */ | 185 | struct auth_ops * rq_authop; /* authentication flavour */ |
137 | struct svc_cred rq_cred; /* auth info */ | 186 | struct svc_cred rq_cred; /* auth info */ |
@@ -180,6 +229,7 @@ struct svc_rqst { | |||
180 | * to prevent encrypting page | 229 | * to prevent encrypting page |
181 | * cache pages */ | 230 | * cache pages */ |
182 | wait_queue_head_t rq_wait; /* synchronization */ | 231 | wait_queue_head_t rq_wait; /* synchronization */ |
232 | struct task_struct *rq_task; /* service thread */ | ||
183 | }; | 233 | }; |
184 | 234 | ||
185 | /* | 235 | /* |
@@ -321,20 +371,21 @@ struct svc_procedure { | |||
321 | }; | 371 | }; |
322 | 372 | ||
323 | /* | 373 | /* |
324 | * This is the RPC server thread function prototype | ||
325 | */ | ||
326 | typedef void (*svc_thread_fn)(struct svc_rqst *); | ||
327 | |||
328 | /* | ||
329 | * Function prototypes. | 374 | * Function prototypes. |
330 | */ | 375 | */ |
331 | struct svc_serv * svc_create(struct svc_program *, unsigned int); | 376 | struct svc_serv * svc_create(struct svc_program *, unsigned int, |
377 | void (*shutdown)(struct svc_serv*)); | ||
332 | int svc_create_thread(svc_thread_fn, struct svc_serv *); | 378 | int svc_create_thread(svc_thread_fn, struct svc_serv *); |
333 | void svc_exit_thread(struct svc_rqst *); | 379 | void svc_exit_thread(struct svc_rqst *); |
380 | struct svc_serv * svc_create_pooled(struct svc_program *, unsigned int, | ||
381 | void (*shutdown)(struct svc_serv*), | ||
382 | svc_thread_fn, int sig, struct module *); | ||
383 | int svc_set_num_threads(struct svc_serv *, struct svc_pool *, int); | ||
334 | void svc_destroy(struct svc_serv *); | 384 | void svc_destroy(struct svc_serv *); |
335 | int svc_process(struct svc_serv *, struct svc_rqst *); | 385 | int svc_process(struct svc_rqst *); |
336 | int svc_register(struct svc_serv *, int, unsigned short); | 386 | int svc_register(struct svc_serv *, int, unsigned short); |
337 | void svc_wake_up(struct svc_serv *); | 387 | void svc_wake_up(struct svc_serv *); |
338 | void svc_reserve(struct svc_rqst *rqstp, int space); | 388 | void svc_reserve(struct svc_rqst *rqstp, int space); |
389 | struct svc_pool * svc_pool_for_cpu(struct svc_serv *serv, int cpu); | ||
339 | 390 | ||
340 | #endif /* SUNRPC_SVC_H */ | 391 | #endif /* SUNRPC_SVC_H */ |
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h index b4acb3d37c3f..4c296152cbfa 100644 --- a/include/linux/sunrpc/svcsock.h +++ b/include/linux/sunrpc/svcsock.h | |||
@@ -20,8 +20,9 @@ struct svc_sock { | |||
20 | struct socket * sk_sock; /* berkeley socket layer */ | 20 | struct socket * sk_sock; /* berkeley socket layer */ |
21 | struct sock * sk_sk; /* INET layer */ | 21 | struct sock * sk_sk; /* INET layer */ |
22 | 22 | ||
23 | struct svc_pool * sk_pool; /* current pool iff queued */ | ||
23 | struct svc_serv * sk_server; /* service for this socket */ | 24 | struct svc_serv * sk_server; /* service for this socket */ |
24 | unsigned int sk_inuse; /* use count */ | 25 | atomic_t sk_inuse; /* use count */ |
25 | unsigned long sk_flags; | 26 | unsigned long sk_flags; |
26 | #define SK_BUSY 0 /* enqueued/receiving */ | 27 | #define SK_BUSY 0 /* enqueued/receiving */ |
27 | #define SK_CONN 1 /* conn pending */ | 28 | #define SK_CONN 1 /* conn pending */ |
@@ -31,9 +32,12 @@ struct svc_sock { | |||
31 | #define SK_DEAD 6 /* socket closed */ | 32 | #define SK_DEAD 6 /* socket closed */ |
32 | #define SK_CHNGBUF 7 /* need to change snd/rcv buffer sizes */ | 33 | #define SK_CHNGBUF 7 /* need to change snd/rcv buffer sizes */ |
33 | #define SK_DEFERRED 8 /* request on sk_deferred */ | 34 | #define SK_DEFERRED 8 /* request on sk_deferred */ |
35 | #define SK_OLD 9 /* used for temp socket aging mark+sweep */ | ||
36 | #define SK_DETACHED 10 /* detached from tempsocks list */ | ||
34 | 37 | ||
35 | int sk_reserved; /* space on outq that is reserved */ | 38 | atomic_t sk_reserved; /* space on outq that is reserved */ |
36 | 39 | ||
40 | spinlock_t sk_defer_lock; /* protects sk_deferred */ | ||
37 | struct list_head sk_deferred; /* deferred requests that need to | 41 | struct list_head sk_deferred; /* deferred requests that need to |
38 | * be revisted */ | 42 | * be revisted */ |
39 | struct mutex sk_mutex; /* to serialize sending data */ | 43 | struct mutex sk_mutex; /* to serialize sending data */ |
@@ -57,9 +61,14 @@ struct svc_sock { | |||
57 | */ | 61 | */ |
58 | int svc_makesock(struct svc_serv *, int, unsigned short); | 62 | int svc_makesock(struct svc_serv *, int, unsigned short); |
59 | void svc_delete_socket(struct svc_sock *); | 63 | void svc_delete_socket(struct svc_sock *); |
60 | int svc_recv(struct svc_serv *, struct svc_rqst *, long); | 64 | int svc_recv(struct svc_rqst *, long); |
61 | int svc_send(struct svc_rqst *); | 65 | int svc_send(struct svc_rqst *); |
62 | void svc_drop(struct svc_rqst *); | 66 | void svc_drop(struct svc_rqst *); |
63 | void svc_sock_update_bufs(struct svc_serv *serv); | 67 | void svc_sock_update_bufs(struct svc_serv *serv); |
68 | int svc_sock_names(char *buf, struct svc_serv *serv, char *toclose); | ||
69 | int svc_addsock(struct svc_serv *serv, | ||
70 | int fd, | ||
71 | char *name_return, | ||
72 | int *proto); | ||
64 | 73 | ||
65 | #endif /* SUNRPC_SVCSOCK_H */ | 74 | #endif /* SUNRPC_SVCSOCK_H */ |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 2d1c3d5c83ac..3efcfc7e9c6c 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -599,4 +599,6 @@ asmlinkage long sys_set_robust_list(struct robust_list_head __user *head, | |||
599 | size_t len); | 599 | size_t len); |
600 | asmlinkage long sys_getcpu(unsigned __user *cpu, unsigned __user *node, struct getcpu_cache __user *cache); | 600 | asmlinkage long sys_getcpu(unsigned __user *cpu, unsigned __user *node, struct getcpu_cache __user *cache); |
601 | 601 | ||
602 | int kernel_execve(const char *filename, char *const argv[], char *const envp[]); | ||
603 | |||
602 | #endif | 604 | #endif |
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h index 58c961c9e170..5c8473bb6882 100644 --- a/include/linux/tty_driver.h +++ b/include/linux/tty_driver.h | |||
@@ -219,7 +219,8 @@ extern struct list_head tty_drivers; | |||
219 | 219 | ||
220 | struct tty_driver *alloc_tty_driver(int lines); | 220 | struct tty_driver *alloc_tty_driver(int lines); |
221 | void put_tty_driver(struct tty_driver *driver); | 221 | void put_tty_driver(struct tty_driver *driver); |
222 | void tty_set_operations(struct tty_driver *driver, struct tty_operations *op); | 222 | void tty_set_operations(struct tty_driver *driver, |
223 | const struct tty_operations *op); | ||
223 | 224 | ||
224 | /* tty driver magic number */ | 225 | /* tty driver magic number */ |
225 | #define TTY_DRIVER_MAGIC 0x5402 | 226 | #define TTY_DRIVER_MAGIC 0x5402 |
diff --git a/include/linux/uinput.h b/include/linux/uinput.h index 7168302f9844..1fd61eeed664 100644 --- a/include/linux/uinput.h +++ b/include/linux/uinput.h | |||
@@ -22,12 +22,18 @@ | |||
22 | * Author: Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org> | 22 | * Author: Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org> |
23 | * | 23 | * |
24 | * Changes/Revisions: | 24 | * Changes/Revisions: |
25 | * 0.3 24/05/2006 (Anssi Hannula <anssi.hannulagmail.com>) | ||
26 | * - update ff support for the changes in kernel interface | ||
27 | * - add UINPUT_VERSION | ||
25 | * 0.2 16/10/2004 (Micah Dowty <micah@navi.cx>) | 28 | * 0.2 16/10/2004 (Micah Dowty <micah@navi.cx>) |
26 | * - added force feedback support | 29 | * - added force feedback support |
27 | * - added UI_SET_PHYS | 30 | * - added UI_SET_PHYS |
28 | * 0.1 20/06/2002 | 31 | * 0.1 20/06/2002 |
29 | * - first public version | 32 | * - first public version |
30 | */ | 33 | */ |
34 | |||
35 | #define UINPUT_VERSION 3 | ||
36 | |||
31 | #ifdef __KERNEL__ | 37 | #ifdef __KERNEL__ |
32 | #define UINPUT_MINOR 223 | 38 | #define UINPUT_MINOR 223 |
33 | #define UINPUT_NAME "uinput" | 39 | #define UINPUT_NAME "uinput" |
@@ -45,7 +51,10 @@ struct uinput_request { | |||
45 | 51 | ||
46 | union { | 52 | union { |
47 | int effect_id; | 53 | int effect_id; |
48 | struct ff_effect* effect; | 54 | struct { |
55 | struct ff_effect *effect; | ||
56 | struct ff_effect *old; | ||
57 | } upload; | ||
49 | } u; | 58 | } u; |
50 | }; | 59 | }; |
51 | 60 | ||
@@ -58,6 +67,7 @@ struct uinput_device { | |||
58 | unsigned char head; | 67 | unsigned char head; |
59 | unsigned char tail; | 68 | unsigned char tail; |
60 | struct input_event buff[UINPUT_BUFFER_SIZE]; | 69 | struct input_event buff[UINPUT_BUFFER_SIZE]; |
70 | int ff_effects_max; | ||
61 | 71 | ||
62 | struct uinput_request *requests[UINPUT_NUM_REQUESTS]; | 72 | struct uinput_request *requests[UINPUT_NUM_REQUESTS]; |
63 | wait_queue_head_t requests_waitq; | 73 | wait_queue_head_t requests_waitq; |
@@ -69,6 +79,7 @@ struct uinput_ff_upload { | |||
69 | int request_id; | 79 | int request_id; |
70 | int retval; | 80 | int retval; |
71 | struct ff_effect effect; | 81 | struct ff_effect effect; |
82 | struct ff_effect old; | ||
72 | }; | 83 | }; |
73 | 84 | ||
74 | struct uinput_ff_erase { | 85 | struct uinput_ff_erase { |
@@ -98,33 +109,33 @@ struct uinput_ff_erase { | |||
98 | #define UI_BEGIN_FF_ERASE _IOWR(UINPUT_IOCTL_BASE, 202, struct uinput_ff_erase) | 109 | #define UI_BEGIN_FF_ERASE _IOWR(UINPUT_IOCTL_BASE, 202, struct uinput_ff_erase) |
99 | #define UI_END_FF_ERASE _IOW(UINPUT_IOCTL_BASE, 203, struct uinput_ff_erase) | 110 | #define UI_END_FF_ERASE _IOW(UINPUT_IOCTL_BASE, 203, struct uinput_ff_erase) |
100 | 111 | ||
101 | /* To write a force-feedback-capable driver, the upload_effect | 112 | /* |
113 | * To write a force-feedback-capable driver, the upload_effect | ||
102 | * and erase_effect callbacks in input_dev must be implemented. | 114 | * and erase_effect callbacks in input_dev must be implemented. |
103 | * The uinput driver will generate a fake input event when one of | 115 | * The uinput driver will generate a fake input event when one of |
104 | * these callbacks are invoked. The userspace code then uses | 116 | * these callbacks are invoked. The userspace code then uses |
105 | * ioctls to retrieve additional parameters and send the return code. | 117 | * ioctls to retrieve additional parameters and send the return code. |
106 | * The callback blocks until this return code is sent. | 118 | * The callback blocks until this return code is sent. |
107 | * | 119 | * |
108 | * The described callback mechanism is only used if EV_FF is set. | 120 | * The described callback mechanism is only used if ff_effects_max |
109 | * Otherwise, default implementations of upload_effect and erase_effect | 121 | * is set. |
110 | * are used. | ||
111 | * | 122 | * |
112 | * To implement upload_effect(): | 123 | * To implement upload_effect(): |
113 | * 1. Wait for an event with type==EV_UINPUT and code==UI_FF_UPLOAD. | 124 | * 1. Wait for an event with type == EV_UINPUT and code == UI_FF_UPLOAD. |
114 | * A request ID will be given in 'value'. | 125 | * A request ID will be given in 'value'. |
115 | * 2. Allocate a uinput_ff_upload struct, fill in request_id with | 126 | * 2. Allocate a uinput_ff_upload struct, fill in request_id with |
116 | * the 'value' from the EV_UINPUT event. | 127 | * the 'value' from the EV_UINPUT event. |
117 | * 3. Issue a UI_BEGIN_FF_UPLOAD ioctl, giving it the | 128 | * 3. Issue a UI_BEGIN_FF_UPLOAD ioctl, giving it the |
118 | * uinput_ff_upload struct. It will be filled in with the | 129 | * uinput_ff_upload struct. It will be filled in with the |
119 | * ff_effect passed to upload_effect(). | 130 | * ff_effects passed to upload_effect(). |
120 | * 4. Perform the effect upload, and place the modified ff_effect | 131 | * 4. Perform the effect upload, and place a return code back into |
121 | * and a return code back into the uinput_ff_upload struct. | 132 | the uinput_ff_upload struct. |
122 | * 5. Issue a UI_END_FF_UPLOAD ioctl, also giving it the | 133 | * 5. Issue a UI_END_FF_UPLOAD ioctl, also giving it the |
123 | * uinput_ff_upload_effect struct. This will complete execution | 134 | * uinput_ff_upload_effect struct. This will complete execution |
124 | * of our upload_effect() handler. | 135 | * of our upload_effect() handler. |
125 | * | 136 | * |
126 | * To implement erase_effect(): | 137 | * To implement erase_effect(): |
127 | * 1. Wait for an event with type==EV_UINPUT and code==UI_FF_ERASE. | 138 | * 1. Wait for an event with type == EV_UINPUT and code == UI_FF_ERASE. |
128 | * A request ID will be given in 'value'. | 139 | * A request ID will be given in 'value'. |
129 | * 2. Allocate a uinput_ff_erase struct, fill in request_id with | 140 | * 2. Allocate a uinput_ff_erase struct, fill in request_id with |
130 | * the 'value' from the EV_UINPUT event. | 141 | * the 'value' from the EV_UINPUT event. |
@@ -133,13 +144,13 @@ struct uinput_ff_erase { | |||
133 | * effect ID passed to erase_effect(). | 144 | * effect ID passed to erase_effect(). |
134 | * 4. Perform the effect erasure, and place a return code back | 145 | * 4. Perform the effect erasure, and place a return code back |
135 | * into the uinput_ff_erase struct. | 146 | * into the uinput_ff_erase struct. |
136 | * and a return code back into the uinput_ff_erase struct. | ||
137 | * 5. Issue a UI_END_FF_ERASE ioctl, also giving it the | 147 | * 5. Issue a UI_END_FF_ERASE ioctl, also giving it the |
138 | * uinput_ff_erase_effect struct. This will complete execution | 148 | * uinput_ff_erase_effect struct. This will complete execution |
139 | * of our erase_effect() handler. | 149 | * of our erase_effect() handler. |
140 | */ | 150 | */ |
141 | 151 | ||
142 | /* This is the new event type, used only by uinput. | 152 | /* |
153 | * This is the new event type, used only by uinput. | ||
143 | * 'code' is UI_FF_UPLOAD or UI_FF_ERASE, and 'value' | 154 | * 'code' is UI_FF_UPLOAD or UI_FF_ERASE, and 'value' |
144 | * is the unique request ID. This number was picked | 155 | * is the unique request ID. This number was picked |
145 | * arbitrarily, above EV_MAX (since the input system | 156 | * arbitrarily, above EV_MAX (since the input system |
diff --git a/include/linux/unistd.h b/include/linux/unistd.h index c18c60f3254e..aa8d5b5e2e3e 100644 --- a/include/linux/unistd.h +++ b/include/linux/unistd.h | |||
@@ -1,12 +1,8 @@ | |||
1 | #ifndef _LINUX_UNISTD_H_ | 1 | #ifndef _LINUX_UNISTD_H_ |
2 | #define _LINUX_UNISTD_H_ | 2 | #define _LINUX_UNISTD_H_ |
3 | 3 | ||
4 | #ifdef __KERNEL__ | ||
5 | extern int errno; | ||
6 | #endif | ||
7 | |||
8 | /* | 4 | /* |
9 | * Include machine specific syscallX macros | 5 | * Include machine specific syscall numbers |
10 | */ | 6 | */ |
11 | #include <asm/unistd.h> | 7 | #include <asm/unistd.h> |
12 | 8 | ||
diff --git a/include/linux/utsname.h b/include/linux/utsname.h index 13e1da0c538d..02e4b6972064 100644 --- a/include/linux/utsname.h +++ b/include/linux/utsname.h | |||
@@ -1,6 +1,11 @@ | |||
1 | #ifndef _LINUX_UTSNAME_H | 1 | #ifndef _LINUX_UTSNAME_H |
2 | #define _LINUX_UTSNAME_H | 2 | #define _LINUX_UTSNAME_H |
3 | 3 | ||
4 | #include <linux/sched.h> | ||
5 | #include <linux/kref.h> | ||
6 | #include <linux/nsproxy.h> | ||
7 | #include <asm/atomic.h> | ||
8 | |||
4 | #define __OLD_UTS_LEN 8 | 9 | #define __OLD_UTS_LEN 8 |
5 | 10 | ||
6 | struct oldold_utsname { | 11 | struct oldold_utsname { |
@@ -30,7 +35,55 @@ struct new_utsname { | |||
30 | char domainname[65]; | 35 | char domainname[65]; |
31 | }; | 36 | }; |
32 | 37 | ||
33 | extern struct new_utsname system_utsname; | 38 | struct uts_namespace { |
39 | struct kref kref; | ||
40 | struct new_utsname name; | ||
41 | }; | ||
42 | extern struct uts_namespace init_uts_ns; | ||
43 | |||
44 | static inline void get_uts_ns(struct uts_namespace *ns) | ||
45 | { | ||
46 | kref_get(&ns->kref); | ||
47 | } | ||
48 | |||
49 | #ifdef CONFIG_UTS_NS | ||
50 | extern int unshare_utsname(unsigned long unshare_flags, | ||
51 | struct uts_namespace **new_uts); | ||
52 | extern int copy_utsname(int flags, struct task_struct *tsk); | ||
53 | extern void free_uts_ns(struct kref *kref); | ||
54 | |||
55 | static inline void put_uts_ns(struct uts_namespace *ns) | ||
56 | { | ||
57 | kref_put(&ns->kref, free_uts_ns); | ||
58 | } | ||
59 | #else | ||
60 | static inline int unshare_utsname(unsigned long unshare_flags, | ||
61 | struct uts_namespace **new_uts) | ||
62 | { | ||
63 | if (unshare_flags & CLONE_NEWUTS) | ||
64 | return -EINVAL; | ||
65 | |||
66 | return 0; | ||
67 | } | ||
68 | |||
69 | static inline int copy_utsname(int flags, struct task_struct *tsk) | ||
70 | { | ||
71 | return 0; | ||
72 | } | ||
73 | static inline void put_uts_ns(struct uts_namespace *ns) | ||
74 | { | ||
75 | } | ||
76 | #endif | ||
77 | |||
78 | static inline struct new_utsname *utsname(void) | ||
79 | { | ||
80 | return ¤t->nsproxy->uts_ns->name; | ||
81 | } | ||
82 | |||
83 | static inline struct new_utsname *init_utsname(void) | ||
84 | { | ||
85 | return &init_uts_ns.name; | ||
86 | } | ||
34 | 87 | ||
35 | extern struct rw_semaphore uts_sem; | 88 | extern struct rw_semaphore uts_sem; |
36 | #endif | 89 | #endif |
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h index 1009d3fe1fc2..37a1a41f5b65 100644 --- a/include/linux/vt_kern.h +++ b/include/linux/vt_kern.h | |||
@@ -84,4 +84,11 @@ void reset_vc(struct vc_data *vc); | |||
84 | extern char con_buf[CON_BUF_SIZE]; | 84 | extern char con_buf[CON_BUF_SIZE]; |
85 | extern struct semaphore con_buf_sem; | 85 | extern struct semaphore con_buf_sem; |
86 | 86 | ||
87 | struct vt_spawn_console { | ||
88 | spinlock_t lock; | ||
89 | struct pid *pid; | ||
90 | int sig; | ||
91 | }; | ||
92 | extern struct vt_spawn_console vt_spawn_con; | ||
93 | |||
87 | #endif /* _VT_KERN_H */ | 94 | #endif /* _VT_KERN_H */ |