diff options
| author | Linus Torvalds <torvalds@home.osdl.org> | 2004-01-06 15:44:53 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.osdl.org> | 2004-01-06 15:44:53 -0800 |
| commit | 0e00c9efc00ceda5eb83c7799a49d9a22e6c3ed4 (patch) | |
| tree | 86e52b10d8fe5a8689f32643c030c42a6caa91e8 /include | |
| parent | 3115b7080c9f03e28c82af7eae0bd8f9a278fc77 (diff) | |
| parent | 0c8ad9d059408e60916b8c974e1f20655c2b1810 (diff) | |
Merge bk://linux-dj.bkbits.net/agpgart
into home.osdl.org:/home/torvalds/v2.5/linux
Diffstat (limited to 'include')
157 files changed, 1548 insertions, 837 deletions
diff --git a/include/asm-alpha/cpumask.h b/include/asm-alpha/cpumask.h new file mode 100644 index 000000000000..bc3381ad1643 --- /dev/null +++ b/include/asm-alpha/cpumask.h @@ -0,0 +1,6 @@ +#ifndef _ASM_ALPHA_CPUMASK_H +#define _ASM_ALPHA_CPUMASK_H + +#include <asm-generic/cpumask.h> + +#endif /* _ASM_ALPHA_CPUMASK_H */ diff --git a/include/asm-arm/arch-ebsa285/time.h b/include/asm-arm/arch-ebsa285/time.h index a3b012a73887..f651eeb655be 100644 --- a/include/asm-arm/arch-ebsa285/time.h +++ b/include/asm-arm/arch-ebsa285/time.h @@ -243,6 +243,7 @@ void __init time_init(void) if ((CMOS_READ(RTC_REG_A) & 0x7f) == RTC_REF_CLCK_32KHZ && CMOS_READ(RTC_REG_B) == reg_b) { + struct timespec tv; /* * We have a RTC. Check the battery @@ -250,7 +251,9 @@ void __init time_init(void) if ((reg_d & 0x80) == 0) printk(KERN_WARNING "RTC: *** warning: CMOS battery bad\n"); - xtime.tv_sec = get_isa_cmos_time(); + tv.tv_nsec = 0; + tv.tv_sec = get_isa_cmos_time(); + do_settimeofday(&tv); set_rtc = set_isa_cmos_time; } else rtc_base = 0; diff --git a/include/asm-arm/arch-pxa/time.h b/include/asm-arm/arch-pxa/time.h index 91865bd8fce8..bc9437a8c38d 100644 --- a/include/asm-arm/arch-pxa/time.h +++ b/include/asm-arm/arch-pxa/time.h @@ -33,7 +33,7 @@ static int pxa_set_rtc(void) /* IRQs are disabled before entering here from do_gettimeofday() */ static unsigned long pxa_gettimeoffset (void) { - unsigned long ticks_to_match, elapsed, usec; + long ticks_to_match, elapsed, usec; /* Get ticks before next timer match */ ticks_to_match = OSMR0 - OSCR; @@ -41,6 +41,10 @@ static unsigned long pxa_gettimeoffset (void) /* We need elapsed ticks since last match */ elapsed = LATCH - ticks_to_match; + /* don't get fooled by the workaround in pxa_timer_interrupt() */ + if (elapsed <= 0) + return 0; + /* Now convert them to usec */ usec = (unsigned long)(elapsed * (tick_nsec / 1000))/LATCH; @@ -59,6 +63,15 @@ pxa_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) * IRQs are disabled inside the loop to ensure coherence between * lost_ticks (updated in do_timer()) and the match reg value, so we * can use do_gettimeofday() from interrupt handlers. + * + * HACK ALERT: it seems that the PXA timer regs aren't updated right + * away in all cases when a write occurs. We therefore compare with + * 8 instead of 0 in the while() condition below to avoid missing a + * match if OSCR has already reached the next OSMR value. + * Experience has shown that up to 6 ticks are needed to work around + * this problem, but let's use 8 to be conservative. Note that this + * affect things only when the timer IRQ has been delayed by nearly + * exactly one tick period which should be a pretty rare event. */ do { do_leds(); @@ -66,16 +79,22 @@ pxa_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) do_timer(regs); OSSR = OSSR_M0; /* Clear match on timer 0 */ next_match = (OSMR0 += LATCH); - } while( (signed long)(next_match - OSCR) <= 0 ); + } while( (signed long)(next_match - OSCR) <= 8 ); return IRQ_HANDLED; } void __init time_init(void) { + struct timespec tv; + gettimeoffset = pxa_gettimeoffset; set_rtc = pxa_set_rtc; - xtime.tv_sec = pxa_get_rtc_time(); + + tv.tv_nsec = 0; + tv.tv_sec = pxa_get_rtc_time(); + do_settimeofday(&tv); + timer_irq.handler = pxa_timer_interrupt; OSMR0 = 0; /* set initial match at 0 */ OSSR = 0xf; /* clear status on all timers */ diff --git a/include/asm-arm/arch-sa1100/time.h b/include/asm-arm/arch-sa1100/time.h index a7c984968819..d962626154dd 100644 --- a/include/asm-arm/arch-sa1100/time.h +++ b/include/asm-arm/arch-sa1100/time.h @@ -92,9 +92,15 @@ sa1100_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) void __init time_init(void) { + struct timespec tv; + gettimeoffset = sa1100_gettimeoffset; set_rtc = sa1100_set_rtc; - xtime.tv_sec = sa1100_get_rtc_time(); + + tv.tv_nsec = 0; + tv.tv_sec = sa1100_get_rtc_time(); + do_settimeofday(&tv); + timer_irq.handler = sa1100_timer_interrupt; OSMR0 = 0; /* set initial match at 0 */ OSSR = 0xf; /* clear status on all timers */ diff --git a/include/asm-arm/arch-shark/time.h b/include/asm-arm/arch-shark/time.h index 86a9bdebae23..66e45254a628 100644 --- a/include/asm-arm/arch-shark/time.h +++ b/include/asm-arm/arch-shark/time.h @@ -34,8 +34,6 @@ void __init time_init(void) outb(HZ_TIME & 0xff, 0x40); /* LSB of count */ outb(HZ_TIME >> 8, 0x40); - xtime.tv_sec = 0; - timer_irq.handler = timer_interrupt; setup_irq(IRQ_TIMER, &timer_irq); } diff --git a/include/asm-arm/cpumask.h b/include/asm-arm/cpumask.h new file mode 100644 index 000000000000..e3cf01fdf9c9 --- /dev/null +++ b/include/asm-arm/cpumask.h @@ -0,0 +1,6 @@ +#ifndef _ASM_ARM_CPUMASK_H +#define _ASM_ARM_CPUMASK_H + +#include <asm-generic/cpumask.h> + +#endif /* _ASM_ARM_CPUMASK_H */ diff --git a/include/asm-arm/div64.h b/include/asm-arm/div64.h index 3e3bdb7e7b79..4957da3df270 100644 --- a/include/asm-arm/div64.h +++ b/include/asm-arm/div64.h @@ -1,18 +1,42 @@ #ifndef __ASM_ARM_DIV64 #define __ASM_ARM_DIV64 -/* We're not 64-bit, but... */ +/* + * The semantics of do_div() are: + * + * uint32_t do_div(uint64_t *n, uint32_t base) + * { + * uint32_t remainder = *n % base; + * *n = *n / base; + * return remainder; + * } + * + * In other words, a 64-bit dividend with a 32-bit divisor producing + * a 64-bit result and a 32-bit remainder. To accomplish this optimally + * we call a special __do_div64 helper with completely non standard + * calling convention for arguments and results (beware). + */ + +#ifdef __ARMEB__ +#define __xh "r0" +#define __xl "r1" +#else +#define __xl "r0" +#define __xh "r1" +#endif + #define do_div(n,base) \ ({ \ - register int __res asm("r2") = base; \ - register unsigned long long __n asm("r0") = n; \ - asm("bl do_div64" \ - : "=r" (__n), "=r" (__res) \ - : "0" (__n), "1" (__res) \ - : "r3", "ip", "lr", "cc"); \ - n = __n; \ - __res; \ + register unsigned int __base asm("r4") = base; \ + register unsigned long long __n asm("r0") = n; \ + register unsigned long long __res asm("r2"); \ + register unsigned int __rem asm(__xh); \ + asm("bl __do_div64" \ + : "=r" (__rem), "=r" (__res) \ + : "r" (__n), "r" (__base) \ + : "ip", "lr", "cc"); \ + n = __res; \ + __rem; \ }) #endif - diff --git a/include/asm-arm/kmap_types.h b/include/asm-arm/kmap_types.h index 9ed6c333df58..69d967962a99 100644 --- a/include/asm-arm/kmap_types.h +++ b/include/asm-arm/kmap_types.h @@ -5,8 +5,21 @@ * This is the "bare minimum". AIO seems to require this. */ enum km_type { + KM_BOUNCE_READ, + KM_SKB_SUNRPC_DATA, + KM_SKB_DATA_SOFTIRQ, + KM_USER0, + KM_USER1, + KM_BIO_SRC_IRQ, + KM_BIO_DST_IRQ, + KM_PTE0, + KM_PTE1, + KM_PTE2, KM_IRQ0, - KM_USER1 + KM_IRQ1, + KM_SOFTIRQ0, + KM_SOFTIRQ1, + KM_TYPE_NR }; #endif diff --git a/include/asm-arm/pgtable.h b/include/asm-arm/pgtable.h index 9a09fb19258b..94522584d6f6 100644 --- a/include/asm-arm/pgtable.h +++ b/include/asm-arm/pgtable.h @@ -152,16 +152,16 @@ extern void __pgd_error(const char *file, int line, unsigned long val); /* * The following macros handle the cache and bufferable bits... */ -#define _L_PTE_DEFAULT L_PTE_PRESENT | L_PTE_YOUNG -#define _L_PTE_READ L_PTE_USER | L_PTE_EXEC | L_PTE_CACHEABLE | L_PTE_BUFFERABLE +#define _L_PTE_DEFAULT L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_CACHEABLE | L_PTE_BUFFERABLE +#define _L_PTE_READ L_PTE_USER | L_PTE_EXEC + +extern pgprot_t pgprot_kernel; #define PAGE_NONE __pgprot(_L_PTE_DEFAULT) #define PAGE_COPY __pgprot(_L_PTE_DEFAULT | _L_PTE_READ) #define PAGE_SHARED __pgprot(_L_PTE_DEFAULT | _L_PTE_READ | L_PTE_WRITE) #define PAGE_READONLY __pgprot(_L_PTE_DEFAULT | _L_PTE_READ) -#define PAGE_KERNEL __pgprot(_L_PTE_DEFAULT | L_PTE_CACHEABLE | L_PTE_BUFFERABLE | L_PTE_DIRTY | L_PTE_WRITE | L_PTE_EXEC) - -#define _PAGE_CHG_MASK (PAGE_MASK | L_PTE_DIRTY | L_PTE_YOUNG) +#define PAGE_KERNEL pgprot_kernel #endif /* __ASSEMBLY__ */ @@ -323,7 +323,8 @@ static inline pte_t *pmd_page_kernel(pmd_t pmd) static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) { - pte_val(pte) = (pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot); + const unsigned long mask = L_PTE_EXEC | L_PTE_WRITE | L_PTE_USER; + pte_val(pte) = (pte_val(pte) & ~mask) | (pgprot_val(newprot) & mask); return pte; } diff --git a/include/asm-arm/unaligned.h b/include/asm-arm/unaligned.h index a5f2abf845cf..1b39c2f322c9 100644 --- a/include/asm-arm/unaligned.h +++ b/include/asm-arm/unaligned.h @@ -159,7 +159,7 @@ static inline void __put_unaligned_8_be(const unsigned long long __v, register _ (void) 0; \ }) -#define put_unaligned_be(val,ptr) \ +#define __put_unaligned_be(val,ptr) \ ({ \ switch (sizeof(*(ptr))) { \ case 1: \ diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h index 825c98bcd14f..4affa93ebb48 100644 --- a/include/asm-arm/unistd.h +++ b/include/asm-arm/unistd.h @@ -282,6 +282,20 @@ /* 254 for set_thread_area */ /* 255 for get_thread_area */ /* 256 for set_tid_address */ +#define __NR_timer_create (__NR_SYSCALL_BASE+257) +#define __NR_timer_settime (__NR_SYSCALL_BASE+258) +#define __NR_timer_gettime (__NR_SYSCALL_BASE+259) +#define __NR_timer_getoverrun (__NR_SYSCALL_BASE+260) +#define __NR_timer_delete (__NR_SYSCALL_BASE+261) +#define __NR_clock_settime (__NR_SYSCALL_BASE+262) +#define __NR_clock_gettime (__NR_SYSCALL_BASE+263) +#define __NR_clock_getres (__NR_SYSCALL_BASE+264) +#define __NR_clock_nanosleep (__NR_SYSCALL_BASE+265) +#define __NR_statfs64 (__NR_SYSCALL_BASE+266) +#define __NR_fstatfs64 (__NR_SYSCALL_BASE+267) +#define __NR_tgkill (__NR_SYSCALL_BASE+268) +#define __NR_utimes (__NR_SYSCALL_BASE+269) +#define __NR_fadvise64_64 (__NR_SYSCALL_BASE+270) /* * The following SWIs are ARM private. diff --git a/include/asm-arm26/cpumask.h b/include/asm-arm26/cpumask.h new file mode 100644 index 000000000000..d181df4ed512 --- /dev/null +++ b/include/asm-arm26/cpumask.h @@ -0,0 +1,6 @@ +#ifndef _ASM_ARM26_CPUMASK_H +#define _ASM_ARM26_CPUMASK_H + +#include <asm-generic/cpumask.h> + +#endif /* _ASM_ARM26_CPUMASK_H */ diff --git a/include/asm-arm26/keyboard.h.old b/include/asm-arm26/keyboard.h.old deleted file mode 100644 index dc5c9fc3410c..000000000000 --- a/include/asm-arm26/keyboard.h.old +++ /dev/null @@ -1,78 +0,0 @@ -/* - * linux/include/asm-arm/keyboard.h - * - * Copyright (C) 1998 Russell King - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Keyboard driver definitions for ARM - */ -#ifndef __ASM_ARM_KEYBOARD_H -#define __ASM_ARM_KEYBOARD_H - -#include <linux/kd.h> -#include <linux/pm.h> - -/* - * We provide a unified keyboard interface when in VC_MEDIUMRAW - * mode. This means that all keycodes must be common between - * all supported keyboards. This unfortunately puts us at odds - * with the PC keyboard interface chip... but we can't do anything - * about that now. - */ -#ifdef __KERNEL__ - -extern int (*k_setkeycode)(unsigned int, unsigned int); -extern int (*k_getkeycode)(unsigned int); -extern int (*k_translate)(unsigned char, unsigned char *, char); -extern char (*k_unexpected_up)(unsigned char); -extern void (*k_leds)(unsigned char); - - -static inline int kbd_setkeycode(unsigned int sc, unsigned int kc) -{ - int ret = -EINVAL; - - if (k_setkeycode) - ret = k_setkeycode(sc, kc); - - return ret; -} - -static inline int kbd_getkeycode(unsigned int sc) -{ - int ret = -EINVAL; - - if (k_getkeycode) - ret = k_getkeycode(sc); - - return ret; -} - -static inline void kbd_leds(unsigned char leds) -{ - if (k_leds) - k_leds(leds); -} - -extern int k_sysrq_key; -extern unsigned char *k_sysrq_xlate; - -#define SYSRQ_KEY k_sysrq_key -#define kbd_sysrq_xlate k_sysrq_xlate -#define kbd_translate k_translate -#define kbd_unexpected_up k_unexpected_up - -#define NR_SCANCODES 128 - -extern int a5kkbd_init_hw(void); - -#define kbd_disable_irq() disable_irq(IRQ_KEYBOARDRX) -#define kbd_enable_irq() enable_irq(IRQ_KEYBOARDRX) -#define kbd_init_hw() a5kkbd_init_hw() - -#endif /* __KERNEL__ */ - -#endif /* __ASM_ARM_KEYBOARD_H */ diff --git a/include/asm-cris/cpumask.h b/include/asm-cris/cpumask.h new file mode 100644 index 000000000000..123b032a6eae --- /dev/null +++ b/include/asm-cris/cpumask.h @@ -0,0 +1,6 @@ +#ifndef _ASM_CRIS_CPUMASK_H +#define _ASM_CRIS_CPUMASK_H + +#include <asm-generic/cpumask.h> + +#endif /* _ASM_CRIS_CPUMASK_H */ diff --git a/include/asm-generic/cpumask.h b/include/asm-generic/cpumask.h new file mode 100644 index 000000000000..a5103259d7a9 --- /dev/null +++ b/include/asm-generic/cpumask.h @@ -0,0 +1,40 @@ +#ifndef __ASM_GENERIC_CPUMASK_H +#define __ASM_GENERIC_CPUMASK_H + +#include <linux/config.h> +#include <linux/kernel.h> +#include <linux/threads.h> +#include <linux/types.h> +#include <linux/bitmap.h> + +#if NR_CPUS > BITS_PER_LONG && NR_CPUS != 1 +#define CPU_ARRAY_SIZE BITS_TO_LONGS(NR_CPUS) + +struct cpumask +{ + unsigned long mask[CPU_ARRAY_SIZE]; +}; + +typedef struct cpumask cpumask_t; + +#else +typedef unsigned long cpumask_t; +#endif + +#ifdef CONFIG_SMP +#if NR_CPUS > BITS_PER_LONG +#include <asm-generic/cpumask_array.h> +#else +#include <asm-generic/cpumask_arith.h> +#endif +#else +#include <asm-generic/cpumask_up.h> +#endif + +#if NR_CPUS <= 4*BITS_PER_LONG +#include <asm-generic/cpumask_const_value.h> +#else +#include <asm-generic/cpumask_const_reference.h> +#endif + +#endif /* __ASM_GENERIC_CPUMASK_H */ diff --git a/include/asm-generic/cpumask_arith.h b/include/asm-generic/cpumask_arith.h index c19a0a6e45f0..7325284843dd 100644 --- a/include/asm-generic/cpumask_arith.h +++ b/include/asm-generic/cpumask_arith.h @@ -17,6 +17,7 @@ #define cpus_complement(map) do { map = ~(map); } while (0) #define cpus_equal(map1, map2) ((map1) == (map2)) #define cpus_empty(map) ((map) == 0) +#define cpus_addr(map) (&(map)) #if BITS_PER_LONG == 32 #define cpus_weight(map) hweight32(map) diff --git a/include/asm-generic/cpumask_array.h b/include/asm-generic/cpumask_array.h index 60c955d823b7..bd5c49133c6c 100644 --- a/include/asm-generic/cpumask_array.h +++ b/include/asm-generic/cpumask_array.h @@ -20,6 +20,7 @@ #define cpus_complement(map) bitmap_complement((map).mask, NR_CPUS) #define cpus_equal(map1, map2) bitmap_equal((map1).mask, (map2).mask, NR_CPUS) #define cpus_empty(map) bitmap_empty(map.mask, NR_CPUS) +#define cpus_addr(map) ((map).mask) #define cpus_weight(map) bitmap_weight((map).mask, NR_CPUS) #define cpus_shift_right(d, s, n) bitmap_shift_right((d).mask, (s).mask, n, NR_CPUS) #define cpus_shift_left(d, s, n) bitmap_shift_left((d).mask, (s).mask, n, NR_CPUS) diff --git a/include/asm-generic/cpumask_const_value.h b/include/asm-generic/cpumask_const_value.h index 7a4caefa4066..16ca16d286dc 100644 --- a/include/asm-generic/cpumask_const_value.h +++ b/include/asm-generic/cpumask_const_value.h @@ -3,7 +3,7 @@ typedef const cpumask_t cpumask_const_t; -#define mk_cpumask_const(map) ((cpumask_const_t)(map)) +#define mk_cpumask_const(map) (map) #define cpu_isset_const(cpu, map) cpu_isset(cpu, map) #define cpus_and_const(dst,src1,src2) cpus_and(dst, src1, src2) #define cpus_or_const(dst,src1,src2) cpus_or(dst, src1, src2) diff --git a/include/asm-generic/cpumask_up.h b/include/asm-generic/cpumask_up.h index a486c3414d04..f55c265a0e3b 100644 --- a/include/asm-generic/cpumask_up.h +++ b/include/asm-generic/cpumask_up.h @@ -33,6 +33,7 @@ #define cpus_equal(map1, map2) (cpus_coerce(map1) == cpus_coerce(map2)) #define cpus_empty(map) (cpus_coerce(map) == 0UL) +#define cpus_addr(map) (&(map)) #define cpus_weight(map) (cpus_coerce(map) ? 1UL : 0UL) #define cpus_shift_right(d, s, n) do { cpus_coerce(d) = 0UL; } while (0) #define cpus_shift_left(d, s, n) do { cpus_coerce(d) = 0UL; } while (0) diff --git a/include/asm-generic/statfs.h b/include/asm-generic/statfs.h index fecaf8fd5c10..1d01043e797d 100644 --- a/include/asm-generic/statfs.h +++ b/include/asm-generic/statfs.h @@ -34,4 +34,18 @@ struct statfs64 { __u32 f_spare[5]; }; +struct compat_statfs64 { + __u32 f_type; + __u32 f_bsize; + __u64 f_blocks; + __u64 f_bfree; + __u64 f_bavail; + __u64 f_files; + __u64 f_ffree; + __kernel_fsid_t f_fsid; + __u32 f_namelen; + __u32 f_frsize; + __u32 f_spare[5]; +}; + #endif diff --git a/include/asm-h8300/bitops.h b/include/asm-h8300/bitops.h index 87068f245d5c..30288d3ffe32 100644 --- a/include/asm-h8300/bitops.h +++ b/include/asm-h8300/bitops.h @@ -23,25 +23,22 @@ */ static __inline__ unsigned long ffz(unsigned long word) { - register unsigned long result asm("er0"); - register unsigned long _word asm("er1"); - - _word = word; - __asm__("sub.l %0,%0\n\t" - "dec.l #1,%0\n" - "1:\n\t" - "shlr.l %1\n\t" + unsigned long result; + + result = -1; + __asm__("1:\n\t" + "shlr.l %2\n\t" "adds #1,%0\n\t" "bcs 1b" - : "=r" (result) : "r" (_word)); + : "=r" (result) + : "0" (result),"r" (word)); return result; } static __inline__ void set_bit(int nr, volatile unsigned long* addr) { volatile unsigned char *b_addr; - b_addr = &(((volatile unsigned char *) addr) - [((nr >> 3) & ~3) + 3 - ((nr >> 3) & 3)]); + b_addr = (volatile unsigned char *)addr + ((nr >> 3) ^ 3); __asm__("mov.l %1,er0\n\t" "bset r0l,%0" :"+m"(*b_addr) @@ -61,8 +58,7 @@ static __inline__ void set_bit(int nr, volatile unsigned long* addr) static __inline__ void clear_bit(int nr, volatile unsigned long* addr) { volatile unsigned char *b_addr; - b_addr = &(((volatile unsigned char *) addr) - [((nr >> 3) & ~3) + 3 - ((nr >> 3) & 3)]); + b_addr = (volatile unsigned char *)addr + ((nr >> 3) ^ 3); __asm__("mov.l %1,er0\n\t" "bclr r0l,%0" :"+m"(*b_addr) @@ -75,8 +71,7 @@ static __inline__ void clear_bit(int nr, volatile unsigned long* addr) static __inline__ void change_bit(int nr, volatile unsigned long* addr) { volatile unsigned char *b_addr; - b_addr = &(((volatile unsigned char *) addr) - [((nr >> 3) & ~3) + 3 - ((nr >> 3) & 3)]); + b_addr = (volatile unsigned char *)addr + ((nr >> 3) ^ 3); __asm__("mov.l %1,er0\n\t" "bnot r0l,%0" :"+m"(*b_addr) @@ -88,22 +83,18 @@ static __inline__ void change_bit(int nr, volatile unsigned long* addr) static __inline__ int test_bit(int nr, const unsigned long* addr) { - return ((1UL << (nr & 7)) & - (((const volatile unsigned char *) addr) - [((nr >> 3) & ~3) + 3 - ((nr >> 3) & 3)])) != 0; + return (*((volatile unsigned char *)addr + ((nr >> 3) ^ 3)) & (1UL << (nr & 7))) != 0; } #define __test_bit(nr, addr) test_bit(nr, addr) static __inline__ int test_and_set_bit(int nr, volatile unsigned long* addr) { - register int retval __asm__("er0"); + int retval = 0; volatile unsigned char *a; - a = (volatile unsigned char *)addr; - a += ((nr >> 3) & ~3) + (3 - ((nr >> 3) & 3)); - __asm__("mov.l %2,er3\n\t" - "sub.l %0,%0\n\t" + a = (volatile unsigned char *)addr += ((nr >> 3) ^ 3); \ + __asm__("mov.l %4,er3\n\t" "stc ccr,r3h\n\t" "orc #0x80,ccr\n\t" "btst r3l,%1\n\t" @@ -112,37 +103,35 @@ static __inline__ int test_and_set_bit(int nr, volatile unsigned long* addr) "inc.l #1,%0\n\t" "1:" "ldc r3h,ccr" - : "=r"(retval),"+m"(*a) :"g"(nr & 7):"er3","memory"); + : "=r"(retval),"+m"(*a) + : "0" (retval),"m" (*a),"g"(nr & 7):"er3","memory"); return retval; } static __inline__ int __test_and_set_bit(int nr, volatile unsigned long* addr) { - register int retval __asm__("er0"); + int retval = 0; volatile unsigned char *a; - a = (volatile unsigned char *)addr; - a += ((nr >> 3) & ~3) + (3 - ((nr >> 3) & 3)); - __asm__("mov.l %2,er3\n\t" - "sub.l %0,%0\n\t" + a = (volatile unsigned char *)addr += ((nr >> 3) ^ 3); \ + __asm__("mov.l %4,er3\n\t" "btst r3l,%1\n\t" "bset r3l,%1\n\t" "beq 1f\n\t" "inc.l #1,%0\n\t" "1:" - : "=r"(retval),"+m"(*a) :"g"(nr & 7):"er3","memory"); + : "=r"(retval),"+m"(*a) + : "0" (retval),"m" (*a),"g"(nr & 7):"er3","memory"); return retval; } static __inline__ int test_and_clear_bit(int nr, volatile unsigned long* addr) { - register int retval __asm__("er0"); + int retval = 0; volatile unsigned char *a; - a = (volatile unsigned char *)addr; - a += ((nr >> 3) & ~3) + (3 - ((nr >> 3) & 3)); - __asm__("mov.l %2,er3\n\t" - "sub.l %0,%0\n\t" + a = (volatile unsigned char *)addr += ((nr >> 3) ^ 3); \ + __asm__("mov.l %4,er3\n\t" "stc ccr,r3h\n\t" "orc #0x80,ccr\n\t" "btst r3l,%1\n\t" @@ -151,37 +140,35 @@ static __inline__ int test_and_clear_bit(int nr, volatile unsigned long* addr) "inc.l #1,%0\n\t" "1:" "ldc r3h,ccr" - : "=r"(retval),"=m"(*a) :"g"(nr & 7):"er3","memory"); + : "=r"(retval),"+m"(*a) + : "0" (retval),"m" (*a),"g"(nr & 7):"er3","memory"); return retval; } static __inline__ int __test_and_clear_bit(int nr, volatile unsigned long* addr) { - register int retval __asm__("er0"); + int retval = 0; volatile unsigned char *a; - a = (volatile unsigned char *)addr; - a += ((nr >> 3) & ~3) + (3 - ((nr >> 3) & 3)); - __asm__("mov.l %2,er3\n\t" - "sub.l %0,%0\n\t" + a = (volatile unsigned char *)addr += ((nr >> 3) ^ 3); \ + __asm__("mov.l %4,er3\n\t" "btst r3l,%1\n\t" "bclr r3l,%1\n\t" "beq 1f\n\t" "inc.l #1,%0\n\t" "1:" - : "=r"(retval),"+m"(*a) :"g"(nr & 7):"er3","memory"); + : "=r"(retval),"+m"(*a) + : "0" (retval),"m" (*a),"g"(nr & 7):"er3","memory"); return retval; } static __inline__ int test_and_change_bit(int nr, volatile unsigned long* addr) { - register int retval __asm__("er0"); + int retval = 0; volatile unsigned char *a; - a = (volatile unsigned char *)addr; - a += ((nr >> 3) & ~3) + (3 - ((nr >> 3) & 3)); - __asm__("mov.l %2,er3\n\t" - "sub.l %0,%0\n\t" + a = (volatile unsigned char *)addr += ((nr >> 3) ^ 3); \ + __asm__("mov.l %4,er3\n\t" "stc ccr,r3h\n\t" "orc #0x80,ccr\n\t" "btst r3l,%1\n\t" @@ -190,25 +177,25 @@ static __inline__ int test_and_change_bit(int nr, volatile unsigned long* addr) "inc.l #1,%0\n\t" "1:" "ldc r3h,ccr" - : "=r"(retval),"+m"(*a) :"g"(nr & 7):"er3","memory"); + : "=r"(retval),"+m"(*a) + : "0" (retval),"m" (*a),"g"(nr & 7):"er3","memory"); return retval; } static __inline__ int __test_and_change_bit(int nr, volatile unsigned long* addr) { - register int retval __asm__("er0"); + int retval = 0; volatile unsigned char *a; - a = (volatile unsigned char *)addr; - a += ((nr >> 3) & ~3) + (3 - ((nr >> 3) & 3)); - __asm__("mov.l %2,er3\n\t" - "sub.l %0,%0\n\t" + a = (volatile unsigned char *)addr += ((nr >> 3) ^ 3); \ + __asm__("mov.l %4,er3\n\t" "btst r3l,%1\n\t" "bnot r3l,%1\n\t" "beq 1f\n\t" "inc.l #1,%0\n\t" "1:" - : "=r"(retval),"+m"(*a) :"g"(nr & 7):"er3","memory"); + : "=r"(retval),"+m"(*a) + : "0" (retval),"m" (*a),"g"(nr & 7):"er3","memory"); return retval; } @@ -251,27 +238,21 @@ found_middle: return result + ffz(tmp); } -static __inline__ unsigned long ffs(unsigned long word) +static __inline__ unsigned long __ffs(unsigned long word) { - register unsigned long result asm("er0"); - register unsigned long _word asm("er1"); - - _word = word; - __asm__("sub.l %0,%0\n\t" - "dec.l #1,%0\n" - "1:\n\t" - "shlr.l %1\n\t" + unsigned long result; + + result = -1; + __asm__("1:\n\t" + "shlr.l %2\n\t" "adds #1,%0\n\t" "bcc 1b" - : "=r" (result) : "r"(_word)); + : "=r" (result) + : "0"(result),"r"(word)); return result; } -#define __ffs(x) ffs(x) - -/* - * fls: find last bit set. - */ +#define ffs(x) generic_ffs(x) #define fls(x) generic_fls(x) /* @@ -316,6 +297,7 @@ static __inline__ int ext2_set_bit(int nr, volatile void * addr) local_irq_restore(flags); return retval; } +#define ext2_set_bit_atomic(lock, nr, addr) ext2_set_bit(nr, addr) static __inline__ int ext2_clear_bit(int nr, volatile void * addr) { @@ -331,6 +313,7 @@ static __inline__ int ext2_clear_bit(int nr, volatile void * addr) local_irq_restore(flags); return retval; } +#define ext2_clear_bit_atomic(lock, nr, addr) ext2_set_bit(nr, addr) static __inline__ int ext2_test_bit(int nr, const volatile void * addr) { @@ -402,17 +385,6 @@ found_middle: #define minix_test_bit(nr,addr) test_bit(nr,addr) #define minix_find_first_zero_bit(addr,size) find_first_zero_bit(addr,size) -/** - * hweightN - returns the hamming weight of a N-bit word - * @x: the word to weigh - * - * The Hamming Weight of a number is the total number of bits set in it. - */ - -#define hweight32(x) generic_hweight32(x) -#define hweight16(x) generic_hweight16(x) -#define hweight8(x) generic_hweight8(x) - #endif /* __KERNEL__ */ #endif /* _H8300_BITOPS_H */ diff --git a/include/asm-h8300/cpumask.h b/include/asm-h8300/cpumask.h new file mode 100644 index 000000000000..3b403850c043 --- /dev/null +++ b/include/asm-h8300/cpumask.h @@ -0,0 +1,6 @@ +#ifndef _ASM_H8300_CPUMASK_H +#define _ASM_H8300_CPUMASK_H + +#include <asm-generic/cpumask.h> + +#endif /* _ASM_H8300_CPUMASK_H */ diff --git a/include/asm-i386/cpumask.h b/include/asm-i386/cpumask.h new file mode 100644 index 000000000000..8bf5a829c528 --- /dev/null +++ b/include/asm-i386/cpumask.h @@ -0,0 +1,6 @@ +#ifndef _ASM_I386_CPUMASK_H +#define _ASM_I386_CPUMASK_H + +#include <asm-generic/cpumask.h> + +#endif /* _ASM_I386_CPUMASK_H */ diff --git a/include/asm-i386/hw_irq.h b/include/asm-i386/hw_irq.h index 225539187eb6..9b3b8bf9e266 100644 --- a/include/asm-i386/hw_irq.h +++ b/include/asm-i386/hw_irq.h @@ -41,6 +41,7 @@ asmlinkage void apic_timer_interrupt(void); asmlinkage void error_interrupt(void); asmlinkage void spurious_interrupt(void); asmlinkage void thermal_interrupt(struct pt_regs); +#define platform_legacy_irq(irq) ((irq) < 16) #endif void mask_irq(unsigned int irq); diff --git a/include/asm-i386/io_apic.h b/include/asm-i386/io_apic.h index 3b973c8b4aeb..861eceefc5aa 100644 --- a/include/asm-i386/io_apic.h +++ b/include/asm-i386/io_apic.h @@ -13,6 +13,46 @@ #ifdef CONFIG_X86_IO_APIC +#ifdef CONFIG_PCI_USE_VECTOR +static inline int use_pci_vector(void) {return 1;} +static inline void disable_edge_ioapic_vector(unsigned int vector) { } +static inline void mask_and_ack_level_ioapic_vector(unsigned int vector) { } +static inline void end_edge_ioapic_vector (unsigned int vector) { } +#define startup_level_ioapic startup_level_ioapic_vector +#define shutdown_level_ioapic mask_IO_APIC_vector +#define enable_level_ioapic unmask_IO_APIC_vector +#define disable_level_ioapic mask_IO_APIC_vector +#define mask_and_ack_level_ioapic mask_and_ack_level_ioapic_vector +#define end_level_ioapic end_level_ioapic_vector +#define set_ioapic_affinity set_ioapic_affinity_vector + +#define startup_edge_ioapic startup_edge_ioapic_vector +#define shutdown_edge_ioapic disable_edge_ioapic_vector +#define enable_edge_ioapic unmask_IO_APIC_vector +#define disable_edge_ioapic disable_edge_ioapic_vector +#define ack_edge_ioapic ack_edge_ioapic_vector +#define end_edge_ioapic end_edge_ioapic_vector +#else +static inline int use_pci_vector(void) {return 0;} +static inline void disable_edge_ioapic_irq(unsigned int irq) { } +static inline void mask_and_ack_level_ioapic_irq(unsigned int irq) { } +static inline void end_edge_ioapic_irq (unsigned int irq) { } +#define startup_level_ioapic startup_level_ioapic_irq +#define shutdown_level_ioapic mask_IO_APIC_irq +#define enable_level_ioapic unmask_IO_APIC_irq +#define disable_level_ioapic mask_IO_APIC_irq +#define mask_and_ack_level_ioapic mask_and_ack_level_ioapic_irq +#define end_level_ioapic end_level_ioapic_irq +#define set_ioapic_affinity set_ioapic_affinity_irq + +#define startup_edge_ioapic startup_edge_ioapic_irq +#define shutdown_edge_ioapic disable_edge_ioapic_irq +#define enable_edge_ioapic unmask_IO_APIC_irq +#define disable_edge_ioapic disable_edge_ioapic_irq +#define ack_edge_ioapic ack_edge_ioapic_irq +#define end_edge_ioapic end_edge_ioapic_irq +#endif + #define APIC_MISMATCH_DEBUG #define IO_APIC_BASE(idx) \ @@ -177,4 +217,6 @@ extern int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level #define io_apic_assign_pci_irqs 0 #endif +extern int assign_irq_vector(int irq); + #endif diff --git a/include/asm-i386/ioctl.h b/include/asm-i386/ioctl.h index 2e98645a3788..543f7843d553 100644 --- a/include/asm-i386/ioctl.h +++ b/include/asm-i386/ioctl.h @@ -53,7 +53,7 @@ ((size) << _IOC_SIZESHIFT)) /* provoke compile error for invalid uses of size argument */ -extern int __invalid_size_argument_for_IOC; +extern unsigned int __invalid_size_argument_for_IOC; #define _IOC_TYPECHECK(t) \ ((sizeof(t) == sizeof(t[1]) && \ sizeof(t) < (1 << _IOC_SIZEBITS)) ? \ diff --git a/include/asm-i386/irq.h b/include/asm-i386/irq.h index f7d17d2897a6..69cb661b012a 100644 --- a/include/asm-i386/irq.h +++ b/include/asm-i386/irq.h @@ -24,6 +24,7 @@ extern void disable_irq(unsigned int); extern void disable_irq_nosync(unsigned int); extern void enable_irq(unsigned int); extern void release_x86_irqs(struct task_struct *); +extern int can_request_irq(unsigned int, unsigned long flags); #ifdef CONFIG_X86_LOCAL_APIC #define ARCH_HAS_NMI_WATCHDOG /* See include/linux/nmi.h */ diff --git a/include/asm-i386/mach-default/irq_vectors.h b/include/asm-i386/mach-default/irq_vectors.h index a0371dc31137..8381e7e6197b 100644 --- a/include/asm-i386/mach-default/irq_vectors.h +++ b/include/asm-i386/mach-default/irq_vectors.h @@ -76,6 +76,18 @@ * Since vectors 0x00-0x1f are used/reserved for the CPU, * the usable vector space is 0x20-0xff (224 vectors) */ + +/* + * The maximum number of vectors supported by i386 processors + * is limited to 256. For processors other than i386, NR_VECTORS + * should be changed accordingly. + */ +#define NR_VECTORS 256 + +#ifdef CONFIG_PCI_USE_VECTOR +#define NR_IRQS FIRST_SYSTEM_VECTOR +#define NR_IRQ_VECTORS NR_IRQS +#else #ifdef CONFIG_X86_IO_APIC #define NR_IRQS 224 # if (224 >= 32 * NR_CPUS) @@ -87,6 +99,7 @@ #define NR_IRQS 16 #define NR_IRQ_VECTORS NR_IRQS #endif +#endif #define FPU_IRQ 13 diff --git a/include/asm-i386/mach-default/mach_apic.h b/include/asm-i386/mach-default/mach_apic.h index 8875f34285bd..1d427aadfa41 100644 --- a/include/asm-i386/mach-default/mach_apic.h +++ b/include/asm-i386/mach-default/mach_apic.h @@ -5,12 +5,12 @@ #define APIC_DFR_VALUE (APIC_DFR_FLAT) -static inline cpumask_t target_cpus(void) +static inline cpumask_const_t target_cpus(void) { #ifdef CONFIG_SMP - return cpu_online_map; + return mk_cpumask_const(cpu_online_map); #else - return cpumask_of_cpu(0); + return mk_cpumask_const(cpumask_of_cpu(0)); #endif } #define TARGET_CPUS (target_cpus()) diff --git a/include/asm-i386/mach-es7000/mach_apic.h b/include/asm-i386/mach-es7000/mach_apic.h index b744ac27f6fc..e15b73c7e113 100644 --- a/include/asm-i386/mach-es7000/mach_apic.h +++ b/include/asm-i386/mach-es7000/mach_apic.h @@ -39,6 +39,7 @@ static inline cpumask_t target_cpus(void) #endif #define APIC_BROADCAST_ID (0xff) +#define NO_IOAPIC_CHECK (0) static inline unsigned long check_apicid_used(physid_mask_t bitmap, int apicid) { diff --git a/include/asm-i386/mach-summit/mach_mpparse.h b/include/asm-i386/mach-summit/mach_mpparse.h index 88d215ad7bde..1cce2b924a80 100644 --- a/include/asm-i386/mach-summit/mach_mpparse.h +++ b/include/asm-i386/mach-summit/mach_mpparse.h @@ -5,11 +5,11 @@ extern int use_cyclone; -#ifdef CONFIG_NUMA +#ifdef CONFIG_X86_SUMMIT_NUMA extern void setup_summit(void); -#else /* !CONFIG_NUMA */ +#else #define setup_summit() {} -#endif /* CONFIG_NUMA */ +#endif static inline void mpc_oem_bus_info(struct mpc_config_bus *m, char *name, struct mpc_config_translation *translation) @@ -110,9 +110,9 @@ typedef enum { LookOutBWPEG = 7, /* LookOut WPEG */ } node_type; -static inline int is_WPEG(node_type type){ - return (type == CompatWPEG || type == AltWPEG || - type == LookOutAWPEG || type == LookOutBWPEG); +static inline int is_WPEG(struct rio_detail *rio){ + return (rio->type == CompatWPEG || rio->type == AltWPEG || + rio->type == LookOutAWPEG || rio->type == LookOutBWPEG); } #endif /* __ASM_MACH_MPPARSE_H */ diff --git a/include/asm-i386/mach-voyager/irq_vectors.h b/include/asm-i386/mach-voyager/irq_vectors.h index e0121b8ed500..165421f5821c 100644 --- a/include/asm-i386/mach-voyager/irq_vectors.h +++ b/include/asm-i386/mach-voyager/irq_vectors.h @@ -55,6 +55,7 @@ #define VIC_CPU_BOOT_CPI VIC_CPI_LEVEL0 #define VIC_CPU_BOOT_ERRATA_CPI (VIC_CPI_LEVEL0 + 8) +#define NR_VECTORS 256 #define NR_IRQS 224 #define NR_IRQ_VECTORS NR_IRQS diff --git a/include/asm-i386/mpspec.h b/include/asm-i386/mpspec.h index a4ee37cade68..55bd3075d68f 100644 --- a/include/asm-i386/mpspec.h +++ b/include/asm-i386/mpspec.h @@ -27,10 +27,6 @@ extern unsigned long mp_lapic_addr; extern int pic_mode; extern int using_apic_timer; -#ifdef CONFIG_X86_SUMMIT -extern void setup_summit (void); -#endif - #ifdef CONFIG_ACPI_BOOT extern void mp_register_lapic (u8 id, u8 enabled); extern void mp_register_lapic_address (u64 address); diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h index b9998ad13267..553404457974 100644 --- a/include/asm-i386/processor.h +++ b/include/asm-i386/processor.h @@ -407,6 +407,7 @@ struct thread_struct { /* cached TLS descriptors. */ struct desc_struct tls_array[GDT_ENTRY_TLS_ENTRIES]; unsigned long esp0; + unsigned long sysenter_cs; unsigned long eip; unsigned long esp; unsigned long fs; @@ -428,6 +429,7 @@ struct thread_struct { #define INIT_THREAD { \ .vm86_info = NULL, \ + .sysenter_cs = __KERNEL_CS, \ .io_bitmap_ptr = NULL, \ } @@ -447,21 +449,13 @@ struct thread_struct { .io_bitmap = { [ 0 ... IO_BITMAP_LONGS] = ~0 }, \ } -static inline void load_esp0(struct tss_struct *tss, unsigned long esp0) +static inline void load_esp0(struct tss_struct *tss, struct thread_struct *thread) { - tss->esp0 = esp0; + tss->esp0 = thread->esp0; /* This can only happen when SEP is enabled, no need to test "SEP"arately */ - if ((unlikely(tss->ss1 != __KERNEL_CS))) { - tss->ss1 = __KERNEL_CS; - wrmsr(MSR_IA32_SYSENTER_CS, __KERNEL_CS, 0); - } -} - -static inline void disable_sysenter(struct tss_struct *tss) -{ - if (cpu_has_sep) { - tss->ss1 = 0; - wrmsr(MSR_IA32_SYSENTER_CS, 0, 0); + if (unlikely(tss->ss1 != thread->sysenter_cs)) { + tss->ss1 = thread->sysenter_cs; + wrmsr(MSR_IA32_SYSENTER_CS, thread->sysenter_cs, 0); } } diff --git a/include/asm-i386/setup.h b/include/asm-i386/setup.h index 9198a377748c..bead49efcf04 100644 --- a/include/asm-i386/setup.h +++ b/include/asm-i386/setup.h @@ -29,6 +29,11 @@ #define IST_INFO (*(struct ist_info *) (PARAM+0x60)) #define DRIVE_INFO (*(struct drive_info_struct *) (PARAM+0x80)) #define SYS_DESC_TABLE (*(struct sys_desc_table_struct*)(PARAM+0xa0)) +#define EFI_SYSTAB ((efi_system_table_t *) *((unsigned long *)(PARAM+0x1c4))) +#define EFI_MEMDESC_SIZE (*((unsigned long *) (PARAM+0x1c8))) +#define EFI_MEMDESC_VERSION (*((unsigned long *) (PARAM+0x1cc))) +#define EFI_MEMMAP ((efi_memory_desc_t *) *((unsigned long *)(PARAM+0x1d0))) +#define EFI_MEMMAP_SIZE (*((unsigned long *) (PARAM+0x1d4))) #define MOUNT_ROOT_RDONLY (*(unsigned short *) (PARAM+0x1F2)) #define RAMDISK_FLAGS (*(unsigned short *) (PARAM+0x1F8)) #define VIDEO_MODE (*(unsigned short *) (PARAM+0x1FA)) diff --git a/include/asm-i386/string.h b/include/asm-i386/string.h index 3a90a9e142cd..daecfc479f35 100644 --- a/include/asm-i386/string.h +++ b/include/asm-i386/string.h @@ -291,7 +291,7 @@ extern void __struct_cpy_bug (void); #define struct_cpy(x,y) \ ({ \ if (sizeof(*(x)) != sizeof(*(y))) \ - __struct_cpy_bug; \ + __struct_cpy_bug(); \ memcpy(x, y, sizeof(*(x))); \ }) @@ -299,14 +299,9 @@ extern void __struct_cpy_bug (void); static inline void * memmove(void * dest,const void * src, size_t n) { int d0, d1, d2; -if (dest<src) -__asm__ __volatile__( - "rep\n\t" - "movsb" - : "=&c" (d0), "=&S" (d1), "=&D" (d2) - :"0" (n),"1" (src),"2" (dest) - : "memory"); -else +if (dest<src) { + memcpy(dest,src,n); +} else __asm__ __volatile__( "std\n\t" "rep\n\t" diff --git a/include/asm-i386/timer.h b/include/asm-i386/timer.h index 21044fa48baa..1727153c3570 100644 --- a/include/asm-i386/timer.h +++ b/include/asm-i386/timer.h @@ -11,6 +11,7 @@ * last timer intruupt. */ struct timer_opts{ + char* name; int (*init)(char *override); void (*mark_offset)(void); unsigned long (*get_offset)(void); diff --git a/include/asm-ia64/acpi.h b/include/asm-ia64/acpi.h index 7c3c0edd574a..8f11f8f345f7 100644 --- a/include/asm-ia64/acpi.h +++ b/include/asm-ia64/acpi.h @@ -88,11 +88,8 @@ ia64_acpi_release_global_lock (unsigned int *lock) const char *acpi_get_sysname (void); int acpi_request_vector (u32 int_type); -int acpi_get_prt (struct pci_vector_struct **vectors, int *count); -int acpi_get_interrupt_model (int *type); int acpi_register_irq (u32 gsi, u32 polarity, u32 trigger); int acpi_irq_to_vector (u32 irq); -int acpi_get_addr_space (void *obj, u8 type, u64 *base, u64 *length,u64 *tra); #ifdef CONFIG_ACPI_NUMA #include <asm/numa.h> diff --git a/include/asm-ia64/cpumask.h b/include/asm-ia64/cpumask.h new file mode 100644 index 000000000000..7764aef653e8 --- /dev/null +++ b/include/asm-ia64/cpumask.h @@ -0,0 +1,6 @@ +#ifndef _ASM_IA64_CPUMASK_H +#define _ASM_IA64_CPUMASK_H + +#include <asm-generic/cpumask.h> + +#endif /* _ASM_IA64_CPUMASK_H */ diff --git a/include/asm-ia64/ia32.h b/include/asm-ia64/ia32.h index 4c8fd32b8b78..afabca920514 100644 --- a/include/asm-ia64/ia32.h +++ b/include/asm-ia64/ia32.h @@ -6,7 +6,11 @@ #include <asm/ptrace.h> #include <asm/signal.h> -#ifdef CONFIG_IA32_SUPPORT +#define IA32_NR_syscalls 275 /* length of syscall table */ + +#ifndef __ASSEMBLY__ + +# ifdef CONFIG_IA32_SUPPORT extern void ia32_cpu_init (void); extern void ia32_boot_gdt_init (void); @@ -15,10 +19,12 @@ extern int ia32_exception (struct pt_regs *regs, unsigned long isr); extern int ia32_intercept (struct pt_regs *regs, unsigned long isr); extern int ia32_clone_tls (struct task_struct *child, struct pt_regs *childregs); -#endif /* !CONFIG_IA32_SUPPORT */ +# endif /* !CONFIG_IA32_SUPPORT */ /* Declare this unconditionally, so we don't get warnings for unreachable code. */ extern int ia32_setup_frame1 (int sig, struct k_sigaction *ka, siginfo_t *info, sigset_t *set, struct pt_regs *regs); +#endif /* !__ASSEMBLY__ */ + #endif /* _ASM_IA64_IA32_H */ diff --git a/include/asm-ia64/intrinsics.h b/include/asm-ia64/intrinsics.h index 743049ca0851..8089f955e5d2 100644 --- a/include/asm-ia64/intrinsics.h +++ b/include/asm-ia64/intrinsics.h @@ -167,7 +167,7 @@ extern long ia64_cmpxchg_called_with_bad_pointer (void); if (_cmpxchg_bugcheck_count-- <= 0) { \ void *ip; \ extern int printk(const char *fmt, ...); \ - ip = ia64_getreg(_IA64_REG_IP); \ + ip = (void *) ia64_getreg(_IA64_REG_IP); \ printk("CMPXCHG_BUGCHECK: stuck at %p on word %p\n", ip, (v)); \ break; \ } \ diff --git a/include/asm-ia64/mca.h b/include/asm-ia64/mca.h index 6791e7358a03..f6439e7dd68e 100644 --- a/include/asm-ia64/mca.h +++ b/include/asm-ia64/mca.h @@ -18,6 +18,7 @@ #include <asm/param.h> #include <asm/sal.h> #include <asm/processor.h> +#include <asm/mca_asm.h> /* These are the return codes from all the IA64_MCA specific interfaces */ typedef int ia64_mca_return_code_t; @@ -61,6 +62,17 @@ enum { IA64_MCA_RENDEZ_CHECKIN_DONE = 0x1 }; +/* the following data structure is used for TLB error recovery purposes */ +extern struct ia64_mca_tlb_info { + u64 cr_lid; + u64 percpu_paddr; + u64 ptce_base; + u32 ptce_count[2]; + u32 ptce_stride[2]; + u64 pal_paddr; + u64 pal_base; +} ia64_mca_tlb_list[NR_CPUS]; + /* Information maintained by the MC infrastructure */ typedef struct ia64_mc_info_s { u64 imi_mca_handler; @@ -141,7 +153,6 @@ extern irqreturn_t ia64_mca_cpe_int_caller(int,void *,struct pt_regs *); extern int ia64_log_print(int,prfunc_t); extern void ia64_mca_cmc_vector_setup(void); extern int ia64_mca_check_errors(void); -extern u64 ia64_log_get(int, prfunc_t); #define PLATFORM_CALL(fn, args) printk("Platform call TBD\n") diff --git a/include/asm-ia64/mmu_context.h b/include/asm-ia64/mmu_context.h index 0255260f61bc..3a3ea55e9ab3 100644 --- a/include/asm-ia64/mmu_context.h +++ b/include/asm-ia64/mmu_context.h @@ -95,12 +95,13 @@ delayed_tlb_flush (void) static inline mm_context_t get_mmu_context (struct mm_struct *mm) { + unsigned long flags; mm_context_t context = mm->context; if (context) return context; - spin_lock(&ia64_ctx.lock); + spin_lock_irqsave(&ia64_ctx.lock, flags); { /* re-check, now that we've got the lock: */ context = mm->context; @@ -110,7 +111,7 @@ get_mmu_context (struct mm_struct *mm) mm->context = context = ia64_ctx.next++; } } - spin_unlock(&ia64_ctx.lock); + spin_unlock_irqrestore(&ia64_ctx.lock, flags); return context; } diff --git a/include/asm-ia64/numa.h b/include/asm-ia64/numa.h index f5a735239897..bdf62e67eb4e 100644 --- a/include/asm-ia64/numa.h +++ b/include/asm-ia64/numa.h @@ -24,7 +24,7 @@ #include <asm/mmzone.h> -extern volatile char cpu_to_node_map[NR_CPUS] __cacheline_aligned; +extern volatile u8 cpu_to_node_map[NR_CPUS] __cacheline_aligned; extern volatile cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned; /* Stuff below this line could be architecture independent */ diff --git a/include/asm-ia64/numnodes.h b/include/asm-ia64/numnodes.h index f0f167b09807..217171bc3add 100644 --- a/include/asm-ia64/numnodes.h +++ b/include/asm-ia64/numnodes.h @@ -5,8 +5,8 @@ /* Max 8 Nodes */ #define NODES_SHIFT 3 #elif defined(CONFIG_IA64_SGI_SN2) || defined(CONFIG_IA64_GENERIC) -/* Max 128 Nodes */ -#define NODES_SHIFT 7 +/* Max 256 Nodes */ +#define NODES_SHIFT 8 #endif #endif /* _ASM_MAX_NUMNODES_H */ diff --git a/include/asm-ia64/page.h b/include/asm-ia64/page.h index 15b81b2984b9..7aa162462351 100644 --- a/include/asm-ia64/page.h +++ b/include/asm-ia64/page.h @@ -63,7 +63,7 @@ # define HPAGE_SIZE (__IA64_UL_CONST(1) << HPAGE_SHIFT) # define HPAGE_MASK (~(HPAGE_SIZE - 1)) # define HAVE_ARCH_HUGETLB_UNMAPPED_AREA -# define ARCH_HAS_VALID_HUGEPAGE_RANGE +# define ARCH_HAS_HUGEPAGE_ONLY_RANGE #endif /* CONFIG_HUGETLB_PAGE */ #ifdef __ASSEMBLY__ @@ -137,7 +137,9 @@ typedef union ia64_va { # define htlbpage_to_page(x) ((REGION_NUMBER(x) << 61) \ | (REGION_OFFSET(x) >> (HPAGE_SHIFT-PAGE_SHIFT))) # define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) -extern int check_valid_hugepage_range(unsigned long addr, unsigned long len); +# define is_hugepage_only_range(addr, len) \ + (REGION_NUMBER(addr) == REGION_HPAGE && \ + REGION_NUMBER((addr)+(len)) == REGION_HPAGE) #endif static __inline__ int diff --git a/include/asm-ia64/pal.h b/include/asm-ia64/pal.h index eccf580c1d5f..7d47da05b823 100644 --- a/include/asm-ia64/pal.h +++ b/include/asm-ia64/pal.h @@ -461,23 +461,13 @@ typedef struct pal_process_state_info_s { } pal_processor_state_info_t; typedef struct pal_cache_check_info_s { - u64 reserved1 : 16, - way : 5, /* Way in which the - * error occurred - */ - reserved2 : 1, - mc : 1, /* Machine check corrected */ - tv : 1, /* Target address - * structure is valid - */ - - wv : 1, /* Way field valid */ - op : 3, /* Type of cache + u64 op : 4, /* Type of cache * operation that * caused the machine * check. */ - + level : 2, /* Cache level */ + reserved1 : 2, dl : 1, /* Failure in data part * of cache line */ @@ -486,11 +476,34 @@ typedef struct pal_cache_check_info_s { */ dc : 1, /* Failure in dcache */ ic : 1, /* Failure in icache */ - index : 24, /* Cache line index */ - mv : 1, /* mesi valid */ mesi : 3, /* Cache line state */ - level : 4; /* Cache level */ + mv : 1, /* mesi valid */ + way : 5, /* Way in which the + * error occurred + */ + wiv : 1, /* Way field valid */ + reserved2 : 10, + index : 20, /* Cache line index */ + reserved3 : 2, + + is : 1, /* instruction set (1 == ia32) */ + iv : 1, /* instruction set field valid */ + pl : 2, /* privilege level */ + pv : 1, /* privilege level field valid */ + mcc : 1, /* Machine check corrected */ + tv : 1, /* Target address + * structure is valid + */ + rq : 1, /* Requester identifier + * structure is valid + */ + rp : 1, /* Responder identifier + * structure is valid + */ + pi : 1; /* Precise instruction pointer + * structure is valid + */ } pal_cache_check_info_t; typedef struct pal_tlb_check_info_s { @@ -498,18 +511,38 @@ typedef struct pal_tlb_check_info_s { u64 tr_slot : 8, /* Slot# of TR where * error occurred */ - reserved2 : 8, + trv : 1, /* tr_slot field is valid */ + reserved1 : 1, + level : 2, /* TLB level where failure occurred */ + reserved2 : 4, dtr : 1, /* Fail in data TR */ itr : 1, /* Fail in inst TR */ dtc : 1, /* Fail in data TC */ itc : 1, /* Fail in inst. TC */ - mc : 1, /* Machine check corrected */ - reserved1 : 43; - + op : 4, /* Cache operation */ + reserved3 : 30, + + is : 1, /* instruction set (1 == ia32) */ + iv : 1, /* instruction set field valid */ + pl : 2, /* privilege level */ + pv : 1, /* privilege level field valid */ + mcc : 1, /* Machine check corrected */ + tv : 1, /* Target address + * structure is valid + */ + rq : 1, /* Requester identifier + * structure is valid + */ + rp : 1, /* Responder identifier + * structure is valid + */ + pi : 1; /* Precise instruction pointer + * structure is valid + */ } pal_tlb_check_info_t; typedef struct pal_bus_check_info_s { - u64 size : 5, /* Xaction size*/ + u64 size : 5, /* Xaction size */ ib : 1, /* Internal bus error */ eb : 1, /* External bus error */ cc : 1, /* Error occurred @@ -518,22 +551,99 @@ typedef struct pal_bus_check_info_s { */ type : 8, /* Bus xaction type*/ sev : 5, /* Bus error severity*/ - tv : 1, /* Targ addr valid */ - rp : 1, /* Resp addr valid */ - rq : 1, /* Req addr valid */ + hier : 2, /* Bus hierarchy level */ + reserved1 : 1, bsi : 8, /* Bus error status * info */ - mc : 1, /* Machine check corrected */ - reserved1 : 31; + reserved2 : 22, + + is : 1, /* instruction set (1 == ia32) */ + iv : 1, /* instruction set field valid */ + pl : 2, /* privilege level */ + pv : 1, /* privilege level field valid */ + mcc : 1, /* Machine check corrected */ + tv : 1, /* Target address + * structure is valid + */ + rq : 1, /* Requester identifier + * structure is valid + */ + rp : 1, /* Responder identifier + * structure is valid + */ + pi : 1; /* Precise instruction pointer + * structure is valid + */ } pal_bus_check_info_t; +typedef struct pal_reg_file_check_info_s { + u64 id : 4, /* Register file identifier */ + op : 4, /* Type of register + * operation that + * caused the machine + * check. + */ + reg_num : 7, /* Register number */ + rnv : 1, /* reg_num valid */ + reserved2 : 38, + + is : 1, /* instruction set (1 == ia32) */ + iv : 1, /* instruction set field valid */ + pl : 2, /* privilege level */ + pv : 1, /* privilege level field valid */ + mcc : 1, /* Machine check corrected */ + reserved3 : 3, + pi : 1; /* Precise instruction pointer + * structure is valid + */ +} pal_reg_file_check_info_t; + +typedef struct pal_uarch_check_info_s { + u64 sid : 5, /* Structure identification */ + level : 3, /* Level of failure */ + array_id : 4, /* Array identification */ + op : 4, /* Type of + * operation that + * caused the machine + * check. + */ + way : 6, /* Way of structure */ + wv : 1, /* way valid */ + xv : 1, /* index valid */ + reserved1 : 8, + index : 8, /* Index or set of the uarch + * structure that failed. + */ + reserved2 : 24, + + is : 1, /* instruction set (1 == ia32) */ + iv : 1, /* instruction set field valid */ + pl : 2, /* privilege level */ + pv : 1, /* privilege level field valid */ + mcc : 1, /* Machine check corrected */ + tv : 1, /* Target address + * structure is valid + */ + rq : 1, /* Requester identifier + * structure is valid + */ + rp : 1, /* Responder identifier + * structure is valid + */ + pi : 1; /* Precise instruction pointer + * structure is valid + */ +} pal_uarch_check_info_t; + typedef union pal_mc_error_info_u { u64 pmei_data; pal_processor_state_info_t pme_processor; pal_cache_check_info_t pme_cache; pal_tlb_check_info_t pme_tlb; pal_bus_check_info_t pme_bus; + pal_reg_file_check_info_t pme_reg_file; + pal_uarch_check_info_t pme_uarch; } pal_mc_error_info_t; #define pmci_proc_unknown_check pme_processor.uc diff --git a/include/asm-ia64/pgtable.h b/include/asm-ia64/pgtable.h index ca0e38c0f8ff..7561d3d8f632 100644 --- a/include/asm-ia64/pgtable.h +++ b/include/asm-ia64/pgtable.h @@ -230,6 +230,10 @@ ia64_phys_addr_valid (unsigned long addr) #define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot)) +/* This takes a physical page address that is used by the remapping functions */ +#define mk_pte_phys(physpage, pgprot) \ +({ pte_t __pte; pte_val(__pte) = physpage + pgprot_val(pgprot); __pte; }) + #define pte_modify(_pte, newprot) \ (__pte((pte_val(_pte) & ~_PAGE_CHG_MASK) | (pgprot_val(newprot) & _PAGE_CHG_MASK))) @@ -455,6 +459,15 @@ extern struct page *zero_page_memmap_ptr; /* We provide our own get_unmapped_area to cope with VA holes for userland */ #define HAVE_ARCH_UNMAPPED_AREA +#ifdef CONFIG_HUGETLB_PAGE +#define HUGETLB_PGDIR_SHIFT (HPAGE_SHIFT + 2*(PAGE_SHIFT-3)) +#define HUGETLB_PGDIR_SIZE (__IA64_UL(1) << HUGETLB_PGDIR_SHIFT) +#define HUGETLB_PGDIR_MASK (~(HUGETLB_PGDIR_SIZE-1)) +struct mmu_gather; +extern void hugetlb_free_pgtables(struct mmu_gather *tlb, + struct vm_area_struct * prev, unsigned long start, unsigned long end); +#endif + typedef pte_t *pte_addr_t; /* diff --git a/include/asm-ia64/processor.h b/include/asm-ia64/processor.h index 5948902ae28b..91ca5ec53c9c 100644 --- a/include/asm-ia64/processor.h +++ b/include/asm-ia64/processor.h @@ -64,7 +64,7 @@ #define IA64_THREAD_PM_VALID (__IA64_UL(1) << 2) /* performance registers valid? */ #define IA64_THREAD_UAC_NOPRINT (__IA64_UL(1) << 3) /* don't log unaligned accesses */ #define IA64_THREAD_UAC_SIGBUS (__IA64_UL(1) << 4) /* generate SIGBUS on unaligned acc. */ -#define IA64_THREAD_KRBS_SYNCED (__IA64_UL(1) << 5) /* krbs synced with process vm? */ + /* bit 5 is currently unused */ #define IA64_THREAD_FPEMU_NOPRINT (__IA64_UL(1) << 6) /* don't log any fpswa faults */ #define IA64_THREAD_FPEMU_SIGFPE (__IA64_UL(1) << 7) /* send a SIGFPE for fpswa faults */ #define IA64_THREAD_XSTACK (__IA64_UL(1) << 8) /* stack executable by default? */ diff --git a/include/asm-ia64/sal.h b/include/asm-ia64/sal.h index 855c24712736..7f47a574a7a9 100644 --- a/include/asm-ia64/sal.h +++ b/include/asm-ia64/sal.h @@ -71,7 +71,9 @@ extern spinlock_t sal_lock; # define SAL_CALL_REENTRANT(result,args...) do { \ struct ia64_fpreg __ia64_scs_fr[6]; \ ia64_save_scratch_fpregs(__ia64_scs_fr); \ + preempt_disable(); \ __SAL_CALL(result, args); \ + preempt_enable(); \ ia64_load_scratch_fpregs(__ia64_scs_fr); \ } while (0) @@ -725,14 +727,16 @@ ia64_sal_mc_rendez (void) * Allow the OS to specify the interrupt number to be used by SAL to interrupt OS during * the machine check rendezvous sequence as well as the mechanism to wake up the * non-monarch processor at the end of machine check processing. + * Returns the complete ia64_sal_retval because some calls return more than just a status + * value. */ -static inline s64 +static inline struct ia64_sal_retval ia64_sal_mc_set_params (u64 param_type, u64 i_or_m, u64 i_or_m_val, u64 timeout, u64 rz_always) { struct ia64_sal_retval isrv; SAL_CALL(isrv, SAL_MC_SET_PARAMS, param_type, i_or_m, i_or_m_val, timeout, rz_always, 0, 0); - return isrv.status; + return isrv; } /* Read from PCI configuration space */ @@ -804,10 +808,12 @@ ia64_sal_update_pal (u64 param_buf, u64 scratch_buf, u64 scratch_buf_size, extern unsigned long sal_platform_features; +extern int (*salinfo_platform_oemdata)(const u8 *, u8 **, u64 *); + struct sal_ret_values { long r8; long r9; long r10; long r11; }; #endif /* __ASSEMBLY__ */ -#endif /* _ASM_IA64_PAL_H */ +#endif /* _ASM_IA64_SAL_H */ diff --git a/include/asm-ia64/spinlock.h b/include/asm-ia64/spinlock.h index d2bcd9b20784..45cdfc53a112 100644 --- a/include/asm-ia64/spinlock.h +++ b/include/asm-ia64/spinlock.h @@ -39,7 +39,7 @@ _raw_spin_lock (spinlock_t *lock) { register volatile unsigned int *ptr asm ("r31") = &lock->lock; -#if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4) +#if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 3) # ifdef CONFIG_ITANIUM /* don't use brl on Itanium... */ asm volatile ("{\n\t" diff --git a/include/asm-ia64/statfs.h b/include/asm-ia64/statfs.h index 053effc79ac9..f4fa9462842f 100644 --- a/include/asm-ia64/statfs.h +++ b/include/asm-ia64/statfs.h @@ -43,5 +43,18 @@ struct statfs64 { long f_spare[5]; }; +struct compat_statfs64 { + __u32 f_type; + __u32 f_bsize; + __u64 f_blocks; + __u64 f_bfree; + __u64 f_bavail; + __u64 f_files; + __u64 f_ffree; + __kernel_fsid_t f_fsid; + __u32 f_namelen; + __u32 f_frsize; + __u32 f_spare[5]; +} __attribute__((packed)); #endif /* _ASM_IA64_STATFS_H */ diff --git a/include/asm-ia64/system.h b/include/asm-ia64/system.h index c0a638402858..d6a5d7eb44f4 100644 --- a/include/asm-ia64/system.h +++ b/include/asm-ia64/system.h @@ -19,8 +19,11 @@ #include <asm/pal.h> #include <asm/percpu.h> -/* 0xa000000000000000 - 0xa000000000000000+PERCPU_PAGE_SIZE remain unmapped */ -#define GATE_ADDR (0xa000000000000000 + PERCPU_PAGE_SIZE) +#define GATE_ADDR (0xa000000000000000) +/* + * 0xa000000000000000+2*PERCPU_PAGE_SIZE + * - 0xa000000000000000+3*PERCPU_PAGE_SIZE remain unmapped (guard page) + */ #define KERNEL_START 0xa000000100000000 #define PERCPU_ADDR (-PERCPU_PAGE_SIZE) diff --git a/include/asm-ia64/uaccess.h b/include/asm-ia64/uaccess.h index 5154d4904d69..9bd9e3f0c48e 100644 --- a/include/asm-ia64/uaccess.h +++ b/include/asm-ia64/uaccess.h @@ -50,7 +50,7 @@ #define get_fs() (current_thread_info()->addr_limit) #define set_fs(x) (current_thread_info()->addr_limit = (x)) -#define segment_eq(a,b) ((a).seg == (b).seg) +#define segment_eq(a, b) ((a).seg == (b).seg) /* * When accessing user memory, we need to make sure the entire area really is in @@ -58,16 +58,16 @@ * address TASK_SIZE is never valid. We also need to make sure that the address doesn't * point inside the virtually mapped linear page table. */ -#define __access_ok(addr,size,segment) \ - likely(((unsigned long) (addr)) <= (segment).seg \ - && ((segment).seg == KERNEL_DS.seg \ - || REGION_OFFSET((unsigned long) (addr)) < RGN_MAP_LIMIT)) -#define access_ok(type,addr,size) __access_ok((addr),(size),get_fs()) +#define __access_ok(addr, size, segment) \ + (likely((unsigned long) (addr) <= (segment).seg) \ + && ((segment).seg == KERNEL_DS.seg \ + || likely(REGION_OFFSET((unsigned long) (addr)) < RGN_MAP_LIMIT))) +#define access_ok(type, addr, size) __access_ok((addr), (size), get_fs()) static inline int verify_area (int type, const void *addr, unsigned long size) { - return access_ok(type,addr,size) ? 0 : -EFAULT; + return access_ok(type, addr, size) ? 0 : -EFAULT; } /* @@ -78,292 +78,173 @@ verify_area (int type, const void *addr, unsigned long size) * (a) re-use the arguments for side effects (sizeof/typeof is ok) * (b) require any knowledge of processes at this stage */ -#define put_user(x,ptr) __put_user_check((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)),get_fs()) -#define get_user(x,ptr) __get_user_check((x),(ptr),sizeof(*(ptr)),get_fs()) +#define put_user(x, ptr) __put_user_check((__typeof__(*(ptr))) (x), (ptr), sizeof(*(ptr)), get_fs()) +#define get_user(x, ptr) __get_user_check((x), (ptr), sizeof(*(ptr)), get_fs()) /* * The "__xxx" versions do not do address space checking, useful when * doing multiple accesses to the same area (the programmer has to do the * checks by hand with "access_ok()") */ -#define __put_user(x,ptr) __put_user_nocheck((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr))) -#define __get_user(x,ptr) __get_user_nocheck((x),(ptr),sizeof(*(ptr))) +#define __put_user(x, ptr) __put_user_nocheck((__typeof__(*(ptr))) (x), (ptr), sizeof(*(ptr))) +#define __get_user(x, ptr) __get_user_nocheck((x), (ptr), sizeof(*(ptr))) #ifdef ASM_SUPPORTED - -extern void __get_user_unknown (void); - -#define __get_user_nocheck(x,ptr,size) \ -({ \ - register long __gu_err asm ("r8") = 0; \ - register long __gu_val asm ("r9") = 0; \ - switch (size) { \ - case 1: __get_user_8(ptr); break; \ - case 2: __get_user_16(ptr); break; \ - case 4: __get_user_32(ptr); break; \ - case 8: __get_user_64(ptr); break; \ - default: __get_user_unknown(); break; \ - } \ - (x) = (__typeof__(*(ptr))) __gu_val; \ - __gu_err; \ -}) - -#define __get_user_check(x,ptr,size,segment) \ -({ \ - register long __gu_err asm ("r8") = -EFAULT; \ - register long __gu_val asm ("r9") = 0; \ - const __typeof__(*(ptr)) *__gu_addr = (ptr); \ - if (__access_ok((long)__gu_addr,size,segment)) { \ - __gu_err = 0; \ - switch (size) { \ - case 1: __get_user_8(__gu_addr); break; \ - case 2: __get_user_16(__gu_addr); break; \ - case 4: __get_user_32(__gu_addr); break; \ - case 8: __get_user_64(__gu_addr); break; \ - default: __get_user_unknown(); break; \ - } \ - } \ - (x) = (__typeof__(*(ptr))) __gu_val; \ - __gu_err; \ -}) - -struct __large_struct { unsigned long buf[100]; }; -#define __m(x) (*(struct __large_struct *)(x)) + struct __large_struct { unsigned long buf[100]; }; +# define __m(x) (*(struct __large_struct *)(x)) /* We need to declare the __ex_table section before we can use it in .xdata. */ asm (".section \"__ex_table\", \"a\"\n\t.previous"); -#define __get_user_64(addr) \ - asm ("\n[1:]\tld8 %0=%2%P2\t// %0 and %1 get overwritten by exception handler\n" \ - "\t.xdata4 \"__ex_table\", 1b-., 1f-.+4\n" \ - "[1:]" \ - : "=r"(__gu_val), "=r"(__gu_err) : "m"(__m(addr)), "1"(__gu_err)); - -#define __get_user_32(addr) \ - asm ("\n[1:]\tld4 %0=%2%P2\t// %0 and %1 get overwritten by exception handler\n" \ +# define __get_user_size(val, addr, n, err) \ +do { \ + register long __gu_r8 asm ("r8") = 0; \ + register long __gu_r9 asm ("r9"); \ + asm ("\n[1:]\tld"#n" %0=%2%P2\t// %0 and %1 get overwritten by exception handler\n" \ "\t.xdata4 \"__ex_table\", 1b-., 1f-.+4\n" \ "[1:]" \ - : "=r"(__gu_val), "=r"(__gu_err) : "m"(__m(addr)), "1"(__gu_err)); - -#define __get_user_16(addr) \ - asm ("\n[1:]\tld2 %0=%2%P2\t// %0 and %1 get overwritten by exception handler\n" \ - "\t.xdata4 \"__ex_table\", 1b-., 1f-.+4\n" \ - "[1:]" \ - : "=r"(__gu_val), "=r"(__gu_err) : "m"(__m(addr)), "1"(__gu_err)); - -#define __get_user_8(addr) \ - asm ("\n[1:]\tld1 %0=%2%P2\t// %0 and %1 get overwritten by exception handler\n" \ - "\t.xdata4 \"__ex_table\", 1b-., 1f-.+4\n" \ - "[1:]" \ - : "=r"(__gu_val), "=r"(__gu_err) : "m"(__m(addr)), "1"(__gu_err)); - -extern void __put_user_unknown (void); - -#define __put_user_nocheck(x,ptr,size) \ -({ \ - register long __pu_err asm ("r8") = 0; \ - switch (size) { \ - case 1: __put_user_8(x,ptr); break; \ - case 2: __put_user_16(x,ptr); break; \ - case 4: __put_user_32(x,ptr); break; \ - case 8: __put_user_64(x,ptr); break; \ - default: __put_user_unknown(); break; \ - } \ - __pu_err; \ -}) - -#define __put_user_check(x,ptr,size,segment) \ -({ \ - register long __pu_err asm ("r8") = -EFAULT; \ - __typeof__(*(ptr)) *__pu_addr = (ptr); \ - if (__access_ok((long)__pu_addr,size,segment)) { \ - __pu_err = 0; \ - switch (size) { \ - case 1: __put_user_8(x,__pu_addr); break; \ - case 2: __put_user_16(x,__pu_addr); break; \ - case 4: __put_user_32(x,__pu_addr); break; \ - case 8: __put_user_64(x,__pu_addr); break; \ - default: __put_user_unknown(); break; \ - } \ - } \ - __pu_err; \ -}) + : "=r"(__gu_r9), "=r"(__gu_r8) : "m"(__m(addr)), "1"(__gu_r8)); \ + (err) = __gu_r8; \ + (val) = __gu_r9; \ +} while (0) /* - * The "__put_user_xx()" macros tell gcc they read from memory - * instead of writing: this is because they do not write to - * any memory gcc knows about, so there are no aliasing issues + * The "__put_user_size()" macro tells gcc it reads from memory instead of writing it. This + * is because they do not write to any memory gcc knows about, so there are no aliasing + * issues. */ -#define __put_user_64(x,addr) \ - asm volatile ( \ - "\n[1:]\tst8 %1=%r2%P1\t// %0 gets overwritten by exception handler\n" \ - "\t.xdata4 \"__ex_table\", 1b-., 1f-.\n" \ - "[1:]" \ - : "=r"(__pu_err) : "m"(__m(addr)), "rO"(x), "0"(__pu_err)) - -#define __put_user_32(x,addr) \ - asm volatile ( \ - "\n[1:]\tst4 %1=%r2%P1\t// %0 gets overwritten by exception handler\n" \ - "\t.xdata4 \"__ex_table\", 1b-., 1f-.\n" \ - "[1:]" \ - : "=r"(__pu_err) : "m"(__m(addr)), "rO"(x), "0"(__pu_err)) - -#define __put_user_16(x,addr) \ - asm volatile ( \ - "\n[1:]\tst2 %1=%r2%P1\t// %0 gets overwritten by exception handler\n" \ - "\t.xdata4 \"__ex_table\", 1b-., 1f-.\n" \ - "[1:]" \ - : "=r"(__pu_err) : "m"(__m(addr)), "rO"(x), "0"(__pu_err)) - -#define __put_user_8(x,addr) \ - asm volatile ( \ - "\n[1:]\tst1 %1=%r2%P1\t// %0 gets overwritten by exception handler\n" \ - "\t.xdata4 \"__ex_table\", 1b-., 1f-.\n" \ - "[1:]" \ - : "=r"(__pu_err) : "m"(__m(addr)), "rO"(x), "0"(__pu_err)) +# define __put_user_size(val, addr, n, err) \ +do { \ + register long __pu_r8 asm ("r8") = 0; \ + asm volatile ("\n[1:]\tst"#n" %1=%r2%P1\t// %0 gets overwritten by exception handler\n" \ + "\t.xdata4 \"__ex_table\", 1b-., 1f-.\n" \ + "[1:]" \ + : "=r"(__pu_r8) : "m"(__m(addr)), "rO"(val), "0"(__pu_r8)); \ + (err) = __pu_r8; \ +} while (0) #else /* !ASM_SUPPORTED */ - -#define RELOC_TYPE 2 /* ip-rel */ - -#define __put_user_xx(val, addr, size, err) \ - __st_user("__ex_table", (unsigned long) addr, size, RELOC_TYPE, (unsigned long) (val)); \ - (err) = ia64_getreg(_IA64_REG_R8); - -#define __get_user_xx(val, addr, size, err) \ - __ld_user("__ex_table", (unsigned long) addr, size, RELOC_TYPE); \ - (err) = ia64_getreg(_IA64_REG_R8); \ - (val) = ia64_getreg(_IA64_REG_R9); +# define RELOC_TYPE 2 /* ip-rel */ +# define __get_user_size(val, addr, n, err) \ +do { \ + __ld_user("__ex_table", (unsigned long) addr, n, RELOC_TYPE); \ + (err) = ia64_getreg(_IA64_REG_R8); \ + (val) = ia64_getreg(_IA64_REG_R9); \ +} while (0) +# define __put_user_size(val, addr, n, err) \ +do { \ + __st_user("__ex_table", (unsigned long) addr, n, RELOC_TYPE, (unsigned long) (val)); \ + (err) = ia64_getreg(_IA64_REG_R8); \ +} while (0) +#endif /* !ASM_SUPPORTED */ extern void __get_user_unknown (void); -#define __get_user_nocheck(x, ptr, size) \ -({ \ - register long __gu_err = 0; \ - register long __gu_val = 0; \ - const __typeof__(*(ptr)) *__gu_addr = (ptr); \ - switch (size) { \ - case 1: case 2: case 4: case 8: \ - __get_user_xx(__gu_val, __gu_addr, size, __gu_err); \ - break; \ - default: \ - __get_user_unknown(); \ - break; \ - } \ - (x) = (__typeof__(*(ptr))) __gu_val; \ - __gu_err; \ +/* + * Evaluating arguments X, PTR, SIZE, and SEGMENT may involve subroutine-calls, which + * could clobber r8 and r9 (among others). Thus, be careful not to evaluate it while + * using r8/r9. + */ +#define __do_get_user(check, x, ptr, size, segment) \ +({ \ + const __typeof__(*(ptr)) *__gu_ptr = (ptr); \ + __typeof__ (size) __gu_size = (size); \ + long __gu_err = -EFAULT, __gu_val = 0; \ + \ + if (!check || __access_ok((long) __gu_ptr, size, segment)) \ + switch (__gu_size) { \ + case 1: __get_user_size(__gu_val, __gu_ptr, 1, __gu_err); break; \ + case 2: __get_user_size(__gu_val, __gu_ptr, 2, __gu_err); break; \ + case 4: __get_user_size(__gu_val, __gu_ptr, 4, __gu_err); break; \ + case 8: __get_user_size(__gu_val, __gu_ptr, 8, __gu_err); break; \ + default: __get_user_unknown(); break; \ + } \ + (x) = (__typeof__(*(__gu_ptr))) __gu_val; \ + __gu_err; \ }) -#define __get_user_check(x,ptr,size,segment) \ -({ \ - register long __gu_err = -EFAULT; \ - register long __gu_val = 0; \ - const __typeof__(*(ptr)) *__gu_addr = (ptr); \ - if (__access_ok((long) __gu_addr, size, segment)) { \ - switch (size) { \ - case 1: case 2: case 4: case 8: \ - __get_user_xx(__gu_val, __gu_addr, size, __gu_err); \ - break; \ - default: \ - __get_user_unknown(); break; \ - } \ - } \ - (x) = (__typeof__(*(ptr))) __gu_val; \ - __gu_err; \ -}) +#define __get_user_nocheck(x, ptr, size) __do_get_user(0, x, ptr, size, KERNEL_DS) +#define __get_user_check(x, ptr, size, segment) __do_get_user(1, x, ptr, size, segment) extern void __put_user_unknown (void); -#define __put_user_nocheck(x, ptr, size) \ -({ \ - int __pu_err = 0; \ - __typeof__(*(ptr)) *__pu_addr = (ptr); \ - switch (size) { \ - case 1: case 2: case 4: case 8: \ - __put_user_xx(x, __pu_addr, size, __pu_err); \ - break; \ - default: \ - __put_user_unknown(); break; \ - } \ - __pu_err; \ -}) - -#define __put_user_check(x,ptr,size,segment) \ -({ \ - register long __pu_err = -EFAULT; \ - __typeof__(*(ptr)) *__pu_addr = (ptr); \ - if (__access_ok((long)__pu_addr,size,segment)) { \ - switch (size) { \ - case 1: case 2: case 4: case 8: \ - __put_user_xx(x,__pu_addr, size, __pu_err); \ - break; \ - default: \ - __put_user_unknown(); break; \ - } \ - } \ - __pu_err; \ +/* + * Evaluating arguments X, PTR, SIZE, and SEGMENT may involve subroutine-calls, which + * could clobber r8 (among others). Thus, be careful not to evaluate them while using r8. + */ +#define __do_put_user(check, x, ptr, size, segment) \ +({ \ + __typeof__ (x) __pu_x = (x); \ + __typeof__ (*(ptr)) *__pu_ptr = (ptr); \ + __typeof__ (size) __pu_size = (size); \ + long __pu_err = -EFAULT; \ + \ + if (!check || __access_ok((long) __pu_ptr, __pu_size, segment)) \ + switch (__pu_size) { \ + case 1: __put_user_size(__pu_x, __pu_ptr, 1, __pu_err); break; \ + case 2: __put_user_size(__pu_x, __pu_ptr, 2, __pu_err); break; \ + case 4: __put_user_size(__pu_x, __pu_ptr, 4, __pu_err); break; \ + case 8: __put_user_size(__pu_x, __pu_ptr, 8, __pu_err); break; \ + default: __put_user_unknown(); break; \ + } \ + __pu_err; \ }) -#endif /* !ASM_SUPPORTED */ +#define __put_user_nocheck(x, ptr, size) __do_put_user(0, x, ptr, size, KERNEL_DS) +#define __put_user_check(x, ptr, size, segment) __do_put_user(1, x, ptr, size, segment) /* * Complex access routines */ extern unsigned long __copy_user (void *to, const void *from, unsigned long count); -#define __copy_to_user(to,from,n) __copy_user((to), (from), (n)) -#define __copy_from_user(to,from,n) __copy_user((to), (from), (n)) - -#define copy_to_user(to,from,n) __copy_tofrom_user((to), (from), (n), 1) -#define copy_from_user(to,from,n) __copy_tofrom_user((to), (from), (n), 0) - -#define __copy_tofrom_user(to,from,n,check_to) \ -({ \ - void *__cu_to = (to); \ - const void *__cu_from = (from); \ - long __cu_len = (n); \ - \ - if (__access_ok((long) ((check_to) ? __cu_to : __cu_from), __cu_len, get_fs())) { \ - __cu_len = __copy_user(__cu_to, __cu_from, __cu_len); \ - } \ - __cu_len; \ +#define __copy_to_user(to, from, n) __copy_user((to), (from), (n)) +#define __copy_from_user(to, from, n) __copy_user((to), (from), (n)) + +#define copy_to_user(to, from, n) __copy_tofrom_user((to), (from), (n), 1) +#define copy_from_user(to, from, n) __copy_tofrom_user((to), (from), (n), 0) + +#define __copy_tofrom_user(to, from, n, check_to) \ +({ \ + void *__cu_to = (to); \ + const void *__cu_from = (from); \ + long __cu_len = (n); \ + \ + if (__access_ok((long) ((check_to) ? __cu_to : __cu_from), __cu_len, get_fs())) \ + __cu_len = __copy_user(__cu_to, __cu_from, __cu_len); \ + __cu_len; \ }) -#define __copy_in_user(to, from, size) \ - __copy_user((to), (from), (size)) +#define __copy_in_user(to, from, size) __copy_user((to), (from), (size)) static inline unsigned long copy_in_user (void *to, const void *from, unsigned long n) { - if (likely(access_ok(VERIFY_READ, from, n) && - access_ok(VERIFY_WRITE, to, n))) + if (likely(access_ok(VERIFY_READ, from, n) && access_ok(VERIFY_WRITE, to, n))) n = __copy_user(to, from, n); return n; } extern unsigned long __do_clear_user (void *, unsigned long); -#define __clear_user(to,n) \ -({ \ - __do_clear_user(to,n); \ -}) +#define __clear_user(to, n) __do_clear_user(to, n) -#define clear_user(to,n) \ +#define clear_user(to, n) \ ({ \ unsigned long __cu_len = (n); \ - if (__access_ok((long) to, __cu_len, get_fs())) { \ + if (__access_ok((long) to, __cu_len, get_fs())) \ __cu_len = __do_clear_user(to, __cu_len); \ - } \ __cu_len; \ }) -/* Returns: -EFAULT if exception before terminator, N if the entire - buffer filled, else strlen. */ - +/* + * Returns: -EFAULT if exception before terminator, N if the entire buffer filled, else + * strlen. + */ extern long __strncpy_from_user (char *to, const char *from, long to_len); -#define strncpy_from_user(to,from,n) \ +#define strncpy_from_user(to, from, n) \ ({ \ const char * __sfu_from = (from); \ long __sfu_ret = -EFAULT; \ diff --git a/include/asm-m68k/cpumask.h b/include/asm-m68k/cpumask.h new file mode 100644 index 000000000000..b12450332e19 --- /dev/null +++ b/include/asm-m68k/cpumask.h @@ -0,0 +1,6 @@ +#ifndef _ASM_M68K_CPUMASK_H +#define _ASM_M68K_CPUMASK_H + +#include <asm-generic/cpumask.h> + +#endif /* _ASM_M68K_CPUMASK_H */ diff --git a/include/asm-m68knommu/cpumask.h b/include/asm-m68knommu/cpumask.h new file mode 100644 index 000000000000..cd9cc78af838 --- /dev/null +++ b/include/asm-m68knommu/cpumask.h @@ -0,0 +1,6 @@ +#ifndef _ASM_M68KNOMMU_CPUMASK_H +#define _ASM_M68KNOMMU_CPUMASK_H + +#include <asm-generic/cpumask.h> + +#endif /* _ASM_M68KNOMMU_CPUMASK_H */ diff --git a/include/asm-mips/cpumask.h b/include/asm-mips/cpumask.h new file mode 100644 index 000000000000..cf562af10d6f --- /dev/null +++ b/include/asm-mips/cpumask.h @@ -0,0 +1,6 @@ +#ifndef _ASM_MIPS_CPUMASK_H +#define _ASM_MIPS_CPUMASK_H + +#include <asm-generic/cpumask.h> + +#endif /* _ASM_MIPS_CPUMASK_H */ diff --git a/include/asm-mips/statfs.h b/include/asm-mips/statfs.h index 58a8999eef31..ef15465abdf9 100644 --- a/include/asm-mips/statfs.h +++ b/include/asm-mips/statfs.h @@ -75,6 +75,20 @@ struct statfs64 { /* Same as struct statfs */ long f_spare[6]; }; +struct compat_statfs64 { + __u32 f_type; + __u32 f_bsize; + __u64 f_blocks; + __u64 f_bfree; + __u64 f_bavail; + __u64 f_files; + __u64 f_ffree; + __kernel_fsid_t f_fsid; + __u32 f_namelen; + __u32 f_frsize; + __u32 f_spare[5]; +}; + #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ #endif /* _ASM_STATFS_H */ diff --git a/include/asm-parisc/cpumask.h b/include/asm-parisc/cpumask.h new file mode 100644 index 000000000000..27f4f17fb15a --- /dev/null +++ b/include/asm-parisc/cpumask.h @@ -0,0 +1,6 @@ +#ifndef _ASM_PARISC_CPUMASK_H +#define _ASM_PARISC_CPUMASK_H + +#include <asm-generic/cpumask.h> + +#endif /* _ASM_PARISC_CPUMASK_H */ diff --git a/include/asm-parisc/dma-mapping.h b/include/asm-parisc/dma-mapping.h index 3c7a4901537e..189f86480ef9 100644 --- a/include/asm-parisc/dma-mapping.h +++ b/include/asm-parisc/dma-mapping.h @@ -5,9 +5,7 @@ #include <linux/config.h> #include <asm/cacheflush.h> -/* -** See Documentation/DMA-mapping.txt -*/ +/* See Documentation/DMA-mapping.txt */ struct hppa_dma_ops { int (*dma_supported)(struct device *dev, u64 mask); void *(*alloc_consistent)(struct device *dev, size_t size, dma_addr_t *iova, int flag); @@ -208,15 +206,13 @@ int ccio_request_resource(const struct parisc_device *dev, struct resource *res); int ccio_allocate_resource(const struct parisc_device *dev, struct resource *res, unsigned long size, - unsigned long min, unsigned long max, unsigned long align, - void (*alignf)(void *, struct resource *, unsigned long, unsigned long), - void *alignf_data); + unsigned long min, unsigned long max, unsigned long align); #else /* !CONFIG_IOMMU_CCIO */ #define ccio_get_iommu(dev) NULL #define ccio_request_resource(dev, res) request_resource(&iomem_resource, res) -#define ccio_allocate_resource(dev, res, size, min, max, align, alignf, data) \ +#define ccio_allocate_resource(dev, res, size, min, max, align) \ allocate_resource(&iomem_resource, res, size, min, max, \ - align, alignf, data) + align, NULL, NULL) #endif /* !CONFIG_IOMMU_CCIO */ #ifdef CONFIG_IOMMU_SBA diff --git a/include/asm-parisc/ioctl.h b/include/asm-parisc/ioctl.h index 75dc3e956457..95dd7871f821 100644 --- a/include/asm-parisc/ioctl.h +++ b/include/asm-parisc/ioctl.h @@ -45,7 +45,7 @@ ((size) << _IOC_SIZESHIFT)) /* provoke compile error for invalid uses of size argument */ -extern int __invalid_size_argument_for_IOC; +extern unsigned int __invalid_size_argument_for_IOC; #define _IOC_TYPECHECK(t) \ ((sizeof(t) == sizeof(t[1]) && \ sizeof(t) < (1 << _IOC_SIZEBITS)) ? \ diff --git a/include/asm-parisc/statfs.h b/include/asm-parisc/statfs.h index e8c8169d5d7f..a52d8f93f05c 100644 --- a/include/asm-parisc/statfs.h +++ b/include/asm-parisc/statfs.h @@ -41,4 +41,18 @@ struct statfs64 { long f_spare[5]; }; +struct compat_statfs64 { + __u32 f_type; + __u32 f_bsize; + __u64 f_blocks; + __u64 f_bfree; + __u64 f_bavail; + __u64 f_files; + __u64 f_ffree; + __kernel_fsid_t f_fsid; + __u32 f_namelen; + __u32 f_frsize; + __u32 f_spare[5]; +}; + #endif diff --git a/include/asm-parisc/uaccess.h b/include/asm-parisc/uaccess.h index cc9e311cabd1..66510fd432f7 100644 --- a/include/asm-parisc/uaccess.h +++ b/include/asm-parisc/uaccess.h @@ -40,10 +40,10 @@ extern int __put_user_bad(void); #define get_user __get_user #if BITS_PER_LONG == 32 -#define LDD_KERNEL(ptr) __get_kernel_bad(); -#define LDD_USER(ptr) __get_user_bad(); -#define STD_KERNEL(x, ptr) __put_kernel_asm64((u32)x,ptr) -#define STD_USER(x, ptr) __put_user_asm64((u32)x,ptr) +#define LDD_KERNEL(ptr) __get_kernel_bad(); +#define LDD_USER(ptr) __get_user_bad(); +#define STD_KERNEL(x, ptr) __put_kernel_asm64(x,ptr) +#define STD_USER(x, ptr) __put_user_asm64(x,ptr) #else #define LDD_KERNEL(ptr) __get_kernel_asm("ldd",ptr) #define LDD_USER(ptr) __get_user_asm("ldd",ptr) @@ -256,11 +256,12 @@ static inline void __put_user_asm64(u64 x, void *ptr) * Complex access routines -- external declarations */ -extern unsigned long lcopy_to_user(void *, const void *, unsigned long); -extern unsigned long lcopy_from_user(void *, const void *, unsigned long); -extern long lstrncpy_from_user(char *, const char *, long); -extern unsigned lclear_user(void *,unsigned long); -extern long lstrnlen_user(const char *,long); +extern unsigned long lcopy_to_user(void __user *, const void *, unsigned long); +extern unsigned long lcopy_from_user(void *, const void __user *, unsigned long); +extern unsigned long lcopy_in_user(void __user *, const void __user *, unsigned long); +extern long lstrncpy_from_user(char *, const char __user *, long); +extern unsigned lclear_user(void __user *,unsigned long); +extern long lstrnlen_user(const char __user *,long); /* * Complex access routines -- macros @@ -276,5 +277,7 @@ extern long lstrnlen_user(const char *,long); #define __copy_from_user lcopy_from_user #define copy_to_user lcopy_to_user #define __copy_to_user lcopy_to_user +#define copy_in_user lcopy_in_user +#define __copy_in_user lcopy_in_user #endif /* __PARISC_UACCESS_H */ diff --git a/include/asm-parisc/ucontext.h b/include/asm-parisc/ucontext.h index f2e590499832..6c8883e4b0bd 100644 --- a/include/asm-parisc/ucontext.h +++ b/include/asm-parisc/ucontext.h @@ -1,12 +1,12 @@ -#ifndef _ASMPARISC_UCONTEXT_H -#define _ASMPARISC_UCONTEXT_H +#ifndef _ASM_PARISC_UCONTEXT_H +#define _ASM_PARISC_UCONTEXT_H struct ucontext { - unsigned long uc_flags; + unsigned int uc_flags; struct ucontext *uc_link; stack_t uc_stack; struct sigcontext uc_mcontext; sigset_t uc_sigmask; /* mask last for extensibility */ }; -#endif /* !_ASMPARISC_UCONTEXT_H */ +#endif /* !_ASM_PARISC_UCONTEXT_H */ diff --git a/include/asm-parisc/unistd.h b/include/asm-parisc/unistd.h index 410a871f910c..88e4343c4b94 100644 --- a/include/asm-parisc/unistd.h +++ b/include/asm-parisc/unistd.h @@ -490,7 +490,7 @@ */ #define __NR_Linux 0 -#define __NR_syscall (__NR_Linux + 0) +#define __NR_restart_syscall (__NR_Linux + 0) #define __NR_exit (__NR_Linux + 1) #define __NR_fork (__NR_Linux + 2) #define __NR_read (__NR_Linux + 3) diff --git a/include/asm-ppc/cpumask.h b/include/asm-ppc/cpumask.h new file mode 100644 index 000000000000..30901089dd41 --- /dev/null +++ b/include/asm-ppc/cpumask.h @@ -0,0 +1,6 @@ +#ifndef _ASM_PPC_CPUMASK_H +#define _ASM_PPC_CPUMASK_H + +#include <asm-generic/cpumask.h> + +#endif /* _ASM_PPC_CPUMASK_H */ diff --git a/include/asm-ppc/highmem.h b/include/asm-ppc/highmem.h index a4aac1adf9f3..c13b4e495519 100644 --- a/include/asm-ppc/highmem.h +++ b/include/asm-ppc/highmem.h @@ -81,6 +81,7 @@ static inline void *kmap_atomic(struct page *page, enum km_type type) unsigned int idx; unsigned long vaddr; + /* even !CONFIG_PREEMPT needs this, for in_atomic in do_page_fault */ inc_preempt_count(); if (page < highmem_start_page) return page_address(page); @@ -105,6 +106,7 @@ static inline void kunmap_atomic(void *kvaddr, enum km_type type) if (vaddr < KMAP_FIX_BEGIN) { // FIXME dec_preempt_count(); + preempt_check_resched(); return; } @@ -119,6 +121,7 @@ static inline void kunmap_atomic(void *kvaddr, enum km_type type) flush_tlb_page(0, vaddr); #endif dec_preempt_count(); + preempt_check_resched(); } static inline struct page *kmap_atomic_to_page(void *ptr) diff --git a/include/asm-ppc/ioctl.h b/include/asm-ppc/ioctl.h index 8d8cb7ec4f01..93c6acfdd0fd 100644 --- a/include/asm-ppc/ioctl.h +++ b/include/asm-ppc/ioctl.h @@ -38,7 +38,7 @@ ((size) << _IOC_SIZESHIFT)) /* provoke compile error for invalid uses of size argument */ -extern int __invalid_size_argument_for_IOC; +extern unsigned int __invalid_size_argument_for_IOC; #define _IOC_TYPECHECK(t) \ ((sizeof(t) == sizeof(t[1]) && \ sizeof(t) < (1 << _IOC_SIZEBITS)) ? \ diff --git a/include/asm-ppc64/cpumask.h b/include/asm-ppc64/cpumask.h new file mode 100644 index 000000000000..0914511db218 --- /dev/null +++ b/include/asm-ppc64/cpumask.h @@ -0,0 +1,6 @@ +#ifndef _ASM_PPC64_CPUMASK_H +#define _ASM_PPC64_CPUMASK_H + +#include <asm-generic/cpumask.h> + +#endif /* _ASM_PPC64_CPUMASK_H */ diff --git a/include/asm-ppc64/ioctl.h b/include/asm-ppc64/ioctl.h index b639b83183bf..42b8c5da7fbc 100644 --- a/include/asm-ppc64/ioctl.h +++ b/include/asm-ppc64/ioctl.h @@ -43,7 +43,7 @@ ((size) << _IOC_SIZESHIFT)) /* provoke compile error for invalid uses of size argument */ -extern int __invalid_size_argument_for_IOC; +extern unsigned int __invalid_size_argument_for_IOC; #define _IOC_TYPECHECK(t) \ ((sizeof(t) == sizeof(t[1]) && \ sizeof(t) < (1 << _IOC_SIZEBITS)) ? \ diff --git a/include/asm-ppc64/page.h b/include/asm-ppc64/page.h index 29e5738f7180..5674054309ef 100644 --- a/include/asm-ppc64/page.h +++ b/include/asm-ppc64/page.h @@ -41,6 +41,7 @@ ( ((addr > (TASK_HPAGE_BASE-len)) && (addr < TASK_HPAGE_END)) || \ ((current->mm->context & CONTEXT_LOW_HPAGES) && \ (addr > (TASK_HPAGE_BASE_32-len)) && (addr < TASK_HPAGE_END_32)) ) +#define hugetlb_free_pgtables free_pgtables #define HAVE_ARCH_HUGETLB_UNMAPPED_AREA #define in_hugepage_area(context, addr) \ diff --git a/include/asm-ppc64/statfs.h b/include/asm-ppc64/statfs.h index 7cce64bf7ee0..3c985e5246a7 100644 --- a/include/asm-ppc64/statfs.h +++ b/include/asm-ppc64/statfs.h @@ -44,4 +44,18 @@ struct statfs64 { long f_spare[5]; }; +struct compat_statfs64 { + __u32 f_type; + __u32 f_bsize; + __u64 f_blocks; + __u64 f_bfree; + __u64 f_bavail; + __u64 f_files; + __u64 f_ffree; + __kernel_fsid_t f_fsid; + __u32 f_namelen; + __u32 f_frsize; + __u32 f_spare[5]; +}; + #endif /* _PPC64_STATFS_H */ diff --git a/include/asm-s390/ccwdev.h b/include/asm-s390/ccwdev.h index 25dabfd2a596..f447ac2d193e 100644 --- a/include/asm-s390/ccwdev.h +++ b/include/asm-s390/ccwdev.h @@ -69,7 +69,7 @@ ccw_device_id_match(const struct ccw_device_id *array, /* The struct ccw device is our replacement for the globally accessible * ioinfo array. ioinfo will mutate into a subchannel device later. * - * Reference: Documentation/driver-model.txt */ + * Reference: Documentation/s390/driver-model.txt */ struct ccw_device { spinlock_t *ccwlock; struct ccw_device_private *private; /* cio private information */ diff --git a/include/asm-s390/cpumask.h b/include/asm-s390/cpumask.h new file mode 100644 index 000000000000..4deef1641ec6 --- /dev/null +++ b/include/asm-s390/cpumask.h @@ -0,0 +1,6 @@ +#ifndef _ASM_S390_CPUMASK_H +#define _ASM_S390_CPUMASK_H + +#include <asm-generic/cpumask.h> + +#endif /* _ASM_S390_CPUMASK_H */ diff --git a/include/asm-s390/statfs.h b/include/asm-s390/statfs.h index f9edb541f99f..099a45579190 100644 --- a/include/asm-s390/statfs.h +++ b/include/asm-s390/statfs.h @@ -53,5 +53,19 @@ struct statfs64 { int f_spare[5]; }; +struct compat_statfs64 { + __u32 f_type; + __u32 f_bsize; + __u64 f_blocks; + __u64 f_bfree; + __u64 f_bavail; + __u64 f_files; + __u64 f_ffree; + __kernel_fsid_t f_fsid; + __u32 f_namelen; + __u32 f_frsize; + __u32 f_spare[5]; +}; + #endif /* __s390x__ */ #endif diff --git a/include/asm-sh/cpumask.h b/include/asm-sh/cpumask.h new file mode 100644 index 000000000000..deaf3bb85d7e --- /dev/null +++ b/include/asm-sh/cpumask.h @@ -0,0 +1,6 @@ +#ifndef _ASM_SH_CPUMASK_H +#define _ASM_SH_CPUMASK_H + +#include <asm-generic/cpumask.h> + +#endif /* _ASM_SH_CPUMASK_H */ diff --git a/include/asm-sparc/cpumask.h b/include/asm-sparc/cpumask.h new file mode 100644 index 000000000000..272f31de7bc1 --- /dev/null +++ b/include/asm-sparc/cpumask.h @@ -0,0 +1,6 @@ +#ifndef _ASM_SPARC_CPUMASK_H +#define _ASM_SPARC_CPUMASK_H + +#include <asm-generic/cpumask.h> + +#endif /* _ASM_SPARC_CPUMASK_H */ diff --git a/include/asm-sparc/processor.h b/include/asm-sparc/processor.h index 2ae0e6bb9a53..b0c5a0d09204 100644 --- a/include/asm-sparc/processor.h +++ b/include/asm-sparc/processor.h @@ -56,19 +56,12 @@ typedef struct { /* The Sparc processor specific thread struct. */ struct thread_struct { struct pt_regs *kregs; + unsigned int _pad1; /* Special child fork kpsr/kwim values. */ unsigned long fork_kpsr __attribute__ ((aligned (8))); unsigned long fork_kwim; - /* A place to store user windows and stack pointers - * when the stack needs inspection. - */ -#define NSWINS 8 - struct reg_window reg_window[NSWINS] __attribute__ ((aligned (8))); - unsigned long rwbuf_stkptrs[NSWINS] __attribute__ ((aligned (8))); - unsigned long w_saved; - /* Floating point regs */ unsigned long float_regs[32] __attribute__ ((aligned (8))); unsigned long fsr; @@ -78,23 +71,16 @@ struct thread_struct { mm_segment_t current_ds; struct exec core_exec; /* just what it says. */ int new_signal; - atomic_t refcount; /* used for sun4c only */ }; #define SPARC_FLAG_KTHREAD 0x1 /* task is a kernel thread */ #define SPARC_FLAG_UNALIGNED 0x2 /* is allowed to do unaligned accesses */ #define INIT_THREAD { \ -/* kregs, */ \ - 0, \ +/* kregs, _pad1, */ \ + 0, 0, \ /* fork_kpsr, fork_kwim */ \ 0, 0, \ -/* reg_window */ \ -{ { { 0, }, { 0, } }, }, \ -/* rwbuf_stkptrs */ \ -{ 0, 0, 0, 0, 0, 0, 0, 0, }, \ -/* w_saved */ \ - 0, \ /* FPU regs */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, \ /* FPU status, FPU qdepth, FPU queue */ \ diff --git a/include/asm-sparc/thread_info.h b/include/asm-sparc/thread_info.h index 94ef1063ed48..56296b5af7b1 100644 --- a/include/asm-sparc/thread_info.h +++ b/include/asm-sparc/thread_info.h @@ -16,16 +16,14 @@ #ifndef __ASSEMBLY__ #include <asm/btfixup.h> +#include <asm/ptrace.h> /* * Low level task data. * - * If you change this, change the TI_* offsets below to match. XXX check_asm. - * - * The uwinmask is a first class citizen among w_saved and friends. - * XXX Is this a good idea? wof.S/wuf.S have to use w_saved anyway, - * so they waste a register on current, and an ld on fetching it. + * If you change this, change the TI_* offsets below to match. */ +#define NSWINS 8 struct thread_info { unsigned long uwinmask; struct task_struct *task; /* main task structure */ @@ -43,6 +41,13 @@ struct thread_info { unsigned long kpsr; unsigned long kwim; + /* A place to store user windows and stack pointers + * when the stack needs inspection. + */ + struct reg_window reg_window[NSWINS]; /* align for ldd! */ + unsigned long rwbuf_stkptrs[NSWINS]; + unsigned long w_saved; + struct restart_block restart_block; }; @@ -100,6 +105,7 @@ BTFIXUPDEF_CALL(void, free_thread_info, struct thread_info *) /* * Offsets in thread_info structure, used in assembly code + * The "#define REGWIN_SZ 0x40" was abolished, so no multiplications. */ #define TI_UWINMASK 0x00 /* uwinmask */ #define TI_TASK 0x04 @@ -113,7 +119,10 @@ BTFIXUPDEF_CALL(void, free_thread_info, struct thread_info *) #define TI_KPC 0x24 /* kpc (ldd'ed with kpc) */ #define TI_KPSR 0x28 /* kpsr */ #define TI_KWIM 0x2c /* kwim (ldd'ed with kpsr) */ -#define TI_RESTART_BLOCK 0x30 +#define TI_REG_WINDOW 0x30 +#define TI_RWIN_SPTRS 0x230 +#define TI_W_SAVED 0x250 +/* #define TI_RESTART_BLOCK 0x25n */ /* Nobody cares */ #define PREEMPT_ACTIVE 0x4000000 diff --git a/include/asm-sparc/winmacro.h b/include/asm-sparc/winmacro.h index 7fc9169b90b6..649081568961 100644 --- a/include/asm-sparc/winmacro.h +++ b/include/asm-sparc/winmacro.h @@ -9,7 +9,6 @@ #include <linux/config.h> #include <asm/ptrace.h> -#include <asm/psr.h> /* Store the register window onto the 8-byte aligned area starting * at %reg. It might be %sp, it might not, we don't care. @@ -91,18 +90,18 @@ STORE_PT_INS(base_reg) #define SAVE_BOLIXED_USER_STACK(cur_reg, scratch) \ - ld [%cur_reg + AOFF_task_thread + AOFF_thread_w_saved], %scratch; \ + ld [%cur_reg + TI_W_SAVED], %scratch; \ sll %scratch, 2, %scratch; \ add %scratch, %cur_reg, %scratch; \ - st %sp, [%scratch + AOFF_task_thread + AOFF_thread_rwbuf_stkptrs]; \ + st %sp, [%scratch + TI_RWIN_SPTRS]; \ sub %scratch, %cur_reg, %scratch; \ sll %scratch, 4, %scratch; \ add %scratch, %cur_reg, %scratch; \ - STORE_WINDOW(scratch + AOFF_task_thread + AOFF_thread_reg_window); \ + STORE_WINDOW(scratch + TI_REG_WINDOW); \ sub %scratch, %cur_reg, %scratch; \ srl %scratch, 6, %scratch; \ add %scratch, 1, %scratch; \ - st %scratch, [%cur_reg + AOFF_task_thread + AOFF_thread_w_saved]; + st %scratch, [%cur_reg + TI_W_SAVED]; #ifdef CONFIG_SMP #define LOAD_CURRENT4M(dest_reg, idreg) \ diff --git a/include/asm-sparc64/cpumask.h b/include/asm-sparc64/cpumask.h new file mode 100644 index 000000000000..ee60cae3dcd1 --- /dev/null +++ b/include/asm-sparc64/cpumask.h @@ -0,0 +1,6 @@ +#ifndef _ASM_SPARC64_CPUMASK_H +#define _ASM_SPARC64_CPUMASK_H + +#include <asm-generic/cpumask.h> + +#endif /* _ASM_SPARC64_CPUMASK_H */ diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h index 289046945682..3cb8a2b3c7e8 100644 --- a/include/asm-sparc64/pgtable.h +++ b/include/asm-sparc64/pgtable.h @@ -145,9 +145,9 @@ #if defined(CONFIG_HUGETLB_PAGE_SIZE_4MB) #define _PAGE_SZHUGE _PAGE_SZ4MB #elif defined(CONFIG_HUGETLB_PAGE_SIZE_512K) -#define _PAGE_SZHUGE _PAGE_512K +#define _PAGE_SZHUGE _PAGE_SZ512K #elif defined(CONFIG_HUGETLB_PAGE_SIZE_64K) -#define _PAGE_SZHUGE _PAGE_64K +#define _PAGE_SZHUGE _PAGE_SZ64K #endif #define _PAGE_CACHE (_PAGE_CP | _PAGE_CV) diff --git a/include/asm-sparc64/statfs.h b/include/asm-sparc64/statfs.h index 5985f1901cfc..185b6c481b24 100644 --- a/include/asm-sparc64/statfs.h +++ b/include/asm-sparc64/statfs.h @@ -38,4 +38,18 @@ struct statfs64 { long f_spare[5]; }; +struct compat_statfs64 { + __u32 f_type; + __u32 f_bsize; + __u64 f_blocks; + __u64 f_bfree; + __u64 f_bavail; + __u64 f_files; + __u64 f_ffree; + __kernel_fsid_t f_fsid; + __u32 f_namelen; + __u32 f_frsize; + __u32 f_spare[5]; +}; + #endif diff --git a/include/asm-um/cpumask.h b/include/asm-um/cpumask.h new file mode 100644 index 000000000000..90f0d003d74e --- /dev/null +++ b/include/asm-um/cpumask.h @@ -0,0 +1,6 @@ +#ifndef _ASM_UM_CPUMASK_H +#define _ASM_UM_CPUMASK_H + +#include <asm-generic/cpumask.h> + +#endif /* _ASM_UM_CPUMASK_H */ diff --git a/include/asm-v850/cpumask.h b/include/asm-v850/cpumask.h new file mode 100644 index 000000000000..09aebd0c28d7 --- /dev/null +++ b/include/asm-v850/cpumask.h @@ -0,0 +1,6 @@ +#ifndef _ASM_V850_CPUMASK_H +#define _ASM_V850_CPUMASK_H + +#include <asm-generic/cpumask.h> + +#endif /* _ASM_V850_CPUMASK_H */ diff --git a/include/asm-x86_64/a.out.h b/include/asm-x86_64/a.out.h index 83c98f8e801d..5c89a5f7046d 100644 --- a/include/asm-x86_64/a.out.h +++ b/include/asm-x86_64/a.out.h @@ -1,13 +1,11 @@ #ifndef __X8664_A_OUT_H__ #define __X8664_A_OUT_H__ - -/* Note: a.out is not supported in 64bit mode. This is just here to - still let some old things compile. */ +/* 32bit a.out */ struct exec { - unsigned long a_info; /* Use macros N_MAGIC, etc for access */ + unsigned int a_info; /* Use macros N_MAGIC, etc for access */ unsigned a_text; /* length of text, in bytes */ unsigned a_data; /* length of data, in bytes */ unsigned a_bss; /* length of uninitialized data area for file, in bytes */ @@ -23,7 +21,7 @@ struct exec #ifdef __KERNEL__ -#define STACK_TOP TASK_SIZE +#define STACK_TOP 0xc0000000 #endif diff --git a/include/asm-x86_64/acpi.h b/include/asm-x86_64/acpi.h index c25843f32951..5fb0a7f75daf 100644 --- a/include/asm-x86_64/acpi.h +++ b/include/asm-x86_64/acpi.h @@ -52,40 +52,36 @@ #define ACPI_ENABLE_IRQS() local_irq_enable() #define ACPI_FLUSH_CPU_CACHE() wbinvd() -/* - * A brief explanation as GNU inline assembly is a bit hairy - * %0 is the output parameter in RAX ("=a") - * %1 and %2 are the input parameters in RCX ("c") - * and an immediate value ("i") respectively - * All actual register references are preceded with "%%" as in "%%edx" - * Immediate values in the assembly are preceded by "$" as in "$0x1" - * The final asm parameter are the operation altered non-output registers. - */ + +static inline int +__acpi_acquire_global_lock (unsigned int *lock) +{ + unsigned int old, new, val; + do { + old = *lock; + new = (((old & ~0x3) + 2) + ((old >> 1) & 0x1)); + val = cmpxchg4_locked(lock, new, old); + } while (unlikely (val != old)); + return (new < 3) ? -1 : 0; +} + +static inline int +__acpi_release_global_lock (unsigned int *lock) +{ + unsigned int old, new, val; + do { + old = *lock; + new = old & ~0x3; + val = cmpxchg4_locked(lock, new, old); + } while (unlikely (val != old)); + return old & 0x1; +} + #define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) \ - do { \ - unsigned long dummy; \ - asm("1: movl (%2),%%eax;" \ - "movl %%eax,%%edx;" \ - "andq %2,%%rdx;" \ - "btsl $0x1,%%edx;" \ - "adcl $0x0,%%edx;" \ - "lock; cmpxchgl %%edx,(%1);" \ - "jnz 1b;" \ - "cmpb $0x3,%%dl;" \ - "sbbl %%eax,%%eax" \ - :"=a"(Acq),"=c"(dummy):"c"(GLptr),"i"(~1L):"dx"); \ - } while(0) + ((Acq) = __acpi_acquire_global_lock((unsigned int *) GLptr)) + #define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) \ - do { \ - unsigned long dummy; \ - asm("1: movl (%2),%%eax;" \ - "movl %%eax,%%edx;" \ - "andq %2,%%rdx;" \ - "lock; cmpxchgl %%edx,(%1);" \ - "jnz 1b;" \ - "andl $0x1,%%eax" \ - :"=a"(Acq),"=c"(dummy):"c"(GLptr),"i"(~3L):"dx"); \ - } while(0) + ((Acq) = __acpi_release_global_lock((unsigned int *) GLptr)) /* * Math helper asm macros diff --git a/include/asm-x86_64/bitops.h b/include/asm-x86_64/bitops.h index fffada4e2b67..e5d85ff241e3 100644 --- a/include/asm-x86_64/bitops.h +++ b/include/asm-x86_64/bitops.h @@ -7,14 +7,6 @@ #include <linux/config.h> -/* - * These have to be done with inline assembly: that way the bit-setting - * is guaranteed to be atomic. All bit operations return 0 if the bit - * was cleared before the operation and != 0 if it was not. - * - * bit 0 is the LSB of addr; bit 32 is the LSB of (addr+1). - */ - #ifdef CONFIG_SMP #define LOCK_PREFIX "lock ; " #else @@ -363,26 +355,26 @@ static __inline__ int find_first_bit(const unsigned long * addr, unsigned size) */ static __inline__ int find_next_bit(const unsigned long * addr, int size, int offset) { - unsigned int * p = ((unsigned int *) addr) + (offset >> 5); - int set = 0, bit = offset & 31, res; + const unsigned long * p = addr + (offset >> 6); + unsigned long set = 0, bit = offset & 63, res; if (bit) { /* - * Look for nonzero in the first 32 bits: + * Look for nonzero in the first 64 bits: */ - __asm__("bsfl %1,%0\n\t" - "cmovel %2,%0\n\t" + __asm__("bsfq %1,%0\n\t" + "cmoveq %2,%0\n\t" : "=r" (set) - : "r" (*p >> bit), "r" (32)); - if (set < (32 - bit)) + : "r" (*p >> bit), "r" (64L)); + if (set < (64 - bit)) return set + offset; - set = 32 - bit; + set = 64 - bit; p++; } /* * No set bit yet, search remaining full words for a bit */ - res = find_first_bit ((const unsigned long *)p, size - 32 * (p - (unsigned int *) addr)); + res = find_first_bit (p, size - 64 * (p - addr)); return (offset + set + res); } diff --git a/include/asm-x86_64/calling.h b/include/asm-x86_64/calling.h index a3a04b806744..0b55601b0047 100644 --- a/include/asm-x86_64/calling.h +++ b/include/asm-x86_64/calling.h @@ -8,7 +8,7 @@ #define R14 8 #define R13 16 #define R12 24 -#define RBP 36 +#define RBP 32 #define RBX 40 /* arguments: interrupts/non tracing syscalls only save upto here*/ #define R11 48 diff --git a/include/asm-x86_64/cpu.h b/include/asm-x86_64/cpu.h new file mode 100644 index 000000000000..8eea076525a4 --- /dev/null +++ b/include/asm-x86_64/cpu.h @@ -0,0 +1 @@ +#include <asm-i386/cpu.h> diff --git a/include/asm-x86_64/cpumask.h b/include/asm-x86_64/cpumask.h new file mode 100644 index 000000000000..d9ea497140a1 --- /dev/null +++ b/include/asm-x86_64/cpumask.h @@ -0,0 +1,6 @@ +#ifndef _ASM_X86_64_CPUMASK_H +#define _ASM_X86_64_CPUMASK_H + +#include <asm-generic/cpumask.h> + +#endif /* _ASM_X86_64_CPUMASK_H */ diff --git a/include/asm-x86_64/hw_irq.h b/include/asm-x86_64/hw_irq.h index e1423be20796..931aa2bec401 100644 --- a/include/asm-x86_64/hw_irq.h +++ b/include/asm-x86_64/hw_irq.h @@ -72,7 +72,7 @@ struct hw_interrupt_type; * levels. (0x80 is the syscall vector) */ #define FIRST_DEVICE_VECTOR 0x31 -#define FIRST_SYSTEM_VECTOR 0xef +#define FIRST_SYSTEM_VECTOR 0xef /* duplicated in irq.h */ #ifndef __ASSEMBLY__ @@ -173,6 +173,8 @@ static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) { static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {} #endif +#define platform_legacy_irq(irq) ((irq) < 16) + #endif #endif /* _ASM_HW_IRQ_H */ diff --git a/include/asm-x86_64/io.h b/include/asm-x86_64/io.h index bf9738f9a23b..7d37aa7f3945 100644 --- a/include/asm-x86_64/io.h +++ b/include/asm-x86_64/io.h @@ -304,8 +304,8 @@ out: /* Disable vmerge for now. Need to fix the block layer code to check for non iommu addresses first. When the IOMMU is force it is safe to enable. */ -extern int force_iommu; -#define BIO_VERMGE_BOUNDARY (force_iommu ? 4096 : 0) +extern int iommu_merge; +#define BIO_VMERGE_BOUNDARY (iommu_merge ? 4096 : 0) #endif /* __KERNEL__ */ diff --git a/include/asm-x86_64/io_apic.h b/include/asm-x86_64/io_apic.h index d24f5367ab00..5f31a27b0902 100644 --- a/include/asm-x86_64/io_apic.h +++ b/include/asm-x86_64/io_apic.h @@ -13,6 +13,46 @@ #ifdef CONFIG_X86_IO_APIC +#ifdef CONFIG_PCI_USE_VECTOR +static inline int use_pci_vector(void) {return 1;} +static inline void disable_edge_ioapic_vector(unsigned int vector) { } +static inline void mask_and_ack_level_ioapic_vector(unsigned int vector) { } +static inline void end_edge_ioapic_vector (unsigned int vector) { } +#define startup_level_ioapic startup_level_ioapic_vector +#define shutdown_level_ioapic mask_IO_APIC_vector +#define enable_level_ioapic unmask_IO_APIC_vector +#define disable_level_ioapic mask_IO_APIC_vector +#define mask_and_ack_level_ioapic mask_and_ack_level_ioapic_vector +#define end_level_ioapic end_level_ioapic_vector +#define set_ioapic_affinity set_ioapic_affinity_vector + +#define startup_edge_ioapic startup_edge_ioapic_vector +#define shutdown_edge_ioapic disable_edge_ioapic_vector +#define enable_edge_ioapic unmask_IO_APIC_vector +#define disable_edge_ioapic disable_edge_ioapic_vector +#define ack_edge_ioapic ack_edge_ioapic_vector +#define end_edge_ioapic end_edge_ioapic_vector +#else +static inline int use_pci_vector(void) {return 0;} +static inline void disable_edge_ioapic_irq(unsigned int irq) { } +static inline void mask_and_ack_level_ioapic_irq(unsigned int irq) { } +static inline void end_edge_ioapic_irq (unsigned int irq) { } +#define startup_level_ioapic startup_level_ioapic_irq +#define shutdown_level_ioapic mask_IO_APIC_irq +#define enable_level_ioapic unmask_IO_APIC_irq +#define disable_level_ioapic mask_IO_APIC_irq +#define mask_and_ack_level_ioapic mask_and_ack_level_ioapic_irq +#define end_level_ioapic end_level_ioapic_irq +#define set_ioapic_affinity set_ioapic_affinity_irq + +#define startup_edge_ioapic startup_edge_ioapic_irq +#define shutdown_edge_ioapic disable_edge_ioapic_irq +#define enable_edge_ioapic unmask_IO_APIC_irq +#define disable_edge_ioapic disable_edge_ioapic_irq +#define ack_edge_ioapic ack_edge_ioapic_irq +#define end_edge_ioapic end_edge_ioapic_irq +#endif + #define APIC_MISMATCH_DEBUG #define IO_APIC_BASE(idx) \ @@ -174,6 +214,8 @@ extern int sis_apic_bug; /* dummy */ #define io_apic_assign_pci_irqs 0 #endif +extern int assign_irq_vector(int irq); + void enable_NMI_through_LVT0 (void * dummy); #endif diff --git a/include/asm-x86_64/irq.h b/include/asm-x86_64/irq.h index f7512e095d3d..ad5445ee7460 100644 --- a/include/asm-x86_64/irq.h +++ b/include/asm-x86_64/irq.h @@ -21,8 +21,23 @@ * Since vectors 0x00-0x1f are used/reserved for the CPU, * the usable vector space is 0x20-0xff (224 vectors) */ + +/* + * The maximum number of vectors supported by x86_64 processors + * is limited to 256. For processors other than x86_64, NR_VECTORS + * should be changed accordingly. + */ +#define NR_VECTORS 256 + +#define FIRST_SYSTEM_VECTOR 0xef /* duplicated in hw_irq.h */ + +#ifdef CONFIG_PCI_USE_VECTOR +#define NR_IRQS FIRST_SYSTEM_VECTOR +#define NR_IRQ_VECTORS NR_IRQS +#else #define NR_IRQS 224 #define NR_IRQ_VECTORS NR_IRQS +#endif static __inline__ int irq_canonicalize(int irq) { @@ -32,6 +47,7 @@ static __inline__ int irq_canonicalize(int irq) extern void disable_irq(unsigned int); extern void disable_irq_nosync(unsigned int); extern void enable_irq(unsigned int); +extern int can_request_irq(unsigned int, unsigned long flags); #ifdef CONFIG_X86_LOCAL_APIC #define ARCH_HAS_NMI_WATCHDOG /* See include/linux/nmi.h */ diff --git a/include/asm-x86_64/memblk.h b/include/asm-x86_64/memblk.h new file mode 100644 index 000000000000..cb084c244f0d --- /dev/null +++ b/include/asm-x86_64/memblk.h @@ -0,0 +1 @@ +#include <asm-i386/memblk.h> diff --git a/include/asm-x86_64/node.h b/include/asm-x86_64/node.h new file mode 100644 index 000000000000..0ee6f88db048 --- /dev/null +++ b/include/asm-x86_64/node.h @@ -0,0 +1 @@ +#include <asm-i386/node.h> diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h index 8e7afb86395a..e48a738d9604 100644 --- a/include/asm-x86_64/pgtable.h +++ b/include/asm-x86_64/pgtable.h @@ -180,6 +180,8 @@ static inline void set_pml4(pml4_t *dst, pml4_t val) (_PAGE_PRESENT | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_NX) #define __PAGE_KERNEL_VSYSCALL \ (_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED) +#define __PAGE_KERNEL_VSYSCALL_NOCACHE \ + (_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED | _PAGE_PCD) #define __PAGE_KERNEL_LARGE \ (__PAGE_KERNEL | _PAGE_PSE) @@ -191,6 +193,7 @@ static inline void set_pml4(pml4_t *dst, pml4_t val) #define PAGE_KERNEL_NOCACHE MAKE_GLOBAL(__PAGE_KERNEL_NOCACHE) #define PAGE_KERNEL_VSYSCALL MAKE_GLOBAL(__PAGE_KERNEL_VSYSCALL) #define PAGE_KERNEL_LARGE MAKE_GLOBAL(__PAGE_KERNEL_LARGE) +#define PAGE_KERNEL_VSYSCALL_NOCACHE MAKE_GLOBAL(__PAGE_KERNEL_VSYSCALL_NOCACHE) /* xwr */ #define __P000 PAGE_NONE diff --git a/include/asm-x86_64/smp.h b/include/asm-x86_64/smp.h index 8f425a3acdf6..28c6f28fa54b 100644 --- a/include/asm-x86_64/smp.h +++ b/include/asm-x86_64/smp.h @@ -74,7 +74,7 @@ extern __inline int hard_smp_processor_id(void) return GET_APIC_ID(*(unsigned int *)(APIC_BASE+APIC_ID)); } -#define safe_smp_processor_id() (cpuid_ebx(1) >> 24) +#define safe_smp_processor_id() (disable_apic ? 0 : hard_smp_processor_id()) #define cpu_online(cpu) cpu_isset(cpu, cpu_online_map) #endif /* !ASSEMBLY */ diff --git a/include/asm-x86_64/stat.h b/include/asm-x86_64/stat.h index 29767169b2b1..fd9f00d560f8 100644 --- a/include/asm-x86_64/stat.h +++ b/include/asm-x86_64/stat.h @@ -26,4 +26,19 @@ struct stat { long __unused[3]; }; +/* For 32bit emulation */ +struct __old_kernel_stat { + unsigned short st_dev; + unsigned short st_ino; + unsigned short st_mode; + unsigned short st_nlink; + unsigned short st_uid; + unsigned short st_gid; + unsigned short st_rdev; + unsigned int st_size; + unsigned int st_atime; + unsigned int st_mtime; + unsigned int st_ctime; +}; + #endif diff --git a/include/asm-x86_64/statfs.h b/include/asm-x86_64/statfs.h index bb11240c22b8..b3f4718af30b 100644 --- a/include/asm-x86_64/statfs.h +++ b/include/asm-x86_64/statfs.h @@ -41,4 +41,18 @@ struct statfs64 { long f_spare[5]; }; +struct compat_statfs64 { + __u32 f_type; + __u32 f_bsize; + __u64 f_blocks; + __u64 f_bfree; + __u64 f_bavail; + __u64 f_files; + __u64 f_ffree; + __kernel_fsid_t f_fsid; + __u32 f_namelen; + __u32 f_frsize; + __u32 f_spare[5]; +} __attribute__((packed)); + #endif diff --git a/include/asm-x86_64/system.h b/include/asm-x86_64/system.h index d9b9beab2bbe..5acc4a7da9d2 100644 --- a/include/asm-x86_64/system.h +++ b/include/asm-x86_64/system.h @@ -276,6 +276,13 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\ (unsigned long)(n),sizeof(*(ptr)))) +static inline __u32 cmpxchg4_locked(__u32 *ptr, __u32 old, __u32 new) +{ + asm volatile("lock ; cmpxchgl %k1,%2" : + "=r" (new) : "0" (old), "m" (*(__u32 *)ptr) : "memory"); + return new; +} + #ifdef CONFIG_SMP #define smp_mb() mb() #define smp_rmb() rmb() @@ -314,7 +321,21 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, #define local_irq_disable() __asm__ __volatile__("cli": : :"memory") #define local_irq_enable() __asm__ __volatile__("sti": : :"memory") /* used in the idle loop; sti takes one instruction cycle to complete */ -#define safe_halt() __asm__ __volatile__("sti; hlt": : :"memory") + +/* Work around BIOS that don't have K8 Errata #93 fixed. */ +#define safe_halt() \ + asm volatile(" sti\n" \ + "1: hlt\n" \ + "2:\n" \ + ".section .fixup,\"ax\"\n" \ + "3: call idle_warning\n" \ + " jmp 2b\n" \ + ".previous\n" \ + ".section __ex_table,\"a\"\n\t" \ + ".align 8\n\t" \ + ".quad 1b,3b\n" \ + ".previous" ::: "memory") + #define irqs_disabled() \ ({ \ unsigned long flags; \ diff --git a/include/asm-x86_64/unistd.h b/include/asm-x86_64/unistd.h index c6400293c604..a53f192c9d84 100644 --- a/include/asm-x86_64/unistd.h +++ b/include/asm-x86_64/unistd.h @@ -623,11 +623,11 @@ __syscall_return(type,__res); \ type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,type6 arg6) \ { \ long __res; \ -__asm__ volatile ("movq %5,%%r10 ; movq %6,%%r8 ; movq %7,%%r9" __syscall \ +__asm__ volatile ("movq %5,%%r10 ; movq %6,%%r8 ; movq %7,%%r9 ; " __syscall \ : "=a" (__res) \ : "0" (__NR_##name),"D" ((long)(arg1)),"S" ((long)(arg2)), \ - "d" ((long)(arg3)),"g" ((long)(arg4)),"g" ((long)(arg5), \ - "g" ((long)(arg6),) : \ + "d" ((long)(arg3)), "g" ((long)(arg4)), "g" ((long)(arg5)), \ + "g" ((long)(arg6)) : \ __syscall_clobber,"r8","r10","r9" ); \ __syscall_return(type,__res); \ } diff --git a/include/linux/bio.h b/include/linux/bio.h index 0ac6a27ea0db..4f090059372e 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -162,7 +162,7 @@ struct bio { */ #define __BVEC_END(bio) bio_iovec_idx((bio), (bio)->bi_vcnt - 1) -#define __BVEC_START(bio) bio_iovec_idx((bio), 0) +#define __BVEC_START(bio) bio_iovec_idx((bio), (bio)->bi_idx) #define BIOVEC_PHYS_MERGEABLE(vec1, vec2) \ ((bvec_to_phys((vec1)) + (vec1)->bv_len) == bvec_to_phys((vec2))) #define BIOVEC_VIRT_MERGEABLE(vec1, vec2) \ diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 35e0f0004e87..f90e9ac25738 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -195,11 +195,6 @@ enum rq_flag_bits { __REQ_PM_SUSPEND, /* suspend request */ __REQ_PM_RESUME, /* resume request */ __REQ_PM_SHUTDOWN, /* shutdown request */ - __REQ_IDETAPE_PC1, /* packet command (first stage) */ - __REQ_IDETAPE_PC2, /* packet command (second stage) */ - __REQ_IDETAPE_READ, - __REQ_IDETAPE_WRITE, - __REQ_IDETAPE_READ_BUFFER, __REQ_NR_BITS, /* stops here */ }; @@ -225,11 +220,6 @@ enum rq_flag_bits { #define REQ_PM_SUSPEND (1 << __REQ_PM_SUSPEND) #define REQ_PM_RESUME (1 << __REQ_PM_RESUME) #define REQ_PM_SHUTDOWN (1 << __REQ_PM_SHUTDOWN) -#define REQ_IDETAPE_PC1 (1 << __REQ_IDETAPE_PC1) -#define REQ_IDETAPE_PC2 (1 << __REQ_IDETAPE_PC2) -#define REQ_IDETAPE_READ (1 << __REQ_IDETAPE_READ) -#define REQ_IDETAPE_WRITE (1 << __REQ_IDETAPE_WRITE) -#define REQ_IDETAPE_READ_BUFFER (1 << __REQ_IDETAPE_READ_BUFFER) /* * State information carried for REQ_PM_SUSPEND and REQ_PM_RESUME diff --git a/include/linux/compat.h b/include/linux/compat.h index 3e8e53bdd42e..6bcfa56141b2 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h @@ -44,8 +44,8 @@ typedef struct { } compat_sigset_t; extern int cp_compat_stat(struct kstat *, struct compat_stat *); -extern int get_compat_timespec(struct timespec *, struct compat_timespec *); -extern int put_compat_timespec(struct timespec *, struct compat_timespec *); +extern int get_compat_timespec(struct timespec *, const struct compat_timespec *); +extern int put_compat_timespec(struct timespec *, const struct compat_timespec *); struct compat_iovec { compat_uptr_t iov_base; @@ -76,20 +76,6 @@ struct compat_rusage { compat_long_t ru_nivcsw; }; -struct compat_statfs64 { - __u32 f_type; - __u32 f_bsize; - __u64 f_blocks; - __u64 f_bfree; - __u64 f_bavail; - __u64 f_files; - __u64 f_ffree; - __kernel_fsid_t f_fsid; - __u32 f_namelen; - __u32 f_frsize; - __u32 f_spare[5]; -}; - struct compat_dirent { u32 d_ino; compat_off_t d_off; diff --git a/include/linux/compat_ioctl.h b/include/linux/compat_ioctl.h index 976a56a78119..d87c417544bc 100644 --- a/include/linux/compat_ioctl.h +++ b/include/linux/compat_ioctl.h @@ -678,3 +678,10 @@ COMPATIBLE_IOCTL(NBD_CLEAR_QUE) COMPATIBLE_IOCTL(NBD_PRINT_DEBUG) COMPATIBLE_IOCTL(NBD_SET_SIZE_BLOCKS) COMPATIBLE_IOCTL(NBD_DISCONNECT) +/* i2c */ +COMPATIBLE_IOCTL(I2C_SLAVE) +COMPATIBLE_IOCTL(I2C_SLAVE_FORCE) +COMPATIBLE_IOCTL(I2C_TENBIT) +COMPATIBLE_IOCTL(I2C_PEC) +COMPATIBLE_IOCTL(I2C_RETRIES) +COMPATIBLE_IOCTL(I2C_TIMEOUT) diff --git a/include/linux/console.h b/include/linux/console.h index cdff9de7ee71..6db0056fb4c9 100644 --- a/include/linux/console.h +++ b/include/linux/console.h @@ -71,18 +71,6 @@ void give_up_console(const struct consw *sw); #define CM_MOVE (3) /* - * Array of consoles built from command line options (console=) - */ -struct console_cmdline -{ - char name[8]; /* Name of the driver */ - int index; /* Minor dev. to use */ - char *options; /* Options for the driver */ -}; -#define MAX_CMDLINECONSOLES 8 -extern struct console_cmdline console_list[MAX_CMDLINECONSOLES]; - -/* * The interface for a console, or any other device that * wants to capture console messages (printer driver?) */ @@ -106,6 +94,7 @@ struct console struct console *next; }; +extern int add_preferred_console(char *name, int idx, char *options); extern void register_console(struct console *); extern int unregister_console(struct console *); extern struct console *console_drivers; diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 51790ee0ed6c..bbc983dc8913 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -57,7 +57,7 @@ struct cpufreq_governor; struct cpufreq_cpuinfo { unsigned int max_freq; unsigned int min_freq; - unsigned int transition_latency; /* in 10^(-9) s */ + unsigned int transition_latency; /* in 10^(-9) s = nanoseconds */ }; struct cpufreq_real_policy { @@ -231,17 +231,18 @@ int cpufreq_update_policy(unsigned int cpu); /* the proc_intf.c needs this */ int cpufreq_parse_governor (char *str_governor, unsigned int *policy, struct cpufreq_governor **governor); -#if defined(CONFIG_CPU_FREQ_GOV_USERSPACE) || defined(CONFIG_CPU_FREQ_GOV_USERSPACE_MODULE) + /********************************************************************* * CPUFREQ USERSPACE GOVERNOR * *********************************************************************/ int cpufreq_gov_userspace_init(void); +#ifdef CONFIG_CPU_FREQ_24_API + int cpufreq_setmax(unsigned int cpu); int cpufreq_set(unsigned int kHz, unsigned int cpu); unsigned int cpufreq_get(unsigned int cpu); -#ifdef CONFIG_CPU_FREQ_24_API /* /proc/sys/cpu */ enum { @@ -289,8 +290,6 @@ enum { #endif /* CONFIG_CPU_FREQ_24_API */ -#endif /* CONFIG_CPU_FREQ_GOV_USERSPACE */ - /********************************************************************* * CPUFREQ DEFAULT GOVERNOR * @@ -305,6 +304,7 @@ extern struct cpufreq_governor cpufreq_gov_userspace; #define CPUFREQ_DEFAULT_GOVERNOR &cpufreq_gov_userspace #endif + /********************************************************************* * FREQUENCY TABLE HELPERS * *********************************************************************/ @@ -318,7 +318,6 @@ struct cpufreq_frequency_table { * order */ }; -#if defined(CONFIG_CPU_FREQ_TABLE) || defined(CONFIG_CPU_FREQ_TABLE_MODULE) int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy, struct cpufreq_frequency_table *table); @@ -340,5 +339,4 @@ void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table, void cpufreq_frequency_table_put_attr(unsigned int cpu); -#endif /* CONFIG_CPU_FREQ_TABLE */ #endif /* _LINUX_CPUFREQ_H */ diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index c43921ec27fe..6aa67b15b76f 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h @@ -1,42 +1,9 @@ #ifndef __LINUX_CPUMASK_H #define __LINUX_CPUMASK_H -#include <linux/config.h> -#include <linux/kernel.h> #include <linux/threads.h> -#include <linux/types.h> -#include <linux/bitmap.h> - -#if NR_CPUS > BITS_PER_LONG && NR_CPUS != 1 -#define CPU_ARRAY_SIZE BITS_TO_LONGS(NR_CPUS) - -struct cpumask -{ - unsigned long mask[CPU_ARRAY_SIZE]; -}; - -typedef struct cpumask cpumask_t; - -#else -typedef unsigned long cpumask_t; -#endif - -#ifdef CONFIG_SMP -#if NR_CPUS > BITS_PER_LONG -#include <asm-generic/cpumask_array.h> -#else -#include <asm-generic/cpumask_arith.h> -#endif -#else -#include <asm-generic/cpumask_up.h> -#endif - -#if NR_CPUS <= 4*BITS_PER_LONG -#include <asm-generic/cpumask_const_value.h> -#else -#include <asm-generic/cpumask_const_reference.h> -#endif - +#include <asm/cpumask.h> +#include <asm/bug.h> #ifdef CONFIG_SMP @@ -53,19 +20,31 @@ extern cpumask_t cpu_online_map; static inline int next_online_cpu(int cpu, cpumask_t map) { do - cpu = next_cpu_const(cpu, map); + cpu = next_cpu_const(cpu, mk_cpumask_const(map)); while (cpu < NR_CPUS && !cpu_online(cpu)); return cpu; } #define for_each_cpu(cpu, map) \ - for (cpu = first_cpu_const(map); \ + for (cpu = first_cpu_const(mk_cpumask_const(map)); \ cpu < NR_CPUS; \ - cpu = next_cpu_const(cpu,map)) + cpu = next_cpu_const(cpu,mk_cpumask_const(map))) #define for_each_online_cpu(cpu, map) \ - for (cpu = first_cpu_const(map); \ + for (cpu = first_cpu_const(mk_cpumask_const(map)); \ cpu < NR_CPUS; \ cpu = next_online_cpu(cpu,map)) +extern int __mask_snprintf_len(char *buf, unsigned int buflen, + const unsigned long *maskp, unsigned int maskbytes); + +#define cpumask_snprintf(buf, buflen, map) \ + __mask_snprintf_len(buf, buflen, cpus_addr(map), sizeof(map)) + +extern int __mask_parse_len(const char __user *ubuf, unsigned int ubuflen, + unsigned long *maskp, unsigned int maskbytes); + +#define cpumask_parse(buf, buflen, map) \ + __mask_parse_len(buf, buflen, cpus_addr(map), sizeof(map)) + #endif /* __LINUX_CPUMASK_H */ diff --git a/include/linux/device.h b/include/linux/device.h index 6c43fdbbf23a..8f008e19b83f 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -372,7 +372,7 @@ extern int platform_device_register(struct platform_device *); extern void platform_device_unregister(struct platform_device *); extern struct bus_type platform_bus_type; -extern struct device legacy_bus; +extern struct device platform_bus; /* drivers/base/power.c */ extern void device_shutdown(void); diff --git a/include/linux/efi.h b/include/linux/efi.h index 645fc382081c..86e9d2ebb5eb 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -16,6 +16,8 @@ #include <linux/time.h> #include <linux/types.h> #include <linux/proc_fs.h> +#include <linux/rtc.h> +#include <linux/ioport.h> #include <asm/page.h> #include <asm/system.h> @@ -77,18 +79,23 @@ typedef struct { #define EFI_MAX_MEMORY_TYPE 14 /* Attribute values: */ -#define EFI_MEMORY_UC 0x0000000000000001 /* uncached */ -#define EFI_MEMORY_WC 0x0000000000000002 /* write-coalescing */ -#define EFI_MEMORY_WT 0x0000000000000004 /* write-through */ -#define EFI_MEMORY_WB 0x0000000000000008 /* write-back */ -#define EFI_MEMORY_WP 0x0000000000001000 /* write-protect */ -#define EFI_MEMORY_RP 0x0000000000002000 /* read-protect */ -#define EFI_MEMORY_XP 0x0000000000004000 /* execute-protect */ -#define EFI_MEMORY_RUNTIME 0x8000000000000000 /* range requires runtime mapping */ +#define EFI_MEMORY_UC ((u64)0x0000000000000001ULL) /* uncached */ +#define EFI_MEMORY_WC ((u64)0x0000000000000002ULL) /* write-coalescing */ +#define EFI_MEMORY_WT ((u64)0x0000000000000004ULL) /* write-through */ +#define EFI_MEMORY_WB ((u64)0x0000000000000008ULL) /* write-back */ +#define EFI_MEMORY_WP ((u64)0x0000000000001000ULL) /* write-protect */ +#define EFI_MEMORY_RP ((u64)0x0000000000002000ULL) /* read-protect */ +#define EFI_MEMORY_XP ((u64)0x0000000000004000ULL) /* execute-protect */ +#define EFI_MEMORY_RUNTIME ((u64)0x8000000000000000ULL) /* range requires runtime mapping */ #define EFI_MEMORY_DESCRIPTOR_VERSION 1 #define EFI_PAGE_SHIFT 12 +/* + * For current x86 implementations of EFI, there is + * additional padding in the mem descriptors. This is not + * the case in ia64. Need to have this fixed in the f/w. + */ typedef struct { u32 type; u32 pad; @@ -96,6 +103,9 @@ typedef struct { u64 virt_addr; u64 num_pages; u64 attribute; +#if defined (__i386__) + u64 pad1; +#endif } efi_memory_desc_t; typedef int efi_freemem_callback_t (unsigned long start, unsigned long end, void *arg); @@ -132,11 +142,12 @@ typedef struct { */ #define EFI_RESET_COLD 0 #define EFI_RESET_WARM 1 +#define EFI_RESET_SHUTDOWN 2 /* * EFI Runtime Services table */ -#define EFI_RUNTIME_SERVICES_SIGNATURE 0x5652453544e5552 +#define EFI_RUNTIME_SERVICES_SIGNATURE ((u64)0x5652453544e5552ULL) #define EFI_RUNTIME_SERVICES_REVISION 0x00010000 typedef struct { @@ -169,6 +180,10 @@ typedef efi_status_t efi_set_variable_t (efi_char16_t *name, efi_guid_t *vendor, typedef efi_status_t efi_get_next_high_mono_count_t (u32 *count); typedef void efi_reset_system_t (int reset_type, efi_status_t status, unsigned long data_size, efi_char16_t *data); +typedef efi_status_t efi_set_virtual_address_map_t (unsigned long memory_map_size, + unsigned long descriptor_size, + u32 descriptor_version, + efi_memory_desc_t *virtual_map); /* * EFI Configuration Table and GUID definitions @@ -194,12 +209,15 @@ typedef void efi_reset_system_t (int reset_type, efi_status_t status, #define HCDP_TABLE_GUID \ EFI_GUID( 0xf951938d, 0x620b, 0x42ef, 0x82, 0x79, 0xa8, 0x4b, 0x79, 0x61, 0x78, 0x98 ) +#define UGA_IO_PROTOCOL_GUID \ + EFI_GUID( 0x61a4d49e, 0x6f68, 0x4f1b, 0xb9, 0x22, 0xa8, 0x6e, 0xed, 0xb, 0x7, 0xa2 ) + typedef struct { efi_guid_t guid; unsigned long table; } efi_config_table_t; -#define EFI_SYSTEM_TABLE_SIGNATURE 0x5453595320494249 +#define EFI_SYSTEM_TABLE_SIGNATURE ((u64)0x5453595320494249ULL) #define EFI_SYSTEM_TABLE_REVISION ((1 << 16) | 00) typedef struct { @@ -218,6 +236,13 @@ typedef struct { unsigned long tables; } efi_system_table_t; +struct efi_memory_map { + efi_memory_desc_t *phys_map; + efi_memory_desc_t *map; + int nr_map; + unsigned long desc_version; +}; + /* * All runtime access to EFI goes through this structure: */ @@ -230,6 +255,7 @@ extern struct efi { void *sal_systab; /* SAL system table */ void *boot_info; /* boot info table */ void *hcdp; /* HCDP table */ + void *uga; /* UGA table */ efi_get_time_t *get_time; efi_set_time_t *set_time; efi_get_wakeup_time_t *get_wakeup_time; @@ -239,6 +265,7 @@ extern struct efi { efi_set_variable_t *set_variable; efi_get_next_high_mono_count_t *get_next_high_mono_count; efi_reset_system_t *reset_system; + efi_set_virtual_address_map_t *set_virtual_address_map; } efi; static inline int @@ -260,12 +287,25 @@ efi_guid_unparse(efi_guid_t *guid, char *out) extern void efi_init (void); extern void efi_map_pal_code (void); +extern void efi_map_memmap(void); extern void efi_memmap_walk (efi_freemem_callback_t callback, void *arg); extern void efi_gettimeofday (struct timespec *ts); extern void efi_enter_virtual_mode (void); /* switch EFI to virtual mode, if possible */ extern u64 efi_get_iobase (void); extern u32 efi_mem_type (unsigned long phys_addr); extern u64 efi_mem_attributes (unsigned long phys_addr); +extern void efi_initialize_iomem_resources(struct resource *code_resource, + struct resource *data_resource); +extern efi_status_t phys_efi_get_time(efi_time_t *tm, efi_time_cap_t *tc); +extern unsigned long inline __init efi_get_time(void); +extern int inline __init efi_set_rtc_mmss(unsigned long nowtime); +extern struct efi_memory_map memmap; + +#ifdef CONFIG_EFI +extern int efi_enabled; +#else +#define efi_enabled 0 +#endif /* * Variable Attributes diff --git a/include/linux/fs.h b/include/linux/fs.h index b3a714c094d2..ab962f0b00c2 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -630,6 +630,7 @@ extern int __break_lease(struct inode *inode, unsigned int flags); extern void lease_get_mtime(struct inode *, struct timespec *time); extern int lock_may_read(struct inode *, loff_t start, unsigned long count); extern int lock_may_write(struct inode *, loff_t start, unsigned long count); +extern void steal_locks(fl_owner_t from); struct fasync_struct { int magic; @@ -1408,5 +1409,8 @@ static inline ino_t parent_ino(struct dentry *dentry) return res; } +/* kernel/fork.c */ +extern int unshare_files(void); + #endif /* __KERNEL__ */ #endif /* _LINUX_FS_H */ diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index b3dd00de8dc3..72bda668895b 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -39,6 +39,7 @@ mark_mm_hugetlb(struct mm_struct *mm, struct vm_area_struct *vma) #ifndef ARCH_HAS_HUGEPAGE_ONLY_RANGE #define is_hugepage_only_range(addr, len) 0 +#define hugetlb_free_pgtables(tlb, prev, start, end) do { } while (0) #endif #else /* !CONFIG_HUGETLB_PAGE */ @@ -63,6 +64,7 @@ static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) #define is_aligned_hugepage_range(addr, len) 0 #define pmd_huge(x) 0 #define is_hugepage_only_range(addr, len) 0 +#define hugetlb_free_pgtables(tlb, prev, start, end) do { } while (0) #ifndef HPAGE_MASK #define HPAGE_MASK 0 /* Keep the compiler happy */ diff --git a/include/linux/i2c-dev.h b/include/linux/i2c-dev.h index 1c78b593851a..d228230ffe5d 100644 --- a/include/linux/i2c-dev.h +++ b/include/linux/i2c-dev.h @@ -43,4 +43,6 @@ struct i2c_rdwr_ioctl_data { __u32 nmsgs; /* number of i2c_msgs */ }; +#define I2C_RDRW_IOCTL_MAX_MSGS 42 + #endif /* _LINUX_I2C_DEV_H */ diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index 7dc4abf806c2..74a7286240ba 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h @@ -153,6 +153,7 @@ #define I2C_DRIVERID_FS451 1037 #define I2C_DRIVERID_W83627HF 1038 #define I2C_DRIVERID_LM85 1039 +#define I2C_DRIVERID_LM83 1040 /* * ---- Adapter types ---------------------------------------------------- @@ -258,6 +259,7 @@ #define I2C_HW_SMBUS_AMD8111 0x0a #define I2C_HW_SMBUS_SCX200 0x0b #define I2C_HW_SMBUS_NFORCE2 0x0c +#define I2C_HW_SMBUS_W9968CF 0x0d /* --- ISA pseudo-adapter */ #define I2C_HW_ISA 0x00 diff --git a/include/linux/ide.h b/include/linux/ide.h index fe10ca8d3dd8..e27f0d9d733f 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -51,9 +51,6 @@ #ifndef SUPPORT_VLB_SYNC /* 1 to support weird 32-bit chips */ #define SUPPORT_VLB_SYNC 1 /* 0 to reduce kernel size */ #endif -#ifndef DISK_RECOVERY_TIME /* off=0; on=access_delay_time */ -#define DISK_RECOVERY_TIME 0 /* for hardware that needs it */ -#endif #ifndef OK_TO_RESET_CONTROLLER /* 1 needed for good error recovery */ #define OK_TO_RESET_CONTROLLER 1 /* 0 for use with AH2372A/B interface */ #endif @@ -246,11 +243,11 @@ typedef unsigned char byte; /* used everywhere */ /* * Timeouts for various operations: */ -#define WAIT_DRQ (5*HZ/100) /* 50msec - spec allows up to 20ms */ +#define WAIT_DRQ (HZ/10) /* 100msec - spec allows up to 20ms */ #if defined(CONFIG_APM) || defined(CONFIG_APM_MODULE) #define WAIT_READY (5*HZ) /* 5sec - some laptops are very slow */ #else -#define WAIT_READY (3*HZ/100) /* 30msec - should be instantaneous */ +#define WAIT_READY (HZ/10) /* 100msec - should be instantaneous */ #endif /* CONFIG_APM || CONFIG_APM_MODULE */ #define WAIT_PIDENTIFY (10*HZ) /* 10sec - should be less than 3ms (?), if all ATAPI CD is closed at boot */ #define WAIT_WORSTCASE (30*HZ) /* 30sec - worst case when spinning up */ @@ -999,10 +996,6 @@ typedef struct hwif_s { unsigned dma_extra; /* extra addr for dma ports */ unsigned long config_data; /* for use by chipset-specific code */ unsigned long select_data; /* for use by chipset-specific code */ -#if (DISK_RECOVERY_TIME > 0) - unsigned long last_time; /* time when previous rq was done */ -#endif - unsigned noprobe : 1; /* don't probe for this interface */ unsigned present : 1; /* this interface exists */ @@ -1693,6 +1686,8 @@ extern void ide_setup_pci_devices(struct pci_dev *, struct pci_dev *, ide_pci_de #define GOOD_DMA_DRIVE 1 #ifdef CONFIG_BLK_DEV_IDEDMA_PCI +extern int ide_build_sglist(ide_drive_t *, struct request *); +extern int ide_raw_build_sglist(ide_drive_t *, struct request *); extern int ide_build_dmatable(ide_drive_t *, struct request *); extern void ide_destroy_dmatable(ide_drive_t *); extern ide_startstop_t ide_dma_intr(ide_drive_t *); diff --git a/include/linux/input.h b/include/linux/input.h index 189476217b5c..eff36f445c25 100644 --- a/include/linux/input.h +++ b/include/linux/input.h @@ -870,6 +870,7 @@ struct input_handler { char *name; struct input_device_id *id_table; + struct input_device_id *blacklist; struct list_head h_list; struct list_head node; diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h index f4ff32632c5d..459630f41680 100644 --- a/include/linux/jiffies.h +++ b/include/linux/jiffies.h @@ -10,7 +10,7 @@ /* * The 64-bit value is not volatile - you MUST NOT read it - * without holding read_lock_irq(&xtime_lock). + * without sampling the sequence number in xtime_lock. * get_jiffies_64() will do this for you as appropriate. */ extern u64 jiffies_64; diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 6d4cb2db44db..74af714ff946 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -87,6 +87,8 @@ extern int session_of_pgrp(int pgrp); asmlinkage int printk(const char * fmt, ...) __attribute__ ((format (printf, 1, 2))); +unsigned long int_sqrt(unsigned long); + static inline void console_silent(void) { console_loglevel = 0; diff --git a/include/linux/keyboard.h b/include/linux/keyboard.h index a7fcf94e5a0d..f9c6ad75213a 100644 --- a/include/linux/keyboard.h +++ b/include/linux/keyboard.h @@ -2,7 +2,6 @@ #define __LINUX_KEYBOARD_H #include <linux/wait.h> -#include <linux/input.h> #define KG_SHIFT 0 #define KG_CTRL 2 @@ -17,7 +16,7 @@ #define NR_SHIFT 9 -#define NR_KEYS (KEY_MAX+1) +#define NR_KEYS 255 #define MAX_NR_KEYMAPS 256 /* This means 128Kb if all keymaps are allocated. Only the superuser may increase the number of keymaps beyond MAX_NR_OF_USER_KEYMAPS. */ diff --git a/include/linux/kmod.h b/include/linux/kmod.h index 8412faeea0f7..7c5af18df9d1 100644 --- a/include/linux/kmod.h +++ b/include/linux/kmod.h @@ -24,6 +24,8 @@ #include <linux/compiler.h> #ifdef CONFIG_KMOD +/* modprobe exit status on success, -ve on error. Return value + * usually useless though. */ extern int request_module(const char * name, ...) __attribute__ ((format (printf, 1, 2))); #else static inline int request_module(const char * name, ...) { return -ENOSYS; } diff --git a/include/linux/libata.h b/include/linux/libata.h index feabeae1cfc0..53ce430954da 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -28,6 +28,7 @@ #include <asm/io.h> #include <linux/ata.h> + /* * compile-time options */ @@ -66,8 +67,6 @@ /* defines only for the constants which don't work well as enums */ #define ATA_TAG_POISON 0xfafbfcfdU -#define ATA_DMA_BOUNDARY 0xffffUL -#define ATA_DMA_MASK 0xffffffffULL enum { /* various global constants */ @@ -171,6 +170,7 @@ enum { }; /* forward declarations */ +struct scsi_device; struct ata_port_operations; struct ata_port; struct ata_queued_cmd; @@ -247,8 +247,8 @@ struct ata_queued_cmd { struct ata_port *ap; struct ata_device *dev; - Scsi_Cmnd *scsicmd; - void (*scsidone)(Scsi_Cmnd *); + struct scsi_cmnd *scsicmd; + void (*scsidone)(struct scsi_cmnd *); struct list_head node; unsigned long flags; /* ATA_QCFLAG_xxx */ @@ -403,7 +403,7 @@ extern int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_i extern void ata_pci_remove_one (struct pci_dev *pdev); extern int ata_device_add(struct ata_probe_ent *ent); extern int ata_scsi_detect(Scsi_Host_Template *sht); -extern int ata_scsi_queuecmd(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *)); +extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); extern int ata_scsi_error(struct Scsi_Host *host); extern int ata_scsi_release(struct Scsi_Host *host); extern int ata_scsi_slave_config(struct scsi_device *sdev); @@ -427,6 +427,9 @@ extern void ata_bmdma_start_pio (struct ata_queued_cmd *qc); extern int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits); extern void ata_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat, unsigned int done_late); extern void ata_eng_timeout(struct ata_port *ap); +extern int ata_std_bios_param(struct scsi_device *sdev, + struct block_device *bdev, + sector_t capacity, int geom[]); static inline unsigned long msecs_to_jiffies(unsigned long msecs) diff --git a/include/linux/list.h b/include/linux/list.h index 0835011b0ffb..9a5df31af22e 100644 --- a/include/linux/list.h +++ b/include/linux/list.h @@ -212,6 +212,12 @@ static inline int list_empty(const struct list_head *head) * list_empty_careful - tests whether a list is * empty _and_ checks that no other CPU might be * in the process of still modifying either member + * + * NOTE: using list_empty_careful() without synchronization + * can only be safe if the only activity that can happen + * to the list entry is list_del_init(). Eg. it cannot be used + * if another CPU could re-list_add() it. + * * @head: the list to test. */ static inline int list_empty_careful(const struct list_head *head) diff --git a/include/linux/mm.h b/include/linux/mm.h index f72772e17665..881091514f01 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -143,7 +143,7 @@ extern pgprot_t protection_map[16]; struct vm_operations_struct { void (*open)(struct vm_area_struct * area); void (*close)(struct vm_area_struct * area); - struct page * (*nopage)(struct vm_area_struct * area, unsigned long address, int unused); + struct page * (*nopage)(struct vm_area_struct * area, unsigned long address, int *type); int (*populate)(struct vm_area_struct * area, unsigned long address, unsigned long len, pgprot_t prot, unsigned long pgoff, int nonblock); }; @@ -322,8 +322,10 @@ static inline void put_page(struct page *page) /* * The zone field is never updated after free_area_init_core() * sets it, so none of the operations on it need to be atomic. + * We'll have up to log2(MAX_NUMNODES * MAX_NR_ZONES) zones + * total, so we use NODES_SHIFT here to get enough bits. */ -#define ZONE_SHIFT (BITS_PER_LONG - 8) +#define ZONE_SHIFT (BITS_PER_LONG - NODES_SHIFT - MAX_NR_ZONES_SHIFT) struct zone; extern struct zone *zone_table[]; @@ -405,7 +407,7 @@ static inline int page_mapped(struct page *page) extern void show_free_areas(void); struct page *shmem_nopage(struct vm_area_struct * vma, - unsigned long address, int unused); + unsigned long address, int *type); struct file *shmem_file_setup(char * name, loff_t size, unsigned long flags); void shmem_lock(struct file * file, int lock); int shmem_zero_setup(struct vm_area_struct *); @@ -563,7 +565,7 @@ extern unsigned long page_unuse(struct page *); extern void truncate_inode_pages(struct address_space *, loff_t); /* generic vm_area_ops exported for stackable file systems */ -extern struct page *filemap_nopage(struct vm_area_struct *, unsigned long, int); +struct page *filemap_nopage(struct vm_area_struct *, unsigned long, int *); /* mm/page-writeback.c */ int write_one_page(struct page *page, int wait); diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index bea51c4f5b22..a089e01dad03 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -159,7 +159,10 @@ struct zone { #define ZONE_DMA 0 #define ZONE_NORMAL 1 #define ZONE_HIGHMEM 2 -#define MAX_NR_ZONES 3 + +#define MAX_NR_ZONES 3 /* Sync this with MAX_NR_ZONES_SHIFT */ +#define MAX_NR_ZONES_SHIFT 2 /* ceil(log2(MAX_NR_ZONES)) */ + #define GFP_ZONEMASK 0x03 /* @@ -284,8 +287,6 @@ struct ctl_table; struct file; int min_free_kbytes_sysctl_handler(struct ctl_table *, int, struct file *, void *, size_t *); -extern void setup_per_zone_pages_min(void); - #ifdef CONFIG_NUMA #define MAX_NR_MEMBLKS BITS_PER_LONG /* Max number of Memory Blocks */ diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h index b1fb57c91086..f5c6209bc8f1 100644 --- a/include/linux/msdos_fs.h +++ b/include/linux/msdos_fs.h @@ -4,13 +4,8 @@ /* * The MS-DOS filesystem constants/structures */ -#include <linux/buffer_head.h> -#include <linux/string.h> #include <asm/byteorder.h> -struct statfs; - - #define SECTOR_SIZE 512 /* sector size (bytes) */ #define SECTOR_BITS 9 /* log2(SECTOR_SIZE) */ #define MSDOS_DPB (MSDOS_DPS) /* dir entries per block */ @@ -18,6 +13,9 @@ struct statfs; #define MSDOS_DPS (SECTOR_SIZE / sizeof(struct msdos_dir_entry)) #define MSDOS_DPS_BITS 4 /* log2(MSDOS_DPS) */ + +#define MSDOS_SUPER_MAGIC 0x4d44 /* MD */ + #define MSDOS_ROOT_INO 1 /* == MINIX_ROOT_INO */ #define MSDOS_DIR_BITS 5 /* log2(sizeof(struct msdos_dir_entry)) */ @@ -25,8 +23,6 @@ struct statfs; #define FAT_MAX_DIR_ENTRIES (65536) #define FAT_MAX_DIR_SIZE (FAT_MAX_DIR_ENTRIES << MSDOS_DIR_BITS) -#define MSDOS_SUPER_MAGIC 0x4d44 /* MD */ - #define ATTR_NONE 0 /* no attribute bits */ #define ATTR_RO 1 /* read-only */ #define ATTR_HIDDEN 2 /* hidden */ @@ -35,10 +31,10 @@ struct statfs; #define ATTR_DIR 16 /* directory */ #define ATTR_ARCH 32 /* archived */ +/* attribute bits that are copied "as is" */ #define ATTR_UNUSED (ATTR_VOLUME | ATTR_ARCH | ATTR_SYS | ATTR_HIDDEN) - /* attribute bits that are copied "as is" */ +/* bits that are used by the Windows 95/Windows NT extended FAT */ #define ATTR_EXT (ATTR_RO | ATTR_HIDDEN | ATTR_SYS | ATTR_VOLUME) - /* bits that are used by the Windows 95/Windows NT extended FAT */ #define CASE_LOWER_BASE 8 /* base is lower case */ #define CASE_LOWER_EXT 16 /* extension is lower case */ @@ -46,8 +42,12 @@ struct statfs; #define DELETED_FLAG 0xe5 /* marks file as deleted when in name[0] */ #define IS_FREE(n) (!*(n) || *(n) == DELETED_FLAG) +/* valid file mode bits */ #define MSDOS_VALID_MODE (S_IFREG | S_IFDIR | S_IRWXU | S_IRWXG | S_IRWXO) - /* valid file mode bits */ +/* Convert attribute bits and a mask to the UNIX mode. */ +#define MSDOS_MKMODE(a, m) (m & (a & ATTR_RO ? S_IRUGO|S_IXUGO : S_IRWXUGO)) +/* Convert the UNIX mode to MS-DOS attribute bits. */ +#define MSDOS_MKATTR(m) ((m & S_IWUGO) ? ATTR_NONE : ATTR_RO) #define MSDOS_NAME 11 /* maximum name length */ #define MSDOS_LONGNAME 256 /* maximum name length */ @@ -55,24 +55,29 @@ struct statfs; #define MSDOS_DOT ". " /* ".", padded to MSDOS_NAME chars */ #define MSDOS_DOTDOT ".. " /* "..", padded to MSDOS_NAME chars */ -#define MSDOS_FAT12 4084 /* maximum number of clusters in a 12 bit FAT */ - /* media of boot sector */ #define FAT_VALID_MEDIA(x) ((0xF8 <= (x) && (x) <= 0xFF) || (x) == 0xF0) #define FAT_FIRST_ENT(s, x) ((MSDOS_SB(s)->fat_bits == 32 ? 0x0FFFFF00 : \ MSDOS_SB(s)->fat_bits == 16 ? 0xFF00 : 0xF00) | (x)) +/* maximum number of clusters */ +#define MAX_FAT12 0xFF4 +#define MAX_FAT16 0xFFF4 +#define MAX_FAT32 0x0FFFFFF6 +#define MAX_FAT(s) (MSDOS_SB(s)->fat_bits == 32 ? MAX_FAT32 : \ + MSDOS_SB(s)->fat_bits == 16 ? MAX_FAT16 : MAX_FAT12) + /* bad cluster mark */ #define BAD_FAT12 0xFF7 #define BAD_FAT16 0xFFF7 -#define BAD_FAT32 0xFFFFFF7 +#define BAD_FAT32 0x0FFFFFF7 #define BAD_FAT(s) (MSDOS_SB(s)->fat_bits == 32 ? BAD_FAT32 : \ MSDOS_SB(s)->fat_bits == 16 ? BAD_FAT16 : BAD_FAT12) /* standard EOF */ #define EOF_FAT12 0xFFF #define EOF_FAT16 0xFFFF -#define EOF_FAT32 0xFFFFFFF +#define EOF_FAT32 0x0FFFFFFF #define EOF_FAT(s) (MSDOS_SB(s)->fat_bits == 32 ? EOF_FAT32 : \ MSDOS_SB(s)->fat_bits == 16 ? EOF_FAT16 : EOF_FAT12) @@ -80,8 +85,8 @@ struct statfs; #define FAT_ENT_BAD (BAD_FAT32) #define FAT_ENT_EOF (EOF_FAT32) -#define FAT_FSINFO_SIG1 0x41615252 -#define FAT_FSINFO_SIG2 0x61417272 +#define FAT_FSINFO_SIG1 0x41615252 +#define FAT_FSINFO_SIG2 0x61417272 #define IS_FSINFO(x) (CF_LE_L((x)->signature1) == FAT_FSINFO_SIG1 \ && CF_LE_L((x)->signature2) == FAT_FSINFO_SIG2) @@ -179,15 +184,10 @@ struct vfat_slot_info { loff_t i_pos; /* on-disk position of directory entry */ }; -/* Convert attribute bits and a mask to the UNIX mode. */ -#define MSDOS_MKMODE(a,m) (m & (a & ATTR_RO ? S_IRUGO|S_IXUGO : S_IRWXUGO)) - -/* Convert the UNIX mode to MS-DOS attribute bits. */ -#define MSDOS_MKATTR(m) ((m & S_IWUGO) ? ATTR_NONE : ATTR_RO) - - #ifdef __KERNEL__ +#include <linux/buffer_head.h> +#include <linux/string.h> #include <linux/nls.h> #include <linux/msdos_fs_i.h> #include <linux/msdos_fs_sb.h> diff --git a/include/linux/msdos_fs_sb.h b/include/linux/msdos_fs_sb.h index 546458d82ece..c79a172225d3 100644 --- a/include/linux/msdos_fs_sb.h +++ b/include/linux/msdos_fs_sb.h @@ -47,9 +47,9 @@ struct msdos_sb_info { unsigned long data_start; /* first data sector */ unsigned long clusters; /* number of clusters */ unsigned long root_cluster; /* first cluster of the root directory */ - unsigned long fsinfo_sector; /* FAT32 fsinfo offset from start of disk */ + unsigned long fsinfo_sector; /* sector number of FAT32 fsinfo */ struct semaphore fat_lock; - int prev_free; /* previously returned free cluster number */ + int prev_free; /* previously allocated cluster number */ int free_clusters; /* -1 if undefined */ struct fat_mount_options options; struct nls_table *nls_disk; /* Codepage used on disk */ diff --git a/include/linux/nbd.h b/include/linux/nbd.h index 8a3311efe284..dcb0228efcae 100644 --- a/include/linux/nbd.h +++ b/include/linux/nbd.h @@ -35,6 +35,9 @@ enum { /* Define PARANOIA to include extra sanity checking code in here & driver */ #define PARANOIA +/* userspace doesn't need the nbd_device structure */ +#ifdef __KERNEL__ + struct nbd_device { int flags; int harderror; /* Code of hard error */ @@ -53,6 +56,8 @@ struct nbd_device { u64 bytesize; }; +#endif + /* This now IS in some kind of include file... */ /* These are send over network in request/reply magic field */ diff --git a/include/linux/netfilter_bridge.h b/include/linux/netfilter_bridge.h index 88cc98af2dce..bc4f5988251c 100644 --- a/include/linux/netfilter_bridge.h +++ b/include/linux/netfilter_bridge.h @@ -8,10 +8,8 @@ #include <linux/netfilter.h> #if defined(__KERNEL__) && defined(CONFIG_BRIDGE_NETFILTER) #include <asm/atomic.h> -#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) #include <linux/if_ether.h> #endif -#endif /* Bridge Hooks */ /* After promisc drops, checksum checks. */ @@ -71,13 +69,11 @@ static inline void nf_bridge_maybe_copy_header(struct sk_buff *skb) { if (skb->nf_bridge) { -#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) if (skb->protocol == __constant_htons(ETH_P_8021Q)) { - memcpy(skb->data - 18, skb->nf_bridge->hh, 18); + memcpy(skb->data - 18, skb->nf_bridge->data, 18); skb_push(skb, 4); } else -#endif - memcpy(skb->data - 16, skb->nf_bridge->hh, 16); + memcpy(skb->data - 16, skb->nf_bridge->data, 16); } } @@ -86,11 +82,10 @@ void nf_bridge_save_header(struct sk_buff *skb) { int header_size = 16; -#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) if (skb->protocol == __constant_htons(ETH_P_8021Q)) header_size = 18; -#endif - memcpy(skb->nf_bridge->hh, skb->data - header_size, header_size); + + memcpy(skb->nf_bridge->data, skb->data - header_size, header_size); } struct bridge_skb_cb { diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 006fde0295d5..0b35e7111465 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -133,6 +133,7 @@ extern void get_full_page_state(struct page_state *ret); #define inc_page_state(member) mod_page_state(member, 1UL) #define dec_page_state(member) mod_page_state(member, 0UL - 1) +#define add_page_state(member,delta) mod_page_state(member, (delta)) #define sub_page_state(member,delta) mod_page_state(member, 0UL - (delta)) diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 8fc118dc90cc..e552cb04a0ed 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -8,7 +8,6 @@ #include <linux/fs.h> #include <linux/list.h> #include <linux/highmem.h> -#include <linux/pagemap.h> #include <asm/uaccess.h> #include <linux/gfp.h> diff --git a/include/linux/parser.h b/include/linux/parser.h index 5f982a1a2600..fa3332861a09 100644 --- a/include/linux/parser.h +++ b/include/linux/parser.h @@ -1,3 +1,14 @@ +/* + * linux/include/linux/parser.h + * + * Header for lib/parser.c + * Intended use of these functions is parsing filesystem argument lists, + * but could potentially be used anywhere else that simple option=arg + * parsing is required. + */ + + +/* associates an integer enumerator with a pattern string. */ struct match_token { int token; char *pattern; @@ -5,15 +16,16 @@ struct match_token { typedef struct match_token match_table_t[]; +/* Maximum number of arguments that match_token will find in a pattern */ enum {MAX_OPT_ARGS = 3}; +/* Describe the location within a string of a substring */ typedef struct { char *from; char *to; } substring_t; -int match_token(char *s, match_table_t table, substring_t args[]); - +int match_token(char *, match_table_t table, substring_t args[]); int match_int(substring_t *, int *result); int match_octal(substring_t *, int *result); int match_hex(substring_t *, int *result); diff --git a/include/linux/pci.h b/include/linux/pci.h index 654840dad226..b88b9d3f5bfc 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -36,6 +36,7 @@ #define PCI_COMMAND_WAIT 0x80 /* Enable address/data stepping */ #define PCI_COMMAND_SERR 0x100 /* Enable SERR */ #define PCI_COMMAND_FAST_BACK 0x200 /* Enable back-to-back writes */ +#define PCI_COMMAND_INTX_DISABLE 0x400 /* INTx Emulation Disable */ #define PCI_STATUS 0x06 /* 16 bits */ #define PCI_STATUS_CAP_LIST 0x10 /* Support Capability List */ @@ -198,6 +199,8 @@ #define PCI_CAP_ID_MSI 0x05 /* Message Signalled Interrupts */ #define PCI_CAP_ID_CHSWP 0x06 /* CompactPCI HotSwap */ #define PCI_CAP_ID_PCIX 0x07 /* PCI-X */ +#define PCI_CAP_ID_EXP 0x10 /* PCI Express */ +#define PCI_CAP_ID_MSIX 0x11 /* MSI-X */ #define PCI_CAP_LIST_NEXT 1 /* Next capability in the list */ #define PCI_CAP_FLAGS 2 /* Capability defined flags (16 bits) */ #define PCI_CAP_SIZEOF 4 @@ -275,11 +278,13 @@ #define PCI_MSI_FLAGS_QSIZE 0x70 /* Message queue size configured */ #define PCI_MSI_FLAGS_QMASK 0x0e /* Maximum queue size available */ #define PCI_MSI_FLAGS_ENABLE 0x01 /* MSI feature enabled */ +#define PCI_MSI_FLAGS_MASKBIT 0x100 /* 64-bit mask bits allowed */ #define PCI_MSI_RFU 3 /* Rest of capability flags */ #define PCI_MSI_ADDRESS_LO 4 /* Lower 32 bits */ #define PCI_MSI_ADDRESS_HI 8 /* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */ #define PCI_MSI_DATA_32 8 /* 16 bits of data for 32-bit devices */ #define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */ +#define PCI_MSI_MASK_BIT 16 /* Mask bits register */ /* CompactPCI Hotswap Register */ @@ -695,6 +700,18 @@ void pci_pool_free (struct pci_pool *pool, void *vaddr, dma_addr_t addr); extern struct pci_dev *isa_bridge; #endif +#ifndef CONFIG_PCI_USE_VECTOR +static inline void pci_scan_msi_device(struct pci_dev *dev) {} +static inline int pci_enable_msi(struct pci_dev *dev) {return -1;} +static inline void msi_remove_pci_irq_vectors(struct pci_dev *dev) {} +#else +extern void pci_scan_msi_device(struct pci_dev *dev); +extern int pci_enable_msi(struct pci_dev *dev); +extern void msi_remove_pci_irq_vectors(struct pci_dev *dev); +extern int msi_alloc_vectors(struct pci_dev* dev, int *vector, int nvec); +extern int msi_free_vectors(struct pci_dev* dev, int *vector, int nvec); +#endif + #endif /* CONFIG_PCI */ /* Include architecture-dependent settings and functions */ diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 074323455323..34e5bb79396b 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -901,6 +901,7 @@ #define PCI_VENDOR_ID_SGI 0x10a9 #define PCI_DEVICE_ID_SGI_IOC3 0x0003 +#define PCI_DEVICE_ID_SGI_IOC4 0x100a #define PCI_VENDOR_ID_SGI_LITHIUM 0x1002 #define PCI_VENDOR_ID_ACC 0x10aa @@ -1785,11 +1786,13 @@ #define PCI_DEVICE_ID_TIGON3_5702 0x1646 #define PCI_DEVICE_ID_TIGON3_5703 0x1647 #define PCI_DEVICE_ID_TIGON3_5704 0x1648 +#define PCI_DEVICE_ID_TIGON3_5704S_2 0x1649 #define PCI_DEVICE_ID_TIGON3_5702FE 0x164d #define PCI_DEVICE_ID_TIGON3_5705 0x1653 #define PCI_DEVICE_ID_TIGON3_5705_2 0x1654 #define PCI_DEVICE_ID_TIGON3_5705M 0x165d #define PCI_DEVICE_ID_TIGON3_5705M_2 0x165e +#define PCI_DEVICE_ID_TIGON3_5705F 0x166e #define PCI_DEVICE_ID_TIGON3_5782 0x1696 #define PCI_DEVICE_ID_TIGON3_5788 0x169c #define PCI_DEVICE_ID_TIGON3_5702X 0x16a6 @@ -2053,6 +2056,7 @@ #define PCI_DEVICE_ID_INTEL_82443MX_3 0x719b #define PCI_DEVICE_ID_INTEL_82443GX_0 0x71a0 #define PCI_DEVICE_ID_INTEL_82443GX_1 0x71a1 +#define PCI_DEVICE_ID_INTEL_82443GX_2 0x71a2 #define PCI_DEVICE_ID_INTEL_82372FB_0 0x7600 #define PCI_DEVICE_ID_INTEL_82372FB_1 0x7601 #define PCI_DEVICE_ID_INTEL_82372FB_2 0x7602 diff --git a/include/linux/pci_msi.h b/include/linux/pci_msi.h new file mode 100644 index 000000000000..0e42e65bc3e1 --- /dev/null +++ b/include/linux/pci_msi.h @@ -0,0 +1,193 @@ +/* + * ../include/linux/pci_msi.h + * + */ + +#ifndef _ASM_PCI_MSI_H +#define _ASM_PCI_MSI_H + +#include <linux/pci.h> + +#define MSI_AUTO -1 +#define NR_REPEATS 23 +#define NR_RESERVED_VECTORS 3 /*FIRST_DEVICE_VECTOR,FIRST_SYSTEM_VECTOR,0x80 */ + +/* + * Assume the maximum number of hot plug slots supported by the system is about + * ten. The worstcase is that each of these slots is hot-added with a device, + * which has two MSI/MSI-X capable functions. To avoid any MSI-X driver, which + * attempts to request all available vectors, NR_HP_RESERVED_VECTORS is defined + * as below to ensure at least one message is assigned to each detected MSI/ + * MSI-X device function. + */ +#define NR_HP_RESERVED_VECTORS 20 + +extern int vector_irq[NR_IRQS]; +extern cpumask_t pending_irq_balance_cpumask[NR_IRQS]; +extern void (*interrupt[NR_IRQS])(void); + +#ifdef CONFIG_SMP +#define set_msi_irq_affinity set_msi_affinity +#else +#define set_msi_irq_affinity NULL +static inline void move_msi(int vector) {} +#endif + +#ifndef CONFIG_X86_IO_APIC +static inline int get_ioapic_vector(struct pci_dev *dev) { return -1;} +static inline void restore_ioapic_irq_handler(int irq) {} +#else +extern void restore_ioapic_irq_handler(int irq); +#endif + +/* + * MSI-X Address Register + */ +#define PCI_MSIX_FLAGS_QSIZE 0x7FF +#define PCI_MSIX_FLAGS_ENABLE (1 << 15) +#define PCI_MSIX_FLAGS_BIRMASK (7 << 0) +#define PCI_MSIX_FLAGS_BITMASK (1 << 0) + +#define PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET 0 +#define PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET 4 +#define PCI_MSIX_ENTRY_DATA_OFFSET 8 +#define PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET 12 +#define PCI_MSIX_ENTRY_SIZE 16 + +#define msi_control_reg(base) (base + PCI_MSI_FLAGS) +#define msi_lower_address_reg(base) (base + PCI_MSI_ADDRESS_LO) +#define msi_upper_address_reg(base) (base + PCI_MSI_ADDRESS_HI) +#define msi_data_reg(base, is64bit) \ + ( (is64bit == 1) ? base+PCI_MSI_DATA_64 : base+PCI_MSI_DATA_32 ) +#define msi_mask_bits_reg(base, is64bit) \ + ( (is64bit == 1) ? base+PCI_MSI_MASK_BIT : base+PCI_MSI_MASK_BIT-4) +#define msi_disable(control) control &= ~PCI_MSI_FLAGS_ENABLE +#define multi_msi_capable(control) \ + (1 << ((control & PCI_MSI_FLAGS_QMASK) >> 1)) +#define multi_msi_enable(control, num) \ + control |= (((num >> 1) << 4) & PCI_MSI_FLAGS_QSIZE); +#define is_64bit_address(control) (control & PCI_MSI_FLAGS_64BIT) +#define is_mask_bit_support(control) (control & PCI_MSI_FLAGS_MASKBIT) +#define msi_enable(control, num) multi_msi_enable(control, num); \ + control |= PCI_MSI_FLAGS_ENABLE + +#define msix_control_reg msi_control_reg +#define msix_table_offset_reg(base) (base + 0x04) +#define msix_pba_offset_reg(base) (base + 0x08) +#define msix_enable(control) control |= PCI_MSIX_FLAGS_ENABLE +#define msix_disable(control) control &= ~PCI_MSIX_FLAGS_ENABLE +#define msix_table_size(control) ((control & PCI_MSIX_FLAGS_QSIZE)+1) +#define multi_msix_capable msix_table_size +#define msix_unmask(address) (address & ~PCI_MSIX_FLAGS_BITMASK) +#define msix_mask(address) (address | PCI_MSIX_FLAGS_BITMASK) +#define msix_is_pending(address) (address & PCI_MSIX_FLAGS_PENDMASK) + +extern char __dbg_str_buf[256]; +#define _DEFINE_DBG_BUFFER char __dbg_str_buf[256]; +#define _DBG_K_TRACE_ENTRY ((unsigned int)0x00000001) +#define _DBG_K_TRACE_EXIT ((unsigned int)0x00000002) +#define _DBG_K_INFO ((unsigned int)0x00000004) +#define _DBG_K_ERROR ((unsigned int)0x00000008) +#define _DBG_K_TRACE (_DBG_K_TRACE_ENTRY | _DBG_K_TRACE_EXIT) + +#define _DEBUG_LEVEL (_DBG_K_INFO | _DBG_K_ERROR | _DBG_K_TRACE) +#define _DBG_PRINT( dbg_flags, args... ) \ +if ( _DEBUG_LEVEL & (dbg_flags) ) \ +{ \ + int len; \ + len = sprintf(__dbg_str_buf, "%s:%d: %s ", \ + __FILE__, __LINE__, __FUNCTION__ ); \ + sprintf(__dbg_str_buf + len, args); \ + printk(KERN_INFO "%s\n", __dbg_str_buf); \ +} + +#define MSI_FUNCTION_TRACE_ENTER \ + _DBG_PRINT (_DBG_K_TRACE_ENTRY, "%s", "[Entry]"); +#define MSI_FUNCTION_TRACE_EXIT \ + _DBG_PRINT (_DBG_K_TRACE_EXIT, "%s", "[Entry]"); + +/* + * MSI Defined Data Structures + */ +#define MSI_ADDRESS_HEADER 0xfee +#define MSI_ADDRESS_HEADER_SHIFT 12 +#define MSI_ADDRESS_HEADER_MASK 0xfff000 +#define MSI_TARGET_CPU_SHIFT 4 +#define MSI_TARGET_CPU_MASK 0xff +#define MSI_DELIVERY_MODE 0 +#define MSI_LEVEL_MODE 1 /* Edge always assert */ +#define MSI_TRIGGER_MODE 0 /* MSI is edge sensitive */ +#define MSI_LOGICAL_MODE 1 +#define MSI_REDIRECTION_HINT_MODE 0 +#ifdef CONFIG_SMP +#define MSI_TARGET_CPU logical_smp_processor_id() +#else +#define MSI_TARGET_CPU TARGET_CPUS +#endif + +struct msg_data { +#if defined(__LITTLE_ENDIAN_BITFIELD) + __u32 vector : 8; + __u32 delivery_mode : 3; /* 000b: FIXED | 001b: lowest prior */ + __u32 reserved_1 : 3; + __u32 level : 1; /* 0: deassert | 1: assert */ + __u32 trigger : 1; /* 0: edge | 1: level */ + __u32 reserved_2 : 16; +#elif defined(__BIG_ENDIAN_BITFIELD) + __u32 reserved_2 : 16; + __u32 trigger : 1; /* 0: edge | 1: level */ + __u32 level : 1; /* 0: deassert | 1: assert */ + __u32 reserved_1 : 3; + __u32 delivery_mode : 3; /* 000b: FIXED | 001b: lowest prior */ + __u32 vector : 8; +#else +#error "Bitfield endianness not defined! Check your byteorder.h" +#endif +} __attribute__ ((packed)); + +struct msg_address { + union { + struct { +#if defined(__LITTLE_ENDIAN_BITFIELD) + __u32 reserved_1 : 2; + __u32 dest_mode : 1; /*0:physic | 1:logic */ + __u32 redirection_hint: 1; /*0: dedicated CPU + 1: lowest priority */ + __u32 reserved_2 : 4; + __u32 dest_id : 24; /* Destination ID */ +#elif defined(__BIG_ENDIAN_BITFIELD) + __u32 dest_id : 24; /* Destination ID */ + __u32 reserved_2 : 4; + __u32 redirection_hint: 1; /*0: dedicated CPU + 1: lowest priority */ + __u32 dest_mode : 1; /*0:physic | 1:logic */ + __u32 reserved_1 : 2; +#else +#error "Bitfield endianness not defined! Check your byteorder.h" +#endif + }u; + __u32 value; + }lo_address; + __u32 hi_address; +} __attribute__ ((packed)); + +struct msi_desc { + struct { + __u8 type : 5; /* {0: unused, 5h:MSI, 11h:MSI-X} */ + __u8 maskbit : 1; /* mask-pending bit supported ? */ + __u8 reserved: 2; /* reserved */ + __u8 entry_nr; /* specific enabled entry */ + __u8 default_vector; /* default pre-assigned vector */ + __u8 current_cpu; /* current destination cpu */ + }msi_attrib; + + struct { + __u16 head; + __u16 tail; + }link; + + unsigned long mask_base; + struct pci_dev *dev; +}; + +#endif /* _ASM_PCI_MSI_H */ diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h index 53c52176c391..594f564e031a 100644 --- a/include/linux/percpu_counter.h +++ b/include/linux/percpu_counter.h @@ -8,17 +8,14 @@ #include <linux/spinlock.h> #include <linux/smp.h> #include <linux/threads.h> +#include <linux/percpu.h> #ifdef CONFIG_SMP -struct __percpu_counter { - long count; -} ____cacheline_aligned; - struct percpu_counter { spinlock_t lock; long count; - struct __percpu_counter counters[NR_CPUS]; + long *counters; }; #if NR_CPUS >= 16 @@ -29,12 +26,14 @@ struct percpu_counter { static inline void percpu_counter_init(struct percpu_counter *fbc) { - int i; - spin_lock_init(&fbc->lock); fbc->count = 0; - for (i = 0; i < NR_CPUS; i++) - fbc->counters[i].count = 0; + fbc->counters = alloc_percpu(long); +} + +static inline void percpu_counter_destroy(struct percpu_counter *fbc) +{ + free_percpu(fbc->counters); } void percpu_counter_mod(struct percpu_counter *fbc, long amount); @@ -69,6 +68,10 @@ static inline void percpu_counter_init(struct percpu_counter *fbc) fbc->count = 0; } +static inline void percpu_counter_destroy(struct percpu_counter *fbc) +{ +} + static inline void percpu_counter_mod(struct percpu_counter *fbc, long amount) { diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index fafb0fc55cf7..d8de4a1b03ef 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h @@ -141,6 +141,8 @@ extern void proc_rtas_init(void); extern struct proc_dir_entry *proc_symlink(const char *, struct proc_dir_entry *, const char *); extern struct proc_dir_entry *proc_mkdir(const char *,struct proc_dir_entry *); +extern struct proc_dir_entry *proc_mkdir_mode(const char *name, mode_t mode, + struct proc_dir_entry *parent); static inline struct proc_dir_entry *create_proc_read_entry(const char *name, mode_t mode, struct proc_dir_entry *base, diff --git a/include/linux/quota.h b/include/linux/quota.h index 447b5e192a74..2f65eb567384 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h @@ -250,7 +250,7 @@ struct dquot_operations { void (*free_space) (struct inode *, qsize_t); void (*free_inode) (const struct inode *, unsigned long); int (*transfer) (struct inode *, struct iattr *); - int (*sync_dquot) (struct dquot *); + int (*write_dquot) (struct dquot *); }; /* Operations handling requests from userspace */ diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index a34e79044978..32fe6c84b3b6 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h @@ -1719,7 +1719,7 @@ void reiserfs_allow_writes(struct super_block *s) ; void reiserfs_check_lock_depth(char *caller) ; void reiserfs_prepare_for_journal(struct super_block *, struct buffer_head *bh, int wait) ; void reiserfs_restore_prepared_buffer(struct super_block *, struct buffer_head *bh) ; -int journal_init(struct super_block *, const char * j_dev_name, int old_format) ; +int journal_init(struct super_block *, const char * j_dev_name, int old_format, unsigned int) ; int journal_release(struct reiserfs_transaction_handle*, struct super_block *) ; int journal_release_error(struct reiserfs_transaction_handle*, struct super_block *) ; int journal_end(struct reiserfs_transaction_handle *, struct super_block *, unsigned long) ; diff --git a/include/linux/sched.h b/include/linux/sched.h index fbf3c753ef8a..8bea1256eb08 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -205,7 +205,6 @@ struct mm_struct { unsigned long rss, total_vm, locked_vm; unsigned long def_flags; cpumask_t cpu_vm_mask; - unsigned long swap_address; unsigned long saved_auxv[40]; /* for /proc/PID/auxv */ diff --git a/include/linux/serio.h b/include/linux/serio.h index a3cf7dd02072..d99e973302de 100644 --- a/include/linux/serio.h +++ b/include/linux/serio.h @@ -49,6 +49,7 @@ struct serio_dev { irqreturn_t (*interrupt)(struct serio *, unsigned char, unsigned int, struct pt_regs *); void (*connect)(struct serio *, struct serio_dev *dev); + int (*reconnect)(struct serio *); void (*disconnect)(struct serio *); void (*cleanup)(struct serio *); @@ -58,12 +59,15 @@ struct serio_dev { int serio_open(struct serio *serio, struct serio_dev *dev); void serio_close(struct serio *serio); void serio_rescan(struct serio *serio); +void serio_reconnect(struct serio *serio); irqreturn_t serio_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs); void serio_register_port(struct serio *serio); -void serio_register_slave_port(struct serio *serio); +void serio_register_port_delayed(struct serio *serio); +void __serio_register_port(struct serio *serio); void serio_unregister_port(struct serio *serio); -void serio_unregister_slave_port(struct serio *serio); +void serio_unregister_port_delayed(struct serio *serio); +void __serio_unregister_port(struct serio *serio); void serio_register_device(struct serio_dev *dev); void serio_unregister_device(struct serio_dev *dev); diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index b7c23dd89b9a..77162e4c2819 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -107,7 +107,7 @@ struct nf_bridge_info { struct net_device *netoutdev; #endif unsigned int mask; - unsigned long hh[32 / sizeof(unsigned long)]; + unsigned long data[32 / sizeof(unsigned long)]; }; #endif @@ -764,10 +764,10 @@ static inline struct sk_buff *__skb_dequeue_tail(struct sk_buff_head *list) } /** - * skb_dequeue - remove from the head of the queue + * skb_dequeue_tail - remove from the tail of the queue * @list: list to dequeue from * - * Remove the head of the list. The list lock is taken so the function + * Remove the tail of the list. The list lock is taken so the function * may be used safely with other locking list functions. The tail item is * returned or %NULL if the list is empty. */ diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 4c1b633d5fbf..c94fb1d1862a 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -579,6 +579,14 @@ enum { NET_SCTP_MAX_BURST = 12, }; +/* /proc/sys/net/bridge */ +enum { + NET_BRIDGE_NF_CALL_ARPTABLES = 1, + NET_BRIDGE_NF_CALL_IPTABLES = 2, + NET_BRIDGE_NF_CALL_IP6TABLES = 3, + NET_BRIDGE_NF_FILTER_VLAN_TAGGED = 4, +}; + /* CTL_PROC names: */ /* CTL_FS names: */ diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 3a2e7bf3c44a..d25e5bd21c4d 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h @@ -386,7 +386,10 @@ struct tcp_sock { struct tcp_opt tcp; }; -#define tcp_sk(__sk) (&((struct tcp_sock *)__sk)->tcp) +static inline struct tcp_opt * tcp_sk(const struct sock *__sk) +{ + return &((struct tcp_sock *)__sk)->tcp; +} #endif diff --git a/include/linux/usb.h b/include/linux/usb.h index 41c2ca3dc629..5e49f861230d 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -414,9 +414,6 @@ static inline int usb_make_path (struct usb_device *dev, char *buf, size_t size) * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set * or your driver's probe function will never get called. * @driver: the driver model core driver structure. - * @serialize: a semaphore used to serialize access to this driver. Used - * in the probe and disconnect functions. Only the USB core should use - * this lock. * * USB drivers must provide a name, probe() and disconnect() methods, * and an id_table. Other driver fields are optional. @@ -451,8 +448,6 @@ struct usb_driver { const struct usb_device_id *id_table; struct device_driver driver; - - struct semaphore serialize; }; #define to_usb_driver(d) container_of(d, struct usb_driver, driver) diff --git a/include/linux/usb_ch9.h b/include/linux/usb_ch9.h index 916378f747c1..682e95114870 100644 --- a/include/linux/usb_ch9.h +++ b/include/linux/usb_ch9.h @@ -116,6 +116,17 @@ struct usb_ctrlrequest { #define USB_DT_DEVICE_QUALIFIER 0x06 #define USB_DT_OTHER_SPEED_CONFIG 0x07 #define USB_DT_INTERFACE_POWER 0x08 +/* these are from a minor usb 2.0 revision (ECN) */ +#define USB_DT_OTG 0x09 +#define USB_DT_DEBUG 0x0a +#define USB_DT_INTERFACE_ASSOCIATION 0x0b + +/* conventional codes for class-specific descriptors */ +#define USB_DT_CS_DEVICE 0x21 +#define USB_DT_CS_CONFIG 0x22 +#define USB_DT_CS_STRING 0x23 +#define USB_DT_CS_INTERFACE 0x24 +#define USB_DT_CS_ENDPOINT 0x25 /* All standard descriptors have these 2 fields at the beginning */ struct usb_descriptor_header { @@ -165,6 +176,7 @@ struct usb_device_descriptor { #define USB_CLASS_CDC_DATA 0x0a #define USB_CLASS_CSCID 0x0b /* chip+ smart card */ #define USB_CLASS_CONTENT_SEC 0x0d /* content security */ +#define USB_CLASS_VIDEO 0x0e #define USB_CLASS_APP_SPEC 0xfe #define USB_CLASS_VENDOR_SPEC 0xff @@ -283,6 +295,36 @@ struct usb_qualifier_descriptor { /*-------------------------------------------------------------------------*/ +/* USB_DT_OTG (from OTG 1.0a supplement) */ +struct usb_otg_descriptor { + __u8 bLength; + __u8 bDescriptorType; + + __u8 bmAttributes; /* support for HNP, SRP, etc */ +} __attribute__ ((packed)); + +/* from usb_otg_descriptor.bmAttributes */ +#define USB_OTG_SRP (1 << 0) +#define USB_OTG_HNP (1 << 1) /* swap host/device roles */ + +/*-------------------------------------------------------------------------*/ + +/* USB_DT_INTERFACE_ASSOCIATION: groups interfaces */ +struct usb_interface_assoc_descriptor { + __u8 bLength; + __u8 bDescriptorType; + + __u8 bFirstInterface; + __u8 bInterfaceCount; + __u8 bFunctionClass; + __u8 bFunctionSubClass; + __u8 bFunctionProtocol; + __u8 iFunction; +} __attribute__ ((packed)); + + +/*-------------------------------------------------------------------------*/ + /* USB 2.0 defines three speeds, here's how Linux identifies them */ enum usb_device_speed { diff --git a/include/linux/usb_gadget.h b/include/linux/usb_gadget.h index da2d9749baf6..1cfb33ebf348 100644 --- a/include/linux/usb_gadget.h +++ b/include/linux/usb_gadget.h @@ -28,12 +28,20 @@ struct usb_ep; * for mapping and unmapping the buffer. * @length: Length of that data * @no_interrupt: If true, hints that no completion irq is needed. - * Helpful sometimes with deep request queues. + * Helpful sometimes with deep request queues that are handled + * directly by DMA controllers. * @zero: If true, when writing data, makes the last packet be "short" * by adding a zero length packet as needed; * @short_not_ok: When reading data, makes short packets be * treated as errors (queue stops advancing till cleanup). - * @complete: Function called when request completes + * @complete: Function called when request completes, so this request and + * its buffer may be re-used. + * Reads terminate with a short packet, or when the buffer fills, + * whichever comes first. When writes terminate, some data bytes + * will usually still be in flight (often in a hardware fifo). + * Errors (for reads or writes) stop the queue from advancing + * until the completion function returns, so that any transfers + * invalidated by the error may first be dequeued. * @context: For use by the completion callback * @list: For use by the gadget driver. * @status: Reports completion code, zero or a negative errno. @@ -41,12 +49,13 @@ struct usb_ep; * the completion callback returns. * Code "-ESHUTDOWN" indicates completion caused by device disconnect, * or when the driver disabled the endpoint. - * @actual: Reports actual bytes transferred. For reads (OUT + * @actual: Reports bytes transferred to/from the buffer. For reads (OUT * transfers) this may be less than the requested length. If the * short_not_ok flag is set, short reads are treated as errors * even when status otherwise indicates successful completion. - * Note that for writes (IN transfers) the data bytes may still - * reside in a device-side FIFO. + * Note that for writes (IN transfers) some data bytes may still + * reside in a device-side FIFO when the request is reported as + * complete. * * These are allocated/freed through the endpoint they're used with. The * hardware's driver can add extra per-request data to the memory it returns, @@ -287,6 +296,9 @@ usb_ep_free_buffer (struct usb_ep *ep, void *buf, dma_addr_t dma, unsigned len) * Each request is turned into one or more packets. The controller driver * never merges adjacent requests into the same packet. OUT transfers * will sometimes use data that's already buffered in the hardware. + * Drivers can rely on the fact that the first byte of the request's buffer + * always corresponds to the first byte of some USB packet, for both + * IN and OUT transfers. * * Bulk endpoints can queue any amount of data; the transfer is packetized * automatically. The last packet will be short if the request doesn't fill it @@ -361,6 +373,9 @@ static inline int usb_ep_dequeue (struct usb_ep *ep, struct usb_request *req) * * Returns zero, or a negative error code. On success, this call sets * underlying hardware state that blocks data transfers. + * Attempts to halt IN endpoints will fail (returning -EAGAIN) if any + * transfer requests are still queued, or if the controller hardware + * (usually a FIFO) still holds bytes that the host hasn't collected. */ static inline int usb_ep_set_halt (struct usb_ep *ep) @@ -393,8 +408,8 @@ usb_ep_clear_halt (struct usb_ep *ep) * * FIFO endpoints may have "unclaimed data" in them in certain cases, * such as after aborted transfers. Hosts may not have collected all - * the IN data written by the gadget driver, as reported by a request - * completion. The gadget driver may not have collected all the data + * the IN data written by the gadget driver (and reported by a request + * completion). The gadget driver may not have collected all the data * written OUT to it by the host. Drivers that need precise handling for * fault reporting or recovery may need to use this call. * diff --git a/include/linux/videodev.h b/include/linux/videodev.h index 8abbd9e9e596..9b00fb693783 100644 --- a/include/linux/videodev.h +++ b/include/linux/videodev.h @@ -429,6 +429,7 @@ struct video_code #define VID_HARDWARE_CPIA2 33 #define VID_HARDWARE_VICAM 34 #define VID_HARDWARE_SF16FMR2 35 +#define VID_HARDWARE_W9968CF 36 /* W996[87]CF JPEG USB Dual Mode Cam */ #endif /* __LINUX_VIDEODEV_H */ /* diff --git a/include/media/saa7146.h b/include/media/saa7146.h index d0d990469705..5e6b16299b05 100644 --- a/include/media/saa7146.h +++ b/include/media/saa7146.h @@ -87,6 +87,7 @@ struct saa7146_extension { char name[32]; /* name of the device */ #define SAA7146_USE_I2C_IRQ 0x1 +#define SAA7146_I2C_SHORT_DELAY 0x2 int flags; /* pairs of subvendor and subdevice ids for @@ -162,9 +163,10 @@ int saa7146_unregister_extension(struct saa7146_extension*); struct saa7146_format* format_by_fourcc(struct saa7146_dev *dev, int fourcc); int saa7146_pgtable_alloc(struct pci_dev *pci, struct saa7146_pgtable *pt); void saa7146_pgtable_free(struct pci_dev *pci, struct saa7146_pgtable *pt); -void saa7146_pgtable_build_single(struct pci_dev *pci, struct saa7146_pgtable *pt, struct scatterlist *list, int length ); +int saa7146_pgtable_build_single(struct pci_dev *pci, struct saa7146_pgtable *pt, struct scatterlist *list, int length ); char *saa7146_vmalloc_build_pgtable(struct pci_dev *pci, long length, struct saa7146_pgtable *pt); void saa7146_setgpio(struct saa7146_dev *dev, int port, u32 data); +int saa7146_wait_for_debi_done(struct saa7146_dev *dev); /* some memory sizes */ #define SAA7146_I2C_MEM ( 1*PAGE_SIZE) @@ -187,6 +189,9 @@ void saa7146_setgpio(struct saa7146_dev *dev, int port, u32 data); #define SAA7146_GPIO_OUTLO 0x40 #define SAA7146_GPIO_OUTHI 0x50 +/* debi defines */ +#define DEBINOSWAP 0x000e0000 + /* define for the register programming sequencer (rps) */ #define CMD_NOP 0x00000000 /* No operation */ #define CMD_CLR_EVENT 0x00000000 /* Clear event */ diff --git a/include/media/saa7146_vv.h b/include/media/saa7146_vv.h index f8362431c962..83d8b9d66830 100644 --- a/include/media/saa7146_vv.h +++ b/include/media/saa7146_vv.h @@ -149,7 +149,7 @@ struct saa7146_extension_ioctls }; /* flags */ -#define SAA7146_EXT_SWAP_ODD_EVEN 0x1 /* needs odd/even fields swapped */ +// #define SAA7146_EXT_SWAP_ODD_EVEN 0x1 /* needs odd/even fields swapped */ #define SAA7146_USE_PORT_B_FOR_VBI 0x2 /* use input port b for vbi hardware bug workaround */ struct saa7146_ext_vv @@ -171,12 +171,10 @@ struct saa7146_ext_vv struct saa7146_use_ops { void (*init)(struct saa7146_dev *, struct saa7146_vv *); - void(*open)(struct saa7146_dev *, struct saa7146_fh *); - void (*release)(struct saa7146_dev *, struct saa7146_fh *,struct file *); + void(*open)(struct saa7146_dev *, struct file *); + void (*release)(struct saa7146_dev *, struct file *); void (*irq_done)(struct saa7146_dev *, unsigned long status); ssize_t (*read)(struct file *, char *, size_t, loff_t *); - int (*capture_begin)(struct saa7146_fh *); - int (*capture_end)(struct saa7146_fh *); }; /* from saa7146_fops.c */ diff --git a/include/net/ax25.h b/include/net/ax25.h index 171b92848a25..26b5553e3cb0 100644 --- a/include/net/ax25.h +++ b/include/net/ax25.h @@ -227,8 +227,7 @@ extern void ax25_cb_add(ax25_cb *); struct sock *ax25_find_listener(ax25_address *, int, struct net_device *, int); struct sock *ax25_get_socket(ax25_address *, ax25_address *, int); extern ax25_cb *ax25_find_cb(ax25_address *, ax25_address *, ax25_digi *, struct net_device *); -extern struct sock *ax25_addr_match(ax25_address *); -extern void ax25_send_to_raw(struct sock *, struct sk_buff *, int); +extern void ax25_send_to_raw(ax25_address *, struct sk_buff *, int); extern void ax25_destroy_socket(ax25_cb *); extern ax25_cb *ax25_create_cb(void); extern void ax25_fillin_cb(ax25_cb *, ax25_dev *); diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h index 887987f4ba91..ca07367721df 100644 --- a/include/net/pkt_cls.h +++ b/include/net/pkt_cls.h @@ -81,7 +81,12 @@ static inline int tc_classify(struct sk_buff *skb, struct tcf_proto *tp, struct return -1; } - +static inline void tcf_destroy(struct tcf_proto *tp) +{ + tp->ops->destroy(tp); + module_put(tp->ops->owner); + kfree(tp); +} extern int register_tcf_proto_ops(struct tcf_proto_ops *ops); extern int unregister_tcf_proto_ops(struct tcf_proto_ops *ops); diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index bf33562cd101..7edb15d6561a 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h @@ -90,7 +90,6 @@ #include <net/snmp.h> #include <net/sctp/structs.h> #include <net/sctp/constants.h> -#include <net/sctp/sm.h> /* Set SCTP_DEBUG flag via config if not already set. */ diff --git a/include/net/sock.h b/include/net/sock.h index ac2eccb7ff9a..1d85a3e5a3cc 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -542,24 +542,9 @@ static inline struct inode *SOCK_INODE(struct socket *socket) extern void __lock_sock(struct sock *sk); extern void __release_sock(struct sock *sk); #define sock_owned_by_user(sk) ((sk)->sk_lock.owner) -#define lock_sock(__sk) \ -do { might_sleep(); \ - spin_lock_bh(&((__sk)->sk_lock.slock)); \ - if ((__sk)->sk_lock.owner) \ - __lock_sock(__sk); \ - (__sk)->sk_lock.owner = (void *)1; \ - spin_unlock_bh(&((__sk)->sk_lock.slock)); \ -} while(0) -#define release_sock(__sk) \ -do { spin_lock_bh(&((__sk)->sk_lock.slock)); \ - if ((__sk)->sk_backlog.tail) \ - __release_sock(__sk); \ - (__sk)->sk_lock.owner = NULL; \ - if (waitqueue_active(&((__sk)->sk_lock.wq))) \ - wake_up(&((__sk)->sk_lock.wq)); \ - spin_unlock_bh(&((__sk)->sk_lock.slock)); \ -} while(0) +extern void lock_sock(struct sock *sk); +extern void release_sock(struct sock *sk); /* BH context may only use the following locking interface. */ #define bh_lock_sock(__sk) spin_lock(&((__sk)->sk_lock.slock)) diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 2ae391720d4d..67072071aec1 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -860,7 +860,7 @@ extern void xfrm_policy_flush(void); extern void xfrm_policy_kill(struct xfrm_policy *); extern int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol); extern struct xfrm_policy *xfrm_sk_policy_lookup(struct sock *sk, int dir, struct flowi *fl); -extern int xfrm_flush_bundles(struct xfrm_state *x); +extern int xfrm_flush_bundles(void); extern wait_queue_head_t km_waitq; extern void km_state_expired(struct xfrm_state *x, int hard); diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index 832e4edd1808..55250d85e2c0 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h @@ -302,6 +302,7 @@ struct scsi_lun { #define QUEUED 0x2004 #define SOFT_ERROR 0x2005 #define ADD_TO_MLQUEUE 0x2006 +#define TIMEOUT 0x2007 /* * Midlevel queue return values. |
