diff options
Diffstat (limited to 'include')
213 files changed, 2203 insertions, 2004 deletions
diff --git a/include/asm-alpha/spinlock.h b/include/asm-alpha/spinlock.h index 0c294c9b0c55..aeeb125f6851 100644 --- a/include/asm-alpha/spinlock.h +++ b/include/asm-alpha/spinlock.h | |||
@@ -166,4 +166,8 @@ static inline void __raw_write_unlock(raw_rwlock_t * lock) | |||
166 | lock->lock = 0; | 166 | lock->lock = 0; |
167 | } | 167 | } |
168 | 168 | ||
169 | #define _raw_spin_relax(lock) cpu_relax() | ||
170 | #define _raw_read_relax(lock) cpu_relax() | ||
171 | #define _raw_write_relax(lock) cpu_relax() | ||
172 | |||
169 | #endif /* _ALPHA_SPINLOCK_H */ | 173 | #endif /* _ALPHA_SPINLOCK_H */ |
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/arch-pnx4008/clock.h b/include/asm-arm/arch-pnx4008/clock.h index 91ae0030fdf2..ce155e161269 100644 --- a/include/asm-arm/arch-pnx4008/clock.h +++ b/include/asm-arm/arch-pnx4008/clock.h | |||
@@ -32,6 +32,7 @@ struct clk; | |||
32 | #define KEYCLKCTRL_REG (PWRMAN_VA_BASE + 0xb0) | 32 | #define KEYCLKCTRL_REG (PWRMAN_VA_BASE + 0xb0) |
33 | #define TSCLKCTRL_REG (PWRMAN_VA_BASE + 0xb4) | 33 | #define TSCLKCTRL_REG (PWRMAN_VA_BASE + 0xb4) |
34 | #define PWMCLKCTRL_REG (PWRMAN_VA_BASE + 0xb8) | 34 | #define PWMCLKCTRL_REG (PWRMAN_VA_BASE + 0xb8) |
35 | #define TIMCLKCTRL_REG (PWRMAN_VA_BASE + 0xbc) | ||
35 | #define SPICTRL_REG (PWRMAN_VA_BASE + 0xc4) | 36 | #define SPICTRL_REG (PWRMAN_VA_BASE + 0xc4) |
36 | #define FLASHCLKCTRL_REG (PWRMAN_VA_BASE + 0xc8) | 37 | #define FLASHCLKCTRL_REG (PWRMAN_VA_BASE + 0xc8) |
37 | #define UART3CLK_REG (PWRMAN_VA_BASE + 0xd0) | 38 | #define UART3CLK_REG (PWRMAN_VA_BASE + 0xd0) |
diff --git a/include/asm-arm/spinlock.h b/include/asm-arm/spinlock.h index 01b7c26a3038..861092fbaa53 100644 --- a/include/asm-arm/spinlock.h +++ b/include/asm-arm/spinlock.h | |||
@@ -218,4 +218,8 @@ static inline int __raw_read_trylock(raw_rwlock_t *rw) | |||
218 | /* read_can_lock - would read_trylock() succeed? */ | 218 | /* read_can_lock - would read_trylock() succeed? */ |
219 | #define __raw_read_can_lock(x) ((x)->lock < 0x80000000) | 219 | #define __raw_read_can_lock(x) ((x)->lock < 0x80000000) |
220 | 220 | ||
221 | #define _raw_spin_relax(lock) cpu_relax() | ||
222 | #define _raw_read_relax(lock) cpu_relax() | ||
223 | #define _raw_write_relax(lock) cpu_relax() | ||
224 | |||
221 | #endif /* __ASM_SPINLOCK_H */ | 225 | #endif /* __ASM_SPINLOCK_H */ |
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/arch-v32/spinlock.h b/include/asm-cris/arch-v32/spinlock.h index 52df72a62232..5f43df0a5fb4 100644 --- a/include/asm-cris/arch-v32/spinlock.h +++ b/include/asm-cris/arch-v32/spinlock.h | |||
@@ -160,4 +160,8 @@ static __inline__ int is_write_locked(rwlock_t *rw) | |||
160 | return rw->counter < 0; | 160 | return rw->counter < 0; |
161 | } | 161 | } |
162 | 162 | ||
163 | #define _raw_spin_relax(lock) cpu_relax() | ||
164 | #define _raw_read_relax(lock) cpu_relax() | ||
165 | #define _raw_write_relax(lock) cpu_relax() | ||
166 | |||
163 | #endif /* __ASM_ARCH_SPINLOCK_H */ | 167 | #endif /* __ASM_ARCH_SPINLOCK_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/pgtable.h b/include/asm-frv/pgtable.h index 2fb3c6f05e03..ba1b37df69d5 100644 --- a/include/asm-frv/pgtable.h +++ b/include/asm-frv/pgtable.h | |||
@@ -176,8 +176,6 @@ do { \ | |||
176 | } while(0) | 176 | } while(0) |
177 | #define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) | 177 | #define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) |
178 | 178 | ||
179 | #define set_pte_atomic(pteptr, pteval) set_pte((pteptr), (pteval)) | ||
180 | |||
181 | /* | 179 | /* |
182 | * pgd_offset() returns a (pgd_t *) | 180 | * pgd_offset() returns a (pgd_t *) |
183 | * pgd_index() is used get the offset into the pgd page's array of pgd_t's; | 181 | * pgd_index() is used get the offset into the pgd page's array of pgd_t's; |
diff --git a/include/asm-frv/timex.h b/include/asm-frv/timex.h index 2aa562fa067b..a89bddefdacf 100644 --- a/include/asm-frv/timex.h +++ b/include/asm-frv/timex.h | |||
@@ -6,11 +6,6 @@ | |||
6 | #define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ | 6 | #define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ |
7 | #define CLOCK_TICK_FACTOR 20 /* Factor of both 1000000 and CLOCK_TICK_RATE */ | 7 | #define CLOCK_TICK_FACTOR 20 /* Factor of both 1000000 and CLOCK_TICK_RATE */ |
8 | 8 | ||
9 | #define FINETUNE \ | ||
10 | ((((((long)LATCH * HZ - CLOCK_TICK_RATE) << SHIFT_HZ) * \ | ||
11 | (1000000/CLOCK_TICK_FACTOR) / (CLOCK_TICK_RATE/CLOCK_TICK_FACTOR)) \ | ||
12 | << (SHIFT_SCALE-SHIFT_HZ)) / HZ) | ||
13 | |||
14 | typedef unsigned long cycles_t; | 9 | typedef unsigned long cycles_t; |
15 | 10 | ||
16 | static inline cycles_t get_cycles(void) | 11 | static inline cycles_t get_cycles(void) |
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-generic/pgtable.h b/include/asm-generic/pgtable.h index 349260cd86ed..9d774d07d95b 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h | |||
@@ -15,19 +15,11 @@ | |||
15 | * Note: the old pte is known to not be writable, so we don't need to | 15 | * Note: the old pte is known to not be writable, so we don't need to |
16 | * worry about dirty bits etc getting lost. | 16 | * worry about dirty bits etc getting lost. |
17 | */ | 17 | */ |
18 | #ifndef __HAVE_ARCH_SET_PTE_ATOMIC | ||
19 | #define ptep_establish(__vma, __address, __ptep, __entry) \ | 18 | #define ptep_establish(__vma, __address, __ptep, __entry) \ |
20 | do { \ | 19 | do { \ |
21 | set_pte_at((__vma)->vm_mm, (__address), __ptep, __entry); \ | 20 | set_pte_at((__vma)->vm_mm, (__address), __ptep, __entry); \ |
22 | flush_tlb_page(__vma, __address); \ | 21 | flush_tlb_page(__vma, __address); \ |
23 | } while (0) | 22 | } while (0) |
24 | #else /* __HAVE_ARCH_SET_PTE_ATOMIC */ | ||
25 | #define ptep_establish(__vma, __address, __ptep, __entry) \ | ||
26 | do { \ | ||
27 | set_pte_atomic(__ptep, __entry); \ | ||
28 | flush_tlb_page(__vma, __address); \ | ||
29 | } while (0) | ||
30 | #endif /* __HAVE_ARCH_SET_PTE_ATOMIC */ | ||
31 | #endif | 23 | #endif |
32 | 24 | ||
33 | #ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS | 25 | #ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS |
@@ -112,8 +104,13 @@ do { \ | |||
112 | }) | 104 | }) |
113 | #endif | 105 | #endif |
114 | 106 | ||
115 | #ifndef __HAVE_ARCH_PTE_CLEAR_FULL | 107 | /* |
116 | #define pte_clear_full(__mm, __address, __ptep, __full) \ | 108 | * Some architectures may be able to avoid expensive synchronization |
109 | * primitives when modifications are made to PTE's which are already | ||
110 | * not present, or in the process of an address space destruction. | ||
111 | */ | ||
112 | #ifndef __HAVE_ARCH_PTE_CLEAR_NOT_PRESENT_FULL | ||
113 | #define pte_clear_not_present_full(__mm, __address, __ptep, __full) \ | ||
117 | do { \ | 114 | do { \ |
118 | pte_clear((__mm), (__address), (__ptep)); \ | 115 | pte_clear((__mm), (__address), (__ptep)); \ |
119 | } while (0) | 116 | } while (0) |
@@ -166,6 +163,26 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addres | |||
166 | #endif | 163 | #endif |
167 | 164 | ||
168 | /* | 165 | /* |
166 | * A facility to provide lazy MMU batching. This allows PTE updates and | ||
167 | * page invalidations to be delayed until a call to leave lazy MMU mode | ||
168 | * is issued. Some architectures may benefit from doing this, and it is | ||
169 | * beneficial for both shadow and direct mode hypervisors, which may batch | ||
170 | * the PTE updates which happen during this window. Note that using this | ||
171 | * interface requires that read hazards be removed from the code. A read | ||
172 | * hazard could result in the direct mode hypervisor case, since the actual | ||
173 | * write to the page tables may not yet have taken place, so reads though | ||
174 | * a raw PTE pointer after it has been modified are not guaranteed to be | ||
175 | * up to date. This mode can only be entered and left under the protection of | ||
176 | * the page table locks for all page tables which may be modified. In the UP | ||
177 | * case, this is required so that preemption is disabled, and in the SMP case, | ||
178 | * it must synchronize the delayed page table writes properly on other CPUs. | ||
179 | */ | ||
180 | #ifndef __HAVE_ARCH_ENTER_LAZY_MMU_MODE | ||
181 | #define arch_enter_lazy_mmu_mode() do {} while (0) | ||
182 | #define arch_leave_lazy_mmu_mode() do {} while (0) | ||
183 | #endif | ||
184 | |||
185 | /* | ||
169 | * When walking page tables, get the address of the next boundary, | 186 | * When walking page tables, get the address of the next boundary, |
170 | * or the end address of the range if that comes earlier. Although no | 187 | * or the end address of the range if that comes earlier. Although no |
171 | * vma end wraps to 0, rounded up __boundary may wrap to 0 throughout. | 188 | * vma end wraps to 0, rounded up __boundary may wrap to 0 throughout. |
diff --git a/include/asm-h8300/keyboard.h b/include/asm-h8300/keyboard.h index fbad65e8a5c0..90efbd655390 100644 --- a/include/asm-h8300/keyboard.h +++ b/include/asm-h8300/keyboard.h | |||
@@ -18,14 +18,6 @@ | |||
18 | #define kbd_enable_irq(x...) do {;} while (0) | 18 | #define kbd_enable_irq(x...) do {;} while (0) |
19 | #define kbd_disable_irq(x...) do {;} while (0) | 19 | #define kbd_disable_irq(x...) do {;} while (0) |
20 | 20 | ||
21 | |||
22 | /* needed if MAGIC_SYSRQ is enabled for serial console */ | ||
23 | #ifndef SYSRQ_KEY | ||
24 | #define SYSRQ_KEY ((unsigned char)(-1)) | ||
25 | #define kbd_sysrq_xlate ((unsigned char *)NULL) | ||
26 | #endif | ||
27 | |||
28 | |||
29 | #endif /* _H8300_KEYBOARD_H */ | 21 | #endif /* _H8300_KEYBOARD_H */ |
30 | 22 | ||
31 | 23 | ||
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/mca_dma.h b/include/asm-i386/mca_dma.h index 4b3b526c5a3f..fbb1f3b71279 100644 --- a/include/asm-i386/mca_dma.h +++ b/include/asm-i386/mca_dma.h | |||
@@ -181,7 +181,7 @@ static __inline__ void mca_set_dma_io(unsigned int dmanr, unsigned int io_addr) | |||
181 | * @mode: mode to set | 181 | * @mode: mode to set |
182 | * | 182 | * |
183 | * The DMA controller supports several modes. The mode values you can | 183 | * The DMA controller supports several modes. The mode values you can |
184 | * set are : | 184 | * set are- |
185 | * | 185 | * |
186 | * %MCA_DMA_MODE_READ when reading from the DMA device. | 186 | * %MCA_DMA_MODE_READ when reading from the DMA device. |
187 | * | 187 | * |
@@ -190,7 +190,6 @@ static __inline__ void mca_set_dma_io(unsigned int dmanr, unsigned int io_addr) | |||
190 | * %MCA_DMA_MODE_IO to do DMA to or from an I/O port. | 190 | * %MCA_DMA_MODE_IO to do DMA to or from an I/O port. |
191 | * | 191 | * |
192 | * %MCA_DMA_MODE_16 to do 16bit transfers. | 192 | * %MCA_DMA_MODE_16 to do 16bit transfers. |
193 | * | ||
194 | */ | 193 | */ |
195 | 194 | ||
196 | static __inline__ void mca_set_dma_mode(unsigned int dmanr, unsigned int mode) | 195 | static __inline__ void mca_set_dma_mode(unsigned int dmanr, unsigned int mode) |
diff --git a/include/asm-i386/nmi.h b/include/asm-i386/nmi.h index 303bcd4592bb..269d315719ca 100644 --- a/include/asm-i386/nmi.h +++ b/include/asm-i386/nmi.h | |||
@@ -36,4 +36,10 @@ extern unsigned int nmi_watchdog; | |||
36 | #define NMI_LOCAL_APIC 2 | 36 | #define NMI_LOCAL_APIC 2 |
37 | #define NMI_INVALID 3 | 37 | #define NMI_INVALID 3 |
38 | 38 | ||
39 | struct ctl_table; | ||
40 | struct file; | ||
41 | extern int proc_nmi_enabled(struct ctl_table *, int , struct file *, | ||
42 | void __user *, size_t *, loff_t *); | ||
43 | extern int unknown_nmi_panic; | ||
44 | |||
39 | #endif /* ASM_NMI_H */ | 45 | #endif /* ASM_NMI_H */ |
diff --git a/include/asm-i386/pgtable-2level.h b/include/asm-i386/pgtable-2level.h index 201c86a6711e..8d8d3b9ecdb0 100644 --- a/include/asm-i386/pgtable-2level.h +++ b/include/asm-i386/pgtable-2level.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #define set_pte(pteptr, pteval) (*(pteptr) = pteval) | 16 | #define set_pte(pteptr, pteval) (*(pteptr) = pteval) |
17 | #define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) | 17 | #define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) |
18 | #define set_pte_atomic(pteptr, pteval) set_pte(pteptr,pteval) | 18 | #define set_pte_atomic(pteptr, pteval) set_pte(pteptr,pteval) |
19 | #define set_pte_present(mm,addr,ptep,pteval) set_pte_at(mm,addr,ptep,pteval) | ||
19 | #define set_pmd(pmdptr, pmdval) (*(pmdptr) = (pmdval)) | 20 | #define set_pmd(pmdptr, pmdval) (*(pmdptr) = (pmdval)) |
20 | 21 | ||
21 | #define pte_clear(mm,addr,xp) do { set_pte_at(mm, addr, xp, __pte(0)); } while (0) | 22 | #define pte_clear(mm,addr,xp) do { set_pte_at(mm, addr, xp, __pte(0)); } while (0) |
diff --git a/include/asm-i386/pgtable-3level.h b/include/asm-i386/pgtable-3level.h index 0d899173232e..c2d701ea35be 100644 --- a/include/asm-i386/pgtable-3level.h +++ b/include/asm-i386/pgtable-3level.h | |||
@@ -58,7 +58,21 @@ static inline void set_pte(pte_t *ptep, pte_t pte) | |||
58 | } | 58 | } |
59 | #define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) | 59 | #define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) |
60 | 60 | ||
61 | #define __HAVE_ARCH_SET_PTE_ATOMIC | 61 | /* |
62 | * Since this is only called on user PTEs, and the page fault handler | ||
63 | * must handle the already racy situation of simultaneous page faults, | ||
64 | * we are justified in merely clearing the PTE present bit, followed | ||
65 | * by a set. The ordering here is important. | ||
66 | */ | ||
67 | static inline void set_pte_present(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pte) | ||
68 | { | ||
69 | ptep->pte_low = 0; | ||
70 | smp_wmb(); | ||
71 | ptep->pte_high = pte.pte_high; | ||
72 | smp_wmb(); | ||
73 | ptep->pte_low = pte.pte_low; | ||
74 | } | ||
75 | |||
62 | #define set_pte_atomic(pteptr,pteval) \ | 76 | #define set_pte_atomic(pteptr,pteval) \ |
63 | set_64bit((unsigned long long *)(pteptr),pte_val(pteval)) | 77 | set_64bit((unsigned long long *)(pteptr),pte_val(pteval)) |
64 | #define set_pmd(pmdptr,pmdval) \ | 78 | #define set_pmd(pmdptr,pmdval) \ |
diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h index 541b3e234335..7d398f493dde 100644 --- a/include/asm-i386/pgtable.h +++ b/include/asm-i386/pgtable.h | |||
@@ -247,6 +247,23 @@ static inline pte_t pte_mkhuge(pte_t pte) { (pte).pte_low |= _PAGE_PSE; return p | |||
247 | #endif | 247 | #endif |
248 | 248 | ||
249 | /* | 249 | /* |
250 | * Rules for using pte_update - it must be called after any PTE update which | ||
251 | * has not been done using the set_pte / clear_pte interfaces. It is used by | ||
252 | * shadow mode hypervisors to resynchronize the shadow page tables. Kernel PTE | ||
253 | * updates should either be sets, clears, or set_pte_atomic for P->P | ||
254 | * transitions, which means this hook should only be called for user PTEs. | ||
255 | * This hook implies a P->P protection or access change has taken place, which | ||
256 | * requires a subsequent TLB flush. The notification can optionally be delayed | ||
257 | * until the TLB flush event by using the pte_update_defer form of the | ||
258 | * interface, but care must be taken to assure that the flush happens while | ||
259 | * still holding the same page table lock so that the shadow and primary pages | ||
260 | * do not become out of sync on SMP. | ||
261 | */ | ||
262 | #define pte_update(mm, addr, ptep) do { } while (0) | ||
263 | #define pte_update_defer(mm, addr, ptep) do { } while (0) | ||
264 | |||
265 | |||
266 | /* | ||
250 | * We only update the dirty/accessed state if we set | 267 | * We only update the dirty/accessed state if we set |
251 | * the dirty bit by hand in the kernel, since the hardware | 268 | * the dirty bit by hand in the kernel, since the hardware |
252 | * will do the accessed bit for us, and we don't want to | 269 | * will do the accessed bit for us, and we don't want to |
@@ -258,25 +275,54 @@ static inline pte_t pte_mkhuge(pte_t pte) { (pte).pte_low |= _PAGE_PSE; return p | |||
258 | do { \ | 275 | do { \ |
259 | if (dirty) { \ | 276 | if (dirty) { \ |
260 | (ptep)->pte_low = (entry).pte_low; \ | 277 | (ptep)->pte_low = (entry).pte_low; \ |
278 | pte_update_defer((vma)->vm_mm, (addr), (ptep)); \ | ||
261 | flush_tlb_page(vma, address); \ | 279 | flush_tlb_page(vma, address); \ |
262 | } \ | 280 | } \ |
263 | } while (0) | 281 | } while (0) |
264 | 282 | ||
283 | /* | ||
284 | * We don't actually have these, but we want to advertise them so that | ||
285 | * we can encompass the flush here. | ||
286 | */ | ||
265 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY | 287 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY |
266 | static inline int ptep_test_and_clear_dirty(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) | ||
267 | { | ||
268 | if (!pte_dirty(*ptep)) | ||
269 | return 0; | ||
270 | return test_and_clear_bit(_PAGE_BIT_DIRTY, &ptep->pte_low); | ||
271 | } | ||
272 | |||
273 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG | 288 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG |
274 | static inline int ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) | 289 | |
275 | { | 290 | /* |
276 | if (!pte_young(*ptep)) | 291 | * Rules for using ptep_establish: the pte MUST be a user pte, and |
277 | return 0; | 292 | * must be a present->present transition. |
278 | return test_and_clear_bit(_PAGE_BIT_ACCESSED, &ptep->pte_low); | 293 | */ |
279 | } | 294 | #define __HAVE_ARCH_PTEP_ESTABLISH |
295 | #define ptep_establish(vma, address, ptep, pteval) \ | ||
296 | do { \ | ||
297 | set_pte_present((vma)->vm_mm, address, ptep, pteval); \ | ||
298 | flush_tlb_page(vma, address); \ | ||
299 | } while (0) | ||
300 | |||
301 | #define __HAVE_ARCH_PTEP_CLEAR_DIRTY_FLUSH | ||
302 | #define ptep_clear_flush_dirty(vma, address, ptep) \ | ||
303 | ({ \ | ||
304 | int __dirty; \ | ||
305 | __dirty = pte_dirty(*(ptep)); \ | ||
306 | if (__dirty) { \ | ||
307 | clear_bit(_PAGE_BIT_DIRTY, &(ptep)->pte_low); \ | ||
308 | pte_update_defer((vma)->vm_mm, (addr), (ptep)); \ | ||
309 | flush_tlb_page(vma, address); \ | ||
310 | } \ | ||
311 | __dirty; \ | ||
312 | }) | ||
313 | |||
314 | #define __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH | ||
315 | #define ptep_clear_flush_young(vma, address, ptep) \ | ||
316 | ({ \ | ||
317 | int __young; \ | ||
318 | __young = pte_young(*(ptep)); \ | ||
319 | if (__young) { \ | ||
320 | clear_bit(_PAGE_BIT_ACCESSED, &(ptep)->pte_low); \ | ||
321 | pte_update_defer((vma)->vm_mm, (addr), (ptep)); \ | ||
322 | flush_tlb_page(vma, address); \ | ||
323 | } \ | ||
324 | __young; \ | ||
325 | }) | ||
280 | 326 | ||
281 | #define __HAVE_ARCH_PTEP_GET_AND_CLEAR_FULL | 327 | #define __HAVE_ARCH_PTEP_GET_AND_CLEAR_FULL |
282 | static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm, unsigned long addr, pte_t *ptep, int full) | 328 | static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm, unsigned long addr, pte_t *ptep, int full) |
@@ -295,6 +341,7 @@ static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm, unsigned long | |||
295 | static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep) | 341 | static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep) |
296 | { | 342 | { |
297 | clear_bit(_PAGE_BIT_RW, &ptep->pte_low); | 343 | clear_bit(_PAGE_BIT_RW, &ptep->pte_low); |
344 | pte_update(mm, addr, ptep); | ||
298 | } | 345 | } |
299 | 346 | ||
300 | /* | 347 | /* |
@@ -426,6 +473,13 @@ extern pte_t *lookup_address(unsigned long address); | |||
426 | #define pte_unmap_nested(pte) do { } while (0) | 473 | #define pte_unmap_nested(pte) do { } while (0) |
427 | #endif | 474 | #endif |
428 | 475 | ||
476 | /* Clear a kernel PTE and flush it from the TLB */ | ||
477 | #define kpte_clear_flush(ptep, vaddr) \ | ||
478 | do { \ | ||
479 | pte_clear(&init_mm, vaddr, ptep); \ | ||
480 | __flush_tlb_one(vaddr); \ | ||
481 | } while (0) | ||
482 | |||
429 | /* | 483 | /* |
430 | * The i386 doesn't have any external MMU info: the kernel page | 484 | * The i386 doesn't have any external MMU info: the kernel page |
431 | * tables contain all the necessary information. | 485 | * tables contain all the necessary information. |
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/smp.h b/include/asm-i386/smp.h index 915c26a31b79..6aa1206f6e2a 100644 --- a/include/asm-i386/smp.h +++ b/include/asm-i386/smp.h | |||
@@ -84,6 +84,7 @@ static inline int hard_smp_processor_id(void) | |||
84 | #endif | 84 | #endif |
85 | #endif | 85 | #endif |
86 | 86 | ||
87 | extern int safe_smp_processor_id(void); | ||
87 | extern int __cpu_disable(void); | 88 | extern int __cpu_disable(void); |
88 | extern void __cpu_die(unsigned int cpu); | 89 | extern void __cpu_die(unsigned int cpu); |
89 | extern unsigned int num_processors; | 90 | extern unsigned int num_processors; |
@@ -92,6 +93,7 @@ extern unsigned int num_processors; | |||
92 | 93 | ||
93 | #else /* CONFIG_SMP */ | 94 | #else /* CONFIG_SMP */ |
94 | 95 | ||
96 | #define safe_smp_processor_id() 0 | ||
95 | #define cpu_physical_id(cpu) boot_cpu_physical_apicid | 97 | #define cpu_physical_id(cpu) boot_cpu_physical_apicid |
96 | 98 | ||
97 | #define NO_PROC_ID 0xFF /* No processor magic marker */ | 99 | #define NO_PROC_ID 0xFF /* No processor magic marker */ |
diff --git a/include/asm-i386/spinlock.h b/include/asm-i386/spinlock.h index b0b3043f05e1..c18b71fae6b3 100644 --- a/include/asm-i386/spinlock.h +++ b/include/asm-i386/spinlock.h | |||
@@ -205,4 +205,8 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw) | |||
205 | : "+m" (rw->lock) : : "memory"); | 205 | : "+m" (rw->lock) : : "memory"); |
206 | } | 206 | } |
207 | 207 | ||
208 | #define _raw_spin_relax(lock) cpu_relax() | ||
209 | #define _raw_read_relax(lock) cpu_relax() | ||
210 | #define _raw_write_relax(lock) cpu_relax() | ||
211 | |||
208 | #endif /* __ASM_SPINLOCK_H */ | 212 | #endif /* __ASM_SPINLOCK_H */ |
diff --git a/include/asm-i386/topology.h b/include/asm-i386/topology.h index 6adbd9b1ae88..978d09596130 100644 --- a/include/asm-i386/topology.h +++ b/include/asm-i386/topology.h | |||
@@ -74,6 +74,7 @@ static inline int node_to_first_cpu(int node) | |||
74 | #define SD_NODE_INIT (struct sched_domain) { \ | 74 | #define SD_NODE_INIT (struct sched_domain) { \ |
75 | .span = CPU_MASK_NONE, \ | 75 | .span = CPU_MASK_NONE, \ |
76 | .parent = NULL, \ | 76 | .parent = NULL, \ |
77 | .child = NULL, \ | ||
77 | .groups = NULL, \ | 78 | .groups = NULL, \ |
78 | .min_interval = 8, \ | 79 | .min_interval = 8, \ |
79 | .max_interval = 32, \ | 80 | .max_interval = 32, \ |
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/spinlock.h b/include/asm-ia64/spinlock.h index 9e83210dc312..ff857e31738a 100644 --- a/include/asm-ia64/spinlock.h +++ b/include/asm-ia64/spinlock.h | |||
@@ -213,4 +213,8 @@ static inline int __raw_read_trylock(raw_rwlock_t *x) | |||
213 | return (u32)ia64_cmpxchg4_acq((__u32 *)(x), new.word, old.word) == old.word; | 213 | return (u32)ia64_cmpxchg4_acq((__u32 *)(x), new.word, old.word) == old.word; |
214 | } | 214 | } |
215 | 215 | ||
216 | #define _raw_spin_relax(lock) cpu_relax() | ||
217 | #define _raw_read_relax(lock) cpu_relax() | ||
218 | #define _raw_write_relax(lock) cpu_relax() | ||
219 | |||
216 | #endif /* _ASM_IA64_SPINLOCK_H */ | 220 | #endif /* _ASM_IA64_SPINLOCK_H */ |
diff --git a/include/asm-ia64/topology.h b/include/asm-ia64/topology.h index 937c21257523..a6e38565ab4c 100644 --- a/include/asm-ia64/topology.h +++ b/include/asm-ia64/topology.h | |||
@@ -59,6 +59,7 @@ void build_cpu_to_node_map(void); | |||
59 | #define SD_CPU_INIT (struct sched_domain) { \ | 59 | #define SD_CPU_INIT (struct sched_domain) { \ |
60 | .span = CPU_MASK_NONE, \ | 60 | .span = CPU_MASK_NONE, \ |
61 | .parent = NULL, \ | 61 | .parent = NULL, \ |
62 | .child = NULL, \ | ||
62 | .groups = NULL, \ | 63 | .groups = NULL, \ |
63 | .min_interval = 1, \ | 64 | .min_interval = 1, \ |
64 | .max_interval = 4, \ | 65 | .max_interval = 4, \ |
@@ -84,6 +85,7 @@ void build_cpu_to_node_map(void); | |||
84 | #define SD_NODE_INIT (struct sched_domain) { \ | 85 | #define SD_NODE_INIT (struct sched_domain) { \ |
85 | .span = CPU_MASK_NONE, \ | 86 | .span = CPU_MASK_NONE, \ |
86 | .parent = NULL, \ | 87 | .parent = NULL, \ |
88 | .child = NULL, \ | ||
87 | .groups = NULL, \ | 89 | .groups = NULL, \ |
88 | .min_interval = 8, \ | 90 | .min_interval = 8, \ |
89 | .max_interval = 8*(min(num_online_cpus(), 32)), \ | 91 | .max_interval = 8*(min(num_online_cpus(), 32)), \ |
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/pgtable-2level.h b/include/asm-m32r/pgtable-2level.h index 6a674e3d37a2..84152760e0b5 100644 --- a/include/asm-m32r/pgtable-2level.h +++ b/include/asm-m32r/pgtable-2level.h | |||
@@ -44,7 +44,7 @@ static inline int pgd_present(pgd_t pgd) { return 1; } | |||
44 | */ | 44 | */ |
45 | #define set_pte(pteptr, pteval) (*(pteptr) = pteval) | 45 | #define set_pte(pteptr, pteval) (*(pteptr) = pteval) |
46 | #define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) | 46 | #define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) |
47 | #define set_pte_atomic(pteptr, pteval) set_pte(pteptr, pteval) | 47 | |
48 | /* | 48 | /* |
49 | * (pmds are folded into pgds so this doesnt get actually called, | 49 | * (pmds are folded into pgds so this doesnt get actually called, |
50 | * but the define is needed for a generic inline function.) | 50 | * but the define is needed for a generic inline function.) |
diff --git a/include/asm-m32r/spinlock.h b/include/asm-m32r/spinlock.h index f9f90727a4a1..f5cfba81ee10 100644 --- a/include/asm-m32r/spinlock.h +++ b/include/asm-m32r/spinlock.h | |||
@@ -316,4 +316,8 @@ static inline int __raw_write_trylock(raw_rwlock_t *lock) | |||
316 | return 0; | 316 | return 0; |
317 | } | 317 | } |
318 | 318 | ||
319 | #define _raw_spin_relax(lock) cpu_relax() | ||
320 | #define _raw_read_relax(lock) cpu_relax() | ||
321 | #define _raw_write_relax(lock) cpu_relax() | ||
322 | |||
319 | #endif /* _ASM_M32R_SPINLOCK_H */ | 323 | #endif /* _ASM_M32R_SPINLOCK_H */ |
diff --git a/include/asm-m32r/timex.h b/include/asm-m32r/timex.h index e89bfd17db51..019441c1d7a0 100644 --- a/include/asm-m32r/timex.h +++ b/include/asm-m32r/timex.h | |||
@@ -12,9 +12,6 @@ | |||
12 | 12 | ||
13 | #define CLOCK_TICK_RATE (CONFIG_BUS_CLOCK / CONFIG_TIMER_DIVIDE) | 13 | #define CLOCK_TICK_RATE (CONFIG_BUS_CLOCK / CONFIG_TIMER_DIVIDE) |
14 | #define CLOCK_TICK_FACTOR 20 /* Factor of both 1000000 and CLOCK_TICK_RATE */ | 14 | #define CLOCK_TICK_FACTOR 20 /* Factor of both 1000000 and CLOCK_TICK_RATE */ |
15 | #define FINETUNE ((((((long)LATCH * HZ - CLOCK_TICK_RATE) << SHIFT_HZ) * \ | ||
16 | (1000000/CLOCK_TICK_FACTOR) / (CLOCK_TICK_RATE/CLOCK_TICK_FACTOR)) \ | ||
17 | << (SHIFT_SCALE-SHIFT_HZ)) / HZ) | ||
18 | 15 | ||
19 | #ifdef __KERNEL__ | 16 | #ifdef __KERNEL__ |
20 | /* | 17 | /* |
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/mach-ip27/topology.h b/include/asm-mips/mach-ip27/topology.h index 59d26b52ba32..a13b715fd9ca 100644 --- a/include/asm-mips/mach-ip27/topology.h +++ b/include/asm-mips/mach-ip27/topology.h | |||
@@ -22,6 +22,7 @@ extern unsigned char __node_distances[MAX_COMPACT_NODES][MAX_COMPACT_NODES]; | |||
22 | #define SD_NODE_INIT (struct sched_domain) { \ | 22 | #define SD_NODE_INIT (struct sched_domain) { \ |
23 | .span = CPU_MASK_NONE, \ | 23 | .span = CPU_MASK_NONE, \ |
24 | .parent = NULL, \ | 24 | .parent = NULL, \ |
25 | .child = NULL, \ | ||
25 | .groups = NULL, \ | 26 | .groups = NULL, \ |
26 | .min_interval = 8, \ | 27 | .min_interval = 8, \ |
27 | .max_interval = 32, \ | 28 | .max_interval = 32, \ |
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/spinlock.h b/include/asm-mips/spinlock.h index 4c1a1b53aeaf..c8d5587467bb 100644 --- a/include/asm-mips/spinlock.h +++ b/include/asm-mips/spinlock.h | |||
@@ -328,4 +328,8 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw) | |||
328 | } | 328 | } |
329 | 329 | ||
330 | 330 | ||
331 | #define _raw_spin_relax(lock) cpu_relax() | ||
332 | #define _raw_read_relax(lock) cpu_relax() | ||
333 | #define _raw_write_relax(lock) cpu_relax() | ||
334 | |||
331 | #endif /* _ASM_SPINLOCK_H */ | 335 | #endif /* _ASM_SPINLOCK_H */ |
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/spinlock.h b/include/asm-parisc/spinlock.h index a93960e232cf..e1825530365d 100644 --- a/include/asm-parisc/spinlock.h +++ b/include/asm-parisc/spinlock.h | |||
@@ -152,4 +152,8 @@ static __inline__ int __raw_write_can_lock(raw_rwlock_t *rw) | |||
152 | return !rw->counter; | 152 | return !rw->counter; |
153 | } | 153 | } |
154 | 154 | ||
155 | #define _raw_spin_relax(lock) cpu_relax() | ||
156 | #define _raw_read_relax(lock) cpu_relax() | ||
157 | #define _raw_write_relax(lock) cpu_relax() | ||
158 | |||
155 | #endif /* __ASM_SPINLOCK_H */ | 159 | #endif /* __ASM_SPINLOCK_H */ |
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/fs_pd.h b/include/asm-powerpc/fs_pd.h new file mode 100644 index 000000000000..3d0e819d37f1 --- /dev/null +++ b/include/asm-powerpc/fs_pd.h | |||
@@ -0,0 +1,45 @@ | |||
1 | /* | ||
2 | * Platform information definitions. | ||
3 | * | ||
4 | * 2006 (c) MontaVista Software, Inc. | ||
5 | * Vitaly Bordug <vbordug@ru.mvista.com> | ||
6 | * | ||
7 | * This file is licensed under the terms of the GNU General Public License | ||
8 | * version 2. This program is licensed "as is" without any warranty of any | ||
9 | * kind, whether express or implied. | ||
10 | */ | ||
11 | |||
12 | #ifndef FS_PD_H | ||
13 | #define FS_PD_H | ||
14 | #include <asm/cpm2.h> | ||
15 | #include <sysdev/fsl_soc.h> | ||
16 | #include <asm/time.h> | ||
17 | |||
18 | static inline int uart_baudrate(void) | ||
19 | { | ||
20 | return get_baudrate(); | ||
21 | } | ||
22 | |||
23 | static inline int uart_clock(void) | ||
24 | { | ||
25 | return ppc_proc_freq; | ||
26 | } | ||
27 | |||
28 | #define cpm2_map(member) \ | ||
29 | ({ \ | ||
30 | u32 offset = offsetof(cpm2_map_t, member); \ | ||
31 | void *addr = ioremap (CPM_MAP_ADDR + offset, \ | ||
32 | sizeof( ((cpm2_map_t*)0)->member)); \ | ||
33 | addr; \ | ||
34 | }) | ||
35 | |||
36 | #define cpm2_map_size(member, size) \ | ||
37 | ({ \ | ||
38 | u32 offset = offsetof(cpm2_map_t, member); \ | ||
39 | void *addr = ioremap (CPM_MAP_ADDR + offset, size); \ | ||
40 | addr; \ | ||
41 | }) | ||
42 | |||
43 | #define cpm2_unmap(addr) iounmap(addr) | ||
44 | |||
45 | #endif | ||
diff --git a/include/asm-powerpc/io.h b/include/asm-powerpc/io.h index 46bae1cf385b..cbbd8c648df1 100644 --- a/include/asm-powerpc/io.h +++ b/include/asm-powerpc/io.h | |||
@@ -11,6 +11,7 @@ | |||
11 | 11 | ||
12 | /* Check of existence of legacy devices */ | 12 | /* Check of existence of legacy devices */ |
13 | extern int check_legacy_ioport(unsigned long base_port); | 13 | extern int check_legacy_ioport(unsigned long base_port); |
14 | #define PNPBIOS_BASE 0xf000 /* only relevant for PReP */ | ||
14 | 15 | ||
15 | #ifndef CONFIG_PPC64 | 16 | #ifndef CONFIG_PPC64 |
16 | #include <asm-ppc/io.h> | 17 | #include <asm-ppc/io.h> |
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/mpc85xx.h b/include/asm-powerpc/mpc85xx.h new file mode 100644 index 000000000000..ccdb8a21138f --- /dev/null +++ b/include/asm-powerpc/mpc85xx.h | |||
@@ -0,0 +1,53 @@ | |||
1 | /* | ||
2 | * include/asm-powerpc/mpc85xx.h | ||
3 | * | ||
4 | * MPC85xx definitions | ||
5 | * | ||
6 | * Maintainer: Kumar Gala <galak@kernel.crashing.org> | ||
7 | * | ||
8 | * Copyright 2004 Freescale Semiconductor, Inc | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify it | ||
11 | * under the terms of the GNU General Public License as published by the | ||
12 | * Free Software Foundation; either version 2 of the License, or (at your | ||
13 | * option) any later version. | ||
14 | */ | ||
15 | |||
16 | #ifdef __KERNEL__ | ||
17 | #ifndef __ASM_MPC85xx_H__ | ||
18 | #define __ASM_MPC85xx_H__ | ||
19 | |||
20 | #include <asm/mmu.h> | ||
21 | |||
22 | #ifdef CONFIG_85xx | ||
23 | |||
24 | #if defined(CONFIG_MPC8540_ADS) || defined(CONFIG_MPC8560_ADS) | ||
25 | #include <platforms/85xx/mpc85xx_ads.h> | ||
26 | #endif | ||
27 | #if defined(CONFIG_MPC8555_CDS) || defined(CONFIG_MPC8548_CDS) | ||
28 | #include <platforms/85xx/mpc8555_cds.h> | ||
29 | #endif | ||
30 | #ifdef CONFIG_MPC85xx_CDS | ||
31 | #include <platforms/85xx/mpc85xx_cds.h> | ||
32 | #endif | ||
33 | |||
34 | #define _IO_BASE isa_io_base | ||
35 | #define _ISA_MEM_BASE isa_mem_base | ||
36 | #ifdef CONFIG_PCI | ||
37 | #define PCI_DRAM_OFFSET pci_dram_offset | ||
38 | #else | ||
39 | #define PCI_DRAM_OFFSET 0 | ||
40 | #endif | ||
41 | |||
42 | /* Let modules/drivers get at CCSRBAR */ | ||
43 | extern phys_addr_t get_ccsrbar(void); | ||
44 | |||
45 | #ifdef MODULE | ||
46 | #define CCSRBAR get_ccsrbar() | ||
47 | #else | ||
48 | #define CCSRBAR BOARD_CCSRBAR | ||
49 | #endif | ||
50 | |||
51 | #endif /* CONFIG_85xx */ | ||
52 | #endif /* __ASM_MPC85xx_H__ */ | ||
53 | #endif /* __KERNEL__ */ | ||
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/spinlock.h b/include/asm-powerpc/spinlock.h index c31e4382a775..cc4cfceac67c 100644 --- a/include/asm-powerpc/spinlock.h +++ b/include/asm-powerpc/spinlock.h | |||
@@ -285,5 +285,9 @@ static __inline__ void __raw_write_unlock(raw_rwlock_t *rw) | |||
285 | rw->lock = 0; | 285 | rw->lock = 0; |
286 | } | 286 | } |
287 | 287 | ||
288 | #define _raw_spin_relax(lock) __spin_yield(lock) | ||
289 | #define _raw_read_relax(lock) __rw_yield(lock) | ||
290 | #define _raw_write_relax(lock) __rw_yield(lock) | ||
291 | |||
288 | #endif /* __KERNEL__ */ | 292 | #endif /* __KERNEL__ */ |
289 | #endif /* __ASM_SPINLOCK_H */ | 293 | #endif /* __ASM_SPINLOCK_H */ |
diff --git a/include/asm-powerpc/time.h b/include/asm-powerpc/time.h index 5785ac4737b5..b051d4c88c3b 100644 --- a/include/asm-powerpc/time.h +++ b/include/asm-powerpc/time.h | |||
@@ -39,6 +39,10 @@ extern void generic_calibrate_decr(void); | |||
39 | extern void wakeup_decrementer(void); | 39 | extern void wakeup_decrementer(void); |
40 | extern void snapshot_timebase(void); | 40 | extern void snapshot_timebase(void); |
41 | 41 | ||
42 | #ifdef CONFIG_RTC_CLASS | ||
43 | extern int __init rtc_class_hookup(void); | ||
44 | #endif | ||
45 | |||
42 | /* Some sane defaults: 125 MHz timebase, 1GHz processor */ | 46 | /* Some sane defaults: 125 MHz timebase, 1GHz processor */ |
43 | extern unsigned long ppc_proc_freq; | 47 | extern unsigned long ppc_proc_freq; |
44 | #define DEFAULT_PROC_FREQ (DEFAULT_TB_FREQ * 8) | 48 | #define DEFAULT_PROC_FREQ (DEFAULT_TB_FREQ * 8) |
@@ -234,4 +238,4 @@ extern void snapshot_timebases(void); | |||
234 | #endif | 238 | #endif |
235 | 239 | ||
236 | #endif /* __KERNEL__ */ | 240 | #endif /* __KERNEL__ */ |
237 | #endif /* __PPC64_TIME_H */ | 241 | #endif /* __POWERPC_TIME_H */ |
diff --git a/include/asm-powerpc/topology.h b/include/asm-powerpc/topology.h index bbc3844b086f..8f7ee16781a4 100644 --- a/include/asm-powerpc/topology.h +++ b/include/asm-powerpc/topology.h | |||
@@ -43,6 +43,7 @@ extern int pcibus_to_node(struct pci_bus *bus); | |||
43 | #define SD_NODE_INIT (struct sched_domain) { \ | 43 | #define SD_NODE_INIT (struct sched_domain) { \ |
44 | .span = CPU_MASK_NONE, \ | 44 | .span = CPU_MASK_NONE, \ |
45 | .parent = NULL, \ | 45 | .parent = NULL, \ |
46 | .child = NULL, \ | ||
46 | .groups = NULL, \ | 47 | .groups = NULL, \ |
47 | .min_interval = 8, \ | 48 | .min_interval = 8, \ |
48 | .max_interval = 32, \ | 49 | .max_interval = 32, \ |
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-ppc/cpm2.h b/include/asm-ppc/cpm2.h index f6a7ff04ffe5..220cc2debe08 100644 --- a/include/asm-ppc/cpm2.h +++ b/include/asm-ppc/cpm2.h | |||
@@ -42,6 +42,8 @@ | |||
42 | #define CPM_CR_IDMA4_SBLOCK (0x17) | 42 | #define CPM_CR_IDMA4_SBLOCK (0x17) |
43 | #define CPM_CR_MCC1_SBLOCK (0x1c) | 43 | #define CPM_CR_MCC1_SBLOCK (0x1c) |
44 | 44 | ||
45 | #define CPM_CR_FCC_SBLOCK(x) (x + 0x10) | ||
46 | |||
45 | #define CPM_CR_SCC1_PAGE (0x00) | 47 | #define CPM_CR_SCC1_PAGE (0x00) |
46 | #define CPM_CR_SCC2_PAGE (0x01) | 48 | #define CPM_CR_SCC2_PAGE (0x01) |
47 | #define CPM_CR_SCC3_PAGE (0x02) | 49 | #define CPM_CR_SCC3_PAGE (0x02) |
@@ -62,6 +64,8 @@ | |||
62 | #define CPM_CR_MCC1_PAGE (0x07) | 64 | #define CPM_CR_MCC1_PAGE (0x07) |
63 | #define CPM_CR_MCC2_PAGE (0x08) | 65 | #define CPM_CR_MCC2_PAGE (0x08) |
64 | 66 | ||
67 | #define CPM_CR_FCC_PAGE(x) (x + 0x04) | ||
68 | |||
65 | /* Some opcodes (there are more...later) | 69 | /* Some opcodes (there are more...later) |
66 | */ | 70 | */ |
67 | #define CPM_CR_INIT_TRX ((ushort)0x0000) | 71 | #define CPM_CR_INIT_TRX ((ushort)0x0000) |
@@ -173,6 +177,10 @@ typedef struct cpm_buf_desc { | |||
173 | #define PROFF_I2C_BASE ((uint)0x8afc) | 177 | #define PROFF_I2C_BASE ((uint)0x8afc) |
174 | #define PROFF_IDMA4_BASE ((uint)0x8afe) | 178 | #define PROFF_IDMA4_BASE ((uint)0x8afe) |
175 | 179 | ||
180 | #define PROFF_SCC_SIZE ((uint)0x100) | ||
181 | #define PROFF_FCC_SIZE ((uint)0x100) | ||
182 | #define PROFF_SMC_SIZE ((uint)64) | ||
183 | |||
176 | /* The SMCs are relocated to any of the first eight DPRAM pages. | 184 | /* The SMCs are relocated to any of the first eight DPRAM pages. |
177 | * We will fix these at the first locations of DPRAM, until we | 185 | * We will fix these at the first locations of DPRAM, until we |
178 | * get some microcode patches :-). | 186 | * get some microcode patches :-). |
@@ -1186,7 +1194,60 @@ typedef struct im_idma { | |||
1186 | #define FCC_MEM_OFFSET(x) (CPM_FCC_SPECIAL_BASE + (x*128)) | 1194 | #define FCC_MEM_OFFSET(x) (CPM_FCC_SPECIAL_BASE + (x*128)) |
1187 | #define FCC1_MEM_OFFSET FCC_MEM_OFFSET(0) | 1195 | #define FCC1_MEM_OFFSET FCC_MEM_OFFSET(0) |
1188 | #define FCC2_MEM_OFFSET FCC_MEM_OFFSET(1) | 1196 | #define FCC2_MEM_OFFSET FCC_MEM_OFFSET(1) |
1189 | #define FCC2_MEM_OFFSET FCC_MEM_OFFSET(2) | 1197 | #define FCC3_MEM_OFFSET FCC_MEM_OFFSET(2) |
1198 | |||
1199 | /* Clocks and GRG's */ | ||
1200 | |||
1201 | enum cpm_clk_dir { | ||
1202 | CPM_CLK_RX, | ||
1203 | CPM_CLK_TX, | ||
1204 | CPM_CLK_RTX | ||
1205 | }; | ||
1206 | |||
1207 | enum cpm_clk_target { | ||
1208 | CPM_CLK_SCC1, | ||
1209 | CPM_CLK_SCC2, | ||
1210 | CPM_CLK_SCC3, | ||
1211 | CPM_CLK_SCC4, | ||
1212 | CPM_CLK_FCC1, | ||
1213 | CPM_CLK_FCC2, | ||
1214 | CPM_CLK_FCC3 | ||
1215 | }; | ||
1216 | |||
1217 | enum cpm_clk { | ||
1218 | CPM_CLK_NONE = 0, | ||
1219 | CPM_BRG1, /* Baud Rate Generator 1 */ | ||
1220 | CPM_BRG2, /* Baud Rate Generator 2 */ | ||
1221 | CPM_BRG3, /* Baud Rate Generator 3 */ | ||
1222 | CPM_BRG4, /* Baud Rate Generator 4 */ | ||
1223 | CPM_BRG5, /* Baud Rate Generator 5 */ | ||
1224 | CPM_BRG6, /* Baud Rate Generator 6 */ | ||
1225 | CPM_BRG7, /* Baud Rate Generator 7 */ | ||
1226 | CPM_BRG8, /* Baud Rate Generator 8 */ | ||
1227 | CPM_CLK1, /* Clock 1 */ | ||
1228 | CPM_CLK2, /* Clock 2 */ | ||
1229 | CPM_CLK3, /* Clock 3 */ | ||
1230 | CPM_CLK4, /* Clock 4 */ | ||
1231 | CPM_CLK5, /* Clock 5 */ | ||
1232 | CPM_CLK6, /* Clock 6 */ | ||
1233 | CPM_CLK7, /* Clock 7 */ | ||
1234 | CPM_CLK8, /* Clock 8 */ | ||
1235 | CPM_CLK9, /* Clock 9 */ | ||
1236 | CPM_CLK10, /* Clock 10 */ | ||
1237 | CPM_CLK11, /* Clock 11 */ | ||
1238 | CPM_CLK12, /* Clock 12 */ | ||
1239 | CPM_CLK13, /* Clock 13 */ | ||
1240 | CPM_CLK14, /* Clock 14 */ | ||
1241 | CPM_CLK15, /* Clock 15 */ | ||
1242 | CPM_CLK16, /* Clock 16 */ | ||
1243 | CPM_CLK17, /* Clock 17 */ | ||
1244 | CPM_CLK18, /* Clock 18 */ | ||
1245 | CPM_CLK19, /* Clock 19 */ | ||
1246 | CPM_CLK20, /* Clock 20 */ | ||
1247 | CPM_CLK_DUMMY | ||
1248 | }; | ||
1249 | |||
1250 | extern int cpm2_clk_setup(enum cpm_clk_target target, int clock, int mode); | ||
1190 | 1251 | ||
1191 | #endif /* __CPM2__ */ | 1252 | #endif /* __CPM2__ */ |
1192 | #endif /* __KERNEL__ */ | 1253 | #endif /* __KERNEL__ */ |
diff --git a/include/asm-ppc/fs_pd.h b/include/asm-ppc/fs_pd.h new file mode 100644 index 000000000000..8691327653af --- /dev/null +++ b/include/asm-ppc/fs_pd.h | |||
@@ -0,0 +1,36 @@ | |||
1 | /* | ||
2 | * Platform information definitions. | ||
3 | * | ||
4 | * 2006 (c) MontaVista Software, Inc. | ||
5 | * Vitaly Bordug <vbordug@ru.mvista.com> | ||
6 | * | ||
7 | * This file is licensed under the terms of the GNU General Public License | ||
8 | * version 2. This program is licensed "as is" without any warranty of any | ||
9 | * kind, whether express or implied. | ||
10 | */ | ||
11 | |||
12 | #ifndef FS_PD_H | ||
13 | #define FS_PD_H | ||
14 | |||
15 | static inline int uart_baudrate(void) | ||
16 | { | ||
17 | int baud; | ||
18 | bd_t *bd = (bd_t *) __res; | ||
19 | |||
20 | if (bd->bi_baudrate) | ||
21 | baud = bd->bi_baudrate; | ||
22 | else | ||
23 | baud = -1; | ||
24 | return baud; | ||
25 | } | ||
26 | |||
27 | static inline int uart_clock(void) | ||
28 | { | ||
29 | return (((bd_t *) __res)->bi_intfreq); | ||
30 | } | ||
31 | |||
32 | #define cpm2_map(member) (&cpm2_immr->member) | ||
33 | #define cpm2_map_size(member, size) (&cpm2_immr->member) | ||
34 | #define cpm2_unmap(addr) do {} while(0) | ||
35 | |||
36 | #endif | ||
diff --git a/include/asm-ppc/rheap.h b/include/asm-ppc/rheap.h index e6ca1f67cedc..65b93225a778 100644 --- a/include/asm-ppc/rheap.h +++ b/include/asm-ppc/rheap.h | |||
@@ -62,6 +62,10 @@ extern int rh_attach_region(rh_info_t * info, void *start, int size); | |||
62 | /* Detach a free region */ | 62 | /* Detach a free region */ |
63 | extern void *rh_detach_region(rh_info_t * info, void *start, int size); | 63 | extern void *rh_detach_region(rh_info_t * info, void *start, int size); |
64 | 64 | ||
65 | /* Allocate the given size from the remote heap (with alignment) */ | ||
66 | extern void *rh_alloc_align(rh_info_t * info, int size, int alignment, | ||
67 | const char *owner); | ||
68 | |||
65 | /* Allocate the given size from the remote heap */ | 69 | /* Allocate the given size from the remote heap */ |
66 | extern void *rh_alloc(rh_info_t * info, int size, const char *owner); | 70 | extern void *rh_alloc(rh_info_t * info, int size, const char *owner); |
67 | 71 | ||
diff --git a/include/asm-ppc/spinlock.h b/include/asm-ppc/spinlock.h index 5c64b75f0295..fccaf5531e57 100644 --- a/include/asm-ppc/spinlock.h +++ b/include/asm-ppc/spinlock.h | |||
@@ -161,4 +161,8 @@ static __inline__ void __raw_write_unlock(raw_rwlock_t *rw) | |||
161 | rw->lock = 0; | 161 | rw->lock = 0; |
162 | } | 162 | } |
163 | 163 | ||
164 | #define _raw_spin_relax(lock) cpu_relax() | ||
165 | #define _raw_read_relax(lock) cpu_relax() | ||
166 | #define _raw_write_relax(lock) cpu_relax() | ||
167 | |||
164 | #endif /* __ASM_SPINLOCK_H */ | 168 | #endif /* __ASM_SPINLOCK_H */ |
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/setup.h b/include/asm-s390/setup.h index f1959732b6fd..5d72eda8a11b 100644 --- a/include/asm-s390/setup.h +++ b/include/asm-s390/setup.h | |||
@@ -39,6 +39,7 @@ extern unsigned long machine_flags; | |||
39 | #define MACHINE_IS_P390 (machine_flags & 4) | 39 | #define MACHINE_IS_P390 (machine_flags & 4) |
40 | #define MACHINE_HAS_MVPG (machine_flags & 16) | 40 | #define MACHINE_HAS_MVPG (machine_flags & 16) |
41 | #define MACHINE_HAS_IDTE (machine_flags & 128) | 41 | #define MACHINE_HAS_IDTE (machine_flags & 128) |
42 | #define MACHINE_HAS_DIAG9C (machine_flags & 256) | ||
42 | 43 | ||
43 | #ifndef __s390x__ | 44 | #ifndef __s390x__ |
44 | #define MACHINE_HAS_IEEE (machine_flags & 2) | 45 | #define MACHINE_HAS_IEEE (machine_flags & 2) |
diff --git a/include/asm-s390/spinlock.h b/include/asm-s390/spinlock.h index ce3edf6d63b3..6b78af16999b 100644 --- a/include/asm-s390/spinlock.h +++ b/include/asm-s390/spinlock.h | |||
@@ -13,6 +13,8 @@ | |||
13 | 13 | ||
14 | #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2) | 14 | #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2) |
15 | 15 | ||
16 | #include <linux/smp.h> | ||
17 | |||
16 | static inline int | 18 | static inline int |
17 | _raw_compare_and_swap(volatile unsigned int *lock, | 19 | _raw_compare_and_swap(volatile unsigned int *lock, |
18 | unsigned int old, unsigned int new) | 20 | unsigned int old, unsigned int new) |
@@ -50,34 +52,46 @@ _raw_compare_and_swap(volatile unsigned int *lock, | |||
50 | * (the type definitions are in asm/spinlock_types.h) | 52 | * (the type definitions are in asm/spinlock_types.h) |
51 | */ | 53 | */ |
52 | 54 | ||
53 | #define __raw_spin_is_locked(x) ((x)->lock != 0) | 55 | #define __raw_spin_is_locked(x) ((x)->owner_cpu != 0) |
54 | #define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock) | 56 | #define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock) |
55 | #define __raw_spin_unlock_wait(lock) \ | 57 | #define __raw_spin_unlock_wait(lock) \ |
56 | do { while (__raw_spin_is_locked(lock)) cpu_relax(); } while (0) | 58 | do { while (__raw_spin_is_locked(lock)) \ |
59 | _raw_spin_relax(lock); } while (0) | ||
57 | 60 | ||
58 | extern void _raw_spin_lock_wait(raw_spinlock_t *lp, unsigned int pc); | 61 | extern void _raw_spin_lock_wait(raw_spinlock_t *, unsigned int pc); |
59 | extern int _raw_spin_trylock_retry(raw_spinlock_t *lp, unsigned int pc); | 62 | extern int _raw_spin_trylock_retry(raw_spinlock_t *, unsigned int pc); |
63 | extern void _raw_spin_relax(raw_spinlock_t *lock); | ||
60 | 64 | ||
61 | static inline void __raw_spin_lock(raw_spinlock_t *lp) | 65 | static inline void __raw_spin_lock(raw_spinlock_t *lp) |
62 | { | 66 | { |
63 | unsigned long pc = 1 | (unsigned long) __builtin_return_address(0); | 67 | unsigned long pc = 1 | (unsigned long) __builtin_return_address(0); |
64 | 68 | int old; | |
65 | if (unlikely(_raw_compare_and_swap(&lp->lock, 0, pc) != 0)) | 69 | |
66 | _raw_spin_lock_wait(lp, pc); | 70 | old = _raw_compare_and_swap(&lp->owner_cpu, 0, ~smp_processor_id()); |
71 | if (likely(old == 0)) { | ||
72 | lp->owner_pc = pc; | ||
73 | return; | ||
74 | } | ||
75 | _raw_spin_lock_wait(lp, pc); | ||
67 | } | 76 | } |
68 | 77 | ||
69 | static inline int __raw_spin_trylock(raw_spinlock_t *lp) | 78 | static inline int __raw_spin_trylock(raw_spinlock_t *lp) |
70 | { | 79 | { |
71 | unsigned long pc = 1 | (unsigned long) __builtin_return_address(0); | 80 | unsigned long pc = 1 | (unsigned long) __builtin_return_address(0); |
81 | int old; | ||
72 | 82 | ||
73 | if (likely(_raw_compare_and_swap(&lp->lock, 0, pc) == 0)) | 83 | old = _raw_compare_and_swap(&lp->owner_cpu, 0, ~smp_processor_id()); |
84 | if (likely(old == 0)) { | ||
85 | lp->owner_pc = pc; | ||
74 | return 1; | 86 | return 1; |
87 | } | ||
75 | return _raw_spin_trylock_retry(lp, pc); | 88 | return _raw_spin_trylock_retry(lp, pc); |
76 | } | 89 | } |
77 | 90 | ||
78 | static inline void __raw_spin_unlock(raw_spinlock_t *lp) | 91 | static inline void __raw_spin_unlock(raw_spinlock_t *lp) |
79 | { | 92 | { |
80 | _raw_compare_and_swap(&lp->lock, lp->lock, 0); | 93 | lp->owner_pc = 0; |
94 | _raw_compare_and_swap(&lp->owner_cpu, lp->owner_cpu, 0); | ||
81 | } | 95 | } |
82 | 96 | ||
83 | /* | 97 | /* |
@@ -154,4 +168,7 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw) | |||
154 | return _raw_write_trylock_retry(rw); | 168 | return _raw_write_trylock_retry(rw); |
155 | } | 169 | } |
156 | 170 | ||
171 | #define _raw_read_relax(lock) cpu_relax() | ||
172 | #define _raw_write_relax(lock) cpu_relax() | ||
173 | |||
157 | #endif /* __ASM_SPINLOCK_H */ | 174 | #endif /* __ASM_SPINLOCK_H */ |
diff --git a/include/asm-s390/spinlock_types.h b/include/asm-s390/spinlock_types.h index f79a2216204f..b7ac13f7aa37 100644 --- a/include/asm-s390/spinlock_types.h +++ b/include/asm-s390/spinlock_types.h | |||
@@ -6,16 +6,16 @@ | |||
6 | #endif | 6 | #endif |
7 | 7 | ||
8 | typedef struct { | 8 | typedef struct { |
9 | volatile unsigned int lock; | 9 | volatile unsigned int owner_cpu; |
10 | volatile unsigned int owner_pc; | ||
10 | } __attribute__ ((aligned (4))) raw_spinlock_t; | 11 | } __attribute__ ((aligned (4))) raw_spinlock_t; |
11 | 12 | ||
12 | #define __RAW_SPIN_LOCK_UNLOCKED { 0 } | 13 | #define __RAW_SPIN_LOCK_UNLOCKED { 0 } |
13 | 14 | ||
14 | typedef struct { | 15 | typedef struct { |
15 | volatile unsigned int lock; | 16 | volatile unsigned int lock; |
16 | volatile unsigned int owner_pc; | ||
17 | } raw_rwlock_t; | 17 | } raw_rwlock_t; |
18 | 18 | ||
19 | #define __RAW_RW_LOCK_UNLOCKED { 0, 0 } | 19 | #define __RAW_RW_LOCK_UNLOCKED { 0 } |
20 | 20 | ||
21 | #endif | 21 | #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/.gitignore b/include/asm-sh/.gitignore new file mode 100644 index 000000000000..9218ef82b698 --- /dev/null +++ b/include/asm-sh/.gitignore | |||
@@ -0,0 +1,3 @@ | |||
1 | cpu | ||
2 | mach | ||
3 | machtypes.h | ||
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/cpu-sh3/rtc.h b/include/asm-sh/cpu-sh3/rtc.h deleted file mode 100644 index 2d926671115a..000000000000 --- a/include/asm-sh/cpu-sh3/rtc.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | #ifndef __ASM_CPU_SH3_RTC_H | ||
2 | #define __ASM_CPU_SH3_RTC_H | ||
3 | |||
4 | /* SH-3 RTC */ | ||
5 | #define R64CNT 0xfffffec0 | ||
6 | #define RSECCNT 0xfffffec2 | ||
7 | #define RMINCNT 0xfffffec4 | ||
8 | #define RHRCNT 0xfffffec6 | ||
9 | #define RWKCNT 0xfffffec8 | ||
10 | #define RDAYCNT 0xfffffeca | ||
11 | #define RMONCNT 0xfffffecc | ||
12 | #define RYRCNT 0xfffffece | ||
13 | #define RSECAR 0xfffffed0 | ||
14 | #define RMINAR 0xfffffed2 | ||
15 | #define RHRAR 0xfffffed4 | ||
16 | #define RWKAR 0xfffffed6 | ||
17 | #define RDAYAR 0xfffffed8 | ||
18 | #define RMONAR 0xfffffeda | ||
19 | #define RCR1 0xfffffedc | ||
20 | #define RCR2 0xfffffede | ||
21 | |||
22 | #define RTC_BIT_INVERTED 0 /* No bug on SH7708, SH7709A */ | ||
23 | |||
24 | #endif /* __ASM_CPU_SH3_RTC_H */ | ||
25 | |||
diff --git a/include/asm-sh/cpu-sh4/rtc.h b/include/asm-sh/cpu-sh4/rtc.h deleted file mode 100644 index e091e32a67b7..000000000000 --- a/include/asm-sh/cpu-sh4/rtc.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | #ifndef __ASM_CPU_SH4_RTC_H | ||
2 | #define __ASM_CPU_SH4_RTC_H | ||
3 | |||
4 | /* SH-4 RTC */ | ||
5 | #define R64CNT 0xffc80000 | ||
6 | #define RSECCNT 0xffc80004 | ||
7 | #define RMINCNT 0xffc80008 | ||
8 | #define RHRCNT 0xffc8000c | ||
9 | #define RWKCNT 0xffc80010 | ||
10 | #define RDAYCNT 0xffc80014 | ||
11 | #define RMONCNT 0xffc80018 | ||
12 | #define RYRCNT 0xffc8001c /* 16bit */ | ||
13 | #define RSECAR 0xffc80020 | ||
14 | #define RMINAR 0xffc80024 | ||
15 | #define RHRAR 0xffc80028 | ||
16 | #define RWKAR 0xffc8002c | ||
17 | #define RDAYAR 0xffc80030 | ||
18 | #define RMONAR 0xffc80034 | ||
19 | #define RCR1 0xffc80038 | ||
20 | #define RCR2 0xffc8003c | ||
21 | |||
22 | #define RTC_BIT_INVERTED 0x40 /* bug on SH7750, SH7750S */ | ||
23 | |||
24 | #endif /* __ASM_CPU_SH4_RTC_H */ | ||
25 | |||
diff --git a/include/asm-sh/ec3104/keyboard.h b/include/asm-sh/ec3104/keyboard.h index 0dee7b05b49d..c1253a683197 100644 --- a/include/asm-sh/ec3104/keyboard.h +++ b/include/asm-sh/ec3104/keyboard.h | |||
@@ -6,8 +6,6 @@ extern char ec3104_kbd_unexpected_up(unsigned char); | |||
6 | extern void ec3104_kbd_leds(unsigned char); | 6 | extern void ec3104_kbd_leds(unsigned char); |
7 | extern void ec3104_kbd_init_hw(void); | 7 | extern void ec3104_kbd_init_hw(void); |
8 | 8 | ||
9 | #define SYSRQ_KEY 0x54 | ||
10 | |||
11 | #define kbd_sysrq_xlate ec3104_kbd_sysrq_xlate | 9 | #define kbd_sysrq_xlate ec3104_kbd_sysrq_xlate |
12 | #define kbd_setkeycode ec3104_kbd_setkeycode | 10 | #define kbd_setkeycode ec3104_kbd_setkeycode |
13 | #define kbd_getkeycode ec3104_kbd_getkeycode | 11 | #define kbd_getkeycode ec3104_kbd_getkeycode |
diff --git a/include/asm-sh/elf.h b/include/asm-sh/elf.h index 3a07ab40ac4d..fc050fd7645e 100644 --- a/include/asm-sh/elf.h +++ b/include/asm-sh/elf.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef __ASM_SH_ELF_H | 1 | #ifndef __ASM_SH_ELF_H |
2 | #define __ASM_SH_ELF_H | 2 | #define __ASM_SH_ELF_H |
3 | 3 | ||
4 | #include <asm/processor.h> | ||
5 | #include <asm/auxvec.h> | 4 | #include <asm/auxvec.h> |
6 | #include <asm/ptrace.h> | 5 | #include <asm/ptrace.h> |
7 | #include <asm/user.h> | 6 | #include <asm/user.h> |
diff --git a/include/asm-sh/hs7751rvoip/io.h b/include/asm-sh/hs7751rvoip/io.h deleted file mode 100644 index 513c8514001b..000000000000 --- a/include/asm-sh/hs7751rvoip/io.h +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-sh/hs7751rvoip/hs7751rvoip.h | ||
3 | * | ||
4 | * Modified version of io_se.h for the hs7751rvoip-specific functions. | ||
5 | * | ||
6 | * May be copied or modified under the terms of the GNU General Public | ||
7 | * License. See linux/COPYING for more information. | ||
8 | * | ||
9 | * IO functions for an Renesas Technology sales HS7751RVOIP | ||
10 | */ | ||
11 | |||
12 | #ifndef _ASM_SH_IO_HS7751RVOIP_H | ||
13 | #define _ASM_SH_IO_HS7751RVOIP_H | ||
14 | |||
15 | #include <asm/io_generic.h> | ||
16 | |||
17 | extern unsigned char hs7751rvoip_inb(unsigned long port); | ||
18 | extern unsigned short hs7751rvoip_inw(unsigned long port); | ||
19 | extern unsigned int hs7751rvoip_inl(unsigned long port); | ||
20 | |||
21 | extern void hs7751rvoip_outb(unsigned char value, unsigned long port); | ||
22 | extern void hs7751rvoip_outw(unsigned short value, unsigned long port); | ||
23 | extern void hs7751rvoip_outl(unsigned int value, unsigned long port); | ||
24 | |||
25 | extern unsigned char hs7751rvoip_inb_p(unsigned long port); | ||
26 | extern void hs7751rvoip_outb_p(unsigned char value, unsigned long port); | ||
27 | |||
28 | extern void hs7751rvoip_insb(unsigned long port, void *addr, unsigned long count); | ||
29 | extern void hs7751rvoip_insw(unsigned long port, void *addr, unsigned long count); | ||
30 | extern void hs7751rvoip_insl(unsigned long port, void *addr, unsigned long count); | ||
31 | extern void hs7751rvoip_outsb(unsigned long port, const void *addr, unsigned long count); | ||
32 | extern void hs7751rvoip_outsw(unsigned long port, const void *addr, unsigned long count); | ||
33 | extern void hs7751rvoip_outsl(unsigned long port, const void *addr, unsigned long count); | ||
34 | |||
35 | extern void *hs7751rvoip_ioremap(unsigned long offset, unsigned long size); | ||
36 | |||
37 | extern unsigned long hs7751rvoip_isa_port2addr(unsigned long offset); | ||
38 | |||
39 | #endif /* _ASM_SH_IO_HS7751RVOIP_H */ | ||
diff --git a/include/asm-sh/mpc1211/keyboard.h b/include/asm-sh/mpc1211/keyboard.h index 71ef4cf4242d..9020feee7b4c 100644 --- a/include/asm-sh/mpc1211/keyboard.h +++ b/include/asm-sh/mpc1211/keyboard.h | |||
@@ -24,7 +24,6 @@ extern void pckbd_leds(unsigned char leds); | |||
24 | extern void pckbd_init_hw(void); | 24 | extern void pckbd_init_hw(void); |
25 | extern int pckbd_pm_resume(struct pm_dev *, pm_request_t, void *); | 25 | extern int pckbd_pm_resume(struct pm_dev *, pm_request_t, void *); |
26 | extern pm_callback pm_kbd_request_override; | 26 | extern pm_callback pm_kbd_request_override; |
27 | extern unsigned char pckbd_sysrq_xlate[128]; | ||
28 | 27 | ||
29 | #define kbd_setkeycode pckbd_setkeycode | 28 | #define kbd_setkeycode pckbd_setkeycode |
30 | #define kbd_getkeycode pckbd_getkeycode | 29 | #define kbd_getkeycode pckbd_getkeycode |
@@ -32,9 +31,6 @@ extern unsigned char pckbd_sysrq_xlate[128]; | |||
32 | #define kbd_unexpected_up pckbd_unexpected_up | 31 | #define kbd_unexpected_up pckbd_unexpected_up |
33 | #define kbd_leds pckbd_leds | 32 | #define kbd_leds pckbd_leds |
34 | #define kbd_init_hw pckbd_init_hw | 33 | #define kbd_init_hw pckbd_init_hw |
35 | #define kbd_sysrq_xlate pckbd_sysrq_xlate | ||
36 | |||
37 | #define SYSRQ_KEY 0x54 | ||
38 | 34 | ||
39 | /* resource allocation */ | 35 | /* resource allocation */ |
40 | #define kbd_request_region() | 36 | #define kbd_request_region() |
diff --git a/include/asm-sh/rts7751r2d/io.h b/include/asm-sh/rts7751r2d/io.h deleted file mode 100644 index 241094020567..000000000000 --- a/include/asm-sh/rts7751r2d/io.h +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-sh/io_rts7751r2d.h | ||
3 | * | ||
4 | * Modified version of io_se.h for the rts7751r2d-specific functions. | ||
5 | * | ||
6 | * May be copied or modified under the terms of the GNU General Public | ||
7 | * License. See linux/COPYING for more information. | ||
8 | * | ||
9 | * IO functions for an Renesas Technology sales RTS7751R2D | ||
10 | */ | ||
11 | |||
12 | #ifndef _ASM_SH_IO_RTS7751R2D_H | ||
13 | #define _ASM_SH_IO_RTS7751R2D_H | ||
14 | |||
15 | extern unsigned char rts7751r2d_inb(unsigned long port); | ||
16 | extern unsigned short rts7751r2d_inw(unsigned long port); | ||
17 | extern unsigned int rts7751r2d_inl(unsigned long port); | ||
18 | |||
19 | extern void rts7751r2d_outb(unsigned char value, unsigned long port); | ||
20 | extern void rts7751r2d_outw(unsigned short value, unsigned long port); | ||
21 | extern void rts7751r2d_outl(unsigned int value, unsigned long port); | ||
22 | |||
23 | extern unsigned char rts7751r2d_inb_p(unsigned long port); | ||
24 | extern void rts7751r2d_outb_p(unsigned char value, unsigned long port); | ||
25 | |||
26 | extern void rts7751r2d_insb(unsigned long port, void *addr, unsigned long count); | ||
27 | extern void rts7751r2d_insw(unsigned long port, void *addr, unsigned long count); | ||
28 | extern void rts7751r2d_insl(unsigned long port, void *addr, unsigned long count); | ||
29 | extern void rts7751r2d_outsb(unsigned long port, const void *addr, unsigned long count); | ||
30 | extern void rts7751r2d_outsw(unsigned long port, const void *addr, unsigned long count); | ||
31 | extern void rts7751r2d_outsl(unsigned long port, const void *addr, unsigned long count); | ||
32 | |||
33 | extern void *rts7751r2d_ioremap(unsigned long offset, unsigned long size); | ||
34 | |||
35 | extern unsigned long rts7751r2d_isa_port2addr(unsigned long offset); | ||
36 | |||
37 | #endif /* _ASM_SH_IO_RTS7751R2D_H */ | ||
diff --git a/include/asm-sh/rts7751r2d/rts7751r2d.h b/include/asm-sh/rts7751r2d/rts7751r2d.h index b112ae221fd1..796b8fcb81a8 100644 --- a/include/asm-sh/rts7751r2d/rts7751r2d.h +++ b/include/asm-sh/rts7751r2d/rts7751r2d.h | |||
@@ -68,4 +68,7 @@ | |||
68 | #define IRQ_PCISLOT2 10 /* PCI Slot #2 IRQ */ | 68 | #define IRQ_PCISLOT2 10 /* PCI Slot #2 IRQ */ |
69 | #define IRQ_EXTENTION 11 /* EXTn IRQ */ | 69 | #define IRQ_EXTENTION 11 /* EXTn IRQ */ |
70 | 70 | ||
71 | #define __IO_PREFIX rts7751r2d | ||
72 | #include <asm/io_generic.h> | ||
73 | |||
71 | #endif /* __ASM_SH_RENESAS_RTS7751R2D */ | 74 | #endif /* __ASM_SH_RENESAS_RTS7751R2D */ |
diff --git a/include/asm-sh/sfp-machine.h b/include/asm-sh/sfp-machine.h index 8a6399a8cfe0..d3c548443f2a 100644 --- a/include/asm-sh/sfp-machine.h +++ b/include/asm-sh/sfp-machine.h | |||
@@ -25,8 +25,6 @@ | |||
25 | #ifndef _SFP_MACHINE_H | 25 | #ifndef _SFP_MACHINE_H |
26 | #define _SFP_MACHINE_H | 26 | #define _SFP_MACHINE_H |
27 | 27 | ||
28 | #include <linux/config.h> | ||
29 | |||
30 | #define _FP_W_TYPE_SIZE 32 | 28 | #define _FP_W_TYPE_SIZE 32 |
31 | #define _FP_W_TYPE unsigned long | 29 | #define _FP_W_TYPE unsigned long |
32 | #define _FP_WS_TYPE signed long | 30 | #define _FP_WS_TYPE signed long |
diff --git a/include/asm-sh/spinlock.h b/include/asm-sh/spinlock.h index 846322d4c35d..2586eef07d57 100644 --- a/include/asm-sh/spinlock.h +++ b/include/asm-sh/spinlock.h | |||
@@ -88,7 +88,14 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw) | |||
88 | __raw_spin_unlock(&rw->lock); | 88 | __raw_spin_unlock(&rw->lock); |
89 | } | 89 | } |
90 | 90 | ||
91 | #define __raw_read_trylock(lock) generic__raw_read_trylock(lock) | 91 | static inline int __raw_read_trylock(raw_rwlock_t *lock) |
92 | { | ||
93 | atomic_t *count = (atomic_t*)lock; | ||
94 | if (atomic_dec_return(count) >= 0) | ||
95 | return 1; | ||
96 | atomic_inc(count); | ||
97 | return 0; | ||
98 | } | ||
92 | 99 | ||
93 | static inline int __raw_write_trylock(raw_rwlock_t *rw) | 100 | static inline int __raw_write_trylock(raw_rwlock_t *rw) |
94 | { | 101 | { |
@@ -100,4 +107,8 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw) | |||
100 | return 0; | 107 | return 0; |
101 | } | 108 | } |
102 | 109 | ||
110 | #define _raw_spin_relax(lock) cpu_relax() | ||
111 | #define _raw_read_relax(lock) cpu_relax() | ||
112 | #define _raw_write_relax(lock) cpu_relax() | ||
113 | |||
103 | #endif /* __ASM_SH_SPINLOCK_H */ | 114 | #endif /* __ASM_SH_SPINLOCK_H */ |
diff --git a/include/asm-sh/string.h b/include/asm-sh/string.h index 3e0cff04caec..95bc7db006b0 100644 --- a/include/asm-sh/string.h +++ b/include/asm-sh/string.h | |||
@@ -1,13 +1,15 @@ | |||
1 | #ifndef __ASM_SH_STRING_H | 1 | #ifndef __ASM_SH_STRING_H |
2 | #define __ASM_SH_STRING_H | 2 | #define __ASM_SH_STRING_H |
3 | 3 | ||
4 | #ifdef __KERNEL__ | ||
5 | |||
4 | /* | 6 | /* |
5 | * Copyright (C) 1999 Niibe Yutaka | 7 | * Copyright (C) 1999 Niibe Yutaka |
6 | * But consider these trivial functions to be public domain. | 8 | * But consider these trivial functions to be public domain. |
7 | */ | 9 | */ |
8 | 10 | ||
9 | #define __HAVE_ARCH_STRCPY | 11 | #define __HAVE_ARCH_STRCPY |
10 | static __inline__ char *strcpy(char *__dest, const char *__src) | 12 | static inline char *strcpy(char *__dest, const char *__src) |
11 | { | 13 | { |
12 | register char *__xdest = __dest; | 14 | register char *__xdest = __dest; |
13 | unsigned long __dummy; | 15 | unsigned long __dummy; |
@@ -26,7 +28,7 @@ static __inline__ char *strcpy(char *__dest, const char *__src) | |||
26 | } | 28 | } |
27 | 29 | ||
28 | #define __HAVE_ARCH_STRNCPY | 30 | #define __HAVE_ARCH_STRNCPY |
29 | static __inline__ char *strncpy(char *__dest, const char *__src, size_t __n) | 31 | static inline char *strncpy(char *__dest, const char *__src, size_t __n) |
30 | { | 32 | { |
31 | register char *__xdest = __dest; | 33 | register char *__xdest = __dest; |
32 | unsigned long __dummy; | 34 | unsigned long __dummy; |
@@ -52,7 +54,7 @@ static __inline__ char *strncpy(char *__dest, const char *__src, size_t __n) | |||
52 | } | 54 | } |
53 | 55 | ||
54 | #define __HAVE_ARCH_STRCMP | 56 | #define __HAVE_ARCH_STRCMP |
55 | static __inline__ int strcmp(const char *__cs, const char *__ct) | 57 | static inline int strcmp(const char *__cs, const char *__ct) |
56 | { | 58 | { |
57 | register int __res; | 59 | register int __res; |
58 | unsigned long __dummy; | 60 | unsigned long __dummy; |
@@ -78,7 +80,7 @@ static __inline__ int strcmp(const char *__cs, const char *__ct) | |||
78 | } | 80 | } |
79 | 81 | ||
80 | #define __HAVE_ARCH_STRNCMP | 82 | #define __HAVE_ARCH_STRNCMP |
81 | static __inline__ int strncmp(const char *__cs, const char *__ct, size_t __n) | 83 | static inline int strncmp(const char *__cs, const char *__ct, size_t __n) |
82 | { | 84 | { |
83 | register int __res; | 85 | register int __res; |
84 | unsigned long __dummy; | 86 | unsigned long __dummy; |
@@ -124,4 +126,9 @@ extern void *memchr(const void *__s, int __c, size_t __n); | |||
124 | #define __HAVE_ARCH_STRLEN | 126 | #define __HAVE_ARCH_STRLEN |
125 | extern size_t strlen(const char *); | 127 | extern size_t strlen(const char *); |
126 | 128 | ||
129 | /* arch/sh/lib/strcasecmp.c */ | ||
130 | extern int strcasecmp(const char *, const char *); | ||
131 | |||
132 | #endif /* __KERNEL__ */ | ||
133 | |||
127 | #endif /* __ASM_SH_STRING_H */ | 134 | #endif /* __ASM_SH_STRING_H */ |
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/keyboard.h b/include/asm-sh64/keyboard.h index 1fab96d792bf..0b01c3beb2f8 100644 --- a/include/asm-sh64/keyboard.h +++ b/include/asm-sh64/keyboard.h | |||
@@ -30,7 +30,6 @@ extern int pckbd_translate(unsigned char scancode, unsigned char *keycode, | |||
30 | extern char pckbd_unexpected_up(unsigned char keycode); | 30 | extern char pckbd_unexpected_up(unsigned char keycode); |
31 | extern void pckbd_leds(unsigned char leds); | 31 | extern void pckbd_leds(unsigned char leds); |
32 | extern void pckbd_init_hw(void); | 32 | extern void pckbd_init_hw(void); |
33 | extern unsigned char pckbd_sysrq_xlate[128]; | ||
34 | 33 | ||
35 | #define kbd_setkeycode pckbd_setkeycode | 34 | #define kbd_setkeycode pckbd_setkeycode |
36 | #define kbd_getkeycode pckbd_getkeycode | 35 | #define kbd_getkeycode pckbd_getkeycode |
@@ -38,9 +37,6 @@ extern unsigned char pckbd_sysrq_xlate[128]; | |||
38 | #define kbd_unexpected_up pckbd_unexpected_up | 37 | #define kbd_unexpected_up pckbd_unexpected_up |
39 | #define kbd_leds pckbd_leds | 38 | #define kbd_leds pckbd_leds |
40 | #define kbd_init_hw pckbd_init_hw | 39 | #define kbd_init_hw pckbd_init_hw |
41 | #define kbd_sysrq_xlate pckbd_sysrq_xlate | ||
42 | |||
43 | #define SYSRQ_KEY 0x54 | ||
44 | 40 | ||
45 | /* resource allocation */ | 41 | /* resource allocation */ |
46 | #define kbd_request_region() | 42 | #define kbd_request_region() |
diff --git a/include/asm-sh64/timex.h b/include/asm-sh64/timex.h index af0b79269661..163e2b62fe27 100644 --- a/include/asm-sh64/timex.h +++ b/include/asm-sh64/timex.h | |||
@@ -17,9 +17,6 @@ | |||
17 | 17 | ||
18 | #define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ | 18 | #define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ |
19 | #define CLOCK_TICK_FACTOR 20 /* Factor of both 1000000 and CLOCK_TICK_RATE */ | 19 | #define CLOCK_TICK_FACTOR 20 /* Factor of both 1000000 and CLOCK_TICK_RATE */ |
20 | #define FINETUNE ((((((long)LATCH * HZ - CLOCK_TICK_RATE) << SHIFT_HZ) * \ | ||
21 | (1000000/CLOCK_TICK_FACTOR) / (CLOCK_TICK_RATE/CLOCK_TICK_FACTOR)) \ | ||
22 | << (SHIFT_SCALE-SHIFT_HZ)) / HZ) | ||
23 | 20 | ||
24 | typedef unsigned long cycles_t; | 21 | typedef unsigned long cycles_t; |
25 | 22 | ||
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/spinlock.h b/include/asm-sparc/spinlock.h index 1c75474ba1df..557d08959d2f 100644 --- a/include/asm-sparc/spinlock.h +++ b/include/asm-sparc/spinlock.h | |||
@@ -154,6 +154,10 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw) | |||
154 | #define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock) | 154 | #define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock) |
155 | #define __raw_read_trylock(lock) generic__raw_read_trylock(lock) | 155 | #define __raw_read_trylock(lock) generic__raw_read_trylock(lock) |
156 | 156 | ||
157 | #define _raw_spin_relax(lock) cpu_relax() | ||
158 | #define _raw_read_relax(lock) cpu_relax() | ||
159 | #define _raw_write_relax(lock) cpu_relax() | ||
160 | |||
157 | #define __raw_read_can_lock(rw) (!((rw)->lock & 0xff)) | 161 | #define __raw_read_can_lock(rw) (!((rw)->lock & 0xff)) |
158 | #define __raw_write_can_lock(rw) (!(rw)->lock) | 162 | #define __raw_write_can_lock(rw) (!(rw)->lock) |
159 | 163 | ||
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/compat_signal.h b/include/asm-sparc64/compat_signal.h new file mode 100644 index 000000000000..7aefa301321e --- /dev/null +++ b/include/asm-sparc64/compat_signal.h | |||
@@ -0,0 +1,30 @@ | |||
1 | #ifndef _COMPAT_SIGNAL_H | ||
2 | #define _COMPAT_SIGNAL_H | ||
3 | |||
4 | #include <linux/config.h> | ||
5 | #include <linux/compat.h> | ||
6 | #include <asm/signal.h> | ||
7 | |||
8 | #ifdef CONFIG_COMPAT | ||
9 | struct __new_sigaction32 { | ||
10 | unsigned sa_handler; | ||
11 | unsigned int sa_flags; | ||
12 | unsigned sa_restorer; /* not used by Linux/SPARC yet */ | ||
13 | compat_sigset_t sa_mask; | ||
14 | }; | ||
15 | |||
16 | struct __old_sigaction32 { | ||
17 | unsigned sa_handler; | ||
18 | compat_old_sigset_t sa_mask; | ||
19 | unsigned int sa_flags; | ||
20 | unsigned sa_restorer; /* not used by Linux/SPARC yet */ | ||
21 | }; | ||
22 | |||
23 | typedef struct sigaltstack32 { | ||
24 | u32 ss_sp; | ||
25 | int ss_flags; | ||
26 | compat_size_t ss_size; | ||
27 | } stack_t32; | ||
28 | #endif | ||
29 | |||
30 | #endif /* !(_COMPAT_SIGNAL_H) */ | ||
diff --git a/include/asm-sparc64/signal.h b/include/asm-sparc64/signal.h index 9968871103bc..fa6f467389db 100644 --- a/include/asm-sparc64/signal.h +++ b/include/asm-sparc64/signal.h | |||
@@ -8,7 +8,6 @@ | |||
8 | #ifndef __ASSEMBLY__ | 8 | #ifndef __ASSEMBLY__ |
9 | #include <linux/personality.h> | 9 | #include <linux/personality.h> |
10 | #include <linux/types.h> | 10 | #include <linux/types.h> |
11 | #include <linux/compat.h> | ||
12 | #endif | 11 | #endif |
13 | #endif | 12 | #endif |
14 | 13 | ||
@@ -167,23 +166,6 @@ struct __new_sigaction { | |||
167 | __new_sigset_t sa_mask; | 166 | __new_sigset_t sa_mask; |
168 | }; | 167 | }; |
169 | 168 | ||
170 | #ifdef __KERNEL__ | ||
171 | |||
172 | #ifdef CONFIG_COMPAT | ||
173 | struct __new_sigaction32 { | ||
174 | unsigned sa_handler; | ||
175 | unsigned int sa_flags; | ||
176 | unsigned sa_restorer; /* not used by Linux/SPARC yet */ | ||
177 | compat_sigset_t sa_mask; | ||
178 | }; | ||
179 | #endif | ||
180 | |||
181 | struct k_sigaction { | ||
182 | struct __new_sigaction sa; | ||
183 | void __user *ka_restorer; | ||
184 | }; | ||
185 | #endif | ||
186 | |||
187 | struct __old_sigaction { | 169 | struct __old_sigaction { |
188 | __sighandler_t sa_handler; | 170 | __sighandler_t sa_handler; |
189 | __old_sigset_t sa_mask; | 171 | __old_sigset_t sa_mask; |
@@ -191,19 +173,6 @@ struct __old_sigaction { | |||
191 | void (*sa_restorer)(void); /* not used by Linux/SPARC yet */ | 173 | void (*sa_restorer)(void); /* not used by Linux/SPARC yet */ |
192 | }; | 174 | }; |
193 | 175 | ||
194 | #ifdef __KERNEL__ | ||
195 | |||
196 | #ifdef CONFIG_COMPAT | ||
197 | struct __old_sigaction32 { | ||
198 | unsigned sa_handler; | ||
199 | compat_old_sigset_t sa_mask; | ||
200 | unsigned int sa_flags; | ||
201 | unsigned sa_restorer; /* not used by Linux/SPARC yet */ | ||
202 | }; | ||
203 | #endif | ||
204 | |||
205 | #endif | ||
206 | |||
207 | typedef struct sigaltstack { | 176 | typedef struct sigaltstack { |
208 | void __user *ss_sp; | 177 | void __user *ss_sp; |
209 | int ss_flags; | 178 | int ss_flags; |
@@ -212,13 +181,10 @@ typedef struct sigaltstack { | |||
212 | 181 | ||
213 | #ifdef __KERNEL__ | 182 | #ifdef __KERNEL__ |
214 | 183 | ||
215 | #ifdef CONFIG_COMPAT | 184 | struct k_sigaction { |
216 | typedef struct sigaltstack32 { | 185 | struct __new_sigaction sa; |
217 | u32 ss_sp; | 186 | void __user *ka_restorer; |
218 | int ss_flags; | 187 | }; |
219 | compat_size_t ss_size; | ||
220 | } stack_t32; | ||
221 | #endif | ||
222 | 188 | ||
223 | struct signal_deliver_cookie { | 189 | struct signal_deliver_cookie { |
224 | int restart_syscall; | 190 | int restart_syscall; |
diff --git a/include/asm-sparc64/spinlock.h b/include/asm-sparc64/spinlock.h index bd5ffc76bc7e..0006fe9f8c7a 100644 --- a/include/asm-sparc64/spinlock.h +++ b/include/asm-sparc64/spinlock.h | |||
@@ -241,6 +241,10 @@ static int inline __write_trylock(raw_rwlock_t *lock) | |||
241 | #define __raw_read_can_lock(rw) (!((rw)->lock & 0x80000000UL)) | 241 | #define __raw_read_can_lock(rw) (!((rw)->lock & 0x80000000UL)) |
242 | #define __raw_write_can_lock(rw) (!(rw)->lock) | 242 | #define __raw_write_can_lock(rw) (!(rw)->lock) |
243 | 243 | ||
244 | #define _raw_spin_relax(lock) cpu_relax() | ||
245 | #define _raw_read_relax(lock) cpu_relax() | ||
246 | #define _raw_write_relax(lock) cpu_relax() | ||
247 | |||
244 | #endif /* !(__ASSEMBLY__) */ | 248 | #endif /* !(__ASSEMBLY__) */ |
245 | 249 | ||
246 | #endif /* !(__SPARC64_SPINLOCK_H) */ | 250 | #endif /* !(__SPARC64_SPINLOCK_H) */ |
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/nmi.h b/include/asm-x86_64/nmi.h index cbf2669bca71..f367d4014b42 100644 --- a/include/asm-x86_64/nmi.h +++ b/include/asm-x86_64/nmi.h | |||
@@ -70,4 +70,11 @@ extern unsigned int nmi_watchdog; | |||
70 | #define NMI_LOCAL_APIC 2 | 70 | #define NMI_LOCAL_APIC 2 |
71 | #define NMI_INVALID 3 | 71 | #define NMI_INVALID 3 |
72 | 72 | ||
73 | struct ctl_table; | ||
74 | struct file; | ||
75 | extern int proc_nmi_enabled(struct ctl_table *, int , struct file *, | ||
76 | void __user *, size_t *, loff_t *); | ||
77 | |||
78 | extern int unknown_nmi_panic; | ||
79 | |||
73 | #endif /* ASM_NMI_H */ | 80 | #endif /* ASM_NMI_H */ |
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/semaphore.h b/include/asm-x86_64/semaphore.h index 107bd90429e8..1194888536b9 100644 --- a/include/asm-x86_64/semaphore.h +++ b/include/asm-x86_64/semaphore.h | |||
@@ -132,7 +132,7 @@ static inline int down_interruptible(struct semaphore * sem) | |||
132 | "jns 2f\n\t" | 132 | "jns 2f\n\t" |
133 | "call __down_failed_interruptible\n" | 133 | "call __down_failed_interruptible\n" |
134 | "2:\n" | 134 | "2:\n" |
135 | :"=a" (result), "=m" (sem->count) | 135 | :"=&a" (result), "=m" (sem->count) |
136 | :"D" (sem) | 136 | :"D" (sem) |
137 | :"memory"); | 137 | :"memory"); |
138 | return result; | 138 | return result; |
@@ -153,7 +153,7 @@ static inline int down_trylock(struct semaphore * sem) | |||
153 | "jns 2f\n\t" | 153 | "jns 2f\n\t" |
154 | "call __down_failed_trylock\n\t" | 154 | "call __down_failed_trylock\n\t" |
155 | "2:\n" | 155 | "2:\n" |
156 | :"=a" (result), "=m" (sem->count) | 156 | :"=&a" (result), "=m" (sem->count) |
157 | :"D" (sem) | 157 | :"D" (sem) |
158 | :"memory","cc"); | 158 | :"memory","cc"); |
159 | return result; | 159 | return result; |
diff --git a/include/asm-x86_64/spinlock.h b/include/asm-x86_64/spinlock.h index 3daf5b005905..05ef097ba55b 100644 --- a/include/asm-x86_64/spinlock.h +++ b/include/asm-x86_64/spinlock.h | |||
@@ -133,4 +133,8 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw) | |||
133 | : "=m" (rw->lock) : : "memory"); | 133 | : "=m" (rw->lock) : : "memory"); |
134 | } | 134 | } |
135 | 135 | ||
136 | #define _raw_spin_relax(lock) cpu_relax() | ||
137 | #define _raw_read_relax(lock) cpu_relax() | ||
138 | #define _raw_write_relax(lock) cpu_relax() | ||
139 | |||
136 | #endif /* __ASM_SPINLOCK_H */ | 140 | #endif /* __ASM_SPINLOCK_H */ |
diff --git a/include/asm-x86_64/topology.h b/include/asm-x86_64/topology.h index 6e7a2e976b04..5c8f49280dbc 100644 --- a/include/asm-x86_64/topology.h +++ b/include/asm-x86_64/topology.h | |||
@@ -31,6 +31,7 @@ extern int __node_distance(int, int); | |||
31 | #define SD_NODE_INIT (struct sched_domain) { \ | 31 | #define SD_NODE_INIT (struct sched_domain) { \ |
32 | .span = CPU_MASK_NONE, \ | 32 | .span = CPU_MASK_NONE, \ |
33 | .parent = NULL, \ | 33 | .parent = NULL, \ |
34 | .child = NULL, \ | ||
34 | .groups = NULL, \ | 35 | .groups = NULL, \ |
35 | .min_interval = 8, \ | 36 | .min_interval = 8, \ |
36 | .max_interval = 32, \ | 37 | .max_interval = 32, \ |
diff --git a/include/asm-x86_64/uaccess.h b/include/asm-x86_64/uaccess.h index e856570c0689..19f99178fe83 100644 --- a/include/asm-x86_64/uaccess.h +++ b/include/asm-x86_64/uaccess.h | |||
@@ -361,6 +361,11 @@ __must_check unsigned long clear_user(void __user *mem, unsigned long len); | |||
361 | __must_check unsigned long __clear_user(void __user *mem, unsigned long len); | 361 | __must_check unsigned long __clear_user(void __user *mem, unsigned long len); |
362 | 362 | ||
363 | __must_check long __copy_from_user_inatomic(void *dst, const void __user *src, unsigned size); | 363 | __must_check long __copy_from_user_inatomic(void *dst, const void __user *src, unsigned size); |
364 | #define __copy_to_user_inatomic copy_user_generic | 364 | |
365 | static __must_check __always_inline int | ||
366 | __copy_to_user_inatomic(void __user *dst, const void *src, unsigned size) | ||
367 | { | ||
368 | return copy_user_generic((__force void *)dst, src, size); | ||
369 | } | ||
365 | 370 | ||
366 | #endif /* __X86_64_UACCESS_H */ | 371 | #endif /* __X86_64_UACCESS_H */ |
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-x86_64/vsyscall.h b/include/asm-x86_64/vsyscall.h index 2281e9399b96..fd452fc2c037 100644 --- a/include/asm-x86_64/vsyscall.h +++ b/include/asm-x86_64/vsyscall.h | |||
@@ -17,7 +17,6 @@ enum vsyscall_num { | |||
17 | 17 | ||
18 | #define __section_vxtime __attribute__ ((unused, __section__ (".vxtime"), aligned(16))) | 18 | #define __section_vxtime __attribute__ ((unused, __section__ (".vxtime"), aligned(16))) |
19 | #define __section_vgetcpu_mode __attribute__ ((unused, __section__ (".vgetcpu_mode"), aligned(16))) | 19 | #define __section_vgetcpu_mode __attribute__ ((unused, __section__ (".vgetcpu_mode"), aligned(16))) |
20 | #define __section_wall_jiffies __attribute__ ((unused, __section__ (".wall_jiffies"), aligned(16))) | ||
21 | #define __section_jiffies __attribute__ ((unused, __section__ (".jiffies"), aligned(16))) | 20 | #define __section_jiffies __attribute__ ((unused, __section__ (".jiffies"), aligned(16))) |
22 | #define __section_sys_tz __attribute__ ((unused, __section__ (".sys_tz"), aligned(16))) | 21 | #define __section_sys_tz __attribute__ ((unused, __section__ (".sys_tz"), aligned(16))) |
23 | #define __section_sysctl_vsyscall __attribute__ ((unused, __section__ (".sysctl_vsyscall"), aligned(16))) | 22 | #define __section_sysctl_vsyscall __attribute__ ((unused, __section__ (".sysctl_vsyscall"), aligned(16))) |
@@ -48,14 +47,12 @@ extern struct vxtime_data __vxtime; | |||
48 | extern int __vgetcpu_mode; | 47 | extern int __vgetcpu_mode; |
49 | extern struct timespec __xtime; | 48 | extern struct timespec __xtime; |
50 | extern volatile unsigned long __jiffies; | 49 | extern volatile unsigned long __jiffies; |
51 | extern unsigned long __wall_jiffies; | ||
52 | extern struct timezone __sys_tz; | 50 | extern struct timezone __sys_tz; |
53 | extern seqlock_t __xtime_lock; | 51 | extern seqlock_t __xtime_lock; |
54 | 52 | ||
55 | /* kernel space (writeable) */ | 53 | /* kernel space (writeable) */ |
56 | extern struct vxtime_data vxtime; | 54 | extern struct vxtime_data vxtime; |
57 | extern int vgetcpu_mode; | 55 | extern int vgetcpu_mode; |
58 | extern unsigned long wall_jiffies; | ||
59 | extern struct timezone sys_tz; | 56 | extern struct timezone sys_tz; |
60 | extern int sysctl_vsyscall; | 57 | extern int sysctl_vsyscall; |
61 | extern seqlock_t xtime_lock; | 58 | extern seqlock_t xtime_lock; |
diff --git a/include/asm-xtensa/timex.h b/include/asm-xtensa/timex.h index d14a3755a12b..c7b705e66655 100644 --- a/include/asm-xtensa/timex.h +++ b/include/asm-xtensa/timex.h | |||
@@ -31,9 +31,6 @@ | |||
31 | 31 | ||
32 | #define CLOCK_TICK_RATE 1193180 /* (everyone is using this value) */ | 32 | #define CLOCK_TICK_RATE 1193180 /* (everyone is using this value) */ |
33 | #define CLOCK_TICK_FACTOR 20 /* Factor of both 10^6 and CLOCK_TICK_RATE */ | 33 | #define CLOCK_TICK_FACTOR 20 /* Factor of both 10^6 and CLOCK_TICK_RATE */ |
34 | #define FINETUNE ((((((long)LATCH * HZ - CLOCK_TICK_RATE) << SHIFT_HZ) * \ | ||
35 | (1000000/CLOCK_TICK_FACTOR) / (CLOCK_TICK_RATE/CLOCK_TICK_FACTOR)) \ | ||
36 | << (SHIFT_SCALE-SHIFT_HZ)) / HZ) | ||
37 | 34 | ||
38 | #ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT | 35 | #ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT |
39 | extern unsigned long ccount_per_jiffy; | 36 | extern unsigned long ccount_per_jiffy; |
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/acct.h b/include/linux/acct.h index e86bae7324d2..0496d1f09952 100644 --- a/include/linux/acct.h +++ b/include/linux/acct.h | |||
@@ -124,16 +124,12 @@ extern void acct_auto_close(struct super_block *sb); | |||
124 | extern void acct_init_pacct(struct pacct_struct *pacct); | 124 | extern void acct_init_pacct(struct pacct_struct *pacct); |
125 | extern void acct_collect(long exitcode, int group_dead); | 125 | extern void acct_collect(long exitcode, int group_dead); |
126 | extern void acct_process(void); | 126 | extern void acct_process(void); |
127 | extern void acct_update_integrals(struct task_struct *tsk); | ||
128 | extern void acct_clear_integrals(struct task_struct *tsk); | ||
129 | #else | 127 | #else |
130 | #define acct_auto_close_mnt(x) do { } while (0) | 128 | #define acct_auto_close_mnt(x) do { } while (0) |
131 | #define acct_auto_close(x) do { } while (0) | 129 | #define acct_auto_close(x) do { } while (0) |
132 | #define acct_init_pacct(x) do { } while (0) | 130 | #define acct_init_pacct(x) do { } while (0) |
133 | #define acct_collect(x,y) do { } while (0) | 131 | #define acct_collect(x,y) do { } while (0) |
134 | #define acct_process() do { } while (0) | 132 | #define acct_process() do { } while (0) |
135 | #define acct_update_integrals(x) do { } while (0) | ||
136 | #define acct_clear_integrals(task) do { } while (0) | ||
137 | #endif | 133 | #endif |
138 | 134 | ||
139 | /* | 135 | /* |
diff --git a/include/linux/aio.h b/include/linux/aio.h index 00c8efa95cc3..0d71c0041f13 100644 --- a/include/linux/aio.h +++ b/include/linux/aio.h | |||
@@ -4,8 +4,10 @@ | |||
4 | #include <linux/list.h> | 4 | #include <linux/list.h> |
5 | #include <linux/workqueue.h> | 5 | #include <linux/workqueue.h> |
6 | #include <linux/aio_abi.h> | 6 | #include <linux/aio_abi.h> |
7 | #include <linux/uio.h> | ||
7 | 8 | ||
8 | #include <asm/atomic.h> | 9 | #include <asm/atomic.h> |
10 | #include <linux/uio.h> | ||
9 | 11 | ||
10 | #define AIO_MAXSEGS 4 | 12 | #define AIO_MAXSEGS 4 |
11 | #define AIO_KIOGRP_NR_ATOMIC 8 | 13 | #define AIO_KIOGRP_NR_ATOMIC 8 |
@@ -110,8 +112,10 @@ struct kiocb { | |||
110 | char __user *ki_buf; /* remaining iocb->aio_buf */ | 112 | char __user *ki_buf; /* remaining iocb->aio_buf */ |
111 | size_t ki_left; /* remaining bytes */ | 113 | size_t ki_left; /* remaining bytes */ |
112 | long ki_retried; /* just for testing */ | 114 | long ki_retried; /* just for testing */ |
113 | long ki_kicked; /* just for testing */ | 115 | struct iovec ki_inline_vec; /* inline vector */ |
114 | long ki_queued; /* just for testing */ | 116 | struct iovec *ki_iovec; |
117 | unsigned long ki_nr_segs; | ||
118 | unsigned long ki_cur_seg; | ||
115 | 119 | ||
116 | struct list_head ki_list; /* the aio core uses this | 120 | struct list_head ki_list; /* the aio core uses this |
117 | * for cancellation */ | 121 | * for cancellation */ |
@@ -213,11 +217,11 @@ int FASTCALL(io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb, | |||
213 | struct iocb *iocb)); | 217 | struct iocb *iocb)); |
214 | 218 | ||
215 | #define get_ioctx(kioctx) do { \ | 219 | #define get_ioctx(kioctx) do { \ |
216 | BUG_ON(unlikely(atomic_read(&(kioctx)->users) <= 0)); \ | 220 | BUG_ON(atomic_read(&(kioctx)->users) <= 0); \ |
217 | atomic_inc(&(kioctx)->users); \ | 221 | atomic_inc(&(kioctx)->users); \ |
218 | } while (0) | 222 | } while (0) |
219 | #define put_ioctx(kioctx) do { \ | 223 | #define put_ioctx(kioctx) do { \ |
220 | BUG_ON(unlikely(atomic_read(&(kioctx)->users) <= 0)); \ | 224 | BUG_ON(atomic_read(&(kioctx)->users) <= 0); \ |
221 | if (unlikely(atomic_dec_and_test(&(kioctx)->users))) \ | 225 | if (unlikely(atomic_dec_and_test(&(kioctx)->users))) \ |
222 | __put_ioctx(kioctx); \ | 226 | __put_ioctx(kioctx); \ |
223 | } while (0) | 227 | } while (0) |
diff --git a/include/linux/aio_abi.h b/include/linux/aio_abi.h index 30fdcc89d142..3466b1d0ffd2 100644 --- a/include/linux/aio_abi.h +++ b/include/linux/aio_abi.h | |||
@@ -41,6 +41,8 @@ enum { | |||
41 | * IOCB_CMD_POLL = 5, | 41 | * IOCB_CMD_POLL = 5, |
42 | */ | 42 | */ |
43 | IOCB_CMD_NOOP = 6, | 43 | IOCB_CMD_NOOP = 6, |
44 | IOCB_CMD_PREADV = 7, | ||
45 | IOCB_CMD_PWRITEV = 8, | ||
44 | }; | 46 | }; |
45 | 47 | ||
46 | /* read() from /dev/aio returns these structures. */ | 48 | /* read() from /dev/aio returns these structures. */ |
diff --git a/include/linux/bio.h b/include/linux/bio.h index 76bdaeab6f62..711c321a7011 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -148,6 +148,7 @@ struct bio { | |||
148 | #define BIO_RW_BARRIER 2 | 148 | #define BIO_RW_BARRIER 2 |
149 | #define BIO_RW_FAILFAST 3 | 149 | #define BIO_RW_FAILFAST 3 |
150 | #define BIO_RW_SYNC 4 | 150 | #define BIO_RW_SYNC 4 |
151 | #define BIO_RW_META 5 | ||
151 | 152 | ||
152 | /* | 153 | /* |
153 | * upper 16 bits of bi_rw define the io priority of this bio | 154 | * upper 16 bits of bi_rw define the io priority of this bio |
@@ -178,6 +179,7 @@ struct bio { | |||
178 | #define bio_sync(bio) ((bio)->bi_rw & (1 << BIO_RW_SYNC)) | 179 | #define bio_sync(bio) ((bio)->bi_rw & (1 << BIO_RW_SYNC)) |
179 | #define bio_failfast(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST)) | 180 | #define bio_failfast(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST)) |
180 | #define bio_rw_ahead(bio) ((bio)->bi_rw & (1 << BIO_RW_AHEAD)) | 181 | #define bio_rw_ahead(bio) ((bio)->bi_rw & (1 << BIO_RW_AHEAD)) |
182 | #define bio_rw_meta(bio) ((bio)->bi_rw & (1 << BIO_RW_META)) | ||
181 | 183 | ||
182 | /* | 184 | /* |
183 | * will die | 185 | * will die |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index cfde8b3ee919..1d79b8d4ca6d 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef _LINUX_BLKDEV_H | 1 | #ifndef _LINUX_BLKDEV_H |
2 | #define _LINUX_BLKDEV_H | 2 | #define _LINUX_BLKDEV_H |
3 | 3 | ||
4 | #include <linux/sched.h> | ||
4 | #include <linux/major.h> | 5 | #include <linux/major.h> |
5 | #include <linux/genhd.h> | 6 | #include <linux/genhd.h> |
6 | #include <linux/list.h> | 7 | #include <linux/list.h> |
@@ -16,6 +17,22 @@ | |||
16 | 17 | ||
17 | #include <asm/scatterlist.h> | 18 | #include <asm/scatterlist.h> |
18 | 19 | ||
20 | #ifdef CONFIG_LBD | ||
21 | # include <asm/div64.h> | ||
22 | # define sector_div(a, b) do_div(a, b) | ||
23 | #else | ||
24 | # define sector_div(n, b)( \ | ||
25 | { \ | ||
26 | int _res; \ | ||
27 | _res = (n) % (b); \ | ||
28 | (n) /= (b); \ | ||
29 | _res; \ | ||
30 | } \ | ||
31 | ) | ||
32 | #endif | ||
33 | |||
34 | #ifdef CONFIG_BLOCK | ||
35 | |||
19 | struct scsi_ioctl_command; | 36 | struct scsi_ioctl_command; |
20 | 37 | ||
21 | struct request_queue; | 38 | struct request_queue; |
@@ -90,7 +107,7 @@ struct io_context { | |||
90 | atomic_t refcount; | 107 | atomic_t refcount; |
91 | struct task_struct *task; | 108 | struct task_struct *task; |
92 | 109 | ||
93 | int (*set_ioprio)(struct io_context *, unsigned int); | 110 | unsigned int ioprio_changed; |
94 | 111 | ||
95 | /* | 112 | /* |
96 | * For request batching | 113 | * For request batching |
@@ -104,8 +121,7 @@ struct io_context { | |||
104 | 121 | ||
105 | void put_io_context(struct io_context *ioc); | 122 | void put_io_context(struct io_context *ioc); |
106 | void exit_io_context(void); | 123 | void exit_io_context(void); |
107 | struct io_context *current_io_context(gfp_t gfp_flags); | 124 | struct io_context *get_io_context(gfp_t gfp_flags, int node); |
108 | struct io_context *get_io_context(gfp_t gfp_flags); | ||
109 | void copy_io_context(struct io_context **pdst, struct io_context **psrc); | 125 | void copy_io_context(struct io_context **pdst, struct io_context **psrc); |
110 | void swap_io_context(struct io_context **ioc1, struct io_context **ioc2); | 126 | void swap_io_context(struct io_context **ioc1, struct io_context **ioc2); |
111 | 127 | ||
@@ -120,6 +136,90 @@ struct request_list { | |||
120 | wait_queue_head_t wait[2]; | 136 | wait_queue_head_t wait[2]; |
121 | }; | 137 | }; |
122 | 138 | ||
139 | /* | ||
140 | * request command types | ||
141 | */ | ||
142 | enum rq_cmd_type_bits { | ||
143 | REQ_TYPE_FS = 1, /* fs request */ | ||
144 | REQ_TYPE_BLOCK_PC, /* scsi command */ | ||
145 | REQ_TYPE_SENSE, /* sense request */ | ||
146 | REQ_TYPE_PM_SUSPEND, /* suspend request */ | ||
147 | REQ_TYPE_PM_RESUME, /* resume request */ | ||
148 | REQ_TYPE_PM_SHUTDOWN, /* shutdown request */ | ||
149 | REQ_TYPE_FLUSH, /* flush request */ | ||
150 | REQ_TYPE_SPECIAL, /* driver defined type */ | ||
151 | REQ_TYPE_LINUX_BLOCK, /* generic block layer message */ | ||
152 | /* | ||
153 | * for ATA/ATAPI devices. this really doesn't belong here, ide should | ||
154 | * use REQ_TYPE_SPECIAL and use rq->cmd[0] with the range of driver | ||
155 | * private REQ_LB opcodes to differentiate what type of request this is | ||
156 | */ | ||
157 | REQ_TYPE_ATA_CMD, | ||
158 | REQ_TYPE_ATA_TASK, | ||
159 | REQ_TYPE_ATA_TASKFILE, | ||
160 | }; | ||
161 | |||
162 | /* | ||
163 | * For request of type REQ_TYPE_LINUX_BLOCK, rq->cmd[0] is the opcode being | ||
164 | * sent down (similar to how REQ_TYPE_BLOCK_PC means that ->cmd[] holds a | ||
165 | * SCSI cdb. | ||
166 | * | ||
167 | * 0x00 -> 0x3f are driver private, to be used for whatever purpose they need, | ||
168 | * typically to differentiate REQ_TYPE_SPECIAL requests. | ||
169 | * | ||
170 | */ | ||
171 | enum { | ||
172 | /* | ||
173 | * just examples for now | ||
174 | */ | ||
175 | REQ_LB_OP_EJECT = 0x40, /* eject request */ | ||
176 | REQ_LB_OP_FLUSH = 0x41, /* flush device */ | ||
177 | }; | ||
178 | |||
179 | /* | ||
180 | * request type modified bits. first three bits match BIO_RW* bits, important | ||
181 | */ | ||
182 | enum rq_flag_bits { | ||
183 | __REQ_RW, /* not set, read. set, write */ | ||
184 | __REQ_FAILFAST, /* no low level driver retries */ | ||
185 | __REQ_SORTED, /* elevator knows about this request */ | ||
186 | __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */ | ||
187 | __REQ_HARDBARRIER, /* may not be passed by drive either */ | ||
188 | __REQ_FUA, /* forced unit access */ | ||
189 | __REQ_NOMERGE, /* don't touch this for merging */ | ||
190 | __REQ_STARTED, /* drive already may have started this one */ | ||
191 | __REQ_DONTPREP, /* don't call prep for this one */ | ||
192 | __REQ_QUEUED, /* uses queueing */ | ||
193 | __REQ_ELVPRIV, /* elevator private data attached */ | ||
194 | __REQ_FAILED, /* set if the request failed */ | ||
195 | __REQ_QUIET, /* don't worry about errors */ | ||
196 | __REQ_PREEMPT, /* set for "ide_preempt" requests */ | ||
197 | __REQ_ORDERED_COLOR, /* is before or after barrier */ | ||
198 | __REQ_RW_SYNC, /* request is sync (O_DIRECT) */ | ||
199 | __REQ_ALLOCED, /* request came from our alloc pool */ | ||
200 | __REQ_RW_META, /* metadata io request */ | ||
201 | __REQ_NR_BITS, /* stops here */ | ||
202 | }; | ||
203 | |||
204 | #define REQ_RW (1 << __REQ_RW) | ||
205 | #define REQ_FAILFAST (1 << __REQ_FAILFAST) | ||
206 | #define REQ_SORTED (1 << __REQ_SORTED) | ||
207 | #define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER) | ||
208 | #define REQ_HARDBARRIER (1 << __REQ_HARDBARRIER) | ||
209 | #define REQ_FUA (1 << __REQ_FUA) | ||
210 | #define REQ_NOMERGE (1 << __REQ_NOMERGE) | ||
211 | #define REQ_STARTED (1 << __REQ_STARTED) | ||
212 | #define REQ_DONTPREP (1 << __REQ_DONTPREP) | ||
213 | #define REQ_QUEUED (1 << __REQ_QUEUED) | ||
214 | #define REQ_ELVPRIV (1 << __REQ_ELVPRIV) | ||
215 | #define REQ_FAILED (1 << __REQ_FAILED) | ||
216 | #define REQ_QUIET (1 << __REQ_QUIET) | ||
217 | #define REQ_PREEMPT (1 << __REQ_PREEMPT) | ||
218 | #define REQ_ORDERED_COLOR (1 << __REQ_ORDERED_COLOR) | ||
219 | #define REQ_RW_SYNC (1 << __REQ_RW_SYNC) | ||
220 | #define REQ_ALLOCED (1 << __REQ_ALLOCED) | ||
221 | #define REQ_RW_META (1 << __REQ_RW_META) | ||
222 | |||
123 | #define BLK_MAX_CDB 16 | 223 | #define BLK_MAX_CDB 16 |
124 | 224 | ||
125 | /* | 225 | /* |
@@ -129,30 +229,46 @@ struct request { | |||
129 | struct list_head queuelist; | 229 | struct list_head queuelist; |
130 | struct list_head donelist; | 230 | struct list_head donelist; |
131 | 231 | ||
132 | unsigned long flags; /* see REQ_ bits below */ | 232 | request_queue_t *q; |
233 | |||
234 | unsigned int cmd_flags; | ||
235 | enum rq_cmd_type_bits cmd_type; | ||
133 | 236 | ||
134 | /* Maintain bio traversal state for part by part I/O submission. | 237 | /* Maintain bio traversal state for part by part I/O submission. |
135 | * hard_* are block layer internals, no driver should touch them! | 238 | * hard_* are block layer internals, no driver should touch them! |
136 | */ | 239 | */ |
137 | 240 | ||
138 | sector_t sector; /* next sector to submit */ | 241 | sector_t sector; /* next sector to submit */ |
242 | sector_t hard_sector; /* next sector to complete */ | ||
139 | unsigned long nr_sectors; /* no. of sectors left to submit */ | 243 | unsigned long nr_sectors; /* no. of sectors left to submit */ |
244 | unsigned long hard_nr_sectors; /* no. of sectors left to complete */ | ||
140 | /* no. of sectors left to submit in the current segment */ | 245 | /* no. of sectors left to submit in the current segment */ |
141 | unsigned int current_nr_sectors; | 246 | unsigned int current_nr_sectors; |
142 | 247 | ||
143 | sector_t hard_sector; /* next sector to complete */ | ||
144 | unsigned long hard_nr_sectors; /* no. of sectors left to complete */ | ||
145 | /* no. of sectors left to complete in the current segment */ | 248 | /* no. of sectors left to complete in the current segment */ |
146 | unsigned int hard_cur_sectors; | 249 | unsigned int hard_cur_sectors; |
147 | 250 | ||
148 | struct bio *bio; | 251 | struct bio *bio; |
149 | struct bio *biotail; | 252 | struct bio *biotail; |
150 | 253 | ||
254 | struct hlist_node hash; /* merge hash */ | ||
255 | /* | ||
256 | * The rb_node is only used inside the io scheduler, requests | ||
257 | * are pruned when moved to the dispatch queue. So let the | ||
258 | * completion_data share space with the rb_node. | ||
259 | */ | ||
260 | union { | ||
261 | struct rb_node rb_node; /* sort/lookup */ | ||
262 | void *completion_data; | ||
263 | }; | ||
264 | |||
265 | /* | ||
266 | * two pointers are available for the IO schedulers, if they need | ||
267 | * more they have to dynamically allocate it. | ||
268 | */ | ||
151 | void *elevator_private; | 269 | void *elevator_private; |
152 | void *completion_data; | 270 | void *elevator_private2; |
153 | 271 | ||
154 | int rq_status; /* should split this into a few status bits */ | ||
155 | int errors; | ||
156 | struct gendisk *rq_disk; | 272 | struct gendisk *rq_disk; |
157 | unsigned long start_time; | 273 | unsigned long start_time; |
158 | 274 | ||
@@ -170,15 +286,13 @@ struct request { | |||
170 | 286 | ||
171 | unsigned short ioprio; | 287 | unsigned short ioprio; |
172 | 288 | ||
289 | void *special; | ||
290 | char *buffer; | ||
291 | |||
173 | int tag; | 292 | int tag; |
293 | int errors; | ||
174 | 294 | ||
175 | int ref_count; | 295 | int ref_count; |
176 | request_queue_t *q; | ||
177 | struct request_list *rl; | ||
178 | |||
179 | struct completion *waiting; | ||
180 | void *special; | ||
181 | char *buffer; | ||
182 | 296 | ||
183 | /* | 297 | /* |
184 | * when request is used as a packet command carrier | 298 | * when request is used as a packet command carrier |
@@ -195,80 +309,14 @@ struct request { | |||
195 | int retries; | 309 | int retries; |
196 | 310 | ||
197 | /* | 311 | /* |
198 | * completion callback. end_io_data should be folded in with waiting | 312 | * completion callback. |
199 | */ | 313 | */ |
200 | rq_end_io_fn *end_io; | 314 | rq_end_io_fn *end_io; |
201 | void *end_io_data; | 315 | void *end_io_data; |
202 | }; | 316 | }; |
203 | 317 | ||
204 | /* | 318 | /* |
205 | * first three bits match BIO_RW* bits, important | 319 | * State information carried for REQ_TYPE_PM_SUSPEND and REQ_TYPE_PM_RESUME |
206 | */ | ||
207 | enum rq_flag_bits { | ||
208 | __REQ_RW, /* not set, read. set, write */ | ||
209 | __REQ_FAILFAST, /* no low level driver retries */ | ||
210 | __REQ_SORTED, /* elevator knows about this request */ | ||
211 | __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */ | ||
212 | __REQ_HARDBARRIER, /* may not be passed by drive either */ | ||
213 | __REQ_FUA, /* forced unit access */ | ||
214 | __REQ_CMD, /* is a regular fs rw request */ | ||
215 | __REQ_NOMERGE, /* don't touch this for merging */ | ||
216 | __REQ_STARTED, /* drive already may have started this one */ | ||
217 | __REQ_DONTPREP, /* don't call prep for this one */ | ||
218 | __REQ_QUEUED, /* uses queueing */ | ||
219 | __REQ_ELVPRIV, /* elevator private data attached */ | ||
220 | /* | ||
221 | * for ATA/ATAPI devices | ||
222 | */ | ||
223 | __REQ_PC, /* packet command (special) */ | ||
224 | __REQ_BLOCK_PC, /* queued down pc from block layer */ | ||
225 | __REQ_SENSE, /* sense retrival */ | ||
226 | |||
227 | __REQ_FAILED, /* set if the request failed */ | ||
228 | __REQ_QUIET, /* don't worry about errors */ | ||
229 | __REQ_SPECIAL, /* driver suplied command */ | ||
230 | __REQ_DRIVE_CMD, | ||
231 | __REQ_DRIVE_TASK, | ||
232 | __REQ_DRIVE_TASKFILE, | ||
233 | __REQ_PREEMPT, /* set for "ide_preempt" requests */ | ||
234 | __REQ_PM_SUSPEND, /* suspend request */ | ||
235 | __REQ_PM_RESUME, /* resume request */ | ||
236 | __REQ_PM_SHUTDOWN, /* shutdown request */ | ||
237 | __REQ_ORDERED_COLOR, /* is before or after barrier */ | ||
238 | __REQ_RW_SYNC, /* request is sync (O_DIRECT) */ | ||
239 | __REQ_NR_BITS, /* stops here */ | ||
240 | }; | ||
241 | |||
242 | #define REQ_RW (1 << __REQ_RW) | ||
243 | #define REQ_FAILFAST (1 << __REQ_FAILFAST) | ||
244 | #define REQ_SORTED (1 << __REQ_SORTED) | ||
245 | #define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER) | ||
246 | #define REQ_HARDBARRIER (1 << __REQ_HARDBARRIER) | ||
247 | #define REQ_FUA (1 << __REQ_FUA) | ||
248 | #define REQ_CMD (1 << __REQ_CMD) | ||
249 | #define REQ_NOMERGE (1 << __REQ_NOMERGE) | ||
250 | #define REQ_STARTED (1 << __REQ_STARTED) | ||
251 | #define REQ_DONTPREP (1 << __REQ_DONTPREP) | ||
252 | #define REQ_QUEUED (1 << __REQ_QUEUED) | ||
253 | #define REQ_ELVPRIV (1 << __REQ_ELVPRIV) | ||
254 | #define REQ_PC (1 << __REQ_PC) | ||
255 | #define REQ_BLOCK_PC (1 << __REQ_BLOCK_PC) | ||
256 | #define REQ_SENSE (1 << __REQ_SENSE) | ||
257 | #define REQ_FAILED (1 << __REQ_FAILED) | ||
258 | #define REQ_QUIET (1 << __REQ_QUIET) | ||
259 | #define REQ_SPECIAL (1 << __REQ_SPECIAL) | ||
260 | #define REQ_DRIVE_CMD (1 << __REQ_DRIVE_CMD) | ||
261 | #define REQ_DRIVE_TASK (1 << __REQ_DRIVE_TASK) | ||
262 | #define REQ_DRIVE_TASKFILE (1 << __REQ_DRIVE_TASKFILE) | ||
263 | #define REQ_PREEMPT (1 << __REQ_PREEMPT) | ||
264 | #define REQ_PM_SUSPEND (1 << __REQ_PM_SUSPEND) | ||
265 | #define REQ_PM_RESUME (1 << __REQ_PM_RESUME) | ||
266 | #define REQ_PM_SHUTDOWN (1 << __REQ_PM_SHUTDOWN) | ||
267 | #define REQ_ORDERED_COLOR (1 << __REQ_ORDERED_COLOR) | ||
268 | #define REQ_RW_SYNC (1 << __REQ_RW_SYNC) | ||
269 | |||
270 | /* | ||
271 | * State information carried for REQ_PM_SUSPEND and REQ_PM_RESUME | ||
272 | * requests. Some step values could eventually be made generic. | 320 | * requests. Some step values could eventually be made generic. |
273 | */ | 321 | */ |
274 | struct request_pm_state | 322 | struct request_pm_state |
@@ -432,9 +480,6 @@ struct request_queue | |||
432 | struct mutex sysfs_lock; | 480 | struct mutex sysfs_lock; |
433 | }; | 481 | }; |
434 | 482 | ||
435 | #define RQ_INACTIVE (-1) | ||
436 | #define RQ_ACTIVE 1 | ||
437 | |||
438 | #define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */ | 483 | #define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */ |
439 | #define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */ | 484 | #define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */ |
440 | #define QUEUE_FLAG_STOPPED 2 /* queue is stopped */ | 485 | #define QUEUE_FLAG_STOPPED 2 /* queue is stopped */ |
@@ -490,25 +535,34 @@ enum { | |||
490 | #define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) | 535 | #define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) |
491 | #define blk_queue_flushing(q) ((q)->ordseq) | 536 | #define blk_queue_flushing(q) ((q)->ordseq) |
492 | 537 | ||
493 | #define blk_fs_request(rq) ((rq)->flags & REQ_CMD) | 538 | #define blk_fs_request(rq) ((rq)->cmd_type == REQ_TYPE_FS) |
494 | #define blk_pc_request(rq) ((rq)->flags & REQ_BLOCK_PC) | 539 | #define blk_pc_request(rq) ((rq)->cmd_type == REQ_TYPE_BLOCK_PC) |
495 | #define blk_noretry_request(rq) ((rq)->flags & REQ_FAILFAST) | 540 | #define blk_special_request(rq) ((rq)->cmd_type == REQ_TYPE_SPECIAL) |
496 | #define blk_rq_started(rq) ((rq)->flags & REQ_STARTED) | 541 | #define blk_sense_request(rq) ((rq)->cmd_type == REQ_TYPE_SENSE) |
542 | |||
543 | #define blk_noretry_request(rq) ((rq)->cmd_flags & REQ_FAILFAST) | ||
544 | #define blk_rq_started(rq) ((rq)->cmd_flags & REQ_STARTED) | ||
497 | 545 | ||
498 | #define blk_account_rq(rq) (blk_rq_started(rq) && blk_fs_request(rq)) | 546 | #define blk_account_rq(rq) (blk_rq_started(rq) && blk_fs_request(rq)) |
499 | 547 | ||
500 | #define blk_pm_suspend_request(rq) ((rq)->flags & REQ_PM_SUSPEND) | 548 | #define blk_pm_suspend_request(rq) ((rq)->cmd_type == REQ_TYPE_PM_SUSPEND) |
501 | #define blk_pm_resume_request(rq) ((rq)->flags & REQ_PM_RESUME) | 549 | #define blk_pm_resume_request(rq) ((rq)->cmd_type == REQ_TYPE_PM_RESUME) |
502 | #define blk_pm_request(rq) \ | 550 | #define blk_pm_request(rq) \ |
503 | ((rq)->flags & (REQ_PM_SUSPEND | REQ_PM_RESUME)) | 551 | (blk_pm_suspend_request(rq) || blk_pm_resume_request(rq)) |
504 | 552 | ||
505 | #define blk_sorted_rq(rq) ((rq)->flags & REQ_SORTED) | 553 | #define blk_sorted_rq(rq) ((rq)->cmd_flags & REQ_SORTED) |
506 | #define blk_barrier_rq(rq) ((rq)->flags & REQ_HARDBARRIER) | 554 | #define blk_barrier_rq(rq) ((rq)->cmd_flags & REQ_HARDBARRIER) |
507 | #define blk_fua_rq(rq) ((rq)->flags & REQ_FUA) | 555 | #define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA) |
508 | 556 | ||
509 | #define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist) | 557 | #define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist) |
510 | 558 | ||
511 | #define rq_data_dir(rq) ((rq)->flags & 1) | 559 | #define rq_data_dir(rq) ((rq)->cmd_flags & 1) |
560 | |||
561 | /* | ||
562 | * We regard a request as sync, if it's a READ or a SYNC write. | ||
563 | */ | ||
564 | #define rq_is_sync(rq) (rq_data_dir((rq)) == READ || (rq)->cmd_flags & REQ_RW_SYNC) | ||
565 | #define rq_is_meta(rq) ((rq)->cmd_flags & REQ_RW_META) | ||
512 | 566 | ||
513 | static inline int blk_queue_full(struct request_queue *q, int rw) | 567 | static inline int blk_queue_full(struct request_queue *q, int rw) |
514 | { | 568 | { |
@@ -541,13 +595,7 @@ static inline void blk_clear_queue_full(struct request_queue *q, int rw) | |||
541 | #define RQ_NOMERGE_FLAGS \ | 595 | #define RQ_NOMERGE_FLAGS \ |
542 | (REQ_NOMERGE | REQ_STARTED | REQ_HARDBARRIER | REQ_SOFTBARRIER) | 596 | (REQ_NOMERGE | REQ_STARTED | REQ_HARDBARRIER | REQ_SOFTBARRIER) |
543 | #define rq_mergeable(rq) \ | 597 | #define rq_mergeable(rq) \ |
544 | (!((rq)->flags & RQ_NOMERGE_FLAGS) && blk_fs_request((rq))) | 598 | (!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && blk_fs_request((rq))) |
545 | |||
546 | /* | ||
547 | * noop, requests are automagically marked as active/inactive by I/O | ||
548 | * scheduler -- see elv_next_request | ||
549 | */ | ||
550 | #define blk_queue_headactive(q, head_active) | ||
551 | 599 | ||
552 | /* | 600 | /* |
553 | * q->prep_rq_fn return values | 601 | * q->prep_rq_fn return values |
@@ -586,11 +634,6 @@ static inline void blk_queue_bounce(request_queue_t *q, struct bio **bio) | |||
586 | if ((rq->bio)) \ | 634 | if ((rq->bio)) \ |
587 | for (_bio = (rq)->bio; _bio; _bio = _bio->bi_next) | 635 | for (_bio = (rq)->bio; _bio; _bio = _bio->bi_next) |
588 | 636 | ||
589 | struct sec_size { | ||
590 | unsigned block_size; | ||
591 | unsigned block_size_bits; | ||
592 | }; | ||
593 | |||
594 | extern int blk_register_queue(struct gendisk *disk); | 637 | extern int blk_register_queue(struct gendisk *disk); |
595 | extern void blk_unregister_queue(struct gendisk *disk); | 638 | extern void blk_unregister_queue(struct gendisk *disk); |
596 | extern void register_disk(struct gendisk *dev); | 639 | extern void register_disk(struct gendisk *dev); |
@@ -612,6 +655,7 @@ extern void blk_stop_queue(request_queue_t *q); | |||
612 | extern void blk_sync_queue(struct request_queue *q); | 655 | extern void blk_sync_queue(struct request_queue *q); |
613 | extern void __blk_stop_queue(request_queue_t *q); | 656 | extern void __blk_stop_queue(request_queue_t *q); |
614 | extern void blk_run_queue(request_queue_t *); | 657 | extern void blk_run_queue(request_queue_t *); |
658 | extern void blk_start_queueing(request_queue_t *); | ||
615 | extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *); | 659 | extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *); |
616 | extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned int); | 660 | extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned int); |
617 | extern int blk_rq_unmap_user(struct bio *, unsigned int); | 661 | extern int blk_rq_unmap_user(struct bio *, unsigned int); |
@@ -655,16 +699,6 @@ extern void end_that_request_last(struct request *, int); | |||
655 | extern void end_request(struct request *req, int uptodate); | 699 | extern void end_request(struct request *req, int uptodate); |
656 | extern void blk_complete_request(struct request *); | 700 | extern void blk_complete_request(struct request *); |
657 | 701 | ||
658 | static inline int rq_all_done(struct request *rq, unsigned int nr_bytes) | ||
659 | { | ||
660 | if (blk_fs_request(rq)) | ||
661 | return (nr_bytes >= (rq->hard_nr_sectors << 9)); | ||
662 | else if (blk_pc_request(rq)) | ||
663 | return nr_bytes >= rq->data_len; | ||
664 | |||
665 | return 0; | ||
666 | } | ||
667 | |||
668 | /* | 702 | /* |
669 | * end_that_request_first/chunk() takes an uptodate argument. we account | 703 | * end_that_request_first/chunk() takes an uptodate argument. we account |
670 | * any value <= as an io error. 0 means -EIO for compatability reasons, | 704 | * any value <= as an io error. 0 means -EIO for compatability reasons, |
@@ -679,21 +713,6 @@ static inline void blkdev_dequeue_request(struct request *req) | |||
679 | } | 713 | } |
680 | 714 | ||
681 | /* | 715 | /* |
682 | * This should be in elevator.h, but that requires pulling in rq and q | ||
683 | */ | ||
684 | static inline void elv_dispatch_add_tail(struct request_queue *q, | ||
685 | struct request *rq) | ||
686 | { | ||
687 | if (q->last_merge == rq) | ||
688 | q->last_merge = NULL; | ||
689 | q->nr_sorted--; | ||
690 | |||
691 | q->end_sector = rq_end_sector(rq); | ||
692 | q->boundary_rq = rq; | ||
693 | list_add_tail(&rq->queuelist, &q->queue_head); | ||
694 | } | ||
695 | |||
696 | /* | ||
697 | * Access functions for manipulating queue properties | 716 | * Access functions for manipulating queue properties |
698 | */ | 717 | */ |
699 | extern request_queue_t *blk_init_queue_node(request_fn_proc *rfn, | 718 | extern request_queue_t *blk_init_queue_node(request_fn_proc *rfn, |
@@ -737,7 +756,7 @@ extern void blk_put_queue(request_queue_t *); | |||
737 | */ | 756 | */ |
738 | #define blk_queue_tag_depth(q) ((q)->queue_tags->busy) | 757 | #define blk_queue_tag_depth(q) ((q)->queue_tags->busy) |
739 | #define blk_queue_tag_queue(q) ((q)->queue_tags->busy < (q)->queue_tags->max_depth) | 758 | #define blk_queue_tag_queue(q) ((q)->queue_tags->busy < (q)->queue_tags->max_depth) |
740 | #define blk_rq_tagged(rq) ((rq)->flags & REQ_QUEUED) | 759 | #define blk_rq_tagged(rq) ((rq)->cmd_flags & REQ_QUEUED) |
741 | extern int blk_queue_start_tag(request_queue_t *, struct request *); | 760 | extern int blk_queue_start_tag(request_queue_t *, struct request *); |
742 | extern struct request *blk_queue_find_tag(request_queue_t *, int); | 761 | extern struct request *blk_queue_find_tag(request_queue_t *, int); |
743 | extern void blk_queue_end_tag(request_queue_t *, struct request *); | 762 | extern void blk_queue_end_tag(request_queue_t *, struct request *); |
@@ -787,14 +806,6 @@ static inline int queue_dma_alignment(request_queue_t *q) | |||
787 | return retval; | 806 | return retval; |
788 | } | 807 | } |
789 | 808 | ||
790 | static inline int bdev_dma_aligment(struct block_device *bdev) | ||
791 | { | ||
792 | return queue_dma_alignment(bdev_get_queue(bdev)); | ||
793 | } | ||
794 | |||
795 | #define blk_finished_io(nsects) do { } while (0) | ||
796 | #define blk_started_io(nsects) do { } while (0) | ||
797 | |||
798 | /* assumes size > 256 */ | 809 | /* assumes size > 256 */ |
799 | static inline unsigned int blksize_bits(unsigned int size) | 810 | static inline unsigned int blksize_bits(unsigned int size) |
800 | { | 811 | { |
@@ -824,24 +835,32 @@ struct work_struct; | |||
824 | int kblockd_schedule_work(struct work_struct *work); | 835 | int kblockd_schedule_work(struct work_struct *work); |
825 | void kblockd_flush(void); | 836 | void kblockd_flush(void); |
826 | 837 | ||
827 | #ifdef CONFIG_LBD | ||
828 | # include <asm/div64.h> | ||
829 | # define sector_div(a, b) do_div(a, b) | ||
830 | #else | ||
831 | # define sector_div(n, b)( \ | ||
832 | { \ | ||
833 | int _res; \ | ||
834 | _res = (n) % (b); \ | ||
835 | (n) /= (b); \ | ||
836 | _res; \ | ||
837 | } \ | ||
838 | ) | ||
839 | #endif | ||
840 | |||
841 | #define MODULE_ALIAS_BLOCKDEV(major,minor) \ | 838 | #define MODULE_ALIAS_BLOCKDEV(major,minor) \ |
842 | MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor)) | 839 | MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor)) |
843 | #define MODULE_ALIAS_BLOCKDEV_MAJOR(major) \ | 840 | #define MODULE_ALIAS_BLOCKDEV_MAJOR(major) \ |
844 | MODULE_ALIAS("block-major-" __stringify(major) "-*") | 841 | MODULE_ALIAS("block-major-" __stringify(major) "-*") |
845 | 842 | ||
846 | 843 | ||
844 | #else /* CONFIG_BLOCK */ | ||
845 | /* | ||
846 | * stubs for when the block layer is configured out | ||
847 | */ | ||
848 | #define buffer_heads_over_limit 0 | ||
849 | |||
850 | static inline long blk_congestion_wait(int rw, long timeout) | ||
851 | { | ||
852 | return io_schedule_timeout(timeout); | ||
853 | } | ||
854 | |||
855 | static inline long nr_blockdev_pages(void) | ||
856 | { | ||
857 | return 0; | ||
858 | } | ||
859 | |||
860 | static inline void exit_io_context(void) | ||
861 | { | ||
862 | } | ||
863 | |||
864 | #endif /* CONFIG_BLOCK */ | ||
865 | |||
847 | #endif | 866 | #endif |
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index 7520cc1ff9e2..b99a714fcac6 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h | |||
@@ -20,6 +20,7 @@ enum blktrace_cat { | |||
20 | BLK_TC_PC = 1 << 9, /* pc requests */ | 20 | BLK_TC_PC = 1 << 9, /* pc requests */ |
21 | BLK_TC_NOTIFY = 1 << 10, /* special message */ | 21 | BLK_TC_NOTIFY = 1 << 10, /* special message */ |
22 | BLK_TC_AHEAD = 1 << 11, /* readahead */ | 22 | BLK_TC_AHEAD = 1 << 11, /* readahead */ |
23 | BLK_TC_META = 1 << 12, /* metadata */ | ||
23 | 24 | ||
24 | BLK_TC_END = 1 << 15, /* only 16-bits, reminder */ | 25 | BLK_TC_END = 1 << 15, /* only 16-bits, reminder */ |
25 | }; | 26 | }; |
@@ -148,7 +149,7 @@ static inline void blk_add_trace_rq(struct request_queue *q, struct request *rq, | |||
148 | u32 what) | 149 | u32 what) |
149 | { | 150 | { |
150 | struct blk_trace *bt = q->blk_trace; | 151 | struct blk_trace *bt = q->blk_trace; |
151 | int rw = rq->flags & 0x03; | 152 | int rw = rq->cmd_flags & 0x03; |
152 | 153 | ||
153 | if (likely(!bt)) | 154 | if (likely(!bt)) |
154 | return; | 155 | return; |
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 737e407d0cd1..131ffd37e716 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
@@ -14,6 +14,8 @@ | |||
14 | #include <linux/wait.h> | 14 | #include <linux/wait.h> |
15 | #include <asm/atomic.h> | 15 | #include <asm/atomic.h> |
16 | 16 | ||
17 | #ifdef CONFIG_BLOCK | ||
18 | |||
17 | enum bh_state_bits { | 19 | enum bh_state_bits { |
18 | BH_Uptodate, /* Contains valid data */ | 20 | BH_Uptodate, /* Contains valid data */ |
19 | BH_Dirty, /* Is dirty */ | 21 | BH_Dirty, /* Is dirty */ |
@@ -190,9 +192,7 @@ extern int buffer_heads_over_limit; | |||
190 | * Generic address_space_operations implementations for buffer_head-backed | 192 | * Generic address_space_operations implementations for buffer_head-backed |
191 | * address_spaces. | 193 | * address_spaces. |
192 | */ | 194 | */ |
193 | int try_to_release_page(struct page * page, gfp_t gfp_mask); | ||
194 | void block_invalidatepage(struct page *page, unsigned long offset); | 195 | void block_invalidatepage(struct page *page, unsigned long offset); |
195 | void do_invalidatepage(struct page *page, unsigned long offset); | ||
196 | int block_write_full_page(struct page *page, get_block_t *get_block, | 196 | int block_write_full_page(struct page *page, get_block_t *get_block, |
197 | struct writeback_control *wbc); | 197 | struct writeback_control *wbc); |
198 | int block_read_full_page(struct page*, get_block_t*); | 198 | int block_read_full_page(struct page*, get_block_t*); |
@@ -302,4 +302,19 @@ static inline void lock_buffer(struct buffer_head *bh) | |||
302 | __lock_buffer(bh); | 302 | __lock_buffer(bh); |
303 | } | 303 | } |
304 | 304 | ||
305 | extern int __set_page_dirty_buffers(struct page *page); | ||
306 | |||
307 | #else /* CONFIG_BLOCK */ | ||
308 | |||
309 | static inline void buffer_init(void) {} | ||
310 | static inline int try_to_free_buffers(struct page *page) { return 1; } | ||
311 | static inline int sync_blockdev(struct block_device *bdev) { return 0; } | ||
312 | static inline int inode_has_buffers(struct inode *inode) { return 0; } | ||
313 | static inline void invalidate_inode_buffers(struct inode *inode) {} | ||
314 | static inline int remove_inode_buffers(struct inode *inode) { return 1; } | ||
315 | static inline int sync_mapping_buffers(struct address_space *mapping) { return 0; } | ||
316 | static inline void invalidate_bdev(struct block_device *bdev, int destroy_dirty_buffers) {} | ||
317 | |||
318 | |||
319 | #endif /* CONFIG_BLOCK */ | ||
305 | #endif /* _LINUX_BUFFER_HEAD_H */ | 320 | #endif /* _LINUX_BUFFER_HEAD_H */ |
diff --git a/include/linux/compat.h b/include/linux/compat.h index 9760753e662b..ef5cd192784c 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) |
@@ -227,6 +228,7 @@ static inline int compat_timespec_compare(struct compat_timespec *lhs, | |||
227 | asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp); | 228 | asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp); |
228 | 229 | ||
229 | extern int compat_printk(const char *fmt, ...); | 230 | extern int compat_printk(const char *fmt, ...); |
231 | extern void sigset_from_compat(sigset_t *set, compat_sigset_t *compat); | ||
230 | 232 | ||
231 | #endif /* CONFIG_COMPAT */ | 233 | #endif /* CONFIG_COMPAT */ |
232 | #endif /* _LINUX_COMPAT_H */ | 234 | #endif /* _LINUX_COMPAT_H */ |
diff --git a/include/linux/compat_ioctl.h b/include/linux/compat_ioctl.h index bea0255196c4..4e1663d7691e 100644 --- a/include/linux/compat_ioctl.h +++ b/include/linux/compat_ioctl.h | |||
@@ -90,6 +90,7 @@ COMPATIBLE_IOCTL(FDTWADDLE) | |||
90 | COMPATIBLE_IOCTL(FDFMTTRK) | 90 | COMPATIBLE_IOCTL(FDFMTTRK) |
91 | COMPATIBLE_IOCTL(FDRAWCMD) | 91 | COMPATIBLE_IOCTL(FDRAWCMD) |
92 | /* 0x12 */ | 92 | /* 0x12 */ |
93 | #ifdef CONFIG_BLOCK | ||
93 | COMPATIBLE_IOCTL(BLKRASET) | 94 | COMPATIBLE_IOCTL(BLKRASET) |
94 | COMPATIBLE_IOCTL(BLKROSET) | 95 | COMPATIBLE_IOCTL(BLKROSET) |
95 | COMPATIBLE_IOCTL(BLKROGET) | 96 | COMPATIBLE_IOCTL(BLKROGET) |
@@ -103,6 +104,7 @@ COMPATIBLE_IOCTL(BLKTRACESETUP) | |||
103 | COMPATIBLE_IOCTL(BLKTRACETEARDOWN) | 104 | COMPATIBLE_IOCTL(BLKTRACETEARDOWN) |
104 | ULONG_IOCTL(BLKRASET) | 105 | ULONG_IOCTL(BLKRASET) |
105 | ULONG_IOCTL(BLKFRASET) | 106 | ULONG_IOCTL(BLKFRASET) |
107 | #endif | ||
106 | /* RAID */ | 108 | /* RAID */ |
107 | COMPATIBLE_IOCTL(RAID_VERSION) | 109 | COMPATIBLE_IOCTL(RAID_VERSION) |
108 | COMPATIBLE_IOCTL(GET_ARRAY_INFO) | 110 | COMPATIBLE_IOCTL(GET_ARRAY_INFO) |
@@ -120,10 +122,10 @@ COMPATIBLE_IOCTL(PROTECT_ARRAY) | |||
120 | ULONG_IOCTL(HOT_ADD_DISK) | 122 | ULONG_IOCTL(HOT_ADD_DISK) |
121 | ULONG_IOCTL(SET_DISK_FAULTY) | 123 | ULONG_IOCTL(SET_DISK_FAULTY) |
122 | COMPATIBLE_IOCTL(RUN_ARRAY) | 124 | COMPATIBLE_IOCTL(RUN_ARRAY) |
123 | ULONG_IOCTL(START_ARRAY) | ||
124 | COMPATIBLE_IOCTL(STOP_ARRAY) | 125 | COMPATIBLE_IOCTL(STOP_ARRAY) |
125 | COMPATIBLE_IOCTL(STOP_ARRAY_RO) | 126 | COMPATIBLE_IOCTL(STOP_ARRAY_RO) |
126 | COMPATIBLE_IOCTL(RESTART_ARRAY_RW) | 127 | COMPATIBLE_IOCTL(RESTART_ARRAY_RW) |
128 | ULONG_IOCTL(SET_BITMAP_FILE) | ||
127 | /* DM */ | 129 | /* DM */ |
128 | COMPATIBLE_IOCTL(DM_VERSION_32) | 130 | COMPATIBLE_IOCTL(DM_VERSION_32) |
129 | COMPATIBLE_IOCTL(DM_REMOVE_ALL_32) | 131 | COMPATIBLE_IOCTL(DM_REMOVE_ALL_32) |
@@ -395,12 +397,6 @@ COMPATIBLE_IOCTL(DVD_WRITE_STRUCT) | |||
395 | COMPATIBLE_IOCTL(DVD_AUTH) | 397 | COMPATIBLE_IOCTL(DVD_AUTH) |
396 | /* pktcdvd */ | 398 | /* pktcdvd */ |
397 | COMPATIBLE_IOCTL(PACKET_CTRL_CMD) | 399 | COMPATIBLE_IOCTL(PACKET_CTRL_CMD) |
398 | /* Big L */ | ||
399 | ULONG_IOCTL(LOOP_SET_FD) | ||
400 | ULONG_IOCTL(LOOP_CHANGE_FD) | ||
401 | COMPATIBLE_IOCTL(LOOP_CLR_FD) | ||
402 | COMPATIBLE_IOCTL(LOOP_GET_STATUS64) | ||
403 | COMPATIBLE_IOCTL(LOOP_SET_STATUS64) | ||
404 | /* Big A */ | 400 | /* Big A */ |
405 | /* sparc only */ | 401 | /* sparc only */ |
406 | /* Big Q for sound/OSS */ | 402 | /* Big Q for sound/OSS */ |
@@ -573,18 +569,6 @@ COMPATIBLE_IOCTL(RAW_SETBIND) | |||
573 | COMPATIBLE_IOCTL(RAW_GETBIND) | 569 | COMPATIBLE_IOCTL(RAW_GETBIND) |
574 | /* SMB ioctls which do not need any translations */ | 570 | /* SMB ioctls which do not need any translations */ |
575 | COMPATIBLE_IOCTL(SMB_IOC_NEWCONN) | 571 | COMPATIBLE_IOCTL(SMB_IOC_NEWCONN) |
576 | /* NCP ioctls which do not need any translations */ | ||
577 | COMPATIBLE_IOCTL(NCP_IOC_CONN_LOGGED_IN) | ||
578 | COMPATIBLE_IOCTL(NCP_IOC_SIGN_INIT) | ||
579 | COMPATIBLE_IOCTL(NCP_IOC_SIGN_WANTED) | ||
580 | COMPATIBLE_IOCTL(NCP_IOC_SET_SIGN_WANTED) | ||
581 | COMPATIBLE_IOCTL(NCP_IOC_LOCKUNLOCK) | ||
582 | COMPATIBLE_IOCTL(NCP_IOC_GETROOT) | ||
583 | COMPATIBLE_IOCTL(NCP_IOC_SETROOT) | ||
584 | COMPATIBLE_IOCTL(NCP_IOC_GETCHARSETS) | ||
585 | COMPATIBLE_IOCTL(NCP_IOC_SETCHARSETS) | ||
586 | COMPATIBLE_IOCTL(NCP_IOC_GETDENTRYTTL) | ||
587 | COMPATIBLE_IOCTL(NCP_IOC_SETDENTRYTTL) | ||
588 | /* Little a */ | 572 | /* Little a */ |
589 | COMPATIBLE_IOCTL(ATMSIGD_CTRL) | 573 | COMPATIBLE_IOCTL(ATMSIGD_CTRL) |
590 | COMPATIBLE_IOCTL(ATMARPD_CTRL) | 574 | COMPATIBLE_IOCTL(ATMARPD_CTRL) |
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 0780de440220..538423d4a865 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
@@ -10,10 +10,10 @@ | |||
10 | # define __force __attribute__((force)) | 10 | # define __force __attribute__((force)) |
11 | # define __nocast __attribute__((nocast)) | 11 | # define __nocast __attribute__((nocast)) |
12 | # define __iomem __attribute__((noderef, address_space(2))) | 12 | # define __iomem __attribute__((noderef, address_space(2))) |
13 | # define __acquires(x) __attribute__((context(0,1))) | 13 | # define __acquires(x) __attribute__((context(x,0,1))) |
14 | # define __releases(x) __attribute__((context(1,0))) | 14 | # define __releases(x) __attribute__((context(x,1,0))) |
15 | # define __acquire(x) __context__(1) | 15 | # define __acquire(x) __context__(x,1) |
16 | # define __release(x) __context__(-1) | 16 | # define __release(x) __context__(x,-1) |
17 | # define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0) | 17 | # define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0) |
18 | extern void __chk_user_ptr(void __user *); | 18 | extern void __chk_user_ptr(void __user *); |
19 | extern void __chk_io_ptr(void __iomem *); | 19 | extern void __chk_io_ptr(void __iomem *); |
diff --git a/include/linux/console.h b/include/linux/console.h index 76a1807726eb..7d0420274de0 100644 --- a/include/linux/console.h +++ b/include/linux/console.h | |||
@@ -129,6 +129,9 @@ static inline void suspend_console(void) {} | |||
129 | static inline void resume_console(void) {} | 129 | static inline void resume_console(void) {} |
130 | #endif /* CONFIG_DISABLE_CONSOLE_SUSPEND */ | 130 | #endif /* CONFIG_DISABLE_CONSOLE_SUSPEND */ |
131 | 131 | ||
132 | int mda_console_init(void); | ||
133 | void prom_con_init(void); | ||
134 | |||
132 | /* Some debug stub to catch some of the obvious races in the VT code */ | 135 | /* Some debug stub to catch some of the obvious races in the VT code */ |
133 | #if 1 | 136 | #if 1 |
134 | #define WARN_CONSOLE_UNLOCKED() WARN_ON(!is_console_locked() && !oops_in_progress) | 137 | #define WARN_CONSOLE_UNLOCKED() WARN_ON(!is_console_locked() && !oops_in_progress) |
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/consolemap.h b/include/linux/consolemap.h index 65842efc1b70..82c9a1f11020 100644 --- a/include/linux/consolemap.h +++ b/include/linux/consolemap.h | |||
@@ -13,3 +13,4 @@ struct vc_data; | |||
13 | extern unsigned char inverse_translate(struct vc_data *conp, int glyph); | 13 | extern unsigned char inverse_translate(struct vc_data *conp, int glyph); |
14 | extern unsigned short *set_translate(int m, struct vc_data *vc); | 14 | extern unsigned short *set_translate(int m, struct vc_data *vc); |
15 | extern int conv_uni_to_pc(struct vc_data *conp, long ucs); | 15 | extern int conv_uni_to_pc(struct vc_data *conp, long ucs); |
16 | void console_map_init(void); | ||
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index e3d1c33d1558..03ef41c1eaac 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
@@ -55,8 +55,10 @@ typedef int (*dm_endio_fn) (struct dm_target *ti, | |||
55 | struct bio *bio, int error, | 55 | struct bio *bio, int error, |
56 | union map_info *map_context); | 56 | union map_info *map_context); |
57 | 57 | ||
58 | typedef void (*dm_flush_fn) (struct dm_target *ti); | ||
58 | typedef void (*dm_presuspend_fn) (struct dm_target *ti); | 59 | typedef void (*dm_presuspend_fn) (struct dm_target *ti); |
59 | typedef void (*dm_postsuspend_fn) (struct dm_target *ti); | 60 | typedef void (*dm_postsuspend_fn) (struct dm_target *ti); |
61 | typedef int (*dm_preresume_fn) (struct dm_target *ti); | ||
60 | typedef void (*dm_resume_fn) (struct dm_target *ti); | 62 | typedef void (*dm_resume_fn) (struct dm_target *ti); |
61 | 63 | ||
62 | typedef int (*dm_status_fn) (struct dm_target *ti, status_type_t status_type, | 64 | typedef int (*dm_status_fn) (struct dm_target *ti, status_type_t status_type, |
@@ -64,9 +66,18 @@ typedef int (*dm_status_fn) (struct dm_target *ti, status_type_t status_type, | |||
64 | 66 | ||
65 | typedef int (*dm_message_fn) (struct dm_target *ti, unsigned argc, char **argv); | 67 | typedef int (*dm_message_fn) (struct dm_target *ti, unsigned argc, char **argv); |
66 | 68 | ||
69 | typedef int (*dm_ioctl_fn) (struct dm_target *ti, struct inode *inode, | ||
70 | struct file *filp, unsigned int cmd, | ||
71 | unsigned long arg); | ||
72 | |||
67 | void dm_error(const char *message); | 73 | void dm_error(const char *message); |
68 | 74 | ||
69 | /* | 75 | /* |
76 | * Combine device limits. | ||
77 | */ | ||
78 | void dm_set_device_limits(struct dm_target *ti, struct block_device *bdev); | ||
79 | |||
80 | /* | ||
70 | * Constructors should call these functions to ensure destination devices | 81 | * Constructors should call these functions to ensure destination devices |
71 | * are opened/closed correctly. | 82 | * are opened/closed correctly. |
72 | * FIXME: too many arguments. | 83 | * FIXME: too many arguments. |
@@ -86,11 +97,14 @@ struct target_type { | |||
86 | dm_dtr_fn dtr; | 97 | dm_dtr_fn dtr; |
87 | dm_map_fn map; | 98 | dm_map_fn map; |
88 | dm_endio_fn end_io; | 99 | dm_endio_fn end_io; |
100 | dm_flush_fn flush; | ||
89 | dm_presuspend_fn presuspend; | 101 | dm_presuspend_fn presuspend; |
90 | dm_postsuspend_fn postsuspend; | 102 | dm_postsuspend_fn postsuspend; |
103 | dm_preresume_fn preresume; | ||
91 | dm_resume_fn resume; | 104 | dm_resume_fn resume; |
92 | dm_status_fn status; | 105 | dm_status_fn status; |
93 | dm_message_fn message; | 106 | dm_message_fn message; |
107 | dm_ioctl_fn ioctl; | ||
94 | }; | 108 | }; |
95 | 109 | ||
96 | struct io_restrictions { | 110 | struct io_restrictions { |
diff --git a/include/linux/dm-ioctl.h b/include/linux/dm-ioctl.h index 9623bb625090..8853fc4d1c5e 100644 --- a/include/linux/dm-ioctl.h +++ b/include/linux/dm-ioctl.h | |||
@@ -285,9 +285,9 @@ typedef char ioctl_struct[308]; | |||
285 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) | 285 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) |
286 | 286 | ||
287 | #define DM_VERSION_MAJOR 4 | 287 | #define DM_VERSION_MAJOR 4 |
288 | #define DM_VERSION_MINOR 7 | 288 | #define DM_VERSION_MINOR 10 |
289 | #define DM_VERSION_PATCHLEVEL 0 | 289 | #define DM_VERSION_PATCHLEVEL 0 |
290 | #define DM_VERSION_EXTRA "-ioctl (2006-06-24)" | 290 | #define DM_VERSION_EXTRA "-ioctl (2006-09-14)" |
291 | 291 | ||
292 | /* Status bits */ | 292 | /* Status bits */ |
293 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ | 293 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ |
diff --git a/include/linux/elevator.h b/include/linux/elevator.h index 1713ace808bf..b3370ef5164d 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h | |||
@@ -1,12 +1,16 @@ | |||
1 | #ifndef _LINUX_ELEVATOR_H | 1 | #ifndef _LINUX_ELEVATOR_H |
2 | #define _LINUX_ELEVATOR_H | 2 | #define _LINUX_ELEVATOR_H |
3 | 3 | ||
4 | #include <linux/percpu.h> | ||
5 | |||
6 | #ifdef CONFIG_BLOCK | ||
7 | |||
4 | typedef int (elevator_merge_fn) (request_queue_t *, struct request **, | 8 | typedef int (elevator_merge_fn) (request_queue_t *, struct request **, |
5 | struct bio *); | 9 | struct bio *); |
6 | 10 | ||
7 | typedef void (elevator_merge_req_fn) (request_queue_t *, struct request *, struct request *); | 11 | typedef void (elevator_merge_req_fn) (request_queue_t *, struct request *, struct request *); |
8 | 12 | ||
9 | typedef void (elevator_merged_fn) (request_queue_t *, struct request *); | 13 | typedef void (elevator_merged_fn) (request_queue_t *, struct request *, int); |
10 | 14 | ||
11 | typedef int (elevator_dispatch_fn) (request_queue_t *, int); | 15 | typedef int (elevator_dispatch_fn) (request_queue_t *, int); |
12 | 16 | ||
@@ -14,9 +18,9 @@ typedef void (elevator_add_req_fn) (request_queue_t *, struct request *); | |||
14 | typedef int (elevator_queue_empty_fn) (request_queue_t *); | 18 | typedef int (elevator_queue_empty_fn) (request_queue_t *); |
15 | typedef struct request *(elevator_request_list_fn) (request_queue_t *, struct request *); | 19 | typedef struct request *(elevator_request_list_fn) (request_queue_t *, struct request *); |
16 | typedef void (elevator_completed_req_fn) (request_queue_t *, struct request *); | 20 | typedef void (elevator_completed_req_fn) (request_queue_t *, struct request *); |
17 | typedef int (elevator_may_queue_fn) (request_queue_t *, int, struct bio *); | 21 | typedef int (elevator_may_queue_fn) (request_queue_t *, int); |
18 | 22 | ||
19 | typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, struct bio *, gfp_t); | 23 | typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, gfp_t); |
20 | typedef void (elevator_put_req_fn) (request_queue_t *, struct request *); | 24 | typedef void (elevator_put_req_fn) (request_queue_t *, struct request *); |
21 | typedef void (elevator_activate_req_fn) (request_queue_t *, struct request *); | 25 | typedef void (elevator_activate_req_fn) (request_queue_t *, struct request *); |
22 | typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *); | 26 | typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *); |
@@ -82,19 +86,21 @@ struct elevator_queue | |||
82 | struct kobject kobj; | 86 | struct kobject kobj; |
83 | struct elevator_type *elevator_type; | 87 | struct elevator_type *elevator_type; |
84 | struct mutex sysfs_lock; | 88 | struct mutex sysfs_lock; |
89 | struct hlist_head *hash; | ||
85 | }; | 90 | }; |
86 | 91 | ||
87 | /* | 92 | /* |
88 | * block elevator interface | 93 | * block elevator interface |
89 | */ | 94 | */ |
90 | extern void elv_dispatch_sort(request_queue_t *, struct request *); | 95 | extern void elv_dispatch_sort(request_queue_t *, struct request *); |
96 | extern void elv_dispatch_add_tail(request_queue_t *, struct request *); | ||
91 | extern void elv_add_request(request_queue_t *, struct request *, int, int); | 97 | extern void elv_add_request(request_queue_t *, struct request *, int, int); |
92 | extern void __elv_add_request(request_queue_t *, struct request *, int, int); | 98 | extern void __elv_add_request(request_queue_t *, struct request *, int, int); |
93 | extern void elv_insert(request_queue_t *, struct request *, int); | 99 | extern void elv_insert(request_queue_t *, struct request *, int); |
94 | extern int elv_merge(request_queue_t *, struct request **, struct bio *); | 100 | extern int elv_merge(request_queue_t *, struct request **, struct bio *); |
95 | extern void elv_merge_requests(request_queue_t *, struct request *, | 101 | extern void elv_merge_requests(request_queue_t *, struct request *, |
96 | struct request *); | 102 | struct request *); |
97 | extern void elv_merged_request(request_queue_t *, struct request *); | 103 | extern void elv_merged_request(request_queue_t *, struct request *, int); |
98 | extern void elv_dequeue_request(request_queue_t *, struct request *); | 104 | extern void elv_dequeue_request(request_queue_t *, struct request *); |
99 | extern void elv_requeue_request(request_queue_t *, struct request *); | 105 | extern void elv_requeue_request(request_queue_t *, struct request *); |
100 | extern int elv_queue_empty(request_queue_t *); | 106 | extern int elv_queue_empty(request_queue_t *); |
@@ -103,9 +109,9 @@ extern struct request *elv_former_request(request_queue_t *, struct request *); | |||
103 | extern struct request *elv_latter_request(request_queue_t *, struct request *); | 109 | extern struct request *elv_latter_request(request_queue_t *, struct request *); |
104 | extern int elv_register_queue(request_queue_t *q); | 110 | extern int elv_register_queue(request_queue_t *q); |
105 | extern void elv_unregister_queue(request_queue_t *q); | 111 | extern void elv_unregister_queue(request_queue_t *q); |
106 | extern int elv_may_queue(request_queue_t *, int, struct bio *); | 112 | extern int elv_may_queue(request_queue_t *, int); |
107 | extern void elv_completed_request(request_queue_t *, struct request *); | 113 | extern void elv_completed_request(request_queue_t *, struct request *); |
108 | extern int elv_set_request(request_queue_t *, struct request *, struct bio *, gfp_t); | 114 | extern int elv_set_request(request_queue_t *, struct request *, gfp_t); |
109 | extern void elv_put_request(request_queue_t *, struct request *); | 115 | extern void elv_put_request(request_queue_t *, struct request *); |
110 | 116 | ||
111 | /* | 117 | /* |
@@ -125,6 +131,19 @@ extern void elevator_exit(elevator_t *); | |||
125 | extern int elv_rq_merge_ok(struct request *, struct bio *); | 131 | extern int elv_rq_merge_ok(struct request *, struct bio *); |
126 | 132 | ||
127 | /* | 133 | /* |
134 | * Helper functions. | ||
135 | */ | ||
136 | extern struct request *elv_rb_former_request(request_queue_t *, struct request *); | ||
137 | extern struct request *elv_rb_latter_request(request_queue_t *, struct request *); | ||
138 | |||
139 | /* | ||
140 | * rb support functions. | ||
141 | */ | ||
142 | extern struct request *elv_rb_add(struct rb_root *, struct request *); | ||
143 | extern void elv_rb_del(struct rb_root *, struct request *); | ||
144 | extern struct request *elv_rb_find(struct rb_root *, sector_t); | ||
145 | |||
146 | /* | ||
128 | * Return values from elevator merger | 147 | * Return values from elevator merger |
129 | */ | 148 | */ |
130 | #define ELEVATOR_NO_MERGE 0 | 149 | #define ELEVATOR_NO_MERGE 0 |
@@ -149,5 +168,42 @@ enum { | |||
149 | }; | 168 | }; |
150 | 169 | ||
151 | #define rq_end_sector(rq) ((rq)->sector + (rq)->nr_sectors) | 170 | #define rq_end_sector(rq) ((rq)->sector + (rq)->nr_sectors) |
171 | #define rb_entry_rq(node) rb_entry((node), struct request, rb_node) | ||
172 | |||
173 | /* | ||
174 | * Hack to reuse the donelist list_head as the fifo time holder while | ||
175 | * the request is in the io scheduler. Saves an unsigned long in rq. | ||
176 | */ | ||
177 | #define rq_fifo_time(rq) ((unsigned long) (rq)->donelist.next) | ||
178 | #define rq_set_fifo_time(rq,exp) ((rq)->donelist.next = (void *) (exp)) | ||
179 | #define rq_entry_fifo(ptr) list_entry((ptr), struct request, queuelist) | ||
180 | #define rq_fifo_clear(rq) do { \ | ||
181 | list_del_init(&(rq)->queuelist); \ | ||
182 | INIT_LIST_HEAD(&(rq)->donelist); \ | ||
183 | } while (0) | ||
152 | 184 | ||
185 | /* | ||
186 | * io context count accounting | ||
187 | */ | ||
188 | #define elv_ioc_count_mod(name, __val) \ | ||
189 | do { \ | ||
190 | preempt_disable(); \ | ||
191 | __get_cpu_var(name) += (__val); \ | ||
192 | preempt_enable(); \ | ||
193 | } while (0) | ||
194 | |||
195 | #define elv_ioc_count_inc(name) elv_ioc_count_mod(name, 1) | ||
196 | #define elv_ioc_count_dec(name) elv_ioc_count_mod(name, -1) | ||
197 | |||
198 | #define elv_ioc_count_read(name) \ | ||
199 | ({ \ | ||
200 | unsigned long __val = 0; \ | ||
201 | int __cpu; \ | ||
202 | smp_wmb(); \ | ||
203 | for_each_possible_cpu(__cpu) \ | ||
204 | __val += per_cpu(name, __cpu); \ | ||
205 | __val; \ | ||
206 | }) | ||
207 | |||
208 | #endif /* CONFIG_BLOCK */ | ||
153 | #endif | 209 | #endif |
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h index 33a1aa107329..153d755376a4 100644 --- a/include/linux/ext2_fs.h +++ b/include/linux/ext2_fs.h | |||
@@ -165,41 +165,49 @@ struct ext2_group_desc | |||
165 | #define EXT2_N_BLOCKS (EXT2_TIND_BLOCK + 1) | 165 | #define EXT2_N_BLOCKS (EXT2_TIND_BLOCK + 1) |
166 | 166 | ||
167 | /* | 167 | /* |
168 | * Inode flags | 168 | * Inode flags (GETFLAGS/SETFLAGS) |
169 | */ | 169 | */ |
170 | #define EXT2_SECRM_FL 0x00000001 /* Secure deletion */ | 170 | #define EXT2_SECRM_FL FS_SECRM_FL /* Secure deletion */ |
171 | #define EXT2_UNRM_FL 0x00000002 /* Undelete */ | 171 | #define EXT2_UNRM_FL FS_UNRM_FL /* Undelete */ |
172 | #define EXT2_COMPR_FL 0x00000004 /* Compress file */ | 172 | #define EXT2_COMPR_FL FS_COMPR_FL /* Compress file */ |
173 | #define EXT2_SYNC_FL 0x00000008 /* Synchronous updates */ | 173 | #define EXT2_SYNC_FL FS_SYNC_FL /* Synchronous updates */ |
174 | #define EXT2_IMMUTABLE_FL 0x00000010 /* Immutable file */ | 174 | #define EXT2_IMMUTABLE_FL FS_IMMUTABLE_FL /* Immutable file */ |
175 | #define EXT2_APPEND_FL 0x00000020 /* writes to file may only append */ | 175 | #define EXT2_APPEND_FL FS_APPEND_FL /* writes to file may only append */ |
176 | #define EXT2_NODUMP_FL 0x00000040 /* do not dump file */ | 176 | #define EXT2_NODUMP_FL FS_NODUMP_FL /* do not dump file */ |
177 | #define EXT2_NOATIME_FL 0x00000080 /* do not update atime */ | 177 | #define EXT2_NOATIME_FL FS_NOATIME_FL /* do not update atime */ |
178 | /* Reserved for compression usage... */ | 178 | /* Reserved for compression usage... */ |
179 | #define EXT2_DIRTY_FL 0x00000100 | 179 | #define EXT2_DIRTY_FL FS_DIRTY_FL |
180 | #define EXT2_COMPRBLK_FL 0x00000200 /* One or more compressed clusters */ | 180 | #define EXT2_COMPRBLK_FL FS_COMPRBLK_FL /* One or more compressed clusters */ |
181 | #define EXT2_NOCOMP_FL 0x00000400 /* Don't compress */ | 181 | #define EXT2_NOCOMP_FL FS_NOCOMP_FL /* Don't compress */ |
182 | #define EXT2_ECOMPR_FL 0x00000800 /* Compression error */ | 182 | #define EXT2_ECOMPR_FL FS_ECOMPR_FL /* Compression error */ |
183 | /* End compression flags --- maybe not all used */ | 183 | /* End compression flags --- maybe not all used */ |
184 | #define EXT2_BTREE_FL 0x00001000 /* btree format dir */ | 184 | #define EXT2_BTREE_FL FS_BTREE_FL /* btree format dir */ |
185 | #define EXT2_INDEX_FL 0x00001000 /* hash-indexed directory */ | 185 | #define EXT2_INDEX_FL FS_INDEX_FL /* hash-indexed directory */ |
186 | #define EXT2_IMAGIC_FL 0x00002000 /* AFS directory */ | 186 | #define EXT2_IMAGIC_FL FS_IMAGIC_FL /* AFS directory */ |
187 | #define EXT2_JOURNAL_DATA_FL 0x00004000 /* Reserved for ext3 */ | 187 | #define EXT2_JOURNAL_DATA_FL FS_JOURNAL_DATA_FL /* Reserved for ext3 */ |
188 | #define EXT2_NOTAIL_FL 0x00008000 /* file tail should not be merged */ | 188 | #define EXT2_NOTAIL_FL FS_NOTAIL_FL /* file tail should not be merged */ |
189 | #define EXT2_DIRSYNC_FL 0x00010000 /* dirsync behaviour (directories only) */ | 189 | #define EXT2_DIRSYNC_FL FS_DIRSYNC_FL /* dirsync behaviour (directories only) */ |
190 | #define EXT2_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/ | 190 | #define EXT2_TOPDIR_FL FS_TOPDIR_FL /* Top of directory hierarchies*/ |
191 | #define EXT2_RESERVED_FL 0x80000000 /* reserved for ext2 lib */ | 191 | #define EXT2_RESERVED_FL FS_RESERVED_FL /* reserved for ext2 lib */ |
192 | 192 | ||
193 | #define EXT2_FL_USER_VISIBLE 0x0003DFFF /* User visible flags */ | 193 | #define EXT2_FL_USER_VISIBLE FS_FL_USER_VISIBLE /* User visible flags */ |
194 | #define EXT2_FL_USER_MODIFIABLE 0x000380FF /* User modifiable flags */ | 194 | #define EXT2_FL_USER_MODIFIABLE FS_FL_USER_MODIFIABLE /* User modifiable flags */ |
195 | 195 | ||
196 | /* | 196 | /* |
197 | * ioctl commands | 197 | * ioctl commands |
198 | */ | 198 | */ |
199 | #define EXT2_IOC_GETFLAGS _IOR('f', 1, long) | 199 | #define EXT2_IOC_GETFLAGS FS_IOC_GETFLAGS |
200 | #define EXT2_IOC_SETFLAGS _IOW('f', 2, long) | 200 | #define EXT2_IOC_SETFLAGS FS_IOC_SETFLAGS |
201 | #define EXT2_IOC_GETVERSION _IOR('v', 1, long) | 201 | #define EXT2_IOC_GETVERSION FS_IOC_GETVERSION |
202 | #define EXT2_IOC_SETVERSION _IOW('v', 2, long) | 202 | #define EXT2_IOC_SETVERSION FS_IOC_SETVERSION |
203 | |||
204 | /* | ||
205 | * ioctl commands in 32 bit emulation | ||
206 | */ | ||
207 | #define EXT2_IOC32_GETFLAGS FS_IOC32_GETFLAGS | ||
208 | #define EXT2_IOC32_SETFLAGS FS_IOC32_SETFLAGS | ||
209 | #define EXT2_IOC32_GETVERSION FS_IOC32_GETVERSION | ||
210 | #define EXT2_IOC32_SETVERSION FS_IOC32_SETVERSION | ||
203 | 211 | ||
204 | /* | 212 | /* |
205 | * Structure of an inode on the disk | 213 | * Structure of an inode on the disk |
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index cc08f56750da..11cca1bdc0c7 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h | |||
@@ -216,14 +216,14 @@ struct ext3_new_group_data { | |||
216 | /* | 216 | /* |
217 | * ioctl commands | 217 | * ioctl commands |
218 | */ | 218 | */ |
219 | #define EXT3_IOC_GETFLAGS _IOR('f', 1, long) | 219 | #define EXT3_IOC_GETFLAGS FS_IOC_GETFLAGS |
220 | #define EXT3_IOC_SETFLAGS _IOW('f', 2, long) | 220 | #define EXT3_IOC_SETFLAGS FS_IOC_SETFLAGS |
221 | #define EXT3_IOC_GETVERSION _IOR('f', 3, long) | 221 | #define EXT3_IOC_GETVERSION _IOR('f', 3, long) |
222 | #define EXT3_IOC_SETVERSION _IOW('f', 4, long) | 222 | #define EXT3_IOC_SETVERSION _IOW('f', 4, long) |
223 | #define EXT3_IOC_GROUP_EXTEND _IOW('f', 7, unsigned long) | 223 | #define EXT3_IOC_GROUP_EXTEND _IOW('f', 7, unsigned long) |
224 | #define EXT3_IOC_GROUP_ADD _IOW('f', 8,struct ext3_new_group_input) | 224 | #define EXT3_IOC_GROUP_ADD _IOW('f', 8,struct ext3_new_group_input) |
225 | #define EXT3_IOC_GETVERSION_OLD _IOR('v', 1, long) | 225 | #define EXT3_IOC_GETVERSION_OLD FS_IOC_GETVERSION |
226 | #define EXT3_IOC_SETVERSION_OLD _IOW('v', 2, long) | 226 | #define EXT3_IOC_SETVERSION_OLD FS_IOC_SETVERSION |
227 | #ifdef CONFIG_JBD_DEBUG | 227 | #ifdef CONFIG_JBD_DEBUG |
228 | #define EXT3_IOC_WAIT_FOR_READONLY _IOR('f', 99, long) | 228 | #define EXT3_IOC_WAIT_FOR_READONLY _IOR('f', 99, long) |
229 | #endif | 229 | #endif |
@@ -231,6 +231,23 @@ struct ext3_new_group_data { | |||
231 | #define EXT3_IOC_SETRSVSZ _IOW('f', 6, long) | 231 | #define EXT3_IOC_SETRSVSZ _IOW('f', 6, long) |
232 | 232 | ||
233 | /* | 233 | /* |
234 | * ioctl commands in 32 bit emulation | ||
235 | */ | ||
236 | #define EXT3_IOC32_GETFLAGS FS_IOC32_GETFLAGS | ||
237 | #define EXT3_IOC32_SETFLAGS FS_IOC32_SETFLAGS | ||
238 | #define EXT3_IOC32_GETVERSION _IOR('f', 3, int) | ||
239 | #define EXT3_IOC32_SETVERSION _IOW('f', 4, int) | ||
240 | #define EXT3_IOC32_GETRSVSZ _IOR('f', 5, int) | ||
241 | #define EXT3_IOC32_SETRSVSZ _IOW('f', 6, int) | ||
242 | #define EXT3_IOC32_GROUP_EXTEND _IOW('f', 7, unsigned int) | ||
243 | #ifdef CONFIG_JBD_DEBUG | ||
244 | #define EXT3_IOC32_WAIT_FOR_READONLY _IOR('f', 99, int) | ||
245 | #endif | ||
246 | #define EXT3_IOC32_GETVERSION_OLD FS_IOC32_GETVERSION | ||
247 | #define EXT3_IOC32_SETVERSION_OLD FS_IOC32_SETVERSION | ||
248 | |||
249 | |||
250 | /* | ||
234 | * Mount options | 251 | * Mount options |
235 | */ | 252 | */ |
236 | struct ext3_mount_options { | 253 | struct ext3_mount_options { |
@@ -812,6 +829,7 @@ extern void ext3_set_aops(struct inode *inode); | |||
812 | /* ioctl.c */ | 829 | /* ioctl.c */ |
813 | extern int ext3_ioctl (struct inode *, struct file *, unsigned int, | 830 | extern int ext3_ioctl (struct inode *, struct file *, unsigned int, |
814 | unsigned long); | 831 | unsigned long); |
832 | extern long ext3_compat_ioctl (struct file *, unsigned int, unsigned long); | ||
815 | 833 | ||
816 | /* namei.c */ | 834 | /* namei.c */ |
817 | extern int ext3_orphan_add(handle_t *, struct inode *); | 835 | extern int ext3_orphan_add(handle_t *, struct inode *); |
diff --git a/include/linux/fb.h b/include/linux/fb.h index 2f335e966011..3e69241e6a81 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _LINUX_FB_H | 2 | #define _LINUX_FB_H |
3 | 3 | ||
4 | #include <asm/types.h> | 4 | #include <asm/types.h> |
5 | #include <linux/i2c.h> | ||
5 | 6 | ||
6 | /* Definitions of frame buffers */ | 7 | /* Definitions of frame buffers */ |
7 | 8 | ||
@@ -775,6 +776,7 @@ struct fb_info { | |||
775 | struct fb_ops *fbops; | 776 | struct fb_ops *fbops; |
776 | struct device *device; | 777 | struct device *device; |
777 | struct class_device *class_device; /* sysfs per device attrs */ | 778 | struct class_device *class_device; /* sysfs per device attrs */ |
779 | int class_flag; /* private sysfs flags */ | ||
778 | #ifdef CONFIG_FB_TILEBLITTING | 780 | #ifdef CONFIG_FB_TILEBLITTING |
779 | struct fb_tile_ops *tileops; /* Tile Blitting */ | 781 | struct fb_tile_ops *tileops; /* Tile Blitting */ |
780 | #endif | 782 | #endif |
@@ -940,6 +942,7 @@ extern void fb_edid_to_monspecs(unsigned char *edid, | |||
940 | struct fb_monspecs *specs); | 942 | struct fb_monspecs *specs); |
941 | extern void fb_destroy_modedb(struct fb_videomode *modedb); | 943 | extern void fb_destroy_modedb(struct fb_videomode *modedb); |
942 | extern int fb_find_mode_cvt(struct fb_videomode *mode, int margins, int rb); | 944 | extern int fb_find_mode_cvt(struct fb_videomode *mode, int margins, int rb); |
945 | extern unsigned char *fb_ddc_read(struct i2c_adapter *adapter); | ||
943 | 946 | ||
944 | /* drivers/video/modedb.c */ | 947 | /* drivers/video/modedb.c */ |
945 | #define VESA_MODEDB_SIZE 34 | 948 | #define VESA_MODEDB_SIZE 34 |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 6eafbe309483..f53bf4ff1955 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -79,8 +79,8 @@ extern int dir_notify_enable; | |||
79 | #define WRITE 1 | 79 | #define WRITE 1 |
80 | #define READA 2 /* read-ahead - don't block if no resources */ | 80 | #define READA 2 /* read-ahead - don't block if no resources */ |
81 | #define SWRITE 3 /* for ll_rw_block() - wait for buffer lock */ | 81 | #define SWRITE 3 /* for ll_rw_block() - wait for buffer lock */ |
82 | #define SPECIAL 4 /* For non-blockdevice requests in request queue */ | ||
83 | #define READ_SYNC (READ | (1 << BIO_RW_SYNC)) | 82 | #define READ_SYNC (READ | (1 << BIO_RW_SYNC)) |
83 | #define READ_META (READ | (1 << BIO_RW_META)) | ||
84 | #define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC)) | 84 | #define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC)) |
85 | #define WRITE_BARRIER ((1 << BIO_RW) | (1 << BIO_RW_BARRIER)) | 85 | #define WRITE_BARRIER ((1 << BIO_RW) | (1 << BIO_RW_BARRIER)) |
86 | 86 | ||
@@ -217,6 +217,45 @@ extern int dir_notify_enable; | |||
217 | #define FIBMAP _IO(0x00,1) /* bmap access */ | 217 | #define FIBMAP _IO(0x00,1) /* bmap access */ |
218 | #define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */ | 218 | #define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */ |
219 | 219 | ||
220 | #define FS_IOC_GETFLAGS _IOR('f', 1, long) | ||
221 | #define FS_IOC_SETFLAGS _IOW('f', 2, long) | ||
222 | #define FS_IOC_GETVERSION _IOR('v', 1, long) | ||
223 | #define FS_IOC_SETVERSION _IOW('v', 2, long) | ||
224 | #define FS_IOC32_GETFLAGS _IOR('f', 1, int) | ||
225 | #define FS_IOC32_SETFLAGS _IOW('f', 2, int) | ||
226 | #define FS_IOC32_GETVERSION _IOR('v', 1, int) | ||
227 | #define FS_IOC32_SETVERSION _IOW('v', 2, int) | ||
228 | |||
229 | /* | ||
230 | * Inode flags (FS_IOC_GETFLAGS / FS_IOC_SETFLAGS) | ||
231 | */ | ||
232 | #define FS_SECRM_FL 0x00000001 /* Secure deletion */ | ||
233 | #define FS_UNRM_FL 0x00000002 /* Undelete */ | ||
234 | #define FS_COMPR_FL 0x00000004 /* Compress file */ | ||
235 | #define FS_SYNC_FL 0x00000008 /* Synchronous updates */ | ||
236 | #define FS_IMMUTABLE_FL 0x00000010 /* Immutable file */ | ||
237 | #define FS_APPEND_FL 0x00000020 /* writes to file may only append */ | ||
238 | #define FS_NODUMP_FL 0x00000040 /* do not dump file */ | ||
239 | #define FS_NOATIME_FL 0x00000080 /* do not update atime */ | ||
240 | /* Reserved for compression usage... */ | ||
241 | #define FS_DIRTY_FL 0x00000100 | ||
242 | #define FS_COMPRBLK_FL 0x00000200 /* One or more compressed clusters */ | ||
243 | #define FS_NOCOMP_FL 0x00000400 /* Don't compress */ | ||
244 | #define FS_ECOMPR_FL 0x00000800 /* Compression error */ | ||
245 | /* End compression flags --- maybe not all used */ | ||
246 | #define FS_BTREE_FL 0x00001000 /* btree format dir */ | ||
247 | #define FS_INDEX_FL 0x00001000 /* hash-indexed directory */ | ||
248 | #define FS_IMAGIC_FL 0x00002000 /* AFS directory */ | ||
249 | #define FS_JOURNAL_DATA_FL 0x00004000 /* Reserved for ext3 */ | ||
250 | #define FS_NOTAIL_FL 0x00008000 /* file tail should not be merged */ | ||
251 | #define FS_DIRSYNC_FL 0x00010000 /* dirsync behaviour (directories only) */ | ||
252 | #define FS_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/ | ||
253 | #define FS_RESERVED_FL 0x80000000 /* reserved for ext2 lib */ | ||
254 | |||
255 | #define FS_FL_USER_VISIBLE 0x0003DFFF /* User visible flags */ | ||
256 | #define FS_FL_USER_MODIFIABLE 0x000380FF /* User modifiable flags */ | ||
257 | |||
258 | |||
220 | #define SYNC_FILE_RANGE_WAIT_BEFORE 1 | 259 | #define SYNC_FILE_RANGE_WAIT_BEFORE 1 |
221 | #define SYNC_FILE_RANGE_WRITE 2 | 260 | #define SYNC_FILE_RANGE_WRITE 2 |
222 | #define SYNC_FILE_RANGE_WAIT_AFTER 4 | 261 | #define SYNC_FILE_RANGE_WAIT_AFTER 4 |
@@ -645,7 +684,8 @@ extern struct block_device *I_BDEV(struct inode *inode); | |||
645 | 684 | ||
646 | struct fown_struct { | 685 | struct fown_struct { |
647 | rwlock_t lock; /* protects pid, uid, euid fields */ | 686 | rwlock_t lock; /* protects pid, uid, euid fields */ |
648 | 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 */ | ||
649 | uid_t uid, euid; /* uid/euid of process setting the owner */ | 689 | uid_t uid, euid; /* uid/euid of process setting the owner */ |
650 | int signum; /* posix.1b rt signal to be delivered on IO */ | 690 | int signum; /* posix.1b rt signal to be delivered on IO */ |
651 | }; | 691 | }; |
@@ -841,8 +881,10 @@ extern void kill_fasync(struct fasync_struct **, int, int); | |||
841 | /* only for net: no internal synchronization */ | 881 | /* only for net: no internal synchronization */ |
842 | extern void __kill_fasync(struct fasync_struct *, int, int); | 882 | extern void __kill_fasync(struct fasync_struct *, int, int); |
843 | 883 | ||
884 | extern int __f_setown(struct file *filp, struct pid *, enum pid_type, int force); | ||
844 | 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); |
845 | extern void f_delown(struct file *filp); | 886 | extern void f_delown(struct file *filp); |
887 | extern pid_t f_getown(struct file *filp); | ||
846 | extern int send_sigurg(struct fown_struct *fown); | 888 | extern int send_sigurg(struct fown_struct *fown); |
847 | 889 | ||
848 | /* | 890 | /* |
@@ -1007,7 +1049,7 @@ int generic_osync_inode(struct inode *, struct address_space *, int); | |||
1007 | * This allows the kernel to read directories into kernel space or | 1049 | * This allows the kernel to read directories into kernel space or |
1008 | * to have different dirent layouts depending on the binary type. | 1050 | * to have different dirent layouts depending on the binary type. |
1009 | */ | 1051 | */ |
1010 | typedef int (*filldir_t)(void *, const char *, int, loff_t, ino_t, unsigned); | 1052 | typedef int (*filldir_t)(void *, const char *, int, loff_t, u64, unsigned); |
1011 | 1053 | ||
1012 | struct block_device_operations { | 1054 | struct block_device_operations { |
1013 | int (*open) (struct inode *, struct file *); | 1055 | int (*open) (struct inode *, struct file *); |
@@ -1058,9 +1100,9 @@ struct file_operations { | |||
1058 | struct module *owner; | 1100 | struct module *owner; |
1059 | loff_t (*llseek) (struct file *, loff_t, int); | 1101 | loff_t (*llseek) (struct file *, loff_t, int); |
1060 | ssize_t (*read) (struct file *, char __user *, size_t, loff_t *); | 1102 | ssize_t (*read) (struct file *, char __user *, size_t, loff_t *); |
1061 | ssize_t (*aio_read) (struct kiocb *, char __user *, size_t, loff_t); | ||
1062 | ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *); | 1103 | ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *); |
1063 | ssize_t (*aio_write) (struct kiocb *, const char __user *, size_t, loff_t); | 1104 | ssize_t (*aio_read) (struct kiocb *, const struct iovec *, unsigned long, loff_t); |
1105 | ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t); | ||
1064 | int (*readdir) (struct file *, void *, filldir_t); | 1106 | int (*readdir) (struct file *, void *, filldir_t); |
1065 | unsigned int (*poll) (struct file *, struct poll_table_struct *); | 1107 | unsigned int (*poll) (struct file *, struct poll_table_struct *); |
1066 | int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long); | 1108 | int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long); |
@@ -1074,8 +1116,6 @@ struct file_operations { | |||
1074 | int (*aio_fsync) (struct kiocb *, int datasync); | 1116 | int (*aio_fsync) (struct kiocb *, int datasync); |
1075 | int (*fasync) (int, struct file *, int); | 1117 | int (*fasync) (int, struct file *, int); |
1076 | int (*lock) (struct file *, int, struct file_lock *); | 1118 | int (*lock) (struct file *, int, struct file_lock *); |
1077 | ssize_t (*readv) (struct file *, const struct iovec *, unsigned long, loff_t *); | ||
1078 | ssize_t (*writev) (struct file *, const struct iovec *, unsigned long, loff_t *); | ||
1079 | ssize_t (*sendfile) (struct file *, loff_t *, size_t, read_actor_t, void *); | 1119 | ssize_t (*sendfile) (struct file *, loff_t *, size_t, read_actor_t, void *); |
1080 | ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int); | 1120 | ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int); |
1081 | unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); | 1121 | unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); |
@@ -1113,6 +1153,11 @@ struct inode_operations { | |||
1113 | 1153 | ||
1114 | struct seq_file; | 1154 | struct seq_file; |
1115 | 1155 | ||
1156 | ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector, | ||
1157 | unsigned long nr_segs, unsigned long fast_segs, | ||
1158 | struct iovec *fast_pointer, | ||
1159 | struct iovec **ret_pointer); | ||
1160 | |||
1116 | extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *); | 1161 | extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *); |
1117 | extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *); | 1162 | extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *); |
1118 | extern ssize_t vfs_readv(struct file *, const struct iovec __user *, | 1163 | extern ssize_t vfs_readv(struct file *, const struct iovec __user *, |
@@ -1177,15 +1222,30 @@ static inline void mark_inode_dirty_sync(struct inode *inode) | |||
1177 | __mark_inode_dirty(inode, I_DIRTY_SYNC); | 1222 | __mark_inode_dirty(inode, I_DIRTY_SYNC); |
1178 | } | 1223 | } |
1179 | 1224 | ||
1180 | static inline void inode_inc_link_count(struct inode *inode) | 1225 | static inline void inc_nlink(struct inode *inode) |
1181 | { | 1226 | { |
1182 | inode->i_nlink++; | 1227 | inode->i_nlink++; |
1228 | } | ||
1229 | |||
1230 | static inline void inode_inc_link_count(struct inode *inode) | ||
1231 | { | ||
1232 | inc_nlink(inode); | ||
1183 | mark_inode_dirty(inode); | 1233 | mark_inode_dirty(inode); |
1184 | } | 1234 | } |
1185 | 1235 | ||
1186 | static inline void inode_dec_link_count(struct inode *inode) | 1236 | static inline void drop_nlink(struct inode *inode) |
1187 | { | 1237 | { |
1188 | inode->i_nlink--; | 1238 | inode->i_nlink--; |
1239 | } | ||
1240 | |||
1241 | static inline void clear_nlink(struct inode *inode) | ||
1242 | { | ||
1243 | inode->i_nlink = 0; | ||
1244 | } | ||
1245 | |||
1246 | static inline void inode_dec_link_count(struct inode *inode) | ||
1247 | { | ||
1248 | drop_nlink(inode); | ||
1189 | mark_inode_dirty(inode); | 1249 | mark_inode_dirty(inode); |
1190 | } | 1250 | } |
1191 | 1251 | ||
@@ -1443,6 +1503,7 @@ extern void __init vfs_caches_init(unsigned long); | |||
1443 | extern void putname(const char *name); | 1503 | extern void putname(const char *name); |
1444 | #endif | 1504 | #endif |
1445 | 1505 | ||
1506 | #ifdef CONFIG_BLOCK | ||
1446 | extern int register_blkdev(unsigned int, const char *); | 1507 | extern int register_blkdev(unsigned int, const char *); |
1447 | extern int unregister_blkdev(unsigned int, const char *); | 1508 | extern int unregister_blkdev(unsigned int, const char *); |
1448 | extern struct block_device *bdget(dev_t); | 1509 | extern struct block_device *bdget(dev_t); |
@@ -1451,13 +1512,20 @@ extern void bd_forget(struct inode *inode); | |||
1451 | extern void bdput(struct block_device *); | 1512 | extern void bdput(struct block_device *); |
1452 | extern struct block_device *open_by_devnum(dev_t, unsigned); | 1513 | extern struct block_device *open_by_devnum(dev_t, unsigned); |
1453 | extern struct block_device *open_partition_by_devnum(dev_t, unsigned); | 1514 | extern struct block_device *open_partition_by_devnum(dev_t, unsigned); |
1454 | extern const struct file_operations def_blk_fops; | ||
1455 | extern const struct address_space_operations def_blk_aops; | 1515 | extern const struct address_space_operations def_blk_aops; |
1516 | #else | ||
1517 | static inline void bd_forget(struct inode *inode) {} | ||
1518 | #endif | ||
1519 | extern const struct file_operations def_blk_fops; | ||
1456 | extern const struct file_operations def_chr_fops; | 1520 | extern const struct file_operations def_chr_fops; |
1457 | extern const struct file_operations bad_sock_fops; | 1521 | extern const struct file_operations bad_sock_fops; |
1458 | extern const struct file_operations def_fifo_fops; | 1522 | extern const struct file_operations def_fifo_fops; |
1523 | #ifdef CONFIG_BLOCK | ||
1459 | extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long); | 1524 | extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long); |
1460 | extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long); | 1525 | extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long); |
1526 | extern int blkdev_driver_ioctl(struct inode *inode, struct file *file, | ||
1527 | struct gendisk *disk, unsigned cmd, | ||
1528 | unsigned long arg); | ||
1461 | extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); | 1529 | extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); |
1462 | extern int blkdev_get(struct block_device *, mode_t, unsigned); | 1530 | extern int blkdev_get(struct block_device *, mode_t, unsigned); |
1463 | extern int blkdev_put(struct block_device *); | 1531 | extern int blkdev_put(struct block_device *); |
@@ -1471,6 +1539,7 @@ extern void bd_release_from_disk(struct block_device *, struct gendisk *); | |||
1471 | #define bd_claim_by_disk(bdev, holder, disk) bd_claim(bdev, holder) | 1539 | #define bd_claim_by_disk(bdev, holder, disk) bd_claim(bdev, holder) |
1472 | #define bd_release_from_disk(bdev, disk) bd_release(bdev) | 1540 | #define bd_release_from_disk(bdev, disk) bd_release(bdev) |
1473 | #endif | 1541 | #endif |
1542 | #endif | ||
1474 | 1543 | ||
1475 | /* fs/char_dev.c */ | 1544 | /* fs/char_dev.c */ |
1476 | #define CHRDEV_MAJOR_HASH_SIZE 255 | 1545 | #define CHRDEV_MAJOR_HASH_SIZE 255 |
@@ -1484,14 +1553,19 @@ extern int chrdev_open(struct inode *, struct file *); | |||
1484 | extern void chrdev_show(struct seq_file *,off_t); | 1553 | extern void chrdev_show(struct seq_file *,off_t); |
1485 | 1554 | ||
1486 | /* fs/block_dev.c */ | 1555 | /* fs/block_dev.c */ |
1487 | #define BLKDEV_MAJOR_HASH_SIZE 255 | ||
1488 | #define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */ | 1556 | #define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */ |
1557 | |||
1558 | #ifdef CONFIG_BLOCK | ||
1559 | #define BLKDEV_MAJOR_HASH_SIZE 255 | ||
1489 | extern const char *__bdevname(dev_t, char *buffer); | 1560 | extern const char *__bdevname(dev_t, char *buffer); |
1490 | extern const char *bdevname(struct block_device *bdev, char *buffer); | 1561 | extern const char *bdevname(struct block_device *bdev, char *buffer); |
1491 | extern struct block_device *lookup_bdev(const char *); | 1562 | extern struct block_device *lookup_bdev(const char *); |
1492 | extern struct block_device *open_bdev_excl(const char *, int, void *); | 1563 | extern struct block_device *open_bdev_excl(const char *, int, void *); |
1493 | extern void close_bdev_excl(struct block_device *); | 1564 | extern void close_bdev_excl(struct block_device *); |
1494 | extern void blkdev_show(struct seq_file *,off_t); | 1565 | extern void blkdev_show(struct seq_file *,off_t); |
1566 | #else | ||
1567 | #define BLKDEV_MAJOR_HASH_SIZE 0 | ||
1568 | #endif | ||
1495 | 1569 | ||
1496 | extern void init_special_inode(struct inode *, umode_t, dev_t); | 1570 | extern void init_special_inode(struct inode *, umode_t, dev_t); |
1497 | 1571 | ||
@@ -1505,6 +1579,7 @@ extern const struct file_operations rdwr_fifo_fops; | |||
1505 | 1579 | ||
1506 | extern int fs_may_remount_ro(struct super_block *); | 1580 | extern int fs_may_remount_ro(struct super_block *); |
1507 | 1581 | ||
1582 | #ifdef CONFIG_BLOCK | ||
1508 | /* | 1583 | /* |
1509 | * return READ, READA, or WRITE | 1584 | * return READ, READA, or WRITE |
1510 | */ | 1585 | */ |
@@ -1516,9 +1591,10 @@ extern int fs_may_remount_ro(struct super_block *); | |||
1516 | #define bio_data_dir(bio) ((bio)->bi_rw & 1) | 1591 | #define bio_data_dir(bio) ((bio)->bi_rw & 1) |
1517 | 1592 | ||
1518 | extern int check_disk_change(struct block_device *); | 1593 | extern int check_disk_change(struct block_device *); |
1519 | extern int invalidate_inodes(struct super_block *); | ||
1520 | extern int __invalidate_device(struct block_device *); | 1594 | extern int __invalidate_device(struct block_device *); |
1521 | extern int invalidate_partition(struct gendisk *, int); | 1595 | extern int invalidate_partition(struct gendisk *, int); |
1596 | #endif | ||
1597 | extern int invalidate_inodes(struct super_block *); | ||
1522 | unsigned long invalidate_mapping_pages(struct address_space *mapping, | 1598 | unsigned long invalidate_mapping_pages(struct address_space *mapping, |
1523 | pgoff_t start, pgoff_t end); | 1599 | pgoff_t start, pgoff_t end); |
1524 | unsigned long invalidate_inode_pages(struct address_space *mapping); | 1600 | unsigned long invalidate_inode_pages(struct address_space *mapping); |
@@ -1546,11 +1622,14 @@ extern int __filemap_fdatawrite_range(struct address_space *mapping, | |||
1546 | extern long do_fsync(struct file *file, int datasync); | 1622 | extern long do_fsync(struct file *file, int datasync); |
1547 | extern void sync_supers(void); | 1623 | extern void sync_supers(void); |
1548 | extern void sync_filesystems(int wait); | 1624 | extern void sync_filesystems(int wait); |
1625 | extern void __fsync_super(struct super_block *sb); | ||
1549 | extern void emergency_sync(void); | 1626 | extern void emergency_sync(void); |
1550 | extern void emergency_remount(void); | 1627 | extern void emergency_remount(void); |
1551 | extern int do_remount_sb(struct super_block *sb, int flags, | 1628 | extern int do_remount_sb(struct super_block *sb, int flags, |
1552 | void *data, int force); | 1629 | void *data, int force); |
1630 | #ifdef CONFIG_BLOCK | ||
1553 | extern sector_t bmap(struct inode *, sector_t); | 1631 | extern sector_t bmap(struct inode *, sector_t); |
1632 | #endif | ||
1554 | extern int notify_change(struct dentry *, struct iattr *); | 1633 | extern int notify_change(struct dentry *, struct iattr *); |
1555 | extern int permission(struct inode *, int, struct nameidata *); | 1634 | extern int permission(struct inode *, int, struct nameidata *); |
1556 | extern int generic_permission(struct inode *, int, | 1635 | extern int generic_permission(struct inode *, int, |
@@ -1568,6 +1647,9 @@ static inline void allow_write_access(struct file *file) | |||
1568 | atomic_inc(&file->f_dentry->d_inode->i_writecount); | 1647 | atomic_inc(&file->f_dentry->d_inode->i_writecount); |
1569 | } | 1648 | } |
1570 | extern int do_pipe(int *); | 1649 | extern int do_pipe(int *); |
1650 | extern struct file *create_read_pipe(struct file *f); | ||
1651 | extern struct file *create_write_pipe(void); | ||
1652 | extern void free_write_pipe(struct file *); | ||
1571 | 1653 | ||
1572 | extern int open_namei(int dfd, const char *, int, int, struct nameidata *); | 1654 | extern int open_namei(int dfd, const char *, int, int, struct nameidata *); |
1573 | extern int may_open(struct nameidata *, int, int); | 1655 | extern int may_open(struct nameidata *, int, int); |
@@ -1633,9 +1715,11 @@ static inline void insert_inode_hash(struct inode *inode) { | |||
1633 | extern struct file * get_empty_filp(void); | 1715 | extern struct file * get_empty_filp(void); |
1634 | extern void file_move(struct file *f, struct list_head *list); | 1716 | extern void file_move(struct file *f, struct list_head *list); |
1635 | extern void file_kill(struct file *f); | 1717 | extern void file_kill(struct file *f); |
1718 | #ifdef CONFIG_BLOCK | ||
1636 | struct bio; | 1719 | struct bio; |
1637 | extern void submit_bio(int, struct bio *); | 1720 | extern void submit_bio(int, struct bio *); |
1638 | extern int bdev_read_only(struct block_device *); | 1721 | extern int bdev_read_only(struct block_device *); |
1722 | #endif | ||
1639 | extern int set_blocksize(struct block_device *, int); | 1723 | extern int set_blocksize(struct block_device *, int); |
1640 | extern int sb_set_blocksize(struct super_block *, int); | 1724 | extern int sb_set_blocksize(struct super_block *, int); |
1641 | extern int sb_min_blocksize(struct super_block *, int); | 1725 | extern int sb_min_blocksize(struct super_block *, int); |
@@ -1644,22 +1728,17 @@ extern int generic_file_mmap(struct file *, struct vm_area_struct *); | |||
1644 | extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *); | 1728 | extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *); |
1645 | extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); | 1729 | extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); |
1646 | extern int file_send_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); | 1730 | extern int file_send_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); |
1647 | extern ssize_t generic_file_read(struct file *, char __user *, size_t, loff_t *); | ||
1648 | int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk); | 1731 | int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk); |
1649 | extern ssize_t generic_file_write(struct file *, const char __user *, size_t, loff_t *); | 1732 | extern ssize_t generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t); |
1650 | extern ssize_t generic_file_aio_read(struct kiocb *, char __user *, size_t, loff_t); | 1733 | extern ssize_t generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long, loff_t); |
1651 | extern ssize_t __generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t *); | ||
1652 | extern ssize_t generic_file_aio_write(struct kiocb *, const char __user *, size_t, loff_t); | ||
1653 | extern ssize_t generic_file_aio_write_nolock(struct kiocb *, const struct iovec *, | 1734 | extern ssize_t generic_file_aio_write_nolock(struct kiocb *, const struct iovec *, |
1654 | unsigned long, loff_t *); | 1735 | unsigned long, loff_t); |
1655 | extern ssize_t generic_file_direct_write(struct kiocb *, const struct iovec *, | 1736 | extern ssize_t generic_file_direct_write(struct kiocb *, const struct iovec *, |
1656 | unsigned long *, loff_t, loff_t *, size_t, size_t); | 1737 | unsigned long *, loff_t, loff_t *, size_t, size_t); |
1657 | extern ssize_t generic_file_buffered_write(struct kiocb *, const struct iovec *, | 1738 | extern ssize_t generic_file_buffered_write(struct kiocb *, const struct iovec *, |
1658 | unsigned long, loff_t, loff_t *, size_t, ssize_t); | 1739 | unsigned long, loff_t, loff_t *, size_t, ssize_t); |
1659 | extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos); | 1740 | extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos); |
1660 | extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos); | 1741 | extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos); |
1661 | ssize_t generic_file_write_nolock(struct file *file, const struct iovec *iov, | ||
1662 | unsigned long nr_segs, loff_t *ppos); | ||
1663 | extern ssize_t generic_file_sendfile(struct file *, loff_t *, size_t, read_actor_t, void *); | 1742 | extern ssize_t generic_file_sendfile(struct file *, loff_t *, size_t, read_actor_t, void *); |
1664 | extern void do_generic_mapping_read(struct address_space *mapping, | 1743 | extern void do_generic_mapping_read(struct address_space *mapping, |
1665 | struct file_ra_state *, struct file *, | 1744 | struct file_ra_state *, struct file *, |
@@ -1677,10 +1756,6 @@ extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out, | |||
1677 | 1756 | ||
1678 | extern void | 1757 | extern void |
1679 | file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); | 1758 | file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); |
1680 | extern ssize_t generic_file_readv(struct file *filp, const struct iovec *iov, | ||
1681 | unsigned long nr_segs, loff_t *ppos); | ||
1682 | ssize_t generic_file_writev(struct file *filp, const struct iovec *iov, | ||
1683 | unsigned long nr_segs, loff_t *ppos); | ||
1684 | extern loff_t no_llseek(struct file *file, loff_t offset, int origin); | 1759 | extern loff_t no_llseek(struct file *file, loff_t offset, int origin); |
1685 | extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin); | 1760 | extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin); |
1686 | extern loff_t remote_llseek(struct file *file, loff_t offset, int origin); | 1761 | extern loff_t remote_llseek(struct file *file, loff_t offset, int origin); |
@@ -1716,6 +1791,7 @@ static inline void do_generic_file_read(struct file * filp, loff_t *ppos, | |||
1716 | actor); | 1791 | actor); |
1717 | } | 1792 | } |
1718 | 1793 | ||
1794 | #ifdef CONFIG_BLOCK | ||
1719 | ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, | 1795 | ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, |
1720 | struct block_device *bdev, const struct iovec *iov, loff_t offset, | 1796 | struct block_device *bdev, const struct iovec *iov, loff_t offset, |
1721 | unsigned long nr_segs, get_block_t get_block, dio_iodone_t end_io, | 1797 | unsigned long nr_segs, get_block_t get_block, dio_iodone_t end_io, |
@@ -1753,6 +1829,7 @@ static inline ssize_t blockdev_direct_IO_own_locking(int rw, struct kiocb *iocb, | |||
1753 | return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, | 1829 | return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, |
1754 | nr_segs, get_block, end_io, DIO_OWN_LOCKING); | 1830 | nr_segs, get_block, end_io, DIO_OWN_LOCKING); |
1755 | } | 1831 | } |
1832 | #endif | ||
1756 | 1833 | ||
1757 | extern const struct file_operations generic_ro_fops; | 1834 | extern const struct file_operations generic_ro_fops; |
1758 | 1835 | ||
diff --git a/include/linux/fs_enet_pd.h b/include/linux/fs_enet_pd.h index 74ed35a00a94..543cd3cd9e77 100644 --- a/include/linux/fs_enet_pd.h +++ b/include/linux/fs_enet_pd.h | |||
@@ -55,6 +55,30 @@ static inline int fs_get_scc_index(enum fs_id id) | |||
55 | return -1; | 55 | return -1; |
56 | } | 56 | } |
57 | 57 | ||
58 | static inline int fs_fec_index2id(int index) | ||
59 | { | ||
60 | int id = fsid_fec1 + index - 1; | ||
61 | if (id >= fsid_fec1 && id <= fsid_fec2) | ||
62 | return id; | ||
63 | return FS_MAX_INDEX; | ||
64 | } | ||
65 | |||
66 | static inline int fs_fcc_index2id(int index) | ||
67 | { | ||
68 | int id = fsid_fcc1 + index - 1; | ||
69 | if (id >= fsid_fcc1 && id <= fsid_fcc3) | ||
70 | return id; | ||
71 | return FS_MAX_INDEX; | ||
72 | } | ||
73 | |||
74 | static inline int fs_scc_index2id(int index) | ||
75 | { | ||
76 | int id = fsid_scc1 + index - 1; | ||
77 | if (id >= fsid_scc1 && id <= fsid_scc4) | ||
78 | return id; | ||
79 | return FS_MAX_INDEX; | ||
80 | } | ||
81 | |||
58 | enum fs_mii_method { | 82 | enum fs_mii_method { |
59 | fsmii_fixed, | 83 | fsmii_fixed, |
60 | fsmii_fec, | 84 | fsmii_fec, |
@@ -87,18 +111,21 @@ struct fs_mii_bb_platform_info { | |||
87 | }; | 111 | }; |
88 | 112 | ||
89 | struct fs_platform_info { | 113 | struct fs_platform_info { |
90 | 114 | ||
91 | void(*init_ioports)(void); | 115 | void(*init_ioports)(struct fs_platform_info *); |
92 | /* device specific information */ | 116 | /* device specific information */ |
93 | int fs_no; /* controller index */ | 117 | int fs_no; /* controller index */ |
118 | char fs_type[4]; /* controller type */ | ||
94 | 119 | ||
95 | u32 cp_page; /* CPM page */ | 120 | u32 cp_page; /* CPM page */ |
96 | u32 cp_block; /* CPM sblock */ | 121 | u32 cp_block; /* CPM sblock */ |
97 | 122 | ||
98 | u32 clk_trx; /* some stuff for pins & mux configuration*/ | 123 | u32 clk_trx; /* some stuff for pins & mux configuration*/ |
124 | u32 clk_rx; | ||
125 | u32 clk_tx; | ||
99 | u32 clk_route; | 126 | u32 clk_route; |
100 | u32 clk_mask; | 127 | u32 clk_mask; |
101 | 128 | ||
102 | u32 mem_offset; | 129 | u32 mem_offset; |
103 | u32 dpram_offset; | 130 | u32 dpram_offset; |
104 | u32 fcc_regs_c; | 131 | u32 fcc_regs_c; |
@@ -124,4 +151,16 @@ struct fs_mii_fec_platform_info { | |||
124 | u32 irq[32]; | 151 | u32 irq[32]; |
125 | u32 mii_speed; | 152 | u32 mii_speed; |
126 | }; | 153 | }; |
154 | |||
155 | static inline int fs_get_id(struct fs_platform_info *fpi) | ||
156 | { | ||
157 | if(strstr(fpi->fs_type, "SCC")) | ||
158 | return fs_scc_index2id(fpi->fs_no); | ||
159 | if(strstr(fpi->fs_type, "FCC")) | ||
160 | return fs_fcc_index2id(fpi->fs_no); | ||
161 | if(strstr(fpi->fs_type, "FEC")) | ||
162 | return fs_fec_index2id(fpi->fs_no); | ||
163 | return fpi->fs_no; | ||
164 | } | ||
165 | |||
127 | #endif | 166 | #endif |
diff --git a/include/linux/fs_uart_pd.h b/include/linux/fs_uart_pd.h index f5975126b712..809bb9ffc788 100644 --- a/include/linux/fs_uart_pd.h +++ b/include/linux/fs_uart_pd.h | |||
@@ -46,15 +46,27 @@ static inline int fs_uart_id_fsid2smc(int id) | |||
46 | } | 46 | } |
47 | 47 | ||
48 | struct fs_uart_platform_info { | 48 | struct fs_uart_platform_info { |
49 | void(*init_ioports)(void); | 49 | void(*init_ioports)(struct fs_uart_platform_info *); |
50 | /* device specific information */ | 50 | /* device specific information */ |
51 | int fs_no; /* controller index */ | 51 | int fs_no; /* controller index */ |
52 | char fs_type[4]; /* controller type */ | ||
52 | u32 uart_clk; | 53 | u32 uart_clk; |
53 | u8 tx_num_fifo; | 54 | u8 tx_num_fifo; |
54 | u8 tx_buf_size; | 55 | u8 tx_buf_size; |
55 | u8 rx_num_fifo; | 56 | u8 rx_num_fifo; |
56 | u8 rx_buf_size; | 57 | u8 rx_buf_size; |
57 | u8 brg; | 58 | u8 brg; |
59 | u8 clk_rx; | ||
60 | u8 clk_tx; | ||
58 | }; | 61 | }; |
59 | 62 | ||
63 | static inline int fs_uart_get_id(struct fs_uart_platform_info *fpi) | ||
64 | { | ||
65 | if(strstr(fpi->fs_type, "SMC")) | ||
66 | return fs_uart_id_smc2fsid(fpi->fs_no); | ||
67 | if(strstr(fpi->fs_type, "SCC")) | ||
68 | return fs_uart_id_scc2fsid(fpi->fs_no); | ||
69 | return fpi->fs_no; | ||
70 | } | ||
71 | |||
60 | #endif | 72 | #endif |
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/genhd.h b/include/linux/genhd.h index e4af57e87c17..41f276fdd185 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -11,6 +11,8 @@ | |||
11 | 11 | ||
12 | #include <linux/types.h> | 12 | #include <linux/types.h> |
13 | 13 | ||
14 | #ifdef CONFIG_BLOCK | ||
15 | |||
14 | enum { | 16 | enum { |
15 | /* These three have identical behaviour; use the second one if DOS FDISK gets | 17 | /* These three have identical behaviour; use the second one if DOS FDISK gets |
16 | confused about extended/logical partitions starting past cylinder 1023. */ | 18 | confused about extended/logical partitions starting past cylinder 1023. */ |
@@ -420,3 +422,5 @@ static inline struct block_device *bdget_disk(struct gendisk *disk, int index) | |||
420 | #endif | 422 | #endif |
421 | 423 | ||
422 | #endif | 424 | #endif |
425 | |||
426 | #endif | ||
diff --git a/include/linux/getcpu.h b/include/linux/getcpu.h index 031ed3780e45..c7372d7a97be 100644 --- a/include/linux/getcpu.h +++ b/include/linux/getcpu.h | |||
@@ -1,16 +1,18 @@ | |||
1 | #ifndef _LINUX_GETCPU_H | 1 | #ifndef _LINUX_GETCPU_H |
2 | #define _LINUX_GETCPU_H 1 | 2 | #define _LINUX_GETCPU_H 1 |
3 | 3 | ||
4 | /* Cache for getcpu() to speed it up. Results might be upto a jiffie | 4 | /* Cache for getcpu() to speed it up. Results might be a short time |
5 | out of date, but will be faster. | 5 | out of date, but will be faster. |
6 | |||
6 | User programs should not refer to the contents of this structure. | 7 | User programs should not refer to the contents of this structure. |
7 | It is only a cache for vgetcpu(). It might change in future kernels. | 8 | I repeat they should not refer to it. If they do they will break |
9 | in future kernels. | ||
10 | |||
11 | It is only a private cache for vgetcpu(). It will change in future kernels. | ||
8 | The user program must store this information per thread (__thread) | 12 | The user program must store this information per thread (__thread) |
9 | If you want 100% accurate information pass NULL instead. */ | 13 | If you want 100% accurate information pass NULL instead. */ |
10 | struct getcpu_cache { | 14 | struct getcpu_cache { |
11 | unsigned long t0; | 15 | unsigned long blob[128 / sizeof(long)]; |
12 | unsigned long t1; | ||
13 | unsigned long res[4]; | ||
14 | }; | 16 | }; |
15 | 17 | ||
16 | #endif | 18 | #endif |
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index 9418519a55d1..0a8f750cbede 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h | |||
@@ -193,6 +193,7 @@ | |||
193 | #define I2C_HW_B_RADEON 0x01001e /* radeon framebuffer driver */ | 193 | #define I2C_HW_B_RADEON 0x01001e /* radeon framebuffer driver */ |
194 | #define I2C_HW_B_EM28XX 0x01001f /* em28xx video capture cards */ | 194 | #define I2C_HW_B_EM28XX 0x01001f /* em28xx video capture cards */ |
195 | #define I2C_HW_B_CX2341X 0x010020 /* Conexant CX2341X MPEG encoder cards */ | 195 | #define I2C_HW_B_CX2341X 0x010020 /* Conexant CX2341X MPEG encoder cards */ |
196 | #define I2C_HW_B_INTELFB 0x010021 /* intel framebuffer driver */ | ||
196 | 197 | ||
197 | /* --- PCF 8584 based algorithms */ | 198 | /* --- PCF 8584 based algorithms */ |
198 | #define I2C_HW_P_LP 0x020000 /* Parallel port interface */ | 199 | #define I2C_HW_P_LP 0x020000 /* Parallel port interface */ |
diff --git a/include/linux/ide.h b/include/linux/ide.h index 99620451d958..07d8d725541f 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -251,7 +251,8 @@ static inline void ide_std_init_ports(hw_regs_t *hw, | |||
251 | 251 | ||
252 | #include <asm/ide.h> | 252 | #include <asm/ide.h> |
253 | 253 | ||
254 | #ifndef MAX_HWIFS | 254 | #if !defined(MAX_HWIFS) || defined(CONFIG_EMBEDDED) |
255 | #undef MAX_HWIFS | ||
255 | #define MAX_HWIFS CONFIG_IDE_MAX_HWIFS | 256 | #define MAX_HWIFS CONFIG_IDE_MAX_HWIFS |
256 | #endif | 257 | #endif |
257 | 258 | ||
@@ -773,12 +774,13 @@ typedef struct hwif_s { | |||
773 | unsigned long dma_status; /* dma status register */ | 774 | unsigned long dma_status; /* dma status register */ |
774 | unsigned long dma_vendor3; /* dma vendor 3 register */ | 775 | unsigned long dma_vendor3; /* dma vendor 3 register */ |
775 | unsigned long dma_prdtable; /* actual prd table address */ | 776 | unsigned long dma_prdtable; /* actual prd table address */ |
776 | unsigned long dma_base2; /* extended base addr for dma ports */ | ||
777 | 777 | ||
778 | unsigned dma_extra; /* extra addr for dma ports */ | ||
779 | unsigned long config_data; /* for use by chipset-specific code */ | 778 | unsigned long config_data; /* for use by chipset-specific code */ |
780 | unsigned long select_data; /* for use by chipset-specific code */ | 779 | unsigned long select_data; /* for use by chipset-specific code */ |
781 | 780 | ||
781 | unsigned long extra_base; /* extra addr for dma ports */ | ||
782 | unsigned extra_ports; /* number of extra dma ports */ | ||
783 | |||
782 | unsigned noprobe : 1; /* don't probe for this interface */ | 784 | unsigned noprobe : 1; /* don't probe for this interface */ |
783 | unsigned present : 1; /* this interface exists */ | 785 | unsigned present : 1; /* this interface exists */ |
784 | unsigned hold : 1; /* this interface is always present */ | 786 | unsigned hold : 1; /* this interface is always present */ |
@@ -823,6 +825,9 @@ typedef struct hwgroup_s { | |||
823 | unsigned int sleeping : 1; | 825 | unsigned int sleeping : 1; |
824 | /* BOOL: polling active & poll_timeout field valid */ | 826 | /* BOOL: polling active & poll_timeout field valid */ |
825 | unsigned int polling : 1; | 827 | unsigned int polling : 1; |
828 | /* BOOL: in a polling reset situation. Must not trigger another reset yet */ | ||
829 | unsigned int resetting : 1; | ||
830 | |||
826 | /* current drive */ | 831 | /* current drive */ |
827 | ide_drive_t *drive; | 832 | ide_drive_t *drive; |
828 | /* ptr to current hwif in linked-list */ | 833 | /* ptr to current hwif in linked-list */ |
@@ -1190,7 +1195,6 @@ extern int ideprobe_init(void); | |||
1190 | extern void ide_scan_pcibus(int scan_direction) __init; | 1195 | extern void ide_scan_pcibus(int scan_direction) __init; |
1191 | extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *owner); | 1196 | extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *owner); |
1192 | #define ide_pci_register_driver(d) __ide_pci_register_driver(d, THIS_MODULE) | 1197 | #define ide_pci_register_driver(d) __ide_pci_register_driver(d, THIS_MODULE) |
1193 | extern void ide_pci_unregister_driver(struct pci_driver *driver); | ||
1194 | void ide_pci_setup_ports(struct pci_dev *, struct ide_pci_device_s *, int, ata_index_t *); | 1198 | void ide_pci_setup_ports(struct pci_dev *, struct ide_pci_device_s *, int, ata_index_t *); |
1195 | extern void ide_setup_pci_noise (struct pci_dev *dev, struct ide_pci_device_s *d); | 1199 | extern void ide_setup_pci_noise (struct pci_dev *dev, struct ide_pci_device_s *d); |
1196 | 1200 | ||
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/io.h b/include/linux/io.h index 420e2fdf26f6..aa3f5af670b5 100644 --- a/include/linux/io.h +++ b/include/linux/io.h | |||
@@ -19,8 +19,12 @@ | |||
19 | #define _LINUX_IO_H | 19 | #define _LINUX_IO_H |
20 | 20 | ||
21 | #include <asm/io.h> | 21 | #include <asm/io.h> |
22 | #include <asm/page.h> | ||
22 | 23 | ||
23 | void __iowrite32_copy(void __iomem *to, const void *from, size_t count); | 24 | void __iowrite32_copy(void __iomem *to, const void *from, size_t count); |
24 | void __iowrite64_copy(void __iomem *to, const void *from, size_t count); | 25 | void __iowrite64_copy(void __iomem *to, const void *from, size_t count); |
25 | 26 | ||
27 | int ioremap_page_range(unsigned long addr, unsigned long end, | ||
28 | unsigned long phys_addr, pgprot_t prot); | ||
29 | |||
26 | #endif /* _LINUX_IO_H */ | 30 | #endif /* _LINUX_IO_H */ |
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/ipmi.h b/include/linux/ipmi.h index d09fbeabf1dc..796ca009fd46 100644 --- a/include/linux/ipmi.h +++ b/include/linux/ipmi.h | |||
@@ -148,6 +148,13 @@ struct ipmi_lan_addr | |||
148 | #define IPMI_BMC_CHANNEL 0xf | 148 | #define IPMI_BMC_CHANNEL 0xf |
149 | #define IPMI_NUM_CHANNELS 0x10 | 149 | #define IPMI_NUM_CHANNELS 0x10 |
150 | 150 | ||
151 | /* | ||
152 | * Used to signify an "all channel" bitmask. This is more than the | ||
153 | * actual number of channels because this is used in userland and | ||
154 | * will cover us if the number of channels is extended. | ||
155 | */ | ||
156 | #define IPMI_CHAN_ALL (~0) | ||
157 | |||
151 | 158 | ||
152 | /* | 159 | /* |
153 | * A raw IPMI message without any addressing. This covers both | 160 | * A raw IPMI message without any addressing. This covers both |
@@ -350,18 +357,21 @@ int ipmi_request_supply_msgs(ipmi_user_t user, | |||
350 | 357 | ||
351 | /* | 358 | /* |
352 | * When commands come in to the SMS, the user can register to receive | 359 | * When commands come in to the SMS, the user can register to receive |
353 | * them. Only one user can be listening on a specific netfn/cmd pair | 360 | * them. Only one user can be listening on a specific netfn/cmd/chan tuple |
354 | * at a time, you will get an EBUSY error if the command is already | 361 | * at a time, you will get an EBUSY error if the command is already |
355 | * registered. If a command is received that does not have a user | 362 | * registered. If a command is received that does not have a user |
356 | * registered, the driver will automatically return the proper | 363 | * registered, the driver will automatically return the proper |
357 | * error. | 364 | * error. Channels are specified as a bitfield, use IPMI_CHAN_ALL to |
365 | * mean all channels. | ||
358 | */ | 366 | */ |
359 | int ipmi_register_for_cmd(ipmi_user_t user, | 367 | int ipmi_register_for_cmd(ipmi_user_t user, |
360 | unsigned char netfn, | 368 | unsigned char netfn, |
361 | unsigned char cmd); | 369 | unsigned char cmd, |
370 | unsigned int chans); | ||
362 | int ipmi_unregister_for_cmd(ipmi_user_t user, | 371 | int ipmi_unregister_for_cmd(ipmi_user_t user, |
363 | unsigned char netfn, | 372 | unsigned char netfn, |
364 | unsigned char cmd); | 373 | unsigned char cmd, |
374 | unsigned int chans); | ||
365 | 375 | ||
366 | /* | 376 | /* |
367 | * Allow run-to-completion mode to be set for the interface of | 377 | * Allow run-to-completion mode to be set for the interface of |
@@ -571,6 +581,36 @@ struct ipmi_cmdspec | |||
571 | #define IPMICTL_UNREGISTER_FOR_CMD _IOR(IPMI_IOC_MAGIC, 15, \ | 581 | #define IPMICTL_UNREGISTER_FOR_CMD _IOR(IPMI_IOC_MAGIC, 15, \ |
572 | struct ipmi_cmdspec) | 582 | struct ipmi_cmdspec) |
573 | 583 | ||
584 | /* | ||
585 | * Register to get commands from other entities on specific channels. | ||
586 | * This way, you can only listen on specific channels, or have messages | ||
587 | * from some channels go to one place and other channels to someplace | ||
588 | * else. The chans field is a bitmask, (1 << channel) for each channel. | ||
589 | * It may be IPMI_CHAN_ALL for all channels. | ||
590 | */ | ||
591 | struct ipmi_cmdspec_chans | ||
592 | { | ||
593 | unsigned int netfn; | ||
594 | unsigned int cmd; | ||
595 | unsigned int chans; | ||
596 | }; | ||
597 | |||
598 | /* | ||
599 | * Register to receive a specific command on specific channels. error values: | ||
600 | * - EFAULT - an address supplied was invalid. | ||
601 | * - EBUSY - One of the netfn/cmd/chans supplied was already in use. | ||
602 | * - ENOMEM - could not allocate memory for the entry. | ||
603 | */ | ||
604 | #define IPMICTL_REGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 28, \ | ||
605 | struct ipmi_cmdspec_chans) | ||
606 | /* | ||
607 | * Unregister some netfn/cmd/chans. error values: | ||
608 | * - EFAULT - an address supplied was invalid. | ||
609 | * - ENOENT - None of the netfn/cmd/chans were found registered for this user. | ||
610 | */ | ||
611 | #define IPMICTL_UNREGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 29, \ | ||
612 | struct ipmi_cmdspec_chans) | ||
613 | |||
574 | /* | 614 | /* |
575 | * Set whether this interface receives events. Note that the first | 615 | * Set whether this interface receives events. Note that the first |
576 | * user registered for events will get all pending events for the | 616 | * user registered for events will get all pending events for the |
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h index 849043ce4ed6..1cebcbc28b47 100644 --- a/include/linux/kallsyms.h +++ b/include/linux/kallsyms.h | |||
@@ -12,6 +12,10 @@ | |||
12 | /* Lookup the address for a symbol. Returns 0 if not found. */ | 12 | /* Lookup the address for a symbol. Returns 0 if not found. */ |
13 | unsigned long kallsyms_lookup_name(const char *name); | 13 | unsigned long kallsyms_lookup_name(const char *name); |
14 | 14 | ||
15 | extern int kallsyms_lookup_size_offset(unsigned long addr, | ||
16 | unsigned long *symbolsize, | ||
17 | unsigned long *offset); | ||
18 | |||
15 | /* Lookup an address. modname is set to NULL if it's in the kernel. */ | 19 | /* Lookup an address. modname is set to NULL if it's in the kernel. */ |
16 | const char *kallsyms_lookup(unsigned long addr, | 20 | const char *kallsyms_lookup(unsigned long addr, |
17 | unsigned long *symbolsize, | 21 | unsigned long *symbolsize, |
@@ -28,6 +32,13 @@ static inline unsigned long kallsyms_lookup_name(const char *name) | |||
28 | return 0; | 32 | return 0; |
29 | } | 33 | } |
30 | 34 | ||
35 | static inline int kallsyms_lookup_size_offset(unsigned long addr, | ||
36 | unsigned long *symbolsize, | ||
37 | unsigned long *offset) | ||
38 | { | ||
39 | return 0; | ||
40 | } | ||
41 | |||
31 | static inline const char *kallsyms_lookup(unsigned long addr, | 42 | static inline const char *kallsyms_lookup(unsigned long addr, |
32 | unsigned long *symbolsize, | 43 | unsigned long *symbolsize, |
33 | unsigned long *offset, | 44 | unsigned long *offset, |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 4d00988dad03..80f39cab470a 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -216,8 +216,10 @@ extern void dump_stack(void); | |||
216 | #define pr_debug(fmt,arg...) \ | 216 | #define pr_debug(fmt,arg...) \ |
217 | printk(KERN_DEBUG fmt,##arg) | 217 | printk(KERN_DEBUG fmt,##arg) |
218 | #else | 218 | #else |
219 | #define pr_debug(fmt,arg...) \ | 219 | static inline int __attribute__ ((format (printf, 1, 2))) pr_debug(const char * fmt, ...) |
220 | do { } while (0) | 220 | { |
221 | return 0; | ||
222 | } | ||
221 | #endif | 223 | #endif |
222 | 224 | ||
223 | #define pr_info(fmt,arg...) \ | 225 | #define pr_info(fmt,arg...) \ |
diff --git a/include/linux/kmod.h b/include/linux/kmod.h index 0db22a1ab474..10f505c8431d 100644 --- a/include/linux/kmod.h +++ b/include/linux/kmod.h | |||
@@ -47,4 +47,8 @@ call_usermodehelper(char *path, char **argv, char **envp, int wait) | |||
47 | 47 | ||
48 | extern void usermodehelper_init(void); | 48 | extern void usermodehelper_init(void); |
49 | 49 | ||
50 | struct file; | ||
51 | extern int call_usermodehelper_pipe(char *path, char *argv[], char *envp[], | ||
52 | struct file **filp); | ||
53 | |||
50 | #endif /* __LINUX_KMOD_H__ */ | 54 | #endif /* __LINUX_KMOD_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/latency.h b/include/linux/latency.h new file mode 100644 index 000000000000..c08b52bb55b0 --- /dev/null +++ b/include/linux/latency.h | |||
@@ -0,0 +1,25 @@ | |||
1 | /* | ||
2 | * latency.h: Explicit system-wide latency-expectation infrastructure | ||
3 | * | ||
4 | * (C) Copyright 2006 Intel Corporation | ||
5 | * Author: Arjan van de Ven <arjan@linux.intel.com> | ||
6 | * | ||
7 | */ | ||
8 | |||
9 | #ifndef _INCLUDE_GUARD_LATENCY_H_ | ||
10 | #define _INCLUDE_GUARD_LATENCY_H_ | ||
11 | |||
12 | #include <linux/notifier.h> | ||
13 | |||
14 | void set_acceptable_latency(char *identifier, int usecs); | ||
15 | void modify_acceptable_latency(char *identifier, int usecs); | ||
16 | void remove_acceptable_latency(char *identifier); | ||
17 | void synchronize_acceptable_latency(void); | ||
18 | int system_latency_constraint(void); | ||
19 | |||
20 | int register_latency_notifier(struct notifier_block * nb); | ||
21 | int unregister_latency_notifier(struct notifier_block * nb); | ||
22 | |||
23 | #define INFINITE_LATENCY 1000000 | ||
24 | |||
25 | #endif | ||
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/memory.h b/include/linux/memory.h index 8f04143ca363..654ef5544878 100644 --- a/include/linux/memory.h +++ b/include/linux/memory.h | |||
@@ -57,7 +57,7 @@ struct memory_block { | |||
57 | struct notifier_block; | 57 | struct notifier_block; |
58 | struct mem_section; | 58 | struct mem_section; |
59 | 59 | ||
60 | #ifndef CONFIG_MEMORY_HOTPLUG | 60 | #ifndef CONFIG_MEMORY_HOTPLUG_SPARSE |
61 | static inline int memory_dev_init(void) | 61 | static inline int memory_dev_init(void) |
62 | { | 62 | { |
63 | return 0; | 63 | return 0; |
@@ -78,7 +78,7 @@ extern int remove_memory_block(unsigned long, struct mem_section *, int); | |||
78 | #define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT) | 78 | #define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT) |
79 | 79 | ||
80 | 80 | ||
81 | #endif /* CONFIG_MEMORY_HOTPLUG */ | 81 | #endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */ |
82 | 82 | ||
83 | #define hotplug_memory_notifier(fn, pri) { \ | 83 | #define hotplug_memory_notifier(fn, pri) { \ |
84 | static struct notifier_block fn##_mem_nb = \ | 84 | static struct notifier_block fn##_mem_nb = \ |
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index 218501cfaeb9..7b54666cea8e 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h | |||
@@ -172,5 +172,7 @@ static inline int __remove_pages(struct zone *zone, unsigned long start_pfn, | |||
172 | extern int add_memory(int nid, u64 start, u64 size); | 172 | extern int add_memory(int nid, u64 start, u64 size); |
173 | extern int arch_add_memory(int nid, u64 start, u64 size); | 173 | extern int arch_add_memory(int nid, u64 start, u64 size); |
174 | extern int remove_memory(u64 start, u64 size); | 174 | extern int remove_memory(u64 start, u64 size); |
175 | extern int sparse_add_one_section(struct zone *zone, unsigned long start_pfn, | ||
176 | int nr_pages); | ||
175 | 177 | ||
176 | #endif /* __LINUX_MEMORY_HOTPLUG_H */ | 178 | #endif /* __LINUX_MEMORY_HOTPLUG_H */ |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 7b703b6d4358..b7966ab8cb6a 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -743,7 +743,9 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long | |||
743 | int len, int write, int force, struct page **pages, struct vm_area_struct **vmas); | 743 | int len, int write, int force, struct page **pages, struct vm_area_struct **vmas); |
744 | void print_bad_pte(struct vm_area_struct *, pte_t, unsigned long); | 744 | void print_bad_pte(struct vm_area_struct *, pte_t, unsigned long); |
745 | 745 | ||
746 | int __set_page_dirty_buffers(struct page *page); | 746 | extern int try_to_release_page(struct page * page, gfp_t gfp_mask); |
747 | extern void do_invalidatepage(struct page *page, unsigned long offset); | ||
748 | |||
747 | int __set_page_dirty_nobuffers(struct page *page); | 749 | int __set_page_dirty_nobuffers(struct page *page); |
748 | int redirty_page_for_writepage(struct writeback_control *wbc, | 750 | int redirty_page_for_writepage(struct writeback_control *wbc, |
749 | struct page *page); | 751 | struct page *page); |
@@ -944,6 +946,8 @@ extern void mem_init(void); | |||
944 | extern void show_mem(void); | 946 | extern void show_mem(void); |
945 | extern void si_meminfo(struct sysinfo * val); | 947 | extern void si_meminfo(struct sysinfo * val); |
946 | extern void si_meminfo_node(struct sysinfo *val, int nid); | 948 | extern void si_meminfo_node(struct sysinfo *val, int nid); |
949 | extern void zonetable_add(struct zone *zone, int nid, enum zone_type zid, | ||
950 | unsigned long pfn, unsigned long size); | ||
947 | 951 | ||
948 | #ifdef CONFIG_NUMA | 952 | #ifdef CONFIG_NUMA |
949 | extern void setup_per_cpu_pageset(void); | 953 | extern void setup_per_cpu_pageset(void); |
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/mpage.h b/include/linux/mpage.h index 3ca880463c47..cc5fb75af78a 100644 --- a/include/linux/mpage.h +++ b/include/linux/mpage.h | |||
@@ -9,6 +9,7 @@ | |||
9 | * (And no, it doesn't do the #ifdef __MPAGE_H thing, and it doesn't do | 9 | * (And no, it doesn't do the #ifdef __MPAGE_H thing, and it doesn't do |
10 | * nested includes. Get it right in the .c file). | 10 | * nested includes. Get it right in the .c file). |
11 | */ | 11 | */ |
12 | #ifdef CONFIG_BLOCK | ||
12 | 13 | ||
13 | struct writeback_control; | 14 | struct writeback_control; |
14 | typedef int (writepage_t)(struct page *page, struct writeback_control *wbc); | 15 | typedef int (writepage_t)(struct page *page, struct writeback_control *wbc); |
@@ -21,8 +22,4 @@ int mpage_writepages(struct address_space *mapping, | |||
21 | int mpage_writepage(struct page *page, get_block_t *get_block, | 22 | int mpage_writepage(struct page *page, get_block_t *get_block, |
22 | struct writeback_control *wbc); | 23 | struct writeback_control *wbc); |
23 | 24 | ||
24 | static inline int | 25 | #endif |
25 | generic_writepages(struct address_space *mapping, struct writeback_control *wbc) | ||
26 | { | ||
27 | return mpage_writepages(mapping, wbc, NULL); | ||
28 | } | ||
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 0b4cd2fa64aa..70420bbae82b 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
@@ -27,9 +27,17 @@ | |||
27 | struct mtd_info; | 27 | struct mtd_info; |
28 | /* Scan and identify a NAND device */ | 28 | /* Scan and identify a NAND device */ |
29 | extern int nand_scan (struct mtd_info *mtd, int max_chips); | 29 | extern int nand_scan (struct mtd_info *mtd, int max_chips); |
30 | /* Separate phases of nand_scan(), allowing board driver to intervene | ||
31 | * and override command or ECC setup according to flash type */ | ||
32 | extern int nand_scan_ident(struct mtd_info *mtd, int max_chips); | ||
33 | extern int nand_scan_tail(struct mtd_info *mtd); | ||
34 | |||
30 | /* Free resources held by the NAND device */ | 35 | /* Free resources held by the NAND device */ |
31 | extern void nand_release (struct mtd_info *mtd); | 36 | extern void nand_release (struct mtd_info *mtd); |
32 | 37 | ||
38 | /* Internal helper for board drivers which need to override command function */ | ||
39 | extern void nand_wait_ready(struct mtd_info *mtd); | ||
40 | |||
33 | /* The maximum number of NAND chips in an array */ | 41 | /* The maximum number of NAND chips in an array */ |
34 | #define NAND_MAX_CHIPS 8 | 42 | #define NAND_MAX_CHIPS 8 |
35 | 43 | ||
@@ -178,7 +186,9 @@ typedef enum { | |||
178 | #define NAND_USE_FLASH_BBT 0x00010000 | 186 | #define NAND_USE_FLASH_BBT 0x00010000 |
179 | /* This option skips the bbt scan during initialization. */ | 187 | /* This option skips the bbt scan during initialization. */ |
180 | #define NAND_SKIP_BBTSCAN 0x00020000 | 188 | #define NAND_SKIP_BBTSCAN 0x00020000 |
181 | 189 | /* This option is defined if the board driver allocates its own buffers | |
190 | (e.g. because it needs them DMA-coherent */ | ||
191 | #define NAND_OWN_BUFFERS 0x00040000 | ||
182 | /* Options set by nand scan */ | 192 | /* Options set by nand scan */ |
183 | /* Nand scan has allocated controller struct */ | 193 | /* Nand scan has allocated controller struct */ |
184 | #define NAND_CONTROLLER_ALLOC 0x80000000 | 194 | #define NAND_CONTROLLER_ALLOC 0x80000000 |
@@ -228,6 +238,8 @@ struct nand_hw_control { | |||
228 | * be provided if an hardware ECC is available | 238 | * be provided if an hardware ECC is available |
229 | * @calculate: function for ecc calculation or readback from ecc hardware | 239 | * @calculate: function for ecc calculation or readback from ecc hardware |
230 | * @correct: function for ecc correction, matching to ecc generator (sw/hw) | 240 | * @correct: function for ecc correction, matching to ecc generator (sw/hw) |
241 | * @read_page_raw: function to read a raw page without ECC | ||
242 | * @write_page_raw: function to write a raw page without ECC | ||
231 | * @read_page: function to read a page according to the ecc generator requirements | 243 | * @read_page: function to read a page according to the ecc generator requirements |
232 | * @write_page: function to write a page according to the ecc generator requirements | 244 | * @write_page: function to write a page according to the ecc generator requirements |
233 | * @read_oob: function to read chip OOB data | 245 | * @read_oob: function to read chip OOB data |
@@ -249,6 +261,12 @@ struct nand_ecc_ctrl { | |||
249 | int (*correct)(struct mtd_info *mtd, uint8_t *dat, | 261 | int (*correct)(struct mtd_info *mtd, uint8_t *dat, |
250 | uint8_t *read_ecc, | 262 | uint8_t *read_ecc, |
251 | uint8_t *calc_ecc); | 263 | uint8_t *calc_ecc); |
264 | int (*read_page_raw)(struct mtd_info *mtd, | ||
265 | struct nand_chip *chip, | ||
266 | uint8_t *buf); | ||
267 | void (*write_page_raw)(struct mtd_info *mtd, | ||
268 | struct nand_chip *chip, | ||
269 | const uint8_t *buf); | ||
252 | int (*read_page)(struct mtd_info *mtd, | 270 | int (*read_page)(struct mtd_info *mtd, |
253 | struct nand_chip *chip, | 271 | struct nand_chip *chip, |
254 | uint8_t *buf); | 272 | uint8_t *buf); |
@@ -337,6 +355,7 @@ struct nand_buffers { | |||
337 | * @priv: [OPTIONAL] pointer to private chip date | 355 | * @priv: [OPTIONAL] pointer to private chip date |
338 | * @errstat: [OPTIONAL] hardware specific function to perform additional error status checks | 356 | * @errstat: [OPTIONAL] hardware specific function to perform additional error status checks |
339 | * (determine if errors are correctable) | 357 | * (determine if errors are correctable) |
358 | * @write_page [REPLACEABLE] High-level page write function | ||
340 | */ | 359 | */ |
341 | 360 | ||
342 | struct nand_chip { | 361 | struct nand_chip { |
@@ -359,6 +378,8 @@ struct nand_chip { | |||
359 | void (*erase_cmd)(struct mtd_info *mtd, int page); | 378 | void (*erase_cmd)(struct mtd_info *mtd, int page); |
360 | int (*scan_bbt)(struct mtd_info *mtd); | 379 | int (*scan_bbt)(struct mtd_info *mtd); |
361 | int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state, int status, int page); | 380 | int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state, int status, int page); |
381 | int (*write_page)(struct mtd_info *mtd, struct nand_chip *chip, | ||
382 | const uint8_t *buf, int page, int cached, int raw); | ||
362 | 383 | ||
363 | int chip_delay; | 384 | int chip_delay; |
364 | unsigned int options; | 385 | unsigned int options; |
@@ -380,7 +401,7 @@ struct nand_chip { | |||
380 | struct nand_ecclayout *ecclayout; | 401 | struct nand_ecclayout *ecclayout; |
381 | 402 | ||
382 | struct nand_ecc_ctrl ecc; | 403 | struct nand_ecc_ctrl ecc; |
383 | struct nand_buffers buffers; | 404 | struct nand_buffers *buffers; |
384 | struct nand_hw_control hwcontrol; | 405 | struct nand_hw_control hwcontrol; |
385 | 406 | ||
386 | struct mtd_oob_ops ops; | 407 | struct mtd_oob_ops ops; |
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h index 1f4972155249..6f045b586e76 100644 --- a/include/linux/mtd/onenand.h +++ b/include/linux/mtd/onenand.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * linux/include/linux/mtd/onenand.h | 2 | * linux/include/linux/mtd/onenand.h |
3 | * | 3 | * |
4 | * Copyright (C) 2005 Samsung Electronics | 4 | * Copyright (C) 2005-2006 Samsung Electronics |
5 | * Kyungmin Park <kyungmin.park@samsung.com> | 5 | * Kyungmin Park <kyungmin.park@samsung.com> |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
@@ -96,6 +96,7 @@ struct onenand_chip { | |||
96 | void __iomem *base; | 96 | void __iomem *base; |
97 | unsigned int chipsize; | 97 | unsigned int chipsize; |
98 | unsigned int device_id; | 98 | unsigned int device_id; |
99 | unsigned int version_id; | ||
99 | unsigned int density_mask; | 100 | unsigned int density_mask; |
100 | unsigned int options; | 101 | unsigned int options; |
101 | 102 | ||
@@ -149,7 +150,8 @@ struct onenand_chip { | |||
149 | /* | 150 | /* |
150 | * Options bits | 151 | * Options bits |
151 | */ | 152 | */ |
152 | #define ONENAND_CONT_LOCK (0x0001) | 153 | #define ONENAND_HAS_CONT_LOCK (0x0001) |
154 | #define ONENAND_HAS_UNLOCK_ALL (0x0002) | ||
153 | #define ONENAND_PAGEBUF_ALLOC (0x1000) | 155 | #define ONENAND_PAGEBUF_ALLOC (0x1000) |
154 | 156 | ||
155 | /* | 157 | /* |
diff --git a/include/linux/mtd/onenand_regs.h b/include/linux/mtd/onenand_regs.h index 4a72818d2545..9e409fe6ded6 100644 --- a/include/linux/mtd/onenand_regs.h +++ b/include/linux/mtd/onenand_regs.h | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * OneNAND Register header file | 4 | * OneNAND Register header file |
5 | * | 5 | * |
6 | * Copyright (C) 2005 Samsung Electronics | 6 | * Copyright (C) 2005-2006 Samsung Electronics |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License version 2 as | 9 | * it under the terms of the GNU General Public License version 2 as |
@@ -72,6 +72,7 @@ | |||
72 | #define ONENAND_DEVICE_VCC_MASK (0x3) | 72 | #define ONENAND_DEVICE_VCC_MASK (0x3) |
73 | 73 | ||
74 | #define ONENAND_DEVICE_DENSITY_512Mb (0x002) | 74 | #define ONENAND_DEVICE_DENSITY_512Mb (0x002) |
75 | #define ONENAND_DEVICE_DENSITY_1Gb (0x003) | ||
75 | 76 | ||
76 | /* | 77 | /* |
77 | * Version ID Register F002h (R) | 78 | * Version ID Register F002h (R) |
@@ -110,6 +111,7 @@ | |||
110 | #define ONENAND_CMD_UNLOCK (0x23) | 111 | #define ONENAND_CMD_UNLOCK (0x23) |
111 | #define ONENAND_CMD_LOCK (0x2A) | 112 | #define ONENAND_CMD_LOCK (0x2A) |
112 | #define ONENAND_CMD_LOCK_TIGHT (0x2C) | 113 | #define ONENAND_CMD_LOCK_TIGHT (0x2C) |
114 | #define ONENAND_CMD_UNLOCK_ALL (0x27) | ||
113 | #define ONENAND_CMD_ERASE (0x94) | 115 | #define ONENAND_CMD_ERASE (0x94) |
114 | #define ONENAND_CMD_RESET (0xF0) | 116 | #define ONENAND_CMD_RESET (0xF0) |
115 | #define ONENAND_CMD_OTP_ACCESS (0x65) | 117 | #define ONENAND_CMD_OTP_ACCESS (0x65) |
diff --git a/include/linux/namei.h b/include/linux/namei.h index c6470ba00668..f5f19606effb 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef _LINUX_NAMEI_H | 1 | #ifndef _LINUX_NAMEI_H |
2 | #define _LINUX_NAMEI_H | 2 | #define _LINUX_NAMEI_H |
3 | 3 | ||
4 | #include <linux/dcache.h> | ||
4 | #include <linux/linkage.h> | 5 | #include <linux/linkage.h> |
5 | 6 | ||
6 | struct vfsmount; | 7 | struct vfsmount; |
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/ncp_fs.h b/include/linux/ncp_fs.h index 02e352be717e..0ea7f89e613c 100644 --- a/include/linux/ncp_fs.h +++ b/include/linux/ncp_fs.h | |||
@@ -212,6 +212,7 @@ void ncp_date_unix2dos(int unix_date, __le16 * time, __le16 * date); | |||
212 | 212 | ||
213 | /* linux/fs/ncpfs/ioctl.c */ | 213 | /* linux/fs/ncpfs/ioctl.c */ |
214 | int ncp_ioctl(struct inode *, struct file *, unsigned int, unsigned long); | 214 | int ncp_ioctl(struct inode *, struct file *, unsigned int, unsigned long); |
215 | long ncp_compat_ioctl(struct file *, unsigned int, unsigned long); | ||
215 | 216 | ||
216 | /* linux/fs/ncpfs/sock.c */ | 217 | /* linux/fs/ncpfs/sock.c */ |
217 | int ncp_request2(struct ncp_server *server, int function, | 218 | int ncp_request2(struct ncp_server *server, int function, |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 98c9b9f667a5..76ff54846ada 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -367,10 +367,12 @@ extern int nfs3_removexattr (struct dentry *, const char *name); | |||
367 | */ | 367 | */ |
368 | extern ssize_t nfs_direct_IO(int, struct kiocb *, const struct iovec *, loff_t, | 368 | extern ssize_t nfs_direct_IO(int, struct kiocb *, const struct iovec *, loff_t, |
369 | unsigned long); | 369 | unsigned long); |
370 | extern ssize_t nfs_file_direct_read(struct kiocb *iocb, char __user *buf, | 370 | extern ssize_t nfs_file_direct_read(struct kiocb *iocb, |
371 | size_t count, loff_t pos); | 371 | const struct iovec *iov, unsigned long nr_segs, |
372 | extern ssize_t nfs_file_direct_write(struct kiocb *iocb, const char __user *buf, | 372 | loff_t pos); |
373 | size_t count, loff_t pos); | 373 | extern ssize_t nfs_file_direct_write(struct kiocb *iocb, |
374 | const struct iovec *iov, unsigned long nr_segs, | ||
375 | loff_t pos); | ||
374 | 376 | ||
375 | /* | 377 | /* |
376 | * linux/fs/nfs/dir.c | 378 | * linux/fs/nfs/dir.c |
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/pci.h b/include/linux/pci.h index 5c3a4176eb64..4431ce4e1e6f 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -787,12 +787,13 @@ enum pci_fixup_pass { | |||
787 | void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev); | 787 | void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev); |
788 | 788 | ||
789 | extern int pci_pci_problems; | 789 | extern int pci_pci_problems; |
790 | #define PCIPCI_FAIL 1 | 790 | #define PCIPCI_FAIL 1 /* No PCI PCI DMA */ |
791 | #define PCIPCI_TRITON 2 | 791 | #define PCIPCI_TRITON 2 |
792 | #define PCIPCI_NATOMA 4 | 792 | #define PCIPCI_NATOMA 4 |
793 | #define PCIPCI_VIAETBF 8 | 793 | #define PCIPCI_VIAETBF 8 |
794 | #define PCIPCI_VSFX 16 | 794 | #define PCIPCI_VSFX 16 |
795 | #define PCIPCI_ALIMAGIK 32 | 795 | #define PCIPCI_ALIMAGIK 32 /* Need low latency setting */ |
796 | #define PCIAGP_FAIL 64 /* No PCI to AGP DMA */ | ||
796 | 797 | ||
797 | #endif /* __KERNEL__ */ | 798 | #endif /* __KERNEL__ */ |
798 | #endif /* LINUX_PCI_H */ | 799 | #endif /* LINUX_PCI_H */ |
diff --git a/include/linux/pid.h b/include/linux/pid.h index 93da7e2d9f30..2c0007d17218 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 | { |
98 | 101 | pid_t nr = 0; | |
99 | #define pid_next_task(task, type) \ | 102 | if (pid) |
100 | hlist_entry(pid_next(task, type), struct task_struct, \ | 103 | nr = pid->nr; |
101 | pids[(type)].node) | 104 | return nr; |
105 | } | ||
102 | 106 | ||
103 | 107 | ||
104 | /* We could use hlist_for_each_entry_rcu here but it takes more arguments | ||
105 | * than the do_each_task_pid/while_each_task_pid. So we roll our own | ||
106 | * to preserve the existing interface. | ||
107 | */ | ||
108 | #define do_each_task_pid(who, type, task) \ | 108 | #define do_each_task_pid(who, type, task) \ |
109 | if ((task = find_task_by_pid_type(type, who))) { \ | 109 | do { \ |
110 | prefetch(pid_next(task, type)); \ | 110 | struct hlist_node *pos___; \ |
111 | do { | 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) { | ||
112 | 115 | ||
113 | #define while_each_task_pid(who, type, task) \ | 116 | #define while_each_task_pid(who, type, task) \ |
114 | } while (pid_next(task, type) && ({ \ | 117 | } \ |
115 | task = pid_next_task(task, type); \ | 118 | } while (0) |
116 | rcu_dereference(task); \ | 119 | |
117 | prefetch(pid_next(task, type)); \ | 120 | |
118 | 1; }) ); \ | 121 | #define do_each_pid_task(pid, type, task) \ |
119 | } | 122 | do { \ |
123 | struct hlist_node *pos___; \ | ||
124 | if (pid != NULL) \ | ||
125 | hlist_for_each_entry_rcu((task), pos___, \ | ||
126 | &pid->tasks[type], pids[type].node) { | ||
127 | |||
128 | #define while_each_pid_task(pid, type, task) \ | ||
129 | } \ | ||
130 | } while (0) | ||
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/raid/bitmap.h b/include/linux/raid/bitmap.h index 63df898fe2e9..84d887751855 100644 --- a/include/linux/raid/bitmap.h +++ b/include/linux/raid/bitmap.h | |||
@@ -265,6 +265,8 @@ int bitmap_update_sb(struct bitmap *bitmap); | |||
265 | int bitmap_setallbits(struct bitmap *bitmap); | 265 | int bitmap_setallbits(struct bitmap *bitmap); |
266 | void bitmap_write_all(struct bitmap *bitmap); | 266 | void bitmap_write_all(struct bitmap *bitmap); |
267 | 267 | ||
268 | void bitmap_dirty_bits(struct bitmap *bitmap, unsigned long s, unsigned long e); | ||
269 | |||
268 | /* these are exported */ | 270 | /* these are exported */ |
269 | int bitmap_startwrite(struct bitmap *bitmap, sector_t offset, | 271 | int bitmap_startwrite(struct bitmap *bitmap, sector_t offset, |
270 | unsigned long sectors, int behind); | 272 | unsigned long sectors, int behind); |
diff --git a/include/linux/raid/md.h b/include/linux/raid/md.h index eb3e547c8fee..866a1e2b0ce0 100644 --- a/include/linux/raid/md.h +++ b/include/linux/raid/md.h | |||
@@ -53,6 +53,8 @@ | |||
53 | #include <linux/raid/md_u.h> | 53 | #include <linux/raid/md_u.h> |
54 | #include <linux/raid/md_k.h> | 54 | #include <linux/raid/md_k.h> |
55 | 55 | ||
56 | #ifdef CONFIG_MD | ||
57 | |||
56 | /* | 58 | /* |
57 | * Different major versions are not compatible. | 59 | * Different major versions are not compatible. |
58 | * Different minor versions are only downward compatible. | 60 | * Different minor versions are only downward compatible. |
@@ -93,7 +95,7 @@ extern int sync_page_io(struct block_device *bdev, sector_t sector, int size, | |||
93 | extern void md_do_sync(mddev_t *mddev); | 95 | extern void md_do_sync(mddev_t *mddev); |
94 | extern void md_new_event(mddev_t *mddev); | 96 | extern void md_new_event(mddev_t *mddev); |
95 | 97 | ||
96 | extern void md_update_sb(mddev_t * mddev); | ||
97 | 98 | ||
99 | #endif /* CONFIG_MD */ | ||
98 | #endif | 100 | #endif |
99 | 101 | ||
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index d28890295852..8245c282168b 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h | |||
@@ -18,6 +18,8 @@ | |||
18 | /* and dm-bio-list.h is not under include/linux because.... ??? */ | 18 | /* and dm-bio-list.h is not under include/linux because.... ??? */ |
19 | #include "../../../drivers/md/dm-bio-list.h" | 19 | #include "../../../drivers/md/dm-bio-list.h" |
20 | 20 | ||
21 | #ifdef CONFIG_BLOCK | ||
22 | |||
21 | #define LEVEL_MULTIPATH (-4) | 23 | #define LEVEL_MULTIPATH (-4) |
22 | #define LEVEL_LINEAR (-1) | 24 | #define LEVEL_LINEAR (-1) |
23 | #define LEVEL_FAULTY (-5) | 25 | #define LEVEL_FAULTY (-5) |
@@ -29,18 +31,15 @@ | |||
29 | #define LEVEL_NONE (-1000000) | 31 | #define LEVEL_NONE (-1000000) |
30 | 32 | ||
31 | #define MaxSector (~(sector_t)0) | 33 | #define MaxSector (~(sector_t)0) |
32 | #define MD_THREAD_NAME_MAX 14 | ||
33 | 34 | ||
34 | typedef struct mddev_s mddev_t; | 35 | typedef struct mddev_s mddev_t; |
35 | typedef struct mdk_rdev_s mdk_rdev_t; | 36 | typedef struct mdk_rdev_s mdk_rdev_t; |
36 | 37 | ||
37 | #define MAX_MD_DEVS 256 /* Max number of md dev */ | ||
38 | |||
39 | /* | 38 | /* |
40 | * options passed in raidrun: | 39 | * options passed in raidrun: |
41 | */ | 40 | */ |
42 | 41 | ||
43 | /* Currently this must fix in an 'int' */ | 42 | /* Currently this must fit in an 'int' */ |
44 | #define MAX_CHUNK_SIZE (1<<30) | 43 | #define MAX_CHUNK_SIZE (1<<30) |
45 | 44 | ||
46 | /* | 45 | /* |
@@ -114,7 +113,11 @@ struct mddev_s | |||
114 | dev_t unit; | 113 | dev_t unit; |
115 | int md_minor; | 114 | int md_minor; |
116 | struct list_head disks; | 115 | struct list_head disks; |
117 | int sb_dirty; | 116 | unsigned long flags; |
117 | #define MD_CHANGE_DEVS 0 /* Some device status has changed */ | ||
118 | #define MD_CHANGE_CLEAN 1 /* transition to or from 'clean' */ | ||
119 | #define MD_CHANGE_PENDING 2 /* superblock update in progress */ | ||
120 | |||
118 | int ro; | 121 | int ro; |
119 | 122 | ||
120 | struct gendisk *gendisk; | 123 | struct gendisk *gendisk; |
@@ -362,5 +365,6 @@ static inline void safe_put_page(struct page *p) | |||
362 | if (p) put_page(p); | 365 | if (p) put_page(p); |
363 | } | 366 | } |
364 | 367 | ||
368 | #endif /* CONFIG_BLOCK */ | ||
365 | #endif | 369 | #endif |
366 | 370 | ||
diff --git a/include/linux/raid/md_u.h b/include/linux/raid/md_u.h index 81da20ccec4d..7192035fc4b0 100644 --- a/include/linux/raid/md_u.h +++ b/include/linux/raid/md_u.h | |||
@@ -41,7 +41,7 @@ | |||
41 | 41 | ||
42 | /* usage */ | 42 | /* usage */ |
43 | #define RUN_ARRAY _IOW (MD_MAJOR, 0x30, mdu_param_t) | 43 | #define RUN_ARRAY _IOW (MD_MAJOR, 0x30, mdu_param_t) |
44 | #define START_ARRAY _IO (MD_MAJOR, 0x31) | 44 | /* 0x31 was START_ARRAY */ |
45 | #define STOP_ARRAY _IO (MD_MAJOR, 0x32) | 45 | #define STOP_ARRAY _IO (MD_MAJOR, 0x32) |
46 | #define STOP_ARRAY_RO _IO (MD_MAJOR, 0x33) | 46 | #define STOP_ARRAY_RO _IO (MD_MAJOR, 0x33) |
47 | #define RESTART_ARRAY_RW _IO (MD_MAJOR, 0x34) | 47 | #define RESTART_ARRAY_RW _IO (MD_MAJOR, 0x34) |
diff --git a/include/linux/raid/raid1.h b/include/linux/raid/raid1.h index 3009c813d83d..0a9ba7c3302e 100644 --- a/include/linux/raid/raid1.h +++ b/include/linux/raid/raid1.h | |||
@@ -30,7 +30,6 @@ struct r1_private_data_s { | |||
30 | mddev_t *mddev; | 30 | mddev_t *mddev; |
31 | mirror_info_t *mirrors; | 31 | mirror_info_t *mirrors; |
32 | int raid_disks; | 32 | int raid_disks; |
33 | int working_disks; | ||
34 | int last_used; | 33 | int last_used; |
35 | sector_t next_seq_sect; | 34 | sector_t next_seq_sect; |
36 | spinlock_t device_lock; | 35 | spinlock_t device_lock; |
diff --git a/include/linux/raid/raid10.h b/include/linux/raid/raid10.h index c41e56a7c090..e9091cfeb286 100644 --- a/include/linux/raid/raid10.h +++ b/include/linux/raid/raid10.h | |||
@@ -16,7 +16,6 @@ struct r10_private_data_s { | |||
16 | mddev_t *mddev; | 16 | mddev_t *mddev; |
17 | mirror_info_t *mirrors; | 17 | mirror_info_t *mirrors; |
18 | int raid_disks; | 18 | int raid_disks; |
19 | int working_disks; | ||
20 | spinlock_t device_lock; | 19 | spinlock_t device_lock; |
21 | 20 | ||
22 | /* geometry */ | 21 | /* geometry */ |
diff --git a/include/linux/raid/raid5.h b/include/linux/raid/raid5.h index 20ed4c997636..f13299a15591 100644 --- a/include/linux/raid/raid5.h +++ b/include/linux/raid/raid5.h | |||
@@ -195,8 +195,9 @@ struct stripe_head { | |||
195 | * it to the count of prereading stripes. | 195 | * it to the count of prereading stripes. |
196 | * When write is initiated, or the stripe refcnt == 0 (just in case) we | 196 | * When write is initiated, or the stripe refcnt == 0 (just in case) we |
197 | * clear the PREREAD_ACTIVE flag and decrement the count | 197 | * clear the PREREAD_ACTIVE flag and decrement the count |
198 | * Whenever the delayed queue is empty and the device is not plugged, we | 198 | * Whenever the 'handle' queue is empty and the device is not plugged, we |
199 | * move any strips from delayed to handle and clear the DELAYED flag and set PREREAD_ACTIVE. | 199 | * move any strips from delayed to handle and clear the DELAYED flag and set |
200 | * PREREAD_ACTIVE. | ||
200 | * In stripe_handle, if we find pre-reading is necessary, we do it if | 201 | * In stripe_handle, if we find pre-reading is necessary, we do it if |
201 | * PREREAD_ACTIVE is set, else we set DELAYED which will send it to the delayed queue. | 202 | * PREREAD_ACTIVE is set, else we set DELAYED which will send it to the delayed queue. |
202 | * HANDLE gets cleared if stripe_handle leave nothing locked. | 203 | * HANDLE gets cleared if stripe_handle leave nothing locked. |
@@ -213,7 +214,7 @@ struct raid5_private_data { | |||
213 | struct disk_info *spare; | 214 | struct disk_info *spare; |
214 | int chunk_size, level, algorithm; | 215 | int chunk_size, level, algorithm; |
215 | int max_degraded; | 216 | int max_degraded; |
216 | int raid_disks, working_disks, failed_disks; | 217 | int raid_disks; |
217 | int max_nr_stripes; | 218 | int max_nr_stripes; |
218 | 219 | ||
219 | /* used during an expand */ | 220 | /* used during an expand */ |
diff --git a/include/linux/ramfs.h b/include/linux/ramfs.h index 00b340ba6612..b160fb18e8d6 100644 --- a/include/linux/ramfs.h +++ b/include/linux/ramfs.h | |||
@@ -17,5 +17,6 @@ extern int ramfs_nommu_mmap(struct file *file, struct vm_area_struct *vma); | |||
17 | 17 | ||
18 | extern const struct file_operations ramfs_file_operations; | 18 | extern const struct file_operations ramfs_file_operations; |
19 | extern struct vm_operations_struct generic_file_vm_ops; | 19 | extern struct vm_operations_struct generic_file_vm_ops; |
20 | extern int __init init_rootfs(void); | ||
20 | 21 | ||
21 | #endif | 22 | #endif |
diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h index 8d5382e62c08..344bc3495ddb 100644 --- a/include/linux/rbtree.h +++ b/include/linux/rbtree.h | |||
@@ -133,7 +133,7 @@ static inline void rb_set_color(struct rb_node *rb, int color) | |||
133 | #define rb_entry(ptr, type, member) container_of(ptr, type, member) | 133 | #define rb_entry(ptr, type, member) container_of(ptr, type, member) |
134 | 134 | ||
135 | #define RB_EMPTY_ROOT(root) ((root)->rb_node == NULL) | 135 | #define RB_EMPTY_ROOT(root) ((root)->rb_node == NULL) |
136 | #define RB_EMPTY_NODE(node) (rb_parent(node) != node) | 136 | #define RB_EMPTY_NODE(node) (rb_parent(node) == node) |
137 | #define RB_CLEAR_NODE(node) (rb_set_parent(node, node)) | 137 | #define RB_CLEAR_NODE(node) (rb_set_parent(node, node)) |
138 | 138 | ||
139 | extern void rb_insert_color(struct rb_node *, struct rb_root *); | 139 | extern void rb_insert_color(struct rb_node *, struct rb_root *); |
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index 28493ffaafe7..7bc6bfb86253 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
@@ -807,21 +807,19 @@ struct stat_data_v1 { | |||
807 | #define set_sd_v1_first_direct_byte(sdp,v) \ | 807 | #define set_sd_v1_first_direct_byte(sdp,v) \ |
808 | ((sdp)->sd_first_direct_byte = cpu_to_le32(v)) | 808 | ((sdp)->sd_first_direct_byte = cpu_to_le32(v)) |
809 | 809 | ||
810 | #include <linux/ext2_fs.h> | ||
811 | |||
812 | /* inode flags stored in sd_attrs (nee sd_reserved) */ | 810 | /* inode flags stored in sd_attrs (nee sd_reserved) */ |
813 | 811 | ||
814 | /* we want common flags to have the same values as in ext2, | 812 | /* we want common flags to have the same values as in ext2, |
815 | so chattr(1) will work without problems */ | 813 | so chattr(1) will work without problems */ |
816 | #define REISERFS_IMMUTABLE_FL EXT2_IMMUTABLE_FL | 814 | #define REISERFS_IMMUTABLE_FL FS_IMMUTABLE_FL |
817 | #define REISERFS_APPEND_FL EXT2_APPEND_FL | 815 | #define REISERFS_APPEND_FL FS_APPEND_FL |
818 | #define REISERFS_SYNC_FL EXT2_SYNC_FL | 816 | #define REISERFS_SYNC_FL FS_SYNC_FL |
819 | #define REISERFS_NOATIME_FL EXT2_NOATIME_FL | 817 | #define REISERFS_NOATIME_FL FS_NOATIME_FL |
820 | #define REISERFS_NODUMP_FL EXT2_NODUMP_FL | 818 | #define REISERFS_NODUMP_FL FS_NODUMP_FL |
821 | #define REISERFS_SECRM_FL EXT2_SECRM_FL | 819 | #define REISERFS_SECRM_FL FS_SECRM_FL |
822 | #define REISERFS_UNRM_FL EXT2_UNRM_FL | 820 | #define REISERFS_UNRM_FL FS_UNRM_FL |
823 | #define REISERFS_COMPR_FL EXT2_COMPR_FL | 821 | #define REISERFS_COMPR_FL FS_COMPR_FL |
824 | #define REISERFS_NOTAIL_FL EXT2_NOTAIL_FL | 822 | #define REISERFS_NOTAIL_FL FS_NOTAIL_FL |
825 | 823 | ||
826 | /* persistent flags that file inherits from the parent directory */ | 824 | /* persistent flags that file inherits from the parent directory */ |
827 | #define REISERFS_INHERIT_MASK ( REISERFS_IMMUTABLE_FL | \ | 825 | #define REISERFS_INHERIT_MASK ( REISERFS_IMMUTABLE_FL | \ |
@@ -2075,6 +2073,10 @@ void reiserfs_init_alloc_options(struct super_block *s); | |||
2075 | */ | 2073 | */ |
2076 | __le32 reiserfs_choose_packing(struct inode *dir); | 2074 | __le32 reiserfs_choose_packing(struct inode *dir); |
2077 | 2075 | ||
2076 | int reiserfs_init_bitmap_cache(struct super_block *sb); | ||
2077 | void reiserfs_free_bitmap_cache(struct super_block *sb); | ||
2078 | void reiserfs_cache_bitmap_metadata(struct super_block *sb, struct buffer_head *bh, struct reiserfs_bitmap_info *info); | ||
2079 | struct buffer_head *reiserfs_read_bitmap_block(struct super_block *sb, unsigned int bitmap); | ||
2078 | int is_reusable(struct super_block *s, b_blocknr_t block, int bit_value); | 2080 | int is_reusable(struct super_block *s, b_blocknr_t block, int bit_value); |
2079 | void reiserfs_free_block(struct reiserfs_transaction_handle *th, struct inode *, | 2081 | void reiserfs_free_block(struct reiserfs_transaction_handle *th, struct inode *, |
2080 | b_blocknr_t, int for_unformatted); | 2082 | b_blocknr_t, int for_unformatted); |
@@ -2163,15 +2165,24 @@ __u32 r5_hash(const signed char *msg, int len); | |||
2163 | /* prototypes from ioctl.c */ | 2165 | /* prototypes from ioctl.c */ |
2164 | int reiserfs_ioctl(struct inode *inode, struct file *filp, | 2166 | int reiserfs_ioctl(struct inode *inode, struct file *filp, |
2165 | unsigned int cmd, unsigned long arg); | 2167 | unsigned int cmd, unsigned long arg); |
2168 | long reiserfs_compat_ioctl(struct file *filp, | ||
2169 | unsigned int cmd, unsigned long arg); | ||
2166 | 2170 | ||
2167 | /* ioctl's command */ | 2171 | /* ioctl's command */ |
2168 | #define REISERFS_IOC_UNPACK _IOW(0xCD,1,long) | 2172 | #define REISERFS_IOC_UNPACK _IOW(0xCD,1,long) |
2169 | /* define following flags to be the same as in ext2, so that chattr(1), | 2173 | /* define following flags to be the same as in ext2, so that chattr(1), |
2170 | lsattr(1) will work with us. */ | 2174 | lsattr(1) will work with us. */ |
2171 | #define REISERFS_IOC_GETFLAGS EXT2_IOC_GETFLAGS | 2175 | #define REISERFS_IOC_GETFLAGS FS_IOC_GETFLAGS |
2172 | #define REISERFS_IOC_SETFLAGS EXT2_IOC_SETFLAGS | 2176 | #define REISERFS_IOC_SETFLAGS FS_IOC_SETFLAGS |
2173 | #define REISERFS_IOC_GETVERSION EXT2_IOC_GETVERSION | 2177 | #define REISERFS_IOC_GETVERSION FS_IOC_GETVERSION |
2174 | #define REISERFS_IOC_SETVERSION EXT2_IOC_SETVERSION | 2178 | #define REISERFS_IOC_SETVERSION FS_IOC_SETVERSION |
2179 | |||
2180 | /* the 32 bit compat definitions with int argument */ | ||
2181 | #define REISERFS_IOC32_UNPACK _IOW(0xCD, 1, int) | ||
2182 | #define REISERFS_IOC32_GETFLAGS FS_IOC32_GETFLAGS | ||
2183 | #define REISERFS_IOC32_SETFLAGS FS_IOC32_SETFLAGS | ||
2184 | #define REISERFS_IOC32_GETVERSION FS_IOC32_GETVERSION | ||
2185 | #define REISERFS_IOC32_SETVERSION FS_IOC32_SETVERSION | ||
2175 | 2186 | ||
2176 | /* Locking primitives */ | 2187 | /* Locking primitives */ |
2177 | /* Right now we are still falling back to (un)lock_kernel, but eventually that | 2188 | /* Right now we are still falling back to (un)lock_kernel, but eventually that |
diff --git a/include/linux/reiserfs_fs_sb.h b/include/linux/reiserfs_fs_sb.h index 31b4c0bd4fa0..73e0becec086 100644 --- a/include/linux/reiserfs_fs_sb.h +++ b/include/linux/reiserfs_fs_sb.h | |||
@@ -267,7 +267,6 @@ struct reiserfs_bitmap_info { | |||
267 | // FIXME: Won't work with block sizes > 8K | 267 | // FIXME: Won't work with block sizes > 8K |
268 | __u16 first_zero_hint; | 268 | __u16 first_zero_hint; |
269 | __u16 free_count; | 269 | __u16 free_count; |
270 | struct buffer_head *bh; /* the actual bitmap */ | ||
271 | }; | 270 | }; |
272 | 271 | ||
273 | struct proc_dir_entry; | 272 | struct proc_dir_entry; |
@@ -414,6 +413,7 @@ struct reiserfs_sb_info { | |||
414 | /* Definitions of reiserfs on-disk properties: */ | 413 | /* Definitions of reiserfs on-disk properties: */ |
415 | #define REISERFS_3_5 0 | 414 | #define REISERFS_3_5 0 |
416 | #define REISERFS_3_6 1 | 415 | #define REISERFS_3_6 1 |
416 | #define REISERFS_OLD_FORMAT 2 | ||
417 | 417 | ||
418 | enum reiserfs_mount_options { | 418 | enum reiserfs_mount_options { |
419 | /* Mount options */ | 419 | /* Mount options */ |
diff --git a/include/linux/rtc.h b/include/linux/rtc.h index 5371e4e74595..b89f09357054 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h | |||
@@ -141,7 +141,7 @@ struct rtc_device | |||
141 | int id; | 141 | int id; |
142 | char name[RTC_DEVICE_NAME_SIZE]; | 142 | char name[RTC_DEVICE_NAME_SIZE]; |
143 | 143 | ||
144 | struct rtc_class_ops *ops; | 144 | const struct rtc_class_ops *ops; |
145 | struct mutex ops_lock; | 145 | struct mutex ops_lock; |
146 | 146 | ||
147 | struct class_device *rtc_dev; | 147 | struct class_device *rtc_dev; |
@@ -172,7 +172,7 @@ struct rtc_device | |||
172 | 172 | ||
173 | extern struct rtc_device *rtc_device_register(const char *name, | 173 | extern struct rtc_device *rtc_device_register(const char *name, |
174 | struct device *dev, | 174 | struct device *dev, |
175 | struct rtc_class_ops *ops, | 175 | const struct rtc_class_ops *ops, |
176 | struct module *owner); | 176 | struct module *owner); |
177 | extern void rtc_device_unregister(struct rtc_device *rdev); | 177 | extern void rtc_device_unregister(struct rtc_device *rdev); |
178 | extern int rtc_interface_register(struct class_interface *intf); | 178 | extern int rtc_interface_register(struct class_interface *intf); |
diff --git a/include/linux/sched.h b/include/linux/sched.h index a06fc89cf6e5..331f4502e92b 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 |
@@ -624,9 +625,17 @@ enum idle_type | |||
624 | #define SD_WAKE_BALANCE 64 /* Perform balancing at task wakeup */ | 625 | #define SD_WAKE_BALANCE 64 /* Perform balancing at task wakeup */ |
625 | #define SD_SHARE_CPUPOWER 128 /* Domain members share cpu power */ | 626 | #define SD_SHARE_CPUPOWER 128 /* Domain members share cpu power */ |
626 | #define SD_POWERSAVINGS_BALANCE 256 /* Balance for power savings */ | 627 | #define SD_POWERSAVINGS_BALANCE 256 /* Balance for power savings */ |
628 | #define SD_SHARE_PKG_RESOURCES 512 /* Domain members share cpu pkg resources */ | ||
627 | 629 | ||
628 | #define BALANCE_FOR_POWER ((sched_mc_power_savings || sched_smt_power_savings) \ | 630 | #define BALANCE_FOR_MC_POWER \ |
629 | ? SD_POWERSAVINGS_BALANCE : 0) | 631 | (sched_smt_power_savings ? SD_POWERSAVINGS_BALANCE : 0) |
632 | |||
633 | #define BALANCE_FOR_PKG_POWER \ | ||
634 | ((sched_mc_power_savings || sched_smt_power_savings) ? \ | ||
635 | SD_POWERSAVINGS_BALANCE : 0) | ||
636 | |||
637 | #define test_sd_parent(sd, flag) ((sd->parent && \ | ||
638 | (sd->parent->flags & flag)) ? 1 : 0) | ||
630 | 639 | ||
631 | 640 | ||
632 | struct sched_group { | 641 | struct sched_group { |
@@ -643,6 +652,7 @@ struct sched_group { | |||
643 | struct sched_domain { | 652 | struct sched_domain { |
644 | /* These fields must be setup */ | 653 | /* These fields must be setup */ |
645 | struct sched_domain *parent; /* top domain must be null terminated */ | 654 | struct sched_domain *parent; /* top domain must be null terminated */ |
655 | struct sched_domain *child; /* bottom domain must be null terminated */ | ||
646 | struct sched_group *groups; /* the balancing groups of the domain */ | 656 | struct sched_group *groups; /* the balancing groups of the domain */ |
647 | cpumask_t span; /* span of all CPUs in this domain */ | 657 | cpumask_t span; /* span of all CPUs in this domain */ |
648 | unsigned long min_interval; /* Minimum balance interval ms */ | 658 | unsigned long min_interval; /* Minimum balance interval ms */ |
@@ -710,7 +720,6 @@ extern unsigned int max_cache_size; | |||
710 | 720 | ||
711 | 721 | ||
712 | struct io_context; /* See blkdev.h */ | 722 | struct io_context; /* See blkdev.h */ |
713 | void exit_io_context(void); | ||
714 | struct cpuset; | 723 | struct cpuset; |
715 | 724 | ||
716 | #define NGROUPS_SMALL 32 | 725 | #define NGROUPS_SMALL 32 |
@@ -755,6 +764,7 @@ static inline void prefetch_stack(struct task_struct *t) { } | |||
755 | struct audit_context; /* See audit.c */ | 764 | struct audit_context; /* See audit.c */ |
756 | struct mempolicy; | 765 | struct mempolicy; |
757 | struct pipe_inode_info; | 766 | struct pipe_inode_info; |
767 | struct uts_namespace; | ||
758 | 768 | ||
759 | enum sleep_type { | 769 | enum sleep_type { |
760 | SLEEP_NORMAL, | 770 | SLEEP_NORMAL, |
@@ -898,8 +908,8 @@ struct task_struct { | |||
898 | struct fs_struct *fs; | 908 | struct fs_struct *fs; |
899 | /* open file information */ | 909 | /* open file information */ |
900 | struct files_struct *files; | 910 | struct files_struct *files; |
901 | /* namespace */ | 911 | /* namespaces */ |
902 | struct namespace *namespace; | 912 | struct nsproxy *nsproxy; |
903 | /* signal handlers */ | 913 | /* signal handlers */ |
904 | struct signal_struct *signal; | 914 | struct signal_struct *signal; |
905 | struct sighand_struct *sighand; | 915 | struct sighand_struct *sighand; |
@@ -982,10 +992,10 @@ struct task_struct { | |||
982 | wait_queue_t *io_wait; | 992 | wait_queue_t *io_wait; |
983 | /* i/o counters(bytes read/written, #syscalls */ | 993 | /* i/o counters(bytes read/written, #syscalls */ |
984 | u64 rchar, wchar, syscr, syscw; | 994 | u64 rchar, wchar, syscr, syscw; |
985 | #if defined(CONFIG_BSD_PROCESS_ACCT) | 995 | #if defined(CONFIG_TASK_XACCT) |
986 | u64 acct_rss_mem1; /* accumulated rss usage */ | 996 | u64 acct_rss_mem1; /* accumulated rss usage */ |
987 | u64 acct_vm_mem1; /* accumulated virtual memory usage */ | 997 | u64 acct_vm_mem1; /* accumulated virtual memory usage */ |
988 | clock_t acct_stimexpd; /* clock_t-converted stime since last update */ | 998 | cputime_t acct_stimexpd;/* stime since last update */ |
989 | #endif | 999 | #endif |
990 | #ifdef CONFIG_NUMA | 1000 | #ifdef CONFIG_NUMA |
991 | struct mempolicy *mempolicy; | 1001 | struct mempolicy *mempolicy; |
@@ -1021,6 +1031,26 @@ static inline pid_t process_group(struct task_struct *tsk) | |||
1021 | return tsk->signal->pgrp; | 1031 | return tsk->signal->pgrp; |
1022 | } | 1032 | } |
1023 | 1033 | ||
1034 | static inline struct pid *task_pid(struct task_struct *task) | ||
1035 | { | ||
1036 | return task->pids[PIDTYPE_PID].pid; | ||
1037 | } | ||
1038 | |||
1039 | static inline struct pid *task_tgid(struct task_struct *task) | ||
1040 | { | ||
1041 | return task->group_leader->pids[PIDTYPE_PID].pid; | ||
1042 | } | ||
1043 | |||
1044 | static inline struct pid *task_pgrp(struct task_struct *task) | ||
1045 | { | ||
1046 | return task->group_leader->pids[PIDTYPE_PGID].pid; | ||
1047 | } | ||
1048 | |||
1049 | static inline struct pid *task_session(struct task_struct *task) | ||
1050 | { | ||
1051 | return task->group_leader->pids[PIDTYPE_SID].pid; | ||
1052 | } | ||
1053 | |||
1024 | /** | 1054 | /** |
1025 | * pid_alive - check that a task structure is not stale | 1055 | * pid_alive - check that a task structure is not stale |
1026 | * @p: Task structure to be checked. | 1056 | * @p: Task structure to be checked. |
@@ -1044,6 +1074,8 @@ static inline int is_init(struct task_struct *tsk) | |||
1044 | return tsk->pid == 1; | 1074 | return tsk->pid == 1; |
1045 | } | 1075 | } |
1046 | 1076 | ||
1077 | extern struct pid *cad_pid; | ||
1078 | |||
1047 | extern void free_task(struct task_struct *tsk); | 1079 | extern void free_task(struct task_struct *tsk); |
1048 | #define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0) | 1080 | #define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0) |
1049 | 1081 | ||
@@ -1248,10 +1280,15 @@ extern int send_sig_info(int, struct siginfo *, struct task_struct *); | |||
1248 | extern int send_group_sig_info(int, struct siginfo *, struct task_struct *); | 1280 | extern int send_group_sig_info(int, struct siginfo *, struct task_struct *); |
1249 | extern int force_sigsegv(int, struct task_struct *); | 1281 | extern int force_sigsegv(int, struct task_struct *); |
1250 | extern int force_sig_info(int, struct siginfo *, struct task_struct *); | 1282 | extern int force_sig_info(int, struct siginfo *, struct task_struct *); |
1283 | extern int __kill_pgrp_info(int sig, struct siginfo *info, struct pid *pgrp); | ||
1284 | extern int kill_pgrp_info(int sig, struct siginfo *info, struct pid *pgrp); | ||
1285 | extern int kill_pid_info(int sig, struct siginfo *info, struct pid *pid); | ||
1286 | extern int kill_pid_info_as_uid(int, struct siginfo *, struct pid *, uid_t, uid_t, u32); | ||
1287 | extern int kill_pgrp(struct pid *pid, int sig, int priv); | ||
1288 | extern int kill_pid(struct pid *pid, int sig, int priv); | ||
1251 | extern int __kill_pg_info(int sig, struct siginfo *info, pid_t pgrp); | 1289 | extern int __kill_pg_info(int sig, struct siginfo *info, pid_t pgrp); |
1252 | extern int kill_pg_info(int, struct siginfo *, pid_t); | 1290 | extern int kill_pg_info(int, struct siginfo *, pid_t); |
1253 | extern int kill_proc_info(int, struct siginfo *, pid_t); | 1291 | extern int kill_proc_info(int, struct siginfo *, pid_t); |
1254 | extern int kill_proc_info_as_uid(int, struct siginfo *, pid_t, uid_t, uid_t, u32); | ||
1255 | extern void do_notify_parent(struct task_struct *, int); | 1292 | extern void do_notify_parent(struct task_struct *, int); |
1256 | extern void force_sig(int, struct task_struct *); | 1293 | extern void force_sig(int, struct task_struct *); |
1257 | extern void force_sig_specific(int, struct task_struct *); | 1294 | extern void force_sig_specific(int, struct task_struct *); |
@@ -1266,6 +1303,11 @@ extern int send_group_sigqueue(int, struct sigqueue *, struct task_struct *); | |||
1266 | extern int do_sigaction(int, struct k_sigaction *, struct k_sigaction *); | 1303 | extern int do_sigaction(int, struct k_sigaction *, struct k_sigaction *); |
1267 | extern int do_sigaltstack(const stack_t __user *, stack_t __user *, unsigned long); | 1304 | extern int do_sigaltstack(const stack_t __user *, stack_t __user *, unsigned long); |
1268 | 1305 | ||
1306 | static inline int kill_cad_pid(int sig, int priv) | ||
1307 | { | ||
1308 | return kill_pid(cad_pid, sig, priv); | ||
1309 | } | ||
1310 | |||
1269 | /* These can be the second arg to send_sig_info/send_group_sig_info. */ | 1311 | /* These can be the second arg to send_sig_info/send_group_sig_info. */ |
1270 | #define SEND_SIG_NOINFO ((struct siginfo *) 0) | 1312 | #define SEND_SIG_NOINFO ((struct siginfo *) 0) |
1271 | #define SEND_SIG_PRIV ((struct siginfo *) 1) | 1313 | #define SEND_SIG_PRIV ((struct siginfo *) 1) |
@@ -1359,6 +1401,17 @@ extern void wait_task_inactive(struct task_struct * p); | |||
1359 | /* de_thread depends on thread_group_leader not being a pid based check */ | 1401 | /* de_thread depends on thread_group_leader not being a pid based check */ |
1360 | #define thread_group_leader(p) (p == p->group_leader) | 1402 | #define thread_group_leader(p) (p == p->group_leader) |
1361 | 1403 | ||
1404 | /* Do to the insanities of de_thread it is possible for a process | ||
1405 | * to have the pid of the thread group leader without actually being | ||
1406 | * the thread group leader. For iteration through the pids in proc | ||
1407 | * all we care about is that we have a task with the appropriate | ||
1408 | * pid, we don't actually care if we have the right task. | ||
1409 | */ | ||
1410 | static inline int has_group_leader_pid(struct task_struct *p) | ||
1411 | { | ||
1412 | return p->pid == p->tgid; | ||
1413 | } | ||
1414 | |||
1362 | static inline struct task_struct *next_thread(const struct task_struct *p) | 1415 | static inline struct task_struct *next_thread(const struct task_struct *p) |
1363 | { | 1416 | { |
1364 | return list_entry(rcu_dereference(p->thread_group.next), | 1417 | 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/stat.h b/include/linux/stat.h index 8669291352db..679ef0d70b6b 100644 --- a/include/linux/stat.h +++ b/include/linux/stat.h | |||
@@ -57,7 +57,7 @@ | |||
57 | #include <linux/time.h> | 57 | #include <linux/time.h> |
58 | 58 | ||
59 | struct kstat { | 59 | struct kstat { |
60 | unsigned long ino; | 60 | u64 ino; |
61 | dev_t dev; | 61 | dev_t dev; |
62 | umode_t mode; | 62 | umode_t mode; |
63 | unsigned int nlink; | 63 | unsigned int nlink; |
diff --git a/include/linux/stddef.h b/include/linux/stddef.h index ea65dfb60cd8..6a40c76bdcf1 100644 --- a/include/linux/stddef.h +++ b/include/linux/stddef.h | |||
@@ -11,6 +11,12 @@ | |||
11 | #endif | 11 | #endif |
12 | 12 | ||
13 | #ifdef __KERNEL__ | 13 | #ifdef __KERNEL__ |
14 | |||
15 | enum { | ||
16 | false = 0, | ||
17 | true = 1 | ||
18 | }; | ||
19 | |||
14 | #undef offsetof | 20 | #undef offsetof |
15 | #ifdef __compiler_offsetof | 21 | #ifdef __compiler_offsetof |
16 | #define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER) | 22 | #define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER) |
diff --git a/include/linux/string.h b/include/linux/string.h index e4c755860316..4f69ef9e6eb5 100644 --- a/include/linux/string.h +++ b/include/linux/string.h | |||
@@ -99,6 +99,7 @@ extern void * memchr(const void *,int,__kernel_size_t); | |||
99 | #endif | 99 | #endif |
100 | 100 | ||
101 | extern char *kstrdup(const char *s, gfp_t gfp); | 101 | extern char *kstrdup(const char *s, gfp_t gfp); |
102 | extern void *kmemdup(const void *src, size_t len, gfp_t gfp); | ||
102 | 103 | ||
103 | #ifdef __cplusplus | 104 | #ifdef __cplusplus |
104 | } | 105 | } |
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/synclink.h b/include/linux/synclink.h index 0577f5284cbc..c8b042667af1 100644 --- a/include/linux/synclink.h +++ b/include/linux/synclink.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * SyncLink Multiprotocol Serial Adapter Driver | 2 | * SyncLink Multiprotocol Serial Adapter Driver |
3 | * | 3 | * |
4 | * $Id: synclink.h,v 3.13 2006/05/23 18:25:06 paulkf Exp $ | 4 | * $Id: synclink.h,v 3.14 2006/07/17 20:15:43 paulkf Exp $ |
5 | * | 5 | * |
6 | * Copyright (C) 1998-2000 by Microgate Corporation | 6 | * Copyright (C) 1998-2000 by Microgate Corporation |
7 | * | 7 | * |
@@ -124,6 +124,8 @@ | |||
124 | 124 | ||
125 | #define MGSL_MODE_ASYNC 1 | 125 | #define MGSL_MODE_ASYNC 1 |
126 | #define MGSL_MODE_HDLC 2 | 126 | #define MGSL_MODE_HDLC 2 |
127 | #define MGSL_MODE_MONOSYNC 3 | ||
128 | #define MGSL_MODE_BISYNC 4 | ||
127 | #define MGSL_MODE_RAW 6 | 129 | #define MGSL_MODE_RAW 6 |
128 | 130 | ||
129 | #define MGSL_BUS_TYPE_ISA 1 | 131 | #define MGSL_BUS_TYPE_ISA 1 |
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/sysrq.h b/include/linux/sysrq.h index 4812ff60561c..e657e523b9bf 100644 --- a/include/linux/sysrq.h +++ b/include/linux/sysrq.h | |||
@@ -11,6 +11,8 @@ | |||
11 | * based upon discusions in irc://irc.openprojects.net/#kernelnewbies | 11 | * based upon discusions in irc://irc.openprojects.net/#kernelnewbies |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #ifndef _LINUX_SYSRQ_H | ||
15 | #define _LINUX_SYSRQ_H | ||
14 | 16 | ||
15 | struct pt_regs; | 17 | struct pt_regs; |
16 | struct tty_struct; | 18 | struct tty_struct; |
@@ -57,3 +59,5 @@ static inline int __reterr(void) | |||
57 | #define unregister_sysrq_key(ig,nore) __reterr() | 59 | #define unregister_sysrq_key(ig,nore) __reterr() |
58 | 60 | ||
59 | #endif | 61 | #endif |
62 | |||
63 | #endif /* _LINUX_SYSRQ_H */ | ||
diff --git a/include/linux/taskstats.h b/include/linux/taskstats.h index f1cb6cddd19d..45248806ae9c 100644 --- a/include/linux/taskstats.h +++ b/include/linux/taskstats.h | |||
@@ -2,6 +2,7 @@ | |||
2 | * | 2 | * |
3 | * Copyright (C) Shailabh Nagar, IBM Corp. 2006 | 3 | * Copyright (C) Shailabh Nagar, IBM Corp. 2006 |
4 | * (C) Balbir Singh, IBM Corp. 2006 | 4 | * (C) Balbir Singh, IBM Corp. 2006 |
5 | * (C) Jay Lan, SGI, 2006 | ||
5 | * | 6 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 7 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms of version 2.1 of the GNU Lesser General Public License | 8 | * under the terms of version 2.1 of the GNU Lesser General Public License |
@@ -29,16 +30,25 @@ | |||
29 | * c) add new fields after version comment; maintain 64-bit alignment | 30 | * c) add new fields after version comment; maintain 64-bit alignment |
30 | */ | 31 | */ |
31 | 32 | ||
32 | #define TASKSTATS_VERSION 1 | 33 | |
34 | #define TASKSTATS_VERSION 2 | ||
35 | #define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN | ||
36 | * in linux/sched.h */ | ||
33 | 37 | ||
34 | struct taskstats { | 38 | struct taskstats { |
35 | 39 | ||
36 | /* Version 1 */ | 40 | /* The version number of this struct. This field is always set to |
41 | * TAKSTATS_VERSION, which is defined in <linux/taskstats.h>. | ||
42 | * Each time the struct is changed, the value should be incremented. | ||
43 | */ | ||
37 | __u16 version; | 44 | __u16 version; |
38 | __u16 padding[3]; /* Userspace should not interpret the padding | 45 | __u32 ac_exitcode; /* Exit status */ |
39 | * field which can be replaced by useful | 46 | |
40 | * fields if struct taskstats is extended. | 47 | /* The accounting flags of a task as defined in <linux/acct.h> |
41 | */ | 48 | * Defined values are AFORK, ASU, ACOMPAT, ACORE, and AXSIG. |
49 | */ | ||
50 | __u8 ac_flag; /* Record flags */ | ||
51 | __u8 ac_nice; /* task_nice */ | ||
42 | 52 | ||
43 | /* Delay accounting fields start | 53 | /* Delay accounting fields start |
44 | * | 54 | * |
@@ -88,6 +98,48 @@ struct taskstats { | |||
88 | __u64 cpu_run_virtual_total; | 98 | __u64 cpu_run_virtual_total; |
89 | /* Delay accounting fields end */ | 99 | /* Delay accounting fields end */ |
90 | /* version 1 ends here */ | 100 | /* version 1 ends here */ |
101 | |||
102 | /* Basic Accounting Fields start */ | ||
103 | char ac_comm[TS_COMM_LEN]; /* Command name */ | ||
104 | __u8 ac_sched; /* Scheduling discipline */ | ||
105 | __u8 ac_pad[3]; | ||
106 | __u32 ac_uid; /* User ID */ | ||
107 | __u32 ac_gid; /* Group ID */ | ||
108 | __u32 ac_pid; /* Process ID */ | ||
109 | __u32 ac_ppid; /* Parent process ID */ | ||
110 | __u32 ac_btime; /* Begin time [sec since 1970] */ | ||
111 | __u64 ac_etime; /* Elapsed time [usec] */ | ||
112 | __u64 ac_utime; /* User CPU time [usec] */ | ||
113 | __u64 ac_stime; /* SYstem CPU time [usec] */ | ||
114 | __u64 ac_minflt; /* Minor Page Fault Count */ | ||
115 | __u64 ac_majflt; /* Major Page Fault Count */ | ||
116 | /* Basic Accounting Fields end */ | ||
117 | |||
118 | /* Extended accounting fields start */ | ||
119 | /* Accumulated RSS usage in duration of a task, in MBytes-usecs. | ||
120 | * The current rss usage is added to this counter every time | ||
121 | * a tick is charged to a task's system time. So, at the end we | ||
122 | * will have memory usage multiplied by system time. Thus an | ||
123 | * average usage per system time unit can be calculated. | ||
124 | */ | ||
125 | __u64 coremem; /* accumulated RSS usage in MB-usec */ | ||
126 | /* Accumulated virtual memory usage in duration of a task. | ||
127 | * Same as acct_rss_mem1 above except that we keep track of VM usage. | ||
128 | */ | ||
129 | __u64 virtmem; /* accumulated VM usage in MB-usec */ | ||
130 | |||
131 | /* High watermark of RSS and virtual memory usage in duration of | ||
132 | * a task, in KBytes. | ||
133 | */ | ||
134 | __u64 hiwater_rss; /* High-watermark of RSS usage, in KB */ | ||
135 | __u64 hiwater_vm; /* High-water VM usage, in KB */ | ||
136 | |||
137 | /* The following four fields are I/O statistics of a task. */ | ||
138 | __u64 read_char; /* bytes read */ | ||
139 | __u64 write_char; /* bytes written */ | ||
140 | __u64 read_syscalls; /* read syscalls */ | ||
141 | __u64 write_syscalls; /* write syscalls */ | ||
142 | /* Extended accounting fields end */ | ||
91 | }; | 143 | }; |
92 | 144 | ||
93 | 145 | ||
diff --git a/include/linux/timex.h b/include/linux/timex.h index d543d3871e38..049dfe4a11f2 100644 --- a/include/linux/timex.h +++ b/include/linux/timex.h | |||
@@ -69,34 +69,28 @@ | |||
69 | * zero to MAXTC, the PLL will converge in 15 minutes to 16 hours, | 69 | * zero to MAXTC, the PLL will converge in 15 minutes to 16 hours, |
70 | * respectively. | 70 | * respectively. |
71 | */ | 71 | */ |
72 | #define SHIFT_KG 6 /* phase factor (shift) */ | 72 | #define SHIFT_PLL 4 /* PLL frequency factor (shift) */ |
73 | #define SHIFT_KF 16 /* PLL frequency factor (shift) */ | 73 | #define SHIFT_FLL 2 /* FLL frequency factor (shift) */ |
74 | #define SHIFT_KH 2 /* FLL frequency factor (shift) */ | 74 | #define MAXTC 10 /* maximum time constant (shift) */ |
75 | #define MAXTC 6 /* maximum time constant (shift) */ | ||
76 | 75 | ||
77 | /* | 76 | /* |
78 | * The SHIFT_SCALE define establishes the decimal point of the time_phase | 77 | * The SHIFT_UPDATE define establishes the decimal point of the |
79 | * variable which serves as an extension to the low-order bits of the | 78 | * time_offset variable which represents the current offset with |
80 | * system clock variable. The SHIFT_UPDATE define establishes the decimal | 79 | * respect to standard time. |
81 | * point of the time_offset variable which represents the current offset | ||
82 | * with respect to standard time. The FINENSEC define represents 1 nsec in | ||
83 | * scaled units. | ||
84 | * | 80 | * |
85 | * SHIFT_USEC defines the scaling (shift) of the time_freq and | 81 | * SHIFT_USEC defines the scaling (shift) of the time_freq and |
86 | * time_tolerance variables, which represent the current frequency | 82 | * time_tolerance variables, which represent the current frequency |
87 | * offset and maximum frequency tolerance. | 83 | * offset and maximum frequency tolerance. |
88 | * | ||
89 | * FINENSEC is 1 ns in SHIFT_UPDATE units of the time_phase variable. | ||
90 | */ | 84 | */ |
91 | #define SHIFT_SCALE 22 /* phase scale (shift) */ | 85 | #define SHIFT_UPDATE (SHIFT_HZ + 1) /* time offset scale (shift) */ |
92 | #define SHIFT_UPDATE (SHIFT_KG + MAXTC) /* time offset scale (shift) */ | ||
93 | #define SHIFT_USEC 16 /* frequency offset scale (shift) */ | 86 | #define SHIFT_USEC 16 /* frequency offset scale (shift) */ |
94 | #define FINENSEC (1L << (SHIFT_SCALE - 10)) /* ~1 ns in phase units */ | 87 | #define SHIFT_NSEC 12 /* kernel frequency offset scale */ |
95 | 88 | ||
96 | #define MAXPHASE 512000L /* max phase error (us) */ | 89 | #define MAXPHASE 512000L /* max phase error (us) */ |
97 | #define MAXFREQ (512L << SHIFT_USEC) /* max frequency error (ppm) */ | 90 | #define MAXFREQ (512L << SHIFT_USEC) /* max frequency error (ppm) */ |
98 | #define MINSEC 16L /* min interval between updates (s) */ | 91 | #define MAXFREQ_NSEC (512000L << SHIFT_NSEC) /* max frequency error (ppb) */ |
99 | #define MAXSEC 1200L /* max interval between updates (s) */ | 92 | #define MINSEC 256 /* min interval between updates (s) */ |
93 | #define MAXSEC 2048 /* max interval between updates (s) */ | ||
100 | #define NTP_PHASE_LIMIT (MAXPHASE << 5) /* beyond max. dispersion */ | 94 | #define NTP_PHASE_LIMIT (MAXPHASE << 5) /* beyond max. dispersion */ |
101 | 95 | ||
102 | /* | 96 | /* |
@@ -204,33 +198,15 @@ extern int tickadj; /* amount of adjustment per tick */ | |||
204 | /* | 198 | /* |
205 | * phase-lock loop variables | 199 | * phase-lock loop variables |
206 | */ | 200 | */ |
207 | extern int time_state; /* clock status */ | ||
208 | extern int time_status; /* clock synchronization status bits */ | 201 | extern int time_status; /* clock synchronization status bits */ |
209 | extern long time_offset; /* time adjustment (us) */ | ||
210 | extern long time_constant; /* pll time constant */ | ||
211 | extern long time_tolerance; /* frequency tolerance (ppm) */ | ||
212 | extern long time_precision; /* clock precision (us) */ | ||
213 | extern long time_maxerror; /* maximum error */ | 202 | extern long time_maxerror; /* maximum error */ |
214 | extern long time_esterror; /* estimated error */ | 203 | extern long time_esterror; /* estimated error */ |
215 | 204 | ||
216 | extern long time_freq; /* frequency offset (scaled ppm) */ | 205 | extern long time_freq; /* frequency offset (scaled ppm) */ |
217 | extern long time_reftime; /* time at last adjustment (s) */ | ||
218 | 206 | ||
219 | extern long time_adjust; /* The amount of adjtime left */ | 207 | extern long time_adjust; /* The amount of adjtime left */ |
220 | extern long time_next_adjust; /* Value for time_adjust at next tick */ | ||
221 | 208 | ||
222 | /** | 209 | extern void ntp_clear(void); |
223 | * ntp_clear - Clears the NTP state variables | ||
224 | * | ||
225 | * Must be called while holding a write on the xtime_lock | ||
226 | */ | ||
227 | static inline void ntp_clear(void) | ||
228 | { | ||
229 | time_adjust = 0; /* stop active adjtime() */ | ||
230 | time_status |= STA_UNSYNC; | ||
231 | time_maxerror = NTP_PHASE_LIMIT; | ||
232 | time_esterror = NTP_PHASE_LIMIT; | ||
233 | } | ||
234 | 210 | ||
235 | /** | 211 | /** |
236 | * ntp_synced - Returns 1 if the NTP status is not UNSYNC | 212 | * ntp_synced - Returns 1 if the NTP status is not UNSYNC |
@@ -294,11 +270,15 @@ extern void register_time_interpolator(struct time_interpolator *); | |||
294 | extern void unregister_time_interpolator(struct time_interpolator *); | 270 | extern void unregister_time_interpolator(struct time_interpolator *); |
295 | extern void time_interpolator_reset(void); | 271 | extern void time_interpolator_reset(void); |
296 | extern unsigned long time_interpolator_get_offset(void); | 272 | extern unsigned long time_interpolator_get_offset(void); |
273 | extern void time_interpolator_update(long delta_nsec); | ||
297 | 274 | ||
298 | #else /* !CONFIG_TIME_INTERPOLATION */ | 275 | #else /* !CONFIG_TIME_INTERPOLATION */ |
299 | 276 | ||
300 | static inline void | 277 | static inline void time_interpolator_reset(void) |
301 | time_interpolator_reset(void) | 278 | { |
279 | } | ||
280 | |||
281 | static inline void time_interpolator_update(long delta_nsec) | ||
302 | { | 282 | { |
303 | } | 283 | } |
304 | 284 | ||
@@ -309,6 +289,8 @@ time_interpolator_reset(void) | |||
309 | /* Returns how long ticks are at present, in ns / 2^(SHIFT_SCALE-10). */ | 289 | /* Returns how long ticks are at present, in ns / 2^(SHIFT_SCALE-10). */ |
310 | extern u64 current_tick_length(void); | 290 | extern u64 current_tick_length(void); |
311 | 291 | ||
292 | extern void second_overflow(void); | ||
293 | extern void update_ntp_one_tick(void); | ||
312 | extern int do_adjtimex(struct timex *); | 294 | extern int do_adjtimex(struct timex *); |
313 | 295 | ||
314 | #endif /* KERNEL */ | 296 | #endif /* KERNEL */ |
diff --git a/include/linux/topology.h b/include/linux/topology.h index ec1eca85290a..da508d1998e4 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h | |||
@@ -89,6 +89,7 @@ | |||
89 | #define SD_SIBLING_INIT (struct sched_domain) { \ | 89 | #define SD_SIBLING_INIT (struct sched_domain) { \ |
90 | .span = CPU_MASK_NONE, \ | 90 | .span = CPU_MASK_NONE, \ |
91 | .parent = NULL, \ | 91 | .parent = NULL, \ |
92 | .child = NULL, \ | ||
92 | .groups = NULL, \ | 93 | .groups = NULL, \ |
93 | .min_interval = 1, \ | 94 | .min_interval = 1, \ |
94 | .max_interval = 2, \ | 95 | .max_interval = 2, \ |
@@ -114,11 +115,44 @@ | |||
114 | #endif | 115 | #endif |
115 | #endif /* CONFIG_SCHED_SMT */ | 116 | #endif /* CONFIG_SCHED_SMT */ |
116 | 117 | ||
118 | #ifdef CONFIG_SCHED_MC | ||
119 | /* Common values for MC siblings. for now mostly derived from SD_CPU_INIT */ | ||
120 | #ifndef SD_MC_INIT | ||
121 | #define SD_MC_INIT (struct sched_domain) { \ | ||
122 | .span = CPU_MASK_NONE, \ | ||
123 | .parent = NULL, \ | ||
124 | .child = NULL, \ | ||
125 | .groups = NULL, \ | ||
126 | .min_interval = 1, \ | ||
127 | .max_interval = 4, \ | ||
128 | .busy_factor = 64, \ | ||
129 | .imbalance_pct = 125, \ | ||
130 | .cache_nice_tries = 1, \ | ||
131 | .per_cpu_gain = 100, \ | ||
132 | .busy_idx = 2, \ | ||
133 | .idle_idx = 1, \ | ||
134 | .newidle_idx = 2, \ | ||
135 | .wake_idx = 1, \ | ||
136 | .forkexec_idx = 1, \ | ||
137 | .flags = SD_LOAD_BALANCE \ | ||
138 | | SD_BALANCE_NEWIDLE \ | ||
139 | | SD_BALANCE_EXEC \ | ||
140 | | SD_WAKE_AFFINE \ | ||
141 | | SD_SHARE_PKG_RESOURCES\ | ||
142 | | BALANCE_FOR_MC_POWER, \ | ||
143 | .last_balance = jiffies, \ | ||
144 | .balance_interval = 1, \ | ||
145 | .nr_balance_failed = 0, \ | ||
146 | } | ||
147 | #endif | ||
148 | #endif /* CONFIG_SCHED_MC */ | ||
149 | |||
117 | /* Common values for CPUs */ | 150 | /* Common values for CPUs */ |
118 | #ifndef SD_CPU_INIT | 151 | #ifndef SD_CPU_INIT |
119 | #define SD_CPU_INIT (struct sched_domain) { \ | 152 | #define SD_CPU_INIT (struct sched_domain) { \ |
120 | .span = CPU_MASK_NONE, \ | 153 | .span = CPU_MASK_NONE, \ |
121 | .parent = NULL, \ | 154 | .parent = NULL, \ |
155 | .child = NULL, \ | ||
122 | .groups = NULL, \ | 156 | .groups = NULL, \ |
123 | .min_interval = 1, \ | 157 | .min_interval = 1, \ |
124 | .max_interval = 4, \ | 158 | .max_interval = 4, \ |
@@ -135,7 +169,7 @@ | |||
135 | | SD_BALANCE_NEWIDLE \ | 169 | | SD_BALANCE_NEWIDLE \ |
136 | | SD_BALANCE_EXEC \ | 170 | | SD_BALANCE_EXEC \ |
137 | | SD_WAKE_AFFINE \ | 171 | | SD_WAKE_AFFINE \ |
138 | | BALANCE_FOR_POWER, \ | 172 | | BALANCE_FOR_PKG_POWER,\ |
139 | .last_balance = jiffies, \ | 173 | .last_balance = jiffies, \ |
140 | .balance_interval = 1, \ | 174 | .balance_interval = 1, \ |
141 | .nr_balance_failed = 0, \ | 175 | .nr_balance_failed = 0, \ |
@@ -146,6 +180,7 @@ | |||
146 | #define SD_ALLNODES_INIT (struct sched_domain) { \ | 180 | #define SD_ALLNODES_INIT (struct sched_domain) { \ |
147 | .span = CPU_MASK_NONE, \ | 181 | .span = CPU_MASK_NONE, \ |
148 | .parent = NULL, \ | 182 | .parent = NULL, \ |
183 | .child = NULL, \ | ||
149 | .groups = NULL, \ | 184 | .groups = NULL, \ |
150 | .min_interval = 64, \ | 185 | .min_interval = 64, \ |
151 | .max_interval = 64*num_online_cpus(), \ | 186 | .max_interval = 64*num_online_cpus(), \ |
@@ -165,15 +200,6 @@ | |||
165 | .nr_balance_failed = 0, \ | 200 | .nr_balance_failed = 0, \ |
166 | } | 201 | } |
167 | 202 | ||
168 | #ifdef CONFIG_SCHED_MC | ||
169 | #ifndef SD_MC_INIT | ||
170 | /* for now its same as SD_CPU_INIT. | ||
171 | * TBD: Tune Domain parameters! | ||
172 | */ | ||
173 | #define SD_MC_INIT SD_CPU_INIT | ||
174 | #endif | ||
175 | #endif | ||
176 | |||
177 | #ifdef CONFIG_NUMA | 203 | #ifdef CONFIG_NUMA |
178 | #ifndef SD_NODE_INIT | 204 | #ifndef SD_NODE_INIT |
179 | #error Please define an appropriate SD_NODE_INIT in include/asm/topology.h!!! | 205 | #error Please define an appropriate SD_NODE_INIT in include/asm/topology.h!!! |
diff --git a/include/linux/tsacct_kern.h b/include/linux/tsacct_kern.h new file mode 100644 index 000000000000..7e50ac795b0b --- /dev/null +++ b/include/linux/tsacct_kern.h | |||
@@ -0,0 +1,34 @@ | |||
1 | /* | ||
2 | * tsacct_kern.h - kernel header for system accounting over taskstats interface | ||
3 | * | ||
4 | * Copyright (C) Jay Lan SGI | ||
5 | */ | ||
6 | |||
7 | #ifndef _LINUX_TSACCT_KERN_H | ||
8 | #define _LINUX_TSACCT_KERN_H | ||
9 | |||
10 | #include <linux/taskstats.h> | ||
11 | |||
12 | #ifdef CONFIG_TASKSTATS | ||
13 | extern void bacct_add_tsk(struct taskstats *stats, struct task_struct *tsk); | ||
14 | #else | ||
15 | static inline void bacct_add_tsk(struct taskstats *stats, struct task_struct *tsk) | ||
16 | {} | ||
17 | #endif /* CONFIG_TASKSTATS */ | ||
18 | |||
19 | #ifdef CONFIG_TASK_XACCT | ||
20 | extern void xacct_add_tsk(struct taskstats *stats, struct task_struct *p); | ||
21 | extern void acct_update_integrals(struct task_struct *tsk); | ||
22 | extern void acct_clear_integrals(struct task_struct *tsk); | ||
23 | #else | ||
24 | static inline void xacct_add_tsk(struct taskstats *stats, struct task_struct *p) | ||
25 | {} | ||
26 | static inline void acct_update_integrals(struct task_struct *tsk) | ||
27 | {} | ||
28 | static inline void acct_clear_integrals(struct task_struct *tsk) | ||
29 | {} | ||
30 | #endif /* CONFIG_TASK_XACCT */ | ||
31 | |||
32 | #endif | ||
33 | |||
34 | |||
diff --git a/include/linux/tty.h b/include/linux/tty.h index ea4c2605f8da..44091c0db0b4 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -307,6 +307,9 @@ extern void tty_ldisc_put(int); | |||
307 | extern void tty_wakeup(struct tty_struct *tty); | 307 | extern void tty_wakeup(struct tty_struct *tty); |
308 | extern void tty_ldisc_flush(struct tty_struct *tty); | 308 | extern void tty_ldisc_flush(struct tty_struct *tty); |
309 | 309 | ||
310 | extern int tty_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | ||
311 | unsigned long arg); | ||
312 | |||
310 | extern struct mutex tty_mutex; | 313 | extern struct mutex tty_mutex; |
311 | 314 | ||
312 | /* n_tty.c */ | 315 | /* n_tty.c */ |
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/types.h b/include/linux/types.h index 3f235660a3cd..406d4ae57631 100644 --- a/include/linux/types.h +++ b/include/linux/types.h | |||
@@ -33,6 +33,8 @@ typedef __kernel_clockid_t clockid_t; | |||
33 | typedef __kernel_mqd_t mqd_t; | 33 | typedef __kernel_mqd_t mqd_t; |
34 | 34 | ||
35 | #ifdef __KERNEL__ | 35 | #ifdef __KERNEL__ |
36 | typedef _Bool bool; | ||
37 | |||
36 | typedef __kernel_uid32_t uid_t; | 38 | typedef __kernel_uid32_t uid_t; |
37 | typedef __kernel_gid32_t gid_t; | 39 | typedef __kernel_gid32_t gid_t; |
38 | typedef __kernel_uid16_t uid16_t; | 40 | typedef __kernel_uid16_t uid16_t; |
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/unwind.h b/include/linux/unwind.h index ce48e2cd37a2..73e1751d03dd 100644 --- a/include/linux/unwind.h +++ b/include/linux/unwind.h | |||
@@ -12,8 +12,6 @@ | |||
12 | * is not much point in implementing the full Dwarf2 unwind API. | 12 | * is not much point in implementing the full Dwarf2 unwind API. |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include <linux/config.h> | ||
16 | |||
17 | struct module; | 15 | struct module; |
18 | 16 | ||
19 | #ifdef CONFIG_STACK_UNWIND | 17 | #ifdef CONFIG_STACK_UNWIND |
diff --git a/include/linux/utime.h b/include/linux/utime.h index c6bf27b7897e..640be6a1959e 100644 --- a/include/linux/utime.h +++ b/include/linux/utime.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef _LINUX_UTIME_H | 1 | #ifndef _LINUX_UTIME_H |
2 | #define _LINUX_UTIME_H | 2 | #define _LINUX_UTIME_H |
3 | 3 | ||
4 | #include <linux/types.h> | ||
5 | |||
4 | struct utimbuf { | 6 | struct utimbuf { |
5 | time_t actime; | 7 | time_t actime; |
6 | time_t modtime; | 8 | time_t modtime; |
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/videodev2.h b/include/linux/videodev2.h index e3715d774197..44c59da26ed2 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -1135,7 +1135,8 @@ struct v4l2_sliced_vbi_cap | |||
1135 | (equals frame lines 313-336 for 625 line video | 1135 | (equals frame lines 313-336 for 625 line video |
1136 | standards, 263-286 for 525 line standards) */ | 1136 | standards, 263-286 for 525 line standards) */ |
1137 | __u16 service_lines[2][24]; | 1137 | __u16 service_lines[2][24]; |
1138 | __u32 reserved[4]; /* must be 0 */ | 1138 | enum v4l2_buf_type type; |
1139 | __u32 reserved[3]; /* must be 0 */ | ||
1139 | }; | 1140 | }; |
1140 | 1141 | ||
1141 | struct v4l2_sliced_vbi_data | 1142 | struct v4l2_sliced_vbi_data |
@@ -1242,7 +1243,7 @@ struct v4l2_streamparm | |||
1242 | #define VIDIOC_G_PRIORITY _IOR ('V', 67, enum v4l2_priority) | 1243 | #define VIDIOC_G_PRIORITY _IOR ('V', 67, enum v4l2_priority) |
1243 | #define VIDIOC_S_PRIORITY _IOW ('V', 68, enum v4l2_priority) | 1244 | #define VIDIOC_S_PRIORITY _IOW ('V', 68, enum v4l2_priority) |
1244 | #if 1 | 1245 | #if 1 |
1245 | #define VIDIOC_G_SLICED_VBI_CAP _IOR ('V', 69, struct v4l2_sliced_vbi_cap) | 1246 | #define VIDIOC_G_SLICED_VBI_CAP _IOWR ('V', 69, struct v4l2_sliced_vbi_cap) |
1246 | #endif | 1247 | #endif |
1247 | #define VIDIOC_LOG_STATUS _IO ('V', 70) | 1248 | #define VIDIOC_LOG_STATUS _IO ('V', 70) |
1248 | #define VIDIOC_G_EXT_CTRLS _IOWR ('V', 71, struct v4l2_ext_controls) | 1249 | #define VIDIOC_G_EXT_CTRLS _IOWR ('V', 71, struct v4l2_ext_controls) |
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 */ |
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index 9d4074ecd0cd..4f4d98addb44 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
@@ -111,6 +111,8 @@ balance_dirty_pages_ratelimited(struct address_space *mapping) | |||
111 | } | 111 | } |
112 | 112 | ||
113 | int pdflush_operation(void (*fn)(unsigned long), unsigned long arg0); | 113 | int pdflush_operation(void (*fn)(unsigned long), unsigned long arg0); |
114 | extern int generic_writepages(struct address_space *mapping, | ||
115 | struct writeback_control *wbc); | ||
114 | int do_writepages(struct address_space *mapping, struct writeback_control *wbc); | 116 | int do_writepages(struct address_space *mapping, struct writeback_control *wbc); |
115 | int sync_page_range(struct inode *inode, struct address_space *mapping, | 117 | int sync_page_range(struct inode *inode, struct address_space *mapping, |
116 | loff_t pos, loff_t count); | 118 | loff_t pos, loff_t count); |
diff --git a/include/media/ir-common.h b/include/media/ir-common.h index 7bab09b0ed45..8f58406533c6 100644 --- a/include/media/ir-common.h +++ b/include/media/ir-common.h | |||
@@ -90,6 +90,8 @@ extern IR_KEYTAB_TYPE ir_codes_winfast[IR_KEYTAB_SIZE]; | |||
90 | extern IR_KEYTAB_TYPE ir_codes_pinnacle_color[IR_KEYTAB_SIZE]; | 90 | extern IR_KEYTAB_TYPE ir_codes_pinnacle_color[IR_KEYTAB_SIZE]; |
91 | extern IR_KEYTAB_TYPE ir_codes_hauppauge_new[IR_KEYTAB_SIZE]; | 91 | extern IR_KEYTAB_TYPE ir_codes_hauppauge_new[IR_KEYTAB_SIZE]; |
92 | extern IR_KEYTAB_TYPE ir_codes_npgtech[IR_KEYTAB_SIZE]; | 92 | extern IR_KEYTAB_TYPE ir_codes_npgtech[IR_KEYTAB_SIZE]; |
93 | extern IR_KEYTAB_TYPE ir_codes_norwood[IR_KEYTAB_SIZE]; | ||
94 | extern IR_KEYTAB_TYPE ir_codes_proteus_2309[IR_KEYTAB_SIZE]; | ||
93 | 95 | ||
94 | #endif | 96 | #endif |
95 | 97 | ||
diff --git a/include/media/tuner-types.h b/include/media/tuner-types.h index 3c43b95f4c0d..37dad07a8439 100644 --- a/include/media/tuner-types.h +++ b/include/media/tuner-types.h | |||
@@ -72,6 +72,9 @@ struct tuner_params { | |||
72 | unsigned int port2_invert_for_secam_lc:1; | 72 | unsigned int port2_invert_for_secam_lc:1; |
73 | /* Some cards require PORT1 to be 1 for mono Radio FM and 0 for stereo. */ | 73 | /* Some cards require PORT1 to be 1 for mono Radio FM and 0 for stereo. */ |
74 | unsigned int port1_set_for_fm_mono:1; | 74 | unsigned int port1_set_for_fm_mono:1; |
75 | /* Select 18% (or according to datasheet 0%) L standard PLL gating, | ||
76 | vs the driver default of 36%. */ | ||
77 | unsigned int default_pll_gating_18:1; | ||
75 | /* Default tda9887 TOP value in dB for the low band. Default is 0. | 78 | /* Default tda9887 TOP value in dB for the low band. Default is 0. |
76 | Range: -16:+15 */ | 79 | Range: -16:+15 */ |
77 | signed int default_top_low:5; | 80 | signed int default_top_low:5; |
diff --git a/include/media/tuner.h b/include/media/tuner.h index 2f7b00b08e88..3116e750132f 100644 --- a/include/media/tuner.h +++ b/include/media/tuner.h | |||
@@ -144,6 +144,7 @@ extern int tuner_debug; | |||
144 | #define TDA9887_DEEMPHASIS_50 (2<<16) | 144 | #define TDA9887_DEEMPHASIS_50 (2<<16) |
145 | #define TDA9887_DEEMPHASIS_75 (3<<16) | 145 | #define TDA9887_DEEMPHASIS_75 (3<<16) |
146 | #define TDA9887_AUTOMUTE (1<<18) | 146 | #define TDA9887_AUTOMUTE (1<<18) |
147 | #define TDA9887_GATING_18 (1<<19) | ||
147 | 148 | ||
148 | #ifdef __KERNEL__ | 149 | #ifdef __KERNEL__ |
149 | 150 | ||
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h index 5564db13c0d5..aecc946980a3 100644 --- a/include/media/v4l2-common.h +++ b/include/media/v4l2-common.h | |||
@@ -121,10 +121,17 @@ enum v4l2_chip_ident { | |||
121 | /* general idents: reserved range 0-49 */ | 121 | /* general idents: reserved range 0-49 */ |
122 | V4L2_IDENT_UNKNOWN = 0, | 122 | V4L2_IDENT_UNKNOWN = 0, |
123 | 123 | ||
124 | /* module saa7115: reserved range 100-149 */ | 124 | /* module saa7110: just ident= 100 */ |
125 | V4L2_IDENT_SAA7110 = 100, | ||
126 | |||
127 | /* module saa7111: just ident= 101 */ | ||
128 | V4L2_IDENT_SAA7111 = 101, | ||
129 | |||
130 | /* module saa7115: reserved range 102-149 */ | ||
125 | V4L2_IDENT_SAA7113 = 103, | 131 | V4L2_IDENT_SAA7113 = 103, |
126 | V4L2_IDENT_SAA7114 = 104, | 132 | V4L2_IDENT_SAA7114 = 104, |
127 | V4L2_IDENT_SAA7115 = 105, | 133 | V4L2_IDENT_SAA7115 = 105, |
134 | V4L2_IDENT_SAA7118 = 108, | ||
128 | 135 | ||
129 | /* module saa7127: reserved range 150-199 */ | 136 | /* module saa7127: reserved range 150-199 */ |
130 | V4L2_IDENT_SAA7127 = 157, | 137 | V4L2_IDENT_SAA7127 = 157, |
@@ -166,11 +173,12 @@ enum v4l2_chip_ident { | |||
166 | #define VIDIOC_INT_S_STANDBY _IOW('d', 94, u32) | 173 | #define VIDIOC_INT_S_STANDBY _IOW('d', 94, u32) |
167 | 174 | ||
168 | /* only implemented if CONFIG_VIDEO_ADV_DEBUG is defined */ | 175 | /* only implemented if CONFIG_VIDEO_ADV_DEBUG is defined */ |
169 | #define VIDIOC_INT_S_REGISTER _IOR ('d', 100, struct v4l2_register) | 176 | #define VIDIOC_INT_S_REGISTER _IOW ('d', 100, struct v4l2_register) |
170 | #define VIDIOC_INT_G_REGISTER _IOWR('d', 101, struct v4l2_register) | 177 | #define VIDIOC_INT_G_REGISTER _IOWR('d', 101, struct v4l2_register) |
171 | 178 | ||
172 | /* Reset the I2C chip */ | 179 | /* Generic reset command. The argument selects which subsystems to reset. |
173 | #define VIDIOC_INT_RESET _IO ('d', 102) | 180 | Passing 0 will always reset the whole chip. */ |
181 | #define VIDIOC_INT_RESET _IOW ('d', 102, u32) | ||
174 | 182 | ||
175 | /* Set the frequency (in Hz) of the audio clock output. | 183 | /* Set the frequency (in Hz) of the audio clock output. |
176 | Used to slave an audio processor to the video decoder, ensuring that audio | 184 | Used to slave an audio processor to the video decoder, ensuring that audio |
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h index bb495b7f4680..6a11d772700f 100644 --- a/include/media/v4l2-dev.h +++ b/include/media/v4l2-dev.h | |||
@@ -9,7 +9,8 @@ | |||
9 | #ifndef _V4L2_DEV_H | 9 | #ifndef _V4L2_DEV_H |
10 | #define _V4L2_DEV_H | 10 | #define _V4L2_DEV_H |
11 | 11 | ||
12 | #define OBSOLETE_OWNER 1 /* to be removed soon */ | 12 | #define OBSOLETE_OWNER 1 /* to be removed soon */ |
13 | #define OBSOLETE_DEVDATA 1 /* to be removed soon */ | ||
13 | 14 | ||
14 | #include <linux/poll.h> | 15 | #include <linux/poll.h> |
15 | #include <linux/fs.h> | 16 | #include <linux/fs.h> |
@@ -338,8 +339,6 @@ extern int video_usercopy(struct inode *inode, struct file *file, | |||
338 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | 339 | #ifdef CONFIG_VIDEO_V4L1_COMPAT |
339 | #include <linux/mm.h> | 340 | #include <linux/mm.h> |
340 | 341 | ||
341 | extern struct video_device* video_devdata(struct file*); | ||
342 | |||
343 | #define to_video_device(cd) container_of(cd, struct video_device, class_dev) | 342 | #define to_video_device(cd) container_of(cd, struct video_device, class_dev) |
344 | static inline int __must_check | 343 | static inline int __must_check |
345 | video_device_create_file(struct video_device *vfd, | 344 | video_device_create_file(struct video_device *vfd, |
@@ -370,9 +369,14 @@ static inline void video_set_drvdata(struct video_device *dev, void *data) | |||
370 | { | 369 | { |
371 | dev->priv = data; | 370 | dev->priv = data; |
372 | } | 371 | } |
372 | |||
373 | #endif | 373 | #endif |
374 | 374 | ||
375 | #ifdef OBSOLETE_DEVDATA /* to be removed soon */ | ||
376 | /* Obsolete stuff - Still needed for radio devices and obsolete drivers */ | ||
377 | extern struct video_device* video_devdata(struct file*); | ||
375 | extern int video_exclusive_open(struct inode *inode, struct file *file); | 378 | extern int video_exclusive_open(struct inode *inode, struct file *file); |
376 | extern int video_exclusive_release(struct inode *inode, struct file *file); | 379 | extern int video_exclusive_release(struct inode *inode, struct file *file); |
380 | #endif | ||
377 | 381 | ||
378 | #endif /* _V4L2_DEV_H */ | 382 | #endif /* _V4L2_DEV_H */ |
diff --git a/include/mtd/Kbuild b/include/mtd/Kbuild index 13e7a3c6d794..e0fe92b03a4e 100644 --- a/include/mtd/Kbuild +++ b/include/mtd/Kbuild | |||
@@ -1,6 +1,5 @@ | |||
1 | header-y += inftl-user.h | 1 | header-y += inftl-user.h |
2 | header-y += jffs2-user.h | 2 | header-y += jffs2-user.h |
3 | header-y += mtd-abi.h | ||
3 | header-y += mtd-user.h | 4 | header-y += mtd-user.h |
4 | header-y += nftl-user.h | 5 | header-y += nftl-user.h |
5 | |||
6 | unifdef-y += mtd-abi.h | ||
diff --git a/include/mtd/mtd-abi.h b/include/mtd/mtd-abi.h index b0a67b7ffdcd..f913c30d7b89 100644 --- a/include/mtd/mtd-abi.h +++ b/include/mtd/mtd-abi.h | |||
@@ -7,12 +7,6 @@ | |||
7 | #ifndef __MTD_ABI_H__ | 7 | #ifndef __MTD_ABI_H__ |
8 | #define __MTD_ABI_H__ | 8 | #define __MTD_ABI_H__ |
9 | 9 | ||
10 | #ifndef __KERNEL__ | ||
11 | /* Urgh. The whole point of splitting this out into | ||
12 | separate files was to avoid #ifdef __KERNEL__ */ | ||
13 | #define __user | ||
14 | #endif | ||
15 | |||
16 | struct erase_info_user { | 10 | struct erase_info_user { |
17 | uint32_t start; | 11 | uint32_t start; |
18 | uint32_t length; | 12 | uint32_t length; |
diff --git a/include/net/genetlink.h b/include/net/genetlink.h index 4a38d85e4e25..b619314218a6 100644 --- a/include/net/genetlink.h +++ b/include/net/genetlink.h | |||
@@ -169,4 +169,22 @@ static inline int genlmsg_len(const struct genlmsghdr *gnlh) | |||
169 | return (nlh->nlmsg_len - GENL_HDRLEN - NLMSG_HDRLEN); | 169 | return (nlh->nlmsg_len - GENL_HDRLEN - NLMSG_HDRLEN); |
170 | } | 170 | } |
171 | 171 | ||
172 | /** | ||
173 | * genlmsg_msg_size - length of genetlink message not including padding | ||
174 | * @payload: length of message payload | ||
175 | */ | ||
176 | static inline int genlmsg_msg_size(int payload) | ||
177 | { | ||
178 | return GENL_HDRLEN + payload; | ||
179 | } | ||
180 | |||
181 | /** | ||
182 | * genlmsg_total_size - length of genetlink message including padding | ||
183 | * @payload: length of message payload | ||
184 | */ | ||
185 | static inline int genlmsg_total_size(int payload) | ||
186 | { | ||
187 | return NLMSG_ALIGN(genlmsg_msg_size(payload)); | ||
188 | } | ||
189 | |||
172 | #endif /* __NET_GENERIC_NETLINK_H */ | 190 | #endif /* __NET_GENERIC_NETLINK_H */ |
diff --git a/include/net/sock.h b/include/net/sock.h index edd4d73ce7f5..40bb90ebb2d1 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -665,7 +665,6 @@ struct sock_iocb { | |||
665 | struct sock *sk; | 665 | struct sock *sk; |
666 | struct scm_cookie *scm; | 666 | struct scm_cookie *scm; |
667 | struct msghdr *msg, async_msg; | 667 | struct msghdr *msg, async_msg; |
668 | struct iovec async_iov; | ||
669 | struct kiocb *kiocb; | 668 | struct kiocb *kiocb; |
670 | }; | 669 | }; |
671 | 670 | ||
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 895d212864cd..b401c82036be 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
@@ -298,9 +298,9 @@ extern int scsi_execute_async(struct scsi_device *sdev, | |||
298 | void (*done)(void *, char *, int, int), | 298 | void (*done)(void *, char *, int, int), |
299 | gfp_t gfp); | 299 | gfp_t gfp); |
300 | 300 | ||
301 | static inline void scsi_device_reprobe(struct scsi_device *sdev) | 301 | static inline int __must_check scsi_device_reprobe(struct scsi_device *sdev) |
302 | { | 302 | { |
303 | device_reprobe(&sdev->sdev_gendev); | 303 | return device_reprobe(&sdev->sdev_gendev); |
304 | } | 304 | } |
305 | 305 | ||
306 | static inline unsigned int sdev_channel(struct scsi_device *sdev) | 306 | static inline unsigned int sdev_channel(struct scsi_device *sdev) |
diff --git a/include/scsi/scsi_tcq.h b/include/scsi/scsi_tcq.h index d04d05adfa9b..c247a28259bc 100644 --- a/include/scsi/scsi_tcq.h +++ b/include/scsi/scsi_tcq.h | |||
@@ -6,7 +6,6 @@ | |||
6 | #include <scsi/scsi_device.h> | 6 | #include <scsi/scsi_device.h> |
7 | #include <scsi/scsi_host.h> | 7 | #include <scsi/scsi_host.h> |
8 | 8 | ||
9 | |||
10 | #define MSG_SIMPLE_TAG 0x20 | 9 | #define MSG_SIMPLE_TAG 0x20 |
11 | #define MSG_HEAD_TAG 0x21 | 10 | #define MSG_HEAD_TAG 0x21 |
12 | #define MSG_ORDERED_TAG 0x22 | 11 | #define MSG_ORDERED_TAG 0x22 |
@@ -14,6 +13,7 @@ | |||
14 | #define SCSI_NO_TAG (-1) /* identify no tag in use */ | 13 | #define SCSI_NO_TAG (-1) /* identify no tag in use */ |
15 | 14 | ||
16 | 15 | ||
16 | #ifdef CONFIG_BLOCK | ||
17 | 17 | ||
18 | /** | 18 | /** |
19 | * scsi_get_tag_type - get the type of tag the device supports | 19 | * scsi_get_tag_type - get the type of tag the device supports |
@@ -100,7 +100,7 @@ static inline int scsi_populate_tag_msg(struct scsi_cmnd *cmd, char *msg) | |||
100 | struct scsi_device *sdev = cmd->device; | 100 | struct scsi_device *sdev = cmd->device; |
101 | 101 | ||
102 | if (blk_rq_tagged(req)) { | 102 | if (blk_rq_tagged(req)) { |
103 | if (sdev->ordered_tags && req->flags & REQ_HARDBARRIER) | 103 | if (sdev->ordered_tags && req->cmd_flags & REQ_HARDBARRIER) |
104 | *msg++ = MSG_ORDERED_TAG; | 104 | *msg++ = MSG_ORDERED_TAG; |
105 | else | 105 | else |
106 | *msg++ = MSG_SIMPLE_TAG; | 106 | *msg++ = MSG_SIMPLE_TAG; |
@@ -144,4 +144,5 @@ static inline int scsi_init_shared_tag_map(struct Scsi_Host *shost, int depth) | |||
144 | return shost->bqt ? 0 : -ENOMEM; | 144 | return shost->bqt ? 0 : -ENOMEM; |
145 | } | 145 | } |
146 | 146 | ||
147 | #endif /* CONFIG_BLOCK */ | ||
147 | #endif /* _SCSI_SCSI_TCQ_H */ | 148 | #endif /* _SCSI_SCSI_TCQ_H */ |
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 60d40b34efc0..afaf3e88e086 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
@@ -347,6 +347,7 @@ struct snd_pcm_substream { | |||
347 | int number; | 347 | int number; |
348 | char name[32]; /* substream name */ | 348 | char name[32]; /* substream name */ |
349 | int stream; /* stream (direction) */ | 349 | int stream; /* stream (direction) */ |
350 | char latency_id[20]; /* latency identifier */ | ||
350 | size_t buffer_bytes_max; /* limit ring buffer size */ | 351 | size_t buffer_bytes_max; /* limit ring buffer size */ |
351 | struct snd_dma_buffer dma_buffer; | 352 | struct snd_dma_buffer dma_buffer; |
352 | unsigned int dma_buf_id; | 353 | unsigned int dma_buf_id; |
diff --git a/include/video/sstfb.h b/include/video/sstfb.h index 3570f9c9b111..5dbf5e7e50a8 100644 --- a/include/video/sstfb.h +++ b/include/video/sstfb.h | |||
@@ -68,10 +68,6 @@ | |||
68 | # define print_var(X,Y...) | 68 | # define print_var(X,Y...) |
69 | #endif | 69 | #endif |
70 | 70 | ||
71 | #define eprintk(X...) printk(KERN_ERR "sstfb: " X) | ||
72 | #define iprintk(X...) printk(KERN_INFO "sstfb: " X) | ||
73 | #define wprintk(X...) printk(KERN_WARNING "sstfb: " X) | ||
74 | |||
75 | #define BIT(x) (1ul<<(x)) | 71 | #define BIT(x) (1ul<<(x)) |
76 | #define POW2(x) (1ul<<(x)) | 72 | #define POW2(x) (1ul<<(x)) |
77 | 73 | ||