diff options
| author | Jeff Garzik <jeff@garzik.org> | 2006-04-01 14:29:12 -0500 |
|---|---|---|
| committer | Jeff Garzik <jeff@garzik.org> | 2006-04-01 14:29:12 -0500 |
| commit | 6e07e16404deafadf45895a7d2aeb5feba53b479 (patch) | |
| tree | a7025d6632f0b3eb6232eafba79f331ead812fcf /include | |
| parent | 08a556db919f67e1e4d33ae8d40f7222da34d994 (diff) | |
| parent | e8e0619f68bff8f39d98c46aac85ed1d4557ccfd (diff) | |
Merge branch 'upstream'
Diffstat (limited to 'include')
67 files changed, 766 insertions, 512 deletions
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 | ||
| 19 | static __inline__ void putc(char c) | 19 | static 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 | ||
| 31 | static void putstr(const char *s) | 32 | static 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 | */ |
| 28 | struct corgibl_machinfo { | 28 | struct 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 | }; |
| 32 | extern void corgibl_limit_intensity(int limit); | 34 | extern 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) \ | 20 | static inline void |
| 21 | do { \ | 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 | */ |
| 38 | static inline int | 39 | static 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) \ | 63 | static inline void |
| 63 | do { \ | 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) \ | 25 | static inline void |
| 26 | do { \ | 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 | */ |
| 44 | static inline int | 44 | static 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) \ | 67 | static inline void |
| 68 | do { \ | 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 | ||
| 6 | typedef struct | 6 | typedef 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 | ||
| 32 | static __inline__ void local_add(unsigned long i, local_t *v) | 32 | static __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 | ||
| 40 | static __inline__ void local_sub(unsigned long i, local_t *v) | 40 | static __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 014e3562895b..2e7f3e257fdd 100644 --- a/include/asm-i386/unistd.h +++ b/include/asm-i386/unistd.h | |||
| @@ -318,8 +318,10 @@ | |||
| 318 | #define __NR_unshare 310 | 318 | #define __NR_unshare 310 |
| 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 | ||
| 322 | #define __NR_sys_sync_file_range 314 | ||
| 321 | 323 | ||
| 322 | #define NR_syscalls 313 | 324 | #define NR_syscalls 315 |
| 323 | 325 | ||
| 324 | /* | 326 | /* |
| 325 | * 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/asmmacro.h b/include/asm-ia64/asmmacro.h index d4cec32083d8..edf2cebb2969 100644 --- a/include/asm-ia64/asmmacro.h +++ b/include/asm-ia64/asmmacro.h | |||
| @@ -38,6 +38,10 @@ name: | |||
| 38 | 38 | ||
| 39 | /* | 39 | /* |
| 40 | * Helper macros for accessing user memory. | 40 | * Helper macros for accessing user memory. |
| 41 | * | ||
| 42 | * When adding any new .section/.previous entries here, make sure to | ||
| 43 | * also add it to the DISCARD section in arch/ia64/kernel/gate.lds.S or | ||
| 44 | * unpleasant things will happen. | ||
| 41 | */ | 45 | */ |
| 42 | 46 | ||
| 43 | .section "__ex_table", "a" // declare section & section attributes | 47 | .section "__ex_table", "a" // declare section & section attributes |
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 | ||
| 132 | typedef struct pal_freq_ratio { | 133 | typedef 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 | ||
| 136 | typedef union pal_cache_config_info_1_s { | 137 | typedef union pal_cache_config_info_1_s { |
| @@ -151,10 +152,10 @@ typedef union pal_cache_config_info_1_s { | |||
| 151 | 152 | ||
| 152 | typedef union pal_cache_config_info_2_s { | 153 | typedef 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 | |||
| 1652 | typedef 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. */ | ||
| 1660 | static inline s64 | ||
| 1661 | ia64_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-ia64/unistd.h b/include/asm-ia64/unistd.h index 019956c613e4..36070c1014d8 100644 --- a/include/asm-ia64/unistd.h +++ b/include/asm-ia64/unistd.h | |||
| @@ -285,12 +285,13 @@ | |||
| 285 | #define __NR_faccessat 1293 | 285 | #define __NR_faccessat 1293 |
| 286 | /* 1294, 1295 reserved for pselect/ppoll */ | 286 | /* 1294, 1295 reserved for pselect/ppoll */ |
| 287 | #define __NR_unshare 1296 | 287 | #define __NR_unshare 1296 |
| 288 | #define __NR_splice 1297 | ||
| 288 | 289 | ||
| 289 | #ifdef __KERNEL__ | 290 | #ifdef __KERNEL__ |
| 290 | 291 | ||
| 291 | #include <linux/config.h> | 292 | #include <linux/config.h> |
| 292 | 293 | ||
| 293 | #define NR_syscalls 273 /* length of syscall table */ | 294 | #define NR_syscalls 274 /* length of syscall table */ |
| 294 | 295 | ||
| 295 | #define __ARCH_WANT_SYS_RT_SIGACTION | 296 | #define __ARCH_WANT_SYS_RT_SIGACTION |
| 296 | 297 | ||
diff --git a/include/asm-parisc/atomic.h b/include/asm-parisc/atomic.h index 4dc7253ff5d0..403ea97316cf 100644 --- a/include/asm-parisc/atomic.h +++ b/include/asm-parisc/atomic.h | |||
| @@ -210,6 +210,8 @@ static __inline__ int atomic_read(const atomic_t *v) | |||
| 210 | 210 | ||
| 211 | #define atomic_dec_and_test(v) (atomic_dec_return(v) == 0) | 211 | #define atomic_dec_and_test(v) (atomic_dec_return(v) == 0) |
| 212 | 212 | ||
| 213 | #define atomic_sub_and_test(i,v) (atomic_sub_return((i),(v)) == 0) | ||
| 214 | |||
| 213 | #define ATOMIC_INIT(i) ((atomic_t) { (i) }) | 215 | #define ATOMIC_INIT(i) ((atomic_t) { (i) }) |
| 214 | 216 | ||
| 215 | #define smp_mb__before_atomic_dec() smp_mb() | 217 | #define smp_mb__before_atomic_dec() smp_mb() |
| @@ -267,6 +269,7 @@ atomic64_read(const atomic64_t *v) | |||
| 267 | 269 | ||
| 268 | #define atomic64_inc_and_test(v) (atomic64_inc_return(v) == 0) | 270 | #define atomic64_inc_and_test(v) (atomic64_inc_return(v) == 0) |
| 269 | #define atomic64_dec_and_test(v) (atomic64_dec_return(v) == 0) | 271 | #define atomic64_dec_and_test(v) (atomic64_dec_return(v) == 0) |
| 272 | #define atomic64_sub_and_test(i,v) (atomic64_sub_return((i),(v)) == 0) | ||
| 270 | 273 | ||
| 271 | #endif /* __LP64__ */ | 274 | #endif /* __LP64__ */ |
| 272 | 275 | ||
diff --git a/include/asm-parisc/cache.h b/include/asm-parisc/cache.h index ae50f8e12eed..c831665473cb 100644 --- a/include/asm-parisc/cache.h +++ b/include/asm-parisc/cache.h | |||
| @@ -48,7 +48,7 @@ extern void flush_user_icache_range_asm(unsigned long, unsigned long); | |||
| 48 | extern void flush_kernel_icache_range_asm(unsigned long, unsigned long); | 48 | extern void flush_kernel_icache_range_asm(unsigned long, unsigned long); |
| 49 | extern void flush_user_dcache_range_asm(unsigned long, unsigned long); | 49 | extern void flush_user_dcache_range_asm(unsigned long, unsigned long); |
| 50 | extern void flush_kernel_dcache_range_asm(unsigned long, unsigned long); | 50 | extern void flush_kernel_dcache_range_asm(unsigned long, unsigned long); |
| 51 | extern void flush_kernel_dcache_page(void *); | 51 | extern void flush_kernel_dcache_page_asm(void *); |
| 52 | extern void flush_kernel_icache_page(void *); | 52 | extern void flush_kernel_icache_page(void *); |
| 53 | extern void disable_sr_hashing(void); /* turns off space register hashing */ | 53 | extern void disable_sr_hashing(void); /* turns off space register hashing */ |
| 54 | extern void disable_sr_hashing_asm(int); /* low level support for above */ | 54 | extern void disable_sr_hashing_asm(int); /* low level support for above */ |
diff --git a/include/asm-parisc/cacheflush.h b/include/asm-parisc/cacheflush.h index c53af9ff41b5..76b6b7d6046a 100644 --- a/include/asm-parisc/cacheflush.h +++ b/include/asm-parisc/cacheflush.h | |||
| @@ -62,7 +62,7 @@ extern void flush_dcache_page(struct page *page); | |||
| 62 | #define flush_dcache_mmap_unlock(mapping) \ | 62 | #define flush_dcache_mmap_unlock(mapping) \ |
| 63 | write_unlock_irq(&(mapping)->tree_lock) | 63 | write_unlock_irq(&(mapping)->tree_lock) |
| 64 | 64 | ||
| 65 | #define flush_icache_page(vma,page) do { flush_kernel_dcache_page(page_address(page)); flush_kernel_icache_page(page_address(page)); } while (0) | 65 | #define flush_icache_page(vma,page) do { flush_kernel_dcache_page(page); flush_kernel_icache_page(page_address(page)); } while (0) |
| 66 | 66 | ||
| 67 | #define flush_icache_range(s,e) do { flush_kernel_dcache_range_asm(s,e); flush_kernel_icache_range_asm(s,e); } while (0) | 67 | #define flush_icache_range(s,e) do { flush_kernel_dcache_range_asm(s,e); flush_kernel_icache_range_asm(s,e); } while (0) |
| 68 | 68 | ||
| @@ -184,6 +184,21 @@ flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr, unsigned long | |||
| 184 | 184 | ||
| 185 | } | 185 | } |
| 186 | 186 | ||
| 187 | static inline void | ||
| 188 | flush_anon_page(struct page *page, unsigned long vmaddr) | ||
| 189 | { | ||
| 190 | if (PageAnon(page)) | ||
| 191 | flush_user_dcache_page(vmaddr); | ||
| 192 | } | ||
| 193 | #define ARCH_HAS_FLUSH_ANON_PAGE | ||
| 194 | |||
| 195 | static inline void | ||
| 196 | flush_kernel_dcache_page(struct page *page) | ||
| 197 | { | ||
| 198 | flush_kernel_dcache_page_asm(page_address(page)); | ||
| 199 | } | ||
| 200 | #define ARCH_HAS_FLUSH_KERNEL_DCACHE_PAGE | ||
| 201 | |||
| 187 | #ifdef CONFIG_DEBUG_RODATA | 202 | #ifdef CONFIG_DEBUG_RODATA |
| 188 | void mark_rodata_ro(void); | 203 | void mark_rodata_ro(void); |
| 189 | #endif | 204 | #endif |
diff --git a/include/asm-parisc/io.h b/include/asm-parisc/io.h index be0c7234a6da..29da31194b91 100644 --- a/include/asm-parisc/io.h +++ b/include/asm-parisc/io.h | |||
| @@ -25,35 +25,11 @@ extern unsigned long parisc_vmerge_max_size; | |||
| 25 | * eg dev->hpa or 0xfee00000. | 25 | * eg dev->hpa or 0xfee00000. |
| 26 | */ | 26 | */ |
| 27 | 27 | ||
| 28 | #ifdef CONFIG_DEBUG_IOREMAP | ||
| 29 | #ifdef CONFIG_64BIT | ||
| 30 | #define NYBBLE_SHIFT 60 | ||
| 31 | #else | ||
| 32 | #define NYBBLE_SHIFT 28 | ||
| 33 | #endif | ||
| 34 | extern void gsc_bad_addr(unsigned long addr); | ||
| 35 | extern void __raw_bad_addr(const volatile void __iomem *addr); | ||
| 36 | #define gsc_check_addr(addr) \ | ||
| 37 | if ((addr >> NYBBLE_SHIFT) != 0xf) { \ | ||
| 38 | gsc_bad_addr(addr); \ | ||
| 39 | addr |= 0xfUL << NYBBLE_SHIFT; \ | ||
| 40 | } | ||
| 41 | #define __raw_check_addr(addr) \ | ||
| 42 | if (((unsigned long)addr >> NYBBLE_SHIFT) != 0xe) \ | ||
| 43 | __raw_bad_addr(addr); \ | ||
| 44 | addr = (void __iomem *)((unsigned long)addr | (0xfUL << NYBBLE_SHIFT)); | ||
| 45 | #else | ||
| 46 | #define gsc_check_addr(addr) | ||
| 47 | #define __raw_check_addr(addr) | ||
| 48 | #endif | ||
| 49 | |||
| 50 | static inline unsigned char gsc_readb(unsigned long addr) | 28 | static inline unsigned char gsc_readb(unsigned long addr) |
| 51 | { | 29 | { |
| 52 | long flags; | 30 | long flags; |
| 53 | unsigned char ret; | 31 | unsigned char ret; |
| 54 | 32 | ||
| 55 | gsc_check_addr(addr); | ||
| 56 | |||
| 57 | __asm__ __volatile__( | 33 | __asm__ __volatile__( |
| 58 | " rsm 2,%0\n" | 34 | " rsm 2,%0\n" |
| 59 | " ldbx 0(%2),%1\n" | 35 | " ldbx 0(%2),%1\n" |
| @@ -68,8 +44,6 @@ static inline unsigned short gsc_readw(unsigned long addr) | |||
| 68 | long flags; | 44 | long flags; |
| 69 | unsigned short ret; | 45 | unsigned short ret; |
| 70 | 46 | ||
| 71 | gsc_check_addr(addr); | ||
| 72 | |||
| 73 | __asm__ __volatile__( | 47 | __asm__ __volatile__( |
| 74 | " rsm 2,%0\n" | 48 | " rsm 2,%0\n" |
| 75 | " ldhx 0(%2),%1\n" | 49 | " ldhx 0(%2),%1\n" |
| @@ -83,8 +57,6 @@ static inline unsigned int gsc_readl(unsigned long addr) | |||
| 83 | { | 57 | { |
| 84 | u32 ret; | 58 | u32 ret; |
| 85 | 59 | ||
| 86 | gsc_check_addr(addr); | ||
| 87 | |||
| 88 | __asm__ __volatile__( | 60 | __asm__ __volatile__( |
| 89 | " ldwax 0(%1),%0\n" | 61 | " ldwax 0(%1),%0\n" |
| 90 | : "=r" (ret) : "r" (addr) ); | 62 | : "=r" (ret) : "r" (addr) ); |
| @@ -95,7 +67,6 @@ static inline unsigned int gsc_readl(unsigned long addr) | |||
| 95 | static inline unsigned long long gsc_readq(unsigned long addr) | 67 | static inline unsigned long long gsc_readq(unsigned long addr) |
| 96 | { | 68 | { |
| 97 | unsigned long long ret; | 69 | unsigned long long ret; |
| 98 | gsc_check_addr(addr); | ||
| 99 | 70 | ||
| 100 | #ifdef __LP64__ | 71 | #ifdef __LP64__ |
| 101 | __asm__ __volatile__( | 72 | __asm__ __volatile__( |
| @@ -112,8 +83,6 @@ static inline unsigned long long gsc_readq(unsigned long addr) | |||
| 112 | static inline void gsc_writeb(unsigned char val, unsigned long addr) | 83 | static inline void gsc_writeb(unsigned char val, unsigned long addr) |
| 113 | { | 84 | { |
| 114 | long flags; | 85 | long flags; |
| 115 | gsc_check_addr(addr); | ||
| 116 | |||
| 117 | __asm__ __volatile__( | 86 | __asm__ __volatile__( |
| 118 | " rsm 2,%0\n" | 87 | " rsm 2,%0\n" |
| 119 | " stbs %1,0(%2)\n" | 88 | " stbs %1,0(%2)\n" |
| @@ -124,8 +93,6 @@ static inline void gsc_writeb(unsigned char val, unsigned long addr) | |||
| 124 | static inline void gsc_writew(unsigned short val, unsigned long addr) | 93 | static inline void gsc_writew(unsigned short val, unsigned long addr) |
| 125 | { | 94 | { |
| 126 | long flags; | 95 | long flags; |
| 127 | gsc_check_addr(addr); | ||
| 128 | |||
| 129 | __asm__ __volatile__( | 96 | __asm__ __volatile__( |
| 130 | " rsm 2,%0\n" | 97 | " rsm 2,%0\n" |
| 131 | " sths %1,0(%2)\n" | 98 | " sths %1,0(%2)\n" |
| @@ -135,8 +102,6 @@ static inline void gsc_writew(unsigned short val, unsigned long addr) | |||
| 135 | 102 | ||
| 136 | static inline void gsc_writel(unsigned int val, unsigned long addr) | 103 | static inline void gsc_writel(unsigned int val, unsigned long addr) |
| 137 | { | 104 | { |
| 138 | gsc_check_addr(addr); | ||
| 139 | |||
| 140 | __asm__ __volatile__( | 105 | __asm__ __volatile__( |
| 141 | " stwas %0,0(%1)\n" | 106 | " stwas %0,0(%1)\n" |
| 142 | : : "r" (val), "r" (addr) ); | 107 | : : "r" (val), "r" (addr) ); |
| @@ -144,8 +109,6 @@ static inline void gsc_writel(unsigned int val, unsigned long addr) | |||
| 144 | 109 | ||
| 145 | static inline void gsc_writeq(unsigned long long val, unsigned long addr) | 110 | static inline void gsc_writeq(unsigned long long val, unsigned long addr) |
| 146 | { | 111 | { |
| 147 | gsc_check_addr(addr); | ||
| 148 | |||
| 149 | #ifdef __LP64__ | 112 | #ifdef __LP64__ |
| 150 | __asm__ __volatile__( | 113 | __asm__ __volatile__( |
| 151 | " stda %0,0(%1)\n" | 114 | " stda %0,0(%1)\n" |
| @@ -180,14 +143,7 @@ extern inline void * ioremap_nocache(unsigned long offset, unsigned long size) | |||
| 180 | 143 | ||
| 181 | extern void iounmap(void __iomem *addr); | 144 | extern void iounmap(void __iomem *addr); |
| 182 | 145 | ||
| 183 | /* | ||
| 184 | * USE_HPPA_IOREMAP is the magic flag to enable or disable real ioremap() | ||
| 185 | * functionality. It's currently disabled because it may not work on some | ||
| 186 | * machines. | ||
| 187 | */ | ||
| 188 | #define USE_HPPA_IOREMAP 0 | ||
| 189 | 146 | ||
| 190 | #if USE_HPPA_IOREMAP | ||
| 191 | static inline unsigned char __raw_readb(const volatile void __iomem *addr) | 147 | static inline unsigned char __raw_readb(const volatile void __iomem *addr) |
| 192 | { | 148 | { |
| 193 | return (*(volatile unsigned char __force *) (addr)); | 149 | return (*(volatile unsigned char __force *) (addr)); |
| @@ -221,57 +177,6 @@ static inline void __raw_writeq(unsigned long long b, volatile void __iomem *add | |||
| 221 | { | 177 | { |
| 222 | *(volatile unsigned long long __force *) addr = b; | 178 | *(volatile unsigned long long __force *) addr = b; |
| 223 | } | 179 | } |
| 224 | #else /* !USE_HPPA_IOREMAP */ | ||
| 225 | static inline unsigned char __raw_readb(const volatile void __iomem *addr) | ||
| 226 | { | ||
| 227 | __raw_check_addr(addr); | ||
| 228 | |||
| 229 | return gsc_readb((unsigned long) addr); | ||
| 230 | } | ||
| 231 | static inline unsigned short __raw_readw(const volatile void __iomem *addr) | ||
| 232 | { | ||
| 233 | __raw_check_addr(addr); | ||
| 234 | |||
| 235 | return gsc_readw((unsigned long) addr); | ||
| 236 | } | ||
| 237 | static inline unsigned int __raw_readl(const volatile void __iomem *addr) | ||
| 238 | { | ||
| 239 | __raw_check_addr(addr); | ||
| 240 | |||
| 241 | return gsc_readl((unsigned long) addr); | ||
| 242 | } | ||
| 243 | static inline unsigned long long __raw_readq(const volatile void __iomem *addr) | ||
| 244 | { | ||
| 245 | __raw_check_addr(addr); | ||
| 246 | |||
| 247 | return gsc_readq((unsigned long) addr); | ||
| 248 | } | ||
| 249 | |||
| 250 | static inline void __raw_writeb(unsigned char b, volatile void __iomem *addr) | ||
| 251 | { | ||
| 252 | __raw_check_addr(addr); | ||
| 253 | |||
| 254 | gsc_writeb(b, (unsigned long) addr); | ||
| 255 | } | ||
| 256 | static inline void __raw_writew(unsigned short b, volatile void __iomem *addr) | ||
| 257 | { | ||
| 258 | __raw_check_addr(addr); | ||
| 259 | |||
| 260 | gsc_writew(b, (unsigned long) addr); | ||
| 261 | } | ||
| 262 | static inline void __raw_writel(unsigned int b, volatile void __iomem *addr) | ||
| 263 | { | ||
| 264 | __raw_check_addr(addr); | ||
| 265 | |||
| 266 | gsc_writel(b, (unsigned long) addr); | ||
| 267 | } | ||
| 268 | static inline void __raw_writeq(unsigned long long b, volatile void __iomem *addr) | ||
| 269 | { | ||
| 270 | __raw_check_addr(addr); | ||
| 271 | |||
| 272 | gsc_writeq(b, (unsigned long) addr); | ||
| 273 | } | ||
| 274 | #endif /* !USE_HPPA_IOREMAP */ | ||
| 275 | 180 | ||
| 276 | /* readb can never be const, so use __fswab instead of le*_to_cpu */ | 181 | /* readb can never be const, so use __fswab instead of le*_to_cpu */ |
| 277 | #define readb(addr) __raw_readb(addr) | 182 | #define readb(addr) __raw_readb(addr) |
diff --git a/include/asm-parisc/local.h b/include/asm-parisc/local.h index 892b3b2c4962..d0f550912755 100644 --- a/include/asm-parisc/local.h +++ b/include/asm-parisc/local.h | |||
| @@ -4,16 +4,16 @@ | |||
| 4 | #include <linux/percpu.h> | 4 | #include <linux/percpu.h> |
| 5 | #include <asm/atomic.h> | 5 | #include <asm/atomic.h> |
| 6 | 6 | ||
| 7 | typedef atomic_t local_t; | 7 | typedef atomic_long_t local_t; |
| 8 | 8 | ||
| 9 | #define LOCAL_INIT(i) ATOMIC_INIT(i) | 9 | #define LOCAL_INIT(i) ATOMIC_LONG_INIT(i) |
| 10 | #define local_read(v) atomic_read(v) | 10 | #define local_read(v) atomic_long_read(v) |
| 11 | #define local_set(v,i) atomic_set(v,i) | 11 | #define local_set(v,i) atomic_long_set(v,i) |
| 12 | 12 | ||
| 13 | #define local_inc(v) atomic_inc(v) | 13 | #define local_inc(v) atomic_long_inc(v) |
| 14 | #define local_dec(v) atomic_dec(v) | 14 | #define local_dec(v) atomic_long_dec(v) |
| 15 | #define local_add(i, v) atomic_add(i, v) | 15 | #define local_add(i, v) atomic_long_add(i, v) |
| 16 | #define local_sub(i, v) atomic_sub(i, v) | 16 | #define local_sub(i, v) atomic_long_sub(i, v) |
| 17 | 17 | ||
| 18 | #define __local_inc(v) ((v)->counter++) | 18 | #define __local_inc(v) ((v)->counter++) |
| 19 | #define __local_dec(v) ((v)->counter--) | 19 | #define __local_dec(v) ((v)->counter--) |
diff --git a/include/asm-parisc/page.h b/include/asm-parisc/page.h index 9f303c0c3cd7..45e02aa5bf4b 100644 --- a/include/asm-parisc/page.h +++ b/include/asm-parisc/page.h | |||
| @@ -26,7 +26,7 @@ static inline void | |||
| 26 | copy_user_page(void *vto, void *vfrom, unsigned long vaddr, struct page *pg) | 26 | copy_user_page(void *vto, void *vfrom, unsigned long vaddr, struct page *pg) |
| 27 | { | 27 | { |
| 28 | copy_user_page_asm(vto, vfrom); | 28 | copy_user_page_asm(vto, vfrom); |
| 29 | flush_kernel_dcache_page(vto); | 29 | flush_kernel_dcache_page_asm(vto); |
| 30 | /* XXX: ppc flushes icache too, should we? */ | 30 | /* XXX: ppc flushes icache too, should we? */ |
| 31 | } | 31 | } |
| 32 | 32 | ||
| @@ -40,14 +40,19 @@ clear_user_page(void *page, unsigned long vaddr, struct page *pg) | |||
| 40 | /* | 40 | /* |
| 41 | * These are used to make use of C type-checking.. | 41 | * These are used to make use of C type-checking.. |
| 42 | */ | 42 | */ |
| 43 | #ifdef __LP64__ | 43 | #define STRICT_MM_TYPECHECKS |
| 44 | typedef struct { unsigned long pte; } pte_t; | 44 | #ifdef STRICT_MM_TYPECHECKS |
| 45 | #else | 45 | typedef struct { unsigned long pte; |
| 46 | typedef struct { | 46 | #if !defined(CONFIG_64BIT) |
| 47 | unsigned long pte; | 47 | unsigned long future_flags; |
| 48 | unsigned long flags; | 48 | /* XXX: it's possible to remove future_flags and change BITS_PER_PTE_ENTRY |
| 49 | } pte_t; | 49 | to 2, but then strangely the identical 32bit kernel boots on a |
| 50 | c3000(pa20), but not any longer on a 715(pa11). | ||
| 51 | Still investigating... HelgeD. | ||
| 52 | */ | ||
| 50 | #endif | 53 | #endif |
| 54 | } pte_t; /* either 32 or 64bit */ | ||
| 55 | |||
| 51 | /* NOTE: even on 64 bits, these entries are __u32 because we allocate | 56 | /* NOTE: even on 64 bits, these entries are __u32 because we allocate |
| 52 | * the pmd and pgd in ZONE_DMA (i.e. under 4GB) */ | 57 | * the pmd and pgd in ZONE_DMA (i.e. under 4GB) */ |
| 53 | typedef struct { __u32 pmd; } pmd_t; | 58 | typedef struct { __u32 pmd; } pmd_t; |
| @@ -55,25 +60,44 @@ typedef struct { __u32 pgd; } pgd_t; | |||
| 55 | typedef struct { unsigned long pgprot; } pgprot_t; | 60 | typedef struct { unsigned long pgprot; } pgprot_t; |
| 56 | 61 | ||
| 57 | #define pte_val(x) ((x).pte) | 62 | #define pte_val(x) ((x).pte) |
| 58 | #ifdef __LP64__ | ||
| 59 | #define pte_flags(x) (*(__u32 *)&((x).pte)) | ||
| 60 | #else | ||
| 61 | #define pte_flags(x) ((x).flags) | ||
| 62 | #endif | ||
| 63 | |||
| 64 | /* These do not work lvalues, so make sure we don't use them as such. */ | 63 | /* These do not work lvalues, so make sure we don't use them as such. */ |
| 65 | #define pmd_val(x) ((x).pmd + 0) | 64 | #define pmd_val(x) ((x).pmd + 0) |
| 66 | #define pgd_val(x) ((x).pgd + 0) | 65 | #define pgd_val(x) ((x).pgd + 0) |
| 67 | #define pgprot_val(x) ((x).pgprot) | 66 | #define pgprot_val(x) ((x).pgprot) |
| 68 | 67 | ||
| 69 | #define __pmd_val_set(x,n) (x).pmd = (n) | ||
| 70 | #define __pgd_val_set(x,n) (x).pgd = (n) | ||
| 71 | |||
| 72 | #define __pte(x) ((pte_t) { (x) } ) | 68 | #define __pte(x) ((pte_t) { (x) } ) |
| 73 | #define __pmd(x) ((pmd_t) { (x) } ) | 69 | #define __pmd(x) ((pmd_t) { (x) } ) |
| 74 | #define __pgd(x) ((pgd_t) { (x) } ) | 70 | #define __pgd(x) ((pgd_t) { (x) } ) |
| 75 | #define __pgprot(x) ((pgprot_t) { (x) } ) | 71 | #define __pgprot(x) ((pgprot_t) { (x) } ) |
| 76 | 72 | ||
| 73 | #define __pmd_val_set(x,n) (x).pmd = (n) | ||
| 74 | #define __pgd_val_set(x,n) (x).pgd = (n) | ||
| 75 | |||
| 76 | #else | ||
| 77 | /* | ||
| 78 | * .. while these make it easier on the compiler | ||
| 79 | */ | ||
| 80 | typedef unsigned long pte_t; | ||
| 81 | typedef __u32 pmd_t; | ||
| 82 | typedef __u32 pgd_t; | ||
| 83 | typedef unsigned long pgprot_t; | ||
| 84 | |||
| 85 | #define pte_val(x) (x) | ||
| 86 | #define pmd_val(x) (x) | ||
| 87 | #define pgd_val(x) (x) | ||
| 88 | #define pgprot_val(x) (x) | ||
| 89 | |||
| 90 | #define __pte(x) (x) | ||
| 91 | #define __pmd(x) (x) | ||
| 92 | #define __pgd(x) (x) | ||
| 93 | #define __pgprot(x) (x) | ||
| 94 | |||
| 95 | #define __pmd_val_set(x,n) (x) = (n) | ||
| 96 | #define __pgd_val_set(x,n) (x) = (n) | ||
| 97 | |||
| 98 | #endif /* STRICT_MM_TYPECHECKS */ | ||
| 99 | |||
| 100 | |||
| 77 | typedef struct __physmem_range { | 101 | typedef struct __physmem_range { |
| 78 | unsigned long start_pfn; | 102 | unsigned long start_pfn; |
| 79 | unsigned long pages; /* PAGE_SIZE pages */ | 103 | unsigned long pages; /* PAGE_SIZE pages */ |
diff --git a/include/asm-parisc/pci.h b/include/asm-parisc/pci.h index fe7f6a2f5aa7..77bbafb7f73e 100644 --- a/include/asm-parisc/pci.h +++ b/include/asm-parisc/pci.h | |||
| @@ -289,4 +289,9 @@ static inline void pcibios_add_platform_entries(struct pci_dev *dev) | |||
| 289 | { | 289 | { |
| 290 | } | 290 | } |
| 291 | 291 | ||
| 292 | static inline void pcibios_penalize_isa_irq(int irq, int active) | ||
| 293 | { | ||
| 294 | /* We don't need to penalize isa irq's */ | ||
| 295 | } | ||
| 296 | |||
| 292 | #endif /* __ASM_PARISC_PCI_H */ | 297 | #endif /* __ASM_PARISC_PCI_H */ |
diff --git a/include/asm-parisc/pdc_chassis.h b/include/asm-parisc/pdc_chassis.h index adac9ac2743f..a609273dc6bf 100644 --- a/include/asm-parisc/pdc_chassis.h +++ b/include/asm-parisc/pdc_chassis.h | |||
| @@ -6,9 +6,8 @@ | |||
| 6 | * | 6 | * |
| 7 | * | 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by | 9 | * it under the terms of the GNU General Public License, version 2, as |
| 10 | * the Free Software Foundation; either version 2, or (at your option) | 10 | * published by the Free Software Foundation. |
| 11 | * any later version. | ||
| 12 | * | 11 | * |
| 13 | * This program is distributed in the hope that it will be useful, | 12 | * This program is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
diff --git a/include/asm-parisc/spinlock.h b/include/asm-parisc/spinlock.h index 16c2ac075fc5..a93960e232cf 100644 --- a/include/asm-parisc/spinlock.h +++ b/include/asm-parisc/spinlock.h | |||
| @@ -134,14 +134,22 @@ static __inline__ int __raw_write_trylock(raw_rwlock_t *rw) | |||
| 134 | return 1; | 134 | return 1; |
| 135 | } | 135 | } |
| 136 | 136 | ||
| 137 | static __inline__ int __raw_is_read_locked(raw_rwlock_t *rw) | 137 | /* |
| 138 | * read_can_lock - would read_trylock() succeed? | ||
| 139 | * @lock: the rwlock in question. | ||
| 140 | */ | ||
| 141 | static __inline__ int __raw_read_can_lock(raw_rwlock_t *rw) | ||
| 138 | { | 142 | { |
| 139 | return rw->counter > 0; | 143 | return rw->counter >= 0; |
| 140 | } | 144 | } |
| 141 | 145 | ||
| 142 | static __inline__ int __raw_is_write_locked(raw_rwlock_t *rw) | 146 | /* |
| 147 | * write_can_lock - would write_trylock() succeed? | ||
| 148 | * @lock: the rwlock in question. | ||
| 149 | */ | ||
| 150 | static __inline__ int __raw_write_can_lock(raw_rwlock_t *rw) | ||
| 143 | { | 151 | { |
| 144 | return rw->counter < 0; | 152 | return !rw->counter; |
| 145 | } | 153 | } |
| 146 | 154 | ||
| 147 | #endif /* __ASM_SPINLOCK_H */ | 155 | #endif /* __ASM_SPINLOCK_H */ |
diff --git a/include/asm-parisc/thread_info.h b/include/asm-parisc/thread_info.h index ac32f140b83a..f2f83b04cd8b 100644 --- a/include/asm-parisc/thread_info.h +++ b/include/asm-parisc/thread_info.h | |||
| @@ -49,7 +49,8 @@ struct thread_info { | |||
| 49 | 49 | ||
| 50 | #endif /* !__ASSEMBLY */ | 50 | #endif /* !__ASSEMBLY */ |
| 51 | 51 | ||
| 52 | #define PREEMPT_ACTIVE 0x10000000 | 52 | #define PREEMPT_ACTIVE_BIT 28 |
| 53 | #define PREEMPT_ACTIVE (1 << PREEMPT_ACTIVE_BIT) | ||
| 53 | 54 | ||
| 54 | /* | 55 | /* |
| 55 | * thread information flags | 56 | * thread information flags |
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-powerpc/unistd.h b/include/asm-powerpc/unistd.h index 1e990747dce7..536ba0873052 100644 --- a/include/asm-powerpc/unistd.h +++ b/include/asm-powerpc/unistd.h | |||
| @@ -301,8 +301,9 @@ | |||
| 301 | #define __NR_pselect6 280 | 301 | #define __NR_pselect6 280 |
| 302 | #define __NR_ppoll 281 | 302 | #define __NR_ppoll 281 |
| 303 | #define __NR_unshare 282 | 303 | #define __NR_unshare 282 |
| 304 | #define __NR_splice 283 | ||
| 304 | 305 | ||
| 305 | #define __NR_syscalls 283 | 306 | #define __NR_syscalls 284 |
| 306 | 307 | ||
| 307 | #ifdef __KERNEL__ | 308 | #ifdef __KERNEL__ |
| 308 | #define __NR__exit __NR_exit | 309 | #define __NR__exit __NR_exit |
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) \ |
| 47 | do { \ | 47 | do { \ |
| 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-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 | ||
| 14 | struct mmu_context_skas; | ||
| 15 | extern void ldt_host_info(void); | ||
| 16 | extern long init_new_ldt(struct mmu_context_skas * to_mm, | ||
| 17 | struct mmu_context_skas * from_mm); | ||
| 18 | extern 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 | |||
| 27 | struct ldt_entry { | ||
| 28 | __u32 a; | ||
| 29 | __u32 b; | ||
| 30 | }; | ||
| 31 | |||
| 32 | typedef 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 | |||
| 14 | struct mmu_context_skas; | ||
| 15 | extern void ldt_host_info(void); | ||
| 16 | extern long init_new_ldt(struct mmu_context_skas * to_mm, | ||
| 17 | struct mmu_context_skas * from_mm); | ||
| 18 | extern 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 | |||
| 27 | struct ldt_entry { | ||
| 28 | __u32 a; | ||
| 29 | __u32 b; | ||
| 30 | }; | ||
| 31 | |||
| 32 | typedef 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 | |||
| 14 | struct mmu_context_skas; | ||
| 15 | extern void ldt_host_info(void); | ||
| 16 | extern long init_new_ldt(struct mmu_context_skas * to_mm, | ||
| 17 | struct mmu_context_skas * from_mm); | ||
| 18 | extern 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 | |||
| 27 | struct ldt_entry { | ||
| 28 | __u32 a; | ||
| 29 | __u32 b; | ||
| 30 | }; | ||
| 31 | |||
| 32 | typedef 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 | |||
| 9 | extern int host_has_xmm; | 13 | extern int host_has_xmm; |
| 10 | extern int host_has_cmov; | 14 | extern 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 | ||
| 19 | struct uml_tls_struct { | ||
| 20 | struct user_desc tls; | ||
| 21 | unsigned flushed:1; | ||
| 22 | unsigned present:1; | ||
| 23 | }; | ||
| 24 | |||
| 15 | struct arch_thread { | 25 | struct 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 | |||
| 40 | static 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 | |||
| 46 | static 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 | ||
| 31 | static inline void arch_flush_thread(struct arch_thread *thread) | ||
| 32 | { | ||
| 33 | } | ||
| 34 | |||
| 35 | static 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); | |||
| 60 | extern void send_sigtrap(struct task_struct *tsk, union uml_pt_regs *regs, | 60 | extern void send_sigtrap(struct task_struct *tsk, union uml_pt_regs *regs, |
| 61 | int error_code); | 61 | int error_code); |
| 62 | 62 | ||
| 63 | #endif | 63 | extern int arch_copy_tls(struct task_struct *new); |
| 64 | extern 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 | 44 | extern int ptrace_get_thread_area(struct task_struct *child, int idx, |
| 45 | struct user_desc __user *user_desc); | ||
| 42 | 46 | ||
| 43 | /* | 47 | extern 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 | 50 | extern int do_set_thread_area_skas(struct user_desc *info); |
| 47 | * of the file. | 51 | extern int do_get_thread_area_skas(struct user_desc *info); |
| 48 | * --------------------------------------------------------------------------- | 52 | |
| 49 | * Local variables: | 53 | extern int do_set_thread_area_tt(struct user_desc *info); |
| 50 | * c-file-style: "linux" | 54 | extern int do_get_thread_area_tt(struct user_desc *info); |
| 51 | * End: | 55 | |
| 52 | */ | 56 | extern int arch_switch_tls_skas(struct task_struct *from, struct task_struct *to); |
| 57 | extern int arch_switch_tls_tt(struct task_struct *from, struct task_struct *to); | ||
| 58 | |||
| 59 | static 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 | |||
| 64 | static 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 | |||
| 69 | struct 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 | 68 | static 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 | /* | 74 | static 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: | 80 | static 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 | |||
| 85 | static 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 | ||
| 4 | extern 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 | ||
| 6 | typedef struct | 6 | typedef 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 | ||
| 16 | static __inline__ void local_inc(local_t *v) | 16 | static 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 | ||
| 24 | static __inline__ void local_dec(local_t *v) | 24 | static 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 | ||
| 32 | static __inline__ void local_add(unsigned int i, local_t *v) | 32 | static 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 | ||
| 40 | static __inline__ void local_sub(unsigned int i, local_t *v) | 40 | static 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/asm-x86_64/unistd.h b/include/asm-x86_64/unistd.h index fcc516353087..f21ff2c1e960 100644 --- a/include/asm-x86_64/unistd.h +++ b/include/asm-x86_64/unistd.h | |||
| @@ -609,8 +609,10 @@ __SYSCALL(__NR_unshare, sys_unshare) | |||
| 609 | __SYSCALL(__NR_set_robust_list, sys_set_robust_list) | 609 | __SYSCALL(__NR_set_robust_list, sys_set_robust_list) |
| 610 | #define __NR_get_robust_list 274 | 610 | #define __NR_get_robust_list 274 |
| 611 | __SYSCALL(__NR_get_robust_list, sys_get_robust_list) | 611 | __SYSCALL(__NR_get_robust_list, sys_get_robust_list) |
| 612 | #define __NR_splice 275 | ||
| 613 | __SYSCALL(__NR_splice, sys_splice) | ||
| 612 | 614 | ||
| 613 | #define __NR_syscall_max __NR_get_robust_list | 615 | #define __NR_syscall_max __NR_splice |
| 614 | 616 | ||
| 615 | #ifndef __NO_STUBS | 617 | #ifndef __NO_STUBS |
| 616 | 618 | ||
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; | |||
| 19 | struct backlight_properties { | 19 | struct 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 | ||
| 38 | struct backlight_device { | 43 | struct 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 */ |
| 276 | extern struct dentry * d_lookup(struct dentry *, struct qstr *); | 276 | extern struct dentry * d_lookup(struct dentry *, struct qstr *); |
| 277 | extern struct dentry * __d_lookup(struct dentry *, struct qstr *); | 277 | extern struct dentry * __d_lookup(struct dentry *, struct qstr *); |
| 278 | extern struct dentry * d_hash_and_lookup(struct dentry *, struct qstr *); | ||
| 278 | 279 | ||
| 279 | /* validate "insecure" dentry pointer */ | 280 | /* validate "insecure" dentry pointer */ |
| 280 | extern int d_validate(struct dentry *, struct dentry *); | 281 | extern 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 408fe89498f4..4ed7e602d703 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); | |||
| 757 | extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg); | 757 | extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg); |
| 758 | extern int fcntl_getlease(struct file *filp); | 758 | extern 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 | ||
| 764 | extern 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 */ |
| 761 | extern void locks_init_lock(struct file_lock *); | 768 | extern void locks_init_lock(struct file_lock *); |
| 762 | extern void locks_copy_lock(struct file_lock *, struct file_lock *); | 769 | extern void locks_copy_lock(struct file_lock *, struct file_lock *); |
| @@ -1032,6 +1039,8 @@ struct file_operations { | |||
| 1032 | int (*check_flags)(int); | 1039 | int (*check_flags)(int); |
| 1033 | int (*dir_notify)(struct file *filp, unsigned long arg); | 1040 | int (*dir_notify)(struct file *filp, unsigned long arg); |
| 1034 | int (*flock) (struct file *, int, struct file_lock *); | 1041 | int (*flock) (struct file *, int, struct file_lock *); |
| 1042 | ssize_t (*splice_write)(struct inode *, struct file *, size_t, unsigned int); | ||
| 1043 | ssize_t (*splice_read)(struct file *, struct inode *, size_t, unsigned int); | ||
| 1035 | }; | 1044 | }; |
| 1036 | 1045 | ||
| 1037 | struct inode_operations { | 1046 | struct inode_operations { |
| @@ -1411,6 +1420,7 @@ extern void bd_release_from_disk(struct block_device *, struct gendisk *); | |||
| 1411 | #endif | 1420 | #endif |
| 1412 | 1421 | ||
| 1413 | /* fs/char_dev.c */ | 1422 | /* fs/char_dev.c */ |
| 1423 | #define CHRDEV_MAJOR_HASH_SIZE 255 | ||
| 1414 | extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *); | 1424 | extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *); |
| 1415 | extern int register_chrdev_region(dev_t, unsigned, const char *); | 1425 | extern int register_chrdev_region(dev_t, unsigned, const char *); |
| 1416 | extern int register_chrdev(unsigned int, const char *, | 1426 | extern int register_chrdev(unsigned int, const char *, |
| @@ -1418,25 +1428,17 @@ extern int register_chrdev(unsigned int, const char *, | |||
| 1418 | extern int unregister_chrdev(unsigned int, const char *); | 1428 | extern int unregister_chrdev(unsigned int, const char *); |
| 1419 | extern void unregister_chrdev_region(dev_t, unsigned); | 1429 | extern void unregister_chrdev_region(dev_t, unsigned); |
| 1420 | extern int chrdev_open(struct inode *, struct file *); | 1430 | extern int chrdev_open(struct inode *, struct file *); |
| 1421 | extern int get_chrdev_list(char *); | 1431 | extern void chrdev_show(struct seq_file *,off_t); |
| 1422 | extern void *acquire_chrdev_list(void); | ||
| 1423 | extern int count_chrdev_list(void); | ||
| 1424 | extern void *get_next_chrdev(void *); | ||
| 1425 | extern int get_chrdev_info(void *, int *, char **); | ||
| 1426 | extern void release_chrdev_list(void *); | ||
| 1427 | 1432 | ||
| 1428 | /* fs/block_dev.c */ | 1433 | /* fs/block_dev.c */ |
| 1434 | #define BLKDEV_MAJOR_HASH_SIZE 255 | ||
| 1429 | #define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */ | 1435 | #define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */ |
| 1430 | extern const char *__bdevname(dev_t, char *buffer); | 1436 | extern const char *__bdevname(dev_t, char *buffer); |
| 1431 | extern const char *bdevname(struct block_device *bdev, char *buffer); | 1437 | extern const char *bdevname(struct block_device *bdev, char *buffer); |
| 1432 | extern struct block_device *lookup_bdev(const char *); | 1438 | extern struct block_device *lookup_bdev(const char *); |
| 1433 | extern struct block_device *open_bdev_excl(const char *, int, void *); | 1439 | extern struct block_device *open_bdev_excl(const char *, int, void *); |
| 1434 | extern void close_bdev_excl(struct block_device *); | 1440 | extern void close_bdev_excl(struct block_device *); |
| 1435 | extern void *acquire_blkdev_list(void); | 1441 | extern void blkdev_show(struct seq_file *,off_t); |
| 1436 | extern int count_blkdev_list(void); | ||
| 1437 | extern void *get_next_blkdev(void *); | ||
| 1438 | extern int get_blkdev_info(void *, int *, char **); | ||
| 1439 | extern void release_blkdev_list(void *); | ||
| 1440 | 1442 | ||
| 1441 | extern void init_special_inode(struct inode *, umode_t, dev_t); | 1443 | extern void init_special_inode(struct inode *, umode_t, dev_t); |
| 1442 | 1444 | ||
| @@ -1609,6 +1611,8 @@ extern ssize_t generic_file_sendfile(struct file *, loff_t *, size_t, read_actor | |||
| 1609 | extern void do_generic_mapping_read(struct address_space *mapping, | 1611 | extern void do_generic_mapping_read(struct address_space *mapping, |
| 1610 | struct file_ra_state *, struct file *, | 1612 | struct file_ra_state *, struct file *, |
| 1611 | loff_t *, read_descriptor_t *, read_actor_t); | 1613 | loff_t *, read_descriptor_t *, read_actor_t); |
| 1614 | extern ssize_t generic_file_splice_read(struct file *, struct inode *, size_t, unsigned int); | ||
| 1615 | extern ssize_t generic_file_splice_write(struct inode *, struct file *, size_t, unsigned int); | ||
| 1612 | extern void | 1616 | extern void |
| 1613 | file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); | 1617 | file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); |
| 1614 | extern ssize_t generic_file_readv(struct file *filp, const struct iovec *iov, | 1618 | extern ssize_t generic_file_readv(struct file *filp, const struct iovec *iov, |
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 93830158348e..b20939287613 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 | */ | ||
| 68 | struct 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 |
| @@ -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 | ||
| 143 | extern 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: */ |
| 131 | extern void hrtimer_run_queues(void); | 147 | extern void hrtimer_run_queues(void); |
| 132 | 148 | ||
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. */ | ||
| 161 | int ipmi_register_smi(struct ipmi_smi_handlers *handlers, | 172 | int 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/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 | |||
| 15 | struct device; | ||
| 16 | struct class_device; | ||
| 17 | /* | ||
| 18 | * LED Core | ||
| 19 | */ | ||
| 20 | |||
| 21 | enum led_brightness { | ||
| 22 | LED_OFF = 0, | ||
| 23 | LED_HALF = 127, | ||
| 24 | LED_FULL = 255, | ||
| 25 | }; | ||
| 26 | |||
| 27 | struct 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 | |||
| 53 | extern int led_classdev_register(struct device *parent, | ||
| 54 | struct led_classdev *led_cdev); | ||
| 55 | extern void led_classdev_unregister(struct led_classdev *led_cdev); | ||
| 56 | extern void led_classdev_suspend(struct led_classdev *led_cdev); | ||
| 57 | extern 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 | |||
| 66 | struct 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 */ | ||
| 81 | extern int led_trigger_register(struct led_trigger *trigger); | ||
| 82 | extern 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; | ||
| 87 | extern void led_trigger_register_simple(const char *name, | ||
| 88 | struct led_trigger **trigger); | ||
| 89 | extern void led_trigger_unregister_simple(struct led_trigger *trigger); | ||
| 90 | extern 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 | ||
| 106 | extern 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/libata.h b/include/linux/libata.h index b248cb020f87..b0171e9accc4 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
| @@ -668,14 +668,24 @@ static inline unsigned int ata_tag_valid(unsigned int tag) | |||
| 668 | return (tag < ATA_MAX_QUEUE) ? 1 : 0; | 668 | return (tag < ATA_MAX_QUEUE) ? 1 : 0; |
| 669 | } | 669 | } |
| 670 | 670 | ||
| 671 | static inline unsigned int ata_class_present(unsigned int class) | 671 | static inline unsigned int ata_class_enabled(unsigned int class) |
| 672 | { | 672 | { |
| 673 | return class == ATA_DEV_ATA || class == ATA_DEV_ATAPI; | 673 | return class == ATA_DEV_ATA || class == ATA_DEV_ATAPI; |
| 674 | } | 674 | } |
| 675 | 675 | ||
| 676 | static inline unsigned int ata_dev_present(const struct ata_device *dev) | 676 | static inline unsigned int ata_class_disabled(unsigned int class) |
| 677 | { | 677 | { |
| 678 | return ata_class_present(dev->class); | 678 | return class == ATA_DEV_ATA_UNSUP || class == ATA_DEV_ATAPI_UNSUP; |
| 679 | } | ||
| 680 | |||
| 681 | static inline unsigned int ata_dev_enabled(const struct ata_device *dev) | ||
| 682 | { | ||
| 683 | return ata_class_enabled(dev->class); | ||
| 684 | } | ||
| 685 | |||
| 686 | static inline unsigned int ata_dev_disabled(const struct ata_device *dev) | ||
| 687 | { | ||
| 688 | return ata_class_disabled(dev->class); | ||
| 679 | } | 689 | } |
| 680 | 690 | ||
| 681 | static inline u8 ata_chk_status(struct ata_port *ap) | 691 | static inline u8 ata_chk_status(struct ata_port *ap) |
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 *); | |||
| 12 | extern int migrate_page_remove_references(struct page *, struct page *, int); | 12 | extern int migrate_page_remove_references(struct page *, struct page *, int); |
| 13 | extern int migrate_pages(struct list_head *l, struct list_head *t, | 13 | extern 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); |
| 15 | int migrate_pages_to(struct list_head *pagelist, | 15 | extern int migrate_pages_to(struct list_head *pagelist, |
| 16 | struct vm_area_struct *vma, int dest); | 16 | struct vm_area_struct *vma, int dest); |
| 17 | extern int fail_migrate_page(struct page *, struct page *); | 17 | extern 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; } | |||
| 26 | static inline int migrate_pages(struct list_head *l, struct list_head *t, | 26 | static 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 | ||
| 29 | static inline int migrate_pages_to(struct list_head *pagelist, | ||
| 30 | struct vm_area_struct *vma, int dest) { return 0; } | ||
| 31 | |||
| 29 | static inline int migrate_prep(void) { return -ENOSYS; } | 32 | static 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 | ||
| 15 | struct hd_geometry; | 15 | struct hd_geometry; |
| 16 | struct mtd_info; | 16 | struct 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 | ||
| 193 | int doc_decode_ecc(unsigned char sector[512], unsigned char ecc1[6]); | 193 | int 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 { | |||
| 52 | int INFTL_mount(struct INFTLrecord *s); | 52 | int INFTL_mount(struct INFTLrecord *s); |
| 53 | int INFTL_formatblock(struct INFTLrecord *s, int block); | 53 | int INFTL_formatblock(struct INFTLrecord *s, int block); |
| 54 | 54 | ||
| 55 | extern char inftlmountrev[]; | ||
| 56 | |||
| 57 | void INFTL_dumptables(struct INFTLrecord *s); | ||
| 58 | void 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); | |||
| 75 | extern void release_open_intent(struct nameidata *); | 75 | extern void release_open_intent(struct nameidata *); |
| 76 | 76 | ||
| 77 | extern struct dentry * lookup_one_len(const char *, struct dentry *, int); | 77 | extern struct dentry * lookup_one_len(const char *, struct dentry *, int); |
| 78 | extern __deprecated_for_modules struct dentry * lookup_hash(struct nameidata *); | ||
| 79 | 78 | ||
| 80 | extern int follow_down(struct vfsmount **, struct dentry **); | 79 | extern int follow_down(struct vfsmount **, struct dentry **); |
| 81 | extern int follow_up(struct vfsmount **, struct dentry **); | 80 | extern 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 | ||
| 601 | static inline void __netif_schedule(struct net_device *dev) | 601 | extern 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 | ||
| 616 | static inline void netif_schedule(struct net_device *dev) | 603 | static 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 | */ |
| 678 | static inline void dev_kfree_skb_any(struct sk_buff *skb) | 665 | extern 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 |
| 687 | extern int netif_rx(struct sk_buff *skb); | 668 | extern 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 | ||
| 771 | static inline void netif_device_detach(struct net_device *dev) | 752 | extern 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 | ||
| 779 | static inline void netif_device_attach(struct net_device *dev) | 754 | extern 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 | ||
| 854 | static inline void __netif_rx_schedule(struct net_device *dev) | 822 | extern 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/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); |
| 73 | extern struct page * find_lock_page(struct address_space *mapping, | 73 | extern struct page * find_lock_page(struct address_space *mapping, |
| 74 | unsigned long index); | 74 | unsigned long index); |
| 75 | extern struct page * find_trylock_page(struct address_space *mapping, | 75 | extern __deprecated_for_modules struct page * find_trylock_page( |
| 76 | unsigned long index); | 76 | struct address_space *mapping, unsigned long index); |
| 77 | extern struct page * find_or_create_page(struct address_space *mapping, | 77 | extern 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); |
| 79 | unsigned find_get_pages(struct address_space *mapping, pgoff_t start, | 79 | unsigned 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 | |||
| 4 | enum pid_type | 6 | enum 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 | |||
| 12 | struct pid | 42 | struct 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) \ | 53 | struct 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 | |||
| 59 | static inline struct pid *get_pid(struct pid *pid) | ||
| 60 | { | ||
| 61 | if (pid) | ||
| 62 | atomic_inc(&pid->count); | ||
| 63 | return pid; | ||
| 64 | } | ||
| 65 | |||
| 66 | extern void FASTCALL(put_pid(struct pid *pid)); | ||
| 67 | extern struct task_struct *FASTCALL(pid_task(struct pid *pid, enum pid_type)); | ||
| 68 | extern struct task_struct *FASTCALL(get_pid_task(struct pid *pid, | ||
| 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 | */ |
| 28 | extern int FASTCALL(attach_pid(struct task_struct *task, enum pid_type type, int nr)); | 75 | extern int FASTCALL(attach_pid(struct task_struct *task, |
| 76 | enum pid_type type, int nr)); | ||
| 29 | 77 | ||
| 30 | extern void FASTCALL(detach_pid(struct task_struct *task, enum pid_type)); | 78 | extern 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 | */ | ||
| 84 | extern 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 | */ |
| 36 | extern struct pid *FASTCALL(find_pid(enum pid_type, int)); | 89 | extern struct pid *find_get_pid(int nr); |
| 37 | 90 | ||
| 38 | extern int alloc_pidmap(void); | 91 | extern struct pid *alloc_pid(void); |
| 39 | extern void FASTCALL(free_pidmap(int)); | 92 | extern 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 b12e59c75752..75c7f55023ab 100644 --- a/include/linux/pipe_fs_i.h +++ b/include/linux/pipe_fs_i.h | |||
| @@ -9,6 +9,7 @@ struct pipe_buffer { | |||
| 9 | struct page *page; | 9 | struct page *page; |
| 10 | unsigned int offset, len; | 10 | unsigned int offset, len; |
| 11 | struct pipe_buf_operations *ops; | 11 | struct pipe_buf_operations *ops; |
| 12 | unsigned int stolen; | ||
| 12 | }; | 13 | }; |
| 13 | 14 | ||
| 14 | struct pipe_buf_operations { | 15 | struct pipe_buf_operations { |
| @@ -16,6 +17,7 @@ struct pipe_buf_operations { | |||
| 16 | void * (*map)(struct file *, struct pipe_inode_info *, struct pipe_buffer *); | 17 | void * (*map)(struct file *, struct pipe_inode_info *, struct pipe_buffer *); |
| 17 | void (*unmap)(struct pipe_inode_info *, struct pipe_buffer *); | 18 | void (*unmap)(struct pipe_inode_info *, struct pipe_buffer *); |
| 18 | void (*release)(struct pipe_inode_info *, struct pipe_buffer *); | 19 | void (*release)(struct pipe_inode_info *, struct pipe_buffer *); |
| 20 | int (*steal)(struct pipe_inode_info *, struct pipe_buffer *); | ||
| 19 | }; | 21 | }; |
| 20 | 22 | ||
| 21 | struct pipe_inode_info { | 23 | struct pipe_inode_info { |
| @@ -53,4 +55,10 @@ void pipe_wait(struct inode * inode); | |||
| 53 | struct inode* pipe_new(struct inode* inode); | 55 | struct inode* pipe_new(struct inode* inode); |
| 54 | void free_pipe_info(struct inode* inode); | 56 | void free_pipe_info(struct inode* inode); |
| 55 | 57 | ||
| 58 | /* | ||
| 59 | * splice is tied to pipes as a transport (at least for now), so we'll just | ||
| 60 | * add the splice flags here. | ||
| 61 | */ | ||
| 62 | #define SPLICE_F_MOVE (0x01) /* move pages instead of copying */ | ||
| 63 | |||
| 56 | #endif | 64 | #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); | |||
| 100 | extern int nr_processes(void); | 100 | extern int nr_processes(void); |
| 101 | extern unsigned long nr_running(void); | 101 | extern unsigned long nr_running(void); |
| 102 | extern unsigned long nr_uninterruptible(void); | 102 | extern unsigned long nr_uninterruptible(void); |
| 103 | extern unsigned long nr_active(void); | ||
| 103 | extern unsigned long nr_iowait(void); | 104 | extern 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) { } | |||
| 683 | struct audit_context; /* See audit.c */ | 685 | struct audit_context; /* See audit.c */ |
| 684 | struct mempolicy; | 686 | struct mempolicy; |
| 685 | 687 | ||
| 688 | enum sleep_type { | ||
| 689 | SLEEP_NORMAL, | ||
| 690 | SLEEP_NONINTERACTIVE, | ||
| 691 | SLEEP_INTERACTIVE, | ||
| 692 | SLEEP_INTERRUPTED, | ||
| 693 | }; | ||
| 694 | |||
| 686 | struct task_struct { | 695 | struct 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 | */ |
| 891 | static inline int pid_alive(struct task_struct *p) | 900 | static 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 | ||
| 896 | extern void free_task(struct task_struct *tsk); | 905 | extern 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 | ||
| 899 | extern void __put_task_struct_cb(struct rcu_head *rhp); | 908 | extern void __put_task_struct_cb(struct rcu_head *rhp); |
| 909 | extern void __put_task_struct(struct task_struct *t); | ||
| 900 | 910 | ||
| 901 | static inline void put_task_struct(struct task_struct *t) | 911 | static 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/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 | |||
| 944 | extern int ___pskb_trim(struct sk_buff *skb, unsigned int len, int realloc); | 963 | extern int ___pskb_trim(struct sk_buff *skb, unsigned int len, int realloc); |
| 945 | 964 | ||
| 946 | static inline void __skb_trim(struct sk_buff *skb, unsigned int len) | 965 | static 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) | |||
| 1030 | static inline struct sk_buff *__dev_alloc_skb(unsigned int length, | 1049 | static 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 | */ |
| 1071 | static inline int skb_cow(struct sk_buff *skb, unsigned int headroom) | 1090 | static 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 e487e3b60f60..5717147596b6 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
| @@ -569,5 +569,9 @@ asmlinkage long compat_sys_newfstatat(unsigned int dfd, char __user * filename, | |||
| 569 | asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename, | 569 | asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename, |
| 570 | int flags, int mode); | 570 | int flags, int mode); |
| 571 | asmlinkage long sys_unshare(unsigned long unshare_flags); | 571 | asmlinkage long sys_unshare(unsigned long unshare_flags); |
| 572 | asmlinkage long sys_splice(int fdin, int fdout, size_t len, | ||
| 573 | unsigned int flags); | ||
| 574 | asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes, | ||
| 575 | int flags); | ||
| 572 | 576 | ||
| 573 | #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 | ||
| 9 | struct timer_base_s; | 9 | struct tvec_t_base_s; |
| 10 | 10 | ||
| 11 | struct timer_list { | 11 | struct 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 | ||
| 21 | extern struct timer_base_s __init_timer_base; | 21 | extern 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/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 | ||
| 406 | extern void tcp_unhash(struct sock *sk); | 406 | extern void tcp_unhash(struct sock *sk); |
| 407 | 407 | ||
| 408 | extern int tcp_v4_hash_connecting(struct sock *sk); | ||
| 409 | |||
| 410 | |||
| 411 | /* From syncookies.c */ | 408 | /* From syncookies.c */ |
| 412 | extern struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb, | 409 | extern 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/rdma/ib_mad.h b/include/rdma/ib_mad.h index 51ab8eddb295..5ff77558013b 100644 --- a/include/rdma/ib_mad.h +++ b/include/rdma/ib_mad.h | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | * Copyright (c) 2004 Infinicon Corporation. All rights reserved. | 3 | * Copyright (c) 2004 Infinicon Corporation. All rights reserved. |
| 4 | * Copyright (c) 2004 Intel Corporation. All rights reserved. | 4 | * Copyright (c) 2004 Intel Corporation. All rights reserved. |
| 5 | * Copyright (c) 2004 Topspin Corporation. All rights reserved. | 5 | * Copyright (c) 2004 Topspin Corporation. All rights reserved. |
| 6 | * Copyright (c) 2004 Voltaire Corporation. All rights reserved. | 6 | * Copyright (c) 2004-2006 Voltaire Corporation. All rights reserved. |
| 7 | * | 7 | * |
| 8 | * This software is available to you under a choice of one of two | 8 | * This software is available to you under a choice of one of two |
| 9 | * licenses. You may choose to be licensed under the terms of the GNU | 9 | * licenses. You may choose to be licensed under the terms of the GNU |
| @@ -55,6 +55,10 @@ | |||
| 55 | #define IB_MGMT_CLASS_DEVICE_MGMT 0x06 | 55 | #define IB_MGMT_CLASS_DEVICE_MGMT 0x06 |
| 56 | #define IB_MGMT_CLASS_CM 0x07 | 56 | #define IB_MGMT_CLASS_CM 0x07 |
| 57 | #define IB_MGMT_CLASS_SNMP 0x08 | 57 | #define IB_MGMT_CLASS_SNMP 0x08 |
| 58 | #define IB_MGMT_CLASS_DEVICE_ADM 0x10 | ||
| 59 | #define IB_MGMT_CLASS_BOOT_MGMT 0x11 | ||
| 60 | #define IB_MGMT_CLASS_BIS 0x12 | ||
| 61 | #define IB_MGMT_CLASS_CONG_MGMT 0x21 | ||
| 58 | #define IB_MGMT_CLASS_VENDOR_RANGE2_START 0x30 | 62 | #define IB_MGMT_CLASS_VENDOR_RANGE2_START 0x30 |
| 59 | #define IB_MGMT_CLASS_VENDOR_RANGE2_END 0x4F | 63 | #define IB_MGMT_CLASS_VENDOR_RANGE2_END 0x4F |
| 60 | 64 | ||
| @@ -117,6 +121,8 @@ enum { | |||
| 117 | IB_MGMT_VENDOR_DATA = 216, | 121 | IB_MGMT_VENDOR_DATA = 216, |
| 118 | IB_MGMT_SA_HDR = 56, | 122 | IB_MGMT_SA_HDR = 56, |
| 119 | IB_MGMT_SA_DATA = 200, | 123 | IB_MGMT_SA_DATA = 200, |
| 124 | IB_MGMT_DEVICE_HDR = 64, | ||
| 125 | IB_MGMT_DEVICE_DATA = 192, | ||
| 120 | }; | 126 | }; |
| 121 | 127 | ||
| 122 | struct ib_mad_hdr { | 128 | struct ib_mad_hdr { |
| @@ -603,6 +609,25 @@ struct ib_mad_send_buf * ib_create_send_mad(struct ib_mad_agent *mad_agent, | |||
| 603 | gfp_t gfp_mask); | 609 | gfp_t gfp_mask); |
| 604 | 610 | ||
| 605 | /** | 611 | /** |
| 612 | * ib_is_mad_class_rmpp - returns whether given management class | ||
| 613 | * supports RMPP. | ||
| 614 | * @mgmt_class: management class | ||
| 615 | * | ||
| 616 | * This routine returns whether the management class supports RMPP. | ||
| 617 | */ | ||
| 618 | int ib_is_mad_class_rmpp(u8 mgmt_class); | ||
| 619 | |||
| 620 | /** | ||
| 621 | * ib_get_mad_data_offset - returns the data offset for a given | ||
| 622 | * management class. | ||
| 623 | * @mgmt_class: management class | ||
| 624 | * | ||
| 625 | * This routine returns the data offset in the MAD for the management | ||
| 626 | * class requested. | ||
| 627 | */ | ||
| 628 | int ib_get_mad_data_offset(u8 mgmt_class); | ||
| 629 | |||
| 630 | /** | ||
| 606 | * ib_get_rmpp_segment - returns the data buffer for a given RMPP segment. | 631 | * ib_get_rmpp_segment - returns the data buffer for a given RMPP segment. |
| 607 | * @send_buf: Previously allocated send data buffer. | 632 | * @send_buf: Previously allocated send data buffer. |
| 608 | * @seg_num: number of segment to return | 633 | * @seg_num: number of segment to return |
