aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-arm/arch-at91rm9200/hardware.h3
-rw-r--r--include/asm-arm/arch-ixp23xx/uncompress.h11
-rw-r--r--include/asm-arm/arch-pxa/pxa-regs.h2
-rw-r--r--include/asm-arm/arch-pxa/sharpsl.h2
-rw-r--r--include/asm-arm/unistd.h11
-rw-r--r--include/asm-generic/local.h13
-rw-r--r--include/asm-generic/mutex-dec.h30
-rw-r--r--include/asm-generic/mutex-xchg.h33
-rw-r--r--include/asm-i386/apicdef.h1
-rw-r--r--include/asm-i386/floppy.h34
-rw-r--r--include/asm-i386/local.h6
-rw-r--r--include/asm-i386/unistd.h3
-rw-r--r--include/asm-ia64/pal.h34
-rw-r--r--include/asm-powerpc/eeh.h20
-rw-r--r--include/asm-powerpc/hvcall.h185
-rw-r--r--include/asm-powerpc/system.h5
-rw-r--r--include/asm-s390/percpu.h2
-rw-r--r--include/asm-sparc/unistd.h6
-rw-r--r--include/asm-sparc64/unistd.h4
-rw-r--r--include/asm-um/desc.h12
-rw-r--r--include/asm-um/host_ldt-i386.h34
-rw-r--r--include/asm-um/host_ldt-x86_64.h (renamed from include/asm-um/ldt-x86_64.h)39
-rw-r--r--include/asm-um/ldt-i386.h69
-rw-r--r--include/asm-um/ldt.h41
-rw-r--r--include/asm-um/processor-i386.h35
-rw-r--r--include/asm-um/processor-x86_64.h9
-rw-r--r--include/asm-um/ptrace-generic.h16
-rw-r--r--include/asm-um/ptrace-i386.h41
-rw-r--r--include/asm-um/ptrace-x86_64.h35
-rw-r--r--include/asm-um/segment.h6
-rw-r--r--include/asm-um/thread_info.h16
-rw-r--r--include/asm-um/uaccess.h2
-rw-r--r--include/asm-x86_64/local.h10
-rw-r--r--include/linux/backlight.h25
-rw-r--r--include/linux/dcache.h1
-rw-r--r--include/linux/fadvise.h6
-rw-r--r--include/linux/fb.h2
-rw-r--r--include/linux/fs.h24
-rw-r--r--include/linux/gameport.h7
-rw-r--r--include/linux/hrtimer.h18
-rw-r--r--include/linux/input.h23
-rw-r--r--include/linux/ipmi_smi.h16
-rw-r--r--include/linux/kbd_kern.h2
-rw-r--r--include/linux/keyboard.h13
-rw-r--r--include/linux/leds.h111
-rw-r--r--include/linux/libps2.h2
-rw-r--r--include/linux/migrate.h5
-rw-r--r--include/linux/mtd/blktrans.h4
-rw-r--r--include/linux/mtd/doc2000.h4
-rw-r--r--include/linux/mtd/inftl.h5
-rw-r--r--include/linux/namei.h1
-rw-r--r--include/linux/netdevice.h55
-rw-r--r--include/linux/netfilter/x_tables.h67
-rw-r--r--include/linux/netfilter/xt_esp.h14
-rw-r--r--include/linux/netfilter/xt_multiport.h30
-rw-r--r--include/linux/netfilter_ipv4/ip_tables.h18
-rw-r--r--include/linux/netfilter_ipv4/ipt_esp.h14
-rw-r--r--include/linux/netfilter_ipv4/ipt_multiport.h31
-rw-r--r--include/linux/netfilter_ipv6/ip6t_esp.h12
-rw-r--r--include/linux/netfilter_ipv6/ip6t_multiport.h25
-rw-r--r--include/linux/pagemap.h4
-rw-r--r--include/linux/pid.h96
-rw-r--r--include/linux/pipe_fs_i.h3
-rw-r--r--include/linux/sched.h18
-rw-r--r--include/linux/serio.h9
-rw-r--r--include/linux/skbuff.h29
-rw-r--r--include/linux/syscalls.h2
-rw-r--r--include/linux/timer.h8
-rw-r--r--include/linux/tiocl.h1
-rw-r--r--include/linux/uinput.h4
-rw-r--r--include/linux/videodev2.h65
-rw-r--r--include/media/cx25840.h64
-rw-r--r--include/media/msp3400.h60
-rw-r--r--include/media/saa7115.h37
-rw-r--r--include/media/saa7127.h41
-rw-r--r--include/media/upd64031a.h40
-rw-r--r--include/media/upd64083.h58
-rw-r--r--include/net/tcp.h3
-rw-r--r--include/net/xfrm.h19
-rw-r--r--include/pcmcia/bulkmem.h4
-rw-r--r--include/pcmcia/ciscode.h5
-rw-r--r--include/pcmcia/cistpl.h21
-rw-r--r--include/pcmcia/cs.h34
-rw-r--r--include/pcmcia/ds.h80
-rw-r--r--include/pcmcia/ss.h11
85 files changed, 1328 insertions, 693 deletions
diff --git a/include/asm-arm/arch-at91rm9200/hardware.h b/include/asm-arm/arch-at91rm9200/hardware.h
index 2646c01f8e97..59e6f44d3a0d 100644
--- a/include/asm-arm/arch-at91rm9200/hardware.h
+++ b/include/asm-arm/arch-at91rm9200/hardware.h
@@ -65,6 +65,9 @@
65/* SmartMedia */ 65/* SmartMedia */
66#define AT91_SMARTMEDIA_BASE 0x40000000 /* NCS3: Smartmedia physical base address */ 66#define AT91_SMARTMEDIA_BASE 0x40000000 /* NCS3: Smartmedia physical base address */
67 67
68/* Compact Flash */
69#define AT91_CF_BASE 0x50000000 /* NCS4-NCS6: Compact Flash physical base address */
70
68/* Multi-Master Memory controller */ 71/* Multi-Master Memory controller */
69#define AT91_UHP_BASE 0x00300000 /* USB Host controller */ 72#define AT91_UHP_BASE 0x00300000 /* USB Host controller */
70 73
diff --git a/include/asm-arm/arch-ixp23xx/uncompress.h b/include/asm-arm/arch-ixp23xx/uncompress.h
index 62623fa9b2f7..013575e6a9a1 100644
--- a/include/asm-arm/arch-ixp23xx/uncompress.h
+++ b/include/asm-arm/arch-ixp23xx/uncompress.h
@@ -16,26 +16,21 @@
16 16
17#define UART_BASE ((volatile u32 *)IXP23XX_UART1_PHYS) 17#define UART_BASE ((volatile u32 *)IXP23XX_UART1_PHYS)
18 18
19static __inline__ void putc(char c) 19static inline void putc(char c)
20{ 20{
21 int j; 21 int j;
22 22
23 for (j = 0; j < 0x1000; j++) { 23 for (j = 0; j < 0x1000; j++) {
24 if (UART_BASE[UART_LSR] & UART_LSR_THRE) 24 if (UART_BASE[UART_LSR] & UART_LSR_THRE)
25 break; 25 break;
26 barrier();
26 } 27 }
27 28
28 UART_BASE[UART_TX] = c; 29 UART_BASE[UART_TX] = c;
29} 30}
30 31
31static void putstr(const char *s) 32static inline void flush(void)
32{ 33{
33 while (*s) {
34 putc(*s);
35 if (*s == '\n')
36 putc('\r');
37 s++;
38 }
39} 34}
40 35
41#define arch_decomp_setup() 36#define arch_decomp_setup()
diff --git a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h
index 1409c5bd703f..c8f53a71c076 100644
--- a/include/asm-arm/arch-pxa/pxa-regs.h
+++ b/include/asm-arm/arch-pxa/pxa-regs.h
@@ -485,7 +485,7 @@
485#define SACR1_ENLBF (1 << 5) /* Enable Loopback */ 485#define SACR1_ENLBF (1 << 5) /* Enable Loopback */
486#define SACR1_DRPL (1 << 4) /* Disable Replaying Function */ 486#define SACR1_DRPL (1 << 4) /* Disable Replaying Function */
487#define SACR1_DREC (1 << 3) /* Disable Recording Function */ 487#define SACR1_DREC (1 << 3) /* Disable Recording Function */
488#define SACR1_AMSL (1 << 1) /* Specify Alternate Mode */ 488#define SACR1_AMSL (1 << 0) /* Specify Alternate Mode */
489 489
490#define SASR0_I2SOFF (1 << 7) /* Controller Status */ 490#define SASR0_I2SOFF (1 << 7) /* Controller Status */
491#define SASR0_ROR (1 << 6) /* Rx FIFO Overrun */ 491#define SASR0_ROR (1 << 6) /* Rx FIFO Overrun */
diff --git a/include/asm-arm/arch-pxa/sharpsl.h b/include/asm-arm/arch-pxa/sharpsl.h
index 0b43495d24b4..94cb4982af82 100644
--- a/include/asm-arm/arch-pxa/sharpsl.h
+++ b/include/asm-arm/arch-pxa/sharpsl.h
@@ -27,6 +27,8 @@ struct corgits_machinfo {
27 */ 27 */
28struct corgibl_machinfo { 28struct corgibl_machinfo {
29 int max_intensity; 29 int max_intensity;
30 int default_intensity;
31 int limit_mask;
30 void (*set_bl_intensity)(int intensity); 32 void (*set_bl_intensity)(int intensity);
31}; 33};
32extern void corgibl_limit_intensity(int limit); 34extern void corgibl_limit_intensity(int limit);
diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h
index 8f331bbd39a8..65ac305c2d45 100644
--- a/include/asm-arm/unistd.h
+++ b/include/asm-arm/unistd.h
@@ -308,8 +308,6 @@
308#define __NR_mq_notify (__NR_SYSCALL_BASE+278) 308#define __NR_mq_notify (__NR_SYSCALL_BASE+278)
309#define __NR_mq_getsetattr (__NR_SYSCALL_BASE+279) 309#define __NR_mq_getsetattr (__NR_SYSCALL_BASE+279)
310#define __NR_waitid (__NR_SYSCALL_BASE+280) 310#define __NR_waitid (__NR_SYSCALL_BASE+280)
311
312#if defined(__ARM_EABI__) /* reserve these for un-muxing socketcall */
313#define __NR_socket (__NR_SYSCALL_BASE+281) 311#define __NR_socket (__NR_SYSCALL_BASE+281)
314#define __NR_bind (__NR_SYSCALL_BASE+282) 312#define __NR_bind (__NR_SYSCALL_BASE+282)
315#define __NR_connect (__NR_SYSCALL_BASE+283) 313#define __NR_connect (__NR_SYSCALL_BASE+283)
@@ -327,9 +325,6 @@
327#define __NR_getsockopt (__NR_SYSCALL_BASE+295) 325#define __NR_getsockopt (__NR_SYSCALL_BASE+295)
328#define __NR_sendmsg (__NR_SYSCALL_BASE+296) 326#define __NR_sendmsg (__NR_SYSCALL_BASE+296)
329#define __NR_recvmsg (__NR_SYSCALL_BASE+297) 327#define __NR_recvmsg (__NR_SYSCALL_BASE+297)
330#endif
331
332#if defined(__ARM_EABI__) /* reserve these for un-muxing ipc */
333#define __NR_semop (__NR_SYSCALL_BASE+298) 328#define __NR_semop (__NR_SYSCALL_BASE+298)
334#define __NR_semget (__NR_SYSCALL_BASE+299) 329#define __NR_semget (__NR_SYSCALL_BASE+299)
335#define __NR_semctl (__NR_SYSCALL_BASE+300) 330#define __NR_semctl (__NR_SYSCALL_BASE+300)
@@ -341,16 +336,10 @@
341#define __NR_shmdt (__NR_SYSCALL_BASE+306) 336#define __NR_shmdt (__NR_SYSCALL_BASE+306)
342#define __NR_shmget (__NR_SYSCALL_BASE+307) 337#define __NR_shmget (__NR_SYSCALL_BASE+307)
343#define __NR_shmctl (__NR_SYSCALL_BASE+308) 338#define __NR_shmctl (__NR_SYSCALL_BASE+308)
344#endif
345
346#define __NR_add_key (__NR_SYSCALL_BASE+309) 339#define __NR_add_key (__NR_SYSCALL_BASE+309)
347#define __NR_request_key (__NR_SYSCALL_BASE+310) 340#define __NR_request_key (__NR_SYSCALL_BASE+310)
348#define __NR_keyctl (__NR_SYSCALL_BASE+311) 341#define __NR_keyctl (__NR_SYSCALL_BASE+311)
349
350#if defined(__ARM_EABI__) /* reserved for un-muxing ipc */
351#define __NR_semtimedop (__NR_SYSCALL_BASE+312) 342#define __NR_semtimedop (__NR_SYSCALL_BASE+312)
352#endif
353
354#define __NR_vserver (__NR_SYSCALL_BASE+313) 343#define __NR_vserver (__NR_SYSCALL_BASE+313)
355#define __NR_ioprio_set (__NR_SYSCALL_BASE+314) 344#define __NR_ioprio_set (__NR_SYSCALL_BASE+314)
356#define __NR_ioprio_get (__NR_SYSCALL_BASE+315) 345#define __NR_ioprio_get (__NR_SYSCALL_BASE+315)
diff --git a/include/asm-generic/local.h b/include/asm-generic/local.h
index de4614840c2c..9291c24f5819 100644
--- a/include/asm-generic/local.h
+++ b/include/asm-generic/local.h
@@ -7,8 +7,15 @@
7#include <asm/atomic.h> 7#include <asm/atomic.h>
8#include <asm/types.h> 8#include <asm/types.h>
9 9
10/* An unsigned long type for operations which are atomic for a single 10/*
11 * CPU. Usually used in combination with per-cpu variables. */ 11 * A signed long type for operations which are atomic for a single CPU.
12 * Usually used in combination with per-cpu variables.
13 *
14 * This is the default implementation, which uses atomic_long_t. Which is
15 * rather pointless. The whole point behind local_t is that some processors
16 * can perform atomic adds and subtracts in a manner which is atomic wrt IRQs
17 * running on this CPU. local_t allows exploitation of such capabilities.
18 */
12 19
13/* Implement in terms of atomics. */ 20/* Implement in terms of atomics. */
14 21
@@ -20,7 +27,7 @@ typedef struct
20 27
21#define LOCAL_INIT(i) { ATOMIC_LONG_INIT(i) } 28#define LOCAL_INIT(i) { ATOMIC_LONG_INIT(i) }
22 29
23#define local_read(l) ((unsigned long)atomic_long_read(&(l)->a)) 30#define local_read(l) atomic_long_read(&(l)->a)
24#define local_set(l,i) atomic_long_set((&(l)->a),(i)) 31#define local_set(l,i) atomic_long_set((&(l)->a),(i))
25#define local_inc(l) atomic_long_inc(&(l)->a) 32#define local_inc(l) atomic_long_inc(&(l)->a)
26#define local_dec(l) atomic_long_dec(&(l)->a) 33#define local_dec(l) atomic_long_dec(&(l)->a)
diff --git a/include/asm-generic/mutex-dec.h b/include/asm-generic/mutex-dec.h
index 40c6d1f86598..29c6ac34e236 100644
--- a/include/asm-generic/mutex-dec.h
+++ b/include/asm-generic/mutex-dec.h
@@ -17,13 +17,14 @@
17 * it wasn't 1 originally. This function MUST leave the value lower than 17 * it wasn't 1 originally. This function MUST leave the value lower than
18 * 1 even when the "1" assertion wasn't true. 18 * 1 even when the "1" assertion wasn't true.
19 */ 19 */
20#define __mutex_fastpath_lock(count, fail_fn) \ 20static inline void
21do { \ 21__mutex_fastpath_lock(atomic_t *count, fastcall void (*fail_fn)(atomic_t *))
22 if (unlikely(atomic_dec_return(count) < 0)) \ 22{
23 fail_fn(count); \ 23 if (unlikely(atomic_dec_return(count) < 0))
24 else \ 24 fail_fn(count);
25 smp_mb(); \ 25 else
26} while (0) 26 smp_mb();
27}
27 28
28/** 29/**
29 * __mutex_fastpath_lock_retval - try to take the lock by moving the count 30 * __mutex_fastpath_lock_retval - try to take the lock by moving the count
@@ -36,7 +37,7 @@ do { \
36 * or anything the slow path function returns. 37 * or anything the slow path function returns.
37 */ 38 */
38static inline int 39static inline int
39__mutex_fastpath_lock_retval(atomic_t *count, int (*fail_fn)(atomic_t *)) 40__mutex_fastpath_lock_retval(atomic_t *count, fastcall int (*fail_fn)(atomic_t *))
40{ 41{
41 if (unlikely(atomic_dec_return(count) < 0)) 42 if (unlikely(atomic_dec_return(count) < 0))
42 return fail_fn(count); 43 return fail_fn(count);
@@ -59,12 +60,13 @@ __mutex_fastpath_lock_retval(atomic_t *count, int (*fail_fn)(atomic_t *))
59 * __mutex_slowpath_needs_to_unlock() macro needs to return 1, it needs 60 * __mutex_slowpath_needs_to_unlock() macro needs to return 1, it needs
60 * to return 0 otherwise. 61 * to return 0 otherwise.
61 */ 62 */
62#define __mutex_fastpath_unlock(count, fail_fn) \ 63static inline void
63do { \ 64__mutex_fastpath_unlock(atomic_t *count, fastcall void (*fail_fn)(atomic_t *))
64 smp_mb(); \ 65{
65 if (unlikely(atomic_inc_return(count) <= 0)) \ 66 smp_mb();
66 fail_fn(count); \ 67 if (unlikely(atomic_inc_return(count) <= 0))
67} while (0) 68 fail_fn(count);
69}
68 70
69#define __mutex_slowpath_needs_to_unlock() 1 71#define __mutex_slowpath_needs_to_unlock() 1
70 72
diff --git a/include/asm-generic/mutex-xchg.h b/include/asm-generic/mutex-xchg.h
index 1d24f47e6c48..32a2100c1aeb 100644
--- a/include/asm-generic/mutex-xchg.h
+++ b/include/asm-generic/mutex-xchg.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Generic implementation of the mutex fastpath, based on xchg(). 4 * Generic implementation of the mutex fastpath, based on xchg().
5 * 5 *
6 * NOTE: An xchg based implementation is less optimal than an atomic 6 * NOTE: An xchg based implementation might be less optimal than an atomic
7 * decrement/increment based implementation. If your architecture 7 * decrement/increment based implementation. If your architecture
8 * has a reasonable atomic dec/inc then you should probably use 8 * has a reasonable atomic dec/inc then you should probably use
9 * asm-generic/mutex-dec.h instead, or you could open-code an 9 * asm-generic/mutex-dec.h instead, or you could open-code an
@@ -22,14 +22,14 @@
22 * wasn't 1 originally. This function MUST leave the value lower than 1 22 * wasn't 1 originally. This function MUST leave the value lower than 1
23 * even when the "1" assertion wasn't true. 23 * even when the "1" assertion wasn't true.
24 */ 24 */
25#define __mutex_fastpath_lock(count, fail_fn) \ 25static inline void
26do { \ 26__mutex_fastpath_lock(atomic_t *count, fastcall void (*fail_fn)(atomic_t *))
27 if (unlikely(atomic_xchg(count, 0) != 1)) \ 27{
28 fail_fn(count); \ 28 if (unlikely(atomic_xchg(count, 0) != 1))
29 else \ 29 fail_fn(count);
30 smp_mb(); \ 30 else
31} while (0) 31 smp_mb();
32 32}
33 33
34/** 34/**
35 * __mutex_fastpath_lock_retval - try to take the lock by moving the count 35 * __mutex_fastpath_lock_retval - try to take the lock by moving the count
@@ -42,7 +42,7 @@ do { \
42 * or anything the slow path function returns 42 * or anything the slow path function returns
43 */ 43 */
44static inline int 44static inline int
45__mutex_fastpath_lock_retval(atomic_t *count, int (*fail_fn)(atomic_t *)) 45__mutex_fastpath_lock_retval(atomic_t *count, fastcall int (*fail_fn)(atomic_t *))
46{ 46{
47 if (unlikely(atomic_xchg(count, 0) != 1)) 47 if (unlikely(atomic_xchg(count, 0) != 1))
48 return fail_fn(count); 48 return fail_fn(count);
@@ -64,12 +64,13 @@ __mutex_fastpath_lock_retval(atomic_t *count, int (*fail_fn)(atomic_t *))
64 * __mutex_slowpath_needs_to_unlock() macro needs to return 1, it needs 64 * __mutex_slowpath_needs_to_unlock() macro needs to return 1, it needs
65 * to return 0 otherwise. 65 * to return 0 otherwise.
66 */ 66 */
67#define __mutex_fastpath_unlock(count, fail_fn) \ 67static inline void
68do { \ 68__mutex_fastpath_unlock(atomic_t *count, fastcall void (*fail_fn)(atomic_t *))
69 smp_mb(); \ 69{
70 if (unlikely(atomic_xchg(count, 1) != 0)) \ 70 smp_mb();
71 fail_fn(count); \ 71 if (unlikely(atomic_xchg(count, 1) != 0))
72} while (0) 72 fail_fn(count);
73}
73 74
74#define __mutex_slowpath_needs_to_unlock() 0 75#define __mutex_slowpath_needs_to_unlock() 0
75 76
diff --git a/include/asm-i386/apicdef.h b/include/asm-i386/apicdef.h
index 03185cef8e0a..5e4a35af2921 100644
--- a/include/asm-i386/apicdef.h
+++ b/include/asm-i386/apicdef.h
@@ -37,6 +37,7 @@
37#define APIC_SPIV_FOCUS_DISABLED (1<<9) 37#define APIC_SPIV_FOCUS_DISABLED (1<<9)
38#define APIC_SPIV_APIC_ENABLED (1<<8) 38#define APIC_SPIV_APIC_ENABLED (1<<8)
39#define APIC_ISR 0x100 39#define APIC_ISR 0x100
40#define APIC_ISR_NR 0x8 /* Number of 32 bit ISR registers. */
40#define APIC_TMR 0x180 41#define APIC_TMR 0x180
41#define APIC_IRR 0x200 42#define APIC_IRR 0x200
42#define APIC_ESR 0x280 43#define APIC_ESR 0x280
diff --git a/include/asm-i386/floppy.h b/include/asm-i386/floppy.h
index 79727afb94c9..03403045c182 100644
--- a/include/asm-i386/floppy.h
+++ b/include/asm-i386/floppy.h
@@ -56,7 +56,6 @@ static irqreturn_t floppy_hardint(int irq, void *dev_id, struct pt_regs * regs)
56 register unsigned char st; 56 register unsigned char st;
57 57
58#undef TRACE_FLPY_INT 58#undef TRACE_FLPY_INT
59#define NO_FLOPPY_ASSEMBLER
60 59
61#ifdef TRACE_FLPY_INT 60#ifdef TRACE_FLPY_INT
62 static int calls=0; 61 static int calls=0;
@@ -71,38 +70,6 @@ static irqreturn_t floppy_hardint(int irq, void *dev_id, struct pt_regs * regs)
71 bytes = virtual_dma_count; 70 bytes = virtual_dma_count;
72#endif 71#endif
73 72
74#ifndef NO_FLOPPY_ASSEMBLER
75 __asm__ (
76 "testl %1,%1"
77 "je 3f"
78"1: inb %w4,%b0"
79 "andb $160,%b0"
80 "cmpb $160,%b0"
81 "jne 2f"
82 "incw %w4"
83 "testl %3,%3"
84 "jne 4f"
85 "inb %w4,%b0"
86 "movb %0,(%2)"
87 "jmp 5f"
88"4: movb (%2),%0"
89 "outb %b0,%w4"
90"5: decw %w4"
91 "outb %0,$0x80"
92 "decl %1"
93 "incl %2"
94 "testl %1,%1"
95 "jne 1b"
96"3: inb %w4,%b0"
97"2: "
98 : "=a" ((char) st),
99 "=c" ((long) virtual_dma_count),
100 "=S" ((long) virtual_dma_addr)
101 : "b" ((long) virtual_dma_mode),
102 "d" ((short) virtual_dma_port+4),
103 "1" ((long) virtual_dma_count),
104 "2" ((long) virtual_dma_addr));
105#else
106 { 73 {
107 register int lcount; 74 register int lcount;
108 register char *lptr; 75 register char *lptr;
@@ -122,7 +89,6 @@ static irqreturn_t floppy_hardint(int irq, void *dev_id, struct pt_regs * regs)
122 virtual_dma_addr = lptr; 89 virtual_dma_addr = lptr;
123 st = inb(virtual_dma_port+4); 90 st = inb(virtual_dma_port+4);
124 } 91 }
125#endif
126 92
127#ifdef TRACE_FLPY_INT 93#ifdef TRACE_FLPY_INT
128 calls++; 94 calls++;
diff --git a/include/asm-i386/local.h b/include/asm-i386/local.h
index 0177da80dde3..e67fa08260fe 100644
--- a/include/asm-i386/local.h
+++ b/include/asm-i386/local.h
@@ -5,7 +5,7 @@
5 5
6typedef struct 6typedef struct
7{ 7{
8 volatile unsigned long counter; 8 volatile long counter;
9} local_t; 9} local_t;
10 10
11#define LOCAL_INIT(i) { (i) } 11#define LOCAL_INIT(i) { (i) }
@@ -29,7 +29,7 @@ static __inline__ void local_dec(local_t *v)
29 :"m" (v->counter)); 29 :"m" (v->counter));
30} 30}
31 31
32static __inline__ void local_add(unsigned long i, local_t *v) 32static __inline__ void local_add(long i, local_t *v)
33{ 33{
34 __asm__ __volatile__( 34 __asm__ __volatile__(
35 "addl %1,%0" 35 "addl %1,%0"
@@ -37,7 +37,7 @@ static __inline__ void local_add(unsigned long i, local_t *v)
37 :"ir" (i), "m" (v->counter)); 37 :"ir" (i), "m" (v->counter));
38} 38}
39 39
40static __inline__ void local_sub(unsigned long i, local_t *v) 40static __inline__ void local_sub(long i, local_t *v)
41{ 41{
42 __asm__ __volatile__( 42 __asm__ __volatile__(
43 "subl %1,%0" 43 "subl %1,%0"
diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h
index 789e9bdd0a40..2e7f3e257fdd 100644
--- a/include/asm-i386/unistd.h
+++ b/include/asm-i386/unistd.h
@@ -319,8 +319,9 @@
319#define __NR_set_robust_list 311 319#define __NR_set_robust_list 311
320#define __NR_get_robust_list 312 320#define __NR_get_robust_list 312
321#define __NR_sys_splice 313 321#define __NR_sys_splice 313
322#define __NR_sys_sync_file_range 314
322 323
323#define NR_syscalls 314 324#define NR_syscalls 315
324 325
325/* 326/*
326 * user-visible error numbers are in the range -1 - -128: see 327 * user-visible error numbers are in the range -1 - -128: see
diff --git a/include/asm-ia64/pal.h b/include/asm-ia64/pal.h
index 4e7e6f23b08c..37e52a2836b0 100644
--- a/include/asm-ia64/pal.h
+++ b/include/asm-ia64/pal.h
@@ -68,6 +68,7 @@
68#define PAL_SHUTDOWN 40 /* enter processor shutdown state */ 68#define PAL_SHUTDOWN 40 /* enter processor shutdown state */
69#define PAL_PREFETCH_VISIBILITY 41 /* Make Processor Prefetches Visible */ 69#define PAL_PREFETCH_VISIBILITY 41 /* Make Processor Prefetches Visible */
70#define PAL_LOGICAL_TO_PHYSICAL 42 /* returns information on logical to physical processor mapping */ 70#define PAL_LOGICAL_TO_PHYSICAL 42 /* returns information on logical to physical processor mapping */
71#define PAL_CACHE_SHARED_INFO 43 /* returns information on caches shared by logical processor */
71 72
72#define PAL_COPY_PAL 256 /* relocate PAL procedures and PAL PMI */ 73#define PAL_COPY_PAL 256 /* relocate PAL procedures and PAL PMI */
73#define PAL_HALT_INFO 257 /* return the low power capabilities of processor */ 74#define PAL_HALT_INFO 257 /* return the low power capabilities of processor */
@@ -130,7 +131,7 @@ typedef u64 pal_cache_line_state_t;
130#define PAL_CACHE_LINE_STATE_MODIFIED 3 /* Modified */ 131#define PAL_CACHE_LINE_STATE_MODIFIED 3 /* Modified */
131 132
132typedef struct pal_freq_ratio { 133typedef struct pal_freq_ratio {
133 u64 den : 32, num : 32; /* numerator & denominator */ 134 u32 den, num; /* numerator & denominator */
134} itc_ratio, proc_ratio; 135} itc_ratio, proc_ratio;
135 136
136typedef union pal_cache_config_info_1_s { 137typedef union pal_cache_config_info_1_s {
@@ -151,10 +152,10 @@ typedef union pal_cache_config_info_1_s {
151 152
152typedef union pal_cache_config_info_2_s { 153typedef union pal_cache_config_info_2_s {
153 struct { 154 struct {
154 u64 cache_size : 32, /*cache size in bytes*/ 155 u32 cache_size; /*cache size in bytes*/
155 156
156 157
157 alias_boundary : 8, /* 39-32 aliased addr 158 u32 alias_boundary : 8, /* 39-32 aliased addr
158 * separation for max 159 * separation for max
159 * performance. 160 * performance.
160 */ 161 */
@@ -1647,6 +1648,33 @@ ia64_pal_logical_to_phys(u64 proc_number, pal_logical_to_physical_t *mapping)
1647 1648
1648 return iprv.status; 1649 return iprv.status;
1649} 1650}
1651
1652typedef struct pal_cache_shared_info_s
1653{
1654 u64 num_shared;
1655 pal_proc_n_log_info1_t ppli1;
1656 pal_proc_n_log_info2_t ppli2;
1657} pal_cache_shared_info_t;
1658
1659/* Get information on logical to physical processor mappings. */
1660static inline s64
1661ia64_pal_cache_shared_info(u64 level,
1662 u64 type,
1663 u64 proc_number,
1664 pal_cache_shared_info_t *info)
1665{
1666 struct ia64_pal_retval iprv;
1667
1668 PAL_CALL(iprv, PAL_CACHE_SHARED_INFO, level, type, proc_number);
1669
1670 if (iprv.status == PAL_STATUS_SUCCESS) {
1671 info->num_shared = iprv.v0;
1672 info->ppli1.ppli1_data = iprv.v1;
1673 info->ppli2.ppli2_data = iprv.v2;
1674 }
1675
1676 return iprv.status;
1677}
1650#endif /* __ASSEMBLY__ */ 1678#endif /* __ASSEMBLY__ */
1651 1679
1652#endif /* _ASM_IA64_PAL_H */ 1680#endif /* _ASM_IA64_PAL_H */
diff --git a/include/asm-powerpc/eeh.h b/include/asm-powerpc/eeh.h
index 5207758a6dd9..868c7139dbff 100644
--- a/include/asm-powerpc/eeh.h
+++ b/include/asm-powerpc/eeh.h
@@ -60,24 +60,10 @@ void __init pci_addr_cache_build(void);
60 * device (including config space i/o). Call eeh_add_device_late 60 * device (including config space i/o). Call eeh_add_device_late
61 * to finish the eeh setup for this device. 61 * to finish the eeh setup for this device.
62 */ 62 */
63void eeh_add_device_early(struct device_node *);
64void eeh_add_device_late(struct pci_dev *dev);
65void eeh_add_device_tree_early(struct device_node *); 63void eeh_add_device_tree_early(struct device_node *);
66void eeh_add_device_tree_late(struct pci_bus *); 64void eeh_add_device_tree_late(struct pci_bus *);
67 65
68/** 66/**
69 * eeh_remove_device - undo EEH setup for the indicated pci device
70 * @dev: pci device to be removed
71 *
72 * This routine should be called when a device is removed from
73 * a running system (e.g. by hotplug or dlpar). It unregisters
74 * the PCI device from the EEH subsystem. I/O errors affecting
75 * this device will no longer be detected after this call; thus,
76 * i/o errors affecting this slot may leave this device unusable.
77 */
78void eeh_remove_device(struct pci_dev *);
79
80/**
81 * eeh_remove_device_recursive - undo EEH for device & children. 67 * eeh_remove_device_recursive - undo EEH for device & children.
82 * @dev: pci device to be removed 68 * @dev: pci device to be removed
83 * 69 *
@@ -116,12 +102,6 @@ static inline int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *d
116 102
117static inline void pci_addr_cache_build(void) { } 103static inline void pci_addr_cache_build(void) { }
118 104
119static inline void eeh_add_device_early(struct device_node *dn) { }
120
121static inline void eeh_add_device_late(struct pci_dev *dev) { }
122
123static inline void eeh_remove_device(struct pci_dev *dev) { }
124
125static inline void eeh_add_device_tree_early(struct device_node *dn) { } 105static inline void eeh_add_device_tree_early(struct device_node *dn) { }
126 106
127static inline void eeh_add_device_tree_late(struct pci_bus *bus) { } 107static inline void eeh_add_device_tree_late(struct pci_bus *bus) { }
diff --git a/include/asm-powerpc/hvcall.h b/include/asm-powerpc/hvcall.h
index b72c04f3f551..6cc7e1fb7bfd 100644
--- a/include/asm-powerpc/hvcall.h
+++ b/include/asm-powerpc/hvcall.h
@@ -4,47 +4,88 @@
4 4
5#define HVSC .long 0x44000022 5#define HVSC .long 0x44000022
6 6
7#define H_Success 0 7#define H_SUCCESS 0
8#define H_Busy 1 /* Hardware busy -- retry later */ 8#define H_BUSY 1 /* Hardware busy -- retry later */
9#define H_Closed 2 /* Resource closed */ 9#define H_CLOSED 2 /* Resource closed */
10#define H_Constrained 4 /* Resource request constrained to max allowed */ 10#define H_NOT_AVAILABLE 3
11#define H_InProgress 14 /* Kind of like busy */ 11#define H_CONSTRAINED 4 /* Resource request constrained to max allowed */
12#define H_Pending 17 /* returned from H_POLL_PENDING */ 12#define H_PARTIAL 5
13#define H_Continue 18 /* Returned from H_Join on success */ 13#define H_IN_PROGRESS 14 /* Kind of like busy */
14#define H_LongBusyStartRange 9900 /* Start of long busy range */ 14#define H_PAGE_REGISTERED 15
15#define H_LongBusyOrder1msec 9900 /* Long busy, hint that 1msec is a good time to retry */ 15#define H_PARTIAL_STORE 16
16#define H_LongBusyOrder10msec 9901 /* Long busy, hint that 10msec is a good time to retry */ 16#define H_PENDING 17 /* returned from H_POLL_PENDING */
17#define H_LongBusyOrder100msec 9902 /* Long busy, hint that 100msec is a good time to retry */ 17#define H_CONTINUE 18 /* Returned from H_Join on success */
18#define H_LongBusyOrder1sec 9903 /* Long busy, hint that 1sec is a good time to retry */ 18#define H_LONG_BUSY_START_RANGE 9900 /* Start of long busy range */
19#define H_LongBusyOrder10sec 9904 /* Long busy, hint that 10sec is a good time to retry */ 19#define H_LONG_BUSY_ORDER_1_MSEC 9900 /* Long busy, hint that 1msec \
20#define H_LongBusyOrder100sec 9905 /* Long busy, hint that 100sec is a good time to retry */ 20 is a good time to retry */
21#define H_LongBusyEndRange 9905 /* End of long busy range */ 21#define H_LONG_BUSY_ORDER_10_MSEC 9901 /* Long busy, hint that 10msec \
22#define H_Hardware -1 /* Hardware error */ 22 is a good time to retry */
23#define H_Function -2 /* Function not supported */ 23#define H_LONG_BUSY_ORDER_100_MSEC 9902 /* Long busy, hint that 100msec \
24#define H_Privilege -3 /* Caller not privileged */ 24 is a good time to retry */
25#define H_Parameter -4 /* Parameter invalid, out-of-range or conflicting */ 25#define H_LONG_BUSY_ORDER_1_SEC 9903 /* Long busy, hint that 1sec \
26#define H_Bad_Mode -5 /* Illegal msr value */ 26 is a good time to retry */
27#define H_PTEG_Full -6 /* PTEG is full */ 27#define H_LONG_BUSY_ORDER_10_SEC 9904 /* Long busy, hint that 10sec \
28#define H_Not_Found -7 /* PTE was not found" */ 28 is a good time to retry */
29#define H_Reserved_DABR -8 /* DABR address is reserved by the hypervisor on this processor" */ 29#define H_LONG_BUSY_ORDER_100_SEC 9905 /* Long busy, hint that 100sec \
30#define H_NoMem -9 30 is a good time to retry */
31#define H_Authority -10 31#define H_LONG_BUSY_END_RANGE 9905 /* End of long busy range */
32#define H_Permission -11 32#define H_HARDWARE -1 /* Hardware error */
33#define H_Dropped -12 33#define H_FUNCTION -2 /* Function not supported */
34#define H_SourceParm -13 34#define H_PRIVILEGE -3 /* Caller not privileged */
35#define H_DestParm -14 35#define H_PARAMETER -4 /* Parameter invalid, out-of-range or conflicting */
36#define H_RemoteParm -15 36#define H_BAD_MODE -5 /* Illegal msr value */
37#define H_Resource -16 37#define H_PTEG_FULL -6 /* PTEG is full */
38#define H_NOT_FOUND -7 /* PTE was not found" */
39#define H_RESERVED_DABR -8 /* DABR address is reserved by the hypervisor on this processor" */
40#define H_NO_MEM -9
41#define H_AUTHORITY -10
42#define H_PERMISSION -11
43#define H_DROPPED -12
44#define H_SOURCE_PARM -13
45#define H_DEST_PARM -14
46#define H_REMOTE_PARM -15
47#define H_RESOURCE -16
48#define H_ADAPTER_PARM -17
49#define H_RH_PARM -18
50#define H_RCQ_PARM -19
51#define H_SCQ_PARM -20
52#define H_EQ_PARM -21
53#define H_RT_PARM -22
54#define H_ST_PARM -23
55#define H_SIGT_PARM -24
56#define H_TOKEN_PARM -25
57#define H_MLENGTH_PARM -27
58#define H_MEM_PARM -28
59#define H_MEM_ACCESS_PARM -29
60#define H_ATTR_PARM -30
61#define H_PORT_PARM -31
62#define H_MCG_PARM -32
63#define H_VL_PARM -33
64#define H_TSIZE_PARM -34
65#define H_TRACE_PARM -35
66
67#define H_MASK_PARM -37
68#define H_MCG_FULL -38
69#define H_ALIAS_EXIST -39
70#define H_P_COUNTER -40
71#define H_TABLE_FULL -41
72#define H_ALT_TABLE -42
73#define H_MR_CONDITION -43
74#define H_NOT_ENOUGH_RESOURCES -44
75#define H_R_STATE -45
76#define H_RESCINDEND -46
77
38 78
39/* Long Busy is a condition that can be returned by the firmware 79/* Long Busy is a condition that can be returned by the firmware
40 * when a call cannot be completed now, but the identical call 80 * when a call cannot be completed now, but the identical call
41 * should be retried later. This prevents calls blocking in the 81 * should be retried later. This prevents calls blocking in the
42 * firmware for long periods of time. Annoyingly the firmware can return 82 * firmware for long periods of time. Annoyingly the firmware can return
43 * a range of return codes, hinting at how long we should wait before 83 * a range of return codes, hinting at how long we should wait before
44 * retrying. If you don't care for the hint, the macro below is a good 84 * retrying. If you don't care for the hint, the macro below is a good
45 * way to check for the long_busy return codes 85 * way to check for the long_busy return codes
46 */ 86 */
47#define H_isLongBusy(x) ((x >= H_LongBusyStartRange) && (x <= H_LongBusyEndRange)) 87#define H_IS_LONG_BUSY(x) ((x >= H_LONG_BUSY_START_RANGE) \
88 && (x <= H_LONG_BUSY_END_RANGE))
48 89
49/* Flags */ 90/* Flags */
50#define H_LARGE_PAGE (1UL<<(63-16)) 91#define H_LARGE_PAGE (1UL<<(63-16))
@@ -66,6 +107,9 @@
66#define H_DABRX_KERNEL (1UL<<(63-62)) 107#define H_DABRX_KERNEL (1UL<<(63-62))
67#define H_DABRX_USER (1UL<<(63-63)) 108#define H_DABRX_USER (1UL<<(63-63))
68 109
110/* Each control block has to be on a 4K bondary */
111#define H_CB_ALIGNMENT 4096
112
69/* pSeries hypervisor opcodes */ 113/* pSeries hypervisor opcodes */
70#define H_REMOVE 0x04 114#define H_REMOVE 0x04
71#define H_ENTER 0x08 115#define H_ENTER 0x08
@@ -99,25 +143,52 @@
99#define H_PERFMON 0x7c 143#define H_PERFMON 0x7c
100#define H_MIGRATE_DMA 0x78 144#define H_MIGRATE_DMA 0x78
101#define H_REGISTER_VPA 0xDC 145#define H_REGISTER_VPA 0xDC
102#define H_CEDE 0xE0 146#define H_CEDE 0xE0
103#define H_CONFER 0xE4 147#define H_CONFER 0xE4
104#define H_PROD 0xE8 148#define H_PROD 0xE8
105#define H_GET_PPP 0xEC 149#define H_GET_PPP 0xEC
106#define H_SET_PPP 0xF0 150#define H_SET_PPP 0xF0
107#define H_PURR 0xF4 151#define H_PURR 0xF4
108#define H_PIC 0xF8 152#define H_PIC 0xF8
109#define H_REG_CRQ 0xFC 153#define H_REG_CRQ 0xFC
110#define H_FREE_CRQ 0x100 154#define H_FREE_CRQ 0x100
111#define H_VIO_SIGNAL 0x104 155#define H_VIO_SIGNAL 0x104
112#define H_SEND_CRQ 0x108 156#define H_SEND_CRQ 0x108
113#define H_COPY_RDMA 0x110 157#define H_COPY_RDMA 0x110
114#define H_SET_XDABR 0x134 158#define H_SET_XDABR 0x134
115#define H_STUFF_TCE 0x138 159#define H_STUFF_TCE 0x138
116#define H_PUT_TCE_INDIRECT 0x13C 160#define H_PUT_TCE_INDIRECT 0x13C
117#define H_VTERM_PARTNER_INFO 0x150 161#define H_VTERM_PARTNER_INFO 0x150
118#define H_REGISTER_VTERM 0x154 162#define H_REGISTER_VTERM 0x154
119#define H_FREE_VTERM 0x158 163#define H_FREE_VTERM 0x158
120#define H_POLL_PENDING 0x1D8 164#define H_RESET_EVENTS 0x15C
165#define H_ALLOC_RESOURCE 0x160
166#define H_FREE_RESOURCE 0x164
167#define H_MODIFY_QP 0x168
168#define H_QUERY_QP 0x16C
169#define H_REREGISTER_PMR 0x170
170#define H_REGISTER_SMR 0x174
171#define H_QUERY_MR 0x178
172#define H_QUERY_MW 0x17C
173#define H_QUERY_HCA 0x180
174#define H_QUERY_PORT 0x184
175#define H_MODIFY_PORT 0x188
176#define H_DEFINE_AQP1 0x18C
177#define H_GET_TRACE_BUFFER 0x190
178#define H_DEFINE_AQP0 0x194
179#define H_RESIZE_MR 0x198
180#define H_ATTACH_MCQP 0x19C
181#define H_DETACH_MCQP 0x1A0
182#define H_CREATE_RPT 0x1A4
183#define H_REMOVE_RPT 0x1A8
184#define H_REGISTER_RPAGES 0x1AC
185#define H_DISABLE_AND_GETC 0x1B0
186#define H_ERROR_DATA 0x1B4
187#define H_GET_HCA_INFO 0x1B8
188#define H_GET_PERF_COUNT 0x1BC
189#define H_MANAGE_TRACE 0x1C0
190#define H_QUERY_INT_STATE 0x1E4
191#define H_POLL_PENDING 0x1D8
121#define H_JOIN 0x298 192#define H_JOIN 0x298
122#define H_ENABLE_CRQ 0x2B0 193#define H_ENABLE_CRQ 0x2B0
123 194
@@ -152,7 +223,7 @@ long plpar_hcall_norets(unsigned long opcode, ...);
152 */ 223 */
153long plpar_hcall_8arg_2ret(unsigned long opcode, 224long plpar_hcall_8arg_2ret(unsigned long opcode,
154 unsigned long arg1, 225 unsigned long arg1,
155 unsigned long arg2, 226 unsigned long arg2,
156 unsigned long arg3, 227 unsigned long arg3,
157 unsigned long arg4, 228 unsigned long arg4,
158 unsigned long arg5, 229 unsigned long arg5,
@@ -176,6 +247,42 @@ long plpar_hcall_4out(unsigned long opcode,
176 unsigned long *out3, 247 unsigned long *out3,
177 unsigned long *out4); 248 unsigned long *out4);
178 249
250long plpar_hcall_7arg_7ret(unsigned long opcode,
251 unsigned long arg1,
252 unsigned long arg2,
253 unsigned long arg3,
254 unsigned long arg4,
255 unsigned long arg5,
256 unsigned long arg6,
257 unsigned long arg7,
258 unsigned long *out1,
259 unsigned long *out2,
260 unsigned long *out3,
261 unsigned long *out4,
262 unsigned long *out5,
263 unsigned long *out6,
264 unsigned long *out7);
265
266long plpar_hcall_9arg_9ret(unsigned long opcode,
267 unsigned long arg1,
268 unsigned long arg2,
269 unsigned long arg3,
270 unsigned long arg4,
271 unsigned long arg5,
272 unsigned long arg6,
273 unsigned long arg7,
274 unsigned long arg8,
275 unsigned long arg9,
276 unsigned long *out1,
277 unsigned long *out2,
278 unsigned long *out3,
279 unsigned long *out4,
280 unsigned long *out5,
281 unsigned long *out6,
282 unsigned long *out7,
283 unsigned long *out8,
284 unsigned long *out9);
285
179#endif /* __ASSEMBLY__ */ 286#endif /* __ASSEMBLY__ */
180#endif /* __KERNEL__ */ 287#endif /* __KERNEL__ */
181#endif /* _ASM_POWERPC_HVCALL_H */ 288#endif /* _ASM_POWERPC_HVCALL_H */
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h
index 65f5a7b2646b..d075725bf444 100644
--- a/include/asm-powerpc/system.h
+++ b/include/asm-powerpc/system.h
@@ -365,8 +365,11 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new,
365 * powers of 2 writes until it reaches sufficient alignment). 365 * powers of 2 writes until it reaches sufficient alignment).
366 * 366 *
367 * Based on this we disable the IP header alignment in network drivers. 367 * Based on this we disable the IP header alignment in network drivers.
368 * We also modify NET_SKB_PAD to be a cacheline in size, thus maintaining
369 * cacheline alignment of buffers.
368 */ 370 */
369#define NET_IP_ALIGN 0 371#define NET_IP_ALIGN 0
372#define NET_SKB_PAD L1_CACHE_BYTES
370#endif 373#endif
371 374
372#define arch_align_stack(x) (x) 375#define arch_align_stack(x) (x)
diff --git a/include/asm-s390/percpu.h b/include/asm-s390/percpu.h
index e10ed87094f0..436d216601e5 100644
--- a/include/asm-s390/percpu.h
+++ b/include/asm-s390/percpu.h
@@ -46,7 +46,7 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
46#define percpu_modcopy(pcpudst, src, size) \ 46#define percpu_modcopy(pcpudst, src, size) \
47do { \ 47do { \
48 unsigned int __i; \ 48 unsigned int __i; \
49 for_each_cpu(__i) \ 49 for_each_possible_cpu(__i) \
50 memcpy((pcpudst)+__per_cpu_offset[__i], \ 50 memcpy((pcpudst)+__per_cpu_offset[__i], \
51 (src), (size)); \ 51 (src), (size)); \
52} while (0) 52} while (0)
diff --git a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h
index 64ec640a40ee..264f0ebeaedc 100644
--- a/include/asm-sparc/unistd.h
+++ b/include/asm-sparc/unistd.h
@@ -180,7 +180,7 @@
180#define __NR_sched_get_affinity 161 /* Linux specific, getfh under SunOS */ 180#define __NR_sched_get_affinity 161 /* Linux specific, getfh under SunOS */
181#define __NR_getdomainname 162 /* SunOS Specific */ 181#define __NR_getdomainname 162 /* SunOS Specific */
182#define __NR_setdomainname 163 /* Common */ 182#define __NR_setdomainname 163 /* Common */
183/* #define __NR_ni_syscall 164 ENOSYS under SunOS */ 183/* #define __NR_utrap_install 164 Linux sparc64 specific */
184#define __NR_quotactl 165 /* Common */ 184#define __NR_quotactl 165 /* Common */
185#define __NR_set_tid_address 166 /* Linux specific, exportfs under SunOS */ 185#define __NR_set_tid_address 166 /* Linux specific, exportfs under SunOS */
186#define __NR_mount 167 /* Common */ 186#define __NR_mount 167 /* Common */
@@ -248,7 +248,7 @@
248#define __NR_setfsgid 229 /* Linux Specific */ 248#define __NR_setfsgid 229 /* Linux Specific */
249#define __NR__newselect 230 /* Linux Specific */ 249#define __NR__newselect 230 /* Linux Specific */
250#define __NR_time 231 /* Linux Specific */ 250#define __NR_time 231 /* Linux Specific */
251/* #define __NR_oldstat 232 Linux Specific */ 251#define __NR_sys_splice 232 /* Linux Specific */
252#define __NR_stime 233 /* Linux Specific */ 252#define __NR_stime 233 /* Linux Specific */
253#define __NR_statfs64 234 /* Linux Specific */ 253#define __NR_statfs64 234 /* Linux Specific */
254#define __NR_fstatfs64 235 /* Linux Specific */ 254#define __NR_fstatfs64 235 /* Linux Specific */
@@ -271,7 +271,7 @@
271#define __NR_getsid 252 271#define __NR_getsid 252
272#define __NR_fdatasync 253 272#define __NR_fdatasync 253
273#define __NR_nfsservctl 254 273#define __NR_nfsservctl 254
274#define __NR_aplib 255 274#define __NR_sys_sync_file_range 255
275#define __NR_clock_settime 256 275#define __NR_clock_settime 256
276#define __NR_clock_gettime 257 276#define __NR_clock_gettime 257
277#define __NR_clock_getres 258 277#define __NR_clock_getres 258
diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h
index a284986b1541..d0544b4f47b7 100644
--- a/include/asm-sparc64/unistd.h
+++ b/include/asm-sparc64/unistd.h
@@ -250,7 +250,7 @@
250#ifdef __KERNEL__ 250#ifdef __KERNEL__
251#define __NR_time 231 /* Linux sparc32 */ 251#define __NR_time 231 /* Linux sparc32 */
252#endif 252#endif
253/* #define __NR_oldstat 232 Linux Specific */ 253#define __NR_sys_splice 232 /* Linux Specific */
254#define __NR_stime 233 /* Linux Specific */ 254#define __NR_stime 233 /* Linux Specific */
255#define __NR_statfs64 234 /* Linux Specific */ 255#define __NR_statfs64 234 /* Linux Specific */
256#define __NR_fstatfs64 235 /* Linux Specific */ 256#define __NR_fstatfs64 235 /* Linux Specific */
@@ -273,7 +273,7 @@
273#define __NR_getsid 252 273#define __NR_getsid 252
274#define __NR_fdatasync 253 274#define __NR_fdatasync 253
275#define __NR_nfsservctl 254 275#define __NR_nfsservctl 254
276#define __NR_aplib 255 276#define __NR_sys_sync_file_range 255
277#define __NR_clock_settime 256 277#define __NR_clock_settime 256
278#define __NR_clock_gettime 257 278#define __NR_clock_gettime 257
279#define __NR_clock_getres 258 279#define __NR_clock_getres 258
diff --git a/include/asm-um/desc.h b/include/asm-um/desc.h
index ac1d2a20d178..4ec34a51b62c 100644
--- a/include/asm-um/desc.h
+++ b/include/asm-um/desc.h
@@ -1,6 +1,16 @@
1#ifndef __UM_DESC_H 1#ifndef __UM_DESC_H
2#define __UM_DESC_H 2#define __UM_DESC_H
3 3
4#include "asm/arch/desc.h" 4/* Taken from asm-i386/desc.h, it's the only thing we need. The rest wouldn't
5 * compile, and has never been used. */
6#define LDT_empty(info) (\
7 (info)->base_addr == 0 && \
8 (info)->limit == 0 && \
9 (info)->contents == 0 && \
10 (info)->read_exec_only == 1 && \
11 (info)->seg_32bit == 0 && \
12 (info)->limit_in_pages == 0 && \
13 (info)->seg_not_present == 1 && \
14 (info)->useable == 0 )
5 15
6#endif 16#endif
diff --git a/include/asm-um/host_ldt-i386.h b/include/asm-um/host_ldt-i386.h
new file mode 100644
index 000000000000..b27cb0a9dd30
--- /dev/null
+++ b/include/asm-um/host_ldt-i386.h
@@ -0,0 +1,34 @@
1#ifndef __ASM_HOST_LDT_I386_H
2#define __ASM_HOST_LDT_I386_H
3
4#include "asm/arch/ldt.h"
5
6/*
7 * macros stolen from include/asm-i386/desc.h
8 */
9#define LDT_entry_a(info) \
10 ((((info)->base_addr & 0x0000ffff) << 16) | ((info)->limit & 0x0ffff))
11
12#define LDT_entry_b(info) \
13 (((info)->base_addr & 0xff000000) | \
14 (((info)->base_addr & 0x00ff0000) >> 16) | \
15 ((info)->limit & 0xf0000) | \
16 (((info)->read_exec_only ^ 1) << 9) | \
17 ((info)->contents << 10) | \
18 (((info)->seg_not_present ^ 1) << 15) | \
19 ((info)->seg_32bit << 22) | \
20 ((info)->limit_in_pages << 23) | \
21 ((info)->useable << 20) | \
22 0x7000)
23
24#define LDT_empty(info) (\
25 (info)->base_addr == 0 && \
26 (info)->limit == 0 && \
27 (info)->contents == 0 && \
28 (info)->read_exec_only == 1 && \
29 (info)->seg_32bit == 0 && \
30 (info)->limit_in_pages == 0 && \
31 (info)->seg_not_present == 1 && \
32 (info)->useable == 0 )
33
34#endif
diff --git a/include/asm-um/ldt-x86_64.h b/include/asm-um/host_ldt-x86_64.h
index 96b35aada79a..74a63f7d9a90 100644
--- a/include/asm-um/ldt-x86_64.h
+++ b/include/asm-um/host_ldt-x86_64.h
@@ -1,43 +1,8 @@
1/* 1#ifndef __ASM_HOST_LDT_X86_64_H
2 * Copyright (C) 2004 Fujitsu Siemens Computers GmbH 2#define __ASM_HOST_LDT_X86_64_H
3 * Licensed under the GPL
4 *
5 * Author: Bodo Stroesser <bstroesser@fujitsu-siemens.com>
6 */
7 3
8#ifndef __ASM_LDT_X86_64_H
9#define __ASM_LDT_X86_64_H
10
11#include "asm/semaphore.h"
12#include "asm/arch/ldt.h" 4#include "asm/arch/ldt.h"
13 5
14struct mmu_context_skas;
15extern void ldt_host_info(void);
16extern long init_new_ldt(struct mmu_context_skas * to_mm,
17 struct mmu_context_skas * from_mm);
18extern void free_ldt(struct mmu_context_skas * mm);
19
20#define LDT_PAGES_MAX \
21 ((LDT_ENTRIES * LDT_ENTRY_SIZE)/PAGE_SIZE)
22#define LDT_ENTRIES_PER_PAGE \
23 (PAGE_SIZE/LDT_ENTRY_SIZE)
24#define LDT_DIRECT_ENTRIES \
25 ((LDT_PAGES_MAX*sizeof(void *))/LDT_ENTRY_SIZE)
26
27struct ldt_entry {
28 __u32 a;
29 __u32 b;
30};
31
32typedef struct uml_ldt {
33 int entry_count;
34 struct semaphore semaphore;
35 union {
36 struct ldt_entry * pages[LDT_PAGES_MAX];
37 struct ldt_entry entries[LDT_DIRECT_ENTRIES];
38 } u;
39} uml_ldt_t;
40
41/* 6/*
42 * macros stolen from include/asm-x86_64/desc.h 7 * macros stolen from include/asm-x86_64/desc.h
43 */ 8 */
diff --git a/include/asm-um/ldt-i386.h b/include/asm-um/ldt-i386.h
deleted file mode 100644
index 175722a91164..000000000000
--- a/include/asm-um/ldt-i386.h
+++ /dev/null
@@ -1,69 +0,0 @@
1/*
2 * Copyright (C) 2004 Fujitsu Siemens Computers GmbH
3 * Licensed under the GPL
4 *
5 * Author: Bodo Stroesser <bstroesser@fujitsu-siemens.com>
6 */
7
8#ifndef __ASM_LDT_I386_H
9#define __ASM_LDT_I386_H
10
11#include "asm/semaphore.h"
12#include "asm/arch/ldt.h"
13
14struct mmu_context_skas;
15extern void ldt_host_info(void);
16extern long init_new_ldt(struct mmu_context_skas * to_mm,
17 struct mmu_context_skas * from_mm);
18extern void free_ldt(struct mmu_context_skas * mm);
19
20#define LDT_PAGES_MAX \
21 ((LDT_ENTRIES * LDT_ENTRY_SIZE)/PAGE_SIZE)
22#define LDT_ENTRIES_PER_PAGE \
23 (PAGE_SIZE/LDT_ENTRY_SIZE)
24#define LDT_DIRECT_ENTRIES \
25 ((LDT_PAGES_MAX*sizeof(void *))/LDT_ENTRY_SIZE)
26
27struct ldt_entry {
28 __u32 a;
29 __u32 b;
30};
31
32typedef struct uml_ldt {
33 int entry_count;
34 struct semaphore semaphore;
35 union {
36 struct ldt_entry * pages[LDT_PAGES_MAX];
37 struct ldt_entry entries[LDT_DIRECT_ENTRIES];
38 } u;
39} uml_ldt_t;
40
41/*
42 * macros stolen from include/asm-i386/desc.h
43 */
44#define LDT_entry_a(info) \
45 ((((info)->base_addr & 0x0000ffff) << 16) | ((info)->limit & 0x0ffff))
46
47#define LDT_entry_b(info) \
48 (((info)->base_addr & 0xff000000) | \
49 (((info)->base_addr & 0x00ff0000) >> 16) | \
50 ((info)->limit & 0xf0000) | \
51 (((info)->read_exec_only ^ 1) << 9) | \
52 ((info)->contents << 10) | \
53 (((info)->seg_not_present ^ 1) << 15) | \
54 ((info)->seg_32bit << 22) | \
55 ((info)->limit_in_pages << 23) | \
56 ((info)->useable << 20) | \
57 0x7000)
58
59#define LDT_empty(info) (\
60 (info)->base_addr == 0 && \
61 (info)->limit == 0 && \
62 (info)->contents == 0 && \
63 (info)->read_exec_only == 1 && \
64 (info)->seg_32bit == 0 && \
65 (info)->limit_in_pages == 0 && \
66 (info)->seg_not_present == 1 && \
67 (info)->useable == 0 )
68
69#endif
diff --git a/include/asm-um/ldt.h b/include/asm-um/ldt.h
new file mode 100644
index 000000000000..96f82a456ce6
--- /dev/null
+++ b/include/asm-um/ldt.h
@@ -0,0 +1,41 @@
1/*
2 * Copyright (C) 2004 Fujitsu Siemens Computers GmbH
3 * Licensed under the GPL
4 *
5 * Author: Bodo Stroesser <bstroesser@fujitsu-siemens.com>
6 */
7
8#ifndef __ASM_LDT_H
9#define __ASM_LDT_H
10
11#include "asm/semaphore.h"
12#include "asm/host_ldt.h"
13
14struct mmu_context_skas;
15extern void ldt_host_info(void);
16extern long init_new_ldt(struct mmu_context_skas * to_mm,
17 struct mmu_context_skas * from_mm);
18extern void free_ldt(struct mmu_context_skas * mm);
19
20#define LDT_PAGES_MAX \
21 ((LDT_ENTRIES * LDT_ENTRY_SIZE)/PAGE_SIZE)
22#define LDT_ENTRIES_PER_PAGE \
23 (PAGE_SIZE/LDT_ENTRY_SIZE)
24#define LDT_DIRECT_ENTRIES \
25 ((LDT_PAGES_MAX*sizeof(void *))/LDT_ENTRY_SIZE)
26
27struct ldt_entry {
28 __u32 a;
29 __u32 b;
30};
31
32typedef struct uml_ldt {
33 int entry_count;
34 struct semaphore semaphore;
35 union {
36 struct ldt_entry * pages[LDT_PAGES_MAX];
37 struct ldt_entry entries[LDT_DIRECT_ENTRIES];
38 } u;
39} uml_ldt_t;
40
41#endif
diff --git a/include/asm-um/processor-i386.h b/include/asm-um/processor-i386.h
index 4108a579eb92..595f1c3e1e40 100644
--- a/include/asm-um/processor-i386.h
+++ b/include/asm-um/processor-i386.h
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) 2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
@@ -6,21 +6,48 @@
6#ifndef __UM_PROCESSOR_I386_H 6#ifndef __UM_PROCESSOR_I386_H
7#define __UM_PROCESSOR_I386_H 7#define __UM_PROCESSOR_I386_H
8 8
9#include "linux/string.h"
10#include "asm/host_ldt.h"
11#include "asm/segment.h"
12
9extern int host_has_xmm; 13extern int host_has_xmm;
10extern int host_has_cmov; 14extern int host_has_cmov;
11 15
12/* include faultinfo structure */ 16/* include faultinfo structure */
13#include "sysdep/faultinfo.h" 17#include "sysdep/faultinfo.h"
14 18
19struct uml_tls_struct {
20 struct user_desc tls;
21 unsigned flushed:1;
22 unsigned present:1;
23};
24
15struct arch_thread { 25struct arch_thread {
26 struct uml_tls_struct tls_array[GDT_ENTRY_TLS_ENTRIES];
16 unsigned long debugregs[8]; 27 unsigned long debugregs[8];
17 int debugregs_seq; 28 int debugregs_seq;
18 struct faultinfo faultinfo; 29 struct faultinfo faultinfo;
19}; 30};
20 31
21#define INIT_ARCH_THREAD { .debugregs = { [ 0 ... 7 ] = 0 }, \ 32#define INIT_ARCH_THREAD { \
22 .debugregs_seq = 0, \ 33 .tls_array = { [ 0 ... GDT_ENTRY_TLS_ENTRIES - 1 ] = \
23 .faultinfo = { 0, 0, 0 } } 34 { .present = 0, .flushed = 0 } }, \
35 .debugregs = { [ 0 ... 7 ] = 0 }, \
36 .debugregs_seq = 0, \
37 .faultinfo = { 0, 0, 0 } \
38}
39
40static inline void arch_flush_thread(struct arch_thread *thread)
41{
42 /* Clear any TLS still hanging */
43 memset(&thread->tls_array, 0, sizeof(thread->tls_array));
44}
45
46static inline void arch_copy_thread(struct arch_thread *from,
47 struct arch_thread *to)
48{
49 memcpy(&to->tls_array, &from->tls_array, sizeof(from->tls_array));
50}
24 51
25#include "asm/arch/user.h" 52#include "asm/arch/user.h"
26 53
diff --git a/include/asm-um/processor-x86_64.h b/include/asm-um/processor-x86_64.h
index e1e1255a1d36..10609af376c0 100644
--- a/include/asm-um/processor-x86_64.h
+++ b/include/asm-um/processor-x86_64.h
@@ -28,6 +28,15 @@ extern inline void rep_nop(void)
28 .debugregs_seq = 0, \ 28 .debugregs_seq = 0, \
29 .faultinfo = { 0, 0, 0 } } 29 .faultinfo = { 0, 0, 0 } }
30 30
31static inline void arch_flush_thread(struct arch_thread *thread)
32{
33}
34
35static inline void arch_copy_thread(struct arch_thread *from,
36 struct arch_thread *to)
37{
38}
39
31#include "asm/arch/user.h" 40#include "asm/arch/user.h"
32 41
33#define current_text_addr() \ 42#define current_text_addr() \
diff --git a/include/asm-um/ptrace-generic.h b/include/asm-um/ptrace-generic.h
index 46599ac44037..503484305e67 100644
--- a/include/asm-um/ptrace-generic.h
+++ b/include/asm-um/ptrace-generic.h
@@ -28,7 +28,7 @@ struct pt_regs {
28 union uml_pt_regs regs; 28 union uml_pt_regs regs;
29}; 29};
30 30
31#define EMPTY_REGS { regs : EMPTY_UML_PT_REGS } 31#define EMPTY_REGS { .regs = EMPTY_UML_PT_REGS }
32 32
33#define PT_REGS_IP(r) UPT_IP(&(r)->regs) 33#define PT_REGS_IP(r) UPT_IP(&(r)->regs)
34#define PT_REGS_SP(r) UPT_SP(&(r)->regs) 34#define PT_REGS_SP(r) UPT_SP(&(r)->regs)
@@ -60,17 +60,9 @@ extern void show_regs(struct pt_regs *regs);
60extern void send_sigtrap(struct task_struct *tsk, union uml_pt_regs *regs, 60extern void send_sigtrap(struct task_struct *tsk, union uml_pt_regs *regs,
61 int error_code); 61 int error_code);
62 62
63#endif 63extern int arch_copy_tls(struct task_struct *new);
64extern void clear_flushed_tls(struct task_struct *task);
64 65
65#endif 66#endif
66 67
67/* 68#endif
68 * Overrides for Emacs so that we follow Linus's tabbing style.
69 * Emacs will notice this stuff at the end of the file and automatically
70 * adjust the settings for this buffer only. This must remain at the end
71 * of the file.
72 * ---------------------------------------------------------------------------
73 * Local variables:
74 * c-file-style: "linux"
75 * End:
76 */
diff --git a/include/asm-um/ptrace-i386.h b/include/asm-um/ptrace-i386.h
index fe882b9d917e..30656c962d74 100644
--- a/include/asm-um/ptrace-i386.h
+++ b/include/asm-um/ptrace-i386.h
@@ -8,8 +8,11 @@
8 8
9#define HOST_AUDIT_ARCH AUDIT_ARCH_I386 9#define HOST_AUDIT_ARCH AUDIT_ARCH_I386
10 10
11#include "linux/compiler.h"
11#include "sysdep/ptrace.h" 12#include "sysdep/ptrace.h"
12#include "asm/ptrace-generic.h" 13#include "asm/ptrace-generic.h"
14#include "asm/host_ldt.h"
15#include "choose-mode.h"
13 16
14#define PT_REGS_EAX(r) UPT_EAX(&(r)->regs) 17#define PT_REGS_EAX(r) UPT_EAX(&(r)->regs)
15#define PT_REGS_EBX(r) UPT_EBX(&(r)->regs) 18#define PT_REGS_EBX(r) UPT_EBX(&(r)->regs)
@@ -38,15 +41,31 @@
38 41
39#define user_mode(r) UPT_IS_USER(&(r)->regs) 42#define user_mode(r) UPT_IS_USER(&(r)->regs)
40 43
41#endif 44extern int ptrace_get_thread_area(struct task_struct *child, int idx,
45 struct user_desc __user *user_desc);
42 46
43/* 47extern int ptrace_set_thread_area(struct task_struct *child, int idx,
44 * Overrides for Emacs so that we follow Linus's tabbing style. 48 struct user_desc __user *user_desc);
45 * Emacs will notice this stuff at the end of the file and automatically 49
46 * adjust the settings for this buffer only. This must remain at the end 50extern int do_set_thread_area_skas(struct user_desc *info);
47 * of the file. 51extern int do_get_thread_area_skas(struct user_desc *info);
48 * --------------------------------------------------------------------------- 52
49 * Local variables: 53extern int do_set_thread_area_tt(struct user_desc *info);
50 * c-file-style: "linux" 54extern int do_get_thread_area_tt(struct user_desc *info);
51 * End: 55
52 */ 56extern int arch_switch_tls_skas(struct task_struct *from, struct task_struct *to);
57extern int arch_switch_tls_tt(struct task_struct *from, struct task_struct *to);
58
59static inline int do_get_thread_area(struct user_desc *info)
60{
61 return CHOOSE_MODE_PROC(do_get_thread_area_tt, do_get_thread_area_skas, info);
62}
63
64static inline int do_set_thread_area(struct user_desc *info)
65{
66 return CHOOSE_MODE_PROC(do_set_thread_area_tt, do_set_thread_area_skas, info);
67}
68
69struct task_struct;
70
71#endif
diff --git a/include/asm-um/ptrace-x86_64.h b/include/asm-um/ptrace-x86_64.h
index be51219a8ffe..c894e68b1f96 100644
--- a/include/asm-um/ptrace-x86_64.h
+++ b/include/asm-um/ptrace-x86_64.h
@@ -8,6 +8,8 @@
8#define __UM_PTRACE_X86_64_H 8#define __UM_PTRACE_X86_64_H
9 9
10#include "linux/compiler.h" 10#include "linux/compiler.h"
11#include "asm/errno.h"
12#include "asm/host_ldt.h"
11 13
12#define signal_fault signal_fault_x86_64 14#define signal_fault signal_fault_x86_64
13#define __FRAME_OFFSETS /* Needed to get the R* macros */ 15#define __FRAME_OFFSETS /* Needed to get the R* macros */
@@ -63,15 +65,26 @@ void signal_fault(struct pt_regs_subarch *regs, void *frame, char *where);
63 65
64#define profile_pc(regs) PT_REGS_IP(regs) 66#define profile_pc(regs) PT_REGS_IP(regs)
65 67
66#endif 68static inline int ptrace_get_thread_area(struct task_struct *child, int idx,
69 struct user_desc __user *user_desc)
70{
71 return -ENOSYS;
72}
67 73
68/* 74static inline int ptrace_set_thread_area(struct task_struct *child, int idx,
69 * Overrides for Emacs so that we follow Linus's tabbing style. 75 struct user_desc __user *user_desc)
70 * Emacs will notice this stuff at the end of the file and automatically 76{
71 * adjust the settings for this buffer only. This must remain at the end 77 return -ENOSYS;
72 * of the file. 78}
73 * --------------------------------------------------------------------------- 79
74 * Local variables: 80static inline void arch_switch_to_tt(struct task_struct *from,
75 * c-file-style: "linux" 81 struct task_struct *to)
76 * End: 82{
77 */ 83}
84
85static inline void arch_switch_to_skas(struct task_struct *from,
86 struct task_struct *to)
87{
88}
89
90#endif
diff --git a/include/asm-um/segment.h b/include/asm-um/segment.h
index 55e40301f625..45183fcd10b6 100644
--- a/include/asm-um/segment.h
+++ b/include/asm-um/segment.h
@@ -1,4 +1,10 @@
1#ifndef __UM_SEGMENT_H 1#ifndef __UM_SEGMENT_H
2#define __UM_SEGMENT_H 2#define __UM_SEGMENT_H
3 3
4extern int host_gdt_entry_tls_min;
5
6#define GDT_ENTRY_TLS_ENTRIES 3
7#define GDT_ENTRY_TLS_MIN host_gdt_entry_tls_min
8#define GDT_ENTRY_TLS_MAX (GDT_ENTRY_TLS_MIN + GDT_ENTRY_TLS_ENTRIES - 1)
9
4#endif 10#endif
diff --git a/include/asm-um/thread_info.h b/include/asm-um/thread_info.h
index 17b6b07c4332..f166b9837c6a 100644
--- a/include/asm-um/thread_info.h
+++ b/include/asm-um/thread_info.h
@@ -27,14 +27,14 @@ struct thread_info {
27 27
28#define INIT_THREAD_INFO(tsk) \ 28#define INIT_THREAD_INFO(tsk) \
29{ \ 29{ \
30 task: &tsk, \ 30 .task = &tsk, \
31 exec_domain: &default_exec_domain, \ 31 .exec_domain = &default_exec_domain, \
32 flags: 0, \ 32 .flags = 0, \
33 cpu: 0, \ 33 .cpu = 0, \
34 preempt_count: 1, \ 34 .preempt_count = 1, \
35 addr_limit: KERNEL_DS, \ 35 .addr_limit = KERNEL_DS, \
36 restart_block: { \ 36 .restart_block = { \
37 fn: do_no_restart_syscall, \ 37 .fn = do_no_restart_syscall, \
38 }, \ 38 }, \
39} 39}
40 40
diff --git a/include/asm-um/uaccess.h b/include/asm-um/uaccess.h
index 4e460d6f5ac8..bea5a015f667 100644
--- a/include/asm-um/uaccess.h
+++ b/include/asm-um/uaccess.h
@@ -57,7 +57,7 @@
57({ \ 57({ \
58 const __typeof__((*(ptr))) __user *private_ptr = (ptr); \ 58 const __typeof__((*(ptr))) __user *private_ptr = (ptr); \
59 (access_ok(VERIFY_READ, private_ptr, sizeof(*private_ptr)) ? \ 59 (access_ok(VERIFY_READ, private_ptr, sizeof(*private_ptr)) ? \
60 __get_user(x, private_ptr) : ((x) = 0, -EFAULT)); \ 60 __get_user(x, private_ptr) : ((x) = (__typeof__(*ptr))0, -EFAULT)); \
61}) 61})
62 62
63#define __put_user(x, ptr) \ 63#define __put_user(x, ptr) \
diff --git a/include/asm-x86_64/local.h b/include/asm-x86_64/local.h
index bf148037d4e5..cd17945bf218 100644
--- a/include/asm-x86_64/local.h
+++ b/include/asm-x86_64/local.h
@@ -5,7 +5,7 @@
5 5
6typedef struct 6typedef struct
7{ 7{
8 volatile unsigned long counter; 8 volatile long counter;
9} local_t; 9} local_t;
10 10
11#define LOCAL_INIT(i) { (i) } 11#define LOCAL_INIT(i) { (i) }
@@ -13,7 +13,7 @@ typedef struct
13#define local_read(v) ((v)->counter) 13#define local_read(v) ((v)->counter)
14#define local_set(v,i) (((v)->counter) = (i)) 14#define local_set(v,i) (((v)->counter) = (i))
15 15
16static __inline__ void local_inc(local_t *v) 16static inline void local_inc(local_t *v)
17{ 17{
18 __asm__ __volatile__( 18 __asm__ __volatile__(
19 "incq %0" 19 "incq %0"
@@ -21,7 +21,7 @@ static __inline__ void local_inc(local_t *v)
21 :"m" (v->counter)); 21 :"m" (v->counter));
22} 22}
23 23
24static __inline__ void local_dec(local_t *v) 24static inline void local_dec(local_t *v)
25{ 25{
26 __asm__ __volatile__( 26 __asm__ __volatile__(
27 "decq %0" 27 "decq %0"
@@ -29,7 +29,7 @@ static __inline__ void local_dec(local_t *v)
29 :"m" (v->counter)); 29 :"m" (v->counter));
30} 30}
31 31
32static __inline__ void local_add(unsigned int i, local_t *v) 32static inline void local_add(long i, local_t *v)
33{ 33{
34 __asm__ __volatile__( 34 __asm__ __volatile__(
35 "addq %1,%0" 35 "addq %1,%0"
@@ -37,7 +37,7 @@ static __inline__ void local_add(unsigned int i, local_t *v)
37 :"ir" (i), "m" (v->counter)); 37 :"ir" (i), "m" (v->counter));
38} 38}
39 39
40static __inline__ void local_sub(unsigned int i, local_t *v) 40static inline void local_sub(long i, local_t *v)
41{ 41{
42 __asm__ __volatile__( 42 __asm__ __volatile__(
43 "subq %1,%0" 43 "subq %1,%0"
diff --git a/include/linux/backlight.h b/include/linux/backlight.h
index bb9e54322322..75e91f5b6a04 100644
--- a/include/linux/backlight.h
+++ b/include/linux/backlight.h
@@ -19,20 +19,25 @@ struct fb_info;
19struct backlight_properties { 19struct backlight_properties {
20 /* Owner module */ 20 /* Owner module */
21 struct module *owner; 21 struct module *owner;
22 /* Get the backlight power status (0: full on, 1..3: power saving 22
23 modes; 4: full off), see FB_BLANK_XXX */ 23 /* Notify the backlight driver some property has changed */
24 int (*get_power)(struct backlight_device *); 24 int (*update_status)(struct backlight_device *);
25 /* Enable or disable power to the LCD (0: on; 4: off, see FB_BLANK_XXX) */ 25 /* Return the current backlight brightness (accounting for power,
26 int (*set_power)(struct backlight_device *, int power); 26 fb_blank etc.) */
27 /* Maximal value for brightness (read-only) */
28 int max_brightness;
29 /* Get current backlight brightness */
30 int (*get_brightness)(struct backlight_device *); 27 int (*get_brightness)(struct backlight_device *);
31 /* Set backlight brightness (0..max_brightness) */
32 int (*set_brightness)(struct backlight_device *, int brightness);
33 /* Check if given framebuffer device is the one bound to this backlight; 28 /* Check if given framebuffer device is the one bound to this backlight;
34 return 0 if not, !=0 if it is. If NULL, backlight always matches the fb. */ 29 return 0 if not, !=0 if it is. If NULL, backlight always matches the fb. */
35 int (*check_fb)(struct fb_info *); 30 int (*check_fb)(struct fb_info *);
31
32 /* Current User requested brightness (0 - max_brightness) */
33 int brightness;
34 /* Maximal value for brightness (read-only) */
35 int max_brightness;
36 /* Current FB Power mode (0: full on, 1..3: power saving
37 modes; 4: full off), see FB_BLANK_XXX */
38 int power;
39 /* FB Blanking active? (values as for power) */
40 int fb_blank;
36}; 41};
37 42
38struct backlight_device { 43struct backlight_device {
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index d10bd30c337e..836325ee0931 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -275,6 +275,7 @@ extern void d_move(struct dentry *, struct dentry *);
275/* appendix may either be NULL or be used for transname suffixes */ 275/* appendix may either be NULL or be used for transname suffixes */
276extern struct dentry * d_lookup(struct dentry *, struct qstr *); 276extern struct dentry * d_lookup(struct dentry *, struct qstr *);
277extern struct dentry * __d_lookup(struct dentry *, struct qstr *); 277extern struct dentry * __d_lookup(struct dentry *, struct qstr *);
278extern struct dentry * d_hash_and_lookup(struct dentry *, struct qstr *);
278 279
279/* validate "insecure" dentry pointer */ 280/* validate "insecure" dentry pointer */
280extern int d_validate(struct dentry *, struct dentry *); 281extern int d_validate(struct dentry *, struct dentry *);
diff --git a/include/linux/fadvise.h b/include/linux/fadvise.h
index b2913bba35d8..e8e747139b9a 100644
--- a/include/linux/fadvise.h
+++ b/include/linux/fadvise.h
@@ -18,10 +18,4 @@
18#define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */ 18#define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
19#endif 19#endif
20 20
21/*
22 * Linux-specific fadvise() extensions:
23 */
24#define LINUX_FADV_ASYNC_WRITE 32 /* Start writeout on range */
25#define LINUX_FADV_WRITE_WAIT 33 /* Wait upon writeout to range */
26
27#endif /* FADVISE_H_INCLUDED */ 21#endif /* FADVISE_H_INCLUDED */
diff --git a/include/linux/fb.h b/include/linux/fb.h
index d03fadfcafe3..315d89740ddf 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -839,12 +839,10 @@ struct fb_info {
839#define FB_LEFT_POS(bpp) (32 - bpp) 839#define FB_LEFT_POS(bpp) (32 - bpp)
840#define FB_SHIFT_HIGH(val, bits) ((val) >> (bits)) 840#define FB_SHIFT_HIGH(val, bits) ((val) >> (bits))
841#define FB_SHIFT_LOW(val, bits) ((val) << (bits)) 841#define FB_SHIFT_LOW(val, bits) ((val) << (bits))
842#define FB_BIT_NR(b) (7 - (b))
843#else 842#else
844#define FB_LEFT_POS(bpp) (0) 843#define FB_LEFT_POS(bpp) (0)
845#define FB_SHIFT_HIGH(val, bits) ((val) << (bits)) 844#define FB_SHIFT_HIGH(val, bits) ((val) << (bits))
846#define FB_SHIFT_LOW(val, bits) ((val) >> (bits)) 845#define FB_SHIFT_LOW(val, bits) ((val) >> (bits))
847#define FB_BIT_NR(b) (b)
848#endif 846#endif
849 847
850 /* 848 /*
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 20fa5f6d7269..1e9ebaba07b7 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -757,6 +757,13 @@ extern void send_sigio(struct fown_struct *fown, int fd, int band);
757extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg); 757extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg);
758extern int fcntl_getlease(struct file *filp); 758extern int fcntl_getlease(struct file *filp);
759 759
760/* fs/sync.c */
761#define SYNC_FILE_RANGE_WAIT_BEFORE 1
762#define SYNC_FILE_RANGE_WRITE 2
763#define SYNC_FILE_RANGE_WAIT_AFTER 4
764extern int do_sync_file_range(struct file *file, loff_t offset, loff_t endbyte,
765 int flags);
766
760/* fs/locks.c */ 767/* fs/locks.c */
761extern void locks_init_lock(struct file_lock *); 768extern void locks_init_lock(struct file_lock *);
762extern void locks_copy_lock(struct file_lock *, struct file_lock *); 769extern void locks_copy_lock(struct file_lock *, struct file_lock *);
@@ -857,7 +864,7 @@ struct super_block {
857 */ 864 */
858 struct mutex s_vfs_rename_mutex; /* Kludge */ 865 struct mutex s_vfs_rename_mutex; /* Kludge */
859 866
860 /* Granuality of c/m/atime in ns. 867 /* Granularity of c/m/atime in ns.
861 Cannot be worse than a second */ 868 Cannot be worse than a second */
862 u32 s_time_gran; 869 u32 s_time_gran;
863}; 870};
@@ -1413,6 +1420,7 @@ extern void bd_release_from_disk(struct block_device *, struct gendisk *);
1413#endif 1420#endif
1414 1421
1415/* fs/char_dev.c */ 1422/* fs/char_dev.c */
1423#define CHRDEV_MAJOR_HASH_SIZE 255
1416extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *); 1424extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *);
1417extern int register_chrdev_region(dev_t, unsigned, const char *); 1425extern int register_chrdev_region(dev_t, unsigned, const char *);
1418extern int register_chrdev(unsigned int, const char *, 1426extern int register_chrdev(unsigned int, const char *,
@@ -1420,25 +1428,17 @@ extern int register_chrdev(unsigned int, const char *,
1420extern int unregister_chrdev(unsigned int, const char *); 1428extern int unregister_chrdev(unsigned int, const char *);
1421extern void unregister_chrdev_region(dev_t, unsigned); 1429extern void unregister_chrdev_region(dev_t, unsigned);
1422extern int chrdev_open(struct inode *, struct file *); 1430extern int chrdev_open(struct inode *, struct file *);
1423extern int get_chrdev_list(char *); 1431extern void chrdev_show(struct seq_file *,off_t);
1424extern void *acquire_chrdev_list(void);
1425extern int count_chrdev_list(void);
1426extern void *get_next_chrdev(void *);
1427extern int get_chrdev_info(void *, int *, char **);
1428extern void release_chrdev_list(void *);
1429 1432
1430/* fs/block_dev.c */ 1433/* fs/block_dev.c */
1434#define BLKDEV_MAJOR_HASH_SIZE 255
1431#define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */ 1435#define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */
1432extern const char *__bdevname(dev_t, char *buffer); 1436extern const char *__bdevname(dev_t, char *buffer);
1433extern const char *bdevname(struct block_device *bdev, char *buffer); 1437extern const char *bdevname(struct block_device *bdev, char *buffer);
1434extern struct block_device *lookup_bdev(const char *); 1438extern struct block_device *lookup_bdev(const char *);
1435extern struct block_device *open_bdev_excl(const char *, int, void *); 1439extern struct block_device *open_bdev_excl(const char *, int, void *);
1436extern void close_bdev_excl(struct block_device *); 1440extern void close_bdev_excl(struct block_device *);
1437extern void *acquire_blkdev_list(void); 1441extern void blkdev_show(struct seq_file *,off_t);
1438extern int count_blkdev_list(void);
1439extern void *get_next_blkdev(void *);
1440extern int get_blkdev_info(void *, int *, char **);
1441extern void release_blkdev_list(void *);
1442 1442
1443extern void init_special_inode(struct inode *, umode_t, dev_t); 1443extern void init_special_inode(struct inode *, umode_t, dev_t);
1444 1444
diff --git a/include/linux/gameport.h b/include/linux/gameport.h
index 9c8e6da2393b..71e7b2847cb3 100644
--- a/include/linux/gameport.h
+++ b/include/linux/gameport.h
@@ -11,6 +11,7 @@
11 11
12#include <asm/io.h> 12#include <asm/io.h>
13#include <linux/list.h> 13#include <linux/list.h>
14#include <linux/mutex.h>
14#include <linux/device.h> 15#include <linux/device.h>
15#include <linux/timer.h> 16#include <linux/timer.h>
16 17
@@ -40,7 +41,7 @@ struct gameport {
40 struct gameport *parent, *child; 41 struct gameport *parent, *child;
41 42
42 struct gameport_driver *drv; 43 struct gameport_driver *drv;
43 struct semaphore drv_sem; /* protects serio->drv so attributes can pin driver */ 44 struct mutex drv_mutex; /* protects serio->drv so attributes can pin driver */
44 45
45 struct device dev; 46 struct device dev;
46 unsigned int registered; /* port has been fully registered with driver core */ 47 unsigned int registered; /* port has been fully registered with driver core */
@@ -137,12 +138,12 @@ static inline void gameport_set_drvdata(struct gameport *gameport, void *data)
137 */ 138 */
138static inline int gameport_pin_driver(struct gameport *gameport) 139static inline int gameport_pin_driver(struct gameport *gameport)
139{ 140{
140 return down_interruptible(&gameport->drv_sem); 141 return mutex_lock_interruptible(&gameport->drv_mutex);
141} 142}
142 143
143static inline void gameport_unpin_driver(struct gameport *gameport) 144static inline void gameport_unpin_driver(struct gameport *gameport)
144{ 145{
145 up(&gameport->drv_sem); 146 mutex_unlock(&gameport->drv_mutex);
146} 147}
147 148
148void __gameport_register_driver(struct gameport_driver *drv, struct module *owner); 149void __gameport_register_driver(struct gameport_driver *drv, struct module *owner);
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 93830158348e..306acf1dc6d5 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -58,6 +58,19 @@ struct hrtimer {
58}; 58};
59 59
60/** 60/**
61 * struct hrtimer_sleeper - simple sleeper structure
62 *
63 * @timer: embedded timer structure
64 * @task: task to wake up
65 *
66 * task is set to NULL, when the timer expires.
67 */
68struct hrtimer_sleeper {
69 struct hrtimer timer;
70 struct task_struct *task;
71};
72
73/**
61 * struct hrtimer_base - the timer base for a specific clock 74 * struct hrtimer_base - the timer base for a specific clock
62 * 75 *
63 * @index: clock type index for per_cpu support when moving a timer 76 * @index: clock type index for per_cpu support when moving a timer
@@ -67,7 +80,7 @@ struct hrtimer {
67 * @first: pointer to the timer node which expires first 80 * @first: pointer to the timer node which expires first
68 * @resolution: the resolution of the clock, in nanoseconds 81 * @resolution: the resolution of the clock, in nanoseconds
69 * @get_time: function to retrieve the current time of the clock 82 * @get_time: function to retrieve the current time of the clock
70 * @get_sofirq_time: function to retrieve the current time from the softirq 83 * @get_softirq_time: function to retrieve the current time from the softirq
71 * @curr_timer: the timer which is executing a callback right now 84 * @curr_timer: the timer which is executing a callback right now
72 * @softirq_time: the time when running the hrtimer queue in the softirq 85 * @softirq_time: the time when running the hrtimer queue in the softirq
73 */ 86 */
@@ -127,6 +140,9 @@ extern long hrtimer_nanosleep(struct timespec *rqtp,
127 const enum hrtimer_mode mode, 140 const enum hrtimer_mode mode,
128 const clockid_t clockid); 141 const clockid_t clockid);
129 142
143extern void hrtimer_init_sleeper(struct hrtimer_sleeper *sl,
144 struct task_struct *tsk);
145
130/* Soft interrupt function to run the hrtimer queues: */ 146/* Soft interrupt function to run the hrtimer queues: */
131extern void hrtimer_run_queues(void); 147extern void hrtimer_run_queues(void);
132 148
diff --git a/include/linux/input.h b/include/linux/input.h
index 1d4e341b72e6..b0e612dda0cf 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -421,7 +421,7 @@ struct input_absinfo {
421#define BTN_GEAR_UP 0x151 421#define BTN_GEAR_UP 0x151
422 422
423#define KEY_OK 0x160 423#define KEY_OK 0x160
424#define KEY_SELECT 0x161 424#define KEY_SELECT 0x161
425#define KEY_GOTO 0x162 425#define KEY_GOTO 0x162
426#define KEY_CLEAR 0x163 426#define KEY_CLEAR 0x163
427#define KEY_POWER2 0x164 427#define KEY_POWER2 0x164
@@ -512,6 +512,15 @@ struct input_absinfo {
512#define KEY_FN_S 0x1e3 512#define KEY_FN_S 0x1e3
513#define KEY_FN_B 0x1e4 513#define KEY_FN_B 0x1e4
514 514
515#define KEY_BRL_DOT1 0x1f1
516#define KEY_BRL_DOT2 0x1f2
517#define KEY_BRL_DOT3 0x1f3
518#define KEY_BRL_DOT4 0x1f4
519#define KEY_BRL_DOT5 0x1f5
520#define KEY_BRL_DOT6 0x1f6
521#define KEY_BRL_DOT7 0x1f7
522#define KEY_BRL_DOT8 0x1f8
523
515/* We avoid low common keys in module aliases so they don't get huge. */ 524/* We avoid low common keys in module aliases so they don't get huge. */
516#define KEY_MIN_INTERESTING KEY_MUTE 525#define KEY_MIN_INTERESTING KEY_MUTE
517#define KEY_MAX 0x1ff 526#define KEY_MAX 0x1ff
@@ -929,7 +938,7 @@ struct input_dev {
929 938
930 struct input_handle *grab; 939 struct input_handle *grab;
931 940
932 struct semaphore sem; /* serializes open and close operations */ 941 struct mutex mutex; /* serializes open and close operations */
933 unsigned int users; 942 unsigned int users;
934 943
935 struct class_device cdev; 944 struct class_device cdev;
@@ -995,11 +1004,6 @@ static inline void init_input_dev(struct input_dev *dev)
995 1004
996struct input_dev *input_allocate_device(void); 1005struct input_dev *input_allocate_device(void);
997 1006
998static inline void input_free_device(struct input_dev *dev)
999{
1000 kfree(dev);
1001}
1002
1003static inline struct input_dev *input_get_device(struct input_dev *dev) 1007static inline struct input_dev *input_get_device(struct input_dev *dev)
1004{ 1008{
1005 return to_input_dev(class_device_get(&dev->cdev)); 1009 return to_input_dev(class_device_get(&dev->cdev));
@@ -1010,6 +1014,11 @@ static inline void input_put_device(struct input_dev *dev)
1010 class_device_put(&dev->cdev); 1014 class_device_put(&dev->cdev);
1011} 1015}
1012 1016
1017static inline void input_free_device(struct input_dev *dev)
1018{
1019 input_put_device(dev);
1020}
1021
1013int input_register_device(struct input_dev *); 1022int input_register_device(struct input_dev *);
1014void input_unregister_device(struct input_dev *); 1023void input_unregister_device(struct input_dev *);
1015 1024
diff --git a/include/linux/ipmi_smi.h b/include/linux/ipmi_smi.h
index 53571288a9fc..6d9c7e4da472 100644
--- a/include/linux/ipmi_smi.h
+++ b/include/linux/ipmi_smi.h
@@ -82,6 +82,13 @@ struct ipmi_smi_handlers
82{ 82{
83 struct module *owner; 83 struct module *owner;
84 84
85 /* The low-level interface cannot start sending messages to
86 the upper layer until this function is called. This may
87 not be NULL, the lower layer must take the interface from
88 this call. */
89 int (*start_processing)(void *send_info,
90 ipmi_smi_t new_intf);
91
85 /* Called to enqueue an SMI message to be sent. This 92 /* Called to enqueue an SMI message to be sent. This
86 operation is not allowed to fail. If an error occurs, it 93 operation is not allowed to fail. If an error occurs, it
87 should report back the error in a received message. It may 94 should report back the error in a received message. It may
@@ -157,13 +164,16 @@ static inline void ipmi_demangle_device_id(unsigned char *data,
157} 164}
158 165
159/* Add a low-level interface to the IPMI driver. Note that if the 166/* Add a low-level interface to the IPMI driver. Note that if the
160 interface doesn't know its slave address, it should pass in zero. */ 167 interface doesn't know its slave address, it should pass in zero.
168 The low-level interface should not deliver any messages to the
169 upper layer until the start_processing() function in the handlers
170 is called, and the lower layer must get the interface from that
171 call. */
161int ipmi_register_smi(struct ipmi_smi_handlers *handlers, 172int ipmi_register_smi(struct ipmi_smi_handlers *handlers,
162 void *send_info, 173 void *send_info,
163 struct ipmi_device_id *device_id, 174 struct ipmi_device_id *device_id,
164 struct device *dev, 175 struct device *dev,
165 unsigned char slave_addr, 176 unsigned char slave_addr);
166 ipmi_smi_t *intf);
167 177
168/* 178/*
169 * Remove a low-level interface from the IPMI driver. This will 179 * Remove a low-level interface from the IPMI driver. This will
diff --git a/include/linux/kbd_kern.h b/include/linux/kbd_kern.h
index e87c32a5c86a..4eb851ece080 100644
--- a/include/linux/kbd_kern.h
+++ b/include/linux/kbd_kern.h
@@ -135,6 +135,8 @@ static inline void chg_vc_kbd_led(struct kbd_struct * kbd, int flag)
135 135
136#define U(x) ((x) ^ 0xf000) 136#define U(x) ((x) ^ 0xf000)
137 137
138#define BRL_UC_ROW 0x2800
139
138/* keyboard.c */ 140/* keyboard.c */
139 141
140struct console; 142struct console;
diff --git a/include/linux/keyboard.h b/include/linux/keyboard.h
index 08488042d74a..de76843bbe8a 100644
--- a/include/linux/keyboard.h
+++ b/include/linux/keyboard.h
@@ -44,6 +44,7 @@ extern unsigned short plain_map[NR_KEYS];
44#define KT_ASCII 9 44#define KT_ASCII 9
45#define KT_LOCK 10 45#define KT_LOCK 10
46#define KT_SLOCK 12 46#define KT_SLOCK 12
47#define KT_BRL 14
47 48
48#define K(t,v) (((t)<<8)|(v)) 49#define K(t,v) (((t)<<8)|(v))
49#define KTYP(x) ((x) >> 8) 50#define KTYP(x) ((x) >> 8)
@@ -427,5 +428,17 @@ extern unsigned short plain_map[NR_KEYS];
427 428
428#define NR_LOCK 8 429#define NR_LOCK 8
429 430
431#define K_BRL_BLANK K(KT_BRL, 0)
432#define K_BRL_DOT1 K(KT_BRL, 1)
433#define K_BRL_DOT2 K(KT_BRL, 2)
434#define K_BRL_DOT3 K(KT_BRL, 3)
435#define K_BRL_DOT4 K(KT_BRL, 4)
436#define K_BRL_DOT5 K(KT_BRL, 5)
437#define K_BRL_DOT6 K(KT_BRL, 6)
438#define K_BRL_DOT7 K(KT_BRL, 7)
439#define K_BRL_DOT8 K(KT_BRL, 8)
440
441#define NR_BRL 9
442
430#define MAX_DIACR 256 443#define MAX_DIACR 256
431#endif 444#endif
diff --git a/include/linux/leds.h b/include/linux/leds.h
new file mode 100644
index 000000000000..4617e75903b0
--- /dev/null
+++ b/include/linux/leds.h
@@ -0,0 +1,111 @@
1/*
2 * Driver model for leds and led triggers
3 *
4 * Copyright (C) 2005 John Lenz <lenz@cs.wisc.edu>
5 * Copyright (C) 2005 Richard Purdie <rpurdie@openedhand.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 */
12#ifndef __LINUX_LEDS_H_INCLUDED
13#define __LINUX_LEDS_H_INCLUDED
14
15struct device;
16struct class_device;
17/*
18 * LED Core
19 */
20
21enum led_brightness {
22 LED_OFF = 0,
23 LED_HALF = 127,
24 LED_FULL = 255,
25};
26
27struct led_classdev {
28 const char *name;
29 int brightness;
30 int flags;
31#define LED_SUSPENDED (1 << 0)
32
33 /* A function to set the brightness of the led */
34 void (*brightness_set)(struct led_classdev *led_cdev,
35 enum led_brightness brightness);
36
37 struct class_device *class_dev;
38 /* LED Device linked list */
39 struct list_head node;
40
41 /* Trigger data */
42 char *default_trigger;
43#ifdef CONFIG_LEDS_TRIGGERS
44 rwlock_t trigger_lock;
45 /* Protects the trigger data below */
46
47 struct led_trigger *trigger;
48 struct list_head trig_list;
49 void *trigger_data;
50#endif
51};
52
53extern int led_classdev_register(struct device *parent,
54 struct led_classdev *led_cdev);
55extern void led_classdev_unregister(struct led_classdev *led_cdev);
56extern void led_classdev_suspend(struct led_classdev *led_cdev);
57extern void led_classdev_resume(struct led_classdev *led_cdev);
58
59/*
60 * LED Triggers
61 */
62#ifdef CONFIG_LEDS_TRIGGERS
63
64#define TRIG_NAME_MAX 50
65
66struct led_trigger {
67 /* Trigger Properties */
68 const char *name;
69 void (*activate)(struct led_classdev *led_cdev);
70 void (*deactivate)(struct led_classdev *led_cdev);
71
72 /* LEDs under control by this trigger (for simple triggers) */
73 rwlock_t leddev_list_lock;
74 struct list_head led_cdevs;
75
76 /* Link to next registered trigger */
77 struct list_head next_trig;
78};
79
80/* Registration functions for complex triggers */
81extern int led_trigger_register(struct led_trigger *trigger);
82extern void led_trigger_unregister(struct led_trigger *trigger);
83
84/* Registration functions for simple triggers */
85#define DEFINE_LED_TRIGGER(x) static struct led_trigger *x;
86#define DEFINE_LED_TRIGGER_GLOBAL(x) struct led_trigger *x;
87extern void led_trigger_register_simple(const char *name,
88 struct led_trigger **trigger);
89extern void led_trigger_unregister_simple(struct led_trigger *trigger);
90extern void led_trigger_event(struct led_trigger *trigger,
91 enum led_brightness event);
92
93#else
94
95/* Triggers aren't active - null macros */
96#define DEFINE_LED_TRIGGER(x)
97#define DEFINE_LED_TRIGGER_GLOBAL(x)
98#define led_trigger_register_simple(x, y) do {} while(0)
99#define led_trigger_unregister_simple(x) do {} while(0)
100#define led_trigger_event(x, y) do {} while(0)
101
102#endif
103
104/* Trigger specific functions */
105#ifdef CONFIG_LEDS_TRIGGER_IDE_DISK
106extern void ledtrig_ide_activity(void);
107#else
108#define ledtrig_ide_activity() do {} while(0)
109#endif
110
111#endif /* __LINUX_LEDS_H_INCLUDED */
diff --git a/include/linux/libps2.h b/include/linux/libps2.h
index a710bddda4eb..08a450a9dbf7 100644
--- a/include/linux/libps2.h
+++ b/include/linux/libps2.h
@@ -28,7 +28,7 @@ struct ps2dev {
28 struct serio *serio; 28 struct serio *serio;
29 29
30 /* Ensures that only one command is executing at a time */ 30 /* Ensures that only one command is executing at a time */
31 struct semaphore cmd_sem; 31 struct mutex cmd_mutex;
32 32
33 /* Used to signal completion from interrupt handler */ 33 /* Used to signal completion from interrupt handler */
34 wait_queue_head_t wait; 34 wait_queue_head_t wait;
diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index 7d09962c3c0b..ff0a64073ebc 100644
--- a/include/linux/migrate.h
+++ b/include/linux/migrate.h
@@ -12,7 +12,7 @@ extern void migrate_page_copy(struct page *, struct page *);
12extern int migrate_page_remove_references(struct page *, struct page *, int); 12extern int migrate_page_remove_references(struct page *, struct page *, int);
13extern int migrate_pages(struct list_head *l, struct list_head *t, 13extern int migrate_pages(struct list_head *l, struct list_head *t,
14 struct list_head *moved, struct list_head *failed); 14 struct list_head *moved, struct list_head *failed);
15int migrate_pages_to(struct list_head *pagelist, 15extern int migrate_pages_to(struct list_head *pagelist,
16 struct vm_area_struct *vma, int dest); 16 struct vm_area_struct *vma, int dest);
17extern int fail_migrate_page(struct page *, struct page *); 17extern int fail_migrate_page(struct page *, struct page *);
18 18
@@ -26,6 +26,9 @@ static inline int putback_lru_pages(struct list_head *l) { return 0; }
26static inline int migrate_pages(struct list_head *l, struct list_head *t, 26static inline int migrate_pages(struct list_head *l, struct list_head *t,
27 struct list_head *moved, struct list_head *failed) { return -ENOSYS; } 27 struct list_head *moved, struct list_head *failed) { return -ENOSYS; }
28 28
29static inline int migrate_pages_to(struct list_head *pagelist,
30 struct vm_area_struct *vma, int dest) { return 0; }
31
29static inline int migrate_prep(void) { return -ENOSYS; } 32static inline int migrate_prep(void) { return -ENOSYS; }
30 33
31/* Possible settings for the migrate_page() method in address_operations */ 34/* Possible settings for the migrate_page() method in address_operations */
diff --git a/include/linux/mtd/blktrans.h b/include/linux/mtd/blktrans.h
index f46afec6fbf8..72fc68c5ee96 100644
--- a/include/linux/mtd/blktrans.h
+++ b/include/linux/mtd/blktrans.h
@@ -10,7 +10,7 @@
10#ifndef __MTD_TRANS_H__ 10#ifndef __MTD_TRANS_H__
11#define __MTD_TRANS_H__ 11#define __MTD_TRANS_H__
12 12
13#include <asm/semaphore.h> 13#include <linux/mutex.h>
14 14
15struct hd_geometry; 15struct hd_geometry;
16struct mtd_info; 16struct mtd_info;
@@ -22,7 +22,7 @@ struct mtd_blktrans_dev {
22 struct mtd_blktrans_ops *tr; 22 struct mtd_blktrans_ops *tr;
23 struct list_head list; 23 struct list_head list;
24 struct mtd_info *mtd; 24 struct mtd_info *mtd;
25 struct semaphore sem; 25 struct mutex lock;
26 int devnum; 26 int devnum;
27 int blksize; 27 int blksize;
28 unsigned long size; 28 unsigned long size;
diff --git a/include/linux/mtd/doc2000.h b/include/linux/mtd/doc2000.h
index 386a52cf8b1b..9addd073bf15 100644
--- a/include/linux/mtd/doc2000.h
+++ b/include/linux/mtd/doc2000.h
@@ -15,7 +15,7 @@
15#define __MTD_DOC2000_H__ 15#define __MTD_DOC2000_H__
16 16
17#include <linux/mtd/mtd.h> 17#include <linux/mtd/mtd.h>
18#include <asm/semaphore.h> 18#include <linux/mutex.h>
19 19
20#define DoC_Sig1 0 20#define DoC_Sig1 0
21#define DoC_Sig2 1 21#define DoC_Sig2 1
@@ -187,7 +187,7 @@ struct DiskOnChip {
187 int numchips; 187 int numchips;
188 struct Nand *chips; 188 struct Nand *chips;
189 struct mtd_info *nextdoc; 189 struct mtd_info *nextdoc;
190 struct semaphore lock; 190 struct mutex lock;
191}; 191};
192 192
193int doc_decode_ecc(unsigned char sector[512], unsigned char ecc1[6]); 193int doc_decode_ecc(unsigned char sector[512], unsigned char ecc1[6]);
diff --git a/include/linux/mtd/inftl.h b/include/linux/mtd/inftl.h
index 0268125a6271..d7eaa40e5ab0 100644
--- a/include/linux/mtd/inftl.h
+++ b/include/linux/mtd/inftl.h
@@ -52,6 +52,11 @@ struct INFTLrecord {
52int INFTL_mount(struct INFTLrecord *s); 52int INFTL_mount(struct INFTLrecord *s);
53int INFTL_formatblock(struct INFTLrecord *s, int block); 53int INFTL_formatblock(struct INFTLrecord *s, int block);
54 54
55extern char inftlmountrev[];
56
57void INFTL_dumptables(struct INFTLrecord *s);
58void INFTL_dumpVUchains(struct INFTLrecord *s);
59
55#endif /* __KERNEL__ */ 60#endif /* __KERNEL__ */
56 61
57#endif /* __MTD_INFTL_H__ */ 62#endif /* __MTD_INFTL_H__ */
diff --git a/include/linux/namei.h b/include/linux/namei.h
index e6698013e4d0..58cb3d3d44b4 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -75,7 +75,6 @@ extern struct file *nameidata_to_filp(struct nameidata *nd, int flags);
75extern void release_open_intent(struct nameidata *); 75extern void release_open_intent(struct nameidata *);
76 76
77extern struct dentry * lookup_one_len(const char *, struct dentry *, int); 77extern struct dentry * lookup_one_len(const char *, struct dentry *, int);
78extern __deprecated_for_modules struct dentry * lookup_hash(struct nameidata *);
79 78
80extern int follow_down(struct vfsmount **, struct dentry **); 79extern int follow_down(struct vfsmount **, struct dentry **);
81extern int follow_up(struct vfsmount **, struct dentry **); 80extern int follow_up(struct vfsmount **, struct dentry **);
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 950dc55e5192..40ccf8cc4239 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -598,20 +598,7 @@ DECLARE_PER_CPU(struct softnet_data,softnet_data);
598 598
599#define HAVE_NETIF_QUEUE 599#define HAVE_NETIF_QUEUE
600 600
601static inline void __netif_schedule(struct net_device *dev) 601extern void __netif_schedule(struct net_device *dev);
602{
603 if (!test_and_set_bit(__LINK_STATE_SCHED, &dev->state)) {
604 unsigned long flags;
605 struct softnet_data *sd;
606
607 local_irq_save(flags);
608 sd = &__get_cpu_var(softnet_data);
609 dev->next_sched = sd->output_queue;
610 sd->output_queue = dev;
611 raise_softirq_irqoff(NET_TX_SOFTIRQ);
612 local_irq_restore(flags);
613 }
614}
615 602
616static inline void netif_schedule(struct net_device *dev) 603static inline void netif_schedule(struct net_device *dev)
617{ 604{
@@ -675,13 +662,7 @@ static inline void dev_kfree_skb_irq(struct sk_buff *skb)
675/* Use this variant in places where it could be invoked 662/* Use this variant in places where it could be invoked
676 * either from interrupt or non-interrupt context. 663 * either from interrupt or non-interrupt context.
677 */ 664 */
678static inline void dev_kfree_skb_any(struct sk_buff *skb) 665extern void dev_kfree_skb_any(struct sk_buff *skb);
679{
680 if (in_irq() || irqs_disabled())
681 dev_kfree_skb_irq(skb);
682 else
683 dev_kfree_skb(skb);
684}
685 666
686#define HAVE_NETIF_RX 1 667#define HAVE_NETIF_RX 1
687extern int netif_rx(struct sk_buff *skb); 668extern int netif_rx(struct sk_buff *skb);
@@ -768,22 +749,9 @@ static inline int netif_device_present(struct net_device *dev)
768 return test_bit(__LINK_STATE_PRESENT, &dev->state); 749 return test_bit(__LINK_STATE_PRESENT, &dev->state);
769} 750}
770 751
771static inline void netif_device_detach(struct net_device *dev) 752extern void netif_device_detach(struct net_device *dev);
772{
773 if (test_and_clear_bit(__LINK_STATE_PRESENT, &dev->state) &&
774 netif_running(dev)) {
775 netif_stop_queue(dev);
776 }
777}
778 753
779static inline void netif_device_attach(struct net_device *dev) 754extern void netif_device_attach(struct net_device *dev);
780{
781 if (!test_and_set_bit(__LINK_STATE_PRESENT, &dev->state) &&
782 netif_running(dev)) {
783 netif_wake_queue(dev);
784 __netdev_watchdog_up(dev);
785 }
786}
787 755
788/* 756/*
789 * Network interface message level settings 757 * Network interface message level settings
@@ -851,20 +819,7 @@ static inline int netif_rx_schedule_prep(struct net_device *dev)
851 * already been called and returned 1. 819 * already been called and returned 1.
852 */ 820 */
853 821
854static inline void __netif_rx_schedule(struct net_device *dev) 822extern void __netif_rx_schedule(struct net_device *dev);
855{
856 unsigned long flags;
857
858 local_irq_save(flags);
859 dev_hold(dev);
860 list_add_tail(&dev->poll_list, &__get_cpu_var(softnet_data).poll_list);
861 if (dev->quota < 0)
862 dev->quota += dev->weight;
863 else
864 dev->quota = dev->weight;
865 __raise_softirq_irqoff(NET_RX_SOFTIRQ);
866 local_irq_restore(flags);
867}
868 823
869/* Try to reschedule poll. Called by irq handler. */ 824/* Try to reschedule poll. Called by irq handler. */
870 825
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index 1350e47b0234..f6bdef82a322 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -142,6 +142,12 @@ struct xt_counters_info
142#define ASSERT_WRITE_LOCK(x) 142#define ASSERT_WRITE_LOCK(x)
143#include <linux/netfilter_ipv4/listhelp.h> 143#include <linux/netfilter_ipv4/listhelp.h>
144 144
145#ifdef CONFIG_COMPAT
146#define COMPAT_TO_USER 1
147#define COMPAT_FROM_USER -1
148#define COMPAT_CALC_SIZE 0
149#endif
150
145struct xt_match 151struct xt_match
146{ 152{
147 struct list_head list; 153 struct list_head list;
@@ -175,6 +181,9 @@ struct xt_match
175 void (*destroy)(const struct xt_match *match, void *matchinfo, 181 void (*destroy)(const struct xt_match *match, void *matchinfo,
176 unsigned int matchinfosize); 182 unsigned int matchinfosize);
177 183
184 /* Called when userspace align differs from kernel space one */
185 int (*compat)(void *match, void **dstptr, int *size, int convert);
186
178 /* Set this to THIS_MODULE if you are a module, otherwise NULL */ 187 /* Set this to THIS_MODULE if you are a module, otherwise NULL */
179 struct module *me; 188 struct module *me;
180 189
@@ -220,6 +229,9 @@ struct xt_target
220 void (*destroy)(const struct xt_target *target, void *targinfo, 229 void (*destroy)(const struct xt_target *target, void *targinfo,
221 unsigned int targinfosize); 230 unsigned int targinfosize);
222 231
232 /* Called when userspace align differs from kernel space one */
233 int (*compat)(void *target, void **dstptr, int *size, int convert);
234
223 /* Set this to THIS_MODULE if you are a module, otherwise NULL */ 235 /* Set this to THIS_MODULE if you are a module, otherwise NULL */
224 struct module *me; 236 struct module *me;
225 237
@@ -314,6 +326,61 @@ extern void xt_proto_fini(int af);
314extern struct xt_table_info *xt_alloc_table_info(unsigned int size); 326extern struct xt_table_info *xt_alloc_table_info(unsigned int size);
315extern void xt_free_table_info(struct xt_table_info *info); 327extern void xt_free_table_info(struct xt_table_info *info);
316 328
329#ifdef CONFIG_COMPAT
330#include <net/compat.h>
331
332struct compat_xt_entry_match
333{
334 union {
335 struct {
336 u_int16_t match_size;
337 char name[XT_FUNCTION_MAXNAMELEN - 1];
338 u_int8_t revision;
339 } user;
340 u_int16_t match_size;
341 } u;
342 unsigned char data[0];
343};
344
345struct compat_xt_entry_target
346{
347 union {
348 struct {
349 u_int16_t target_size;
350 char name[XT_FUNCTION_MAXNAMELEN - 1];
351 u_int8_t revision;
352 } user;
353 u_int16_t target_size;
354 } u;
355 unsigned char data[0];
356};
357
358/* FIXME: this works only on 32 bit tasks
359 * need to change whole approach in order to calculate align as function of
360 * current task alignment */
361
362struct compat_xt_counters
363{
364 u_int32_t cnt[4];
365};
366
367struct compat_xt_counters_info
368{
369 char name[XT_TABLE_MAXNAMELEN];
370 compat_uint_t num_counters;
371 struct compat_xt_counters counters[0];
372};
373
374#define COMPAT_XT_ALIGN(s) (((s) + (__alignof__(struct compat_xt_counters)-1)) \
375 & ~(__alignof__(struct compat_xt_counters)-1))
376
377extern void xt_compat_lock(int af);
378extern void xt_compat_unlock(int af);
379extern int xt_compat_match(void *match, void **dstptr, int *size, int convert);
380extern int xt_compat_target(void *target, void **dstptr, int *size,
381 int convert);
382
383#endif /* CONFIG_COMPAT */
317#endif /* __KERNEL__ */ 384#endif /* __KERNEL__ */
318 385
319#endif /* _X_TABLES_H */ 386#endif /* _X_TABLES_H */
diff --git a/include/linux/netfilter/xt_esp.h b/include/linux/netfilter/xt_esp.h
new file mode 100644
index 000000000000..9380fb1c27da
--- /dev/null
+++ b/include/linux/netfilter/xt_esp.h
@@ -0,0 +1,14 @@
1#ifndef _XT_ESP_H
2#define _XT_ESP_H
3
4struct xt_esp
5{
6 u_int32_t spis[2]; /* Security Parameter Index */
7 u_int8_t invflags; /* Inverse flags */
8};
9
10/* Values for "invflags" field in struct xt_esp. */
11#define XT_ESP_INV_SPI 0x01 /* Invert the sense of spi. */
12#define XT_ESP_INV_MASK 0x01 /* All possible flags. */
13
14#endif /*_XT_ESP_H*/
diff --git a/include/linux/netfilter/xt_multiport.h b/include/linux/netfilter/xt_multiport.h
new file mode 100644
index 000000000000..d49ee4183710
--- /dev/null
+++ b/include/linux/netfilter/xt_multiport.h
@@ -0,0 +1,30 @@
1#ifndef _XT_MULTIPORT_H
2#define _XT_MULTIPORT_H
3
4enum xt_multiport_flags
5{
6 XT_MULTIPORT_SOURCE,
7 XT_MULTIPORT_DESTINATION,
8 XT_MULTIPORT_EITHER
9};
10
11#define XT_MULTI_PORTS 15
12
13/* Must fit inside union xt_matchinfo: 16 bytes */
14struct xt_multiport
15{
16 u_int8_t flags; /* Type of comparison */
17 u_int8_t count; /* Number of ports */
18 u_int16_t ports[XT_MULTI_PORTS]; /* Ports */
19};
20
21struct xt_multiport_v1
22{
23 u_int8_t flags; /* Type of comparison */
24 u_int8_t count; /* Number of ports */
25 u_int16_t ports[XT_MULTI_PORTS]; /* Ports */
26 u_int8_t pflags[XT_MULTI_PORTS]; /* Port flags */
27 u_int8_t invert; /* Invert flag */
28};
29
30#endif /*_XT_MULTIPORT_H*/
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h
index d5b8c0d6a12b..c0dac16e1902 100644
--- a/include/linux/netfilter_ipv4/ip_tables.h
+++ b/include/linux/netfilter_ipv4/ip_tables.h
@@ -316,5 +316,23 @@ extern unsigned int ipt_do_table(struct sk_buff **pskb,
316 void *userdata); 316 void *userdata);
317 317
318#define IPT_ALIGN(s) XT_ALIGN(s) 318#define IPT_ALIGN(s) XT_ALIGN(s)
319
320#ifdef CONFIG_COMPAT
321#include <net/compat.h>
322
323struct compat_ipt_entry
324{
325 struct ipt_ip ip;
326 compat_uint_t nfcache;
327 u_int16_t target_offset;
328 u_int16_t next_offset;
329 compat_uint_t comefrom;
330 struct compat_xt_counters counters;
331 unsigned char elems[0];
332};
333
334#define COMPAT_IPT_ALIGN(s) COMPAT_XT_ALIGN(s)
335
336#endif /* CONFIG_COMPAT */
319#endif /*__KERNEL__*/ 337#endif /*__KERNEL__*/
320#endif /* _IPTABLES_H */ 338#endif /* _IPTABLES_H */
diff --git a/include/linux/netfilter_ipv4/ipt_esp.h b/include/linux/netfilter_ipv4/ipt_esp.h
index c782a83e53e0..78296e7eeff9 100644
--- a/include/linux/netfilter_ipv4/ipt_esp.h
+++ b/include/linux/netfilter_ipv4/ipt_esp.h
@@ -1,16 +1,10 @@
1#ifndef _IPT_ESP_H 1#ifndef _IPT_ESP_H
2#define _IPT_ESP_H 2#define _IPT_ESP_H
3 3
4struct ipt_esp 4#include <linux/netfilter/xt_esp.h>
5{
6 u_int32_t spis[2]; /* Security Parameter Index */
7 u_int8_t invflags; /* Inverse flags */
8};
9 5
10 6#define ipt_esp xt_esp
11 7#define IPT_ESP_INV_SPI XT_ESP_INV_SPI
12/* Values for "invflags" field in struct ipt_esp. */ 8#define IPT_ESP_INV_MASK XT_ESP_INV_MASK
13#define IPT_ESP_INV_SPI 0x01 /* Invert the sense of spi. */
14#define IPT_ESP_INV_MASK 0x01 /* All possible flags. */
15 9
16#endif /*_IPT_ESP_H*/ 10#endif /*_IPT_ESP_H*/
diff --git a/include/linux/netfilter_ipv4/ipt_multiport.h b/include/linux/netfilter_ipv4/ipt_multiport.h
index e6b6fff811df..55fe85eca88c 100644
--- a/include/linux/netfilter_ipv4/ipt_multiport.h
+++ b/include/linux/netfilter_ipv4/ipt_multiport.h
@@ -1,30 +1,15 @@
1#ifndef _IPT_MULTIPORT_H 1#ifndef _IPT_MULTIPORT_H
2#define _IPT_MULTIPORT_H 2#define _IPT_MULTIPORT_H
3#include <linux/netfilter_ipv4/ip_tables.h>
4 3
5enum ipt_multiport_flags 4#include <linux/netfilter/xt_multiport.h>
6{
7 IPT_MULTIPORT_SOURCE,
8 IPT_MULTIPORT_DESTINATION,
9 IPT_MULTIPORT_EITHER
10};
11 5
12#define IPT_MULTI_PORTS 15 6#define IPT_MULTIPORT_SOURCE XT_MULTIPORT_SOURCE
7#define IPT_MULTIPORT_DESTINATION XT_MULTIPORT_DESTINATION
8#define IPT_MULTIPORT_EITHER XT_MULTIPORT_EITHER
13 9
14/* Must fit inside union ipt_matchinfo: 16 bytes */ 10#define IPT_MULTI_PORTS XT_MULTI_PORTS
15struct ipt_multiport 11
16{ 12#define ipt_multiport xt_multiport
17 u_int8_t flags; /* Type of comparison */ 13#define ipt_multiport_v1 xt_multiport_v1
18 u_int8_t count; /* Number of ports */
19 u_int16_t ports[IPT_MULTI_PORTS]; /* Ports */
20};
21 14
22struct ipt_multiport_v1
23{
24 u_int8_t flags; /* Type of comparison */
25 u_int8_t count; /* Number of ports */
26 u_int16_t ports[IPT_MULTI_PORTS]; /* Ports */
27 u_int8_t pflags[IPT_MULTI_PORTS]; /* Port flags */
28 u_int8_t invert; /* Invert flag */
29};
30#endif /*_IPT_MULTIPORT_H*/ 15#endif /*_IPT_MULTIPORT_H*/
diff --git a/include/linux/netfilter_ipv6/ip6t_esp.h b/include/linux/netfilter_ipv6/ip6t_esp.h
index a91b6abc8079..f62eaf53c16c 100644
--- a/include/linux/netfilter_ipv6/ip6t_esp.h
+++ b/include/linux/netfilter_ipv6/ip6t_esp.h
@@ -1,14 +1,10 @@
1#ifndef _IP6T_ESP_H 1#ifndef _IP6T_ESP_H
2#define _IP6T_ESP_H 2#define _IP6T_ESP_H
3 3
4struct ip6t_esp 4#include <linux/netfilter/xt_esp.h>
5{
6 u_int32_t spis[2]; /* Security Parameter Index */
7 u_int8_t invflags; /* Inverse flags */
8};
9 5
10/* Values for "invflags" field in struct ip6t_esp. */ 6#define ip6t_esp xt_esp
11#define IP6T_ESP_INV_SPI 0x01 /* Invert the sense of spi. */ 7#define IP6T_ESP_INV_SPI XT_ESP_INV_SPI
12#define IP6T_ESP_INV_MASK 0x01 /* All possible flags. */ 8#define IP6T_ESP_INV_MASK XT_ESP_INV_MASK
13 9
14#endif /*_IP6T_ESP_H*/ 10#endif /*_IP6T_ESP_H*/
diff --git a/include/linux/netfilter_ipv6/ip6t_multiport.h b/include/linux/netfilter_ipv6/ip6t_multiport.h
index efe4954a8681..042c92661cee 100644
--- a/include/linux/netfilter_ipv6/ip6t_multiport.h
+++ b/include/linux/netfilter_ipv6/ip6t_multiport.h
@@ -1,21 +1,14 @@
1#ifndef _IP6T_MULTIPORT_H 1#ifndef _IP6T_MULTIPORT_H
2#define _IP6T_MULTIPORT_H 2#define _IP6T_MULTIPORT_H
3#include <linux/netfilter_ipv6/ip6_tables.h>
4 3
5enum ip6t_multiport_flags 4#include <linux/netfilter/xt_multiport.h>
6{
7 IP6T_MULTIPORT_SOURCE,
8 IP6T_MULTIPORT_DESTINATION,
9 IP6T_MULTIPORT_EITHER
10};
11 5
12#define IP6T_MULTI_PORTS 15 6#define IP6T_MULTIPORT_SOURCE XT_MULTIPORT_SOURCE
7#define IP6T_MULTIPORT_DESTINATION XT_MULTIPORT_DESTINATION
8#define IP6T_MULTIPORT_EITHER XT_MULTIPORT_EITHER
13 9
14/* Must fit inside union ip6t_matchinfo: 16 bytes */ 10#define IP6T_MULTI_PORTS XT_MULTI_PORTS
15struct ip6t_multiport 11
16{ 12#define ip6t_multiport xt_multiport
17 u_int8_t flags; /* Type of comparison */ 13
18 u_int8_t count; /* Number of ports */ 14#endif /*_IP6T_MULTIPORT_H*/
19 u_int16_t ports[IP6T_MULTI_PORTS]; /* Ports */
20};
21#endif /*_IPT_MULTIPORT_H*/
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 839f0b3c23aa..9539efd4f7e6 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -72,8 +72,8 @@ extern struct page * find_get_page(struct address_space *mapping,
72 unsigned long index); 72 unsigned long index);
73extern struct page * find_lock_page(struct address_space *mapping, 73extern struct page * find_lock_page(struct address_space *mapping,
74 unsigned long index); 74 unsigned long index);
75extern struct page * find_trylock_page(struct address_space *mapping, 75extern __deprecated_for_modules struct page * find_trylock_page(
76 unsigned long index); 76 struct address_space *mapping, unsigned long index);
77extern struct page * find_or_create_page(struct address_space *mapping, 77extern struct page * find_or_create_page(struct address_space *mapping,
78 unsigned long index, gfp_t gfp_mask); 78 unsigned long index, gfp_t gfp_mask);
79unsigned find_get_pages(struct address_space *mapping, pgoff_t start, 79unsigned find_get_pages(struct address_space *mapping, pgoff_t start,
diff --git a/include/linux/pid.h b/include/linux/pid.h
index 5b9082cc600f..29960b03bef7 100644
--- a/include/linux/pid.h
+++ b/include/linux/pid.h
@@ -1,6 +1,8 @@
1#ifndef _LINUX_PID_H 1#ifndef _LINUX_PID_H
2#define _LINUX_PID_H 2#define _LINUX_PID_H
3 3
4#include <linux/rcupdate.h>
5
4enum pid_type 6enum pid_type
5{ 7{
6 PIDTYPE_PID, 8 PIDTYPE_PID,
@@ -9,45 +11,109 @@ enum pid_type
9 PIDTYPE_MAX 11 PIDTYPE_MAX
10}; 12};
11 13
14/*
15 * What is struct pid?
16 *
17 * A struct pid is the kernel's internal notion of a process identifier.
18 * It refers to individual tasks, process groups, and sessions. While
19 * there are processes attached to it the struct pid lives in a hash
20 * table, so it and then the processes that it refers to can be found
21 * quickly from the numeric pid value. The attached processes may be
22 * quickly accessed by following pointers from struct pid.
23 *
24 * Storing pid_t values in the kernel and refering to them later has a
25 * problem. The process originally with that pid may have exited and the
26 * pid allocator wrapped, and another process could have come along
27 * and been assigned that pid.
28 *
29 * Referring to user space processes by holding a reference to struct
30 * task_struct has a problem. When the user space process exits
31 * the now useless task_struct is still kept. A task_struct plus a
32 * stack consumes around 10K of low kernel memory. More precisely
33 * this is THREAD_SIZE + sizeof(struct task_struct). By comparison
34 * a struct pid is about 64 bytes.
35 *
36 * Holding a reference to struct pid solves both of these problems.
37 * It is small so holding a reference does not consume a lot of
38 * resources, and since a new struct pid is allocated when the numeric
39 * pid value is reused we don't mistakenly refer to new processes.
40 */
41
12struct pid 42struct pid
13{ 43{
44 atomic_t count;
14 /* Try to keep pid_chain in the same cacheline as nr for find_pid */ 45 /* Try to keep pid_chain in the same cacheline as nr for find_pid */
15 int nr; 46 int nr;
16 struct hlist_node pid_chain; 47 struct hlist_node pid_chain;
17 /* list of pids with the same nr, only one of them is in the hash */ 48 /* lists of tasks that use this pid */
18 struct list_head pid_list; 49 struct hlist_head tasks[PIDTYPE_MAX];
50 struct rcu_head rcu;
19}; 51};
20 52
21#define pid_task(elem, type) \ 53struct pid_link
22 list_entry(elem, struct task_struct, pids[type].pid_list) 54{
55 struct hlist_node node;
56 struct pid *pid;
57};
58
59static inline struct pid *get_pid(struct pid *pid)
60{
61 if (pid)
62 atomic_inc(&pid->count);
63 return pid;
64}
65
66extern void FASTCALL(put_pid(struct pid *pid));
67extern struct task_struct *FASTCALL(pid_task(struct pid *pid, enum pid_type));
68extern struct task_struct *FASTCALL(get_pid_task(struct pid *pid,
69 enum pid_type));
23 70
24/* 71/*
25 * attach_pid() and detach_pid() must be called with the tasklist_lock 72 * attach_pid() and detach_pid() must be called with the tasklist_lock
26 * write-held. 73 * write-held.
27 */ 74 */
28extern int FASTCALL(attach_pid(struct task_struct *task, enum pid_type type, int nr)); 75extern int FASTCALL(attach_pid(struct task_struct *task,
76 enum pid_type type, int nr));
29 77
30extern void FASTCALL(detach_pid(struct task_struct *task, enum pid_type)); 78extern void FASTCALL(detach_pid(struct task_struct *task, enum pid_type));
31 79
32/* 80/*
33 * look up a PID in the hash table. Must be called with the tasklist_lock 81 * look up a PID in the hash table. Must be called with the tasklist_lock
34 * held. 82 * or rcu_read_lock() held.
83 */
84extern struct pid *FASTCALL(find_pid(int nr));
85
86/*
87 * Lookup a PID in the hash table, and return with it's count elevated.
35 */ 88 */
36extern struct pid *FASTCALL(find_pid(enum pid_type, int)); 89extern struct pid *find_get_pid(int nr);
37 90
38extern int alloc_pidmap(void); 91extern struct pid *alloc_pid(void);
39extern void FASTCALL(free_pidmap(int)); 92extern void FASTCALL(free_pid(struct pid *pid));
40 93
94#define pid_next(task, type) \
95 ((task)->pids[(type)].node.next)
96
97#define pid_next_task(task, type) \
98 hlist_entry(pid_next(task, type), struct task_struct, \
99 pids[(type)].node)
100
101
102/* We could use hlist_for_each_entry_rcu here but it takes more arguments
103 * than the do_each_task_pid/while_each_task_pid. So we roll our own
104 * to preserve the existing interface.
105 */
41#define do_each_task_pid(who, type, task) \ 106#define do_each_task_pid(who, type, task) \
42 if ((task = find_task_by_pid_type(type, who))) { \ 107 if ((task = find_task_by_pid_type(type, who))) { \
43 prefetch((task)->pids[type].pid_list.next); \ 108 prefetch(pid_next(task, type)); \
44 do { 109 do {
45 110
46#define while_each_task_pid(who, type, task) \ 111#define while_each_task_pid(who, type, task) \
47 } while (task = pid_task((task)->pids[type].pid_list.next,\ 112 } while (pid_next(task, type) && ({ \
48 type), \ 113 task = pid_next_task(task, type); \
49 prefetch((task)->pids[type].pid_list.next), \ 114 rcu_dereference(task); \
50 hlist_unhashed(&(task)->pids[type].pid_chain)); \ 115 prefetch(pid_next(task, type)); \
51 } \ 116 1; }) ); \
117 }
52 118
53#endif /* _LINUX_PID_H */ 119#endif /* _LINUX_PID_H */
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h
index 75c7f55023ab..d218fc729319 100644
--- a/include/linux/pipe_fs_i.h
+++ b/include/linux/pipe_fs_i.h
@@ -60,5 +60,8 @@ void free_pipe_info(struct inode* inode);
60 * add the splice flags here. 60 * add the splice flags here.
61 */ 61 */
62#define SPLICE_F_MOVE (0x01) /* move pages instead of copying */ 62#define SPLICE_F_MOVE (0x01) /* move pages instead of copying */
63#define SPLICE_F_NONBLOCK (0x02) /* don't block on the pipe splicing (but */
64 /* we may still block on the fd we splice */
65 /* from/to, of course */
63 66
64#endif 67#endif
diff --git a/include/linux/sched.h b/include/linux/sched.h
index d04186d8cc68..541f4828f5e7 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -100,6 +100,7 @@ DECLARE_PER_CPU(unsigned long, process_counts);
100extern int nr_processes(void); 100extern int nr_processes(void);
101extern unsigned long nr_running(void); 101extern unsigned long nr_running(void);
102extern unsigned long nr_uninterruptible(void); 102extern unsigned long nr_uninterruptible(void);
103extern unsigned long nr_active(void);
103extern unsigned long nr_iowait(void); 104extern unsigned long nr_iowait(void);
104 105
105#include <linux/time.h> 106#include <linux/time.h>
@@ -483,6 +484,7 @@ struct signal_struct {
483#define MAX_PRIO (MAX_RT_PRIO + 40) 484#define MAX_PRIO (MAX_RT_PRIO + 40)
484 485
485#define rt_task(p) (unlikely((p)->prio < MAX_RT_PRIO)) 486#define rt_task(p) (unlikely((p)->prio < MAX_RT_PRIO))
487#define batch_task(p) (unlikely((p)->policy == SCHED_BATCH))
486 488
487/* 489/*
488 * Some day this will be a full-fledged user tracking system.. 490 * Some day this will be a full-fledged user tracking system..
@@ -683,6 +685,13 @@ static inline void prefetch_stack(struct task_struct *t) { }
683struct audit_context; /* See audit.c */ 685struct audit_context; /* See audit.c */
684struct mempolicy; 686struct mempolicy;
685 687
688enum sleep_type {
689 SLEEP_NORMAL,
690 SLEEP_NONINTERACTIVE,
691 SLEEP_INTERACTIVE,
692 SLEEP_INTERRUPTED,
693};
694
686struct task_struct { 695struct task_struct {
687 volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */ 696 volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */
688 struct thread_info *thread_info; 697 struct thread_info *thread_info;
@@ -705,7 +714,7 @@ struct task_struct {
705 unsigned long sleep_avg; 714 unsigned long sleep_avg;
706 unsigned long long timestamp, last_ran; 715 unsigned long long timestamp, last_ran;
707 unsigned long long sched_time; /* sched_clock time spent running */ 716 unsigned long long sched_time; /* sched_clock time spent running */
708 int activated; 717 enum sleep_type sleep_type;
709 718
710 unsigned long policy; 719 unsigned long policy;
711 cpumask_t cpus_allowed; 720 cpumask_t cpus_allowed;
@@ -751,7 +760,7 @@ struct task_struct {
751 struct task_struct *group_leader; /* threadgroup leader */ 760 struct task_struct *group_leader; /* threadgroup leader */
752 761
753 /* PID/PID hash table linkage. */ 762 /* PID/PID hash table linkage. */
754 struct pid pids[PIDTYPE_MAX]; 763 struct pid_link pids[PIDTYPE_MAX];
755 struct list_head thread_group; 764 struct list_head thread_group;
756 765
757 struct completion *vfork_done; /* for vfork() */ 766 struct completion *vfork_done; /* for vfork() */
@@ -890,18 +899,19 @@ static inline pid_t process_group(struct task_struct *tsk)
890 */ 899 */
891static inline int pid_alive(struct task_struct *p) 900static inline int pid_alive(struct task_struct *p)
892{ 901{
893 return p->pids[PIDTYPE_PID].nr != 0; 902 return p->pids[PIDTYPE_PID].pid != NULL;
894} 903}
895 904
896extern void free_task(struct task_struct *tsk); 905extern void free_task(struct task_struct *tsk);
897#define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0) 906#define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0)
898 907
899extern void __put_task_struct_cb(struct rcu_head *rhp); 908extern void __put_task_struct_cb(struct rcu_head *rhp);
909extern void __put_task_struct(struct task_struct *t);
900 910
901static inline void put_task_struct(struct task_struct *t) 911static inline void put_task_struct(struct task_struct *t)
902{ 912{
903 if (atomic_dec_and_test(&t->usage)) 913 if (atomic_dec_and_test(&t->usage))
904 call_rcu(&t->rcu, __put_task_struct_cb); 914 __put_task_struct(t);
905} 915}
906 916
907/* 917/*
diff --git a/include/linux/serio.h b/include/linux/serio.h
index 690aabca8ed0..6348e8330897 100644
--- a/include/linux/serio.h
+++ b/include/linux/serio.h
@@ -18,6 +18,7 @@
18#include <linux/interrupt.h> 18#include <linux/interrupt.h>
19#include <linux/list.h> 19#include <linux/list.h>
20#include <linux/spinlock.h> 20#include <linux/spinlock.h>
21#include <linux/mutex.h>
21#include <linux/device.h> 22#include <linux/device.h>
22#include <linux/mod_devicetable.h> 23#include <linux/mod_devicetable.h>
23 24
@@ -42,7 +43,7 @@ struct serio {
42 struct serio *parent, *child; 43 struct serio *parent, *child;
43 44
44 struct serio_driver *drv; /* accessed from interrupt, must be protected by serio->lock and serio->sem */ 45 struct serio_driver *drv; /* accessed from interrupt, must be protected by serio->lock and serio->sem */
45 struct semaphore drv_sem; /* protects serio->drv so attributes can pin driver */ 46 struct mutex drv_mutex; /* protects serio->drv so attributes can pin driver */
46 47
47 struct device dev; 48 struct device dev;
48 unsigned int registered; /* port has been fully registered with driver core */ 49 unsigned int registered; /* port has been fully registered with driver core */
@@ -151,17 +152,17 @@ static inline void serio_continue_rx(struct serio *serio)
151 */ 152 */
152static inline int serio_pin_driver(struct serio *serio) 153static inline int serio_pin_driver(struct serio *serio)
153{ 154{
154 return down_interruptible(&serio->drv_sem); 155 return mutex_lock_interruptible(&serio->drv_mutex);
155} 156}
156 157
157static inline void serio_pin_driver_uninterruptible(struct serio *serio) 158static inline void serio_pin_driver_uninterruptible(struct serio *serio)
158{ 159{
159 down(&serio->drv_sem); 160 mutex_lock(&serio->drv_mutex);
160} 161}
161 162
162static inline void serio_unpin_driver(struct serio *serio) 163static inline void serio_unpin_driver(struct serio *serio)
163{ 164{
164 up(&serio->drv_sem); 165 mutex_unlock(&serio->drv_mutex);
165} 166}
166 167
167 168
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 613b9513f8b9..c4619a428d9b 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -941,6 +941,25 @@ static inline void skb_reserve(struct sk_buff *skb, int len)
941#define NET_IP_ALIGN 2 941#define NET_IP_ALIGN 2
942#endif 942#endif
943 943
944/*
945 * The networking layer reserves some headroom in skb data (via
946 * dev_alloc_skb). This is used to avoid having to reallocate skb data when
947 * the header has to grow. In the default case, if the header has to grow
948 * 16 bytes or less we avoid the reallocation.
949 *
950 * Unfortunately this headroom changes the DMA alignment of the resulting
951 * network packet. As for NET_IP_ALIGN, this unaligned DMA is expensive
952 * on some architectures. An architecture can override this value,
953 * perhaps setting it to a cacheline in size (since that will maintain
954 * cacheline alignment of the DMA). It must be a power of 2.
955 *
956 * Various parts of the networking layer expect at least 16 bytes of
957 * headroom, you should not reduce this.
958 */
959#ifndef NET_SKB_PAD
960#define NET_SKB_PAD 16
961#endif
962
944extern int ___pskb_trim(struct sk_buff *skb, unsigned int len, int realloc); 963extern int ___pskb_trim(struct sk_buff *skb, unsigned int len, int realloc);
945 964
946static inline void __skb_trim(struct sk_buff *skb, unsigned int len) 965static inline void __skb_trim(struct sk_buff *skb, unsigned int len)
@@ -1030,9 +1049,9 @@ static inline void __skb_queue_purge(struct sk_buff_head *list)
1030static inline struct sk_buff *__dev_alloc_skb(unsigned int length, 1049static inline struct sk_buff *__dev_alloc_skb(unsigned int length,
1031 gfp_t gfp_mask) 1050 gfp_t gfp_mask)
1032{ 1051{
1033 struct sk_buff *skb = alloc_skb(length + 16, gfp_mask); 1052 struct sk_buff *skb = alloc_skb(length + NET_SKB_PAD, gfp_mask);
1034 if (likely(skb)) 1053 if (likely(skb))
1035 skb_reserve(skb, 16); 1054 skb_reserve(skb, NET_SKB_PAD);
1036 return skb; 1055 return skb;
1037} 1056}
1038#else 1057#else
@@ -1070,13 +1089,15 @@ static inline struct sk_buff *dev_alloc_skb(unsigned int length)
1070 */ 1089 */
1071static inline int skb_cow(struct sk_buff *skb, unsigned int headroom) 1090static inline int skb_cow(struct sk_buff *skb, unsigned int headroom)
1072{ 1091{
1073 int delta = (headroom > 16 ? headroom : 16) - skb_headroom(skb); 1092 int delta = (headroom > NET_SKB_PAD ? headroom : NET_SKB_PAD) -
1093 skb_headroom(skb);
1074 1094
1075 if (delta < 0) 1095 if (delta < 0)
1076 delta = 0; 1096 delta = 0;
1077 1097
1078 if (delta || skb_cloned(skb)) 1098 if (delta || skb_cloned(skb))
1079 return pskb_expand_head(skb, (delta + 15) & ~15, 0, GFP_ATOMIC); 1099 return pskb_expand_head(skb, (delta + (NET_SKB_PAD-1)) &
1100 ~(NET_SKB_PAD-1), 0, GFP_ATOMIC);
1080 return 0; 1101 return 0;
1081} 1102}
1082 1103
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index e78ffc7d5b56..5717147596b6 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -571,5 +571,7 @@ asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename,
571asmlinkage long sys_unshare(unsigned long unshare_flags); 571asmlinkage long sys_unshare(unsigned long unshare_flags);
572asmlinkage long sys_splice(int fdin, int fdout, size_t len, 572asmlinkage long sys_splice(int fdin, int fdout, size_t len,
573 unsigned int flags); 573 unsigned int flags);
574asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes,
575 int flags);
574 576
575#endif 577#endif
diff --git a/include/linux/timer.h b/include/linux/timer.h
index b5caabca553c..0a485beba9f5 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -6,7 +6,7 @@
6#include <linux/spinlock.h> 6#include <linux/spinlock.h>
7#include <linux/stddef.h> 7#include <linux/stddef.h>
8 8
9struct timer_base_s; 9struct tvec_t_base_s;
10 10
11struct timer_list { 11struct timer_list {
12 struct list_head entry; 12 struct list_head entry;
@@ -15,16 +15,16 @@ struct timer_list {
15 void (*function)(unsigned long); 15 void (*function)(unsigned long);
16 unsigned long data; 16 unsigned long data;
17 17
18 struct timer_base_s *base; 18 struct tvec_t_base_s *base;
19}; 19};
20 20
21extern struct timer_base_s __init_timer_base; 21extern struct tvec_t_base_s boot_tvec_bases;
22 22
23#define TIMER_INITIALIZER(_function, _expires, _data) { \ 23#define TIMER_INITIALIZER(_function, _expires, _data) { \
24 .function = (_function), \ 24 .function = (_function), \
25 .expires = (_expires), \ 25 .expires = (_expires), \
26 .data = (_data), \ 26 .data = (_data), \
27 .base = &__init_timer_base, \ 27 .base = &boot_tvec_bases, \
28 } 28 }
29 29
30#define DEFINE_TIMER(_name, _function, _expires, _data) \ 30#define DEFINE_TIMER(_name, _function, _expires, _data) \
diff --git a/include/linux/tiocl.h b/include/linux/tiocl.h
index 2c9e847f6ed1..4756862c4ed4 100644
--- a/include/linux/tiocl.h
+++ b/include/linux/tiocl.h
@@ -34,5 +34,6 @@ struct tiocl_selection {
34#define TIOCL_SCROLLCONSOLE 13 /* scroll console */ 34#define TIOCL_SCROLLCONSOLE 13 /* scroll console */
35#define TIOCL_BLANKSCREEN 14 /* keep screen blank even if a key is pressed */ 35#define TIOCL_BLANKSCREEN 14 /* keep screen blank even if a key is pressed */
36#define TIOCL_BLANKEDSCREEN 15 /* return which vt was blanked */ 36#define TIOCL_BLANKEDSCREEN 15 /* return which vt was blanked */
37#define TIOCL_GETKMSGREDIRECT 17 /* get the vt the kernel messages are restricted to */
37 38
38#endif /* _LINUX_TIOCL_H */ 39#endif /* _LINUX_TIOCL_H */
diff --git a/include/linux/uinput.h b/include/linux/uinput.h
index 0ff7ca68e5c5..7168302f9844 100644
--- a/include/linux/uinput.h
+++ b/include/linux/uinput.h
@@ -20,7 +20,7 @@
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 * 21 *
22 * Author: Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org> 22 * Author: Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org>
23 * 23 *
24 * Changes/Revisions: 24 * Changes/Revisions:
25 * 0.2 16/10/2004 (Micah Dowty <micah@navi.cx>) 25 * 0.2 16/10/2004 (Micah Dowty <micah@navi.cx>)
26 * - added force feedback support 26 * - added force feedback support
@@ -51,7 +51,7 @@ struct uinput_request {
51 51
52struct uinput_device { 52struct uinput_device {
53 struct input_dev *dev; 53 struct input_dev *dev;
54 struct semaphore sem; 54 struct mutex mutex;
55 enum uinput_state state; 55 enum uinput_state state;
56 wait_queue_head_t waitq; 56 wait_queue_head_t waitq;
57 unsigned char ready; 57 unsigned char ready;
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index af2d6155d3fe..d7670ec1ec1e 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -966,66 +966,17 @@ struct v4l2_sliced_vbi_format
966 966
967/* Teletext World System Teletext 967/* Teletext World System Teletext
968 (WST), defined on ITU-R BT.653-2 */ 968 (WST), defined on ITU-R BT.653-2 */
969#define V4L2_SLICED_TELETEXT_PAL_B (0x000001) 969#define V4L2_SLICED_TELETEXT_B (0x0001)
970#define V4L2_SLICED_TELETEXT_PAL_C (0x000002)
971#define V4L2_SLICED_TELETEXT_NTSC_B (0x000010)
972#define V4L2_SLICED_TELETEXT_SECAM (0x000020)
973
974/* Teletext North American Broadcast Teletext Specification
975 (NABTS), defined on ITU-R BT.653-2 */
976#define V4L2_SLICED_TELETEXT_NTSC_C (0x000040)
977#define V4L2_SLICED_TELETEXT_NTSC_D (0x000080)
978
979/* Video Program System, defined on ETS 300 231*/ 970/* Video Program System, defined on ETS 300 231*/
980#define V4L2_SLICED_VPS (0x000400) 971#define V4L2_SLICED_VPS (0x0400)
981
982/* Closed Caption, defined on EIA-608 */ 972/* Closed Caption, defined on EIA-608 */
983#define V4L2_SLICED_CAPTION_525 (0x001000) 973#define V4L2_SLICED_CAPTION_525 (0x1000)
984#define V4L2_SLICED_CAPTION_625 (0x002000)
985
986/* Wide Screen System, defined on ITU-R BT1119.1 */ 974/* Wide Screen System, defined on ITU-R BT1119.1 */
987#define V4L2_SLICED_WSS_625 (0x004000) 975#define V4L2_SLICED_WSS_625 (0x4000)
988 976
989/* Wide Screen System, defined on IEC 61880 */ 977#define V4L2_SLICED_VBI_525 (V4L2_SLICED_CAPTION_525)
990#define V4L2_SLICED_WSS_525 (0x008000) 978#define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_B | V4L2_SLICED_VPS | V4L2_SLICED_WSS_625)
991 979
992/* Vertical Interval Timecode (VITC), defined on SMPTE 12M */
993#define V4l2_SLICED_VITC_625 (0x010000)
994#define V4l2_SLICED_VITC_525 (0x020000)
995
996#define V4L2_SLICED_TELETEXT_B (V4L2_SLICED_TELETEXT_PAL_B |\
997 V4L2_SLICED_TELETEXT_NTSC_B)
998
999#define V4L2_SLICED_TELETEXT (V4L2_SLICED_TELETEXT_PAL_B |\
1000 V4L2_SLICED_TELETEXT_PAL_C |\
1001 V4L2_SLICED_TELETEXT_SECAM |\
1002 V4L2_SLICED_TELETEXT_NTSC_B |\
1003 V4L2_SLICED_TELETEXT_NTSC_C |\
1004 V4L2_SLICED_TELETEXT_NTSC_D)
1005
1006#define V4L2_SLICED_CAPTION (V4L2_SLICED_CAPTION_525 |\
1007 V4L2_SLICED_CAPTION_625)
1008
1009#define V4L2_SLICED_WSS (V4L2_SLICED_WSS_525 |\
1010 V4L2_SLICED_WSS_625)
1011
1012#define V4L2_SLICED_VITC (V4L2_SLICED_VITC_525 |\
1013 V4L2_SLICED_VITC_625)
1014
1015#define V4L2_SLICED_VBI_525 (V4L2_SLICED_TELETEXT_NTSC_B |\
1016 V4L2_SLICED_TELETEXT_NTSC_C |\
1017 V4L2_SLICED_TELETEXT_NTSC_D |\
1018 V4L2_SLICED_CAPTION_525 |\
1019 V4L2_SLICED_WSS_525 |\
1020 V4l2_SLICED_VITC_525)
1021
1022#define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_PAL_B |\
1023 V4L2_SLICED_TELETEXT_PAL_C |\
1024 V4L2_SLICED_TELETEXT_SECAM |\
1025 V4L2_SLICED_VPS |\
1026 V4L2_SLICED_CAPTION_625 |\
1027 V4L2_SLICED_WSS_625 |\
1028 V4l2_SLICED_VITC_625)
1029 980
1030struct v4l2_sliced_vbi_cap 981struct v4l2_sliced_vbi_cap
1031{ 982{
diff --git a/include/media/cx25840.h b/include/media/cx25840.h
new file mode 100644
index 000000000000..8e7e52d659a0
--- /dev/null
+++ b/include/media/cx25840.h
@@ -0,0 +1,64 @@
1/*
2 cx25840.h - definition for cx25840/1/2/3 inputs
3
4 Copyright (C) 2006 Hans Verkuil (hverkuil@xs4all.nl)
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 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19*/
20
21#ifndef _CX25840_H_
22#define _CX25840_H_
23
24enum cx25840_video_input {
25 /* Composite video inputs In1-In8 */
26 CX25840_COMPOSITE1 = 1,
27 CX25840_COMPOSITE2,
28 CX25840_COMPOSITE3,
29 CX25840_COMPOSITE4,
30 CX25840_COMPOSITE5,
31 CX25840_COMPOSITE6,
32 CX25840_COMPOSITE7,
33 CX25840_COMPOSITE8,
34
35 /* S-Video inputs consist of one luma input (In1-In4) ORed with one
36 chroma input (In5-In8) */
37 CX25840_SVIDEO_LUMA1 = 0x10,
38 CX25840_SVIDEO_LUMA2 = 0x20,
39 CX25840_SVIDEO_LUMA3 = 0x30,
40 CX25840_SVIDEO_LUMA4 = 0x40,
41 CX25840_SVIDEO_CHROMA4 = 0x400,
42 CX25840_SVIDEO_CHROMA5 = 0x500,
43 CX25840_SVIDEO_CHROMA6 = 0x600,
44 CX25840_SVIDEO_CHROMA7 = 0x700,
45 CX25840_SVIDEO_CHROMA8 = 0x800,
46
47 /* S-Video aliases for common luma/chroma combinations */
48 CX25840_SVIDEO1 = 0x510,
49 CX25840_SVIDEO2 = 0x620,
50 CX25840_SVIDEO3 = 0x730,
51 CX25840_SVIDEO4 = 0x840,
52};
53
54enum cx25840_audio_input {
55 /* Audio inputs: serial or In4-In8 */
56 CX25840_AUDIO_SERIAL,
57 CX25840_AUDIO4 = 4,
58 CX25840_AUDIO5,
59 CX25840_AUDIO6,
60 CX25840_AUDIO7,
61 CX25840_AUDIO8,
62};
63
64#endif
diff --git a/include/media/msp3400.h b/include/media/msp3400.h
index 0be61a021d45..6ab854931c05 100644
--- a/include/media/msp3400.h
+++ b/include/media/msp3400.h
@@ -80,16 +80,16 @@
80 */ 80 */
81 81
82/* SCART input to DSP selection */ 82/* SCART input to DSP selection */
83#define MSP_IN_SCART_1 0 /* Pin SC1_IN */ 83#define MSP_IN_SCART1 0 /* Pin SC1_IN */
84#define MSP_IN_SCART_2 1 /* Pin SC2_IN */ 84#define MSP_IN_SCART2 1 /* Pin SC2_IN */
85#define MSP_IN_SCART_3 2 /* Pin SC3_IN */ 85#define MSP_IN_SCART3 2 /* Pin SC3_IN */
86#define MSP_IN_SCART_4 3 /* Pin SC4_IN */ 86#define MSP_IN_SCART4 3 /* Pin SC4_IN */
87#define MSP_IN_MONO 6 /* Pin MONO_IN */ 87#define MSP_IN_MONO 6 /* Pin MONO_IN */
88#define MSP_IN_MUTE 7 /* Mute DSP input */ 88#define MSP_IN_MUTE 7 /* Mute DSP input */
89#define MSP_SCART_TO_DSP(in) (in) 89#define MSP_SCART_TO_DSP(in) (in)
90/* Tuner input to demodulator and DSP selection */ 90/* Tuner input to demodulator and DSP selection */
91#define MSP_IN_TUNER_1 0 /* Analog Sound IF input pin ANA_IN1 */ 91#define MSP_IN_TUNER1 0 /* Analog Sound IF input pin ANA_IN1 */
92#define MSP_IN_TUNER_2 1 /* Analog Sound IF input pin ANA_IN2 */ 92#define MSP_IN_TUNER2 1 /* Analog Sound IF input pin ANA_IN2 */
93#define MSP_TUNER_TO_DSP(in) ((in) << 3) 93#define MSP_TUNER_TO_DSP(in) ((in) << 3)
94 94
95/* The msp has up to 5 DSP outputs, each output can independently select 95/* The msp has up to 5 DSP outputs, each output can independently select
@@ -109,14 +109,14 @@
109 DSP. This is currently not implemented. Also not implemented is the 109 DSP. This is currently not implemented. Also not implemented is the
110 multi-channel capable I2S3 input of the 44x0G. If someone can demonstrate 110 multi-channel capable I2S3 input of the 44x0G. If someone can demonstrate
111 a need for one of those features then additional support can be added. */ 111 a need for one of those features then additional support can be added. */
112#define MSP_DSP_OUT_TUNER 0 /* Tuner output */ 112#define MSP_DSP_IN_TUNER 0 /* Tuner DSP input */
113#define MSP_DSP_OUT_SCART 2 /* SCART output */ 113#define MSP_DSP_IN_SCART 2 /* SCART DSP input */
114#define MSP_DSP_OUT_I2S1 5 /* I2S1 output */ 114#define MSP_DSP_IN_I2S1 5 /* I2S1 DSP input */
115#define MSP_DSP_OUT_I2S2 6 /* I2S2 output */ 115#define MSP_DSP_IN_I2S2 6 /* I2S2 DSP input */
116#define MSP_DSP_OUT_I2S3 7 /* I2S3 output */ 116#define MSP_DSP_IN_I2S3 7 /* I2S3 DSP input */
117#define MSP_DSP_OUT_MAIN_AVC 11 /* MAIN AVC processed output */ 117#define MSP_DSP_IN_MAIN_AVC 11 /* MAIN AVC processed DSP input */
118#define MSP_DSP_OUT_MAIN 12 /* MAIN output */ 118#define MSP_DSP_IN_MAIN 12 /* MAIN DSP input */
119#define MSP_DSP_OUT_AUX 13 /* AUX output */ 119#define MSP_DSP_IN_AUX 13 /* AUX DSP input */
120#define MSP_DSP_TO_MAIN(in) ((in) << 4) 120#define MSP_DSP_TO_MAIN(in) ((in) << 4)
121#define MSP_DSP_TO_AUX(in) ((in) << 8) 121#define MSP_DSP_TO_AUX(in) ((in) << 8)
122#define MSP_DSP_TO_SCART1(in) ((in) << 12) 122#define MSP_DSP_TO_SCART1(in) ((in) << 12)
@@ -125,16 +125,16 @@
125 125
126/* Output SCART select: the SCART outputs can select which input 126/* Output SCART select: the SCART outputs can select which input
127 to use. */ 127 to use. */
128#define MSP_OUT_SCART1 0 /* SCART1 input, bypassing the DSP */ 128#define MSP_SC_IN_SCART1 0 /* SCART1 input, bypassing the DSP */
129#define MSP_OUT_SCART2 1 /* SCART2 input, bypassing the DSP */ 129#define MSP_SC_IN_SCART2 1 /* SCART2 input, bypassing the DSP */
130#define MSP_OUT_SCART3 2 /* SCART3 input, bypassing the DSP */ 130#define MSP_SC_IN_SCART3 2 /* SCART3 input, bypassing the DSP */
131#define MSP_OUT_SCART4 3 /* SCART4 input, bypassing the DSP */ 131#define MSP_SC_IN_SCART4 3 /* SCART4 input, bypassing the DSP */
132#define MSP_OUT_SCART1_DA 4 /* DSP SCART1 output */ 132#define MSP_SC_IN_DSP_SCART1 4 /* DSP SCART1 input */
133#define MSP_OUT_SCART2_DA 5 /* DSP SCART2 output */ 133#define MSP_SC_IN_DSP_SCART2 5 /* DSP SCART2 input */
134#define MSP_OUT_MONO 6 /* MONO input, bypassing the DSP */ 134#define MSP_SC_IN_MONO 6 /* MONO input, bypassing the DSP */
135#define MSP_OUT_MUTE 7 /* MUTE output */ 135#define MSP_SC_IN_MUTE 7 /* MUTE output */
136#define MSP_OUT_TO_SCART1(in) (in) 136#define MSP_SC_TO_SCART1(in) (in)
137#define MSP_OUT_TO_SCART2(in) ((in) << 4) 137#define MSP_SC_TO_SCART2(in) ((in) << 4)
138 138
139/* Shortcut macros */ 139/* Shortcut macros */
140#define MSP_INPUT(sc, t, main_aux_src, sc_i2s_src) \ 140#define MSP_INPUT(sc, t, main_aux_src, sc_i2s_src) \
@@ -145,14 +145,14 @@
145 MSP_DSP_TO_SCART1(sc_i2s_src) | \ 145 MSP_DSP_TO_SCART1(sc_i2s_src) | \
146 MSP_DSP_TO_SCART2(sc_i2s_src) | \ 146 MSP_DSP_TO_SCART2(sc_i2s_src) | \
147 MSP_DSP_TO_I2S(sc_i2s_src)) 147 MSP_DSP_TO_I2S(sc_i2s_src))
148#define MSP_INPUT_DEFAULT MSP_INPUT(MSP_IN_SCART_1, MSP_IN_TUNER_1, \ 148#define MSP_INPUT_DEFAULT MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1, \
149 MSP_DSP_OUT_TUNER, MSP_DSP_OUT_TUNER) 149 MSP_DSP_IN_TUNER, MSP_DSP_IN_TUNER)
150#define MSP_OUTPUT(sc) \ 150#define MSP_OUTPUT(sc) \
151 (MSP_OUT_TO_SCART1(sc) | \ 151 (MSP_SC_TO_SCART1(sc) | \
152 MSP_OUT_TO_SCART2(sc)) 152 MSP_SC_TO_SCART2(sc))
153/* This equals the RESET position of the msp3400 ACB register */ 153/* This equals the RESET position of the msp3400 ACB register */
154#define MSP_OUTPUT_DEFAULT (MSP_OUT_TO_SCART1(MSP_OUT_SCART3) | \ 154#define MSP_OUTPUT_DEFAULT (MSP_SC_TO_SCART1(MSP_SC_IN_SCART3) | \
155 MSP_OUT_TO_SCART2(MSP_OUT_SCART1_DA)) 155 MSP_SC_TO_SCART2(MSP_SC_IN_DSP_SCART1))
156 156
157/* Tuner inputs vs. msp version */ 157/* Tuner inputs vs. msp version */
158/* Chip TUNER_1 TUNER_2 158/* Chip TUNER_1 TUNER_2
diff --git a/include/media/saa7115.h b/include/media/saa7115.h
new file mode 100644
index 000000000000..6b4836f3f057
--- /dev/null
+++ b/include/media/saa7115.h
@@ -0,0 +1,37 @@
1/*
2 saa7115.h - definition for saa7113/4/5 inputs
3
4 Copyright (C) 2006 Hans Verkuil (hverkuil@xs4all.nl)
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 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19*/
20
21#ifndef _SAA7115_H_
22#define _SAA7115_H_
23
24/* SAA7113/4/5 HW inputs */
25#define SAA7115_COMPOSITE0 0
26#define SAA7115_COMPOSITE1 1
27#define SAA7115_COMPOSITE2 2
28#define SAA7115_COMPOSITE3 3
29#define SAA7115_COMPOSITE4 4 /* not available for the saa7113 */
30#define SAA7115_COMPOSITE5 5 /* not available for the saa7113 */
31#define SAA7115_SVIDEO0 6
32#define SAA7115_SVIDEO1 7
33#define SAA7115_SVIDEO2 8
34#define SAA7115_SVIDEO3 9
35
36#endif
37
diff --git a/include/media/saa7127.h b/include/media/saa7127.h
new file mode 100644
index 000000000000..bbcf862141af
--- /dev/null
+++ b/include/media/saa7127.h
@@ -0,0 +1,41 @@
1/*
2 saa7127.h - definition for saa7126/7/8/9 inputs/outputs
3
4 Copyright (C) 2006 Hans Verkuil (hverkuil@xs4all.nl)
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 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19*/
20
21#ifndef _SAA7127_H_
22#define _SAA7127_H_
23
24/* Enumeration for the supported input types */
25enum saa7127_input_type {
26 SAA7127_INPUT_TYPE_NORMAL,
27 SAA7127_INPUT_TYPE_TEST_IMAGE
28};
29
30/* Enumeration for the supported output signal types */
31enum saa7127_output_type {
32 SAA7127_OUTPUT_TYPE_BOTH,
33 SAA7127_OUTPUT_TYPE_COMPOSITE,
34 SAA7127_OUTPUT_TYPE_SVIDEO,
35 SAA7127_OUTPUT_TYPE_RGB,
36 SAA7127_OUTPUT_TYPE_YUV_C,
37 SAA7127_OUTPUT_TYPE_YUV_V
38};
39
40#endif
41
diff --git a/include/media/upd64031a.h b/include/media/upd64031a.h
new file mode 100644
index 000000000000..3ad6a32e1bce
--- /dev/null
+++ b/include/media/upd64031a.h
@@ -0,0 +1,40 @@
1/*
2 * upd64031a - NEC Electronics Ghost Reduction input defines
3 *
4 * 2006 by Hans Verkuil (hverkuil@xs4all.nl)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (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 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 */
20
21#ifndef _UPD64031A_H_
22#define _UPD64031A_H_
23
24/* Ghost reduction modes */
25#define UPD64031A_GR_ON 0
26#define UPD64031A_GR_OFF 1
27#define UPD64031A_GR_THROUGH 3
28
29/* Direct 3D/YCS Connection */
30#define UPD64031A_3DYCS_DISABLE (0 << 2)
31#define UPD64031A_3DYCS_COMPOSITE (2 << 2)
32#define UPD64031A_3DYCS_SVIDEO (3 << 2)
33
34/* Composite sync digital separation circuit */
35#define UPD64031A_COMPOSITE_EXTERNAL (1 << 4)
36
37/* Vertical sync digital separation circuit */
38#define UPD64031A_VERTICAL_EXTERNAL (1 << 5)
39
40#endif
diff --git a/include/media/upd64083.h b/include/media/upd64083.h
new file mode 100644
index 000000000000..59b6f32ba300
--- /dev/null
+++ b/include/media/upd64083.h
@@ -0,0 +1,58 @@
1/*
2 * upd6408x - NEC Electronics 3-Dimensional Y/C separation input defines
3 *
4 * 2006 by Hans Verkuil (hverkuil@xs4all.nl)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (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 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 */
20
21#ifndef _UPD64083_H_
22#define _UPD64083_H_
23
24/* There are two bits of information that the driver needs in order
25 to select the correct routing: the operating mode and the selection
26 of the Y input (external or internal).
27
28 The first two operating modes expect a composite signal on the Y input,
29 the second two operating modes use both the Y and C inputs.
30
31 Normally YCS_MODE is used for tuner and composite inputs, and the
32 YCNR mode is used for S-Video inputs.
33
34 The external Y-ADC is selected when the composite input comes from a
35 upd64031a ghost reduction device. If this device is not present, or
36 the input is a S-Video signal, then the internal Y-ADC input should
37 be used. */
38
39/* Operating modes: */
40
41/* YCS mode: Y/C separation (burst locked clocking) */
42#define UPD64083_YCS_MODE 0
43/* YCS+ mode: 2D Y/C separation and YCNR (burst locked clocking) */
44#define UPD64083_YCS_PLUS_MODE 1
45
46/* Note: the following two modes cannot be used in combination with the
47 external Y-ADC. */
48/* MNNR mode: frame comb type YNR+C delay (line locked clocking) */
49#define UPD64083_MNNR_MODE 2
50/* YCNR mode: frame recursive YCNR (burst locked clocking) */
51#define UPD64083_YCNR_MODE 3
52
53/* Select external Y-ADC: this should be set if this device is used in
54 combination with the upd64031a ghost reduction device.
55 Otherwise leave at 0 (use internal Y-ADC). */
56#define UPD64083_EXT_Y_ADC (1 << 2)
57
58#endif
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 9418f4d1afbb..3c989db8a7aa 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -405,9 +405,6 @@ extern int tcp_disconnect(struct sock *sk, int flags);
405 405
406extern void tcp_unhash(struct sock *sk); 406extern void tcp_unhash(struct sock *sk);
407 407
408extern int tcp_v4_hash_connecting(struct sock *sk);
409
410
411/* From syncookies.c */ 408/* From syncookies.c */
412extern struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb, 409extern struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
413 struct ip_options *opt); 410 struct ip_options *opt);
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index e100291e43f4..0d5529c382e8 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -242,7 +242,6 @@ extern int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo);
242 242
243extern void xfrm_state_delete_tunnel(struct xfrm_state *x); 243extern void xfrm_state_delete_tunnel(struct xfrm_state *x);
244 244
245struct xfrm_decap_state;
246struct xfrm_type 245struct xfrm_type
247{ 246{
248 char *description; 247 char *description;
@@ -251,7 +250,7 @@ struct xfrm_type
251 250
252 int (*init_state)(struct xfrm_state *x); 251 int (*init_state)(struct xfrm_state *x);
253 void (*destructor)(struct xfrm_state *); 252 void (*destructor)(struct xfrm_state *);
254 int (*input)(struct xfrm_state *, struct xfrm_decap_state *, struct sk_buff *skb); 253 int (*input)(struct xfrm_state *, struct sk_buff *skb);
255 int (*output)(struct xfrm_state *, struct sk_buff *pskb); 254 int (*output)(struct xfrm_state *, struct sk_buff *pskb);
256 /* Estimate maximal size of result of transformation of a dgram */ 255 /* Estimate maximal size of result of transformation of a dgram */
257 u32 (*get_max_size)(struct xfrm_state *, int size); 256 u32 (*get_max_size)(struct xfrm_state *, int size);
@@ -606,25 +605,11 @@ static inline void xfrm_dst_destroy(struct xfrm_dst *xdst)
606 605
607extern void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev); 606extern void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev);
608 607
609/* Decapsulation state, used by the input to store data during
610 * decapsulation procedure, to be used later (during the policy
611 * check
612 */
613struct xfrm_decap_state {
614 char decap_data[20];
615 __u16 decap_type;
616};
617
618struct sec_decap_state {
619 struct xfrm_state *xvec;
620 struct xfrm_decap_state decap;
621};
622
623struct sec_path 608struct sec_path
624{ 609{
625 atomic_t refcnt; 610 atomic_t refcnt;
626 int len; 611 int len;
627 struct sec_decap_state x[XFRM_MAX_DEPTH]; 612 struct xfrm_state *xvec[XFRM_MAX_DEPTH];
628}; 613};
629 614
630static inline struct sec_path * 615static inline struct sec_path *
diff --git a/include/pcmcia/bulkmem.h b/include/pcmcia/bulkmem.h
index b53b78d497ba..6bc7472293b2 100644
--- a/include/pcmcia/bulkmem.h
+++ b/include/pcmcia/bulkmem.h
@@ -35,7 +35,7 @@ typedef struct region_info_t {
35#define REGION_BAR_MASK 0xe000 35#define REGION_BAR_MASK 0xe000
36#define REGION_BAR_SHIFT 13 36#define REGION_BAR_SHIFT 13
37 37
38int pcmcia_get_first_region(client_handle_t handle, region_info_t *rgn); 38int pcmcia_get_first_region(struct pcmcia_device *handle, region_info_t *rgn);
39int pcmcia_get_next_region(client_handle_t handle, region_info_t *rgn); 39int pcmcia_get_next_region(struct pcmcia_device *handle, region_info_t *rgn);
40 40
41#endif /* _LINUX_BULKMEM_H */ 41#endif /* _LINUX_BULKMEM_H */
diff --git a/include/pcmcia/ciscode.h b/include/pcmcia/ciscode.h
index da19c297dd65..c1da8558339a 100644
--- a/include/pcmcia/ciscode.h
+++ b/include/pcmcia/ciscode.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * ciscode.h -- Definitions for bulk memory services 2 * ciscode.h
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as 5 * it under the terms of the GNU General Public License version 2 as
@@ -122,4 +122,7 @@
122 122
123#define MANFID_XIRCOM 0x0105 123#define MANFID_XIRCOM 0x0105
124 124
125#define MANFID_POSSIO 0x030c
126#define PRODID_POSSIO_GCC 0x0003
127
125#endif /* _LINUX_CISCODE_H */ 128#endif /* _LINUX_CISCODE_H */
diff --git a/include/pcmcia/cistpl.h b/include/pcmcia/cistpl.h
index c6a069554fd7..d3bbb19caf81 100644
--- a/include/pcmcia/cistpl.h
+++ b/include/pcmcia/cistpl.h
@@ -586,12 +586,7 @@ typedef struct cisdump_t {
586 cisdata_t Data[CISTPL_MAX_CIS_SIZE]; 586 cisdata_t Data[CISTPL_MAX_CIS_SIZE];
587} cisdump_t; 587} cisdump_t;
588 588
589int pcmcia_get_first_tuple(client_handle_t handle, tuple_t *tuple);
590int pcmcia_get_next_tuple(client_handle_t handle, tuple_t *tuple);
591int pcmcia_get_tuple_data(client_handle_t handle, tuple_t *tuple);
592int pcmcia_parse_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse);
593 589
594int pcmcia_validate_cis(client_handle_t handle, cisinfo_t *info);
595int pcmcia_replace_cis(struct pcmcia_socket *s, cisdump_t *cis); 590int pcmcia_replace_cis(struct pcmcia_socket *s, cisdump_t *cis);
596 591
597/* don't use outside of PCMCIA core yet */ 592/* don't use outside of PCMCIA core yet */
@@ -602,4 +597,20 @@ int pccard_parse_tuple(tuple_t *tuple, cisparse_t *parse);
602 597
603int pccard_validate_cis(struct pcmcia_socket *s, unsigned int function, cisinfo_t *info); 598int pccard_validate_cis(struct pcmcia_socket *s, unsigned int function, cisinfo_t *info);
604 599
600/* ... but use these wrappers instead */
601#define pcmcia_get_first_tuple(p_dev, tuple) \
602 pccard_get_first_tuple(p_dev->socket, p_dev->func, tuple)
603
604#define pcmcia_get_next_tuple(p_dev, tuple) \
605 pccard_get_next_tuple(p_dev->socket, p_dev->func, tuple)
606
607#define pcmcia_get_tuple_data(p_dev, tuple) \
608 pccard_get_tuple_data(p_dev->socket, tuple)
609
610#define pcmcia_parse_tuple(p_dev, tuple, parse) \
611 pccard_parse_tuple(tuple, parse)
612
613#define pcmcia_validate_cis(p_dev, info) \
614 pccard_validate_cis(p_dev->socket, p_dev->func, info)
615
605#endif /* LINUX_CISTPL_H */ 616#endif /* LINUX_CISTPL_H */
diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h
index 52660f32663d..d5838c30d20f 100644
--- a/include/pcmcia/cs.h
+++ b/include/pcmcia/cs.h
@@ -109,17 +109,6 @@ typedef struct client_req_t {
109 109
110#define CLIENT_THIS_SOCKET 0x01 110#define CLIENT_THIS_SOCKET 0x01
111 111
112/* For RegisterClient */
113typedef struct client_reg_t {
114 dev_info_t *dev_info;
115 u_int Attributes; /* UNUSED */
116 u_int EventMask;
117 int (*event_handler)(event_t event, int priority,
118 event_callback_args_t *);
119 event_callback_args_t event_callback_args;
120 u_int Version;
121} client_reg_t;
122
123/* ModifyConfiguration */ 112/* ModifyConfiguration */
124typedef struct modconf_t { 113typedef struct modconf_t {
125 u_int Attributes; 114 u_int Attributes;
@@ -127,15 +116,16 @@ typedef struct modconf_t {
127} modconf_t; 116} modconf_t;
128 117
129/* Attributes for ModifyConfiguration */ 118/* Attributes for ModifyConfiguration */
130#define CONF_IRQ_CHANGE_VALID 0x100 119#define CONF_IRQ_CHANGE_VALID 0x0100
131#define CONF_VCC_CHANGE_VALID 0x200 120#define CONF_VCC_CHANGE_VALID 0x0200
132#define CONF_VPP1_CHANGE_VALID 0x400 121#define CONF_VPP1_CHANGE_VALID 0x0400
133#define CONF_VPP2_CHANGE_VALID 0x800 122#define CONF_VPP2_CHANGE_VALID 0x0800
123#define CONF_IO_CHANGE_WIDTH 0x1000
134 124
135/* For RequestConfiguration */ 125/* For RequestConfiguration */
136typedef struct config_req_t { 126typedef struct config_req_t {
137 u_int Attributes; 127 u_int Attributes;
138 u_int Vcc, Vpp1, Vpp2; 128 u_int Vpp; /* both Vpp1 and Vpp2 */
139 u_int IntType; 129 u_int IntType;
140 u_int ConfigBase; 130 u_int ConfigBase;
141 u_char Status, Pin, Copy, ExtStatus; 131 u_char Status, Pin, Copy, ExtStatus;
@@ -389,23 +379,27 @@ int pcmcia_get_status(struct pcmcia_device *p_dev, cs_status_t *status);
389int pcmcia_get_mem_page(window_handle_t win, memreq_t *req); 379int pcmcia_get_mem_page(window_handle_t win, memreq_t *req);
390int pcmcia_map_mem_page(window_handle_t win, memreq_t *req); 380int pcmcia_map_mem_page(window_handle_t win, memreq_t *req);
391int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod); 381int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod);
392int pcmcia_release_configuration(struct pcmcia_device *p_dev);
393int pcmcia_release_io(struct pcmcia_device *p_dev, io_req_t *req);
394int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req);
395int pcmcia_release_window(window_handle_t win); 382int pcmcia_release_window(window_handle_t win);
396int pcmcia_request_configuration(struct pcmcia_device *p_dev, config_req_t *req); 383int pcmcia_request_configuration(struct pcmcia_device *p_dev, config_req_t *req);
397int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req); 384int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req);
398int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req); 385int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req);
399int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_handle_t *wh); 386int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_handle_t *wh);
400int pcmcia_reset_card(struct pcmcia_device *p_dev, client_req_t *req);
401int pcmcia_suspend_card(struct pcmcia_socket *skt); 387int pcmcia_suspend_card(struct pcmcia_socket *skt);
402int pcmcia_resume_card(struct pcmcia_socket *skt); 388int pcmcia_resume_card(struct pcmcia_socket *skt);
403int pcmcia_eject_card(struct pcmcia_socket *skt); 389int pcmcia_eject_card(struct pcmcia_socket *skt);
404int pcmcia_insert_card(struct pcmcia_socket *skt); 390int pcmcia_insert_card(struct pcmcia_socket *skt);
391int pccard_reset_card(struct pcmcia_socket *skt);
392
393struct pcmcia_device * pcmcia_dev_present(struct pcmcia_device *p_dev);
394void pcmcia_disable_device(struct pcmcia_device *p_dev);
405 395
406struct pcmcia_socket * pcmcia_get_socket(struct pcmcia_socket *skt); 396struct pcmcia_socket * pcmcia_get_socket(struct pcmcia_socket *skt);
407void pcmcia_put_socket(struct pcmcia_socket *skt); 397void pcmcia_put_socket(struct pcmcia_socket *skt);
408 398
399/* compatibility functions */
400#define pcmcia_reset_card(p_dev, req) \
401 pccard_reset_card(p_dev->socket)
402
409#endif /* __KERNEL__ */ 403#endif /* __KERNEL__ */
410 404
411#endif /* _LINUX_CS_H */ 405#endif /* _LINUX_CS_H */
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
index 8e2a96396478..8c339f5678cf 100644
--- a/include/pcmcia/ds.h
+++ b/include/pcmcia/ds.h
@@ -39,7 +39,7 @@ typedef struct win_info_t {
39typedef struct bind_info_t { 39typedef struct bind_info_t {
40 dev_info_t dev_info; 40 dev_info_t dev_info;
41 u_char function; 41 u_char function;
42 struct dev_link_t *instance; 42 struct pcmcia_device *instance;
43 char name[DEV_NAME_LEN]; 43 char name[DEV_NAME_LEN];
44 u_short major, minor; 44 u_short major, minor;
45 void *next; 45 void *next;
@@ -96,6 +96,7 @@ typedef union ds_ioctl_arg_t {
96 96
97#ifdef __KERNEL__ 97#ifdef __KERNEL__
98#include <linux/device.h> 98#include <linux/device.h>
99#include <pcmcia/ss.h>
99 100
100typedef struct dev_node_t { 101typedef struct dev_node_t {
101 char dev_name[DEV_NAME_LEN]; 102 char dev_name[DEV_NAME_LEN];
@@ -103,34 +104,9 @@ typedef struct dev_node_t {
103 struct dev_node_t *next; 104 struct dev_node_t *next;
104} dev_node_t; 105} dev_node_t;
105 106
106typedef struct dev_link_t {
107 dev_node_t *dev;
108 u_int state, open;
109 wait_queue_head_t pending;
110 client_handle_t handle;
111 io_req_t io;
112 irq_req_t irq;
113 config_req_t conf;
114 window_handle_t win;
115 void *priv;
116 struct dev_link_t *next;
117} dev_link_t;
118
119/* Flags for device state */
120#define DEV_PRESENT 0x01
121#define DEV_CONFIG 0x02
122#define DEV_STALE_CONFIG 0x04 /* release on close */
123#define DEV_STALE_LINK 0x08 /* detach on release */
124#define DEV_CONFIG_PENDING 0x10
125#define DEV_RELEASE_PENDING 0x20
126#define DEV_SUSPEND 0x40
127#define DEV_BUSY 0x80
128
129#define DEV_OK(l) \
130 ((l) && ((l->state & ~DEV_BUSY) == (DEV_CONFIG|DEV_PRESENT)))
131
132 107
133struct pcmcia_socket; 108struct pcmcia_socket;
109struct config_t;
134 110
135struct pcmcia_driver { 111struct pcmcia_driver {
136 int (*probe) (struct pcmcia_device *dev); 112 int (*probe) (struct pcmcia_device *dev);
@@ -148,6 +124,7 @@ struct pcmcia_driver {
148int pcmcia_register_driver(struct pcmcia_driver *driver); 124int pcmcia_register_driver(struct pcmcia_driver *driver);
149void pcmcia_unregister_driver(struct pcmcia_driver *driver); 125void pcmcia_unregister_driver(struct pcmcia_driver *driver);
150 126
127
151struct pcmcia_device { 128struct pcmcia_device {
152 /* the socket and the device_no [for multifunction devices] 129 /* the socket and the device_no [for multifunction devices]
153 uniquely define a pcmcia_device */ 130 uniquely define a pcmcia_device */
@@ -160,21 +137,40 @@ struct pcmcia_device {
160 /* the hardware "function" device; certain subdevices can 137 /* the hardware "function" device; certain subdevices can
161 * share one hardware "function" device. */ 138 * share one hardware "function" device. */
162 u8 func; 139 u8 func;
140 struct config_t* function_config;
163 141
164 struct list_head socket_device_list; 142 struct list_head socket_device_list;
165 143
166 /* deprecated, a cleaned up version will be moved into this 144 /* deprecated, will be cleaned up soon */
167 struct soon */ 145 dev_node_t *dev_node;
168 dev_link_t *instance; 146 u_int open;
169 u_int state; 147 io_req_t io;
148 irq_req_t irq;
149 config_req_t conf;
150 window_handle_t win;
151
152 /* Is the device suspended, or in the process of
153 * being removed? */
154 u16 suspended:1;
155 u16 _removed:1;
156
157 /* Flags whether io, irq, win configurations were
158 * requested, and whether the configuration is "locked" */
159 u16 _irq:1;
160 u16 _io:1;
161 u16 _win:4;
162 u16 _locked:1;
163
164 /* Flag whether a "fuzzy" func_id based match is
165 * allowed. */
166 u16 allow_func_id_match:1;
170 167
171 /* information about this device */ 168 /* information about this device */
172 u8 has_manf_id:1; 169 u16 has_manf_id:1;
173 u8 has_card_id:1; 170 u16 has_card_id:1;
174 u8 has_func_id:1; 171 u16 has_func_id:1;
175 172
176 u8 allow_func_id_match:1; 173 u16 reserved:3;
177 u8 reserved:4;
178 174
179 u8 func_id; 175 u8 func_id;
180 u16 manf_id; 176 u16 manf_id;
@@ -182,22 +178,24 @@ struct pcmcia_device {
182 178
183 char * prod_id[4]; 179 char * prod_id[4];
184 180
181 struct device dev;
182
183#ifdef CONFIG_PCMCIA_IOCTL
185 /* device driver wanted by cardmgr */ 184 /* device driver wanted by cardmgr */
186 struct pcmcia_driver * cardmgr; 185 struct pcmcia_driver * cardmgr;
186#endif
187 187
188 struct device dev; 188 /* data private to drivers */
189 void *priv;
189}; 190};
190 191
191#define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev) 192#define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev)
192#define to_pcmcia_drv(n) container_of(n, struct pcmcia_driver, drv) 193#define to_pcmcia_drv(n) container_of(n, struct pcmcia_driver, drv)
193 194
194#define handle_to_pdev(handle) (handle)
195#define handle_to_dev(handle) (handle->dev) 195#define handle_to_dev(handle) (handle->dev)
196 196
197#define dev_to_instance(dev) (dev->instance)
198
199/* error reporting */ 197/* error reporting */
200void cs_error(client_handle_t handle, int func, int ret); 198void cs_error(struct pcmcia_device *handle, int func, int ret);
201 199
202#endif /* __KERNEL__ */ 200#endif /* __KERNEL__ */
203#endif /* _LINUX_DS_H */ 201#endif /* _LINUX_DS_H */
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h
index 2889a69a7a8f..5e0a01ab2216 100644
--- a/include/pcmcia/ss.h
+++ b/include/pcmcia/ss.h
@@ -18,6 +18,7 @@
18#include <linux/config.h> 18#include <linux/config.h>
19#include <linux/device.h> 19#include <linux/device.h>
20#include <linux/sched.h> /* task_struct, completion */ 20#include <linux/sched.h> /* task_struct, completion */
21#include <linux/mutex.h>
21 22
22#include <pcmcia/cs_types.h> 23#include <pcmcia/cs_types.h>
23#include <pcmcia/cs.h> 24#include <pcmcia/cs.h>
@@ -146,14 +147,15 @@ extern struct pccard_resource_ops pccard_static_ops;
146/* !SS_CAP_STATIC_MAP */ 147/* !SS_CAP_STATIC_MAP */
147extern struct pccard_resource_ops pccard_nonstatic_ops; 148extern struct pccard_resource_ops pccard_nonstatic_ops;
148 149
150/* static mem, dynamic IO sockets */
151extern struct pccard_resource_ops pccard_iodyn_ops;
152
149/* 153/*
150 * Calls to set up low-level "Socket Services" drivers 154 * Calls to set up low-level "Socket Services" drivers
151 */ 155 */
152struct pcmcia_socket; 156struct pcmcia_socket;
153 157
154typedef struct io_window_t { 158typedef struct io_window_t {
155 u_int Attributes;
156 kio_addr_t BasePort, NumPorts;
157 kio_addr_t InUse, Config; 159 kio_addr_t InUse, Config;
158 struct resource *res; 160 struct resource *res;
159} io_window_t; 161} io_window_t;
@@ -162,7 +164,7 @@ typedef struct io_window_t {
162typedef struct window_t { 164typedef struct window_t {
163 u_short magic; 165 u_short magic;
164 u_short index; 166 u_short index;
165 client_handle_t handle; 167 struct pcmcia_device *handle;
166 struct pcmcia_socket *sock; 168 struct pcmcia_socket *sock;
167 pccard_mem_map ctl; 169 pccard_mem_map ctl;
168} window_t; 170} window_t;
@@ -186,7 +188,6 @@ struct pcmcia_socket {
186 u_short lock_count; 188 u_short lock_count;
187 pccard_mem_map cis_mem; 189 pccard_mem_map cis_mem;
188 void __iomem *cis_virt; 190 void __iomem *cis_virt;
189 struct config_t *config;
190 struct { 191 struct {
191 u_int AssignedIRQ; 192 u_int AssignedIRQ;
192 u_int Config; 193 u_int Config;
@@ -241,7 +242,7 @@ struct pcmcia_socket {
241#endif 242#endif
242 243
243 /* state thread */ 244 /* state thread */
244 struct semaphore skt_sem; /* protects socket h/w state */ 245 struct mutex skt_mutex; /* protects socket h/w state */
245 246
246 struct task_struct *thread; 247 struct task_struct *thread;
247 struct completion thread_done; 248 struct completion thread_done;