diff options
Diffstat (limited to 'include')
71 files changed, 767 insertions, 671 deletions
diff --git a/include/asm-arm/arch-at91/hardware.h b/include/asm-arm/arch-at91/hardware.h index eaaf1c12b753..28133e0154dd 100644 --- a/include/asm-arm/arch-at91/hardware.h +++ b/include/asm-arm/arch-at91/hardware.h | |||
@@ -31,7 +31,7 @@ | |||
31 | 31 | ||
32 | /* | 32 | /* |
33 | * Remap the peripherals from address 0xFFF78000 .. 0xFFFFFFFF | 33 | * Remap the peripherals from address 0xFFF78000 .. 0xFFFFFFFF |
34 | * to 0xFEF78000 .. 0xFF000000. (5444Kb) | 34 | * to 0xFEF78000 .. 0xFF000000. (544Kb) |
35 | */ | 35 | */ |
36 | #define AT91_IO_PHYS_BASE 0xFFF78000 | 36 | #define AT91_IO_PHYS_BASE 0xFFF78000 |
37 | #define AT91_IO_SIZE (0xFFFFFFFF - AT91_IO_PHYS_BASE + 1) | 37 | #define AT91_IO_SIZE (0xFFFFFFFF - AT91_IO_PHYS_BASE + 1) |
diff --git a/include/asm-arm/arch-at91rm9200/entry-macro.S b/include/asm-arm/arch-at91rm9200/entry-macro.S deleted file mode 100644 index 0e0aadf2a175..000000000000 --- a/include/asm-arm/arch-at91rm9200/entry-macro.S +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-at91rm9200/entry-macro.S | ||
3 | * | ||
4 | * Copyright (C) 2003-2005 SAN People | ||
5 | * | ||
6 | * Low-level IRQ helper macros for AT91RM9200 platforms | ||
7 | * | ||
8 | * This file is licensed under the terms of the GNU General Public | ||
9 | * License version 2. This program is licensed "as is" without any | ||
10 | * warranty of any kind, whether express or implied. | ||
11 | */ | ||
12 | |||
13 | #include <asm/hardware.h> | ||
14 | #include <asm/arch/at91_aic.h> | ||
15 | |||
16 | .macro disable_fiq | ||
17 | .endm | ||
18 | |||
19 | .macro get_irqnr_preamble, base, tmp | ||
20 | .endm | ||
21 | |||
22 | .macro arch_ret_to_user, tmp1, tmp2 | ||
23 | .endm | ||
24 | |||
25 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
26 | ldr \base, =(AT91_VA_BASE_SYS) @ base virtual address of SYS peripherals | ||
27 | ldr \irqnr, [\base, #AT91_AIC_IVR] @ read IRQ vector register: de-asserts nIRQ to processor (and clears interrupt) | ||
28 | ldr \irqstat, [\base, #AT91_AIC_ISR] @ read interrupt source number | ||
29 | teq \irqstat, #0 @ ISR is 0 when no current interrupt, or spurious interrupt | ||
30 | streq \tmp, [\base, #AT91_AIC_EOICR] @ not going to be handled further, then ACK it now. | ||
31 | .endm | ||
32 | |||
diff --git a/include/asm-arm/arch-ns9xxx/entry-macro.S b/include/asm-arm/arch-ns9xxx/entry-macro.S index 467a1986d259..86aec87303e4 100644 --- a/include/asm-arm/arch-ns9xxx/entry-macro.S +++ b/include/asm-arm/arch-ns9xxx/entry-macro.S | |||
@@ -11,6 +11,12 @@ | |||
11 | #include <asm/hardware.h> | 11 | #include <asm/hardware.h> |
12 | #include <asm/arch-ns9xxx/regs-sys.h> | 12 | #include <asm/arch-ns9xxx/regs-sys.h> |
13 | 13 | ||
14 | .macro get_irqnr_preamble, base, tmp | ||
15 | .endm | ||
16 | |||
17 | .macro arch_ret_to_user, tmp1, tmp2 | ||
18 | .endm | ||
19 | |||
14 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | 20 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
15 | ldr \base, =SYS_ISRADDR | 21 | ldr \base, =SYS_ISRADDR |
16 | ldr \irqstat, [\base, #(SYS_ISA - SYS_ISRADDR)] | 22 | ldr \irqstat, [\base, #(SYS_ISA - SYS_ISRADDR)] |
diff --git a/include/asm-i386/idle.h b/include/asm-i386/idle.h deleted file mode 100644 index 87ab93911199..000000000000 --- a/include/asm-i386/idle.h +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | #ifndef _ASM_I386_IDLE_H | ||
2 | #define _ASM_I386_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 exit_idle(void); | ||
12 | void enter_idle(void); | ||
13 | |||
14 | #endif | ||
diff --git a/include/asm-i386/msr.h b/include/asm-i386/msr.h index 6db40d0583f1..ec3b6803fd36 100644 --- a/include/asm-i386/msr.h +++ b/include/asm-i386/msr.h | |||
@@ -83,6 +83,20 @@ static inline void wrmsrl (unsigned long msr, unsigned long long val) | |||
83 | : "c" (counter)) | 83 | : "c" (counter)) |
84 | #endif /* !CONFIG_PARAVIRT */ | 84 | #endif /* !CONFIG_PARAVIRT */ |
85 | 85 | ||
86 | #ifdef CONFIG_SMP | ||
87 | void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h); | ||
88 | void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h); | ||
89 | #else /* CONFIG_SMP */ | ||
90 | static inline void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h) | ||
91 | { | ||
92 | rdmsr(msr_no, *l, *h); | ||
93 | } | ||
94 | static inline void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h) | ||
95 | { | ||
96 | wrmsr(msr_no, l, h); | ||
97 | } | ||
98 | #endif /* CONFIG_SMP */ | ||
99 | |||
86 | /* symbolic names for some interesting MSRs */ | 100 | /* symbolic names for some interesting MSRs */ |
87 | /* Intel defined MSRs. */ | 101 | /* Intel defined MSRs. */ |
88 | #define MSR_IA32_P5_MC_ADDR 0 | 102 | #define MSR_IA32_P5_MC_ADDR 0 |
diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h index edfbe46a5e13..11bf899de8aa 100644 --- a/include/asm-i386/processor.h +++ b/include/asm-i386/processor.h | |||
@@ -257,14 +257,6 @@ static inline void __mwait(unsigned long eax, unsigned long ecx) | |||
257 | : :"a" (eax), "c" (ecx)); | 257 | : :"a" (eax), "c" (ecx)); |
258 | } | 258 | } |
259 | 259 | ||
260 | static inline void __sti_mwait(unsigned long eax, unsigned long ecx) | ||
261 | { | ||
262 | /* "mwait %eax,%ecx;" */ | ||
263 | asm volatile( | ||
264 | "sti; .byte 0x0f,0x01,0xc9;" | ||
265 | : :"a" (eax), "c" (ecx)); | ||
266 | } | ||
267 | |||
268 | extern void mwait_idle_with_hints(unsigned long eax, unsigned long ecx); | 260 | extern void mwait_idle_with_hints(unsigned long eax, unsigned long ecx); |
269 | 261 | ||
270 | /* from system description table in BIOS. Mostly for MCA use, but | 262 | /* from system description table in BIOS. Mostly for MCA use, but |
diff --git a/include/asm-mips/ptrace.h b/include/asm-mips/ptrace.h index 8a1f2b6f04ac..1906938285c0 100644 --- a/include/asm-mips/ptrace.h +++ b/include/asm-mips/ptrace.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #define FPC_EIR 70 | 21 | #define FPC_EIR 70 |
22 | #define DSP_BASE 71 /* 3 more hi / lo register pairs */ | 22 | #define DSP_BASE 71 /* 3 more hi / lo register pairs */ |
23 | #define DSP_CONTROL 77 | 23 | #define DSP_CONTROL 77 |
24 | #define ACX 78 | ||
24 | 25 | ||
25 | /* | 26 | /* |
26 | * This struct defines the way the registers are stored on the stack during a | 27 | * This struct defines the way the registers are stored on the stack during a |
@@ -39,6 +40,9 @@ struct pt_regs { | |||
39 | unsigned long cp0_status; | 40 | unsigned long cp0_status; |
40 | unsigned long hi; | 41 | unsigned long hi; |
41 | unsigned long lo; | 42 | unsigned long lo; |
43 | #ifdef CONFIG_CPU_HAS_SMARTMIPS | ||
44 | unsigned long acx; | ||
45 | #endif | ||
42 | unsigned long cp0_badvaddr; | 46 | unsigned long cp0_badvaddr; |
43 | unsigned long cp0_cause; | 47 | unsigned long cp0_cause; |
44 | unsigned long cp0_epc; | 48 | unsigned long cp0_epc; |
diff --git a/include/asm-mips/sigcontext.h b/include/asm-mips/sigcontext.h index 972947474eb7..9ce0607d7a4e 100644 --- a/include/asm-mips/sigcontext.h +++ b/include/asm-mips/sigcontext.h | |||
@@ -23,7 +23,7 @@ struct sigcontext { | |||
23 | unsigned long long sc_pc; | 23 | unsigned long long sc_pc; |
24 | unsigned long long sc_regs[32]; | 24 | unsigned long long sc_regs[32]; |
25 | unsigned long long sc_fpregs[32]; | 25 | unsigned long long sc_fpregs[32]; |
26 | unsigned int sc_ownedfp; /* Unused */ | 26 | unsigned int sc_acx; /* Was sc_ownedfp */ |
27 | unsigned int sc_fpc_csr; | 27 | unsigned int sc_fpc_csr; |
28 | unsigned int sc_fpc_eir; /* Unused */ | 28 | unsigned int sc_fpc_eir; /* Unused */ |
29 | unsigned int sc_used_math; | 29 | unsigned int sc_used_math; |
@@ -79,7 +79,7 @@ struct sigcontext32 { | |||
79 | __u64 sc_pc; | 79 | __u64 sc_pc; |
80 | __u64 sc_regs[32]; | 80 | __u64 sc_regs[32]; |
81 | __u64 sc_fpregs[32]; | 81 | __u64 sc_fpregs[32]; |
82 | __u32 sc_ownedfp; /* Unused */ | 82 | __u32 sc_acx; /* Only MIPS32; was sc_ownedfp */ |
83 | __u32 sc_fpc_csr; | 83 | __u32 sc_fpc_csr; |
84 | __u32 sc_fpc_eir; /* Unused */ | 84 | __u32 sc_fpc_eir; /* Unused */ |
85 | __u32 sc_used_math; | 85 | __u32 sc_used_math; |
diff --git a/include/asm-mips/stackframe.h b/include/asm-mips/stackframe.h index 1fae5dc58138..7afa1fdf70ca 100644 --- a/include/asm-mips/stackframe.h +++ b/include/asm-mips/stackframe.h | |||
@@ -29,16 +29,25 @@ | |||
29 | .endm | 29 | .endm |
30 | 30 | ||
31 | .macro SAVE_TEMP | 31 | .macro SAVE_TEMP |
32 | #ifdef CONFIG_CPU_HAS_SMARTMIPS | ||
33 | mflhxu v1 | ||
34 | LONG_S v1, PT_LO(sp) | ||
35 | mflhxu v1 | ||
36 | LONG_S v1, PT_HI(sp) | ||
37 | mflhxu v1 | ||
38 | LONG_S v1, PT_ACX(sp) | ||
39 | #else | ||
32 | mfhi v1 | 40 | mfhi v1 |
41 | LONG_S v1, PT_HI(sp) | ||
42 | mflo v1 | ||
43 | LONG_S v1, PT_LO(sp) | ||
44 | #endif | ||
33 | #ifdef CONFIG_32BIT | 45 | #ifdef CONFIG_32BIT |
34 | LONG_S $8, PT_R8(sp) | 46 | LONG_S $8, PT_R8(sp) |
35 | LONG_S $9, PT_R9(sp) | 47 | LONG_S $9, PT_R9(sp) |
36 | #endif | 48 | #endif |
37 | LONG_S v1, PT_HI(sp) | ||
38 | mflo v1 | ||
39 | LONG_S $10, PT_R10(sp) | 49 | LONG_S $10, PT_R10(sp) |
40 | LONG_S $11, PT_R11(sp) | 50 | LONG_S $11, PT_R11(sp) |
41 | LONG_S v1, PT_LO(sp) | ||
42 | LONG_S $12, PT_R12(sp) | 51 | LONG_S $12, PT_R12(sp) |
43 | LONG_S $13, PT_R13(sp) | 52 | LONG_S $13, PT_R13(sp) |
44 | LONG_S $14, PT_R14(sp) | 53 | LONG_S $14, PT_R14(sp) |
@@ -182,16 +191,25 @@ | |||
182 | .endm | 191 | .endm |
183 | 192 | ||
184 | .macro RESTORE_TEMP | 193 | .macro RESTORE_TEMP |
194 | #ifdef CONFIG_CPU_HAS_SMARTMIPS | ||
195 | LONG_L $24, PT_ACX(sp) | ||
196 | mtlhx $24 | ||
197 | LONG_L $24, PT_HI(sp) | ||
198 | mtlhx $24 | ||
185 | LONG_L $24, PT_LO(sp) | 199 | LONG_L $24, PT_LO(sp) |
200 | mtlhx $24 | ||
201 | #else | ||
202 | LONG_L $24, PT_LO(sp) | ||
203 | mtlo $24 | ||
204 | LONG_L $24, PT_HI(sp) | ||
205 | mthi $24 | ||
206 | #endif | ||
186 | #ifdef CONFIG_32BIT | 207 | #ifdef CONFIG_32BIT |
187 | LONG_L $8, PT_R8(sp) | 208 | LONG_L $8, PT_R8(sp) |
188 | LONG_L $9, PT_R9(sp) | 209 | LONG_L $9, PT_R9(sp) |
189 | #endif | 210 | #endif |
190 | mtlo $24 | ||
191 | LONG_L $24, PT_HI(sp) | ||
192 | LONG_L $10, PT_R10(sp) | 211 | LONG_L $10, PT_R10(sp) |
193 | LONG_L $11, PT_R11(sp) | 212 | LONG_L $11, PT_R11(sp) |
194 | mthi $24 | ||
195 | LONG_L $12, PT_R12(sp) | 213 | LONG_L $12, PT_R12(sp) |
196 | LONG_L $13, PT_R13(sp) | 214 | LONG_L $13, PT_R13(sp) |
197 | LONG_L $14, PT_R14(sp) | 215 | LONG_L $14, PT_R14(sp) |
diff --git a/include/asm-parisc/assembly.h b/include/asm-parisc/assembly.h index 5a1e0e8b1c32..5587f0023881 100644 --- a/include/asm-parisc/assembly.h +++ b/include/asm-parisc/assembly.h | |||
@@ -31,9 +31,13 @@ | |||
31 | #define STREGM std,ma | 31 | #define STREGM std,ma |
32 | #define SHRREG shrd | 32 | #define SHRREG shrd |
33 | #define SHLREG shld | 33 | #define SHLREG shld |
34 | #define ADDIB addib,* | ||
35 | #define CMPB cmpb,* | ||
36 | #define ANDCM andcm,* | ||
34 | #define RP_OFFSET 16 | 37 | #define RP_OFFSET 16 |
35 | #define FRAME_SIZE 128 | 38 | #define FRAME_SIZE 128 |
36 | #define CALLEE_REG_FRAME_SIZE 144 | 39 | #define CALLEE_REG_FRAME_SIZE 144 |
40 | #define ASM_ULONG_INSN .dword | ||
37 | #else /* CONFIG_64BIT */ | 41 | #else /* CONFIG_64BIT */ |
38 | #define LDREG ldw | 42 | #define LDREG ldw |
39 | #define STREG stw | 43 | #define STREG stw |
@@ -42,9 +46,13 @@ | |||
42 | #define STREGM stwm | 46 | #define STREGM stwm |
43 | #define SHRREG shr | 47 | #define SHRREG shr |
44 | #define SHLREG shlw | 48 | #define SHLREG shlw |
49 | #define ADDIB addib, | ||
50 | #define CMPB cmpb, | ||
51 | #define ANDCM andcm | ||
45 | #define RP_OFFSET 20 | 52 | #define RP_OFFSET 20 |
46 | #define FRAME_SIZE 64 | 53 | #define FRAME_SIZE 64 |
47 | #define CALLEE_REG_FRAME_SIZE 128 | 54 | #define CALLEE_REG_FRAME_SIZE 128 |
55 | #define ASM_ULONG_INSN .word | ||
48 | #endif | 56 | #endif |
49 | 57 | ||
50 | #define CALLEE_SAVE_FRAME_SIZE (CALLEE_REG_FRAME_SIZE + CALLEE_FLOAT_FRAME_SIZE) | 58 | #define CALLEE_SAVE_FRAME_SIZE (CALLEE_REG_FRAME_SIZE + CALLEE_FLOAT_FRAME_SIZE) |
@@ -65,7 +73,7 @@ | |||
65 | 73 | ||
66 | #ifdef __ASSEMBLY__ | 74 | #ifdef __ASSEMBLY__ |
67 | 75 | ||
68 | #ifdef __LP64__ | 76 | #ifdef CONFIG_64BIT |
69 | /* the 64-bit pa gnu assembler unfortunately defaults to .level 1.1 or 2.0 so | 77 | /* the 64-bit pa gnu assembler unfortunately defaults to .level 1.1 or 2.0 so |
70 | * work around that for now... */ | 78 | * work around that for now... */ |
71 | .level 2.0w | 79 | .level 2.0w |
@@ -156,7 +164,7 @@ | |||
156 | .endm | 164 | .endm |
157 | 165 | ||
158 | .macro loadgp | 166 | .macro loadgp |
159 | #ifdef __LP64__ | 167 | #ifdef CONFIG_64BIT |
160 | ldil L%__gp, %r27 | 168 | ldil L%__gp, %r27 |
161 | ldo R%__gp(%r27), %r27 | 169 | ldo R%__gp(%r27), %r27 |
162 | #else | 170 | #else |
@@ -334,7 +342,7 @@ | |||
334 | fldd,mb -8(%r30), %fr12 | 342 | fldd,mb -8(%r30), %fr12 |
335 | .endm | 343 | .endm |
336 | 344 | ||
337 | #ifdef __LP64__ | 345 | #ifdef CONFIG_64BIT |
338 | .macro callee_save | 346 | .macro callee_save |
339 | std,ma %r3, CALLEE_REG_FRAME_SIZE(%r30) | 347 | std,ma %r3, CALLEE_REG_FRAME_SIZE(%r30) |
340 | mfctl %cr27, %r3 | 348 | mfctl %cr27, %r3 |
@@ -377,7 +385,7 @@ | |||
377 | ldd,mb -CALLEE_REG_FRAME_SIZE(%r30), %r3 | 385 | ldd,mb -CALLEE_REG_FRAME_SIZE(%r30), %r3 |
378 | .endm | 386 | .endm |
379 | 387 | ||
380 | #else /* ! __LP64__ */ | 388 | #else /* ! CONFIG_64BIT */ |
381 | 389 | ||
382 | .macro callee_save | 390 | .macro callee_save |
383 | stw,ma %r3, CALLEE_REG_FRAME_SIZE(%r30) | 391 | stw,ma %r3, CALLEE_REG_FRAME_SIZE(%r30) |
@@ -420,7 +428,7 @@ | |||
420 | mtctl %r3, %cr27 | 428 | mtctl %r3, %cr27 |
421 | ldw,mb -CALLEE_REG_FRAME_SIZE(%r30), %r3 | 429 | ldw,mb -CALLEE_REG_FRAME_SIZE(%r30), %r3 |
422 | .endm | 430 | .endm |
423 | #endif /* ! __LP64__ */ | 431 | #endif /* ! CONFIG_64BIT */ |
424 | 432 | ||
425 | .macro save_specials regs | 433 | .macro save_specials regs |
426 | 434 | ||
@@ -441,7 +449,7 @@ | |||
441 | mtctl %r0, %cr18 | 449 | mtctl %r0, %cr18 |
442 | SAVE_CR (%cr18, PT_IAOQ1(\regs)) | 450 | SAVE_CR (%cr18, PT_IAOQ1(\regs)) |
443 | 451 | ||
444 | #ifdef __LP64__ | 452 | #ifdef CONFIG_64BIT |
445 | /* cr11 (sar) is a funny one. 5 bits on PA1.1 and 6 bit on PA2.0 | 453 | /* cr11 (sar) is a funny one. 5 bits on PA1.1 and 6 bit on PA2.0 |
446 | * For PA2.0 mtsar or mtctl always write 6 bits, but mfctl only | 454 | * For PA2.0 mtsar or mtctl always write 6 bits, but mfctl only |
447 | * reads 5 bits. Use mfctl,w to read all six bits. Otherwise | 455 | * reads 5 bits. Use mfctl,w to read all six bits. Otherwise |
diff --git a/include/asm-parisc/atomic.h b/include/asm-parisc/atomic.h index 48bf9b8ab8ff..7d57d34fcca8 100644 --- a/include/asm-parisc/atomic.h +++ b/include/asm-parisc/atomic.h | |||
@@ -58,7 +58,7 @@ extern void __xchg_called_with_bad_pointer(void); | |||
58 | /* __xchg32/64 defined in arch/parisc/lib/bitops.c */ | 58 | /* __xchg32/64 defined in arch/parisc/lib/bitops.c */ |
59 | extern unsigned long __xchg8(char, char *); | 59 | extern unsigned long __xchg8(char, char *); |
60 | extern unsigned long __xchg32(int, int *); | 60 | extern unsigned long __xchg32(int, int *); |
61 | #ifdef __LP64__ | 61 | #ifdef CONFIG_64BIT |
62 | extern unsigned long __xchg64(unsigned long, unsigned long *); | 62 | extern unsigned long __xchg64(unsigned long, unsigned long *); |
63 | #endif | 63 | #endif |
64 | 64 | ||
@@ -67,7 +67,7 @@ static __inline__ unsigned long | |||
67 | __xchg(unsigned long x, __volatile__ void * ptr, int size) | 67 | __xchg(unsigned long x, __volatile__ void * ptr, int size) |
68 | { | 68 | { |
69 | switch(size) { | 69 | switch(size) { |
70 | #ifdef __LP64__ | 70 | #ifdef CONFIG_64BIT |
71 | case 8: return __xchg64(x,(unsigned long *) ptr); | 71 | case 8: return __xchg64(x,(unsigned long *) ptr); |
72 | #endif | 72 | #endif |
73 | case 4: return __xchg32((int) x, (int *) ptr); | 73 | case 4: return __xchg32((int) x, (int *) ptr); |
@@ -81,7 +81,7 @@ __xchg(unsigned long x, __volatile__ void * ptr, int size) | |||
81 | /* | 81 | /* |
82 | ** REVISIT - Abandoned use of LDCW in xchg() for now: | 82 | ** REVISIT - Abandoned use of LDCW in xchg() for now: |
83 | ** o need to test sizeof(*ptr) to avoid clearing adjacent bytes | 83 | ** o need to test sizeof(*ptr) to avoid clearing adjacent bytes |
84 | ** o and while we are at it, could __LP64__ code use LDCD too? | 84 | ** o and while we are at it, could CONFIG_64BIT code use LDCD too? |
85 | ** | 85 | ** |
86 | ** if (__builtin_constant_p(x) && (x == NULL)) | 86 | ** if (__builtin_constant_p(x) && (x == NULL)) |
87 | ** if (((unsigned long)p & 0xf) == 0) | 87 | ** if (((unsigned long)p & 0xf) == 0) |
@@ -105,7 +105,7 @@ static __inline__ unsigned long | |||
105 | __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new_, int size) | 105 | __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new_, int size) |
106 | { | 106 | { |
107 | switch(size) { | 107 | switch(size) { |
108 | #ifdef __LP64__ | 108 | #ifdef CONFIG_64BIT |
109 | case 8: return __cmpxchg_u64((unsigned long *)ptr, old, new_); | 109 | case 8: return __cmpxchg_u64((unsigned long *)ptr, old, new_); |
110 | #endif | 110 | #endif |
111 | case 4: return __cmpxchg_u32((unsigned int *)ptr, (unsigned int) old, (unsigned int) new_); | 111 | case 4: return __cmpxchg_u32((unsigned int *)ptr, (unsigned int) old, (unsigned int) new_); |
@@ -218,7 +218,7 @@ static __inline__ int atomic_read(const atomic_t *v) | |||
218 | #define smp_mb__before_atomic_inc() smp_mb() | 218 | #define smp_mb__before_atomic_inc() smp_mb() |
219 | #define smp_mb__after_atomic_inc() smp_mb() | 219 | #define smp_mb__after_atomic_inc() smp_mb() |
220 | 220 | ||
221 | #ifdef __LP64__ | 221 | #ifdef CONFIG_64BIT |
222 | 222 | ||
223 | typedef struct { volatile s64 counter; } atomic64_t; | 223 | typedef struct { volatile s64 counter; } atomic64_t; |
224 | 224 | ||
@@ -270,7 +270,7 @@ atomic64_read(const atomic64_t *v) | |||
270 | #define atomic64_dec_and_test(v) (atomic64_dec_return(v) == 0) | 270 | #define atomic64_dec_and_test(v) (atomic64_dec_return(v) == 0) |
271 | #define atomic64_sub_and_test(i,v) (atomic64_sub_return((i),(v)) == 0) | 271 | #define atomic64_sub_and_test(i,v) (atomic64_sub_return((i),(v)) == 0) |
272 | 272 | ||
273 | #endif /* __LP64__ */ | 273 | #endif /* CONFIG_64BIT */ |
274 | 274 | ||
275 | #include <asm-generic/atomic.h> | 275 | #include <asm-generic/atomic.h> |
276 | 276 | ||
diff --git a/include/asm-parisc/bitops.h b/include/asm-parisc/bitops.h index 900561922c4c..015cb0d379bd 100644 --- a/include/asm-parisc/bitops.h +++ b/include/asm-parisc/bitops.h | |||
@@ -60,31 +60,37 @@ static __inline__ void change_bit(int nr, volatile unsigned long * addr) | |||
60 | static __inline__ int test_and_set_bit(int nr, volatile unsigned long * addr) | 60 | static __inline__ int test_and_set_bit(int nr, volatile unsigned long * addr) |
61 | { | 61 | { |
62 | unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr); | 62 | unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr); |
63 | unsigned long oldbit; | 63 | unsigned long old; |
64 | unsigned long flags; | 64 | unsigned long flags; |
65 | int set; | ||
65 | 66 | ||
66 | addr += (nr >> SHIFT_PER_LONG); | 67 | addr += (nr >> SHIFT_PER_LONG); |
67 | _atomic_spin_lock_irqsave(addr, flags); | 68 | _atomic_spin_lock_irqsave(addr, flags); |
68 | oldbit = *addr; | 69 | old = *addr; |
69 | *addr = oldbit | mask; | 70 | set = (old & mask) ? 1 : 0; |
71 | if (!set) | ||
72 | *addr = old | mask; | ||
70 | _atomic_spin_unlock_irqrestore(addr, flags); | 73 | _atomic_spin_unlock_irqrestore(addr, flags); |
71 | 74 | ||
72 | return (oldbit & mask) ? 1 : 0; | 75 | return set; |
73 | } | 76 | } |
74 | 77 | ||
75 | static __inline__ int test_and_clear_bit(int nr, volatile unsigned long * addr) | 78 | static __inline__ int test_and_clear_bit(int nr, volatile unsigned long * addr) |
76 | { | 79 | { |
77 | unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr); | 80 | unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr); |
78 | unsigned long oldbit; | 81 | unsigned long old; |
79 | unsigned long flags; | 82 | unsigned long flags; |
83 | int set; | ||
80 | 84 | ||
81 | addr += (nr >> SHIFT_PER_LONG); | 85 | addr += (nr >> SHIFT_PER_LONG); |
82 | _atomic_spin_lock_irqsave(addr, flags); | 86 | _atomic_spin_lock_irqsave(addr, flags); |
83 | oldbit = *addr; | 87 | old = *addr; |
84 | *addr = oldbit & ~mask; | 88 | set = (old & mask) ? 1 : 0; |
89 | if (set) | ||
90 | *addr = old & ~mask; | ||
85 | _atomic_spin_unlock_irqrestore(addr, flags); | 91 | _atomic_spin_unlock_irqrestore(addr, flags); |
86 | 92 | ||
87 | return (oldbit & mask) ? 1 : 0; | 93 | return set; |
88 | } | 94 | } |
89 | 95 | ||
90 | static __inline__ int test_and_change_bit(int nr, volatile unsigned long * addr) | 96 | static __inline__ int test_and_change_bit(int nr, volatile unsigned long * addr) |
@@ -130,7 +136,7 @@ static __inline__ unsigned long __ffs(unsigned long x) | |||
130 | unsigned long ret; | 136 | unsigned long ret; |
131 | 137 | ||
132 | __asm__( | 138 | __asm__( |
133 | #ifdef __LP64__ | 139 | #ifdef CONFIG_64BIT |
134 | " ldi 63,%1\n" | 140 | " ldi 63,%1\n" |
135 | " extrd,u,*<> %0,63,32,%%r0\n" | 141 | " extrd,u,*<> %0,63,32,%%r0\n" |
136 | " extrd,u,*TR %0,31,32,%0\n" /* move top 32-bits down */ | 142 | " extrd,u,*TR %0,31,32,%0\n" /* move top 32-bits down */ |
diff --git a/include/asm-parisc/bug.h b/include/asm-parisc/bug.h index 695588da41f8..83ba510ed5d8 100644 --- a/include/asm-parisc/bug.h +++ b/include/asm-parisc/bug.h | |||
@@ -1,14 +1,92 @@ | |||
1 | #ifndef _PARISC_BUG_H | 1 | #ifndef _PARISC_BUG_H |
2 | #define _PARISC_BUG_H | 2 | #define _PARISC_BUG_H |
3 | 3 | ||
4 | /* | ||
5 | * Tell the user there is some problem. | ||
6 | * The offending file and line are encoded in the __bug_table section. | ||
7 | */ | ||
8 | |||
4 | #ifdef CONFIG_BUG | 9 | #ifdef CONFIG_BUG |
5 | #define HAVE_ARCH_BUG | 10 | #define HAVE_ARCH_BUG |
6 | #define BUG() do { \ | 11 | #define HAVE_ARCH_WARN_ON |
7 | printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ | 12 | |
8 | dump_stack(); \ | 13 | /* the break instruction is used as BUG() marker. */ |
9 | panic("BUG!"); \ | 14 | #define PARISC_BUG_BREAK_ASM "break 0x1f, 0x1fff" |
10 | } while (0) | 15 | #define PARISC_BUG_BREAK_INSN 0x03ffe01f /* PARISC_BUG_BREAK_ASM */ |
16 | |||
17 | #if defined(CONFIG_64BIT) | ||
18 | #define ASM_WORD_INSN ".dword\t" | ||
19 | #else | ||
20 | #define ASM_WORD_INSN ".word\t" | ||
21 | #endif | ||
22 | |||
23 | #ifdef CONFIG_DEBUG_BUGVERBOSE | ||
24 | #define BUG() \ | ||
25 | do { \ | ||
26 | asm volatile("\n" \ | ||
27 | "1:\t" PARISC_BUG_BREAK_ASM "\n" \ | ||
28 | "\t.pushsection __bug_table,\"a\"\n" \ | ||
29 | "2:\t" ASM_WORD_INSN "1b, %c0\n" \ | ||
30 | "\t.short %c1, %c2\n" \ | ||
31 | "\t.org 2b+%c3\n" \ | ||
32 | "\t.popsection" \ | ||
33 | : : "i" (__FILE__), "i" (__LINE__), \ | ||
34 | "i" (0), "i" (sizeof(struct bug_entry)) ); \ | ||
35 | for(;;) ; \ | ||
36 | } while(0) | ||
37 | |||
38 | #else | ||
39 | #define BUG() \ | ||
40 | do { \ | ||
41 | asm volatile(PARISC_BUG_BREAK_ASM : : ); \ | ||
42 | for(;;) ; \ | ||
43 | } while(0) | ||
44 | #endif | ||
45 | |||
46 | #ifdef CONFIG_DEBUG_BUGVERBOSE | ||
47 | #define __WARN() \ | ||
48 | do { \ | ||
49 | asm volatile("\n" \ | ||
50 | "1:\t" PARISC_BUG_BREAK_ASM "\n" \ | ||
51 | "\t.pushsection __bug_table,\"a\"\n" \ | ||
52 | "2:\t" ASM_WORD_INSN "1b, %c0\n" \ | ||
53 | "\t.short %c1, %c2\n" \ | ||
54 | "\t.org 2b+%c3\n" \ | ||
55 | "\t.popsection" \ | ||
56 | : : "i" (__FILE__), "i" (__LINE__), \ | ||
57 | "i" (BUGFLAG_WARNING), \ | ||
58 | "i" (sizeof(struct bug_entry)) ); \ | ||
59 | } while(0) | ||
60 | #else | ||
61 | #define __WARN() \ | ||
62 | do { \ | ||
63 | asm volatile("\n" \ | ||
64 | "1:\t" PARISC_BUG_BREAK_ASM "\n" \ | ||
65 | "\t.pushsection __bug_table,\"a\"\n" \ | ||
66 | "2:\t" ASM_WORD_INSN "1b\n" \ | ||
67 | "\t.short %c0\n" \ | ||
68 | "\t.org 2b+%c1\n" \ | ||
69 | "\t.popsection" \ | ||
70 | : : "i" (BUGFLAG_WARNING), \ | ||
71 | "i" (sizeof(struct bug_entry)) ); \ | ||
72 | } while(0) | ||
73 | #endif | ||
74 | |||
75 | |||
76 | #define WARN_ON(x) ({ \ | ||
77 | typeof(x) __ret_warn_on = (x); \ | ||
78 | if (__builtin_constant_p(__ret_warn_on)) { \ | ||
79 | if (__ret_warn_on) \ | ||
80 | __WARN(); \ | ||
81 | } else { \ | ||
82 | if (unlikely(__ret_warn_on)) \ | ||
83 | __WARN(); \ | ||
84 | } \ | ||
85 | unlikely(__ret_warn_on); \ | ||
86 | }) | ||
87 | |||
11 | #endif | 88 | #endif |
12 | 89 | ||
13 | #include <asm-generic/bug.h> | 90 | #include <asm-generic/bug.h> |
14 | #endif | 91 | #endif |
92 | |||
diff --git a/include/asm-parisc/cache.h b/include/asm-parisc/cache.h index 7d22fa206fc4..32c2cca74345 100644 --- a/include/asm-parisc/cache.h +++ b/include/asm-parisc/cache.h | |||
@@ -30,31 +30,11 @@ | |||
30 | 30 | ||
31 | #define __read_mostly __attribute__((__section__(".data.read_mostly"))) | 31 | #define __read_mostly __attribute__((__section__(".data.read_mostly"))) |
32 | 32 | ||
33 | extern void flush_data_cache_local(void *); /* flushes local data-cache only */ | 33 | void parisc_cache_init(void); /* initializes cache-flushing */ |
34 | extern void flush_instruction_cache_local(void *); /* flushes local code-cache only */ | 34 | void disable_sr_hashing_asm(int); /* low level support for above */ |
35 | #ifdef CONFIG_SMP | 35 | void disable_sr_hashing(void); /* turns off space register hashing */ |
36 | extern void flush_data_cache(void); /* flushes data-cache only (all processors) */ | 36 | void free_sid(unsigned long); |
37 | extern void flush_instruction_cache(void); /* flushes i-cache only (all processors) */ | ||
38 | #else | ||
39 | #define flush_data_cache() flush_data_cache_local(NULL) | ||
40 | #define flush_instruction_cache() flush_instruction_cache_local(NULL) | ||
41 | #endif | ||
42 | |||
43 | extern void parisc_cache_init(void); /* initializes cache-flushing */ | ||
44 | extern void flush_all_caches(void); /* flush everything (tlb & cache) */ | ||
45 | extern int get_cache_info(char *); | ||
46 | extern void flush_user_icache_range_asm(unsigned long, unsigned long); | ||
47 | extern void flush_kernel_icache_range_asm(unsigned long, unsigned long); | ||
48 | extern void flush_user_dcache_range_asm(unsigned long, unsigned long); | ||
49 | extern void flush_kernel_dcache_range_asm(unsigned long, unsigned long); | ||
50 | extern void flush_kernel_dcache_page_asm(void *); | ||
51 | extern void flush_kernel_icache_page(void *); | ||
52 | extern void disable_sr_hashing(void); /* turns off space register hashing */ | ||
53 | extern void disable_sr_hashing_asm(int); /* low level support for above */ | ||
54 | extern void free_sid(unsigned long); | ||
55 | unsigned long alloc_sid(void); | 37 | unsigned long alloc_sid(void); |
56 | extern void flush_user_dcache_page(unsigned long); | ||
57 | extern void flush_user_icache_page(unsigned long); | ||
58 | 38 | ||
59 | struct seq_file; | 39 | struct seq_file; |
60 | extern void show_cache_info(struct seq_file *m); | 40 | extern void show_cache_info(struct seq_file *m); |
@@ -63,6 +43,7 @@ extern int split_tlb; | |||
63 | extern int dcache_stride; | 43 | extern int dcache_stride; |
64 | extern int icache_stride; | 44 | extern int icache_stride; |
65 | extern struct pdc_cache_info cache_info; | 45 | extern struct pdc_cache_info cache_info; |
46 | void parisc_setup_cache_timing(void); | ||
66 | 47 | ||
67 | #define pdtlb(addr) asm volatile("pdtlb 0(%%sr1,%0)" : : "r" (addr)); | 48 | #define pdtlb(addr) asm volatile("pdtlb 0(%%sr1,%0)" : : "r" (addr)); |
68 | #define pitlb(addr) asm volatile("pitlb 0(%%sr1,%0)" : : "r" (addr)); | 49 | #define pitlb(addr) asm volatile("pitlb 0(%%sr1,%0)" : : "r" (addr)); |
diff --git a/include/asm-parisc/cacheflush.h b/include/asm-parisc/cacheflush.h index a799dd8ef395..2f1e1b05440a 100644 --- a/include/asm-parisc/cacheflush.h +++ b/include/asm-parisc/cacheflush.h | |||
@@ -2,60 +2,46 @@ | |||
2 | #define _PARISC_CACHEFLUSH_H | 2 | #define _PARISC_CACHEFLUSH_H |
3 | 3 | ||
4 | #include <linux/mm.h> | 4 | #include <linux/mm.h> |
5 | #include <asm/cache.h> /* for flush_user_dcache_range_asm() proto */ | ||
6 | 5 | ||
7 | /* The usual comment is "Caches aren't brain-dead on the <architecture>". | 6 | /* The usual comment is "Caches aren't brain-dead on the <architecture>". |
8 | * Unfortunately, that doesn't apply to PA-RISC. */ | 7 | * Unfortunately, that doesn't apply to PA-RISC. */ |
9 | 8 | ||
10 | /* Cache flush operations */ | 9 | /* Internal implementation */ |
11 | 10 | void flush_data_cache_local(void *); /* flushes local data-cache only */ | |
11 | void flush_instruction_cache_local(void *); /* flushes local code-cache only */ | ||
12 | #ifdef CONFIG_SMP | 12 | #ifdef CONFIG_SMP |
13 | #define flush_cache_mm(mm) flush_cache_all() | 13 | void flush_data_cache(void); /* flushes data-cache only (all processors) */ |
14 | void flush_instruction_cache(void); /* flushes i-cache only (all processors) */ | ||
14 | #else | 15 | #else |
15 | #define flush_cache_mm(mm) flush_cache_all_local() | 16 | #define flush_data_cache() flush_data_cache_local(NULL) |
17 | #define flush_instruction_cache() flush_instruction_cache_local(NULL) | ||
16 | #endif | 18 | #endif |
17 | 19 | ||
18 | #define flush_cache_dup_mm(mm) flush_cache_mm(mm) | 20 | #define flush_cache_dup_mm(mm) flush_cache_mm(mm) |
19 | 21 | ||
20 | #define flush_kernel_dcache_range(start,size) \ | 22 | void flush_user_icache_range_asm(unsigned long, unsigned long); |
21 | flush_kernel_dcache_range_asm((start), (start)+(size)); | 23 | void flush_kernel_icache_range_asm(unsigned long, unsigned long); |
24 | void flush_user_dcache_range_asm(unsigned long, unsigned long); | ||
25 | void flush_kernel_dcache_range_asm(unsigned long, unsigned long); | ||
26 | void flush_kernel_dcache_page_asm(void *); | ||
27 | void flush_kernel_icache_page(void *); | ||
28 | void flush_user_dcache_page(unsigned long); | ||
29 | void flush_user_icache_page(unsigned long); | ||
30 | void flush_user_dcache_range(unsigned long, unsigned long); | ||
31 | void flush_user_icache_range(unsigned long, unsigned long); | ||
22 | 32 | ||
23 | extern void flush_cache_all_local(void); | 33 | /* Cache flush operations */ |
24 | 34 | ||
25 | static inline void cacheflush_h_tmp_function(void *dummy) | 35 | void flush_cache_all_local(void); |
26 | { | 36 | void flush_cache_all(void); |
27 | flush_cache_all_local(); | 37 | void flush_cache_mm(struct mm_struct *mm); |
28 | } | ||
29 | 38 | ||
30 | static inline void flush_cache_all(void) | 39 | #define flush_kernel_dcache_range(start,size) \ |
31 | { | 40 | flush_kernel_dcache_range_asm((start), (start)+(size)); |
32 | on_each_cpu(cacheflush_h_tmp_function, NULL, 1, 1); | ||
33 | } | ||
34 | 41 | ||
35 | #define flush_cache_vmap(start, end) flush_cache_all() | 42 | #define flush_cache_vmap(start, end) flush_cache_all() |
36 | #define flush_cache_vunmap(start, end) flush_cache_all() | 43 | #define flush_cache_vunmap(start, end) flush_cache_all() |
37 | 44 | ||
38 | extern int parisc_cache_flush_threshold; | ||
39 | void parisc_setup_cache_timing(void); | ||
40 | |||
41 | static inline void | ||
42 | flush_user_dcache_range(unsigned long start, unsigned long end) | ||
43 | { | ||
44 | if ((end - start) < parisc_cache_flush_threshold) | ||
45 | flush_user_dcache_range_asm(start,end); | ||
46 | else | ||
47 | flush_data_cache(); | ||
48 | } | ||
49 | |||
50 | static inline void | ||
51 | flush_user_icache_range(unsigned long start, unsigned long end) | ||
52 | { | ||
53 | if ((end - start) < parisc_cache_flush_threshold) | ||
54 | flush_user_icache_range_asm(start,end); | ||
55 | else | ||
56 | flush_instruction_cache(); | ||
57 | } | ||
58 | |||
59 | extern void flush_dcache_page(struct page *page); | 45 | extern void flush_dcache_page(struct page *page); |
60 | 46 | ||
61 | #define flush_dcache_mmap_lock(mapping) \ | 47 | #define flush_dcache_mmap_lock(mapping) \ |
@@ -63,9 +49,15 @@ extern void flush_dcache_page(struct page *page); | |||
63 | #define flush_dcache_mmap_unlock(mapping) \ | 49 | #define flush_dcache_mmap_unlock(mapping) \ |
64 | write_unlock_irq(&(mapping)->tree_lock) | 50 | write_unlock_irq(&(mapping)->tree_lock) |
65 | 51 | ||
66 | #define flush_icache_page(vma,page) do { flush_kernel_dcache_page(page); flush_kernel_icache_page(page_address(page)); } while (0) | 52 | #define flush_icache_page(vma,page) do { \ |
53 | flush_kernel_dcache_page(page); \ | ||
54 | flush_kernel_icache_page(page_address(page)); \ | ||
55 | } while (0) | ||
67 | 56 | ||
68 | #define flush_icache_range(s,e) do { flush_kernel_dcache_range_asm(s,e); flush_kernel_icache_range_asm(s,e); } while (0) | 57 | #define flush_icache_range(s,e) do { \ |
58 | flush_kernel_dcache_range_asm(s,e); \ | ||
59 | flush_kernel_icache_range_asm(s,e); \ | ||
60 | } while (0) | ||
69 | 61 | ||
70 | #define copy_to_user_page(vma, page, vaddr, dst, src, len) \ | 62 | #define copy_to_user_page(vma, page, vaddr, dst, src, len) \ |
71 | do { \ | 63 | do { \ |
@@ -80,118 +72,17 @@ do { \ | |||
80 | memcpy(dst, src, len); \ | 72 | memcpy(dst, src, len); \ |
81 | } while (0) | 73 | } while (0) |
82 | 74 | ||
83 | static inline void flush_cache_range(struct vm_area_struct *vma, | 75 | void flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr, unsigned long pfn); |
84 | unsigned long start, unsigned long end) | 76 | void flush_cache_range(struct vm_area_struct *vma, |
85 | { | 77 | unsigned long start, unsigned long end); |
86 | int sr3; | ||
87 | |||
88 | if (!vma->vm_mm->context) { | ||
89 | BUG(); | ||
90 | return; | ||
91 | } | ||
92 | |||
93 | sr3 = mfsp(3); | ||
94 | if (vma->vm_mm->context == sr3) { | ||
95 | flush_user_dcache_range(start,end); | ||
96 | flush_user_icache_range(start,end); | ||
97 | } else { | ||
98 | flush_cache_all(); | ||
99 | } | ||
100 | } | ||
101 | |||
102 | /* Simple function to work out if we have an existing address translation | ||
103 | * for a user space vma. */ | ||
104 | static inline int translation_exists(struct vm_area_struct *vma, | ||
105 | unsigned long addr, unsigned long pfn) | ||
106 | { | ||
107 | pgd_t *pgd = pgd_offset(vma->vm_mm, addr); | ||
108 | pmd_t *pmd; | ||
109 | pte_t pte; | ||
110 | |||
111 | if(pgd_none(*pgd)) | ||
112 | return 0; | ||
113 | |||
114 | pmd = pmd_offset(pgd, addr); | ||
115 | if(pmd_none(*pmd) || pmd_bad(*pmd)) | ||
116 | return 0; | ||
117 | |||
118 | /* We cannot take the pte lock here: flush_cache_page is usually | ||
119 | * called with pte lock already held. Whereas flush_dcache_page | ||
120 | * takes flush_dcache_mmap_lock, which is lower in the hierarchy: | ||
121 | * the vma itself is secure, but the pte might come or go racily. | ||
122 | */ | ||
123 | pte = *pte_offset_map(pmd, addr); | ||
124 | /* But pte_unmap() does nothing on this architecture */ | ||
125 | |||
126 | /* Filter out coincidental file entries and swap entries */ | ||
127 | if (!(pte_val(pte) & (_PAGE_FLUSH|_PAGE_PRESENT))) | ||
128 | return 0; | ||
129 | |||
130 | return pte_pfn(pte) == pfn; | ||
131 | } | ||
132 | |||
133 | /* Private function to flush a page from the cache of a non-current | ||
134 | * process. cr25 contains the Page Directory of the current user | ||
135 | * process; we're going to hijack both it and the user space %sr3 to | ||
136 | * temporarily make the non-current process current. We have to do | ||
137 | * this because cache flushing may cause a non-access tlb miss which | ||
138 | * the handlers have to fill in from the pgd of the non-current | ||
139 | * process. */ | ||
140 | static inline void | ||
141 | flush_user_cache_page_non_current(struct vm_area_struct *vma, | ||
142 | unsigned long vmaddr) | ||
143 | { | ||
144 | /* save the current process space and pgd */ | ||
145 | unsigned long space = mfsp(3), pgd = mfctl(25); | ||
146 | |||
147 | /* we don't mind taking interrups since they may not | ||
148 | * do anything with user space, but we can't | ||
149 | * be preempted here */ | ||
150 | preempt_disable(); | ||
151 | |||
152 | /* make us current */ | ||
153 | mtctl(__pa(vma->vm_mm->pgd), 25); | ||
154 | mtsp(vma->vm_mm->context, 3); | ||
155 | |||
156 | flush_user_dcache_page(vmaddr); | ||
157 | if(vma->vm_flags & VM_EXEC) | ||
158 | flush_user_icache_page(vmaddr); | ||
159 | |||
160 | /* put the old current process back */ | ||
161 | mtsp(space, 3); | ||
162 | mtctl(pgd, 25); | ||
163 | preempt_enable(); | ||
164 | } | ||
165 | |||
166 | static inline void | ||
167 | __flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr) | ||
168 | { | ||
169 | if (likely(vma->vm_mm->context == mfsp(3))) { | ||
170 | flush_user_dcache_page(vmaddr); | ||
171 | if (vma->vm_flags & VM_EXEC) | ||
172 | flush_user_icache_page(vmaddr); | ||
173 | } else { | ||
174 | flush_user_cache_page_non_current(vma, vmaddr); | ||
175 | } | ||
176 | } | ||
177 | |||
178 | static inline void | ||
179 | flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr, unsigned long pfn) | ||
180 | { | ||
181 | BUG_ON(!vma->vm_mm->context); | ||
182 | |||
183 | if (likely(translation_exists(vma, vmaddr, pfn))) | ||
184 | __flush_cache_page(vma, vmaddr); | ||
185 | |||
186 | } | ||
187 | 78 | ||
79 | #define ARCH_HAS_FLUSH_ANON_PAGE | ||
188 | static inline void | 80 | static inline void |
189 | flush_anon_page(struct vm_area_struct *vma, struct page *page, unsigned long vmaddr) | 81 | flush_anon_page(struct vm_area_struct *vma, struct page *page, unsigned long vmaddr) |
190 | { | 82 | { |
191 | if (PageAnon(page)) | 83 | if (PageAnon(page)) |
192 | flush_user_dcache_page(vmaddr); | 84 | flush_user_dcache_page(vmaddr); |
193 | } | 85 | } |
194 | #define ARCH_HAS_FLUSH_ANON_PAGE | ||
195 | 86 | ||
196 | #define ARCH_HAS_FLUSH_KERNEL_DCACHE_PAGE | 87 | #define ARCH_HAS_FLUSH_KERNEL_DCACHE_PAGE |
197 | void flush_kernel_dcache_page_addr(void *addr); | 88 | void flush_kernel_dcache_page_addr(void *addr); |
diff --git a/include/asm-parisc/dma-mapping.h b/include/asm-parisc/dma-mapping.h index 66f0b408c669..c6c0e9ff6bde 100644 --- a/include/asm-parisc/dma-mapping.h +++ b/include/asm-parisc/dma-mapping.h | |||
@@ -236,7 +236,7 @@ int ccio_allocate_resource(const struct parisc_device *dev, | |||
236 | unsigned long min, unsigned long max, unsigned long align); | 236 | unsigned long min, unsigned long max, unsigned long align); |
237 | #else /* !CONFIG_IOMMU_CCIO */ | 237 | #else /* !CONFIG_IOMMU_CCIO */ |
238 | #define ccio_get_iommu(dev) NULL | 238 | #define ccio_get_iommu(dev) NULL |
239 | #define ccio_request_resource(dev, res) request_resource(&iomem_resource, res) | 239 | #define ccio_request_resource(dev, res) insert_resource(&iomem_resource, res) |
240 | #define ccio_allocate_resource(dev, res, size, min, max, align) \ | 240 | #define ccio_allocate_resource(dev, res, size, min, max, align) \ |
241 | allocate_resource(&iomem_resource, res, size, min, max, \ | 241 | allocate_resource(&iomem_resource, res, size, min, max, \ |
242 | align, NULL, NULL) | 242 | align, NULL, NULL) |
diff --git a/include/asm-parisc/elf.h b/include/asm-parisc/elf.h index adea65fc43c9..f628ac7de83d 100644 --- a/include/asm-parisc/elf.h +++ b/include/asm-parisc/elf.h | |||
@@ -220,7 +220,7 @@ typedef struct elf64_fdesc { | |||
220 | * macros, and then it includes fs/binfmt_elf.c to provide an alternate | 220 | * macros, and then it includes fs/binfmt_elf.c to provide an alternate |
221 | * elf binary handler for 32 bit binaries (on the 64 bit kernel). | 221 | * elf binary handler for 32 bit binaries (on the 64 bit kernel). |
222 | */ | 222 | */ |
223 | #ifdef __LP64__ | 223 | #ifdef CONFIG_64BIT |
224 | #define ELF_CLASS ELFCLASS64 | 224 | #define ELF_CLASS ELFCLASS64 |
225 | #else | 225 | #else |
226 | #define ELF_CLASS ELFCLASS32 | 226 | #define ELF_CLASS ELFCLASS32 |
diff --git a/include/asm-parisc/hardware.h b/include/asm-parisc/hardware.h index 106d3f7cd882..76d880dc4bae 100644 --- a/include/asm-parisc/hardware.h +++ b/include/asm-parisc/hardware.h | |||
@@ -1,19 +1,13 @@ | |||
1 | #ifndef _PARISC_HARDWARE_H | 1 | #ifndef _PARISC_HARDWARE_H |
2 | #define _PARISC_HARDWARE_H | 2 | #define _PARISC_HARDWARE_H |
3 | 3 | ||
4 | #include <linux/mod_devicetable.h> | ||
4 | #include <asm/pdc.h> | 5 | #include <asm/pdc.h> |
5 | 6 | ||
6 | struct parisc_device_id { | 7 | #define HWTYPE_ANY_ID PA_HWTYPE_ANY_ID |
7 | unsigned char hw_type; /* 5 bits used */ | 8 | #define HVERSION_ANY_ID PA_HVERSION_ANY_ID |
8 | unsigned char hversion_rev; /* 4 bits */ | 9 | #define HVERSION_REV_ANY_ID PA_HVERSION_REV_ANY_ID |
9 | unsigned short hversion; /* 12 bits */ | 10 | #define SVERSION_ANY_ID PA_SVERSION_ANY_ID |
10 | unsigned int sversion; /* 20 bits */ | ||
11 | }; | ||
12 | |||
13 | #define HWTYPE_ANY_ID 0xff | ||
14 | #define HVERSION_REV_ANY_ID 0xff | ||
15 | #define HVERSION_ANY_ID 0xffff | ||
16 | #define SVERSION_ANY_ID 0xffffffffU | ||
17 | 11 | ||
18 | struct hp_hardware { | 12 | struct hp_hardware { |
19 | unsigned short hw_type:5; /* HPHW_xxx */ | 13 | unsigned short hw_type:5; /* HPHW_xxx */ |
diff --git a/include/asm-parisc/io.h b/include/asm-parisc/io.h index ca46e7cc0940..c0fed91da3a2 100644 --- a/include/asm-parisc/io.h +++ b/include/asm-parisc/io.h | |||
@@ -67,7 +67,7 @@ static inline unsigned long long gsc_readq(unsigned long addr) | |||
67 | { | 67 | { |
68 | unsigned long long ret; | 68 | unsigned long long ret; |
69 | 69 | ||
70 | #ifdef __LP64__ | 70 | #ifdef CONFIG_64BIT |
71 | __asm__ __volatile__( | 71 | __asm__ __volatile__( |
72 | " ldda 0(%1),%0\n" | 72 | " ldda 0(%1),%0\n" |
73 | : "=r" (ret) : "r" (addr) ); | 73 | : "=r" (ret) : "r" (addr) ); |
@@ -108,7 +108,7 @@ static inline void gsc_writel(unsigned int val, unsigned long addr) | |||
108 | 108 | ||
109 | static inline void gsc_writeq(unsigned long long val, unsigned long addr) | 109 | static inline void gsc_writeq(unsigned long long val, unsigned long addr) |
110 | { | 110 | { |
111 | #ifdef __LP64__ | 111 | #ifdef CONFIG_64BIT |
112 | __asm__ __volatile__( | 112 | __asm__ __volatile__( |
113 | " stda %0,0(%1)\n" | 113 | " stda %0,0(%1)\n" |
114 | : : "r" (val), "r" (addr) ); | 114 | : : "r" (val), "r" (addr) ); |
diff --git a/include/asm-parisc/led.h b/include/asm-parisc/led.h index efadfd543ec6..c3405ab9d60a 100644 --- a/include/asm-parisc/led.h +++ b/include/asm-parisc/led.h | |||
@@ -31,7 +31,7 @@ void __init register_led_regions(void); | |||
31 | 31 | ||
32 | #ifdef CONFIG_CHASSIS_LCD_LED | 32 | #ifdef CONFIG_CHASSIS_LCD_LED |
33 | /* writes a string to the LCD display (if possible on this h/w) */ | 33 | /* writes a string to the LCD display (if possible on this h/w) */ |
34 | int lcd_print(char *str); | 34 | int lcd_print(const char *str); |
35 | #else | 35 | #else |
36 | #define lcd_print(str) | 36 | #define lcd_print(str) |
37 | #endif | 37 | #endif |
diff --git a/include/asm-parisc/linkage.h b/include/asm-parisc/linkage.h index 291c2d01c44f..7a09d911b538 100644 --- a/include/asm-parisc/linkage.h +++ b/include/asm-parisc/linkage.h | |||
@@ -1,6 +1,28 @@ | |||
1 | #ifndef __ASM_LINKAGE_H | 1 | #ifndef __ASM_PARISC_LINKAGE_H |
2 | #define __ASM_LINKAGE_H | 2 | #define __ASM_PARISC_LINKAGE_H |
3 | 3 | ||
4 | /* Nothing to see here... */ | 4 | #ifndef __ALIGN |
5 | #define __ALIGN .align 4 | ||
6 | #define __ALIGN_STR ".align 4" | ||
7 | #endif | ||
8 | |||
9 | /* | ||
10 | * In parisc assembly a semicolon marks a comment while a | ||
11 | * exclamation mark is used to seperate independend lines. | ||
12 | */ | ||
13 | #define ENTRY(name) \ | ||
14 | .export name !\ | ||
15 | ALIGN !\ | ||
16 | name: | ||
5 | 17 | ||
18 | #ifdef CONFIG_64BIT | ||
19 | #define ENDPROC(name) \ | ||
20 | END(name) | ||
21 | #else | ||
22 | #define ENDPROC(name) \ | ||
23 | .type name, @function !\ | ||
24 | END(name) | ||
6 | #endif | 25 | #endif |
26 | |||
27 | |||
28 | #endif /* __ASM_PARISC_LINKAGE_H */ | ||
diff --git a/include/asm-parisc/mmzone.h b/include/asm-parisc/mmzone.h index c87813662d4d..9608d2cf214a 100644 --- a/include/asm-parisc/mmzone.h +++ b/include/asm-parisc/mmzone.h | |||
@@ -35,7 +35,7 @@ extern struct node_map_data node_data[]; | |||
35 | #define PFNNID_MAP_MAX 512 /* support 512GB */ | 35 | #define PFNNID_MAP_MAX 512 /* support 512GB */ |
36 | extern unsigned char pfnnid_map[PFNNID_MAP_MAX]; | 36 | extern unsigned char pfnnid_map[PFNNID_MAP_MAX]; |
37 | 37 | ||
38 | #ifndef __LP64__ | 38 | #ifndef CONFIG_64BIT |
39 | #define pfn_is_io(pfn) ((pfn & (0xf0000000UL >> PAGE_SHIFT)) == (0xf0000000UL >> PAGE_SHIFT)) | 39 | #define pfn_is_io(pfn) ((pfn & (0xf0000000UL >> PAGE_SHIFT)) == (0xf0000000UL >> PAGE_SHIFT)) |
40 | #else | 40 | #else |
41 | /* io can be 0xf0f0f0f0f0xxxxxx or 0xfffffffff0000000 */ | 41 | /* io can be 0xf0f0f0f0f0xxxxxx or 0xfffffffff0000000 */ |
diff --git a/include/asm-parisc/module.h b/include/asm-parisc/module.h index 00f06885f843..c2cb49e934c1 100644 --- a/include/asm-parisc/module.h +++ b/include/asm-parisc/module.h | |||
@@ -3,7 +3,7 @@ | |||
3 | /* | 3 | /* |
4 | * This file contains the parisc architecture specific module code. | 4 | * This file contains the parisc architecture specific module code. |
5 | */ | 5 | */ |
6 | #ifdef __LP64__ | 6 | #ifdef CONFIG_64BIT |
7 | #define Elf_Shdr Elf64_Shdr | 7 | #define Elf_Shdr Elf64_Shdr |
8 | #define Elf_Sym Elf64_Sym | 8 | #define Elf_Sym Elf64_Sym |
9 | #define Elf_Ehdr Elf64_Ehdr | 9 | #define Elf_Ehdr Elf64_Ehdr |
diff --git a/include/asm-parisc/msgbuf.h b/include/asm-parisc/msgbuf.h index 14ffc2782f1e..fe88f2649418 100644 --- a/include/asm-parisc/msgbuf.h +++ b/include/asm-parisc/msgbuf.h | |||
@@ -13,15 +13,15 @@ | |||
13 | 13 | ||
14 | struct msqid64_ds { | 14 | struct msqid64_ds { |
15 | struct ipc64_perm msg_perm; | 15 | struct ipc64_perm msg_perm; |
16 | #ifndef __LP64__ | 16 | #ifndef CONFIG_64BIT |
17 | unsigned int __pad1; | 17 | unsigned int __pad1; |
18 | #endif | 18 | #endif |
19 | __kernel_time_t msg_stime; /* last msgsnd time */ | 19 | __kernel_time_t msg_stime; /* last msgsnd time */ |
20 | #ifndef __LP64__ | 20 | #ifndef CONFIG_64BIT |
21 | unsigned int __pad2; | 21 | unsigned int __pad2; |
22 | #endif | 22 | #endif |
23 | __kernel_time_t msg_rtime; /* last msgrcv time */ | 23 | __kernel_time_t msg_rtime; /* last msgrcv time */ |
24 | #ifndef __LP64__ | 24 | #ifndef CONFIG_64BIT |
25 | unsigned int __pad3; | 25 | unsigned int __pad3; |
26 | #endif | 26 | #endif |
27 | __kernel_time_t msg_ctime; /* last change time */ | 27 | __kernel_time_t msg_ctime; /* last change time */ |
diff --git a/include/asm-parisc/page.h b/include/asm-parisc/page.h index 3567208191e3..f6bba4c13664 100644 --- a/include/asm-parisc/page.h +++ b/include/asm-parisc/page.h | |||
@@ -105,7 +105,7 @@ extern int npmem_ranges; | |||
105 | /* WARNING: The definitions below must match exactly to sizeof(pte_t) | 105 | /* WARNING: The definitions below must match exactly to sizeof(pte_t) |
106 | * etc | 106 | * etc |
107 | */ | 107 | */ |
108 | #ifdef __LP64__ | 108 | #ifdef CONFIG_64BIT |
109 | #define BITS_PER_PTE_ENTRY 3 | 109 | #define BITS_PER_PTE_ENTRY 3 |
110 | #define BITS_PER_PMD_ENTRY 2 | 110 | #define BITS_PER_PMD_ENTRY 2 |
111 | #define BITS_PER_PGD_ENTRY 2 | 111 | #define BITS_PER_PGD_ENTRY 2 |
@@ -127,7 +127,11 @@ extern int npmem_ranges; | |||
127 | /* This governs the relationship between virtual and physical addresses. | 127 | /* This governs the relationship between virtual and physical addresses. |
128 | * If you alter it, make sure to take care of our various fixed mapping | 128 | * If you alter it, make sure to take care of our various fixed mapping |
129 | * segments in fixmap.h */ | 129 | * segments in fixmap.h */ |
130 | #define __PAGE_OFFSET (0x10000000) | 130 | #ifdef CONFIG_64BIT |
131 | #define __PAGE_OFFSET (0x40000000) /* 1GB */ | ||
132 | #else | ||
133 | #define __PAGE_OFFSET (0x10000000) /* 256MB */ | ||
134 | #endif | ||
131 | 135 | ||
132 | #define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET) | 136 | #define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET) |
133 | 137 | ||
diff --git a/include/asm-parisc/parisc-device.h b/include/asm-parisc/parisc-device.h index e12624d8941d..7aa13f2add7a 100644 --- a/include/asm-parisc/parisc-device.h +++ b/include/asm-parisc/parisc-device.h | |||
@@ -15,7 +15,7 @@ struct parisc_device { | |||
15 | unsigned int num_addrs; /* some devices have additional address ranges. */ | 15 | unsigned int num_addrs; /* some devices have additional address ranges. */ |
16 | unsigned long *addr; /* which will be stored here */ | 16 | unsigned long *addr; /* which will be stored here */ |
17 | 17 | ||
18 | #ifdef __LP64__ | 18 | #ifdef CONFIG_64BIT |
19 | /* parms for pdc_pat_cell_module() call */ | 19 | /* parms for pdc_pat_cell_module() call */ |
20 | unsigned long pcell_loc; /* Physical Cell location */ | 20 | unsigned long pcell_loc; /* Physical Cell location */ |
21 | unsigned long mod_index; /* PAT specific - Misc Module info */ | 21 | unsigned long mod_index; /* PAT specific - Misc Module info */ |
diff --git a/include/asm-parisc/pdc.h b/include/asm-parisc/pdc.h index 423c2b84b4a0..876fd8116d4a 100644 --- a/include/asm-parisc/pdc.h +++ b/include/asm-parisc/pdc.h | |||
@@ -341,7 +341,7 @@ struct pdc_model { /* for PDC_MODEL */ | |||
341 | 341 | ||
342 | struct pdc_cache_cf { /* for PDC_CACHE (I/D-caches) */ | 342 | struct pdc_cache_cf { /* for PDC_CACHE (I/D-caches) */ |
343 | unsigned long | 343 | unsigned long |
344 | #ifdef __LP64__ | 344 | #ifdef CONFIG_64BIT |
345 | cc_padW:32, | 345 | cc_padW:32, |
346 | #endif | 346 | #endif |
347 | cc_alias: 4, /* alias boundaries for virtual addresses */ | 347 | cc_alias: 4, /* alias boundaries for virtual addresses */ |
@@ -357,7 +357,7 @@ struct pdc_cache_cf { /* for PDC_CACHE (I/D-caches) */ | |||
357 | 357 | ||
358 | struct pdc_tlb_cf { /* for PDC_CACHE (I/D-TLB's) */ | 358 | struct pdc_tlb_cf { /* for PDC_CACHE (I/D-TLB's) */ |
359 | unsigned long tc_pad0:12, /* reserved */ | 359 | unsigned long tc_pad0:12, /* reserved */ |
360 | #ifdef __LP64__ | 360 | #ifdef CONFIG_64BIT |
361 | tc_padW:32, | 361 | tc_padW:32, |
362 | #endif | 362 | #endif |
363 | tc_sh : 2, /* 0 = separate I/D-TLB, else shared I/D-TLB */ | 363 | tc_sh : 2, /* 0 = separate I/D-TLB, else shared I/D-TLB */ |
@@ -445,7 +445,7 @@ struct pdc_btlb_info { /* PDC_BLOCK_TLB, return of PDC_BTLB_INFO */ | |||
445 | 445 | ||
446 | #endif /* !CONFIG_PA20 */ | 446 | #endif /* !CONFIG_PA20 */ |
447 | 447 | ||
448 | #ifdef __LP64__ | 448 | #ifdef CONFIG_64BIT |
449 | struct pdc_memory_table_raddr { /* PDC_MEM/PDC_MEM_TABLE (return info) */ | 449 | struct pdc_memory_table_raddr { /* PDC_MEM/PDC_MEM_TABLE (return info) */ |
450 | unsigned long entries_returned; | 450 | unsigned long entries_returned; |
451 | unsigned long entries_total; | 451 | unsigned long entries_total; |
@@ -456,7 +456,7 @@ struct pdc_memory_table { /* PDC_MEM/PDC_MEM_TABLE (arguments) */ | |||
456 | unsigned int pages; | 456 | unsigned int pages; |
457 | unsigned int reserved; | 457 | unsigned int reserved; |
458 | }; | 458 | }; |
459 | #endif /* __LP64__ */ | 459 | #endif /* CONFIG_64BIT */ |
460 | 460 | ||
461 | struct pdc_system_map_mod_info { /* PDC_SYSTEM_MAP/FIND_MODULE */ | 461 | struct pdc_system_map_mod_info { /* PDC_SYSTEM_MAP/FIND_MODULE */ |
462 | unsigned long mod_addr; | 462 | unsigned long mod_addr; |
@@ -752,7 +752,7 @@ int pdc_get_initiator(struct hardware_path *, struct pdc_initiator *); | |||
752 | int pdc_tod_read(struct pdc_tod *tod); | 752 | int pdc_tod_read(struct pdc_tod *tod); |
753 | int pdc_tod_set(unsigned long sec, unsigned long usec); | 753 | int pdc_tod_set(unsigned long sec, unsigned long usec); |
754 | 754 | ||
755 | #ifdef __LP64__ | 755 | #ifdef CONFIG_64BIT |
756 | int pdc_mem_mem_table(struct pdc_memory_table_raddr *r_addr, | 756 | int pdc_mem_mem_table(struct pdc_memory_table_raddr *r_addr, |
757 | struct pdc_memory_table *tbl, unsigned long entries); | 757 | struct pdc_memory_table *tbl, unsigned long entries); |
758 | #endif | 758 | #endif |
diff --git a/include/asm-parisc/pdcpat.h b/include/asm-parisc/pdcpat.h index b4b34c0e8c1a..47539f117958 100644 --- a/include/asm-parisc/pdcpat.h +++ b/include/asm-parisc/pdcpat.h | |||
@@ -250,7 +250,7 @@ struct pdc_pat_pd_addr_map_entry { | |||
250 | #define PAT_GET_ENTITY(value) (((value) >> 56) & 0xffUL) | 250 | #define PAT_GET_ENTITY(value) (((value) >> 56) & 0xffUL) |
251 | #define PAT_GET_DVI(value) (((value) >> 48) & 0xffUL) | 251 | #define PAT_GET_DVI(value) (((value) >> 48) & 0xffUL) |
252 | #define PAT_GET_IOC(value) (((value) >> 40) & 0xffUL) | 252 | #define PAT_GET_IOC(value) (((value) >> 40) & 0xffUL) |
253 | #define PAT_GET_MOD_PAGES(value)(((value) & 0xffffffUL) | 253 | #define PAT_GET_MOD_PAGES(value) ((value) & 0xffffffUL) |
254 | 254 | ||
255 | 255 | ||
256 | /* | 256 | /* |
@@ -303,35 +303,6 @@ extern int pdc_pat_io_pci_cfg_write(unsigned long pci_addr, int pci_size, u32 va | |||
303 | */ | 303 | */ |
304 | extern int pdc_pat; /* arch/parisc/kernel/inventory.c */ | 304 | extern int pdc_pat; /* arch/parisc/kernel/inventory.c */ |
305 | 305 | ||
306 | /******************************************************************** | ||
307 | * PDC_PAT_CELL[Return Cell Module] memaddr[0] conf_base_addr | ||
308 | * ---------------------------------------------------------- | ||
309 | * Bit 0 to 51 - conf_base_addr | ||
310 | * Bit 52 to 62 - reserved | ||
311 | * Bit 63 - endianess bit | ||
312 | ********************************************************************/ | ||
313 | #define PAT_GET_CBA(value) ((value) & 0xfffffffffffff000UL) | ||
314 | |||
315 | /******************************************************************** | ||
316 | * PDC_PAT_CELL[Return Cell Module] memaddr[1] mod_info | ||
317 | * ---------------------------------------------------- | ||
318 | * Bit 0 to 7 - entity type | ||
319 | * 0 = central agent, 1 = processor, | ||
320 | * 2 = memory controller, 3 = system bus adapter, | ||
321 | * 4 = local bus adapter, 5 = processor bus converter, | ||
322 | * 6 = crossbar fabric connect, 7 = fabric interconnect, | ||
323 | * 8 to 254 reserved, 255 = unknown. | ||
324 | * Bit 8 to 15 - DVI | ||
325 | * Bit 16 to 23 - IOC functions | ||
326 | * Bit 24 to 39 - reserved | ||
327 | * Bit 40 to 63 - mod_pages | ||
328 | * number of 4K pages a module occupies starting at conf_base_addr | ||
329 | ********************************************************************/ | ||
330 | #define PAT_GET_ENTITY(value) (((value) >> 56) & 0xffUL) | ||
331 | #define PAT_GET_DVI(value) (((value) >> 48) & 0xffUL) | ||
332 | #define PAT_GET_IOC(value) (((value) >> 40) & 0xffUL) | ||
333 | #define PAT_GET_MOD_PAGES(value)(((value) & 0xffffffUL) | ||
334 | |||
335 | #endif /* __ASSEMBLY__ */ | 306 | #endif /* __ASSEMBLY__ */ |
336 | 307 | ||
337 | #endif /* ! __PARISC_PATPDC_H */ | 308 | #endif /* ! __PARISC_PATPDC_H */ |
diff --git a/include/asm-parisc/pgalloc.h b/include/asm-parisc/pgalloc.h index 3122fad38a1b..1af1a41e0723 100644 --- a/include/asm-parisc/pgalloc.h +++ b/include/asm-parisc/pgalloc.h | |||
@@ -14,7 +14,7 @@ | |||
14 | * Here (for 64 bit kernels) we implement a Hybrid L2/L3 scheme: we | 14 | * Here (for 64 bit kernels) we implement a Hybrid L2/L3 scheme: we |
15 | * allocate the first pmd adjacent to the pgd. This means that we can | 15 | * allocate the first pmd adjacent to the pgd. This means that we can |
16 | * subtract a constant offset to get to it. The pmd and pgd sizes are | 16 | * subtract a constant offset to get to it. The pmd and pgd sizes are |
17 | * arranged so that a single pmd covers 4GB (giving a full LP64 | 17 | * arranged so that a single pmd covers 4GB (giving a full 64-bit |
18 | * process access to 8TB) so our lookups are effectively L2 for the | 18 | * process access to 8TB) so our lookups are effectively L2 for the |
19 | * first 4GB of the kernel (i.e. for all ILP32 processes and all the | 19 | * first 4GB of the kernel (i.e. for all ILP32 processes and all the |
20 | * kernel for machines with under 4GB of memory) */ | 20 | * kernel for machines with under 4GB of memory) */ |
@@ -26,7 +26,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm) | |||
26 | 26 | ||
27 | if (likely(pgd != NULL)) { | 27 | if (likely(pgd != NULL)) { |
28 | memset(pgd, 0, PAGE_SIZE<<PGD_ALLOC_ORDER); | 28 | memset(pgd, 0, PAGE_SIZE<<PGD_ALLOC_ORDER); |
29 | #ifdef __LP64__ | 29 | #ifdef CONFIG_64BIT |
30 | actual_pgd += PTRS_PER_PGD; | 30 | actual_pgd += PTRS_PER_PGD; |
31 | /* Populate first pmd with allocated memory. We mark it | 31 | /* Populate first pmd with allocated memory. We mark it |
32 | * with PxD_FLAG_ATTACHED as a signal to the system that this | 32 | * with PxD_FLAG_ATTACHED as a signal to the system that this |
@@ -45,7 +45,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm) | |||
45 | 45 | ||
46 | static inline void pgd_free(pgd_t *pgd) | 46 | static inline void pgd_free(pgd_t *pgd) |
47 | { | 47 | { |
48 | #ifdef __LP64__ | 48 | #ifdef CONFIG_64BIT |
49 | pgd -= PTRS_PER_PGD; | 49 | pgd -= PTRS_PER_PGD; |
50 | #endif | 50 | #endif |
51 | free_pages((unsigned long)pgd, PGD_ALLOC_ORDER); | 51 | free_pages((unsigned long)pgd, PGD_ALLOC_ORDER); |
@@ -72,7 +72,7 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) | |||
72 | 72 | ||
73 | static inline void pmd_free(pmd_t *pmd) | 73 | static inline void pmd_free(pmd_t *pmd) |
74 | { | 74 | { |
75 | #ifdef __LP64__ | 75 | #ifdef CONFIG_64BIT |
76 | if(pmd_flag(*pmd) & PxD_FLAG_ATTACHED) | 76 | if(pmd_flag(*pmd) & PxD_FLAG_ATTACHED) |
77 | /* This is the permanent pmd attached to the pgd; | 77 | /* This is the permanent pmd attached to the pgd; |
78 | * cannot free it */ | 78 | * cannot free it */ |
@@ -99,7 +99,7 @@ static inline void pmd_free(pmd_t *pmd) | |||
99 | static inline void | 99 | static inline void |
100 | pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte) | 100 | pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte) |
101 | { | 101 | { |
102 | #ifdef __LP64__ | 102 | #ifdef CONFIG_64BIT |
103 | /* preserve the gateway marker if this is the beginning of | 103 | /* preserve the gateway marker if this is the beginning of |
104 | * the permanent pmd */ | 104 | * the permanent pmd */ |
105 | if(pmd_flag(*pmd) & PxD_FLAG_ATTACHED) | 105 | if(pmd_flag(*pmd) & PxD_FLAG_ATTACHED) |
diff --git a/include/asm-parisc/pgtable.h b/include/asm-parisc/pgtable.h index c0b61e0d1497..d7e1b10da5c6 100644 --- a/include/asm-parisc/pgtable.h +++ b/include/asm-parisc/pgtable.h | |||
@@ -10,7 +10,6 @@ | |||
10 | * we simulate an x86-style page table for the linux mm code | 10 | * we simulate an x86-style page table for the linux mm code |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <linux/spinlock.h> | ||
14 | #include <linux/mm.h> /* for vm_area_struct */ | 13 | #include <linux/mm.h> /* for vm_area_struct */ |
15 | #include <asm/processor.h> | 14 | #include <asm/processor.h> |
16 | #include <asm/cache.h> | 15 | #include <asm/cache.h> |
diff --git a/include/asm-parisc/posix_types.h b/include/asm-parisc/posix_types.h index 9b19970de619..b634e3c47fdc 100644 --- a/include/asm-parisc/posix_types.h +++ b/include/asm-parisc/posix_types.h | |||
@@ -20,7 +20,7 @@ typedef int __kernel_timer_t; | |||
20 | typedef int __kernel_clockid_t; | 20 | typedef int __kernel_clockid_t; |
21 | typedef int __kernel_daddr_t; | 21 | typedef int __kernel_daddr_t; |
22 | /* Note these change from narrow to wide kernels */ | 22 | /* Note these change from narrow to wide kernels */ |
23 | #ifdef __LP64__ | 23 | #ifdef CONFIG_64BIT |
24 | typedef unsigned long __kernel_size_t; | 24 | typedef unsigned long __kernel_size_t; |
25 | typedef long __kernel_ssize_t; | 25 | typedef long __kernel_ssize_t; |
26 | typedef long __kernel_ptrdiff_t; | 26 | typedef long __kernel_ptrdiff_t; |
diff --git a/include/asm-parisc/processor.h b/include/asm-parisc/processor.h index fd7866dc8c83..d2f396721d3e 100644 --- a/include/asm-parisc/processor.h +++ b/include/asm-parisc/processor.h | |||
@@ -9,13 +9,10 @@ | |||
9 | #define __ASM_PARISC_PROCESSOR_H | 9 | #define __ASM_PARISC_PROCESSOR_H |
10 | 10 | ||
11 | #ifndef __ASSEMBLY__ | 11 | #ifndef __ASSEMBLY__ |
12 | #include <asm/prefetch.h> /* lockdep.h needs <linux/prefetch.h> */ | ||
13 | |||
14 | #include <linux/threads.h> | 12 | #include <linux/threads.h> |
15 | #include <linux/spinlock_types.h> | ||
16 | 13 | ||
14 | #include <asm/prefetch.h> | ||
17 | #include <asm/hardware.h> | 15 | #include <asm/hardware.h> |
18 | #include <asm/page.h> | ||
19 | #include <asm/pdc.h> | 16 | #include <asm/pdc.h> |
20 | #include <asm/ptrace.h> | 17 | #include <asm/ptrace.h> |
21 | #include <asm/types.h> | 18 | #include <asm/types.h> |
@@ -41,7 +38,7 @@ | |||
41 | #define DEFAULT_TASK_SIZE32 (0xFFF00000UL) | 38 | #define DEFAULT_TASK_SIZE32 (0xFFF00000UL) |
42 | #define DEFAULT_MAP_BASE32 (0x40000000UL) | 39 | #define DEFAULT_MAP_BASE32 (0x40000000UL) |
43 | 40 | ||
44 | #ifdef __LP64__ | 41 | #ifdef CONFIG_64BIT |
45 | #define DEFAULT_TASK_SIZE (MAX_ADDRESS-0xf000000) | 42 | #define DEFAULT_TASK_SIZE (MAX_ADDRESS-0xf000000) |
46 | #define DEFAULT_MAP_BASE (0x200000000UL) | 43 | #define DEFAULT_MAP_BASE (0x200000000UL) |
47 | #else | 44 | #else |
@@ -87,7 +84,6 @@ struct cpuinfo_parisc { | |||
87 | unsigned long hpa; /* Host Physical address */ | 84 | unsigned long hpa; /* Host Physical address */ |
88 | unsigned long txn_addr; /* MMIO addr of EIR or id_eid */ | 85 | unsigned long txn_addr; /* MMIO addr of EIR or id_eid */ |
89 | #ifdef CONFIG_SMP | 86 | #ifdef CONFIG_SMP |
90 | spinlock_t lock; /* synchronization for ipi's */ | ||
91 | unsigned long pending_ipi; /* bitmap of type ipi_message_type */ | 87 | unsigned long pending_ipi; /* bitmap of type ipi_message_type */ |
92 | unsigned long ipi_count; /* number ipi Interrupts */ | 88 | unsigned long ipi_count; /* number ipi Interrupts */ |
93 | #endif | 89 | #endif |
@@ -277,7 +273,7 @@ on downward growing arches, it looks like this: | |||
277 | * it in here from the current->personality | 273 | * it in here from the current->personality |
278 | */ | 274 | */ |
279 | 275 | ||
280 | #ifdef __LP64__ | 276 | #ifdef CONFIG_64BIT |
281 | #define USER_WIDE_MODE (!test_thread_flag(TIF_32BIT)) | 277 | #define USER_WIDE_MODE (!test_thread_flag(TIF_32BIT)) |
282 | #else | 278 | #else |
283 | #define USER_WIDE_MODE 0 | 279 | #define USER_WIDE_MODE 0 |
diff --git a/include/asm-parisc/sembuf.h b/include/asm-parisc/sembuf.h index 1083368ef8db..1e59ffd3bd1e 100644 --- a/include/asm-parisc/sembuf.h +++ b/include/asm-parisc/sembuf.h | |||
@@ -13,11 +13,11 @@ | |||
13 | 13 | ||
14 | struct semid64_ds { | 14 | struct semid64_ds { |
15 | struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ | 15 | struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ |
16 | #ifndef __LP64__ | 16 | #ifndef CONFIG_64BIT |
17 | unsigned int __pad1; | 17 | unsigned int __pad1; |
18 | #endif | 18 | #endif |
19 | __kernel_time_t sem_otime; /* last semop time */ | 19 | __kernel_time_t sem_otime; /* last semop time */ |
20 | #ifndef __LP64__ | 20 | #ifndef CONFIG_64BIT |
21 | unsigned int __pad2; | 21 | unsigned int __pad2; |
22 | #endif | 22 | #endif |
23 | __kernel_time_t sem_ctime; /* last change time */ | 23 | __kernel_time_t sem_ctime; /* last change time */ |
diff --git a/include/asm-parisc/shmbuf.h b/include/asm-parisc/shmbuf.h index 623b6c0c49e6..0a3eada1863b 100644 --- a/include/asm-parisc/shmbuf.h +++ b/include/asm-parisc/shmbuf.h | |||
@@ -13,19 +13,19 @@ | |||
13 | 13 | ||
14 | struct shmid64_ds { | 14 | struct shmid64_ds { |
15 | struct ipc64_perm shm_perm; /* operation perms */ | 15 | struct ipc64_perm shm_perm; /* operation perms */ |
16 | #ifndef __LP64__ | 16 | #ifndef CONFIG_64BIT |
17 | unsigned int __pad1; | 17 | unsigned int __pad1; |
18 | #endif | 18 | #endif |
19 | __kernel_time_t shm_atime; /* last attach time */ | 19 | __kernel_time_t shm_atime; /* last attach time */ |
20 | #ifndef __LP64__ | 20 | #ifndef CONFIG_64BIT |
21 | unsigned int __pad2; | 21 | unsigned int __pad2; |
22 | #endif | 22 | #endif |
23 | __kernel_time_t shm_dtime; /* last detach time */ | 23 | __kernel_time_t shm_dtime; /* last detach time */ |
24 | #ifndef __LP64__ | 24 | #ifndef CONFIG_64BIT |
25 | unsigned int __pad3; | 25 | unsigned int __pad3; |
26 | #endif | 26 | #endif |
27 | __kernel_time_t shm_ctime; /* last change time */ | 27 | __kernel_time_t shm_ctime; /* last change time */ |
28 | #ifndef __LP64__ | 28 | #ifndef CONFIG_64BIT |
29 | unsigned int __pad4; | 29 | unsigned int __pad4; |
30 | #endif | 30 | #endif |
31 | size_t shm_segsz; /* size of segment (bytes) */ | 31 | size_t shm_segsz; /* size of segment (bytes) */ |
@@ -36,7 +36,7 @@ struct shmid64_ds { | |||
36 | unsigned int __unused2; | 36 | unsigned int __unused2; |
37 | }; | 37 | }; |
38 | 38 | ||
39 | #ifdef __LP64__ | 39 | #ifdef CONFIG_64BIT |
40 | /* The 'unsigned int' (formerly 'unsigned long') data types below will | 40 | /* The 'unsigned int' (formerly 'unsigned long') data types below will |
41 | * ensure that a 32-bit app calling shmctl(*,IPC_INFO,*) will work on | 41 | * ensure that a 32-bit app calling shmctl(*,IPC_INFO,*) will work on |
42 | * a wide kernel, but if some of these values are meant to contain pointers | 42 | * a wide kernel, but if some of these values are meant to contain pointers |
diff --git a/include/asm-parisc/signal.h b/include/asm-parisc/signal.h index 98a82fa0cfdb..c20356375d1d 100644 --- a/include/asm-parisc/signal.h +++ b/include/asm-parisc/signal.h | |||
@@ -105,7 +105,7 @@ | |||
105 | struct siginfo; | 105 | struct siginfo; |
106 | 106 | ||
107 | /* Type of a signal handler. */ | 107 | /* Type of a signal handler. */ |
108 | #ifdef __LP64__ | 108 | #ifdef CONFIG_64BIT |
109 | /* function pointers on 64-bit parisc are pointers to little structs and the | 109 | /* function pointers on 64-bit parisc are pointers to little structs and the |
110 | * compiler doesn't support code which changes or tests the address of | 110 | * compiler doesn't support code which changes or tests the address of |
111 | * the function in the little struct. This is really ugly -PB | 111 | * the function in the little struct. This is really ugly -PB |
diff --git a/include/asm-parisc/smp.h b/include/asm-parisc/smp.h index d4c0e26afcd1..306f4950e32e 100644 --- a/include/asm-parisc/smp.h +++ b/include/asm-parisc/smp.h | |||
@@ -41,14 +41,6 @@ extern void smp_send_all_nop(void); | |||
41 | 41 | ||
42 | #define PROC_CHANGE_PENALTY 15 /* Schedule penalty */ | 42 | #define PROC_CHANGE_PENALTY 15 /* Schedule penalty */ |
43 | 43 | ||
44 | #undef ENTRY_SYS_CPUS | ||
45 | #ifdef ENTRY_SYS_CPUS | ||
46 | #define STATE_RENDEZVOUS 0 | ||
47 | #define STATE_STOPPED 1 | ||
48 | #define STATE_RUNNING 2 | ||
49 | #define STATE_HALTED 3 | ||
50 | #endif | ||
51 | |||
52 | extern unsigned long cpu_present_mask; | 44 | extern unsigned long cpu_present_mask; |
53 | 45 | ||
54 | #define raw_smp_processor_id() (current_thread_info()->cpu) | 46 | #define raw_smp_processor_id() (current_thread_info()->cpu) |
diff --git a/include/asm-parisc/spinlock_types.h b/include/asm-parisc/spinlock_types.h index d6b479bdb886..3f72f47cf4b2 100644 --- a/include/asm-parisc/spinlock_types.h +++ b/include/asm-parisc/spinlock_types.h | |||
@@ -1,10 +1,6 @@ | |||
1 | #ifndef __ASM_SPINLOCK_TYPES_H | 1 | #ifndef __ASM_SPINLOCK_TYPES_H |
2 | #define __ASM_SPINLOCK_TYPES_H | 2 | #define __ASM_SPINLOCK_TYPES_H |
3 | 3 | ||
4 | #ifndef __LINUX_SPINLOCK_TYPES_H | ||
5 | # error "please don't include this file directly" | ||
6 | #endif | ||
7 | |||
8 | typedef struct { | 4 | typedef struct { |
9 | #ifdef CONFIG_PA20 | 5 | #ifdef CONFIG_PA20 |
10 | volatile unsigned int slock; | 6 | volatile unsigned int slock; |
diff --git a/include/asm-parisc/statfs.h b/include/asm-parisc/statfs.h index a52d8f93f05c..1d2b8130b23d 100644 --- a/include/asm-parisc/statfs.h +++ b/include/asm-parisc/statfs.h | |||
@@ -30,11 +30,11 @@ struct statfs { | |||
30 | struct statfs64 { | 30 | struct statfs64 { |
31 | long f_type; | 31 | long f_type; |
32 | long f_bsize; | 32 | long f_bsize; |
33 | u64 f_blocks; | 33 | __u64 f_blocks; |
34 | u64 f_bfree; | 34 | __u64 f_bfree; |
35 | u64 f_bavail; | 35 | __u64 f_bavail; |
36 | u64 f_files; | 36 | __u64 f_files; |
37 | u64 f_ffree; | 37 | __u64 f_ffree; |
38 | __kernel_fsid_t f_fsid; | 38 | __kernel_fsid_t f_fsid; |
39 | long f_namelen; | 39 | long f_namelen; |
40 | long f_frsize; | 40 | long f_frsize; |
diff --git a/include/asm-parisc/system.h b/include/asm-parisc/system.h index 74f037a39e6f..7e9afa720d43 100644 --- a/include/asm-parisc/system.h +++ b/include/asm-parisc/system.h | |||
@@ -34,7 +34,7 @@ struct pa_psw { | |||
34 | unsigned int i:1; | 34 | unsigned int i:1; |
35 | }; | 35 | }; |
36 | 36 | ||
37 | #ifdef __LP64__ | 37 | #ifdef CONFIG_64BIT |
38 | #define pa_psw(task) ((struct pa_psw *) ((char *) (task) + TASK_PT_PSW + 4)) | 38 | #define pa_psw(task) ((struct pa_psw *) ((char *) (task) + TASK_PT_PSW + 4)) |
39 | #else | 39 | #else |
40 | #define pa_psw(task) ((struct pa_psw *) ((char *) (task) + TASK_PT_PSW)) | 40 | #define pa_psw(task) ((struct pa_psw *) ((char *) (task) + TASK_PT_PSW)) |
diff --git a/include/asm-parisc/thread_info.h b/include/asm-parisc/thread_info.h index f2f83b04cd8b..949314cf6188 100644 --- a/include/asm-parisc/thread_info.h +++ b/include/asm-parisc/thread_info.h | |||
@@ -62,6 +62,7 @@ struct thread_info { | |||
62 | #define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling TIF_NEED_RESCHED */ | 62 | #define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling TIF_NEED_RESCHED */ |
63 | #define TIF_32BIT 5 /* 32 bit binary */ | 63 | #define TIF_32BIT 5 /* 32 bit binary */ |
64 | #define TIF_MEMDIE 6 | 64 | #define TIF_MEMDIE 6 |
65 | #define TIF_RESTORE_SIGMASK 7 /* restore saved signal mask */ | ||
65 | 66 | ||
66 | #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) | 67 | #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) |
67 | #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) | 68 | #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) |
@@ -69,9 +70,10 @@ struct thread_info { | |||
69 | #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) | 70 | #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) |
70 | #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) | 71 | #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) |
71 | #define _TIF_32BIT (1 << TIF_32BIT) | 72 | #define _TIF_32BIT (1 << TIF_32BIT) |
73 | #define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) | ||
72 | 74 | ||
73 | #define _TIF_USER_WORK_MASK (_TIF_NOTIFY_RESUME | _TIF_SIGPENDING | \ | 75 | #define _TIF_USER_WORK_MASK (_TIF_NOTIFY_RESUME | _TIF_SIGPENDING | \ |
74 | _TIF_NEED_RESCHED) | 76 | _TIF_NEED_RESCHED | _TIF_RESTORE_SIGMASK) |
75 | 77 | ||
76 | #endif /* __KERNEL__ */ | 78 | #endif /* __KERNEL__ */ |
77 | 79 | ||
diff --git a/include/asm-parisc/tlbflush.h b/include/asm-parisc/tlbflush.h index f662e837dea1..3313da9ea00f 100644 --- a/include/asm-parisc/tlbflush.h +++ b/include/asm-parisc/tlbflush.h | |||
@@ -73,33 +73,11 @@ static inline void flush_tlb_page(struct vm_area_struct *vma, | |||
73 | purge_tlb_end(); | 73 | purge_tlb_end(); |
74 | } | 74 | } |
75 | 75 | ||
76 | static inline void flush_tlb_range(struct vm_area_struct *vma, | 76 | void __flush_tlb_range(unsigned long sid, |
77 | unsigned long start, unsigned long end) | 77 | unsigned long start, unsigned long end); |
78 | { | ||
79 | unsigned long npages; | ||
80 | 78 | ||
81 | npages = ((end - (start & PAGE_MASK)) + (PAGE_SIZE - 1)) >> PAGE_SHIFT; | 79 | #define flush_tlb_range(vma,start,end) __flush_tlb_range((vma)->vm_mm->context,start,end) |
82 | if (npages >= 512) /* 2MB of space: arbitrary, should be tuned */ | ||
83 | flush_tlb_all(); | ||
84 | else { | ||
85 | mtsp(vma->vm_mm->context,1); | ||
86 | purge_tlb_start(); | ||
87 | if (split_tlb) { | ||
88 | while (npages--) { | ||
89 | pdtlb(start); | ||
90 | pitlb(start); | ||
91 | start += PAGE_SIZE; | ||
92 | } | ||
93 | } else { | ||
94 | while (npages--) { | ||
95 | pdtlb(start); | ||
96 | start += PAGE_SIZE; | ||
97 | } | ||
98 | } | ||
99 | purge_tlb_end(); | ||
100 | } | ||
101 | } | ||
102 | 80 | ||
103 | #define flush_tlb_kernel_range(start, end) flush_tlb_all() | 81 | #define flush_tlb_kernel_range(start, end) __flush_tlb_range(0,start,end) |
104 | 82 | ||
105 | #endif | 83 | #endif |
diff --git a/include/asm-parisc/types.h b/include/asm-parisc/types.h index 34fdce361a5a..d4aa33033d98 100644 --- a/include/asm-parisc/types.h +++ b/include/asm-parisc/types.h | |||
@@ -31,7 +31,7 @@ typedef unsigned long long __u64; | |||
31 | */ | 31 | */ |
32 | #ifdef __KERNEL__ | 32 | #ifdef __KERNEL__ |
33 | 33 | ||
34 | #ifdef __LP64__ | 34 | #ifdef CONFIG_64BIT |
35 | #define BITS_PER_LONG 64 | 35 | #define BITS_PER_LONG 64 |
36 | #define SHIFT_PER_LONG 6 | 36 | #define SHIFT_PER_LONG 6 |
37 | #else | 37 | #else |
diff --git a/include/asm-parisc/uaccess.h b/include/asm-parisc/uaccess.h index d973e8b3466c..4878b9501f24 100644 --- a/include/asm-parisc/uaccess.h +++ b/include/asm-parisc/uaccess.h | |||
@@ -4,7 +4,6 @@ | |||
4 | /* | 4 | /* |
5 | * User space memory access functions | 5 | * User space memory access functions |
6 | */ | 6 | */ |
7 | #include <linux/sched.h> | ||
8 | #include <asm/page.h> | 7 | #include <asm/page.h> |
9 | #include <asm/system.h> | 8 | #include <asm/system.h> |
10 | #include <asm/cache.h> | 9 | #include <asm/cache.h> |
@@ -43,16 +42,18 @@ static inline long access_ok(int type, const void __user * addr, | |||
43 | #define put_user __put_user | 42 | #define put_user __put_user |
44 | #define get_user __get_user | 43 | #define get_user __get_user |
45 | 44 | ||
46 | #if BITS_PER_LONG == 32 | 45 | #if !defined(CONFIG_64BIT) |
47 | #define LDD_KERNEL(ptr) __get_kernel_bad(); | 46 | #define LDD_KERNEL(ptr) __get_kernel_bad(); |
48 | #define LDD_USER(ptr) __get_user_bad(); | 47 | #define LDD_USER(ptr) __get_user_bad(); |
49 | #define STD_KERNEL(x, ptr) __put_kernel_asm64(x,ptr) | 48 | #define STD_KERNEL(x, ptr) __put_kernel_asm64(x,ptr) |
50 | #define STD_USER(x, ptr) __put_user_asm64(x,ptr) | 49 | #define STD_USER(x, ptr) __put_user_asm64(x,ptr) |
50 | #define ASM_WORD_INSN ".word\t" | ||
51 | #else | 51 | #else |
52 | #define LDD_KERNEL(ptr) __get_kernel_asm("ldd",ptr) | 52 | #define LDD_KERNEL(ptr) __get_kernel_asm("ldd",ptr) |
53 | #define LDD_USER(ptr) __get_user_asm("ldd",ptr) | 53 | #define LDD_USER(ptr) __get_user_asm("ldd",ptr) |
54 | #define STD_KERNEL(x, ptr) __put_kernel_asm("std",x,ptr) | 54 | #define STD_KERNEL(x, ptr) __put_kernel_asm("std",x,ptr) |
55 | #define STD_USER(x, ptr) __put_user_asm("std",x,ptr) | 55 | #define STD_USER(x, ptr) __put_user_asm("std",x,ptr) |
56 | #define ASM_WORD_INSN ".dword\t" | ||
56 | #endif | 57 | #endif |
57 | 58 | ||
58 | /* | 59 | /* |
@@ -66,6 +67,11 @@ struct exception_table_entry { | |||
66 | long fixup; /* fixup routine */ | 67 | long fixup; /* fixup routine */ |
67 | }; | 68 | }; |
68 | 69 | ||
70 | #define ASM_EXCEPTIONTABLE_ENTRY( fault_addr, except_addr )\ | ||
71 | ".section __ex_table,\"aw\"\n" \ | ||
72 | ASM_WORD_INSN #fault_addr ", " #except_addr "\n\t" \ | ||
73 | ".previous\n" | ||
74 | |||
69 | /* | 75 | /* |
70 | * The page fault handler stores, in a per-cpu area, the following information | 76 | * The page fault handler stores, in a per-cpu area, the following information |
71 | * if a fixup routine is available. | 77 | * if a fixup routine is available. |
@@ -104,43 +110,19 @@ struct exception_data { | |||
104 | __gu_err; \ | 110 | __gu_err; \ |
105 | }) | 111 | }) |
106 | 112 | ||
107 | #ifdef __LP64__ | ||
108 | #define __get_kernel_asm(ldx,ptr) \ | ||
109 | __asm__("\n1:\t" ldx "\t0(%2),%0\n" \ | ||
110 | "\t.section __ex_table,\"aw\"\n" \ | ||
111 | "\t.dword\t1b,fixup_get_user_skip_1\n" \ | ||
112 | "\t.previous" \ | ||
113 | : "=r"(__gu_val), "=r"(__gu_err) \ | ||
114 | : "r"(ptr), "1"(__gu_err) \ | ||
115 | : "r1"); | ||
116 | |||
117 | #define __get_user_asm(ldx,ptr) \ | ||
118 | __asm__("\n1:\t" ldx "\t0(%%sr3,%2),%0\n" \ | ||
119 | "\t.section __ex_table,\"aw\"\n" \ | ||
120 | "\t.dword\t1b,fixup_get_user_skip_1\n" \ | ||
121 | "\t.previous" \ | ||
122 | : "=r"(__gu_val), "=r"(__gu_err) \ | ||
123 | : "r"(ptr), "1"(__gu_err) \ | ||
124 | : "r1"); | ||
125 | #else | ||
126 | #define __get_kernel_asm(ldx,ptr) \ | 113 | #define __get_kernel_asm(ldx,ptr) \ |
127 | __asm__("\n1:\t" ldx "\t0(%2),%0\n" \ | 114 | __asm__("\n1:\t" ldx "\t0(%2),%0\n\t" \ |
128 | "\t.section __ex_table,\"aw\"\n" \ | 115 | ASM_EXCEPTIONTABLE_ENTRY(1b, fixup_get_user_skip_1)\ |
129 | "\t.word\t1b,fixup_get_user_skip_1\n" \ | ||
130 | "\t.previous" \ | ||
131 | : "=r"(__gu_val), "=r"(__gu_err) \ | 116 | : "=r"(__gu_val), "=r"(__gu_err) \ |
132 | : "r"(ptr), "1"(__gu_err) \ | 117 | : "r"(ptr), "1"(__gu_err) \ |
133 | : "r1"); | 118 | : "r1"); |
134 | 119 | ||
135 | #define __get_user_asm(ldx,ptr) \ | 120 | #define __get_user_asm(ldx,ptr) \ |
136 | __asm__("\n1:\t" ldx "\t0(%%sr3,%2),%0\n" \ | 121 | __asm__("\n1:\t" ldx "\t0(%%sr3,%2),%0\n\t" \ |
137 | "\t.section __ex_table,\"aw\"\n" \ | 122 | ASM_EXCEPTIONTABLE_ENTRY(1b,fixup_get_user_skip_1)\ |
138 | "\t.word\t1b,fixup_get_user_skip_1\n" \ | ||
139 | "\t.previous" \ | ||
140 | : "=r"(__gu_val), "=r"(__gu_err) \ | 123 | : "=r"(__gu_val), "=r"(__gu_err) \ |
141 | : "r"(ptr), "1"(__gu_err) \ | 124 | : "r"(ptr), "1"(__gu_err) \ |
142 | : "r1"); | 125 | : "r1"); |
143 | #endif /* !__LP64__ */ | ||
144 | 126 | ||
145 | #define __put_user(x,ptr) \ | 127 | #define __put_user(x,ptr) \ |
146 | ({ \ | 128 | ({ \ |
@@ -179,80 +161,54 @@ struct exception_data { | |||
179 | * r8/r9 are already listed as err/val. | 161 | * r8/r9 are already listed as err/val. |
180 | */ | 162 | */ |
181 | 163 | ||
182 | #ifdef __LP64__ | ||
183 | #define __put_kernel_asm(stx,x,ptr) \ | 164 | #define __put_kernel_asm(stx,x,ptr) \ |
184 | __asm__ __volatile__ ( \ | 165 | __asm__ __volatile__ ( \ |
185 | "\n1:\t" stx "\t%2,0(%1)\n" \ | 166 | "\n1:\t" stx "\t%2,0(%1)\n\t" \ |
186 | "\t.section __ex_table,\"aw\"\n" \ | 167 | ASM_EXCEPTIONTABLE_ENTRY(1b,fixup_put_user_skip_1)\ |
187 | "\t.dword\t1b,fixup_put_user_skip_1\n" \ | ||
188 | "\t.previous" \ | ||
189 | : "=r"(__pu_err) \ | 168 | : "=r"(__pu_err) \ |
190 | : "r"(ptr), "r"(x), "0"(__pu_err) \ | 169 | : "r"(ptr), "r"(x), "0"(__pu_err) \ |
191 | : "r1") | 170 | : "r1") |
192 | 171 | ||
193 | #define __put_user_asm(stx,x,ptr) \ | 172 | #define __put_user_asm(stx,x,ptr) \ |
194 | __asm__ __volatile__ ( \ | 173 | __asm__ __volatile__ ( \ |
195 | "\n1:\t" stx "\t%2,0(%%sr3,%1)\n" \ | 174 | "\n1:\t" stx "\t%2,0(%%sr3,%1)\n\t" \ |
196 | "\t.section __ex_table,\"aw\"\n" \ | 175 | ASM_EXCEPTIONTABLE_ENTRY(1b,fixup_put_user_skip_1)\ |
197 | "\t.dword\t1b,fixup_put_user_skip_1\n" \ | ||
198 | "\t.previous" \ | ||
199 | : "=r"(__pu_err) \ | ||
200 | : "r"(ptr), "r"(x), "0"(__pu_err) \ | ||
201 | : "r1") | ||
202 | #else | ||
203 | #define __put_kernel_asm(stx,x,ptr) \ | ||
204 | __asm__ __volatile__ ( \ | ||
205 | "\n1:\t" stx "\t%2,0(%1)\n" \ | ||
206 | "\t.section __ex_table,\"aw\"\n" \ | ||
207 | "\t.word\t1b,fixup_put_user_skip_1\n" \ | ||
208 | "\t.previous" \ | ||
209 | : "=r"(__pu_err) \ | 176 | : "=r"(__pu_err) \ |
210 | : "r"(ptr), "r"(x), "0"(__pu_err) \ | 177 | : "r"(ptr), "r"(x), "0"(__pu_err) \ |
211 | : "r1") | 178 | : "r1") |
212 | 179 | ||
213 | #define __put_user_asm(stx,x,ptr) \ | ||
214 | __asm__ __volatile__ ( \ | ||
215 | "\n1:\t" stx "\t%2,0(%%sr3,%1)\n" \ | ||
216 | "\t.section __ex_table,\"aw\"\n" \ | ||
217 | "\t.word\t1b,fixup_put_user_skip_1\n" \ | ||
218 | "\t.previous" \ | ||
219 | : "=r"(__pu_err) \ | ||
220 | : "r"(ptr), "r"(x), "0"(__pu_err) \ | ||
221 | : "r1") | ||
222 | 180 | ||
223 | #define __put_kernel_asm64(__val,ptr) do { \ | 181 | #if !defined(CONFIG_64BIT) |
224 | u64 __val64 = (u64)(__val); \ | 182 | |
225 | u32 hi = (__val64) >> 32; \ | 183 | #define __put_kernel_asm64(__val,ptr) do { \ |
226 | u32 lo = (__val64) & 0xffffffff; \ | 184 | u64 __val64 = (u64)(__val); \ |
185 | u32 hi = (__val64) >> 32; \ | ||
186 | u32 lo = (__val64) & 0xffffffff; \ | ||
227 | __asm__ __volatile__ ( \ | 187 | __asm__ __volatile__ ( \ |
228 | "\n1:\tstw %2,0(%1)\n" \ | 188 | "\n1:\tstw %2,0(%1)" \ |
229 | "\n2:\tstw %3,4(%1)\n" \ | 189 | "\n2:\tstw %3,4(%1)\n\t" \ |
230 | "\t.section __ex_table,\"aw\"\n" \ | 190 | ASM_EXCEPTIONTABLE_ENTRY(1b,fixup_put_user_skip_2)\ |
231 | "\t.word\t1b,fixup_put_user_skip_2\n" \ | 191 | ASM_EXCEPTIONTABLE_ENTRY(2b,fixup_put_user_skip_1)\ |
232 | "\t.word\t2b,fixup_put_user_skip_1\n" \ | ||
233 | "\t.previous" \ | ||
234 | : "=r"(__pu_err) \ | 192 | : "=r"(__pu_err) \ |
235 | : "r"(ptr), "r"(hi), "r"(lo), "0"(__pu_err) \ | 193 | : "r"(ptr), "r"(hi), "r"(lo), "0"(__pu_err) \ |
236 | : "r1"); \ | 194 | : "r1"); \ |
237 | } while (0) | 195 | } while (0) |
238 | 196 | ||
239 | #define __put_user_asm64(__val,ptr) do { \ | 197 | #define __put_user_asm64(__val,ptr) do { \ |
240 | u64 __val64 = (u64)__val; \ | 198 | u64 __val64 = (u64)(__val); \ |
241 | u32 hi = (__val64) >> 32; \ | 199 | u32 hi = (__val64) >> 32; \ |
242 | u32 lo = (__val64) & 0xffffffff; \ | 200 | u32 lo = (__val64) & 0xffffffff; \ |
243 | __asm__ __volatile__ ( \ | 201 | __asm__ __volatile__ ( \ |
244 | "\n1:\tstw %2,0(%%sr3,%1)\n" \ | 202 | "\n1:\tstw %2,0(%%sr3,%1)" \ |
245 | "\n2:\tstw %3,4(%%sr3,%1)\n" \ | 203 | "\n2:\tstw %3,4(%%sr3,%1)\n\t" \ |
246 | "\t.section __ex_table,\"aw\"\n" \ | 204 | ASM_EXCEPTIONTABLE_ENTRY(1b,fixup_put_user_skip_2)\ |
247 | "\t.word\t1b,fixup_get_user_skip_2\n" \ | 205 | ASM_EXCEPTIONTABLE_ENTRY(2b,fixup_put_user_skip_1)\ |
248 | "\t.word\t2b,fixup_get_user_skip_1\n" \ | ||
249 | "\t.previous" \ | ||
250 | : "=r"(__pu_err) \ | 206 | : "=r"(__pu_err) \ |
251 | : "r"(ptr), "r"(hi), "r"(lo), "0"(__pu_err) \ | 207 | : "r"(ptr), "r"(hi), "r"(lo), "0"(__pu_err) \ |
252 | : "r1"); \ | 208 | : "r1"); \ |
253 | } while (0) | 209 | } while (0) |
254 | 210 | ||
255 | #endif /* !__LP64__ */ | 211 | #endif /* !defined(CONFIG_64BIT) */ |
256 | 212 | ||
257 | 213 | ||
258 | /* | 214 | /* |
diff --git a/include/asm-parisc/unistd.h b/include/asm-parisc/unistd.h index 53b0f5d290e4..2f7c40861c91 100644 --- a/include/asm-parisc/unistd.h +++ b/include/asm-parisc/unistd.h | |||
@@ -772,7 +772,7 @@ | |||
772 | #define __NR_mknodat (__NR_Linux + 277) | 772 | #define __NR_mknodat (__NR_Linux + 277) |
773 | #define __NR_fchownat (__NR_Linux + 278) | 773 | #define __NR_fchownat (__NR_Linux + 278) |
774 | #define __NR_futimesat (__NR_Linux + 279) | 774 | #define __NR_futimesat (__NR_Linux + 279) |
775 | #define __NR_newfstatat (__NR_Linux + 280) | 775 | #define __NR_fstatat64 (__NR_Linux + 280) |
776 | #define __NR_unlinkat (__NR_Linux + 281) | 776 | #define __NR_unlinkat (__NR_Linux + 281) |
777 | #define __NR_renameat (__NR_Linux + 282) | 777 | #define __NR_renameat (__NR_Linux + 282) |
778 | #define __NR_linkat (__NR_Linux + 283) | 778 | #define __NR_linkat (__NR_Linux + 283) |
@@ -786,8 +786,14 @@ | |||
786 | #define __NR_splice (__NR_Linux + 291) | 786 | #define __NR_splice (__NR_Linux + 291) |
787 | #define __NR_sync_file_range (__NR_Linux + 292) | 787 | #define __NR_sync_file_range (__NR_Linux + 292) |
788 | #define __NR_tee (__NR_Linux + 293) | 788 | #define __NR_tee (__NR_Linux + 293) |
789 | #define __NR_vmsplice (__NR_Linux + 294) | ||
790 | #define __NR_move_pages (__NR_Linux + 295) | ||
791 | #define __NR_getcpu (__NR_Linux + 296) | ||
792 | #define __NR_epoll_pwait (__NR_Linux + 297) | ||
793 | #define __NR_statfs64 (__NR_Linux + 298) | ||
794 | #define __NR_fstatfs64 (__NR_Linux + 299) | ||
789 | 795 | ||
790 | #define __NR_Linux_syscalls 294 | 796 | #define __NR_Linux_syscalls (__NR_fstatfs64 + 1) |
791 | 797 | ||
792 | #define HPUX_GATEWAY_ADDR 0xC0000004 | 798 | #define HPUX_GATEWAY_ADDR 0xC0000004 |
793 | #define LINUX_GATEWAY_ADDR 0x100 | 799 | #define LINUX_GATEWAY_ADDR 0x100 |
@@ -951,6 +957,8 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \ | |||
951 | #define __ARCH_WANT_SYS_SIGPENDING | 957 | #define __ARCH_WANT_SYS_SIGPENDING |
952 | #define __ARCH_WANT_SYS_SIGPROCMASK | 958 | #define __ARCH_WANT_SYS_SIGPROCMASK |
953 | #define __ARCH_WANT_SYS_RT_SIGACTION | 959 | #define __ARCH_WANT_SYS_RT_SIGACTION |
960 | #define __ARCH_WANT_SYS_RT_SIGSUSPEND | ||
961 | #define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND | ||
954 | 962 | ||
955 | #endif /* __ASSEMBLY__ */ | 963 | #endif /* __ASSEMBLY__ */ |
956 | 964 | ||
diff --git a/include/asm-s390/atomic.h b/include/asm-s390/atomic.h index af20c7462485..c17bdbf22067 100644 --- a/include/asm-s390/atomic.h +++ b/include/asm-s390/atomic.h | |||
@@ -215,6 +215,8 @@ static __inline__ void atomic64_set_mask(unsigned long mask, atomic64_t * v) | |||
215 | __CSG_LOOP(v, mask, "ogr"); | 215 | __CSG_LOOP(v, mask, "ogr"); |
216 | } | 216 | } |
217 | 217 | ||
218 | #define atomic64_xchg(v, new) (xchg(&((v)->counter), new)) | ||
219 | |||
218 | static __inline__ long long atomic64_cmpxchg(atomic64_t *v, | 220 | static __inline__ long long atomic64_cmpxchg(atomic64_t *v, |
219 | long long old, long long new) | 221 | long long old, long long new) |
220 | { | 222 | { |
diff --git a/include/asm-s390/ipl.h b/include/asm-s390/ipl.h new file mode 100644 index 000000000000..5650d3d4ae46 --- /dev/null +++ b/include/asm-s390/ipl.h | |||
@@ -0,0 +1,113 @@ | |||
1 | /* | ||
2 | * s390 (re)ipl support | ||
3 | * | ||
4 | * Copyright IBM Corp. 2007 | ||
5 | */ | ||
6 | |||
7 | #ifndef _ASM_S390_IPL_H | ||
8 | #define _ASM_S390_IPL_H | ||
9 | |||
10 | #include <asm/types.h> | ||
11 | |||
12 | #define IPL_PARMBLOCK_ORIGIN 0x2000 | ||
13 | |||
14 | #define IPL_PARM_BLK_FCP_LEN (sizeof(struct ipl_list_hdr) + \ | ||
15 | sizeof(struct ipl_block_fcp)) | ||
16 | |||
17 | #define IPL_PARM_BLK_CCW_LEN (sizeof(struct ipl_list_hdr) + \ | ||
18 | sizeof(struct ipl_block_ccw)) | ||
19 | |||
20 | #define IPL_MAX_SUPPORTED_VERSION (0) | ||
21 | |||
22 | #define IPL_PARMBLOCK_START ((struct ipl_parameter_block *) \ | ||
23 | IPL_PARMBLOCK_ORIGIN) | ||
24 | #define IPL_PARMBLOCK_SIZE (IPL_PARMBLOCK_START->hdr.len) | ||
25 | |||
26 | struct ipl_list_hdr { | ||
27 | u32 len; | ||
28 | u8 reserved1[3]; | ||
29 | u8 version; | ||
30 | u32 blk0_len; | ||
31 | u8 pbt; | ||
32 | u8 flags; | ||
33 | u16 reserved2; | ||
34 | } __attribute__((packed)); | ||
35 | |||
36 | struct ipl_block_fcp { | ||
37 | u8 reserved1[313-1]; | ||
38 | u8 opt; | ||
39 | u8 reserved2[3]; | ||
40 | u16 reserved3; | ||
41 | u16 devno; | ||
42 | u8 reserved4[4]; | ||
43 | u64 wwpn; | ||
44 | u64 lun; | ||
45 | u32 bootprog; | ||
46 | u8 reserved5[12]; | ||
47 | u64 br_lba; | ||
48 | u32 scp_data_len; | ||
49 | u8 reserved6[260]; | ||
50 | u8 scp_data[]; | ||
51 | } __attribute__((packed)); | ||
52 | |||
53 | struct ipl_block_ccw { | ||
54 | u8 load_param[8]; | ||
55 | u8 reserved1[84]; | ||
56 | u8 reserved2[2]; | ||
57 | u16 devno; | ||
58 | u8 vm_flags; | ||
59 | u8 reserved3[3]; | ||
60 | u32 vm_parm_len; | ||
61 | } __attribute__((packed)); | ||
62 | |||
63 | struct ipl_parameter_block { | ||
64 | struct ipl_list_hdr hdr; | ||
65 | union { | ||
66 | struct ipl_block_fcp fcp; | ||
67 | struct ipl_block_ccw ccw; | ||
68 | } ipl_info; | ||
69 | } __attribute__((packed)); | ||
70 | |||
71 | /* | ||
72 | * IPL validity flags and parameters as detected in head.S | ||
73 | */ | ||
74 | extern u32 ipl_flags; | ||
75 | extern u16 ipl_devno; | ||
76 | |||
77 | extern void do_reipl(void); | ||
78 | extern void ipl_save_parameters(void); | ||
79 | |||
80 | enum { | ||
81 | IPL_DEVNO_VALID = 1, | ||
82 | IPL_PARMBLOCK_VALID = 2, | ||
83 | IPL_NSS_VALID = 4, | ||
84 | }; | ||
85 | |||
86 | /* | ||
87 | * DIAG 308 support | ||
88 | */ | ||
89 | enum diag308_subcode { | ||
90 | DIAG308_REL_HSA = 2, | ||
91 | DIAG308_IPL = 3, | ||
92 | DIAG308_DUMP = 4, | ||
93 | DIAG308_SET = 5, | ||
94 | DIAG308_STORE = 6, | ||
95 | }; | ||
96 | |||
97 | enum diag308_ipl_type { | ||
98 | DIAG308_IPL_TYPE_FCP = 0, | ||
99 | DIAG308_IPL_TYPE_CCW = 2, | ||
100 | }; | ||
101 | |||
102 | enum diag308_opt { | ||
103 | DIAG308_IPL_OPT_IPL = 0x10, | ||
104 | DIAG308_IPL_OPT_DUMP = 0x20, | ||
105 | }; | ||
106 | |||
107 | enum diag308_rc { | ||
108 | DIAG308_RC_OK = 1, | ||
109 | }; | ||
110 | |||
111 | extern int diag308(unsigned long subcode, void *addr); | ||
112 | |||
113 | #endif /* _ASM_S390_IPL_H */ | ||
diff --git a/include/asm-s390/local.h b/include/asm-s390/local.h index 86745a1b29bb..c11c530f74d0 100644 --- a/include/asm-s390/local.h +++ b/include/asm-s390/local.h | |||
@@ -1,58 +1 @@ | |||
1 | #ifndef _ASM_LOCAL_H | #include <asm-generic/local.h> | |
2 | #define _ASM_LOCAL_H | ||
3 | |||
4 | #include <linux/percpu.h> | ||
5 | #include <asm/atomic.h> | ||
6 | |||
7 | #ifndef __s390x__ | ||
8 | |||
9 | typedef atomic_t local_t; | ||
10 | |||
11 | #define LOCAL_INIT(i) ATOMIC_INIT(i) | ||
12 | #define local_read(v) atomic_read(v) | ||
13 | #define local_set(v,i) atomic_set(v,i) | ||
14 | |||
15 | #define local_inc(v) atomic_inc(v) | ||
16 | #define local_dec(v) atomic_dec(v) | ||
17 | #define local_add(i, v) atomic_add(i, v) | ||
18 | #define local_sub(i, v) atomic_sub(i, v) | ||
19 | |||
20 | #else | ||
21 | |||
22 | typedef atomic64_t local_t; | ||
23 | |||
24 | #define LOCAL_INIT(i) ATOMIC64_INIT(i) | ||
25 | #define local_read(v) atomic64_read(v) | ||
26 | #define local_set(v,i) atomic64_set(v,i) | ||
27 | |||
28 | #define local_inc(v) atomic64_inc(v) | ||
29 | #define local_dec(v) atomic64_dec(v) | ||
30 | #define local_add(i, v) atomic64_add(i, v) | ||
31 | #define local_sub(i, v) atomic64_sub(i, v) | ||
32 | |||
33 | #endif | ||
34 | |||
35 | #define __local_inc(v) ((v)->counter++) | ||
36 | #define __local_dec(v) ((v)->counter--) | ||
37 | #define __local_add(i,v) ((v)->counter+=(i)) | ||
38 | #define __local_sub(i,v) ((v)->counter-=(i)) | ||
39 | |||
40 | /* | ||
41 | * Use these for per-cpu local_t variables: on some archs they are | ||
42 | * much more efficient than these naive implementations. Note they take | ||
43 | * a variable, not an address. | ||
44 | */ | ||
45 | #define cpu_local_read(v) local_read(&__get_cpu_var(v)) | ||
46 | #define cpu_local_set(v, i) local_set(&__get_cpu_var(v), (i)) | ||
47 | |||
48 | #define cpu_local_inc(v) local_inc(&__get_cpu_var(v)) | ||
49 | #define cpu_local_dec(v) local_dec(&__get_cpu_var(v)) | ||
50 | #define cpu_local_add(i, v) local_add((i), &__get_cpu_var(v)) | ||
51 | #define cpu_local_sub(i, v) local_sub((i), &__get_cpu_var(v)) | ||
52 | |||
53 | #define __cpu_local_inc(v) __local_inc(&__get_cpu_var(v)) | ||
54 | #define __cpu_local_dec(v) __local_dec(&__get_cpu_var(v)) | ||
55 | #define __cpu_local_add(i, v) __local_add((i), &__get_cpu_var(v)) | ||
56 | #define __cpu_local_sub(i, v) __local_sub((i), &__get_cpu_var(v)) | ||
57 | |||
58 | #endif /* _ASM_LOCAL_H */ | ||
diff --git a/include/asm-s390/processor.h b/include/asm-s390/processor.h index 4c1b73940351..33b80ced4bc1 100644 --- a/include/asm-s390/processor.h +++ b/include/asm-s390/processor.h | |||
@@ -36,6 +36,11 @@ typedef struct | |||
36 | unsigned int unused : 16; | 36 | unsigned int unused : 16; |
37 | } __attribute__ ((packed)) cpuid_t; | 37 | } __attribute__ ((packed)) cpuid_t; |
38 | 38 | ||
39 | static inline void get_cpu_id(cpuid_t *ptr) | ||
40 | { | ||
41 | asm volatile("stidp 0(%1)" : "=m" (*ptr) : "a" (ptr)); | ||
42 | } | ||
43 | |||
39 | struct cpuinfo_S390 | 44 | struct cpuinfo_S390 |
40 | { | 45 | { |
41 | cpuid_t cpu_id; | 46 | cpuid_t cpu_id; |
diff --git a/include/asm-s390/sections.h b/include/asm-s390/sections.h index 1c5a2c4ccdad..fbd9116eb17b 100644 --- a/include/asm-s390/sections.h +++ b/include/asm-s390/sections.h | |||
@@ -3,6 +3,6 @@ | |||
3 | 3 | ||
4 | #include <asm-generic/sections.h> | 4 | #include <asm-generic/sections.h> |
5 | 5 | ||
6 | extern char _eshared[]; | 6 | extern char _eshared[], _ehead[]; |
7 | 7 | ||
8 | #endif | 8 | #endif |
diff --git a/include/asm-s390/setup.h b/include/asm-s390/setup.h index 3388bb52597c..44c7aee2bd34 100644 --- a/include/asm-s390/setup.h +++ b/include/asm-s390/setup.h | |||
@@ -16,7 +16,6 @@ | |||
16 | 16 | ||
17 | #define PARMAREA 0x10400 | 17 | #define PARMAREA 0x10400 |
18 | #define MEMORY_CHUNKS 16 /* max 0x7fff */ | 18 | #define MEMORY_CHUNKS 16 /* max 0x7fff */ |
19 | #define IPL_PARMBLOCK_ORIGIN 0x2000 | ||
20 | 19 | ||
21 | #ifndef __ASSEMBLY__ | 20 | #ifndef __ASSEMBLY__ |
22 | 21 | ||
@@ -97,82 +96,9 @@ extern char vmpoff_cmd[]; | |||
97 | #define SET_CONSOLE_3215 do { console_mode = 2; } while (0) | 96 | #define SET_CONSOLE_3215 do { console_mode = 2; } while (0) |
98 | #define SET_CONSOLE_3270 do { console_mode = 3; } while (0) | 97 | #define SET_CONSOLE_3270 do { console_mode = 3; } while (0) |
99 | 98 | ||
100 | struct ipl_list_hdr { | ||
101 | u32 len; | ||
102 | u8 reserved1[3]; | ||
103 | u8 version; | ||
104 | u32 blk0_len; | ||
105 | u8 pbt; | ||
106 | u8 flags; | ||
107 | u16 reserved2; | ||
108 | } __attribute__((packed)); | ||
109 | |||
110 | struct ipl_block_fcp { | ||
111 | u8 reserved1[313-1]; | ||
112 | u8 opt; | ||
113 | u8 reserved2[3]; | ||
114 | u16 reserved3; | ||
115 | u16 devno; | ||
116 | u8 reserved4[4]; | ||
117 | u64 wwpn; | ||
118 | u64 lun; | ||
119 | u32 bootprog; | ||
120 | u8 reserved5[12]; | ||
121 | u64 br_lba; | ||
122 | u32 scp_data_len; | ||
123 | u8 reserved6[260]; | ||
124 | u8 scp_data[]; | ||
125 | } __attribute__((packed)); | ||
126 | |||
127 | struct ipl_block_ccw { | ||
128 | u8 load_param[8]; | ||
129 | u8 reserved1[84]; | ||
130 | u8 reserved2[2]; | ||
131 | u16 devno; | ||
132 | u8 vm_flags; | ||
133 | u8 reserved3[3]; | ||
134 | u32 vm_parm_len; | ||
135 | } __attribute__((packed)); | ||
136 | |||
137 | struct ipl_parameter_block { | ||
138 | struct ipl_list_hdr hdr; | ||
139 | union { | ||
140 | struct ipl_block_fcp fcp; | ||
141 | struct ipl_block_ccw ccw; | ||
142 | } ipl_info; | ||
143 | } __attribute__((packed)); | ||
144 | |||
145 | #define IPL_PARM_BLK_FCP_LEN (sizeof(struct ipl_list_hdr) + \ | ||
146 | sizeof(struct ipl_block_fcp)) | ||
147 | |||
148 | #define IPL_PARM_BLK_CCW_LEN (sizeof(struct ipl_list_hdr) + \ | ||
149 | sizeof(struct ipl_block_ccw)) | ||
150 | |||
151 | #define IPL_MAX_SUPPORTED_VERSION (0) | ||
152 | |||
153 | /* | ||
154 | * IPL validity flags and parameters as detected in head.S | ||
155 | */ | ||
156 | extern u32 ipl_flags; | ||
157 | extern u16 ipl_devno; | ||
158 | |||
159 | extern void do_reipl(void); | ||
160 | extern void ipl_save_parameters(void); | ||
161 | |||
162 | enum { | ||
163 | IPL_DEVNO_VALID = 1, | ||
164 | IPL_PARMBLOCK_VALID = 2, | ||
165 | IPL_NSS_VALID = 4, | ||
166 | }; | ||
167 | |||
168 | #define NSS_NAME_SIZE 8 | 99 | #define NSS_NAME_SIZE 8 |
169 | |||
170 | extern char kernel_nss_name[]; | 100 | extern char kernel_nss_name[]; |
171 | 101 | ||
172 | #define IPL_PARMBLOCK_START ((struct ipl_parameter_block *) \ | ||
173 | IPL_PARMBLOCK_ORIGIN) | ||
174 | #define IPL_PARMBLOCK_SIZE (IPL_PARMBLOCK_START->hdr.len) | ||
175 | |||
176 | #else /* __ASSEMBLY__ */ | 102 | #else /* __ASSEMBLY__ */ |
177 | 103 | ||
178 | #ifndef __s390x__ | 104 | #ifndef __s390x__ |
diff --git a/include/asm-x86_64/hw_irq.h b/include/asm-x86_64/hw_irq.h index 552df5f10a6d..2e4b7a5ed1c4 100644 --- a/include/asm-x86_64/hw_irq.h +++ b/include/asm-x86_64/hw_irq.h | |||
@@ -32,9 +32,30 @@ | |||
32 | #define IA32_SYSCALL_VECTOR 0x80 | 32 | #define IA32_SYSCALL_VECTOR 0x80 |
33 | 33 | ||
34 | 34 | ||
35 | /* Reserve the lowest usable priority level 0x20 - 0x2f for triggering | ||
36 | * cleanup after irq migration. | ||
37 | */ | ||
38 | #define IRQ_MOVE_CLEANUP_VECTOR FIRST_EXTERNAL_VECTOR | ||
39 | |||
35 | /* | 40 | /* |
36 | * Vectors 0x20-0x2f are used for ISA interrupts. | 41 | * Vectors 0x20-0x2f are used for ISA interrupts. |
37 | */ | 42 | */ |
43 | #define IRQ0_VECTOR FIRST_EXTERNAL_VECTOR + 0x10 | ||
44 | #define IRQ1_VECTOR IRQ0_VECTOR + 1 | ||
45 | #define IRQ2_VECTOR IRQ0_VECTOR + 2 | ||
46 | #define IRQ3_VECTOR IRQ0_VECTOR + 3 | ||
47 | #define IRQ4_VECTOR IRQ0_VECTOR + 4 | ||
48 | #define IRQ5_VECTOR IRQ0_VECTOR + 5 | ||
49 | #define IRQ6_VECTOR IRQ0_VECTOR + 6 | ||
50 | #define IRQ7_VECTOR IRQ0_VECTOR + 7 | ||
51 | #define IRQ8_VECTOR IRQ0_VECTOR + 8 | ||
52 | #define IRQ9_VECTOR IRQ0_VECTOR + 9 | ||
53 | #define IRQ10_VECTOR IRQ0_VECTOR + 10 | ||
54 | #define IRQ11_VECTOR IRQ0_VECTOR + 11 | ||
55 | #define IRQ12_VECTOR IRQ0_VECTOR + 12 | ||
56 | #define IRQ13_VECTOR IRQ0_VECTOR + 13 | ||
57 | #define IRQ14_VECTOR IRQ0_VECTOR + 14 | ||
58 | #define IRQ15_VECTOR IRQ0_VECTOR + 15 | ||
38 | 59 | ||
39 | /* | 60 | /* |
40 | * Special IRQ vectors used by the SMP architecture, 0xf0-0xff | 61 | * Special IRQ vectors used by the SMP architecture, 0xf0-0xff |
@@ -66,10 +87,10 @@ | |||
66 | 87 | ||
67 | /* | 88 | /* |
68 | * First APIC vector available to drivers: (vectors 0x30-0xee) | 89 | * First APIC vector available to drivers: (vectors 0x30-0xee) |
69 | * we start at 0x31 to spread out vectors evenly between priority | 90 | * we start at 0x41 to spread out vectors evenly between priority |
70 | * levels. (0x80 is the syscall vector) | 91 | * levels. (0x80 is the syscall vector) |
71 | */ | 92 | */ |
72 | #define FIRST_DEVICE_VECTOR 0x31 | 93 | #define FIRST_DEVICE_VECTOR (IRQ15_VECTOR + 2) |
73 | #define FIRST_SYSTEM_VECTOR 0xef /* duplicated in irq.h */ | 94 | #define FIRST_SYSTEM_VECTOR 0xef /* duplicated in irq.h */ |
74 | 95 | ||
75 | 96 | ||
diff --git a/include/asm-x86_64/msr.h b/include/asm-x86_64/msr.h index 3227bc93d69b..902f9a58617e 100644 --- a/include/asm-x86_64/msr.h +++ b/include/asm-x86_64/msr.h | |||
@@ -160,6 +160,19 @@ static inline unsigned int cpuid_edx(unsigned int op) | |||
160 | #define MSR_IA32_UCODE_WRITE 0x79 | 160 | #define MSR_IA32_UCODE_WRITE 0x79 |
161 | #define MSR_IA32_UCODE_REV 0x8b | 161 | #define MSR_IA32_UCODE_REV 0x8b |
162 | 162 | ||
163 | #ifdef CONFIG_SMP | ||
164 | void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h); | ||
165 | void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h); | ||
166 | #else /* CONFIG_SMP */ | ||
167 | static inline void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h) | ||
168 | { | ||
169 | rdmsr(msr_no, *l, *h); | ||
170 | } | ||
171 | static inline void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h) | ||
172 | { | ||
173 | wrmsr(msr_no, l, h); | ||
174 | } | ||
175 | #endif /* CONFIG_SMP */ | ||
163 | 176 | ||
164 | #endif | 177 | #endif |
165 | 178 | ||
diff --git a/include/linux/device.h b/include/linux/device.h index d1a3a27c3988..39a3199a826d 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -294,8 +294,6 @@ extern void class_device_initialize(struct class_device *); | |||
294 | extern int __must_check class_device_add(struct class_device *); | 294 | extern int __must_check class_device_add(struct class_device *); |
295 | extern void class_device_del(struct class_device *); | 295 | extern void class_device_del(struct class_device *); |
296 | 296 | ||
297 | extern int class_device_rename(struct class_device *, char *); | ||
298 | |||
299 | extern struct class_device * class_device_get(struct class_device *); | 297 | extern struct class_device * class_device_get(struct class_device *); |
300 | extern void class_device_put(struct class_device *); | 298 | extern void class_device_put(struct class_device *); |
301 | 299 | ||
diff --git a/include/linux/irq.h b/include/linux/irq.h index aa5b3e6178a0..b0a44b8e0281 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -200,17 +200,6 @@ extern int setup_irq(unsigned int irq, struct irqaction *new); | |||
200 | #endif | 200 | #endif |
201 | 201 | ||
202 | #ifdef CONFIG_SMP | 202 | #ifdef CONFIG_SMP |
203 | static inline void set_native_irq_info(int irq, cpumask_t mask) | ||
204 | { | ||
205 | irq_desc[irq].affinity = mask; | ||
206 | } | ||
207 | #else | ||
208 | static inline void set_native_irq_info(int irq, cpumask_t mask) | ||
209 | { | ||
210 | } | ||
211 | #endif | ||
212 | |||
213 | #ifdef CONFIG_SMP | ||
214 | 203 | ||
215 | #if defined(CONFIG_GENERIC_PENDING_IRQ) || defined(CONFIG_IRQBALANCE) | 204 | #if defined(CONFIG_GENERIC_PENDING_IRQ) || defined(CONFIG_IRQBALANCE) |
216 | 205 | ||
diff --git a/include/linux/kmod.h b/include/linux/kmod.h index cc8e674ae27a..10f505c8431d 100644 --- a/include/linux/kmod.h +++ b/include/linux/kmod.h | |||
@@ -28,10 +28,8 @@ | |||
28 | #ifdef CONFIG_KMOD | 28 | #ifdef CONFIG_KMOD |
29 | /* modprobe exit status on success, -ve on error. Return value | 29 | /* modprobe exit status on success, -ve on error. Return value |
30 | * usually useless though. */ | 30 | * usually useless though. */ |
31 | extern void kmod_sysfs_init(void); | ||
32 | extern int request_module(const char * name, ...) __attribute__ ((format (printf, 1, 2))); | 31 | extern int request_module(const char * name, ...) __attribute__ ((format (printf, 1, 2))); |
33 | #else | 32 | #else |
34 | static inline void kmod_sysfs_init(void) {}; | ||
35 | static inline int request_module(const char * name, ...) { return -ENOSYS; } | 33 | static inline int request_module(const char * name, ...) { return -ENOSYS; } |
36 | #endif | 34 | #endif |
37 | 35 | ||
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index e0c393cc7240..e96b2dee10bb 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
@@ -320,4 +320,16 @@ struct eisa_device_id { | |||
320 | 320 | ||
321 | #define EISA_DEVICE_MODALIAS_FMT "eisa:s%s" | 321 | #define EISA_DEVICE_MODALIAS_FMT "eisa:s%s" |
322 | 322 | ||
323 | struct parisc_device_id { | ||
324 | __u8 hw_type; /* 5 bits used */ | ||
325 | __u8 hversion_rev; /* 4 bits */ | ||
326 | __u16 hversion; /* 12 bits */ | ||
327 | __u32 sversion; /* 20 bits */ | ||
328 | }; | ||
329 | |||
330 | #define PA_HWTYPE_ANY_ID 0xff | ||
331 | #define PA_HVERSION_REV_ANY_ID 0xff | ||
332 | #define PA_HVERSION_ANY_ID 0xffff | ||
333 | #define PA_SVERSION_ANY_ID 0xffffffff | ||
334 | |||
323 | #endif /* LINUX_MOD_DEVICETABLE_H */ | 335 | #endif /* LINUX_MOD_DEVICETABLE_H */ |
diff --git a/include/linux/pm.h b/include/linux/pm.h index 070394e846d0..21db05ac7c0b 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -120,15 +120,48 @@ typedef int __bitwise suspend_disk_method_t; | |||
120 | #define PM_DISK_TESTPROC ((__force suspend_disk_method_t) 6) | 120 | #define PM_DISK_TESTPROC ((__force suspend_disk_method_t) 6) |
121 | #define PM_DISK_MAX ((__force suspend_disk_method_t) 7) | 121 | #define PM_DISK_MAX ((__force suspend_disk_method_t) 7) |
122 | 122 | ||
123 | /** | ||
124 | * struct pm_ops - Callbacks for managing platform dependent suspend states. | ||
125 | * @valid: Callback to determine whether the given state can be entered. | ||
126 | * If %CONFIG_SOFTWARE_SUSPEND is set then %PM_SUSPEND_DISK is | ||
127 | * always valid and never passed to this call. | ||
128 | * If not assigned, all suspend states are advertised as valid | ||
129 | * in /sys/power/state (but can still be rejected by prepare or enter.) | ||
130 | * | ||
131 | * @prepare: Prepare the platform for the given suspend state. Can return a | ||
132 | * negative error code if necessary. | ||
133 | * | ||
134 | * @enter: Enter the given suspend state, must be assigned. Can return a | ||
135 | * negative error code if necessary. | ||
136 | * | ||
137 | * @finish: Called when the system has left the given state and all devices | ||
138 | * are resumed. The return value is ignored. | ||
139 | * | ||
140 | * @pm_disk_mode: Set to the disk method that the user should be able to | ||
141 | * configure for suspend-to-disk. Since %PM_DISK_SHUTDOWN, | ||
142 | * %PM_DISK_REBOOT, %PM_DISK_TEST and %PM_DISK_TESTPROC | ||
143 | * are always allowed, currently only %PM_DISK_PLATFORM | ||
144 | * makes sense. If the user then choses %PM_DISK_PLATFORM, | ||
145 | * the @prepare call will be called before suspending to disk | ||
146 | * (if present), the @enter call should be present and will | ||
147 | * be called after all state has been saved and the machine | ||
148 | * is ready to be shut down/suspended/..., and the @finish | ||
149 | * callback is called after state has been restored. All | ||
150 | * these calls are called with %PM_SUSPEND_DISK as the state. | ||
151 | */ | ||
123 | struct pm_ops { | 152 | struct pm_ops { |
124 | suspend_disk_method_t pm_disk_mode; | ||
125 | int (*valid)(suspend_state_t state); | 153 | int (*valid)(suspend_state_t state); |
126 | int (*prepare)(suspend_state_t state); | 154 | int (*prepare)(suspend_state_t state); |
127 | int (*enter)(suspend_state_t state); | 155 | int (*enter)(suspend_state_t state); |
128 | int (*finish)(suspend_state_t state); | 156 | int (*finish)(suspend_state_t state); |
157 | suspend_disk_method_t pm_disk_mode; | ||
129 | }; | 158 | }; |
130 | 159 | ||
131 | extern void pm_set_ops(struct pm_ops *); | 160 | /** |
161 | * pm_set_ops - set platform dependent power management ops | ||
162 | * @pm_ops: The new power management operations to set. | ||
163 | */ | ||
164 | extern void pm_set_ops(struct pm_ops *pm_ops); | ||
132 | extern struct pm_ops *pm_ops; | 165 | extern struct pm_ops *pm_ops; |
133 | extern int pm_suspend(suspend_state_t state); | 166 | extern int pm_suspend(suspend_state_t state); |
134 | 167 | ||
diff --git a/include/linux/sched.h b/include/linux/sched.h index 5053dc01fad4..6f7c9a4d80e5 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1329,6 +1329,7 @@ extern int kill_pid_info(int sig, struct siginfo *info, struct pid *pid); | |||
1329 | extern int kill_pid_info_as_uid(int, struct siginfo *, struct pid *, uid_t, uid_t, u32); | 1329 | extern int kill_pid_info_as_uid(int, struct siginfo *, struct pid *, uid_t, uid_t, u32); |
1330 | extern int kill_pgrp(struct pid *pid, int sig, int priv); | 1330 | extern int kill_pgrp(struct pid *pid, int sig, int priv); |
1331 | extern int kill_pid(struct pid *pid, int sig, int priv); | 1331 | extern int kill_pid(struct pid *pid, int sig, int priv); |
1332 | extern int kill_proc_info(int, struct siginfo *, pid_t); | ||
1332 | extern void do_notify_parent(struct task_struct *, int); | 1333 | extern void do_notify_parent(struct task_struct *, int); |
1333 | extern void force_sig(int, struct task_struct *); | 1334 | extern void force_sig(int, struct task_struct *); |
1334 | extern void force_sig_specific(int, struct task_struct *); | 1335 | extern void force_sig_specific(int, struct task_struct *); |
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 192de3afa96b..21805b500aa2 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
@@ -17,6 +17,7 @@ | |||
17 | struct kobject; | 17 | struct kobject; |
18 | struct module; | 18 | struct module; |
19 | struct nameidata; | 19 | struct nameidata; |
20 | struct dentry; | ||
20 | 21 | ||
21 | struct attribute { | 22 | struct attribute { |
22 | const char * name; | 23 | const char * name; |
@@ -68,18 +69,6 @@ struct sysfs_ops { | |||
68 | ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t); | 69 | ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t); |
69 | }; | 70 | }; |
70 | 71 | ||
71 | struct sysfs_dirent { | ||
72 | atomic_t s_count; | ||
73 | struct list_head s_sibling; | ||
74 | struct list_head s_children; | ||
75 | void * s_element; | ||
76 | int s_type; | ||
77 | umode_t s_mode; | ||
78 | struct dentry * s_dentry; | ||
79 | struct iattr * s_iattr; | ||
80 | atomic_t s_event; | ||
81 | }; | ||
82 | |||
83 | #define SYSFS_ROOT 0x0001 | 72 | #define SYSFS_ROOT 0x0001 |
84 | #define SYSFS_DIR 0x0002 | 73 | #define SYSFS_DIR 0x0002 |
85 | #define SYSFS_KOBJ_ATTR 0x0004 | 74 | #define SYSFS_KOBJ_ATTR 0x0004 |
@@ -126,6 +115,11 @@ void sysfs_remove_bin_file(struct kobject *kobj, struct bin_attribute *attr); | |||
126 | int __must_check sysfs_create_group(struct kobject *, | 115 | int __must_check sysfs_create_group(struct kobject *, |
127 | const struct attribute_group *); | 116 | const struct attribute_group *); |
128 | void sysfs_remove_group(struct kobject *, const struct attribute_group *); | 117 | void sysfs_remove_group(struct kobject *, const struct attribute_group *); |
118 | int sysfs_add_file_to_group(struct kobject *kobj, | ||
119 | const struct attribute *attr, const char *group); | ||
120 | void sysfs_remove_file_from_group(struct kobject *kobj, | ||
121 | const struct attribute *attr, const char *group); | ||
122 | |||
129 | void sysfs_notify(struct kobject * k, char *dir, char *attr); | 123 | void sysfs_notify(struct kobject * k, char *dir, char *attr); |
130 | 124 | ||
131 | 125 | ||
@@ -210,6 +204,18 @@ static inline void sysfs_remove_group(struct kobject * k, const struct attribute | |||
210 | ; | 204 | ; |
211 | } | 205 | } |
212 | 206 | ||
207 | static inline int sysfs_add_file_to_group(struct kobject *kobj, | ||
208 | const struct attribute *attr, const char *group) | ||
209 | { | ||
210 | return 0; | ||
211 | } | ||
212 | |||
213 | static inline void sysfs_remove_file_from_group(struct kobject *kobj, | ||
214 | const struct attribute *attr, const char *group); | ||
215 | { | ||
216 | ; | ||
217 | } | ||
218 | |||
213 | static inline void sysfs_notify(struct kobject * k, char *dir, char *attr) | 219 | static inline void sysfs_notify(struct kobject * k, char *dir, char *attr) |
214 | { | 220 | { |
215 | } | 221 | } |
diff --git a/include/linux/usb.h b/include/linux/usb.h index a8e8d1ecebb1..87dc75a6cee1 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -388,10 +388,14 @@ struct usb_device { | |||
388 | struct usb_device *children[USB_MAXCHILDREN]; | 388 | struct usb_device *children[USB_MAXCHILDREN]; |
389 | 389 | ||
390 | int pm_usage_cnt; /* usage counter for autosuspend */ | 390 | int pm_usage_cnt; /* usage counter for autosuspend */ |
391 | u32 quirks; /* quirks of the whole device */ | ||
392 | |||
391 | #ifdef CONFIG_PM | 393 | #ifdef CONFIG_PM |
392 | struct delayed_work autosuspend; /* for delayed autosuspends */ | 394 | struct delayed_work autosuspend; /* for delayed autosuspends */ |
393 | struct mutex pm_mutex; /* protects PM operations */ | 395 | struct mutex pm_mutex; /* protects PM operations */ |
394 | 396 | ||
397 | unsigned autosuspend_delay; /* in jiffies */ | ||
398 | |||
395 | unsigned auto_pm:1; /* autosuspend/resume in progress */ | 399 | unsigned auto_pm:1; /* autosuspend/resume in progress */ |
396 | unsigned do_remote_wakeup:1; /* remote wakeup should be enabled */ | 400 | unsigned do_remote_wakeup:1; /* remote wakeup should be enabled */ |
397 | #endif | 401 | #endif |
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h index 245c72531228..1122a6c2c1a3 100644 --- a/include/linux/usb/ch9.h +++ b/include/linux/usb/ch9.h | |||
@@ -1,8 +1,9 @@ | |||
1 | /* | 1 | /* |
2 | * This file holds USB constants and structures that are needed for USB | 2 | * This file holds USB constants and structures that are needed for |
3 | * device APIs. These are used by the USB device model, which is defined | 3 | * USB device APIs. These are used by the USB device model, which is |
4 | * in chapter 9 of the USB 2.0 specification. Linux has several APIs in C | 4 | * defined in chapter 9 of the USB 2.0 specification and in the |
5 | * that need these: | 5 | * Wireless USB 1.0 (spread around). Linux has several APIs in C that |
6 | * need these: | ||
6 | * | 7 | * |
7 | * - the master/host side Linux-USB kernel driver API; | 8 | * - the master/host side Linux-USB kernel driver API; |
8 | * - the "usbfs" user space API; and | 9 | * - the "usbfs" user space API; and |
@@ -14,6 +15,19 @@ | |||
14 | * | 15 | * |
15 | * There's also "Wireless USB", using low power short range radios for | 16 | * There's also "Wireless USB", using low power short range radios for |
16 | * peripheral interconnection but otherwise building on the USB framework. | 17 | * peripheral interconnection but otherwise building on the USB framework. |
18 | * | ||
19 | * Note all descriptors are declared '__attribute__((packed))' so that: | ||
20 | * | ||
21 | * [a] they never get padded, either internally (USB spec writers | ||
22 | * probably handled that) or externally; | ||
23 | * | ||
24 | * [b] so that accessing bigger-than-a-bytes fields will never | ||
25 | * generate bus errors on any platform, even when the location of | ||
26 | * its descriptor inside a bundle isn't "naturally aligned", and | ||
27 | * | ||
28 | * [c] for consistency, removing all doubt even when it appears to | ||
29 | * someone that the two other points are non-issues for that | ||
30 | * particular descriptor type. | ||
17 | */ | 31 | */ |
18 | 32 | ||
19 | #ifndef __LINUX_USB_CH9_H | 33 | #ifndef __LINUX_USB_CH9_H |
diff --git a/include/linux/usb/iowarrior.h b/include/linux/usb/iowarrior.h new file mode 100644 index 000000000000..cbbe020a4f5c --- /dev/null +++ b/include/linux/usb/iowarrior.h | |||
@@ -0,0 +1,33 @@ | |||
1 | #ifndef _IOWARRIOR_H_ | ||
2 | #define _IOWARRIOR_H_ | ||
3 | |||
4 | #define CODEMERCS_MAGIC_NUMBER 0xC0 /* like COde Mercenaries */ | ||
5 | |||
6 | /* Define the ioctl commands for reading and writing data */ | ||
7 | #define IOW_WRITE _IOW(CODEMERCS_MAGIC_NUMBER, 1, __u8 *) | ||
8 | #define IOW_READ _IOW(CODEMERCS_MAGIC_NUMBER, 2, __u8 *) | ||
9 | |||
10 | /* | ||
11 | A struct for available device info which is read | ||
12 | with the ioctl IOW_GETINFO. | ||
13 | To be compatible with 2.4 userspace which didn't have an easy way to get | ||
14 | this information. | ||
15 | */ | ||
16 | struct iowarrior_info { | ||
17 | __u32 vendor; /* vendor id : supposed to be USB_VENDOR_ID_CODEMERCS in all cases */ | ||
18 | __u32 product; /* product id : depends on type of chip (USB_DEVICE_ID_CODEMERCS_XXXXX) */ | ||
19 | __u8 serial[9]; /* the serial number of our chip (if a serial-number is not available this is empty string) */ | ||
20 | __u32 revision; /* revision number of the chip */ | ||
21 | __u32 speed; /* USB-speed of the device (0=UNKNOWN, 1=LOW, 2=FULL 3=HIGH) */ | ||
22 | __u32 power; /* power consumption of the device in mA */ | ||
23 | __u32 if_num; /* the number of the endpoint */ | ||
24 | __u32 report_size; /* size of the data-packets on this interface */ | ||
25 | }; | ||
26 | |||
27 | /* | ||
28 | Get some device-information (product-id , serial-number etc.) | ||
29 | in order to identify a chip. | ||
30 | */ | ||
31 | #define IOW_GETINFO _IOR(CODEMERCS_MAGIC_NUMBER, 3, struct iowarrior_info) | ||
32 | |||
33 | #endif /* _IOWARRIOR_H_ */ | ||
diff --git a/include/linux/usb/quirks.h b/include/linux/usb/quirks.h new file mode 100644 index 000000000000..6bac8faacbc6 --- /dev/null +++ b/include/linux/usb/quirks.h | |||
@@ -0,0 +1,11 @@ | |||
1 | /* | ||
2 | * This file holds the definitions of quirks found in USB devices. | ||
3 | * Only quirks that affect the whole device, not an interface, | ||
4 | * belong here. | ||
5 | */ | ||
6 | |||
7 | /* device must not be autosuspended */ | ||
8 | #define USB_QUIRK_NO_AUTOSUSPEND 0x00000001 | ||
9 | |||
10 | /* string descriptors must not be fetched using a 255-byte read */ | ||
11 | #define USB_QUIRK_STRING_FETCH_255 0x00000002 | ||
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index d94e2683be52..65a165f918c9 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -1,5 +1,45 @@ | |||
1 | /* | 1 | /* |
2 | * Video for Linux Two | 2 | * Video for Linux Two header file |
3 | * | ||
4 | * Copyright (C) 1999-2007 the contributors | ||
5 | * | ||
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 | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * Alternatively you can redistribute this file under the terms of the | ||
17 | * BSD license as stated below: | ||
18 | * | ||
19 | * Redistribution and use in source and binary forms, with or without | ||
20 | * modification, are permitted provided that the following conditions | ||
21 | * are met: | ||
22 | * 1. Redistributions of source code must retain the above copyright | ||
23 | * notice, this list of conditions and the following disclaimer. | ||
24 | * 2. Redistributions in binary form must reproduce the above copyright | ||
25 | * notice, this list of conditions and the following disclaimer in | ||
26 | * the documentation and/or other materials provided with the | ||
27 | * distribution. | ||
28 | * 3. The names of its contributors may not be used to endorse or promote | ||
29 | * products derived from this software without specific prior written | ||
30 | * permission. | ||
31 | * | ||
32 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
33 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
34 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
35 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
36 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
37 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED | ||
38 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
39 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
40 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
41 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
42 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
3 | * | 43 | * |
4 | * Header file for v4l or V4L2 drivers and applications | 44 | * Header file for v4l or V4L2 drivers and applications |
5 | * with public API. | 45 | * with public API. |
@@ -8,8 +48,9 @@ | |||
8 | * | 48 | * |
9 | * See http://linuxtv.org for more info | 49 | * See http://linuxtv.org for more info |
10 | * | 50 | * |
11 | * Author: Bill Dirks <bdirks@pacbell.net> | 51 | * Author: Bill Dirks <bill@thedirks.org> |
12 | * Justin Schoeman | 52 | * Justin Schoeman |
53 | * Hans Verkuil <hverkuil@xs4all.nl> | ||
13 | * et al. | 54 | * et al. |
14 | */ | 55 | */ |
15 | #ifndef __LINUX_VIDEODEV2_H | 56 | #ifndef __LINUX_VIDEODEV2_H |
@@ -90,11 +131,8 @@ enum v4l2_buf_type { | |||
90 | V4L2_BUF_TYPE_VIDEO_OVERLAY = 3, | 131 | V4L2_BUF_TYPE_VIDEO_OVERLAY = 3, |
91 | V4L2_BUF_TYPE_VBI_CAPTURE = 4, | 132 | V4L2_BUF_TYPE_VBI_CAPTURE = 4, |
92 | V4L2_BUF_TYPE_VBI_OUTPUT = 5, | 133 | V4L2_BUF_TYPE_VBI_OUTPUT = 5, |
93 | #if 1 | ||
94 | /* Experimental Sliced VBI */ | ||
95 | V4L2_BUF_TYPE_SLICED_VBI_CAPTURE = 6, | 134 | V4L2_BUF_TYPE_SLICED_VBI_CAPTURE = 6, |
96 | V4L2_BUF_TYPE_SLICED_VBI_OUTPUT = 7, | 135 | V4L2_BUF_TYPE_SLICED_VBI_OUTPUT = 7, |
97 | #endif | ||
98 | V4L2_BUF_TYPE_PRIVATE = 0x80, | 136 | V4L2_BUF_TYPE_PRIVATE = 0x80, |
99 | }; | 137 | }; |
100 | 138 | ||
@@ -186,10 +224,8 @@ struct v4l2_capability | |||
186 | #define V4L2_CAP_VIDEO_OVERLAY 0x00000004 /* Can do video overlay */ | 224 | #define V4L2_CAP_VIDEO_OVERLAY 0x00000004 /* Can do video overlay */ |
187 | #define V4L2_CAP_VBI_CAPTURE 0x00000010 /* Is a raw VBI capture device */ | 225 | #define V4L2_CAP_VBI_CAPTURE 0x00000010 /* Is a raw VBI capture device */ |
188 | #define V4L2_CAP_VBI_OUTPUT 0x00000020 /* Is a raw VBI output device */ | 226 | #define V4L2_CAP_VBI_OUTPUT 0x00000020 /* Is a raw VBI output device */ |
189 | #if 1 | ||
190 | #define V4L2_CAP_SLICED_VBI_CAPTURE 0x00000040 /* Is a sliced VBI capture device */ | 227 | #define V4L2_CAP_SLICED_VBI_CAPTURE 0x00000040 /* Is a sliced VBI capture device */ |
191 | #define V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080 /* Is a sliced VBI output device */ | 228 | #define V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080 /* Is a sliced VBI output device */ |
192 | #endif | ||
193 | #define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */ | 229 | #define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */ |
194 | 230 | ||
195 | #define V4L2_CAP_TUNER 0x00010000 /* has a tuner */ | 231 | #define V4L2_CAP_TUNER 0x00010000 /* has a tuner */ |
@@ -1179,7 +1215,6 @@ struct v4l2_vbi_format | |||
1179 | #define V4L2_VBI_UNSYNC (1<< 0) | 1215 | #define V4L2_VBI_UNSYNC (1<< 0) |
1180 | #define V4L2_VBI_INTERLACED (1<< 1) | 1216 | #define V4L2_VBI_INTERLACED (1<< 1) |
1181 | 1217 | ||
1182 | #if 1 | ||
1183 | /* Sliced VBI | 1218 | /* Sliced VBI |
1184 | * | 1219 | * |
1185 | * This implements is a proposal V4L2 API to allow SLICED VBI | 1220 | * This implements is a proposal V4L2 API to allow SLICED VBI |
@@ -1212,7 +1247,6 @@ struct v4l2_sliced_vbi_format | |||
1212 | #define V4L2_SLICED_VBI_525 (V4L2_SLICED_CAPTION_525) | 1247 | #define V4L2_SLICED_VBI_525 (V4L2_SLICED_CAPTION_525) |
1213 | #define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_B | V4L2_SLICED_VPS | V4L2_SLICED_WSS_625) | 1248 | #define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_B | V4L2_SLICED_VPS | V4L2_SLICED_WSS_625) |
1214 | 1249 | ||
1215 | |||
1216 | struct v4l2_sliced_vbi_cap | 1250 | struct v4l2_sliced_vbi_cap |
1217 | { | 1251 | { |
1218 | __u16 service_set; | 1252 | __u16 service_set; |
@@ -1233,7 +1267,6 @@ struct v4l2_sliced_vbi_data | |||
1233 | __u32 reserved; /* must be 0 */ | 1267 | __u32 reserved; /* must be 0 */ |
1234 | __u8 data[48]; | 1268 | __u8 data[48]; |
1235 | }; | 1269 | }; |
1236 | #endif | ||
1237 | 1270 | ||
1238 | /* | 1271 | /* |
1239 | * A G G R E G A T E S T R U C T U R E S | 1272 | * A G G R E G A T E S T R U C T U R E S |
@@ -1249,9 +1282,7 @@ struct v4l2_format | |||
1249 | struct v4l2_pix_format pix; // V4L2_BUF_TYPE_VIDEO_CAPTURE | 1282 | struct v4l2_pix_format pix; // V4L2_BUF_TYPE_VIDEO_CAPTURE |
1250 | struct v4l2_window win; // V4L2_BUF_TYPE_VIDEO_OVERLAY | 1283 | struct v4l2_window win; // V4L2_BUF_TYPE_VIDEO_OVERLAY |
1251 | struct v4l2_vbi_format vbi; // V4L2_BUF_TYPE_VBI_CAPTURE | 1284 | struct v4l2_vbi_format vbi; // V4L2_BUF_TYPE_VBI_CAPTURE |
1252 | #if 1 | ||
1253 | struct v4l2_sliced_vbi_format sliced; // V4L2_BUF_TYPE_SLICED_VBI_CAPTURE | 1285 | struct v4l2_sliced_vbi_format sliced; // V4L2_BUF_TYPE_SLICED_VBI_CAPTURE |
1254 | #endif | ||
1255 | __u8 raw_data[200]; // user-defined | 1286 | __u8 raw_data[200]; // user-defined |
1256 | } fmt; | 1287 | } fmt; |
1257 | }; | 1288 | }; |
@@ -1271,6 +1302,17 @@ struct v4l2_streamparm | |||
1271 | }; | 1302 | }; |
1272 | 1303 | ||
1273 | /* | 1304 | /* |
1305 | * A D V A N C E D D E B U G G I N G | ||
1306 | */ | ||
1307 | |||
1308 | /* VIDIOC_DBG_G_REGISTER and VIDIOC_DBG_S_REGISTER */ | ||
1309 | struct v4l2_register { | ||
1310 | __u64 reg; | ||
1311 | __u32 i2c_id; /* I2C driver ID of the I2C chip, or 0 for the host */ | ||
1312 | __u32 val; | ||
1313 | }; | ||
1314 | |||
1315 | /* | ||
1274 | * I O C T L C O D E S F O R V I D E O D E V I C E S | 1316 | * I O C T L C O D E S F O R V I D E O D E V I C E S |
1275 | * | 1317 | * |
1276 | */ | 1318 | */ |
@@ -1328,9 +1370,7 @@ struct v4l2_streamparm | |||
1328 | #define VIDIOC_ENUMAUDOUT _IOWR ('V', 66, struct v4l2_audioout) | 1370 | #define VIDIOC_ENUMAUDOUT _IOWR ('V', 66, struct v4l2_audioout) |
1329 | #define VIDIOC_G_PRIORITY _IOR ('V', 67, enum v4l2_priority) | 1371 | #define VIDIOC_G_PRIORITY _IOR ('V', 67, enum v4l2_priority) |
1330 | #define VIDIOC_S_PRIORITY _IOW ('V', 68, enum v4l2_priority) | 1372 | #define VIDIOC_S_PRIORITY _IOW ('V', 68, enum v4l2_priority) |
1331 | #if 1 | ||
1332 | #define VIDIOC_G_SLICED_VBI_CAP _IOWR ('V', 69, struct v4l2_sliced_vbi_cap) | 1373 | #define VIDIOC_G_SLICED_VBI_CAP _IOWR ('V', 69, struct v4l2_sliced_vbi_cap) |
1333 | #endif | ||
1334 | #define VIDIOC_LOG_STATUS _IO ('V', 70) | 1374 | #define VIDIOC_LOG_STATUS _IO ('V', 70) |
1335 | #define VIDIOC_G_EXT_CTRLS _IOWR ('V', 71, struct v4l2_ext_controls) | 1375 | #define VIDIOC_G_EXT_CTRLS _IOWR ('V', 71, struct v4l2_ext_controls) |
1336 | #define VIDIOC_S_EXT_CTRLS _IOWR ('V', 72, struct v4l2_ext_controls) | 1376 | #define VIDIOC_S_EXT_CTRLS _IOWR ('V', 72, struct v4l2_ext_controls) |
@@ -1339,6 +1379,9 @@ struct v4l2_streamparm | |||
1339 | #define VIDIOC_ENUM_FRAMESIZES _IOWR ('V', 74, struct v4l2_frmsizeenum) | 1379 | #define VIDIOC_ENUM_FRAMESIZES _IOWR ('V', 74, struct v4l2_frmsizeenum) |
1340 | #define VIDIOC_ENUM_FRAMEINTERVALS _IOWR ('V', 75, struct v4l2_frmivalenum) | 1380 | #define VIDIOC_ENUM_FRAMEINTERVALS _IOWR ('V', 75, struct v4l2_frmivalenum) |
1341 | #endif | 1381 | #endif |
1382 | /* only implemented if CONFIG_VIDEO_ADV_DEBUG is defined */ | ||
1383 | #define VIDIOC_DBG_S_REGISTER _IOW ('d', 100, struct v4l2_register) | ||
1384 | #define VIDIOC_DBG_G_REGISTER _IOWR('d', 101, struct v4l2_register) | ||
1342 | 1385 | ||
1343 | #ifdef __OLD_VIDIOC_ | 1386 | #ifdef __OLD_VIDIOC_ |
1344 | /* for compatibility, will go away some day */ | 1387 | /* for compatibility, will go away some day */ |
diff --git a/include/media/cx2341x.h b/include/media/cx2341x.h index ecad55bf0162..d758a52cf556 100644 --- a/include/media/cx2341x.h +++ b/include/media/cx2341x.h | |||
@@ -57,7 +57,6 @@ struct cx2341x_mpeg_params { | |||
57 | u16 video_b_frames; | 57 | u16 video_b_frames; |
58 | u16 video_gop_size; | 58 | u16 video_gop_size; |
59 | u16 video_gop_closure; | 59 | u16 video_gop_closure; |
60 | u16 video_pulldown; | ||
61 | enum v4l2_mpeg_video_bitrate_mode video_bitrate_mode; | 60 | enum v4l2_mpeg_video_bitrate_mode video_bitrate_mode; |
62 | u32 video_bitrate; | 61 | u32 video_bitrate; |
63 | u32 video_bitrate_peak; | 62 | u32 video_bitrate_peak; |
@@ -121,8 +120,6 @@ void cx2341x_log_status(struct cx2341x_mpeg_params *p, const char *prefix); | |||
121 | #define CX2341X_DEC_SET_DISPLAY_BUFFERS 0x18 | 120 | #define CX2341X_DEC_SET_DISPLAY_BUFFERS 0x18 |
122 | #define CX2341X_DEC_EXTRACT_VBI 0x19 | 121 | #define CX2341X_DEC_EXTRACT_VBI 0x19 |
123 | #define CX2341X_DEC_SET_DECODER_SOURCE 0x1a | 122 | #define CX2341X_DEC_SET_DECODER_SOURCE 0x1a |
124 | #define CX2341X_DEC_SET_AUDIO_OUTPUT 0x1b | ||
125 | #define CX2341X_DEC_SET_AV_DELAY 0x1c | ||
126 | #define CX2341X_DEC_SET_PREBUFFERING 0x1e | 123 | #define CX2341X_DEC_SET_PREBUFFERING 0x1e |
127 | 124 | ||
128 | /* MPEG encoder API */ | 125 | /* MPEG encoder API */ |
@@ -141,7 +138,6 @@ void cx2341x_log_status(struct cx2341x_mpeg_params *p, const char *prefix); | |||
141 | #define CX2341X_ENC_SET_DNR_FILTER_PROPS 0x9d | 138 | #define CX2341X_ENC_SET_DNR_FILTER_PROPS 0x9d |
142 | #define CX2341X_ENC_SET_CORING_LEVELS 0x9f | 139 | #define CX2341X_ENC_SET_CORING_LEVELS 0x9f |
143 | #define CX2341X_ENC_SET_SPATIAL_FILTER_TYPE 0xa1 | 140 | #define CX2341X_ENC_SET_SPATIAL_FILTER_TYPE 0xa1 |
144 | #define CX2341X_ENC_SET_3_2_PULLDOWN 0xb1 | ||
145 | #define CX2341X_ENC_SET_VBI_LINE 0xb7 | 141 | #define CX2341X_ENC_SET_VBI_LINE 0xb7 |
146 | #define CX2341X_ENC_SET_STREAM_TYPE 0xb9 | 142 | #define CX2341X_ENC_SET_STREAM_TYPE 0xb9 |
147 | #define CX2341X_ENC_SET_OUTPUT_PORT 0xbb | 143 | #define CX2341X_ENC_SET_OUTPUT_PORT 0xbb |
diff --git a/include/media/ir-common.h b/include/media/ir-common.h index 4bb0ad810179..9807a7c15830 100644 --- a/include/media/ir-common.h +++ b/include/media/ir-common.h | |||
@@ -36,6 +36,11 @@ | |||
36 | #define IR_KEYCODE(tab,code) (((unsigned)code < IR_KEYTAB_SIZE) \ | 36 | #define IR_KEYCODE(tab,code) (((unsigned)code < IR_KEYTAB_SIZE) \ |
37 | ? tab[code] : KEY_RESERVED) | 37 | ? tab[code] : KEY_RESERVED) |
38 | 38 | ||
39 | #define RC5_START(x) (((x)>>12)&3) | ||
40 | #define RC5_TOGGLE(x) (((x)>>11)&1) | ||
41 | #define RC5_ADDR(x) (((x)>>6)&31) | ||
42 | #define RC5_INSTR(x) ((x)&63) | ||
43 | |||
39 | struct ir_input_state { | 44 | struct ir_input_state { |
40 | /* configuration */ | 45 | /* configuration */ |
41 | int ir_type; | 46 | int ir_type; |
@@ -48,6 +53,40 @@ struct ir_input_state { | |||
48 | int keypressed; /* current state */ | 53 | int keypressed; /* current state */ |
49 | }; | 54 | }; |
50 | 55 | ||
56 | /* this was saa7134_ir and bttv_ir, moved here for | ||
57 | * rc5 decoding. */ | ||
58 | struct card_ir { | ||
59 | struct input_dev *dev; | ||
60 | struct ir_input_state ir; | ||
61 | char name[32]; | ||
62 | char phys[32]; | ||
63 | |||
64 | /* Usual gpio signalling */ | ||
65 | |||
66 | u32 mask_keycode; | ||
67 | u32 mask_keydown; | ||
68 | u32 mask_keyup; | ||
69 | u32 polling; | ||
70 | u32 last_gpio; | ||
71 | int shift_by; | ||
72 | int start; // What should RC5_START() be | ||
73 | int addr; // What RC5_ADDR() should be. | ||
74 | int rc5_key_timeout; | ||
75 | int rc5_remote_gap; | ||
76 | struct work_struct work; | ||
77 | struct timer_list timer; | ||
78 | |||
79 | /* RC5 gpio */ | ||
80 | u32 rc5_gpio; | ||
81 | struct timer_list timer_end; /* timer_end for code completion */ | ||
82 | struct timer_list timer_keyup; /* timer_end for key release */ | ||
83 | u32 last_rc5; /* last good rc5 code */ | ||
84 | u32 last_bit; /* last raw bit seen */ | ||
85 | u32 code; /* raw code under construction */ | ||
86 | struct timeval base_time; /* time of last seen code */ | ||
87 | int active; /* building raw code */ | ||
88 | }; | ||
89 | |||
51 | void ir_input_init(struct input_dev *dev, struct ir_input_state *ir, | 90 | void ir_input_init(struct input_dev *dev, struct ir_input_state *ir, |
52 | int ir_type, IR_KEYTAB_TYPE *ir_codes); | 91 | int ir_type, IR_KEYTAB_TYPE *ir_codes); |
53 | void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir); | 92 | void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir); |
@@ -58,6 +97,10 @@ int ir_dump_samples(u32 *samples, int count); | |||
58 | int ir_decode_biphase(u32 *samples, int count, int low, int high); | 97 | int ir_decode_biphase(u32 *samples, int count, int low, int high); |
59 | int ir_decode_pulsedistance(u32 *samples, int count, int low, int high); | 98 | int ir_decode_pulsedistance(u32 *samples, int count, int low, int high); |
60 | 99 | ||
100 | u32 ir_rc5_decode(unsigned int code); | ||
101 | void ir_rc5_timer_end(unsigned long data); | ||
102 | void ir_rc5_timer_keyup(unsigned long data); | ||
103 | |||
61 | /* Keymaps to be used by other modules */ | 104 | /* Keymaps to be used by other modules */ |
62 | 105 | ||
63 | extern IR_KEYTAB_TYPE ir_codes_empty[IR_KEYTAB_SIZE]; | 106 | extern IR_KEYTAB_TYPE ir_codes_empty[IR_KEYTAB_SIZE]; |
@@ -94,6 +137,9 @@ extern IR_KEYTAB_TYPE ir_codes_npgtech[IR_KEYTAB_SIZE]; | |||
94 | extern IR_KEYTAB_TYPE ir_codes_norwood[IR_KEYTAB_SIZE]; | 137 | extern IR_KEYTAB_TYPE ir_codes_norwood[IR_KEYTAB_SIZE]; |
95 | extern IR_KEYTAB_TYPE ir_codes_proteus_2309[IR_KEYTAB_SIZE]; | 138 | extern IR_KEYTAB_TYPE ir_codes_proteus_2309[IR_KEYTAB_SIZE]; |
96 | extern IR_KEYTAB_TYPE ir_codes_budget_ci_old[IR_KEYTAB_SIZE]; | 139 | extern IR_KEYTAB_TYPE ir_codes_budget_ci_old[IR_KEYTAB_SIZE]; |
140 | extern IR_KEYTAB_TYPE ir_codes_asus_pc39[IR_KEYTAB_SIZE]; | ||
141 | extern IR_KEYTAB_TYPE ir_codes_encore_enltv[IR_KEYTAB_SIZE]; | ||
142 | extern IR_KEYTAB_TYPE ir_codes_tt_1500[IR_KEYTAB_SIZE]; | ||
97 | 143 | ||
98 | #endif | 144 | #endif |
99 | 145 | ||
diff --git a/include/media/saa7115.h b/include/media/saa7115.h index 9f0e2285a099..f677dfb9d373 100644 --- a/include/media/saa7115.h +++ b/include/media/saa7115.h | |||
@@ -42,5 +42,8 @@ | |||
42 | #define SAA7115_FREQ_FL_CGCDIV (1 << 1) /* SA 3A[6], CGCDIV, SAA7115 only */ | 42 | #define SAA7115_FREQ_FL_CGCDIV (1 << 1) /* SA 3A[6], CGCDIV, SAA7115 only */ |
43 | #define SAA7115_FREQ_FL_APLL (1 << 2) /* SA 3A[3], APLL, SAA7114/5 only */ | 43 | #define SAA7115_FREQ_FL_APLL (1 << 2) /* SA 3A[3], APLL, SAA7114/5 only */ |
44 | 44 | ||
45 | #define SAA7115_IPORT_ON 1 | ||
46 | #define SAA7115_IPORT_OFF 0 | ||
47 | |||
45 | #endif | 48 | #endif |
46 | 49 | ||
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h index 91b19921f958..244e440edb53 100644 --- a/include/media/v4l2-common.h +++ b/include/media/v4l2-common.h | |||
@@ -64,9 +64,6 @@ | |||
64 | /* Prints the ioctl in a human-readable format */ | 64 | /* Prints the ioctl in a human-readable format */ |
65 | extern void v4l_printk_ioctl(unsigned int cmd); | 65 | extern void v4l_printk_ioctl(unsigned int cmd); |
66 | 66 | ||
67 | /* Prints the ioctl and arg in a human-readable format */ | ||
68 | extern void v4l_printk_ioctl_arg(char *s,unsigned int cmd, void *arg); | ||
69 | |||
70 | /* Use this macro for non-I2C drivers. Pass the driver name as the first arg. */ | 67 | /* Use this macro for non-I2C drivers. Pass the driver name as the first arg. */ |
71 | #define v4l_print_ioctl(name, cmd) \ | 68 | #define v4l_print_ioctl(name, cmd) \ |
72 | do { \ | 69 | do { \ |
@@ -99,13 +96,6 @@ u32 v4l2_ctrl_next(const u32 * const *ctrl_classes, u32 id); | |||
99 | 96 | ||
100 | /* Internal ioctls */ | 97 | /* Internal ioctls */ |
101 | 98 | ||
102 | /* VIDIOC_INT_G_REGISTER and VIDIOC_INT_S_REGISTER */ | ||
103 | struct v4l2_register { | ||
104 | u32 i2c_id; /* I2C driver ID of the I2C chip. 0 for the I2C adapter. */ | ||
105 | unsigned long reg; | ||
106 | u32 val; | ||
107 | }; | ||
108 | |||
109 | /* VIDIOC_INT_DECODE_VBI_LINE */ | 99 | /* VIDIOC_INT_DECODE_VBI_LINE */ |
110 | struct v4l2_decode_vbi_line { | 100 | struct v4l2_decode_vbi_line { |
111 | u32 is_second_field; /* Set to 0 for the first (odd) field, | 101 | u32 is_second_field; /* Set to 0 for the first (odd) field, |
@@ -175,9 +165,7 @@ enum v4l2_chip_ident { | |||
175 | Replacement of TUNER_SET_STANDBY. */ | 165 | Replacement of TUNER_SET_STANDBY. */ |
176 | #define VIDIOC_INT_S_STANDBY _IOW('d', 94, u32) | 166 | #define VIDIOC_INT_S_STANDBY _IOW('d', 94, u32) |
177 | 167 | ||
178 | /* only implemented if CONFIG_VIDEO_ADV_DEBUG is defined */ | 168 | /* 100, 101 used by VIDIOC_DBG_[SG]_REGISTER */ |
179 | #define VIDIOC_INT_S_REGISTER _IOW ('d', 100, struct v4l2_register) | ||
180 | #define VIDIOC_INT_G_REGISTER _IOWR('d', 101, struct v4l2_register) | ||
181 | 169 | ||
182 | /* Generic reset command. The argument selects which subsystems to reset. | 170 | /* Generic reset command. The argument selects which subsystems to reset. |
183 | Passing 0 will always reset the whole chip. */ | 171 | Passing 0 will always reset the whole chip. */ |
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h index fb96472a1bd3..aeec56992ef5 100644 --- a/include/media/v4l2-dev.h +++ b/include/media/v4l2-dev.h | |||
@@ -296,6 +296,15 @@ struct video_device | |||
296 | int (*vidioc_log_status) (struct file *file, void *fh); | 296 | int (*vidioc_log_status) (struct file *file, void *fh); |
297 | 297 | ||
298 | 298 | ||
299 | /* Debugging ioctls */ | ||
300 | #ifdef CONFIG_VIDEO_ADV_DEBUG | ||
301 | int (*vidioc_g_register) (struct file *file, void *fh, | ||
302 | struct v4l2_register *reg); | ||
303 | int (*vidioc_s_register) (struct file *file, void *fh, | ||
304 | struct v4l2_register *reg); | ||
305 | #endif | ||
306 | |||
307 | |||
299 | #ifdef OBSOLETE_OWNER /* to be removed soon */ | 308 | #ifdef OBSOLETE_OWNER /* to be removed soon */ |
300 | /* obsolete -- fops->owner is used instead */ | 309 | /* obsolete -- fops->owner is used instead */ |
301 | struct module *owner; | 310 | struct module *owner; |
diff --git a/include/media/video-buf.h b/include/media/video-buf.h index 1115a256969f..d6f079476db3 100644 --- a/include/media/video-buf.h +++ b/include/media/video-buf.h | |||
@@ -78,6 +78,9 @@ struct videobuf_dmabuf { | |||
78 | /* for kernel buffers */ | 78 | /* for kernel buffers */ |
79 | void *vmalloc; | 79 | void *vmalloc; |
80 | 80 | ||
81 | /* Stores the userspace pointer to vmalloc area */ | ||
82 | void *varea; | ||
83 | |||
81 | /* for overlay buffers (pci-pci dma) */ | 84 | /* for overlay buffers (pci-pci dma) */ |
82 | dma_addr_t bus_addr; | 85 | dma_addr_t bus_addr; |
83 | 86 | ||
diff --git a/include/net/irda/irda.h b/include/net/irda/irda.h index 1cb0607fcbb9..89fe534045f1 100644 --- a/include/net/irda/irda.h +++ b/include/net/irda/irda.h | |||
@@ -113,4 +113,20 @@ do { if(!(expr)) { \ | |||
113 | #define IAS_IRCOMM_ID 0x2343 | 113 | #define IAS_IRCOMM_ID 0x2343 |
114 | #define IAS_IRLPT_ID 0x9876 | 114 | #define IAS_IRLPT_ID 0x9876 |
115 | 115 | ||
116 | struct net_device; | ||
117 | struct packet_type; | ||
118 | |||
119 | extern void irda_proc_register(void); | ||
120 | extern void irda_proc_unregister(void); | ||
121 | |||
122 | extern int irda_sysctl_register(void); | ||
123 | extern void irda_sysctl_unregister(void); | ||
124 | |||
125 | extern int irsock_init(void); | ||
126 | extern void irsock_cleanup(void); | ||
127 | |||
128 | extern int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev, | ||
129 | struct packet_type *ptype, | ||
130 | struct net_device *orig_dev); | ||
131 | |||
116 | #endif /* NET_IRDA_H */ | 132 | #endif /* NET_IRDA_H */ |