diff options
Diffstat (limited to 'include')
273 files changed, 2285 insertions, 2366 deletions
diff --git a/include/asm-alpha/mmu_context.h b/include/asm-alpha/mmu_context.h index a714d0cdc204..6f92482cc96c 100644 --- a/include/asm-alpha/mmu_context.h +++ b/include/asm-alpha/mmu_context.h | |||
@@ -156,7 +156,7 @@ ev5_switch_mm(struct mm_struct *prev_mm, struct mm_struct *next_mm, | |||
156 | /* Always update the PCB ASN. Another thread may have allocated | 156 | /* Always update the PCB ASN. Another thread may have allocated |
157 | a new mm->context (via flush_tlb_mm) without the ASN serial | 157 | a new mm->context (via flush_tlb_mm) without the ASN serial |
158 | number wrapping. We have no way to detect when this is needed. */ | 158 | number wrapping. We have no way to detect when this is needed. */ |
159 | next->thread_info->pcb.asn = mmc & HARDWARE_ASN_MASK; | 159 | task_thread_info(next)->pcb.asn = mmc & HARDWARE_ASN_MASK; |
160 | } | 160 | } |
161 | 161 | ||
162 | __EXTERN_INLINE void | 162 | __EXTERN_INLINE void |
@@ -235,7 +235,7 @@ init_new_context(struct task_struct *tsk, struct mm_struct *mm) | |||
235 | if (cpu_online(i)) | 235 | if (cpu_online(i)) |
236 | mm->context[i] = 0; | 236 | mm->context[i] = 0; |
237 | if (tsk != current) | 237 | if (tsk != current) |
238 | tsk->thread_info->pcb.ptbr | 238 | task_thread_info(tsk)->pcb.ptbr |
239 | = ((unsigned long)mm->pgd - IDENT_ADDR) >> PAGE_SHIFT; | 239 | = ((unsigned long)mm->pgd - IDENT_ADDR) >> PAGE_SHIFT; |
240 | return 0; | 240 | return 0; |
241 | } | 241 | } |
@@ -249,7 +249,7 @@ destroy_context(struct mm_struct *mm) | |||
249 | static inline void | 249 | static inline void |
250 | enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) | 250 | enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) |
251 | { | 251 | { |
252 | tsk->thread_info->pcb.ptbr | 252 | task_thread_info(tsk)->pcb.ptbr |
253 | = ((unsigned long)mm->pgd - IDENT_ADDR) >> PAGE_SHIFT; | 253 | = ((unsigned long)mm->pgd - IDENT_ADDR) >> PAGE_SHIFT; |
254 | } | 254 | } |
255 | 255 | ||
diff --git a/include/asm-alpha/processor.h b/include/asm-alpha/processor.h index bb1a7a3abb8b..425b7b6d28cb 100644 --- a/include/asm-alpha/processor.h +++ b/include/asm-alpha/processor.h | |||
@@ -52,19 +52,10 @@ extern long kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); | |||
52 | 52 | ||
53 | unsigned long get_wchan(struct task_struct *p); | 53 | unsigned long get_wchan(struct task_struct *p); |
54 | 54 | ||
55 | /* See arch/alpha/kernel/ptrace.c for details. */ | 55 | #define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc) |
56 | #define PT_REG(reg) \ | ||
57 | (PAGE_SIZE*2 - sizeof(struct pt_regs) + offsetof(struct pt_regs, reg)) | ||
58 | |||
59 | #define SW_REG(reg) \ | ||
60 | (PAGE_SIZE*2 - sizeof(struct pt_regs) - sizeof(struct switch_stack) \ | ||
61 | + offsetof(struct switch_stack, reg)) | ||
62 | |||
63 | #define KSTK_EIP(tsk) \ | ||
64 | (*(unsigned long *)(PT_REG(pc) + (unsigned long) ((tsk)->thread_info))) | ||
65 | 56 | ||
66 | #define KSTK_ESP(tsk) \ | 57 | #define KSTK_ESP(tsk) \ |
67 | ((tsk) == current ? rdusp() : (tsk)->thread_info->pcb.usp) | 58 | ((tsk) == current ? rdusp() : task_thread_info(tsk)->pcb.usp) |
68 | 59 | ||
69 | #define cpu_relax() barrier() | 60 | #define cpu_relax() barrier() |
70 | 61 | ||
diff --git a/include/asm-alpha/ptrace.h b/include/asm-alpha/ptrace.h index 072375c135b4..9933b8b3612e 100644 --- a/include/asm-alpha/ptrace.h +++ b/include/asm-alpha/ptrace.h | |||
@@ -75,10 +75,10 @@ struct switch_stack { | |||
75 | #define profile_pc(regs) instruction_pointer(regs) | 75 | #define profile_pc(regs) instruction_pointer(regs) |
76 | extern void show_regs(struct pt_regs *); | 76 | extern void show_regs(struct pt_regs *); |
77 | 77 | ||
78 | #define alpha_task_regs(task) \ | 78 | #define task_pt_regs(task) \ |
79 | ((struct pt_regs *) ((long) (task)->thread_info + 2*PAGE_SIZE) - 1) | 79 | ((struct pt_regs *) (task_stack_page(task) + 2*PAGE_SIZE) - 1) |
80 | 80 | ||
81 | #define force_successful_syscall_return() (alpha_task_regs(current)->r0 = 0) | 81 | #define force_successful_syscall_return() (task_pt_regs(current)->r0 = 0) |
82 | 82 | ||
83 | #endif | 83 | #endif |
84 | 84 | ||
diff --git a/include/asm-alpha/system.h b/include/asm-alpha/system.h index 050e86d12891..cc9c7e8cced5 100644 --- a/include/asm-alpha/system.h +++ b/include/asm-alpha/system.h | |||
@@ -131,15 +131,25 @@ struct el_common_EV6_mcheck { | |||
131 | extern void halt(void) __attribute__((noreturn)); | 131 | extern void halt(void) __attribute__((noreturn)); |
132 | #define __halt() __asm__ __volatile__ ("call_pal %0 #halt" : : "i" (PAL_halt)) | 132 | #define __halt() __asm__ __volatile__ ("call_pal %0 #halt" : : "i" (PAL_halt)) |
133 | 133 | ||
134 | #define switch_to(P,N,L) \ | 134 | #define switch_to(P,N,L) \ |
135 | do { \ | 135 | do { \ |
136 | (L) = alpha_switch_to(virt_to_phys(&(N)->thread_info->pcb), (P)); \ | 136 | (L) = alpha_switch_to(virt_to_phys(&task_thread_info(N)->pcb), (P)); \ |
137 | check_mmu_context(); \ | 137 | check_mmu_context(); \ |
138 | } while (0) | 138 | } while (0) |
139 | 139 | ||
140 | struct task_struct; | 140 | struct task_struct; |
141 | extern struct task_struct *alpha_switch_to(unsigned long, struct task_struct*); | 141 | extern struct task_struct *alpha_switch_to(unsigned long, struct task_struct*); |
142 | 142 | ||
143 | /* | ||
144 | * On SMP systems, when the scheduler does migration-cost autodetection, | ||
145 | * it needs a way to flush as much of the CPU's caches as possible. | ||
146 | * | ||
147 | * TODO: fill this in! | ||
148 | */ | ||
149 | static inline void sched_cacheflush(void) | ||
150 | { | ||
151 | } | ||
152 | |||
143 | #define imb() \ | 153 | #define imb() \ |
144 | __asm__ __volatile__ ("call_pal %0 #imb" : : "i" (PAL_imb) : "memory") | 154 | __asm__ __volatile__ ("call_pal %0 #imb" : : "i" (PAL_imb) : "memory") |
145 | 155 | ||
diff --git a/include/asm-alpha/thread_info.h b/include/asm-alpha/thread_info.h index d51491ed00b8..69ffd93f8e22 100644 --- a/include/asm-alpha/thread_info.h +++ b/include/asm-alpha/thread_info.h | |||
@@ -54,8 +54,6 @@ register struct thread_info *__current_thread_info __asm__("$8"); | |||
54 | #define alloc_thread_info(tsk) \ | 54 | #define alloc_thread_info(tsk) \ |
55 | ((struct thread_info *) __get_free_pages(GFP_KERNEL,1)) | 55 | ((struct thread_info *) __get_free_pages(GFP_KERNEL,1)) |
56 | #define free_thread_info(ti) free_pages((unsigned long) (ti), 1) | 56 | #define free_thread_info(ti) free_pages((unsigned long) (ti), 1) |
57 | #define get_thread_info(ti) get_task_struct((ti)->task) | ||
58 | #define put_thread_info(ti) put_task_struct((ti)->task) | ||
59 | 57 | ||
60 | #endif /* __ASSEMBLY__ */ | 58 | #endif /* __ASSEMBLY__ */ |
61 | 59 | ||
diff --git a/include/asm-arm/ioctl.h b/include/asm-arm/ioctl.h index 2cbb7d0e9dc6..b279fe06dfe5 100644 --- a/include/asm-arm/ioctl.h +++ b/include/asm-arm/ioctl.h | |||
@@ -1,74 +1 @@ | |||
1 | /* | #include <asm-generic/ioctl.h> | |
2 | * linux/ioctl.h for Linux by H.H. Bergman. | ||
3 | */ | ||
4 | |||
5 | #ifndef _ASMARM_IOCTL_H | ||
6 | #define _ASMARM_IOCTL_H | ||
7 | |||
8 | /* ioctl command encoding: 32 bits total, command in lower 16 bits, | ||
9 | * size of the parameter structure in the lower 14 bits of the | ||
10 | * upper 16 bits. | ||
11 | * Encoding the size of the parameter structure in the ioctl request | ||
12 | * is useful for catching programs compiled with old versions | ||
13 | * and to avoid overwriting user space outside the user buffer area. | ||
14 | * The highest 2 bits are reserved for indicating the ``access mode''. | ||
15 | * NOTE: This limits the max parameter size to 16kB -1 ! | ||
16 | */ | ||
17 | |||
18 | /* | ||
19 | * The following is for compatibility across the various Linux | ||
20 | * platforms. The i386 ioctl numbering scheme doesn't really enforce | ||
21 | * a type field. De facto, however, the top 8 bits of the lower 16 | ||
22 | * bits are indeed used as a type field, so we might just as well make | ||
23 | * this explicit here. Please be sure to use the decoding macros | ||
24 | * below from now on. | ||
25 | */ | ||
26 | #define _IOC_NRBITS 8 | ||
27 | #define _IOC_TYPEBITS 8 | ||
28 | #define _IOC_SIZEBITS 14 | ||
29 | #define _IOC_DIRBITS 2 | ||
30 | |||
31 | #define _IOC_NRMASK ((1 << _IOC_NRBITS)-1) | ||
32 | #define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1) | ||
33 | #define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1) | ||
34 | #define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1) | ||
35 | |||
36 | #define _IOC_NRSHIFT 0 | ||
37 | #define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS) | ||
38 | #define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS) | ||
39 | #define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS) | ||
40 | |||
41 | /* | ||
42 | * Direction bits. | ||
43 | */ | ||
44 | #define _IOC_NONE 0U | ||
45 | #define _IOC_WRITE 1U | ||
46 | #define _IOC_READ 2U | ||
47 | |||
48 | #define _IOC(dir,type,nr,size) \ | ||
49 | (((dir) << _IOC_DIRSHIFT) | \ | ||
50 | ((type) << _IOC_TYPESHIFT) | \ | ||
51 | ((nr) << _IOC_NRSHIFT) | \ | ||
52 | ((size) << _IOC_SIZESHIFT)) | ||
53 | |||
54 | /* used to create numbers */ | ||
55 | #define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0) | ||
56 | #define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size)) | ||
57 | #define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size)) | ||
58 | #define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size)) | ||
59 | |||
60 | /* used to decode ioctl numbers.. */ | ||
61 | #define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) | ||
62 | #define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK) | ||
63 | #define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK) | ||
64 | #define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK) | ||
65 | |||
66 | /* ...and for the drivers/sound files... */ | ||
67 | |||
68 | #define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT) | ||
69 | #define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT) | ||
70 | #define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT) | ||
71 | #define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT) | ||
72 | #define IOCSIZE_SHIFT (_IOC_SIZESHIFT) | ||
73 | |||
74 | #endif /* _ASMARM_IOCTL_H */ | ||
diff --git a/include/asm-arm/processor.h b/include/asm-arm/processor.h index 7d4118e09054..31290694648b 100644 --- a/include/asm-arm/processor.h +++ b/include/asm-arm/processor.h | |||
@@ -85,9 +85,11 @@ unsigned long get_wchan(struct task_struct *p); | |||
85 | */ | 85 | */ |
86 | extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); | 86 | extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); |
87 | 87 | ||
88 | #define KSTK_REGS(tsk) (((struct pt_regs *)(THREAD_START_SP + (unsigned long)(tsk)->thread_info)) - 1) | 88 | #define task_pt_regs(p) \ |
89 | #define KSTK_EIP(tsk) KSTK_REGS(tsk)->ARM_pc | 89 | ((struct pt_regs *)(THREAD_START_SP + task_stack_page(p)) - 1) |
90 | #define KSTK_ESP(tsk) KSTK_REGS(tsk)->ARM_sp | 90 | |
91 | #define KSTK_EIP(tsk) task_pt_regs(tsk)->ARM_pc | ||
92 | #define KSTK_ESP(tsk) task_pt_regs(tsk)->ARM_sp | ||
91 | 93 | ||
92 | /* | 94 | /* |
93 | * Prefetching support - only ARMv5. | 95 | * Prefetching support - only ARMv5. |
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h index 5621d61ebc07..eb2de8c10515 100644 --- a/include/asm-arm/system.h +++ b/include/asm-arm/system.h | |||
@@ -168,10 +168,20 @@ extern struct task_struct *__switch_to(struct task_struct *, struct thread_info | |||
168 | 168 | ||
169 | #define switch_to(prev,next,last) \ | 169 | #define switch_to(prev,next,last) \ |
170 | do { \ | 170 | do { \ |
171 | last = __switch_to(prev,prev->thread_info,next->thread_info); \ | 171 | last = __switch_to(prev,task_thread_info(prev), task_thread_info(next)); \ |
172 | } while (0) | 172 | } while (0) |
173 | 173 | ||
174 | /* | 174 | /* |
175 | * On SMP systems, when the scheduler does migration-cost autodetection, | ||
176 | * it needs a way to flush as much of the CPU's caches as possible. | ||
177 | * | ||
178 | * TODO: fill this in! | ||
179 | */ | ||
180 | static inline void sched_cacheflush(void) | ||
181 | { | ||
182 | } | ||
183 | |||
184 | /* | ||
175 | * CPU interrupt mask handling. | 185 | * CPU interrupt mask handling. |
176 | */ | 186 | */ |
177 | #if __LINUX_ARM_ARCH__ >= 6 | 187 | #if __LINUX_ARM_ARCH__ >= 6 |
diff --git a/include/asm-arm/thread_info.h b/include/asm-arm/thread_info.h index 7c98557b717f..33a33cbb6329 100644 --- a/include/asm-arm/thread_info.h +++ b/include/asm-arm/thread_info.h | |||
@@ -96,13 +96,10 @@ static inline struct thread_info *current_thread_info(void) | |||
96 | extern struct thread_info *alloc_thread_info(struct task_struct *task); | 96 | extern struct thread_info *alloc_thread_info(struct task_struct *task); |
97 | extern void free_thread_info(struct thread_info *); | 97 | extern void free_thread_info(struct thread_info *); |
98 | 98 | ||
99 | #define get_thread_info(ti) get_task_struct((ti)->task) | ||
100 | #define put_thread_info(ti) put_task_struct((ti)->task) | ||
101 | |||
102 | #define thread_saved_pc(tsk) \ | 99 | #define thread_saved_pc(tsk) \ |
103 | ((unsigned long)(pc_pointer((tsk)->thread_info->cpu_context.pc))) | 100 | ((unsigned long)(pc_pointer(task_thread_info(tsk)->cpu_context.pc))) |
104 | #define thread_saved_fp(tsk) \ | 101 | #define thread_saved_fp(tsk) \ |
105 | ((unsigned long)((tsk)->thread_info->cpu_context.fp)) | 102 | ((unsigned long)(task_thread_info(tsk)->cpu_context.fp)) |
106 | 103 | ||
107 | extern void iwmmxt_task_disable(struct thread_info *); | 104 | extern void iwmmxt_task_disable(struct thread_info *); |
108 | extern void iwmmxt_task_copy(struct thread_info *, void *); | 105 | extern void iwmmxt_task_copy(struct thread_info *, void *); |
diff --git a/include/asm-arm26/ioctl.h b/include/asm-arm26/ioctl.h index 2cbb7d0e9dc6..b279fe06dfe5 100644 --- a/include/asm-arm26/ioctl.h +++ b/include/asm-arm26/ioctl.h | |||
@@ -1,74 +1 @@ | |||
1 | /* | #include <asm-generic/ioctl.h> | |
2 | * linux/ioctl.h for Linux by H.H. Bergman. | ||
3 | */ | ||
4 | |||
5 | #ifndef _ASMARM_IOCTL_H | ||
6 | #define _ASMARM_IOCTL_H | ||
7 | |||
8 | /* ioctl command encoding: 32 bits total, command in lower 16 bits, | ||
9 | * size of the parameter structure in the lower 14 bits of the | ||
10 | * upper 16 bits. | ||
11 | * Encoding the size of the parameter structure in the ioctl request | ||
12 | * is useful for catching programs compiled with old versions | ||
13 | * and to avoid overwriting user space outside the user buffer area. | ||
14 | * The highest 2 bits are reserved for indicating the ``access mode''. | ||
15 | * NOTE: This limits the max parameter size to 16kB -1 ! | ||
16 | */ | ||
17 | |||
18 | /* | ||
19 | * The following is for compatibility across the various Linux | ||
20 | * platforms. The i386 ioctl numbering scheme doesn't really enforce | ||
21 | * a type field. De facto, however, the top 8 bits of the lower 16 | ||
22 | * bits are indeed used as a type field, so we might just as well make | ||
23 | * this explicit here. Please be sure to use the decoding macros | ||
24 | * below from now on. | ||
25 | */ | ||
26 | #define _IOC_NRBITS 8 | ||
27 | #define _IOC_TYPEBITS 8 | ||
28 | #define _IOC_SIZEBITS 14 | ||
29 | #define _IOC_DIRBITS 2 | ||
30 | |||
31 | #define _IOC_NRMASK ((1 << _IOC_NRBITS)-1) | ||
32 | #define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1) | ||
33 | #define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1) | ||
34 | #define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1) | ||
35 | |||
36 | #define _IOC_NRSHIFT 0 | ||
37 | #define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS) | ||
38 | #define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS) | ||
39 | #define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS) | ||
40 | |||
41 | /* | ||
42 | * Direction bits. | ||
43 | */ | ||
44 | #define _IOC_NONE 0U | ||
45 | #define _IOC_WRITE 1U | ||
46 | #define _IOC_READ 2U | ||
47 | |||
48 | #define _IOC(dir,type,nr,size) \ | ||
49 | (((dir) << _IOC_DIRSHIFT) | \ | ||
50 | ((type) << _IOC_TYPESHIFT) | \ | ||
51 | ((nr) << _IOC_NRSHIFT) | \ | ||
52 | ((size) << _IOC_SIZESHIFT)) | ||
53 | |||
54 | /* used to create numbers */ | ||
55 | #define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0) | ||
56 | #define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size)) | ||
57 | #define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size)) | ||
58 | #define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size)) | ||
59 | |||
60 | /* used to decode ioctl numbers.. */ | ||
61 | #define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) | ||
62 | #define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK) | ||
63 | #define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK) | ||
64 | #define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK) | ||
65 | |||
66 | /* ...and for the drivers/sound files... */ | ||
67 | |||
68 | #define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT) | ||
69 | #define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT) | ||
70 | #define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT) | ||
71 | #define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT) | ||
72 | #define IOCSIZE_SHIFT (_IOC_SIZESHIFT) | ||
73 | |||
74 | #endif /* _ASMARM_IOCTL_H */ | ||
diff --git a/include/asm-arm26/system.h b/include/asm-arm26/system.h index f23fac1938f3..ca4ccfc4b578 100644 --- a/include/asm-arm26/system.h +++ b/include/asm-arm26/system.h | |||
@@ -111,10 +111,20 @@ extern struct task_struct *__switch_to(struct task_struct *, struct thread_info | |||
111 | 111 | ||
112 | #define switch_to(prev,next,last) \ | 112 | #define switch_to(prev,next,last) \ |
113 | do { \ | 113 | do { \ |
114 | last = __switch_to(prev,prev->thread_info,next->thread_info); \ | 114 | last = __switch_to(prev,task_thread_info(prev),task_thread_info(next)); \ |
115 | } while (0) | 115 | } while (0) |
116 | 116 | ||
117 | /* | 117 | /* |
118 | * On SMP systems, when the scheduler does migration-cost autodetection, | ||
119 | * it needs a way to flush as much of the CPU's caches as possible. | ||
120 | * | ||
121 | * TODO: fill this in! | ||
122 | */ | ||
123 | static inline void sched_cacheflush(void) | ||
124 | { | ||
125 | } | ||
126 | |||
127 | /* | ||
118 | * Save the current interrupt enable state & disable IRQs | 128 | * Save the current interrupt enable state & disable IRQs |
119 | */ | 129 | */ |
120 | #define local_irq_save(x) \ | 130 | #define local_irq_save(x) \ |
diff --git a/include/asm-arm26/thread_info.h b/include/asm-arm26/thread_info.h index aff3e5699c64..a65e58a0a767 100644 --- a/include/asm-arm26/thread_info.h +++ b/include/asm-arm26/thread_info.h | |||
@@ -82,18 +82,15 @@ static inline struct thread_info *current_thread_info(void) | |||
82 | 82 | ||
83 | /* FIXME - PAGE_SIZE < 32K */ | 83 | /* FIXME - PAGE_SIZE < 32K */ |
84 | #define THREAD_SIZE (8*32768) // FIXME - this needs attention (see kernel/fork.c which gets a nice div by zero if this is lower than 8*32768 | 84 | #define THREAD_SIZE (8*32768) // FIXME - this needs attention (see kernel/fork.c which gets a nice div by zero if this is lower than 8*32768 |
85 | #define __get_user_regs(x) (((struct pt_regs *)((unsigned long)(x) + THREAD_SIZE - 8)) - 1) | 85 | #define task_pt_regs(task) ((struct pt_regs *)(task_stack_page(task) + THREAD_SIZE - 8) - 1) |
86 | 86 | ||
87 | extern struct thread_info *alloc_thread_info(struct task_struct *task); | 87 | extern struct thread_info *alloc_thread_info(struct task_struct *task); |
88 | extern void free_thread_info(struct thread_info *); | 88 | extern void free_thread_info(struct thread_info *); |
89 | 89 | ||
90 | #define get_thread_info(ti) get_task_struct((ti)->task) | ||
91 | #define put_thread_info(ti) put_task_struct((ti)->task) | ||
92 | |||
93 | #define thread_saved_pc(tsk) \ | 90 | #define thread_saved_pc(tsk) \ |
94 | ((unsigned long)(pc_pointer((tsk)->thread_info->cpu_context.pc))) | 91 | ((unsigned long)(pc_pointer(task_thread_info(tsk)->cpu_context.pc))) |
95 | #define thread_saved_fp(tsk) \ | 92 | #define thread_saved_fp(tsk) \ |
96 | ((unsigned long)((tsk)->thread_info->cpu_context.fp)) | 93 | ((unsigned long)(task_thread_info(tsk)->cpu_context.fp)) |
97 | 94 | ||
98 | #else /* !__ASSEMBLY__ */ | 95 | #else /* !__ASSEMBLY__ */ |
99 | 96 | ||
diff --git a/include/asm-cris/arch-v10/processor.h b/include/asm-cris/arch-v10/processor.h index e23df8dc96e8..cc692c7a0660 100644 --- a/include/asm-cris/arch-v10/processor.h +++ b/include/asm-cris/arch-v10/processor.h | |||
@@ -40,7 +40,7 @@ struct thread_struct { | |||
40 | #define KSTK_EIP(tsk) \ | 40 | #define KSTK_EIP(tsk) \ |
41 | ({ \ | 41 | ({ \ |
42 | unsigned long eip = 0; \ | 42 | unsigned long eip = 0; \ |
43 | unsigned long regs = (unsigned long)user_regs(tsk); \ | 43 | unsigned long regs = (unsigned long)task_pt_regs(tsk); \ |
44 | if (regs > PAGE_SIZE && \ | 44 | if (regs > PAGE_SIZE && \ |
45 | virt_addr_valid(regs)) \ | 45 | virt_addr_valid(regs)) \ |
46 | eip = ((struct pt_regs *)regs)->irp; \ | 46 | eip = ((struct pt_regs *)regs)->irp; \ |
diff --git a/include/asm-cris/arch-v32/processor.h b/include/asm-cris/arch-v32/processor.h index 8c939bf27987..32bf2e538ced 100644 --- a/include/asm-cris/arch-v32/processor.h +++ b/include/asm-cris/arch-v32/processor.h | |||
@@ -36,7 +36,7 @@ struct thread_struct { | |||
36 | #define KSTK_EIP(tsk) \ | 36 | #define KSTK_EIP(tsk) \ |
37 | ({ \ | 37 | ({ \ |
38 | unsigned long eip = 0; \ | 38 | unsigned long eip = 0; \ |
39 | unsigned long regs = (unsigned long)user_regs(tsk); \ | 39 | unsigned long regs = (unsigned long)task_pt_regs(tsk); \ |
40 | if (regs > PAGE_SIZE && virt_addr_valid(regs)) \ | 40 | if (regs > PAGE_SIZE && virt_addr_valid(regs)) \ |
41 | eip = ((struct pt_regs *)regs)->erp; \ | 41 | eip = ((struct pt_regs *)regs)->erp; \ |
42 | eip; \ | 42 | eip; \ |
diff --git a/include/asm-cris/ioctl.h b/include/asm-cris/ioctl.h index be2d8f667a38..b279fe06dfe5 100644 --- a/include/asm-cris/ioctl.h +++ b/include/asm-cris/ioctl.h | |||
@@ -1,83 +1 @@ | |||
1 | /* | #include <asm-generic/ioctl.h> | |
2 | * linux/ioctl.h for Linux by H.H. Bergman. | ||
3 | * | ||
4 | * This is the same as the i386 version. | ||
5 | */ | ||
6 | |||
7 | #ifndef _ASMCRIS_IOCTL_H | ||
8 | #define _ASMCRIS_IOCTL_H | ||
9 | |||
10 | /* ioctl command encoding: 32 bits total, command in lower 16 bits, | ||
11 | * size of the parameter structure in the lower 14 bits of the | ||
12 | * upper 16 bits. | ||
13 | * Encoding the size of the parameter structure in the ioctl request | ||
14 | * is useful for catching programs compiled with old versions | ||
15 | * and to avoid overwriting user space outside the user buffer area. | ||
16 | * The highest 2 bits are reserved for indicating the ``access mode''. | ||
17 | * NOTE: This limits the max parameter size to 16kB -1 ! | ||
18 | */ | ||
19 | |||
20 | /* | ||
21 | * The following is for compatibility across the various Linux | ||
22 | * platforms. The i386 ioctl numbering scheme doesn't really enforce | ||
23 | * a type field. De facto, however, the top 8 bits of the lower 16 | ||
24 | * bits are indeed used as a type field, so we might just as well make | ||
25 | * this explicit here. Please be sure to use the decoding macros | ||
26 | * below from now on. | ||
27 | */ | ||
28 | #define _IOC_NRBITS 8 | ||
29 | #define _IOC_TYPEBITS 8 | ||
30 | #define _IOC_SIZEBITS 14 | ||
31 | #define _IOC_DIRBITS 2 | ||
32 | |||
33 | #define _IOC_NRMASK ((1 << _IOC_NRBITS)-1) | ||
34 | #define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1) | ||
35 | #define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1) | ||
36 | #define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1) | ||
37 | |||
38 | #define _IOC_NRSHIFT 0 | ||
39 | #define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS) | ||
40 | #define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS) | ||
41 | #define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS) | ||
42 | |||
43 | /* | ||
44 | * Direction bits. | ||
45 | */ | ||
46 | #define _IOC_NONE 0U | ||
47 | #define _IOC_WRITE 1U | ||
48 | #define _IOC_READ 2U | ||
49 | |||
50 | #define _IOC(dir,type,nr,size) \ | ||
51 | (((dir) << _IOC_DIRSHIFT) | \ | ||
52 | ((type) << _IOC_TYPESHIFT) | \ | ||
53 | ((nr) << _IOC_NRSHIFT) | \ | ||
54 | ((size) << _IOC_SIZESHIFT)) | ||
55 | |||
56 | /* provoke compile error for invalid uses of size argument */ | ||
57 | extern int __invalid_size_argument_for_IOC; | ||
58 | #define _IOC_TYPECHECK(t) \ | ||
59 | ((sizeof(t) == sizeof(t[1]) && \ | ||
60 | sizeof(t) < (1 << _IOC_SIZEBITS)) ? \ | ||
61 | sizeof(t) : __invalid_size_argument_for_IOC) | ||
62 | |||
63 | /* used to create numbers */ | ||
64 | #define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0) | ||
65 | #define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),(_IOC_TYPECHECK(size))) | ||
66 | #define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size))) | ||
67 | #define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size))) | ||
68 | |||
69 | /* used to decode ioctl numbers.. */ | ||
70 | #define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) | ||
71 | #define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK) | ||
72 | #define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK) | ||
73 | #define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK) | ||
74 | |||
75 | /* ...and for the drivers/sound files... */ | ||
76 | |||
77 | #define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT) | ||
78 | #define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT) | ||
79 | #define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT) | ||
80 | #define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT) | ||
81 | #define IOCSIZE_SHIFT (_IOC_SIZESHIFT) | ||
82 | |||
83 | #endif /* _ASMCRIS_IOCTL_H */ | ||
diff --git a/include/asm-cris/processor.h b/include/asm-cris/processor.h index dce41009eeb0..961e2bceadbc 100644 --- a/include/asm-cris/processor.h +++ b/include/asm-cris/processor.h | |||
@@ -45,7 +45,8 @@ struct task_struct; | |||
45 | * Dito but for the currently running task | 45 | * Dito but for the currently running task |
46 | */ | 46 | */ |
47 | 47 | ||
48 | #define current_regs() user_regs(current->thread_info) | 48 | #define task_pt_regs(task) user_regs(task_thread_info(task)) |
49 | #define current_regs() task_pt_regs(current) | ||
49 | 50 | ||
50 | static inline void prepare_to_copy(struct task_struct *tsk) | 51 | static inline void prepare_to_copy(struct task_struct *tsk) |
51 | { | 52 | { |
diff --git a/include/asm-cris/thread_info.h b/include/asm-cris/thread_info.h index cef0140fc104..7ad853c3f74e 100644 --- a/include/asm-cris/thread_info.h +++ b/include/asm-cris/thread_info.h | |||
@@ -69,8 +69,6 @@ struct thread_info { | |||
69 | /* thread information allocation */ | 69 | /* thread information allocation */ |
70 | #define alloc_thread_info(tsk) ((struct thread_info *) __get_free_pages(GFP_KERNEL,1)) | 70 | #define alloc_thread_info(tsk) ((struct thread_info *) __get_free_pages(GFP_KERNEL,1)) |
71 | #define free_thread_info(ti) free_pages((unsigned long) (ti), 1) | 71 | #define free_thread_info(ti) free_pages((unsigned long) (ti), 1) |
72 | #define get_thread_info(ti) get_task_struct((ti)->task) | ||
73 | #define put_thread_info(ti) put_task_struct((ti)->task) | ||
74 | 72 | ||
75 | #endif /* !__ASSEMBLY__ */ | 73 | #endif /* !__ASSEMBLY__ */ |
76 | 74 | ||
diff --git a/include/asm-frv/ioctl.h b/include/asm-frv/ioctl.h index 8aee76905545..b279fe06dfe5 100644 --- a/include/asm-frv/ioctl.h +++ b/include/asm-frv/ioctl.h | |||
@@ -1,80 +1 @@ | |||
1 | /* | #include <asm-generic/ioctl.h> | |
2 | * linux/ioctl.h for Linux by H.H. Bergman. | ||
3 | */ | ||
4 | |||
5 | #ifndef _ASM_IOCTL_H | ||
6 | #define _ASM_IOCTL_H | ||
7 | |||
8 | /* ioctl command encoding: 32 bits total, command in lower 16 bits, | ||
9 | * size of the parameter structure in the lower 14 bits of the | ||
10 | * upper 16 bits. | ||
11 | * Encoding the size of the parameter structure in the ioctl request | ||
12 | * is useful for catching programs compiled with old versions | ||
13 | * and to avoid overwriting user space outside the user buffer area. | ||
14 | * The highest 2 bits are reserved for indicating the ``access mode''. | ||
15 | * NOTE: This limits the max parameter size to 16kB -1 ! | ||
16 | */ | ||
17 | |||
18 | /* | ||
19 | * I don't really have any idea about what this should look like, so | ||
20 | * for the time being, this is heavily based on the PC definitions. | ||
21 | */ | ||
22 | |||
23 | /* | ||
24 | * The following is for compatibility across the various Linux | ||
25 | * platforms. The i386 ioctl numbering scheme doesn't really enforce | ||
26 | * a type field. De facto, however, the top 8 bits of the lower 16 | ||
27 | * bits are indeed used as a type field, so we might just as well make | ||
28 | * this explicit here. Please be sure to use the decoding macros | ||
29 | * below from now on. | ||
30 | */ | ||
31 | #define _IOC_NRBITS 8 | ||
32 | #define _IOC_TYPEBITS 8 | ||
33 | #define _IOC_SIZEBITS 14 | ||
34 | #define _IOC_DIRBITS 2 | ||
35 | |||
36 | #define _IOC_NRMASK ((1 << _IOC_NRBITS)-1) | ||
37 | #define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1) | ||
38 | #define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1) | ||
39 | #define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1) | ||
40 | |||
41 | #define _IOC_NRSHIFT 0 | ||
42 | #define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS) | ||
43 | #define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS) | ||
44 | #define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS) | ||
45 | |||
46 | /* | ||
47 | * Direction bits. | ||
48 | */ | ||
49 | #define _IOC_NONE 0U | ||
50 | #define _IOC_WRITE 1U | ||
51 | #define _IOC_READ 2U | ||
52 | |||
53 | #define _IOC(dir,type,nr,size) \ | ||
54 | (((dir) << _IOC_DIRSHIFT) | \ | ||
55 | ((type) << _IOC_TYPESHIFT) | \ | ||
56 | ((nr) << _IOC_NRSHIFT) | \ | ||
57 | ((size) << _IOC_SIZESHIFT)) | ||
58 | |||
59 | /* used to create numbers */ | ||
60 | #define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0) | ||
61 | #define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size)) | ||
62 | #define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size)) | ||
63 | #define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size)) | ||
64 | |||
65 | /* used to decode ioctl numbers.. */ | ||
66 | #define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) | ||
67 | #define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK) | ||
68 | #define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK) | ||
69 | #define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK) | ||
70 | |||
71 | /* ...and for the drivers/sound files... */ | ||
72 | |||
73 | #define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT) | ||
74 | #define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT) | ||
75 | #define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT) | ||
76 | #define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT) | ||
77 | #define IOCSIZE_SHIFT (_IOC_SIZESHIFT) | ||
78 | |||
79 | #endif /* _ASM_IOCTL_H */ | ||
80 | |||
diff --git a/include/asm-frv/thread_info.h b/include/asm-frv/thread_info.h index 60f6b2aee76d..a5576e02dd1d 100644 --- a/include/asm-frv/thread_info.h +++ b/include/asm-frv/thread_info.h | |||
@@ -110,8 +110,6 @@ register struct thread_info *__current_thread_info asm("gr15"); | |||
110 | #endif | 110 | #endif |
111 | 111 | ||
112 | #define free_thread_info(info) kfree(info) | 112 | #define free_thread_info(info) kfree(info) |
113 | #define get_thread_info(ti) get_task_struct((ti)->task) | ||
114 | #define put_thread_info(ti) put_task_struct((ti)->task) | ||
115 | 113 | ||
116 | #else /* !__ASSEMBLY__ */ | 114 | #else /* !__ASSEMBLY__ */ |
117 | 115 | ||
diff --git a/include/asm-generic/ioctl.h b/include/asm-generic/ioctl.h new file mode 100644 index 000000000000..cd027298beb1 --- /dev/null +++ b/include/asm-generic/ioctl.h | |||
@@ -0,0 +1,80 @@ | |||
1 | #ifndef _ASM_GENERIC_IOCTL_H | ||
2 | #define _ASM_GENERIC_IOCTL_H | ||
3 | |||
4 | /* ioctl command encoding: 32 bits total, command in lower 16 bits, | ||
5 | * size of the parameter structure in the lower 14 bits of the | ||
6 | * upper 16 bits. | ||
7 | * Encoding the size of the parameter structure in the ioctl request | ||
8 | * is useful for catching programs compiled with old versions | ||
9 | * and to avoid overwriting user space outside the user buffer area. | ||
10 | * The highest 2 bits are reserved for indicating the ``access mode''. | ||
11 | * NOTE: This limits the max parameter size to 16kB -1 ! | ||
12 | */ | ||
13 | |||
14 | /* | ||
15 | * The following is for compatibility across the various Linux | ||
16 | * platforms. The generic ioctl numbering scheme doesn't really enforce | ||
17 | * a type field. De facto, however, the top 8 bits of the lower 16 | ||
18 | * bits are indeed used as a type field, so we might just as well make | ||
19 | * this explicit here. Please be sure to use the decoding macros | ||
20 | * below from now on. | ||
21 | */ | ||
22 | #define _IOC_NRBITS 8 | ||
23 | #define _IOC_TYPEBITS 8 | ||
24 | #define _IOC_SIZEBITS 14 | ||
25 | #define _IOC_DIRBITS 2 | ||
26 | |||
27 | #define _IOC_NRMASK ((1 << _IOC_NRBITS)-1) | ||
28 | #define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1) | ||
29 | #define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1) | ||
30 | #define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1) | ||
31 | |||
32 | #define _IOC_NRSHIFT 0 | ||
33 | #define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS) | ||
34 | #define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS) | ||
35 | #define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS) | ||
36 | |||
37 | /* | ||
38 | * Direction bits. | ||
39 | */ | ||
40 | #define _IOC_NONE 0U | ||
41 | #define _IOC_WRITE 1U | ||
42 | #define _IOC_READ 2U | ||
43 | |||
44 | #define _IOC(dir,type,nr,size) \ | ||
45 | (((dir) << _IOC_DIRSHIFT) | \ | ||
46 | ((type) << _IOC_TYPESHIFT) | \ | ||
47 | ((nr) << _IOC_NRSHIFT) | \ | ||
48 | ((size) << _IOC_SIZESHIFT)) | ||
49 | |||
50 | /* provoke compile error for invalid uses of size argument */ | ||
51 | extern unsigned int __invalid_size_argument_for_IOC; | ||
52 | #define _IOC_TYPECHECK(t) \ | ||
53 | ((sizeof(t) == sizeof(t[1]) && \ | ||
54 | sizeof(t) < (1 << _IOC_SIZEBITS)) ? \ | ||
55 | sizeof(t) : __invalid_size_argument_for_IOC) | ||
56 | |||
57 | /* used to create numbers */ | ||
58 | #define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0) | ||
59 | #define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),(_IOC_TYPECHECK(size))) | ||
60 | #define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size))) | ||
61 | #define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size))) | ||
62 | #define _IOR_BAD(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size)) | ||
63 | #define _IOW_BAD(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size)) | ||
64 | #define _IOWR_BAD(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size)) | ||
65 | |||
66 | /* used to decode ioctl numbers.. */ | ||
67 | #define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) | ||
68 | #define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK) | ||
69 | #define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK) | ||
70 | #define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK) | ||
71 | |||
72 | /* ...and for the drivers/sound files... */ | ||
73 | |||
74 | #define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT) | ||
75 | #define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT) | ||
76 | #define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT) | ||
77 | #define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT) | ||
78 | #define IOCSIZE_SHIFT (_IOC_SIZESHIFT) | ||
79 | |||
80 | #endif /* _ASM_GENERIC_IOCTL_H */ | ||
diff --git a/include/asm-generic/mutex-dec.h b/include/asm-generic/mutex-dec.h index 74b18cda169f..40c6d1f86598 100644 --- a/include/asm-generic/mutex-dec.h +++ b/include/asm-generic/mutex-dec.h | |||
@@ -97,7 +97,7 @@ __mutex_fastpath_trylock(atomic_t *count, int (*fail_fn)(atomic_t *)) | |||
97 | * the mutex state would be. | 97 | * the mutex state would be. |
98 | */ | 98 | */ |
99 | #ifdef __HAVE_ARCH_CMPXCHG | 99 | #ifdef __HAVE_ARCH_CMPXCHG |
100 | if (likely(atomic_cmpxchg(count, 1, 0)) == 1) { | 100 | if (likely(atomic_cmpxchg(count, 1, 0) == 1)) { |
101 | smp_mb(); | 101 | smp_mb(); |
102 | return 1; | 102 | return 1; |
103 | } | 103 | } |
diff --git a/include/asm-h8300/ioctl.h b/include/asm-h8300/ioctl.h index 031c623478b3..b279fe06dfe5 100644 --- a/include/asm-h8300/ioctl.h +++ b/include/asm-h8300/ioctl.h | |||
@@ -1,80 +1 @@ | |||
1 | /* $Id: ioctl.h,v 1.1 2002/11/19 02:09:26 gerg Exp $ | #include <asm-generic/ioctl.h> | |
2 | * | ||
3 | * linux/ioctl.h for Linux by H.H. Bergman. | ||
4 | */ | ||
5 | |||
6 | #ifndef _H8300_IOCTL_H | ||
7 | #define _H8300_IOCTL_H | ||
8 | |||
9 | /* ioctl command encoding: 32 bits total, command in lower 16 bits, | ||
10 | * size of the parameter structure in the lower 14 bits of the | ||
11 | * upper 16 bits. | ||
12 | * Encoding the size of the parameter structure in the ioctl request | ||
13 | * is useful for catching programs compiled with old versions | ||
14 | * and to avoid overwriting user space outside the user buffer area. | ||
15 | * The highest 2 bits are reserved for indicating the ``access mode''. | ||
16 | * NOTE: This limits the max parameter size to 16kB -1 ! | ||
17 | */ | ||
18 | |||
19 | /* | ||
20 | * I don't really have any idea about what this should look like, so | ||
21 | * for the time being, this is heavily based on the PC definitions. | ||
22 | */ | ||
23 | |||
24 | /* | ||
25 | * The following is for compatibility across the various Linux | ||
26 | * platforms. The i386 ioctl numbering scheme doesn't really enforce | ||
27 | * a type field. De facto, however, the top 8 bits of the lower 16 | ||
28 | * bits are indeed used as a type field, so we might just as well make | ||
29 | * this explicit here. Please be sure to use the decoding macros | ||
30 | * below from now on. | ||
31 | */ | ||
32 | #define _IOC_NRBITS 8 | ||
33 | #define _IOC_TYPEBITS 8 | ||
34 | #define _IOC_SIZEBITS 14 | ||
35 | #define _IOC_DIRBITS 2 | ||
36 | |||
37 | #define _IOC_NRMASK ((1 << _IOC_NRBITS)-1) | ||
38 | #define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1) | ||
39 | #define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1) | ||
40 | #define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1) | ||
41 | |||
42 | #define _IOC_NRSHIFT 0 | ||
43 | #define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS) | ||
44 | #define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS) | ||
45 | #define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS) | ||
46 | |||
47 | /* | ||
48 | * Direction bits. | ||
49 | */ | ||
50 | #define _IOC_NONE 0U | ||
51 | #define _IOC_WRITE 1U | ||
52 | #define _IOC_READ 2U | ||
53 | |||
54 | #define _IOC(dir,type,nr,size) \ | ||
55 | (((dir) << _IOC_DIRSHIFT) | \ | ||
56 | ((type) << _IOC_TYPESHIFT) | \ | ||
57 | ((nr) << _IOC_NRSHIFT) | \ | ||
58 | ((size) << _IOC_SIZESHIFT)) | ||
59 | |||
60 | /* used to create numbers */ | ||
61 | #define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0) | ||
62 | #define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size)) | ||
63 | #define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size)) | ||
64 | #define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size)) | ||
65 | |||
66 | /* used to decode ioctl numbers.. */ | ||
67 | #define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) | ||
68 | #define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK) | ||
69 | #define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK) | ||
70 | #define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK) | ||
71 | |||
72 | /* ...and for the drivers/sound files... */ | ||
73 | |||
74 | #define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT) | ||
75 | #define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT) | ||
76 | #define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT) | ||
77 | #define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT) | ||
78 | #define IOCSIZE_SHIFT (_IOC_SIZESHIFT) | ||
79 | |||
80 | #endif /* _H8300_IOCTL_H */ | ||
diff --git a/include/asm-h8300/page.h b/include/asm-h8300/page.h index e8c02b8c2d99..cd35b1cc6cde 100644 --- a/include/asm-h8300/page.h +++ b/include/asm-h8300/page.h | |||
@@ -13,12 +13,6 @@ | |||
13 | 13 | ||
14 | #include <asm/setup.h> | 14 | #include <asm/setup.h> |
15 | 15 | ||
16 | #if !defined(CONFIG_SMALL_TASKS) && PAGE_SHIFT < 13 | ||
17 | #define KTHREAD_SIZE (8192) | ||
18 | #else | ||
19 | #define KTHREAD_SIZE PAGE_SIZE | ||
20 | #endif | ||
21 | |||
22 | #ifndef __ASSEMBLY__ | 16 | #ifndef __ASSEMBLY__ |
23 | 17 | ||
24 | #define get_user_page(vaddr) __get_free_page(GFP_KERNEL) | 18 | #define get_user_page(vaddr) __get_free_page(GFP_KERNEL) |
diff --git a/include/asm-h8300/thread_info.h b/include/asm-h8300/thread_info.h index bfcc755c3bb1..45f09dc9caff 100644 --- a/include/asm-h8300/thread_info.h +++ b/include/asm-h8300/thread_info.h | |||
@@ -69,8 +69,6 @@ static inline struct thread_info *current_thread_info(void) | |||
69 | #define alloc_thread_info(tsk) ((struct thread_info *) \ | 69 | #define alloc_thread_info(tsk) ((struct thread_info *) \ |
70 | __get_free_pages(GFP_KERNEL, 1)) | 70 | __get_free_pages(GFP_KERNEL, 1)) |
71 | #define free_thread_info(ti) free_pages((unsigned long) (ti), 1) | 71 | #define free_thread_info(ti) free_pages((unsigned long) (ti), 1) |
72 | #define get_thread_info(ti) get_task_struct((ti)->task) | ||
73 | #define put_thread_info(ti) put_task_struct((ti)->task) | ||
74 | #endif /* __ASSEMBLY__ */ | 72 | #endif /* __ASSEMBLY__ */ |
75 | 73 | ||
76 | /* | 74 | /* |
diff --git a/include/asm-i386/apic.h b/include/asm-i386/apic.h index 8c454aa58ac6..d30b8571573f 100644 --- a/include/asm-i386/apic.h +++ b/include/asm-i386/apic.h | |||
@@ -132,6 +132,11 @@ extern unsigned int nmi_watchdog; | |||
132 | 132 | ||
133 | extern int disable_timer_pin_1; | 133 | extern int disable_timer_pin_1; |
134 | 134 | ||
135 | void smp_send_timer_broadcast_ipi(struct pt_regs *regs); | ||
136 | void switch_APIC_timer_to_ipi(void *cpumask); | ||
137 | void switch_ipi_to_APIC_timer(void *cpumask); | ||
138 | #define ARCH_APICTIMER_STOPS_ON_C3 1 | ||
139 | |||
135 | #else /* !CONFIG_X86_LOCAL_APIC */ | 140 | #else /* !CONFIG_X86_LOCAL_APIC */ |
136 | static inline void lapic_shutdown(void) { } | 141 | static inline void lapic_shutdown(void) { } |
137 | 142 | ||
diff --git a/include/asm-i386/bitops.h b/include/asm-i386/bitops.h index 65679aca4b22..fe0819fe9c64 100644 --- a/include/asm-i386/bitops.h +++ b/include/asm-i386/bitops.h | |||
@@ -43,7 +43,7 @@ static inline void set_bit(int nr, volatile unsigned long * addr) | |||
43 | { | 43 | { |
44 | __asm__ __volatile__( LOCK_PREFIX | 44 | __asm__ __volatile__( LOCK_PREFIX |
45 | "btsl %1,%0" | 45 | "btsl %1,%0" |
46 | :"=m" (ADDR) | 46 | :"+m" (ADDR) |
47 | :"Ir" (nr)); | 47 | :"Ir" (nr)); |
48 | } | 48 | } |
49 | 49 | ||
@@ -60,7 +60,7 @@ static inline void __set_bit(int nr, volatile unsigned long * addr) | |||
60 | { | 60 | { |
61 | __asm__( | 61 | __asm__( |
62 | "btsl %1,%0" | 62 | "btsl %1,%0" |
63 | :"=m" (ADDR) | 63 | :"+m" (ADDR) |
64 | :"Ir" (nr)); | 64 | :"Ir" (nr)); |
65 | } | 65 | } |
66 | 66 | ||
@@ -78,7 +78,7 @@ static inline void clear_bit(int nr, volatile unsigned long * addr) | |||
78 | { | 78 | { |
79 | __asm__ __volatile__( LOCK_PREFIX | 79 | __asm__ __volatile__( LOCK_PREFIX |
80 | "btrl %1,%0" | 80 | "btrl %1,%0" |
81 | :"=m" (ADDR) | 81 | :"+m" (ADDR) |
82 | :"Ir" (nr)); | 82 | :"Ir" (nr)); |
83 | } | 83 | } |
84 | 84 | ||
@@ -86,7 +86,7 @@ static inline void __clear_bit(int nr, volatile unsigned long * addr) | |||
86 | { | 86 | { |
87 | __asm__ __volatile__( | 87 | __asm__ __volatile__( |
88 | "btrl %1,%0" | 88 | "btrl %1,%0" |
89 | :"=m" (ADDR) | 89 | :"+m" (ADDR) |
90 | :"Ir" (nr)); | 90 | :"Ir" (nr)); |
91 | } | 91 | } |
92 | #define smp_mb__before_clear_bit() barrier() | 92 | #define smp_mb__before_clear_bit() barrier() |
@@ -105,7 +105,7 @@ static inline void __change_bit(int nr, volatile unsigned long * addr) | |||
105 | { | 105 | { |
106 | __asm__ __volatile__( | 106 | __asm__ __volatile__( |
107 | "btcl %1,%0" | 107 | "btcl %1,%0" |
108 | :"=m" (ADDR) | 108 | :"+m" (ADDR) |
109 | :"Ir" (nr)); | 109 | :"Ir" (nr)); |
110 | } | 110 | } |
111 | 111 | ||
@@ -123,7 +123,7 @@ static inline void change_bit(int nr, volatile unsigned long * addr) | |||
123 | { | 123 | { |
124 | __asm__ __volatile__( LOCK_PREFIX | 124 | __asm__ __volatile__( LOCK_PREFIX |
125 | "btcl %1,%0" | 125 | "btcl %1,%0" |
126 | :"=m" (ADDR) | 126 | :"+m" (ADDR) |
127 | :"Ir" (nr)); | 127 | :"Ir" (nr)); |
128 | } | 128 | } |
129 | 129 | ||
@@ -142,7 +142,7 @@ static inline int test_and_set_bit(int nr, volatile unsigned long * addr) | |||
142 | 142 | ||
143 | __asm__ __volatile__( LOCK_PREFIX | 143 | __asm__ __volatile__( LOCK_PREFIX |
144 | "btsl %2,%1\n\tsbbl %0,%0" | 144 | "btsl %2,%1\n\tsbbl %0,%0" |
145 | :"=r" (oldbit),"=m" (ADDR) | 145 | :"=r" (oldbit),"+m" (ADDR) |
146 | :"Ir" (nr) : "memory"); | 146 | :"Ir" (nr) : "memory"); |
147 | return oldbit; | 147 | return oldbit; |
148 | } | 148 | } |
@@ -162,7 +162,7 @@ static inline int __test_and_set_bit(int nr, volatile unsigned long * addr) | |||
162 | 162 | ||
163 | __asm__( | 163 | __asm__( |
164 | "btsl %2,%1\n\tsbbl %0,%0" | 164 | "btsl %2,%1\n\tsbbl %0,%0" |
165 | :"=r" (oldbit),"=m" (ADDR) | 165 | :"=r" (oldbit),"+m" (ADDR) |
166 | :"Ir" (nr)); | 166 | :"Ir" (nr)); |
167 | return oldbit; | 167 | return oldbit; |
168 | } | 168 | } |
@@ -182,7 +182,7 @@ static inline int test_and_clear_bit(int nr, volatile unsigned long * addr) | |||
182 | 182 | ||
183 | __asm__ __volatile__( LOCK_PREFIX | 183 | __asm__ __volatile__( LOCK_PREFIX |
184 | "btrl %2,%1\n\tsbbl %0,%0" | 184 | "btrl %2,%1\n\tsbbl %0,%0" |
185 | :"=r" (oldbit),"=m" (ADDR) | 185 | :"=r" (oldbit),"+m" (ADDR) |
186 | :"Ir" (nr) : "memory"); | 186 | :"Ir" (nr) : "memory"); |
187 | return oldbit; | 187 | return oldbit; |
188 | } | 188 | } |
@@ -202,7 +202,7 @@ static inline int __test_and_clear_bit(int nr, volatile unsigned long *addr) | |||
202 | 202 | ||
203 | __asm__( | 203 | __asm__( |
204 | "btrl %2,%1\n\tsbbl %0,%0" | 204 | "btrl %2,%1\n\tsbbl %0,%0" |
205 | :"=r" (oldbit),"=m" (ADDR) | 205 | :"=r" (oldbit),"+m" (ADDR) |
206 | :"Ir" (nr)); | 206 | :"Ir" (nr)); |
207 | return oldbit; | 207 | return oldbit; |
208 | } | 208 | } |
@@ -214,7 +214,7 @@ static inline int __test_and_change_bit(int nr, volatile unsigned long *addr) | |||
214 | 214 | ||
215 | __asm__ __volatile__( | 215 | __asm__ __volatile__( |
216 | "btcl %2,%1\n\tsbbl %0,%0" | 216 | "btcl %2,%1\n\tsbbl %0,%0" |
217 | :"=r" (oldbit),"=m" (ADDR) | 217 | :"=r" (oldbit),"+m" (ADDR) |
218 | :"Ir" (nr) : "memory"); | 218 | :"Ir" (nr) : "memory"); |
219 | return oldbit; | 219 | return oldbit; |
220 | } | 220 | } |
@@ -233,7 +233,7 @@ static inline int test_and_change_bit(int nr, volatile unsigned long* addr) | |||
233 | 233 | ||
234 | __asm__ __volatile__( LOCK_PREFIX | 234 | __asm__ __volatile__( LOCK_PREFIX |
235 | "btcl %2,%1\n\tsbbl %0,%0" | 235 | "btcl %2,%1\n\tsbbl %0,%0" |
236 | :"=r" (oldbit),"=m" (ADDR) | 236 | :"=r" (oldbit),"+m" (ADDR) |
237 | :"Ir" (nr) : "memory"); | 237 | :"Ir" (nr) : "memory"); |
238 | return oldbit; | 238 | return oldbit; |
239 | } | 239 | } |
diff --git a/include/asm-i386/cpufeature.h b/include/asm-i386/cpufeature.h index ff1187e80c32..c4ec2a4d8fdf 100644 --- a/include/asm-i386/cpufeature.h +++ b/include/asm-i386/cpufeature.h | |||
@@ -69,6 +69,7 @@ | |||
69 | #define X86_FEATURE_K7 (3*32+ 5) /* Athlon */ | 69 | #define X86_FEATURE_K7 (3*32+ 5) /* Athlon */ |
70 | #define X86_FEATURE_P3 (3*32+ 6) /* P3 */ | 70 | #define X86_FEATURE_P3 (3*32+ 6) /* P3 */ |
71 | #define X86_FEATURE_P4 (3*32+ 7) /* P4 */ | 71 | #define X86_FEATURE_P4 (3*32+ 7) /* P4 */ |
72 | #define X86_FEATURE_CONSTANT_TSC (3*32+ 8) /* TSC ticks at a constant rate */ | ||
72 | 73 | ||
73 | /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ | 74 | /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ |
74 | #define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */ | 75 | #define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */ |
diff --git a/include/asm-i386/dma-mapping.h b/include/asm-i386/dma-mapping.h index 6c37a9ab8d60..9cf20cacf76e 100644 --- a/include/asm-i386/dma-mapping.h +++ b/include/asm-i386/dma-mapping.h | |||
@@ -6,6 +6,7 @@ | |||
6 | #include <asm/cache.h> | 6 | #include <asm/cache.h> |
7 | #include <asm/io.h> | 7 | #include <asm/io.h> |
8 | #include <asm/scatterlist.h> | 8 | #include <asm/scatterlist.h> |
9 | #include <asm/bug.h> | ||
9 | 10 | ||
10 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) | 11 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) |
11 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) | 12 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) |
@@ -20,7 +21,9 @@ static inline dma_addr_t | |||
20 | dma_map_single(struct device *dev, void *ptr, size_t size, | 21 | dma_map_single(struct device *dev, void *ptr, size_t size, |
21 | enum dma_data_direction direction) | 22 | enum dma_data_direction direction) |
22 | { | 23 | { |
23 | BUG_ON(direction == DMA_NONE); | 24 | if (direction == DMA_NONE) |
25 | BUG(); | ||
26 | WARN_ON(size == 0); | ||
24 | flush_write_buffers(); | 27 | flush_write_buffers(); |
25 | return virt_to_phys(ptr); | 28 | return virt_to_phys(ptr); |
26 | } | 29 | } |
@@ -29,7 +32,8 @@ static inline void | |||
29 | dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, | 32 | dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, |
30 | enum dma_data_direction direction) | 33 | enum dma_data_direction direction) |
31 | { | 34 | { |
32 | BUG_ON(direction == DMA_NONE); | 35 | if (direction == DMA_NONE) |
36 | BUG(); | ||
33 | } | 37 | } |
34 | 38 | ||
35 | static inline int | 39 | static inline int |
@@ -38,7 +42,9 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, | |||
38 | { | 42 | { |
39 | int i; | 43 | int i; |
40 | 44 | ||
41 | BUG_ON(direction == DMA_NONE); | 45 | if (direction == DMA_NONE) |
46 | BUG(); | ||
47 | WARN_ON(nents == 0 || sg[0].length == 0); | ||
42 | 48 | ||
43 | for (i = 0; i < nents; i++ ) { | 49 | for (i = 0; i < nents; i++ ) { |
44 | BUG_ON(!sg[i].page); | 50 | BUG_ON(!sg[i].page); |
diff --git a/include/asm-i386/i387.h b/include/asm-i386/i387.h index 6747006743f9..152d0baa576a 100644 --- a/include/asm-i386/i387.h +++ b/include/asm-i386/i387.h | |||
@@ -49,19 +49,19 @@ static inline void __save_init_fpu( struct task_struct *tsk ) | |||
49 | X86_FEATURE_FXSR, | 49 | X86_FEATURE_FXSR, |
50 | "m" (tsk->thread.i387.fxsave) | 50 | "m" (tsk->thread.i387.fxsave) |
51 | :"memory"); | 51 | :"memory"); |
52 | tsk->thread_info->status &= ~TS_USEDFPU; | 52 | task_thread_info(tsk)->status &= ~TS_USEDFPU; |
53 | } | 53 | } |
54 | 54 | ||
55 | #define __unlazy_fpu( tsk ) do { \ | 55 | #define __unlazy_fpu( tsk ) do { \ |
56 | if ((tsk)->thread_info->status & TS_USEDFPU) \ | 56 | if (task_thread_info(tsk)->status & TS_USEDFPU) \ |
57 | save_init_fpu( tsk ); \ | 57 | save_init_fpu( tsk ); \ |
58 | } while (0) | 58 | } while (0) |
59 | 59 | ||
60 | #define __clear_fpu( tsk ) \ | 60 | #define __clear_fpu( tsk ) \ |
61 | do { \ | 61 | do { \ |
62 | if ((tsk)->thread_info->status & TS_USEDFPU) { \ | 62 | if (task_thread_info(tsk)->status & TS_USEDFPU) { \ |
63 | asm volatile("fnclex ; fwait"); \ | 63 | asm volatile("fnclex ; fwait"); \ |
64 | (tsk)->thread_info->status &= ~TS_USEDFPU; \ | 64 | task_thread_info(tsk)->status &= ~TS_USEDFPU; \ |
65 | stts(); \ | 65 | stts(); \ |
66 | } \ | 66 | } \ |
67 | } while (0) | 67 | } while (0) |
diff --git a/include/asm-i386/io.h b/include/asm-i386/io.h index 7babb97a02eb..03233c2ab820 100644 --- a/include/asm-i386/io.h +++ b/include/asm-i386/io.h | |||
@@ -131,6 +131,11 @@ extern void iounmap(volatile void __iomem *addr); | |||
131 | extern void *bt_ioremap(unsigned long offset, unsigned long size); | 131 | extern void *bt_ioremap(unsigned long offset, unsigned long size); |
132 | extern void bt_iounmap(void *addr, unsigned long size); | 132 | extern void bt_iounmap(void *addr, unsigned long size); |
133 | 133 | ||
134 | /* Use early IO mappings for DMI because it's initialized early */ | ||
135 | #define dmi_ioremap bt_ioremap | ||
136 | #define dmi_iounmap bt_iounmap | ||
137 | #define dmi_alloc alloc_bootmem | ||
138 | |||
134 | /* | 139 | /* |
135 | * ISA I/O bus memory addresses are 1:1 with the physical address. | 140 | * ISA I/O bus memory addresses are 1:1 with the physical address. |
136 | */ | 141 | */ |
diff --git a/include/asm-i386/ioctl.h b/include/asm-i386/ioctl.h index 543f7843d553..b279fe06dfe5 100644 --- a/include/asm-i386/ioctl.h +++ b/include/asm-i386/ioctl.h | |||
@@ -1,85 +1 @@ | |||
1 | /* $Id: ioctl.h,v 1.5 1993/07/19 21:53:50 root Exp root $ | #include <asm-generic/ioctl.h> | |
2 | * | ||
3 | * linux/ioctl.h for Linux by H.H. Bergman. | ||
4 | */ | ||
5 | |||
6 | #ifndef _ASMI386_IOCTL_H | ||
7 | #define _ASMI386_IOCTL_H | ||
8 | |||
9 | /* ioctl command encoding: 32 bits total, command in lower 16 bits, | ||
10 | * size of the parameter structure in the lower 14 bits of the | ||
11 | * upper 16 bits. | ||
12 | * Encoding the size of the parameter structure in the ioctl request | ||
13 | * is useful for catching programs compiled with old versions | ||
14 | * and to avoid overwriting user space outside the user buffer area. | ||
15 | * The highest 2 bits are reserved for indicating the ``access mode''. | ||
16 | * NOTE: This limits the max parameter size to 16kB -1 ! | ||
17 | */ | ||
18 | |||
19 | /* | ||
20 | * The following is for compatibility across the various Linux | ||
21 | * platforms. The i386 ioctl numbering scheme doesn't really enforce | ||
22 | * a type field. De facto, however, the top 8 bits of the lower 16 | ||
23 | * bits are indeed used as a type field, so we might just as well make | ||
24 | * this explicit here. Please be sure to use the decoding macros | ||
25 | * below from now on. | ||
26 | */ | ||
27 | #define _IOC_NRBITS 8 | ||
28 | #define _IOC_TYPEBITS 8 | ||
29 | #define _IOC_SIZEBITS 14 | ||
30 | #define _IOC_DIRBITS 2 | ||
31 | |||
32 | #define _IOC_NRMASK ((1 << _IOC_NRBITS)-1) | ||
33 | #define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1) | ||
34 | #define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1) | ||
35 | #define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1) | ||
36 | |||
37 | #define _IOC_NRSHIFT 0 | ||
38 | #define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS) | ||
39 | #define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS) | ||
40 | #define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS) | ||
41 | |||
42 | /* | ||
43 | * Direction bits. | ||
44 | */ | ||
45 | #define _IOC_NONE 0U | ||
46 | #define _IOC_WRITE 1U | ||
47 | #define _IOC_READ 2U | ||
48 | |||
49 | #define _IOC(dir,type,nr,size) \ | ||
50 | (((dir) << _IOC_DIRSHIFT) | \ | ||
51 | ((type) << _IOC_TYPESHIFT) | \ | ||
52 | ((nr) << _IOC_NRSHIFT) | \ | ||
53 | ((size) << _IOC_SIZESHIFT)) | ||
54 | |||
55 | /* provoke compile error for invalid uses of size argument */ | ||
56 | extern unsigned int __invalid_size_argument_for_IOC; | ||
57 | #define _IOC_TYPECHECK(t) \ | ||
58 | ((sizeof(t) == sizeof(t[1]) && \ | ||
59 | sizeof(t) < (1 << _IOC_SIZEBITS)) ? \ | ||
60 | sizeof(t) : __invalid_size_argument_for_IOC) | ||
61 | |||
62 | /* used to create numbers */ | ||
63 | #define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0) | ||
64 | #define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),(_IOC_TYPECHECK(size))) | ||
65 | #define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size))) | ||
66 | #define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size))) | ||
67 | #define _IOR_BAD(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size)) | ||
68 | #define _IOW_BAD(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size)) | ||
69 | #define _IOWR_BAD(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size)) | ||
70 | |||
71 | /* used to decode ioctl numbers.. */ | ||
72 | #define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) | ||
73 | #define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK) | ||
74 | #define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK) | ||
75 | #define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK) | ||
76 | |||
77 | /* ...and for the drivers/sound files... */ | ||
78 | |||
79 | #define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT) | ||
80 | #define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT) | ||
81 | #define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT) | ||
82 | #define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT) | ||
83 | #define IOCSIZE_SHIFT (_IOC_SIZESHIFT) | ||
84 | |||
85 | #endif /* _ASMI386_IOCTL_H */ | ||
diff --git a/include/asm-i386/kexec.h b/include/asm-i386/kexec.h index 6ed2a03e37b3..53f0e06672dc 100644 --- a/include/asm-i386/kexec.h +++ b/include/asm-i386/kexec.h | |||
@@ -2,6 +2,8 @@ | |||
2 | #define _I386_KEXEC_H | 2 | #define _I386_KEXEC_H |
3 | 3 | ||
4 | #include <asm/fixmap.h> | 4 | #include <asm/fixmap.h> |
5 | #include <asm/ptrace.h> | ||
6 | #include <asm/string.h> | ||
5 | 7 | ||
6 | /* | 8 | /* |
7 | * KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return. | 9 | * KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return. |
@@ -26,8 +28,49 @@ | |||
26 | #define KEXEC_ARCH KEXEC_ARCH_386 | 28 | #define KEXEC_ARCH KEXEC_ARCH_386 |
27 | 29 | ||
28 | #define MAX_NOTE_BYTES 1024 | 30 | #define MAX_NOTE_BYTES 1024 |
29 | typedef u32 note_buf_t[MAX_NOTE_BYTES/4]; | ||
30 | 31 | ||
31 | extern note_buf_t crash_notes[]; | 32 | /* CPU does not save ss and esp on stack if execution is already |
33 | * running in kernel mode at the time of NMI occurrence. This code | ||
34 | * fixes it. | ||
35 | */ | ||
36 | static inline void crash_fixup_ss_esp(struct pt_regs *newregs, | ||
37 | struct pt_regs *oldregs) | ||
38 | { | ||
39 | memcpy(newregs, oldregs, sizeof(*newregs)); | ||
40 | newregs->esp = (unsigned long)&(oldregs->esp); | ||
41 | __asm__ __volatile__( | ||
42 | "xorl %%eax, %%eax\n\t" | ||
43 | "movw %%ss, %%ax\n\t" | ||
44 | :"=a"(newregs->xss)); | ||
45 | } | ||
46 | |||
47 | /* | ||
48 | * This function is responsible for capturing register states if coming | ||
49 | * via panic otherwise just fix up the ss and esp if coming via kernel | ||
50 | * mode exception. | ||
51 | */ | ||
52 | static inline void crash_setup_regs(struct pt_regs *newregs, | ||
53 | struct pt_regs *oldregs) | ||
54 | { | ||
55 | if (oldregs) | ||
56 | crash_fixup_ss_esp(newregs, oldregs); | ||
57 | else { | ||
58 | __asm__ __volatile__("movl %%ebx,%0" : "=m"(newregs->ebx)); | ||
59 | __asm__ __volatile__("movl %%ecx,%0" : "=m"(newregs->ecx)); | ||
60 | __asm__ __volatile__("movl %%edx,%0" : "=m"(newregs->edx)); | ||
61 | __asm__ __volatile__("movl %%esi,%0" : "=m"(newregs->esi)); | ||
62 | __asm__ __volatile__("movl %%edi,%0" : "=m"(newregs->edi)); | ||
63 | __asm__ __volatile__("movl %%ebp,%0" : "=m"(newregs->ebp)); | ||
64 | __asm__ __volatile__("movl %%eax,%0" : "=m"(newregs->eax)); | ||
65 | __asm__ __volatile__("movl %%esp,%0" : "=m"(newregs->esp)); | ||
66 | __asm__ __volatile__("movw %%ss, %%ax;" :"=a"(newregs->xss)); | ||
67 | __asm__ __volatile__("movw %%cs, %%ax;" :"=a"(newregs->xcs)); | ||
68 | __asm__ __volatile__("movw %%ds, %%ax;" :"=a"(newregs->xds)); | ||
69 | __asm__ __volatile__("movw %%es, %%ax;" :"=a"(newregs->xes)); | ||
70 | __asm__ __volatile__("pushfl; popl %0" :"=m"(newregs->eflags)); | ||
71 | |||
72 | newregs->eip = (unsigned long)current_text_addr(); | ||
73 | } | ||
74 | } | ||
32 | 75 | ||
33 | #endif /* _I386_KEXEC_H */ | 76 | #endif /* _I386_KEXEC_H */ |
diff --git a/include/asm-i386/kprobes.h b/include/asm-i386/kprobes.h index ca916a892877..27cac050a60e 100644 --- a/include/asm-i386/kprobes.h +++ b/include/asm-i386/kprobes.h | |||
@@ -40,6 +40,7 @@ typedef u8 kprobe_opcode_t; | |||
40 | 40 | ||
41 | #define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry | 41 | #define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry |
42 | #define ARCH_SUPPORTS_KRETPROBES | 42 | #define ARCH_SUPPORTS_KRETPROBES |
43 | #define arch_remove_kprobe(p) do {} while (0) | ||
43 | 44 | ||
44 | void kretprobe_trampoline(void); | 45 | void kretprobe_trampoline(void); |
45 | 46 | ||
@@ -76,14 +77,6 @@ static inline void restore_interrupts(struct pt_regs *regs) | |||
76 | local_irq_enable(); | 77 | local_irq_enable(); |
77 | } | 78 | } |
78 | 79 | ||
79 | #ifdef CONFIG_KPROBES | ||
80 | extern int kprobe_exceptions_notify(struct notifier_block *self, | 80 | extern int kprobe_exceptions_notify(struct notifier_block *self, |
81 | unsigned long val, void *data); | 81 | unsigned long val, void *data); |
82 | #else /* !CONFIG_KPROBES */ | ||
83 | static inline int kprobe_exceptions_notify(struct notifier_block *self, | ||
84 | unsigned long val, void *data) | ||
85 | { | ||
86 | return 0; | ||
87 | } | ||
88 | #endif | ||
89 | #endif /* _ASM_KPROBES_H */ | 82 | #endif /* _ASM_KPROBES_H */ |
diff --git a/include/asm-i386/mach-default/mach_ipi.h b/include/asm-i386/mach-default/mach_ipi.h index cc756a67cd63..a1d0072e36bc 100644 --- a/include/asm-i386/mach-default/mach_ipi.h +++ b/include/asm-i386/mach-default/mach_ipi.h | |||
@@ -15,11 +15,9 @@ static inline void __local_send_IPI_allbutself(int vector) | |||
15 | { | 15 | { |
16 | if (no_broadcast) { | 16 | if (no_broadcast) { |
17 | cpumask_t mask = cpu_online_map; | 17 | cpumask_t mask = cpu_online_map; |
18 | int this_cpu = get_cpu(); | ||
19 | 18 | ||
20 | cpu_clear(this_cpu, mask); | 19 | cpu_clear(smp_processor_id(), mask); |
21 | send_IPI_mask(mask, vector); | 20 | send_IPI_mask(mask, vector); |
22 | put_cpu(); | ||
23 | } else | 21 | } else |
24 | __send_IPI_shortcut(APIC_DEST_ALLBUT, vector); | 22 | __send_IPI_shortcut(APIC_DEST_ALLBUT, vector); |
25 | } | 23 | } |
diff --git a/include/asm-i386/mutex.h b/include/asm-i386/mutex.h index 4e5e3de1b9a6..9b2199e829f3 100644 --- a/include/asm-i386/mutex.h +++ b/include/asm-i386/mutex.h | |||
@@ -28,7 +28,13 @@ do { \ | |||
28 | \ | 28 | \ |
29 | __asm__ __volatile__( \ | 29 | __asm__ __volatile__( \ |
30 | LOCK " decl (%%eax) \n" \ | 30 | LOCK " decl (%%eax) \n" \ |
31 | " js "#fail_fn" \n" \ | 31 | " js 2f \n" \ |
32 | "1: \n" \ | ||
33 | \ | ||
34 | LOCK_SECTION_START("") \ | ||
35 | "2: call "#fail_fn" \n" \ | ||
36 | " jmp 1b \n" \ | ||
37 | LOCK_SECTION_END \ | ||
32 | \ | 38 | \ |
33 | :"=a" (dummy) \ | 39 | :"=a" (dummy) \ |
34 | : "a" (count) \ | 40 | : "a" (count) \ |
@@ -78,7 +84,13 @@ do { \ | |||
78 | \ | 84 | \ |
79 | __asm__ __volatile__( \ | 85 | __asm__ __volatile__( \ |
80 | LOCK " incl (%%eax) \n" \ | 86 | LOCK " incl (%%eax) \n" \ |
81 | " jle "#fail_fn" \n" \ | 87 | " jle 2f \n" \ |
88 | "1: \n" \ | ||
89 | \ | ||
90 | LOCK_SECTION_START("") \ | ||
91 | "2: call "#fail_fn" \n" \ | ||
92 | " jmp 1b \n" \ | ||
93 | LOCK_SECTION_END \ | ||
82 | \ | 94 | \ |
83 | :"=a" (dummy) \ | 95 | :"=a" (dummy) \ |
84 | : "a" (count) \ | 96 | : "a" (count) \ |
@@ -113,7 +125,7 @@ __mutex_fastpath_trylock(atomic_t *count, int (*fail_fn)(atomic_t *)) | |||
113 | * the mutex state would be. | 125 | * the mutex state would be. |
114 | */ | 126 | */ |
115 | #ifdef __HAVE_ARCH_CMPXCHG | 127 | #ifdef __HAVE_ARCH_CMPXCHG |
116 | if (likely(atomic_cmpxchg(count, 1, 0)) == 1) | 128 | if (likely(atomic_cmpxchg(count, 1, 0) == 1)) |
117 | return 1; | 129 | return 1; |
118 | return 0; | 130 | return 0; |
119 | #else | 131 | #else |
diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h index 5c96cf6dcb39..feca5d961e2b 100644 --- a/include/asm-i386/processor.h +++ b/include/asm-i386/processor.h | |||
@@ -61,9 +61,11 @@ struct cpuinfo_x86 { | |||
61 | int x86_cache_size; /* in KB - valid for CPUS which support this | 61 | int x86_cache_size; /* in KB - valid for CPUS which support this |
62 | call */ | 62 | call */ |
63 | int x86_cache_alignment; /* In bytes */ | 63 | int x86_cache_alignment; /* In bytes */ |
64 | int fdiv_bug; | 64 | char fdiv_bug; |
65 | int f00f_bug; | 65 | char f00f_bug; |
66 | int coma_bug; | 66 | char coma_bug; |
67 | char pad0; | ||
68 | int x86_power; | ||
67 | unsigned long loops_per_jiffy; | 69 | unsigned long loops_per_jiffy; |
68 | unsigned char x86_max_cores; /* cpuid returned max cores value */ | 70 | unsigned char x86_max_cores; /* cpuid returned max cores value */ |
69 | unsigned char booted_cores; /* number of cores as seen by OS */ | 71 | unsigned char booted_cores; /* number of cores as seen by OS */ |
@@ -279,9 +281,11 @@ static inline void clear_in_cr4 (unsigned long mask) | |||
279 | outb((data), 0x23); \ | 281 | outb((data), 0x23); \ |
280 | } while (0) | 282 | } while (0) |
281 | 283 | ||
282 | static inline void serialize_cpu(void) | 284 | /* Stop speculative execution */ |
285 | static inline void sync_core(void) | ||
283 | { | 286 | { |
284 | __asm__ __volatile__ ("cpuid" : : : "ax", "bx", "cx", "dx"); | 287 | int tmp; |
288 | asm volatile("cpuid" : "=a" (tmp) : "0" (1) : "ebx","ecx","edx","memory"); | ||
285 | } | 289 | } |
286 | 290 | ||
287 | static inline void __monitor(const void *eax, unsigned long ecx, | 291 | static inline void __monitor(const void *eax, unsigned long ecx, |
@@ -557,10 +561,20 @@ unsigned long get_wchan(struct task_struct *p); | |||
557 | (unsigned long)(&__ptr[THREAD_SIZE_LONGS]); \ | 561 | (unsigned long)(&__ptr[THREAD_SIZE_LONGS]); \ |
558 | }) | 562 | }) |
559 | 563 | ||
564 | /* | ||
565 | * The below -8 is to reserve 8 bytes on top of the ring0 stack. | ||
566 | * This is necessary to guarantee that the entire "struct pt_regs" | ||
567 | * is accessable even if the CPU haven't stored the SS/ESP registers | ||
568 | * on the stack (interrupt gate does not save these registers | ||
569 | * when switching to the same priv ring). | ||
570 | * Therefore beware: accessing the xss/esp fields of the | ||
571 | * "struct pt_regs" is possible, but they may contain the | ||
572 | * completely wrong values. | ||
573 | */ | ||
560 | #define task_pt_regs(task) \ | 574 | #define task_pt_regs(task) \ |
561 | ({ \ | 575 | ({ \ |
562 | struct pt_regs *__regs__; \ | 576 | struct pt_regs *__regs__; \ |
563 | __regs__ = (struct pt_regs *)KSTK_TOP((task)->thread_info); \ | 577 | __regs__ = (struct pt_regs *)(KSTK_TOP(task_stack_page(task))-8); \ |
564 | __regs__ - 1; \ | 578 | __regs__ - 1; \ |
565 | }) | 579 | }) |
566 | 580 | ||
diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h index 9c0593b7a94e..36a92ed6a9d0 100644 --- a/include/asm-i386/system.h +++ b/include/asm-i386/system.h | |||
@@ -548,6 +548,15 @@ void enable_hlt(void); | |||
548 | extern int es7000_plat; | 548 | extern int es7000_plat; |
549 | void cpu_idle_wait(void); | 549 | void cpu_idle_wait(void); |
550 | 550 | ||
551 | /* | ||
552 | * On SMP systems, when the scheduler does migration-cost autodetection, | ||
553 | * it needs a way to flush as much of the CPU's caches as possible: | ||
554 | */ | ||
555 | static inline void sched_cacheflush(void) | ||
556 | { | ||
557 | wbinvd(); | ||
558 | } | ||
559 | |||
551 | extern unsigned long arch_align_stack(unsigned long sp); | 560 | extern unsigned long arch_align_stack(unsigned long sp); |
552 | 561 | ||
553 | #endif | 562 | #endif |
diff --git a/include/asm-i386/thread_info.h b/include/asm-i386/thread_info.h index 8fbf791651bf..2493e77e8c30 100644 --- a/include/asm-i386/thread_info.h +++ b/include/asm-i386/thread_info.h | |||
@@ -111,8 +111,6 @@ register unsigned long current_stack_pointer asm("esp") __attribute_used__; | |||
111 | #endif | 111 | #endif |
112 | 112 | ||
113 | #define free_thread_info(info) kfree(info) | 113 | #define free_thread_info(info) kfree(info) |
114 | #define get_thread_info(ti) get_task_struct((ti)->task) | ||
115 | #define put_thread_info(ti) put_task_struct((ti)->task) | ||
116 | 114 | ||
117 | #else /* !__ASSEMBLY__ */ | 115 | #else /* !__ASSEMBLY__ */ |
118 | 116 | ||
diff --git a/include/asm-i386/topology.h b/include/asm-i386/topology.h index 0ec27c9e8e45..d7e19eb344b7 100644 --- a/include/asm-i386/topology.h +++ b/include/asm-i386/topology.h | |||
@@ -72,7 +72,6 @@ static inline int node_to_first_cpu(int node) | |||
72 | .max_interval = 32, \ | 72 | .max_interval = 32, \ |
73 | .busy_factor = 32, \ | 73 | .busy_factor = 32, \ |
74 | .imbalance_pct = 125, \ | 74 | .imbalance_pct = 125, \ |
75 | .cache_hot_time = (10*1000000), \ | ||
76 | .cache_nice_tries = 1, \ | 75 | .cache_nice_tries = 1, \ |
77 | .busy_idx = 3, \ | 76 | .busy_idx = 3, \ |
78 | .idle_idx = 1, \ | 77 | .idle_idx = 1, \ |
diff --git a/include/asm-ia64/compat.h b/include/asm-ia64/compat.h index aaf11f4e9169..c0b19106665c 100644 --- a/include/asm-ia64/compat.h +++ b/include/asm-ia64/compat.h | |||
@@ -192,7 +192,7 @@ compat_ptr (compat_uptr_t uptr) | |||
192 | static __inline__ void __user * | 192 | static __inline__ void __user * |
193 | compat_alloc_user_space (long len) | 193 | compat_alloc_user_space (long len) |
194 | { | 194 | { |
195 | struct pt_regs *regs = ia64_task_regs(current); | 195 | struct pt_regs *regs = task_pt_regs(current); |
196 | return (void __user *) (((regs->r12 & 0xffffffff) & -16) - len); | 196 | return (void __user *) (((regs->r12 & 0xffffffff) & -16) - len); |
197 | } | 197 | } |
198 | 198 | ||
diff --git a/include/asm-ia64/ioctl.h b/include/asm-ia64/ioctl.h index be9cc2403d2a..b279fe06dfe5 100644 --- a/include/asm-ia64/ioctl.h +++ b/include/asm-ia64/ioctl.h | |||
@@ -1,77 +1 @@ | |||
1 | #ifndef _ASM_IA64_IOCTL_H | #include <asm-generic/ioctl.h> | |
2 | #define _ASM_IA64_IOCTL_H | ||
3 | |||
4 | /* | ||
5 | * Based on <asm-i386/ioctl.h>. | ||
6 | * | ||
7 | * Modified 1998, 1999 | ||
8 | * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co | ||
9 | */ | ||
10 | |||
11 | /* ioctl command encoding: 32 bits total, command in lower 16 bits, | ||
12 | * size of the parameter structure in the lower 14 bits of the | ||
13 | * upper 16 bits. | ||
14 | * Encoding the size of the parameter structure in the ioctl request | ||
15 | * is useful for catching programs compiled with old versions | ||
16 | * and to avoid overwriting user space outside the user buffer area. | ||
17 | * The highest 2 bits are reserved for indicating the ``access mode''. | ||
18 | * NOTE: This limits the max parameter size to 16kB -1 ! | ||
19 | */ | ||
20 | |||
21 | /* | ||
22 | * The following is for compatibility across the various Linux | ||
23 | * platforms. The ia64 ioctl numbering scheme doesn't really enforce | ||
24 | * a type field. De facto, however, the top 8 bits of the lower 16 | ||
25 | * bits are indeed used as a type field, so we might just as well make | ||
26 | * this explicit here. Please be sure to use the decoding macros | ||
27 | * below from now on. | ||
28 | */ | ||
29 | #define _IOC_NRBITS 8 | ||
30 | #define _IOC_TYPEBITS 8 | ||
31 | #define _IOC_SIZEBITS 14 | ||
32 | #define _IOC_DIRBITS 2 | ||
33 | |||
34 | #define _IOC_NRMASK ((1 << _IOC_NRBITS)-1) | ||
35 | #define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1) | ||
36 | #define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1) | ||
37 | #define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1) | ||
38 | |||
39 | #define _IOC_NRSHIFT 0 | ||
40 | #define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS) | ||
41 | #define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS) | ||
42 | #define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS) | ||
43 | |||
44 | /* | ||
45 | * Direction bits. | ||
46 | */ | ||
47 | #define _IOC_NONE 0U | ||
48 | #define _IOC_WRITE 1U | ||
49 | #define _IOC_READ 2U | ||
50 | |||
51 | #define _IOC(dir,type,nr,size) \ | ||
52 | (((dir) << _IOC_DIRSHIFT) | \ | ||
53 | ((type) << _IOC_TYPESHIFT) | \ | ||
54 | ((nr) << _IOC_NRSHIFT) | \ | ||
55 | ((size) << _IOC_SIZESHIFT)) | ||
56 | |||
57 | /* used to create numbers */ | ||
58 | #define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0) | ||
59 | #define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size)) | ||
60 | #define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size)) | ||
61 | #define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size)) | ||
62 | |||
63 | /* used to decode ioctl numbers.. */ | ||
64 | #define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) | ||
65 | #define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK) | ||
66 | #define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK) | ||
67 | #define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK) | ||
68 | |||
69 | /* ...and for the drivers/sound files... */ | ||
70 | |||
71 | #define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT) | ||
72 | #define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT) | ||
73 | #define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT) | ||
74 | #define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT) | ||
75 | #define IOCSIZE_SHIFT (_IOC_SIZESHIFT) | ||
76 | |||
77 | #endif /* _ASM_IA64_IOCTL_H */ | ||
diff --git a/include/asm-ia64/kprobes.h b/include/asm-ia64/kprobes.h index 592abb000e29..a74b68104559 100644 --- a/include/asm-ia64/kprobes.h +++ b/include/asm-ia64/kprobes.h | |||
@@ -89,6 +89,7 @@ struct kprobe_ctlblk { | |||
89 | #define IP_RELATIVE_PREDICT_OPCODE (7) | 89 | #define IP_RELATIVE_PREDICT_OPCODE (7) |
90 | #define LONG_BRANCH_OPCODE (0xC) | 90 | #define LONG_BRANCH_OPCODE (0xC) |
91 | #define LONG_CALL_OPCODE (0xD) | 91 | #define LONG_CALL_OPCODE (0xD) |
92 | #define arch_remove_kprobe(p) do {} while (0) | ||
92 | 93 | ||
93 | typedef struct kprobe_opcode { | 94 | typedef struct kprobe_opcode { |
94 | bundle_t bundle; | 95 | bundle_t bundle; |
@@ -110,12 +111,6 @@ struct arch_specific_insn { | |||
110 | unsigned short target_br_reg; | 111 | unsigned short target_br_reg; |
111 | }; | 112 | }; |
112 | 113 | ||
113 | /* ia64 does not need this */ | ||
114 | static inline void arch_copy_kprobe(struct kprobe *p) | ||
115 | { | ||
116 | } | ||
117 | |||
118 | #ifdef CONFIG_KPROBES | ||
119 | extern int kprobe_exceptions_notify(struct notifier_block *self, | 114 | extern int kprobe_exceptions_notify(struct notifier_block *self, |
120 | unsigned long val, void *data); | 115 | unsigned long val, void *data); |
121 | 116 | ||
@@ -124,11 +119,4 @@ static inline void jprobe_return(void) | |||
124 | { | 119 | { |
125 | } | 120 | } |
126 | 121 | ||
127 | #else /* !CONFIG_KPROBES */ | ||
128 | static inline int kprobe_exceptions_notify(struct notifier_block *self, | ||
129 | unsigned long val, void *data) | ||
130 | { | ||
131 | return 0; | ||
132 | } | ||
133 | #endif | ||
134 | #endif /* _ASM_KPROBES_H */ | 122 | #endif /* _ASM_KPROBES_H */ |
diff --git a/include/asm-ia64/processor.h b/include/asm-ia64/processor.h index 94e07e727395..8c648bf72bbd 100644 --- a/include/asm-ia64/processor.h +++ b/include/asm-ia64/processor.h | |||
@@ -352,7 +352,7 @@ extern unsigned long get_wchan (struct task_struct *p); | |||
352 | /* Return instruction pointer of blocked task TSK. */ | 352 | /* Return instruction pointer of blocked task TSK. */ |
353 | #define KSTK_EIP(tsk) \ | 353 | #define KSTK_EIP(tsk) \ |
354 | ({ \ | 354 | ({ \ |
355 | struct pt_regs *_regs = ia64_task_regs(tsk); \ | 355 | struct pt_regs *_regs = task_pt_regs(tsk); \ |
356 | _regs->cr_iip + ia64_psr(_regs)->ri; \ | 356 | _regs->cr_iip + ia64_psr(_regs)->ri; \ |
357 | }) | 357 | }) |
358 | 358 | ||
diff --git a/include/asm-ia64/ptrace.h b/include/asm-ia64/ptrace.h index 2c703d6e0c86..9471cdc3f4c0 100644 --- a/include/asm-ia64/ptrace.h +++ b/include/asm-ia64/ptrace.h | |||
@@ -248,7 +248,7 @@ struct switch_stack { | |||
248 | }) | 248 | }) |
249 | 249 | ||
250 | /* given a pointer to a task_struct, return the user's pt_regs */ | 250 | /* given a pointer to a task_struct, return the user's pt_regs */ |
251 | # define ia64_task_regs(t) (((struct pt_regs *) ((char *) (t) + IA64_STK_OFFSET)) - 1) | 251 | # define task_pt_regs(t) (((struct pt_regs *) ((char *) (t) + IA64_STK_OFFSET)) - 1) |
252 | # define ia64_psr(regs) ((struct ia64_psr *) &(regs)->cr_ipsr) | 252 | # define ia64_psr(regs) ((struct ia64_psr *) &(regs)->cr_ipsr) |
253 | # define user_mode(regs) (((struct ia64_psr *) &(regs)->cr_ipsr)->cpl != 0) | 253 | # define user_mode(regs) (((struct ia64_psr *) &(regs)->cr_ipsr)->cpl != 0) |
254 | # define user_stack(task,regs) ((long) regs - (long) task == IA64_STK_OFFSET - sizeof(*regs)) | 254 | # define user_stack(task,regs) ((long) regs - (long) task == IA64_STK_OFFSET - sizeof(*regs)) |
@@ -271,7 +271,7 @@ struct switch_stack { | |||
271 | * | 271 | * |
272 | * On ia64, we can clear the user's pt_regs->r8 to force a successful syscall. | 272 | * On ia64, we can clear the user's pt_regs->r8 to force a successful syscall. |
273 | */ | 273 | */ |
274 | # define force_successful_syscall_return() (ia64_task_regs(current)->r8 = 0) | 274 | # define force_successful_syscall_return() (task_pt_regs(current)->r8 = 0) |
275 | 275 | ||
276 | struct task_struct; /* forward decl */ | 276 | struct task_struct; /* forward decl */ |
277 | struct unw_frame_info; /* forward decl */ | 277 | struct unw_frame_info; /* forward decl */ |
diff --git a/include/asm-ia64/system.h b/include/asm-ia64/system.h index 635235fa1e32..80c5a234e259 100644 --- a/include/asm-ia64/system.h +++ b/include/asm-ia64/system.h | |||
@@ -219,14 +219,14 @@ extern void ia64_load_extra (struct task_struct *task); | |||
219 | 219 | ||
220 | #define IA64_HAS_EXTRA_STATE(t) \ | 220 | #define IA64_HAS_EXTRA_STATE(t) \ |
221 | ((t)->thread.flags & (IA64_THREAD_DBG_VALID|IA64_THREAD_PM_VALID) \ | 221 | ((t)->thread.flags & (IA64_THREAD_DBG_VALID|IA64_THREAD_PM_VALID) \ |
222 | || IS_IA32_PROCESS(ia64_task_regs(t)) || PERFMON_IS_SYSWIDE()) | 222 | || IS_IA32_PROCESS(task_pt_regs(t)) || PERFMON_IS_SYSWIDE()) |
223 | 223 | ||
224 | #define __switch_to(prev,next,last) do { \ | 224 | #define __switch_to(prev,next,last) do { \ |
225 | if (IA64_HAS_EXTRA_STATE(prev)) \ | 225 | if (IA64_HAS_EXTRA_STATE(prev)) \ |
226 | ia64_save_extra(prev); \ | 226 | ia64_save_extra(prev); \ |
227 | if (IA64_HAS_EXTRA_STATE(next)) \ | 227 | if (IA64_HAS_EXTRA_STATE(next)) \ |
228 | ia64_load_extra(next); \ | 228 | ia64_load_extra(next); \ |
229 | ia64_psr(ia64_task_regs(next))->dfh = !ia64_is_local_fpu_owner(next); \ | 229 | ia64_psr(task_pt_regs(next))->dfh = !ia64_is_local_fpu_owner(next); \ |
230 | (last) = ia64_switch_to((next)); \ | 230 | (last) = ia64_switch_to((next)); \ |
231 | } while (0) | 231 | } while (0) |
232 | 232 | ||
@@ -238,8 +238,8 @@ extern void ia64_load_extra (struct task_struct *task); | |||
238 | * the latest fph state from another CPU. In other words: eager save, lazy restore. | 238 | * the latest fph state from another CPU. In other words: eager save, lazy restore. |
239 | */ | 239 | */ |
240 | # define switch_to(prev,next,last) do { \ | 240 | # define switch_to(prev,next,last) do { \ |
241 | if (ia64_psr(ia64_task_regs(prev))->mfh && ia64_is_local_fpu_owner(prev)) { \ | 241 | if (ia64_psr(task_pt_regs(prev))->mfh && ia64_is_local_fpu_owner(prev)) { \ |
242 | ia64_psr(ia64_task_regs(prev))->mfh = 0; \ | 242 | ia64_psr(task_pt_regs(prev))->mfh = 0; \ |
243 | (prev)->thread.flags |= IA64_THREAD_FPH_VALID; \ | 243 | (prev)->thread.flags |= IA64_THREAD_FPH_VALID; \ |
244 | __ia64_save_fpu((prev)->thread.fph); \ | 244 | __ia64_save_fpu((prev)->thread.fph); \ |
245 | } \ | 245 | } \ |
@@ -279,6 +279,7 @@ extern void ia64_load_extra (struct task_struct *task); | |||
279 | #define ia64_platform_is(x) (strcmp(x, platform_name) == 0) | 279 | #define ia64_platform_is(x) (strcmp(x, platform_name) == 0) |
280 | 280 | ||
281 | void cpu_idle_wait(void); | 281 | void cpu_idle_wait(void); |
282 | void sched_cacheflush(void); | ||
282 | 283 | ||
283 | #define arch_align_stack(x) (x) | 284 | #define arch_align_stack(x) (x) |
284 | 285 | ||
diff --git a/include/asm-ia64/thread_info.h b/include/asm-ia64/thread_info.h index 171b2207bde4..653bb7f9a753 100644 --- a/include/asm-ia64/thread_info.h +++ b/include/asm-ia64/thread_info.h | |||
@@ -57,11 +57,20 @@ struct thread_info { | |||
57 | /* how to get the thread information struct from C */ | 57 | /* how to get the thread information struct from C */ |
58 | #define current_thread_info() ((struct thread_info *) ((char *) current + IA64_TASK_SIZE)) | 58 | #define current_thread_info() ((struct thread_info *) ((char *) current + IA64_TASK_SIZE)) |
59 | #define alloc_thread_info(tsk) ((struct thread_info *) ((char *) (tsk) + IA64_TASK_SIZE)) | 59 | #define alloc_thread_info(tsk) ((struct thread_info *) ((char *) (tsk) + IA64_TASK_SIZE)) |
60 | #define task_thread_info(tsk) ((struct thread_info *) ((char *) (tsk) + IA64_TASK_SIZE)) | ||
60 | #else | 61 | #else |
61 | #define current_thread_info() ((struct thread_info *) 0) | 62 | #define current_thread_info() ((struct thread_info *) 0) |
62 | #define alloc_thread_info(tsk) ((struct thread_info *) 0) | 63 | #define alloc_thread_info(tsk) ((struct thread_info *) 0) |
64 | #define task_thread_info(tsk) ((struct thread_info *) 0) | ||
63 | #endif | 65 | #endif |
64 | #define free_thread_info(ti) /* nothing */ | 66 | #define free_thread_info(ti) /* nothing */ |
67 | #define task_stack_page(tsk) ((void *)(tsk)) | ||
68 | |||
69 | #define __HAVE_THREAD_FUNCTIONS | ||
70 | #define setup_thread_stack(p, org) \ | ||
71 | *task_thread_info(p) = *task_thread_info(org); \ | ||
72 | task_thread_info(p)->task = (p); | ||
73 | #define end_of_stack(p) (unsigned long *)((void *)(p) + IA64_RBS_OFFSET) | ||
65 | 74 | ||
66 | #define __HAVE_ARCH_TASK_STRUCT_ALLOCATOR | 75 | #define __HAVE_ARCH_TASK_STRUCT_ALLOCATOR |
67 | #define alloc_task_struct() ((task_t *)__get_free_pages(GFP_KERNEL, KERNEL_STACK_SIZE_ORDER)) | 76 | #define alloc_task_struct() ((task_t *)__get_free_pages(GFP_KERNEL, KERNEL_STACK_SIZE_ORDER)) |
diff --git a/include/asm-ia64/topology.h b/include/asm-ia64/topology.h index f7c330467e7e..d8aae4da3978 100644 --- a/include/asm-ia64/topology.h +++ b/include/asm-ia64/topology.h | |||
@@ -55,7 +55,6 @@ void build_cpu_to_node_map(void); | |||
55 | .max_interval = 4, \ | 55 | .max_interval = 4, \ |
56 | .busy_factor = 64, \ | 56 | .busy_factor = 64, \ |
57 | .imbalance_pct = 125, \ | 57 | .imbalance_pct = 125, \ |
58 | .cache_hot_time = (10*1000000), \ | ||
59 | .per_cpu_gain = 100, \ | 58 | .per_cpu_gain = 100, \ |
60 | .cache_nice_tries = 2, \ | 59 | .cache_nice_tries = 2, \ |
61 | .busy_idx = 2, \ | 60 | .busy_idx = 2, \ |
@@ -81,7 +80,6 @@ void build_cpu_to_node_map(void); | |||
81 | .max_interval = 8*(min(num_online_cpus(), 32)), \ | 80 | .max_interval = 8*(min(num_online_cpus(), 32)), \ |
82 | .busy_factor = 64, \ | 81 | .busy_factor = 64, \ |
83 | .imbalance_pct = 125, \ | 82 | .imbalance_pct = 125, \ |
84 | .cache_hot_time = (10*1000000), \ | ||
85 | .cache_nice_tries = 2, \ | 83 | .cache_nice_tries = 2, \ |
86 | .busy_idx = 3, \ | 84 | .busy_idx = 3, \ |
87 | .idle_idx = 2, \ | 85 | .idle_idx = 2, \ |
diff --git a/include/asm-m32r/ioctl.h b/include/asm-m32r/ioctl.h index 87d8f7db6af1..b279fe06dfe5 100644 --- a/include/asm-m32r/ioctl.h +++ b/include/asm-m32r/ioctl.h | |||
@@ -1,78 +1 @@ | |||
1 | #ifndef _ASM_M32R_IOCTL_H | #include <asm-generic/ioctl.h> | |
2 | #define _ASM_M32R_IOCTL_H | ||
3 | |||
4 | /* $Id$ */ | ||
5 | |||
6 | /* orig : i386 2.4.18 */ | ||
7 | |||
8 | /* | ||
9 | * linux/ioctl.h for Linux by H.H. Bergman. | ||
10 | */ | ||
11 | |||
12 | /* ioctl command encoding: 32 bits total, command in lower 16 bits, | ||
13 | * size of the parameter structure in the lower 14 bits of the | ||
14 | * upper 16 bits. | ||
15 | * Encoding the size of the parameter structure in the ioctl request | ||
16 | * is useful for catching programs compiled with old versions | ||
17 | * and to avoid overwriting user space outside the user buffer area. | ||
18 | * The highest 2 bits are reserved for indicating the ``access mode''. | ||
19 | * NOTE: This limits the max parameter size to 16kB -1 ! | ||
20 | */ | ||
21 | |||
22 | /* | ||
23 | * The following is for compatibility across the various Linux | ||
24 | * platforms. The i386 ioctl numbering scheme doesn't really enforce | ||
25 | * a type field. De facto, however, the top 8 bits of the lower 16 | ||
26 | * bits are indeed used as a type field, so we might just as well make | ||
27 | * this explicit here. Please be sure to use the decoding macros | ||
28 | * below from now on. | ||
29 | */ | ||
30 | #define _IOC_NRBITS 8 | ||
31 | #define _IOC_TYPEBITS 8 | ||
32 | #define _IOC_SIZEBITS 14 | ||
33 | #define _IOC_DIRBITS 2 | ||
34 | |||
35 | #define _IOC_NRMASK ((1 << _IOC_NRBITS)-1) | ||
36 | #define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1) | ||
37 | #define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1) | ||
38 | #define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1) | ||
39 | |||
40 | #define _IOC_NRSHIFT 0 | ||
41 | #define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS) | ||
42 | #define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS) | ||
43 | #define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS) | ||
44 | |||
45 | /* | ||
46 | * Direction bits. | ||
47 | */ | ||
48 | #define _IOC_NONE 0U | ||
49 | #define _IOC_WRITE 1U | ||
50 | #define _IOC_READ 2U | ||
51 | |||
52 | #define _IOC(dir,type,nr,size) \ | ||
53 | (((dir) << _IOC_DIRSHIFT) | \ | ||
54 | ((type) << _IOC_TYPESHIFT) | \ | ||
55 | ((nr) << _IOC_NRSHIFT) | \ | ||
56 | ((size) << _IOC_SIZESHIFT)) | ||
57 | |||
58 | /* used to create numbers */ | ||
59 | #define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0) | ||
60 | #define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size)) | ||
61 | #define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size)) | ||
62 | #define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size)) | ||
63 | |||
64 | /* used to decode ioctl numbers.. */ | ||
65 | #define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) | ||
66 | #define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK) | ||
67 | #define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK) | ||
68 | #define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK) | ||
69 | |||
70 | /* ...and for the drivers/sound files... */ | ||
71 | |||
72 | #define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT) | ||
73 | #define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT) | ||
74 | #define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT) | ||
75 | #define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT) | ||
76 | #define IOCSIZE_SHIFT (_IOC_SIZESHIFT) | ||
77 | |||
78 | #endif /* _ASM_M32R_IOCTL_H */ | ||
diff --git a/include/asm-m32r/ptrace.h b/include/asm-m32r/ptrace.h index 55cd7ecfde43..0d058b2d844e 100644 --- a/include/asm-m32r/ptrace.h +++ b/include/asm-m32r/ptrace.h | |||
@@ -163,6 +163,9 @@ extern void show_regs(struct pt_regs *); | |||
163 | 163 | ||
164 | extern void withdraw_debug_trap(struct pt_regs *regs); | 164 | extern void withdraw_debug_trap(struct pt_regs *regs); |
165 | 165 | ||
166 | #define task_pt_regs(task) \ | ||
167 | ((struct pt_regs *)(task_stack_page(task) + THREAD_SIZE) - 1) | ||
168 | |||
166 | #endif /* __KERNEL */ | 169 | #endif /* __KERNEL */ |
167 | 170 | ||
168 | #endif /* _ASM_M32R_PTRACE_H */ | 171 | #endif /* _ASM_M32R_PTRACE_H */ |
diff --git a/include/asm-m32r/system.h b/include/asm-m32r/system.h index dcf619a0a0b0..06c12a037cba 100644 --- a/include/asm-m32r/system.h +++ b/include/asm-m32r/system.h | |||
@@ -68,6 +68,16 @@ | |||
68 | last = __last; \ | 68 | last = __last; \ |
69 | } while(0) | 69 | } while(0) |
70 | 70 | ||
71 | /* | ||
72 | * On SMP systems, when the scheduler does migration-cost autodetection, | ||
73 | * it needs a way to flush as much of the CPU's caches as possible. | ||
74 | * | ||
75 | * TODO: fill this in! | ||
76 | */ | ||
77 | static inline void sched_cacheflush(void) | ||
78 | { | ||
79 | } | ||
80 | |||
71 | /* Interrupt Control */ | 81 | /* Interrupt Control */ |
72 | #if !defined(CONFIG_CHIP_M32102) && !defined(CONFIG_CHIP_M32104) | 82 | #if !defined(CONFIG_CHIP_M32102) && !defined(CONFIG_CHIP_M32104) |
73 | #define local_irq_enable() \ | 83 | #define local_irq_enable() \ |
diff --git a/include/asm-m32r/thread_info.h b/include/asm-m32r/thread_info.h index 0f589363f619..22aff3222d22 100644 --- a/include/asm-m32r/thread_info.h +++ b/include/asm-m32r/thread_info.h | |||
@@ -110,8 +110,6 @@ static inline struct thread_info *current_thread_info(void) | |||
110 | #endif | 110 | #endif |
111 | 111 | ||
112 | #define free_thread_info(info) kfree(info) | 112 | #define free_thread_info(info) kfree(info) |
113 | #define get_thread_info(ti) get_task_struct((ti)->task) | ||
114 | #define put_thread_info(ti) put_task_struct((ti)->task) | ||
115 | 113 | ||
116 | #define TI_FLAG_FAULT_CODE_SHIFT 28 | 114 | #define TI_FLAG_FAULT_CODE_SHIFT 28 |
117 | 115 | ||
diff --git a/include/asm-m68k/amigahw.h b/include/asm-m68k/amigahw.h index 3ae5d8d55ba9..a16fe4e5a28a 100644 --- a/include/asm-m68k/amigahw.h +++ b/include/asm-m68k/amigahw.h | |||
@@ -274,7 +274,7 @@ struct CIA { | |||
274 | #define ZTWO_VADDR(x) (((unsigned long)(x))+zTwoBase) | 274 | #define ZTWO_VADDR(x) (((unsigned long)(x))+zTwoBase) |
275 | 275 | ||
276 | #define CUSTOM_PHYSADDR (0xdff000) | 276 | #define CUSTOM_PHYSADDR (0xdff000) |
277 | #define custom ((*(volatile struct CUSTOM *)(zTwoBase+CUSTOM_PHYSADDR))) | 277 | #define amiga_custom ((*(volatile struct CUSTOM *)(zTwoBase+CUSTOM_PHYSADDR))) |
278 | 278 | ||
279 | #define CIAA_PHYSADDR (0xbfe001) | 279 | #define CIAA_PHYSADDR (0xbfe001) |
280 | #define CIAB_PHYSADDR (0xbfd000) | 280 | #define CIAB_PHYSADDR (0xbfd000) |
@@ -294,12 +294,12 @@ static inline void amifb_video_off(void) | |||
294 | { | 294 | { |
295 | if (amiga_chipset == CS_ECS || amiga_chipset == CS_AGA) { | 295 | if (amiga_chipset == CS_ECS || amiga_chipset == CS_AGA) { |
296 | /* program Denise/Lisa for a higher maximum play rate */ | 296 | /* program Denise/Lisa for a higher maximum play rate */ |
297 | custom.htotal = 113; /* 31 kHz */ | 297 | amiga_custom.htotal = 113; /* 31 kHz */ |
298 | custom.vtotal = 223; /* 70 Hz */ | 298 | amiga_custom.vtotal = 223; /* 70 Hz */ |
299 | custom.beamcon0 = 0x4390; /* HARDDIS, VAR{BEAM,VSY,HSY,CSY}EN */ | 299 | amiga_custom.beamcon0 = 0x4390; /* HARDDIS, VAR{BEAM,VSY,HSY,CSY}EN */ |
300 | /* suspend the monitor */ | 300 | /* suspend the monitor */ |
301 | custom.hsstrt = custom.hsstop = 116; | 301 | amiga_custom.hsstrt = amiga_custom.hsstop = 116; |
302 | custom.vsstrt = custom.vsstop = 226; | 302 | amiga_custom.vsstrt = amiga_custom.vsstop = 226; |
303 | amiga_audio_min_period = 57; | 303 | amiga_audio_min_period = 57; |
304 | } | 304 | } |
305 | } | 305 | } |
diff --git a/include/asm-m68k/amigaints.h b/include/asm-m68k/amigaints.h index 2aff4cfbf7b3..aa968d014bb6 100644 --- a/include/asm-m68k/amigaints.h +++ b/include/asm-m68k/amigaints.h | |||
@@ -109,8 +109,6 @@ | |||
109 | extern void amiga_do_irq(int irq, struct pt_regs *fp); | 109 | extern void amiga_do_irq(int irq, struct pt_regs *fp); |
110 | extern void amiga_do_irq_list(int irq, struct pt_regs *fp); | 110 | extern void amiga_do_irq_list(int irq, struct pt_regs *fp); |
111 | 111 | ||
112 | extern unsigned short amiga_intena_vals[]; | ||
113 | |||
114 | /* CIA interrupt control register bits */ | 112 | /* CIA interrupt control register bits */ |
115 | 113 | ||
116 | #define CIA_ICR_TA 0x01 | 114 | #define CIA_ICR_TA 0x01 |
diff --git a/include/asm-m68k/checksum.h b/include/asm-m68k/checksum.h index 78860c20db01..17280ef719f5 100644 --- a/include/asm-m68k/checksum.h +++ b/include/asm-m68k/checksum.h | |||
@@ -25,7 +25,7 @@ unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum) | |||
25 | * better 64-bit) boundary | 25 | * better 64-bit) boundary |
26 | */ | 26 | */ |
27 | 27 | ||
28 | extern unsigned int csum_partial_copy_from_user(const unsigned char *src, | 28 | extern unsigned int csum_partial_copy_from_user(const unsigned char __user *src, |
29 | unsigned char *dst, | 29 | unsigned char *dst, |
30 | int len, int sum, | 30 | int len, int sum, |
31 | int *csum_err); | 31 | int *csum_err); |
diff --git a/include/asm-m68k/dsp56k.h b/include/asm-m68k/dsp56k.h index ab3dd33e23a1..2d8c0c9f794b 100644 --- a/include/asm-m68k/dsp56k.h +++ b/include/asm-m68k/dsp56k.h | |||
@@ -13,7 +13,7 @@ | |||
13 | /* Used for uploading DSP binary code */ | 13 | /* Used for uploading DSP binary code */ |
14 | struct dsp56k_upload { | 14 | struct dsp56k_upload { |
15 | int len; | 15 | int len; |
16 | char *bin; | 16 | char __user *bin; |
17 | }; | 17 | }; |
18 | 18 | ||
19 | /* For the DSP host flags */ | 19 | /* For the DSP host flags */ |
diff --git a/include/asm-m68k/floppy.h b/include/asm-m68k/floppy.h index c6e708dd9f62..63a05ed95c17 100644 --- a/include/asm-m68k/floppy.h +++ b/include/asm-m68k/floppy.h | |||
@@ -46,7 +46,7 @@ asmlinkage irqreturn_t floppy_hardint(int irq, void *dev_id, | |||
46 | 46 | ||
47 | static int virtual_dma_count=0; | 47 | static int virtual_dma_count=0; |
48 | static int virtual_dma_residue=0; | 48 | static int virtual_dma_residue=0; |
49 | static char *virtual_dma_addr=0; | 49 | static char *virtual_dma_addr=NULL; |
50 | static int virtual_dma_mode=0; | 50 | static int virtual_dma_mode=0; |
51 | static int doing_pdma=0; | 51 | static int doing_pdma=0; |
52 | 52 | ||
diff --git a/include/asm-m68k/hardirq.h b/include/asm-m68k/hardirq.h index 728318bf7f0e..5e1c5826c83d 100644 --- a/include/asm-m68k/hardirq.h +++ b/include/asm-m68k/hardirq.h | |||
@@ -14,13 +14,4 @@ typedef struct { | |||
14 | 14 | ||
15 | #define HARDIRQ_BITS 8 | 15 | #define HARDIRQ_BITS 8 |
16 | 16 | ||
17 | /* | ||
18 | * The hardirq mask has to be large enough to have | ||
19 | * space for potentially all IRQ sources in the system | ||
20 | * nesting on a single CPU: | ||
21 | */ | ||
22 | #if (1 << HARDIRQ_BITS) < NR_IRQS | ||
23 | # error HARDIRQ_BITS is too low! | ||
24 | #endif | ||
25 | |||
26 | #endif | 17 | #endif |
diff --git a/include/asm-m68k/io.h b/include/asm-m68k/io.h index 6bb8b0d8f99d..dcfaa352d34c 100644 --- a/include/asm-m68k/io.h +++ b/include/asm-m68k/io.h | |||
@@ -24,6 +24,7 @@ | |||
24 | #ifdef __KERNEL__ | 24 | #ifdef __KERNEL__ |
25 | 25 | ||
26 | #include <linux/config.h> | 26 | #include <linux/config.h> |
27 | #include <linux/compiler.h> | ||
27 | #include <asm/raw_io.h> | 28 | #include <asm/raw_io.h> |
28 | #include <asm/virtconvert.h> | 29 | #include <asm/virtconvert.h> |
29 | 30 | ||
@@ -120,68 +121,68 @@ extern int isa_sex; | |||
120 | * be compiled in so the case statement will be optimised away | 121 | * be compiled in so the case statement will be optimised away |
121 | */ | 122 | */ |
122 | 123 | ||
123 | static inline u8 *isa_itb(unsigned long addr) | 124 | static inline u8 __iomem *isa_itb(unsigned long addr) |
124 | { | 125 | { |
125 | switch(ISA_TYPE) | 126 | switch(ISA_TYPE) |
126 | { | 127 | { |
127 | #ifdef CONFIG_Q40 | 128 | #ifdef CONFIG_Q40 |
128 | case Q40_ISA: return (u8 *)Q40_ISA_IO_B(addr); | 129 | case Q40_ISA: return (u8 __iomem *)Q40_ISA_IO_B(addr); |
129 | #endif | 130 | #endif |
130 | #ifdef CONFIG_GG2 | 131 | #ifdef CONFIG_GG2 |
131 | case GG2_ISA: return (u8 *)GG2_ISA_IO_B(addr); | 132 | case GG2_ISA: return (u8 __iomem *)GG2_ISA_IO_B(addr); |
132 | #endif | 133 | #endif |
133 | #ifdef CONFIG_AMIGA_PCMCIA | 134 | #ifdef CONFIG_AMIGA_PCMCIA |
134 | case AG_ISA: return (u8 *)AG_ISA_IO_B(addr); | 135 | case AG_ISA: return (u8 __iomem *)AG_ISA_IO_B(addr); |
135 | #endif | 136 | #endif |
136 | default: return 0; /* avoid warnings, just in case */ | 137 | default: return NULL; /* avoid warnings, just in case */ |
137 | } | 138 | } |
138 | } | 139 | } |
139 | static inline u16 *isa_itw(unsigned long addr) | 140 | static inline u16 __iomem *isa_itw(unsigned long addr) |
140 | { | 141 | { |
141 | switch(ISA_TYPE) | 142 | switch(ISA_TYPE) |
142 | { | 143 | { |
143 | #ifdef CONFIG_Q40 | 144 | #ifdef CONFIG_Q40 |
144 | case Q40_ISA: return (u16 *)Q40_ISA_IO_W(addr); | 145 | case Q40_ISA: return (u16 __iomem *)Q40_ISA_IO_W(addr); |
145 | #endif | 146 | #endif |
146 | #ifdef CONFIG_GG2 | 147 | #ifdef CONFIG_GG2 |
147 | case GG2_ISA: return (u16 *)GG2_ISA_IO_W(addr); | 148 | case GG2_ISA: return (u16 __iomem *)GG2_ISA_IO_W(addr); |
148 | #endif | 149 | #endif |
149 | #ifdef CONFIG_AMIGA_PCMCIA | 150 | #ifdef CONFIG_AMIGA_PCMCIA |
150 | case AG_ISA: return (u16 *)AG_ISA_IO_W(addr); | 151 | case AG_ISA: return (u16 __iomem *)AG_ISA_IO_W(addr); |
151 | #endif | 152 | #endif |
152 | default: return 0; /* avoid warnings, just in case */ | 153 | default: return NULL; /* avoid warnings, just in case */ |
153 | } | 154 | } |
154 | } | 155 | } |
155 | static inline u8 *isa_mtb(unsigned long addr) | 156 | static inline u8 __iomem *isa_mtb(unsigned long addr) |
156 | { | 157 | { |
157 | switch(ISA_TYPE) | 158 | switch(ISA_TYPE) |
158 | { | 159 | { |
159 | #ifdef CONFIG_Q40 | 160 | #ifdef CONFIG_Q40 |
160 | case Q40_ISA: return (u8 *)Q40_ISA_MEM_B(addr); | 161 | case Q40_ISA: return (u8 __iomem *)Q40_ISA_MEM_B(addr); |
161 | #endif | 162 | #endif |
162 | #ifdef CONFIG_GG2 | 163 | #ifdef CONFIG_GG2 |
163 | case GG2_ISA: return (u8 *)GG2_ISA_MEM_B(addr); | 164 | case GG2_ISA: return (u8 __iomem *)GG2_ISA_MEM_B(addr); |
164 | #endif | 165 | #endif |
165 | #ifdef CONFIG_AMIGA_PCMCIA | 166 | #ifdef CONFIG_AMIGA_PCMCIA |
166 | case AG_ISA: return (u8 *)addr; | 167 | case AG_ISA: return (u8 __iomem *)addr; |
167 | #endif | 168 | #endif |
168 | default: return 0; /* avoid warnings, just in case */ | 169 | default: return NULL; /* avoid warnings, just in case */ |
169 | } | 170 | } |
170 | } | 171 | } |
171 | static inline u16 *isa_mtw(unsigned long addr) | 172 | static inline u16 __iomem *isa_mtw(unsigned long addr) |
172 | { | 173 | { |
173 | switch(ISA_TYPE) | 174 | switch(ISA_TYPE) |
174 | { | 175 | { |
175 | #ifdef CONFIG_Q40 | 176 | #ifdef CONFIG_Q40 |
176 | case Q40_ISA: return (u16 *)Q40_ISA_MEM_W(addr); | 177 | case Q40_ISA: return (u16 __iomem *)Q40_ISA_MEM_W(addr); |
177 | #endif | 178 | #endif |
178 | #ifdef CONFIG_GG2 | 179 | #ifdef CONFIG_GG2 |
179 | case GG2_ISA: return (u16 *)GG2_ISA_MEM_W(addr); | 180 | case GG2_ISA: return (u16 __iomem *)GG2_ISA_MEM_W(addr); |
180 | #endif | 181 | #endif |
181 | #ifdef CONFIG_AMIGA_PCMCIA | 182 | #ifdef CONFIG_AMIGA_PCMCIA |
182 | case AG_ISA: return (u16 *)addr; | 183 | case AG_ISA: return (u16 __iomem *)addr; |
183 | #endif | 184 | #endif |
184 | default: return 0; /* avoid warnings, just in case */ | 185 | default: return NULL; /* avoid warnings, just in case */ |
185 | } | 186 | } |
186 | } | 187 | } |
187 | 188 | ||
@@ -326,20 +327,20 @@ static inline void isa_delay(void) | |||
326 | 327 | ||
327 | #define mmiowb() | 328 | #define mmiowb() |
328 | 329 | ||
329 | static inline void *ioremap(unsigned long physaddr, unsigned long size) | 330 | static inline void __iomem *ioremap(unsigned long physaddr, unsigned long size) |
330 | { | 331 | { |
331 | return __ioremap(physaddr, size, IOMAP_NOCACHE_SER); | 332 | return __ioremap(physaddr, size, IOMAP_NOCACHE_SER); |
332 | } | 333 | } |
333 | static inline void *ioremap_nocache(unsigned long physaddr, unsigned long size) | 334 | static inline void __iomem *ioremap_nocache(unsigned long physaddr, unsigned long size) |
334 | { | 335 | { |
335 | return __ioremap(physaddr, size, IOMAP_NOCACHE_SER); | 336 | return __ioremap(physaddr, size, IOMAP_NOCACHE_SER); |
336 | } | 337 | } |
337 | static inline void *ioremap_writethrough(unsigned long physaddr, | 338 | static inline void __iomem *ioremap_writethrough(unsigned long physaddr, |
338 | unsigned long size) | 339 | unsigned long size) |
339 | { | 340 | { |
340 | return __ioremap(physaddr, size, IOMAP_WRITETHROUGH); | 341 | return __ioremap(physaddr, size, IOMAP_WRITETHROUGH); |
341 | } | 342 | } |
342 | static inline void *ioremap_fullcache(unsigned long physaddr, | 343 | static inline void __iomem *ioremap_fullcache(unsigned long physaddr, |
343 | unsigned long size) | 344 | unsigned long size) |
344 | { | 345 | { |
345 | return __ioremap(physaddr, size, IOMAP_FULL_CACHING); | 346 | return __ioremap(physaddr, size, IOMAP_FULL_CACHING); |
diff --git a/include/asm-m68k/ioctl.h b/include/asm-m68k/ioctl.h index fd68914ab292..b279fe06dfe5 100644 --- a/include/asm-m68k/ioctl.h +++ b/include/asm-m68k/ioctl.h | |||
@@ -1,80 +1 @@ | |||
1 | /* $Id: ioctl.h,v 1.3 1997/04/16 15:10:07 jes Exp $ | #include <asm-generic/ioctl.h> | |
2 | * | ||
3 | * linux/ioctl.h for Linux by H.H. Bergman. | ||
4 | */ | ||
5 | |||
6 | #ifndef _M68K_IOCTL_H | ||
7 | #define _M68K_IOCTL_H | ||
8 | |||
9 | /* ioctl command encoding: 32 bits total, command in lower 16 bits, | ||
10 | * size of the parameter structure in the lower 14 bits of the | ||
11 | * upper 16 bits. | ||
12 | * Encoding the size of the parameter structure in the ioctl request | ||
13 | * is useful for catching programs compiled with old versions | ||
14 | * and to avoid overwriting user space outside the user buffer area. | ||
15 | * The highest 2 bits are reserved for indicating the ``access mode''. | ||
16 | * NOTE: This limits the max parameter size to 16kB -1 ! | ||
17 | */ | ||
18 | |||
19 | /* | ||
20 | * I don't really have any idea about what this should look like, so | ||
21 | * for the time being, this is heavily based on the PC definitions. | ||
22 | */ | ||
23 | |||
24 | /* | ||
25 | * The following is for compatibility across the various Linux | ||
26 | * platforms. The i386 ioctl numbering scheme doesn't really enforce | ||
27 | * a type field. De facto, however, the top 8 bits of the lower 16 | ||
28 | * bits are indeed used as a type field, so we might just as well make | ||
29 | * this explicit here. Please be sure to use the decoding macros | ||
30 | * below from now on. | ||
31 | */ | ||
32 | #define _IOC_NRBITS 8 | ||
33 | #define _IOC_TYPEBITS 8 | ||
34 | #define _IOC_SIZEBITS 14 | ||
35 | #define _IOC_DIRBITS 2 | ||
36 | |||
37 | #define _IOC_NRMASK ((1 << _IOC_NRBITS)-1) | ||
38 | #define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1) | ||
39 | #define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1) | ||
40 | #define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1) | ||
41 | |||
42 | #define _IOC_NRSHIFT 0 | ||
43 | #define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS) | ||
44 | #define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS) | ||
45 | #define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS) | ||
46 | |||
47 | /* | ||
48 | * Direction bits. | ||
49 | */ | ||
50 | #define _IOC_NONE 0U | ||
51 | #define _IOC_WRITE 1U | ||
52 | #define _IOC_READ 2U | ||
53 | |||
54 | #define _IOC(dir,type,nr,size) \ | ||
55 | (((dir) << _IOC_DIRSHIFT) | \ | ||
56 | ((type) << _IOC_TYPESHIFT) | \ | ||
57 | ((nr) << _IOC_NRSHIFT) | \ | ||
58 | ((size) << _IOC_SIZESHIFT)) | ||
59 | |||
60 | /* used to create numbers */ | ||
61 | #define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0) | ||
62 | #define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size)) | ||
63 | #define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size)) | ||
64 | #define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size)) | ||
65 | |||
66 | /* used to decode ioctl numbers.. */ | ||
67 | #define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) | ||
68 | #define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK) | ||
69 | #define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK) | ||
70 | #define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK) | ||
71 | |||
72 | /* ...and for the drivers/sound files... */ | ||
73 | |||
74 | #define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT) | ||
75 | #define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT) | ||
76 | #define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT) | ||
77 | #define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT) | ||
78 | #define IOCSIZE_SHIFT (_IOC_SIZESHIFT) | ||
79 | |||
80 | #endif /* _M68K_IOCTL_H */ | ||
diff --git a/include/asm-m68k/irq.h b/include/asm-m68k/irq.h index 127ad190cf2d..325c86f8512d 100644 --- a/include/asm-m68k/irq.h +++ b/include/asm-m68k/irq.h | |||
@@ -23,6 +23,15 @@ | |||
23 | #endif | 23 | #endif |
24 | 24 | ||
25 | /* | 25 | /* |
26 | * The hardirq mask has to be large enough to have | ||
27 | * space for potentially all IRQ sources in the system | ||
28 | * nesting on a single CPU: | ||
29 | */ | ||
30 | #if (1 << HARDIRQ_BITS) < NR_IRQS | ||
31 | # error HARDIRQ_BITS is too low! | ||
32 | #endif | ||
33 | |||
34 | /* | ||
26 | * Interrupt source definitions | 35 | * Interrupt source definitions |
27 | * General interrupt sources are the level 1-7. | 36 | * General interrupt sources are the level 1-7. |
28 | * Adding an interrupt service routine for one of these sources | 37 | * Adding an interrupt service routine for one of these sources |
diff --git a/include/asm-m68k/machdep.h b/include/asm-m68k/machdep.h index a0dd5c47002c..7d3fee342369 100644 --- a/include/asm-m68k/machdep.h +++ b/include/asm-m68k/machdep.h | |||
@@ -34,7 +34,6 @@ extern void (*mach_power_off)( void ); | |||
34 | extern unsigned long (*mach_hd_init) (unsigned long, unsigned long); | 34 | extern unsigned long (*mach_hd_init) (unsigned long, unsigned long); |
35 | extern void (*mach_hd_setup)(char *, int *); | 35 | extern void (*mach_hd_setup)(char *, int *); |
36 | extern long mach_max_dma_address; | 36 | extern long mach_max_dma_address; |
37 | extern void (*mach_floppy_setup)(char *, int *); | ||
38 | extern void (*mach_heartbeat) (int); | 37 | extern void (*mach_heartbeat) (int); |
39 | extern void (*mach_l2_flush) (int); | 38 | extern void (*mach_l2_flush) (int); |
40 | extern void (*mach_beep) (unsigned int, unsigned int); | 39 | extern void (*mach_beep) (unsigned int, unsigned int); |
diff --git a/include/asm-m68k/raw_io.h b/include/asm-m68k/raw_io.h index 041f0a87b25d..5439bcaa57c6 100644 --- a/include/asm-m68k/raw_io.h +++ b/include/asm-m68k/raw_io.h | |||
@@ -19,9 +19,9 @@ | |||
19 | #define IOMAP_NOCACHE_NONSER 2 | 19 | #define IOMAP_NOCACHE_NONSER 2 |
20 | #define IOMAP_WRITETHROUGH 3 | 20 | #define IOMAP_WRITETHROUGH 3 |
21 | 21 | ||
22 | extern void iounmap(void *addr); | 22 | extern void iounmap(void __iomem *addr); |
23 | 23 | ||
24 | extern void *__ioremap(unsigned long physaddr, unsigned long size, | 24 | extern void __iomem *__ioremap(unsigned long physaddr, unsigned long size, |
25 | int cacheflag); | 25 | int cacheflag); |
26 | extern void __iounmap(void *addr, unsigned long size); | 26 | extern void __iounmap(void *addr, unsigned long size); |
27 | 27 | ||
@@ -30,21 +30,21 @@ extern void __iounmap(void *addr, unsigned long size); | |||
30 | * two accesses to memory, which may be undesirable for some devices. | 30 | * two accesses to memory, which may be undesirable for some devices. |
31 | */ | 31 | */ |
32 | #define in_8(addr) \ | 32 | #define in_8(addr) \ |
33 | ({ u8 __v = (*(volatile u8 *) (addr)); __v; }) | 33 | ({ u8 __v = (*(__force volatile u8 *) (addr)); __v; }) |
34 | #define in_be16(addr) \ | 34 | #define in_be16(addr) \ |
35 | ({ u16 __v = (*(volatile u16 *) (addr)); __v; }) | 35 | ({ u16 __v = (*(__force volatile u16 *) (addr)); __v; }) |
36 | #define in_be32(addr) \ | 36 | #define in_be32(addr) \ |
37 | ({ u32 __v = (*(volatile u32 *) (addr)); __v; }) | 37 | ({ u32 __v = (*(__force volatile u32 *) (addr)); __v; }) |
38 | #define in_le16(addr) \ | 38 | #define in_le16(addr) \ |
39 | ({ u16 __v = le16_to_cpu(*(volatile u16 *) (addr)); __v; }) | 39 | ({ u16 __v = le16_to_cpu(*(__force volatile u16 *) (addr)); __v; }) |
40 | #define in_le32(addr) \ | 40 | #define in_le32(addr) \ |
41 | ({ u32 __v = le32_to_cpu(*(volatile u32 *) (addr)); __v; }) | 41 | ({ u32 __v = le32_to_cpu(*(__force volatile u32 *) (addr)); __v; }) |
42 | 42 | ||
43 | #define out_8(addr,b) (void)((*(volatile u8 *) (addr)) = (b)) | 43 | #define out_8(addr,b) (void)((*(__force volatile u8 *) (addr)) = (b)) |
44 | #define out_be16(addr,w) (void)((*(volatile u16 *) (addr)) = (w)) | 44 | #define out_be16(addr,w) (void)((*(__force volatile u16 *) (addr)) = (w)) |
45 | #define out_be32(addr,l) (void)((*(volatile u32 *) (addr)) = (l)) | 45 | #define out_be32(addr,l) (void)((*(__force volatile u32 *) (addr)) = (l)) |
46 | #define out_le16(addr,w) (void)((*(volatile u16 *) (addr)) = cpu_to_le16(w)) | 46 | #define out_le16(addr,w) (void)((*(__force volatile u16 *) (addr)) = cpu_to_le16(w)) |
47 | #define out_le32(addr,l) (void)((*(volatile u32 *) (addr)) = cpu_to_le32(l)) | 47 | #define out_le32(addr,l) (void)((*(__force volatile u32 *) (addr)) = cpu_to_le32(l)) |
48 | 48 | ||
49 | #define raw_inb in_8 | 49 | #define raw_inb in_8 |
50 | #define raw_inw in_be16 | 50 | #define raw_inw in_be16 |
@@ -54,7 +54,7 @@ extern void __iounmap(void *addr, unsigned long size); | |||
54 | #define raw_outw(val,port) out_be16((port),(val)) | 54 | #define raw_outw(val,port) out_be16((port),(val)) |
55 | #define raw_outl(val,port) out_be32((port),(val)) | 55 | #define raw_outl(val,port) out_be32((port),(val)) |
56 | 56 | ||
57 | static inline void raw_insb(volatile u8 *port, u8 *buf, unsigned int len) | 57 | static inline void raw_insb(volatile u8 __iomem *port, u8 *buf, unsigned int len) |
58 | { | 58 | { |
59 | unsigned int i; | 59 | unsigned int i; |
60 | 60 | ||
@@ -62,7 +62,7 @@ static inline void raw_insb(volatile u8 *port, u8 *buf, unsigned int len) | |||
62 | *buf++ = in_8(port); | 62 | *buf++ = in_8(port); |
63 | } | 63 | } |
64 | 64 | ||
65 | static inline void raw_outsb(volatile u8 *port, const u8 *buf, | 65 | static inline void raw_outsb(volatile u8 __iomem *port, const u8 *buf, |
66 | unsigned int len) | 66 | unsigned int len) |
67 | { | 67 | { |
68 | unsigned int i; | 68 | unsigned int i; |
@@ -71,7 +71,7 @@ static inline void raw_outsb(volatile u8 *port, const u8 *buf, | |||
71 | out_8(port, *buf++); | 71 | out_8(port, *buf++); |
72 | } | 72 | } |
73 | 73 | ||
74 | static inline void raw_insw(volatile u16 *port, u16 *buf, unsigned int nr) | 74 | static inline void raw_insw(volatile u16 __iomem *port, u16 *buf, unsigned int nr) |
75 | { | 75 | { |
76 | unsigned int tmp; | 76 | unsigned int tmp; |
77 | 77 | ||
@@ -110,7 +110,7 @@ static inline void raw_insw(volatile u16 *port, u16 *buf, unsigned int nr) | |||
110 | } | 110 | } |
111 | } | 111 | } |
112 | 112 | ||
113 | static inline void raw_outsw(volatile u16 *port, const u16 *buf, | 113 | static inline void raw_outsw(volatile u16 __iomem *port, const u16 *buf, |
114 | unsigned int nr) | 114 | unsigned int nr) |
115 | { | 115 | { |
116 | unsigned int tmp; | 116 | unsigned int tmp; |
@@ -150,7 +150,7 @@ static inline void raw_outsw(volatile u16 *port, const u16 *buf, | |||
150 | } | 150 | } |
151 | } | 151 | } |
152 | 152 | ||
153 | static inline void raw_insl(volatile u32 *port, u32 *buf, unsigned int nr) | 153 | static inline void raw_insl(volatile u32 __iomem *port, u32 *buf, unsigned int nr) |
154 | { | 154 | { |
155 | unsigned int tmp; | 155 | unsigned int tmp; |
156 | 156 | ||
@@ -189,7 +189,7 @@ static inline void raw_insl(volatile u32 *port, u32 *buf, unsigned int nr) | |||
189 | } | 189 | } |
190 | } | 190 | } |
191 | 191 | ||
192 | static inline void raw_outsl(volatile u32 *port, const u32 *buf, | 192 | static inline void raw_outsl(volatile u32 __iomem *port, const u32 *buf, |
193 | unsigned int nr) | 193 | unsigned int nr) |
194 | { | 194 | { |
195 | unsigned int tmp; | 195 | unsigned int tmp; |
@@ -230,7 +230,7 @@ static inline void raw_outsl(volatile u32 *port, const u32 *buf, | |||
230 | } | 230 | } |
231 | 231 | ||
232 | 232 | ||
233 | static inline void raw_insw_swapw(volatile u16 *port, u16 *buf, | 233 | static inline void raw_insw_swapw(volatile u16 __iomem *port, u16 *buf, |
234 | unsigned int nr) | 234 | unsigned int nr) |
235 | { | 235 | { |
236 | if ((nr) % 8) | 236 | if ((nr) % 8) |
@@ -283,7 +283,7 @@ static inline void raw_insw_swapw(volatile u16 *port, u16 *buf, | |||
283 | : "d0", "a0", "a1", "d6"); | 283 | : "d0", "a0", "a1", "d6"); |
284 | } | 284 | } |
285 | 285 | ||
286 | static inline void raw_outsw_swapw(volatile u16 *port, const u16 *buf, | 286 | static inline void raw_outsw_swapw(volatile u16 __iomem *port, const u16 *buf, |
287 | unsigned int nr) | 287 | unsigned int nr) |
288 | { | 288 | { |
289 | if ((nr) % 8) | 289 | if ((nr) % 8) |
diff --git a/include/asm-m68k/signal.h b/include/asm-m68k/signal.h index a0cdf9082372..b7b7ea20caab 100644 --- a/include/asm-m68k/signal.h +++ b/include/asm-m68k/signal.h | |||
@@ -144,7 +144,7 @@ struct sigaction { | |||
144 | #endif /* __KERNEL__ */ | 144 | #endif /* __KERNEL__ */ |
145 | 145 | ||
146 | typedef struct sigaltstack { | 146 | typedef struct sigaltstack { |
147 | void *ss_sp; | 147 | void __user *ss_sp; |
148 | int ss_flags; | 148 | int ss_flags; |
149 | size_t ss_size; | 149 | size_t ss_size; |
150 | } stack_t; | 150 | } stack_t; |
diff --git a/include/asm-m68k/sun3_pgtable.h b/include/asm-m68k/sun3_pgtable.h index e974bb072047..5156a28a18d8 100644 --- a/include/asm-m68k/sun3_pgtable.h +++ b/include/asm-m68k/sun3_pgtable.h | |||
@@ -211,7 +211,7 @@ static inline unsigned long pte_to_pgoff(pte_t pte) | |||
211 | return pte.pte & SUN3_PAGE_PGNUM_MASK; | 211 | return pte.pte & SUN3_PAGE_PGNUM_MASK; |
212 | } | 212 | } |
213 | 213 | ||
214 | static inline pte_t pgoff_to_pte(inline unsigned off) | 214 | static inline pte_t pgoff_to_pte(unsigned off) |
215 | { | 215 | { |
216 | pte_t pte = { off + SUN3_PAGE_ACCESSED }; | 216 | pte_t pte = { off + SUN3_PAGE_ACCESSED }; |
217 | return pte; | 217 | return pte; |
diff --git a/include/asm-m68k/sun3ints.h b/include/asm-m68k/sun3ints.h index fd838eb14213..bd038fccb64b 100644 --- a/include/asm-m68k/sun3ints.h +++ b/include/asm-m68k/sun3ints.h | |||
@@ -31,7 +31,6 @@ int sun3_request_irq(unsigned int irq, | |||
31 | ); | 31 | ); |
32 | extern void sun3_init_IRQ (void); | 32 | extern void sun3_init_IRQ (void); |
33 | extern irqreturn_t (*sun3_default_handler[]) (int, void *, struct pt_regs *); | 33 | extern irqreturn_t (*sun3_default_handler[]) (int, void *, struct pt_regs *); |
34 | extern irqreturn_t (*sun3_inthandler[]) (int, void *, struct pt_regs *); | ||
35 | extern void sun3_free_irq (unsigned int irq, void *dev_id); | 34 | extern void sun3_free_irq (unsigned int irq, void *dev_id); |
36 | extern void sun3_enable_interrupts (void); | 35 | extern void sun3_enable_interrupts (void); |
37 | extern void sun3_disable_interrupts (void); | 36 | extern void sun3_disable_interrupts (void); |
diff --git a/include/asm-m68k/sun3xflop.h b/include/asm-m68k/sun3xflop.h index fda1eccf10aa..98a9f79dab29 100644 --- a/include/asm-m68k/sun3xflop.h +++ b/include/asm-m68k/sun3xflop.h | |||
@@ -208,7 +208,7 @@ static int sun3xflop_request_irq(void) | |||
208 | 208 | ||
209 | if(!once) { | 209 | if(!once) { |
210 | once = 1; | 210 | once = 1; |
211 | error = request_irq(FLOPPY_IRQ, sun3xflop_hardint, SA_INTERRUPT, "floppy", 0); | 211 | error = request_irq(FLOPPY_IRQ, sun3xflop_hardint, SA_INTERRUPT, "floppy", NULL); |
212 | return ((error == 0) ? 0 : -1); | 212 | return ((error == 0) ? 0 : -1); |
213 | } else return 0; | 213 | } else return 0; |
214 | } | 214 | } |
@@ -238,7 +238,7 @@ static int sun3xflop_init(void) | |||
238 | *sun3x_fdc.fcr_r = 0; | 238 | *sun3x_fdc.fcr_r = 0; |
239 | 239 | ||
240 | /* Success... */ | 240 | /* Success... */ |
241 | floppy_set_flags(0, 1, FD_BROKEN_DCL); // I don't know how to detect this. | 241 | floppy_set_flags(NULL, 1, FD_BROKEN_DCL); // I don't know how to detect this. |
242 | allowed_drive_mask = 0x01; | 242 | allowed_drive_mask = 0x01; |
243 | return (int) SUN3X_FDC; | 243 | return (int) SUN3X_FDC; |
244 | } | 244 | } |
diff --git a/include/asm-m68k/thread_info.h b/include/asm-m68k/thread_info.h index 9532ca3c45cb..c4d622a57dfb 100644 --- a/include/asm-m68k/thread_info.h +++ b/include/asm-m68k/thread_info.h | |||
@@ -37,6 +37,7 @@ struct thread_info { | |||
37 | #define init_stack (init_thread_union.stack) | 37 | #define init_stack (init_thread_union.stack) |
38 | 38 | ||
39 | #define task_thread_info(tsk) (&(tsk)->thread.info) | 39 | #define task_thread_info(tsk) (&(tsk)->thread.info) |
40 | #define task_stack_page(tsk) ((void *)(tsk)->thread_info) | ||
40 | #define current_thread_info() task_thread_info(current) | 41 | #define current_thread_info() task_thread_info(current) |
41 | 42 | ||
42 | #define __HAVE_THREAD_FUNCTIONS | 43 | #define __HAVE_THREAD_FUNCTIONS |
diff --git a/include/asm-m68k/uaccess.h b/include/asm-m68k/uaccess.h index f5cedf19cf68..2ffd87b0a769 100644 --- a/include/asm-m68k/uaccess.h +++ b/include/asm-m68k/uaccess.h | |||
@@ -42,6 +42,7 @@ struct exception_table_entry | |||
42 | ({ \ | 42 | ({ \ |
43 | int __pu_err; \ | 43 | int __pu_err; \ |
44 | typeof(*(ptr)) __pu_val = (x); \ | 44 | typeof(*(ptr)) __pu_val = (x); \ |
45 | __chk_user_ptr(ptr); \ | ||
45 | switch (sizeof (*(ptr))) { \ | 46 | switch (sizeof (*(ptr))) { \ |
46 | case 1: \ | 47 | case 1: \ |
47 | __put_user_asm(__pu_err, __pu_val, ptr, b); \ | 48 | __put_user_asm(__pu_err, __pu_val, ptr, b); \ |
@@ -91,6 +92,7 @@ __asm__ __volatile__ \ | |||
91 | ({ \ | 92 | ({ \ |
92 | int __gu_err; \ | 93 | int __gu_err; \ |
93 | typeof(*(ptr)) __gu_val; \ | 94 | typeof(*(ptr)) __gu_val; \ |
95 | __chk_user_ptr(ptr); \ | ||
94 | switch (sizeof(*(ptr))) { \ | 96 | switch (sizeof(*(ptr))) { \ |
95 | case 1: \ | 97 | case 1: \ |
96 | __get_user_asm(__gu_err, __gu_val, ptr, b, "=d"); \ | 98 | __get_user_asm(__gu_err, __gu_val, ptr, b, "=d"); \ |
@@ -105,7 +107,7 @@ __asm__ __volatile__ \ | |||
105 | __gu_err = __constant_copy_from_user(&__gu_val, ptr, 8); \ | 107 | __gu_err = __constant_copy_from_user(&__gu_val, ptr, 8); \ |
106 | break; \ | 108 | break; \ |
107 | default: \ | 109 | default: \ |
108 | __gu_val = 0; \ | 110 | __gu_val = (typeof(*(ptr)))0; \ |
109 | __gu_err = __get_user_bad(); \ | 111 | __gu_err = __get_user_bad(); \ |
110 | break; \ | 112 | break; \ |
111 | } \ | 113 | } \ |
@@ -134,7 +136,7 @@ __asm__ __volatile__ \ | |||
134 | : "m"(*(ptr)), "i" (-EFAULT), "0"(0)) | 136 | : "m"(*(ptr)), "i" (-EFAULT), "0"(0)) |
135 | 137 | ||
136 | static inline unsigned long | 138 | static inline unsigned long |
137 | __generic_copy_from_user(void *to, const void *from, unsigned long n) | 139 | __generic_copy_from_user(void *to, const void __user *from, unsigned long n) |
138 | { | 140 | { |
139 | unsigned long tmp; | 141 | unsigned long tmp; |
140 | __asm__ __volatile__ | 142 | __asm__ __volatile__ |
@@ -189,7 +191,7 @@ __generic_copy_from_user(void *to, const void *from, unsigned long n) | |||
189 | } | 191 | } |
190 | 192 | ||
191 | static inline unsigned long | 193 | static inline unsigned long |
192 | __generic_copy_to_user(void *to, const void *from, unsigned long n) | 194 | __generic_copy_to_user(void __user *to, const void *from, unsigned long n) |
193 | { | 195 | { |
194 | unsigned long tmp; | 196 | unsigned long tmp; |
195 | __asm__ __volatile__ | 197 | __asm__ __volatile__ |
@@ -264,7 +266,7 @@ __generic_copy_to_user(void *to, const void *from, unsigned long n) | |||
264 | : "d0", "memory") | 266 | : "d0", "memory") |
265 | 267 | ||
266 | static inline unsigned long | 268 | static inline unsigned long |
267 | __constant_copy_from_user(void *to, const void *from, unsigned long n) | 269 | __constant_copy_from_user(void *to, const void __user *from, unsigned long n) |
268 | { | 270 | { |
269 | switch (n) { | 271 | switch (n) { |
270 | case 0: | 272 | case 0: |
@@ -520,7 +522,7 @@ __constant_copy_from_user(void *to, const void *from, unsigned long n) | |||
520 | #define __copy_from_user_inatomic __copy_from_user | 522 | #define __copy_from_user_inatomic __copy_from_user |
521 | 523 | ||
522 | static inline unsigned long | 524 | static inline unsigned long |
523 | __constant_copy_to_user(void *to, const void *from, unsigned long n) | 525 | __constant_copy_to_user(void __user *to, const void *from, unsigned long n) |
524 | { | 526 | { |
525 | switch (n) { | 527 | switch (n) { |
526 | case 0: | 528 | case 0: |
@@ -766,7 +768,7 @@ __constant_copy_to_user(void *to, const void *from, unsigned long n) | |||
766 | */ | 768 | */ |
767 | 769 | ||
768 | static inline long | 770 | static inline long |
769 | strncpy_from_user(char *dst, const char *src, long count) | 771 | strncpy_from_user(char *dst, const char __user *src, long count) |
770 | { | 772 | { |
771 | long res; | 773 | long res; |
772 | if (count == 0) return count; | 774 | if (count == 0) return count; |
@@ -799,11 +801,11 @@ strncpy_from_user(char *dst, const char *src, long count) | |||
799 | * | 801 | * |
800 | * Return 0 on exception, a value greater than N if too long | 802 | * Return 0 on exception, a value greater than N if too long |
801 | */ | 803 | */ |
802 | static inline long strnlen_user(const char *src, long n) | 804 | static inline long strnlen_user(const char __user *src, long n) |
803 | { | 805 | { |
804 | long res; | 806 | long res; |
805 | 807 | ||
806 | res = -(long)src; | 808 | res = -(unsigned long)src; |
807 | __asm__ __volatile__ | 809 | __asm__ __volatile__ |
808 | ("1:\n" | 810 | ("1:\n" |
809 | " tstl %2\n" | 811 | " tstl %2\n" |
@@ -842,7 +844,7 @@ static inline long strnlen_user(const char *src, long n) | |||
842 | */ | 844 | */ |
843 | 845 | ||
844 | static inline unsigned long | 846 | static inline unsigned long |
845 | clear_user(void *to, unsigned long n) | 847 | clear_user(void __user *to, unsigned long n) |
846 | { | 848 | { |
847 | __asm__ __volatile__ | 849 | __asm__ __volatile__ |
848 | (" tstl %1\n" | 850 | (" tstl %1\n" |
diff --git a/include/asm-m68k/zorro.h b/include/asm-m68k/zorro.h index cf816588bedb..5ce97c22b582 100644 --- a/include/asm-m68k/zorro.h +++ b/include/asm-m68k/zorro.h | |||
@@ -15,24 +15,24 @@ | |||
15 | #define z_memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c)) | 15 | #define z_memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c)) |
16 | #define z_memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c)) | 16 | #define z_memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c)) |
17 | 17 | ||
18 | static inline void *z_remap_nocache_ser(unsigned long physaddr, | 18 | static inline void __iomem *z_remap_nocache_ser(unsigned long physaddr, |
19 | unsigned long size) | 19 | unsigned long size) |
20 | { | 20 | { |
21 | return __ioremap(physaddr, size, IOMAP_NOCACHE_SER); | 21 | return __ioremap(physaddr, size, IOMAP_NOCACHE_SER); |
22 | } | 22 | } |
23 | 23 | ||
24 | static inline void *z_remap_nocache_nonser(unsigned long physaddr, | 24 | static inline void __iomem *z_remap_nocache_nonser(unsigned long physaddr, |
25 | unsigned long size) | 25 | unsigned long size) |
26 | { | 26 | { |
27 | return __ioremap(physaddr, size, IOMAP_NOCACHE_NONSER); | 27 | return __ioremap(physaddr, size, IOMAP_NOCACHE_NONSER); |
28 | } | 28 | } |
29 | 29 | ||
30 | static inline void *z_remap_writethrough(unsigned long physaddr, | 30 | static inline void __iomem *z_remap_writethrough(unsigned long physaddr, |
31 | unsigned long size) | 31 | unsigned long size) |
32 | { | 32 | { |
33 | return __ioremap(physaddr, size, IOMAP_WRITETHROUGH); | 33 | return __ioremap(physaddr, size, IOMAP_WRITETHROUGH); |
34 | } | 34 | } |
35 | static inline void *z_remap_fullcache(unsigned long physaddr, | 35 | static inline void __iomem *z_remap_fullcache(unsigned long physaddr, |
36 | unsigned long size) | 36 | unsigned long size) |
37 | { | 37 | { |
38 | return __ioremap(physaddr, size, IOMAP_FULL_CACHING); | 38 | return __ioremap(physaddr, size, IOMAP_FULL_CACHING); |
diff --git a/include/asm-m68knommu/bitops.h b/include/asm-m68knommu/bitops.h index 4058dd086a02..25d8a3cfef90 100644 --- a/include/asm-m68knommu/bitops.h +++ b/include/asm-m68knommu/bitops.h | |||
@@ -290,7 +290,7 @@ static __inline__ int find_next_zero_bit (const void * addr, int size, int offse | |||
290 | tmp = *p; | 290 | tmp = *p; |
291 | 291 | ||
292 | found_first: | 292 | found_first: |
293 | tmp |= ~0UL >> size; | 293 | tmp |= ~0UL << size; |
294 | found_middle: | 294 | found_middle: |
295 | return result + ffz(tmp); | 295 | return result + ffz(tmp); |
296 | } | 296 | } |
diff --git a/include/asm-m68knommu/ioctl.h b/include/asm-m68knommu/ioctl.h index cff72f33350f..b279fe06dfe5 100644 --- a/include/asm-m68knommu/ioctl.h +++ b/include/asm-m68knommu/ioctl.h | |||
@@ -1 +1 @@ | |||
#include <asm-m68k/ioctl.h> | #include <asm-generic/ioctl.h> | ||
diff --git a/include/asm-m68knommu/machdep.h b/include/asm-m68knommu/machdep.h index 5a9f9c297f79..27c90afd3339 100644 --- a/include/asm-m68knommu/machdep.h +++ b/include/asm-m68knommu/machdep.h | |||
@@ -38,7 +38,6 @@ extern void (*mach_power_off)( void ); | |||
38 | extern unsigned long (*mach_hd_init) (unsigned long, unsigned long); | 38 | extern unsigned long (*mach_hd_init) (unsigned long, unsigned long); |
39 | extern void (*mach_hd_setup)(char *, int *); | 39 | extern void (*mach_hd_setup)(char *, int *); |
40 | extern long mach_max_dma_address; | 40 | extern long mach_max_dma_address; |
41 | extern void (*mach_floppy_setup)(char *, int *); | ||
42 | extern void (*mach_floppy_eject)(void); | 41 | extern void (*mach_floppy_eject)(void); |
43 | extern void (*mach_heartbeat) (int); | 42 | extern void (*mach_heartbeat) (int); |
44 | extern void (*mach_l2_flush) (int); | 43 | extern void (*mach_l2_flush) (int); |
diff --git a/include/asm-m68knommu/sigcontext.h b/include/asm-m68knommu/sigcontext.h index 84bf36dc7a83..36c293fc133d 100644 --- a/include/asm-m68knommu/sigcontext.h +++ b/include/asm-m68knommu/sigcontext.h | |||
@@ -8,6 +8,7 @@ struct sigcontext { | |||
8 | unsigned long sc_d1; | 8 | unsigned long sc_d1; |
9 | unsigned long sc_a0; | 9 | unsigned long sc_a0; |
10 | unsigned long sc_a1; | 10 | unsigned long sc_a1; |
11 | unsigned long sc_a5; | ||
11 | unsigned short sc_sr; | 12 | unsigned short sc_sr; |
12 | unsigned long sc_pc; | 13 | unsigned long sc_pc; |
13 | unsigned short sc_formatvec; | 14 | unsigned short sc_formatvec; |
diff --git a/include/asm-m68knommu/thread_info.h b/include/asm-m68knommu/thread_info.h index 7b9a3fa3af5d..b8f009edf2b2 100644 --- a/include/asm-m68knommu/thread_info.h +++ b/include/asm-m68knommu/thread_info.h | |||
@@ -75,8 +75,6 @@ static inline struct thread_info *current_thread_info(void) | |||
75 | #define alloc_thread_info(tsk) ((struct thread_info *) \ | 75 | #define alloc_thread_info(tsk) ((struct thread_info *) \ |
76 | __get_free_pages(GFP_KERNEL, THREAD_SIZE_ORDER)) | 76 | __get_free_pages(GFP_KERNEL, THREAD_SIZE_ORDER)) |
77 | #define free_thread_info(ti) free_pages((unsigned long) (ti), THREAD_SIZE_ORDER) | 77 | #define free_thread_info(ti) free_pages((unsigned long) (ti), THREAD_SIZE_ORDER) |
78 | #define get_thread_info(ti) get_task_struct((ti)->task) | ||
79 | #define put_thread_info(ti) put_task_struct((ti)->task) | ||
80 | #endif /* __ASSEMBLY__ */ | 78 | #endif /* __ASSEMBLY__ */ |
81 | 79 | ||
82 | #define PREEMPT_ACTIVE 0x4000000 | 80 | #define PREEMPT_ACTIVE 0x4000000 |
diff --git a/include/asm-mips/atomic.h b/include/asm-mips/atomic.h index 94a95872d727..654b97d3e13a 100644 --- a/include/asm-mips/atomic.h +++ b/include/asm-mips/atomic.h | |||
@@ -24,10 +24,9 @@ | |||
24 | #define _ASM_ATOMIC_H | 24 | #define _ASM_ATOMIC_H |
25 | 25 | ||
26 | #include <asm/cpu-features.h> | 26 | #include <asm/cpu-features.h> |
27 | #include <asm/interrupt.h> | ||
27 | #include <asm/war.h> | 28 | #include <asm/war.h> |
28 | 29 | ||
29 | extern spinlock_t atomic_lock; | ||
30 | |||
31 | typedef struct { volatile int counter; } atomic_t; | 30 | typedef struct { volatile int counter; } atomic_t; |
32 | 31 | ||
33 | #define ATOMIC_INIT(i) { (i) } | 32 | #define ATOMIC_INIT(i) { (i) } |
@@ -85,9 +84,9 @@ static __inline__ void atomic_add(int i, atomic_t * v) | |||
85 | } else { | 84 | } else { |
86 | unsigned long flags; | 85 | unsigned long flags; |
87 | 86 | ||
88 | spin_lock_irqsave(&atomic_lock, flags); | 87 | local_irq_save(flags); |
89 | v->counter += i; | 88 | v->counter += i; |
90 | spin_unlock_irqrestore(&atomic_lock, flags); | 89 | local_irq_restore(flags); |
91 | } | 90 | } |
92 | } | 91 | } |
93 | 92 | ||
@@ -127,9 +126,9 @@ static __inline__ void atomic_sub(int i, atomic_t * v) | |||
127 | } else { | 126 | } else { |
128 | unsigned long flags; | 127 | unsigned long flags; |
129 | 128 | ||
130 | spin_lock_irqsave(&atomic_lock, flags); | 129 | local_irq_save(flags); |
131 | v->counter -= i; | 130 | v->counter -= i; |
132 | spin_unlock_irqrestore(&atomic_lock, flags); | 131 | local_irq_restore(flags); |
133 | } | 132 | } |
134 | } | 133 | } |
135 | 134 | ||
@@ -173,11 +172,11 @@ static __inline__ int atomic_add_return(int i, atomic_t * v) | |||
173 | } else { | 172 | } else { |
174 | unsigned long flags; | 173 | unsigned long flags; |
175 | 174 | ||
176 | spin_lock_irqsave(&atomic_lock, flags); | 175 | local_irq_save(flags); |
177 | result = v->counter; | 176 | result = v->counter; |
178 | result += i; | 177 | result += i; |
179 | v->counter = result; | 178 | v->counter = result; |
180 | spin_unlock_irqrestore(&atomic_lock, flags); | 179 | local_irq_restore(flags); |
181 | } | 180 | } |
182 | 181 | ||
183 | return result; | 182 | return result; |
@@ -220,11 +219,11 @@ static __inline__ int atomic_sub_return(int i, atomic_t * v) | |||
220 | } else { | 219 | } else { |
221 | unsigned long flags; | 220 | unsigned long flags; |
222 | 221 | ||
223 | spin_lock_irqsave(&atomic_lock, flags); | 222 | local_irq_save(flags); |
224 | result = v->counter; | 223 | result = v->counter; |
225 | result -= i; | 224 | result -= i; |
226 | v->counter = result; | 225 | v->counter = result; |
227 | spin_unlock_irqrestore(&atomic_lock, flags); | 226 | local_irq_restore(flags); |
228 | } | 227 | } |
229 | 228 | ||
230 | return result; | 229 | return result; |
@@ -277,12 +276,12 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v) | |||
277 | } else { | 276 | } else { |
278 | unsigned long flags; | 277 | unsigned long flags; |
279 | 278 | ||
280 | spin_lock_irqsave(&atomic_lock, flags); | 279 | local_irq_save(flags); |
281 | result = v->counter; | 280 | result = v->counter; |
282 | result -= i; | 281 | result -= i; |
283 | if (result >= 0) | 282 | if (result >= 0) |
284 | v->counter = result; | 283 | v->counter = result; |
285 | spin_unlock_irqrestore(&atomic_lock, flags); | 284 | local_irq_restore(flags); |
286 | } | 285 | } |
287 | 286 | ||
288 | return result; | 287 | return result; |
@@ -433,9 +432,9 @@ static __inline__ void atomic64_add(long i, atomic64_t * v) | |||
433 | } else { | 432 | } else { |
434 | unsigned long flags; | 433 | unsigned long flags; |
435 | 434 | ||
436 | spin_lock_irqsave(&atomic_lock, flags); | 435 | local_irq_save(flags); |
437 | v->counter += i; | 436 | v->counter += i; |
438 | spin_unlock_irqrestore(&atomic_lock, flags); | 437 | local_irq_restore(flags); |
439 | } | 438 | } |
440 | } | 439 | } |
441 | 440 | ||
@@ -475,9 +474,9 @@ static __inline__ void atomic64_sub(long i, atomic64_t * v) | |||
475 | } else { | 474 | } else { |
476 | unsigned long flags; | 475 | unsigned long flags; |
477 | 476 | ||
478 | spin_lock_irqsave(&atomic_lock, flags); | 477 | local_irq_save(flags); |
479 | v->counter -= i; | 478 | v->counter -= i; |
480 | spin_unlock_irqrestore(&atomic_lock, flags); | 479 | local_irq_restore(flags); |
481 | } | 480 | } |
482 | } | 481 | } |
483 | 482 | ||
@@ -521,11 +520,11 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v) | |||
521 | } else { | 520 | } else { |
522 | unsigned long flags; | 521 | unsigned long flags; |
523 | 522 | ||
524 | spin_lock_irqsave(&atomic_lock, flags); | 523 | local_irq_save(flags); |
525 | result = v->counter; | 524 | result = v->counter; |
526 | result += i; | 525 | result += i; |
527 | v->counter = result; | 526 | v->counter = result; |
528 | spin_unlock_irqrestore(&atomic_lock, flags); | 527 | local_irq_restore(flags); |
529 | } | 528 | } |
530 | 529 | ||
531 | return result; | 530 | return result; |
@@ -568,11 +567,11 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v) | |||
568 | } else { | 567 | } else { |
569 | unsigned long flags; | 568 | unsigned long flags; |
570 | 569 | ||
571 | spin_lock_irqsave(&atomic_lock, flags); | 570 | local_irq_save(flags); |
572 | result = v->counter; | 571 | result = v->counter; |
573 | result -= i; | 572 | result -= i; |
574 | v->counter = result; | 573 | v->counter = result; |
575 | spin_unlock_irqrestore(&atomic_lock, flags); | 574 | local_irq_restore(flags); |
576 | } | 575 | } |
577 | 576 | ||
578 | return result; | 577 | return result; |
@@ -625,12 +624,12 @@ static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v) | |||
625 | } else { | 624 | } else { |
626 | unsigned long flags; | 625 | unsigned long flags; |
627 | 626 | ||
628 | spin_lock_irqsave(&atomic_lock, flags); | 627 | local_irq_save(flags); |
629 | result = v->counter; | 628 | result = v->counter; |
630 | result -= i; | 629 | result -= i; |
631 | if (result >= 0) | 630 | if (result >= 0) |
632 | v->counter = result; | 631 | v->counter = result; |
633 | spin_unlock_irqrestore(&atomic_lock, flags); | 632 | local_irq_restore(flags); |
634 | } | 633 | } |
635 | 634 | ||
636 | return result; | 635 | return result; |
diff --git a/include/asm-mips/cpu-features.h b/include/asm-mips/cpu-features.h index 03627cfb3e45..78c9cc2735d5 100644 --- a/include/asm-mips/cpu-features.h +++ b/include/asm-mips/cpu-features.h | |||
@@ -116,6 +116,27 @@ | |||
116 | #endif | 116 | #endif |
117 | #endif | 117 | #endif |
118 | 118 | ||
119 | # ifndef cpu_has_mips32r1 | ||
120 | # define cpu_has_mips32r1 (cpu_data[0].isa_level & MIPS_CPU_ISA_M32R1) | ||
121 | # endif | ||
122 | # ifndef cpu_has_mips32r2 | ||
123 | # define cpu_has_mips32r2 (cpu_data[0].isa_level & MIPS_CPU_ISA_M32R2) | ||
124 | # endif | ||
125 | # ifndef cpu_has_mips64r1 | ||
126 | # define cpu_has_mips64r1 (cpu_data[0].isa_level & MIPS_CPU_ISA_M64R1) | ||
127 | # endif | ||
128 | # ifndef cpu_has_mips64r2 | ||
129 | # define cpu_has_mips64r2 (cpu_data[0].isa_level & MIPS_CPU_ISA_M64R2) | ||
130 | # endif | ||
131 | |||
132 | /* | ||
133 | * Shortcuts ... | ||
134 | */ | ||
135 | #define cpu_has_mips32 (cpu_has_mips32r1 | cpu_has_mips32r2) | ||
136 | #define cpu_has_mips64 (cpu_has_mips64r1 | cpu_has_mips64r2) | ||
137 | #define cpu_has_mips_r1 (cpu_has_mips32r1 | cpu_has_mips64r1) | ||
138 | #define cpu_has_mips_r2 (cpu_has_mips32r2 | cpu_has_mips64r2) | ||
139 | |||
119 | #ifndef cpu_has_dsp | 140 | #ifndef cpu_has_dsp |
120 | #define cpu_has_dsp (cpu_data[0].ases & MIPS_ASE_DSP) | 141 | #define cpu_has_dsp (cpu_data[0].ases & MIPS_ASE_DSP) |
121 | #endif | 142 | #endif |
diff --git a/include/asm-mips/cpu.h b/include/asm-mips/cpu.h index 48eac296060f..934e063e79f1 100644 --- a/include/asm-mips/cpu.h +++ b/include/asm-mips/cpu.h | |||
@@ -204,16 +204,18 @@ | |||
204 | */ | 204 | */ |
205 | #define MIPS_CPU_ISA_I 0x00000001 | 205 | #define MIPS_CPU_ISA_I 0x00000001 |
206 | #define MIPS_CPU_ISA_II 0x00000002 | 206 | #define MIPS_CPU_ISA_II 0x00000002 |
207 | #define MIPS_CPU_ISA_III 0x00008003 | 207 | #define MIPS_CPU_ISA_III 0x00000003 |
208 | #define MIPS_CPU_ISA_IV 0x00008004 | 208 | #define MIPS_CPU_ISA_IV 0x00000004 |
209 | #define MIPS_CPU_ISA_V 0x00008005 | 209 | #define MIPS_CPU_ISA_V 0x00000005 |
210 | #define MIPS_CPU_ISA_M32 0x00000020 | 210 | #define MIPS_CPU_ISA_M32R1 0x00000020 |
211 | #define MIPS_CPU_ISA_M64 0x00008040 | 211 | #define MIPS_CPU_ISA_M32R2 0x00000040 |
212 | #define MIPS_CPU_ISA_M64R1 0x00000080 | ||
213 | #define MIPS_CPU_ISA_M64R2 0x00000100 | ||
212 | 214 | ||
213 | /* | 215 | #define MIPS_CPU_ISA_32BIT (MIPS_CPU_ISA_I | MIPS_CPU_ISA_II | \ |
214 | * Bit 15 encodes if an ISA level supports 64-bit operations. | 216 | MIPS_CPU_ISA_M32R1 | MIPS_CPU_ISA_M32R2 ) |
215 | */ | 217 | #define MIPS_CPU_ISA_64BIT (MIPS_CPU_ISA_III | MIPS_CPU_ISA_IV | \ |
216 | #define MIPS_CPU_ISA_64BIT 0x00008000 | 218 | MIPS_CPU_ISA_V | MIPS_CPU_ISA_M64R1 | MIPS_CPU_ISA_M64R2) |
217 | 219 | ||
218 | /* | 220 | /* |
219 | * CPU Option encodings | 221 | * CPU Option encodings |
diff --git a/include/asm-mips/delay.h b/include/asm-mips/delay.h index 48d00cccdafa..64dd45150f64 100644 --- a/include/asm-mips/delay.h +++ b/include/asm-mips/delay.h | |||
@@ -52,13 +52,11 @@ static inline void __udelay(unsigned long usecs, unsigned long lpj) | |||
52 | unsigned long lo; | 52 | unsigned long lo; |
53 | 53 | ||
54 | /* | 54 | /* |
55 | * The common rates of 1000 and 128 are rounded wrongly by the | 55 | * The rates of 128 is rounded wrongly by the catchall case |
56 | * catchall case for 64-bit. Excessive precission? Probably ... | 56 | * for 64-bit. Excessive precission? Probably ... |
57 | */ | 57 | */ |
58 | #if defined(CONFIG_64BIT) && (HZ == 128) | 58 | #if defined(CONFIG_64BIT) && (HZ == 128) |
59 | usecs *= 0x0008637bd05af6c7UL; /* 2**64 / (1000000 / HZ) */ | 59 | usecs *= 0x0008637bd05af6c7UL; /* 2**64 / (1000000 / HZ) */ |
60 | #elif defined(CONFIG_64BIT) && (HZ == 1000) | ||
61 | usecs *= 0x004189374BC6A7f0UL; /* 2**64 / (1000000 / HZ) */ | ||
62 | #elif defined(CONFIG_64BIT) | 60 | #elif defined(CONFIG_64BIT) |
63 | usecs *= (0x8000000000000000UL / (500000 / HZ)); | 61 | usecs *= (0x8000000000000000UL / (500000 / HZ)); |
64 | #else /* 32-bit junk follows here */ | 62 | #else /* 32-bit junk follows here */ |
diff --git a/include/asm-mips/dsp.h b/include/asm-mips/dsp.h index 50f556bb4978..e9bfc0813c72 100644 --- a/include/asm-mips/dsp.h +++ b/include/asm-mips/dsp.h | |||
@@ -16,7 +16,7 @@ | |||
16 | #include <asm/mipsregs.h> | 16 | #include <asm/mipsregs.h> |
17 | 17 | ||
18 | #define DSP_DEFAULT 0x00000000 | 18 | #define DSP_DEFAULT 0x00000000 |
19 | #define DSP_MASK 0x1f | 19 | #define DSP_MASK 0x3ff |
20 | 20 | ||
21 | #define __enable_dsp_hazard() \ | 21 | #define __enable_dsp_hazard() \ |
22 | do { \ | 22 | do { \ |
@@ -48,6 +48,7 @@ do { \ | |||
48 | tsk->thread.dsp.dspr[3] = mflo2(); \ | 48 | tsk->thread.dsp.dspr[3] = mflo2(); \ |
49 | tsk->thread.dsp.dspr[4] = mfhi3(); \ | 49 | tsk->thread.dsp.dspr[4] = mfhi3(); \ |
50 | tsk->thread.dsp.dspr[5] = mflo3(); \ | 50 | tsk->thread.dsp.dspr[5] = mflo3(); \ |
51 | tsk->thread.dsp.dspcontrol = rddsp(DSP_MASK); \ | ||
51 | } while (0) | 52 | } while (0) |
52 | 53 | ||
53 | #define save_dsp(tsk) \ | 54 | #define save_dsp(tsk) \ |
@@ -64,6 +65,7 @@ do { \ | |||
64 | mtlo2(tsk->thread.dsp.dspr[3]); \ | 65 | mtlo2(tsk->thread.dsp.dspr[3]); \ |
65 | mthi3(tsk->thread.dsp.dspr[4]); \ | 66 | mthi3(tsk->thread.dsp.dspr[4]); \ |
66 | mtlo3(tsk->thread.dsp.dspr[5]); \ | 67 | mtlo3(tsk->thread.dsp.dspr[5]); \ |
68 | wrdsp(tsk->thread.dsp.dspcontrol, DSP_MASK); \ | ||
67 | } while (0) | 69 | } while (0) |
68 | 70 | ||
69 | #define restore_dsp(tsk) \ | 71 | #define restore_dsp(tsk) \ |
diff --git a/include/asm-mips/elf.h b/include/asm-mips/elf.h index d2c9a25f8459..851f013adad3 100644 --- a/include/asm-mips/elf.h +++ b/include/asm-mips/elf.h | |||
@@ -277,12 +277,12 @@ do { \ | |||
277 | 277 | ||
278 | struct task_struct; | 278 | struct task_struct; |
279 | 279 | ||
280 | extern void dump_regs(elf_greg_t *, struct pt_regs *regs); | 280 | extern void elf_dump_regs(elf_greg_t *, struct pt_regs *regs); |
281 | extern int dump_task_regs (struct task_struct *, elf_gregset_t *); | 281 | extern int dump_task_regs (struct task_struct *, elf_gregset_t *); |
282 | extern int dump_task_fpu(struct task_struct *, elf_fpregset_t *); | 282 | extern int dump_task_fpu(struct task_struct *, elf_fpregset_t *); |
283 | 283 | ||
284 | #define ELF_CORE_COPY_REGS(elf_regs, regs) \ | 284 | #define ELF_CORE_COPY_REGS(elf_regs, regs) \ |
285 | dump_regs((elf_greg_t *)&(elf_regs), regs); | 285 | elf_dump_regs((elf_greg_t *)&(elf_regs), regs); |
286 | #define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk, elf_regs) | 286 | #define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk, elf_regs) |
287 | #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) \ | 287 | #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) \ |
288 | dump_task_fpu(tsk, elf_fpregs) | 288 | dump_task_fpu(tsk, elf_fpregs) |
diff --git a/include/asm-mips/hazards.h b/include/asm-mips/hazards.h index 7517189e469f..2fc90632f88c 100644 --- a/include/asm-mips/hazards.h +++ b/include/asm-mips/hazards.h | |||
@@ -233,15 +233,25 @@ __asm__( | |||
233 | #endif | 233 | #endif |
234 | 234 | ||
235 | #ifdef CONFIG_CPU_MIPSR2 | 235 | #ifdef CONFIG_CPU_MIPSR2 |
236 | /* | ||
237 | * gcc has a tradition of misscompiling the previous construct using the | ||
238 | * address of a label as argument to inline assembler. Gas otoh has the | ||
239 | * annoying difference between la and dla which are only usable for 32-bit | ||
240 | * rsp. 64-bit code, so can't be used without conditional compilation. | ||
241 | * The alterantive is switching the assembler to 64-bit code which happens | ||
242 | * to work right even for 32-bit code ... | ||
243 | */ | ||
236 | #define instruction_hazard() \ | 244 | #define instruction_hazard() \ |
237 | do { \ | 245 | do { \ |
238 | __label__ __next; \ | 246 | unsigned long tmp; \ |
247 | \ | ||
239 | __asm__ __volatile__( \ | 248 | __asm__ __volatile__( \ |
249 | " .set mips64r2 \n" \ | ||
250 | " dla %0, 1f \n" \ | ||
240 | " jr.hb %0 \n" \ | 251 | " jr.hb %0 \n" \ |
241 | : \ | 252 | " .set mips0 \n" \ |
242 | : "r" (&&__next)); \ | 253 | "1: \n" \ |
243 | __next: \ | 254 | : "=r" (tmp)); \ |
244 | ; \ | ||
245 | } while (0) | 255 | } while (0) |
246 | 256 | ||
247 | #else | 257 | #else |
diff --git a/include/asm-mips/interrupt.h b/include/asm-mips/interrupt.h index a5735761f5e5..abdf54ee64cf 100644 --- a/include/asm-mips/interrupt.h +++ b/include/asm-mips/interrupt.h | |||
@@ -93,6 +93,7 @@ __asm__ ( | |||
93 | " .set noat \n" | 93 | " .set noat \n" |
94 | #ifdef CONFIG_CPU_MIPSR2 | 94 | #ifdef CONFIG_CPU_MIPSR2 |
95 | " di \\result \n" | 95 | " di \\result \n" |
96 | " andi \\result, 1 \n" | ||
96 | #else | 97 | #else |
97 | " mfc0 \\result, $12 \n" | 98 | " mfc0 \\result, $12 \n" |
98 | " ori $1, \\result, 1 \n" | 99 | " ori $1, \\result, 1 \n" |
diff --git a/include/asm-mips/mach-au1x00/au1000.h b/include/asm-mips/mach-au1x00/au1000.h index 8327ec341c18..8e1d7ed7d8e3 100644 --- a/include/asm-mips/mach-au1x00/au1000.h +++ b/include/asm-mips/mach-au1x00/au1000.h | |||
@@ -838,6 +838,7 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]; | |||
838 | #define UART3_ADDR 0xB1400000 | 838 | #define UART3_ADDR 0xB1400000 |
839 | 839 | ||
840 | #define USB_OHCI_BASE 0x14020000 // phys addr for ioremap | 840 | #define USB_OHCI_BASE 0x14020000 // phys addr for ioremap |
841 | #define USB_OHCI_LEN 0x00060000 | ||
841 | #define USB_HOST_CONFIG 0xB4027ffc | 842 | #define USB_HOST_CONFIG 0xB4027ffc |
842 | 843 | ||
843 | #define AU1550_ETH0_BASE 0xB0500000 | 844 | #define AU1550_ETH0_BASE 0xB0500000 |
@@ -1017,10 +1018,12 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]; | |||
1017 | #define I2S_CONTROL_D (1<<1) | 1018 | #define I2S_CONTROL_D (1<<1) |
1018 | #define I2S_CONTROL_CE (1<<0) | 1019 | #define I2S_CONTROL_CE (1<<0) |
1019 | 1020 | ||
1020 | #ifndef CONFIG_SOC_AU1200 | ||
1021 | |||
1022 | /* USB Host Controller */ | 1021 | /* USB Host Controller */ |
1022 | #ifndef USB_OHCI_LEN | ||
1023 | #define USB_OHCI_LEN 0x00100000 | 1023 | #define USB_OHCI_LEN 0x00100000 |
1024 | #endif | ||
1025 | |||
1026 | #ifndef CONFIG_SOC_AU1200 | ||
1024 | 1027 | ||
1025 | /* USB Device Controller */ | 1028 | /* USB Device Controller */ |
1026 | #define USBD_EP0RD 0xB0200000 | 1029 | #define USBD_EP0RD 0xB0200000 |
diff --git a/include/asm-mips/mach-ip22/cpu-feature-overrides.h b/include/asm-mips/mach-ip22/cpu-feature-overrides.h index ab9714668177..2a37bedb4053 100644 --- a/include/asm-mips/mach-ip22/cpu-feature-overrides.h +++ b/include/asm-mips/mach-ip22/cpu-feature-overrides.h | |||
@@ -34,4 +34,9 @@ | |||
34 | #define cpu_has_nofpuex 0 | 34 | #define cpu_has_nofpuex 0 |
35 | #define cpu_has_64bits 1 | 35 | #define cpu_has_64bits 1 |
36 | 36 | ||
37 | #define cpu_has_mips32r1 0 | ||
38 | #define cpu_has_mips32r2 0 | ||
39 | #define cpu_has_mips64r1 0 | ||
40 | #define cpu_has_mips64r2 0 | ||
41 | |||
37 | #endif /* __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H */ | 42 | #endif /* __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H */ |
diff --git a/include/asm-mips/mach-ip27/cpu-feature-overrides.h b/include/asm-mips/mach-ip27/cpu-feature-overrides.h index 4c8a90051fd0..2d2f5b91e47f 100644 --- a/include/asm-mips/mach-ip27/cpu-feature-overrides.h +++ b/include/asm-mips/mach-ip27/cpu-feature-overrides.h | |||
@@ -37,4 +37,9 @@ | |||
37 | #define cpu_icache_line_size() 64 | 37 | #define cpu_icache_line_size() 64 |
38 | #define cpu_scache_line_size() 128 | 38 | #define cpu_scache_line_size() 128 |
39 | 39 | ||
40 | #define cpu_has_mips32r1 0 | ||
41 | #define cpu_has_mips32r2 0 | ||
42 | #define cpu_has_mips64r1 0 | ||
43 | #define cpu_has_mips64r2 0 | ||
44 | |||
40 | #endif /* __ASM_MACH_IP27_CPU_FEATURE_OVERRIDES_H */ | 45 | #endif /* __ASM_MACH_IP27_CPU_FEATURE_OVERRIDES_H */ |
diff --git a/include/asm-mips/mach-ip27/topology.h b/include/asm-mips/mach-ip27/topology.h index 82141c711c33..59d26b52ba32 100644 --- a/include/asm-mips/mach-ip27/topology.h +++ b/include/asm-mips/mach-ip27/topology.h | |||
@@ -27,7 +27,6 @@ extern unsigned char __node_distances[MAX_COMPACT_NODES][MAX_COMPACT_NODES]; | |||
27 | .max_interval = 32, \ | 27 | .max_interval = 32, \ |
28 | .busy_factor = 32, \ | 28 | .busy_factor = 32, \ |
29 | .imbalance_pct = 125, \ | 29 | .imbalance_pct = 125, \ |
30 | .cache_hot_time = (10*1000), \ | ||
31 | .cache_nice_tries = 1, \ | 30 | .cache_nice_tries = 1, \ |
32 | .per_cpu_gain = 100, \ | 31 | .per_cpu_gain = 100, \ |
33 | .flags = SD_LOAD_BALANCE \ | 32 | .flags = SD_LOAD_BALANCE \ |
diff --git a/include/asm-mips/mach-ip32/cpu-feature-overrides.h b/include/asm-mips/mach-ip32/cpu-feature-overrides.h index ab37fc1842ba..b80c30725cf6 100644 --- a/include/asm-mips/mach-ip32/cpu-feature-overrides.h +++ b/include/asm-mips/mach-ip32/cpu-feature-overrides.h | |||
@@ -39,4 +39,9 @@ | |||
39 | #define cpu_has_ic_fills_f_dc 0 | 39 | #define cpu_has_ic_fills_f_dc 0 |
40 | #define cpu_has_dsp 0 | 40 | #define cpu_has_dsp 0 |
41 | 41 | ||
42 | #define cpu_has_mips32r1 0 | ||
43 | #define cpu_has_mips32r2 0 | ||
44 | #define cpu_has_mips64r1 0 | ||
45 | #define cpu_has_mips64r2 0 | ||
46 | |||
42 | #endif /* __ASM_MACH_IP32_CPU_FEATURE_OVERRIDES_H */ | 47 | #endif /* __ASM_MACH_IP32_CPU_FEATURE_OVERRIDES_H */ |
diff --git a/include/asm-mips/mach-ja/cpu-feature-overrides.h b/include/asm-mips/mach-ja/cpu-feature-overrides.h index a0fde405d4c4..90ff087083b9 100644 --- a/include/asm-mips/mach-ja/cpu-feature-overrides.h +++ b/include/asm-mips/mach-ja/cpu-feature-overrides.h | |||
@@ -37,4 +37,9 @@ | |||
37 | #define cpu_icache_line_size() 32 | 37 | #define cpu_icache_line_size() 32 |
38 | #define cpu_scache_line_size() 32 | 38 | #define cpu_scache_line_size() 32 |
39 | 39 | ||
40 | #define cpu_has_mips32r1 0 | ||
41 | #define cpu_has_mips32r2 0 | ||
42 | #define cpu_has_mips64r1 0 | ||
43 | #define cpu_has_mips64r2 0 | ||
44 | |||
40 | #endif /* __ASM_MACH_JA_CPU_FEATURE_OVERRIDES_H */ | 45 | #endif /* __ASM_MACH_JA_CPU_FEATURE_OVERRIDES_H */ |
diff --git a/include/asm-mips/mach-ocelot3/cpu-feature-overrides.h b/include/asm-mips/mach-ocelot3/cpu-feature-overrides.h index 825c5f674dfc..782b986241dd 100644 --- a/include/asm-mips/mach-ocelot3/cpu-feature-overrides.h +++ b/include/asm-mips/mach-ocelot3/cpu-feature-overrides.h | |||
@@ -40,4 +40,9 @@ | |||
40 | #define cpu_icache_line_size() 32 | 40 | #define cpu_icache_line_size() 32 |
41 | #define cpu_scache_line_size() 32 | 41 | #define cpu_scache_line_size() 32 |
42 | 42 | ||
43 | #define cpu_has_mips32r1 0 | ||
44 | #define cpu_has_mips32r2 0 | ||
45 | #define cpu_has_mips64r1 0 | ||
46 | #define cpu_has_mips64r2 0 | ||
47 | |||
43 | #endif /* __ASM_MACH_JA_CPU_FEATURE_OVERRIDES_H */ | 48 | #endif /* __ASM_MACH_JA_CPU_FEATURE_OVERRIDES_H */ |
diff --git a/include/asm-mips/mach-rm200/cpu-feature-overrides.h b/include/asm-mips/mach-rm200/cpu-feature-overrides.h index 79f9b064c864..91e7cf5f2bfe 100644 --- a/include/asm-mips/mach-rm200/cpu-feature-overrides.h +++ b/include/asm-mips/mach-rm200/cpu-feature-overrides.h | |||
@@ -40,4 +40,9 @@ | |||
40 | #define cpu_icache_line_size() 32 | 40 | #define cpu_icache_line_size() 32 |
41 | #define cpu_scache_line_size() 0 /* No S-cache on R5000 I think ... */ | 41 | #define cpu_scache_line_size() 0 /* No S-cache on R5000 I think ... */ |
42 | 42 | ||
43 | #define cpu_has_mips32r1 0 | ||
44 | #define cpu_has_mips32r2 0 | ||
45 | #define cpu_has_mips64r1 0 | ||
46 | #define cpu_has_mips64r2 0 | ||
47 | |||
43 | #endif /* __ASM_MACH_RM200_CPU_FEATURE_OVERRIDES_H */ | 48 | #endif /* __ASM_MACH_RM200_CPU_FEATURE_OVERRIDES_H */ |
diff --git a/include/asm-mips/mach-yosemite/cpu-feature-overrides.h b/include/asm-mips/mach-yosemite/cpu-feature-overrides.h index 463d051f4683..3073542c93c7 100644 --- a/include/asm-mips/mach-yosemite/cpu-feature-overrides.h +++ b/include/asm-mips/mach-yosemite/cpu-feature-overrides.h | |||
@@ -37,4 +37,9 @@ | |||
37 | #define cpu_icache_line_size() 32 | 37 | #define cpu_icache_line_size() 32 |
38 | #define cpu_scache_line_size() 32 | 38 | #define cpu_scache_line_size() 32 |
39 | 39 | ||
40 | #define cpu_has_mips32r1 0 | ||
41 | #define cpu_has_mips32r2 0 | ||
42 | #define cpu_has_mips64r1 0 | ||
43 | #define cpu_has_mips64r2 0 | ||
44 | |||
40 | #endif /* __ASM_MACH_YOSEMITE_CPU_FEATURE_OVERRIDES_H */ | 45 | #endif /* __ASM_MACH_YOSEMITE_CPU_FEATURE_OVERRIDES_H */ |
diff --git a/include/asm-mips/mipsregs.h b/include/asm-mips/mipsregs.h index 80370e0a5589..035ba0a9b0df 100644 --- a/include/asm-mips/mipsregs.h +++ b/include/asm-mips/mipsregs.h | |||
@@ -1059,7 +1059,7 @@ do { \ | |||
1059 | " .set noat \n" \ | 1059 | " .set noat \n" \ |
1060 | " move $1, %0 \n" \ | 1060 | " move $1, %0 \n" \ |
1061 | " # wrdsp $1, %x1 \n" \ | 1061 | " # wrdsp $1, %x1 \n" \ |
1062 | " .word 0x7c2004f8 | (%x1 << 15) \n" \ | 1062 | " .word 0x7c2004f8 | (%x1 << 11) \n" \ |
1063 | " .set pop \n" \ | 1063 | " .set pop \n" \ |
1064 | : \ | 1064 | : \ |
1065 | : "r" (val), "i" (mask)); \ | 1065 | : "r" (val), "i" (mask)); \ |
diff --git a/include/asm-mips/processor.h b/include/asm-mips/processor.h index f1980c6c3bcc..39d2bd50fece 100644 --- a/include/asm-mips/processor.h +++ b/include/asm-mips/processor.h | |||
@@ -103,7 +103,6 @@ typedef __u32 dspreg_t; | |||
103 | struct mips_dsp_state { | 103 | struct mips_dsp_state { |
104 | dspreg_t dspr[NUM_DSP_REGS]; | 104 | dspreg_t dspr[NUM_DSP_REGS]; |
105 | unsigned int dspcontrol; | 105 | unsigned int dspcontrol; |
106 | unsigned short used_dsp; | ||
107 | }; | 106 | }; |
108 | 107 | ||
109 | #define INIT_DSP {{0,},} | 108 | #define INIT_DSP {{0,},} |
@@ -201,11 +200,11 @@ extern void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long | |||
201 | 200 | ||
202 | unsigned long get_wchan(struct task_struct *p); | 201 | unsigned long get_wchan(struct task_struct *p); |
203 | 202 | ||
204 | #define __PT_REG(reg) ((long)&((struct pt_regs *)0)->reg - sizeof(struct pt_regs)) | 203 | #define __KSTK_TOS(tsk) ((unsigned long)task_stack_page(tsk) + THREAD_SIZE - 32) |
205 | #define __KSTK_TOS(tsk) ((unsigned long)(tsk->thread_info) + THREAD_SIZE - 32) | 204 | #define task_pt_regs(tsk) ((struct pt_regs *)__KSTK_TOS(tsk) - 1) |
206 | #define KSTK_EIP(tsk) (*(unsigned long *)(__KSTK_TOS(tsk) + __PT_REG(cp0_epc))) | 205 | #define KSTK_EIP(tsk) (task_pt_regs(tsk)->cp0_epc) |
207 | #define KSTK_ESP(tsk) (*(unsigned long *)(__KSTK_TOS(tsk) + __PT_REG(regs[29]))) | 206 | #define KSTK_ESP(tsk) (task_pt_regs(tsk)->regs[29]) |
208 | #define KSTK_STATUS(tsk) (*(unsigned long *)(__KSTK_TOS(tsk) + __PT_REG(cp0_status))) | 207 | #define KSTK_STATUS(tsk) (task_pt_regs(tsk)->cp0_status) |
209 | 208 | ||
210 | #define cpu_relax() barrier() | 209 | #define cpu_relax() barrier() |
211 | 210 | ||
diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h index 330c4e497af3..e8e5d4143377 100644 --- a/include/asm-mips/system.h +++ b/include/asm-mips/system.h | |||
@@ -159,11 +159,21 @@ struct task_struct; | |||
159 | do { \ | 159 | do { \ |
160 | if (cpu_has_dsp) \ | 160 | if (cpu_has_dsp) \ |
161 | __save_dsp(prev); \ | 161 | __save_dsp(prev); \ |
162 | (last) = resume(prev, next, next->thread_info); \ | 162 | (last) = resume(prev, next, task_thread_info(next)); \ |
163 | if (cpu_has_dsp) \ | 163 | if (cpu_has_dsp) \ |
164 | __restore_dsp(current); \ | 164 | __restore_dsp(current); \ |
165 | } while(0) | 165 | } while(0) |
166 | 166 | ||
167 | /* | ||
168 | * On SMP systems, when the scheduler does migration-cost autodetection, | ||
169 | * it needs a way to flush as much of the CPU's caches as possible. | ||
170 | * | ||
171 | * TODO: fill this in! | ||
172 | */ | ||
173 | static inline void sched_cacheflush(void) | ||
174 | { | ||
175 | } | ||
176 | |||
167 | static inline unsigned long __xchg_u32(volatile int * m, unsigned int val) | 177 | static inline unsigned long __xchg_u32(volatile int * m, unsigned int val) |
168 | { | 178 | { |
169 | __u32 retval; | 179 | __u32 retval; |
diff --git a/include/asm-mips/thread_info.h b/include/asm-mips/thread_info.h index e6c24472e03f..1612b3fe1080 100644 --- a/include/asm-mips/thread_info.h +++ b/include/asm-mips/thread_info.h | |||
@@ -97,8 +97,6 @@ register struct thread_info *__current_thread_info __asm__("$28"); | |||
97 | #endif | 97 | #endif |
98 | 98 | ||
99 | #define free_thread_info(info) kfree(info) | 99 | #define free_thread_info(info) kfree(info) |
100 | #define get_thread_info(ti) get_task_struct((ti)->task) | ||
101 | #define put_thread_info(ti) put_task_struct((ti)->task) | ||
102 | 100 | ||
103 | #endif /* !__ASSEMBLY__ */ | 101 | #endif /* !__ASSEMBLY__ */ |
104 | 102 | ||
diff --git a/include/asm-mips/vr41xx/capcella.h b/include/asm-mips/vr41xx/capcella.h index 5b55083c5281..d10ffda50de7 100644 --- a/include/asm-mips/vr41xx/capcella.h +++ b/include/asm-mips/vr41xx/capcella.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * capcella.h, Include file for ZAO Networks Capcella. | 2 | * capcella.h, Include file for ZAO Networks Capcella. |
3 | * | 3 | * |
4 | * Copyright (C) 2002-2004 Yoichi Yuasa <yuasa@hh.iij4u.or.jp> | 4 | * Copyright (C) 2002-2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/include/asm-mips/vr41xx/e55.h b/include/asm-mips/vr41xx/e55.h index ea37b56fc66d..558f2269bf37 100644 --- a/include/asm-mips/vr41xx/e55.h +++ b/include/asm-mips/vr41xx/e55.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * e55.h, Include file for CASIO CASSIOPEIA E-10/15/55/65. | 2 | * e55.h, Include file for CASIO CASSIOPEIA E-10/15/55/65. |
3 | * | 3 | * |
4 | * Copyright (C) 2002-2004 Yoichi Yuasa <yuasa@hh.iij4u.or.jp> | 4 | * Copyright (C) 2002-2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/include/asm-mips/vr41xx/giu.h b/include/asm-mips/vr41xx/giu.h index 8590885a7638..8109cda557dc 100644 --- a/include/asm-mips/vr41xx/giu.h +++ b/include/asm-mips/vr41xx/giu.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Include file for NEC VR4100 series General-purpose I/O Unit. | 2 | * Include file for NEC VR4100 series General-purpose I/O Unit. |
3 | * | 3 | * |
4 | * Copyright (C) 2005 Yoichi Yuasa <yuasa@hh.iij4u.or.jp> | 4 | * Copyright (C) 2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/include/asm-mips/vr41xx/mpc30x.h b/include/asm-mips/vr41xx/mpc30x.h index e6ac3c8e8bae..a6cbe4da6667 100644 --- a/include/asm-mips/vr41xx/mpc30x.h +++ b/include/asm-mips/vr41xx/mpc30x.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * mpc30x.h, Include file for Victor MP-C303/304. | 2 | * mpc30x.h, Include file for Victor MP-C303/304. |
3 | * | 3 | * |
4 | * Copyright (C) 2002-2004 Yoichi Yuasa <yuasa@hh.iij4u.or.jp> | 4 | * Copyright (C) 2002-2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/include/asm-mips/vr41xx/pci.h b/include/asm-mips/vr41xx/pci.h index c473aa78d1d4..6fc01ce19777 100644 --- a/include/asm-mips/vr41xx/pci.h +++ b/include/asm-mips/vr41xx/pci.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Include file for NEC VR4100 series PCI Control Unit. | 2 | * Include file for NEC VR4100 series PCI Control Unit. |
3 | * | 3 | * |
4 | * Copyright (C) 2004-2005 Yoichi Yuasa <yuasa@hh.iij4u.or.jp> | 4 | * Copyright (C) 2004-2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/include/asm-mips/vr41xx/siu.h b/include/asm-mips/vr41xx/siu.h index 865cc07ddd7f..1fcf6e8082b4 100644 --- a/include/asm-mips/vr41xx/siu.h +++ b/include/asm-mips/vr41xx/siu.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Include file for NEC VR4100 series Serial Interface Unit. | 2 | * Include file for NEC VR4100 series Serial Interface Unit. |
3 | * | 3 | * |
4 | * Copyright (C) 2005 Yoichi Yuasa <yuasa@hh.iij4u.or.jp> | 4 | * Copyright (C) 2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/include/asm-mips/vr41xx/tb0219.h b/include/asm-mips/vr41xx/tb0219.h index 273c6392688f..b318b9612a83 100644 --- a/include/asm-mips/vr41xx/tb0219.h +++ b/include/asm-mips/vr41xx/tb0219.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * tb0219.h, Include file for TANBAC TB0219. | 2 | * tb0219.h, Include file for TANBAC TB0219. |
3 | * | 3 | * |
4 | * Copyright (C) 2002-2004 Yoichi Yuasa <yuasa@hh.iij4u.or.jp> | 4 | * Copyright (C) 2002-2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> |
5 | * | 5 | * |
6 | * Modified for TANBAC TB0219: | 6 | * Modified for TANBAC TB0219: |
7 | * Copyright (C) 2003 Megasolution Inc. <matsu@megasolution.jp> | 7 | * Copyright (C) 2003 Megasolution Inc. <matsu@megasolution.jp> |
diff --git a/include/asm-mips/vr41xx/tb0226.h b/include/asm-mips/vr41xx/tb0226.h index 0ff9a60ecacc..2513f450e2d6 100644 --- a/include/asm-mips/vr41xx/tb0226.h +++ b/include/asm-mips/vr41xx/tb0226.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * tb0226.h, Include file for TANBAC TB0226. | 2 | * tb0226.h, Include file for TANBAC TB0226. |
3 | * | 3 | * |
4 | * Copyright (C) 2002-2004 Yoichi Yuasa <yuasa@hh.iij4u.or.jp> | 4 | * Copyright (C) 2002-2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/include/asm-mips/vr41xx/vr41xx.h b/include/asm-mips/vr41xx/vr41xx.h index bd2723c30901..70828d5fae9c 100644 --- a/include/asm-mips/vr41xx/vr41xx.h +++ b/include/asm-mips/vr41xx/vr41xx.h | |||
@@ -7,7 +7,7 @@ | |||
7 | * Copyright (C) 2001, 2002 Paul Mundt | 7 | * Copyright (C) 2001, 2002 Paul Mundt |
8 | * Copyright (C) 2002 MontaVista Software, Inc. | 8 | * Copyright (C) 2002 MontaVista Software, Inc. |
9 | * Copyright (C) 2002 TimeSys Corp. | 9 | * Copyright (C) 2002 TimeSys Corp. |
10 | * Copyright (C) 2003-2005 Yoichi Yuasa <yuasa@hh.iij4u.or.jp> | 10 | * Copyright (C) 2003-2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> |
11 | * | 11 | * |
12 | * This program is free software; you can redistribute it and/or modify it | 12 | * This program is free software; you can redistribute it and/or modify it |
13 | * under the terms of the GNU General Public License as published by the | 13 | * under the terms of the GNU General Public License as published by the |
diff --git a/include/asm-mips/vr41xx/vrc4173.h b/include/asm-mips/vr41xx/vrc4173.h index bb7a85c186e4..4d41a9c091d4 100644 --- a/include/asm-mips/vr41xx/vrc4173.h +++ b/include/asm-mips/vr41xx/vrc4173.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * Copyright (C) 2000 Michael R. McDonald | 4 | * Copyright (C) 2000 Michael R. McDonald |
5 | * Copyright (C) 2001-2003 Montavista Software Inc. | 5 | * Copyright (C) 2001-2003 Montavista Software Inc. |
6 | * Author: Yoichi Yuasa <yyuasa@mvista.com, or source@mvista.com> | 6 | * Author: Yoichi Yuasa <yyuasa@mvista.com, or source@mvista.com> |
7 | * Copyright (C) 2004 Yoichi Yuasa <yuasa@hh.iij4u.or.jp> | 7 | * Copyright (C) 2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> |
8 | * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org) | 8 | * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org) |
9 | * | 9 | * |
10 | * This program is free software; you can redistribute it and/or modify | 10 | * This program is free software; you can redistribute it and/or modify |
diff --git a/include/asm-mips/vr41xx/workpad.h b/include/asm-mips/vr41xx/workpad.h index dfe01b43fb79..6bfa9c009a9b 100644 --- a/include/asm-mips/vr41xx/workpad.h +++ b/include/asm-mips/vr41xx/workpad.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * workpad.h, Include file for IBM WorkPad z50. | 2 | * workpad.h, Include file for IBM WorkPad z50. |
3 | * | 3 | * |
4 | * Copyright (C) 2002-2004 Yoichi Yuasa <yuasa@hh.iij4u.or.jp> | 4 | * Copyright (C) 2002-2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/include/asm-parisc/cache.h b/include/asm-parisc/cache.h index 38d201b5652d..93f179f13ce8 100644 --- a/include/asm-parisc/cache.h +++ b/include/asm-parisc/cache.h | |||
@@ -29,14 +29,14 @@ | |||
29 | 29 | ||
30 | #define SMP_CACHE_BYTES L1_CACHE_BYTES | 30 | #define SMP_CACHE_BYTES L1_CACHE_BYTES |
31 | 31 | ||
32 | extern void flush_data_cache_local(void); /* flushes local data-cache only */ | 32 | extern void flush_data_cache_local(void *); /* flushes local data-cache only */ |
33 | extern void flush_instruction_cache_local(void); /* flushes local code-cache only */ | 33 | extern void flush_instruction_cache_local(void *); /* flushes local code-cache only */ |
34 | #ifdef CONFIG_SMP | 34 | #ifdef CONFIG_SMP |
35 | extern void flush_data_cache(void); /* flushes data-cache only (all processors) */ | 35 | extern void flush_data_cache(void); /* flushes data-cache only (all processors) */ |
36 | extern void flush_instruction_cache(void); /* flushes i-cache only (all processors) */ | 36 | extern void flush_instruction_cache(void); /* flushes i-cache only (all processors) */ |
37 | #else | 37 | #else |
38 | #define flush_data_cache flush_data_cache_local | 38 | #define flush_data_cache() flush_data_cache_local(NULL) |
39 | #define flush_instruction_cache flush_instruction_cache_local | 39 | #define flush_instruction_cache() flush_instruction_cache_local(NULL) |
40 | #endif | 40 | #endif |
41 | 41 | ||
42 | extern void parisc_cache_init(void); /* initializes cache-flushing */ | 42 | extern void parisc_cache_init(void); /* initializes cache-flushing */ |
diff --git a/include/asm-parisc/io.h b/include/asm-parisc/io.h index b9bb5946ecc9..0db00adc942a 100644 --- a/include/asm-parisc/io.h +++ b/include/asm-parisc/io.h | |||
@@ -41,7 +41,7 @@ extern void __raw_bad_addr(const volatile void __iomem *addr); | |||
41 | #define __raw_check_addr(addr) \ | 41 | #define __raw_check_addr(addr) \ |
42 | if (((unsigned long)addr >> NYBBLE_SHIFT) != 0xe) \ | 42 | if (((unsigned long)addr >> NYBBLE_SHIFT) != 0xe) \ |
43 | __raw_bad_addr(addr); \ | 43 | __raw_bad_addr(addr); \ |
44 | addr = (void *)((unsigned long)addr | (0xfUL << NYBBLE_SHIFT)); | 44 | addr = (void __iomem *)((unsigned long)addr | (0xfUL << NYBBLE_SHIFT)); |
45 | #else | 45 | #else |
46 | #define gsc_check_addr(addr) | 46 | #define gsc_check_addr(addr) |
47 | #define __raw_check_addr(addr) | 47 | #define __raw_check_addr(addr) |
diff --git a/include/asm-parisc/page.h b/include/asm-parisc/page.h index 44eae9f8274d..4a6752b0afed 100644 --- a/include/asm-parisc/page.h +++ b/include/asm-parisc/page.h | |||
@@ -135,6 +135,13 @@ extern int npmem_ranges; | |||
135 | #define pfn_valid(pfn) ((pfn) < max_mapnr) | 135 | #define pfn_valid(pfn) ((pfn) < max_mapnr) |
136 | #endif /* CONFIG_DISCONTIGMEM */ | 136 | #endif /* CONFIG_DISCONTIGMEM */ |
137 | 137 | ||
138 | #ifdef CONFIG_HUGETLB_PAGE | ||
139 | #define HPAGE_SHIFT 22 /* 4MB (is this fixed?) */ | ||
140 | #define HPAGE_SIZE ((1UL) << HPAGE_SHIFT) | ||
141 | #define HPAGE_MASK (~(HPAGE_SIZE - 1)) | ||
142 | #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) | ||
143 | #endif | ||
144 | |||
138 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) | 145 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) |
139 | 146 | ||
140 | #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) | 147 | #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) |
diff --git a/include/asm-parisc/pci.h b/include/asm-parisc/pci.h index fa39d07d49e9..f277254159b7 100644 --- a/include/asm-parisc/pci.h +++ b/include/asm-parisc/pci.h | |||
@@ -84,11 +84,17 @@ static __inline__ int pci_is_lmmio(struct pci_hba_data *hba, unsigned long a) | |||
84 | /* | 84 | /* |
85 | ** Convert between PCI (IO_VIEW) addresses and processor (PA_VIEW) addresses. | 85 | ** Convert between PCI (IO_VIEW) addresses and processor (PA_VIEW) addresses. |
86 | ** See pcibios.c for more conversions used by Generic PCI code. | 86 | ** See pcibios.c for more conversions used by Generic PCI code. |
87 | ** | ||
88 | ** Platform characteristics/firmware guarantee that | ||
89 | ** (1) PA_VIEW - IO_VIEW = lmmio_offset for both LMMIO and ELMMIO | ||
90 | ** (2) PA_VIEW == IO_VIEW for GMMIO | ||
87 | */ | 91 | */ |
88 | #define PCI_BUS_ADDR(hba,a) (PCI_IS_LMMIO(hba,a) \ | 92 | #define PCI_BUS_ADDR(hba,a) (PCI_IS_LMMIO(hba,a) \ |
89 | ? ((a) - hba->lmmio_space_offset) /* mangle LMMIO */ \ | 93 | ? ((a) - hba->lmmio_space_offset) /* mangle LMMIO */ \ |
90 | : (a)) /* GMMIO */ | 94 | : (a)) /* GMMIO */ |
91 | #define PCI_HOST_ADDR(hba,a) ((a) + hba->lmmio_space_offset) | 95 | #define PCI_HOST_ADDR(hba,a) (((a) & PCI_F_EXTEND) == 0 \ |
96 | ? (a) + hba->lmmio_space_offset \ | ||
97 | : (a)) | ||
92 | 98 | ||
93 | #else /* !CONFIG_64BIT */ | 99 | #else /* !CONFIG_64BIT */ |
94 | 100 | ||
diff --git a/include/asm-parisc/processor.h b/include/asm-parisc/processor.h index aae40e8c3aa8..89f2f1c16c12 100644 --- a/include/asm-parisc/processor.h +++ b/include/asm-parisc/processor.h | |||
@@ -144,16 +144,16 @@ struct thread_struct { | |||
144 | }) | 144 | }) |
145 | 145 | ||
146 | #define INIT_THREAD { \ | 146 | #define INIT_THREAD { \ |
147 | regs: { gr: { 0, }, \ | 147 | .regs = { .gr = { 0, }, \ |
148 | fr: { 0, }, \ | 148 | .fr = { 0, }, \ |
149 | sr: { 0, }, \ | 149 | .sr = { 0, }, \ |
150 | iasq: { 0, }, \ | 150 | .iasq = { 0, }, \ |
151 | iaoq: { 0, }, \ | 151 | .iaoq = { 0, }, \ |
152 | cr27: 0, \ | 152 | .cr27 = 0, \ |
153 | }, \ | 153 | }, \ |
154 | task_size: DEFAULT_TASK_SIZE, \ | 154 | .task_size = DEFAULT_TASK_SIZE, \ |
155 | map_base: DEFAULT_MAP_BASE, \ | 155 | .map_base = DEFAULT_MAP_BASE, \ |
156 | flags: 0 \ | 156 | .flags = 0 \ |
157 | } | 157 | } |
158 | 158 | ||
159 | /* | 159 | /* |
diff --git a/include/asm-parisc/system.h b/include/asm-parisc/system.h index f3928d3a80cb..a5a973c0c07f 100644 --- a/include/asm-parisc/system.h +++ b/include/asm-parisc/system.h | |||
@@ -49,6 +49,15 @@ extern struct task_struct *_switch_to(struct task_struct *, struct task_struct * | |||
49 | (last) = _switch_to(prev, next); \ | 49 | (last) = _switch_to(prev, next); \ |
50 | } while(0) | 50 | } while(0) |
51 | 51 | ||
52 | /* | ||
53 | * On SMP systems, when the scheduler does migration-cost autodetection, | ||
54 | * it needs a way to flush as much of the CPU's caches as possible. | ||
55 | * | ||
56 | * TODO: fill this in! | ||
57 | */ | ||
58 | static inline void sched_cacheflush(void) | ||
59 | { | ||
60 | } | ||
52 | 61 | ||
53 | 62 | ||
54 | /* interrupt control */ | 63 | /* interrupt control */ |
diff --git a/include/asm-parisc/thread_info.h b/include/asm-parisc/thread_info.h index 57bbb76cb6c1..ac32f140b83a 100644 --- a/include/asm-parisc/thread_info.h +++ b/include/asm-parisc/thread_info.h | |||
@@ -43,9 +43,6 @@ struct thread_info { | |||
43 | #define alloc_thread_info(tsk) ((struct thread_info *) \ | 43 | #define alloc_thread_info(tsk) ((struct thread_info *) \ |
44 | __get_free_pages(GFP_KERNEL, THREAD_ORDER)) | 44 | __get_free_pages(GFP_KERNEL, THREAD_ORDER)) |
45 | #define free_thread_info(ti) free_pages((unsigned long) (ti), THREAD_ORDER) | 45 | #define free_thread_info(ti) free_pages((unsigned long) (ti), THREAD_ORDER) |
46 | #define get_thread_info(ti) get_task_struct((ti)->task) | ||
47 | #define put_thread_info(ti) put_task_struct((ti)->task) | ||
48 | |||
49 | 46 | ||
50 | /* how to get the thread information struct from C */ | 47 | /* how to get the thread information struct from C */ |
51 | #define current_thread_info() ((struct thread_info *)mfctl(30)) | 48 | #define current_thread_info() ((struct thread_info *)mfctl(30)) |
diff --git a/include/asm-parisc/tlbflush.h b/include/asm-parisc/tlbflush.h index c9ec39c6fc6c..825994a90e2d 100644 --- a/include/asm-parisc/tlbflush.h +++ b/include/asm-parisc/tlbflush.h | |||
@@ -22,6 +22,7 @@ extern spinlock_t pa_tlb_lock; | |||
22 | #define purge_tlb_end(x) spin_unlock(&pa_tlb_lock) | 22 | #define purge_tlb_end(x) spin_unlock(&pa_tlb_lock) |
23 | 23 | ||
24 | extern void flush_tlb_all(void); | 24 | extern void flush_tlb_all(void); |
25 | extern void flush_tlb_all_local(void *); | ||
25 | 26 | ||
26 | /* | 27 | /* |
27 | * flush_tlb_mm() | 28 | * flush_tlb_mm() |
diff --git a/include/asm-powerpc/eeh.h b/include/asm-powerpc/eeh.h index 4395b7bc1ed4..b263fb2fa6e4 100644 --- a/include/asm-powerpc/eeh.h +++ b/include/asm-powerpc/eeh.h | |||
@@ -34,9 +34,11 @@ struct device_node; | |||
34 | extern int eeh_subsystem_enabled; | 34 | extern int eeh_subsystem_enabled; |
35 | 35 | ||
36 | /* Values for eeh_mode bits in device_node */ | 36 | /* Values for eeh_mode bits in device_node */ |
37 | #define EEH_MODE_SUPPORTED (1<<0) | 37 | #define EEH_MODE_SUPPORTED (1<<0) |
38 | #define EEH_MODE_NOCHECK (1<<1) | 38 | #define EEH_MODE_NOCHECK (1<<1) |
39 | #define EEH_MODE_ISOLATED (1<<2) | 39 | #define EEH_MODE_ISOLATED (1<<2) |
40 | #define EEH_MODE_RECOVERING (1<<3) | ||
41 | #define EEH_MODE_IRQ_DISABLED (1<<4) | ||
40 | 42 | ||
41 | /* Max number of EEH freezes allowed before we consider the device | 43 | /* Max number of EEH freezes allowed before we consider the device |
42 | * to be permanently disabled. */ | 44 | * to be permanently disabled. */ |
diff --git a/include/asm-powerpc/eeh_event.h b/include/asm-powerpc/eeh_event.h index 5e11a00b6fa0..93d55a2bebfd 100644 --- a/include/asm-powerpc/eeh_event.h +++ b/include/asm-powerpc/eeh_event.h | |||
@@ -30,7 +30,7 @@ struct eeh_event { | |||
30 | struct list_head list; | 30 | struct list_head list; |
31 | struct device_node *dn; /* struct device node */ | 31 | struct device_node *dn; /* struct device node */ |
32 | struct pci_dev *dev; /* affected device */ | 32 | struct pci_dev *dev; /* affected device */ |
33 | int state; | 33 | enum pci_channel_state state; /* PCI bus state for the affected device */ |
34 | int time_unavail; /* milliseconds until device might be available */ | 34 | int time_unavail; /* milliseconds until device might be available */ |
35 | }; | 35 | }; |
36 | 36 | ||
@@ -47,8 +47,11 @@ struct eeh_event { | |||
47 | */ | 47 | */ |
48 | int eeh_send_failure_event (struct device_node *dn, | 48 | int eeh_send_failure_event (struct device_node *dn, |
49 | struct pci_dev *dev, | 49 | struct pci_dev *dev, |
50 | int reset_state, | 50 | enum pci_channel_state state, |
51 | int time_unavail); | 51 | int time_unavail); |
52 | 52 | ||
53 | /* Main recovery function */ | ||
54 | void handle_eeh_events (struct eeh_event *); | ||
55 | |||
53 | #endif /* __KERNEL__ */ | 56 | #endif /* __KERNEL__ */ |
54 | #endif /* ASM_PPC64_EEH_EVENT_H */ | 57 | #endif /* ASM_PPC64_EEH_EVENT_H */ |
diff --git a/include/asm-powerpc/elf.h b/include/asm-powerpc/elf.h index c5a635d9bba4..45f2af6f89c4 100644 --- a/include/asm-powerpc/elf.h +++ b/include/asm-powerpc/elf.h | |||
@@ -92,7 +92,6 @@ | |||
92 | * as published by the Free Software Foundation; either version | 92 | * as published by the Free Software Foundation; either version |
93 | * 2 of the License, or (at your option) any later version. | 93 | * 2 of the License, or (at your option) any later version. |
94 | */ | 94 | */ |
95 | #include <asm/ptrace.h> | ||
96 | 95 | ||
97 | #define ELF_NGREG 48 /* includes nip, msr, lr, etc. */ | 96 | #define ELF_NGREG 48 /* includes nip, msr, lr, etc. */ |
98 | #define ELF_NFPREG 33 /* includes fpscr */ | 97 | #define ELF_NFPREG 33 /* includes fpscr */ |
diff --git a/include/asm-powerpc/iommu.h b/include/asm-powerpc/iommu.h index 8a8393e50774..d5677cbec200 100644 --- a/include/asm-powerpc/iommu.h +++ b/include/asm-powerpc/iommu.h | |||
@@ -64,25 +64,6 @@ extern void iommu_free_table(struct device_node *dn); | |||
64 | 64 | ||
65 | #endif /* CONFIG_PPC_MULTIPLATFORM */ | 65 | #endif /* CONFIG_PPC_MULTIPLATFORM */ |
66 | 66 | ||
67 | #ifdef CONFIG_PPC_PSERIES | ||
68 | |||
69 | /* Creates table for an individual device node */ | ||
70 | extern void iommu_devnode_init_pSeries(struct device_node *dn); | ||
71 | |||
72 | #endif /* CONFIG_PPC_PSERIES */ | ||
73 | |||
74 | #ifdef CONFIG_PPC_ISERIES | ||
75 | |||
76 | /* Creates table for an individual device node */ | ||
77 | extern void iommu_devnode_init_iSeries(struct device_node *dn); | ||
78 | /* Get table parameters from HV */ | ||
79 | extern void iommu_table_getparms_iSeries(unsigned long busno, | ||
80 | unsigned char slotno, | ||
81 | unsigned char virtbus, | ||
82 | struct iommu_table* tbl); | ||
83 | |||
84 | #endif /* CONFIG_PPC_ISERIES */ | ||
85 | |||
86 | /* Initializes an iommu_table based in values set in the passed-in | 67 | /* Initializes an iommu_table based in values set in the passed-in |
87 | * structure | 68 | * structure |
88 | */ | 69 | */ |
diff --git a/include/asm-powerpc/iseries/hv_call.h b/include/asm-powerpc/iseries/hv_call.h index e9f831c9a5e5..162d653ad51f 100644 --- a/include/asm-powerpc/iseries/hv_call.h +++ b/include/asm-powerpc/iseries/hv_call.h | |||
@@ -1,5 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * HvCall.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | 2 | * Copyright (C) 2001 Mike Corrigan IBM Corporation |
4 | * | 3 | * |
5 | * This program is free software; you can redistribute it and/or modify | 4 | * This program is free software; you can redistribute it and/or modify |
@@ -15,8 +14,7 @@ | |||
15 | * You should have received a copy of the GNU General Public License | 14 | * You should have received a copy of the GNU General Public License |
16 | * along with this program; if not, write to the Free Software | 15 | * along with this program; if not, write to the Free Software |
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
18 | */ | 17 | * |
19 | /* | ||
20 | * This file contains the "hypervisor call" interface which is used to | 18 | * This file contains the "hypervisor call" interface which is used to |
21 | * drive the hypervisor from the OS. | 19 | * drive the hypervisor from the OS. |
22 | */ | 20 | */ |
diff --git a/include/asm-powerpc/iseries/hv_call_event.h b/include/asm-powerpc/iseries/hv_call_event.h index 46763a30590a..4cec4762076d 100644 --- a/include/asm-powerpc/iseries/hv_call_event.h +++ b/include/asm-powerpc/iseries/hv_call_event.h | |||
@@ -1,5 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * HvCallEvent.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | 2 | * Copyright (C) 2001 Mike Corrigan IBM Corporation |
4 | * | 3 | * |
5 | * This program is free software; you can redistribute it and/or modify | 4 | * This program is free software; you can redistribute it and/or modify |
@@ -15,8 +14,7 @@ | |||
15 | * You should have received a copy of the GNU General Public License | 14 | * You should have received a copy of the GNU General Public License |
16 | * along with this program; if not, write to the Free Software | 15 | * along with this program; if not, write to the Free Software |
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
18 | */ | 17 | * |
19 | /* | ||
20 | * This file contains the "hypervisor call" interface which is used to | 18 | * This file contains the "hypervisor call" interface which is used to |
21 | * drive the hypervisor from the OS. | 19 | * drive the hypervisor from the OS. |
22 | */ | 20 | */ |
@@ -33,32 +31,9 @@ typedef u8 HvLpEvent_Type; | |||
33 | typedef u8 HvLpEvent_AckInd; | 31 | typedef u8 HvLpEvent_AckInd; |
34 | typedef u8 HvLpEvent_AckType; | 32 | typedef u8 HvLpEvent_AckType; |
35 | 33 | ||
36 | struct HvCallEvent_PackedParms { | ||
37 | u8 xAckType:1; | ||
38 | u8 xAckInd:1; | ||
39 | u8 xRsvd:1; | ||
40 | u8 xTargetLp:5; | ||
41 | u8 xType; | ||
42 | u16 xSubtype; | ||
43 | HvLpInstanceId xSourceInstId; | ||
44 | HvLpInstanceId xTargetInstId; | ||
45 | }; | ||
46 | |||
47 | typedef u8 HvLpDma_Direction; | 34 | typedef u8 HvLpDma_Direction; |
48 | typedef u8 HvLpDma_AddressType; | 35 | typedef u8 HvLpDma_AddressType; |
49 | 36 | ||
50 | struct HvCallEvent_PackedDmaParms { | ||
51 | u8 xDirection:1; | ||
52 | u8 xLocalAddrType:1; | ||
53 | u8 xRemoteAddrType:1; | ||
54 | u8 xRsvd1:5; | ||
55 | HvLpIndex xRemoteLp; | ||
56 | u8 xType; | ||
57 | u8 xRsvd2; | ||
58 | HvLpInstanceId xLocalInstId; | ||
59 | HvLpInstanceId xRemoteInstId; | ||
60 | }; | ||
61 | |||
62 | typedef u64 HvLpEvent_Rc; | 37 | typedef u64 HvLpEvent_Rc; |
63 | typedef u64 HvLpDma_Rc; | 38 | typedef u64 HvLpDma_Rc; |
64 | 39 | ||
@@ -92,11 +67,8 @@ static inline void HvCallEvent_setInterLpQueueIndex(u8 queueIndex) | |||
92 | static inline void HvCallEvent_setLpEventStack(u8 queueIndex, | 67 | static inline void HvCallEvent_setLpEventStack(u8 queueIndex, |
93 | char *eventStackAddr, u32 eventStackSize) | 68 | char *eventStackAddr, u32 eventStackSize) |
94 | { | 69 | { |
95 | u64 abs_addr; | 70 | HvCall3(HvCallEventSetLpEventStack, queueIndex, |
96 | 71 | virt_to_abs(eventStackAddr), eventStackSize); | |
97 | abs_addr = virt_to_abs(eventStackAddr); | ||
98 | HvCall3(HvCallEventSetLpEventStack, queueIndex, abs_addr, | ||
99 | eventStackSize); | ||
100 | } | 72 | } |
101 | 73 | ||
102 | static inline void HvCallEvent_setLpEventQueueInterruptProc(u8 queueIndex, | 74 | static inline void HvCallEvent_setLpEventQueueInterruptProc(u8 queueIndex, |
@@ -108,14 +80,7 @@ static inline void HvCallEvent_setLpEventQueueInterruptProc(u8 queueIndex, | |||
108 | 80 | ||
109 | static inline HvLpEvent_Rc HvCallEvent_signalLpEvent(struct HvLpEvent *event) | 81 | static inline HvLpEvent_Rc HvCallEvent_signalLpEvent(struct HvLpEvent *event) |
110 | { | 82 | { |
111 | u64 abs_addr; | 83 | return HvCall1(HvCallEventSignalLpEvent, virt_to_abs(event)); |
112 | |||
113 | #ifdef DEBUG_SENDEVENT | ||
114 | printk("HvCallEvent_signalLpEvent: *event = %016lx\n ", | ||
115 | (unsigned long)event); | ||
116 | #endif | ||
117 | abs_addr = virt_to_abs(event); | ||
118 | return HvCall1(HvCallEventSignalLpEvent, abs_addr); | ||
119 | } | 84 | } |
120 | 85 | ||
121 | static inline HvLpEvent_Rc HvCallEvent_signalLpEventFast(HvLpIndex targetLp, | 86 | static inline HvLpEvent_Rc HvCallEvent_signalLpEventFast(HvLpIndex targetLp, |
@@ -127,17 +92,21 @@ static inline HvLpEvent_Rc HvCallEvent_signalLpEventFast(HvLpIndex targetLp, | |||
127 | { | 92 | { |
128 | /* Pack the misc bits into a single Dword to pass to PLIC */ | 93 | /* Pack the misc bits into a single Dword to pass to PLIC */ |
129 | union { | 94 | union { |
130 | struct HvCallEvent_PackedParms parms; | 95 | struct { |
96 | u8 ack_and_target; | ||
97 | u8 type; | ||
98 | u16 subtype; | ||
99 | HvLpInstanceId src_inst; | ||
100 | HvLpInstanceId target_inst; | ||
101 | } parms; | ||
131 | u64 dword; | 102 | u64 dword; |
132 | } packed; | 103 | } packed; |
133 | packed.parms.xAckType = ackType; | 104 | |
134 | packed.parms.xAckInd = ackInd; | 105 | packed.parms.ack_and_target = (ackType << 7) | (ackInd << 6) | targetLp; |
135 | packed.parms.xRsvd = 0; | 106 | packed.parms.type = type; |
136 | packed.parms.xTargetLp = targetLp; | 107 | packed.parms.subtype = subtype; |
137 | packed.parms.xType = type; | 108 | packed.parms.src_inst = sourceInstanceId; |
138 | packed.parms.xSubtype = subtype; | 109 | packed.parms.target_inst = targetInstanceId; |
139 | packed.parms.xSourceInstId = sourceInstanceId; | ||
140 | packed.parms.xTargetInstId = targetInstanceId; | ||
141 | 110 | ||
142 | return HvCall7(HvCallEventSignalLpEventParms, packed.dword, | 111 | return HvCall7(HvCallEventSignalLpEventParms, packed.dword, |
143 | correlationToken, eventData1, eventData2, | 112 | correlationToken, eventData1, eventData2, |
@@ -146,18 +115,12 @@ static inline HvLpEvent_Rc HvCallEvent_signalLpEventFast(HvLpIndex targetLp, | |||
146 | 115 | ||
147 | static inline HvLpEvent_Rc HvCallEvent_ackLpEvent(struct HvLpEvent *event) | 116 | static inline HvLpEvent_Rc HvCallEvent_ackLpEvent(struct HvLpEvent *event) |
148 | { | 117 | { |
149 | u64 abs_addr; | 118 | return HvCall1(HvCallEventAckLpEvent, virt_to_abs(event)); |
150 | |||
151 | abs_addr = virt_to_abs(event); | ||
152 | return HvCall1(HvCallEventAckLpEvent, abs_addr); | ||
153 | } | 119 | } |
154 | 120 | ||
155 | static inline HvLpEvent_Rc HvCallEvent_cancelLpEvent(struct HvLpEvent *event) | 121 | static inline HvLpEvent_Rc HvCallEvent_cancelLpEvent(struct HvLpEvent *event) |
156 | { | 122 | { |
157 | u64 abs_addr; | 123 | return HvCall1(HvCallEventCancelLpEvent, virt_to_abs(event)); |
158 | |||
159 | abs_addr = virt_to_abs(event); | ||
160 | return HvCall1(HvCallEventCancelLpEvent, abs_addr); | ||
161 | } | 124 | } |
162 | 125 | ||
163 | static inline HvLpInstanceId HvCallEvent_getSourceLpInstanceId( | 126 | static inline HvLpInstanceId HvCallEvent_getSourceLpInstanceId( |
@@ -195,59 +158,34 @@ static inline HvLpDma_Rc HvCallEvent_dmaBufList(HvLpEvent_Type type, | |||
195 | { | 158 | { |
196 | /* Pack the misc bits into a single Dword to pass to PLIC */ | 159 | /* Pack the misc bits into a single Dword to pass to PLIC */ |
197 | union { | 160 | union { |
198 | struct HvCallEvent_PackedDmaParms parms; | 161 | struct { |
162 | u8 flags; | ||
163 | HvLpIndex remote; | ||
164 | u8 type; | ||
165 | u8 reserved; | ||
166 | HvLpInstanceId local_inst; | ||
167 | HvLpInstanceId remote_inst; | ||
168 | } parms; | ||
199 | u64 dword; | 169 | u64 dword; |
200 | } packed; | 170 | } packed; |
201 | 171 | ||
202 | packed.parms.xDirection = direction; | 172 | packed.parms.flags = (direction << 7) | |
203 | packed.parms.xLocalAddrType = localAddressType; | 173 | (localAddressType << 6) | (remoteAddressType << 5); |
204 | packed.parms.xRemoteAddrType = remoteAddressType; | 174 | packed.parms.remote = remoteLp; |
205 | packed.parms.xRsvd1 = 0; | 175 | packed.parms.type = type; |
206 | packed.parms.xRemoteLp = remoteLp; | 176 | packed.parms.reserved = 0; |
207 | packed.parms.xType = type; | 177 | packed.parms.local_inst = localInstanceId; |
208 | packed.parms.xRsvd2 = 0; | 178 | packed.parms.remote_inst = remoteInstanceId; |
209 | packed.parms.xLocalInstId = localInstanceId; | ||
210 | packed.parms.xRemoteInstId = remoteInstanceId; | ||
211 | 179 | ||
212 | return HvCall4(HvCallEventDmaBufList, packed.dword, localBufList, | 180 | return HvCall4(HvCallEventDmaBufList, packed.dword, localBufList, |
213 | remoteBufList, transferLength); | 181 | remoteBufList, transferLength); |
214 | } | 182 | } |
215 | 183 | ||
216 | static inline HvLpDma_Rc HvCallEvent_dmaSingle(HvLpEvent_Type type, | ||
217 | HvLpIndex remoteLp, HvLpDma_Direction direction, | ||
218 | HvLpInstanceId localInstanceId, | ||
219 | HvLpInstanceId remoteInstanceId, | ||
220 | HvLpDma_AddressType localAddressType, | ||
221 | HvLpDma_AddressType remoteAddressType, | ||
222 | u64 localAddrOrTce, u64 remoteAddrOrTce, u32 transferLength) | ||
223 | { | ||
224 | /* Pack the misc bits into a single Dword to pass to PLIC */ | ||
225 | union { | ||
226 | struct HvCallEvent_PackedDmaParms parms; | ||
227 | u64 dword; | ||
228 | } packed; | ||
229 | |||
230 | packed.parms.xDirection = direction; | ||
231 | packed.parms.xLocalAddrType = localAddressType; | ||
232 | packed.parms.xRemoteAddrType = remoteAddressType; | ||
233 | packed.parms.xRsvd1 = 0; | ||
234 | packed.parms.xRemoteLp = remoteLp; | ||
235 | packed.parms.xType = type; | ||
236 | packed.parms.xRsvd2 = 0; | ||
237 | packed.parms.xLocalInstId = localInstanceId; | ||
238 | packed.parms.xRemoteInstId = remoteInstanceId; | ||
239 | |||
240 | return (HvLpDma_Rc)HvCall4(HvCallEventDmaSingle, packed.dword, | ||
241 | localAddrOrTce, remoteAddrOrTce, transferLength); | ||
242 | } | ||
243 | |||
244 | static inline HvLpDma_Rc HvCallEvent_dmaToSp(void *local, u32 remote, | 184 | static inline HvLpDma_Rc HvCallEvent_dmaToSp(void *local, u32 remote, |
245 | u32 length, HvLpDma_Direction dir) | 185 | u32 length, HvLpDma_Direction dir) |
246 | { | 186 | { |
247 | u64 abs_addr; | 187 | return HvCall4(HvCallEventDmaToSp, virt_to_abs(local), remote, |
248 | 188 | length, dir); | |
249 | abs_addr = virt_to_abs(local); | ||
250 | return HvCall4(HvCallEventDmaToSp, abs_addr, remote, length, dir); | ||
251 | } | 189 | } |
252 | 190 | ||
253 | #endif /* _ASM_POWERPC_ISERIES_HV_CALL_EVENT_H */ | 191 | #endif /* _ASM_POWERPC_ISERIES_HV_CALL_EVENT_H */ |
diff --git a/include/asm-powerpc/iseries/hv_call_sc.h b/include/asm-powerpc/iseries/hv_call_sc.h index dec7e9d9ab78..f5d210959250 100644 --- a/include/asm-powerpc/iseries/hv_call_sc.h +++ b/include/asm-powerpc/iseries/hv_call_sc.h | |||
@@ -1,5 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * HvCallSc.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | 2 | * Copyright (C) 2001 Mike Corrigan IBM Corporation |
4 | * | 3 | * |
5 | * This program is free software; you can redistribute it and/or modify | 4 | * This program is free software; you can redistribute it and/or modify |
diff --git a/include/asm-powerpc/iseries/hv_lp_config.h b/include/asm-powerpc/iseries/hv_lp_config.h index bc00f036bca0..df8b20739719 100644 --- a/include/asm-powerpc/iseries/hv_lp_config.h +++ b/include/asm-powerpc/iseries/hv_lp_config.h | |||
@@ -1,5 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * HvLpConfig.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | 2 | * Copyright (C) 2001 Mike Corrigan IBM Corporation |
4 | * | 3 | * |
5 | * This program is free software; you can redistribute it and/or modify | 4 | * This program is free software; you can redistribute it and/or modify |
diff --git a/include/asm-powerpc/iseries/hv_lp_event.h b/include/asm-powerpc/iseries/hv_lp_event.h index 499ab1ad0185..4065a4de4935 100644 --- a/include/asm-powerpc/iseries/hv_lp_event.h +++ b/include/asm-powerpc/iseries/hv_lp_event.h | |||
@@ -1,5 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * HvLpEvent.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | 2 | * Copyright (C) 2001 Mike Corrigan IBM Corporation |
4 | * | 3 | * |
5 | * This program is free software; you can redistribute it and/or modify | 4 | * This program is free software; you can redistribute it and/or modify |
@@ -32,17 +31,8 @@ | |||
32 | * partitions through PLIC. | 31 | * partitions through PLIC. |
33 | */ | 32 | */ |
34 | 33 | ||
35 | struct HvEventFlags { | ||
36 | u8 xValid:1; /* Indicates a valid request x00-x00 */ | ||
37 | u8 xRsvd1:4; /* Reserved ... */ | ||
38 | u8 xAckType:1; /* Immediate or deferred ... */ | ||
39 | u8 xAckInd:1; /* Indicates if ACK required ... */ | ||
40 | u8 xFunction:1; /* Interrupt or Acknowledge ... */ | ||
41 | }; | ||
42 | |||
43 | |||
44 | struct HvLpEvent { | 34 | struct HvLpEvent { |
45 | struct HvEventFlags xFlags; /* Event flags x00-x00 */ | 35 | u8 flags; /* Event flags x00-x00 */ |
46 | u8 xType; /* Type of message x01-x01 */ | 36 | u8 xType; /* Type of message x01-x01 */ |
47 | u16 xSubtype; /* Subtype for event x02-x03 */ | 37 | u16 xSubtype; /* Subtype for event x02-x03 */ |
48 | u8 xSourceLp; /* Source LP x04-x04 */ | 38 | u8 xSourceLp; /* Source LP x04-x04 */ |
@@ -126,6 +116,11 @@ extern int HvLpEvent_closePath(HvLpEvent_Type eventType, HvLpIndex lpIndex); | |||
126 | #define HvLpEvent_AckType_ImmediateAck 0 | 116 | #define HvLpEvent_AckType_ImmediateAck 0 |
127 | #define HvLpEvent_AckType_DeferredAck 1 | 117 | #define HvLpEvent_AckType_DeferredAck 1 |
128 | 118 | ||
119 | #define HV_LP_EVENT_INT 0x01 | ||
120 | #define HV_LP_EVENT_DO_ACK 0x02 | ||
121 | #define HV_LP_EVENT_DEFERRED_ACK 0x04 | ||
122 | #define HV_LP_EVENT_VALID 0x80 | ||
123 | |||
129 | #define HvLpDma_Direction_LocalToRemote 0 | 124 | #define HvLpDma_Direction_LocalToRemote 0 |
130 | #define HvLpDma_Direction_RemoteToLocal 1 | 125 | #define HvLpDma_Direction_RemoteToLocal 1 |
131 | 126 | ||
@@ -139,4 +134,29 @@ extern int HvLpEvent_closePath(HvLpEvent_Type eventType, HvLpIndex lpIndex); | |||
139 | #define HvLpDma_Rc_InvalidAddress 4 | 134 | #define HvLpDma_Rc_InvalidAddress 4 |
140 | #define HvLpDma_Rc_InvalidLength 5 | 135 | #define HvLpDma_Rc_InvalidLength 5 |
141 | 136 | ||
137 | static inline int hvlpevent_is_valid(struct HvLpEvent *h) | ||
138 | { | ||
139 | return h->flags & HV_LP_EVENT_VALID; | ||
140 | } | ||
141 | |||
142 | static inline void hvlpevent_invalidate(struct HvLpEvent *h) | ||
143 | { | ||
144 | h->flags &= ~ HV_LP_EVENT_VALID; | ||
145 | } | ||
146 | |||
147 | static inline int hvlpevent_is_int(struct HvLpEvent *h) | ||
148 | { | ||
149 | return h->flags & HV_LP_EVENT_INT; | ||
150 | } | ||
151 | |||
152 | static inline int hvlpevent_is_ack(struct HvLpEvent *h) | ||
153 | { | ||
154 | return !hvlpevent_is_int(h); | ||
155 | } | ||
156 | |||
157 | static inline int hvlpevent_need_ack(struct HvLpEvent *h) | ||
158 | { | ||
159 | return h->flags & HV_LP_EVENT_DO_ACK; | ||
160 | } | ||
161 | |||
142 | #endif /* _ASM_POWERPC_ISERIES_HV_LP_EVENT_H */ | 162 | #endif /* _ASM_POWERPC_ISERIES_HV_LP_EVENT_H */ |
diff --git a/include/asm-powerpc/iseries/hv_types.h b/include/asm-powerpc/iseries/hv_types.h index c38f7e3d01dc..c3e6d2a1d1c3 100644 --- a/include/asm-powerpc/iseries/hv_types.h +++ b/include/asm-powerpc/iseries/hv_types.h | |||
@@ -1,5 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * HvTypes.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | 2 | * Copyright (C) 2001 Mike Corrigan IBM Corporation |
4 | * | 3 | * |
5 | * This program is free software; you can redistribute it and/or modify | 4 | * This program is free software; you can redistribute it and/or modify |
diff --git a/include/asm-powerpc/iseries/iseries_io.h b/include/asm-powerpc/iseries/iseries_io.h index 56b2113ff0f5..496aa852b617 100644 --- a/include/asm-powerpc/iseries/iseries_io.h +++ b/include/asm-powerpc/iseries/iseries_io.h | |||
@@ -6,7 +6,7 @@ | |||
6 | #ifdef CONFIG_PPC_ISERIES | 6 | #ifdef CONFIG_PPC_ISERIES |
7 | #include <linux/types.h> | 7 | #include <linux/types.h> |
8 | /* | 8 | /* |
9 | * File iSeries_io.h created by Allan Trautman on Thu Dec 28 2000. | 9 | * Created by Allan Trautman on Thu Dec 28 2000. |
10 | * | 10 | * |
11 | * Remaps the io.h for the iSeries Io | 11 | * Remaps the io.h for the iSeries Io |
12 | * Copyright (C) 2000 Allan H Trautman, IBM Corporation | 12 | * Copyright (C) 2000 Allan H Trautman, IBM Corporation |
@@ -32,6 +32,7 @@ | |||
32 | * End Change Activity | 32 | * End Change Activity |
33 | */ | 33 | */ |
34 | 34 | ||
35 | #ifdef CONFIG_PCI | ||
35 | extern u8 iSeries_Read_Byte(const volatile void __iomem * IoAddress); | 36 | extern u8 iSeries_Read_Byte(const volatile void __iomem * IoAddress); |
36 | extern u16 iSeries_Read_Word(const volatile void __iomem * IoAddress); | 37 | extern u16 iSeries_Read_Word(const volatile void __iomem * IoAddress); |
37 | extern u32 iSeries_Read_Long(const volatile void __iomem * IoAddress); | 38 | extern u32 iSeries_Read_Long(const volatile void __iomem * IoAddress); |
@@ -44,6 +45,17 @@ extern void iSeries_memcpy_toio(volatile void __iomem *dest, void *source, | |||
44 | size_t n); | 45 | size_t n); |
45 | extern void iSeries_memcpy_fromio(void *dest, | 46 | extern void iSeries_memcpy_fromio(void *dest, |
46 | const volatile void __iomem *source, size_t n); | 47 | const volatile void __iomem *source, size_t n); |
48 | #else | ||
49 | static inline u8 iSeries_Read_Byte(const volatile void __iomem *IoAddress) | ||
50 | { | ||
51 | return 0xff; | ||
52 | } | ||
53 | |||
54 | static inline void iSeries_Write_Byte(u8 IoData, | ||
55 | volatile void __iomem *IoAddress) | ||
56 | { | ||
57 | } | ||
58 | #endif /* CONFIG_PCI */ | ||
47 | 59 | ||
48 | #endif /* CONFIG_PPC_ISERIES */ | 60 | #endif /* CONFIG_PPC_ISERIES */ |
49 | #endif /* _ASM_POWERPC_ISERIES_ISERIES_IO_H */ | 61 | #endif /* _ASM_POWERPC_ISERIES_ISERIES_IO_H */ |
diff --git a/include/asm-powerpc/iseries/it_exp_vpd_panel.h b/include/asm-powerpc/iseries/it_exp_vpd_panel.h index 66a17a230c52..304a609ae21a 100644 --- a/include/asm-powerpc/iseries/it_exp_vpd_panel.h +++ b/include/asm-powerpc/iseries/it_exp_vpd_panel.h | |||
@@ -1,5 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * ItExtVpdPanel.h | ||
3 | * Copyright (C) 2002 Dave Boutcher IBM Corporation | 2 | * Copyright (C) 2002 Dave Boutcher IBM Corporation |
4 | * | 3 | * |
5 | * This program is free software; you can redistribute it and/or modify | 4 | * This program is free software; you can redistribute it and/or modify |
diff --git a/include/asm-powerpc/iseries/it_lp_naca.h b/include/asm-powerpc/iseries/it_lp_naca.h index c3ef1de45d82..4fdcf052927f 100644 --- a/include/asm-powerpc/iseries/it_lp_naca.h +++ b/include/asm-powerpc/iseries/it_lp_naca.h | |||
@@ -1,5 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * ItLpNaca.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | 2 | * Copyright (C) 2001 Mike Corrigan IBM Corporation |
4 | * | 3 | * |
5 | * This program is free software; you can redistribute it and/or modify | 4 | * This program is free software; you can redistribute it and/or modify |
@@ -37,17 +36,13 @@ struct ItLpNaca { | |||
37 | u8 xLpIndex; // LP Index x0B-x0B | 36 | u8 xLpIndex; // LP Index x0B-x0B |
38 | u16 xMaxLpQueues; // Number of allocated queues x0C-x0D | 37 | u16 xMaxLpQueues; // Number of allocated queues x0C-x0D |
39 | u16 xLpQueueOffset; // Offset to start of LP queues x0E-x0F | 38 | u16 xLpQueueOffset; // Offset to start of LP queues x0E-x0F |
40 | u8 xPirEnvironMode:8; // Piranha or hardware x10-x10 | 39 | u8 xPirEnvironMode; // Piranha or hardware x10-x10 |
41 | u8 xPirConsoleMode:8; // Piranha console indicator x11-x11 | 40 | u8 xPirConsoleMode; // Piranha console indicator x11-x11 |
42 | u8 xPirDasdMode:8; // Piranha dasd indicator x12-x12 | 41 | u8 xPirDasdMode; // Piranha dasd indicator x12-x12 |
43 | u8 xRsvd1_0[5]; // Reserved for Piranha related x13-x17 | 42 | u8 xRsvd1_0[5]; // Reserved for Piranha related x13-x17 |
44 | u8 xLparInstalled:1; // Is LPAR installed on system x18-x1F | 43 | u8 flags; // flags, see below x18-x1F |
45 | u8 xSysPartitioned:1; // Is the system partitioned ... | 44 | u8 xSpVpdFormat; // VPD areas are in CSP format ... |
46 | u8 xHwSyncedTBs:1; // Hardware synced TBs ... | 45 | u8 xIntProcRatio; // Ratio of int procs to procs ... |
47 | u8 xIntProcUtilHmt:1; // Utilize HMT for interrupts ... | ||
48 | u8 xRsvd1_1:4; // Reserved ... | ||
49 | u8 xSpVpdFormat:8; // VPD areas are in CSP format ... | ||
50 | u8 xIntProcRatio:8; // Ratio of int procs to procs ... | ||
51 | u8 xRsvd1_2[5]; // Reserved ... | 46 | u8 xRsvd1_2[5]; // Reserved ... |
52 | u16 xRsvd1_3; // Reserved x20-x21 | 47 | u16 xRsvd1_3; // Reserved x20-x21 |
53 | u16 xPlicVrmIndex; // VRM index of PLIC x22-x23 | 48 | u16 xPlicVrmIndex; // VRM index of PLIC x22-x23 |
@@ -77,4 +72,9 @@ struct ItLpNaca { | |||
77 | 72 | ||
78 | extern struct ItLpNaca itLpNaca; | 73 | extern struct ItLpNaca itLpNaca; |
79 | 74 | ||
75 | #define ITLPNACA_LPAR 0x80 /* Is LPAR installed on the system */ | ||
76 | #define ITLPNACA_PARTITIONED 0x40 /* Is the system partitioned */ | ||
77 | #define ITLPNACA_HWSYNCEDTBS 0x20 /* Hardware synced TBs */ | ||
78 | #define ITLPNACA_HMTINT 0x10 /* Utilize MHT for interrupts */ | ||
79 | |||
80 | #endif /* _ASM_POWERPC_ISERIES_IT_LP_NACA_H */ | 80 | #endif /* _ASM_POWERPC_ISERIES_IT_LP_NACA_H */ |
diff --git a/include/asm-powerpc/iseries/it_lp_queue.h b/include/asm-powerpc/iseries/it_lp_queue.h index a60d03afbf95..b7c6fc12cce2 100644 --- a/include/asm-powerpc/iseries/it_lp_queue.h +++ b/include/asm-powerpc/iseries/it_lp_queue.h | |||
@@ -1,5 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * ItLpQueue.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | 2 | * Copyright (C) 2001 Mike Corrigan IBM Corporation |
4 | * | 3 | * |
5 | * This program is free software; you can redistribute it and/or modify | 4 | * This program is free software; you can redistribute it and/or modify |
diff --git a/include/asm-powerpc/iseries/it_lp_reg_save.h b/include/asm-powerpc/iseries/it_lp_reg_save.h index 81824e1bb767..5403b756f654 100644 --- a/include/asm-powerpc/iseries/it_lp_reg_save.h +++ b/include/asm-powerpc/iseries/it_lp_reg_save.h | |||
@@ -1,5 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * ItLpRegSave.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | 2 | * Copyright (C) 2001 Mike Corrigan IBM Corporation |
4 | * | 3 | * |
5 | * This program is free software; you can redistribute it and/or modify | 4 | * This program is free software; you can redistribute it and/or modify |
@@ -83,4 +82,4 @@ struct ItLpRegSave { | |||
83 | 82 | ||
84 | extern struct ItLpRegSave iseries_reg_save[]; | 83 | extern struct ItLpRegSave iseries_reg_save[]; |
85 | 84 | ||
86 | #endif /* _ITLPREGSAVE_H */ | 85 | #endif /* _ASM_POWERPC_ISERIES_IT_LP_REG_SAVE_H */ |
diff --git a/include/asm-powerpc/iseries/lpar_map.h b/include/asm-powerpc/iseries/lpar_map.h index 84fc321615bf..2ec384d66abb 100644 --- a/include/asm-powerpc/iseries/lpar_map.h +++ b/include/asm-powerpc/iseries/lpar_map.h | |||
@@ -1,5 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * LparMap.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | 2 | * Copyright (C) 2001 Mike Corrigan IBM Corporation |
4 | * | 3 | * |
5 | * This program is free software; you can redistribute it and/or modify | 4 | * This program is free software; you can redistribute it and/or modify |
diff --git a/include/asm-powerpc/iseries/mf.h b/include/asm-powerpc/iseries/mf.h index e7bd57a03fb1..857e5202fc78 100644 --- a/include/asm-powerpc/iseries/mf.h +++ b/include/asm-powerpc/iseries/mf.h | |||
@@ -1,5 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * mf.h | ||
3 | * Copyright (C) 2001 Troy D. Armstrong IBM Corporation | 2 | * Copyright (C) 2001 Troy D. Armstrong IBM Corporation |
4 | * Copyright (C) 2004 Stephen Rothwell IBM Corporation | 3 | * Copyright (C) 2004 Stephen Rothwell IBM Corporation |
5 | * | 4 | * |
diff --git a/include/asm-powerpc/iseries/vio.h b/include/asm-powerpc/iseries/vio.h index 7e3a469420dd..72a97d37aac3 100644 --- a/include/asm-powerpc/iseries/vio.h +++ b/include/asm-powerpc/iseries/vio.h | |||
@@ -1,5 +1,4 @@ | |||
1 | /* -*- linux-c -*- | 1 | /* -*- linux-c -*- |
2 | * drivers/char/vio.h | ||
3 | * | 2 | * |
4 | * iSeries Virtual I/O Message Path header | 3 | * iSeries Virtual I/O Message Path header |
5 | * | 4 | * |
diff --git a/include/asm-powerpc/kexec.h b/include/asm-powerpc/kexec.h index 4263af3cadfd..fffdf690b840 100644 --- a/include/asm-powerpc/kexec.h +++ b/include/asm-powerpc/kexec.h | |||
@@ -38,9 +38,6 @@ | |||
38 | #ifdef CONFIG_KEXEC | 38 | #ifdef CONFIG_KEXEC |
39 | 39 | ||
40 | #define MAX_NOTE_BYTES 1024 | 40 | #define MAX_NOTE_BYTES 1024 |
41 | typedef u32 note_buf_t[MAX_NOTE_BYTES / sizeof(u32)]; | ||
42 | |||
43 | extern note_buf_t crash_notes[]; | ||
44 | 41 | ||
45 | #ifdef __powerpc64__ | 42 | #ifdef __powerpc64__ |
46 | extern void kexec_smp_wait(void); /* get and clear naca physid, wait for | 43 | extern void kexec_smp_wait(void); /* get and clear naca physid, wait for |
@@ -58,6 +55,12 @@ extern void default_machine_crash_shutdown(struct pt_regs *regs); | |||
58 | 55 | ||
59 | #endif /* !CONFIG_KEXEC */ | 56 | #endif /* !CONFIG_KEXEC */ |
60 | 57 | ||
58 | /* | ||
59 | * Provide a dummy definition to avoid build failures. Will remain | ||
60 | * empty till crash dump support is enabled. | ||
61 | */ | ||
62 | static inline void crash_setup_regs(struct pt_regs *newregs, | ||
63 | struct pt_regs *oldregs) { } | ||
61 | #endif /* ! __ASSEMBLY__ */ | 64 | #endif /* ! __ASSEMBLY__ */ |
62 | #endif /* __KERNEL__ */ | 65 | #endif /* __KERNEL__ */ |
63 | #endif /* _ASM_POWERPC_KEXEC_H */ | 66 | #endif /* _ASM_POWERPC_KEXEC_H */ |
diff --git a/include/asm-powerpc/kprobes.h b/include/asm-powerpc/kprobes.h index 0654f79b06df..f466bc804f41 100644 --- a/include/asm-powerpc/kprobes.h +++ b/include/asm-powerpc/kprobes.h | |||
@@ -30,7 +30,10 @@ | |||
30 | #include <linux/ptrace.h> | 30 | #include <linux/ptrace.h> |
31 | #include <linux/percpu.h> | 31 | #include <linux/percpu.h> |
32 | 32 | ||
33 | #define __ARCH_WANT_KPROBES_INSN_SLOT | ||
34 | |||
33 | struct pt_regs; | 35 | struct pt_regs; |
36 | struct kprobe; | ||
34 | 37 | ||
35 | typedef unsigned int kprobe_opcode_t; | 38 | typedef unsigned int kprobe_opcode_t; |
36 | #define BREAKPOINT_INSTRUCTION 0x7fe00008 /* trap */ | 39 | #define BREAKPOINT_INSTRUCTION 0x7fe00008 /* trap */ |
@@ -48,6 +51,7 @@ typedef unsigned int kprobe_opcode_t; | |||
48 | 51 | ||
49 | #define ARCH_SUPPORTS_KRETPROBES | 52 | #define ARCH_SUPPORTS_KRETPROBES |
50 | void kretprobe_trampoline(void); | 53 | void kretprobe_trampoline(void); |
54 | extern void arch_remove_kprobe(struct kprobe *p); | ||
51 | 55 | ||
52 | /* Architecture specific copy of original instruction */ | 56 | /* Architecture specific copy of original instruction */ |
53 | struct arch_specific_insn { | 57 | struct arch_specific_insn { |
@@ -69,15 +73,7 @@ struct kprobe_ctlblk { | |||
69 | struct prev_kprobe prev_kprobe; | 73 | struct prev_kprobe prev_kprobe; |
70 | }; | 74 | }; |
71 | 75 | ||
72 | #ifdef CONFIG_KPROBES | ||
73 | extern int kprobe_exceptions_notify(struct notifier_block *self, | 76 | extern int kprobe_exceptions_notify(struct notifier_block *self, |
74 | unsigned long val, void *data); | 77 | unsigned long val, void *data); |
75 | #else /* !CONFIG_KPROBES */ | ||
76 | static inline int kprobe_exceptions_notify(struct notifier_block *self, | ||
77 | unsigned long val, void *data) | ||
78 | { | ||
79 | return 0; | ||
80 | } | ||
81 | #endif | ||
82 | #endif /* __KERNEL__ */ | 78 | #endif /* __KERNEL__ */ |
83 | #endif /* _ASM_POWERPC_KPROBES_H */ | 79 | #endif /* _ASM_POWERPC_KPROBES_H */ |
diff --git a/include/asm-powerpc/paca.h b/include/asm-powerpc/paca.h index 3ae52d9dc9ff..a64b4d425dab 100644 --- a/include/asm-powerpc/paca.h +++ b/include/asm-powerpc/paca.h | |||
@@ -65,6 +65,7 @@ struct paca_struct { | |||
65 | u64 stab_real; /* Absolute address of segment table */ | 65 | u64 stab_real; /* Absolute address of segment table */ |
66 | u64 stab_addr; /* Virtual address of segment table */ | 66 | u64 stab_addr; /* Virtual address of segment table */ |
67 | void *emergency_sp; /* pointer to emergency stack */ | 67 | void *emergency_sp; /* pointer to emergency stack */ |
68 | u64 data_offset; /* per cpu data offset */ | ||
68 | s16 hw_cpu_id; /* Physical processor number */ | 69 | s16 hw_cpu_id; /* Physical processor number */ |
69 | u8 cpu_start; /* At startup, processor spins until */ | 70 | u8 cpu_start; /* At startup, processor spins until */ |
70 | /* this becomes non-zero. */ | 71 | /* this becomes non-zero. */ |
diff --git a/include/asm-powerpc/page.h b/include/asm-powerpc/page.h index 76d7cb4b4ffc..0b82df483f7f 100644 --- a/include/asm-powerpc/page.h +++ b/include/asm-powerpc/page.h | |||
@@ -178,7 +178,7 @@ typedef unsigned long pmd_t; | |||
178 | #define pmd_val(x) (x) | 178 | #define pmd_val(x) (x) |
179 | #define __pmd(x) (x) | 179 | #define __pmd(x) (x) |
180 | 180 | ||
181 | #ifndef CONFIG_PPC_64K_PAGES | 181 | #if defined(CONFIG_PPC64) && !defined(CONFIG_PPC_64K_PAGES) |
182 | typedef unsigned long pud_t; | 182 | typedef unsigned long pud_t; |
183 | #define pud_val(x) (x) | 183 | #define pud_val(x) (x) |
184 | #define __pud(x) (x) | 184 | #define __pud(x) (x) |
diff --git a/include/asm-powerpc/parport.h b/include/asm-powerpc/parport.h index 897e49a88a6b..3fca21ddf546 100644 --- a/include/asm-powerpc/parport.h +++ b/include/asm-powerpc/parport.h | |||
@@ -10,10 +10,34 @@ | |||
10 | #define _ASM_POWERPC_PARPORT_H | 10 | #define _ASM_POWERPC_PARPORT_H |
11 | #ifdef __KERNEL__ | 11 | #ifdef __KERNEL__ |
12 | 12 | ||
13 | static int __devinit parport_pc_find_isa_ports (int autoirq, int autodma); | 13 | #include <asm/prom.h> |
14 | |||
15 | extern struct parport *parport_pc_probe_port (unsigned long int base, | ||
16 | unsigned long int base_hi, | ||
17 | int irq, int dma, | ||
18 | struct pci_dev *dev); | ||
19 | |||
14 | static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma) | 20 | static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma) |
15 | { | 21 | { |
16 | return parport_pc_find_isa_ports (autoirq, autodma); | 22 | struct device_node *np; |
23 | u32 *prop; | ||
24 | u32 io1, io2; | ||
25 | int propsize; | ||
26 | int count = 0; | ||
27 | for (np = NULL; (np = of_find_compatible_node(np, | ||
28 | "parallel", | ||
29 | "pnpPNP,400")) != NULL;) { | ||
30 | prop = (u32 *)get_property(np, "reg", &propsize); | ||
31 | if (!prop || propsize > 6*sizeof(u32)) | ||
32 | continue; | ||
33 | io1 = prop[1]; io2 = prop[2]; | ||
34 | prop = (u32 *)get_property(np, "interrupts", NULL); | ||
35 | if (!prop) | ||
36 | continue; | ||
37 | if (parport_pc_probe_port(io1, io2, prop[0], autodma, NULL) != NULL) | ||
38 | count++; | ||
39 | } | ||
40 | return count; | ||
17 | } | 41 | } |
18 | 42 | ||
19 | #endif /* __KERNEL__ */ | 43 | #endif /* __KERNEL__ */ |
diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h index 1a08860e789e..38de92d41a14 100644 --- a/include/asm-powerpc/pci-bridge.h +++ b/include/asm-powerpc/pci-bridge.h | |||
@@ -61,16 +61,17 @@ struct pci_controller; | |||
61 | struct iommu_table; | 61 | struct iommu_table; |
62 | 62 | ||
63 | struct pci_dn { | 63 | struct pci_dn { |
64 | int busno; /* for pci devices */ | 64 | int busno; /* pci bus number */ |
65 | int bussubno; /* for pci devices */ | 65 | int bussubno; /* pci subordinate bus number */ |
66 | int devfn; /* for pci devices */ | 66 | int devfn; /* pci device and function number */ |
67 | int class_code; /* pci device class */ | ||
67 | 68 | ||
68 | #ifdef CONFIG_PPC_PSERIES | 69 | #ifdef CONFIG_PPC_PSERIES |
69 | int eeh_mode; /* See eeh.h for possible EEH_MODEs */ | 70 | int eeh_mode; /* See eeh.h for possible EEH_MODEs */ |
70 | int eeh_config_addr; | 71 | int eeh_config_addr; |
72 | int eeh_pe_config_addr; /* new-style partition endpoint address */ | ||
71 | int eeh_check_count; /* # times driver ignored error */ | 73 | int eeh_check_count; /* # times driver ignored error */ |
72 | int eeh_freeze_count; /* # times this device froze up. */ | 74 | int eeh_freeze_count; /* # times this device froze up. */ |
73 | int eeh_is_bridge; /* device is pci-to-pci bridge */ | ||
74 | #endif | 75 | #endif |
75 | int pci_ext_config_space; /* for pci devices */ | 76 | int pci_ext_config_space; /* for pci devices */ |
76 | struct pci_controller *phb; /* for pci devices */ | 77 | struct pci_controller *phb; /* for pci devices */ |
@@ -141,8 +142,6 @@ void pcibios_fixup_new_pci_devices(struct pci_bus *bus, int fix_bus); | |||
141 | 142 | ||
142 | extern int pcibios_remove_root_bus(struct pci_controller *phb); | 143 | extern int pcibios_remove_root_bus(struct pci_controller *phb); |
143 | 144 | ||
144 | extern void phbs_remap_io(void); | ||
145 | |||
146 | static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus) | 145 | static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus) |
147 | { | 146 | { |
148 | struct device_node *busdn = bus->sysdata; | 147 | struct device_node *busdn = bus->sysdata; |
diff --git a/include/asm-powerpc/percpu.h b/include/asm-powerpc/percpu.h index 06a959d67234..e31922c50e53 100644 --- a/include/asm-powerpc/percpu.h +++ b/include/asm-powerpc/percpu.h | |||
@@ -1 +1,57 @@ | |||
1 | #ifndef _ASM_POWERPC_PERCPU_H_ | ||
2 | #define _ASM_POWERPC_PERCPU_H_ | ||
3 | #ifdef __powerpc64__ | ||
4 | #include <linux/compiler.h> | ||
5 | |||
6 | /* | ||
7 | * Same as asm-generic/percpu.h, except that we store the per cpu offset | ||
8 | * in the paca. Based on the x86-64 implementation. | ||
9 | */ | ||
10 | |||
11 | #ifdef CONFIG_SMP | ||
12 | |||
13 | #include <asm/paca.h> | ||
14 | |||
15 | #define __per_cpu_offset(cpu) (paca[cpu].data_offset) | ||
16 | #define __my_cpu_offset() get_paca()->data_offset | ||
17 | |||
18 | /* Separate out the type, so (int[3], foo) works. */ | ||
19 | #define DEFINE_PER_CPU(type, name) \ | ||
20 | __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name | ||
21 | |||
22 | /* var is in discarded region: offset to particular copy we want */ | ||
23 | #define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset(cpu))) | ||
24 | #define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __my_cpu_offset())) | ||
25 | |||
26 | /* A macro to avoid #include hell... */ | ||
27 | #define percpu_modcopy(pcpudst, src, size) \ | ||
28 | do { \ | ||
29 | unsigned int __i; \ | ||
30 | for (__i = 0; __i < NR_CPUS; __i++) \ | ||
31 | if (cpu_possible(__i)) \ | ||
32 | memcpy((pcpudst)+__per_cpu_offset(__i), \ | ||
33 | (src), (size)); \ | ||
34 | } while (0) | ||
35 | |||
36 | extern void setup_per_cpu_areas(void); | ||
37 | |||
38 | #else /* ! SMP */ | ||
39 | |||
40 | #define DEFINE_PER_CPU(type, name) \ | ||
41 | __typeof__(type) per_cpu__##name | ||
42 | |||
43 | #define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var)) | ||
44 | #define __get_cpu_var(var) per_cpu__##var | ||
45 | |||
46 | #endif /* SMP */ | ||
47 | |||
48 | #define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name | ||
49 | |||
50 | #define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(per_cpu__##var) | ||
51 | #define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(per_cpu__##var) | ||
52 | |||
53 | #else | ||
1 | #include <asm-generic/percpu.h> | 54 | #include <asm-generic/percpu.h> |
55 | #endif | ||
56 | |||
57 | #endif /* _ASM_POWERPC_PERCPU_H_ */ | ||
diff --git a/include/asm-powerpc/ppc-pci.h b/include/asm-powerpc/ppc-pci.h index bdef312900a1..f80482c7231f 100644 --- a/include/asm-powerpc/ppc-pci.h +++ b/include/asm-powerpc/ppc-pci.h | |||
@@ -52,6 +52,21 @@ extern unsigned long pci_probe_only; | |||
52 | 52 | ||
53 | /* ---- EEH internal-use-only related routines ---- */ | 53 | /* ---- EEH internal-use-only related routines ---- */ |
54 | #ifdef CONFIG_EEH | 54 | #ifdef CONFIG_EEH |
55 | |||
56 | void pci_addr_cache_insert_device(struct pci_dev *dev); | ||
57 | void pci_addr_cache_remove_device(struct pci_dev *dev); | ||
58 | void pci_addr_cache_build(void); | ||
59 | struct pci_dev *pci_get_device_by_addr(unsigned long addr); | ||
60 | |||
61 | /** | ||
62 | * eeh_slot_error_detail -- record and EEH error condition to the log | ||
63 | * @severity: 1 if temporary, 2 if permanent failure. | ||
64 | * | ||
65 | * Obtains the the EEH error details from the RTAS subsystem, | ||
66 | * and then logs these details with the RTAS error log system. | ||
67 | */ | ||
68 | void eeh_slot_error_detail (struct pci_dn *pdn, int severity); | ||
69 | |||
55 | /** | 70 | /** |
56 | * rtas_set_slot_reset -- unfreeze a frozen slot | 71 | * rtas_set_slot_reset -- unfreeze a frozen slot |
57 | * | 72 | * |
@@ -59,8 +74,10 @@ extern unsigned long pci_probe_only; | |||
59 | * does this by asserting the PCI #RST line for 1/8th of | 74 | * does this by asserting the PCI #RST line for 1/8th of |
60 | * a second; this routine will sleep while the adapter is | 75 | * a second; this routine will sleep while the adapter is |
61 | * being reset. | 76 | * being reset. |
77 | * | ||
78 | * Returns a non-zero value if the reset failed. | ||
62 | */ | 79 | */ |
63 | void rtas_set_slot_reset (struct pci_dn *); | 80 | int rtas_set_slot_reset (struct pci_dn *); |
64 | 81 | ||
65 | /** | 82 | /** |
66 | * eeh_restore_bars - Restore device configuration info. | 83 | * eeh_restore_bars - Restore device configuration info. |
@@ -84,6 +101,7 @@ void eeh_restore_bars(struct pci_dn *); | |||
84 | void rtas_configure_bridge(struct pci_dn *); | 101 | void rtas_configure_bridge(struct pci_dn *); |
85 | 102 | ||
86 | int rtas_write_config(struct pci_dn *, int where, int size, u32 val); | 103 | int rtas_write_config(struct pci_dn *, int where, int size, u32 val); |
104 | int rtas_read_config(struct pci_dn *, int where, int size, u32 *val); | ||
87 | 105 | ||
88 | /** | 106 | /** |
89 | * mark and clear slots: find "partition endpoint" PE and set or | 107 | * mark and clear slots: find "partition endpoint" PE and set or |
@@ -92,6 +110,9 @@ int rtas_write_config(struct pci_dn *, int where, int size, u32 val); | |||
92 | void eeh_mark_slot (struct device_node *dn, int mode_flag); | 110 | void eeh_mark_slot (struct device_node *dn, int mode_flag); |
93 | void eeh_clear_slot (struct device_node *dn, int mode_flag); | 111 | void eeh_clear_slot (struct device_node *dn, int mode_flag); |
94 | 112 | ||
113 | /* Find the associated "Partiationable Endpoint" PE */ | ||
114 | struct device_node * find_device_pe(struct device_node *dn); | ||
115 | |||
95 | #endif | 116 | #endif |
96 | 117 | ||
97 | #endif /* __KERNEL__ */ | 118 | #endif /* __KERNEL__ */ |
diff --git a/include/asm-powerpc/rtas.h b/include/asm-powerpc/rtas.h index 3428889e27b7..f43c6835e62a 100644 --- a/include/asm-powerpc/rtas.h +++ b/include/asm-powerpc/rtas.h | |||
@@ -161,7 +161,6 @@ extern struct rtas_t rtas; | |||
161 | extern void enter_rtas(unsigned long); | 161 | extern void enter_rtas(unsigned long); |
162 | extern int rtas_token(const char *service); | 162 | extern int rtas_token(const char *service); |
163 | extern int rtas_call(int token, int, int, int *, ...); | 163 | extern int rtas_call(int token, int, int, int *, ...); |
164 | extern void call_rtas_display_status(unsigned char); | ||
165 | extern void rtas_restart(char *cmd); | 164 | extern void rtas_restart(char *cmd); |
166 | extern void rtas_power_off(void); | 165 | extern void rtas_power_off(void); |
167 | extern void rtas_halt(void); | 166 | extern void rtas_halt(void); |
diff --git a/include/asm-powerpc/serial.h b/include/asm-powerpc/serial.h index 6dc9546d6908..3e8589b43cb2 100644 --- a/include/asm-powerpc/serial.h +++ b/include/asm-powerpc/serial.h | |||
@@ -15,6 +15,10 @@ | |||
15 | /* Default baud base if not found in device-tree */ | 15 | /* Default baud base if not found in device-tree */ |
16 | #define BASE_BAUD ( 1843200 / 16 ) | 16 | #define BASE_BAUD ( 1843200 / 16 ) |
17 | 17 | ||
18 | #ifdef CONFIG_PPC_UDBG_16550 | ||
18 | extern void find_legacy_serial_ports(void); | 19 | extern void find_legacy_serial_ports(void); |
20 | #else | ||
21 | #define find_legacy_serial_ports() do { } while (0) | ||
22 | #endif | ||
19 | 23 | ||
20 | #endif /* _PPC64_SERIAL_H */ | 24 | #endif /* _PPC64_SERIAL_H */ |
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h index 0c58e32a9570..9b822afa7d0e 100644 --- a/include/asm-powerpc/system.h +++ b/include/asm-powerpc/system.h | |||
@@ -133,6 +133,14 @@ extern int fix_alignment(struct pt_regs *); | |||
133 | extern void cvt_fd(float *from, double *to, struct thread_struct *thread); | 133 | extern void cvt_fd(float *from, double *to, struct thread_struct *thread); |
134 | extern void cvt_df(double *from, float *to, struct thread_struct *thread); | 134 | extern void cvt_df(double *from, float *to, struct thread_struct *thread); |
135 | 135 | ||
136 | #ifndef CONFIG_SMP | ||
137 | extern void discard_lazy_cpu_state(void); | ||
138 | #else | ||
139 | static inline void discard_lazy_cpu_state(void) | ||
140 | { | ||
141 | } | ||
142 | #endif | ||
143 | |||
136 | #ifdef CONFIG_ALTIVEC | 144 | #ifdef CONFIG_ALTIVEC |
137 | extern void flush_altivec_to_thread(struct task_struct *); | 145 | extern void flush_altivec_to_thread(struct task_struct *); |
138 | #else | 146 | #else |
@@ -175,6 +183,16 @@ struct thread_struct; | |||
175 | extern struct task_struct *_switch(struct thread_struct *prev, | 183 | extern struct task_struct *_switch(struct thread_struct *prev, |
176 | struct thread_struct *next); | 184 | struct thread_struct *next); |
177 | 185 | ||
186 | /* | ||
187 | * On SMP systems, when the scheduler does migration-cost autodetection, | ||
188 | * it needs a way to flush as much of the CPU's caches as possible. | ||
189 | * | ||
190 | * TODO: fill this in! | ||
191 | */ | ||
192 | static inline void sched_cacheflush(void) | ||
193 | { | ||
194 | } | ||
195 | |||
178 | extern unsigned int rtas_data; | 196 | extern unsigned int rtas_data; |
179 | extern int mem_init_done; /* set on boot once kmalloc can be called */ | 197 | extern int mem_init_done; /* set on boot once kmalloc can be called */ |
180 | extern unsigned long memory_limit; | 198 | extern unsigned long memory_limit; |
diff --git a/include/asm-powerpc/thread_info.h b/include/asm-powerpc/thread_info.h index ac1e80e6033e..7e09d7cda933 100644 --- a/include/asm-powerpc/thread_info.h +++ b/include/asm-powerpc/thread_info.h | |||
@@ -89,9 +89,6 @@ struct thread_info { | |||
89 | 89 | ||
90 | #endif /* THREAD_SHIFT < PAGE_SHIFT */ | 90 | #endif /* THREAD_SHIFT < PAGE_SHIFT */ |
91 | 91 | ||
92 | #define get_thread_info(ti) get_task_struct((ti)->task) | ||
93 | #define put_thread_info(ti) put_task_struct((ti)->task) | ||
94 | |||
95 | /* how to get the thread information struct from C */ | 92 | /* how to get the thread information struct from C */ |
96 | static inline struct thread_info *current_thread_info(void) | 93 | static inline struct thread_info *current_thread_info(void) |
97 | { | 94 | { |
diff --git a/include/asm-powerpc/topology.h b/include/asm-powerpc/topology.h index 9f3d4da261c4..1e19cd00af25 100644 --- a/include/asm-powerpc/topology.h +++ b/include/asm-powerpc/topology.h | |||
@@ -39,7 +39,6 @@ static inline int node_to_first_cpu(int node) | |||
39 | .max_interval = 32, \ | 39 | .max_interval = 32, \ |
40 | .busy_factor = 32, \ | 40 | .busy_factor = 32, \ |
41 | .imbalance_pct = 125, \ | 41 | .imbalance_pct = 125, \ |
42 | .cache_hot_time = (10*1000000), \ | ||
43 | .cache_nice_tries = 1, \ | 42 | .cache_nice_tries = 1, \ |
44 | .per_cpu_gain = 100, \ | 43 | .per_cpu_gain = 100, \ |
45 | .busy_idx = 3, \ | 44 | .busy_idx = 3, \ |
diff --git a/include/asm-powerpc/udbg.h b/include/asm-powerpc/udbg.h index 479f2d8ff74a..5c4236c342bb 100644 --- a/include/asm-powerpc/udbg.h +++ b/include/asm-powerpc/udbg.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * c 2001 PPC 64 Team, IBM Corp | 2 | * (c) 2001, 2006 IBM Corporation. |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or | 4 | * This program is free software; you can redistribute it and/or |
5 | * modify it under the terms of the GNU General Public License | 5 | * modify it under the terms of the GNU General Public License |
@@ -36,5 +36,12 @@ extern void udbg_scc_init(int force_scc); | |||
36 | extern int udbg_adb_init(int force_btext); | 36 | extern int udbg_adb_init(int force_btext); |
37 | extern void udbg_adb_init_early(void); | 37 | extern void udbg_adb_init_early(void); |
38 | 38 | ||
39 | extern void __init udbg_early_init(void); | ||
40 | extern void __init udbg_init_debug_lpar(void); | ||
41 | extern void __init udbg_init_pmac_realmode(void); | ||
42 | extern void __init udbg_init_maple_realmode(void); | ||
43 | extern void __init udbg_init_iseries(void); | ||
44 | extern void __init udbg_init_rtas(void); | ||
45 | |||
39 | #endif /* __KERNEL__ */ | 46 | #endif /* __KERNEL__ */ |
40 | #endif /* _ASM_POWERPC_UDBG_H */ | 47 | #endif /* _ASM_POWERPC_UDBG_H */ |
diff --git a/include/asm-ppc/system.h b/include/asm-ppc/system.h index bd99cb53a19f..fb49c0c49ea1 100644 --- a/include/asm-ppc/system.h +++ b/include/asm-ppc/system.h | |||
@@ -4,7 +4,6 @@ | |||
4 | #ifndef __PPC_SYSTEM_H | 4 | #ifndef __PPC_SYSTEM_H |
5 | #define __PPC_SYSTEM_H | 5 | #define __PPC_SYSTEM_H |
6 | 6 | ||
7 | #include <linux/config.h> | ||
8 | #include <linux/kernel.h> | 7 | #include <linux/kernel.h> |
9 | 8 | ||
10 | #include <asm/atomic.h> | 9 | #include <asm/atomic.h> |
@@ -39,7 +38,7 @@ | |||
39 | #ifdef CONFIG_SMP | 38 | #ifdef CONFIG_SMP |
40 | #define smp_mb() mb() | 39 | #define smp_mb() mb() |
41 | #define smp_rmb() rmb() | 40 | #define smp_rmb() rmb() |
42 | #define smp_wmb() wmb() | 41 | #define smp_wmb() __asm__ __volatile__ ("eieio" : : : "memory") |
43 | #define smp_read_barrier_depends() read_barrier_depends() | 42 | #define smp_read_barrier_depends() read_barrier_depends() |
44 | #else | 43 | #else |
45 | #define smp_mb() barrier() | 44 | #define smp_mb() barrier() |
@@ -74,6 +73,7 @@ extern void chrp_nvram_init(void); | |||
74 | extern void read_rtc_time(void); | 73 | extern void read_rtc_time(void); |
75 | extern void pmac_find_display(void); | 74 | extern void pmac_find_display(void); |
76 | extern void giveup_fpu(struct task_struct *); | 75 | extern void giveup_fpu(struct task_struct *); |
76 | extern void disable_kernel_fp(void); | ||
77 | extern void enable_kernel_fp(void); | 77 | extern void enable_kernel_fp(void); |
78 | extern void flush_fp_to_thread(struct task_struct *); | 78 | extern void flush_fp_to_thread(struct task_struct *); |
79 | extern void enable_kernel_altivec(void); | 79 | extern void enable_kernel_altivec(void); |
@@ -86,6 +86,14 @@ extern int fix_alignment(struct pt_regs *); | |||
86 | extern void cvt_fd(float *from, double *to, struct thread_struct *thread); | 86 | extern void cvt_fd(float *from, double *to, struct thread_struct *thread); |
87 | extern void cvt_df(double *from, float *to, struct thread_struct *thread); | 87 | extern void cvt_df(double *from, float *to, struct thread_struct *thread); |
88 | 88 | ||
89 | #ifndef CONFIG_SMP | ||
90 | extern void discard_lazy_cpu_state(void); | ||
91 | #else | ||
92 | static inline void discard_lazy_cpu_state(void) | ||
93 | { | ||
94 | } | ||
95 | #endif | ||
96 | |||
89 | #ifdef CONFIG_ALTIVEC | 97 | #ifdef CONFIG_ALTIVEC |
90 | extern void flush_altivec_to_thread(struct task_struct *); | 98 | extern void flush_altivec_to_thread(struct task_struct *); |
91 | #else | 99 | #else |
@@ -123,6 +131,16 @@ extern struct task_struct *__switch_to(struct task_struct *, | |||
123 | struct task_struct *); | 131 | struct task_struct *); |
124 | #define switch_to(prev, next, last) ((last) = __switch_to((prev), (next))) | 132 | #define switch_to(prev, next, last) ((last) = __switch_to((prev), (next))) |
125 | 133 | ||
134 | /* | ||
135 | * On SMP systems, when the scheduler does migration-cost autodetection, | ||
136 | * it needs a way to flush as much of the CPU's caches as possible. | ||
137 | * | ||
138 | * TODO: fill this in! | ||
139 | */ | ||
140 | static inline void sched_cacheflush(void) | ||
141 | { | ||
142 | } | ||
143 | |||
126 | struct thread_struct; | 144 | struct thread_struct; |
127 | extern struct task_struct *_switch(struct thread_struct *prev, | 145 | extern struct task_struct *_switch(struct thread_struct *prev, |
128 | struct thread_struct *next); | 146 | struct thread_struct *next); |
diff --git a/include/asm-s390/elf.h b/include/asm-s390/elf.h index 372d51cccd53..710646e64f7d 100644 --- a/include/asm-s390/elf.h +++ b/include/asm-s390/elf.h | |||
@@ -163,7 +163,7 @@ static inline int dump_regs(struct pt_regs *ptregs, elf_gregset_t *regs) | |||
163 | 163 | ||
164 | static inline int dump_task_regs(struct task_struct *tsk, elf_gregset_t *regs) | 164 | static inline int dump_task_regs(struct task_struct *tsk, elf_gregset_t *regs) |
165 | { | 165 | { |
166 | struct pt_regs *ptregs = __KSTK_PTREGS(tsk); | 166 | struct pt_regs *ptregs = task_pt_regs(tsk); |
167 | memcpy(®s->psw, &ptregs->psw, sizeof(regs->psw)+sizeof(regs->gprs)); | 167 | memcpy(®s->psw, &ptregs->psw, sizeof(regs->psw)+sizeof(regs->gprs)); |
168 | memcpy(regs->acrs, tsk->thread.acrs, sizeof(regs->acrs)); | 168 | memcpy(regs->acrs, tsk->thread.acrs, sizeof(regs->acrs)); |
169 | regs->orig_gpr2 = ptregs->orig_gpr2; | 169 | regs->orig_gpr2 = ptregs->orig_gpr2; |
diff --git a/include/asm-s390/ioctl.h b/include/asm-s390/ioctl.h index df7394345ac4..b279fe06dfe5 100644 --- a/include/asm-s390/ioctl.h +++ b/include/asm-s390/ioctl.h | |||
@@ -1,88 +1 @@ | |||
1 | /* | #include <asm-generic/ioctl.h> | |
2 | * include/asm-s390/ioctl.h | ||
3 | * | ||
4 | * S390 version | ||
5 | * | ||
6 | * Derived from "include/asm-i386/ioctl.h" | ||
7 | */ | ||
8 | |||
9 | #ifndef _S390_IOCTL_H | ||
10 | #define _S390_IOCTL_H | ||
11 | |||
12 | /* ioctl command encoding: 32 bits total, command in lower 16 bits, | ||
13 | * size of the parameter structure in the lower 14 bits of the | ||
14 | * upper 16 bits. | ||
15 | * Encoding the size of the parameter structure in the ioctl request | ||
16 | * is useful for catching programs compiled with old versions | ||
17 | * and to avoid overwriting user space outside the user buffer area. | ||
18 | * The highest 2 bits are reserved for indicating the ``access mode''. | ||
19 | * NOTE: This limits the max parameter size to 16kB -1 ! | ||
20 | */ | ||
21 | |||
22 | /* | ||
23 | * The following is for compatibility across the various Linux | ||
24 | * platforms. The i386 ioctl numbering scheme doesn't really enforce | ||
25 | * a type field. De facto, however, the top 8 bits of the lower 16 | ||
26 | * bits are indeed used as a type field, so we might just as well make | ||
27 | * this explicit here. Please be sure to use the decoding macros | ||
28 | * below from now on. | ||
29 | */ | ||
30 | #define _IOC_NRBITS 8 | ||
31 | #define _IOC_TYPEBITS 8 | ||
32 | #define _IOC_SIZEBITS 14 | ||
33 | #define _IOC_DIRBITS 2 | ||
34 | |||
35 | #define _IOC_NRMASK ((1 << _IOC_NRBITS)-1) | ||
36 | #define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1) | ||
37 | #define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1) | ||
38 | #define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1) | ||
39 | |||
40 | #define _IOC_NRSHIFT 0 | ||
41 | #define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS) | ||
42 | #define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS) | ||
43 | #define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS) | ||
44 | |||
45 | /* | ||
46 | * Direction bits. | ||
47 | */ | ||
48 | #define _IOC_NONE 0U | ||
49 | #define _IOC_WRITE 1U | ||
50 | #define _IOC_READ 2U | ||
51 | |||
52 | #define _IOC(dir,type,nr,size) \ | ||
53 | (((dir) << _IOC_DIRSHIFT) | \ | ||
54 | ((type) << _IOC_TYPESHIFT) | \ | ||
55 | ((nr) << _IOC_NRSHIFT) | \ | ||
56 | ((size) << _IOC_SIZESHIFT)) | ||
57 | |||
58 | /* provoke compile error for invalid uses of size argument */ | ||
59 | extern unsigned long __invalid_size_argument_for_IOC; | ||
60 | #define _IOC_TYPECHECK(t) \ | ||
61 | ((sizeof(t) == sizeof(t[1]) && \ | ||
62 | sizeof(t) < (1 << _IOC_SIZEBITS)) ? \ | ||
63 | sizeof(t) : __invalid_size_argument_for_IOC) | ||
64 | |||
65 | /* used to create numbers */ | ||
66 | #define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0) | ||
67 | #define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),(_IOC_TYPECHECK(size))) | ||
68 | #define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size))) | ||
69 | #define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size))) | ||
70 | #define _IOR_BAD(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size)) | ||
71 | #define _IOW_BAD(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size)) | ||
72 | #define _IOWR_BAD(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size)) | ||
73 | |||
74 | /* used to decode ioctl numbers.. */ | ||
75 | #define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) | ||
76 | #define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK) | ||
77 | #define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK) | ||
78 | #define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK) | ||
79 | |||
80 | /* ...and for the drivers/sound files... */ | ||
81 | |||
82 | #define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT) | ||
83 | #define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT) | ||
84 | #define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT) | ||
85 | #define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT) | ||
86 | #define IOCSIZE_SHIFT (_IOC_SIZESHIFT) | ||
87 | |||
88 | #endif /* _S390_IOCTL_H */ | ||
diff --git a/include/asm-s390/kexec.h b/include/asm-s390/kexec.h index 54cf7d9f251c..ce28ddda0f50 100644 --- a/include/asm-s390/kexec.h +++ b/include/asm-s390/kexec.h | |||
@@ -35,8 +35,9 @@ | |||
35 | #define KEXEC_ARCH KEXEC_ARCH_S390 | 35 | #define KEXEC_ARCH KEXEC_ARCH_S390 |
36 | 36 | ||
37 | #define MAX_NOTE_BYTES 1024 | 37 | #define MAX_NOTE_BYTES 1024 |
38 | typedef u32 note_buf_t[MAX_NOTE_BYTES/4]; | ||
39 | 38 | ||
40 | extern note_buf_t crash_notes[]; | 39 | /* Provide a dummy definition to avoid build failures. */ |
40 | static inline void crash_setup_regs(struct pt_regs *newregs, | ||
41 | struct pt_regs *oldregs) { } | ||
41 | 42 | ||
42 | #endif /*_S390_KEXEC_H */ | 43 | #endif /*_S390_KEXEC_H */ |
diff --git a/include/asm-s390/processor.h b/include/asm-s390/processor.h index 4ec652ebb3b1..c5cbc4bd8414 100644 --- a/include/asm-s390/processor.h +++ b/include/asm-s390/processor.h | |||
@@ -191,10 +191,10 @@ extern void show_registers(struct pt_regs *regs); | |||
191 | extern void show_trace(struct task_struct *task, unsigned long *sp); | 191 | extern void show_trace(struct task_struct *task, unsigned long *sp); |
192 | 192 | ||
193 | unsigned long get_wchan(struct task_struct *p); | 193 | unsigned long get_wchan(struct task_struct *p); |
194 | #define __KSTK_PTREGS(tsk) ((struct pt_regs *) \ | 194 | #define task_pt_regs(tsk) ((struct pt_regs *) \ |
195 | ((unsigned long) tsk->thread_info + THREAD_SIZE - sizeof(struct pt_regs))) | 195 | (task_stack_page(tsk) + THREAD_SIZE) - 1) |
196 | #define KSTK_EIP(tsk) (__KSTK_PTREGS(tsk)->psw.addr) | 196 | #define KSTK_EIP(tsk) (task_pt_regs(tsk)->psw.addr) |
197 | #define KSTK_ESP(tsk) (__KSTK_PTREGS(tsk)->gprs[15]) | 197 | #define KSTK_ESP(tsk) (task_pt_regs(tsk)->gprs[15]) |
198 | 198 | ||
199 | /* | 199 | /* |
200 | * Give up the time slice of the virtual PU. | 200 | * Give up the time slice of the virtual PU. |
diff --git a/include/asm-s390/system.h b/include/asm-s390/system.h index 864cae7e1fd6..c7c3a9ad593f 100644 --- a/include/asm-s390/system.h +++ b/include/asm-s390/system.h | |||
@@ -104,6 +104,16 @@ static inline void restore_access_regs(unsigned int *acrs) | |||
104 | prev = __switch_to(prev,next); \ | 104 | prev = __switch_to(prev,next); \ |
105 | } while (0) | 105 | } while (0) |
106 | 106 | ||
107 | /* | ||
108 | * On SMP systems, when the scheduler does migration-cost autodetection, | ||
109 | * it needs a way to flush as much of the CPU's caches as possible. | ||
110 | * | ||
111 | * TODO: fill this in! | ||
112 | */ | ||
113 | static inline void sched_cacheflush(void) | ||
114 | { | ||
115 | } | ||
116 | |||
107 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING | 117 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING |
108 | extern void account_user_vtime(struct task_struct *); | 118 | extern void account_user_vtime(struct task_struct *); |
109 | extern void account_system_vtime(struct task_struct *); | 119 | extern void account_system_vtime(struct task_struct *); |
diff --git a/include/asm-s390/thread_info.h b/include/asm-s390/thread_info.h index 6c18a3f24316..f3797a52c4ea 100644 --- a/include/asm-s390/thread_info.h +++ b/include/asm-s390/thread_info.h | |||
@@ -81,8 +81,6 @@ static inline struct thread_info *current_thread_info(void) | |||
81 | #define alloc_thread_info(tsk) ((struct thread_info *) \ | 81 | #define alloc_thread_info(tsk) ((struct thread_info *) \ |
82 | __get_free_pages(GFP_KERNEL,THREAD_ORDER)) | 82 | __get_free_pages(GFP_KERNEL,THREAD_ORDER)) |
83 | #define free_thread_info(ti) free_pages((unsigned long) (ti),THREAD_ORDER) | 83 | #define free_thread_info(ti) free_pages((unsigned long) (ti),THREAD_ORDER) |
84 | #define get_thread_info(ti) get_task_struct((ti)->task) | ||
85 | #define put_thread_info(ti) put_task_struct((ti)->task) | ||
86 | 84 | ||
87 | #endif | 85 | #endif |
88 | 86 | ||
diff --git a/include/asm-sh/ioctl.h b/include/asm-sh/ioctl.h index 524700e84acd..b279fe06dfe5 100644 --- a/include/asm-sh/ioctl.h +++ b/include/asm-sh/ioctl.h | |||
@@ -1,75 +1 @@ | |||
1 | /* $Id: ioctl.h,v 1.1.1.1 2001/10/15 20:45:09 mrbrown Exp $ | #include <asm-generic/ioctl.h> | |
2 | * | ||
3 | * linux/ioctl.h for Linux by H.H. Bergman. | ||
4 | */ | ||
5 | |||
6 | #ifndef __ASM_SH_IOCTL_H | ||
7 | #define __ASM_SH_IOCTL_H | ||
8 | |||
9 | /* ioctl command encoding: 32 bits total, command in lower 16 bits, | ||
10 | * size of the parameter structure in the lower 14 bits of the | ||
11 | * upper 16 bits. | ||
12 | * Encoding the size of the parameter structure in the ioctl request | ||
13 | * is useful for catching programs compiled with old versions | ||
14 | * and to avoid overwriting user space outside the user buffer area. | ||
15 | * The highest 2 bits are reserved for indicating the ``access mode''. | ||
16 | * NOTE: This limits the max parameter size to 16kB -1 ! | ||
17 | */ | ||
18 | |||
19 | /* | ||
20 | * The following is for compatibility across the various Linux | ||
21 | * platforms. The i386 ioctl numbering scheme doesn't really enforce | ||
22 | * a type field. De facto, however, the top 8 bits of the lower 16 | ||
23 | * bits are indeed used as a type field, so we might just as well make | ||
24 | * this explicit here. Please be sure to use the decoding macros | ||
25 | * below from now on. | ||
26 | */ | ||
27 | #define _IOC_NRBITS 8 | ||
28 | #define _IOC_TYPEBITS 8 | ||
29 | #define _IOC_SIZEBITS 14 | ||
30 | #define _IOC_DIRBITS 2 | ||
31 | |||
32 | #define _IOC_NRMASK ((1 << _IOC_NRBITS)-1) | ||
33 | #define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1) | ||
34 | #define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1) | ||
35 | #define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1) | ||
36 | |||
37 | #define _IOC_NRSHIFT 0 | ||
38 | #define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS) | ||
39 | #define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS) | ||
40 | #define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS) | ||
41 | |||
42 | /* | ||
43 | * Direction bits. | ||
44 | */ | ||
45 | #define _IOC_NONE 0U | ||
46 | #define _IOC_WRITE 1U | ||
47 | #define _IOC_READ 2U | ||
48 | |||
49 | #define _IOC(dir,type,nr,size) \ | ||
50 | (((dir) << _IOC_DIRSHIFT) | \ | ||
51 | ((type) << _IOC_TYPESHIFT) | \ | ||
52 | ((nr) << _IOC_NRSHIFT) | \ | ||
53 | ((size) << _IOC_SIZESHIFT)) | ||
54 | |||
55 | /* used to create numbers */ | ||
56 | #define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0) | ||
57 | #define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size)) | ||
58 | #define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size)) | ||
59 | #define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size)) | ||
60 | |||
61 | /* used to decode ioctl numbers.. */ | ||
62 | #define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) | ||
63 | #define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK) | ||
64 | #define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK) | ||
65 | #define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK) | ||
66 | |||
67 | /* ...and for the drivers/sound files... */ | ||
68 | |||
69 | #define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT) | ||
70 | #define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT) | ||
71 | #define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT) | ||
72 | #define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT) | ||
73 | #define IOCSIZE_SHIFT (_IOC_SIZESHIFT) | ||
74 | |||
75 | #endif /* __ASM_SH_IOCTL_H */ | ||
diff --git a/include/asm-sh/ptrace.h b/include/asm-sh/ptrace.h index 0f75e16a7415..792fc35bd624 100644 --- a/include/asm-sh/ptrace.h +++ b/include/asm-sh/ptrace.h | |||
@@ -91,6 +91,16 @@ struct pt_dspregs { | |||
91 | #define instruction_pointer(regs) ((regs)->pc) | 91 | #define instruction_pointer(regs) ((regs)->pc) |
92 | extern void show_regs(struct pt_regs *); | 92 | extern void show_regs(struct pt_regs *); |
93 | 93 | ||
94 | #ifdef CONFIG_SH_DSP | ||
95 | #define task_pt_regs(task) \ | ||
96 | ((struct pt_regs *) (task_stack_page(task) + THREAD_SIZE \ | ||
97 | - sizeof(struct pt_dspregs) - sizeof(unsigned long)) - 1) | ||
98 | #else | ||
99 | #define task_pt_regs(task) \ | ||
100 | ((struct pt_regs *) (task_stack_page(task) + THREAD_SIZE \ | ||
101 | - sizeof(unsigned long)) - 1) | ||
102 | #endif | ||
103 | |||
94 | static inline unsigned long profile_pc(struct pt_regs *regs) | 104 | static inline unsigned long profile_pc(struct pt_regs *regs) |
95 | { | 105 | { |
96 | unsigned long pc = instruction_pointer(regs); | 106 | unsigned long pc = instruction_pointer(regs); |
diff --git a/include/asm-sh/system.h b/include/asm-sh/system.h index 28a3c2d8bcd7..bb0330499bdf 100644 --- a/include/asm-sh/system.h +++ b/include/asm-sh/system.h | |||
@@ -57,6 +57,16 @@ | |||
57 | last = __last; \ | 57 | last = __last; \ |
58 | } while (0) | 58 | } while (0) |
59 | 59 | ||
60 | /* | ||
61 | * On SMP systems, when the scheduler does migration-cost autodetection, | ||
62 | * it needs a way to flush as much of the CPU's caches as possible. | ||
63 | * | ||
64 | * TODO: fill this in! | ||
65 | */ | ||
66 | static inline void sched_cacheflush(void) | ||
67 | { | ||
68 | } | ||
69 | |||
60 | #define nop() __asm__ __volatile__ ("nop") | 70 | #define nop() __asm__ __volatile__ ("nop") |
61 | 71 | ||
62 | 72 | ||
diff --git a/include/asm-sh/thread_info.h b/include/asm-sh/thread_info.h index 46080cefaff8..85f0c11b4319 100644 --- a/include/asm-sh/thread_info.h +++ b/include/asm-sh/thread_info.h | |||
@@ -60,8 +60,6 @@ static inline struct thread_info *current_thread_info(void) | |||
60 | #define THREAD_SIZE (2*PAGE_SIZE) | 60 | #define THREAD_SIZE (2*PAGE_SIZE) |
61 | #define alloc_thread_info(ti) ((struct thread_info *) __get_free_pages(GFP_KERNEL,1)) | 61 | #define alloc_thread_info(ti) ((struct thread_info *) __get_free_pages(GFP_KERNEL,1)) |
62 | #define free_thread_info(ti) free_pages((unsigned long) (ti), 1) | 62 | #define free_thread_info(ti) free_pages((unsigned long) (ti), 1) |
63 | #define get_thread_info(ti) get_task_struct((ti)->task) | ||
64 | #define put_thread_info(ti) put_task_struct((ti)->task) | ||
65 | 63 | ||
66 | #else /* !__ASSEMBLY__ */ | 64 | #else /* !__ASSEMBLY__ */ |
67 | 65 | ||
diff --git a/include/asm-sh64/io.h b/include/asm-sh64/io.h index cfafaa73b2b0..dee4f77929a4 100644 --- a/include/asm-sh64/io.h +++ b/include/asm-sh64/io.h | |||
@@ -143,12 +143,12 @@ extern unsigned long pciio_virt; | |||
143 | * Change virtual addresses to physical addresses and vv. | 143 | * Change virtual addresses to physical addresses and vv. |
144 | * These are trivial on the 1:1 Linux/SuperH mapping | 144 | * These are trivial on the 1:1 Linux/SuperH mapping |
145 | */ | 145 | */ |
146 | extern __inline__ unsigned long virt_to_phys(volatile void * address) | 146 | static inline unsigned long virt_to_phys(volatile void * address) |
147 | { | 147 | { |
148 | return __pa(address); | 148 | return __pa(address); |
149 | } | 149 | } |
150 | 150 | ||
151 | extern __inline__ void * phys_to_virt(unsigned long address) | 151 | static inline void * phys_to_virt(unsigned long address) |
152 | { | 152 | { |
153 | return __va(address); | 153 | return __va(address); |
154 | } | 154 | } |
@@ -156,12 +156,12 @@ extern __inline__ void * phys_to_virt(unsigned long address) | |||
156 | extern void * __ioremap(unsigned long phys_addr, unsigned long size, | 156 | extern void * __ioremap(unsigned long phys_addr, unsigned long size, |
157 | unsigned long flags); | 157 | unsigned long flags); |
158 | 158 | ||
159 | extern __inline__ void * ioremap(unsigned long phys_addr, unsigned long size) | 159 | static inline void * ioremap(unsigned long phys_addr, unsigned long size) |
160 | { | 160 | { |
161 | return __ioremap(phys_addr, size, 1); | 161 | return __ioremap(phys_addr, size, 1); |
162 | } | 162 | } |
163 | 163 | ||
164 | extern __inline__ void * ioremap_nocache (unsigned long phys_addr, unsigned long size) | 164 | static inline void * ioremap_nocache (unsigned long phys_addr, unsigned long size) |
165 | { | 165 | { |
166 | return __ioremap(phys_addr, size, 0); | 166 | return __ioremap(phys_addr, size, 0); |
167 | } | 167 | } |
diff --git a/include/asm-sh64/ioctl.h b/include/asm-sh64/ioctl.h index c089a6fb78e0..b279fe06dfe5 100644 --- a/include/asm-sh64/ioctl.h +++ b/include/asm-sh64/ioctl.h | |||
@@ -1,83 +1 @@ | |||
1 | #ifndef __ASM_SH64_IOCTL_H | #include <asm-generic/ioctl.h> | |
2 | #define __ASM_SH64_IOCTL_H | ||
3 | |||
4 | /* | ||
5 | * This file is subject to the terms and conditions of the GNU General Public | ||
6 | * License. See the file "COPYING" in the main directory of this archive | ||
7 | * for more details. | ||
8 | * | ||
9 | * include/asm-sh64/ioctl.h | ||
10 | * | ||
11 | * Copyright (C) 2000, 2001 Paolo Alberelli | ||
12 | * | ||
13 | * linux/ioctl.h for Linux by H.H. Bergman. | ||
14 | * | ||
15 | */ | ||
16 | |||
17 | /* ioctl command encoding: 32 bits total, command in lower 16 bits, | ||
18 | * size of the parameter structure in the lower 14 bits of the | ||
19 | * upper 16 bits. | ||
20 | * Encoding the size of the parameter structure in the ioctl request | ||
21 | * is useful for catching programs compiled with old versions | ||
22 | * and to avoid overwriting user space outside the user buffer area. | ||
23 | * The highest 2 bits are reserved for indicating the ``access mode''. | ||
24 | * NOTE: This limits the max parameter size to 16kB -1 ! | ||
25 | */ | ||
26 | |||
27 | /* | ||
28 | * The following is for compatibility across the various Linux | ||
29 | * platforms. The i386 ioctl numbering scheme doesn't really enforce | ||
30 | * a type field. De facto, however, the top 8 bits of the lower 16 | ||
31 | * bits are indeed used as a type field, so we might just as well make | ||
32 | * this explicit here. Please be sure to use the decoding macros | ||
33 | * below from now on. | ||
34 | */ | ||
35 | #define _IOC_NRBITS 8 | ||
36 | #define _IOC_TYPEBITS 8 | ||
37 | #define _IOC_SIZEBITS 14 | ||
38 | #define _IOC_DIRBITS 2 | ||
39 | |||
40 | #define _IOC_NRMASK ((1 << _IOC_NRBITS)-1) | ||
41 | #define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1) | ||
42 | #define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1) | ||
43 | #define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1) | ||
44 | |||
45 | #define _IOC_NRSHIFT 0 | ||
46 | #define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS) | ||
47 | #define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS) | ||
48 | #define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS) | ||
49 | |||
50 | /* | ||
51 | * Direction bits. | ||
52 | */ | ||
53 | #define _IOC_NONE 0U | ||
54 | #define _IOC_WRITE 1U | ||
55 | #define _IOC_READ 2U | ||
56 | |||
57 | #define _IOC(dir,type,nr,size) \ | ||
58 | (((dir) << _IOC_DIRSHIFT) | \ | ||
59 | ((type) << _IOC_TYPESHIFT) | \ | ||
60 | ((nr) << _IOC_NRSHIFT) | \ | ||
61 | ((size) << _IOC_SIZESHIFT)) | ||
62 | |||
63 | /* used to create numbers */ | ||
64 | #define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0) | ||
65 | #define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size)) | ||
66 | #define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size)) | ||
67 | #define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size)) | ||
68 | |||
69 | /* used to decode ioctl numbers.. */ | ||
70 | #define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) | ||
71 | #define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK) | ||
72 | #define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK) | ||
73 | #define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK) | ||
74 | |||
75 | /* ...and for the drivers/sound files... */ | ||
76 | |||
77 | #define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT) | ||
78 | #define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT) | ||
79 | #define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT) | ||
80 | #define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT) | ||
81 | #define IOCSIZE_SHIFT (_IOC_SIZESHIFT) | ||
82 | |||
83 | #endif /* __ASM_SH64_IOCTL_H */ | ||
diff --git a/include/asm-sh64/mmu_context.h b/include/asm-sh64/mmu_context.h index f062e1513272..991cfda4cdf6 100644 --- a/include/asm-sh64/mmu_context.h +++ b/include/asm-sh64/mmu_context.h | |||
@@ -50,7 +50,7 @@ extern pgd_t *mmu_pdtp_cache; | |||
50 | */ | 50 | */ |
51 | #define MMU_VPN_MASK 0xfffff000 | 51 | #define MMU_VPN_MASK 0xfffff000 |
52 | 52 | ||
53 | extern __inline__ void | 53 | static inline void |
54 | get_new_mmu_context(struct mm_struct *mm) | 54 | get_new_mmu_context(struct mm_struct *mm) |
55 | { | 55 | { |
56 | extern void flush_tlb_all(void); | 56 | extern void flush_tlb_all(void); |
diff --git a/include/asm-sh64/pgalloc.h b/include/asm-sh64/pgalloc.h index b25f5df5535c..678251ac1db8 100644 --- a/include/asm-sh64/pgalloc.h +++ b/include/asm-sh64/pgalloc.h | |||
@@ -38,14 +38,14 @@ static inline void pgd_init(unsigned long page) | |||
38 | * if any. | 38 | * if any. |
39 | */ | 39 | */ |
40 | 40 | ||
41 | extern __inline__ pgd_t *get_pgd_slow(void) | 41 | static inline pgd_t *get_pgd_slow(void) |
42 | { | 42 | { |
43 | unsigned int pgd_size = (USER_PTRS_PER_PGD * sizeof(pgd_t)); | 43 | unsigned int pgd_size = (USER_PTRS_PER_PGD * sizeof(pgd_t)); |
44 | pgd_t *ret = (pgd_t *)kmalloc(pgd_size, GFP_KERNEL); | 44 | pgd_t *ret = (pgd_t *)kmalloc(pgd_size, GFP_KERNEL); |
45 | return ret; | 45 | return ret; |
46 | } | 46 | } |
47 | 47 | ||
48 | extern __inline__ pgd_t *get_pgd_fast(void) | 48 | static inline pgd_t *get_pgd_fast(void) |
49 | { | 49 | { |
50 | unsigned long *ret; | 50 | unsigned long *ret; |
51 | 51 | ||
@@ -62,14 +62,14 @@ extern __inline__ pgd_t *get_pgd_fast(void) | |||
62 | return (pgd_t *)ret; | 62 | return (pgd_t *)ret; |
63 | } | 63 | } |
64 | 64 | ||
65 | extern __inline__ void free_pgd_fast(pgd_t *pgd) | 65 | static inline void free_pgd_fast(pgd_t *pgd) |
66 | { | 66 | { |
67 | *(unsigned long *)pgd = (unsigned long) pgd_quicklist; | 67 | *(unsigned long *)pgd = (unsigned long) pgd_quicklist; |
68 | pgd_quicklist = (unsigned long *) pgd; | 68 | pgd_quicklist = (unsigned long *) pgd; |
69 | pgtable_cache_size++; | 69 | pgtable_cache_size++; |
70 | } | 70 | } |
71 | 71 | ||
72 | extern __inline__ void free_pgd_slow(pgd_t *pgd) | 72 | static inline void free_pgd_slow(pgd_t *pgd) |
73 | { | 73 | { |
74 | kfree((void *)pgd); | 74 | kfree((void *)pgd); |
75 | } | 75 | } |
@@ -77,7 +77,7 @@ extern __inline__ void free_pgd_slow(pgd_t *pgd) | |||
77 | extern pte_t *get_pte_slow(pmd_t *pmd, unsigned long address_preadjusted); | 77 | extern pte_t *get_pte_slow(pmd_t *pmd, unsigned long address_preadjusted); |
78 | extern pte_t *get_pte_kernel_slow(pmd_t *pmd, unsigned long address_preadjusted); | 78 | extern pte_t *get_pte_kernel_slow(pmd_t *pmd, unsigned long address_preadjusted); |
79 | 79 | ||
80 | extern __inline__ pte_t *get_pte_fast(void) | 80 | static inline pte_t *get_pte_fast(void) |
81 | { | 81 | { |
82 | unsigned long *ret; | 82 | unsigned long *ret; |
83 | 83 | ||
@@ -89,7 +89,7 @@ extern __inline__ pte_t *get_pte_fast(void) | |||
89 | return (pte_t *)ret; | 89 | return (pte_t *)ret; |
90 | } | 90 | } |
91 | 91 | ||
92 | extern __inline__ void free_pte_fast(pte_t *pte) | 92 | static inline void free_pte_fast(pte_t *pte) |
93 | { | 93 | { |
94 | *(unsigned long *)pte = (unsigned long) pte_quicklist; | 94 | *(unsigned long *)pte = (unsigned long) pte_quicklist; |
95 | pte_quicklist = (unsigned long *) pte; | 95 | pte_quicklist = (unsigned long *) pte; |
@@ -167,7 +167,7 @@ static __inline__ void pmd_free(pmd_t *pmd) | |||
167 | 167 | ||
168 | extern int do_check_pgt_cache(int, int); | 168 | extern int do_check_pgt_cache(int, int); |
169 | 169 | ||
170 | extern inline void set_pgdir(unsigned long address, pgd_t entry) | 170 | static inline void set_pgdir(unsigned long address, pgd_t entry) |
171 | { | 171 | { |
172 | struct task_struct * p; | 172 | struct task_struct * p; |
173 | pgd_t *pgd; | 173 | pgd_t *pgd; |
diff --git a/include/asm-sh64/pgtable.h b/include/asm-sh64/pgtable.h index a1906a772df9..57af6b3eb271 100644 --- a/include/asm-sh64/pgtable.h +++ b/include/asm-sh64/pgtable.h | |||
@@ -421,18 +421,18 @@ static inline int pte_young(pte_t pte){ return pte_val(pte) & _PAGE_ACCESSED; } | |||
421 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } | 421 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } |
422 | static inline int pte_write(pte_t pte){ return pte_val(pte) & _PAGE_WRITE; } | 422 | static inline int pte_write(pte_t pte){ return pte_val(pte) & _PAGE_WRITE; } |
423 | 423 | ||
424 | extern inline pte_t pte_rdprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_READ)); return pte; } | 424 | static inline pte_t pte_rdprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_READ)); return pte; } |
425 | extern inline pte_t pte_wrprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_WRITE)); return pte; } | 425 | static inline pte_t pte_wrprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_WRITE)); return pte; } |
426 | extern inline pte_t pte_exprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_EXECUTE)); return pte; } | 426 | static inline pte_t pte_exprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_EXECUTE)); return pte; } |
427 | extern inline pte_t pte_mkclean(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY)); return pte; } | 427 | static inline pte_t pte_mkclean(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY)); return pte; } |
428 | extern inline pte_t pte_mkold(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_ACCESSED)); return pte; } | 428 | static inline pte_t pte_mkold(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_ACCESSED)); return pte; } |
429 | 429 | ||
430 | extern inline pte_t pte_mkread(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_READ)); return pte; } | 430 | static inline pte_t pte_mkread(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_READ)); return pte; } |
431 | extern inline pte_t pte_mkwrite(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_WRITE)); return pte; } | 431 | static inline pte_t pte_mkwrite(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_WRITE)); return pte; } |
432 | extern inline pte_t pte_mkexec(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_EXECUTE)); return pte; } | 432 | static inline pte_t pte_mkexec(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_EXECUTE)); return pte; } |
433 | extern inline pte_t pte_mkdirty(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); return pte; } | 433 | static inline pte_t pte_mkdirty(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); return pte; } |
434 | extern inline pte_t pte_mkyoung(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_ACCESSED)); return pte; } | 434 | static inline pte_t pte_mkyoung(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_ACCESSED)); return pte; } |
435 | extern inline pte_t pte_mkhuge(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_SZHUGE)); return pte; } | 435 | static inline pte_t pte_mkhuge(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_SZHUGE)); return pte; } |
436 | 436 | ||
437 | 437 | ||
438 | /* | 438 | /* |
@@ -456,7 +456,7 @@ extern inline pte_t pte_mkhuge(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _ | |||
456 | #define mk_pte_phys(physpage, pgprot) \ | 456 | #define mk_pte_phys(physpage, pgprot) \ |
457 | ({ pte_t __pte; set_pte(&__pte, __pte(physpage | pgprot_val(pgprot))); __pte; }) | 457 | ({ pte_t __pte; set_pte(&__pte, __pte(physpage | pgprot_val(pgprot))); __pte; }) |
458 | 458 | ||
459 | extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | 459 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) |
460 | { set_pte(&pte, __pte((pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot))); return pte; } | 460 | { set_pte(&pte, __pte((pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot))); return pte; } |
461 | 461 | ||
462 | typedef pte_t *pte_addr_t; | 462 | typedef pte_t *pte_addr_t; |
diff --git a/include/asm-sh64/processor.h b/include/asm-sh64/processor.h index a51bd41e6fbc..1bf252dad824 100644 --- a/include/asm-sh64/processor.h +++ b/include/asm-sh64/processor.h | |||
@@ -228,7 +228,7 @@ extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); | |||
228 | * FPU lazy state save handling. | 228 | * FPU lazy state save handling. |
229 | */ | 229 | */ |
230 | 230 | ||
231 | extern __inline__ void release_fpu(void) | 231 | static inline void release_fpu(void) |
232 | { | 232 | { |
233 | unsigned long long __dummy; | 233 | unsigned long long __dummy; |
234 | 234 | ||
@@ -240,7 +240,7 @@ extern __inline__ void release_fpu(void) | |||
240 | : "r" (SR_FD)); | 240 | : "r" (SR_FD)); |
241 | } | 241 | } |
242 | 242 | ||
243 | extern __inline__ void grab_fpu(void) | 243 | static inline void grab_fpu(void) |
244 | { | 244 | { |
245 | unsigned long long __dummy; | 245 | unsigned long long __dummy; |
246 | 246 | ||
diff --git a/include/asm-sh64/system.h b/include/asm-sh64/system.h index 42510e496eb5..3002e988180c 100644 --- a/include/asm-sh64/system.h +++ b/include/asm-sh64/system.h | |||
@@ -132,7 +132,7 @@ static __inline__ void local_irq_disable(void) | |||
132 | (flags != 0); \ | 132 | (flags != 0); \ |
133 | }) | 133 | }) |
134 | 134 | ||
135 | extern __inline__ unsigned long xchg_u32(volatile int * m, unsigned long val) | 135 | static inline unsigned long xchg_u32(volatile int * m, unsigned long val) |
136 | { | 136 | { |
137 | unsigned long flags, retval; | 137 | unsigned long flags, retval; |
138 | 138 | ||
@@ -143,7 +143,7 @@ extern __inline__ unsigned long xchg_u32(volatile int * m, unsigned long val) | |||
143 | return retval; | 143 | return retval; |
144 | } | 144 | } |
145 | 145 | ||
146 | extern __inline__ unsigned long xchg_u8(volatile unsigned char * m, unsigned long val) | 146 | static inline unsigned long xchg_u8(volatile unsigned char * m, unsigned long val) |
147 | { | 147 | { |
148 | unsigned long flags, retval; | 148 | unsigned long flags, retval; |
149 | 149 | ||
diff --git a/include/asm-sh64/thread_info.h b/include/asm-sh64/thread_info.h index 10f024c6a2e3..1f825cb163c3 100644 --- a/include/asm-sh64/thread_info.h +++ b/include/asm-sh64/thread_info.h | |||
@@ -66,8 +66,6 @@ static inline struct thread_info *current_thread_info(void) | |||
66 | 66 | ||
67 | #define alloc_thread_info(ti) ((struct thread_info *) __get_free_pages(GFP_KERNEL,1)) | 67 | #define alloc_thread_info(ti) ((struct thread_info *) __get_free_pages(GFP_KERNEL,1)) |
68 | #define free_thread_info(ti) free_pages((unsigned long) (ti), 1) | 68 | #define free_thread_info(ti) free_pages((unsigned long) (ti), 1) |
69 | #define get_thread_info(ti) get_task_struct((ti)->task) | ||
70 | #define put_thread_info(ti) put_task_struct((ti)->task) | ||
71 | 69 | ||
72 | #endif /* __ASSEMBLY__ */ | 70 | #endif /* __ASSEMBLY__ */ |
73 | 71 | ||
diff --git a/include/asm-sh64/tlbflush.h b/include/asm-sh64/tlbflush.h index 15c0719eecc3..e45beadc29ee 100644 --- a/include/asm-sh64/tlbflush.h +++ b/include/asm-sh64/tlbflush.h | |||
@@ -20,7 +20,7 @@ extern void flush_tlb_mm(struct mm_struct *mm); | |||
20 | extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, | 20 | extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, |
21 | unsigned long end); | 21 | unsigned long end); |
22 | extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long page); | 22 | extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long page); |
23 | extern inline void flush_tlb_pgtables(struct mm_struct *mm, | 23 | static inline void flush_tlb_pgtables(struct mm_struct *mm, |
24 | unsigned long start, unsigned long end) | 24 | unsigned long start, unsigned long end) |
25 | { | 25 | { |
26 | } | 26 | } |
diff --git a/include/asm-sh64/uaccess.h b/include/asm-sh64/uaccess.h index 56aa3cf0f273..f4936d8fa617 100644 --- a/include/asm-sh64/uaccess.h +++ b/include/asm-sh64/uaccess.h | |||
@@ -287,7 +287,7 @@ __sfu_res = __strncpy_from_user((unsigned long) (dest), __sfu_src, __sfu_count); | |||
287 | */ | 287 | */ |
288 | extern long __strnlen_user(const char *__s, long __n); | 288 | extern long __strnlen_user(const char *__s, long __n); |
289 | 289 | ||
290 | extern __inline__ long strnlen_user(const char *s, long n) | 290 | static inline long strnlen_user(const char *s, long n) |
291 | { | 291 | { |
292 | if (!__addr_ok(s)) | 292 | if (!__addr_ok(s)) |
293 | return 0; | 293 | return 0; |
diff --git a/include/asm-sparc/system.h b/include/asm-sparc/system.h index 1f6b71f9e1b6..58dd162927bb 100644 --- a/include/asm-sparc/system.h +++ b/include/asm-sparc/system.h | |||
@@ -155,7 +155,7 @@ extern void fpsave(unsigned long *fpregs, unsigned long *fsr, | |||
155 | "here:\n" \ | 155 | "here:\n" \ |
156 | : "=&r" (last) \ | 156 | : "=&r" (last) \ |
157 | : "r" (&(current_set[hard_smp_processor_id()])), \ | 157 | : "r" (&(current_set[hard_smp_processor_id()])), \ |
158 | "r" ((next)->thread_info), \ | 158 | "r" (task_thread_info(next)), \ |
159 | "i" (TI_KPSR), \ | 159 | "i" (TI_KPSR), \ |
160 | "i" (TI_KSP), \ | 160 | "i" (TI_KSP), \ |
161 | "i" (TI_TASK) \ | 161 | "i" (TI_TASK) \ |
@@ -166,6 +166,16 @@ extern void fpsave(unsigned long *fpregs, unsigned long *fsr, | |||
166 | } while(0) | 166 | } while(0) |
167 | 167 | ||
168 | /* | 168 | /* |
169 | * On SMP systems, when the scheduler does migration-cost autodetection, | ||
170 | * it needs a way to flush as much of the CPU's caches as possible. | ||
171 | * | ||
172 | * TODO: fill this in! | ||
173 | */ | ||
174 | static inline void sched_cacheflush(void) | ||
175 | { | ||
176 | } | ||
177 | |||
178 | /* | ||
169 | * Changing the IRQ level on the Sparc. | 179 | * Changing the IRQ level on the Sparc. |
170 | */ | 180 | */ |
171 | extern void local_irq_restore(unsigned long); | 181 | extern void local_irq_restore(unsigned long); |
diff --git a/include/asm-sparc/thread_info.h b/include/asm-sparc/thread_info.h index ff6ccb3d24c6..65f060b040ab 100644 --- a/include/asm-sparc/thread_info.h +++ b/include/asm-sparc/thread_info.h | |||
@@ -92,9 +92,6 @@ BTFIXUPDEF_CALL(struct thread_info *, alloc_thread_info, void) | |||
92 | BTFIXUPDEF_CALL(void, free_thread_info, struct thread_info *) | 92 | BTFIXUPDEF_CALL(void, free_thread_info, struct thread_info *) |
93 | #define free_thread_info(ti) BTFIXUP_CALL(free_thread_info)(ti) | 93 | #define free_thread_info(ti) BTFIXUP_CALL(free_thread_info)(ti) |
94 | 94 | ||
95 | #define get_thread_info(ti) get_task_struct((ti)->task) | ||
96 | #define put_thread_info(ti) put_task_struct((ti)->task) | ||
97 | |||
98 | #endif /* __ASSEMBLY__ */ | 95 | #endif /* __ASSEMBLY__ */ |
99 | 96 | ||
100 | /* | 97 | /* |
diff --git a/include/asm-sparc64/elf.h b/include/asm-sparc64/elf.h index 91458118277e..69539a8ab833 100644 --- a/include/asm-sparc64/elf.h +++ b/include/asm-sparc64/elf.h | |||
@@ -119,7 +119,7 @@ typedef struct { | |||
119 | #endif | 119 | #endif |
120 | 120 | ||
121 | #define ELF_CORE_COPY_TASK_REGS(__tsk, __elf_regs) \ | 121 | #define ELF_CORE_COPY_TASK_REGS(__tsk, __elf_regs) \ |
122 | ({ ELF_CORE_COPY_REGS((*(__elf_regs)), (__tsk)->thread_info->kregs); 1; }) | 122 | ({ ELF_CORE_COPY_REGS((*(__elf_regs)), task_pt_regs(__tsk)); 1; }) |
123 | 123 | ||
124 | /* | 124 | /* |
125 | * This is used to ensure we don't load something for the wrong architecture. | 125 | * This is used to ensure we don't load something for the wrong architecture. |
diff --git a/include/asm-sparc64/kprobes.h b/include/asm-sparc64/kprobes.h index 7ba845320f5c..e4efe652b54b 100644 --- a/include/asm-sparc64/kprobes.h +++ b/include/asm-sparc64/kprobes.h | |||
@@ -12,6 +12,7 @@ typedef u32 kprobe_opcode_t; | |||
12 | #define MAX_INSN_SIZE 2 | 12 | #define MAX_INSN_SIZE 2 |
13 | 13 | ||
14 | #define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry | 14 | #define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry |
15 | #define arch_remove_kprobe(p) do {} while (0) | ||
15 | 16 | ||
16 | /* Architecture specific copy of original instruction*/ | 17 | /* Architecture specific copy of original instruction*/ |
17 | struct arch_specific_insn { | 18 | struct arch_specific_insn { |
@@ -38,15 +39,6 @@ struct kprobe_ctlblk { | |||
38 | struct prev_kprobe prev_kprobe; | 39 | struct prev_kprobe prev_kprobe; |
39 | }; | 40 | }; |
40 | 41 | ||
41 | #ifdef CONFIG_KPROBES | ||
42 | extern int kprobe_exceptions_notify(struct notifier_block *self, | 42 | extern int kprobe_exceptions_notify(struct notifier_block *self, |
43 | unsigned long val, void *data); | 43 | unsigned long val, void *data); |
44 | #else /* !CONFIG_KPROBES */ | ||
45 | static inline int kprobe_exceptions_notify(struct notifier_block *self, | ||
46 | unsigned long val, void *data) | ||
47 | { | ||
48 | return 0; | ||
49 | } | ||
50 | #endif | ||
51 | |||
52 | #endif /* _SPARC64_KPROBES_H */ | 44 | #endif /* _SPARC64_KPROBES_H */ |
diff --git a/include/asm-sparc64/mmu_context.h b/include/asm-sparc64/mmu_context.h index 08ba72d7722c..57ee7b306189 100644 --- a/include/asm-sparc64/mmu_context.h +++ b/include/asm-sparc64/mmu_context.h | |||
@@ -60,7 +60,7 @@ do { \ | |||
60 | register unsigned long pgd_cache asm("o4"); \ | 60 | register unsigned long pgd_cache asm("o4"); \ |
61 | paddr = __pa((__mm)->pgd); \ | 61 | paddr = __pa((__mm)->pgd); \ |
62 | pgd_cache = 0UL; \ | 62 | pgd_cache = 0UL; \ |
63 | if ((__tsk)->thread_info->flags & _TIF_32BIT) \ | 63 | if (task_thread_info(__tsk)->flags & _TIF_32BIT) \ |
64 | pgd_cache = get_pgd_cache((__mm)->pgd); \ | 64 | pgd_cache = get_pgd_cache((__mm)->pgd); \ |
65 | __asm__ __volatile__("wrpr %%g0, 0x494, %%pstate\n\t" \ | 65 | __asm__ __volatile__("wrpr %%g0, 0x494, %%pstate\n\t" \ |
66 | "mov %3, %%g4\n\t" \ | 66 | "mov %3, %%g4\n\t" \ |
diff --git a/include/asm-sparc64/processor.h b/include/asm-sparc64/processor.h index 3169f3e2237e..cd8d9b4c8658 100644 --- a/include/asm-sparc64/processor.h +++ b/include/asm-sparc64/processor.h | |||
@@ -186,8 +186,9 @@ extern pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); | |||
186 | 186 | ||
187 | extern unsigned long get_wchan(struct task_struct *task); | 187 | extern unsigned long get_wchan(struct task_struct *task); |
188 | 188 | ||
189 | #define KSTK_EIP(tsk) ((tsk)->thread_info->kregs->tpc) | 189 | #define task_pt_regs(tsk) (task_thread_info(tsk)->kregs) |
190 | #define KSTK_ESP(tsk) ((tsk)->thread_info->kregs->u_regs[UREG_FP]) | 190 | #define KSTK_EIP(tsk) (task_pt_regs(tsk)->tpc) |
191 | #define KSTK_ESP(tsk) (task_pt_regs(tsk)->u_regs[UREG_FP]) | ||
191 | 192 | ||
192 | #define cpu_relax() barrier() | 193 | #define cpu_relax() barrier() |
193 | 194 | ||
diff --git a/include/asm-sparc64/system.h b/include/asm-sparc64/system.h index 309f1466b6fa..af254e581834 100644 --- a/include/asm-sparc64/system.h +++ b/include/asm-sparc64/system.h | |||
@@ -208,7 +208,7 @@ do { if (test_thread_flag(TIF_PERFCTR)) { \ | |||
208 | /* If you are tempted to conditionalize the following */ \ | 208 | /* If you are tempted to conditionalize the following */ \ |
209 | /* so that ASI is only written if it changes, think again. */ \ | 209 | /* so that ASI is only written if it changes, think again. */ \ |
210 | __asm__ __volatile__("wr %%g0, %0, %%asi" \ | 210 | __asm__ __volatile__("wr %%g0, %0, %%asi" \ |
211 | : : "r" (__thread_flag_byte_ptr(next->thread_info)[TI_FLAG_BYTE_CURRENT_DS]));\ | 211 | : : "r" (__thread_flag_byte_ptr(task_thread_info(next))[TI_FLAG_BYTE_CURRENT_DS]));\ |
212 | __asm__ __volatile__( \ | 212 | __asm__ __volatile__( \ |
213 | "mov %%g4, %%g7\n\t" \ | 213 | "mov %%g4, %%g7\n\t" \ |
214 | "wrpr %%g0, 0x95, %%pstate\n\t" \ | 214 | "wrpr %%g0, 0x95, %%pstate\n\t" \ |
@@ -238,7 +238,7 @@ do { if (test_thread_flag(TIF_PERFCTR)) { \ | |||
238 | "b,a ret_from_syscall\n\t" \ | 238 | "b,a ret_from_syscall\n\t" \ |
239 | "1:\n\t" \ | 239 | "1:\n\t" \ |
240 | : "=&r" (last) \ | 240 | : "=&r" (last) \ |
241 | : "0" (next->thread_info), \ | 241 | : "0" (task_thread_info(next)), \ |
242 | "i" (TI_WSTATE), "i" (TI_KSP), "i" (TI_NEW_CHILD), \ | 242 | "i" (TI_WSTATE), "i" (TI_KSP), "i" (TI_NEW_CHILD), \ |
243 | "i" (TI_CWP), "i" (TI_TASK) \ | 243 | "i" (TI_CWP), "i" (TI_TASK) \ |
244 | : "cc", \ | 244 | : "cc", \ |
@@ -253,6 +253,16 @@ do { if (test_thread_flag(TIF_PERFCTR)) { \ | |||
253 | } \ | 253 | } \ |
254 | } while(0) | 254 | } while(0) |
255 | 255 | ||
256 | /* | ||
257 | * On SMP systems, when the scheduler does migration-cost autodetection, | ||
258 | * it needs a way to flush as much of the CPU's caches as possible. | ||
259 | * | ||
260 | * TODO: fill this in! | ||
261 | */ | ||
262 | static inline void sched_cacheflush(void) | ||
263 | { | ||
264 | } | ||
265 | |||
256 | static inline unsigned long xchg32(__volatile__ unsigned int *m, unsigned int val) | 266 | static inline unsigned long xchg32(__volatile__ unsigned int *m, unsigned int val) |
257 | { | 267 | { |
258 | unsigned long tmp1, tmp2; | 268 | unsigned long tmp1, tmp2; |
diff --git a/include/asm-um/processor-generic.h b/include/asm-um/processor-generic.h index 075771c371f6..da07a69ce82a 100644 --- a/include/asm-um/processor-generic.h +++ b/include/asm-um/processor-generic.h | |||
@@ -89,7 +89,6 @@ extern struct task_struct *alloc_task_struct(void); | |||
89 | 89 | ||
90 | extern void release_thread(struct task_struct *); | 90 | extern void release_thread(struct task_struct *); |
91 | extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); | 91 | extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); |
92 | extern void dump_thread(struct pt_regs *regs, struct user *u); | ||
93 | 92 | ||
94 | static inline void prepare_to_copy(struct task_struct *tsk) | 93 | static inline void prepare_to_copy(struct task_struct *tsk) |
95 | { | 94 | { |
diff --git a/include/asm-um/thread_info.h b/include/asm-um/thread_info.h index 97267f059ef5..705c71972c32 100644 --- a/include/asm-um/thread_info.h +++ b/include/asm-um/thread_info.h | |||
@@ -56,9 +56,6 @@ static inline struct thread_info *current_thread_info(void) | |||
56 | ((struct thread_info *) kmalloc(THREAD_SIZE, GFP_KERNEL)) | 56 | ((struct thread_info *) kmalloc(THREAD_SIZE, GFP_KERNEL)) |
57 | #define free_thread_info(ti) kfree(ti) | 57 | #define free_thread_info(ti) kfree(ti) |
58 | 58 | ||
59 | #define get_thread_info(ti) get_task_struct((ti)->task) | ||
60 | #define put_thread_info(ti) put_task_struct((ti)->task) | ||
61 | |||
62 | #endif | 59 | #endif |
63 | 60 | ||
64 | #define PREEMPT_ACTIVE 0x10000000 | 61 | #define PREEMPT_ACTIVE 0x10000000 |
diff --git a/include/asm-v850/ioctl.h b/include/asm-v850/ioctl.h index 1765df6c7b87..b279fe06dfe5 100644 --- a/include/asm-v850/ioctl.h +++ b/include/asm-v850/ioctl.h | |||
@@ -1,80 +1 @@ | |||
1 | /* $Id: ioctl.h,v 1.1 2002/09/28 14:58:41 gerg Exp $ | #include <asm-generic/ioctl.h> | |
2 | * | ||
3 | * linux/ioctl.h for Linux by H.H. Bergman. | ||
4 | */ | ||
5 | |||
6 | #ifndef _V850_IOCTL_H | ||
7 | #define _V850_IOCTL_H | ||
8 | |||
9 | /* ioctl command encoding: 32 bits total, command in lower 16 bits, | ||
10 | * size of the parameter structure in the lower 14 bits of the | ||
11 | * upper 16 bits. | ||
12 | * Encoding the size of the parameter structure in the ioctl request | ||
13 | * is useful for catching programs compiled with old versions | ||
14 | * and to avoid overwriting user space outside the user buffer area. | ||
15 | * The highest 2 bits are reserved for indicating the ``access mode''. | ||
16 | * NOTE: This limits the max parameter size to 16kB -1 ! | ||
17 | */ | ||
18 | |||
19 | /* | ||
20 | * I don't really have any idea about what this should look like, so | ||
21 | * for the time being, this is heavily based on the PC definitions. | ||
22 | */ | ||
23 | |||
24 | /* | ||
25 | * The following is for compatibility across the various Linux | ||
26 | * platforms. The i386 ioctl numbering scheme doesn't really enforce | ||
27 | * a type field. De facto, however, the top 8 bits of the lower 16 | ||
28 | * bits are indeed used as a type field, so we might just as well make | ||
29 | * this explicit here. Please be sure to use the decoding macros | ||
30 | * below from now on. | ||
31 | */ | ||
32 | #define _IOC_NRBITS 8 | ||
33 | #define _IOC_TYPEBITS 8 | ||
34 | #define _IOC_SIZEBITS 14 | ||
35 | #define _IOC_DIRBITS 2 | ||
36 | |||
37 | #define _IOC_NRMASK ((1 << _IOC_NRBITS)-1) | ||
38 | #define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1) | ||
39 | #define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1) | ||
40 | #define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1) | ||
41 | |||
42 | #define _IOC_NRSHIFT 0 | ||
43 | #define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS) | ||
44 | #define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS) | ||
45 | #define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS) | ||
46 | |||
47 | /* | ||
48 | * Direction bits. | ||
49 | */ | ||
50 | #define _IOC_NONE 0U | ||
51 | #define _IOC_WRITE 1U | ||
52 | #define _IOC_READ 2U | ||
53 | |||
54 | #define _IOC(dir,type,nr,size) \ | ||
55 | (((dir) << _IOC_DIRSHIFT) | \ | ||
56 | ((type) << _IOC_TYPESHIFT) | \ | ||
57 | ((nr) << _IOC_NRSHIFT) | \ | ||
58 | ((size) << _IOC_SIZESHIFT)) | ||
59 | |||
60 | /* used to create numbers */ | ||
61 | #define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0) | ||
62 | #define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size)) | ||
63 | #define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size)) | ||
64 | #define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size)) | ||
65 | |||
66 | /* used to decode ioctl numbers.. */ | ||
67 | #define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) | ||
68 | #define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK) | ||
69 | #define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK) | ||
70 | #define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK) | ||
71 | |||
72 | /* ...and for the drivers/sound files... */ | ||
73 | |||
74 | #define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT) | ||
75 | #define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT) | ||
76 | #define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT) | ||
77 | #define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT) | ||
78 | #define IOCSIZE_SHIFT (_IOC_SIZESHIFT) | ||
79 | |||
80 | #endif /* __V850_IOCTL_H__ */ | ||
diff --git a/include/asm-v850/processor.h b/include/asm-v850/processor.h index 98f929427d3d..2d31308935a0 100644 --- a/include/asm-v850/processor.h +++ b/include/asm-v850/processor.h | |||
@@ -98,10 +98,10 @@ unsigned long get_wchan (struct task_struct *p); | |||
98 | 98 | ||
99 | 99 | ||
100 | /* Return some info about the user process TASK. */ | 100 | /* Return some info about the user process TASK. */ |
101 | #define task_tos(task) ((unsigned long)(task)->thread_info + THREAD_SIZE) | 101 | #define task_tos(task) ((unsigned long)task_stack_page(task) + THREAD_SIZE) |
102 | #define task_regs(task) ((struct pt_regs *)task_tos (task) - 1) | 102 | #define task_pt_regs(task) ((struct pt_regs *)task_tos (task) - 1) |
103 | #define task_sp(task) (task_regs (task)->gpr[GPR_SP]) | 103 | #define task_sp(task) (task_pt_regs (task)->gpr[GPR_SP]) |
104 | #define task_pc(task) (task_regs (task)->pc) | 104 | #define task_pc(task) (task_pt_regs (task)->pc) |
105 | /* Grotty old names for some. */ | 105 | /* Grotty old names for some. */ |
106 | #define KSTK_EIP(task) task_pc (task) | 106 | #define KSTK_EIP(task) task_pc (task) |
107 | #define KSTK_ESP(task) task_sp (task) | 107 | #define KSTK_ESP(task) task_sp (task) |
diff --git a/include/asm-v850/thread_info.h b/include/asm-v850/thread_info.h index e4cfad94a553..82b8f2846207 100644 --- a/include/asm-v850/thread_info.h +++ b/include/asm-v850/thread_info.h | |||
@@ -58,8 +58,6 @@ struct thread_info { | |||
58 | #define alloc_thread_info(tsk) ((struct thread_info *) \ | 58 | #define alloc_thread_info(tsk) ((struct thread_info *) \ |
59 | __get_free_pages(GFP_KERNEL, 1)) | 59 | __get_free_pages(GFP_KERNEL, 1)) |
60 | #define free_thread_info(ti) free_pages((unsigned long) (ti), 1) | 60 | #define free_thread_info(ti) free_pages((unsigned long) (ti), 1) |
61 | #define get_thread_info(ti) get_task_struct((ti)->task) | ||
62 | #define put_thread_info(ti) put_task_struct((ti)->task) | ||
63 | 61 | ||
64 | #endif /* __ASSEMBLY__ */ | 62 | #endif /* __ASSEMBLY__ */ |
65 | 63 | ||
diff --git a/include/asm-x86_64/apic.h b/include/asm-x86_64/apic.h index 5647b7de1749..4f6a4dc455bb 100644 --- a/include/asm-x86_64/apic.h +++ b/include/asm-x86_64/apic.h | |||
@@ -42,11 +42,6 @@ static __inline void apic_write(unsigned long reg, unsigned int v) | |||
42 | *((volatile unsigned int *)(APIC_BASE+reg)) = v; | 42 | *((volatile unsigned int *)(APIC_BASE+reg)) = v; |
43 | } | 43 | } |
44 | 44 | ||
45 | static __inline void apic_write_atomic(unsigned long reg, unsigned int v) | ||
46 | { | ||
47 | xchg((volatile unsigned int *)(APIC_BASE+reg), v); | ||
48 | } | ||
49 | |||
50 | static __inline unsigned int apic_read(unsigned long reg) | 45 | static __inline unsigned int apic_read(unsigned long reg) |
51 | { | 46 | { |
52 | return *((volatile unsigned int *)(APIC_BASE+reg)); | 47 | return *((volatile unsigned int *)(APIC_BASE+reg)); |
@@ -57,10 +52,6 @@ static __inline__ void apic_wait_icr_idle(void) | |||
57 | while ( apic_read( APIC_ICR ) & APIC_ICR_BUSY ); | 52 | while ( apic_read( APIC_ICR ) & APIC_ICR_BUSY ); |
58 | } | 53 | } |
59 | 54 | ||
60 | #define FORCE_READ_AROUND_WRITE 0 | ||
61 | #define apic_read_around(x) | ||
62 | #define apic_write_around(x,y) apic_write((x),(y)) | ||
63 | |||
64 | static inline void ack_APIC_irq(void) | 55 | static inline void ack_APIC_irq(void) |
65 | { | 56 | { |
66 | /* | 57 | /* |
@@ -71,7 +62,7 @@ static inline void ack_APIC_irq(void) | |||
71 | */ | 62 | */ |
72 | 63 | ||
73 | /* Docs say use 0 for future compatibility */ | 64 | /* Docs say use 0 for future compatibility */ |
74 | apic_write_around(APIC_EOI, 0); | 65 | apic_write(APIC_EOI, 0); |
75 | } | 66 | } |
76 | 67 | ||
77 | extern int get_maxlvt (void); | 68 | extern int get_maxlvt (void); |
@@ -113,6 +104,12 @@ extern int disable_timer_pin_1; | |||
113 | 104 | ||
114 | extern void setup_threshold_lvt(unsigned long lvt_off); | 105 | extern void setup_threshold_lvt(unsigned long lvt_off); |
115 | 106 | ||
107 | void smp_send_timer_broadcast_ipi(void); | ||
108 | void switch_APIC_timer_to_ipi(void *cpumask); | ||
109 | void switch_ipi_to_APIC_timer(void *cpumask); | ||
110 | |||
111 | #define ARCH_APICTIMER_STOPS_ON_C3 1 | ||
112 | |||
116 | #endif /* CONFIG_X86_LOCAL_APIC */ | 113 | #endif /* CONFIG_X86_LOCAL_APIC */ |
117 | 114 | ||
118 | extern unsigned boot_cpu_id; | 115 | extern unsigned boot_cpu_id; |
diff --git a/include/asm-x86_64/apicdef.h b/include/asm-x86_64/apicdef.h index fb1c99ac669f..decaa2d540e8 100644 --- a/include/asm-x86_64/apicdef.h +++ b/include/asm-x86_64/apicdef.h | |||
@@ -13,6 +13,7 @@ | |||
13 | #define APIC_ID 0x20 | 13 | #define APIC_ID 0x20 |
14 | #define APIC_ID_MASK (0xFFu<<24) | 14 | #define APIC_ID_MASK (0xFFu<<24) |
15 | #define GET_APIC_ID(x) (((x)>>24)&0xFFu) | 15 | #define GET_APIC_ID(x) (((x)>>24)&0xFFu) |
16 | #define SET_APIC_ID(x) (((x)<<24)) | ||
16 | #define APIC_LVR 0x30 | 17 | #define APIC_LVR 0x30 |
17 | #define APIC_LVR_MASK 0xFF00FF | 18 | #define APIC_LVR_MASK 0xFF00FF |
18 | #define GET_APIC_VERSION(x) ((x)&0xFFu) | 19 | #define GET_APIC_VERSION(x) ((x)&0xFFu) |
diff --git a/include/asm-x86_64/atomic.h b/include/asm-x86_64/atomic.h index 6b540237a2f8..4b5cd553e772 100644 --- a/include/asm-x86_64/atomic.h +++ b/include/asm-x86_64/atomic.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define __ARCH_X86_64_ATOMIC__ | 2 | #define __ARCH_X86_64_ATOMIC__ |
3 | 3 | ||
4 | #include <linux/config.h> | 4 | #include <linux/config.h> |
5 | #include <asm/types.h> | ||
5 | 6 | ||
6 | /* atomic_t should be 32 bit signed type */ | 7 | /* atomic_t should be 32 bit signed type */ |
7 | 8 | ||
diff --git a/include/asm-x86_64/bitops.h b/include/asm-x86_64/bitops.h index a4d5d0909453..eb4df23e1e41 100644 --- a/include/asm-x86_64/bitops.h +++ b/include/asm-x86_64/bitops.h | |||
@@ -29,7 +29,7 @@ static __inline__ void set_bit(int nr, volatile void * addr) | |||
29 | { | 29 | { |
30 | __asm__ __volatile__( LOCK_PREFIX | 30 | __asm__ __volatile__( LOCK_PREFIX |
31 | "btsl %1,%0" | 31 | "btsl %1,%0" |
32 | :"=m" (ADDR) | 32 | :"+m" (ADDR) |
33 | :"dIr" (nr) : "memory"); | 33 | :"dIr" (nr) : "memory"); |
34 | } | 34 | } |
35 | 35 | ||
@@ -46,7 +46,7 @@ static __inline__ void __set_bit(int nr, volatile void * addr) | |||
46 | { | 46 | { |
47 | __asm__ volatile( | 47 | __asm__ volatile( |
48 | "btsl %1,%0" | 48 | "btsl %1,%0" |
49 | :"=m" (ADDR) | 49 | :"+m" (ADDR) |
50 | :"dIr" (nr) : "memory"); | 50 | :"dIr" (nr) : "memory"); |
51 | } | 51 | } |
52 | 52 | ||
@@ -64,7 +64,7 @@ static __inline__ void clear_bit(int nr, volatile void * addr) | |||
64 | { | 64 | { |
65 | __asm__ __volatile__( LOCK_PREFIX | 65 | __asm__ __volatile__( LOCK_PREFIX |
66 | "btrl %1,%0" | 66 | "btrl %1,%0" |
67 | :"=m" (ADDR) | 67 | :"+m" (ADDR) |
68 | :"dIr" (nr)); | 68 | :"dIr" (nr)); |
69 | } | 69 | } |
70 | 70 | ||
@@ -72,7 +72,7 @@ static __inline__ void __clear_bit(int nr, volatile void * addr) | |||
72 | { | 72 | { |
73 | __asm__ __volatile__( | 73 | __asm__ __volatile__( |
74 | "btrl %1,%0" | 74 | "btrl %1,%0" |
75 | :"=m" (ADDR) | 75 | :"+m" (ADDR) |
76 | :"dIr" (nr)); | 76 | :"dIr" (nr)); |
77 | } | 77 | } |
78 | 78 | ||
@@ -92,7 +92,7 @@ static __inline__ void __change_bit(int nr, volatile void * addr) | |||
92 | { | 92 | { |
93 | __asm__ __volatile__( | 93 | __asm__ __volatile__( |
94 | "btcl %1,%0" | 94 | "btcl %1,%0" |
95 | :"=m" (ADDR) | 95 | :"+m" (ADDR) |
96 | :"dIr" (nr)); | 96 | :"dIr" (nr)); |
97 | } | 97 | } |
98 | 98 | ||
@@ -109,7 +109,7 @@ static __inline__ void change_bit(int nr, volatile void * addr) | |||
109 | { | 109 | { |
110 | __asm__ __volatile__( LOCK_PREFIX | 110 | __asm__ __volatile__( LOCK_PREFIX |
111 | "btcl %1,%0" | 111 | "btcl %1,%0" |
112 | :"=m" (ADDR) | 112 | :"+m" (ADDR) |
113 | :"dIr" (nr)); | 113 | :"dIr" (nr)); |
114 | } | 114 | } |
115 | 115 | ||
@@ -127,7 +127,7 @@ static __inline__ int test_and_set_bit(int nr, volatile void * addr) | |||
127 | 127 | ||
128 | __asm__ __volatile__( LOCK_PREFIX | 128 | __asm__ __volatile__( LOCK_PREFIX |
129 | "btsl %2,%1\n\tsbbl %0,%0" | 129 | "btsl %2,%1\n\tsbbl %0,%0" |
130 | :"=r" (oldbit),"=m" (ADDR) | 130 | :"=r" (oldbit),"+m" (ADDR) |
131 | :"dIr" (nr) : "memory"); | 131 | :"dIr" (nr) : "memory"); |
132 | return oldbit; | 132 | return oldbit; |
133 | } | 133 | } |
@@ -147,7 +147,7 @@ static __inline__ int __test_and_set_bit(int nr, volatile void * addr) | |||
147 | 147 | ||
148 | __asm__( | 148 | __asm__( |
149 | "btsl %2,%1\n\tsbbl %0,%0" | 149 | "btsl %2,%1\n\tsbbl %0,%0" |
150 | :"=r" (oldbit),"=m" (ADDR) | 150 | :"=r" (oldbit),"+m" (ADDR) |
151 | :"dIr" (nr)); | 151 | :"dIr" (nr)); |
152 | return oldbit; | 152 | return oldbit; |
153 | } | 153 | } |
@@ -166,7 +166,7 @@ static __inline__ int test_and_clear_bit(int nr, volatile void * addr) | |||
166 | 166 | ||
167 | __asm__ __volatile__( LOCK_PREFIX | 167 | __asm__ __volatile__( LOCK_PREFIX |
168 | "btrl %2,%1\n\tsbbl %0,%0" | 168 | "btrl %2,%1\n\tsbbl %0,%0" |
169 | :"=r" (oldbit),"=m" (ADDR) | 169 | :"=r" (oldbit),"+m" (ADDR) |
170 | :"dIr" (nr) : "memory"); | 170 | :"dIr" (nr) : "memory"); |
171 | return oldbit; | 171 | return oldbit; |
172 | } | 172 | } |
@@ -186,7 +186,7 @@ static __inline__ int __test_and_clear_bit(int nr, volatile void * addr) | |||
186 | 186 | ||
187 | __asm__( | 187 | __asm__( |
188 | "btrl %2,%1\n\tsbbl %0,%0" | 188 | "btrl %2,%1\n\tsbbl %0,%0" |
189 | :"=r" (oldbit),"=m" (ADDR) | 189 | :"=r" (oldbit),"+m" (ADDR) |
190 | :"dIr" (nr)); | 190 | :"dIr" (nr)); |
191 | return oldbit; | 191 | return oldbit; |
192 | } | 192 | } |
@@ -198,7 +198,7 @@ static __inline__ int __test_and_change_bit(int nr, volatile void * addr) | |||
198 | 198 | ||
199 | __asm__ __volatile__( | 199 | __asm__ __volatile__( |
200 | "btcl %2,%1\n\tsbbl %0,%0" | 200 | "btcl %2,%1\n\tsbbl %0,%0" |
201 | :"=r" (oldbit),"=m" (ADDR) | 201 | :"=r" (oldbit),"+m" (ADDR) |
202 | :"dIr" (nr) : "memory"); | 202 | :"dIr" (nr) : "memory"); |
203 | return oldbit; | 203 | return oldbit; |
204 | } | 204 | } |
@@ -217,7 +217,7 @@ static __inline__ int test_and_change_bit(int nr, volatile void * addr) | |||
217 | 217 | ||
218 | __asm__ __volatile__( LOCK_PREFIX | 218 | __asm__ __volatile__( LOCK_PREFIX |
219 | "btcl %2,%1\n\tsbbl %0,%0" | 219 | "btcl %2,%1\n\tsbbl %0,%0" |
220 | :"=r" (oldbit),"=m" (ADDR) | 220 | :"=r" (oldbit),"+m" (ADDR) |
221 | :"dIr" (nr) : "memory"); | 221 | :"dIr" (nr) : "memory"); |
222 | return oldbit; | 222 | return oldbit; |
223 | } | 223 | } |
@@ -397,6 +397,22 @@ static __inline__ int fls64(__u64 x) | |||
397 | } | 397 | } |
398 | 398 | ||
399 | /** | 399 | /** |
400 | * fls - find last bit set | ||
401 | * @x: the word to search | ||
402 | * | ||
403 | * This is defined the same way as ffs. | ||
404 | */ | ||
405 | static __inline__ int fls(int x) | ||
406 | { | ||
407 | int r; | ||
408 | |||
409 | __asm__("bsrl %1,%0\n\t" | ||
410 | "cmovzl %2,%0" | ||
411 | : "=&r" (r) : "rm" (x), "rm" (-1)); | ||
412 | return r+1; | ||
413 | } | ||
414 | |||
415 | /** | ||
400 | * hweightN - returns the hamming weight of a N-bit word | 416 | * hweightN - returns the hamming weight of a N-bit word |
401 | * @x: the word to weigh | 417 | * @x: the word to weigh |
402 | * | 418 | * |
@@ -434,9 +450,6 @@ static __inline__ int fls64(__u64 x) | |||
434 | #define minix_find_first_zero_bit(addr,size) \ | 450 | #define minix_find_first_zero_bit(addr,size) \ |
435 | find_first_zero_bit((void*)addr,size) | 451 | find_first_zero_bit((void*)addr,size) |
436 | 452 | ||
437 | /* find last set bit */ | ||
438 | #define fls(x) generic_fls(x) | ||
439 | |||
440 | #endif /* __KERNEL__ */ | 453 | #endif /* __KERNEL__ */ |
441 | 454 | ||
442 | #endif /* _X86_64_BITOPS_H */ | 455 | #endif /* _X86_64_BITOPS_H */ |
diff --git a/include/asm-x86_64/cache.h b/include/asm-x86_64/cache.h index b4a2401de77b..263f0a211ed7 100644 --- a/include/asm-x86_64/cache.h +++ b/include/asm-x86_64/cache.h | |||
@@ -10,4 +10,16 @@ | |||
10 | #define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT) | 10 | #define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT) |
11 | #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) | 11 | #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) |
12 | 12 | ||
13 | #ifdef CONFIG_X86_VSMP | ||
14 | |||
15 | /* vSMP Internode cacheline shift */ | ||
16 | #define INTERNODE_CACHE_SHIFT (12) | ||
17 | #ifdef CONFIG_SMP | ||
18 | #define __cacheline_aligned_in_smp \ | ||
19 | __attribute__((__aligned__(1 << (INTERNODE_CACHE_SHIFT)))) \ | ||
20 | __attribute__((__section__(".data.page_aligned"))) | ||
21 | #endif | ||
22 | |||
23 | #endif | ||
24 | |||
13 | #endif | 25 | #endif |
diff --git a/include/asm-x86_64/compat.h b/include/asm-x86_64/compat.h index f0155c38f639..b37ab8218ef0 100644 --- a/include/asm-x86_64/compat.h +++ b/include/asm-x86_64/compat.h | |||
@@ -198,8 +198,13 @@ static inline compat_uptr_t ptr_to_compat(void __user *uptr) | |||
198 | 198 | ||
199 | static __inline__ void __user *compat_alloc_user_space(long len) | 199 | static __inline__ void __user *compat_alloc_user_space(long len) |
200 | { | 200 | { |
201 | struct pt_regs *regs = (void *)current->thread.rsp0 - sizeof(struct pt_regs); | 201 | struct pt_regs *regs = task_pt_regs(current); |
202 | return (void __user *)regs->rsp - len; | 202 | return (void __user *)regs->rsp - len; |
203 | } | 203 | } |
204 | 204 | ||
205 | static inline int is_compat_task(void) | ||
206 | { | ||
207 | return current_thread_info()->status & TS_COMPAT; | ||
208 | } | ||
209 | |||
205 | #endif /* _ASM_X86_64_COMPAT_H */ | 210 | #endif /* _ASM_X86_64_COMPAT_H */ |
diff --git a/include/asm-x86_64/cpufeature.h b/include/asm-x86_64/cpufeature.h index aea308c65709..41c0ac8559be 100644 --- a/include/asm-x86_64/cpufeature.h +++ b/include/asm-x86_64/cpufeature.h | |||
@@ -61,8 +61,9 @@ | |||
61 | #define X86_FEATURE_K6_MTRR (3*32+ 1) /* AMD K6 nonstandard MTRRs */ | 61 | #define X86_FEATURE_K6_MTRR (3*32+ 1) /* AMD K6 nonstandard MTRRs */ |
62 | #define X86_FEATURE_CYRIX_ARR (3*32+ 2) /* Cyrix ARRs (= MTRRs) */ | 62 | #define X86_FEATURE_CYRIX_ARR (3*32+ 2) /* Cyrix ARRs (= MTRRs) */ |
63 | #define X86_FEATURE_CENTAUR_MCR (3*32+ 3) /* Centaur MCRs (= MTRRs) */ | 63 | #define X86_FEATURE_CENTAUR_MCR (3*32+ 3) /* Centaur MCRs (= MTRRs) */ |
64 | #define X86_FEATURE_K8_C (3*32+ 4) /* C stepping K8 */ | 64 | /* 4 free */ |
65 | #define X86_FEATURE_CONSTANT_TSC (3*32+5) /* TSC runs at constant rate */ | 65 | #define X86_FEATURE_CONSTANT_TSC (3*32+5) /* TSC runs at constant rate */ |
66 | #define X86_FEATURE_SYNC_RDTSC (3*32+6) /* RDTSC syncs CPU core */ | ||
66 | 67 | ||
67 | /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ | 68 | /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ |
68 | #define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */ | 69 | #define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */ |
diff --git a/include/asm-x86_64/desc.h b/include/asm-x86_64/desc.h index 33764869387b..eb7723a46790 100644 --- a/include/asm-x86_64/desc.h +++ b/include/asm-x86_64/desc.h | |||
@@ -25,7 +25,7 @@ struct n_desc_struct { | |||
25 | unsigned int a,b; | 25 | unsigned int a,b; |
26 | }; | 26 | }; |
27 | 27 | ||
28 | extern struct desc_struct cpu_gdt_table[NR_CPUS][GDT_ENTRIES]; | 28 | extern struct desc_struct cpu_gdt_table[GDT_ENTRIES]; |
29 | 29 | ||
30 | enum { | 30 | enum { |
31 | GATE_INTERRUPT = 0xE, | 31 | GATE_INTERRUPT = 0xE, |
@@ -79,6 +79,9 @@ extern struct desc_struct default_ldt[]; | |||
79 | extern struct gate_struct idt_table[]; | 79 | extern struct gate_struct idt_table[]; |
80 | extern struct desc_ptr cpu_gdt_descr[]; | 80 | extern struct desc_ptr cpu_gdt_descr[]; |
81 | 81 | ||
82 | /* the cpu gdt accessor */ | ||
83 | #define cpu_gdt(_cpu) ((struct desc_struct *)cpu_gdt_descr[_cpu].address) | ||
84 | |||
82 | static inline void _set_gate(void *adr, unsigned type, unsigned long func, unsigned dpl, unsigned ist) | 85 | static inline void _set_gate(void *adr, unsigned type, unsigned long func, unsigned dpl, unsigned ist) |
83 | { | 86 | { |
84 | struct gate_struct s; | 87 | struct gate_struct s; |
@@ -114,6 +117,11 @@ static inline void set_system_gate(int nr, void *func) | |||
114 | _set_gate(&idt_table[nr], GATE_INTERRUPT, (unsigned long) func, 3, 0); | 117 | _set_gate(&idt_table[nr], GATE_INTERRUPT, (unsigned long) func, 3, 0); |
115 | } | 118 | } |
116 | 119 | ||
120 | static inline void set_system_gate_ist(int nr, void *func, unsigned ist) | ||
121 | { | ||
122 | _set_gate(&idt_table[nr], GATE_INTERRUPT, (unsigned long) func, 3, ist); | ||
123 | } | ||
124 | |||
117 | static inline void set_tssldt_descriptor(void *ptr, unsigned long tss, unsigned type, | 125 | static inline void set_tssldt_descriptor(void *ptr, unsigned long tss, unsigned type, |
118 | unsigned size) | 126 | unsigned size) |
119 | { | 127 | { |
@@ -139,20 +147,20 @@ static inline void set_tss_desc(unsigned cpu, void *addr) | |||
139 | * -1? seg base+limit should be pointing to the address of the | 147 | * -1? seg base+limit should be pointing to the address of the |
140 | * last valid byte | 148 | * last valid byte |
141 | */ | 149 | */ |
142 | set_tssldt_descriptor(&cpu_gdt_table[cpu][GDT_ENTRY_TSS], | 150 | set_tssldt_descriptor(&cpu_gdt(cpu)[GDT_ENTRY_TSS], |
143 | (unsigned long)addr, DESC_TSS, | 151 | (unsigned long)addr, DESC_TSS, |
144 | IO_BITMAP_OFFSET + IO_BITMAP_BYTES + sizeof(unsigned long) - 1); | 152 | IO_BITMAP_OFFSET + IO_BITMAP_BYTES + sizeof(unsigned long) - 1); |
145 | } | 153 | } |
146 | 154 | ||
147 | static inline void set_ldt_desc(unsigned cpu, void *addr, int size) | 155 | static inline void set_ldt_desc(unsigned cpu, void *addr, int size) |
148 | { | 156 | { |
149 | set_tssldt_descriptor(&cpu_gdt_table[cpu][GDT_ENTRY_LDT], (unsigned long)addr, | 157 | set_tssldt_descriptor(&cpu_gdt(cpu)[GDT_ENTRY_LDT], (unsigned long)addr, |
150 | DESC_LDT, size * 8 - 1); | 158 | DESC_LDT, size * 8 - 1); |
151 | } | 159 | } |
152 | 160 | ||
153 | static inline void set_seg_base(unsigned cpu, int entry, void *base) | 161 | static inline void set_seg_base(unsigned cpu, int entry, void *base) |
154 | { | 162 | { |
155 | struct desc_struct *d = &cpu_gdt_table[cpu][entry]; | 163 | struct desc_struct *d = &cpu_gdt(cpu)[entry]; |
156 | u32 addr = (u32)(u64)base; | 164 | u32 addr = (u32)(u64)base; |
157 | BUG_ON((u64)base >> 32); | 165 | BUG_ON((u64)base >> 32); |
158 | d->base0 = addr & 0xffff; | 166 | d->base0 = addr & 0xffff; |
@@ -194,7 +202,7 @@ static inline void set_seg_base(unsigned cpu, int entry, void *base) | |||
194 | 202 | ||
195 | static inline void load_TLS(struct thread_struct *t, unsigned int cpu) | 203 | static inline void load_TLS(struct thread_struct *t, unsigned int cpu) |
196 | { | 204 | { |
197 | u64 *gdt = (u64 *)(cpu_gdt_table[cpu] + GDT_ENTRY_TLS_MIN); | 205 | u64 *gdt = (u64 *)(cpu_gdt(cpu) + GDT_ENTRY_TLS_MIN); |
198 | gdt[0] = t->tls_array[0]; | 206 | gdt[0] = t->tls_array[0]; |
199 | gdt[1] = t->tls_array[1]; | 207 | gdt[1] = t->tls_array[1]; |
200 | gdt[2] = t->tls_array[2]; | 208 | gdt[2] = t->tls_array[2]; |
diff --git a/include/asm-x86_64/dma-mapping.h b/include/asm-x86_64/dma-mapping.h index 36d16dfbac88..49a81a66516e 100644 --- a/include/asm-x86_64/dma-mapping.h +++ b/include/asm-x86_64/dma-mapping.h | |||
@@ -12,155 +12,176 @@ | |||
12 | #include <asm/io.h> | 12 | #include <asm/io.h> |
13 | #include <asm/swiotlb.h> | 13 | #include <asm/swiotlb.h> |
14 | 14 | ||
15 | extern dma_addr_t bad_dma_address; | 15 | struct dma_mapping_ops { |
16 | #define dma_mapping_error(x) \ | 16 | int (*mapping_error)(dma_addr_t dma_addr); |
17 | (swiotlb ? swiotlb_dma_mapping_error(x) : ((x) == bad_dma_address)) | 17 | void* (*alloc_coherent)(struct device *dev, size_t size, |
18 | 18 | dma_addr_t *dma_handle, gfp_t gfp); | |
19 | void *dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, | 19 | void (*free_coherent)(struct device *dev, size_t size, |
20 | gfp_t gfp); | 20 | void *vaddr, dma_addr_t dma_handle); |
21 | void dma_free_coherent(struct device *dev, size_t size, void *vaddr, | 21 | dma_addr_t (*map_single)(struct device *hwdev, void *ptr, |
22 | dma_addr_t dma_handle); | 22 | size_t size, int direction); |
23 | /* like map_single, but doesn't check the device mask */ | ||
24 | dma_addr_t (*map_simple)(struct device *hwdev, char *ptr, | ||
25 | size_t size, int direction); | ||
26 | void (*unmap_single)(struct device *dev, dma_addr_t addr, | ||
27 | size_t size, int direction); | ||
28 | void (*sync_single_for_cpu)(struct device *hwdev, | ||
29 | dma_addr_t dma_handle, size_t size, | ||
30 | int direction); | ||
31 | void (*sync_single_for_device)(struct device *hwdev, | ||
32 | dma_addr_t dma_handle, size_t size, | ||
33 | int direction); | ||
34 | void (*sync_single_range_for_cpu)(struct device *hwdev, | ||
35 | dma_addr_t dma_handle, unsigned long offset, | ||
36 | size_t size, int direction); | ||
37 | void (*sync_single_range_for_device)(struct device *hwdev, | ||
38 | dma_addr_t dma_handle, unsigned long offset, | ||
39 | size_t size, int direction); | ||
40 | void (*sync_sg_for_cpu)(struct device *hwdev, | ||
41 | struct scatterlist *sg, int nelems, | ||
42 | int direction); | ||
43 | void (*sync_sg_for_device)(struct device *hwdev, | ||
44 | struct scatterlist *sg, int nelems, | ||
45 | int direction); | ||
46 | int (*map_sg)(struct device *hwdev, struct scatterlist *sg, | ||
47 | int nents, int direction); | ||
48 | void (*unmap_sg)(struct device *hwdev, | ||
49 | struct scatterlist *sg, int nents, | ||
50 | int direction); | ||
51 | int (*dma_supported)(struct device *hwdev, u64 mask); | ||
52 | int is_phys; | ||
53 | }; | ||
23 | 54 | ||
24 | #ifdef CONFIG_GART_IOMMU | 55 | extern dma_addr_t bad_dma_address; |
56 | extern struct dma_mapping_ops* dma_ops; | ||
57 | extern int iommu_merge; | ||
25 | 58 | ||
26 | extern dma_addr_t dma_map_single(struct device *hwdev, void *ptr, size_t size, | 59 | static inline int dma_mapping_error(dma_addr_t dma_addr) |
27 | int direction); | 60 | { |
28 | extern void dma_unmap_single(struct device *dev, dma_addr_t addr,size_t size, | 61 | if (dma_ops->mapping_error) |
29 | int direction); | 62 | return dma_ops->mapping_error(dma_addr); |
30 | 63 | ||
31 | #else | 64 | return (dma_addr == bad_dma_address); |
65 | } | ||
32 | 66 | ||
33 | /* No IOMMU */ | 67 | extern void *dma_alloc_coherent(struct device *dev, size_t size, |
68 | dma_addr_t *dma_handle, gfp_t gfp); | ||
69 | extern void dma_free_coherent(struct device *dev, size_t size, void *vaddr, | ||
70 | dma_addr_t dma_handle); | ||
34 | 71 | ||
35 | static inline dma_addr_t dma_map_single(struct device *hwdev, void *ptr, | 72 | static inline dma_addr_t |
36 | size_t size, int direction) | 73 | dma_map_single(struct device *hwdev, void *ptr, size_t size, |
74 | int direction) | ||
37 | { | 75 | { |
38 | dma_addr_t addr; | 76 | return dma_ops->map_single(hwdev, ptr, size, direction); |
39 | |||
40 | if (direction == DMA_NONE) | ||
41 | out_of_line_bug(); | ||
42 | addr = virt_to_bus(ptr); | ||
43 | |||
44 | if ((addr+size) & ~*hwdev->dma_mask) | ||
45 | out_of_line_bug(); | ||
46 | return addr; | ||
47 | } | 77 | } |
48 | 78 | ||
49 | static inline void dma_unmap_single(struct device *hwdev, dma_addr_t dma_addr, | 79 | static inline void |
50 | size_t size, int direction) | 80 | dma_unmap_single(struct device *dev, dma_addr_t addr,size_t size, |
81 | int direction) | ||
51 | { | 82 | { |
52 | if (direction == DMA_NONE) | 83 | dma_ops->unmap_single(dev, addr, size, direction); |
53 | out_of_line_bug(); | ||
54 | /* Nothing to do */ | ||
55 | } | 84 | } |
56 | 85 | ||
57 | #endif | ||
58 | |||
59 | #define dma_map_page(dev,page,offset,size,dir) \ | 86 | #define dma_map_page(dev,page,offset,size,dir) \ |
60 | dma_map_single((dev), page_address(page)+(offset), (size), (dir)) | 87 | dma_map_single((dev), page_address(page)+(offset), (size), (dir)) |
61 | 88 | ||
62 | static inline void dma_sync_single_for_cpu(struct device *hwdev, | 89 | #define dma_unmap_page dma_unmap_single |
63 | dma_addr_t dma_handle, | ||
64 | size_t size, int direction) | ||
65 | { | ||
66 | if (direction == DMA_NONE) | ||
67 | out_of_line_bug(); | ||
68 | |||
69 | if (swiotlb) | ||
70 | return swiotlb_sync_single_for_cpu(hwdev,dma_handle,size,direction); | ||
71 | 90 | ||
91 | static inline void | ||
92 | dma_sync_single_for_cpu(struct device *hwdev, dma_addr_t dma_handle, | ||
93 | size_t size, int direction) | ||
94 | { | ||
95 | if (dma_ops->sync_single_for_cpu) | ||
96 | dma_ops->sync_single_for_cpu(hwdev, dma_handle, size, | ||
97 | direction); | ||
72 | flush_write_buffers(); | 98 | flush_write_buffers(); |
73 | } | 99 | } |
74 | 100 | ||
75 | static inline void dma_sync_single_for_device(struct device *hwdev, | 101 | static inline void |
76 | dma_addr_t dma_handle, | 102 | dma_sync_single_for_device(struct device *hwdev, dma_addr_t dma_handle, |
77 | size_t size, int direction) | 103 | size_t size, int direction) |
78 | { | 104 | { |
79 | if (direction == DMA_NONE) | 105 | if (dma_ops->sync_single_for_device) |
80 | out_of_line_bug(); | 106 | dma_ops->sync_single_for_device(hwdev, dma_handle, size, |
81 | 107 | direction); | |
82 | if (swiotlb) | ||
83 | return swiotlb_sync_single_for_device(hwdev,dma_handle,size,direction); | ||
84 | |||
85 | flush_write_buffers(); | 108 | flush_write_buffers(); |
86 | } | 109 | } |
87 | 110 | ||
88 | static inline void dma_sync_single_range_for_cpu(struct device *hwdev, | 111 | static inline void |
89 | dma_addr_t dma_handle, | 112 | dma_sync_single_range_for_cpu(struct device *hwdev, dma_addr_t dma_handle, |
90 | unsigned long offset, | 113 | unsigned long offset, size_t size, int direction) |
91 | size_t size, int direction) | ||
92 | { | 114 | { |
93 | if (direction == DMA_NONE) | 115 | if (dma_ops->sync_single_range_for_cpu) { |
94 | out_of_line_bug(); | 116 | dma_ops->sync_single_range_for_cpu(hwdev, dma_handle, offset, size, direction); |
95 | 117 | } | |
96 | if (swiotlb) | ||
97 | return swiotlb_sync_single_range_for_cpu(hwdev,dma_handle,offset,size,direction); | ||
98 | 118 | ||
99 | flush_write_buffers(); | 119 | flush_write_buffers(); |
100 | } | 120 | } |
101 | 121 | ||
102 | static inline void dma_sync_single_range_for_device(struct device *hwdev, | 122 | static inline void |
103 | dma_addr_t dma_handle, | 123 | dma_sync_single_range_for_device(struct device *hwdev, dma_addr_t dma_handle, |
104 | unsigned long offset, | 124 | unsigned long offset, size_t size, int direction) |
105 | size_t size, int direction) | ||
106 | { | 125 | { |
107 | if (direction == DMA_NONE) | 126 | if (dma_ops->sync_single_range_for_device) |
108 | out_of_line_bug(); | 127 | dma_ops->sync_single_range_for_device(hwdev, dma_handle, |
109 | 128 | offset, size, direction); | |
110 | if (swiotlb) | ||
111 | return swiotlb_sync_single_range_for_device(hwdev,dma_handle,offset,size,direction); | ||
112 | 129 | ||
113 | flush_write_buffers(); | 130 | flush_write_buffers(); |
114 | } | 131 | } |
115 | 132 | ||
116 | static inline void dma_sync_sg_for_cpu(struct device *hwdev, | 133 | static inline void |
117 | struct scatterlist *sg, | 134 | dma_sync_sg_for_cpu(struct device *hwdev, struct scatterlist *sg, |
118 | int nelems, int direction) | 135 | int nelems, int direction) |
119 | { | 136 | { |
120 | if (direction == DMA_NONE) | 137 | if (dma_ops->sync_sg_for_cpu) |
121 | out_of_line_bug(); | 138 | dma_ops->sync_sg_for_cpu(hwdev, sg, nelems, direction); |
122 | |||
123 | if (swiotlb) | ||
124 | return swiotlb_sync_sg_for_cpu(hwdev,sg,nelems,direction); | ||
125 | |||
126 | flush_write_buffers(); | 139 | flush_write_buffers(); |
127 | } | 140 | } |
128 | 141 | ||
129 | static inline void dma_sync_sg_for_device(struct device *hwdev, | 142 | static inline void |
130 | struct scatterlist *sg, | 143 | dma_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg, |
131 | int nelems, int direction) | 144 | int nelems, int direction) |
132 | { | 145 | { |
133 | if (direction == DMA_NONE) | 146 | if (dma_ops->sync_sg_for_device) { |
134 | out_of_line_bug(); | 147 | dma_ops->sync_sg_for_device(hwdev, sg, nelems, direction); |
135 | 148 | } | |
136 | if (swiotlb) | ||
137 | return swiotlb_sync_sg_for_device(hwdev,sg,nelems,direction); | ||
138 | 149 | ||
139 | flush_write_buffers(); | 150 | flush_write_buffers(); |
140 | } | 151 | } |
141 | 152 | ||
142 | extern int dma_map_sg(struct device *hwdev, struct scatterlist *sg, | 153 | static inline int |
143 | int nents, int direction); | 154 | dma_map_sg(struct device *hwdev, struct scatterlist *sg, int nents, int direction) |
144 | extern void dma_unmap_sg(struct device *hwdev, struct scatterlist *sg, | 155 | { |
145 | int nents, int direction); | 156 | return dma_ops->map_sg(hwdev, sg, nents, direction); |
157 | } | ||
146 | 158 | ||
147 | #define dma_unmap_page dma_unmap_single | 159 | static inline void |
160 | dma_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents, | ||
161 | int direction) | ||
162 | { | ||
163 | dma_ops->unmap_sg(hwdev, sg, nents, direction); | ||
164 | } | ||
148 | 165 | ||
149 | extern int dma_supported(struct device *hwdev, u64 mask); | 166 | extern int dma_supported(struct device *hwdev, u64 mask); |
150 | extern int dma_get_cache_alignment(void); | ||
151 | #define dma_is_consistent(h) 1 | ||
152 | 167 | ||
153 | static inline int dma_set_mask(struct device *dev, u64 mask) | 168 | /* same for gart, swiotlb, and nommu */ |
169 | static inline int dma_get_cache_alignment(void) | ||
154 | { | 170 | { |
155 | if (!dev->dma_mask || !dma_supported(dev, mask)) | 171 | return boot_cpu_data.x86_clflush_size; |
156 | return -EIO; | ||
157 | *dev->dma_mask = mask; | ||
158 | return 0; | ||
159 | } | 172 | } |
160 | 173 | ||
161 | static inline void dma_cache_sync(void *vaddr, size_t size, enum dma_data_direction dir) | 174 | #define dma_is_consistent(h) 1 |
175 | |||
176 | extern int dma_set_mask(struct device *dev, u64 mask); | ||
177 | |||
178 | static inline void | ||
179 | dma_cache_sync(void *vaddr, size_t size, enum dma_data_direction dir) | ||
162 | { | 180 | { |
163 | flush_write_buffers(); | 181 | flush_write_buffers(); |
164 | } | 182 | } |
165 | 183 | ||
166 | #endif | 184 | extern struct device fallback_dev; |
185 | extern int panic_on_overflow; | ||
186 | |||
187 | #endif /* _X8664_DMA_MAPPING_H */ | ||
diff --git a/include/asm-x86_64/dwarf2.h b/include/asm-x86_64/dwarf2.h index 582757fc0365..07654bd155bf 100644 --- a/include/asm-x86_64/dwarf2.h +++ b/include/asm-x86_64/dwarf2.h | |||
@@ -14,7 +14,7 @@ | |||
14 | away for older version. | 14 | away for older version. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #ifdef CONFIG_DEBUG_INFO | 17 | #ifdef CONFIG_UNWIND_INFO |
18 | 18 | ||
19 | #define CFI_STARTPROC .cfi_startproc | 19 | #define CFI_STARTPROC .cfi_startproc |
20 | #define CFI_ENDPROC .cfi_endproc | 20 | #define CFI_ENDPROC .cfi_endproc |
@@ -28,6 +28,7 @@ | |||
28 | #define CFI_RESTORE .cfi_restore | 28 | #define CFI_RESTORE .cfi_restore |
29 | #define CFI_REMEMBER_STATE .cfi_remember_state | 29 | #define CFI_REMEMBER_STATE .cfi_remember_state |
30 | #define CFI_RESTORE_STATE .cfi_restore_state | 30 | #define CFI_RESTORE_STATE .cfi_restore_state |
31 | #define CFI_UNDEFINED .cfi_undefined | ||
31 | 32 | ||
32 | #else | 33 | #else |
33 | 34 | ||
@@ -44,6 +45,7 @@ | |||
44 | #define CFI_RESTORE # | 45 | #define CFI_RESTORE # |
45 | #define CFI_REMEMBER_STATE # | 46 | #define CFI_REMEMBER_STATE # |
46 | #define CFI_RESTORE_STATE # | 47 | #define CFI_RESTORE_STATE # |
48 | #define CFI_UNDEFINED # | ||
47 | 49 | ||
48 | #endif | 50 | #endif |
49 | 51 | ||
diff --git a/include/asm-x86_64/e820.h b/include/asm-x86_64/e820.h index e682edc24a68..8dcc32665240 100644 --- a/include/asm-x86_64/e820.h +++ b/include/asm-x86_64/e820.h | |||
@@ -55,6 +55,7 @@ extern unsigned long e820_hole_size(unsigned long start_pfn, | |||
55 | unsigned long end_pfn); | 55 | unsigned long end_pfn); |
56 | 56 | ||
57 | extern void __init parse_memopt(char *p, char **end); | 57 | extern void __init parse_memopt(char *p, char **end); |
58 | extern void __init parse_memmapopt(char *p, char **end); | ||
58 | 59 | ||
59 | extern struct e820map e820; | 60 | extern struct e820map e820; |
60 | #endif/*!__ASSEMBLY__*/ | 61 | #endif/*!__ASSEMBLY__*/ |
diff --git a/include/asm-x86_64/gart-mapping.h b/include/asm-x86_64/gart-mapping.h new file mode 100644 index 000000000000..ada497b0b55b --- /dev/null +++ b/include/asm-x86_64/gart-mapping.h | |||
@@ -0,0 +1,16 @@ | |||
1 | #ifndef _X8664_GART_MAPPING_H | ||
2 | #define _X8664_GART_MAPPING_H 1 | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | #include <asm/types.h> | ||
6 | |||
7 | struct device; | ||
8 | |||
9 | extern void* | ||
10 | gart_alloc_coherent(struct device *dev, size_t size, | ||
11 | dma_addr_t *dma_handle, gfp_t gfp); | ||
12 | |||
13 | extern int | ||
14 | gart_dma_supported(struct device *hwdev, u64 mask); | ||
15 | |||
16 | #endif /* _X8664_GART_MAPPING_H */ | ||
diff --git a/include/asm-x86_64/hw_irq.h b/include/asm-x86_64/hw_irq.h index c14a8c7267a6..0df1715dee71 100644 --- a/include/asm-x86_64/hw_irq.h +++ b/include/asm-x86_64/hw_irq.h | |||
@@ -46,18 +46,18 @@ struct hw_interrupt_type; | |||
46 | * some of the following vectors are 'rare', they are merged | 46 | * some of the following vectors are 'rare', they are merged |
47 | * into a single vector (CALL_FUNCTION_VECTOR) to save vector space. | 47 | * into a single vector (CALL_FUNCTION_VECTOR) to save vector space. |
48 | * TLB, reschedule and local APIC vectors are performance-critical. | 48 | * TLB, reschedule and local APIC vectors are performance-critical. |
49 | * | ||
50 | * Vectors 0xf0-0xf9 are free (reserved for future Linux use). | ||
51 | */ | 49 | */ |
52 | #define SPURIOUS_APIC_VECTOR 0xff | 50 | #define SPURIOUS_APIC_VECTOR 0xff |
53 | #define ERROR_APIC_VECTOR 0xfe | 51 | #define ERROR_APIC_VECTOR 0xfe |
54 | #define RESCHEDULE_VECTOR 0xfd | 52 | #define RESCHEDULE_VECTOR 0xfd |
55 | #define CALL_FUNCTION_VECTOR 0xfc | 53 | #define CALL_FUNCTION_VECTOR 0xfc |
56 | #define KDB_VECTOR 0xfb /* reserved for KDB */ | 54 | /* fb free - please don't readd KDB here because it's useless |
55 | (hint - think what a NMI bit does to a vector) */ | ||
57 | #define THERMAL_APIC_VECTOR 0xfa | 56 | #define THERMAL_APIC_VECTOR 0xfa |
58 | #define THRESHOLD_APIC_VECTOR 0xf9 | 57 | #define THRESHOLD_APIC_VECTOR 0xf9 |
59 | #define INVALIDATE_TLB_VECTOR_END 0xf8 | 58 | /* f8 free */ |
60 | #define INVALIDATE_TLB_VECTOR_START 0xf0 /* f0-f8 used for TLB flush */ | 59 | #define INVALIDATE_TLB_VECTOR_END 0xf7 |
60 | #define INVALIDATE_TLB_VECTOR_START 0xf0 /* f0-f7 used for TLB flush */ | ||
61 | 61 | ||
62 | #define NUM_INVALIDATE_TLB_VECTORS 8 | 62 | #define NUM_INVALIDATE_TLB_VECTORS 8 |
63 | 63 | ||
diff --git a/include/asm-x86_64/i387.h b/include/asm-x86_64/i387.h index aa39cfd0e001..876eb9a2fe78 100644 --- a/include/asm-x86_64/i387.h +++ b/include/asm-x86_64/i387.h | |||
@@ -30,7 +30,7 @@ extern int save_i387(struct _fpstate __user *buf); | |||
30 | */ | 30 | */ |
31 | 31 | ||
32 | #define unlazy_fpu(tsk) do { \ | 32 | #define unlazy_fpu(tsk) do { \ |
33 | if ((tsk)->thread_info->status & TS_USEDFPU) \ | 33 | if (task_thread_info(tsk)->status & TS_USEDFPU) \ |
34 | save_init_fpu(tsk); \ | 34 | save_init_fpu(tsk); \ |
35 | } while (0) | 35 | } while (0) |
36 | 36 | ||
@@ -46,9 +46,9 @@ static inline void tolerant_fwait(void) | |||
46 | } | 46 | } |
47 | 47 | ||
48 | #define clear_fpu(tsk) do { \ | 48 | #define clear_fpu(tsk) do { \ |
49 | if ((tsk)->thread_info->status & TS_USEDFPU) { \ | 49 | if (task_thread_info(tsk)->status & TS_USEDFPU) { \ |
50 | tolerant_fwait(); \ | 50 | tolerant_fwait(); \ |
51 | (tsk)->thread_info->status &= ~TS_USEDFPU; \ | 51 | task_thread_info(tsk)->status &= ~TS_USEDFPU; \ |
52 | stts(); \ | 52 | stts(); \ |
53 | } \ | 53 | } \ |
54 | } while (0) | 54 | } while (0) |
@@ -75,7 +75,8 @@ extern int set_fpregs(struct task_struct *tsk, | |||
75 | static inline int restore_fpu_checking(struct i387_fxsave_struct *fx) | 75 | static inline int restore_fpu_checking(struct i387_fxsave_struct *fx) |
76 | { | 76 | { |
77 | int err; | 77 | int err; |
78 | asm volatile("1: rex64 ; fxrstor (%[fx])\n\t" | 78 | |
79 | asm volatile("1: rex64/fxrstor (%[fx])\n\t" | ||
79 | "2:\n" | 80 | "2:\n" |
80 | ".section .fixup,\"ax\"\n" | 81 | ".section .fixup,\"ax\"\n" |
81 | "3: movl $-1,%[err]\n" | 82 | "3: movl $-1,%[err]\n" |
@@ -86,7 +87,11 @@ static inline int restore_fpu_checking(struct i387_fxsave_struct *fx) | |||
86 | " .quad 1b,3b\n" | 87 | " .quad 1b,3b\n" |
87 | ".previous" | 88 | ".previous" |
88 | : [err] "=r" (err) | 89 | : [err] "=r" (err) |
89 | : [fx] "r" (fx), "0" (0)); | 90 | #if 0 /* See comment in __fxsave_clear() below. */ |
91 | : [fx] "r" (fx), "m" (*fx), "0" (0)); | ||
92 | #else | ||
93 | : [fx] "cdaSDb" (fx), "m" (*fx), "0" (0)); | ||
94 | #endif | ||
90 | if (unlikely(err)) | 95 | if (unlikely(err)) |
91 | init_fpu(current); | 96 | init_fpu(current); |
92 | return err; | 97 | return err; |
@@ -95,7 +100,8 @@ static inline int restore_fpu_checking(struct i387_fxsave_struct *fx) | |||
95 | static inline int save_i387_checking(struct i387_fxsave_struct __user *fx) | 100 | static inline int save_i387_checking(struct i387_fxsave_struct __user *fx) |
96 | { | 101 | { |
97 | int err; | 102 | int err; |
98 | asm volatile("1: rex64 ; fxsave (%[fx])\n\t" | 103 | |
104 | asm volatile("1: rex64/fxsave (%[fx])\n\t" | ||
99 | "2:\n" | 105 | "2:\n" |
100 | ".section .fixup,\"ax\"\n" | 106 | ".section .fixup,\"ax\"\n" |
101 | "3: movl $-1,%[err]\n" | 107 | "3: movl $-1,%[err]\n" |
@@ -105,20 +111,53 @@ static inline int save_i387_checking(struct i387_fxsave_struct __user *fx) | |||
105 | " .align 8\n" | 111 | " .align 8\n" |
106 | " .quad 1b,3b\n" | 112 | " .quad 1b,3b\n" |
107 | ".previous" | 113 | ".previous" |
108 | : [err] "=r" (err) | 114 | : [err] "=r" (err), "=m" (*fx) |
109 | : [fx] "r" (fx), "0" (0)); | 115 | #if 0 /* See comment in __fxsave_clear() below. */ |
116 | : [fx] "r" (fx), "0" (0)); | ||
117 | #else | ||
118 | : [fx] "cdaSDb" (fx), "0" (0)); | ||
119 | #endif | ||
110 | if (unlikely(err)) | 120 | if (unlikely(err)) |
111 | __clear_user(fx, sizeof(struct i387_fxsave_struct)); | 121 | __clear_user(fx, sizeof(struct i387_fxsave_struct)); |
112 | return err; | 122 | return err; |
113 | } | 123 | } |
114 | 124 | ||
125 | static inline void __fxsave_clear(struct task_struct *tsk) | ||
126 | { | ||
127 | /* Using "rex64; fxsave %0" is broken because, if the memory operand | ||
128 | uses any extended registers for addressing, a second REX prefix | ||
129 | will be generated (to the assembler, rex64 followed by semicolon | ||
130 | is a separate instruction), and hence the 64-bitness is lost. */ | ||
131 | #if 0 | ||
132 | /* Using "fxsaveq %0" would be the ideal choice, but is only supported | ||
133 | starting with gas 2.16. */ | ||
134 | __asm__ __volatile__("fxsaveq %0" | ||
135 | : "=m" (tsk->thread.i387.fxsave)); | ||
136 | #elif 0 | ||
137 | /* Using, as a workaround, the properly prefixed form below isn't | ||
138 | accepted by any binutils version so far released, complaining that | ||
139 | the same type of prefix is used twice if an extended register is | ||
140 | needed for addressing (fix submitted to mainline 2005-11-21). */ | ||
141 | __asm__ __volatile__("rex64/fxsave %0" | ||
142 | : "=m" (tsk->thread.i387.fxsave)); | ||
143 | #else | ||
144 | /* This, however, we can work around by forcing the compiler to select | ||
145 | an addressing mode that doesn't require extended registers. */ | ||
146 | __asm__ __volatile__("rex64/fxsave %P2(%1)" | ||
147 | : "=m" (tsk->thread.i387.fxsave) | ||
148 | : "cdaSDb" (tsk), | ||
149 | "i" (offsetof(__typeof__(*tsk), | ||
150 | thread.i387.fxsave))); | ||
151 | #endif | ||
152 | __asm__ __volatile__("fnclex"); | ||
153 | } | ||
154 | |||
115 | static inline void kernel_fpu_begin(void) | 155 | static inline void kernel_fpu_begin(void) |
116 | { | 156 | { |
117 | struct thread_info *me = current_thread_info(); | 157 | struct thread_info *me = current_thread_info(); |
118 | preempt_disable(); | 158 | preempt_disable(); |
119 | if (me->status & TS_USEDFPU) { | 159 | if (me->status & TS_USEDFPU) { |
120 | asm volatile("rex64 ; fxsave %0 ; fnclex" | 160 | __fxsave_clear(me->task); |
121 | : "=m" (me->task->thread.i387.fxsave)); | ||
122 | me->status &= ~TS_USEDFPU; | 161 | me->status &= ~TS_USEDFPU; |
123 | return; | 162 | return; |
124 | } | 163 | } |
@@ -131,11 +170,10 @@ static inline void kernel_fpu_end(void) | |||
131 | preempt_enable(); | 170 | preempt_enable(); |
132 | } | 171 | } |
133 | 172 | ||
134 | static inline void save_init_fpu( struct task_struct *tsk ) | 173 | static inline void save_init_fpu(struct task_struct *tsk) |
135 | { | 174 | { |
136 | asm volatile( "rex64 ; fxsave %0 ; fnclex" | 175 | __fxsave_clear(tsk); |
137 | : "=m" (tsk->thread.i387.fxsave)); | 176 | task_thread_info(tsk)->status &= ~TS_USEDFPU; |
138 | tsk->thread_info->status &= ~TS_USEDFPU; | ||
139 | stts(); | 177 | stts(); |
140 | } | 178 | } |
141 | 179 | ||
diff --git a/include/asm-x86_64/idle.h b/include/asm-x86_64/idle.h new file mode 100644 index 000000000000..6bd47dcf2067 --- /dev/null +++ b/include/asm-x86_64/idle.h | |||
@@ -0,0 +1,14 @@ | |||
1 | #ifndef _ASM_X86_64_IDLE_H | ||
2 | #define _ASM_X86_64_IDLE_H 1 | ||
3 | |||
4 | #define IDLE_START 1 | ||
5 | #define IDLE_END 2 | ||
6 | |||
7 | struct notifier_block; | ||
8 | void idle_notifier_register(struct notifier_block *n); | ||
9 | void idle_notifier_unregister(struct notifier_block *n); | ||
10 | |||
11 | void enter_idle(void); | ||
12 | void exit_idle(void); | ||
13 | |||
14 | #endif | ||
diff --git a/include/asm-x86_64/io.h b/include/asm-x86_64/io.h index 52ff269fe054..9dac18db8291 100644 --- a/include/asm-x86_64/io.h +++ b/include/asm-x86_64/io.h | |||
@@ -143,6 +143,11 @@ static inline void __iomem * ioremap (unsigned long offset, unsigned long size) | |||
143 | extern void __iomem * ioremap_nocache (unsigned long offset, unsigned long size); | 143 | extern void __iomem * ioremap_nocache (unsigned long offset, unsigned long size); |
144 | extern void iounmap(volatile void __iomem *addr); | 144 | extern void iounmap(volatile void __iomem *addr); |
145 | 145 | ||
146 | /* Use normal IO mappings for DMI */ | ||
147 | #define dmi_ioremap ioremap | ||
148 | #define dmi_iounmap(x,l) iounmap(x) | ||
149 | #define dmi_alloc(l) kmalloc(l, GFP_ATOMIC) | ||
150 | |||
146 | /* | 151 | /* |
147 | * ISA I/O bus memory addresses are 1:1 with the physical address. | 152 | * ISA I/O bus memory addresses are 1:1 with the physical address. |
148 | */ | 153 | */ |
diff --git a/include/asm-x86_64/ioctl.h b/include/asm-x86_64/ioctl.h index 609b663b6bf4..b279fe06dfe5 100644 --- a/include/asm-x86_64/ioctl.h +++ b/include/asm-x86_64/ioctl.h | |||
@@ -1,75 +1 @@ | |||
1 | /* $Id: ioctl.h,v 1.2 2001/07/04 09:08:13 ak Exp $ | #include <asm-generic/ioctl.h> | |
2 | * | ||
3 | * linux/ioctl.h for Linux by H.H. Bergman. | ||
4 | */ | ||
5 | |||
6 | #ifndef _ASMX8664_IOCTL_H | ||
7 | #define _ASMX8664_IOCTL_H | ||
8 | |||
9 | /* ioctl command encoding: 32 bits total, command in lower 16 bits, | ||
10 | * size of the parameter structure in the lower 14 bits of the | ||
11 | * upper 16 bits. | ||
12 | * Encoding the size of the parameter structure in the ioctl request | ||
13 | * is useful for catching programs compiled with old versions | ||
14 | * and to avoid overwriting user space outside the user buffer area. | ||
15 | * The highest 2 bits are reserved for indicating the ``access mode''. | ||
16 | * NOTE: This limits the max parameter size to 16kB -1 ! | ||
17 | */ | ||
18 | |||
19 | /* | ||
20 | * The following is for compatibility across the various Linux | ||
21 | * platforms. The i386 ioctl numbering scheme doesn't really enforce | ||
22 | * a type field. De facto, however, the top 8 bits of the lower 16 | ||
23 | * bits are indeed used as a type field, so we might just as well make | ||
24 | * this explicit here. Please be sure to use the decoding macros | ||
25 | * below from now on. | ||
26 | */ | ||
27 | #define _IOC_NRBITS 8 | ||
28 | #define _IOC_TYPEBITS 8 | ||
29 | #define _IOC_SIZEBITS 14 | ||
30 | #define _IOC_DIRBITS 2 | ||
31 | |||
32 | #define _IOC_NRMASK ((1 << _IOC_NRBITS)-1) | ||
33 | #define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1) | ||
34 | #define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1) | ||
35 | #define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1) | ||
36 | |||
37 | #define _IOC_NRSHIFT 0 | ||
38 | #define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS) | ||
39 | #define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS) | ||
40 | #define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS) | ||
41 | |||
42 | /* | ||
43 | * Direction bits. | ||
44 | */ | ||
45 | #define _IOC_NONE 0U | ||
46 | #define _IOC_WRITE 1U | ||
47 | #define _IOC_READ 2U | ||
48 | |||
49 | #define _IOC(dir,type,nr,size) \ | ||
50 | (((dir) << _IOC_DIRSHIFT) | \ | ||
51 | ((type) << _IOC_TYPESHIFT) | \ | ||
52 | ((nr) << _IOC_NRSHIFT) | \ | ||
53 | ((size) << _IOC_SIZESHIFT)) | ||
54 | |||
55 | /* used to create numbers */ | ||
56 | #define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0) | ||
57 | #define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size)) | ||
58 | #define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size)) | ||
59 | #define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size)) | ||
60 | |||
61 | /* used to decode ioctl numbers.. */ | ||
62 | #define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) | ||
63 | #define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK) | ||
64 | #define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK) | ||
65 | #define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK) | ||
66 | |||
67 | /* ...and for the drivers/sound files... */ | ||
68 | |||
69 | #define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT) | ||
70 | #define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT) | ||
71 | #define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT) | ||
72 | #define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT) | ||
73 | #define IOCSIZE_SHIFT (_IOC_SIZESHIFT) | ||
74 | |||
75 | #endif /* _ASMX8664_IOCTL_H */ | ||
diff --git a/include/asm-x86_64/ipi.h b/include/asm-x86_64/ipi.h index 022e9d340ad7..2a5c162b7d92 100644 --- a/include/asm-x86_64/ipi.h +++ b/include/asm-x86_64/ipi.h | |||
@@ -38,10 +38,6 @@ static inline unsigned int __prepare_ICR (unsigned int shortcut, int vector, uns | |||
38 | icr |= APIC_DM_FIXED | vector; | 38 | icr |= APIC_DM_FIXED | vector; |
39 | break; | 39 | break; |
40 | case NMI_VECTOR: | 40 | case NMI_VECTOR: |
41 | /* | ||
42 | * Setup KDB IPI to be delivered as an NMI | ||
43 | */ | ||
44 | case KDB_VECTOR: | ||
45 | icr |= APIC_DM_NMI; | 41 | icr |= APIC_DM_NMI; |
46 | break; | 42 | break; |
47 | } | 43 | } |
diff --git a/include/asm-x86_64/kdebug.h b/include/asm-x86_64/kdebug.h index f604e84c5303..b9ed4c0c8783 100644 --- a/include/asm-x86_64/kdebug.h +++ b/include/asm-x86_64/kdebug.h | |||
@@ -35,9 +35,16 @@ enum die_val { | |||
35 | DIE_PAGE_FAULT, | 35 | DIE_PAGE_FAULT, |
36 | }; | 36 | }; |
37 | 37 | ||
38 | static inline int notify_die(enum die_val val,char *str,struct pt_regs *regs,long err,int trap, int sig) | 38 | static inline int notify_die(enum die_val val, const char *str, |
39 | { | 39 | struct pt_regs *regs, long err, int trap, int sig) |
40 | struct die_args args = { .regs=regs, .str=str, .err=err, .trapnr=trap,.signr=sig }; | 40 | { |
41 | struct die_args args = { | ||
42 | .regs = regs, | ||
43 | .str = str, | ||
44 | .err = err, | ||
45 | .trapnr = trap, | ||
46 | .signr = sig | ||
47 | }; | ||
41 | return notifier_call_chain(&die_chain, val, &args); | 48 | return notifier_call_chain(&die_chain, val, &args); |
42 | } | 49 | } |
43 | 50 | ||
diff --git a/include/asm-x86_64/kexec.h b/include/asm-x86_64/kexec.h index 42d2ff15c592..ae28cd44bcd3 100644 --- a/include/asm-x86_64/kexec.h +++ b/include/asm-x86_64/kexec.h | |||
@@ -3,6 +3,7 @@ | |||
3 | 3 | ||
4 | #include <asm/page.h> | 4 | #include <asm/page.h> |
5 | #include <asm/proto.h> | 5 | #include <asm/proto.h> |
6 | #include <asm/ptrace.h> | ||
6 | 7 | ||
7 | /* | 8 | /* |
8 | * KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return. | 9 | * KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return. |
@@ -26,8 +27,40 @@ | |||
26 | #define KEXEC_ARCH KEXEC_ARCH_X86_64 | 27 | #define KEXEC_ARCH KEXEC_ARCH_X86_64 |
27 | 28 | ||
28 | #define MAX_NOTE_BYTES 1024 | 29 | #define MAX_NOTE_BYTES 1024 |
29 | typedef u32 note_buf_t[MAX_NOTE_BYTES/4]; | ||
30 | 30 | ||
31 | extern note_buf_t crash_notes[]; | 31 | /* |
32 | * Saving the registers of the cpu on which panic occured in | ||
33 | * crash_kexec to save a valid sp. The registers of other cpus | ||
34 | * will be saved in machine_crash_shutdown while shooting down them. | ||
35 | */ | ||
36 | |||
37 | static inline void crash_setup_regs(struct pt_regs *newregs, | ||
38 | struct pt_regs *oldregs) | ||
39 | { | ||
40 | if (oldregs) | ||
41 | memcpy(newregs, oldregs, sizeof(*newregs)); | ||
42 | else { | ||
43 | __asm__ __volatile__("movq %%rbx,%0" : "=m"(newregs->rbx)); | ||
44 | __asm__ __volatile__("movq %%rcx,%0" : "=m"(newregs->rcx)); | ||
45 | __asm__ __volatile__("movq %%rdx,%0" : "=m"(newregs->rdx)); | ||
46 | __asm__ __volatile__("movq %%rsi,%0" : "=m"(newregs->rsi)); | ||
47 | __asm__ __volatile__("movq %%rdi,%0" : "=m"(newregs->rdi)); | ||
48 | __asm__ __volatile__("movq %%rbp,%0" : "=m"(newregs->rbp)); | ||
49 | __asm__ __volatile__("movq %%rax,%0" : "=m"(newregs->rax)); | ||
50 | __asm__ __volatile__("movq %%rsp,%0" : "=m"(newregs->rsp)); | ||
51 | __asm__ __volatile__("movq %%r8,%0" : "=m"(newregs->r8)); | ||
52 | __asm__ __volatile__("movq %%r9,%0" : "=m"(newregs->r9)); | ||
53 | __asm__ __volatile__("movq %%r10,%0" : "=m"(newregs->r10)); | ||
54 | __asm__ __volatile__("movq %%r11,%0" : "=m"(newregs->r11)); | ||
55 | __asm__ __volatile__("movq %%r12,%0" : "=m"(newregs->r12)); | ||
56 | __asm__ __volatile__("movq %%r13,%0" : "=m"(newregs->r13)); | ||
57 | __asm__ __volatile__("movq %%r14,%0" : "=m"(newregs->r14)); | ||
58 | __asm__ __volatile__("movq %%r15,%0" : "=m"(newregs->r15)); | ||
59 | __asm__ __volatile__("movl %%ss, %%eax;" :"=a"(newregs->ss)); | ||
60 | __asm__ __volatile__("movl %%cs, %%eax;" :"=a"(newregs->cs)); | ||
61 | __asm__ __volatile__("pushfq; popq %0" :"=m"(newregs->eflags)); | ||
32 | 62 | ||
63 | newregs->rip = (unsigned long)current_text_addr(); | ||
64 | } | ||
65 | } | ||
33 | #endif /* _X86_64_KEXEC_H */ | 66 | #endif /* _X86_64_KEXEC_H */ |
diff --git a/include/asm-x86_64/kprobes.h b/include/asm-x86_64/kprobes.h index 4dd7a7e148d4..98a1e95ddb98 100644 --- a/include/asm-x86_64/kprobes.h +++ b/include/asm-x86_64/kprobes.h | |||
@@ -27,7 +27,10 @@ | |||
27 | #include <linux/ptrace.h> | 27 | #include <linux/ptrace.h> |
28 | #include <linux/percpu.h> | 28 | #include <linux/percpu.h> |
29 | 29 | ||
30 | #define __ARCH_WANT_KPROBES_INSN_SLOT | ||
31 | |||
30 | struct pt_regs; | 32 | struct pt_regs; |
33 | struct kprobe; | ||
31 | 34 | ||
32 | typedef u8 kprobe_opcode_t; | 35 | typedef u8 kprobe_opcode_t; |
33 | #define BREAKPOINT_INSTRUCTION 0xcc | 36 | #define BREAKPOINT_INSTRUCTION 0xcc |
@@ -42,6 +45,7 @@ typedef u8 kprobe_opcode_t; | |||
42 | #define ARCH_SUPPORTS_KRETPROBES | 45 | #define ARCH_SUPPORTS_KRETPROBES |
43 | 46 | ||
44 | void kretprobe_trampoline(void); | 47 | void kretprobe_trampoline(void); |
48 | extern void arch_remove_kprobe(struct kprobe *p); | ||
45 | 49 | ||
46 | /* Architecture specific copy of original instruction*/ | 50 | /* Architecture specific copy of original instruction*/ |
47 | struct arch_specific_insn { | 51 | struct arch_specific_insn { |
diff --git a/include/asm-x86_64/mmu_context.h b/include/asm-x86_64/mmu_context.h index b630d52bdfb1..16e4be4de0c5 100644 --- a/include/asm-x86_64/mmu_context.h +++ b/include/asm-x86_64/mmu_context.h | |||
@@ -15,18 +15,13 @@ | |||
15 | int init_new_context(struct task_struct *tsk, struct mm_struct *mm); | 15 | int init_new_context(struct task_struct *tsk, struct mm_struct *mm); |
16 | void destroy_context(struct mm_struct *mm); | 16 | void destroy_context(struct mm_struct *mm); |
17 | 17 | ||
18 | #ifdef CONFIG_SMP | ||
19 | |||
20 | static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) | 18 | static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) |
21 | { | 19 | { |
20 | #ifdef CONFIG_SMP | ||
22 | if (read_pda(mmu_state) == TLBSTATE_OK) | 21 | if (read_pda(mmu_state) == TLBSTATE_OK) |
23 | write_pda(mmu_state, TLBSTATE_LAZY); | 22 | write_pda(mmu_state, TLBSTATE_LAZY); |
24 | } | ||
25 | #else | ||
26 | static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) | ||
27 | { | ||
28 | } | ||
29 | #endif | 23 | #endif |
24 | } | ||
30 | 25 | ||
31 | static inline void load_cr3(pgd_t *pgd) | 26 | static inline void load_cr3(pgd_t *pgd) |
32 | { | 27 | { |
diff --git a/include/asm-x86_64/mmzone.h b/include/asm-x86_64/mmzone.h index 69baaa8a3ce0..972c9359f7d7 100644 --- a/include/asm-x86_64/mmzone.h +++ b/include/asm-x86_64/mmzone.h | |||
@@ -36,22 +36,12 @@ static inline __attribute__((pure)) int phys_to_nid(unsigned long addr) | |||
36 | NODE_DATA(nid)->node_spanned_pages) | 36 | NODE_DATA(nid)->node_spanned_pages) |
37 | 37 | ||
38 | #ifdef CONFIG_DISCONTIGMEM | 38 | #ifdef CONFIG_DISCONTIGMEM |
39 | |||
40 | #define pfn_to_nid(pfn) phys_to_nid((unsigned long)(pfn) << PAGE_SHIFT) | 39 | #define pfn_to_nid(pfn) phys_to_nid((unsigned long)(pfn) << PAGE_SHIFT) |
41 | #define kvaddr_to_nid(kaddr) phys_to_nid(__pa(kaddr)) | 40 | #define kvaddr_to_nid(kaddr) phys_to_nid(__pa(kaddr)) |
42 | 41 | ||
43 | /* Requires pfn_valid(pfn) to be true */ | 42 | extern struct page *pfn_to_page(unsigned long pfn); |
44 | #define pfn_to_page(pfn) ({ \ | 43 | extern unsigned long page_to_pfn(struct page *page); |
45 | int nid = phys_to_nid(((unsigned long)(pfn)) << PAGE_SHIFT); \ | 44 | extern int pfn_valid(unsigned long pfn); |
46 | ((pfn) - node_start_pfn(nid)) + NODE_DATA(nid)->node_mem_map; \ | ||
47 | }) | ||
48 | |||
49 | #define page_to_pfn(page) \ | ||
50 | (long)(((page) - page_zone(page)->zone_mem_map) + page_zone(page)->zone_start_pfn) | ||
51 | |||
52 | #define pfn_valid(pfn) ((pfn) >= num_physpages ? 0 : \ | ||
53 | ({ u8 nid__ = pfn_to_nid(pfn); \ | ||
54 | nid__ != 0xff && (pfn) >= node_start_pfn(nid__) && (pfn) < node_end_pfn(nid__); })) | ||
55 | #endif | 45 | #endif |
56 | 46 | ||
57 | #define local_mapnr(kvaddr) \ | 47 | #define local_mapnr(kvaddr) \ |
diff --git a/include/asm-x86_64/mutex.h b/include/asm-x86_64/mutex.h index 818abfd262d1..11fbee2bd6c0 100644 --- a/include/asm-x86_64/mutex.h +++ b/include/asm-x86_64/mutex.h | |||
@@ -104,7 +104,7 @@ do { \ | |||
104 | static inline int | 104 | static inline int |
105 | __mutex_fastpath_trylock(atomic_t *count, int (*fail_fn)(atomic_t *)) | 105 | __mutex_fastpath_trylock(atomic_t *count, int (*fail_fn)(atomic_t *)) |
106 | { | 106 | { |
107 | if (likely(atomic_cmpxchg(count, 1, 0)) == 1) | 107 | if (likely(atomic_cmpxchg(count, 1, 0) == 1)) |
108 | return 1; | 108 | return 1; |
109 | else | 109 | else |
110 | return 0; | 110 | return 0; |
diff --git a/include/asm-x86_64/numa.h b/include/asm-x86_64/numa.h index d51e56fdc3da..34e434ce3268 100644 --- a/include/asm-x86_64/numa.h +++ b/include/asm-x86_64/numa.h | |||
@@ -20,6 +20,11 @@ extern int numa_off; | |||
20 | extern void numa_set_node(int cpu, int node); | 20 | extern void numa_set_node(int cpu, int node); |
21 | 21 | ||
22 | extern unsigned char apicid_to_node[256]; | 22 | extern unsigned char apicid_to_node[256]; |
23 | #ifdef CONFIG_NUMA | ||
24 | extern void __init init_cpu_to_node(void); | ||
25 | #else | ||
26 | #define init_cpu_to_node() do {} while (0) | ||
27 | #endif | ||
23 | 28 | ||
24 | #define NUMA_NO_NODE 0xff | 29 | #define NUMA_NO_NODE 0xff |
25 | 30 | ||
diff --git a/include/asm-x86_64/page.h b/include/asm-x86_64/page.h index 06e489f32472..dcbb4fcd9a18 100644 --- a/include/asm-x86_64/page.h +++ b/include/asm-x86_64/page.h | |||
@@ -14,13 +14,18 @@ | |||
14 | #define PHYSICAL_PAGE_MASK (~(PAGE_SIZE-1) & __PHYSICAL_MASK) | 14 | #define PHYSICAL_PAGE_MASK (~(PAGE_SIZE-1) & __PHYSICAL_MASK) |
15 | 15 | ||
16 | #define THREAD_ORDER 1 | 16 | #define THREAD_ORDER 1 |
17 | #ifdef __ASSEMBLY__ | 17 | #define THREAD_SIZE (PAGE_SIZE << THREAD_ORDER) |
18 | #define THREAD_SIZE (1 << (PAGE_SHIFT + THREAD_ORDER)) | ||
19 | #else | ||
20 | #define THREAD_SIZE (1UL << (PAGE_SHIFT + THREAD_ORDER)) | ||
21 | #endif | ||
22 | #define CURRENT_MASK (~(THREAD_SIZE-1)) | 18 | #define CURRENT_MASK (~(THREAD_SIZE-1)) |
23 | 19 | ||
20 | #define EXCEPTION_STACK_ORDER 0 | ||
21 | #define EXCEPTION_STKSZ (PAGE_SIZE << EXCEPTION_STACK_ORDER) | ||
22 | |||
23 | #define DEBUG_STACK_ORDER EXCEPTION_STACK_ORDER | ||
24 | #define DEBUG_STKSZ (PAGE_SIZE << DEBUG_STACK_ORDER) | ||
25 | |||
26 | #define IRQSTACK_ORDER 2 | ||
27 | #define IRQSTACKSIZE (PAGE_SIZE << IRQSTACK_ORDER) | ||
28 | |||
24 | #define LARGE_PAGE_MASK (~(LARGE_PAGE_SIZE-1)) | 29 | #define LARGE_PAGE_MASK (~(LARGE_PAGE_SIZE-1)) |
25 | #define LARGE_PAGE_SIZE (1UL << PMD_SHIFT) | 30 | #define LARGE_PAGE_SIZE (1UL << PMD_SHIFT) |
26 | 31 | ||
diff --git a/include/asm-x86_64/pci.h b/include/asm-x86_64/pci.h index eeb3088a1c9e..fd03e15d7ea6 100644 --- a/include/asm-x86_64/pci.h +++ b/include/asm-x86_64/pci.h | |||
@@ -42,18 +42,20 @@ int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq); | |||
42 | #include <asm/scatterlist.h> | 42 | #include <asm/scatterlist.h> |
43 | #include <linux/string.h> | 43 | #include <linux/string.h> |
44 | #include <asm/page.h> | 44 | #include <asm/page.h> |
45 | #include <linux/dma-mapping.h> /* for have_iommu */ | ||
45 | 46 | ||
46 | extern int iommu_setup(char *opt); | 47 | extern int iommu_setup(char *opt); |
47 | 48 | ||
48 | #ifdef CONFIG_GART_IOMMU | ||
49 | /* The PCI address space does equal the physical memory | 49 | /* The PCI address space does equal the physical memory |
50 | * address space. The networking and block device layers use | 50 | * address space. The networking and block device layers use |
51 | * this boolean for bounce buffer decisions | 51 | * this boolean for bounce buffer decisions |
52 | * | 52 | * |
53 | * On AMD64 it mostly equals, but we set it to zero to tell some subsystems | 53 | * On AMD64 it mostly equals, but we set it to zero if a hardware |
54 | * that an IOMMU is available. | 54 | * IOMMU (gart) of sotware IOMMU (swiotlb) is available. |
55 | */ | 55 | */ |
56 | #define PCI_DMA_BUS_IS_PHYS (no_iommu ? 1 : 0) | 56 | #define PCI_DMA_BUS_IS_PHYS (dma_ops->is_phys) |
57 | |||
58 | #ifdef CONFIG_GART_IOMMU | ||
57 | 59 | ||
58 | /* | 60 | /* |
59 | * x86-64 always supports DAC, but sometimes it is useful to force | 61 | * x86-64 always supports DAC, but sometimes it is useful to force |
@@ -79,7 +81,6 @@ extern int iommu_sac_force; | |||
79 | #else | 81 | #else |
80 | /* No IOMMU */ | 82 | /* No IOMMU */ |
81 | 83 | ||
82 | #define PCI_DMA_BUS_IS_PHYS 1 | ||
83 | #define pci_dac_dma_supported(pci_dev, mask) 1 | 84 | #define pci_dac_dma_supported(pci_dev, mask) 1 |
84 | 85 | ||
85 | #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) | 86 | #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) |
diff --git a/include/asm-x86_64/pda.h b/include/asm-x86_64/pda.h index 8733ccfa442e..c7ab38a601af 100644 --- a/include/asm-x86_64/pda.h +++ b/include/asm-x86_64/pda.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/stddef.h> | 5 | #include <linux/stddef.h> |
6 | #include <linux/types.h> | 6 | #include <linux/types.h> |
7 | #include <linux/cache.h> | 7 | #include <linux/cache.h> |
8 | #include <asm/page.h> | ||
8 | 9 | ||
9 | /* Per processor datastructure. %gs points to it while the kernel runs */ | 10 | /* Per processor datastructure. %gs points to it while the kernel runs */ |
10 | struct x8664_pda { | 11 | struct x8664_pda { |
@@ -12,6 +13,9 @@ struct x8664_pda { | |||
12 | unsigned long data_offset; /* Per cpu data offset from linker address */ | 13 | unsigned long data_offset; /* Per cpu data offset from linker address */ |
13 | unsigned long kernelstack; /* top of kernel stack for current */ | 14 | unsigned long kernelstack; /* top of kernel stack for current */ |
14 | unsigned long oldrsp; /* user rsp for system call */ | 15 | unsigned long oldrsp; /* user rsp for system call */ |
16 | #if DEBUG_STKSZ > EXCEPTION_STKSZ | ||
17 | unsigned long debugstack; /* #DB/#BP stack. */ | ||
18 | #endif | ||
15 | int irqcount; /* Irq nesting counter. Starts with -1 */ | 19 | int irqcount; /* Irq nesting counter. Starts with -1 */ |
16 | int cpunumber; /* Logical CPU number */ | 20 | int cpunumber; /* Logical CPU number */ |
17 | char *irqstackptr; /* top of irqstack */ | 21 | char *irqstackptr; /* top of irqstack */ |
@@ -23,11 +27,10 @@ struct x8664_pda { | |||
23 | unsigned apic_timer_irqs; | 27 | unsigned apic_timer_irqs; |
24 | } ____cacheline_aligned_in_smp; | 28 | } ____cacheline_aligned_in_smp; |
25 | 29 | ||
30 | extern struct x8664_pda *_cpu_pda[]; | ||
31 | extern struct x8664_pda boot_cpu_pda[]; | ||
26 | 32 | ||
27 | #define IRQSTACK_ORDER 2 | 33 | #define cpu_pda(i) (_cpu_pda[i]) |
28 | #define IRQSTACKSIZE (PAGE_SIZE << IRQSTACK_ORDER) | ||
29 | |||
30 | extern struct x8664_pda cpu_pda[]; | ||
31 | 34 | ||
32 | /* | 35 | /* |
33 | * There is no fast way to get the base address of the PDA, all the accesses | 36 | * There is no fast way to get the base address of the PDA, all the accesses |
diff --git a/include/asm-x86_64/percpu.h b/include/asm-x86_64/percpu.h index 9c71855736fb..29a6b0408f75 100644 --- a/include/asm-x86_64/percpu.h +++ b/include/asm-x86_64/percpu.h | |||
@@ -11,7 +11,7 @@ | |||
11 | 11 | ||
12 | #include <asm/pda.h> | 12 | #include <asm/pda.h> |
13 | 13 | ||
14 | #define __per_cpu_offset(cpu) (cpu_pda[cpu].data_offset) | 14 | #define __per_cpu_offset(cpu) (cpu_pda(cpu)->data_offset) |
15 | #define __my_cpu_offset() read_pda(data_offset) | 15 | #define __my_cpu_offset() read_pda(data_offset) |
16 | 16 | ||
17 | /* Separate out the type, so (int[3], foo) works. */ | 17 | /* Separate out the type, so (int[3], foo) works. */ |
diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h index 02888d7a496f..8fbf4dd72115 100644 --- a/include/asm-x86_64/pgtable.h +++ b/include/asm-x86_64/pgtable.h | |||
@@ -267,25 +267,25 @@ static inline pte_t pfn_pte(unsigned long page_nr, pgprot_t pgprot) | |||
267 | */ | 267 | */ |
268 | #define __LARGE_PTE (_PAGE_PSE|_PAGE_PRESENT) | 268 | #define __LARGE_PTE (_PAGE_PSE|_PAGE_PRESENT) |
269 | static inline int pte_user(pte_t pte) { return pte_val(pte) & _PAGE_USER; } | 269 | static inline int pte_user(pte_t pte) { return pte_val(pte) & _PAGE_USER; } |
270 | extern inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_USER; } | 270 | static inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_USER; } |
271 | extern inline int pte_exec(pte_t pte) { return pte_val(pte) & _PAGE_USER; } | 271 | static inline int pte_exec(pte_t pte) { return pte_val(pte) & _PAGE_USER; } |
272 | extern inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } | 272 | static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } |
273 | extern inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } | 273 | static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } |
274 | extern inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; } | 274 | static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; } |
275 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } | 275 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } |
276 | static inline int pte_huge(pte_t pte) { return (pte_val(pte) & __LARGE_PTE) == __LARGE_PTE; } | 276 | static inline int pte_huge(pte_t pte) { return (pte_val(pte) & __LARGE_PTE) == __LARGE_PTE; } |
277 | 277 | ||
278 | extern inline pte_t pte_rdprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; } | 278 | static inline pte_t pte_rdprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; } |
279 | extern inline pte_t pte_exprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; } | 279 | static inline pte_t pte_exprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; } |
280 | extern inline pte_t pte_mkclean(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY)); return pte; } | 280 | static inline pte_t pte_mkclean(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY)); return pte; } |
281 | extern inline pte_t pte_mkold(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_ACCESSED)); return pte; } | 281 | static inline pte_t pte_mkold(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_ACCESSED)); return pte; } |
282 | extern inline pte_t pte_wrprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_RW)); return pte; } | 282 | static inline pte_t pte_wrprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_RW)); return pte; } |
283 | extern inline pte_t pte_mkread(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_USER)); return pte; } | 283 | static inline pte_t pte_mkread(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_USER)); return pte; } |
284 | extern inline pte_t pte_mkexec(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_USER)); return pte; } | 284 | static inline pte_t pte_mkexec(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_USER)); return pte; } |
285 | extern inline pte_t pte_mkdirty(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); return pte; } | 285 | static inline pte_t pte_mkdirty(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); return pte; } |
286 | extern inline pte_t pte_mkyoung(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_ACCESSED)); return pte; } | 286 | static inline pte_t pte_mkyoung(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_ACCESSED)); return pte; } |
287 | extern inline pte_t pte_mkwrite(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_RW)); return pte; } | 287 | static inline pte_t pte_mkwrite(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_RW)); return pte; } |
288 | extern inline pte_t pte_mkhuge(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | __LARGE_PTE)); return pte; } | 288 | static inline pte_t pte_mkhuge(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | __LARGE_PTE)); return pte; } |
289 | 289 | ||
290 | struct vm_area_struct; | 290 | struct vm_area_struct; |
291 | 291 | ||
diff --git a/include/asm-x86_64/processor.h b/include/asm-x86_64/processor.h index 4861246548f7..87a282b1043a 100644 --- a/include/asm-x86_64/processor.h +++ b/include/asm-x86_64/processor.h | |||
@@ -227,7 +227,13 @@ struct tss_struct { | |||
227 | extern struct cpuinfo_x86 boot_cpu_data; | 227 | extern struct cpuinfo_x86 boot_cpu_data; |
228 | DECLARE_PER_CPU(struct tss_struct,init_tss); | 228 | DECLARE_PER_CPU(struct tss_struct,init_tss); |
229 | 229 | ||
230 | #ifdef CONFIG_X86_VSMP | ||
231 | #define ARCH_MIN_TASKALIGN (1 << INTERNODE_CACHE_SHIFT) | ||
232 | #define ARCH_MIN_MMSTRUCT_ALIGN (1 << INTERNODE_CACHE_SHIFT) | ||
233 | #else | ||
230 | #define ARCH_MIN_TASKALIGN 16 | 234 | #define ARCH_MIN_TASKALIGN 16 |
235 | #define ARCH_MIN_MMSTRUCT_ALIGN 0 | ||
236 | #endif | ||
231 | 237 | ||
232 | struct thread_struct { | 238 | struct thread_struct { |
233 | unsigned long rsp0; | 239 | unsigned long rsp0; |
@@ -273,8 +279,6 @@ struct thread_struct { | |||
273 | #define DEBUG_STACK 4 | 279 | #define DEBUG_STACK 4 |
274 | #define MCE_STACK 5 | 280 | #define MCE_STACK 5 |
275 | #define N_EXCEPTION_STACKS 5 /* hw limit: 7 */ | 281 | #define N_EXCEPTION_STACKS 5 /* hw limit: 7 */ |
276 | #define EXCEPTION_STKSZ (PAGE_SIZE << EXCEPTION_STACK_ORDER) | ||
277 | #define EXCEPTION_STACK_ORDER 0 | ||
278 | 282 | ||
279 | #define start_thread(regs,new_rip,new_rsp) do { \ | 283 | #define start_thread(regs,new_rip,new_rsp) do { \ |
280 | asm volatile("movl %0,%%fs; movl %0,%%es; movl %0,%%ds": :"r" (0)); \ | 284 | asm volatile("movl %0,%%fs; movl %0,%%es; movl %0,%%ds": :"r" (0)); \ |
@@ -317,8 +321,8 @@ extern long kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); | |||
317 | #define thread_saved_pc(t) (*(unsigned long *)((t)->thread.rsp - 8)) | 321 | #define thread_saved_pc(t) (*(unsigned long *)((t)->thread.rsp - 8)) |
318 | 322 | ||
319 | extern unsigned long get_wchan(struct task_struct *p); | 323 | extern unsigned long get_wchan(struct task_struct *p); |
320 | #define KSTK_EIP(tsk) \ | 324 | #define task_pt_regs(tsk) ((struct pt_regs *)(tsk)->thread.rsp0 - 1) |
321 | (((struct pt_regs *)(tsk->thread.rsp0 - sizeof(struct pt_regs)))->rip) | 325 | #define KSTK_EIP(tsk) (task_pt_regs(tsk)->rip) |
322 | #define KSTK_ESP(tsk) -1 /* sorry. doesn't work for syscall. */ | 326 | #define KSTK_ESP(tsk) -1 /* sorry. doesn't work for syscall. */ |
323 | 327 | ||
324 | 328 | ||
diff --git a/include/asm-x86_64/proto.h b/include/asm-x86_64/proto.h index 34501086afef..115e496c6139 100644 --- a/include/asm-x86_64/proto.h +++ b/include/asm-x86_64/proto.h | |||
@@ -67,8 +67,6 @@ extern void load_gs_index(unsigned gs); | |||
67 | 67 | ||
68 | extern unsigned long end_pfn_map; | 68 | extern unsigned long end_pfn_map; |
69 | 69 | ||
70 | extern cpumask_t cpu_initialized; | ||
71 | |||
72 | extern void show_trace(unsigned long * rsp); | 70 | extern void show_trace(unsigned long * rsp); |
73 | extern void show_registers(struct pt_regs *regs); | 71 | extern void show_registers(struct pt_regs *regs); |
74 | 72 | ||
@@ -91,8 +89,12 @@ extern void check_efer(void); | |||
91 | 89 | ||
92 | extern int unhandled_signal(struct task_struct *tsk, int sig); | 90 | extern int unhandled_signal(struct task_struct *tsk, int sig); |
93 | 91 | ||
92 | extern int unsynchronized_tsc(void); | ||
93 | |||
94 | extern void select_idle_routine(const struct cpuinfo_x86 *c); | 94 | extern void select_idle_routine(const struct cpuinfo_x86 *c); |
95 | extern void swiotlb_init(void); | 95 | |
96 | extern void gart_parse_options(char *); | ||
97 | extern void __init no_iommu_init(void); | ||
96 | 98 | ||
97 | extern unsigned long table_start, table_end; | 99 | extern unsigned long table_start, table_end; |
98 | 100 | ||
@@ -106,12 +108,17 @@ extern int skip_ioapic_setup; | |||
106 | extern int acpi_ht; | 108 | extern int acpi_ht; |
107 | extern int acpi_disabled; | 109 | extern int acpi_disabled; |
108 | 110 | ||
111 | #ifdef CONFIG_GART_IOMMU | ||
109 | extern int fallback_aper_order; | 112 | extern int fallback_aper_order; |
110 | extern int fallback_aper_force; | 113 | extern int fallback_aper_force; |
111 | extern int iommu_aperture; | 114 | extern int iommu_aperture; |
112 | extern int iommu_aperture_disabled; | ||
113 | extern int iommu_aperture_allowed; | 115 | extern int iommu_aperture_allowed; |
116 | extern int iommu_aperture_disabled; | ||
114 | extern int fix_aperture; | 117 | extern int fix_aperture; |
118 | #else | ||
119 | #define iommu_aperture 0 | ||
120 | #define iommu_aperture_allowed 0 | ||
121 | #endif | ||
115 | extern int force_iommu; | 122 | extern int force_iommu; |
116 | 123 | ||
117 | extern int reboot_force; | 124 | extern int reboot_force; |
diff --git a/include/asm-x86_64/segment.h b/include/asm-x86_64/segment.h index 44adaf18c11e..d4bed33fb32c 100644 --- a/include/asm-x86_64/segment.h +++ b/include/asm-x86_64/segment.h | |||
@@ -19,15 +19,13 @@ | |||
19 | #define __USER_DS 0x2b /* 5*8+3 */ | 19 | #define __USER_DS 0x2b /* 5*8+3 */ |
20 | #define __USER_CS 0x33 /* 6*8+3 */ | 20 | #define __USER_CS 0x33 /* 6*8+3 */ |
21 | #define __USER32_DS __USER_DS | 21 | #define __USER32_DS __USER_DS |
22 | #define __KERNEL16_CS (GDT_ENTRY_KERNELCS16 * 8) | ||
23 | #define __KERNEL_COMPAT32_CS 0x8 | ||
24 | 22 | ||
25 | #define GDT_ENTRY_TLS 1 | 23 | #define GDT_ENTRY_TLS 1 |
26 | #define GDT_ENTRY_TSS 8 /* needs two entries */ | 24 | #define GDT_ENTRY_TSS 8 /* needs two entries */ |
27 | #define GDT_ENTRY_LDT 10 /* needs two entries */ | 25 | #define GDT_ENTRY_LDT 10 /* needs two entries */ |
28 | #define GDT_ENTRY_TLS_MIN 12 | 26 | #define GDT_ENTRY_TLS_MIN 12 |
29 | #define GDT_ENTRY_TLS_MAX 14 | 27 | #define GDT_ENTRY_TLS_MAX 14 |
30 | #define GDT_ENTRY_KERNELCS16 15 | 28 | /* 15 free */ |
31 | 29 | ||
32 | #define GDT_ENTRY_TLS_ENTRIES 3 | 30 | #define GDT_ENTRY_TLS_ENTRIES 3 |
33 | 31 | ||
diff --git a/include/asm-x86_64/smp.h b/include/asm-x86_64/smp.h index d030409a8fb5..9ccbb2cfd5c0 100644 --- a/include/asm-x86_64/smp.h +++ b/include/asm-x86_64/smp.h | |||
@@ -35,6 +35,7 @@ extern cpumask_t cpu_present_mask; | |||
35 | extern cpumask_t cpu_possible_map; | 35 | extern cpumask_t cpu_possible_map; |
36 | extern cpumask_t cpu_online_map; | 36 | extern cpumask_t cpu_online_map; |
37 | extern cpumask_t cpu_callout_map; | 37 | extern cpumask_t cpu_callout_map; |
38 | extern cpumask_t cpu_initialized; | ||
38 | 39 | ||
39 | /* | 40 | /* |
40 | * Private routines/data | 41 | * Private routines/data |
diff --git a/include/asm-x86_64/swiotlb.h b/include/asm-x86_64/swiotlb.h index dddf1b218681..60757efd1353 100644 --- a/include/asm-x86_64/swiotlb.h +++ b/include/asm-x86_64/swiotlb.h | |||
@@ -3,10 +3,14 @@ | |||
3 | 3 | ||
4 | #include <linux/config.h> | 4 | #include <linux/config.h> |
5 | 5 | ||
6 | #include <asm/dma-mapping.h> | ||
7 | |||
6 | /* SWIOTLB interface */ | 8 | /* SWIOTLB interface */ |
7 | 9 | ||
8 | extern dma_addr_t swiotlb_map_single(struct device *hwdev, void *ptr, size_t size, | 10 | extern dma_addr_t swiotlb_map_single(struct device *hwdev, void *ptr, |
9 | int dir); | 11 | size_t size, int dir); |
12 | extern void *swiotlb_alloc_coherent(struct device *hwdev, size_t size, | ||
13 | dma_addr_t *dma_handle, gfp_t flags); | ||
10 | extern void swiotlb_unmap_single(struct device *hwdev, dma_addr_t dev_addr, | 14 | extern void swiotlb_unmap_single(struct device *hwdev, dma_addr_t dev_addr, |
11 | size_t size, int dir); | 15 | size_t size, int dir); |
12 | extern void swiotlb_sync_single_for_cpu(struct device *hwdev, | 16 | extern void swiotlb_sync_single_for_cpu(struct device *hwdev, |
@@ -34,10 +38,10 @@ extern int swiotlb_map_sg(struct device *hwdev, struct scatterlist *sg, | |||
34 | extern void swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg, | 38 | extern void swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg, |
35 | int nents, int direction); | 39 | int nents, int direction); |
36 | extern int swiotlb_dma_mapping_error(dma_addr_t dma_addr); | 40 | extern int swiotlb_dma_mapping_error(dma_addr_t dma_addr); |
37 | extern void *swiotlb_alloc_coherent (struct device *hwdev, size_t size, | ||
38 | dma_addr_t *dma_handle, gfp_t flags); | ||
39 | extern void swiotlb_free_coherent (struct device *hwdev, size_t size, | 41 | extern void swiotlb_free_coherent (struct device *hwdev, size_t size, |
40 | void *vaddr, dma_addr_t dma_handle); | 42 | void *vaddr, dma_addr_t dma_handle); |
43 | extern int swiotlb_dma_supported(struct device *hwdev, u64 mask); | ||
44 | extern void swiotlb_init(void); | ||
41 | 45 | ||
42 | #ifdef CONFIG_SWIOTLB | 46 | #ifdef CONFIG_SWIOTLB |
43 | extern int swiotlb; | 47 | extern int swiotlb; |
@@ -45,4 +49,6 @@ extern int swiotlb; | |||
45 | #define swiotlb 0 | 49 | #define swiotlb 0 |
46 | #endif | 50 | #endif |
47 | 51 | ||
48 | #endif | 52 | extern void pci_swiotlb_init(void); |
53 | |||
54 | #endif /* _ASM_SWTIOLB_H */ | ||
diff --git a/include/asm-x86_64/system.h b/include/asm-x86_64/system.h index b34cc2ee222b..0eacbefb7dd0 100644 --- a/include/asm-x86_64/system.h +++ b/include/asm-x86_64/system.h | |||
@@ -20,8 +20,8 @@ | |||
20 | #define __RESTORE(reg,offset) "movq (14-" #offset ")*8(%%rsp),%%" #reg "\n\t" | 20 | #define __RESTORE(reg,offset) "movq (14-" #offset ")*8(%%rsp),%%" #reg "\n\t" |
21 | 21 | ||
22 | /* frame pointer must be last for get_wchan */ | 22 | /* frame pointer must be last for get_wchan */ |
23 | #define SAVE_CONTEXT "pushfq ; pushq %%rbp ; movq %%rsi,%%rbp\n\t" | 23 | #define SAVE_CONTEXT "pushq %%rbp ; movq %%rsi,%%rbp\n\t" |
24 | #define RESTORE_CONTEXT "movq %%rbp,%%rsi ; popq %%rbp ; popfq\n\t" | 24 | #define RESTORE_CONTEXT "movq %%rbp,%%rsi ; popq %%rbp\n\t" |
25 | 25 | ||
26 | #define __EXTRA_CLOBBER \ | 26 | #define __EXTRA_CLOBBER \ |
27 | ,"rcx","rbx","rdx","r8","r9","r10","r11","r12","r13","r14","r15" | 27 | ,"rcx","rbx","rdx","r8","r9","r10","r11","r12","r13","r14","r15" |
@@ -137,6 +137,21 @@ struct alt_instr { | |||
137 | "663:\n\t" newinstr "\n664:\n" /* replacement */ \ | 137 | "663:\n\t" newinstr "\n664:\n" /* replacement */ \ |
138 | ".previous" :: "i" (feature), ##input) | 138 | ".previous" :: "i" (feature), ##input) |
139 | 139 | ||
140 | /* Like alternative_input, but with a single output argument */ | ||
141 | #define alternative_io(oldinstr, newinstr, feature, output, input...) \ | ||
142 | asm volatile ("661:\n\t" oldinstr "\n662:\n" \ | ||
143 | ".section .altinstructions,\"a\"\n" \ | ||
144 | " .align 8\n" \ | ||
145 | " .quad 661b\n" /* label */ \ | ||
146 | " .quad 663f\n" /* new instruction */ \ | ||
147 | " .byte %c[feat]\n" /* feature bit */ \ | ||
148 | " .byte 662b-661b\n" /* sourcelen */ \ | ||
149 | " .byte 664f-663f\n" /* replacementlen */ \ | ||
150 | ".previous\n" \ | ||
151 | ".section .altinstr_replacement,\"ax\"\n" \ | ||
152 | "663:\n\t" newinstr "\n664:\n" /* replacement */ \ | ||
153 | ".previous" : output : [feat] "i" (feature), ##input) | ||
154 | |||
140 | /* | 155 | /* |
141 | * Clear and set 'TS' bit respectively | 156 | * Clear and set 'TS' bit respectively |
142 | */ | 157 | */ |
@@ -178,6 +193,15 @@ static inline void write_cr4(unsigned long val) | |||
178 | #define wbinvd() \ | 193 | #define wbinvd() \ |
179 | __asm__ __volatile__ ("wbinvd": : :"memory"); | 194 | __asm__ __volatile__ ("wbinvd": : :"memory"); |
180 | 195 | ||
196 | /* | ||
197 | * On SMP systems, when the scheduler does migration-cost autodetection, | ||
198 | * it needs a way to flush as much of the CPU's caches as possible. | ||
199 | */ | ||
200 | static inline void sched_cacheflush(void) | ||
201 | { | ||
202 | wbinvd(); | ||
203 | } | ||
204 | |||
181 | #endif /* __KERNEL__ */ | 205 | #endif /* __KERNEL__ */ |
182 | 206 | ||
183 | #define nop() __asm__ __volatile__ ("nop") | 207 | #define nop() __asm__ __volatile__ ("nop") |
@@ -311,8 +335,25 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, | |||
311 | /* interrupt control.. */ | 335 | /* interrupt control.. */ |
312 | #define local_save_flags(x) do { warn_if_not_ulong(x); __asm__ __volatile__("# save_flags \n\t pushfq ; popq %q0":"=g" (x): /* no input */ :"memory"); } while (0) | 336 | #define local_save_flags(x) do { warn_if_not_ulong(x); __asm__ __volatile__("# save_flags \n\t pushfq ; popq %q0":"=g" (x): /* no input */ :"memory"); } while (0) |
313 | #define local_irq_restore(x) __asm__ __volatile__("# restore_flags \n\t pushq %0 ; popfq": /* no output */ :"g" (x):"memory", "cc") | 337 | #define local_irq_restore(x) __asm__ __volatile__("# restore_flags \n\t pushq %0 ; popfq": /* no output */ :"g" (x):"memory", "cc") |
338 | |||
339 | #ifdef CONFIG_X86_VSMP | ||
340 | /* Interrupt control for VSMP architecture */ | ||
341 | #define local_irq_disable() do { unsigned long flags; local_save_flags(flags); local_irq_restore((flags & ~(1 << 9)) | (1 << 18)); } while (0) | ||
342 | #define local_irq_enable() do { unsigned long flags; local_save_flags(flags); local_irq_restore((flags | (1 << 9)) & ~(1 << 18)); } while (0) | ||
343 | |||
344 | #define irqs_disabled() \ | ||
345 | ({ \ | ||
346 | unsigned long flags; \ | ||
347 | local_save_flags(flags); \ | ||
348 | (flags & (1<<18)) || !(flags & (1<<9)); \ | ||
349 | }) | ||
350 | |||
351 | /* For spinlocks etc */ | ||
352 | #define local_irq_save(x) do { local_save_flags(x); local_irq_restore((x & ~(1 << 9)) | (1 << 18)); } while (0) | ||
353 | #else /* CONFIG_X86_VSMP */ | ||
314 | #define local_irq_disable() __asm__ __volatile__("cli": : :"memory") | 354 | #define local_irq_disable() __asm__ __volatile__("cli": : :"memory") |
315 | #define local_irq_enable() __asm__ __volatile__("sti": : :"memory") | 355 | #define local_irq_enable() __asm__ __volatile__("sti": : :"memory") |
356 | |||
316 | /* used in the idle loop; sti takes one instruction cycle to complete */ | 357 | /* used in the idle loop; sti takes one instruction cycle to complete */ |
317 | #define safe_halt() __asm__ __volatile__("sti; hlt": : :"memory") | 358 | #define safe_halt() __asm__ __volatile__("sti; hlt": : :"memory") |
318 | /* used when interrupts are already enabled or to shutdown the processor */ | 359 | /* used when interrupts are already enabled or to shutdown the processor */ |
@@ -327,16 +368,10 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, | |||
327 | 368 | ||
328 | /* For spinlocks etc */ | 369 | /* For spinlocks etc */ |
329 | #define local_irq_save(x) do { warn_if_not_ulong(x); __asm__ __volatile__("# local_irq_save \n\t pushfq ; popq %0 ; cli":"=g" (x): /* no input */ :"memory"); } while (0) | 370 | #define local_irq_save(x) do { warn_if_not_ulong(x); __asm__ __volatile__("# local_irq_save \n\t pushfq ; popq %0 ; cli":"=g" (x): /* no input */ :"memory"); } while (0) |
371 | #endif | ||
330 | 372 | ||
331 | void cpu_idle_wait(void); | 373 | void cpu_idle_wait(void); |
332 | 374 | ||
333 | /* | ||
334 | * disable hlt during certain critical i/o operations | ||
335 | */ | ||
336 | #define HAVE_DISABLE_HLT | ||
337 | void disable_hlt(void); | ||
338 | void enable_hlt(void); | ||
339 | |||
340 | extern unsigned long arch_align_stack(unsigned long sp); | 375 | extern unsigned long arch_align_stack(unsigned long sp); |
341 | 376 | ||
342 | #endif | 377 | #endif |
diff --git a/include/asm-x86_64/thread_info.h b/include/asm-x86_64/thread_info.h index 08eb6e4f3737..4ac0e0a36934 100644 --- a/include/asm-x86_64/thread_info.h +++ b/include/asm-x86_64/thread_info.h | |||
@@ -76,8 +76,6 @@ static inline struct thread_info *stack_thread_info(void) | |||
76 | #define alloc_thread_info(tsk) \ | 76 | #define alloc_thread_info(tsk) \ |
77 | ((struct thread_info *) __get_free_pages(GFP_KERNEL,THREAD_ORDER)) | 77 | ((struct thread_info *) __get_free_pages(GFP_KERNEL,THREAD_ORDER)) |
78 | #define free_thread_info(ti) free_pages((unsigned long) (ti), THREAD_ORDER) | 78 | #define free_thread_info(ti) free_pages((unsigned long) (ti), THREAD_ORDER) |
79 | #define get_thread_info(ti) get_task_struct((ti)->task) | ||
80 | #define put_thread_info(ti) put_task_struct((ti)->task) | ||
81 | 79 | ||
82 | #else /* !__ASSEMBLY__ */ | 80 | #else /* !__ASSEMBLY__ */ |
83 | 81 | ||
@@ -138,6 +136,7 @@ static inline struct thread_info *stack_thread_info(void) | |||
138 | * have to worry about atomic accesses. | 136 | * have to worry about atomic accesses. |
139 | */ | 137 | */ |
140 | #define TS_USEDFPU 0x0001 /* FPU was used by this task this quantum (SMP) */ | 138 | #define TS_USEDFPU 0x0001 /* FPU was used by this task this quantum (SMP) */ |
139 | #define TS_COMPAT 0x0002 /* 32bit syscall active */ | ||
141 | 140 | ||
142 | #endif /* __KERNEL__ */ | 141 | #endif /* __KERNEL__ */ |
143 | 142 | ||
diff --git a/include/asm-x86_64/timex.h b/include/asm-x86_64/timex.h index f971f45d6d78..f18443fcdf04 100644 --- a/include/asm-x86_64/timex.h +++ b/include/asm-x86_64/timex.h | |||
@@ -10,6 +10,9 @@ | |||
10 | #include <asm/msr.h> | 10 | #include <asm/msr.h> |
11 | #include <asm/vsyscall.h> | 11 | #include <asm/vsyscall.h> |
12 | #include <asm/hpet.h> | 12 | #include <asm/hpet.h> |
13 | #include <asm/system.h> | ||
14 | #include <asm/processor.h> | ||
15 | #include <linux/compiler.h> | ||
13 | 16 | ||
14 | #define CLOCK_TICK_RATE PIT_TICK_RATE /* Underlying HZ */ | 17 | #define CLOCK_TICK_RATE PIT_TICK_RATE /* Underlying HZ */ |
15 | 18 | ||
@@ -23,6 +26,19 @@ static inline cycles_t get_cycles (void) | |||
23 | return ret; | 26 | return ret; |
24 | } | 27 | } |
25 | 28 | ||
29 | /* Like get_cycles, but make sure the CPU is synchronized. */ | ||
30 | static __always_inline cycles_t get_cycles_sync(void) | ||
31 | { | ||
32 | unsigned long long ret; | ||
33 | unsigned eax; | ||
34 | /* Don't do an additional sync on CPUs where we know | ||
35 | RDTSC is already synchronous. */ | ||
36 | alternative_io(ASM_NOP2, "cpuid", X86_FEATURE_SYNC_RDTSC, | ||
37 | "=a" (eax), "0" (1) : "ebx","ecx","edx","memory"); | ||
38 | rdtscll(ret); | ||
39 | return ret; | ||
40 | } | ||
41 | |||
26 | extern unsigned int cpu_khz; | 42 | extern unsigned int cpu_khz; |
27 | 43 | ||
28 | extern int read_current_timer(unsigned long *timer_value); | 44 | extern int read_current_timer(unsigned long *timer_value); |
diff --git a/include/asm-x86_64/topology.h b/include/asm-x86_64/topology.h index 7d82bc56b9fa..2fa7f27381b4 100644 --- a/include/asm-x86_64/topology.h +++ b/include/asm-x86_64/topology.h | |||
@@ -39,7 +39,6 @@ extern int __node_distance(int, int); | |||
39 | .max_interval = 32, \ | 39 | .max_interval = 32, \ |
40 | .busy_factor = 32, \ | 40 | .busy_factor = 32, \ |
41 | .imbalance_pct = 125, \ | 41 | .imbalance_pct = 125, \ |
42 | .cache_hot_time = (10*1000000), \ | ||
43 | .cache_nice_tries = 2, \ | 42 | .cache_nice_tries = 2, \ |
44 | .busy_idx = 3, \ | 43 | .busy_idx = 3, \ |
45 | .idle_idx = 2, \ | 44 | .idle_idx = 2, \ |
diff --git a/include/asm-x86_64/uaccess.h b/include/asm-x86_64/uaccess.h index 1bb8b8a24436..2892c4b7a28b 100644 --- a/include/asm-x86_64/uaccess.h +++ b/include/asm-x86_64/uaccess.h | |||
@@ -348,6 +348,7 @@ static inline int __copy_in_user(void __user *dst, const void __user *src, unsig | |||
348 | long strncpy_from_user(char *dst, const char __user *src, long count); | 348 | long strncpy_from_user(char *dst, const char __user *src, long count); |
349 | long __strncpy_from_user(char *dst, const char __user *src, long count); | 349 | long __strncpy_from_user(char *dst, const char __user *src, long count); |
350 | long strnlen_user(const char __user *str, long n); | 350 | long strnlen_user(const char __user *str, long n); |
351 | long __strnlen_user(const char __user *str, long n); | ||
351 | long strlen_user(const char __user *str); | 352 | long strlen_user(const char __user *str); |
352 | unsigned long clear_user(void __user *mem, unsigned long len); | 353 | unsigned long clear_user(void __user *mem, unsigned long len); |
353 | unsigned long __clear_user(void __user *mem, unsigned long len); | 354 | unsigned long __clear_user(void __user *mem, unsigned long len); |
diff --git a/include/asm-x86_64/vsyscall.h b/include/asm-x86_64/vsyscall.h index 438a3f52f839..a85e16f56d73 100644 --- a/include/asm-x86_64/vsyscall.h +++ b/include/asm-x86_64/vsyscall.h | |||
@@ -36,8 +36,8 @@ struct vxtime_data { | |||
36 | int mode; | 36 | int mode; |
37 | }; | 37 | }; |
38 | 38 | ||
39 | #define hpet_readl(a) readl((void *)fix_to_virt(FIX_HPET_BASE) + a) | 39 | #define hpet_readl(a) readl((const void __iomem *)fix_to_virt(FIX_HPET_BASE) + a) |
40 | #define hpet_writel(d,a) writel(d, (void *)fix_to_virt(FIX_HPET_BASE) + a) | 40 | #define hpet_writel(d,a) writel(d, (void __iomem *)fix_to_virt(FIX_HPET_BASE) + a) |
41 | 41 | ||
42 | /* vsyscall space (readonly) */ | 42 | /* vsyscall space (readonly) */ |
43 | extern struct vxtime_data __vxtime; | 43 | extern struct vxtime_data __vxtime; |
diff --git a/include/asm-xtensa/ioctl.h b/include/asm-xtensa/ioctl.h index 856c605d62b1..b279fe06dfe5 100644 --- a/include/asm-xtensa/ioctl.h +++ b/include/asm-xtensa/ioctl.h | |||
@@ -1,83 +1 @@ | |||
1 | /* | #include <asm-generic/ioctl.h> | |
2 | * include/asm-xtensa/ioctl.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2003 - 2005 Tensilica Inc. | ||
9 | * | ||
10 | * Derived from "include/asm-i386/ioctl.h" | ||
11 | */ | ||
12 | |||
13 | #ifndef _XTENSA_IOCTL_H | ||
14 | #define _XTENSA_IOCTL_H | ||
15 | |||
16 | |||
17 | /* ioctl command encoding: 32 bits total, command in lower 16 bits, | ||
18 | * size of the parameter structure in the lower 14 bits of the | ||
19 | * upper 16 bits. | ||
20 | * Encoding the size of the parameter structure in the ioctl request | ||
21 | * is useful for catching programs compiled with old versions | ||
22 | * and to avoid overwriting user space outside the user buffer area. | ||
23 | * The highest 2 bits are reserved for indicating the ``access mode''. | ||
24 | * NOTE: This limits the max parameter size to 16kB -1 ! | ||
25 | */ | ||
26 | |||
27 | /* | ||
28 | * The following is for compatibility across the various Linux | ||
29 | * platforms. The i386 ioctl numbering scheme doesn't really enforce | ||
30 | * a type field. De facto, however, the top 8 bits of the lower 16 | ||
31 | * bits are indeed used as a type field, so we might just as well make | ||
32 | * this explicit here. Please be sure to use the decoding macros | ||
33 | * below from now on. | ||
34 | */ | ||
35 | #define _IOC_NRBITS 8 | ||
36 | #define _IOC_TYPEBITS 8 | ||
37 | #define _IOC_SIZEBITS 14 | ||
38 | #define _IOC_DIRBITS 2 | ||
39 | |||
40 | #define _IOC_NRMASK ((1 << _IOC_NRBITS)-1) | ||
41 | #define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1) | ||
42 | #define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1) | ||
43 | #define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1) | ||
44 | |||
45 | #define _IOC_NRSHIFT 0 | ||
46 | #define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS) | ||
47 | #define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS) | ||
48 | #define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS) | ||
49 | |||
50 | /* | ||
51 | * Direction bits. | ||
52 | */ | ||
53 | #define _IOC_NONE 0U | ||
54 | #define _IOC_WRITE 1U | ||
55 | #define _IOC_READ 2U | ||
56 | |||
57 | #define _IOC(dir,type,nr,size) \ | ||
58 | (((dir) << _IOC_DIRSHIFT) | \ | ||
59 | ((type) << _IOC_TYPESHIFT) | \ | ||
60 | ((nr) << _IOC_NRSHIFT) | \ | ||
61 | ((size) << _IOC_SIZESHIFT)) | ||
62 | |||
63 | /* used to create numbers */ | ||
64 | #define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0) | ||
65 | #define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size)) | ||
66 | #define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size)) | ||
67 | #define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size)) | ||
68 | |||
69 | /* used to decode ioctl numbers.. */ | ||
70 | #define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) | ||
71 | #define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK) | ||
72 | #define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK) | ||
73 | #define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK) | ||
74 | |||
75 | /* ...and for the drivers/sound files... */ | ||
76 | |||
77 | #define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT) | ||
78 | #define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT) | ||
79 | #define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT) | ||
80 | #define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT) | ||
81 | #define IOCSIZE_SHIFT (_IOC_SIZESHIFT) | ||
82 | |||
83 | #endif | ||
diff --git a/include/asm-xtensa/processor.h b/include/asm-xtensa/processor.h index 9cab5e4298b9..d1d72ad36f08 100644 --- a/include/asm-xtensa/processor.h +++ b/include/asm-xtensa/processor.h | |||
@@ -184,12 +184,12 @@ extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); | |||
184 | #define release_segments(mm) do { } while(0) | 184 | #define release_segments(mm) do { } while(0) |
185 | #define forget_segments() do { } while (0) | 185 | #define forget_segments() do { } while (0) |
186 | 186 | ||
187 | #define thread_saved_pc(tsk) (xtensa_pt_regs(tsk)->pc) | 187 | #define thread_saved_pc(tsk) (task_pt_regs(tsk)->pc) |
188 | 188 | ||
189 | extern unsigned long get_wchan(struct task_struct *p); | 189 | extern unsigned long get_wchan(struct task_struct *p); |
190 | 190 | ||
191 | #define KSTK_EIP(tsk) (xtensa_pt_regs(tsk)->pc) | 191 | #define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc) |
192 | #define KSTK_ESP(tsk) (xtensa_pt_regs(tsk)->areg[1]) | 192 | #define KSTK_ESP(tsk) (task_pt_regs(tsk)->areg[1]) |
193 | 193 | ||
194 | #define cpu_relax() do { } while (0) | 194 | #define cpu_relax() do { } while (0) |
195 | 195 | ||
diff --git a/include/asm-xtensa/ptrace.h b/include/asm-xtensa/ptrace.h index aa4fd7fb3ce7..a5ac71a5205c 100644 --- a/include/asm-xtensa/ptrace.h +++ b/include/asm-xtensa/ptrace.h | |||
@@ -113,8 +113,8 @@ struct pt_regs { | |||
113 | }; | 113 | }; |
114 | 114 | ||
115 | #ifdef __KERNEL__ | 115 | #ifdef __KERNEL__ |
116 | # define xtensa_pt_regs(tsk) ((struct pt_regs*) \ | 116 | # define task_pt_regs(tsk) ((struct pt_regs*) \ |
117 | (((long)(tsk)->thread_info + KERNEL_STACK_SIZE - (XCHAL_NUM_AREGS-16)*4)) - 1) | 117 | (task_stack_page(tsk) + KERNEL_STACK_SIZE - (XCHAL_NUM_AREGS-16)*4) - 1) |
118 | # define user_mode(regs) (((regs)->ps & 0x00000020)!=0) | 118 | # define user_mode(regs) (((regs)->ps & 0x00000020)!=0) |
119 | # define instruction_pointer(regs) ((regs)->pc) | 119 | # define instruction_pointer(regs) ((regs)->pc) |
120 | extern void show_regs(struct pt_regs *); | 120 | extern void show_regs(struct pt_regs *); |
diff --git a/include/asm-xtensa/thread_info.h b/include/asm-xtensa/thread_info.h index af208d41fd82..5ae34ab71597 100644 --- a/include/asm-xtensa/thread_info.h +++ b/include/asm-xtensa/thread_info.h | |||
@@ -93,8 +93,6 @@ static inline struct thread_info *current_thread_info(void) | |||
93 | /* thread information allocation */ | 93 | /* thread information allocation */ |
94 | #define alloc_thread_info(tsk) ((struct thread_info *) __get_free_pages(GFP_KERNEL,1)) | 94 | #define alloc_thread_info(tsk) ((struct thread_info *) __get_free_pages(GFP_KERNEL,1)) |
95 | #define free_thread_info(ti) free_pages((unsigned long) (ti), 1) | 95 | #define free_thread_info(ti) free_pages((unsigned long) (ti), 1) |
96 | #define get_thread_info(ti) get_task_struct((ti)->task) | ||
97 | #define put_thread_info(ti) put_task_struct((ti)->task) | ||
98 | 96 | ||
99 | #else /* !__ASSEMBLY__ */ | 97 | #else /* !__ASSEMBLY__ */ |
100 | 98 | ||
diff --git a/include/linux/cache.h b/include/linux/cache.h index ffe52210fc4f..d22e632f41fb 100644 --- a/include/linux/cache.h +++ b/include/linux/cache.h | |||
@@ -13,7 +13,7 @@ | |||
13 | #define SMP_CACHE_BYTES L1_CACHE_BYTES | 13 | #define SMP_CACHE_BYTES L1_CACHE_BYTES |
14 | #endif | 14 | #endif |
15 | 15 | ||
16 | #if defined(CONFIG_X86) || defined(CONFIG_SPARC64) || defined(CONFIG_IA64) | 16 | #if defined(CONFIG_X86) || defined(CONFIG_SPARC64) || defined(CONFIG_IA64) || defined(CONFIG_PARISC) |
17 | #define __read_mostly __attribute__((__section__(".data.read_mostly"))) | 17 | #define __read_mostly __attribute__((__section__(".data.read_mostly"))) |
18 | #else | 18 | #else |
19 | #define __read_mostly | 19 | #define __read_mostly |
diff --git a/include/linux/calc64.h b/include/linux/calc64.h new file mode 100644 index 000000000000..ebf4b8f38d88 --- /dev/null +++ b/include/linux/calc64.h | |||
@@ -0,0 +1,49 @@ | |||
1 | #ifndef _LINUX_CALC64_H | ||
2 | #define _LINUX_CALC64_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | #include <asm/div64.h> | ||
6 | |||
7 | /* | ||
8 | * This is a generic macro which is used when the architecture | ||
9 | * specific div64.h does not provide a optimized one. | ||
10 | * | ||
11 | * The 64bit dividend is divided by the divisor (data type long), the | ||
12 | * result is returned and the remainder stored in the variable | ||
13 | * referenced by remainder (data type long *). In contrast to the | ||
14 | * do_div macro the dividend is kept intact. | ||
15 | */ | ||
16 | #ifndef div_long_long_rem | ||
17 | #define div_long_long_rem(dividend, divisor, remainder) \ | ||
18 | do_div_llr((dividend), divisor, remainder) | ||
19 | |||
20 | static inline unsigned long do_div_llr(const long long dividend, | ||
21 | const long divisor, long *remainder) | ||
22 | { | ||
23 | u64 result = dividend; | ||
24 | |||
25 | *(remainder) = do_div(result, divisor); | ||
26 | return (unsigned long) result; | ||
27 | } | ||
28 | #endif | ||
29 | |||
30 | /* | ||
31 | * Sign aware variation of the above. On some architectures a | ||
32 | * negative dividend leads to an divide overflow exception, which | ||
33 | * is avoided by the sign check. | ||
34 | */ | ||
35 | static inline long div_long_long_rem_signed(const long long dividend, | ||
36 | const long divisor, long *remainder) | ||
37 | { | ||
38 | long res; | ||
39 | |||
40 | if (unlikely(dividend < 0)) { | ||
41 | res = -div_long_long_rem(-dividend, divisor, remainder); | ||
42 | *remainder = -(*remainder); | ||
43 | } else | ||
44 | res = div_long_long_rem(dividend, divisor, remainder); | ||
45 | |||
46 | return res; | ||
47 | } | ||
48 | |||
49 | #endif | ||
diff --git a/include/linux/capability.h b/include/linux/capability.h index 6b4618902d3d..5a23ce752629 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h | |||
@@ -43,6 +43,7 @@ typedef struct __user_cap_data_struct { | |||
43 | #ifdef __KERNEL__ | 43 | #ifdef __KERNEL__ |
44 | 44 | ||
45 | #include <linux/spinlock.h> | 45 | #include <linux/spinlock.h> |
46 | #include <asm/current.h> | ||
46 | 47 | ||
47 | /* #define STRICT_CAP_T_TYPECHECKS */ | 48 | /* #define STRICT_CAP_T_TYPECHECKS */ |
48 | 49 | ||
@@ -356,6 +357,8 @@ static inline kernel_cap_t cap_invert(kernel_cap_t c) | |||
356 | 357 | ||
357 | #define cap_is_fs_cap(c) (CAP_TO_MASK(c) & CAP_FS_MASK) | 358 | #define cap_is_fs_cap(c) (CAP_TO_MASK(c) & CAP_FS_MASK) |
358 | 359 | ||
360 | extern int capable(int cap); | ||
361 | |||
359 | #endif /* __KERNEL__ */ | 362 | #endif /* __KERNEL__ */ |
360 | 363 | ||
361 | #endif /* !_LINUX_CAPABILITY_H */ | 364 | #endif /* !_LINUX_CAPABILITY_H */ |
diff --git a/include/linux/compat_ioctl.h b/include/linux/compat_ioctl.h index 339878952f12..8fad50f8e389 100644 --- a/include/linux/compat_ioctl.h +++ b/include/linux/compat_ioctl.h | |||
@@ -2,14 +2,6 @@ | |||
2 | * compatible types passed or none at all... Please include | 2 | * compatible types passed or none at all... Please include |
3 | * only stuff that is compatible on *all architectures*. | 3 | * only stuff that is compatible on *all architectures*. |
4 | */ | 4 | */ |
5 | #ifndef COMPATIBLE_IOCTL /* pointer to compatible structure or no argument */ | ||
6 | #define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL((cmd),(ioctl_trans_handler_t)sys_ioctl) | ||
7 | #endif | ||
8 | |||
9 | #ifndef ULONG_IOCTL /* argument is an unsigned long integer, not a pointer */ | ||
10 | #define ULONG_IOCTL(cmd) HANDLE_IOCTL((cmd),(ioctl_trans_handler_t)sys_ioctl) | ||
11 | #endif | ||
12 | |||
13 | 5 | ||
14 | COMPATIBLE_IOCTL(0x4B50) /* KDGHWCLK - not in the kernel, but don't complain */ | 6 | COMPATIBLE_IOCTL(0x4B50) /* KDGHWCLK - not in the kernel, but don't complain */ |
15 | COMPATIBLE_IOCTL(0x4B51) /* KDSHWCLK - not in the kernel, but don't complain */ | 7 | COMPATIBLE_IOCTL(0x4B51) /* KDSHWCLK - not in the kernel, but don't complain */ |
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 2e05e1e6b0e6..6e1c44a935d4 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h | |||
@@ -11,9 +11,15 @@ | |||
11 | 11 | ||
12 | /* This macro obfuscates arithmetic on a variable address so that gcc | 12 | /* This macro obfuscates arithmetic on a variable address so that gcc |
13 | shouldn't recognize the original var, and make assumptions about it */ | 13 | shouldn't recognize the original var, and make assumptions about it */ |
14 | /* | ||
15 | * Versions of the ppc64 compiler before 4.1 had a bug where use of | ||
16 | * RELOC_HIDE could trash r30. The bug can be worked around by changing | ||
17 | * the inline assembly constraint from =g to =r, in this particular | ||
18 | * case either is valid. | ||
19 | */ | ||
14 | #define RELOC_HIDE(ptr, off) \ | 20 | #define RELOC_HIDE(ptr, off) \ |
15 | ({ unsigned long __ptr; \ | 21 | ({ unsigned long __ptr; \ |
16 | __asm__ ("" : "=g"(__ptr) : "0"(ptr)); \ | 22 | __asm__ ("" : "=r"(__ptr) : "0"(ptr)); \ |
17 | (typeof(ptr)) (__ptr + (off)); }) | 23 | (typeof(ptr)) (__ptr + (off)); }) |
18 | 24 | ||
19 | 25 | ||
diff --git a/include/linux/dmi.h b/include/linux/dmi.h index 05f4132622fc..2e6bbe014157 100644 --- a/include/linux/dmi.h +++ b/include/linux/dmi.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define __DMI_H__ | 2 | #define __DMI_H__ |
3 | 3 | ||
4 | #include <linux/list.h> | 4 | #include <linux/list.h> |
5 | #include <linux/config.h> | ||
5 | 6 | ||
6 | enum dmi_field { | 7 | enum dmi_field { |
7 | DMI_NONE, | 8 | DMI_NONE, |
@@ -60,12 +61,14 @@ struct dmi_device { | |||
60 | void *device_data; /* Type specific data */ | 61 | void *device_data; /* Type specific data */ |
61 | }; | 62 | }; |
62 | 63 | ||
63 | #if defined(CONFIG_X86_32) | 64 | #ifdef CONFIG_DMI |
64 | 65 | ||
65 | extern int dmi_check_system(struct dmi_system_id *list); | 66 | extern int dmi_check_system(struct dmi_system_id *list); |
66 | extern char * dmi_get_system_info(int field); | 67 | extern char * dmi_get_system_info(int field); |
67 | extern struct dmi_device * dmi_find_device(int type, const char *name, | 68 | extern struct dmi_device * dmi_find_device(int type, const char *name, |
68 | struct dmi_device *from); | 69 | struct dmi_device *from); |
70 | extern void dmi_scan_machine(void); | ||
71 | |||
69 | #else | 72 | #else |
70 | 73 | ||
71 | static inline int dmi_check_system(struct dmi_system_id *list) { return 0; } | 74 | static inline int dmi_check_system(struct dmi_system_id *list) { return 0; } |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 92ae3e2067b0..d1e370d25f7b 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -114,8 +114,7 @@ extern int dir_notify_enable; | |||
114 | /* | 114 | /* |
115 | * Superblock flags that can be altered by MS_REMOUNT | 115 | * Superblock flags that can be altered by MS_REMOUNT |
116 | */ | 116 | */ |
117 | #define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME|\ | 117 | #define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK) |
118 | MS_NODIRATIME) | ||
119 | 118 | ||
120 | /* | 119 | /* |
121 | * Old magic mount flag and mask | 120 | * Old magic mount flag and mask |
@@ -161,8 +160,6 @@ extern int dir_notify_enable; | |||
161 | #define IS_NOQUOTA(inode) ((inode)->i_flags & S_NOQUOTA) | 160 | #define IS_NOQUOTA(inode) ((inode)->i_flags & S_NOQUOTA) |
162 | #define IS_APPEND(inode) ((inode)->i_flags & S_APPEND) | 161 | #define IS_APPEND(inode) ((inode)->i_flags & S_APPEND) |
163 | #define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE) | 162 | #define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE) |
164 | #define IS_NOATIME(inode) (__IS_FLG(inode, MS_NOATIME) || ((inode)->i_flags & S_NOATIME)) | ||
165 | #define IS_NODIRATIME(inode) __IS_FLG(inode, MS_NODIRATIME) | ||
166 | #define IS_POSIXACL(inode) __IS_FLG(inode, MS_POSIXACL) | 163 | #define IS_POSIXACL(inode) __IS_FLG(inode, MS_POSIXACL) |
167 | 164 | ||
168 | #define IS_DEADDIR(inode) ((inode)->i_flags & S_DEAD) | 165 | #define IS_DEADDIR(inode) ((inode)->i_flags & S_DEAD) |
@@ -235,9 +232,6 @@ struct kstatfs; | |||
235 | struct vm_area_struct; | 232 | struct vm_area_struct; |
236 | struct vfsmount; | 233 | struct vfsmount; |
237 | 234 | ||
238 | /* Used to be a macro which just called the function, now just a function */ | ||
239 | extern void update_atime (struct inode *); | ||
240 | |||
241 | extern void __init inode_init(unsigned long); | 235 | extern void __init inode_init(unsigned long); |
242 | extern void __init inode_init_early(void); | 236 | extern void __init inode_init_early(void); |
243 | extern void __init mnt_init(unsigned long); | 237 | extern void __init mnt_init(unsigned long); |
@@ -1118,12 +1112,7 @@ static inline void mark_inode_dirty_sync(struct inode *inode) | |||
1118 | __mark_inode_dirty(inode, I_DIRTY_SYNC); | 1112 | __mark_inode_dirty(inode, I_DIRTY_SYNC); |
1119 | } | 1113 | } |
1120 | 1114 | ||
1121 | static inline void touch_atime(struct vfsmount *mnt, struct dentry *dentry) | 1115 | extern void touch_atime(struct vfsmount *mnt, struct dentry *dentry); |
1122 | { | ||
1123 | /* per-mountpoint checks will go here */ | ||
1124 | update_atime(dentry->d_inode); | ||
1125 | } | ||
1126 | |||
1127 | static inline void file_accessed(struct file *file) | 1116 | static inline void file_accessed(struct file *file) |
1128 | { | 1117 | { |
1129 | if (!(file->f_flags & O_NOATIME)) | 1118 | if (!(file->f_flags & O_NOATIME)) |
@@ -1716,7 +1705,7 @@ extern ssize_t simple_read_from_buffer(void __user *, size_t, loff_t *, const vo | |||
1716 | extern int inode_change_ok(struct inode *, struct iattr *); | 1705 | extern int inode_change_ok(struct inode *, struct iattr *); |
1717 | extern int __must_check inode_setattr(struct inode *, struct iattr *); | 1706 | extern int __must_check inode_setattr(struct inode *, struct iattr *); |
1718 | 1707 | ||
1719 | extern void inode_update_time(struct inode *inode, int ctime_too); | 1708 | extern void file_update_time(struct file *file); |
1720 | 1709 | ||
1721 | static inline ino_t parent_ino(struct dentry *dentry) | 1710 | static inline ino_t parent_ino(struct dentry *dentry) |
1722 | { | 1711 | { |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 8b2eab90abb6..20f9148e38d9 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -57,6 +57,7 @@ struct vm_area_struct; | |||
57 | __GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP| \ | 57 | __GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP| \ |
58 | __GFP_NOMEMALLOC|__GFP_HARDWALL) | 58 | __GFP_NOMEMALLOC|__GFP_HARDWALL) |
59 | 59 | ||
60 | /* GFP_ATOMIC means both !wait (__GFP_WAIT not set) and use emergency pool */ | ||
60 | #define GFP_ATOMIC (__GFP_HIGH) | 61 | #define GFP_ATOMIC (__GFP_HIGH) |
61 | #define GFP_NOIO (__GFP_WAIT) | 62 | #define GFP_NOIO (__GFP_WAIT) |
62 | #define GFP_NOFS (__GFP_WAIT | __GFP_IO) | 63 | #define GFP_NOFS (__GFP_WAIT | __GFP_IO) |
@@ -109,6 +110,10 @@ static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask, | |||
109 | if (unlikely(order >= MAX_ORDER)) | 110 | if (unlikely(order >= MAX_ORDER)) |
110 | return NULL; | 111 | return NULL; |
111 | 112 | ||
113 | /* Unknown node is current node */ | ||
114 | if (nid < 0) | ||
115 | nid = numa_node_id(); | ||
116 | |||
112 | return __alloc_pages(gfp_mask, order, | 117 | return __alloc_pages(gfp_mask, order, |
113 | NODE_DATA(nid)->node_zonelists + gfp_zone(gfp_mask)); | 118 | NODE_DATA(nid)->node_zonelists + gfp_zone(gfp_mask)); |
114 | } | 119 | } |
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h new file mode 100644 index 000000000000..089bfb1fa01a --- /dev/null +++ b/include/linux/hrtimer.h | |||
@@ -0,0 +1,139 @@ | |||
1 | /* | ||
2 | * include/linux/hrtimer.h | ||
3 | * | ||
4 | * hrtimers - High-resolution kernel timers | ||
5 | * | ||
6 | * Copyright(C) 2005, Thomas Gleixner <tglx@linutronix.de> | ||
7 | * Copyright(C) 2005, Red Hat, Inc., Ingo Molnar | ||
8 | * | ||
9 | * data type definitions, declarations, prototypes | ||
10 | * | ||
11 | * Started by: Thomas Gleixner and Ingo Molnar | ||
12 | * | ||
13 | * For licencing details see kernel-base/COPYING | ||
14 | */ | ||
15 | #ifndef _LINUX_HRTIMER_H | ||
16 | #define _LINUX_HRTIMER_H | ||
17 | |||
18 | #include <linux/rbtree.h> | ||
19 | #include <linux/ktime.h> | ||
20 | #include <linux/init.h> | ||
21 | #include <linux/list.h> | ||
22 | #include <linux/wait.h> | ||
23 | |||
24 | /* | ||
25 | * Mode arguments of xxx_hrtimer functions: | ||
26 | */ | ||
27 | enum hrtimer_mode { | ||
28 | HRTIMER_ABS, /* Time value is absolute */ | ||
29 | HRTIMER_REL, /* Time value is relative to now */ | ||
30 | }; | ||
31 | |||
32 | enum hrtimer_restart { | ||
33 | HRTIMER_NORESTART, | ||
34 | HRTIMER_RESTART, | ||
35 | }; | ||
36 | |||
37 | /* | ||
38 | * Timer states: | ||
39 | */ | ||
40 | enum hrtimer_state { | ||
41 | HRTIMER_INACTIVE, /* Timer is inactive */ | ||
42 | HRTIMER_EXPIRED, /* Timer is expired */ | ||
43 | HRTIMER_PENDING, /* Timer is pending */ | ||
44 | }; | ||
45 | |||
46 | struct hrtimer_base; | ||
47 | |||
48 | /** | ||
49 | * struct hrtimer - the basic hrtimer structure | ||
50 | * | ||
51 | * @node: red black tree node for time ordered insertion | ||
52 | * @expires: the absolute expiry time in the hrtimers internal | ||
53 | * representation. The time is related to the clock on | ||
54 | * which the timer is based. | ||
55 | * @state: state of the timer | ||
56 | * @function: timer expiry callback function | ||
57 | * @data: argument for the callback function | ||
58 | * @base: pointer to the timer base (per cpu and per clock) | ||
59 | * | ||
60 | * The hrtimer structure must be initialized by init_hrtimer_#CLOCKTYPE() | ||
61 | */ | ||
62 | struct hrtimer { | ||
63 | struct rb_node node; | ||
64 | ktime_t expires; | ||
65 | enum hrtimer_state state; | ||
66 | int (*function)(void *); | ||
67 | void *data; | ||
68 | struct hrtimer_base *base; | ||
69 | }; | ||
70 | |||
71 | /** | ||
72 | * struct hrtimer_base - the timer base for a specific clock | ||
73 | * | ||
74 | * @index: clock type index for per_cpu support when moving a timer | ||
75 | * to a base on another cpu. | ||
76 | * @lock: lock protecting the base and associated timers | ||
77 | * @active: red black tree root node for the active timers | ||
78 | * @first: pointer to the timer node which expires first | ||
79 | * @resolution: the resolution of the clock, in nanoseconds | ||
80 | * @get_time: function to retrieve the current time of the clock | ||
81 | * @curr_timer: the timer which is executing a callback right now | ||
82 | */ | ||
83 | struct hrtimer_base { | ||
84 | clockid_t index; | ||
85 | spinlock_t lock; | ||
86 | struct rb_root active; | ||
87 | struct rb_node *first; | ||
88 | ktime_t resolution; | ||
89 | ktime_t (*get_time)(void); | ||
90 | struct hrtimer *curr_timer; | ||
91 | }; | ||
92 | |||
93 | /* | ||
94 | * clock_was_set() is a NOP for non- high-resolution systems. The | ||
95 | * time-sorted order guarantees that a timer does not expire early and | ||
96 | * is expired in the next softirq when the clock was advanced. | ||
97 | */ | ||
98 | #define clock_was_set() do { } while (0) | ||
99 | |||
100 | /* Exported timer functions: */ | ||
101 | |||
102 | /* Initialize timers: */ | ||
103 | extern void hrtimer_init(struct hrtimer *timer, const clockid_t which_clock); | ||
104 | extern void hrtimer_rebase(struct hrtimer *timer, const clockid_t which_clock); | ||
105 | |||
106 | |||
107 | /* Basic timer operations: */ | ||
108 | extern int hrtimer_start(struct hrtimer *timer, ktime_t tim, | ||
109 | const enum hrtimer_mode mode); | ||
110 | extern int hrtimer_cancel(struct hrtimer *timer); | ||
111 | extern int hrtimer_try_to_cancel(struct hrtimer *timer); | ||
112 | |||
113 | #define hrtimer_restart(timer) hrtimer_start((timer), (timer)->expires, HRTIMER_ABS) | ||
114 | |||
115 | /* Query timers: */ | ||
116 | extern ktime_t hrtimer_get_remaining(const struct hrtimer *timer); | ||
117 | extern int hrtimer_get_res(const clockid_t which_clock, struct timespec *tp); | ||
118 | |||
119 | static inline int hrtimer_active(const struct hrtimer *timer) | ||
120 | { | ||
121 | return timer->state == HRTIMER_PENDING; | ||
122 | } | ||
123 | |||
124 | /* Forward a hrtimer so it expires after now: */ | ||
125 | extern unsigned long hrtimer_forward(struct hrtimer *timer, ktime_t interval); | ||
126 | |||
127 | /* Precise sleep: */ | ||
128 | extern long hrtimer_nanosleep(struct timespec *rqtp, | ||
129 | struct timespec __user *rmtp, | ||
130 | const enum hrtimer_mode mode, | ||
131 | const clockid_t clockid); | ||
132 | |||
133 | /* Soft interrupt function to run the hrtimer queues: */ | ||
134 | extern void hrtimer_run_queues(void); | ||
135 | |||
136 | /* Bootup initialization: */ | ||
137 | extern void __init hrtimers_init(void); | ||
138 | |||
139 | #endif | ||
diff --git a/include/linux/ide.h b/include/linux/ide.h index 9a8c05dbe4f3..f2e1b5b22898 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -1002,7 +1002,6 @@ extern int noautodma; | |||
1002 | 1002 | ||
1003 | extern int ide_end_request (ide_drive_t *drive, int uptodate, int nrsecs); | 1003 | extern int ide_end_request (ide_drive_t *drive, int uptodate, int nrsecs); |
1004 | extern int __ide_end_request (ide_drive_t *drive, struct request *rq, int uptodate, int nrsecs); | 1004 | extern int __ide_end_request (ide_drive_t *drive, struct request *rq, int uptodate, int nrsecs); |
1005 | extern void ide_softirq_done(struct request *rq); | ||
1006 | 1005 | ||
1007 | /* | 1006 | /* |
1008 | * This is used on exit from the driver to designate the next irq handler | 1007 | * This is used on exit from the driver to designate the next irq handler |
diff --git a/include/linux/isicom.h b/include/linux/isicom.h index 7c6eae7f6ed7..45b3d48f0978 100644 --- a/include/linux/isicom.h +++ b/include/linux/isicom.h | |||
@@ -4,47 +4,12 @@ | |||
4 | /*#define ISICOM_DEBUG*/ | 4 | /*#define ISICOM_DEBUG*/ |
5 | /*#define ISICOM_DEBUG_DTR_RTS*/ | 5 | /*#define ISICOM_DEBUG_DTR_RTS*/ |
6 | 6 | ||
7 | |||
8 | /* | ||
9 | * Firmware Loader definitions ... | ||
10 | */ | ||
11 | |||
12 | #define __MultiTech ('M'<<8) | ||
13 | #define MIOCTL_LOAD_FIRMWARE (__MultiTech | 0x01) | ||
14 | #define MIOCTL_READ_FIRMWARE (__MultiTech | 0x02) | ||
15 | #define MIOCTL_XFER_CTRL (__MultiTech | 0x03) | ||
16 | #define MIOCTL_RESET_CARD (__MultiTech | 0x04) | ||
17 | |||
18 | #define DATA_SIZE 16 | ||
19 | |||
20 | typedef struct { | ||
21 | unsigned short exec_segment; | ||
22 | unsigned short exec_addr; | ||
23 | } exec_record; | ||
24 | |||
25 | typedef struct { | ||
26 | int board; /* Board to load */ | ||
27 | unsigned short addr; | ||
28 | unsigned short count; | ||
29 | } bin_header; | ||
30 | |||
31 | typedef struct { | ||
32 | int board; /* Board to load */ | ||
33 | unsigned short addr; | ||
34 | unsigned short count; | ||
35 | unsigned short segment; | ||
36 | unsigned char bin_data[DATA_SIZE]; | ||
37 | } bin_frame; | ||
38 | |||
39 | #ifdef __KERNEL__ | 7 | #ifdef __KERNEL__ |
40 | 8 | ||
41 | #define YES 1 | 9 | #define YES 1 |
42 | #define NO 0 | 10 | #define NO 0 |
43 | 11 | ||
44 | #define ISILOAD_MISC_MINOR 155 /* /dev/isctl */ | 12 | /* |
45 | #define ISILOAD_NAME "ISILoad" | ||
46 | |||
47 | /* | ||
48 | * ISICOM Driver definitions ... | 13 | * ISICOM Driver definitions ... |
49 | * | 14 | * |
50 | */ | 15 | */ |
@@ -55,8 +20,8 @@ typedef struct { | |||
55 | * PCI definitions | 20 | * PCI definitions |
56 | */ | 21 | */ |
57 | 22 | ||
58 | #define DEVID_COUNT 9 | 23 | #define DEVID_COUNT 9 |
59 | #define VENDOR_ID 0x10b5 | 24 | #define VENDOR_ID 0x10b5 |
60 | 25 | ||
61 | /* | 26 | /* |
62 | * These are now officially allocated numbers | 27 | * These are now officially allocated numbers |
@@ -66,9 +31,9 @@ typedef struct { | |||
66 | #define ISICOM_CMAJOR 113 /* callout */ | 31 | #define ISICOM_CMAJOR 113 /* callout */ |
67 | #define ISICOM_MAGIC (('M' << 8) | 'T') | 32 | #define ISICOM_MAGIC (('M' << 8) | 'T') |
68 | 33 | ||
69 | #define WAKEUP_CHARS 256 /* hard coded for now */ | 34 | #define WAKEUP_CHARS 256 /* hard coded for now */ |
70 | #define TX_SIZE 254 | 35 | #define TX_SIZE 254 |
71 | 36 | ||
72 | #define BOARD_COUNT 4 | 37 | #define BOARD_COUNT 4 |
73 | #define PORT_COUNT (BOARD_COUNT*16) | 38 | #define PORT_COUNT (BOARD_COUNT*16) |
74 | 39 | ||
@@ -98,18 +63,15 @@ typedef struct { | |||
98 | #define ISICOM_INITIATE_XONXOFF 0x04 | 63 | #define ISICOM_INITIATE_XONXOFF 0x04 |
99 | #define ISICOM_RESPOND_XONXOFF 0x08 | 64 | #define ISICOM_RESPOND_XONXOFF 0x08 |
100 | 65 | ||
101 | #define InterruptTheCard(base) (outw(0,(base)+0xc)) | ||
102 | #define ClearInterrupt(base) (inw((base)+0x0a)) | ||
103 | |||
104 | #define BOARD(line) (((line) >> 4) & 0x3) | 66 | #define BOARD(line) (((line) >> 4) & 0x3) |
105 | 67 | ||
106 | /* isi kill queue bitmap */ | 68 | /* isi kill queue bitmap */ |
107 | 69 | ||
108 | #define ISICOM_KILLTX 0x01 | 70 | #define ISICOM_KILLTX 0x01 |
109 | #define ISICOM_KILLRX 0x02 | 71 | #define ISICOM_KILLRX 0x02 |
110 | 72 | ||
111 | /* isi_board status bitmap */ | 73 | /* isi_board status bitmap */ |
112 | 74 | ||
113 | #define FIRMWARE_LOADED 0x0001 | 75 | #define FIRMWARE_LOADED 0x0001 |
114 | #define BOARD_ACTIVE 0x0002 | 76 | #define BOARD_ACTIVE 0x0002 |
115 | 77 | ||
@@ -123,9 +85,8 @@ typedef struct { | |||
123 | #define ISI_RTS 0x0200 | 85 | #define ISI_RTS 0x0200 |
124 | 86 | ||
125 | 87 | ||
126 | #define ISI_TXOK 0x0001 | 88 | #define ISI_TXOK 0x0001 |
127 | 89 | ||
128 | #endif /* __KERNEL__ */ | 90 | #endif /* __KERNEL__ */ |
129 | 91 | ||
130 | #endif /* ISICOM_H */ | 92 | #endif /* ISICOM_H */ |
131 | |||
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h index 6acfdbba734b..99905e180532 100644 --- a/include/linux/jiffies.h +++ b/include/linux/jiffies.h | |||
@@ -1,21 +1,12 @@ | |||
1 | #ifndef _LINUX_JIFFIES_H | 1 | #ifndef _LINUX_JIFFIES_H |
2 | #define _LINUX_JIFFIES_H | 2 | #define _LINUX_JIFFIES_H |
3 | 3 | ||
4 | #include <linux/calc64.h> | ||
4 | #include <linux/kernel.h> | 5 | #include <linux/kernel.h> |
5 | #include <linux/types.h> | 6 | #include <linux/types.h> |
6 | #include <linux/time.h> | 7 | #include <linux/time.h> |
7 | #include <linux/timex.h> | 8 | #include <linux/timex.h> |
8 | #include <asm/param.h> /* for HZ */ | 9 | #include <asm/param.h> /* for HZ */ |
9 | #include <asm/div64.h> | ||
10 | |||
11 | #ifndef div_long_long_rem | ||
12 | #define div_long_long_rem(dividend,divisor,remainder) \ | ||
13 | ({ \ | ||
14 | u64 result = dividend; \ | ||
15 | *remainder = do_div(result,divisor); \ | ||
16 | result; \ | ||
17 | }) | ||
18 | #endif | ||
19 | 10 | ||
20 | /* | 11 | /* |
21 | * The following defines establish the engineering parameters of the PLL | 12 | * The following defines establish the engineering parameters of the PLL |
@@ -373,8 +364,11 @@ jiffies_to_timeval(const unsigned long jiffies, struct timeval *value) | |||
373 | * one divide. | 364 | * one divide. |
374 | */ | 365 | */ |
375 | u64 nsec = (u64)jiffies * TICK_NSEC; | 366 | u64 nsec = (u64)jiffies * TICK_NSEC; |
376 | value->tv_sec = div_long_long_rem(nsec, NSEC_PER_SEC, &value->tv_usec); | 367 | long tv_usec; |
377 | value->tv_usec /= NSEC_PER_USEC; | 368 | |
369 | value->tv_sec = div_long_long_rem(nsec, NSEC_PER_SEC, &tv_usec); | ||
370 | tv_usec /= NSEC_PER_USEC; | ||
371 | value->tv_usec = tv_usec; | ||
378 | } | 372 | } |
379 | 373 | ||
380 | /* | 374 | /* |
diff --git a/include/linux/kbd_kern.h b/include/linux/kbd_kern.h index 7428198111eb..45f625d7d0b2 100644 --- a/include/linux/kbd_kern.h +++ b/include/linux/kbd_kern.h | |||
@@ -151,7 +151,7 @@ extern unsigned int keymap_count; | |||
151 | 151 | ||
152 | static inline void con_schedule_flip(struct tty_struct *t) | 152 | static inline void con_schedule_flip(struct tty_struct *t) |
153 | { | 153 | { |
154 | schedule_work(&t->flip.work); | 154 | schedule_work(&t->buf.work); |
155 | } | 155 | } |
156 | 156 | ||
157 | #endif | 157 | #endif |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index d0e6ca3b00ef..e6ee2d95da7a 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -47,6 +47,8 @@ extern int console_printk[]; | |||
47 | #define default_console_loglevel (console_printk[3]) | 47 | #define default_console_loglevel (console_printk[3]) |
48 | 48 | ||
49 | struct completion; | 49 | struct completion; |
50 | struct pt_regs; | ||
51 | struct user; | ||
50 | 52 | ||
51 | /** | 53 | /** |
52 | * might_sleep - annotation for functions that can sleep | 54 | * might_sleep - annotation for functions that can sleep |
@@ -123,6 +125,8 @@ extern int __kernel_text_address(unsigned long addr); | |||
123 | extern int kernel_text_address(unsigned long addr); | 125 | extern int kernel_text_address(unsigned long addr); |
124 | extern int session_of_pgrp(int pgrp); | 126 | extern int session_of_pgrp(int pgrp); |
125 | 127 | ||
128 | extern void dump_thread(struct pt_regs *regs, struct user *dump); | ||
129 | |||
126 | #ifdef CONFIG_PRINTK | 130 | #ifdef CONFIG_PRINTK |
127 | asmlinkage int vprintk(const char *fmt, va_list args) | 131 | asmlinkage int vprintk(const char *fmt, va_list args) |
128 | __attribute__ ((format (printf, 1, 0))); | 132 | __attribute__ ((format (printf, 1, 0))); |
diff --git a/include/linux/kexec.h b/include/linux/kexec.h index c8468472aec0..94abc07cb164 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h | |||
@@ -41,7 +41,7 @@ typedef unsigned long kimage_entry_t; | |||
41 | #define IND_DONE 0x4 | 41 | #define IND_DONE 0x4 |
42 | #define IND_SOURCE 0x8 | 42 | #define IND_SOURCE 0x8 |
43 | 43 | ||
44 | #define KEXEC_SEGMENT_MAX 8 | 44 | #define KEXEC_SEGMENT_MAX 16 |
45 | struct kexec_segment { | 45 | struct kexec_segment { |
46 | void __user *buf; | 46 | void __user *buf; |
47 | size_t bufsz; | 47 | size_t bufsz; |
@@ -125,6 +125,8 @@ extern struct kimage *kexec_image; | |||
125 | /* Location of a reserved region to hold the crash kernel. | 125 | /* Location of a reserved region to hold the crash kernel. |
126 | */ | 126 | */ |
127 | extern struct resource crashk_res; | 127 | extern struct resource crashk_res; |
128 | typedef u32 note_buf_t[MAX_NOTE_BYTES/4]; | ||
129 | extern note_buf_t *crash_notes; | ||
128 | 130 | ||
129 | #else /* !CONFIG_KEXEC */ | 131 | #else /* !CONFIG_KEXEC */ |
130 | struct pt_regs; | 132 | struct pt_regs; |
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index c03f2dc933de..669756bc20a2 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h | |||
@@ -68,6 +68,9 @@ struct kprobe { | |||
68 | /* list of kprobes for multi-handler support */ | 68 | /* list of kprobes for multi-handler support */ |
69 | struct list_head list; | 69 | struct list_head list; |
70 | 70 | ||
71 | /* Indicates that the corresponding module has been ref counted */ | ||
72 | unsigned int mod_refcounted; | ||
73 | |||
71 | /*count the number of times this probe was temporarily disarmed */ | 74 | /*count the number of times this probe was temporarily disarmed */ |
72 | unsigned long nmissed; | 75 | unsigned long nmissed; |
73 | 76 | ||
@@ -149,11 +152,10 @@ struct kretprobe_instance { | |||
149 | }; | 152 | }; |
150 | 153 | ||
151 | extern spinlock_t kretprobe_lock; | 154 | extern spinlock_t kretprobe_lock; |
155 | extern struct semaphore kprobe_mutex; | ||
152 | extern int arch_prepare_kprobe(struct kprobe *p); | 156 | extern int arch_prepare_kprobe(struct kprobe *p); |
153 | extern void arch_copy_kprobe(struct kprobe *p); | ||
154 | extern void arch_arm_kprobe(struct kprobe *p); | 157 | extern void arch_arm_kprobe(struct kprobe *p); |
155 | extern void arch_disarm_kprobe(struct kprobe *p); | 158 | extern void arch_disarm_kprobe(struct kprobe *p); |
156 | extern void arch_remove_kprobe(struct kprobe *p); | ||
157 | extern int arch_init_kprobes(void); | 159 | extern int arch_init_kprobes(void); |
158 | extern void show_registers(struct pt_regs *regs); | 160 | extern void show_registers(struct pt_regs *regs); |
159 | extern kprobe_opcode_t *get_insn_slot(void); | 161 | extern kprobe_opcode_t *get_insn_slot(void); |
diff --git a/include/linux/ktime.h b/include/linux/ktime.h new file mode 100644 index 000000000000..1bd6552cc341 --- /dev/null +++ b/include/linux/ktime.h | |||
@@ -0,0 +1,284 @@ | |||
1 | /* | ||
2 | * include/linux/ktime.h | ||
3 | * | ||
4 | * ktime_t - nanosecond-resolution time format. | ||
5 | * | ||
6 | * Copyright(C) 2005, Thomas Gleixner <tglx@linutronix.de> | ||
7 | * Copyright(C) 2005, Red Hat, Inc., Ingo Molnar | ||
8 | * | ||
9 | * data type definitions, declarations, prototypes and macros. | ||
10 | * | ||
11 | * Started by: Thomas Gleixner and Ingo Molnar | ||
12 | * | ||
13 | * For licencing details see kernel-base/COPYING | ||
14 | */ | ||
15 | #ifndef _LINUX_KTIME_H | ||
16 | #define _LINUX_KTIME_H | ||
17 | |||
18 | #include <linux/time.h> | ||
19 | #include <linux/jiffies.h> | ||
20 | |||
21 | /* | ||
22 | * ktime_t: | ||
23 | * | ||
24 | * On 64-bit CPUs a single 64-bit variable is used to store the hrtimers | ||
25 | * internal representation of time values in scalar nanoseconds. The | ||
26 | * design plays out best on 64-bit CPUs, where most conversions are | ||
27 | * NOPs and most arithmetic ktime_t operations are plain arithmetic | ||
28 | * operations. | ||
29 | * | ||
30 | * On 32-bit CPUs an optimized representation of the timespec structure | ||
31 | * is used to avoid expensive conversions from and to timespecs. The | ||
32 | * endian-aware order of the tv struct members is choosen to allow | ||
33 | * mathematical operations on the tv64 member of the union too, which | ||
34 | * for certain operations produces better code. | ||
35 | * | ||
36 | * For architectures with efficient support for 64/32-bit conversions the | ||
37 | * plain scalar nanosecond based representation can be selected by the | ||
38 | * config switch CONFIG_KTIME_SCALAR. | ||
39 | */ | ||
40 | typedef union { | ||
41 | s64 tv64; | ||
42 | #if BITS_PER_LONG != 64 && !defined(CONFIG_KTIME_SCALAR) | ||
43 | struct { | ||
44 | # ifdef __BIG_ENDIAN | ||
45 | s32 sec, nsec; | ||
46 | # else | ||
47 | s32 nsec, sec; | ||
48 | # endif | ||
49 | } tv; | ||
50 | #endif | ||
51 | } ktime_t; | ||
52 | |||
53 | #define KTIME_MAX (~((u64)1 << 63)) | ||
54 | |||
55 | /* | ||
56 | * ktime_t definitions when using the 64-bit scalar representation: | ||
57 | */ | ||
58 | |||
59 | #if (BITS_PER_LONG == 64) || defined(CONFIG_KTIME_SCALAR) | ||
60 | |||
61 | /* Define a ktime_t variable and initialize it to zero: */ | ||
62 | #define DEFINE_KTIME(kt) ktime_t kt = { .tv64 = 0 } | ||
63 | |||
64 | /** | ||
65 | * ktime_set - Set a ktime_t variable from a seconds/nanoseconds value | ||
66 | * | ||
67 | * @secs: seconds to set | ||
68 | * @nsecs: nanoseconds to set | ||
69 | * | ||
70 | * Return the ktime_t representation of the value | ||
71 | */ | ||
72 | static inline ktime_t ktime_set(const long secs, const unsigned long nsecs) | ||
73 | { | ||
74 | return (ktime_t) { .tv64 = (s64)secs * NSEC_PER_SEC + (s64)nsecs }; | ||
75 | } | ||
76 | |||
77 | /* Subtract two ktime_t variables. rem = lhs -rhs: */ | ||
78 | #define ktime_sub(lhs, rhs) \ | ||
79 | ({ (ktime_t){ .tv64 = (lhs).tv64 - (rhs).tv64 }; }) | ||
80 | |||
81 | /* Add two ktime_t variables. res = lhs + rhs: */ | ||
82 | #define ktime_add(lhs, rhs) \ | ||
83 | ({ (ktime_t){ .tv64 = (lhs).tv64 + (rhs).tv64 }; }) | ||
84 | |||
85 | /* | ||
86 | * Add a ktime_t variable and a scalar nanosecond value. | ||
87 | * res = kt + nsval: | ||
88 | */ | ||
89 | #define ktime_add_ns(kt, nsval) \ | ||
90 | ({ (ktime_t){ .tv64 = (kt).tv64 + (nsval) }; }) | ||
91 | |||
92 | /* convert a timespec to ktime_t format: */ | ||
93 | #define timespec_to_ktime(ts) ktime_set((ts).tv_sec, (ts).tv_nsec) | ||
94 | |||
95 | /* convert a timeval to ktime_t format: */ | ||
96 | #define timeval_to_ktime(tv) ktime_set((tv).tv_sec, (tv).tv_usec * 1000) | ||
97 | |||
98 | /* Map the ktime_t to timespec conversion to ns_to_timespec function */ | ||
99 | #define ktime_to_timespec(kt) ns_to_timespec((kt).tv64) | ||
100 | |||
101 | /* Map the ktime_t to timeval conversion to ns_to_timeval function */ | ||
102 | #define ktime_to_timeval(kt) ns_to_timeval((kt).tv64) | ||
103 | |||
104 | /* Map the ktime_t to clock_t conversion to the inline in jiffies.h: */ | ||
105 | #define ktime_to_clock_t(kt) nsec_to_clock_t((kt).tv64) | ||
106 | |||
107 | /* Convert ktime_t to nanoseconds - NOP in the scalar storage format: */ | ||
108 | #define ktime_to_ns(kt) ((kt).tv64) | ||
109 | |||
110 | #else | ||
111 | |||
112 | /* | ||
113 | * Helper macros/inlines to get the ktime_t math right in the timespec | ||
114 | * representation. The macros are sometimes ugly - their actual use is | ||
115 | * pretty okay-ish, given the circumstances. We do all this for | ||
116 | * performance reasons. The pure scalar nsec_t based code was nice and | ||
117 | * simple, but created too many 64-bit / 32-bit conversions and divisions. | ||
118 | * | ||
119 | * Be especially aware that negative values are represented in a way | ||
120 | * that the tv.sec field is negative and the tv.nsec field is greater | ||
121 | * or equal to zero but less than nanoseconds per second. This is the | ||
122 | * same representation which is used by timespecs. | ||
123 | * | ||
124 | * tv.sec < 0 and 0 >= tv.nsec < NSEC_PER_SEC | ||
125 | */ | ||
126 | |||
127 | /* Define a ktime_t variable and initialize it to zero: */ | ||
128 | #define DEFINE_KTIME(kt) ktime_t kt = { .tv64 = 0 } | ||
129 | |||
130 | /* Set a ktime_t variable to a value in sec/nsec representation: */ | ||
131 | static inline ktime_t ktime_set(const long secs, const unsigned long nsecs) | ||
132 | { | ||
133 | return (ktime_t) { .tv = { .sec = secs, .nsec = nsecs } }; | ||
134 | } | ||
135 | |||
136 | /** | ||
137 | * ktime_sub - subtract two ktime_t variables | ||
138 | * | ||
139 | * @lhs: minuend | ||
140 | * @rhs: subtrahend | ||
141 | * | ||
142 | * Returns the remainder of the substraction | ||
143 | */ | ||
144 | static inline ktime_t ktime_sub(const ktime_t lhs, const ktime_t rhs) | ||
145 | { | ||
146 | ktime_t res; | ||
147 | |||
148 | res.tv64 = lhs.tv64 - rhs.tv64; | ||
149 | if (res.tv.nsec < 0) | ||
150 | res.tv.nsec += NSEC_PER_SEC; | ||
151 | |||
152 | return res; | ||
153 | } | ||
154 | |||
155 | /** | ||
156 | * ktime_add - add two ktime_t variables | ||
157 | * | ||
158 | * @add1: addend1 | ||
159 | * @add2: addend2 | ||
160 | * | ||
161 | * Returns the sum of addend1 and addend2 | ||
162 | */ | ||
163 | static inline ktime_t ktime_add(const ktime_t add1, const ktime_t add2) | ||
164 | { | ||
165 | ktime_t res; | ||
166 | |||
167 | res.tv64 = add1.tv64 + add2.tv64; | ||
168 | /* | ||
169 | * performance trick: the (u32) -NSEC gives 0x00000000Fxxxxxxx | ||
170 | * so we subtract NSEC_PER_SEC and add 1 to the upper 32 bit. | ||
171 | * | ||
172 | * it's equivalent to: | ||
173 | * tv.nsec -= NSEC_PER_SEC | ||
174 | * tv.sec ++; | ||
175 | */ | ||
176 | if (res.tv.nsec >= NSEC_PER_SEC) | ||
177 | res.tv64 += (u32)-NSEC_PER_SEC; | ||
178 | |||
179 | return res; | ||
180 | } | ||
181 | |||
182 | /** | ||
183 | * ktime_add_ns - Add a scalar nanoseconds value to a ktime_t variable | ||
184 | * | ||
185 | * @kt: addend | ||
186 | * @nsec: the scalar nsec value to add | ||
187 | * | ||
188 | * Returns the sum of kt and nsec in ktime_t format | ||
189 | */ | ||
190 | extern ktime_t ktime_add_ns(const ktime_t kt, u64 nsec); | ||
191 | |||
192 | /** | ||
193 | * timespec_to_ktime - convert a timespec to ktime_t format | ||
194 | * | ||
195 | * @ts: the timespec variable to convert | ||
196 | * | ||
197 | * Returns a ktime_t variable with the converted timespec value | ||
198 | */ | ||
199 | static inline ktime_t timespec_to_ktime(const struct timespec ts) | ||
200 | { | ||
201 | return (ktime_t) { .tv = { .sec = (s32)ts.tv_sec, | ||
202 | .nsec = (s32)ts.tv_nsec } }; | ||
203 | } | ||
204 | |||
205 | /** | ||
206 | * timeval_to_ktime - convert a timeval to ktime_t format | ||
207 | * | ||
208 | * @tv: the timeval variable to convert | ||
209 | * | ||
210 | * Returns a ktime_t variable with the converted timeval value | ||
211 | */ | ||
212 | static inline ktime_t timeval_to_ktime(const struct timeval tv) | ||
213 | { | ||
214 | return (ktime_t) { .tv = { .sec = (s32)tv.tv_sec, | ||
215 | .nsec = (s32)tv.tv_usec * 1000 } }; | ||
216 | } | ||
217 | |||
218 | /** | ||
219 | * ktime_to_timespec - convert a ktime_t variable to timespec format | ||
220 | * | ||
221 | * @kt: the ktime_t variable to convert | ||
222 | * | ||
223 | * Returns the timespec representation of the ktime value | ||
224 | */ | ||
225 | static inline struct timespec ktime_to_timespec(const ktime_t kt) | ||
226 | { | ||
227 | return (struct timespec) { .tv_sec = (time_t) kt.tv.sec, | ||
228 | .tv_nsec = (long) kt.tv.nsec }; | ||
229 | } | ||
230 | |||
231 | /** | ||
232 | * ktime_to_timeval - convert a ktime_t variable to timeval format | ||
233 | * | ||
234 | * @kt: the ktime_t variable to convert | ||
235 | * | ||
236 | * Returns the timeval representation of the ktime value | ||
237 | */ | ||
238 | static inline struct timeval ktime_to_timeval(const ktime_t kt) | ||
239 | { | ||
240 | return (struct timeval) { | ||
241 | .tv_sec = (time_t) kt.tv.sec, | ||
242 | .tv_usec = (suseconds_t) (kt.tv.nsec / NSEC_PER_USEC) }; | ||
243 | } | ||
244 | |||
245 | /** | ||
246 | * ktime_to_clock_t - convert a ktime_t variable to clock_t format | ||
247 | * @kt: the ktime_t variable to convert | ||
248 | * | ||
249 | * Returns a clock_t variable with the converted value | ||
250 | */ | ||
251 | static inline clock_t ktime_to_clock_t(const ktime_t kt) | ||
252 | { | ||
253 | return nsec_to_clock_t( (u64) kt.tv.sec * NSEC_PER_SEC + kt.tv.nsec); | ||
254 | } | ||
255 | |||
256 | /** | ||
257 | * ktime_to_ns - convert a ktime_t variable to scalar nanoseconds | ||
258 | * @kt: the ktime_t variable to convert | ||
259 | * | ||
260 | * Returns the scalar nanoseconds representation of kt | ||
261 | */ | ||
262 | static inline u64 ktime_to_ns(const ktime_t kt) | ||
263 | { | ||
264 | return (u64) kt.tv.sec * NSEC_PER_SEC + kt.tv.nsec; | ||
265 | } | ||
266 | |||
267 | #endif | ||
268 | |||
269 | /* | ||
270 | * The resolution of the clocks. The resolution value is returned in | ||
271 | * the clock_getres() system call to give application programmers an | ||
272 | * idea of the (in)accuracy of timers. Timer values are rounded up to | ||
273 | * this resolution values. | ||
274 | */ | ||
275 | #define KTIME_REALTIME_RES (ktime_t){ .tv64 = TICK_NSEC } | ||
276 | #define KTIME_MONOTONIC_RES (ktime_t){ .tv64 = TICK_NSEC } | ||
277 | |||
278 | /* Get the monotonic time in timespec format: */ | ||
279 | extern void ktime_get_ts(struct timespec *ts); | ||
280 | |||
281 | /* Get the real (wall-) time in timespec format: */ | ||
282 | #define ktime_get_real_ts(ts) getnstimeofday(ts) | ||
283 | |||
284 | #endif | ||
diff --git a/include/linux/list.h b/include/linux/list.h index 8e3388284530..945daa1f13dd 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
@@ -436,6 +436,20 @@ static inline void list_splice_init(struct list_head *list, | |||
436 | pos = n, n = list_entry(n->member.next, typeof(*n), member)) | 436 | pos = n, n = list_entry(n->member.next, typeof(*n), member)) |
437 | 437 | ||
438 | /** | 438 | /** |
439 | * list_for_each_entry_safe_reverse - iterate backwards over list of given type safe against | ||
440 | * removal of list entry | ||
441 | * @pos: the type * to use as a loop counter. | ||
442 | * @n: another type * to use as temporary storage | ||
443 | * @head: the head for your list. | ||
444 | * @member: the name of the list_struct within the struct. | ||
445 | */ | ||
446 | #define list_for_each_entry_safe_reverse(pos, n, head, member) \ | ||
447 | for (pos = list_entry((head)->prev, typeof(*pos), member), \ | ||
448 | n = list_entry(pos->member.prev, typeof(*pos), member); \ | ||
449 | &pos->member != (head); \ | ||
450 | pos = n, n = list_entry(n->member.prev, typeof(*n), member)) | ||
451 | |||
452 | /** | ||
439 | * list_for_each_rcu - iterate over an rcu-protected list | 453 | * list_for_each_rcu - iterate over an rcu-protected list |
440 | * @pos: the &struct list_head to use as a loop counter. | 454 | * @pos: the &struct list_head to use as a loop counter. |
441 | * @head: the head for your list. | 455 | * @head: the head for your list. |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 3f1fafc0245e..c643016499a1 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -3,6 +3,7 @@ | |||
3 | 3 | ||
4 | #include <linux/sched.h> | 4 | #include <linux/sched.h> |
5 | #include <linux/errno.h> | 5 | #include <linux/errno.h> |
6 | #include <linux/capability.h> | ||
6 | 7 | ||
7 | #ifdef __KERNEL__ | 8 | #ifdef __KERNEL__ |
8 | 9 | ||
@@ -1027,7 +1028,7 @@ kernel_map_pages(struct page *page, int numpages, int enable) | |||
1027 | { | 1028 | { |
1028 | if (!PageHighMem(page) && !enable) | 1029 | if (!PageHighMem(page) && !enable) |
1029 | mutex_debug_check_no_locks_freed(page_address(page), | 1030 | mutex_debug_check_no_locks_freed(page_address(page), |
1030 | page_address(page + numpages)); | 1031 | numpages * PAGE_SIZE); |
1031 | } | 1032 | } |
1032 | #endif | 1033 | #endif |
1033 | 1034 | ||
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 7e4ae6ab1977..34cbefd2ebde 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -98,7 +98,7 @@ struct per_cpu_pageset { | |||
98 | 98 | ||
99 | /* | 99 | /* |
100 | * On machines where it is needed (eg PCs) we divide physical memory | 100 | * On machines where it is needed (eg PCs) we divide physical memory |
101 | * into multiple physical zones. On a PC we have 4 zones: | 101 | * into multiple physical zones. On a 32bit PC we have 4 zones: |
102 | * | 102 | * |
103 | * ZONE_DMA < 16 MB ISA DMA capable memory | 103 | * ZONE_DMA < 16 MB ISA DMA capable memory |
104 | * ZONE_DMA32 0 MB Empty | 104 | * ZONE_DMA32 0 MB Empty |
diff --git a/include/linux/mount.h b/include/linux/mount.h index b98a709f1794..b7472ae91fa4 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h | |||
@@ -20,10 +20,12 @@ | |||
20 | #define MNT_NOSUID 0x01 | 20 | #define MNT_NOSUID 0x01 |
21 | #define MNT_NODEV 0x02 | 21 | #define MNT_NODEV 0x02 |
22 | #define MNT_NOEXEC 0x04 | 22 | #define MNT_NOEXEC 0x04 |
23 | #define MNT_SHARED 0x10 /* if the vfsmount is a shared mount */ | 23 | #define MNT_NOATIME 0x08 |
24 | #define MNT_UNBINDABLE 0x20 /* if the vfsmount is a unbindable mount */ | 24 | #define MNT_NODIRATIME 0x10 |
25 | 25 | ||
26 | #define MNT_PNODE_MASK (MNT_SHARED | MNT_UNBINDABLE) | 26 | #define MNT_SHARED 0x1000 /* if the vfsmount is a shared mount */ |
27 | #define MNT_UNBINDABLE 0x2000 /* if the vfsmount is a unbindable mount */ | ||
28 | #define MNT_PNODE_MASK 0x3000 /* propogation flag mask */ | ||
27 | 29 | ||
28 | struct vfsmount { | 30 | struct vfsmount { |
29 | struct list_head mnt_hash; | 31 | struct list_head mnt_hash; |
diff --git a/include/linux/mutex-debug.h b/include/linux/mutex-debug.h index 0ccd8f983b50..8b5769f00467 100644 --- a/include/linux/mutex-debug.h +++ b/include/linux/mutex-debug.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef __LINUX_MUTEX_DEBUG_H | 1 | #ifndef __LINUX_MUTEX_DEBUG_H |
2 | #define __LINUX_MUTEX_DEBUG_H | 2 | #define __LINUX_MUTEX_DEBUG_H |
3 | 3 | ||
4 | #include <linux/linkage.h> | ||
5 | |||
4 | /* | 6 | /* |
5 | * Mutexes - debugging helpers: | 7 | * Mutexes - debugging helpers: |
6 | */ | 8 | */ |
@@ -16,6 +18,6 @@ extern void FASTCALL(mutex_destroy(struct mutex *lock)); | |||
16 | extern void mutex_debug_show_all_locks(void); | 18 | extern void mutex_debug_show_all_locks(void); |
17 | extern void mutex_debug_show_held_locks(struct task_struct *filter); | 19 | extern void mutex_debug_show_held_locks(struct task_struct *filter); |
18 | extern void mutex_debug_check_no_locks_held(struct task_struct *task); | 20 | extern void mutex_debug_check_no_locks_held(struct task_struct *task); |
19 | extern void mutex_debug_check_no_locks_freed(const void *from, const void *to); | 21 | extern void mutex_debug_check_no_locks_freed(const void *from, unsigned long len); |
20 | 22 | ||
21 | #endif | 23 | #endif |
diff --git a/include/linux/mutex.h b/include/linux/mutex.h index 9bce0fee68d4..f1ac507fa20d 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h | |||
@@ -12,6 +12,7 @@ | |||
12 | 12 | ||
13 | #include <linux/list.h> | 13 | #include <linux/list.h> |
14 | #include <linux/spinlock_types.h> | 14 | #include <linux/spinlock_types.h> |
15 | #include <linux/linkage.h> | ||
15 | 16 | ||
16 | #include <asm/atomic.h> | 17 | #include <asm/atomic.h> |
17 | 18 | ||
@@ -78,7 +79,7 @@ struct mutex_waiter { | |||
78 | # define mutex_debug_show_all_locks() do { } while (0) | 79 | # define mutex_debug_show_all_locks() do { } while (0) |
79 | # define mutex_debug_show_held_locks(p) do { } while (0) | 80 | # define mutex_debug_show_held_locks(p) do { } while (0) |
80 | # define mutex_debug_check_no_locks_held(task) do { } while (0) | 81 | # define mutex_debug_check_no_locks_held(task) do { } while (0) |
81 | # define mutex_debug_check_no_locks_freed(from, to) do { } while (0) | 82 | # define mutex_debug_check_no_locks_freed(from, len) do { } while (0) |
82 | #endif | 83 | #endif |
83 | 84 | ||
84 | #define __MUTEX_INITIALIZER(lockname) \ | 85 | #define __MUTEX_INITIALIZER(lockname) \ |
diff --git a/include/linux/namei.h b/include/linux/namei.h index 455660eafba9..b699e427c00c 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h | |||
@@ -74,7 +74,7 @@ extern struct file *nameidata_to_filp(struct nameidata *nd, int flags); | |||
74 | extern void release_open_intent(struct nameidata *); | 74 | extern void release_open_intent(struct nameidata *); |
75 | 75 | ||
76 | extern struct dentry * lookup_one_len(const char *, struct dentry *, int); | 76 | extern struct dentry * lookup_one_len(const char *, struct dentry *, int); |
77 | extern struct dentry * lookup_hash(struct nameidata *); | 77 | extern __deprecated_for_modules struct dentry * lookup_hash(struct nameidata *); |
78 | 78 | ||
79 | extern int follow_down(struct vfsmount **, struct dentry **); | 79 | extern int follow_down(struct vfsmount **, struct dentry **); |
80 | extern int follow_up(struct vfsmount **, struct dentry **); | 80 | extern int follow_up(struct vfsmount **, struct dentry **); |
diff --git a/include/linux/netfilter_ipv4/ip_nat_protocol.h b/include/linux/netfilter_ipv4/ip_nat_protocol.h index ef63aa991a06..612a43614e7b 100644 --- a/include/linux/netfilter_ipv4/ip_nat_protocol.h +++ b/include/linux/netfilter_ipv4/ip_nat_protocol.h | |||
@@ -42,13 +42,6 @@ struct ip_nat_protocol | |||
42 | enum ip_nat_manip_type maniptype, | 42 | enum ip_nat_manip_type maniptype, |
43 | const struct ip_conntrack *conntrack); | 43 | const struct ip_conntrack *conntrack); |
44 | 44 | ||
45 | unsigned int (*print)(char *buffer, | ||
46 | const struct ip_conntrack_tuple *match, | ||
47 | const struct ip_conntrack_tuple *mask); | ||
48 | |||
49 | unsigned int (*print_range)(char *buffer, | ||
50 | const struct ip_nat_range *range); | ||
51 | |||
52 | int (*range_to_nfattr)(struct sk_buff *skb, | 45 | int (*range_to_nfattr)(struct sk_buff *skb, |
53 | const struct ip_nat_range *range); | 46 | const struct ip_nat_range *range); |
54 | 47 | ||
diff --git a/include/linux/netfilter_ipv6.h b/include/linux/netfilter_ipv6.h index 53b2983f6278..14f2bd010884 100644 --- a/include/linux/netfilter_ipv6.h +++ b/include/linux/netfilter_ipv6.h | |||
@@ -72,7 +72,12 @@ enum nf_ip6_hook_priorities { | |||
72 | NF_IP6_PRI_LAST = INT_MAX, | 72 | NF_IP6_PRI_LAST = INT_MAX, |
73 | }; | 73 | }; |
74 | 74 | ||
75 | #ifdef CONFIG_NETFILTER | ||
75 | extern int ipv6_netfilter_init(void); | 76 | extern int ipv6_netfilter_init(void); |
76 | extern void ipv6_netfilter_fini(void); | 77 | extern void ipv6_netfilter_fini(void); |
78 | #else /* CONFIG_NETFILTER */ | ||
79 | static inline int ipv6_netfilter_init(void) { return 0; } | ||
80 | static inline void ipv6_netfilter_fini(void) { return; } | ||
81 | #endif /* CONFIG_NETFILTER */ | ||
77 | 82 | ||
78 | #endif /*__LINUX_IP6_NETFILTER_H*/ | 83 | #endif /*__LINUX_IP6_NETFILTER_H*/ |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index c3caa93efb10..7fb397e3f2d3 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -377,6 +377,7 @@ | |||
377 | #define PCI_DEVICE_ID_NS_87560_USB 0x0012 | 377 | #define PCI_DEVICE_ID_NS_87560_USB 0x0012 |
378 | #define PCI_DEVICE_ID_NS_83815 0x0020 | 378 | #define PCI_DEVICE_ID_NS_83815 0x0020 |
379 | #define PCI_DEVICE_ID_NS_83820 0x0022 | 379 | #define PCI_DEVICE_ID_NS_83820 0x0022 |
380 | #define PCI_DEVICE_ID_NS_CS5535_ISA 0x002b | ||
380 | #define PCI_DEVICE_ID_NS_CS5535_IDE 0x002d | 381 | #define PCI_DEVICE_ID_NS_CS5535_IDE 0x002d |
381 | #define PCI_DEVICE_ID_NS_CS5535_AUDIO 0x002e | 382 | #define PCI_DEVICE_ID_NS_CS5535_AUDIO 0x002e |
382 | #define PCI_DEVICE_ID_NS_CS5535_USB 0x002f | 383 | #define PCI_DEVICE_ID_NS_CS5535_USB 0x002f |
@@ -500,6 +501,14 @@ | |||
500 | #define PCI_DEVICE_ID_AMD_8111_AUDIO 0x746d | 501 | #define PCI_DEVICE_ID_AMD_8111_AUDIO 0x746d |
501 | #define PCI_DEVICE_ID_AMD_8151_0 0x7454 | 502 | #define PCI_DEVICE_ID_AMD_8151_0 0x7454 |
502 | #define PCI_DEVICE_ID_AMD_8131_APIC 0x7450 | 503 | #define PCI_DEVICE_ID_AMD_8131_APIC 0x7450 |
504 | #define PCI_DEVICE_ID_AMD_CS5536_ISA 0x2090 | ||
505 | #define PCI_DEVICE_ID_AMD_CS5536_FLASH 0x2091 | ||
506 | #define PCI_DEVICE_ID_AMD_CS5536_AUDIO 0x2093 | ||
507 | #define PCI_DEVICE_ID_AMD_CS5536_OHC 0x2094 | ||
508 | #define PCI_DEVICE_ID_AMD_CS5536_EHC 0x2095 | ||
509 | #define PCI_DEVICE_ID_AMD_CS5536_UDC 0x2096 | ||
510 | #define PCI_DEVICE_ID_AMD_CS5536_UOC 0x2097 | ||
511 | #define PCI_DEVICE_ID_AMD_CS5536_IDE 0x209A | ||
503 | 512 | ||
504 | #define PCI_DEVICE_ID_AMD_CS5536_IDE 0x209A | 513 | #define PCI_DEVICE_ID_AMD_CS5536_IDE 0x209A |
505 | 514 | ||
@@ -1041,6 +1050,11 @@ | |||
1041 | #define PCI_DEVICE_ID_NVIDIA_NVENET_6 0x00e6 | 1050 | #define PCI_DEVICE_ID_NVIDIA_NVENET_6 0x00e6 |
1042 | #define PCI_DEVICE_ID_NVIDIA_CK8S_AUDIO 0x00ea | 1051 | #define PCI_DEVICE_ID_NVIDIA_CK8S_AUDIO 0x00ea |
1043 | #define PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2 0x00ee | 1052 | #define PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2 0x00ee |
1053 | #define PCIE_DEVICE_ID_NVIDIA_GEFORCE_6800_ALT1 0x00f0 | ||
1054 | #define PCIE_DEVICE_ID_NVIDIA_GEFORCE_6600_ALT1 0x00f1 | ||
1055 | #define PCIE_DEVICE_ID_NVIDIA_GEFORCE_6600_ALT2 0x00f2 | ||
1056 | #define PCIE_DEVICE_ID_NVIDIA_GEFORCE_6200_ALT1 0x00f3 | ||
1057 | #define PCIE_DEVICE_ID_NVIDIA_GEFORCE_6800_GT 0x00f9 | ||
1044 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE_SDR 0x0100 | 1058 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE_SDR 0x0100 |
1045 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE_DDR 0x0101 | 1059 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE_DDR 0x0101 |
1046 | #define PCI_DEVICE_ID_NVIDIA_QUADRO 0x0103 | 1060 | #define PCI_DEVICE_ID_NVIDIA_QUADRO 0x0103 |
@@ -2138,6 +2152,9 @@ | |||
2138 | #define PCI_DEVICE_ID_INTEL_IXP2800 0x9004 | 2152 | #define PCI_DEVICE_ID_INTEL_IXP2800 0x9004 |
2139 | #define PCI_DEVICE_ID_INTEL_S21152BB 0xb152 | 2153 | #define PCI_DEVICE_ID_INTEL_S21152BB 0xb152 |
2140 | 2154 | ||
2155 | #define PCI_VENDOR_ID_SCALEMP 0x8686 | ||
2156 | #define PCI_DEVICE_ID_SCALEMP_VSMP_CTL 0x1010 | ||
2157 | |||
2141 | #define PCI_VENDOR_ID_COMPUTONE 0x8e0e | 2158 | #define PCI_VENDOR_ID_COMPUTONE 0x8e0e |
2142 | #define PCI_DEVICE_ID_COMPUTONE_IP2EX 0x0291 | 2159 | #define PCI_DEVICE_ID_COMPUTONE_IP2EX 0x0291 |
2143 | #define PCI_DEVICE_ID_COMPUTONE_PG 0x0302 | 2160 | #define PCI_DEVICE_ID_COMPUTONE_PG 0x0302 |
diff --git a/include/linux/posix-timers.h b/include/linux/posix-timers.h index f942e2bad8e3..54faf5236da0 100644 --- a/include/linux/posix-timers.h +++ b/include/linux/posix-timers.h | |||
@@ -42,7 +42,7 @@ struct k_itimer { | |||
42 | timer_t it_id; /* timer id */ | 42 | timer_t it_id; /* timer id */ |
43 | int it_overrun; /* overrun on pending signal */ | 43 | int it_overrun; /* overrun on pending signal */ |
44 | int it_overrun_last; /* overrun on last delivered signal */ | 44 | int it_overrun_last; /* overrun on last delivered signal */ |
45 | int it_requeue_pending; /* waiting to requeue this timer */ | 45 | int it_requeue_pending; /* waiting to requeue this timer */ |
46 | #define REQUEUE_PENDING 1 | 46 | #define REQUEUE_PENDING 1 |
47 | int it_sigev_notify; /* notify word of sigevent struct */ | 47 | int it_sigev_notify; /* notify word of sigevent struct */ |
48 | int it_sigev_signo; /* signo word of sigevent struct */ | 48 | int it_sigev_signo; /* signo word of sigevent struct */ |
@@ -51,10 +51,8 @@ struct k_itimer { | |||
51 | struct sigqueue *sigq; /* signal queue entry. */ | 51 | struct sigqueue *sigq; /* signal queue entry. */ |
52 | union { | 52 | union { |
53 | struct { | 53 | struct { |
54 | struct timer_list timer; | 54 | struct hrtimer timer; |
55 | struct list_head abs_timer_entry; /* clock abs_timer_list */ | 55 | ktime_t interval; |
56 | struct timespec wall_to_prev; /* wall_to_monotonic used when set */ | ||
57 | unsigned long incr; /* interval in jiffies */ | ||
58 | } real; | 56 | } real; |
59 | struct cpu_timer_list cpu; | 57 | struct cpu_timer_list cpu; |
60 | struct { | 58 | struct { |
@@ -66,18 +64,14 @@ struct k_itimer { | |||
66 | } it; | 64 | } it; |
67 | }; | 65 | }; |
68 | 66 | ||
69 | struct k_clock_abs { | ||
70 | struct list_head list; | ||
71 | spinlock_t lock; | ||
72 | }; | ||
73 | struct k_clock { | 67 | struct k_clock { |
74 | int res; /* in nano seconds */ | 68 | int res; /* in nanoseconds */ |
75 | int (*clock_getres) (clockid_t which_clock, struct timespec *tp); | 69 | int (*clock_getres) (const clockid_t which_clock, struct timespec *tp); |
76 | struct k_clock_abs *abs_struct; | 70 | int (*clock_set) (const clockid_t which_clock, struct timespec * tp); |
77 | int (*clock_set) (clockid_t which_clock, struct timespec * tp); | 71 | int (*clock_get) (const clockid_t which_clock, struct timespec * tp); |
78 | int (*clock_get) (clockid_t which_clock, struct timespec * tp); | ||
79 | int (*timer_create) (struct k_itimer *timer); | 72 | int (*timer_create) (struct k_itimer *timer); |
80 | int (*nsleep) (clockid_t which_clock, int flags, struct timespec *); | 73 | int (*nsleep) (const clockid_t which_clock, int flags, |
74 | struct timespec *, struct timespec __user *); | ||
81 | int (*timer_set) (struct k_itimer * timr, int flags, | 75 | int (*timer_set) (struct k_itimer * timr, int flags, |
82 | struct itimerspec * new_setting, | 76 | struct itimerspec * new_setting, |
83 | struct itimerspec * old_setting); | 77 | struct itimerspec * old_setting); |
@@ -87,53 +81,35 @@ struct k_clock { | |||
87 | struct itimerspec * cur_setting); | 81 | struct itimerspec * cur_setting); |
88 | }; | 82 | }; |
89 | 83 | ||
90 | void register_posix_clock(clockid_t clock_id, struct k_clock *new_clock); | 84 | void register_posix_clock(const clockid_t clock_id, struct k_clock *new_clock); |
91 | 85 | ||
92 | /* Error handlers for timer_create, nanosleep and settime */ | 86 | /* error handlers for timer_create, nanosleep and settime */ |
93 | int do_posix_clock_notimer_create(struct k_itimer *timer); | 87 | int do_posix_clock_notimer_create(struct k_itimer *timer); |
94 | int do_posix_clock_nonanosleep(clockid_t, int flags, struct timespec *); | 88 | int do_posix_clock_nonanosleep(const clockid_t, int flags, struct timespec *, |
95 | int do_posix_clock_nosettime(clockid_t, struct timespec *tp); | 89 | struct timespec __user *); |
90 | int do_posix_clock_nosettime(const clockid_t, struct timespec *tp); | ||
96 | 91 | ||
97 | /* function to call to trigger timer event */ | 92 | /* function to call to trigger timer event */ |
98 | int posix_timer_event(struct k_itimer *timr, int si_private); | 93 | int posix_timer_event(struct k_itimer *timr, int si_private); |
99 | 94 | ||
100 | struct now_struct { | 95 | int posix_cpu_clock_getres(const clockid_t which_clock, struct timespec *ts); |
101 | unsigned long jiffies; | 96 | int posix_cpu_clock_get(const clockid_t which_clock, struct timespec *ts); |
102 | }; | 97 | int posix_cpu_clock_set(const clockid_t which_clock, const struct timespec *ts); |
103 | 98 | int posix_cpu_timer_create(struct k_itimer *timer); | |
104 | #define posix_get_now(now) (now)->jiffies = jiffies; | 99 | int posix_cpu_nsleep(const clockid_t which_clock, int flags, |
105 | #define posix_time_before(timer, now) \ | 100 | struct timespec *rqtp, struct timespec __user *rmtp); |
106 | time_before((timer)->expires, (now)->jiffies) | 101 | int posix_cpu_timer_set(struct k_itimer *timer, int flags, |
107 | 102 | struct itimerspec *new, struct itimerspec *old); | |
108 | #define posix_bump_timer(timr, now) \ | 103 | int posix_cpu_timer_del(struct k_itimer *timer); |
109 | do { \ | 104 | void posix_cpu_timer_get(struct k_itimer *timer, struct itimerspec *itp); |
110 | long delta, orun; \ | 105 | |
111 | delta = now.jiffies - (timr)->it.real.timer.expires; \ | 106 | void posix_cpu_timer_schedule(struct k_itimer *timer); |
112 | if (delta >= 0) { \ | 107 | |
113 | orun = 1 + (delta / (timr)->it.real.incr); \ | 108 | void run_posix_cpu_timers(struct task_struct *task); |
114 | (timr)->it.real.timer.expires += \ | 109 | void posix_cpu_timers_exit(struct task_struct *task); |
115 | orun * (timr)->it.real.incr; \ | 110 | void posix_cpu_timers_exit_group(struct task_struct *task); |
116 | (timr)->it_overrun += orun; \ | 111 | |
117 | } \ | 112 | void set_process_cpu_timer(struct task_struct *task, unsigned int clock_idx, |
118 | }while (0) | 113 | cputime_t *newval, cputime_t *oldval); |
119 | |||
120 | int posix_cpu_clock_getres(clockid_t which_clock, struct timespec *); | ||
121 | int posix_cpu_clock_get(clockid_t which_clock, struct timespec *); | ||
122 | int posix_cpu_clock_set(clockid_t which_clock, const struct timespec *tp); | ||
123 | int posix_cpu_timer_create(struct k_itimer *); | ||
124 | int posix_cpu_nsleep(clockid_t, int, struct timespec *); | ||
125 | int posix_cpu_timer_set(struct k_itimer *, int, | ||
126 | struct itimerspec *, struct itimerspec *); | ||
127 | int posix_cpu_timer_del(struct k_itimer *); | ||
128 | void posix_cpu_timer_get(struct k_itimer *, struct itimerspec *); | ||
129 | |||
130 | void posix_cpu_timer_schedule(struct k_itimer *); | ||
131 | |||
132 | void run_posix_cpu_timers(struct task_struct *); | ||
133 | void posix_cpu_timers_exit(struct task_struct *); | ||
134 | void posix_cpu_timers_exit_group(struct task_struct *); | ||
135 | |||
136 | void set_process_cpu_timer(struct task_struct *, unsigned int, | ||
137 | cputime_t *, cputime_t *); | ||
138 | 114 | ||
139 | #endif | 115 | #endif |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index a1d26cb28925..981f9aa43353 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -65,6 +65,10 @@ struct rcu_ctrlblk { | |||
65 | long cur; /* Current batch number. */ | 65 | long cur; /* Current batch number. */ |
66 | long completed; /* Number of the last completed batch */ | 66 | long completed; /* Number of the last completed batch */ |
67 | int next_pending; /* Is the next batch already waiting? */ | 67 | int next_pending; /* Is the next batch already waiting? */ |
68 | |||
69 | spinlock_t lock ____cacheline_internodealigned_in_smp; | ||
70 | cpumask_t cpumask; /* CPUs that need to switch in order */ | ||
71 | /* for current batch to proceed. */ | ||
68 | } ____cacheline_internodealigned_in_smp; | 72 | } ____cacheline_internodealigned_in_smp; |
69 | 73 | ||
70 | /* Is batch a before batch b ? */ | 74 | /* Is batch a before batch b ? */ |
diff --git a/include/linux/rio_drv.h b/include/linux/rio_drv.h index 157d7e3236b5..f54772d0e7f8 100644 --- a/include/linux/rio_drv.h +++ b/include/linux/rio_drv.h | |||
@@ -337,8 +337,8 @@ static inline void rio_init_dbell_res(struct resource *res, u16 start, u16 end) | |||
337 | 337 | ||
338 | /** | 338 | /** |
339 | * RIO_DEVICE - macro used to describe a specific RIO device | 339 | * RIO_DEVICE - macro used to describe a specific RIO device |
340 | * @vid: the 16 bit RIO vendor ID | 340 | * @dev: the 16 bit RIO device ID |
341 | * @did: the 16 bit RIO device ID | 341 | * @ven: the 16 bit RIO vendor ID |
342 | * | 342 | * |
343 | * This macro is used to create a struct rio_device_id that matches a | 343 | * This macro is used to create a struct rio_device_id that matches a |
344 | * specific device. The assembly vendor and assembly device fields | 344 | * specific device. The assembly vendor and assembly device fields |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 85b53f87c703..a72e17135421 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -105,6 +105,7 @@ extern unsigned long nr_iowait(void); | |||
105 | #include <linux/param.h> | 105 | #include <linux/param.h> |
106 | #include <linux/resource.h> | 106 | #include <linux/resource.h> |
107 | #include <linux/timer.h> | 107 | #include <linux/timer.h> |
108 | #include <linux/hrtimer.h> | ||
108 | 109 | ||
109 | #include <asm/processor.h> | 110 | #include <asm/processor.h> |
110 | 111 | ||
@@ -398,8 +399,8 @@ struct signal_struct { | |||
398 | struct list_head posix_timers; | 399 | struct list_head posix_timers; |
399 | 400 | ||
400 | /* ITIMER_REAL timer for the process */ | 401 | /* ITIMER_REAL timer for the process */ |
401 | struct timer_list real_timer; | 402 | struct hrtimer real_timer; |
402 | unsigned long it_real_value, it_real_incr; | 403 | ktime_t it_real_incr; |
403 | 404 | ||
404 | /* ITIMER_PROF and ITIMER_VIRTUAL timers for the process */ | 405 | /* ITIMER_PROF and ITIMER_VIRTUAL timers for the process */ |
405 | cputime_t it_prof_expires, it_virt_expires; | 406 | cputime_t it_prof_expires, it_virt_expires; |
@@ -630,7 +631,14 @@ struct sched_domain { | |||
630 | 631 | ||
631 | extern void partition_sched_domains(cpumask_t *partition1, | 632 | extern void partition_sched_domains(cpumask_t *partition1, |
632 | cpumask_t *partition2); | 633 | cpumask_t *partition2); |
633 | #endif /* CONFIG_SMP */ | 634 | |
635 | /* | ||
636 | * Maximum cache size the migration-costs auto-tuning code will | ||
637 | * search from: | ||
638 | */ | ||
639 | extern unsigned int max_cache_size; | ||
640 | |||
641 | #endif /* CONFIG_SMP */ | ||
634 | 642 | ||
635 | 643 | ||
636 | struct io_context; /* See blkdev.h */ | 644 | struct io_context; /* See blkdev.h */ |
@@ -688,9 +696,12 @@ struct task_struct { | |||
688 | 696 | ||
689 | int lock_depth; /* BKL lock depth */ | 697 | int lock_depth; /* BKL lock depth */ |
690 | 698 | ||
691 | #if defined(CONFIG_SMP) && defined(__ARCH_WANT_UNLOCKED_CTXSW) | 699 | #if defined(CONFIG_SMP) |
700 | int last_waker_cpu; /* CPU that last woke this task up */ | ||
701 | #if defined(__ARCH_WANT_UNLOCKED_CTXSW) | ||
692 | int oncpu; | 702 | int oncpu; |
693 | #endif | 703 | #endif |
704 | #endif | ||
694 | int prio, static_prio; | 705 | int prio, static_prio; |
695 | struct list_head run_list; | 706 | struct list_head run_list; |
696 | prio_array_t *array; | 707 | prio_array_t *array; |
@@ -1111,21 +1122,6 @@ static inline int sas_ss_flags(unsigned long sp) | |||
1111 | : on_sig_stack(sp) ? SS_ONSTACK : 0); | 1122 | : on_sig_stack(sp) ? SS_ONSTACK : 0); |
1112 | } | 1123 | } |
1113 | 1124 | ||
1114 | |||
1115 | #ifdef CONFIG_SECURITY | ||
1116 | /* code is in security.c */ | ||
1117 | extern int capable(int cap); | ||
1118 | #else | ||
1119 | static inline int capable(int cap) | ||
1120 | { | ||
1121 | if (cap_raised(current->cap_effective, cap)) { | ||
1122 | current->flags |= PF_SUPERPRIV; | ||
1123 | return 1; | ||
1124 | } | ||
1125 | return 0; | ||
1126 | } | ||
1127 | #endif | ||
1128 | |||
1129 | /* | 1125 | /* |
1130 | * Routines for handling mm_structs | 1126 | * Routines for handling mm_structs |
1131 | */ | 1127 | */ |
@@ -1244,6 +1240,7 @@ static inline void task_unlock(struct task_struct *p) | |||
1244 | #ifndef __HAVE_THREAD_FUNCTIONS | 1240 | #ifndef __HAVE_THREAD_FUNCTIONS |
1245 | 1241 | ||
1246 | #define task_thread_info(task) (task)->thread_info | 1242 | #define task_thread_info(task) (task)->thread_info |
1243 | #define task_stack_page(task) ((void*)((task)->thread_info)) | ||
1247 | 1244 | ||
1248 | static inline void setup_thread_stack(struct task_struct *p, struct task_struct *org) | 1245 | static inline void setup_thread_stack(struct task_struct *p, struct task_struct *org) |
1249 | { | 1246 | { |
@@ -1389,12 +1386,8 @@ static inline void arch_pick_mmap_layout(struct mm_struct *mm) | |||
1389 | extern long sched_setaffinity(pid_t pid, cpumask_t new_mask); | 1386 | extern long sched_setaffinity(pid_t pid, cpumask_t new_mask); |
1390 | extern long sched_getaffinity(pid_t pid, cpumask_t *mask); | 1387 | extern long sched_getaffinity(pid_t pid, cpumask_t *mask); |
1391 | 1388 | ||
1392 | #ifdef CONFIG_MAGIC_SYSRQ | ||
1393 | |||
1394 | extern void normalize_rt_tasks(void); | 1389 | extern void normalize_rt_tasks(void); |
1395 | 1390 | ||
1396 | #endif | ||
1397 | |||
1398 | #ifdef CONFIG_PM | 1391 | #ifdef CONFIG_PM |
1399 | /* | 1392 | /* |
1400 | * Check if a process has been frozen | 1393 | * Check if a process has been frozen |
diff --git a/include/linux/screen_info.h b/include/linux/screen_info.h index 76850b75b3f6..6336987dae62 100644 --- a/include/linux/screen_info.h +++ b/include/linux/screen_info.h | |||
@@ -41,8 +41,7 @@ struct screen_info { | |||
41 | u16 vesapm_off; /* 0x30 */ | 41 | u16 vesapm_off; /* 0x30 */ |
42 | u16 pages; /* 0x32 */ | 42 | u16 pages; /* 0x32 */ |
43 | u16 vesa_attributes; /* 0x34 */ | 43 | u16 vesa_attributes; /* 0x34 */ |
44 | u32 capabilities; /* 0x36 */ | 44 | /* 0x36 -- 0x3f reserved for future expansion */ |
45 | /* 0x3a -- 0x3f reserved for future expansion */ | ||
46 | }; | 45 | }; |
47 | 46 | ||
48 | extern struct screen_info screen_info; | 47 | extern struct screen_info screen_info; |
diff --git a/include/linux/time.h b/include/linux/time.h index 797ccd813bb0..f2aca7ec6325 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
@@ -4,7 +4,7 @@ | |||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | 5 | ||
6 | #ifdef __KERNEL__ | 6 | #ifdef __KERNEL__ |
7 | #include <linux/seqlock.h> | 7 | # include <linux/seqlock.h> |
8 | #endif | 8 | #endif |
9 | 9 | ||
10 | #ifndef _STRUCT_TIMESPEC | 10 | #ifndef _STRUCT_TIMESPEC |
@@ -13,7 +13,7 @@ struct timespec { | |||
13 | time_t tv_sec; /* seconds */ | 13 | time_t tv_sec; /* seconds */ |
14 | long tv_nsec; /* nanoseconds */ | 14 | long tv_nsec; /* nanoseconds */ |
15 | }; | 15 | }; |
16 | #endif /* _STRUCT_TIMESPEC */ | 16 | #endif |
17 | 17 | ||
18 | struct timeval { | 18 | struct timeval { |
19 | time_t tv_sec; /* seconds */ | 19 | time_t tv_sec; /* seconds */ |
@@ -27,93 +27,103 @@ struct timezone { | |||
27 | 27 | ||
28 | #ifdef __KERNEL__ | 28 | #ifdef __KERNEL__ |
29 | 29 | ||
30 | /* Parameters used to convert the timespec values */ | 30 | /* Parameters used to convert the timespec values: */ |
31 | #define MSEC_PER_SEC (1000L) | 31 | #define MSEC_PER_SEC 1000L |
32 | #define USEC_PER_SEC (1000000L) | 32 | #define USEC_PER_SEC 1000000L |
33 | #define NSEC_PER_SEC (1000000000L) | 33 | #define NSEC_PER_SEC 1000000000L |
34 | #define NSEC_PER_USEC (1000L) | 34 | #define NSEC_PER_USEC 1000L |
35 | 35 | ||
36 | static __inline__ int timespec_equal(struct timespec *a, struct timespec *b) | 36 | static __inline__ int timespec_equal(struct timespec *a, struct timespec *b) |
37 | { | 37 | { |
38 | return (a->tv_sec == b->tv_sec) && (a->tv_nsec == b->tv_nsec); | 38 | return (a->tv_sec == b->tv_sec) && (a->tv_nsec == b->tv_nsec); |
39 | } | 39 | } |
40 | 40 | ||
41 | /* Converts Gregorian date to seconds since 1970-01-01 00:00:00. | 41 | extern unsigned long mktime(const unsigned int year, const unsigned int mon, |
42 | * Assumes input in normal date format, i.e. 1980-12-31 23:59:59 | 42 | const unsigned int day, const unsigned int hour, |
43 | * => year=1980, mon=12, day=31, hour=23, min=59, sec=59. | 43 | const unsigned int min, const unsigned int sec); |
44 | * | 44 | |
45 | * [For the Julian calendar (which was used in Russia before 1917, | 45 | extern void set_normalized_timespec(struct timespec *ts, time_t sec, long nsec); |
46 | * Britain & colonies before 1752, anywhere else before 1582, | 46 | |
47 | * and is still in use by some communities) leave out the | 47 | /* |
48 | * -year/100+year/400 terms, and add 10.] | 48 | * Returns true if the timespec is norm, false if denorm: |
49 | * | ||
50 | * This algorithm was first published by Gauss (I think). | ||
51 | * | ||
52 | * WARNING: this function will overflow on 2106-02-07 06:28:16 on | ||
53 | * machines were long is 32-bit! (However, as time_t is signed, we | ||
54 | * will already get problems at other places on 2038-01-19 03:14:08) | ||
55 | */ | 49 | */ |
56 | static inline unsigned long | 50 | #define timespec_valid(ts) \ |
57 | mktime (unsigned int year, unsigned int mon, | 51 | (((ts)->tv_sec >= 0) && (((unsigned) (ts)->tv_nsec) < NSEC_PER_SEC)) |
58 | unsigned int day, unsigned int hour, | 52 | |
59 | unsigned int min, unsigned int sec) | 53 | /* |
60 | { | 54 | * 64-bit nanosec type. Large enough to span 292+ years in nanosecond |
61 | if (0 >= (int) (mon -= 2)) { /* 1..12 -> 11,12,1..10 */ | 55 | * resolution. Ought to be enough for a while. |
62 | mon += 12; /* Puts Feb last since it has leap day */ | 56 | */ |
63 | year -= 1; | 57 | typedef s64 nsec_t; |
64 | } | ||
65 | |||
66 | return ((( | ||
67 | (unsigned long) (year/4 - year/100 + year/400 + 367*mon/12 + day) + | ||
68 | year*365 - 719499 | ||
69 | )*24 + hour /* now have hours */ | ||
70 | )*60 + min /* now have minutes */ | ||
71 | )*60 + sec; /* finally seconds */ | ||
72 | } | ||
73 | 58 | ||
74 | extern struct timespec xtime; | 59 | extern struct timespec xtime; |
75 | extern struct timespec wall_to_monotonic; | 60 | extern struct timespec wall_to_monotonic; |
76 | extern seqlock_t xtime_lock; | 61 | extern seqlock_t xtime_lock; |
77 | 62 | ||
78 | static inline unsigned long get_seconds(void) | 63 | static inline unsigned long get_seconds(void) |
79 | { | 64 | { |
80 | return xtime.tv_sec; | 65 | return xtime.tv_sec; |
81 | } | 66 | } |
82 | 67 | ||
83 | struct timespec current_kernel_time(void); | 68 | struct timespec current_kernel_time(void); |
84 | 69 | ||
85 | #define CURRENT_TIME (current_kernel_time()) | 70 | #define CURRENT_TIME (current_kernel_time()) |
86 | #define CURRENT_TIME_SEC ((struct timespec) { xtime.tv_sec, 0 }) | 71 | #define CURRENT_TIME_SEC ((struct timespec) { xtime.tv_sec, 0 }) |
87 | 72 | ||
88 | extern void do_gettimeofday(struct timeval *tv); | 73 | extern void do_gettimeofday(struct timeval *tv); |
89 | extern int do_settimeofday(struct timespec *tv); | 74 | extern int do_settimeofday(struct timespec *tv); |
90 | extern int do_sys_settimeofday(struct timespec *tv, struct timezone *tz); | 75 | extern int do_sys_settimeofday(struct timespec *tv, struct timezone *tz); |
91 | extern void clock_was_set(void); // call when ever the clock is set | 76 | #define do_posix_clock_monotonic_gettime(ts) ktime_get_ts(ts) |
92 | extern int do_posix_clock_monotonic_gettime(struct timespec *tp); | 77 | extern long do_utimes(char __user *filename, struct timeval *times); |
93 | extern long do_utimes(char __user * filename, struct timeval * times); | ||
94 | struct itimerval; | 78 | struct itimerval; |
95 | extern int do_setitimer(int which, struct itimerval *value, struct itimerval *ovalue); | 79 | extern int do_setitimer(int which, struct itimerval *value, |
80 | struct itimerval *ovalue); | ||
96 | extern int do_getitimer(int which, struct itimerval *value); | 81 | extern int do_getitimer(int which, struct itimerval *value); |
97 | extern void getnstimeofday (struct timespec *tv); | 82 | extern void getnstimeofday(struct timespec *tv); |
98 | extern void getnstimestamp(struct timespec *ts); | ||
99 | 83 | ||
100 | extern struct timespec timespec_trunc(struct timespec t, unsigned gran); | 84 | extern struct timespec timespec_trunc(struct timespec t, unsigned gran); |
101 | 85 | ||
102 | static inline void | 86 | /** |
103 | set_normalized_timespec (struct timespec *ts, time_t sec, long nsec) | 87 | * timespec_to_ns - Convert timespec to nanoseconds |
88 | * @ts: pointer to the timespec variable to be converted | ||
89 | * | ||
90 | * Returns the scalar nanosecond representation of the timespec | ||
91 | * parameter. | ||
92 | */ | ||
93 | static inline nsec_t timespec_to_ns(const struct timespec *ts) | ||
104 | { | 94 | { |
105 | while (nsec >= NSEC_PER_SEC) { | 95 | return ((nsec_t) ts->tv_sec * NSEC_PER_SEC) + ts->tv_nsec; |
106 | nsec -= NSEC_PER_SEC; | ||
107 | ++sec; | ||
108 | } | ||
109 | while (nsec < 0) { | ||
110 | nsec += NSEC_PER_SEC; | ||
111 | --sec; | ||
112 | } | ||
113 | ts->tv_sec = sec; | ||
114 | ts->tv_nsec = nsec; | ||
115 | } | 96 | } |
116 | 97 | ||
98 | /** | ||
99 | * timeval_to_ns - Convert timeval to nanoseconds | ||
100 | * @ts: pointer to the timeval variable to be converted | ||
101 | * | ||
102 | * Returns the scalar nanosecond representation of the timeval | ||
103 | * parameter. | ||
104 | */ | ||
105 | static inline nsec_t timeval_to_ns(const struct timeval *tv) | ||
106 | { | ||
107 | return ((nsec_t) tv->tv_sec * NSEC_PER_SEC) + | ||
108 | tv->tv_usec * NSEC_PER_USEC; | ||
109 | } | ||
110 | |||
111 | /** | ||
112 | * ns_to_timespec - Convert nanoseconds to timespec | ||
113 | * @nsec: the nanoseconds value to be converted | ||
114 | * | ||
115 | * Returns the timespec representation of the nsec parameter. | ||
116 | */ | ||
117 | extern struct timespec ns_to_timespec(const nsec_t nsec); | ||
118 | |||
119 | /** | ||
120 | * ns_to_timeval - Convert nanoseconds to timeval | ||
121 | * @nsec: the nanoseconds value to be converted | ||
122 | * | ||
123 | * Returns the timeval representation of the nsec parameter. | ||
124 | */ | ||
125 | extern struct timeval ns_to_timeval(const nsec_t nsec); | ||
126 | |||
117 | #endif /* __KERNEL__ */ | 127 | #endif /* __KERNEL__ */ |
118 | 128 | ||
119 | #define NFDBITS __NFDBITS | 129 | #define NFDBITS __NFDBITS |
@@ -126,49 +136,41 @@ set_normalized_timespec (struct timespec *ts, time_t sec, long nsec) | |||
126 | 136 | ||
127 | /* | 137 | /* |
128 | * Names of the interval timers, and structure | 138 | * Names of the interval timers, and structure |
129 | * defining a timer setting. | 139 | * defining a timer setting: |
130 | */ | 140 | */ |
131 | #define ITIMER_REAL 0 | 141 | #define ITIMER_REAL 0 |
132 | #define ITIMER_VIRTUAL 1 | 142 | #define ITIMER_VIRTUAL 1 |
133 | #define ITIMER_PROF 2 | 143 | #define ITIMER_PROF 2 |
134 | 144 | ||
135 | struct itimerspec { | 145 | struct itimerspec { |
136 | struct timespec it_interval; /* timer period */ | 146 | struct timespec it_interval; /* timer period */ |
137 | struct timespec it_value; /* timer expiration */ | 147 | struct timespec it_value; /* timer expiration */ |
138 | }; | 148 | }; |
139 | 149 | ||
140 | struct itimerval { | 150 | struct itimerval { |
141 | struct timeval it_interval; /* timer interval */ | 151 | struct timeval it_interval; /* timer interval */ |
142 | struct timeval it_value; /* current value */ | 152 | struct timeval it_value; /* current value */ |
143 | }; | 153 | }; |
144 | 154 | ||
145 | |||
146 | /* | 155 | /* |
147 | * The IDs of the various system clocks (for POSIX.1b interval timers). | 156 | * The IDs of the various system clocks (for POSIX.1b interval timers): |
148 | */ | 157 | */ |
149 | #define CLOCK_REALTIME 0 | 158 | #define CLOCK_REALTIME 0 |
150 | #define CLOCK_MONOTONIC 1 | 159 | #define CLOCK_MONOTONIC 1 |
151 | #define CLOCK_PROCESS_CPUTIME_ID 2 | 160 | #define CLOCK_PROCESS_CPUTIME_ID 2 |
152 | #define CLOCK_THREAD_CPUTIME_ID 3 | 161 | #define CLOCK_THREAD_CPUTIME_ID 3 |
153 | #define CLOCK_REALTIME_HR 4 | ||
154 | #define CLOCK_MONOTONIC_HR 5 | ||
155 | 162 | ||
156 | /* | 163 | /* |
157 | * The IDs of various hardware clocks | 164 | * The IDs of various hardware clocks: |
158 | */ | 165 | */ |
159 | 166 | #define CLOCK_SGI_CYCLE 10 | |
160 | 167 | #define MAX_CLOCKS 16 | |
161 | #define CLOCK_SGI_CYCLE 10 | 168 | #define CLOCKS_MASK (CLOCK_REALTIME | CLOCK_MONOTONIC) |
162 | #define MAX_CLOCKS 16 | 169 | #define CLOCKS_MONO CLOCK_MONOTONIC |
163 | #define CLOCKS_MASK (CLOCK_REALTIME | CLOCK_MONOTONIC | \ | ||
164 | CLOCK_REALTIME_HR | CLOCK_MONOTONIC_HR) | ||
165 | #define CLOCKS_MONO (CLOCK_MONOTONIC & CLOCK_MONOTONIC_HR) | ||
166 | 170 | ||
167 | /* | 171 | /* |
168 | * The various flags for setting POSIX.1b interval timers. | 172 | * The various flags for setting POSIX.1b interval timers: |
169 | */ | 173 | */ |
170 | 174 | #define TIMER_ABSTIME 0x01 | |
171 | #define TIMER_ABSTIME 0x01 | ||
172 | |||
173 | 175 | ||
174 | #endif | 176 | #endif |
diff --git a/include/linux/timer.h b/include/linux/timer.h index 72f3a7781106..9b9877fd2505 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h | |||
@@ -96,6 +96,6 @@ static inline void add_timer(struct timer_list *timer) | |||
96 | 96 | ||
97 | extern void init_timers(void); | 97 | extern void init_timers(void); |
98 | extern void run_local_timers(void); | 98 | extern void run_local_timers(void); |
99 | extern void it_real_fn(unsigned long); | 99 | extern int it_real_fn(void *); |
100 | 100 | ||
101 | #endif | 101 | #endif |
diff --git a/include/linux/topology.h b/include/linux/topology.h index 3df1d474e5c5..315a5163d6a0 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h | |||
@@ -86,7 +86,6 @@ | |||
86 | .max_interval = 2, \ | 86 | .max_interval = 2, \ |
87 | .busy_factor = 8, \ | 87 | .busy_factor = 8, \ |
88 | .imbalance_pct = 110, \ | 88 | .imbalance_pct = 110, \ |
89 | .cache_hot_time = 0, \ | ||
90 | .cache_nice_tries = 0, \ | 89 | .cache_nice_tries = 0, \ |
91 | .per_cpu_gain = 25, \ | 90 | .per_cpu_gain = 25, \ |
92 | .busy_idx = 0, \ | 91 | .busy_idx = 0, \ |
@@ -117,7 +116,6 @@ | |||
117 | .max_interval = 4, \ | 116 | .max_interval = 4, \ |
118 | .busy_factor = 64, \ | 117 | .busy_factor = 64, \ |
119 | .imbalance_pct = 125, \ | 118 | .imbalance_pct = 125, \ |
120 | .cache_hot_time = (5*1000000/2), \ | ||
121 | .cache_nice_tries = 1, \ | 119 | .cache_nice_tries = 1, \ |
122 | .per_cpu_gain = 100, \ | 120 | .per_cpu_gain = 100, \ |
123 | .busy_idx = 2, \ | 121 | .busy_idx = 2, \ |
diff --git a/include/linux/tty.h b/include/linux/tty.h index 57449704a47b..3787102e4b12 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -51,16 +51,22 @@ | |||
51 | */ | 51 | */ |
52 | #define TTY_FLIPBUF_SIZE 512 | 52 | #define TTY_FLIPBUF_SIZE 512 |
53 | 53 | ||
54 | struct tty_flip_buffer { | 54 | struct tty_buffer { |
55 | struct tty_buffer *next; | ||
56 | char *char_buf_ptr; | ||
57 | unsigned char *flag_buf_ptr; | ||
58 | int used; | ||
59 | int size; | ||
60 | /* Data points here */ | ||
61 | unsigned long data[0]; | ||
62 | }; | ||
63 | |||
64 | struct tty_bufhead { | ||
55 | struct work_struct work; | 65 | struct work_struct work; |
56 | struct semaphore pty_sem; | 66 | struct semaphore pty_sem; |
57 | char *char_buf_ptr; | 67 | struct tty_buffer *head; /* Queue head */ |
58 | unsigned char *flag_buf_ptr; | 68 | struct tty_buffer *tail; /* Active buffer */ |
59 | int count; | 69 | struct tty_buffer *free; /* Free queue head */ |
60 | int buf_num; | ||
61 | unsigned char char_buf[2*TTY_FLIPBUF_SIZE]; | ||
62 | char flag_buf[2*TTY_FLIPBUF_SIZE]; | ||
63 | unsigned char slop[4]; /* N.B. bug overwrites buffer by 1 */ | ||
64 | }; | 70 | }; |
65 | /* | 71 | /* |
66 | * The pty uses char_buf and flag_buf as a contiguous buffer | 72 | * The pty uses char_buf and flag_buf as a contiguous buffer |
@@ -186,10 +192,11 @@ struct tty_struct { | |||
186 | unsigned char stopped:1, hw_stopped:1, flow_stopped:1, packet:1; | 192 | unsigned char stopped:1, hw_stopped:1, flow_stopped:1, packet:1; |
187 | unsigned char low_latency:1, warned:1; | 193 | unsigned char low_latency:1, warned:1; |
188 | unsigned char ctrl_status; | 194 | unsigned char ctrl_status; |
195 | unsigned int receive_room; /* Bytes free for queue */ | ||
189 | 196 | ||
190 | struct tty_struct *link; | 197 | struct tty_struct *link; |
191 | struct fasync_struct *fasync; | 198 | struct fasync_struct *fasync; |
192 | struct tty_flip_buffer flip; | 199 | struct tty_bufhead buf; |
193 | int max_flip_cnt; | 200 | int max_flip_cnt; |
194 | int alt_speed; /* For magic substitution of 38400 bps */ | 201 | int alt_speed; /* For magic substitution of 38400 bps */ |
195 | wait_queue_head_t write_wait; | 202 | wait_queue_head_t write_wait; |
diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h index abe9bfcf226c..be1400e82482 100644 --- a/include/linux/tty_flip.h +++ b/include/linux/tty_flip.h | |||
@@ -1,25 +1,33 @@ | |||
1 | #ifndef _LINUX_TTY_FLIP_H | 1 | #ifndef _LINUX_TTY_FLIP_H |
2 | #define _LINUX_TTY_FLIP_H | 2 | #define _LINUX_TTY_FLIP_H |
3 | 3 | ||
4 | extern int tty_buffer_request_room(struct tty_struct *tty, size_t size); | ||
5 | extern int tty_insert_flip_string(struct tty_struct *tty, unsigned char *chars, size_t size); | ||
6 | extern int tty_insert_flip_string_flags(struct tty_struct *tty, unsigned char *chars, char *flags, size_t size); | ||
7 | extern int tty_prepare_flip_string(struct tty_struct *tty, unsigned char **chars, size_t size); | ||
8 | extern int tty_prepare_flip_string_flags(struct tty_struct *tty, unsigned char **chars, char **flags, size_t size); | ||
9 | |||
4 | #ifdef INCLUDE_INLINE_FUNCS | 10 | #ifdef INCLUDE_INLINE_FUNCS |
5 | #define _INLINE_ extern | 11 | #define _INLINE_ extern |
6 | #else | 12 | #else |
7 | #define _INLINE_ static __inline__ | 13 | #define _INLINE_ static __inline__ |
8 | #endif | 14 | #endif |
9 | 15 | ||
10 | _INLINE_ void tty_insert_flip_char(struct tty_struct *tty, | 16 | _INLINE_ int tty_insert_flip_char(struct tty_struct *tty, |
11 | unsigned char ch, char flag) | 17 | unsigned char ch, char flag) |
12 | { | 18 | { |
13 | if (tty->flip.count < TTY_FLIPBUF_SIZE) { | 19 | struct tty_buffer *tb = tty->buf.tail; |
14 | tty->flip.count++; | 20 | if (tb && tb->used < tb->size) { |
15 | *tty->flip.flag_buf_ptr++ = flag; | 21 | tb->flag_buf_ptr[tb->used] = flag; |
16 | *tty->flip.char_buf_ptr++ = ch; | 22 | tb->char_buf_ptr[tb->used++] = ch; |
23 | return 1; | ||
17 | } | 24 | } |
25 | return tty_insert_flip_string_flags(tty, &ch, &flag, 1); | ||
18 | } | 26 | } |
19 | 27 | ||
20 | _INLINE_ void tty_schedule_flip(struct tty_struct *tty) | 28 | _INLINE_ void tty_schedule_flip(struct tty_struct *tty) |
21 | { | 29 | { |
22 | schedule_delayed_work(&tty->flip.work, 1); | 30 | schedule_delayed_work(&tty->buf.work, 1); |
23 | } | 31 | } |
24 | 32 | ||
25 | #undef _INLINE_ | 33 | #undef _INLINE_ |
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h index 6066afde5ce4..83c6e6c10ebb 100644 --- a/include/linux/tty_ldisc.h +++ b/include/linux/tty_ldisc.h | |||
@@ -81,14 +81,6 @@ | |||
81 | * pointer of flag bytes which indicate whether a character was | 81 | * pointer of flag bytes which indicate whether a character was |
82 | * received with a parity error, etc. | 82 | * received with a parity error, etc. |
83 | * | 83 | * |
84 | * int (*receive_room)(struct tty_struct *); | ||
85 | * | ||
86 | * This function is called by the low-level tty driver to | ||
87 | * determine how many characters the line discpline can accept. | ||
88 | * The low-level driver must not send more characters than was | ||
89 | * indicated by receive_room, or the line discpline may drop | ||
90 | * those characters. | ||
91 | * | ||
92 | * void (*write_wakeup)(struct tty_struct *); | 84 | * void (*write_wakeup)(struct tty_struct *); |
93 | * | 85 | * |
94 | * This function is called by the low-level tty driver to signal | 86 | * This function is called by the low-level tty driver to signal |
@@ -136,7 +128,6 @@ struct tty_ldisc { | |||
136 | */ | 128 | */ |
137 | void (*receive_buf)(struct tty_struct *, const unsigned char *cp, | 129 | void (*receive_buf)(struct tty_struct *, const unsigned char *cp, |
138 | char *fp, int count); | 130 | char *fp, int count); |
139 | int (*receive_room)(struct tty_struct *); | ||
140 | void (*write_wakeup)(struct tty_struct *); | 131 | void (*write_wakeup)(struct tty_struct *); |
141 | 132 | ||
142 | struct module *owner; | 133 | struct module *owner; |
diff --git a/include/linux/xattr.h b/include/linux/xattr.h index 23f9c61d9546..cda8a96e2fa0 100644 --- a/include/linux/xattr.h +++ b/include/linux/xattr.h | |||
@@ -13,7 +13,22 @@ | |||
13 | #define XATTR_CREATE 0x1 /* set value, fail if attr already exists */ | 13 | #define XATTR_CREATE 0x1 /* set value, fail if attr already exists */ |
14 | #define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */ | 14 | #define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */ |
15 | 15 | ||
16 | /* Namespaces */ | ||
17 | #define XATTR_OS2_PREFIX "os2." | ||
18 | #define XATTR_OS2_PREFIX_LEN (sizeof (XATTR_OS2_PREFIX) - 1) | ||
19 | |||
16 | #define XATTR_SECURITY_PREFIX "security." | 20 | #define XATTR_SECURITY_PREFIX "security." |
21 | #define XATTR_SECURITY_PREFIX_LEN (sizeof (XATTR_SECURITY_PREFIX) - 1) | ||
22 | |||
23 | #define XATTR_SYSTEM_PREFIX "system." | ||
24 | #define XATTR_SYSTEM_PREFIX_LEN (sizeof (XATTR_SYSTEM_PREFIX) - 1) | ||
25 | |||
26 | #define XATTR_TRUSTED_PREFIX "trusted." | ||
27 | #define XATTR_TRUSTED_PREFIX_LEN (sizeof (XATTR_TRUSTED_PREFIX) - 1) | ||
28 | |||
29 | #define XATTR_USER_PREFIX "user." | ||
30 | #define XATTR_USER_PREFIX_LEN (sizeof (XATTR_USER_PREFIX) - 1) | ||
31 | |||
17 | 32 | ||
18 | struct xattr_handler { | 33 | struct xattr_handler { |
19 | char *prefix; | 34 | char *prefix; |
@@ -25,6 +40,10 @@ struct xattr_handler { | |||
25 | size_t size, int flags); | 40 | size_t size, int flags); |
26 | }; | 41 | }; |
27 | 42 | ||
43 | ssize_t vfs_getxattr(struct dentry *, char *, void *, size_t); | ||
44 | int vfs_setxattr(struct dentry *, char *, void *, size_t, int); | ||
45 | int vfs_removexattr(struct dentry *, char *); | ||
46 | |||
28 | ssize_t generic_getxattr(struct dentry *dentry, const char *name, void *buffer, size_t size); | 47 | ssize_t generic_getxattr(struct dentry *dentry, const char *name, void *buffer, size_t size); |
29 | ssize_t generic_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size); | 48 | ssize_t generic_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size); |
30 | int generic_setxattr(struct dentry *dentry, const char *name, const void *value, size_t size, int flags); | 49 | int generic_setxattr(struct dentry *dentry, const char *name, const void *value, size_t size, int flags); |
diff --git a/include/linux/zlib.h b/include/linux/zlib.h index 74f7b78c22d2..4fa32f0d4df8 100644 --- a/include/linux/zlib.h +++ b/include/linux/zlib.h | |||
@@ -442,9 +442,11 @@ extern int deflateInit2 (z_streamp strm, | |||
442 | not perform any compression: this will be done by deflate(). | 442 | not perform any compression: this will be done by deflate(). |
443 | */ | 443 | */ |
444 | 444 | ||
445 | #if 0 | ||
445 | extern int zlib_deflateSetDictionary (z_streamp strm, | 446 | extern int zlib_deflateSetDictionary (z_streamp strm, |
446 | const Byte *dictionary, | 447 | const Byte *dictionary, |
447 | uInt dictLength); | 448 | uInt dictLength); |
449 | #endif | ||
448 | /* | 450 | /* |
449 | Initializes the compression dictionary from the given byte sequence | 451 | Initializes the compression dictionary from the given byte sequence |
450 | without producing any compressed output. This function must be called | 452 | without producing any compressed output. This function must be called |
@@ -478,7 +480,10 @@ extern int zlib_deflateSetDictionary (z_streamp strm, | |||
478 | perform any compression: this will be done by deflate(). | 480 | perform any compression: this will be done by deflate(). |
479 | */ | 481 | */ |
480 | 482 | ||
483 | #if 0 | ||
481 | extern int zlib_deflateCopy (z_streamp dest, z_streamp source); | 484 | extern int zlib_deflateCopy (z_streamp dest, z_streamp source); |
485 | #endif | ||
486 | |||
482 | /* | 487 | /* |
483 | Sets the destination stream as a complete copy of the source stream. | 488 | Sets the destination stream as a complete copy of the source stream. |
484 | 489 | ||
@@ -511,7 +516,9 @@ static inline unsigned long deflateBound(unsigned long s) | |||
511 | return s + ((s + 7) >> 3) + ((s + 63) >> 6) + 11; | 516 | return s + ((s + 7) >> 3) + ((s + 63) >> 6) + 11; |
512 | } | 517 | } |
513 | 518 | ||
519 | #if 0 | ||
514 | extern int zlib_deflateParams (z_streamp strm, int level, int strategy); | 520 | extern int zlib_deflateParams (z_streamp strm, int level, int strategy); |
521 | #endif | ||
515 | /* | 522 | /* |
516 | Dynamically update the compression level and compression strategy. The | 523 | Dynamically update the compression level and compression strategy. The |
517 | interpretation of level and strategy is as in deflateInit2. This can be | 524 | interpretation of level and strategy is as in deflateInit2. This can be |
@@ -571,7 +578,9 @@ extern int zlib_inflateSetDictionary (z_streamp strm, | |||
571 | inflate(). | 578 | inflate(). |
572 | */ | 579 | */ |
573 | 580 | ||
581 | #if 0 | ||
574 | extern int zlib_inflateSync (z_streamp strm); | 582 | extern int zlib_inflateSync (z_streamp strm); |
583 | #endif | ||
575 | /* | 584 | /* |
576 | Skips invalid compressed data until a full flush point (see above the | 585 | Skips invalid compressed data until a full flush point (see above the |
577 | description of deflate with Z_FULL_FLUSH) can be found, or until all | 586 | description of deflate with Z_FULL_FLUSH) can be found, or until all |
@@ -636,7 +645,9 @@ extern int zlib_inflateInit2_ (z_streamp strm, int windowBits, | |||
636 | #endif | 645 | #endif |
637 | 646 | ||
638 | extern const char * zlib_zError (int err); | 647 | extern const char * zlib_zError (int err); |
648 | #if 0 | ||
639 | extern int zlib_inflateSyncPoint (z_streamp z); | 649 | extern int zlib_inflateSyncPoint (z_streamp z); |
650 | #endif | ||
640 | extern const uLong * zlib_get_crc_table (void); | 651 | extern const uLong * zlib_get_crc_table (void); |
641 | 652 | ||
642 | #endif /* _ZLIB_H */ | 653 | #endif /* _ZLIB_H */ |
diff --git a/include/media/tuner.h b/include/media/tuner.h index 7674b121ce8b..27cbf08c931d 100644 --- a/include/media/tuner.h +++ b/include/media/tuner.h | |||
@@ -218,8 +218,8 @@ extern int tea5767_autodetection(struct i2c_client *c); | |||
218 | printk(KERN_INFO "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \ | 218 | printk(KERN_INFO "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \ |
219 | i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0) | 219 | i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0) |
220 | #define tuner_dbg(fmt, arg...) do {\ | 220 | #define tuner_dbg(fmt, arg...) do {\ |
221 | extern int debug; \ | 221 | extern int tuner_debug; \ |
222 | if (debug) \ | 222 | if (tuner_debug) \ |
223 | printk(KERN_DEBUG "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \ | 223 | printk(KERN_DEBUG "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \ |
224 | i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0) | 224 | i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0) |
225 | 225 | ||
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h index 3cc3132f391e..c74052abb189 100644 --- a/include/media/v4l2-common.h +++ b/include/media/v4l2-common.h | |||
@@ -49,9 +49,8 @@ | |||
49 | 49 | ||
50 | /* These three macros assume that the debug level is set with a module | 50 | /* These three macros assume that the debug level is set with a module |
51 | parameter called 'debug'. */ | 51 | parameter called 'debug'. */ |
52 | #define v4l_dbg(level, client, fmt, arg...) \ | 52 | #define v4l_dbg(level, debug, client, fmt, arg...) \ |
53 | do { \ | 53 | do { \ |
54 | extern int debug; \ | ||
55 | if (debug >= (level)) \ | 54 | if (debug >= (level)) \ |
56 | v4l_client_printk(KERN_DEBUG, client, fmt , ## arg); \ | 55 | v4l_client_printk(KERN_DEBUG, client, fmt , ## arg); \ |
57 | } while (0) | 56 | } while (0) |
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h index 50234fa56a68..fa587c94e9d0 100644 --- a/include/net/inet_connection_sock.h +++ b/include/net/inet_connection_sock.h | |||
@@ -83,8 +83,8 @@ struct inet_connection_sock { | |||
83 | struct timer_list icsk_delack_timer; | 83 | struct timer_list icsk_delack_timer; |
84 | __u32 icsk_rto; | 84 | __u32 icsk_rto; |
85 | __u32 icsk_pmtu_cookie; | 85 | __u32 icsk_pmtu_cookie; |
86 | struct tcp_congestion_ops *icsk_ca_ops; | 86 | const struct tcp_congestion_ops *icsk_ca_ops; |
87 | struct inet_connection_sock_af_ops *icsk_af_ops; | 87 | const struct inet_connection_sock_af_ops *icsk_af_ops; |
88 | unsigned int (*icsk_sync_mss)(struct sock *sk, u32 pmtu); | 88 | unsigned int (*icsk_sync_mss)(struct sock *sk, u32 pmtu); |
89 | __u8 icsk_ca_state; | 89 | __u8 icsk_ca_state; |
90 | __u8 icsk_retransmits; | 90 | __u8 icsk_retransmits; |
diff --git a/include/sound/core.h b/include/sound/core.h index 90ac6132ea3b..3093e3ddcf36 100644 --- a/include/sound/core.h +++ b/include/sound/core.h | |||
@@ -317,7 +317,7 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...) | |||
317 | #ifdef CONFIG_SND_VERBOSE_PRINTK | 317 | #ifdef CONFIG_SND_VERBOSE_PRINTK |
318 | /** | 318 | /** |
319 | * snd_printd - debug printk | 319 | * snd_printd - debug printk |
320 | * @format: format string | 320 | * @fmt: format string |
321 | * | 321 | * |
322 | * Compiled only when Works like snd_printk() for debugging purpose. | 322 | * Compiled only when Works like snd_printk() for debugging purpose. |
323 | * Ignored when CONFIG_SND_DEBUG is not set. | 323 | * Ignored when CONFIG_SND_DEBUG is not set. |
@@ -331,7 +331,6 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...) | |||
331 | /** | 331 | /** |
332 | * snd_assert - run-time assertion macro | 332 | * snd_assert - run-time assertion macro |
333 | * @expr: expression | 333 | * @expr: expression |
334 | * @args...: the action | ||
335 | * | 334 | * |
336 | * This macro checks the expression in run-time and invokes the commands | 335 | * This macro checks the expression in run-time and invokes the commands |
337 | * given in the rest arguments if the assertion is failed. | 336 | * given in the rest arguments if the assertion is failed. |
diff --git a/include/video/kyro.h b/include/video/kyro.h index 1bed37cfa68c..dba7de2ee4a8 100644 --- a/include/video/kyro.h +++ b/include/video/kyro.h | |||
@@ -15,6 +15,7 @@ | |||
15 | struct kyrofb_info { | 15 | struct kyrofb_info { |
16 | void __iomem *regbase; | 16 | void __iomem *regbase; |
17 | 17 | ||
18 | u32 palette[16]; | ||
18 | u32 HTot; /* Hor Total Time */ | 19 | u32 HTot; /* Hor Total Time */ |
19 | u32 HFP; /* Hor Front Porch */ | 20 | u32 HFP; /* Hor Front Porch */ |
20 | u32 HST; /* Hor Sync Time */ | 21 | u32 HST; /* Hor Sync Time */ |
diff --git a/include/video/neomagic.h b/include/video/neomagic.h index bdaee70868dd..1d69049bd4c1 100644 --- a/include/video/neomagic.h +++ b/include/video/neomagic.h | |||
@@ -196,6 +196,7 @@ struct neofb_par { | |||
196 | int internal_display; | 196 | int internal_display; |
197 | int external_display; | 197 | int external_display; |
198 | int libretto; | 198 | int libretto; |
199 | u32 palette[16]; | ||
199 | }; | 200 | }; |
200 | 201 | ||
201 | typedef struct { | 202 | typedef struct { |
diff --git a/include/video/newport.h b/include/video/newport.h index 812dac5b55f4..1f5ebeaa818f 100644 --- a/include/video/newport.h +++ b/include/video/newport.h | |||
@@ -382,7 +382,8 @@ typedef struct { | |||
382 | #define VC2_IREG_CONTROL 0x10 | 382 | #define VC2_IREG_CONTROL 0x10 |
383 | #define VC2_IREG_CONFIG 0x20 | 383 | #define VC2_IREG_CONFIG 0x20 |
384 | 384 | ||
385 | extern __inline__ void newport_vc2_set(struct newport_regs *regs, unsigned char vc2ireg, | 385 | static inline void newport_vc2_set(struct newport_regs *regs, |
386 | unsigned char vc2ireg, | ||
386 | unsigned short val) | 387 | unsigned short val) |
387 | { | 388 | { |
388 | regs->set.dcbmode = (NPORT_DMODE_AVC2 | VC2_REGADDR_INDEX | NPORT_DMODE_W3 | | 389 | regs->set.dcbmode = (NPORT_DMODE_AVC2 | VC2_REGADDR_INDEX | NPORT_DMODE_W3 | |
@@ -390,7 +391,7 @@ extern __inline__ void newport_vc2_set(struct newport_regs *regs, unsigned char | |||
390 | regs->set.dcbdata0.byword = (vc2ireg << 24) | (val << 8); | 391 | regs->set.dcbdata0.byword = (vc2ireg << 24) | (val << 8); |
391 | } | 392 | } |
392 | 393 | ||
393 | extern __inline__ unsigned short newport_vc2_get(struct newport_regs *regs, | 394 | static inline unsigned short newport_vc2_get(struct newport_regs *regs, |
394 | unsigned char vc2ireg) | 395 | unsigned char vc2ireg) |
395 | { | 396 | { |
396 | regs->set.dcbmode = (NPORT_DMODE_AVC2 | VC2_REGADDR_INDEX | NPORT_DMODE_W1 | | 397 | regs->set.dcbmode = (NPORT_DMODE_AVC2 | VC2_REGADDR_INDEX | NPORT_DMODE_W1 | |
diff --git a/include/video/sstfb.h b/include/video/sstfb.h index 0d77b5205372..3570f9c9b111 100644 --- a/include/video/sstfb.h +++ b/include/video/sstfb.h | |||
@@ -334,6 +334,7 @@ struct sst_spec { | |||
334 | }; | 334 | }; |
335 | 335 | ||
336 | struct sstfb_par { | 336 | struct sstfb_par { |
337 | u32 palette[16]; | ||
337 | unsigned int yDim; | 338 | unsigned int yDim; |
338 | unsigned int hSyncOn; /* hsync_len */ | 339 | unsigned int hSyncOn; /* hsync_len */ |
339 | unsigned int hSyncOff; /* left_margin + xres + right_margin */ | 340 | unsigned int hSyncOff; /* left_margin + xres + right_margin */ |
diff --git a/include/video/tdfx.h b/include/video/tdfx.h index 04237676b17c..c1cc94ba3fdd 100644 --- a/include/video/tdfx.h +++ b/include/video/tdfx.h | |||
@@ -140,52 +140,52 @@ | |||
140 | #ifdef __KERNEL__ | 140 | #ifdef __KERNEL__ |
141 | 141 | ||
142 | struct banshee_reg { | 142 | struct banshee_reg { |
143 | /* VGA rubbish */ | 143 | /* VGA rubbish */ |
144 | unsigned char att[21]; | 144 | unsigned char att[21]; |
145 | unsigned char crt[25]; | 145 | unsigned char crt[25]; |
146 | unsigned char gra[ 9]; | 146 | unsigned char gra[ 9]; |
147 | unsigned char misc[1]; | 147 | unsigned char misc[1]; |
148 | unsigned char seq[ 5]; | 148 | unsigned char seq[ 5]; |
149 | 149 | ||
150 | /* Banshee extensions */ | 150 | /* Banshee extensions */ |
151 | unsigned char ext[2]; | 151 | unsigned char ext[2]; |
152 | unsigned long vidcfg; | 152 | unsigned long vidcfg; |
153 | unsigned long vidpll; | 153 | unsigned long vidpll; |
154 | unsigned long mempll; | 154 | unsigned long mempll; |
155 | unsigned long gfxpll; | 155 | unsigned long gfxpll; |
156 | unsigned long dacmode; | 156 | unsigned long dacmode; |
157 | unsigned long vgainit0; | 157 | unsigned long vgainit0; |
158 | unsigned long vgainit1; | 158 | unsigned long vgainit1; |
159 | unsigned long screensize; | 159 | unsigned long screensize; |
160 | unsigned long stride; | 160 | unsigned long stride; |
161 | unsigned long cursloc; | 161 | unsigned long cursloc; |
162 | unsigned long curspataddr; | 162 | unsigned long curspataddr; |
163 | unsigned long cursc0; | 163 | unsigned long cursc0; |
164 | unsigned long cursc1; | 164 | unsigned long cursc1; |
165 | unsigned long startaddr; | 165 | unsigned long startaddr; |
166 | unsigned long clip0min; | 166 | unsigned long clip0min; |
167 | unsigned long clip0max; | 167 | unsigned long clip0max; |
168 | unsigned long clip1min; | 168 | unsigned long clip1min; |
169 | unsigned long clip1max; | 169 | unsigned long clip1max; |
170 | unsigned long srcbase; | 170 | unsigned long srcbase; |
171 | unsigned long dstbase; | 171 | unsigned long dstbase; |
172 | unsigned long miscinit0; | 172 | unsigned long miscinit0; |
173 | }; | 173 | }; |
174 | 174 | ||
175 | struct tdfx_par { | 175 | struct tdfx_par { |
176 | u32 max_pixclock; | 176 | u32 max_pixclock; |
177 | 177 | u32 palette[16]; | |
178 | void __iomem *regbase_virt; | 178 | void __iomem *regbase_virt; |
179 | unsigned long iobase; | 179 | unsigned long iobase; |
180 | u32 baseline; | 180 | u32 baseline; |
181 | 181 | ||
182 | struct { | 182 | struct { |
183 | int w,u,d; | 183 | int w,u,d; |
184 | unsigned long enable,disable; | 184 | unsigned long enable,disable; |
185 | struct timer_list timer; | 185 | struct timer_list timer; |
186 | } hwcursor; | 186 | } hwcursor; |
187 | 187 | ||
188 | spinlock_t DAClock; | 188 | spinlock_t DAClock; |
189 | }; | 189 | }; |
190 | 190 | ||
191 | #endif /* __KERNEL__ */ | 191 | #endif /* __KERNEL__ */ |