aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2006-12-01 04:56:43 -0500
committerDavid Woodhouse <dwmw2@infradead.org>2006-12-01 04:56:43 -0500
commitbd3c97a7c718bfb9f1e4f31c16c383a5c6f815eb (patch)
tree3f56594e813c6f35cbacbdb3e137ba5bfd0b3069 /include
parent6c33cafc794d07c9254c160789120a0e98c088c9 (diff)
parent0215ffb08ce99e2bb59eca114a99499a4d06e704 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'include')
-rw-r--r--include/asm-arm/arch-ebsa110/io.h16
-rw-r--r--include/asm-arm/arch-pxa/irqs.h2
-rw-r--r--include/asm-arm/arch-pxa/pxa-regs.h8
-rw-r--r--include/asm-arm/arch-pxa/udc.h17
-rw-r--r--include/asm-arm/dma-mapping.h4
-rw-r--r--include/asm-arm/mach/udc_pxa2xx.h26
-rw-r--r--include/asm-arm/uaccess.h20
-rw-r--r--include/asm-avr32/atomic.h8
-rw-r--r--include/asm-avr32/io.h33
-rw-r--r--include/asm-avr32/unistd.h3
-rw-r--r--include/asm-generic/vmlinux.lds.h35
-rw-r--r--include/asm-i386/acpi.h1
-rw-r--r--include/asm-i386/io_apic.h29
-rw-r--r--include/asm-i386/mach-summit/mach_apic.h4
-rw-r--r--include/asm-i386/mach-visws/do_timer.h53
-rw-r--r--include/asm-i386/mach-visws/mach_apic.h5
-rw-r--r--include/asm-ia64/sal.h1
-rw-r--r--include/asm-ia64/sn/addrs.h6
-rw-r--r--include/asm-ia64/uaccess.h2
-rw-r--r--include/asm-m68knommu/irq_regs.h1
-rw-r--r--include/asm-m68knommu/irqnode.h8
-rw-r--r--include/asm-m68knommu/machdep.h2
-rw-r--r--include/asm-mips/asm.h2
-rw-r--r--include/asm-mips/cacheflush.h19
-rw-r--r--include/asm-mips/div64.h21
-rw-r--r--include/asm-mips/fixmap.h14
-rw-r--r--include/asm-mips/irq.h4
-rw-r--r--include/asm-mips/mach-au1x00/au1xxx_ide.h6
-rw-r--r--include/asm-mips/mipsmtregs.h2
-rw-r--r--include/asm-mips/pgalloc.h2
-rw-r--r--include/asm-mips/pgtable-64.h2
-rw-r--r--include/asm-mips/sibyte/sb1250.h2
-rw-r--r--include/asm-mips/system.h2
-rw-r--r--include/asm-mips/time.h10
-rw-r--r--include/asm-mips/unistd.h19
-rw-r--r--include/asm-parisc/semaphore.h6
-rw-r--r--include/asm-powerpc/asm-compat.h52
-rw-r--r--include/asm-powerpc/cputable.h37
-rw-r--r--include/asm-powerpc/current.h12
-rw-r--r--include/asm-powerpc/firmware.h17
-rw-r--r--include/asm-powerpc/i8259.h1
-rw-r--r--include/asm-powerpc/io.h7
-rw-r--r--include/asm-powerpc/iommu.h22
-rw-r--r--include/asm-powerpc/oprofile_impl.h87
-rw-r--r--include/asm-powerpc/pmc.h13
-rw-r--r--include/asm-powerpc/ppc_asm.h18
-rw-r--r--include/asm-powerpc/prom.h10
-rw-r--r--include/asm-powerpc/reg.h26
-rw-r--r--include/asm-powerpc/systbl.h3
-rw-r--r--include/asm-powerpc/system.h6
-rw-r--r--include/asm-powerpc/tce.h3
-rw-r--r--include/asm-powerpc/time.h31
-rw-r--r--include/asm-powerpc/timex.h20
-rw-r--r--include/asm-powerpc/topology.h8
-rw-r--r--include/asm-powerpc/unistd.h5
-rw-r--r--include/asm-sh/edosk7705.h (renamed from include/asm-sh/edosk7705/io.h)0
-rw-r--r--include/asm-sh/hp6xx.h (renamed from include/asm-sh/hp6xx/hp6xx.h)0
-rw-r--r--include/asm-sh/hp6xx/ide.h8
-rw-r--r--include/asm-sh/hp6xx/io.h10
-rw-r--r--include/asm-sh/hs7751rvoip.h (renamed from include/asm-sh/hs7751rvoip/hs7751rvoip.h)0
-rw-r--r--include/asm-sh/hs7751rvoip/ide.h8
-rw-r--r--include/asm-sh/irq-sh7780.h10
-rw-r--r--include/asm-sh/irq.h31
-rw-r--r--include/asm-sh/landisk/ide.h14
-rw-r--r--include/asm-sh/processor.h2
-rw-r--r--include/asm-sh/r7780rp.h (renamed from include/asm-sh/r7780rp/r7780rp.h)6
-rw-r--r--include/asm-sh/r7780rp/ide.h8
-rw-r--r--include/asm-sh/rts7751r2d.h (renamed from include/asm-sh/rts7751r2d/rts7751r2d.h)0
-rw-r--r--include/asm-sh/rts7751r2d/ide.h8
-rw-r--r--include/asm-sh/sh03/ide.h7
-rw-r--r--include/asm-sh/shmin.h (renamed from include/asm-sh/shmin/shmin.h)0
-rw-r--r--include/asm-sh/system.h7
-rw-r--r--include/asm-sh/unistd.h5
-rw-r--r--include/asm-sparc/unistd.h9
-rw-r--r--include/asm-sparc64/compat.h7
-rw-r--r--include/asm-sparc64/futex.h18
-rw-r--r--include/asm-sparc64/unistd.h10
-rw-r--r--include/asm-um/common.lds.S8
-rw-r--r--include/asm-x86_64/acpi.h1
-rw-r--r--include/asm-x86_64/hw_irq.h2
-rw-r--r--include/asm-x86_64/io_apic.h34
-rw-r--r--include/asm-x86_64/pda.h9
-rw-r--r--include/asm-x86_64/pgtable.h1
-rw-r--r--include/asm-x86_64/proto.h2
-rw-r--r--include/asm-x86_64/vsyscall.h2
-rw-r--r--include/linux/compat.h6
-rw-r--r--include/linux/compat_ioctl.h1
-rw-r--r--include/linux/crypto.h2
-rw-r--r--include/linux/device.h2
-rw-r--r--include/linux/dmi.h2
-rw-r--r--include/linux/fs.h7
-rw-r--r--include/linux/htirq.h16
-rw-r--r--include/linux/hugetlb.h10
-rw-r--r--include/linux/igmp.h2
-rw-r--r--include/linux/in6.h12
-rw-r--r--include/linux/init.h36
-rw-r--r--include/linux/ipmi_msgdefs.h2
-rw-r--r--include/linux/ipx.h14
-rw-r--r--include/linux/kernel.h6
-rw-r--r--include/linux/libata.h3
-rw-r--r--include/linux/mempolicy.h2
-rw-r--r--include/linux/mmzone.h12
-rw-r--r--include/linux/msdos_fs.h2
-rw-r--r--include/linux/mtd/nand.h2
-rw-r--r--include/linux/netdevice.h6
-rw-r--r--include/linux/netfilter/x_tables.h16
-rw-r--r--include/linux/netfilter_arp/arp_tables.h25
-rw-r--r--include/linux/netfilter_ipv4/ip_tables.h27
-rw-r--r--include/linux/netfilter_ipv6/ip6_tables.h27
-rw-r--r--include/linux/nfsd/nfsd.h2
-rw-r--r--include/linux/nsproxy.h4
-rw-r--r--include/linux/pagemap.h14
-rw-r--r--include/linux/pci.h13
-rw-r--r--include/linux/pci_ids.h1
-rw-r--r--include/linux/pci_regs.h1
-rw-r--r--include/linux/personality.h2
-rw-r--r--include/linux/pm.h4
-rw-r--r--include/linux/raid/bitmap.h20
-rw-r--r--include/linux/raid/md_p.h56
-rw-r--r--include/linux/sched.h1
-rw-r--r--include/linux/spinlock.h14
-rw-r--r--include/linux/spinlock_api_smp.h2
-rw-r--r--include/linux/sysctl.h23
-rw-r--r--include/linux/taskstats_kern.h31
-rw-r--r--include/linux/ufs_fs.h2
-rw-r--r--include/linux/unwind.h2
-rw-r--r--include/linux/vmalloc.h6
-rw-r--r--include/linux/wait.h9
-rw-r--r--include/net/dn.h5
-rw-r--r--include/net/flow.h3
-rw-r--r--include/net/ieee80211softmac.h35
-rw-r--r--include/net/inet_ecn.h2
-rw-r--r--include/net/ip_vs.h1
-rw-r--r--include/net/ipx.h26
-rw-r--r--include/net/sock.h16
-rw-r--r--include/rdma/ib_addr.h20
-rw-r--r--include/rdma/ib_user_verbs.h2
-rw-r--r--include/scsi/libiscsi.h3
-rw-r--r--include/scsi/libsas.h1
-rw-r--r--include/scsi/scsi.h5
-rw-r--r--include/scsi/scsi_transport_iscsi.h4
-rw-r--r--include/sound/version.h2
142 files changed, 892 insertions, 680 deletions
diff --git a/include/asm-arm/arch-ebsa110/io.h b/include/asm-arm/arch-ebsa110/io.h
index ae048441c9ed..722c5e086285 100644
--- a/include/asm-arm/arch-ebsa110/io.h
+++ b/include/asm-arm/arch-ebsa110/io.h
@@ -27,9 +27,9 @@ void __outw(u16 val, unsigned int port);
27u32 __inl(unsigned int port); 27u32 __inl(unsigned int port);
28void __outl(u32 val, unsigned int port); 28void __outl(u32 val, unsigned int port);
29 29
30u8 __readb(void __iomem *addr); 30u8 __readb(const volatile void __iomem *addr);
31u16 __readw(void __iomem *addr); 31u16 __readw(const volatile void __iomem *addr);
32u32 __readl(void __iomem *addr); 32u32 __readl(const volatile void __iomem *addr);
33 33
34void __writeb(u8 val, void __iomem *addr); 34void __writeb(u8 val, void __iomem *addr);
35void __writew(u16 val, void __iomem *addr); 35void __writew(u16 val, void __iomem *addr);
@@ -64,8 +64,14 @@ void __writel(u32 val, void __iomem *addr);
64#define writew(v,b) __writew(v,b) 64#define writew(v,b) __writew(v,b)
65#define writel(v,b) __writel(v,b) 65#define writel(v,b) __writel(v,b)
66 66
67#define __arch_ioremap(cookie,sz,c) ((void __iomem *)(cookie)) 67static inline void __iomem *__arch_ioremap(unsigned long cookie, size_t size,
68#define __arch_iounmap(cookie) do { } while (0) 68 unsigned int flags)
69{
70 return (void __iomem *)cookie;
71}
72
73#define __arch_ioremap __arch_ioremap
74#define __arch_iounmap(cookie) do { } while (0)
69 75
70extern void insb(unsigned int port, void *buf, int sz); 76extern void insb(unsigned int port, void *buf, int sz);
71extern void insw(unsigned int port, void *buf, int sz); 77extern void insw(unsigned int port, void *buf, int sz);
diff --git a/include/asm-arm/arch-pxa/irqs.h b/include/asm-arm/arch-pxa/irqs.h
index f3bc70eee35b..67ed43674c63 100644
--- a/include/asm-arm/arch-pxa/irqs.h
+++ b/include/asm-arm/arch-pxa/irqs.h
@@ -73,7 +73,7 @@
73#define IRQ_TO_GPIO(i) (((i) < IRQ_GPIO(2)) ? ((i) - IRQ_GPIO0) : IRQ_TO_GPIO_2_x(i)) 73#define IRQ_TO_GPIO(i) (((i) < IRQ_GPIO(2)) ? ((i) - IRQ_GPIO0) : IRQ_TO_GPIO_2_x(i))
74 74
75#if defined(CONFIG_PXA25x) 75#if defined(CONFIG_PXA25x)
76#define PXA_LAST_GPIO 80 76#define PXA_LAST_GPIO 84
77#elif defined(CONFIG_PXA27x) 77#elif defined(CONFIG_PXA27x)
78#define PXA_LAST_GPIO 127 78#define PXA_LAST_GPIO 127
79#endif 79#endif
diff --git a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h
index 68731e0923a4..cff752f35230 100644
--- a/include/asm-arm/arch-pxa/pxa-regs.h
+++ b/include/asm-arm/arch-pxa/pxa-regs.h
@@ -2242,7 +2242,7 @@
2242 2242
2243#define CICR1_TBIT (1 << 31) /* Transparency bit */ 2243#define CICR1_TBIT (1 << 31) /* Transparency bit */
2244#define CICR1_RGBT_CONV (0x3 << 30) /* RGBT conversion mask */ 2244#define CICR1_RGBT_CONV (0x3 << 30) /* RGBT conversion mask */
2245#define CICR1_PPL (0x3f << 15) /* Pixels per line mask */ 2245#define CICR1_PPL (0x7ff << 15) /* Pixels per line mask */
2246#define CICR1_RGB_CONV (0x7 << 12) /* RGB conversion mask */ 2246#define CICR1_RGB_CONV (0x7 << 12) /* RGB conversion mask */
2247#define CICR1_RGB_F (1 << 11) /* RGB format */ 2247#define CICR1_RGB_F (1 << 11) /* RGB format */
2248#define CICR1_YCBCR_F (1 << 10) /* YCbCr format */ 2248#define CICR1_YCBCR_F (1 << 10) /* YCbCr format */
@@ -2268,7 +2268,7 @@
2268#define CICR3_VSW (0x3f << 10) /* Vertical sync pulse width mask */ 2268#define CICR3_VSW (0x3f << 10) /* Vertical sync pulse width mask */
2269#define CICR3_BFPW (0x3f << 3) /* Beginning-of-frame pixel clock 2269#define CICR3_BFPW (0x3f << 3) /* Beginning-of-frame pixel clock
2270 wait count mask */ 2270 wait count mask */
2271#define CICR3_LPF (0x3ff << 0) /* Lines per frame mask */ 2271#define CICR3_LPF (0x7ff << 0) /* Lines per frame mask */
2272 2272
2273#define CICR4_MCLK_DLY (0x3 << 24) /* MCLK Data Capture Delay mask */ 2273#define CICR4_MCLK_DLY (0x3 << 24) /* MCLK Data Capture Delay mask */
2274#define CICR4_PCLK_EN (1 << 23) /* Pixel clock enable */ 2274#define CICR4_PCLK_EN (1 << 23) /* Pixel clock enable */
@@ -2289,8 +2289,8 @@
2289#define CISR_EOL (1 << 8) /* End of line */ 2289#define CISR_EOL (1 << 8) /* End of line */
2290#define CISR_PAR_ERR (1 << 7) /* Parity error */ 2290#define CISR_PAR_ERR (1 << 7) /* Parity error */
2291#define CISR_CQD (1 << 6) /* Camera interface quick disable */ 2291#define CISR_CQD (1 << 6) /* Camera interface quick disable */
2292#define CISR_SOF (1 << 5) /* Start of frame */ 2292#define CISR_CDD (1 << 5) /* Camera interface disable done */
2293#define CISR_CDD (1 << 4) /* Camera interface disable done */ 2293#define CISR_SOF (1 << 4) /* Start of frame */
2294#define CISR_EOF (1 << 3) /* End of frame */ 2294#define CISR_EOF (1 << 3) /* End of frame */
2295#define CISR_IFO_2 (1 << 2) /* FIFO overrun for Channel 2 */ 2295#define CISR_IFO_2 (1 << 2) /* FIFO overrun for Channel 2 */
2296#define CISR_IFO_1 (1 << 1) /* FIFO overrun for Channel 1 */ 2296#define CISR_IFO_1 (1 << 1) /* FIFO overrun for Channel 1 */
diff --git a/include/asm-arm/arch-pxa/udc.h b/include/asm-arm/arch-pxa/udc.h
index 121cd241115d..646480d37256 100644
--- a/include/asm-arm/arch-pxa/udc.h
+++ b/include/asm-arm/arch-pxa/udc.h
@@ -4,23 +4,8 @@
4 * This supports machine-specific differences in how the PXA2xx 4 * This supports machine-specific differences in how the PXA2xx
5 * USB Device Controller (UDC) is wired. 5 * USB Device Controller (UDC) is wired.
6 * 6 *
7 * It is set in linux/arch/arm/mach-pxa/<machine>.c and used in
8 * the probe routine of linux/drivers/usb/gadget/pxa2xx_udc.c
9 */ 7 */
10struct pxa2xx_udc_mach_info { 8#include <asm/mach/udc_pxa2xx.h>
11 int (*udc_is_connected)(void); /* do we see host? */
12 void (*udc_command)(int cmd);
13#define PXA2XX_UDC_CMD_CONNECT 0 /* let host see us */
14#define PXA2XX_UDC_CMD_DISCONNECT 1 /* so host won't see us */
15
16 /* Boards following the design guidelines in the developer's manual,
17 * with on-chip GPIOs not Lubbock's wierd hardware, can have a sane
18 * VBUS IRQ and omit the methods above. Store the GPIO number
19 * here; for GPIO 0, also mask in one of the pxa_gpio_mode() bits.
20 */
21 u16 gpio_vbus; /* high == vbus present */
22 u16 gpio_pullup; /* high == pullup activated */
23};
24 9
25extern void pxa_set_udc_info(struct pxa2xx_udc_mach_info *info); 10extern void pxa_set_udc_info(struct pxa2xx_udc_mach_info *info);
26 11
diff --git a/include/asm-arm/dma-mapping.h b/include/asm-arm/dma-mapping.h
index 55eb4dc3253d..666617711c81 100644
--- a/include/asm-arm/dma-mapping.h
+++ b/include/asm-arm/dma-mapping.h
@@ -12,6 +12,10 @@
12 * uncached, unwrite-buffered mapped memory space for use with DMA 12 * uncached, unwrite-buffered mapped memory space for use with DMA
13 * devices. This is the "generic" version. The PCI specific version 13 * devices. This is the "generic" version. The PCI specific version
14 * is in pci.h 14 * is in pci.h
15 *
16 * Note: Drivers should NOT use this function directly, as it will break
17 * platforms with CONFIG_DMABOUNCE.
18 * Use the driver DMA support - see dma-mapping.h (dma_sync_*)
15 */ 19 */
16extern void consistent_sync(void *kaddr, size_t size, int rw); 20extern void consistent_sync(void *kaddr, size_t size, int rw);
17 21
diff --git a/include/asm-arm/mach/udc_pxa2xx.h b/include/asm-arm/mach/udc_pxa2xx.h
new file mode 100644
index 000000000000..ff0a95715a07
--- /dev/null
+++ b/include/asm-arm/mach/udc_pxa2xx.h
@@ -0,0 +1,26 @@
1/*
2 * linux/include/asm-arm/mach/udc_pxa2xx.h
3 *
4 * This supports machine-specific differences in how the PXA2xx
5 * USB Device Controller (UDC) is wired.
6 *
7 * It is set in linux/arch/arm/mach-pxa/<machine>.c or in
8 * linux/arch/mach-ixp4xx/<machine>.c and used in
9 * the probe routine of linux/drivers/usb/gadget/pxa2xx_udc.c
10 */
11
12struct pxa2xx_udc_mach_info {
13 int (*udc_is_connected)(void); /* do we see host? */
14 void (*udc_command)(int cmd);
15#define PXA2XX_UDC_CMD_CONNECT 0 /* let host see us */
16#define PXA2XX_UDC_CMD_DISCONNECT 1 /* so host won't see us */
17
18 /* Boards following the design guidelines in the developer's manual,
19 * with on-chip GPIOs not Lubbock's wierd hardware, can have a sane
20 * VBUS IRQ and omit the methods above. Store the GPIO number
21 * here; for GPIO 0, also mask in one of the pxa_gpio_mode() bits.
22 */
23 u16 gpio_vbus; /* high == vbus present */
24 u16 gpio_pullup; /* high == pullup activated */
25};
26
diff --git a/include/asm-arm/uaccess.h b/include/asm-arm/uaccess.h
index 09ad0cab9014..5f420a0149f1 100644
--- a/include/asm-arm/uaccess.h
+++ b/include/asm-arm/uaccess.h
@@ -383,19 +383,19 @@ do { \
383 383
384 384
385#ifdef CONFIG_MMU 385#ifdef CONFIG_MMU
386extern unsigned long __copy_from_user(void *to, const void __user *from, unsigned long n); 386extern unsigned long __must_check __copy_from_user(void *to, const void __user *from, unsigned long n);
387extern unsigned long __copy_to_user(void __user *to, const void *from, unsigned long n); 387extern unsigned long __must_check __copy_to_user(void __user *to, const void *from, unsigned long n);
388extern unsigned long __clear_user(void __user *addr, unsigned long n); 388extern unsigned long __must_check __clear_user(void __user *addr, unsigned long n);
389#else 389#else
390#define __copy_from_user(to,from,n) (memcpy(to, (void __force *)from, n), 0) 390#define __copy_from_user(to,from,n) (memcpy(to, (void __force *)from, n), 0)
391#define __copy_to_user(to,from,n) (memcpy((void __force *)to, from, n), 0) 391#define __copy_to_user(to,from,n) (memcpy((void __force *)to, from, n), 0)
392#define __clear_user(addr,n) (memset((void __force *)addr, 0, n), 0) 392#define __clear_user(addr,n) (memset((void __force *)addr, 0, n), 0)
393#endif 393#endif
394 394
395extern unsigned long __strncpy_from_user(char *to, const char __user *from, unsigned long count); 395extern unsigned long __must_check __strncpy_from_user(char *to, const char __user *from, unsigned long count);
396extern unsigned long __strnlen_user(const char __user *s, long n); 396extern unsigned long __must_check __strnlen_user(const char __user *s, long n);
397 397
398static inline unsigned long copy_from_user(void *to, const void __user *from, unsigned long n) 398static inline unsigned long __must_check copy_from_user(void *to, const void __user *from, unsigned long n)
399{ 399{
400 if (access_ok(VERIFY_READ, from, n)) 400 if (access_ok(VERIFY_READ, from, n))
401 n = __copy_from_user(to, from, n); 401 n = __copy_from_user(to, from, n);
@@ -404,7 +404,7 @@ static inline unsigned long copy_from_user(void *to, const void __user *from, un
404 return n; 404 return n;
405} 405}
406 406
407static inline unsigned long copy_to_user(void __user *to, const void *from, unsigned long n) 407static inline unsigned long __must_check copy_to_user(void __user *to, const void *from, unsigned long n)
408{ 408{
409 if (access_ok(VERIFY_WRITE, to, n)) 409 if (access_ok(VERIFY_WRITE, to, n))
410 n = __copy_to_user(to, from, n); 410 n = __copy_to_user(to, from, n);
@@ -414,14 +414,14 @@ static inline unsigned long copy_to_user(void __user *to, const void *from, unsi
414#define __copy_to_user_inatomic __copy_to_user 414#define __copy_to_user_inatomic __copy_to_user
415#define __copy_from_user_inatomic __copy_from_user 415#define __copy_from_user_inatomic __copy_from_user
416 416
417static inline unsigned long clear_user(void __user *to, unsigned long n) 417static inline unsigned long __must_check clear_user(void __user *to, unsigned long n)
418{ 418{
419 if (access_ok(VERIFY_WRITE, to, n)) 419 if (access_ok(VERIFY_WRITE, to, n))
420 n = __clear_user(to, n); 420 n = __clear_user(to, n);
421 return n; 421 return n;
422} 422}
423 423
424static inline long strncpy_from_user(char *dst, const char __user *src, long count) 424static inline long __must_check strncpy_from_user(char *dst, const char __user *src, long count)
425{ 425{
426 long res = -EFAULT; 426 long res = -EFAULT;
427 if (access_ok(VERIFY_READ, src, 1)) 427 if (access_ok(VERIFY_READ, src, 1))
@@ -431,7 +431,7 @@ static inline long strncpy_from_user(char *dst, const char __user *src, long cou
431 431
432#define strlen_user(s) strnlen_user(s, ~0UL >> 1) 432#define strlen_user(s) strnlen_user(s, ~0UL >> 1)
433 433
434static inline long strnlen_user(const char __user *s, long n) 434static inline long __must_check strnlen_user(const char __user *s, long n)
435{ 435{
436 unsigned long res = 0; 436 unsigned long res = 0;
437 437
diff --git a/include/asm-avr32/atomic.h b/include/asm-avr32/atomic.h
index e0b9c44c126c..c40b6032c480 100644
--- a/include/asm-avr32/atomic.h
+++ b/include/asm-avr32/atomic.h
@@ -41,7 +41,7 @@ static inline int atomic_sub_return(int i, atomic_t *v)
41 " stcond %1, %0\n" 41 " stcond %1, %0\n"
42 " brne 1b" 42 " brne 1b"
43 : "=&r"(result), "=o"(v->counter) 43 : "=&r"(result), "=o"(v->counter)
44 : "m"(v->counter), "ir"(i) 44 : "m"(v->counter), "rKs21"(i)
45 : "cc"); 45 : "cc");
46 46
47 return result; 47 return result;
@@ -58,7 +58,7 @@ static inline int atomic_add_return(int i, atomic_t *v)
58{ 58{
59 int result; 59 int result;
60 60
61 if (__builtin_constant_p(i)) 61 if (__builtin_constant_p(i) && (i >= -1048575) && (i <= 1048576))
62 result = atomic_sub_return(-i, v); 62 result = atomic_sub_return(-i, v);
63 else 63 else
64 asm volatile( 64 asm volatile(
@@ -101,7 +101,7 @@ static inline int atomic_sub_unless(atomic_t *v, int a, int u)
101 " mov %1, 1\n" 101 " mov %1, 1\n"
102 "1:" 102 "1:"
103 : "=&r"(tmp), "=&r"(result), "=o"(v->counter) 103 : "=&r"(tmp), "=&r"(result), "=o"(v->counter)
104 : "m"(v->counter), "ir"(a), "ir"(u) 104 : "m"(v->counter), "rKs21"(a), "rKs21"(u)
105 : "cc", "memory"); 105 : "cc", "memory");
106 106
107 return result; 107 return result;
@@ -121,7 +121,7 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u)
121{ 121{
122 int tmp, result; 122 int tmp, result;
123 123
124 if (__builtin_constant_p(a)) 124 if (__builtin_constant_p(a) && (a >= -1048575) && (a <= 1048576))
125 result = atomic_sub_unless(v, -a, u); 125 result = atomic_sub_unless(v, -a, u);
126 else { 126 else {
127 result = 0; 127 result = 0;
diff --git a/include/asm-avr32/io.h b/include/asm-avr32/io.h
index 2fc8f111dce9..eec47500fa66 100644
--- a/include/asm-avr32/io.h
+++ b/include/asm-avr32/io.h
@@ -76,6 +76,39 @@ static inline unsigned int readl(const volatile void __iomem *addr)
76#define readsw(p, d, l) __raw_readsw((unsigned int)p, d, l) 76#define readsw(p, d, l) __raw_readsw((unsigned int)p, d, l)
77#define readsl(p, d, l) __raw_readsl((unsigned int)p, d, l) 77#define readsl(p, d, l) __raw_readsl((unsigned int)p, d, l)
78 78
79
80/*
81 * io{read,write}{8,16,32} macros in both le (for PCI style consumers) and native be
82 */
83#ifndef ioread8
84
85#define ioread8(p) ({ unsigned int __v = __raw_readb(p); __v; })
86
87#define ioread16(p) ({ unsigned int __v = le16_to_cpu(__raw_readw(p)); __v; })
88#define ioread16be(p) ({ unsigned int __v = be16_to_cpu(__raw_readw(p)); __v; })
89
90#define ioread32(p) ({ unsigned int __v = le32_to_cpu(__raw_readl(p)); __v; })
91#define ioread32be(p) ({ unsigned int __v = be32_to_cpu(__raw_readl(p)); __v; })
92
93#define iowrite8(v,p) __raw_writeb(v, p)
94
95#define iowrite16(v,p) __raw_writew(cpu_to_le16(v), p)
96#define iowrite16be(v,p) __raw_writew(cpu_to_be16(v), p)
97
98#define iowrite32(v,p) __raw_writel(cpu_to_le32(v), p)
99#define iowrite32be(v,p) __raw_writel(cpu_to_be32(v), p)
100
101#define ioread8_rep(p,d,c) __raw_readsb(p,d,c)
102#define ioread16_rep(p,d,c) __raw_readsw(p,d,c)
103#define ioread32_rep(p,d,c) __raw_readsl(p,d,c)
104
105#define iowrite8_rep(p,s,c) __raw_writesb(p,s,c)
106#define iowrite16_rep(p,s,c) __raw_writesw(p,s,c)
107#define iowrite32_rep(p,s,c) __raw_writesl(p,s,c)
108
109#endif
110
111
79/* 112/*
80 * These two are only here because ALSA _thinks_ it needs them... 113 * These two are only here because ALSA _thinks_ it needs them...
81 */ 114 */
diff --git a/include/asm-avr32/unistd.h b/include/asm-avr32/unistd.h
index a50e5004550c..56ed1f9d348a 100644
--- a/include/asm-avr32/unistd.h
+++ b/include/asm-avr32/unistd.h
@@ -280,9 +280,10 @@
280#define __NR_sync_file_range 262 280#define __NR_sync_file_range 262
281#define __NR_tee 263 281#define __NR_tee 263
282#define __NR_vmsplice 264 282#define __NR_vmsplice 264
283#define __NR_epoll_pwait 265
283 284
284#ifdef __KERNEL__ 285#ifdef __KERNEL__
285#define NR_syscalls 265 286#define NR_syscalls 266
286 287
287 288
288#define __ARCH_WANT_IPC_PARSE_VERSION 289#define __ARCH_WANT_IPC_PARSE_VERSION
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 69240b52f8e1..e60d6f21fa62 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -125,6 +125,10 @@
125 *(__param) \ 125 *(__param) \
126 VMLINUX_SYMBOL(__stop___param) = .; \ 126 VMLINUX_SYMBOL(__stop___param) = .; \
127 } \ 127 } \
128 \
129 /* Unwind data binary search table */ \
130 EH_FRAME_HDR \
131 \
128 __end_rodata = .; \ 132 __end_rodata = .; \
129 . = ALIGN(4096); 133 . = ALIGN(4096);
130 134
@@ -157,6 +161,18 @@
157 *(.kprobes.text) \ 161 *(.kprobes.text) \
158 VMLINUX_SYMBOL(__kprobes_text_end) = .; 162 VMLINUX_SYMBOL(__kprobes_text_end) = .;
159 163
164#ifdef CONFIG_STACK_UNWIND
165 /* Unwind data binary search table */
166#define EH_FRAME_HDR \
167 .eh_frame_hdr : AT(ADDR(.eh_frame_hdr) - LOAD_OFFSET) { \
168 VMLINUX_SYMBOL(__start_unwind_hdr) = .; \
169 *(.eh_frame_hdr) \
170 VMLINUX_SYMBOL(__end_unwind_hdr) = .; \
171 }
172#else
173#define EH_FRAME_HDR
174#endif
175
160 /* DWARF debug sections. 176 /* DWARF debug sections.
161 Symbols in the DWARF debugging sections are relative to 177 Symbols in the DWARF debugging sections are relative to
162 the beginning of the section so we begin them at 0. */ 178 the beginning of the section so we begin them at 0. */
@@ -197,3 +213,22 @@
197 213
198#define NOTES \ 214#define NOTES \
199 .notes : { *(.note.*) } :note 215 .notes : { *(.note.*) } :note
216
217#define INITCALLS \
218 *(.initcall0.init) \
219 *(.initcall0s.init) \
220 *(.initcall1.init) \
221 *(.initcall1s.init) \
222 *(.initcall2.init) \
223 *(.initcall2s.init) \
224 *(.initcall3.init) \
225 *(.initcall3s.init) \
226 *(.initcall4.init) \
227 *(.initcall4s.init) \
228 *(.initcall5.init) \
229 *(.initcall5s.init) \
230 *(.initcall6.init) \
231 *(.initcall6s.init) \
232 *(.initcall7.init) \
233 *(.initcall7s.init)
234
diff --git a/include/asm-i386/acpi.h b/include/asm-i386/acpi.h
index 6016632d032f..c80b3a94511a 100644
--- a/include/asm-i386/acpi.h
+++ b/include/asm-i386/acpi.h
@@ -132,6 +132,7 @@ extern int acpi_gsi_to_irq(u32 gsi, unsigned int *irq);
132 132
133#ifdef CONFIG_X86_IO_APIC 133#ifdef CONFIG_X86_IO_APIC
134extern int acpi_skip_timer_override; 134extern int acpi_skip_timer_override;
135extern int acpi_use_timer_override;
135#endif 136#endif
136 137
137static inline void acpi_noirq_set(void) { acpi_noirq = 1; } 138static inline void acpi_noirq_set(void) { acpi_noirq = 1; }
diff --git a/include/asm-i386/io_apic.h b/include/asm-i386/io_apic.h
index 276ea7e8144a..059a9ff28b4d 100644
--- a/include/asm-i386/io_apic.h
+++ b/include/asm-i386/io_apic.h
@@ -12,10 +12,6 @@
12 12
13#ifdef CONFIG_X86_IO_APIC 13#ifdef CONFIG_X86_IO_APIC
14 14
15#define IO_APIC_BASE(idx) \
16 ((volatile int *)(__fix_to_virt(FIX_IO_APIC_BASE_0 + idx) \
17 + (mp_ioapics[idx].mpc_apicaddr & ~PAGE_MASK)))
18
19/* 15/*
20 * The structure of the IO-APIC: 16 * The structure of the IO-APIC:
21 */ 17 */
@@ -119,31 +115,8 @@ extern struct mpc_config_intsrc mp_irqs[MAX_IRQ_SOURCES];
119/* non-0 if default (table-less) MP configuration */ 115/* non-0 if default (table-less) MP configuration */
120extern int mpc_default_type; 116extern int mpc_default_type;
121 117
122static inline unsigned int io_apic_read(unsigned int apic, unsigned int reg) 118/* Older SiS APIC requires we rewrite the index register */
123{
124 *IO_APIC_BASE(apic) = reg;
125 return *(IO_APIC_BASE(apic)+4);
126}
127
128static inline void io_apic_write(unsigned int apic, unsigned int reg, unsigned int value)
129{
130 *IO_APIC_BASE(apic) = reg;
131 *(IO_APIC_BASE(apic)+4) = value;
132}
133
134/*
135 * Re-write a value: to be used for read-modify-write
136 * cycles where the read already set up the index register.
137 *
138 * Older SiS APIC requires we rewrite the index regiser
139 */
140extern int sis_apic_bug; 119extern int sis_apic_bug;
141static inline void io_apic_modify(unsigned int apic, unsigned int reg, unsigned int value)
142{
143 if (sis_apic_bug)
144 *IO_APIC_BASE(apic) = reg;
145 *(IO_APIC_BASE(apic)+4) = value;
146}
147 120
148/* 1 if "noapic" boot option passed */ 121/* 1 if "noapic" boot option passed */
149extern int skip_ioapic_setup; 122extern int skip_ioapic_setup;
diff --git a/include/asm-i386/mach-summit/mach_apic.h b/include/asm-i386/mach-summit/mach_apic.h
index ef0671e5d5c5..43e5bd8f4a19 100644
--- a/include/asm-i386/mach-summit/mach_apic.h
+++ b/include/asm-i386/mach-summit/mach_apic.h
@@ -88,7 +88,11 @@ static inline void clustered_apic_check(void)
88 88
89static inline int apicid_to_node(int logical_apicid) 89static inline int apicid_to_node(int logical_apicid)
90{ 90{
91#ifdef CONFIG_SMP
91 return apicid_2_node[hard_smp_processor_id()]; 92 return apicid_2_node[hard_smp_processor_id()];
93#else
94 return 0;
95#endif
92} 96}
93 97
94/* Mapping from cpu number to logical apicid */ 98/* Mapping from cpu number to logical apicid */
diff --git a/include/asm-i386/mach-visws/do_timer.h b/include/asm-i386/mach-visws/do_timer.h
deleted file mode 100644
index 21cd696d4d0f..000000000000
--- a/include/asm-i386/mach-visws/do_timer.h
+++ /dev/null
@@ -1,53 +0,0 @@
1/* defines for inline arch setup functions */
2
3#include <asm/fixmap.h>
4#include <asm/i8259.h>
5#include "cobalt.h"
6
7static inline void do_timer_interrupt_hook(void)
8{
9 /* Clear the interrupt */
10 co_cpu_write(CO_CPU_STAT,co_cpu_read(CO_CPU_STAT) & ~CO_STAT_TIMEINTR);
11
12 do_timer(1);
13#ifndef CONFIG_SMP
14 update_process_times(user_mode_vm(irq_regs));
15#endif
16/*
17 * In the SMP case we use the local APIC timer interrupt to do the
18 * profiling, except when we simulate SMP mode on a uniprocessor
19 * system, in that case we have to call the local interrupt handler.
20 */
21#ifndef CONFIG_X86_LOCAL_APIC
22 profile_tick(CPU_PROFILING);
23#else
24 if (!using_apic_timer)
25 smp_local_timer_interrupt();
26#endif
27}
28
29static inline int do_timer_overflow(int count)
30{
31 int i;
32
33 spin_lock(&i8259A_lock);
34 /*
35 * This is tricky when I/O APICs are used;
36 * see do_timer_interrupt().
37 */
38 i = inb(0x20);
39 spin_unlock(&i8259A_lock);
40
41 /* assumption about timer being IRQ0 */
42 if (i & 0x01) {
43 /*
44 * We cannot detect lost timer interrupts ...
45 * well, that's why we call them lost, don't we? :)
46 * [hmm, on the Pentium and Alpha we can ... sort of]
47 */
48 count -= LATCH;
49 } else {
50 printk("do_slow_gettimeoffset(): hardware timer problem?\n");
51 }
52 return count;
53}
diff --git a/include/asm-i386/mach-visws/mach_apic.h b/include/asm-i386/mach-visws/mach_apic.h
index de438c7147a8..18afe6b6fc4d 100644
--- a/include/asm-i386/mach-visws/mach_apic.h
+++ b/include/asm-i386/mach-visws/mach_apic.h
@@ -51,6 +51,11 @@ static inline void clustered_apic_check(void)
51{ 51{
52} 52}
53 53
54static inline int apicid_to_node(int logical_apicid)
55{
56 return 0;
57}
58
54/* Mapping from cpu number to logical apicid */ 59/* Mapping from cpu number to logical apicid */
55static inline int cpu_to_logical_apicid(int cpu) 60static inline int cpu_to_logical_apicid(int cpu)
56{ 61{
diff --git a/include/asm-ia64/sal.h b/include/asm-ia64/sal.h
index 0b210abbe003..d000689d9142 100644
--- a/include/asm-ia64/sal.h
+++ b/include/asm-ia64/sal.h
@@ -659,6 +659,7 @@ ia64_sal_freq_base (unsigned long which, unsigned long *ticks_per_second,
659} 659}
660 660
661extern s64 ia64_sal_cache_flush (u64 cache_type); 661extern s64 ia64_sal_cache_flush (u64 cache_type);
662extern void __init check_sal_cache_flush (void);
662 663
663/* Initialize all the processor and platform level instruction and data caches */ 664/* Initialize all the processor and platform level instruction and data caches */
664static inline s64 665static inline s64
diff --git a/include/asm-ia64/sn/addrs.h b/include/asm-ia64/sn/addrs.h
index 1d9efe541662..e715c794b186 100644
--- a/include/asm-ia64/sn/addrs.h
+++ b/include/asm-ia64/sn/addrs.h
@@ -136,9 +136,13 @@
136 */ 136 */
137#define TO_PHYS(x) (TO_PHYS_MASK & (x)) 137#define TO_PHYS(x) (TO_PHYS_MASK & (x))
138#define TO_CAC(x) (CAC_BASE | TO_PHYS(x)) 138#define TO_CAC(x) (CAC_BASE | TO_PHYS(x))
139#ifdef CONFIG_SGI_SN
139#define TO_AMO(x) (AMO_BASE | TO_PHYS(x)) 140#define TO_AMO(x) (AMO_BASE | TO_PHYS(x))
140#define TO_GET(x) (GET_BASE | TO_PHYS(x)) 141#define TO_GET(x) (GET_BASE | TO_PHYS(x))
141 142#else
143#define TO_AMO(x) ({ BUG(); x; })
144#define TO_GET(x) ({ BUG(); x; })
145#endif
142 146
143/* 147/*
144 * Covert from processor physical address to II/TIO physical address: 148 * Covert from processor physical address to II/TIO physical address:
diff --git a/include/asm-ia64/uaccess.h b/include/asm-ia64/uaccess.h
index 9adb51211c22..449c8c0fa2bd 100644
--- a/include/asm-ia64/uaccess.h
+++ b/include/asm-ia64/uaccess.h
@@ -389,7 +389,7 @@ xlate_dev_kmem_ptr (char * p)
389 struct page *page; 389 struct page *page;
390 char * ptr; 390 char * ptr;
391 391
392 page = virt_to_page((unsigned long)p >> PAGE_SHIFT); 392 page = virt_to_page((unsigned long)p);
393 if (PageUncached(page)) 393 if (PageUncached(page))
394 ptr = (char *)__pa(p) + __IA64_UNCACHED_OFFSET; 394 ptr = (char *)__pa(p) + __IA64_UNCACHED_OFFSET;
395 else 395 else
diff --git a/include/asm-m68knommu/irq_regs.h b/include/asm-m68knommu/irq_regs.h
new file mode 100644
index 000000000000..3dd9c0b70270
--- /dev/null
+++ b/include/asm-m68knommu/irq_regs.h
@@ -0,0 +1 @@
#include <asm-generic/irq_regs.h>
diff --git a/include/asm-m68knommu/irqnode.h b/include/asm-m68knommu/irqnode.h
index a2503dfc554c..6132a9858b52 100644
--- a/include/asm-m68knommu/irqnode.h
+++ b/include/asm-m68knommu/irqnode.h
@@ -8,7 +8,7 @@
8 * interrupt source (if it supports chaining). 8 * interrupt source (if it supports chaining).
9 */ 9 */
10typedef struct irq_node { 10typedef struct irq_node {
11 irqreturn_t (*handler)(int, void *, struct pt_regs *); 11 irq_handler_t handler;
12 unsigned long flags; 12 unsigned long flags;
13 void *dev_id; 13 void *dev_id;
14 const char *devname; 14 const char *devname;
@@ -18,12 +18,12 @@ typedef struct irq_node {
18/* 18/*
19 * This structure has only 4 elements for speed reasons 19 * This structure has only 4 elements for speed reasons
20 */ 20 */
21typedef struct irq_handler { 21struct irq_entry {
22 irqreturn_t (*handler)(int, void *, struct pt_regs *); 22 irq_handler_t handler;
23 unsigned long flags; 23 unsigned long flags;
24 void *dev_id; 24 void *dev_id;
25 const char *devname; 25 const char *devname;
26} irq_handler_t; 26};
27 27
28/* count of spurious interrupts */ 28/* count of spurious interrupts */
29extern volatile unsigned int num_spurious; 29extern volatile unsigned int num_spurious;
diff --git a/include/asm-m68knommu/machdep.h b/include/asm-m68knommu/machdep.h
index 27c90afd3339..6ce28f8e0ead 100644
--- a/include/asm-m68knommu/machdep.h
+++ b/include/asm-m68knommu/machdep.h
@@ -18,7 +18,7 @@ extern int (*mach_kbdrate) (struct kbd_repeat *);
18extern void (*mach_kbd_leds) (unsigned int); 18extern void (*mach_kbd_leds) (unsigned int);
19/* machine dependent irq functions */ 19/* machine dependent irq functions */
20extern void (*mach_init_IRQ) (void); 20extern void (*mach_init_IRQ) (void);
21extern irqreturn_t (*(*mach_default_handler)[]) (int, void *, struct pt_regs *); 21extern irq_handler_t mach_default_handler;
22extern int (*mach_request_irq) (unsigned int irq, void (*handler)(int, void *, struct pt_regs *), 22extern int (*mach_request_irq) (unsigned int irq, void (*handler)(int, void *, struct pt_regs *),
23 unsigned long flags, const char *devname, void *dev_id); 23 unsigned long flags, const char *devname, void *dev_id);
24extern void (*mach_free_irq) (unsigned int irq, void *dev_id); 24extern void (*mach_free_irq) (unsigned int irq, void *dev_id);
diff --git a/include/asm-mips/asm.h b/include/asm-mips/asm.h
index e3038a4599ee..838eb3144d81 100644
--- a/include/asm-mips/asm.h
+++ b/include/asm-mips/asm.h
@@ -344,6 +344,7 @@ symbol = value
344#define PTR_L lw 344#define PTR_L lw
345#define PTR_S sw 345#define PTR_S sw
346#define PTR_LA la 346#define PTR_LA la
347#define PTR_LI li
347#define PTR_SLL sll 348#define PTR_SLL sll
348#define PTR_SLLV sllv 349#define PTR_SLLV sllv
349#define PTR_SRL srl 350#define PTR_SRL srl
@@ -368,6 +369,7 @@ symbol = value
368#define PTR_L ld 369#define PTR_L ld
369#define PTR_S sd 370#define PTR_S sd
370#define PTR_LA dla 371#define PTR_LA dla
372#define PTR_LI dli
371#define PTR_SLL dsll 373#define PTR_SLL dsll
372#define PTR_SLLV dsllv 374#define PTR_SLLV dsllv
373#define PTR_SRL dsrl 375#define PTR_SRL dsrl
diff --git a/include/asm-mips/cacheflush.h b/include/asm-mips/cacheflush.h
index 9ab59e2bb233..e3c9925876a3 100644
--- a/include/asm-mips/cacheflush.h
+++ b/include/asm-mips/cacheflush.h
@@ -55,24 +55,13 @@ extern void (*flush_icache_range)(unsigned long start, unsigned long end);
55#define flush_cache_vmap(start, end) flush_cache_all() 55#define flush_cache_vmap(start, end) flush_cache_all()
56#define flush_cache_vunmap(start, end) flush_cache_all() 56#define flush_cache_vunmap(start, end) flush_cache_all()
57 57
58static inline void copy_to_user_page(struct vm_area_struct *vma, 58extern void copy_to_user_page(struct vm_area_struct *vma,
59 struct page *page, unsigned long vaddr, void *dst, const void *src, 59 struct page *page, unsigned long vaddr, void *dst, const void *src,
60 unsigned long len) 60 unsigned long len);
61{
62 if (cpu_has_dc_aliases)
63 flush_cache_page(vma, vaddr, page_to_pfn(page));
64 memcpy(dst, src, len);
65 __flush_icache_page(vma, page);
66}
67 61
68static inline void copy_from_user_page(struct vm_area_struct *vma, 62extern void copy_from_user_page(struct vm_area_struct *vma,
69 struct page *page, unsigned long vaddr, void *dst, const void *src, 63 struct page *page, unsigned long vaddr, void *dst, const void *src,
70 unsigned long len) 64 unsigned long len);
71{
72 if (cpu_has_dc_aliases)
73 flush_cache_page(vma, vaddr, page_to_pfn(page));
74 memcpy(dst, src, len);
75}
76 65
77extern void (*flush_cache_sigtramp)(unsigned long addr); 66extern void (*flush_cache_sigtramp)(unsigned long addr);
78extern void (*flush_icache_all)(void); 67extern void (*flush_icache_all)(void);
diff --git a/include/asm-mips/div64.h b/include/asm-mips/div64.h
index 5f7dcf5452e7..d107832de1b6 100644
--- a/include/asm-mips/div64.h
+++ b/include/asm-mips/div64.h
@@ -83,27 +83,6 @@
83#if (_MIPS_SZLONG == 64) 83#if (_MIPS_SZLONG == 64)
84 84
85/* 85/*
86 * Don't use this one in new code
87 */
88#define do_div64_32(res, high, low, base) ({ \
89 unsigned int __quot, __mod; \
90 unsigned long __div; \
91 unsigned int __low, __high, __base; \
92 \
93 __high = (high); \
94 __low = (low); \
95 __div = __high; \
96 __div = __div << 32 | __low; \
97 __base = (base); \
98 \
99 __mod = __div % __base; \
100 __div = __div / __base; \
101 \
102 __quot = __div; \
103 (res) = __quot; \
104 __mod; })
105
106/*
107 * Hey, we're already 64-bit, no 86 * Hey, we're already 64-bit, no
108 * need to play games.. 87 * need to play games..
109 */ 88 */
diff --git a/include/asm-mips/fixmap.h b/include/asm-mips/fixmap.h
index 6959bdb59310..02c8a13fc894 100644
--- a/include/asm-mips/fixmap.h
+++ b/include/asm-mips/fixmap.h
@@ -45,8 +45,16 @@
45 * fix-mapped? 45 * fix-mapped?
46 */ 46 */
47enum fixed_addresses { 47enum fixed_addresses {
48#define FIX_N_COLOURS 8
49 FIX_CMAP_BEGIN,
50#ifdef CONFIG_MIPS_MT_SMTC
51 FIX_CMAP_END = FIX_CMAP_BEGIN + (FIX_N_COLOURS * NR_CPUS),
52#else
53 FIX_CMAP_END = FIX_CMAP_BEGIN + FIX_N_COLOURS,
54#endif
48#ifdef CONFIG_HIGHMEM 55#ifdef CONFIG_HIGHMEM
49 FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */ 56 /* reserved pte's for temporary kernel mappings */
57 FIX_KMAP_BEGIN = FIX_CMAP_END + 1,
50 FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1, 58 FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1,
51#endif 59#endif
52 __end_of_fixed_addresses 60 __end_of_fixed_addresses
@@ -70,9 +78,9 @@ extern void __set_fixmap (enum fixed_addresses idx,
70 * at the top of mem.. 78 * at the top of mem..
71 */ 79 */
72#if defined(CONFIG_CPU_TX39XX) || defined(CONFIG_CPU_TX49XX) 80#if defined(CONFIG_CPU_TX39XX) || defined(CONFIG_CPU_TX49XX)
73#define FIXADDR_TOP (0xff000000UL - 0x2000) 81#define FIXADDR_TOP ((unsigned long)(long)(int)(0xff000000 - 0x20000))
74#else 82#else
75#define FIXADDR_TOP (0xffffe000UL) 83#define FIXADDR_TOP ((unsigned long)(long)(int)0xfffe0000)
76#endif 84#endif
77#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT) 85#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
78#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE) 86#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
diff --git a/include/asm-mips/irq.h b/include/asm-mips/irq.h
index 0ce2a80b689e..35a05ca5560c 100644
--- a/include/asm-mips/irq.h
+++ b/include/asm-mips/irq.h
@@ -74,4 +74,8 @@ extern int setup_irq_smtc(unsigned int irq, struct irqaction * new,
74 unsigned long hwmask); 74 unsigned long hwmask);
75#endif /* CONFIG_MIPS_MT_SMTC */ 75#endif /* CONFIG_MIPS_MT_SMTC */
76 76
77extern int allocate_irqno(void);
78extern void alloc_legacy_irqno(void);
79extern void free_irqno(unsigned int irq);
80
77#endif /* _ASM_IRQ_H */ 81#endif /* _ASM_IRQ_H */
diff --git a/include/asm-mips/mach-au1x00/au1xxx_ide.h b/include/asm-mips/mach-au1x00/au1xxx_ide.h
index 301e71300779..e9fa252f8a3f 100644
--- a/include/asm-mips/mach-au1x00/au1xxx_ide.h
+++ b/include/asm-mips/mach-au1x00/au1xxx_ide.h
@@ -170,10 +170,8 @@ int __init auide_probe(void);
170 static int auide_dma_host_on(ide_drive_t *drive); 170 static int auide_dma_host_on(ide_drive_t *drive);
171 static int auide_dma_lostirq(ide_drive_t *drive); 171 static int auide_dma_lostirq(ide_drive_t *drive);
172 static int auide_dma_on(ide_drive_t *drive); 172 static int auide_dma_on(ide_drive_t *drive);
173 static void auide_ddma_tx_callback(int irq, void *param, 173 static void auide_ddma_tx_callback(int irq, void *param);
174 struct pt_regs *regs); 174 static void auide_ddma_rx_callback(int irq, void *param);
175 static void auide_ddma_rx_callback(int irq, void *param,
176 struct pt_regs *regs);
177 static int auide_dma_off_quietly(ide_drive_t *drive); 175 static int auide_dma_off_quietly(ide_drive_t *drive);
178#endif /* end CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */ 176#endif /* end CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */
179 177
diff --git a/include/asm-mips/mipsmtregs.h b/include/asm-mips/mipsmtregs.h
index f637ce70758f..3e9468f424f4 100644
--- a/include/asm-mips/mipsmtregs.h
+++ b/include/asm-mips/mipsmtregs.h
@@ -352,6 +352,8 @@ do { \
352#define write_vpe_c0_vpecontrol(val) mttc0(1, 1, val) 352#define write_vpe_c0_vpecontrol(val) mttc0(1, 1, val)
353#define read_vpe_c0_vpeconf0() mftc0(1, 2) 353#define read_vpe_c0_vpeconf0() mftc0(1, 2)
354#define write_vpe_c0_vpeconf0(val) mttc0(1, 2, val) 354#define write_vpe_c0_vpeconf0(val) mttc0(1, 2, val)
355#define read_vpe_c0_count() mftc0(9, 0)
356#define write_vpe_c0_count(val) mttc0(9, 0, val)
355#define read_vpe_c0_status() mftc0(12, 0) 357#define read_vpe_c0_status() mftc0(12, 0)
356#define write_vpe_c0_status(val) mttc0(12, 0, val) 358#define write_vpe_c0_status(val) mttc0(12, 0, val)
357#define read_vpe_c0_cause() mftc0(13, 0) 359#define read_vpe_c0_cause() mftc0(13, 0)
diff --git a/include/asm-mips/pgalloc.h b/include/asm-mips/pgalloc.h
index 582c1fe6cc4a..af121c67dc71 100644
--- a/include/asm-mips/pgalloc.h
+++ b/include/asm-mips/pgalloc.h
@@ -48,7 +48,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
48 48
49 ret = (pgd_t *) __get_free_pages(GFP_KERNEL, PGD_ORDER); 49 ret = (pgd_t *) __get_free_pages(GFP_KERNEL, PGD_ORDER);
50 if (ret) { 50 if (ret) {
51 init = pgd_offset(&init_mm, 0); 51 init = pgd_offset(&init_mm, 0UL);
52 pgd_init((unsigned long)ret); 52 pgd_init((unsigned long)ret);
53 memcpy(ret + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD, 53 memcpy(ret + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD,
54 (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t)); 54 (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
diff --git a/include/asm-mips/pgtable-64.h b/include/asm-mips/pgtable-64.h
index d05fb6f38aa7..7e7320300aa3 100644
--- a/include/asm-mips/pgtable-64.h
+++ b/include/asm-mips/pgtable-64.h
@@ -174,7 +174,7 @@ static inline void pud_clear(pud_t *pudp)
174#define __pmd_offset(address) pmd_index(address) 174#define __pmd_offset(address) pmd_index(address)
175 175
176/* to find an entry in a kernel page-table-directory */ 176/* to find an entry in a kernel page-table-directory */
177#define pgd_offset_k(address) pgd_offset(&init_mm, 0) 177#define pgd_offset_k(address) pgd_offset(&init_mm, 0UL)
178 178
179#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) 179#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
180#define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)) 180#define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
diff --git a/include/asm-mips/sibyte/sb1250.h b/include/asm-mips/sibyte/sb1250.h
index b09e16c93ca0..2ba6988ddc8e 100644
--- a/include/asm-mips/sibyte/sb1250.h
+++ b/include/asm-mips/sibyte/sb1250.h
@@ -51,8 +51,8 @@ extern void sb1250_mask_irq(int cpu, int irq);
51extern void sb1250_unmask_irq(int cpu, int irq); 51extern void sb1250_unmask_irq(int cpu, int irq);
52extern void sb1250_smp_finish(void); 52extern void sb1250_smp_finish(void);
53 53
54extern void bcm1480_hpt_setup(void);
54extern void bcm1480_time_init(void); 55extern void bcm1480_time_init(void);
55extern unsigned long bcm1480_gettimeoffset(void);
56extern void bcm1480_mask_irq(int cpu, int irq); 56extern void bcm1480_mask_irq(int cpu, int irq);
57extern void bcm1480_unmask_irq(int cpu, int irq); 57extern void bcm1480_unmask_irq(int cpu, int irq);
58extern void bcm1480_smp_finish(void); 58extern void bcm1480_smp_finish(void);
diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h
index dcb4701d5728..3056feed5a36 100644
--- a/include/asm-mips/system.h
+++ b/include/asm-mips/system.h
@@ -392,7 +392,7 @@ static inline unsigned long __cmpxchg_u64(volatile int * m, unsigned long old,
392{ 392{
393 __u64 retval; 393 __u64 retval;
394 394
395 if (cpu_has_llsc) { 395 if (cpu_has_llsc && R10000_LLSC_WAR) {
396 __asm__ __volatile__( 396 __asm__ __volatile__(
397 " .set push \n" 397 " .set push \n"
398 " .set noat \n" 398 " .set noat \n"
diff --git a/include/asm-mips/time.h b/include/asm-mips/time.h
index 28512ba2266e..625acd337bc3 100644
--- a/include/asm-mips/time.h
+++ b/include/asm-mips/time.h
@@ -48,7 +48,8 @@ extern void (*mips_timer_ack)(void);
48 * If mips_hpt_read is NULL, an R4k-compatible timer setup is attempted. 48 * If mips_hpt_read is NULL, an R4k-compatible timer setup is attempted.
49 */ 49 */
50extern unsigned int (*mips_hpt_read)(void); 50extern unsigned int (*mips_hpt_read)(void);
51extern void (*mips_hpt_init)(unsigned int); 51extern void (*mips_hpt_init)(void);
52extern unsigned int mips_hpt_mask;
52 53
53/* 54/*
54 * to_tm() converts system time back to (year, mon, day, hour, min, sec). 55 * to_tm() converts system time back to (year, mon, day, hour, min, sec).
@@ -58,13 +59,6 @@ extern void (*mips_hpt_init)(unsigned int);
58extern void to_tm(unsigned long tim, struct rtc_time *tm); 59extern void to_tm(unsigned long tim, struct rtc_time *tm);
59 60
60/* 61/*
61 * do_gettimeoffset(). By default, this func pointer points to
62 * do_null_gettimeoffset(), which leads to the same resolution as HZ.
63 * Higher resolution versions are available, which give ~1us resolution.
64 */
65extern unsigned long (*do_gettimeoffset)(void);
66
67/*
68 * high-level timer interrupt routines. 62 * high-level timer interrupt routines.
69 */ 63 */
70extern irqreturn_t timer_interrupt(int irq, void *dev_id); 64extern irqreturn_t timer_interrupt(int irq, void *dev_id);
diff --git a/include/asm-mips/unistd.h b/include/asm-mips/unistd.h
index 30240a445dbb..ec56aa52f669 100644
--- a/include/asm-mips/unistd.h
+++ b/include/asm-mips/unistd.h
@@ -332,16 +332,18 @@
332#define __NR_set_robust_list (__NR_Linux + 309) 332#define __NR_set_robust_list (__NR_Linux + 309)
333#define __NR_get_robust_list (__NR_Linux + 310) 333#define __NR_get_robust_list (__NR_Linux + 310)
334#define __NR_kexec_load (__NR_Linux + 311) 334#define __NR_kexec_load (__NR_Linux + 311)
335#define __NR_getcpu (__NR_Linux + 312)
336#define __NR_epoll_pwait (__NR_Linux + 313)
335 337
336/* 338/*
337 * Offset of the last Linux o32 flavoured syscall 339 * Offset of the last Linux o32 flavoured syscall
338 */ 340 */
339#define __NR_Linux_syscalls 311 341#define __NR_Linux_syscalls 313
340 342
341#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ 343#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
342 344
343#define __NR_O32_Linux 4000 345#define __NR_O32_Linux 4000
344#define __NR_O32_Linux_syscalls 311 346#define __NR_O32_Linux_syscalls 313
345 347
346#if _MIPS_SIM == _MIPS_SIM_ABI64 348#if _MIPS_SIM == _MIPS_SIM_ABI64
347 349
@@ -620,16 +622,18 @@
620#define __NR_set_robust_list (__NR_Linux + 268) 622#define __NR_set_robust_list (__NR_Linux + 268)
621#define __NR_get_robust_list (__NR_Linux + 269) 623#define __NR_get_robust_list (__NR_Linux + 269)
622#define __NR_kexec_load (__NR_Linux + 270) 624#define __NR_kexec_load (__NR_Linux + 270)
625#define __NR_getcpu (__NR_Linux + 271)
626#define __NR_epoll_pwait (__NR_Linux + 272)
623 627
624/* 628/*
625 * Offset of the last Linux 64-bit flavoured syscall 629 * Offset of the last Linux 64-bit flavoured syscall
626 */ 630 */
627#define __NR_Linux_syscalls 270 631#define __NR_Linux_syscalls 272
628 632
629#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ 633#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
630 634
631#define __NR_64_Linux 5000 635#define __NR_64_Linux 5000
632#define __NR_64_Linux_syscalls 270 636#define __NR_64_Linux_syscalls 272
633 637
634#if _MIPS_SIM == _MIPS_SIM_NABI32 638#if _MIPS_SIM == _MIPS_SIM_NABI32
635 639
@@ -912,16 +916,18 @@
912#define __NR_set_robust_list (__NR_Linux + 272) 916#define __NR_set_robust_list (__NR_Linux + 272)
913#define __NR_get_robust_list (__NR_Linux + 273) 917#define __NR_get_robust_list (__NR_Linux + 273)
914#define __NR_kexec_load (__NR_Linux + 274) 918#define __NR_kexec_load (__NR_Linux + 274)
919#define __NR_getcpu (__NR_Linux + 275)
920#define __NR_epoll_pwait (__NR_Linux + 276)
915 921
916/* 922/*
917 * Offset of the last N32 flavoured syscall 923 * Offset of the last N32 flavoured syscall
918 */ 924 */
919#define __NR_Linux_syscalls 274 925#define __NR_Linux_syscalls 276
920 926
921#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ 927#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
922 928
923#define __NR_N32_Linux 6000 929#define __NR_N32_Linux 6000
924#define __NR_N32_Linux_syscalls 274 930#define __NR_N32_Linux_syscalls 276
925 931
926#ifdef __KERNEL__ 932#ifdef __KERNEL__
927 933
@@ -1189,6 +1195,7 @@ type name (atype a,btype b,ctype c,dtype d,etype e,ftype f) \
1189#endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */ 1195#endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */
1190 1196
1191 1197
1198#define __ARCH_OMIT_COMPAT_SYS_GETDENTS64
1192#define __ARCH_WANT_IPC_PARSE_VERSION 1199#define __ARCH_WANT_IPC_PARSE_VERSION
1193#define __ARCH_WANT_OLD_READDIR 1200#define __ARCH_WANT_OLD_READDIR
1194#define __ARCH_WANT_SYS_ALARM 1201#define __ARCH_WANT_SYS_ALARM
diff --git a/include/asm-parisc/semaphore.h b/include/asm-parisc/semaphore.h
index c9ee41cd0707..d45827a21f94 100644
--- a/include/asm-parisc/semaphore.h
+++ b/include/asm-parisc/semaphore.h
@@ -115,7 +115,8 @@ extern __inline__ int down_interruptible(struct semaphore * sem)
115 */ 115 */
116extern __inline__ int down_trylock(struct semaphore * sem) 116extern __inline__ int down_trylock(struct semaphore * sem)
117{ 117{
118 int flags, count; 118 unsigned long flags;
119 int count;
119 120
120 spin_lock_irqsave(&sem->sentry, flags); 121 spin_lock_irqsave(&sem->sentry, flags);
121 count = sem->count - 1; 122 count = sem->count - 1;
@@ -131,7 +132,8 @@ extern __inline__ int down_trylock(struct semaphore * sem)
131 */ 132 */
132extern __inline__ void up(struct semaphore * sem) 133extern __inline__ void up(struct semaphore * sem)
133{ 134{
134 int flags; 135 unsigned long flags;
136
135 spin_lock_irqsave(&sem->sentry, flags); 137 spin_lock_irqsave(&sem->sentry, flags);
136 if (sem->count < 0) { 138 if (sem->count < 0) {
137 __up(sem); 139 __up(sem);
diff --git a/include/asm-powerpc/asm-compat.h b/include/asm-powerpc/asm-compat.h
index 8e64be0cc47d..c89bd58ee283 100644
--- a/include/asm-powerpc/asm-compat.h
+++ b/include/asm-powerpc/asm-compat.h
@@ -14,6 +14,58 @@
14# define ASM_CONST(x) __ASM_CONST(x) 14# define ASM_CONST(x) __ASM_CONST(x)
15#endif 15#endif
16 16
17
18/*
19 * Feature section common macros
20 *
21 * Note that the entries now contain offsets between the table entry
22 * and the code rather than absolute code pointers in order to be
23 * useable with the vdso shared library. There is also an assumption
24 * that values will be negative, that is, the fixup table has to be
25 * located after the code it fixes up.
26 */
27#ifdef CONFIG_PPC64
28#ifdef __powerpc64__
29/* 64 bits kernel, 64 bits code */
30#define MAKE_FTR_SECTION_ENTRY(msk, val, label, sect) \
3199: \
32 .section sect,"a"; \
33 .align 3; \
3498: \
35 .llong msk; \
36 .llong val; \
37 .llong label##b-98b; \
38 .llong 99b-98b; \
39 .previous
40#else /* __powerpc64__ */
41/* 64 bits kernel, 32 bits code (ie. vdso32) */
42#define MAKE_FTR_SECTION_ENTRY(msk, val, label, sect) \
4399: \
44 .section sect,"a"; \
45 .align 3; \
4698: \
47 .llong msk; \
48 .llong val; \
49 .long 0xffffffff; \
50 .long label##b-98b; \
51 .long 0xffffffff; \
52 .long 99b-98b; \
53 .previous
54#endif /* !__powerpc64__ */
55#else /* CONFIG_PPC64 */
56/* 32 bits kernel, 32 bits code */
57#define MAKE_FTR_SECTION_ENTRY(msk, val, label, sect) \
5899: \
59 .section sect,"a"; \
60 .align 2; \
6198: \
62 .long msk; \
63 .long val; \
64 .long label##b-98b; \
65 .long 99b-98b; \
66 .previous
67#endif /* !CONFIG_PPC64 */
68
17#ifdef __powerpc64__ 69#ifdef __powerpc64__
18 70
19/* operations for longs and pointers */ 71/* operations for longs and pointers */
diff --git a/include/asm-powerpc/cputable.h b/include/asm-powerpc/cputable.h
index 12707ab9dc98..a9a40149a7c0 100644
--- a/include/asm-powerpc/cputable.h
+++ b/include/asm-powerpc/cputable.h
@@ -89,8 +89,11 @@ struct cpu_spec {
89 89
90extern struct cpu_spec *cur_cpu_spec; 90extern struct cpu_spec *cur_cpu_spec;
91 91
92extern void identify_cpu(unsigned long offset, unsigned long cpu); 92extern unsigned int __start___ftr_fixup, __stop___ftr_fixup;
93extern void do_cpu_ftr_fixups(unsigned long offset); 93
94extern struct cpu_spec *identify_cpu(unsigned long offset);
95extern void do_feature_fixups(unsigned long value, void *fixup_start,
96 void *fixup_end);
94 97
95#endif /* __ASSEMBLY__ */ 98#endif /* __ASSEMBLY__ */
96 99
@@ -144,6 +147,7 @@ extern void do_cpu_ftr_fixups(unsigned long offset);
144#define CPU_FTR_CI_LARGE_PAGE LONG_ASM_CONST(0x0000100000000000) 147#define CPU_FTR_CI_LARGE_PAGE LONG_ASM_CONST(0x0000100000000000)
145#define CPU_FTR_PAUSE_ZERO LONG_ASM_CONST(0x0000200000000000) 148#define CPU_FTR_PAUSE_ZERO LONG_ASM_CONST(0x0000200000000000)
146#define CPU_FTR_PURR LONG_ASM_CONST(0x0000400000000000) 149#define CPU_FTR_PURR LONG_ASM_CONST(0x0000400000000000)
150#define CPU_FTR_CELL_TB_BUG LONG_ASM_CONST(0x0000800000000000)
147 151
148#ifndef __ASSEMBLY__ 152#ifndef __ASSEMBLY__
149 153
@@ -332,7 +336,7 @@ extern void do_cpu_ftr_fixups(unsigned long offset);
332#define CPU_FTRS_CELL (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ 336#define CPU_FTRS_CELL (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \
333 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ 337 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
334 CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \ 338 CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \
335 CPU_FTR_PAUSE_ZERO | CPU_FTR_CI_LARGE_PAGE) 339 CPU_FTR_PAUSE_ZERO | CPU_FTR_CI_LARGE_PAGE | CPU_FTR_CELL_TB_BUG)
336#define CPU_FTRS_PA6T (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ 340#define CPU_FTRS_PA6T (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \
337 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \ 341 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \
338 CPU_FTR_ALTIVEC_COMP | CPU_FTR_CI_LARGE_PAGE | \ 342 CPU_FTR_ALTIVEC_COMP | CPU_FTR_CI_LARGE_PAGE | \
@@ -431,29 +435,12 @@ static inline int cpu_has_feature(unsigned long feature)
431 435
432#ifdef __ASSEMBLY__ 436#ifdef __ASSEMBLY__
433 437
434#define BEGIN_FTR_SECTION 98: 438#define BEGIN_FTR_SECTION_NESTED(label) label:
435 439#define BEGIN_FTR_SECTION BEGIN_FTR_SECTION_NESTED(97)
436#ifndef __powerpc64__ 440#define END_FTR_SECTION_NESTED(msk, val, label) \
441 MAKE_FTR_SECTION_ENTRY(msk, val, label, __ftr_fixup)
437#define END_FTR_SECTION(msk, val) \ 442#define END_FTR_SECTION(msk, val) \
43899: \ 443 END_FTR_SECTION_NESTED(msk, val, 97)
439 .section __ftr_fixup,"a"; \
440 .align 2; \
441 .long msk; \
442 .long val; \
443 .long 98b; \
444 .long 99b; \
445 .previous
446#else /* __powerpc64__ */
447#define END_FTR_SECTION(msk, val) \
44899: \
449 .section __ftr_fixup,"a"; \
450 .align 3; \
451 .llong msk; \
452 .llong val; \
453 .llong 98b; \
454 .llong 99b; \
455 .previous
456#endif /* __powerpc64__ */
457 444
458#define END_FTR_SECTION_IFSET(msk) END_FTR_SECTION((msk), (msk)) 445#define END_FTR_SECTION_IFSET(msk) END_FTR_SECTION((msk), (msk))
459#define END_FTR_SECTION_IFCLR(msk) END_FTR_SECTION((msk), 0) 446#define END_FTR_SECTION_IFCLR(msk) END_FTR_SECTION((msk), 0)
diff --git a/include/asm-powerpc/current.h b/include/asm-powerpc/current.h
index 1938d6abd255..b8708aedf925 100644
--- a/include/asm-powerpc/current.h
+++ b/include/asm-powerpc/current.h
@@ -14,7 +14,17 @@ struct task_struct;
14#ifdef __powerpc64__ 14#ifdef __powerpc64__
15#include <asm/paca.h> 15#include <asm/paca.h>
16 16
17#define current (get_paca()->__current) 17static inline struct task_struct *get_current(void)
18{
19 struct task_struct *task;
20
21 __asm__ __volatile__("ld %0,%1(13)"
22 : "=r" (task)
23 : "i" (offsetof(struct paca_struct, __current)));
24
25 return task;
26}
27#define current get_current()
18 28
19#else 29#else
20 30
diff --git a/include/asm-powerpc/firmware.h b/include/asm-powerpc/firmware.h
index 1022737f4f34..fdf9aff71150 100644
--- a/include/asm-powerpc/firmware.h
+++ b/include/asm-powerpc/firmware.h
@@ -96,19 +96,16 @@ extern void machine_check_fwnmi(void);
96/* This is true if we are using the firmware NMI handler (typically LPAR) */ 96/* This is true if we are using the firmware NMI handler (typically LPAR) */
97extern int fwnmi_active; 97extern int fwnmi_active;
98 98
99#else /* __ASSEMBLY__ */ 99extern unsigned int __start___fw_ftr_fixup, __stop___fw_ftr_fixup;
100 100
101#define BEGIN_FW_FTR_SECTION 96: 101#else /* __ASSEMBLY__ */
102 102
103#define BEGIN_FW_FTR_SECTION_NESTED(label) label:
104#define BEGIN_FW_FTR_SECTION BEGIN_FW_FTR_SECTION_NESTED(97)
105#define END_FW_FTR_SECTION_NESTED(msk, val, label) \
106 MAKE_FTR_SECTION_ENTRY(msk, val, label, __fw_ftr_fixup)
103#define END_FW_FTR_SECTION(msk, val) \ 107#define END_FW_FTR_SECTION(msk, val) \
10497: \ 108 END_FW_FTR_SECTION_NESTED(msk, val, 97)
105 .section __fw_ftr_fixup,"a"; \
106 .align 3; \
107 .llong msk; \
108 .llong val; \
109 .llong 96b; \
110 .llong 97b; \
111 .previous
112 109
113#define END_FW_FTR_SECTION_IFSET(msk) END_FW_FTR_SECTION((msk), (msk)) 110#define END_FW_FTR_SECTION_IFSET(msk) END_FW_FTR_SECTION((msk), (msk))
114#define END_FW_FTR_SECTION_IFCLR(msk) END_FW_FTR_SECTION((msk), 0) 111#define END_FW_FTR_SECTION_IFCLR(msk) END_FW_FTR_SECTION((msk), 0)
diff --git a/include/asm-powerpc/i8259.h b/include/asm-powerpc/i8259.h
index 78489fb8d140..db1362f8c603 100644
--- a/include/asm-powerpc/i8259.h
+++ b/include/asm-powerpc/i8259.h
@@ -7,6 +7,7 @@
7#ifdef CONFIG_PPC_MERGE 7#ifdef CONFIG_PPC_MERGE
8extern void i8259_init(struct device_node *node, unsigned long intack_addr); 8extern void i8259_init(struct device_node *node, unsigned long intack_addr);
9extern unsigned int i8259_irq(void); 9extern unsigned int i8259_irq(void);
10extern struct irq_host *i8259_get_host(void);
10#else 11#else
11extern void i8259_init(unsigned long intack_addr, int offset); 12extern void i8259_init(unsigned long intack_addr, int offset);
12extern int i8259_irq(void); 13extern int i8259_irq(void);
diff --git a/include/asm-powerpc/io.h b/include/asm-powerpc/io.h
index 3baff8b0fd5a..c2c5f14b5f5f 100644
--- a/include/asm-powerpc/io.h
+++ b/include/asm-powerpc/io.h
@@ -163,8 +163,11 @@ extern void _outsl_ns(volatile u32 __iomem *port, const void *buf, long count);
163 163
164static inline void mmiowb(void) 164static inline void mmiowb(void)
165{ 165{
166 __asm__ __volatile__ ("sync" : : : "memory"); 166 unsigned long tmp;
167 get_paca()->io_sync = 0; 167
168 __asm__ __volatile__("sync; li %0,0; stb %0,%1(13)"
169 : "=&r" (tmp) : "i" (offsetof(struct paca_struct, io_sync))
170 : "memory");
168} 171}
169 172
170/* 173/*
diff --git a/include/asm-powerpc/iommu.h b/include/asm-powerpc/iommu.h
index a5e98641a2ae..39fad685ffab 100644
--- a/include/asm-powerpc/iommu.h
+++ b/include/asm-powerpc/iommu.h
@@ -22,17 +22,35 @@
22#define _ASM_IOMMU_H 22#define _ASM_IOMMU_H
23#ifdef __KERNEL__ 23#ifdef __KERNEL__
24 24
25#include <asm/types.h> 25#include <linux/compiler.h>
26#include <linux/spinlock.h> 26#include <linux/spinlock.h>
27#include <linux/device.h> 27#include <linux/device.h>
28#include <linux/dma-mapping.h> 28#include <linux/dma-mapping.h>
29#include <asm/types.h>
30#include <asm/bitops.h>
31
32#define IOMMU_PAGE_SHIFT 12
33#define IOMMU_PAGE_SIZE (ASM_CONST(1) << IOMMU_PAGE_SHIFT)
34#define IOMMU_PAGE_MASK (~((1 << IOMMU_PAGE_SHIFT) - 1))
35#define IOMMU_PAGE_ALIGN(addr) _ALIGN_UP(addr, IOMMU_PAGE_SIZE)
36
37#ifndef __ASSEMBLY__
38
39/* Pure 2^n version of get_order */
40static __inline__ __attribute_const__ int get_iommu_order(unsigned long size)
41{
42 return __ilog2((size - 1) >> IOMMU_PAGE_SHIFT) + 1;
43}
44
45#endif /* __ASSEMBLY__ */
46
29 47
30/* 48/*
31 * IOMAP_MAX_ORDER defines the largest contiguous block 49 * IOMAP_MAX_ORDER defines the largest contiguous block
32 * of dma space we can get. IOMAP_MAX_ORDER = 13 50 * of dma space we can get. IOMAP_MAX_ORDER = 13
33 * allows up to 2**12 pages (4096 * 4096) = 16 MB 51 * allows up to 2**12 pages (4096 * 4096) = 16 MB
34 */ 52 */
35#define IOMAP_MAX_ORDER 13 53#define IOMAP_MAX_ORDER 13
36 54
37struct iommu_table { 55struct iommu_table {
38 unsigned long it_busno; /* Bus number this table belongs to */ 56 unsigned long it_busno; /* Bus number this table belongs to */
diff --git a/include/asm-powerpc/oprofile_impl.h b/include/asm-powerpc/oprofile_impl.h
index 5b33994cd488..07a10e590c1d 100644
--- a/include/asm-powerpc/oprofile_impl.h
+++ b/include/asm-powerpc/oprofile_impl.h
@@ -42,7 +42,7 @@ struct op_powerpc_model {
42 void (*reg_setup) (struct op_counter_config *, 42 void (*reg_setup) (struct op_counter_config *,
43 struct op_system_config *, 43 struct op_system_config *,
44 int num_counters); 44 int num_counters);
45 void (*cpu_setup) (void *); 45 void (*cpu_setup) (struct op_counter_config *);
46 void (*start) (struct op_counter_config *); 46 void (*start) (struct op_counter_config *);
47 void (*stop) (void); 47 void (*stop) (void);
48 void (*handle_interrupt) (struct pt_regs *, 48 void (*handle_interrupt) (struct pt_regs *,
@@ -121,7 +121,90 @@ static inline void ctr_write(unsigned int i, unsigned int val)
121 break; 121 break;
122 } 122 }
123} 123}
124#endif /* !CONFIG_FSL_BOOKE */ 124#else /* CONFIG_FSL_BOOKE */
125static inline u32 get_pmlca(int ctr)
126{
127 u32 pmlca;
128
129 switch (ctr) {
130 case 0:
131 pmlca = mfpmr(PMRN_PMLCA0);
132 break;
133 case 1:
134 pmlca = mfpmr(PMRN_PMLCA1);
135 break;
136 case 2:
137 pmlca = mfpmr(PMRN_PMLCA2);
138 break;
139 case 3:
140 pmlca = mfpmr(PMRN_PMLCA3);
141 break;
142 default:
143 panic("Bad ctr number\n");
144 }
145
146 return pmlca;
147}
148
149static inline void set_pmlca(int ctr, u32 pmlca)
150{
151 switch (ctr) {
152 case 0:
153 mtpmr(PMRN_PMLCA0, pmlca);
154 break;
155 case 1:
156 mtpmr(PMRN_PMLCA1, pmlca);
157 break;
158 case 2:
159 mtpmr(PMRN_PMLCA2, pmlca);
160 break;
161 case 3:
162 mtpmr(PMRN_PMLCA3, pmlca);
163 break;
164 default:
165 panic("Bad ctr number\n");
166 }
167}
168
169static inline unsigned int ctr_read(unsigned int i)
170{
171 switch(i) {
172 case 0:
173 return mfpmr(PMRN_PMC0);
174 case 1:
175 return mfpmr(PMRN_PMC1);
176 case 2:
177 return mfpmr(PMRN_PMC2);
178 case 3:
179 return mfpmr(PMRN_PMC3);
180 default:
181 return 0;
182 }
183}
184
185static inline void ctr_write(unsigned int i, unsigned int val)
186{
187 switch(i) {
188 case 0:
189 mtpmr(PMRN_PMC0, val);
190 break;
191 case 1:
192 mtpmr(PMRN_PMC1, val);
193 break;
194 case 2:
195 mtpmr(PMRN_PMC2, val);
196 break;
197 case 3:
198 mtpmr(PMRN_PMC3, val);
199 break;
200 default:
201 break;
202 }
203}
204
205
206#endif /* CONFIG_FSL_BOOKE */
207
125 208
126extern void op_powerpc_backtrace(struct pt_regs * const regs, unsigned int depth); 209extern void op_powerpc_backtrace(struct pt_regs * const regs, unsigned int depth);
127 210
diff --git a/include/asm-powerpc/pmc.h b/include/asm-powerpc/pmc.h
index 07d6a4279319..8588be68e0ad 100644
--- a/include/asm-powerpc/pmc.h
+++ b/include/asm-powerpc/pmc.h
@@ -32,18 +32,5 @@ void release_pmc_hardware(void);
32void power4_enable_pmcs(void); 32void power4_enable_pmcs(void);
33#endif 33#endif
34 34
35#ifdef CONFIG_FSL_BOOKE
36void init_pmc_stop(int ctr);
37void set_pmc_event(int ctr, int event);
38void set_pmc_user_kernel(int ctr, int user, int kernel);
39void set_pmc_marked(int ctr, int mark0, int mark1);
40void pmc_start_ctr(int ctr, int enable);
41void pmc_start_ctrs(int enable);
42void pmc_stop_ctrs(void);
43void dump_pmcs(void);
44
45extern struct op_powerpc_model op_model_fsl_booke;
46#endif
47
48#endif /* __KERNEL__ */ 35#endif /* __KERNEL__ */
49#endif /* _POWERPC_PMC_H */ 36#endif /* _POWERPC_PMC_H */
diff --git a/include/asm-powerpc/ppc_asm.h b/include/asm-powerpc/ppc_asm.h
index a940cfe040da..fa083d8e4663 100644
--- a/include/asm-powerpc/ppc_asm.h
+++ b/include/asm-powerpc/ppc_asm.h
@@ -30,9 +30,9 @@ BEGIN_FTR_SECTION; \
30 mfspr ra,SPRN_PURR; /* get processor util. reg */ \ 30 mfspr ra,SPRN_PURR; /* get processor util. reg */ \
31END_FTR_SECTION_IFSET(CPU_FTR_PURR); \ 31END_FTR_SECTION_IFSET(CPU_FTR_PURR); \
32BEGIN_FTR_SECTION; \ 32BEGIN_FTR_SECTION; \
33 mftb ra; /* or get TB if no PURR */ \ 33 MFTB(ra); /* or get TB if no PURR */ \
34END_FTR_SECTION_IFCLR(CPU_FTR_PURR); \ 34END_FTR_SECTION_IFCLR(CPU_FTR_PURR); \
35 ld rb,PACA_STARTPURR(r13); \ 35 ld rb,PACA_STARTPURR(r13); \
36 std ra,PACA_STARTPURR(r13); \ 36 std ra,PACA_STARTPURR(r13); \
37 subf rb,rb,ra; /* subtract start value */ \ 37 subf rb,rb,ra; /* subtract start value */ \
38 ld ra,PACA_USER_TIME(r13); \ 38 ld ra,PACA_USER_TIME(r13); \
@@ -45,9 +45,9 @@ BEGIN_FTR_SECTION; \
45 mfspr ra,SPRN_PURR; /* get processor util. reg */ \ 45 mfspr ra,SPRN_PURR; /* get processor util. reg */ \
46END_FTR_SECTION_IFSET(CPU_FTR_PURR); \ 46END_FTR_SECTION_IFSET(CPU_FTR_PURR); \
47BEGIN_FTR_SECTION; \ 47BEGIN_FTR_SECTION; \
48 mftb ra; /* or get TB if no PURR */ \ 48 MFTB(ra); /* or get TB if no PURR */ \
49END_FTR_SECTION_IFCLR(CPU_FTR_PURR); \ 49END_FTR_SECTION_IFCLR(CPU_FTR_PURR); \
50 ld rb,PACA_STARTPURR(r13); \ 50 ld rb,PACA_STARTPURR(r13); \
51 std ra,PACA_STARTPURR(r13); \ 51 std ra,PACA_STARTPURR(r13); \
52 subf rb,rb,ra; /* subtract start value */ \ 52 subf rb,rb,ra; /* subtract start value */ \
53 ld ra,PACA_SYSTEM_TIME(r13); \ 53 ld ra,PACA_SYSTEM_TIME(r13); \
@@ -274,6 +274,16 @@ END_FTR_SECTION_IFSET(CPU_FTR_601)
274#define ISYNC_601 274#define ISYNC_601
275#endif 275#endif
276 276
277#ifdef CONFIG_PPC_CELL
278#define MFTB(dest) \
27990: mftb dest; \
280BEGIN_FTR_SECTION_NESTED(96); \
281 cmpwi dest,0; \
282 beq- 90b; \
283END_FTR_SECTION_NESTED(CPU_FTR_CELL_TB_BUG, CPU_FTR_CELL_TB_BUG, 96)
284#else
285#define MFTB(dest) mftb dest
286#endif
277 287
278#ifndef CONFIG_SMP 288#ifndef CONFIG_SMP
279#define TLBSYNC 289#define TLBSYNC
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
index 524629769336..ec11d44eaeb5 100644
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -134,7 +134,7 @@ extern struct device_node *of_find_all_nodes(struct device_node *prev);
134extern struct device_node *of_get_parent(const struct device_node *node); 134extern struct device_node *of_get_parent(const struct device_node *node);
135extern struct device_node *of_get_next_child(const struct device_node *node, 135extern struct device_node *of_get_next_child(const struct device_node *node,
136 struct device_node *prev); 136 struct device_node *prev);
137extern struct property *of_find_property(struct device_node *np, 137extern struct property *of_find_property(const struct device_node *np,
138 const char *name, 138 const char *name,
139 int *lenp); 139 int *lenp);
140extern struct device_node *of_node_get(struct device_node *node); 140extern struct device_node *of_node_get(struct device_node *node);
@@ -158,10 +158,12 @@ extern void of_detach_node(const struct device_node *);
158extern void finish_device_tree(void); 158extern void finish_device_tree(void);
159extern void unflatten_device_tree(void); 159extern void unflatten_device_tree(void);
160extern void early_init_devtree(void *); 160extern void early_init_devtree(void *);
161extern int device_is_compatible(struct device_node *device, const char *); 161extern int device_is_compatible(const struct device_node *device,
162 const char *);
162extern int machine_is_compatible(const char *compat); 163extern int machine_is_compatible(const char *compat);
163extern const void *get_property(struct device_node *node, const char *name, 164extern const void *get_property(const struct device_node *node,
164 int *lenp); 165 const char *name,
166 int *lenp);
165extern void print_properties(struct device_node *node); 167extern void print_properties(struct device_node *node);
166extern int prom_n_addr_cells(struct device_node* np); 168extern int prom_n_addr_cells(struct device_node* np);
167extern int prom_n_size_cells(struct device_node* np); 169extern int prom_n_size_cells(struct device_node* np);
diff --git a/include/asm-powerpc/reg.h b/include/asm-powerpc/reg.h
index 8fb96811b55d..6faae7b14d55 100644
--- a/include/asm-powerpc/reg.h
+++ b/include/asm-powerpc/reg.h
@@ -591,6 +591,7 @@
591#define PV_630 0x0040 591#define PV_630 0x0040
592#define PV_630p 0x0041 592#define PV_630p 0x0041
593#define PV_970MP 0x0044 593#define PV_970MP 0x0044
594#define PV_970GX 0x0045
594#define PV_BE 0x0070 595#define PV_BE 0x0070
595#define PV_PA6T 0x0090 596#define PV_PA6T 0x0090
596 597
@@ -618,10 +619,35 @@
618 : "=r" (rval)); rval;}) 619 : "=r" (rval)); rval;})
619#define mtspr(rn, v) asm volatile("mtspr " __stringify(rn) ",%0" : : "r" (v)) 620#define mtspr(rn, v) asm volatile("mtspr " __stringify(rn) ",%0" : : "r" (v))
620 621
622#ifdef __powerpc64__
623#ifdef CONFIG_PPC_CELL
624#define mftb() ({unsigned long rval; \
625 asm volatile( \
626 "90: mftb %0;\n" \
627 "97: cmpwi %0,0;\n" \
628 " beq- 90b;\n" \
629 "99:\n" \
630 ".section __ftr_fixup,\"a\"\n" \
631 ".align 3\n" \
632 "98:\n" \
633 " .llong %1\n" \
634 " .llong %1\n" \
635 " .llong 97b-98b\n" \
636 " .llong 99b-98b\n" \
637 ".previous" \
638 : "=r" (rval) : "i" (CPU_FTR_CELL_TB_BUG)); rval;})
639#else
621#define mftb() ({unsigned long rval; \ 640#define mftb() ({unsigned long rval; \
622 asm volatile("mftb %0" : "=r" (rval)); rval;}) 641 asm volatile("mftb %0" : "=r" (rval)); rval;})
642#endif /* !CONFIG_PPC_CELL */
643
644#else /* __powerpc64__ */
645
623#define mftbl() ({unsigned long rval; \ 646#define mftbl() ({unsigned long rval; \
624 asm volatile("mftbl %0" : "=r" (rval)); rval;}) 647 asm volatile("mftbl %0" : "=r" (rval)); rval;})
648#define mftbu() ({unsigned long rval; \
649 asm volatile("mftbu %0" : "=r" (rval)); rval;})
650#endif /* !__powerpc64__ */
625 651
626#define mttbl(v) asm volatile("mttbl %0":: "r"(v)) 652#define mttbl(v) asm volatile("mttbl %0":: "r"(v))
627#define mttbu(v) asm volatile("mttbu %0":: "r"(v)) 653#define mttbu(v) asm volatile("mttbu %0":: "r"(v))
diff --git a/include/asm-powerpc/systbl.h b/include/asm-powerpc/systbl.h
index eac85ce101b6..97b435484177 100644
--- a/include/asm-powerpc/systbl.h
+++ b/include/asm-powerpc/systbl.h
@@ -261,7 +261,7 @@ SYSX(sys_ni_syscall, ppc_fadvise64_64, ppc_fadvise64_64)
261PPC_SYS_SPU(rtas) 261PPC_SYS_SPU(rtas)
262OLDSYS(debug_setcontext) 262OLDSYS(debug_setcontext)
263SYSCALL(ni_syscall) 263SYSCALL(ni_syscall)
264SYSCALL(ni_syscall) 264COMPAT_SYS(migrate_pages)
265COMPAT_SYS(mbind) 265COMPAT_SYS(mbind)
266COMPAT_SYS(get_mempolicy) 266COMPAT_SYS(get_mempolicy)
267COMPAT_SYS(set_mempolicy) 267COMPAT_SYS(set_mempolicy)
@@ -304,3 +304,4 @@ SYSCALL_SPU(fchmodat)
304SYSCALL_SPU(faccessat) 304SYSCALL_SPU(faccessat)
305COMPAT_SYS_SPU(get_robust_list) 305COMPAT_SYS_SPU(get_robust_list)
306COMPAT_SYS_SPU(set_robust_list) 306COMPAT_SYS_SPU(set_robust_list)
307COMPAT_SYS(move_pages)
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h
index 43627596003b..f7b1227d6454 100644
--- a/include/asm-powerpc/system.h
+++ b/include/asm-powerpc/system.h
@@ -25,8 +25,8 @@
25 * 25 *
26 * We have to use the sync instructions for mb(), since lwsync doesn't 26 * We have to use the sync instructions for mb(), since lwsync doesn't
27 * order loads with respect to previous stores. Lwsync is fine for 27 * order loads with respect to previous stores. Lwsync is fine for
28 * rmb(), though. Note that lwsync is interpreted as sync by 28 * rmb(), though. Note that rmb() actually uses a sync on 32-bit
29 * 32-bit and older 64-bit CPUs. 29 * architectures.
30 * 30 *
31 * For wmb(), we use sync since wmb is used in drivers to order 31 * For wmb(), we use sync since wmb is used in drivers to order
32 * stores to system memory with respect to writes to the device. 32 * stores to system memory with respect to writes to the device.
@@ -34,7 +34,7 @@
34 * SMP since it is only used to order updates to system memory. 34 * SMP since it is only used to order updates to system memory.
35 */ 35 */
36#define mb() __asm__ __volatile__ ("sync" : : : "memory") 36#define mb() __asm__ __volatile__ ("sync" : : : "memory")
37#define rmb() __asm__ __volatile__ ("lwsync" : : : "memory") 37#define rmb() __asm__ __volatile__ (__stringify(LWSYNC) : : : "memory")
38#define wmb() __asm__ __volatile__ ("sync" : : : "memory") 38#define wmb() __asm__ __volatile__ ("sync" : : : "memory")
39#define read_barrier_depends() do { } while(0) 39#define read_barrier_depends() do { } while(0)
40 40
diff --git a/include/asm-powerpc/tce.h b/include/asm-powerpc/tce.h
index c9483adbf599..f663634cccc9 100644
--- a/include/asm-powerpc/tce.h
+++ b/include/asm-powerpc/tce.h
@@ -22,6 +22,8 @@
22#define _ASM_POWERPC_TCE_H 22#define _ASM_POWERPC_TCE_H
23#ifdef __KERNEL__ 23#ifdef __KERNEL__
24 24
25#include <asm/iommu.h>
26
25/* 27/*
26 * Tces come in two formats, one for the virtual bus and a different 28 * Tces come in two formats, one for the virtual bus and a different
27 * format for PCI 29 * format for PCI
@@ -33,7 +35,6 @@
33 35
34#define TCE_SHIFT 12 36#define TCE_SHIFT 12
35#define TCE_PAGE_SIZE (1 << TCE_SHIFT) 37#define TCE_PAGE_SIZE (1 << TCE_SHIFT)
36#define TCE_PAGE_FACTOR (PAGE_SHIFT - TCE_SHIFT)
37 38
38#define TCE_ENTRY_SIZE 8 /* each TCE is 64 bits */ 39#define TCE_ENTRY_SIZE 8 /* each TCE is 64 bits */
39 40
diff --git a/include/asm-powerpc/time.h b/include/asm-powerpc/time.h
index b051d4c88c3b..4cff977ad526 100644
--- a/include/asm-powerpc/time.h
+++ b/include/asm-powerpc/time.h
@@ -39,10 +39,6 @@ extern void generic_calibrate_decr(void);
39extern void wakeup_decrementer(void); 39extern void wakeup_decrementer(void);
40extern void snapshot_timebase(void); 40extern void snapshot_timebase(void);
41 41
42#ifdef CONFIG_RTC_CLASS
43extern int __init rtc_class_hookup(void);
44#endif
45
46/* Some sane defaults: 125 MHz timebase, 1GHz processor */ 42/* Some sane defaults: 125 MHz timebase, 1GHz processor */
47extern unsigned long ppc_proc_freq; 43extern unsigned long ppc_proc_freq;
48#define DEFAULT_PROC_FREQ (DEFAULT_TB_FREQ * 8) 44#define DEFAULT_PROC_FREQ (DEFAULT_TB_FREQ * 8)
@@ -82,30 +78,35 @@ struct div_result {
82#define __USE_RTC() 0 78#define __USE_RTC() 0
83#endif 79#endif
84 80
85/* On ppc64 this gets us the whole timebase; on ppc32 just the lower half */ 81#ifdef CONFIG_PPC64
82
83/* For compatibility, get_tbl() is defined as get_tb() on ppc64 */
84#define get_tbl get_tb
85
86#else
87
86static inline unsigned long get_tbl(void) 88static inline unsigned long get_tbl(void)
87{ 89{
88 unsigned long tbl;
89
90#if defined(CONFIG_403GCX) 90#if defined(CONFIG_403GCX)
91 unsigned long tbl;
91 asm volatile("mfspr %0, 0x3dd" : "=r" (tbl)); 92 asm volatile("mfspr %0, 0x3dd" : "=r" (tbl));
93 return tbl;
92#else 94#else
93 asm volatile("mftb %0" : "=r" (tbl)); 95 return mftbl();
94#endif 96#endif
95 return tbl;
96} 97}
97 98
98static inline unsigned int get_tbu(void) 99static inline unsigned int get_tbu(void)
99{ 100{
101#ifdef CONFIG_403GCX
100 unsigned int tbu; 102 unsigned int tbu;
101
102#if defined(CONFIG_403GCX)
103 asm volatile("mfspr %0, 0x3dc" : "=r" (tbu)); 103 asm volatile("mfspr %0, 0x3dc" : "=r" (tbu));
104 return tbu;
104#else 105#else
105 asm volatile("mftbu %0" : "=r" (tbu)); 106 return mftbu();
106#endif 107#endif
107 return tbu;
108} 108}
109#endif /* !CONFIG_PPC64 */
109 110
110static inline unsigned int get_rtcl(void) 111static inline unsigned int get_rtcl(void)
111{ 112{
@@ -131,7 +132,7 @@ static inline u64 get_tb(void)
131{ 132{
132 return mftb(); 133 return mftb();
133} 134}
134#else 135#else /* CONFIG_PPC64 */
135static inline u64 get_tb(void) 136static inline u64 get_tb(void)
136{ 137{
137 unsigned int tbhi, tblo, tbhi2; 138 unsigned int tbhi, tblo, tbhi2;
@@ -144,7 +145,7 @@ static inline u64 get_tb(void)
144 145
145 return ((u64)tbhi << 32) | tblo; 146 return ((u64)tbhi << 32) | tblo;
146} 147}
147#endif 148#endif /* !CONFIG_PPC64 */
148 149
149static inline void set_tb(unsigned int upper, unsigned int lower) 150static inline void set_tb(unsigned int upper, unsigned int lower)
150{ 151{
diff --git a/include/asm-powerpc/timex.h b/include/asm-powerpc/timex.h
index 3b9a8e786806..92dedde761d1 100644
--- a/include/asm-powerpc/timex.h
+++ b/include/asm-powerpc/timex.h
@@ -8,6 +8,7 @@
8 */ 8 */
9 9
10#include <asm/cputable.h> 10#include <asm/cputable.h>
11#include <asm/reg.h>
11 12
12#define CLOCK_TICK_RATE 1024000 /* Underlying HZ */ 13#define CLOCK_TICK_RATE 1024000 /* Underlying HZ */
13 14
@@ -15,13 +16,11 @@ typedef unsigned long cycles_t;
15 16
16static inline cycles_t get_cycles(void) 17static inline cycles_t get_cycles(void)
17{ 18{
18 cycles_t ret;
19
20#ifdef __powerpc64__ 19#ifdef __powerpc64__
21 20 return mftb();
22 __asm__ __volatile__("mftb %0" : "=r" (ret) : );
23
24#else 21#else
22 cycles_t ret;
23
25 /* 24 /*
26 * For the "cycle" counter we use the timebase lower half. 25 * For the "cycle" counter we use the timebase lower half.
27 * Currently only used on SMP. 26 * Currently only used on SMP.
@@ -30,18 +29,19 @@ static inline cycles_t get_cycles(void)
30 ret = 0; 29 ret = 0;
31 30
32 __asm__ __volatile__( 31 __asm__ __volatile__(
33 "98: mftb %0\n" 32 "97: mftb %0\n"
34 "99:\n" 33 "99:\n"
35 ".section __ftr_fixup,\"a\"\n" 34 ".section __ftr_fixup,\"a\"\n"
35 ".align 2\n"
36 "98:\n"
36 " .long %1\n" 37 " .long %1\n"
37 " .long 0\n" 38 " .long 0\n"
38 " .long 98b\n" 39 " .long 97b-98b\n"
39 " .long 99b\n" 40 " .long 99b-98b\n"
40 ".previous" 41 ".previous"
41 : "=r" (ret) : "i" (CPU_FTR_601)); 42 : "=r" (ret) : "i" (CPU_FTR_601));
42#endif
43
44 return ret; 43 return ret;
44#endif
45} 45}
46 46
47#endif /* __KERNEL__ */ 47#endif /* __KERNEL__ */
diff --git a/include/asm-powerpc/topology.h b/include/asm-powerpc/topology.h
index 8f7ee16781a4..9fe7894ee035 100644
--- a/include/asm-powerpc/topology.h
+++ b/include/asm-powerpc/topology.h
@@ -96,7 +96,13 @@ static inline void sysfs_remove_device_from_node(struct sys_device *dev,
96 96
97#ifdef CONFIG_SMP 97#ifdef CONFIG_SMP
98#include <asm/cputable.h> 98#include <asm/cputable.h>
99#define smt_capable() (cpu_has_feature(CPU_FTR_SMT)) 99#define smt_capable() (cpu_has_feature(CPU_FTR_SMT))
100
101#ifdef CONFIG_PPC64
102#include <asm/smp.h>
103
104#define topology_thread_siblings(cpu) (cpu_sibling_map[cpu])
105#endif
100#endif 106#endif
101 107
102#endif /* __KERNEL__ */ 108#endif /* __KERNEL__ */
diff --git a/include/asm-powerpc/unistd.h b/include/asm-powerpc/unistd.h
index 464a48cce7f5..0e4ea37f6466 100644
--- a/include/asm-powerpc/unistd.h
+++ b/include/asm-powerpc/unistd.h
@@ -276,7 +276,7 @@
276#define __NR_rtas 255 276#define __NR_rtas 255
277#define __NR_sys_debug_setcontext 256 277#define __NR_sys_debug_setcontext 256
278/* Number 257 is reserved for vserver */ 278/* Number 257 is reserved for vserver */
279/* 258 currently unused */ 279#define __NR_migrate_pages 258
280#define __NR_mbind 259 280#define __NR_mbind 259
281#define __NR_get_mempolicy 260 281#define __NR_get_mempolicy 260
282#define __NR_set_mempolicy 261 282#define __NR_set_mempolicy 261
@@ -323,10 +323,11 @@
323#define __NR_faccessat 298 323#define __NR_faccessat 298
324#define __NR_get_robust_list 299 324#define __NR_get_robust_list 299
325#define __NR_set_robust_list 300 325#define __NR_set_robust_list 300
326#define __NR_move_pages 301
326 327
327#ifdef __KERNEL__ 328#ifdef __KERNEL__
328 329
329#define __NR_syscalls 301 330#define __NR_syscalls 302
330 331
331#define __NR__exit __NR_exit 332#define __NR__exit __NR_exit
332#define NR_syscalls __NR_syscalls 333#define NR_syscalls __NR_syscalls
diff --git a/include/asm-sh/edosk7705/io.h b/include/asm-sh/edosk7705.h
index a1089a65bc36..a1089a65bc36 100644
--- a/include/asm-sh/edosk7705/io.h
+++ b/include/asm-sh/edosk7705.h
diff --git a/include/asm-sh/hp6xx/hp6xx.h b/include/asm-sh/hp6xx.h
index f35134c159dd..f35134c159dd 100644
--- a/include/asm-sh/hp6xx/hp6xx.h
+++ b/include/asm-sh/hp6xx.h
diff --git a/include/asm-sh/hp6xx/ide.h b/include/asm-sh/hp6xx/ide.h
deleted file mode 100644
index 570395a5ebe5..000000000000
--- a/include/asm-sh/hp6xx/ide.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef __ASM_SH_HP6XX_IDE_H
2#define __ASM_SH_HP6XX_IDE_H
3
4#define IRQ_CFCARD 93
5#define IRQ_PCMCIA 94
6
7#endif /* __ASM_SH_HP6XX_IDE_H */
8
diff --git a/include/asm-sh/hp6xx/io.h b/include/asm-sh/hp6xx/io.h
deleted file mode 100644
index 2044476ab199..000000000000
--- a/include/asm-sh/hp6xx/io.h
+++ /dev/null
@@ -1,10 +0,0 @@
1#ifndef __ASM_SH_HP6XX_IO_H
2#define __ASM_SH_HP6XX_IO_H
3
4/*
5 * Nothing special here.. just use the generic cchip io routines.
6 */
7#include <asm/hd64461.h>
8
9#endif /* __ASM_SH_HP6XX_IO_H */
10
diff --git a/include/asm-sh/hs7751rvoip/hs7751rvoip.h b/include/asm-sh/hs7751rvoip.h
index c4cff9d33927..c4cff9d33927 100644
--- a/include/asm-sh/hs7751rvoip/hs7751rvoip.h
+++ b/include/asm-sh/hs7751rvoip.h
diff --git a/include/asm-sh/hs7751rvoip/ide.h b/include/asm-sh/hs7751rvoip/ide.h
deleted file mode 100644
index 65ad1d0f763b..000000000000
--- a/include/asm-sh/hs7751rvoip/ide.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef __ASM_SH_HS7751RVOIP_IDE_H
2#define __ASM_SH_HS7751RVOIP_IDE_H
3
4/* Nothing to see here.. */
5#include <asm/hs7751rvoip/hs7751rvoip.h>
6
7#endif /* __ASM_SH_HS7751RVOIP_IDE_H */
8
diff --git a/include/asm-sh/irq-sh7780.h b/include/asm-sh/irq-sh7780.h
index 895c5780e454..19912ae6a7f7 100644
--- a/include/asm-sh/irq-sh7780.h
+++ b/include/asm-sh/irq-sh7780.h
@@ -6,16 +6,6 @@
6 * 6 *
7 * Copyright (C) 2004 Takashi SHUDO <shudo@hitachi-ul.co.jp> 7 * Copyright (C) 2004 Takashi SHUDO <shudo@hitachi-ul.co.jp>
8 */ 8 */
9
10#ifdef CONFIG_IDE
11# ifndef IRQ_CFCARD
12# define IRQ_CFCARD 14
13# endif
14# ifndef IRQ_PCMCIA
15# define IRQ_PCMCIA 15
16# endif
17#endif
18
19#define INTC_BASE 0xffd00000 9#define INTC_BASE 0xffd00000
20#define INTC_ICR0 (INTC_BASE+0x0) 10#define INTC_ICR0 (INTC_BASE+0x0)
21#define INTC_ICR1 (INTC_BASE+0x1c) 11#define INTC_ICR1 (INTC_BASE+0x1c)
diff --git a/include/asm-sh/irq.h b/include/asm-sh/irq.h
index 28996f9c58cc..6cd3e9e2a76a 100644
--- a/include/asm-sh/irq.h
+++ b/include/asm-sh/irq.h
@@ -14,16 +14,6 @@
14#include <asm/machvec.h> 14#include <asm/machvec.h>
15#include <asm/ptrace.h> /* for pt_regs */ 15#include <asm/ptrace.h> /* for pt_regs */
16 16
17#if defined(CONFIG_SH_HP6XX) || \
18 defined(CONFIG_SH_RTS7751R2D) || \
19 defined(CONFIG_SH_HS7751RVOIP) || \
20 defined(CONFIG_SH_HS7751RVOIP) || \
21 defined(CONFIG_SH_SH03) || \
22 defined(CONFIG_SH_R7780RP) || \
23 defined(CONFIG_SH_LANDISK)
24#include <asm/mach/ide.h>
25#endif
26
27#ifndef CONFIG_CPU_SUBTYPE_SH7780 17#ifndef CONFIG_CPU_SUBTYPE_SH7780
28 18
29#define INTC_DMAC0_MSK 0 19#define INTC_DMAC0_MSK 0
@@ -38,15 +28,6 @@
38#define INTC_IPRD 0xffd00010UL 28#define INTC_IPRD 0xffd00010UL
39#endif 29#endif
40 30
41#ifdef CONFIG_IDE
42# ifndef IRQ_CFCARD
43# define IRQ_CFCARD 14
44# endif
45# ifndef IRQ_PCMCIA
46# define IRQ_PCMCIA 15
47# endif
48#endif
49
50#define TIMER_IRQ 16 31#define TIMER_IRQ 16
51#define TIMER_IPR_ADDR INTC_IPRA 32#define TIMER_IPR_ADDR INTC_IPRA
52#define TIMER_IPR_POS 3 33#define TIMER_IPR_POS 3
@@ -346,11 +327,17 @@ extern unsigned short *irq_mask_register;
346 */ 327 */
347void init_IRQ_pint(void); 328void init_IRQ_pint(void);
348 329
330struct ipr_data {
331 unsigned int irq;
332 unsigned int addr; /* Address of Interrupt Priority Register */
333 int shift; /* Shifts of the 16-bit data */
334 int priority; /* The priority */
335};
336
349/* 337/*
350 * Function for "on chip support modules". 338 * Function for "on chip support modules".
351 */ 339 */
352extern void make_ipr_irq(unsigned int irq, unsigned int addr, 340extern void make_ipr_irq(struct ipr_data *table, unsigned int nr_irqs);
353 int pos, int priority);
354extern void make_imask_irq(unsigned int irq); 341extern void make_imask_irq(unsigned int irq);
355 342
356#if defined(CONFIG_CPU_SUBTYPE_SH7300) 343#if defined(CONFIG_CPU_SUBTYPE_SH7300)
@@ -704,7 +691,7 @@ struct intc2_data {
704 unsigned char priority; 691 unsigned char priority;
705}; 692};
706 693
707void make_intc2_irq(struct intc2_data *); 694void make_intc2_irq(struct intc2_data *, unsigned int nr_irqs);
708void init_IRQ_intc2(void); 695void init_IRQ_intc2(void);
709#endif 696#endif
710 697
diff --git a/include/asm-sh/landisk/ide.h b/include/asm-sh/landisk/ide.h
deleted file mode 100644
index 6490e28415ed..000000000000
--- a/include/asm-sh/landisk/ide.h
+++ /dev/null
@@ -1,14 +0,0 @@
1/*
2 * modifed by kogiidena
3 * 2005.03.03
4 */
5
6#ifndef __ASM_SH_LANDISK_IDE_H
7#define __ASM_SH_LANDISK_IDE_H
8
9/* Nothing to see here.. */
10#include <asm/landisk/iodata_landisk.h>
11#define IRQ_CFCARD IRQ_FATA /* CF Card IRQ */
12#define IRQ_PCMCIA IRQ_ATA /* PCMCIA IRQ */
13
14#endif /* __ASM_SH_LANDISK_IDE_H */
diff --git a/include/asm-sh/processor.h b/include/asm-sh/processor.h
index 474773853cd1..45bb74e35d32 100644
--- a/include/asm-sh/processor.h
+++ b/include/asm-sh/processor.h
@@ -255,6 +255,8 @@ extern void save_fpu(struct task_struct *__tsk, struct pt_regs *regs);
255 */ 255 */
256#define thread_saved_pc(tsk) (tsk->thread.pc) 256#define thread_saved_pc(tsk) (tsk->thread.pc)
257 257
258void show_trace(struct task_struct *tsk, unsigned long *sp,
259 struct pt_regs *regs);
258extern unsigned long get_wchan(struct task_struct *p); 260extern unsigned long get_wchan(struct task_struct *p);
259 261
260#define KSTK_EIP(tsk) ((tsk)->thread.pc) 262#define KSTK_EIP(tsk) ((tsk)->thread.pc)
diff --git a/include/asm-sh/r7780rp/r7780rp.h b/include/asm-sh/r7780rp.h
index f95d9dba31a2..c18f648a7995 100644
--- a/include/asm-sh/r7780rp/r7780rp.h
+++ b/include/asm-sh/r7780rp.h
@@ -72,8 +72,6 @@
72 72
73#define PA_AX88796L 0xa4100400 /* AX88796L Area */ 73#define PA_AX88796L 0xa4100400 /* AX88796L Area */
74#define PA_SC1602BSLB 0xa6000000 /* SC1602BSLB Area */ 74#define PA_SC1602BSLB 0xa6000000 /* SC1602BSLB Area */
75#define PA_AREA5_IO 0xb4000000 /* Area 5 IO Memory */
76#define PA_AREA6_IO 0xb8000000 /* Area 6 IO Memory */
77#define PA_IDE_OFFSET 0x1f0 /* CF IDE Offset */ 75#define PA_IDE_OFFSET 0x1f0 /* CF IDE Offset */
78#define AX88796L_IO_BASE 0x1000 /* AX88796L IO Base Address */ 76#define AX88796L_IO_BASE 0x1000 /* AX88796L IO Base Address */
79 77
@@ -83,7 +81,6 @@
83#define IRQ_PCISLOT2 66 /* PCI Slot #2 IRQ */ 81#define IRQ_PCISLOT2 66 /* PCI Slot #2 IRQ */
84#define IRQ_PCISLOT3 67 /* PCI Slot #3 IRQ */ 82#define IRQ_PCISLOT3 67 /* PCI Slot #3 IRQ */
85#define IRQ_PCISLOT4 68 /* PCI Slot #4 IRQ */ 83#define IRQ_PCISLOT4 68 /* PCI Slot #4 IRQ */
86#define IRQ_CFCARD 1 /* CF Card IRQ */
87// #define IRQ_CFINST 0 /* CF Card Insert IRQ */ 84// #define IRQ_CFINST 0 /* CF Card Insert IRQ */
88#define IRQ_TP 2 /* Touch Panel IRQ */ 85#define IRQ_TP 2 /* Touch Panel IRQ */
89#define IRQ_SCI1 3 /* SCI1 IRQ */ 86#define IRQ_SCI1 3 /* SCI1 IRQ */
@@ -146,8 +143,6 @@
146 143
147#define PA_AX88796L 0xa5800400 /* AX88796L Area */ 144#define PA_AX88796L 0xa5800400 /* AX88796L Area */
148#define PA_SC1602BSLB 0xa6000000 /* SC1602BSLB Area */ 145#define PA_SC1602BSLB 0xa6000000 /* SC1602BSLB Area */
149#define PA_AREA5_IO 0xb4000000 /* Area 5 IO Memory */
150#define PA_AREA6_IO 0xb8000000 /* Area 6 IO Memory */
151#define PA_IDE_OFFSET 0x1f0 /* CF IDE Offset */ 146#define PA_IDE_OFFSET 0x1f0 /* CF IDE Offset */
152#define AX88796L_IO_BASE 0x1000 /* AX88796L IO Base Address */ 147#define AX88796L_IO_BASE 0x1000 /* AX88796L IO Base Address */
153 148
@@ -157,7 +152,6 @@
157#define IRQ_PCISLOT2 1 /* PCI Slot #2 IRQ */ 152#define IRQ_PCISLOT2 1 /* PCI Slot #2 IRQ */
158#define IRQ_PCISLOT3 2 /* PCI Slot #3 IRQ */ 153#define IRQ_PCISLOT3 2 /* PCI Slot #3 IRQ */
159#define IRQ_PCISLOT4 3 /* PCI Slot #4 IRQ */ 154#define IRQ_PCISLOT4 3 /* PCI Slot #4 IRQ */
160#define IRQ_CFCARD 4 /* CF Card IRQ */
161#define IRQ_CFINST 5 /* CF Card Insert IRQ */ 155#define IRQ_CFINST 5 /* CF Card Insert IRQ */
162#define IRQ_M66596 6 /* M66596 IRQ */ 156#define IRQ_M66596 6 /* M66596 IRQ */
163#define IRQ_SDCARD 7 /* SD Card IRQ */ 157#define IRQ_SDCARD 7 /* SD Card IRQ */
diff --git a/include/asm-sh/r7780rp/ide.h b/include/asm-sh/r7780rp/ide.h
deleted file mode 100644
index a1ed78e0f617..000000000000
--- a/include/asm-sh/r7780rp/ide.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef __ASM_SH_R7780RP_IDE_H
2#define __ASM_SH_R7780RP_IDE_H
3
4/* Nothing to see here.. */
5#include <asm/mach/r7780rp.h>
6
7#endif /* __ASM_SH_R7780RP_IDE_H */
8
diff --git a/include/asm-sh/rts7751r2d/rts7751r2d.h b/include/asm-sh/rts7751r2d.h
index 796b8fcb81a8..796b8fcb81a8 100644
--- a/include/asm-sh/rts7751r2d/rts7751r2d.h
+++ b/include/asm-sh/rts7751r2d.h
diff --git a/include/asm-sh/rts7751r2d/ide.h b/include/asm-sh/rts7751r2d/ide.h
deleted file mode 100644
index 416f96b407cb..000000000000
--- a/include/asm-sh/rts7751r2d/ide.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef __ASM_SH_RTS7751R2D_IDE_H
2#define __ASM_SH_RTS7751R2D_IDE_H
3
4/* Nothing to see here.. */
5#include <asm/rts7751r2d/rts7751r2d.h>
6
7#endif /* __ASM_SH_RTS7751R2D_IDE_H */
8
diff --git a/include/asm-sh/sh03/ide.h b/include/asm-sh/sh03/ide.h
deleted file mode 100644
index 73ee92e5c79e..000000000000
--- a/include/asm-sh/sh03/ide.h
+++ /dev/null
@@ -1,7 +0,0 @@
1#ifndef __ASM_SH_SH03_IDE_H
2#define __ASM_SH_SH03_IDE_H
3
4#define IRQ_CFCARD 8
5#define IRQ_PCMCIA 8
6
7#endif /* __ASM_SH_SH03_IDE_H */
diff --git a/include/asm-sh/shmin/shmin.h b/include/asm-sh/shmin.h
index 36ba138a81fb..36ba138a81fb 100644
--- a/include/asm-sh/shmin/shmin.h
+++ b/include/asm-sh/shmin.h
diff --git a/include/asm-sh/system.h b/include/asm-sh/system.h
index 6c1f8fde5ac4..3340126f4e0f 100644
--- a/include/asm-sh/system.h
+++ b/include/asm-sh/system.h
@@ -353,6 +353,13 @@ static inline unsigned long __cmpxchg(volatile void * ptr, unsigned long old,
353 (unsigned long)_n_, sizeof(*(ptr))); \ 353 (unsigned long)_n_, sizeof(*(ptr))); \
354 }) 354 })
355 355
356extern void *set_exception_table_vec(unsigned int vec, void *handler);
357
358static inline void *set_exception_table_evt(unsigned int evt, void *handler)
359{
360 return set_exception_table_vec(evt >> 5, handler);
361}
362
356/* XXX 363/* XXX
357 * disable hlt during certain critical i/o operations 364 * disable hlt during certain critical i/o operations
358 */ 365 */
diff --git a/include/asm-sh/unistd.h b/include/asm-sh/unistd.h
index f1a0cbc966be..1c2abde122cd 100644
--- a/include/asm-sh/unistd.h
+++ b/include/asm-sh/unistd.h
@@ -324,8 +324,11 @@
324#define __NR_sync_file_range 314 324#define __NR_sync_file_range 314
325#define __NR_tee 315 325#define __NR_tee 315
326#define __NR_vmsplice 316 326#define __NR_vmsplice 316
327#define __NR_move_pages 317
328#define __NR_getcpu 318
329#define __NR_epoll_pwait 319
327 330
328#define NR_syscalls 317 331#define NR_syscalls 320
329 332
330#ifdef __KERNEL__ 333#ifdef __KERNEL__
331 334
diff --git a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h
index c7a495afc82e..f7827fa4cd5e 100644
--- a/include/asm-sparc/unistd.h
+++ b/include/asm-sparc/unistd.h
@@ -318,12 +318,15 @@
318#define __NR_unshare 299 318#define __NR_unshare 299
319#define __NR_set_robust_list 300 319#define __NR_set_robust_list 300
320#define __NR_get_robust_list 301 320#define __NR_get_robust_list 301
321#define __NR_migrate_pages 302
322
323#define NR_SYSCALLS 303
321 324
322#ifdef __KERNEL__ 325#ifdef __KERNEL__
323/* WARNING: You MAY NOT add syscall numbers larger than 301, since 326/* WARNING: You MAY NOT add syscall numbers larger than 302, since
324 * all of the syscall tables in the Sparc kernel are 327 * all of the syscall tables in the Sparc kernel are
325 * sized to have 301 entries (starting at zero). Therefore 328 * sized to have 302 entries (starting at zero). Therefore
326 * find a free slot in the 0-301 range. 329 * find a free slot in the 0-302 range.
327 */ 330 */
328 331
329#define _syscall0(type,name) \ 332#define _syscall0(type,name) \
diff --git a/include/asm-sparc64/compat.h b/include/asm-sparc64/compat.h
index c73935dc7ba1..36511ca51416 100644
--- a/include/asm-sparc64/compat.h
+++ b/include/asm-sparc64/compat.h
@@ -164,7 +164,7 @@ static inline compat_uptr_t ptr_to_compat(void __user *uptr)
164 return (u32)(unsigned long)uptr; 164 return (u32)(unsigned long)uptr;
165} 165}
166 166
167static __inline__ void __user *compat_alloc_user_space(long len) 167static inline void __user *compat_alloc_user_space(long len)
168{ 168{
169 struct pt_regs *regs = current_thread_info()->kregs; 169 struct pt_regs *regs = current_thread_info()->kregs;
170 unsigned long usp = regs->u_regs[UREG_I6]; 170 unsigned long usp = regs->u_regs[UREG_I6];
@@ -174,7 +174,10 @@ static __inline__ void __user *compat_alloc_user_space(long len)
174 else 174 else
175 usp &= 0xffffffffUL; 175 usp &= 0xffffffffUL;
176 176
177 return (void __user *) (usp - len); 177 usp -= len;
178 usp &= ~0x7UL;
179
180 return (void __user *) usp;
178} 181}
179 182
180struct compat_ipc64_perm { 183struct compat_ipc64_perm {
diff --git a/include/asm-sparc64/futex.h b/include/asm-sparc64/futex.h
index dee40206b221..7392fc4a954e 100644
--- a/include/asm-sparc64/futex.h
+++ b/include/asm-sparc64/futex.h
@@ -87,24 +87,22 @@ static inline int
87futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) 87futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
88{ 88{
89 __asm__ __volatile__( 89 __asm__ __volatile__(
90 "\n1: lduwa [%2] %%asi, %0\n" 90 "\n1: casa [%3] %%asi, %2, %0\n"
91 "2: casa [%2] %%asi, %0, %1\n" 91 "2:\n"
92 "3:\n"
93 " .section .fixup,#alloc,#execinstr\n" 92 " .section .fixup,#alloc,#execinstr\n"
94 " .align 4\n" 93 " .align 4\n"
95 "4: ba 3b\n" 94 "3: ba 2b\n"
96 " mov %3, %0\n" 95 " mov %4, %0\n"
97 " .previous\n" 96 " .previous\n"
98 " .section __ex_table,\"a\"\n" 97 " .section __ex_table,\"a\"\n"
99 " .align 4\n" 98 " .align 4\n"
100 " .word 1b, 4b\n" 99 " .word 1b, 3b\n"
101 " .word 2b, 4b\n"
102 " .previous\n" 100 " .previous\n"
103 : "=&r" (oldval) 101 : "=r" (newval)
104 : "r" (newval), "r" (uaddr), "i" (-EFAULT) 102 : "0" (newval), "r" (oldval), "r" (uaddr), "i" (-EFAULT)
105 : "memory"); 103 : "memory");
106 104
107 return oldval; 105 return newval;
108} 106}
109 107
110#endif /* !(_SPARC64_FUTEX_H) */ 108#endif /* !(_SPARC64_FUTEX_H) */
diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h
index 124cf076717f..63669dad0d72 100644
--- a/include/asm-sparc64/unistd.h
+++ b/include/asm-sparc64/unistd.h
@@ -320,12 +320,16 @@
320#define __NR_unshare 299 320#define __NR_unshare 299
321#define __NR_set_robust_list 300 321#define __NR_set_robust_list 300
322#define __NR_get_robust_list 301 322#define __NR_get_robust_list 301
323#define __NR_migrate_pages 302
324
325#define NR_SYSCALLS 303
323 326
324#ifdef __KERNEL__ 327#ifdef __KERNEL__
325/* WARNING: You MAY NOT add syscall numbers larger than 301, since 328
329/* WARNING: You MAY NOT add syscall numbers larger than 302, since
326 * all of the syscall tables in the Sparc kernel are 330 * all of the syscall tables in the Sparc kernel are
327 * sized to have 301 entries (starting at zero). Therefore 331 * sized to have 302 entries (starting at zero). Therefore
328 * find a free slot in the 0-301 range. 332 * find a free slot in the 0-302 range.
329 */ 333 */
330 334
331#define _syscall0(type,name) \ 335#define _syscall0(type,name) \
diff --git a/include/asm-um/common.lds.S b/include/asm-um/common.lds.S
index 1010153faaf9..f0454516dd31 100644
--- a/include/asm-um/common.lds.S
+++ b/include/asm-um/common.lds.S
@@ -42,13 +42,7 @@
42 42
43 __initcall_start = .; 43 __initcall_start = .;
44 .initcall.init : { 44 .initcall.init : {
45 *(.initcall1.init) 45 INITCALLS
46 *(.initcall2.init)
47 *(.initcall3.init)
48 *(.initcall4.init)
49 *(.initcall5.init)
50 *(.initcall6.init)
51 *(.initcall7.init)
52 } 46 }
53 __initcall_end = .; 47 __initcall_end = .;
54 48
diff --git a/include/asm-x86_64/acpi.h b/include/asm-x86_64/acpi.h
index ed59aa4c6ff9..9d1916e59c04 100644
--- a/include/asm-x86_64/acpi.h
+++ b/include/asm-x86_64/acpi.h
@@ -163,6 +163,7 @@ extern u8 x86_acpiid_to_apicid[];
163#define ARCH_HAS_POWER_INIT 1 163#define ARCH_HAS_POWER_INIT 1
164 164
165extern int acpi_skip_timer_override; 165extern int acpi_skip_timer_override;
166extern int acpi_use_timer_override;
166 167
167#endif /*__KERNEL__*/ 168#endif /*__KERNEL__*/
168 169
diff --git a/include/asm-x86_64/hw_irq.h b/include/asm-x86_64/hw_irq.h
index 792dd52fcd70..179cce755aa7 100644
--- a/include/asm-x86_64/hw_irq.h
+++ b/include/asm-x86_64/hw_irq.h
@@ -76,6 +76,8 @@
76#ifndef __ASSEMBLY__ 76#ifndef __ASSEMBLY__
77typedef int vector_irq_t[NR_VECTORS]; 77typedef int vector_irq_t[NR_VECTORS];
78DECLARE_PER_CPU(vector_irq_t, vector_irq); 78DECLARE_PER_CPU(vector_irq_t, vector_irq);
79extern void __setup_vector_irq(int cpu);
80extern spinlock_t vector_lock;
79 81
80/* 82/*
81 * Various low-level irq details needed by irq.c, process.c, 83 * Various low-level irq details needed by irq.c, process.c,
diff --git a/include/asm-x86_64/io_apic.h b/include/asm-x86_64/io_apic.h
index 171ec2dc8c04..561ecbfd4cb5 100644
--- a/include/asm-x86_64/io_apic.h
+++ b/include/asm-x86_64/io_apic.h
@@ -12,10 +12,6 @@
12 12
13#define APIC_MISMATCH_DEBUG 13#define APIC_MISMATCH_DEBUG
14 14
15#define IO_APIC_BASE(idx) \
16 ((volatile int *)(__fix_to_virt(FIX_IO_APIC_BASE_0 + idx) \
17 + (mp_ioapics[idx].mpc_apicaddr & ~PAGE_MASK)))
18
19/* 15/*
20 * The structure of the IO-APIC: 16 * The structure of the IO-APIC:
21 */ 17 */
@@ -119,36 +115,6 @@ extern struct mpc_config_intsrc mp_irqs[MAX_IRQ_SOURCES];
119/* non-0 if default (table-less) MP configuration */ 115/* non-0 if default (table-less) MP configuration */
120extern int mpc_default_type; 116extern int mpc_default_type;
121 117
122static inline unsigned int io_apic_read(unsigned int apic, unsigned int reg)
123{
124 *IO_APIC_BASE(apic) = reg;
125 return *(IO_APIC_BASE(apic)+4);
126}
127
128static inline void io_apic_write(unsigned int apic, unsigned int reg, unsigned int value)
129{
130 *IO_APIC_BASE(apic) = reg;
131 *(IO_APIC_BASE(apic)+4) = value;
132}
133
134/*
135 * Re-write a value: to be used for read-modify-write
136 * cycles where the read already set up the index register.
137 */
138static inline void io_apic_modify(unsigned int apic, unsigned int value)
139{
140 *(IO_APIC_BASE(apic)+4) = value;
141}
142
143/*
144 * Synchronize the IO-APIC and the CPU by doing
145 * a dummy read from the IO-APIC
146 */
147static inline void io_apic_sync(unsigned int apic)
148{
149 (void) *(IO_APIC_BASE(apic)+4);
150}
151
152/* 1 if "noapic" boot option passed */ 118/* 1 if "noapic" boot option passed */
153extern int skip_ioapic_setup; 119extern int skip_ioapic_setup;
154 120
diff --git a/include/asm-x86_64/pda.h b/include/asm-x86_64/pda.h
index 14996d962bac..5642634843c4 100644
--- a/include/asm-x86_64/pda.h
+++ b/include/asm-x86_64/pda.h
@@ -109,6 +109,15 @@ extern struct x8664_pda _proxy_pda;
109#define sub_pda(field,val) pda_to_op("sub",field,val) 109#define sub_pda(field,val) pda_to_op("sub",field,val)
110#define or_pda(field,val) pda_to_op("or",field,val) 110#define or_pda(field,val) pda_to_op("or",field,val)
111 111
112/* This is not atomic against other CPUs -- CPU preemption needs to be off */
113#define test_and_clear_bit_pda(bit,field) ({ \
114 int old__; \
115 asm volatile("btr %2,%%gs:%c3\n\tsbbl %0,%0" \
116 : "=r" (old__), "+m" (_proxy_pda.field) \
117 : "dIr" (bit), "i" (pda_offset(field)) : "memory"); \
118 old__; \
119})
120
112#endif 121#endif
113 122
114#define PDA_STACKOFFSET (5*8) 123#define PDA_STACKOFFSET (5*8)
diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h
index 6899e770b173..0555c1c4d8fa 100644
--- a/include/asm-x86_64/pgtable.h
+++ b/include/asm-x86_64/pgtable.h
@@ -366,6 +366,7 @@ static inline pte_t mk_pte_phys(unsigned long physpage, pgprot_t pgprot)
366{ 366{
367 pte_t pte; 367 pte_t pte;
368 pte_val(pte) = physpage | pgprot_val(pgprot); 368 pte_val(pte) = physpage | pgprot_val(pgprot);
369 pte_val(pte) &= __supported_pte_mask;
369 return pte; 370 return pte;
370} 371}
371 372
diff --git a/include/asm-x86_64/proto.h b/include/asm-x86_64/proto.h
index c181fef786e4..e72cfcdf5344 100644
--- a/include/asm-x86_64/proto.h
+++ b/include/asm-x86_64/proto.h
@@ -122,6 +122,8 @@ extern int fix_aperture;
122extern int reboot_force; 122extern int reboot_force;
123extern int notsc_setup(char *); 123extern int notsc_setup(char *);
124 124
125extern int timer_over_8254;
126
125extern int gsi_irq_sharing(int gsi); 127extern int gsi_irq_sharing(int gsi);
126 128
127extern void smp_local_timer_interrupt(void); 129extern void smp_local_timer_interrupt(void);
diff --git a/include/asm-x86_64/vsyscall.h b/include/asm-x86_64/vsyscall.h
index fd452fc2c037..01d1c17e2849 100644
--- a/include/asm-x86_64/vsyscall.h
+++ b/include/asm-x86_64/vsyscall.h
@@ -59,8 +59,6 @@ extern seqlock_t xtime_lock;
59 59
60extern int sysctl_vsyscall; 60extern int sysctl_vsyscall;
61 61
62extern void vsyscall_set_cpu(int cpu);
63
64#define ARCH_HAVE_XTIME_LOCK 1 62#define ARCH_HAVE_XTIME_LOCK 1
65 63
66#endif /* __KERNEL__ */ 64#endif /* __KERNEL__ */
diff --git a/include/linux/compat.h b/include/linux/compat.h
index f4ebf96f5308..80b17f440ec1 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -196,7 +196,7 @@ asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp,
196#define BITS_TO_COMPAT_LONGS(bits) \ 196#define BITS_TO_COMPAT_LONGS(bits) \
197 (((bits)+BITS_PER_COMPAT_LONG-1)/BITS_PER_COMPAT_LONG) 197 (((bits)+BITS_PER_COMPAT_LONG-1)/BITS_PER_COMPAT_LONG)
198 198
199long compat_get_bitmap(unsigned long *mask, compat_ulong_t __user *umask, 199long compat_get_bitmap(unsigned long *mask, const compat_ulong_t __user *umask,
200 unsigned long bitmap_size); 200 unsigned long bitmap_size);
201long compat_put_bitmap(compat_ulong_t __user *umask, unsigned long *mask, 201long compat_put_bitmap(compat_ulong_t __user *umask, unsigned long *mask,
202 unsigned long bitmap_size); 202 unsigned long bitmap_size);
@@ -230,5 +230,9 @@ asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp);
230extern int compat_printk(const char *fmt, ...); 230extern int compat_printk(const char *fmt, ...);
231extern void sigset_from_compat(sigset_t *set, compat_sigset_t *compat); 231extern void sigset_from_compat(sigset_t *set, compat_sigset_t *compat);
232 232
233asmlinkage long compat_sys_migrate_pages(compat_pid_t pid,
234 compat_ulong_t maxnode, const compat_ulong_t __user *old_nodes,
235 const compat_ulong_t __user *new_nodes);
236
233#endif /* CONFIG_COMPAT */ 237#endif /* CONFIG_COMPAT */
234#endif /* _LINUX_COMPAT_H */ 238#endif /* _LINUX_COMPAT_H */
diff --git a/include/linux/compat_ioctl.h b/include/linux/compat_ioctl.h
index cfdb4f6a89d4..c26c3adcfacf 100644
--- a/include/linux/compat_ioctl.h
+++ b/include/linux/compat_ioctl.h
@@ -131,6 +131,7 @@ COMPATIBLE_IOCTL(RUN_ARRAY)
131COMPATIBLE_IOCTL(STOP_ARRAY) 131COMPATIBLE_IOCTL(STOP_ARRAY)
132COMPATIBLE_IOCTL(STOP_ARRAY_RO) 132COMPATIBLE_IOCTL(STOP_ARRAY_RO)
133COMPATIBLE_IOCTL(RESTART_ARRAY_RW) 133COMPATIBLE_IOCTL(RESTART_ARRAY_RW)
134COMPATIBLE_IOCTL(GET_BITMAP_FILE)
134ULONG_IOCTL(SET_BITMAP_FILE) 135ULONG_IOCTL(SET_BITMAP_FILE)
135/* DM */ 136/* DM */
136COMPATIBLE_IOCTL(DM_VERSION_32) 137COMPATIBLE_IOCTL(DM_VERSION_32)
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index 8f2ffa4caabf..6485e9716b36 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -245,7 +245,7 @@ int crypto_alg_available(const char *name, u32 flags)
245 __deprecated_for_modules; 245 __deprecated_for_modules;
246int crypto_has_alg(const char *name, u32 type, u32 mask); 246int crypto_has_alg(const char *name, u32 type, u32 mask);
247#else 247#else
248static int crypto_alg_available(const char *name, u32 flags); 248static int crypto_alg_available(const char *name, u32 flags)
249 __deprecated_for_modules; 249 __deprecated_for_modules;
250static inline int crypto_alg_available(const char *name, u32 flags) 250static inline int crypto_alg_available(const char *name, u32 flags)
251{ 251{
diff --git a/include/linux/device.h b/include/linux/device.h
index 662e6a10144e..9d4f6a963936 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -393,7 +393,7 @@ extern void device_unregister(struct device * dev);
393extern void device_initialize(struct device * dev); 393extern void device_initialize(struct device * dev);
394extern int __must_check device_add(struct device * dev); 394extern int __must_check device_add(struct device * dev);
395extern void device_del(struct device * dev); 395extern void device_del(struct device * dev);
396extern int __must_check device_for_each_child(struct device *, void *, 396extern int device_for_each_child(struct device *, void *,
397 int (*fn)(struct device *, void *)); 397 int (*fn)(struct device *, void *));
398extern int device_rename(struct device *dev, char *new_name); 398extern int device_rename(struct device *dev, char *new_name);
399 399
diff --git a/include/linux/dmi.h b/include/linux/dmi.h
index 38dc403be70b..904bf3d2d90b 100644
--- a/include/linux/dmi.h
+++ b/include/linux/dmi.h
@@ -69,6 +69,7 @@ extern struct dmi_device * dmi_find_device(int type, const char *name,
69 struct dmi_device *from); 69 struct dmi_device *from);
70extern void dmi_scan_machine(void); 70extern void dmi_scan_machine(void);
71extern int dmi_get_year(int field); 71extern int dmi_get_year(int field);
72extern int dmi_name_in_vendors(char *str);
72 73
73#else 74#else
74 75
@@ -77,6 +78,7 @@ static inline char * dmi_get_system_info(int field) { return NULL; }
77static inline struct dmi_device * dmi_find_device(int type, const char *name, 78static inline struct dmi_device * dmi_find_device(int type, const char *name,
78 struct dmi_device *from) { return NULL; } 79 struct dmi_device *from) { return NULL; }
79static inline int dmi_get_year(int year) { return 0; } 80static inline int dmi_get_year(int year) { return 0; }
81static inline int dmi_name_in_vendors(char *s) { return 0; }
80 82
81#endif 83#endif
82 84
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 661c7c572149..2fe6e3f900ba 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -623,6 +623,9 @@ enum inode_i_mutex_lock_class
623 I_MUTEX_QUOTA 623 I_MUTEX_QUOTA
624}; 624};
625 625
626extern void inode_double_lock(struct inode *inode1, struct inode *inode2);
627extern void inode_double_unlock(struct inode *inode1, struct inode *inode2);
628
626/* 629/*
627 * NOTE: in a 32bit arch with a preemptable kernel and 630 * NOTE: in a 32bit arch with a preemptable kernel and
628 * an UP compile the i_size_read/write must be atomic 631 * an UP compile the i_size_read/write must be atomic
@@ -1709,6 +1712,8 @@ extern void __iget(struct inode * inode);
1709extern void clear_inode(struct inode *); 1712extern void clear_inode(struct inode *);
1710extern void destroy_inode(struct inode *); 1713extern void destroy_inode(struct inode *);
1711extern struct inode *new_inode(struct super_block *); 1714extern struct inode *new_inode(struct super_block *);
1715extern int __remove_suid(struct dentry *, int);
1716extern int should_remove_suid(struct dentry *);
1712extern int remove_suid(struct dentry *); 1717extern int remove_suid(struct dentry *);
1713extern void remove_dquot_ref(struct super_block *, int, struct list_head *); 1718extern void remove_dquot_ref(struct super_block *, int, struct list_head *);
1714 1719
@@ -1755,6 +1760,8 @@ extern ssize_t generic_file_splice_read(struct file *, loff_t *,
1755 struct pipe_inode_info *, size_t, unsigned int); 1760 struct pipe_inode_info *, size_t, unsigned int);
1756extern ssize_t generic_file_splice_write(struct pipe_inode_info *, 1761extern ssize_t generic_file_splice_write(struct pipe_inode_info *,
1757 struct file *, loff_t *, size_t, unsigned int); 1762 struct file *, loff_t *, size_t, unsigned int);
1763extern ssize_t generic_file_splice_write_nolock(struct pipe_inode_info *,
1764 struct file *, loff_t *, size_t, unsigned int);
1758extern ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe, 1765extern ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe,
1759 struct file *out, loff_t *, size_t len, unsigned int flags); 1766 struct file *out, loff_t *, size_t len, unsigned int flags);
1760extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out, 1767extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out,
diff --git a/include/linux/htirq.h b/include/linux/htirq.h
index 1f15ce279a23..c96ea46737d0 100644
--- a/include/linux/htirq.h
+++ b/include/linux/htirq.h
@@ -1,15 +1,23 @@
1#ifndef LINUX_HTIRQ_H 1#ifndef LINUX_HTIRQ_H
2#define LINUX_HTIRQ_H 2#define LINUX_HTIRQ_H
3 3
4struct ht_irq_msg {
5 u32 address_lo; /* low 32 bits of the ht irq message */
6 u32 address_hi; /* high 32 bits of the it irq message */
7};
8
4/* Helper functions.. */ 9/* Helper functions.. */
5void write_ht_irq_low(unsigned int irq, u32 data); 10void fetch_ht_irq_msg(unsigned int irq, struct ht_irq_msg *msg);
6void write_ht_irq_high(unsigned int irq, u32 data); 11void write_ht_irq_msg(unsigned int irq, struct ht_irq_msg *msg);
7u32 read_ht_irq_low(unsigned int irq);
8u32 read_ht_irq_high(unsigned int irq);
9void mask_ht_irq(unsigned int irq); 12void mask_ht_irq(unsigned int irq);
10void unmask_ht_irq(unsigned int irq); 13void unmask_ht_irq(unsigned int irq);
11 14
12/* The arch hook for getting things started */ 15/* The arch hook for getting things started */
13int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev); 16int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev);
14 17
18/* For drivers of buggy hardware */
19typedef void (ht_irq_update_t)(struct pci_dev *dev, int irq,
20 struct ht_irq_msg *msg);
21int __ht_create_irq(struct pci_dev *dev, int idx, ht_irq_update_t *update);
22
15#endif /* LINUX_HTIRQ_H */ 23#endif /* LINUX_HTIRQ_H */
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 5081d27bfa27..ace64e57e17f 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -60,8 +60,11 @@ void hugetlb_free_pgd_range(struct mmu_gather **tlb, unsigned long addr,
60 * If the arch doesn't supply something else, assume that hugepage 60 * If the arch doesn't supply something else, assume that hugepage
61 * size aligned regions are ok without further preparation. 61 * size aligned regions are ok without further preparation.
62 */ 62 */
63static inline int prepare_hugepage_range(unsigned long addr, unsigned long len) 63static inline int prepare_hugepage_range(unsigned long addr, unsigned long len,
64 pgoff_t pgoff)
64{ 65{
66 if (pgoff & (~HPAGE_MASK >> PAGE_SHIFT))
67 return -EINVAL;
65 if (len & ~HPAGE_MASK) 68 if (len & ~HPAGE_MASK)
66 return -EINVAL; 69 return -EINVAL;
67 if (addr & ~HPAGE_MASK) 70 if (addr & ~HPAGE_MASK)
@@ -69,7 +72,8 @@ static inline int prepare_hugepage_range(unsigned long addr, unsigned long len)
69 return 0; 72 return 0;
70} 73}
71#else 74#else
72int prepare_hugepage_range(unsigned long addr, unsigned long len); 75int prepare_hugepage_range(unsigned long addr, unsigned long len,
76 pgoff_t pgoff);
73#endif 77#endif
74 78
75#ifndef ARCH_HAS_SETCLEAR_HUGE_PTE 79#ifndef ARCH_HAS_SETCLEAR_HUGE_PTE
@@ -107,7 +111,7 @@ static inline unsigned long hugetlb_total_pages(void)
107#define hugetlb_report_meminfo(buf) 0 111#define hugetlb_report_meminfo(buf) 0
108#define hugetlb_report_node_meminfo(n, buf) 0 112#define hugetlb_report_node_meminfo(n, buf) 0
109#define follow_huge_pmd(mm, addr, pmd, write) NULL 113#define follow_huge_pmd(mm, addr, pmd, write) NULL
110#define prepare_hugepage_range(addr, len) (-EINVAL) 114#define prepare_hugepage_range(addr,len,pgoff) (-EINVAL)
111#define pmd_huge(x) 0 115#define pmd_huge(x) 0
112#define is_hugepage_only_range(mm, addr, len) 0 116#define is_hugepage_only_range(mm, addr, len) 0
113#define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; }) 117#define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; })
diff --git a/include/linux/igmp.h b/include/linux/igmp.h
index 03f43e2893a4..21dd56905271 100644
--- a/include/linux/igmp.h
+++ b/include/linux/igmp.h
@@ -191,7 +191,7 @@ struct ip_mc_list
191#define IGMPV3_MASK(value, nb) ((nb)>=32 ? (value) : ((1<<(nb))-1) & (value)) 191#define IGMPV3_MASK(value, nb) ((nb)>=32 ? (value) : ((1<<(nb))-1) & (value))
192#define IGMPV3_EXP(thresh, nbmant, nbexp, value) \ 192#define IGMPV3_EXP(thresh, nbmant, nbexp, value) \
193 ((value) < (thresh) ? (value) : \ 193 ((value) < (thresh) ? (value) : \
194 ((IGMPV3_MASK(value, nbmant) | (1<<(nbmant+nbexp))) << \ 194 ((IGMPV3_MASK(value, nbmant) | (1<<(nbmant))) << \
195 (IGMPV3_MASK((value) >> (nbmant), nbexp) + (nbexp)))) 195 (IGMPV3_MASK((value) >> (nbmant), nbexp) + (nbexp))))
196 196
197#define IGMPV3_QQIC(value) IGMPV3_EXP(0x80, 4, 3, value) 197#define IGMPV3_QQIC(value) IGMPV3_EXP(0x80, 4, 3, value)
diff --git a/include/linux/in6.h b/include/linux/in6.h
index 9be6a4756f0b..f28621f638e0 100644
--- a/include/linux/in6.h
+++ b/include/linux/in6.h
@@ -225,7 +225,7 @@ struct in6_flowlabel_req
225#endif 225#endif
226 226
227/* 227/*
228 * Netfilter 228 * Netfilter (1)
229 * 229 *
230 * Following socket options are used in ip6_tables; 230 * Following socket options are used in ip6_tables;
231 * see include/linux/netfilter_ipv6/ip6_tables.h. 231 * see include/linux/netfilter_ipv6/ip6_tables.h.
@@ -240,4 +240,14 @@ struct in6_flowlabel_req
240#define IPV6_RECVTCLASS 66 240#define IPV6_RECVTCLASS 66
241#define IPV6_TCLASS 67 241#define IPV6_TCLASS 67
242 242
243/*
244 * Netfilter (2)
245 *
246 * Following socket options are used in ip6_tables;
247 * see include/linux/netfilter_ipv6/ip6_tables.h.
248 *
249 * IP6T_SO_GET_REVISION_MATCH 68
250 * IP6T_SO_GET_REVISION_TARGET 69
251 */
252
243#endif 253#endif
diff --git a/include/linux/init.h b/include/linux/init.h
index e92b1455d7af..5eb5d24b7680 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -84,19 +84,37 @@ extern void setup_arch(char **);
84 * by link order. 84 * by link order.
85 * For backwards compatibility, initcall() puts the call in 85 * For backwards compatibility, initcall() puts the call in
86 * the device init subsection. 86 * the device init subsection.
87 *
88 * The `id' arg to __define_initcall() is needed so that multiple initcalls
89 * can point at the same handler without causing duplicate-symbol build errors.
87 */ 90 */
88 91
89#define __define_initcall(level,fn) \ 92#define __define_initcall(level,fn,id) \
90 static initcall_t __initcall_##fn __attribute_used__ \ 93 static initcall_t __initcall_##fn##id __attribute_used__ \
91 __attribute__((__section__(".initcall" level ".init"))) = fn 94 __attribute__((__section__(".initcall" level ".init"))) = fn
92 95
93#define core_initcall(fn) __define_initcall("1",fn) 96/*
94#define postcore_initcall(fn) __define_initcall("2",fn) 97 * A "pure" initcall has no dependencies on anything else, and purely
95#define arch_initcall(fn) __define_initcall("3",fn) 98 * initializes variables that couldn't be statically initialized.
96#define subsys_initcall(fn) __define_initcall("4",fn) 99 *
97#define fs_initcall(fn) __define_initcall("5",fn) 100 * This only exists for built-in code, not for modules.
98#define device_initcall(fn) __define_initcall("6",fn) 101 */
99#define late_initcall(fn) __define_initcall("7",fn) 102#define pure_initcall(fn) __define_initcall("0",fn,1)
103
104#define core_initcall(fn) __define_initcall("1",fn,1)
105#define core_initcall_sync(fn) __define_initcall("1s",fn,1s)
106#define postcore_initcall(fn) __define_initcall("2",fn,2)
107#define postcore_initcall_sync(fn) __define_initcall("2s",fn,2s)
108#define arch_initcall(fn) __define_initcall("3",fn,3)
109#define arch_initcall_sync(fn) __define_initcall("3s",fn,3s)
110#define subsys_initcall(fn) __define_initcall("4",fn,4)
111#define subsys_initcall_sync(fn) __define_initcall("4s",fn,4s)
112#define fs_initcall(fn) __define_initcall("5",fn,5)
113#define fs_initcall_sync(fn) __define_initcall("5s",fn,5s)
114#define device_initcall(fn) __define_initcall("6",fn,6)
115#define device_initcall_sync(fn) __define_initcall("6s",fn,6s)
116#define late_initcall(fn) __define_initcall("7",fn,7)
117#define late_initcall_sync(fn) __define_initcall("7s",fn,7s)
100 118
101#define __initcall(fn) device_initcall(fn) 119#define __initcall(fn) device_initcall(fn)
102 120
diff --git a/include/linux/ipmi_msgdefs.h b/include/linux/ipmi_msgdefs.h
index 22f5e2afda4f..4d04d8b58a0a 100644
--- a/include/linux/ipmi_msgdefs.h
+++ b/include/linux/ipmi_msgdefs.h
@@ -75,6 +75,8 @@
75#define IPMI_INVALID_COMMAND_ERR 0xc1 75#define IPMI_INVALID_COMMAND_ERR 0xc1
76#define IPMI_ERR_MSG_TRUNCATED 0xc6 76#define IPMI_ERR_MSG_TRUNCATED 0xc6
77#define IPMI_LOST_ARBITRATION_ERR 0x81 77#define IPMI_LOST_ARBITRATION_ERR 0x81
78#define IPMI_BUS_ERR 0x82
79#define IPMI_NAK_ON_WRITE_ERR 0x83
78#define IPMI_ERR_UNSPECIFIED 0xff 80#define IPMI_ERR_UNSPECIFIED 0xff
79 81
80#define IPMI_CHANNEL_PROTOCOL_IPMB 1 82#define IPMI_CHANNEL_PROTOCOL_IPMB 1
diff --git a/include/linux/ipx.h b/include/linux/ipx.h
index 4f29c60964c4..eb19b4ea84f4 100644
--- a/include/linux/ipx.h
+++ b/include/linux/ipx.h
@@ -7,8 +7,8 @@
7 7
8struct sockaddr_ipx { 8struct sockaddr_ipx {
9 sa_family_t sipx_family; 9 sa_family_t sipx_family;
10 __u16 sipx_port; 10 __be16 sipx_port;
11 __u32 sipx_network; 11 __be32 sipx_network;
12 unsigned char sipx_node[IPX_NODE_LEN]; 12 unsigned char sipx_node[IPX_NODE_LEN];
13 __u8 sipx_type; 13 __u8 sipx_type;
14 unsigned char sipx_zero; /* 16 byte fill */ 14 unsigned char sipx_zero; /* 16 byte fill */
@@ -23,13 +23,13 @@ struct sockaddr_ipx {
23#define IPX_CRTITF 1 23#define IPX_CRTITF 1
24 24
25struct ipx_route_definition { 25struct ipx_route_definition {
26 __u32 ipx_network; 26 __be32 ipx_network;
27 __u32 ipx_router_network; 27 __be32 ipx_router_network;
28 unsigned char ipx_router_node[IPX_NODE_LEN]; 28 unsigned char ipx_router_node[IPX_NODE_LEN];
29}; 29};
30 30
31struct ipx_interface_definition { 31struct ipx_interface_definition {
32 __u32 ipx_network; 32 __be32 ipx_network;
33 unsigned char ipx_device[16]; 33 unsigned char ipx_device[16];
34 unsigned char ipx_dlink_type; 34 unsigned char ipx_dlink_type;
35#define IPX_FRAME_NONE 0 35#define IPX_FRAME_NONE 0
@@ -55,8 +55,8 @@ struct ipx_config_data {
55 */ 55 */
56 56
57struct ipx_route_def { 57struct ipx_route_def {
58 __u32 ipx_network; 58 __be32 ipx_network;
59 __u32 ipx_router_network; 59 __be32 ipx_router_network;
60#define IPX_ROUTE_NO_ROUTER 0 60#define IPX_ROUTE_NO_ROUTER 0
61 unsigned char ipx_router_node[IPX_NODE_LEN]; 61 unsigned char ipx_router_node[IPX_NODE_LEN];
62 unsigned char ipx_device[16]; 62 unsigned char ipx_device[16];
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 80f39cab470a..b9b5e4ba166a 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -30,8 +30,10 @@ extern const char linux_banner[];
30 30
31#define STACK_MAGIC 0xdeadbeef 31#define STACK_MAGIC 0xdeadbeef
32 32
33#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1)
34#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
35
33#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) 36#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
34#define ALIGN(x,a) (((x)+(a)-1UL)&~((a)-1UL))
35#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f)) 37#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
36#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) 38#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
37#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) 39#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
@@ -171,6 +173,8 @@ __attribute_const__ roundup_pow_of_two(unsigned long x)
171 173
172extern int printk_ratelimit(void); 174extern int printk_ratelimit(void);
173extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst); 175extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst);
176extern bool printk_timed_ratelimit(unsigned long *caller_jiffies,
177 unsigned int interval_msec);
174 178
175static inline void console_silent(void) 179static inline void console_silent(void)
176{ 180{
diff --git a/include/linux/libata.h b/include/linux/libata.h
index d0a7ad5ed518..abd2debebca2 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -143,7 +143,7 @@ enum {
143 ATA_DFLAG_CFG_MASK = (1 << 8) - 1, 143 ATA_DFLAG_CFG_MASK = (1 << 8) - 1,
144 144
145 ATA_DFLAG_PIO = (1 << 8), /* device limited to PIO mode */ 145 ATA_DFLAG_PIO = (1 << 8), /* device limited to PIO mode */
146 ATA_DFLAG_NCQ_OFF = (1 << 9), /* devied limited to non-NCQ mode */ 146 ATA_DFLAG_NCQ_OFF = (1 << 9), /* device limited to non-NCQ mode */
147 ATA_DFLAG_SUSPENDED = (1 << 10), /* device suspended */ 147 ATA_DFLAG_SUSPENDED = (1 << 10), /* device suspended */
148 ATA_DFLAG_INIT_MASK = (1 << 16) - 1, 148 ATA_DFLAG_INIT_MASK = (1 << 16) - 1,
149 149
@@ -702,7 +702,6 @@ extern int ata_std_prereset(struct ata_port *ap);
702extern int ata_std_softreset(struct ata_port *ap, unsigned int *classes); 702extern int ata_std_softreset(struct ata_port *ap, unsigned int *classes);
703extern int sata_std_hardreset(struct ata_port *ap, unsigned int *class); 703extern int sata_std_hardreset(struct ata_port *ap, unsigned int *class);
704extern void ata_std_postreset(struct ata_port *ap, unsigned int *classes); 704extern void ata_std_postreset(struct ata_port *ap, unsigned int *classes);
705extern int ata_dev_revalidate(struct ata_device *dev, int post_reset);
706extern void ata_port_disable(struct ata_port *); 705extern void ata_port_disable(struct ata_port *);
707extern void ata_std_ports(struct ata_ioports *ioaddr); 706extern void ata_std_ports(struct ata_ioports *ioaddr);
708#ifdef CONFIG_PCI 707#ifdef CONFIG_PCI
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
index 09f0f575ddff..daabb3aa1ec6 100644
--- a/include/linux/mempolicy.h
+++ b/include/linux/mempolicy.h
@@ -150,7 +150,7 @@ extern void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new);
150extern void mpol_fix_fork_child_flag(struct task_struct *p); 150extern void mpol_fix_fork_child_flag(struct task_struct *p);
151#define set_cpuset_being_rebound(x) (cpuset_being_rebound = (x)) 151#define set_cpuset_being_rebound(x) (cpuset_being_rebound = (x))
152 152
153#ifdef CONFIG_CPUSET 153#ifdef CONFIG_CPUSETS
154#define current_cpuset_is_being_rebound() \ 154#define current_cpuset_is_being_rebound() \
155 (cpuset_being_rebound == current->cpuset) 155 (cpuset_being_rebound == current->cpuset)
156#else 156#else
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 59855b8718a0..e06683e2bea3 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -218,13 +218,9 @@ struct zone {
218 * under - it drives the swappiness decision: whether to unmap mapped 218 * under - it drives the swappiness decision: whether to unmap mapped
219 * pages. 219 * pages.
220 * 220 *
221 * temp_priority is used to remember the scanning priority at which 221 * Access to both this field is quite racy even on uniprocessor. But
222 * this zone was successfully refilled to free_pages == pages_high.
223 *
224 * Access to both these fields is quite racy even on uniprocessor. But
225 * it is expected to average out OK. 222 * it is expected to average out OK.
226 */ 223 */
227 int temp_priority;
228 int prev_priority; 224 int prev_priority;
229 225
230 226
@@ -674,6 +670,12 @@ void sparse_init(void);
674#define sparse_index_init(_sec, _nid) do {} while (0) 670#define sparse_index_init(_sec, _nid) do {} while (0)
675#endif /* CONFIG_SPARSEMEM */ 671#endif /* CONFIG_SPARSEMEM */
676 672
673#ifdef CONFIG_NODES_SPAN_OTHER_NODES
674#define early_pfn_in_nid(pfn, nid) (early_pfn_to_nid(pfn) == (nid))
675#else
676#define early_pfn_in_nid(pfn, nid) (1)
677#endif
678
677#ifndef early_pfn_valid 679#ifndef early_pfn_valid
678#define early_pfn_valid(pfn) (1) 680#define early_pfn_valid(pfn) (1)
679#endif 681#endif
diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h
index ce6c85815cbd..24a9ef1506b6 100644
--- a/include/linux/msdos_fs.h
+++ b/include/linux/msdos_fs.h
@@ -402,6 +402,8 @@ extern const struct file_operations fat_file_operations;
402extern struct inode_operations fat_file_inode_operations; 402extern struct inode_operations fat_file_inode_operations;
403extern int fat_notify_change(struct dentry * dentry, struct iattr * attr); 403extern int fat_notify_change(struct dentry * dentry, struct iattr * attr);
404extern void fat_truncate(struct inode *inode); 404extern void fat_truncate(struct inode *inode);
405extern int fat_getattr(struct vfsmount *mnt, struct dentry *dentry,
406 struct kstat *stat);
405 407
406/* fat/inode.c */ 408/* fat/inode.c */
407extern void fat_attach(struct inode *inode, loff_t i_pos); 409extern void fat_attach(struct inode *inode, loff_t i_pos);
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 1aeedf27a1ff..2071b02f0526 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -358,7 +358,7 @@ struct nand_buffers {
358 * @priv: [OPTIONAL] pointer to private chip date 358 * @priv: [OPTIONAL] pointer to private chip date
359 * @errstat: [OPTIONAL] hardware specific function to perform additional error status checks 359 * @errstat: [OPTIONAL] hardware specific function to perform additional error status checks
360 * (determine if errors are correctable) 360 * (determine if errors are correctable)
361 * @write_page [REPLACEABLE] High-level page write function 361 * @write_page: [REPLACEABLE] High-level page write function
362 */ 362 */
363 363
364struct nand_chip { 364struct nand_chip {
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 9264139bd8df..83b8c4f1d69d 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -93,8 +93,10 @@ struct netpoll_info;
93#endif 93#endif
94#endif 94#endif
95 95
96#if !defined(CONFIG_NET_IPIP) && \ 96#if !defined(CONFIG_NET_IPIP) && !defined(CONFIG_NET_IPIP_MODULE) && \
97 !defined(CONFIG_IPV6) && !defined(CONFIG_IPV6_MODULE) 97 !defined(CONFIG_NET_IPGRE) && !defined(CONFIG_NET_IPGRE_MODULE) && \
98 !defined(CONFIG_IPV6_SIT) && !defined(CONFIG_IPV6_SIT_MODULE) && \
99 !defined(CONFIG_IPV6_TUNNEL) && !defined(CONFIG_IPV6_TUNNEL_MODULE)
98#define MAX_HEADER LL_MAX_HEADER 100#define MAX_HEADER LL_MAX_HEADER
99#else 101#else
100#define MAX_HEADER (LL_MAX_HEADER + 48) 102#define MAX_HEADER (LL_MAX_HEADER + 48)
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index 04319a76103a..022edfa97ed9 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -96,22 +96,6 @@ struct _xt_align
96/* Error verdict. */ 96/* Error verdict. */
97#define XT_ERROR_TARGET "ERROR" 97#define XT_ERROR_TARGET "ERROR"
98 98
99/*
100 * New IP firewall options for [gs]etsockopt at the RAW IP level.
101 * Unlike BSD Linux inherits IP options so you don't have to use a raw
102 * socket for this. Instead we check rights in the calls. */
103#define XT_BASE_CTL 64 /* base for firewall socket options */
104
105#define XT_SO_SET_REPLACE (XT_BASE_CTL)
106#define XT_SO_SET_ADD_COUNTERS (XT_BASE_CTL + 1)
107#define XT_SO_SET_MAX XT_SO_SET_ADD_COUNTERS
108
109#define XT_SO_GET_INFO (XT_BASE_CTL)
110#define XT_SO_GET_ENTRIES (XT_BASE_CTL + 1)
111#define XT_SO_GET_REVISION_MATCH (XT_BASE_CTL + 2)
112#define XT_SO_GET_REVISION_TARGET (XT_BASE_CTL + 3)
113#define XT_SO_GET_MAX XT_SO_GET_REVISION_TARGET
114
115#define SET_COUNTER(c,b,p) do { (c).bcnt = (b); (c).pcnt = (p); } while(0) 99#define SET_COUNTER(c,b,p) do { (c).bcnt = (b); (c).pcnt = (p); } while(0)
116#define ADD_COUNTER(c,b,p) do { (c).bcnt += (b); (c).pcnt += (p); } while(0) 100#define ADD_COUNTER(c,b,p) do { (c).bcnt += (b); (c).pcnt += (p); } while(0)
117 101
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h
index 44e39b61d9e7..0be235418a2f 100644
--- a/include/linux/netfilter_arp/arp_tables.h
+++ b/include/linux/netfilter_arp/arp_tables.h
@@ -112,19 +112,20 @@ struct arpt_entry
112 * New IP firewall options for [gs]etsockopt at the RAW IP level. 112 * New IP firewall options for [gs]etsockopt at the RAW IP level.
113 * Unlike BSD Linux inherits IP options so you don't have to use a raw 113 * Unlike BSD Linux inherits IP options so you don't have to use a raw
114 * socket for this. Instead we check rights in the calls. 114 * socket for this. Instead we check rights in the calls.
115 *
116 * ATTENTION: check linux/in.h before adding new number here.
115 */ 117 */
116#define ARPT_CTL_OFFSET 32 118#define ARPT_BASE_CTL 96
117#define ARPT_BASE_CTL (XT_BASE_CTL+ARPT_CTL_OFFSET) 119
118 120#define ARPT_SO_SET_REPLACE (ARPT_BASE_CTL)
119#define ARPT_SO_SET_REPLACE (XT_SO_SET_REPLACE+ARPT_CTL_OFFSET) 121#define ARPT_SO_SET_ADD_COUNTERS (ARPT_BASE_CTL + 1)
120#define ARPT_SO_SET_ADD_COUNTERS (XT_SO_SET_ADD_COUNTERS+ARPT_CTL_OFFSET) 122#define ARPT_SO_SET_MAX ARPT_SO_SET_ADD_COUNTERS
121#define ARPT_SO_SET_MAX (XT_SO_SET_MAX+ARPT_CTL_OFFSET) 123
122 124#define ARPT_SO_GET_INFO (ARPT_BASE_CTL)
123#define ARPT_SO_GET_INFO (XT_SO_GET_INFO+ARPT_CTL_OFFSET) 125#define ARPT_SO_GET_ENTRIES (ARPT_BASE_CTL + 1)
124#define ARPT_SO_GET_ENTRIES (XT_SO_GET_ENTRIES+ARPT_CTL_OFFSET) 126/* #define ARPT_SO_GET_REVISION_MATCH (APRT_BASE_CTL + 2) */
125/* #define ARPT_SO_GET_REVISION_MATCH XT_SO_GET_REVISION_MATCH */ 127#define ARPT_SO_GET_REVISION_TARGET (ARPT_BASE_CTL + 3)
126#define ARPT_SO_GET_REVISION_TARGET (XT_SO_GET_REVISION_TARGET+ARPT_CTL_OFFSET) 128#define ARPT_SO_GET_MAX (ARPT_SO_GET_REVISION_TARGET)
127#define ARPT_SO_GET_MAX (XT_SO_GET_REVISION_TARGET+ARPT_CTL_OFFSET)
128 129
129/* CONTINUE verdict for targets */ 130/* CONTINUE verdict for targets */
130#define ARPT_CONTINUE XT_CONTINUE 131#define ARPT_CONTINUE XT_CONTINUE
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h
index a536bbdef145..4f06dad0bde9 100644
--- a/include/linux/netfilter_ipv4/ip_tables.h
+++ b/include/linux/netfilter_ipv4/ip_tables.h
@@ -101,18 +101,21 @@ struct ipt_entry
101/* 101/*
102 * New IP firewall options for [gs]etsockopt at the RAW IP level. 102 * New IP firewall options for [gs]etsockopt at the RAW IP level.
103 * Unlike BSD Linux inherits IP options so you don't have to use a raw 103 * Unlike BSD Linux inherits IP options so you don't have to use a raw
104 * socket for this. Instead we check rights in the calls. */ 104 * socket for this. Instead we check rights in the calls.
105#define IPT_BASE_CTL XT_BASE_CTL 105 *
106 106 * ATTENTION: check linux/in.h before adding new number here.
107#define IPT_SO_SET_REPLACE XT_SO_SET_REPLACE 107 */
108#define IPT_SO_SET_ADD_COUNTERS XT_SO_SET_ADD_COUNTERS 108#define IPT_BASE_CTL 64
109#define IPT_SO_SET_MAX XT_SO_SET_MAX 109
110 110#define IPT_SO_SET_REPLACE (IPT_BASE_CTL)
111#define IPT_SO_GET_INFO XT_SO_GET_INFO 111#define IPT_SO_SET_ADD_COUNTERS (IPT_BASE_CTL + 1)
112#define IPT_SO_GET_ENTRIES XT_SO_GET_ENTRIES 112#define IPT_SO_SET_MAX IPT_SO_SET_ADD_COUNTERS
113#define IPT_SO_GET_REVISION_MATCH XT_SO_GET_REVISION_MATCH 113
114#define IPT_SO_GET_REVISION_TARGET XT_SO_GET_REVISION_TARGET 114#define IPT_SO_GET_INFO (IPT_BASE_CTL)
115#define IPT_SO_GET_MAX XT_SO_GET_REVISION_TARGET 115#define IPT_SO_GET_ENTRIES (IPT_BASE_CTL + 1)
116#define IPT_SO_GET_REVISION_MATCH (IPT_BASE_CTL + 2)
117#define IPT_SO_GET_REVISION_TARGET (IPT_BASE_CTL + 3)
118#define IPT_SO_GET_MAX IPT_SO_GET_REVISION_TARGET
116 119
117#define IPT_CONTINUE XT_CONTINUE 120#define IPT_CONTINUE XT_CONTINUE
118#define IPT_RETURN XT_RETURN 121#define IPT_RETURN XT_RETURN
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h
index d7a8e9c0dad0..4aed340401db 100644
--- a/include/linux/netfilter_ipv6/ip6_tables.h
+++ b/include/linux/netfilter_ipv6/ip6_tables.h
@@ -107,18 +107,21 @@ struct ip6t_entry
107/* 107/*
108 * New IP firewall options for [gs]etsockopt at the RAW IP level. 108 * New IP firewall options for [gs]etsockopt at the RAW IP level.
109 * Unlike BSD Linux inherits IP options so you don't have to use 109 * Unlike BSD Linux inherits IP options so you don't have to use
110 * a raw socket for this. Instead we check rights in the calls. */ 110 * a raw socket for this. Instead we check rights in the calls.
111#define IP6T_BASE_CTL XT_BASE_CTL 111 *
112 112 * ATTENTION: check linux/in6.h before adding new number here.
113#define IP6T_SO_SET_REPLACE XT_SO_SET_REPLACE 113 */
114#define IP6T_SO_SET_ADD_COUNTERS XT_SO_SET_ADD_COUNTERS 114#define IP6T_BASE_CTL 64
115#define IP6T_SO_SET_MAX XT_SO_SET_MAX 115
116 116#define IP6T_SO_SET_REPLACE (IP6T_BASE_CTL)
117#define IP6T_SO_GET_INFO XT_SO_GET_INFO 117#define IP6T_SO_SET_ADD_COUNTERS (IP6T_BASE_CTL + 1)
118#define IP6T_SO_GET_ENTRIES XT_SO_GET_ENTRIES 118#define IP6T_SO_SET_MAX IP6T_SO_SET_ADD_COUNTERS
119#define IP6T_SO_GET_REVISION_MATCH XT_SO_GET_REVISION_MATCH 119
120#define IP6T_SO_GET_REVISION_TARGET XT_SO_GET_REVISION_TARGET 120#define IP6T_SO_GET_INFO (IP6T_BASE_CTL)
121#define IP6T_SO_GET_MAX XT_SO_GET_REVISION_TARGET 121#define IP6T_SO_GET_ENTRIES (IP6T_BASE_CTL + 1)
122#define IP6T_SO_GET_REVISION_MATCH (IP6T_BASE_CTL + 4)
123#define IP6T_SO_GET_REVISION_TARGET (IP6T_BASE_CTL + 5)
124#define IP6T_SO_GET_MAX IP6T_SO_GET_REVISION_TARGET
122 125
123/* CONTINUE verdict for targets */ 126/* CONTINUE verdict for targets */
124#define IP6T_CONTINUE XT_CONTINUE 127#define IP6T_CONTINUE XT_CONTINUE
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h
index eb231143d579..edb54c3171b3 100644
--- a/include/linux/nfsd/nfsd.h
+++ b/include/linux/nfsd/nfsd.h
@@ -89,7 +89,7 @@ __be32 nfsd_access(struct svc_rqst *, struct svc_fh *, u32 *, u32 *);
89__be32 nfsd_create_v3(struct svc_rqst *, struct svc_fh *, 89__be32 nfsd_create_v3(struct svc_rqst *, struct svc_fh *,
90 char *name, int len, struct iattr *attrs, 90 char *name, int len, struct iattr *attrs,
91 struct svc_fh *res, int createmode, 91 struct svc_fh *res, int createmode,
92 u32 *verifier, int *truncp); 92 u32 *verifier, int *truncp, int *created);
93__be32 nfsd_commit(struct svc_rqst *, struct svc_fh *, 93__be32 nfsd_commit(struct svc_rqst *, struct svc_fh *,
94 loff_t, unsigned long); 94 loff_t, unsigned long);
95#endif /* CONFIG_NFSD_V3 */ 95#endif /* CONFIG_NFSD_V3 */
diff --git a/include/linux/nsproxy.h b/include/linux/nsproxy.h
index f6baecdeecd6..971d1c6dfc4b 100644
--- a/include/linux/nsproxy.h
+++ b/include/linux/nsproxy.h
@@ -45,8 +45,10 @@ static inline void exit_task_namespaces(struct task_struct *p)
45{ 45{
46 struct nsproxy *ns = p->nsproxy; 46 struct nsproxy *ns = p->nsproxy;
47 if (ns) { 47 if (ns) {
48 put_nsproxy(ns); 48 task_lock(p);
49 p->nsproxy = NULL; 49 p->nsproxy = NULL;
50 task_unlock(p);
51 put_nsproxy(ns);
50 } 52 }
51} 53}
52#endif 54#endif
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 64f950925151..c3e255bf8594 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -52,19 +52,23 @@ static inline void mapping_set_gfp_mask(struct address_space *m, gfp_t mask)
52void release_pages(struct page **pages, int nr, int cold); 52void release_pages(struct page **pages, int nr, int cold);
53 53
54#ifdef CONFIG_NUMA 54#ifdef CONFIG_NUMA
55extern struct page *page_cache_alloc(struct address_space *x); 55extern struct page *__page_cache_alloc(gfp_t gfp);
56extern struct page *page_cache_alloc_cold(struct address_space *x);
57#else 56#else
57static inline struct page *__page_cache_alloc(gfp_t gfp)
58{
59 return alloc_pages(gfp, 0);
60}
61#endif
62
58static inline struct page *page_cache_alloc(struct address_space *x) 63static inline struct page *page_cache_alloc(struct address_space *x)
59{ 64{
60 return alloc_pages(mapping_gfp_mask(x), 0); 65 return __page_cache_alloc(mapping_gfp_mask(x));
61} 66}
62 67
63static inline struct page *page_cache_alloc_cold(struct address_space *x) 68static inline struct page *page_cache_alloc_cold(struct address_space *x)
64{ 69{
65 return alloc_pages(mapping_gfp_mask(x)|__GFP_COLD, 0); 70 return __page_cache_alloc(mapping_gfp_mask(x)|__GFP_COLD);
66} 71}
67#endif
68 72
69typedef int filler_t(void *, struct page *); 73typedef int filler_t(void *, struct page *);
70 74
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 4689e2a699c0..09be0f81b27b 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -455,7 +455,11 @@ int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap);
455int pci_find_ext_capability (struct pci_dev *dev, int cap); 455int pci_find_ext_capability (struct pci_dev *dev, int cap);
456struct pci_bus *pci_find_next_bus(const struct pci_bus *from); 456struct pci_bus *pci_find_next_bus(const struct pci_bus *from);
457 457
458struct pci_dev *pci_get_device (unsigned int vendor, unsigned int device, struct pci_dev *from); 458struct pci_dev *pci_get_device(unsigned int vendor, unsigned int device,
459 struct pci_dev *from);
460struct pci_dev *pci_get_device_reverse(unsigned int vendor, unsigned int device,
461 struct pci_dev *from);
462
459struct pci_dev *pci_get_subsys (unsigned int vendor, unsigned int device, 463struct pci_dev *pci_get_subsys (unsigned int vendor, unsigned int device,
460 unsigned int ss_vendor, unsigned int ss_device, 464 unsigned int ss_vendor, unsigned int ss_device,
461 struct pci_dev *from); 465 struct pci_dev *from);
@@ -660,7 +664,12 @@ static inline struct pci_dev *pci_find_device(unsigned int vendor, unsigned int
660static inline struct pci_dev *pci_find_slot(unsigned int bus, unsigned int devfn) 664static inline struct pci_dev *pci_find_slot(unsigned int bus, unsigned int devfn)
661{ return NULL; } 665{ return NULL; }
662 666
663static inline struct pci_dev *pci_get_device (unsigned int vendor, unsigned int device, struct pci_dev *from) 667static inline struct pci_dev *pci_get_device(unsigned int vendor,
668 unsigned int device, struct pci_dev *from)
669{ return NULL; }
670
671static inline struct pci_dev *pci_get_device_reverse(unsigned int vendor,
672 unsigned int device, struct pci_dev *from)
664{ return NULL; } 673{ return NULL; }
665 674
666static inline struct pci_dev *pci_get_subsys (unsigned int vendor, unsigned int device, 675static inline struct pci_dev *pci_get_subsys (unsigned int vendor, unsigned int device,
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index f3a168f3c9df..fa4e1d799782 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1213,6 +1213,7 @@
1213#define PCI_DEVICE_ID_NVIDIA_NVENET_21 0x0451 1213#define PCI_DEVICE_ID_NVIDIA_NVENET_21 0x0451
1214#define PCI_DEVICE_ID_NVIDIA_NVENET_22 0x0452 1214#define PCI_DEVICE_ID_NVIDIA_NVENET_22 0x0452
1215#define PCI_DEVICE_ID_NVIDIA_NVENET_23 0x0453 1215#define PCI_DEVICE_ID_NVIDIA_NVENET_23 0x0453
1216#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE 0x0560
1216 1217
1217#define PCI_VENDOR_ID_IMS 0x10e0 1218#define PCI_VENDOR_ID_IMS 0x10e0
1218#define PCI_DEVICE_ID_IMS_TT128 0x9128 1219#define PCI_DEVICE_ID_IMS_TT128 0x9128
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h
index c312a12ad2d6..c321316f1bc7 100644
--- a/include/linux/pci_regs.h
+++ b/include/linux/pci_regs.h
@@ -371,6 +371,7 @@
371#define PCI_EXP_DEVSTA_TRPND 0x20 /* Transactions Pending */ 371#define PCI_EXP_DEVSTA_TRPND 0x20 /* Transactions Pending */
372#define PCI_EXP_LNKCAP 12 /* Link Capabilities */ 372#define PCI_EXP_LNKCAP 12 /* Link Capabilities */
373#define PCI_EXP_LNKCTL 16 /* Link Control */ 373#define PCI_EXP_LNKCTL 16 /* Link Control */
374#define PCI_EXP_LNKCTL_CLKREQ_EN 0x100 /* Enable clkreq */
374#define PCI_EXP_LNKSTA 18 /* Link Status */ 375#define PCI_EXP_LNKSTA 18 /* Link Status */
375#define PCI_EXP_SLTCAP 20 /* Slot Capabilities */ 376#define PCI_EXP_SLTCAP 20 /* Slot Capabilities */
376#define PCI_EXP_SLTCTL 24 /* Slot Control */ 377#define PCI_EXP_SLTCTL 24 /* Slot Control */
diff --git a/include/linux/personality.h b/include/linux/personality.h
index bf4cf2080e5c..012cd558189b 100644
--- a/include/linux/personality.h
+++ b/include/linux/personality.h
@@ -114,7 +114,7 @@ struct exec_domain {
114 * Change personality of the currently running process. 114 * Change personality of the currently running process.
115 */ 115 */
116#define set_personality(pers) \ 116#define set_personality(pers) \
117 ((current->personality == pers) ? 0 : __set_personality(pers)) 117 ((current->personality == (pers)) ? 0 : __set_personality(pers))
118 118
119#endif /* __KERNEL__ */ 119#endif /* __KERNEL__ */
120 120
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 6b27e07aef19..070394e846d0 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -116,7 +116,9 @@ typedef int __bitwise suspend_disk_method_t;
116#define PM_DISK_PLATFORM ((__force suspend_disk_method_t) 2) 116#define PM_DISK_PLATFORM ((__force suspend_disk_method_t) 2)
117#define PM_DISK_SHUTDOWN ((__force suspend_disk_method_t) 3) 117#define PM_DISK_SHUTDOWN ((__force suspend_disk_method_t) 3)
118#define PM_DISK_REBOOT ((__force suspend_disk_method_t) 4) 118#define PM_DISK_REBOOT ((__force suspend_disk_method_t) 4)
119#define PM_DISK_MAX ((__force suspend_disk_method_t) 5) 119#define PM_DISK_TEST ((__force suspend_disk_method_t) 5)
120#define PM_DISK_TESTPROC ((__force suspend_disk_method_t) 6)
121#define PM_DISK_MAX ((__force suspend_disk_method_t) 7)
120 122
121struct pm_ops { 123struct pm_ops {
122 suspend_disk_method_t pm_disk_mode; 124 suspend_disk_method_t pm_disk_mode;
diff --git a/include/linux/raid/bitmap.h b/include/linux/raid/bitmap.h
index 84d887751855..ebd42a3710b4 100644
--- a/include/linux/raid/bitmap.h
+++ b/include/linux/raid/bitmap.h
@@ -146,16 +146,16 @@ enum bitmap_state {
146 146
147/* the superblock at the front of the bitmap file -- little endian */ 147/* the superblock at the front of the bitmap file -- little endian */
148typedef struct bitmap_super_s { 148typedef struct bitmap_super_s {
149 __u32 magic; /* 0 BITMAP_MAGIC */ 149 __le32 magic; /* 0 BITMAP_MAGIC */
150 __u32 version; /* 4 the bitmap major for now, could change... */ 150 __le32 version; /* 4 the bitmap major for now, could change... */
151 __u8 uuid[16]; /* 8 128 bit uuid - must match md device uuid */ 151 __u8 uuid[16]; /* 8 128 bit uuid - must match md device uuid */
152 __u64 events; /* 24 event counter for the bitmap (1)*/ 152 __le64 events; /* 24 event counter for the bitmap (1)*/
153 __u64 events_cleared;/*32 event counter when last bit cleared (2) */ 153 __le64 events_cleared;/*32 event counter when last bit cleared (2) */
154 __u64 sync_size; /* 40 the size of the md device's sync range(3) */ 154 __le64 sync_size; /* 40 the size of the md device's sync range(3) */
155 __u32 state; /* 48 bitmap state information */ 155 __le32 state; /* 48 bitmap state information */
156 __u32 chunksize; /* 52 the bitmap chunk size in bytes */ 156 __le32 chunksize; /* 52 the bitmap chunk size in bytes */
157 __u32 daemon_sleep; /* 56 seconds between disk flushes */ 157 __le32 daemon_sleep; /* 56 seconds between disk flushes */
158 __u32 write_behind; /* 60 number of outstanding write-behind writes */ 158 __le32 write_behind; /* 60 number of outstanding write-behind writes */
159 159
160 __u8 pad[256 - 64]; /* set to zero */ 160 __u8 pad[256 - 64]; /* set to zero */
161} bitmap_super_t; 161} bitmap_super_t;
diff --git a/include/linux/raid/md_p.h b/include/linux/raid/md_p.h
index b6ebc69bae54..3f2cd98c508b 100644
--- a/include/linux/raid/md_p.h
+++ b/include/linux/raid/md_p.h
@@ -206,52 +206,52 @@ static inline __u64 md_event(mdp_super_t *sb) {
206 */ 206 */
207struct mdp_superblock_1 { 207struct mdp_superblock_1 {
208 /* constant array information - 128 bytes */ 208 /* constant array information - 128 bytes */
209 __u32 magic; /* MD_SB_MAGIC: 0xa92b4efc - little endian */ 209 __le32 magic; /* MD_SB_MAGIC: 0xa92b4efc - little endian */
210 __u32 major_version; /* 1 */ 210 __le32 major_version; /* 1 */
211 __u32 feature_map; /* bit 0 set if 'bitmap_offset' is meaningful */ 211 __le32 feature_map; /* bit 0 set if 'bitmap_offset' is meaningful */
212 __u32 pad0; /* always set to 0 when writing */ 212 __le32 pad0; /* always set to 0 when writing */
213 213
214 __u8 set_uuid[16]; /* user-space generated. */ 214 __u8 set_uuid[16]; /* user-space generated. */
215 char set_name[32]; /* set and interpreted by user-space */ 215 char set_name[32]; /* set and interpreted by user-space */
216 216
217 __u64 ctime; /* lo 40 bits are seconds, top 24 are microseconds or 0*/ 217 __le64 ctime; /* lo 40 bits are seconds, top 24 are microseconds or 0*/
218 __u32 level; /* -4 (multipath), -1 (linear), 0,1,4,5 */ 218 __le32 level; /* -4 (multipath), -1 (linear), 0,1,4,5 */
219 __u32 layout; /* only for raid5 and raid10 currently */ 219 __le32 layout; /* only for raid5 and raid10 currently */
220 __u64 size; /* used size of component devices, in 512byte sectors */ 220 __le64 size; /* used size of component devices, in 512byte sectors */
221 221
222 __u32 chunksize; /* in 512byte sectors */ 222 __le32 chunksize; /* in 512byte sectors */
223 __u32 raid_disks; 223 __le32 raid_disks;
224 __u32 bitmap_offset; /* sectors after start of superblock that bitmap starts 224 __le32 bitmap_offset; /* sectors after start of superblock that bitmap starts
225 * NOTE: signed, so bitmap can be before superblock 225 * NOTE: signed, so bitmap can be before superblock
226 * only meaningful of feature_map[0] is set. 226 * only meaningful of feature_map[0] is set.
227 */ 227 */
228 228
229 /* These are only valid with feature bit '4' */ 229 /* These are only valid with feature bit '4' */
230 __u32 new_level; /* new level we are reshaping to */ 230 __le32 new_level; /* new level we are reshaping to */
231 __u64 reshape_position; /* next address in array-space for reshape */ 231 __le64 reshape_position; /* next address in array-space for reshape */
232 __u32 delta_disks; /* change in number of raid_disks */ 232 __le32 delta_disks; /* change in number of raid_disks */
233 __u32 new_layout; /* new layout */ 233 __le32 new_layout; /* new layout */
234 __u32 new_chunk; /* new chunk size (bytes) */ 234 __le32 new_chunk; /* new chunk size (bytes) */
235 __u8 pad1[128-124]; /* set to 0 when written */ 235 __u8 pad1[128-124]; /* set to 0 when written */
236 236
237 /* constant this-device information - 64 bytes */ 237 /* constant this-device information - 64 bytes */
238 __u64 data_offset; /* sector start of data, often 0 */ 238 __le64 data_offset; /* sector start of data, often 0 */
239 __u64 data_size; /* sectors in this device that can be used for data */ 239 __le64 data_size; /* sectors in this device that can be used for data */
240 __u64 super_offset; /* sector start of this superblock */ 240 __le64 super_offset; /* sector start of this superblock */
241 __u64 recovery_offset;/* sectors before this offset (from data_offset) have been recovered */ 241 __le64 recovery_offset;/* sectors before this offset (from data_offset) have been recovered */
242 __u32 dev_number; /* permanent identifier of this device - not role in raid */ 242 __le32 dev_number; /* permanent identifier of this device - not role in raid */
243 __u32 cnt_corrected_read; /* number of read errors that were corrected by re-writing */ 243 __le32 cnt_corrected_read; /* number of read errors that were corrected by re-writing */
244 __u8 device_uuid[16]; /* user-space setable, ignored by kernel */ 244 __u8 device_uuid[16]; /* user-space setable, ignored by kernel */
245 __u8 devflags; /* per-device flags. Only one defined...*/ 245 __u8 devflags; /* per-device flags. Only one defined...*/
246#define WriteMostly1 1 /* mask for writemostly flag in above */ 246#define WriteMostly1 1 /* mask for writemostly flag in above */
247 __u8 pad2[64-57]; /* set to 0 when writing */ 247 __u8 pad2[64-57]; /* set to 0 when writing */
248 248
249 /* array state information - 64 bytes */ 249 /* array state information - 64 bytes */
250 __u64 utime; /* 40 bits second, 24 btes microseconds */ 250 __le64 utime; /* 40 bits second, 24 btes microseconds */
251 __u64 events; /* incremented when superblock updated */ 251 __le64 events; /* incremented when superblock updated */
252 __u64 resync_offset; /* data before this offset (from data_offset) known to be in sync */ 252 __le64 resync_offset; /* data before this offset (from data_offset) known to be in sync */
253 __u32 sb_csum; /* checksum upto devs[max_dev] */ 253 __le32 sb_csum; /* checksum upto devs[max_dev] */
254 __u32 max_dev; /* size of devs[] array to consider */ 254 __le32 max_dev; /* size of devs[] array to consider */
255 __u8 pad3[64-32]; /* set to 0 when writing */ 255 __u8 pad3[64-32]; /* set to 0 when writing */
256 256
257 /* device state information. Indexed by dev_number. 257 /* device state information. Indexed by dev_number.
@@ -260,7 +260,7 @@ struct mdp_superblock_1 {
260 * into the 'roles' value. If a device is spare or faulty, then it doesn't 260 * into the 'roles' value. If a device is spare or faulty, then it doesn't
261 * have a meaningful role. 261 * have a meaningful role.
262 */ 262 */
263 __u16 dev_roles[0]; /* role in array, or 0xffff for a spare, or 0xfffe for faulty */ 263 __le16 dev_roles[0]; /* role in array, or 0xffff for a spare, or 0xfffe for faulty */
264}; 264};
265 265
266/* feature_map bits */ 266/* feature_map bits */
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 6735c1cf334c..eafe4a7b8237 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -466,7 +466,6 @@ struct signal_struct {
466 struct pacct_struct pacct; /* per-process accounting information */ 466 struct pacct_struct pacct; /* per-process accounting information */
467#endif 467#endif
468#ifdef CONFIG_TASKSTATS 468#ifdef CONFIG_TASKSTATS
469 spinlock_t stats_lock;
470 struct taskstats *stats; 469 struct taskstats *stats;
471#endif 470#endif
472}; 471};
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index b800d2d68b32..8451052ca66f 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -183,13 +183,27 @@ do { \
183#define read_lock(lock) _read_lock(lock) 183#define read_lock(lock) _read_lock(lock)
184 184
185#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) 185#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK)
186
186#define spin_lock_irqsave(lock, flags) flags = _spin_lock_irqsave(lock) 187#define spin_lock_irqsave(lock, flags) flags = _spin_lock_irqsave(lock)
187#define read_lock_irqsave(lock, flags) flags = _read_lock_irqsave(lock) 188#define read_lock_irqsave(lock, flags) flags = _read_lock_irqsave(lock)
188#define write_lock_irqsave(lock, flags) flags = _write_lock_irqsave(lock) 189#define write_lock_irqsave(lock, flags) flags = _write_lock_irqsave(lock)
190
191#ifdef CONFIG_DEBUG_LOCK_ALLOC
192#define spin_lock_irqsave_nested(lock, flags, subclass) \
193 flags = _spin_lock_irqsave_nested(lock, subclass)
194#else
195#define spin_lock_irqsave_nested(lock, flags, subclass) \
196 flags = _spin_lock_irqsave(lock)
197#endif
198
189#else 199#else
200
190#define spin_lock_irqsave(lock, flags) _spin_lock_irqsave(lock, flags) 201#define spin_lock_irqsave(lock, flags) _spin_lock_irqsave(lock, flags)
191#define read_lock_irqsave(lock, flags) _read_lock_irqsave(lock, flags) 202#define read_lock_irqsave(lock, flags) _read_lock_irqsave(lock, flags)
192#define write_lock_irqsave(lock, flags) _write_lock_irqsave(lock, flags) 203#define write_lock_irqsave(lock, flags) _write_lock_irqsave(lock, flags)
204#define spin_lock_irqsave_nested(lock, flags, subclass) \
205 spin_lock_irqsave(lock, flags)
206
193#endif 207#endif
194 208
195#define spin_lock_irq(lock) _spin_lock_irq(lock) 209#define spin_lock_irq(lock) _spin_lock_irq(lock)
diff --git a/include/linux/spinlock_api_smp.h b/include/linux/spinlock_api_smp.h
index 8828b8155e9c..8a2307ce7296 100644
--- a/include/linux/spinlock_api_smp.h
+++ b/include/linux/spinlock_api_smp.h
@@ -32,6 +32,8 @@ void __lockfunc _read_lock_irq(rwlock_t *lock) __acquires(lock);
32void __lockfunc _write_lock_irq(rwlock_t *lock) __acquires(lock); 32void __lockfunc _write_lock_irq(rwlock_t *lock) __acquires(lock);
33unsigned long __lockfunc _spin_lock_irqsave(spinlock_t *lock) 33unsigned long __lockfunc _spin_lock_irqsave(spinlock_t *lock)
34 __acquires(lock); 34 __acquires(lock);
35unsigned long __lockfunc _spin_lock_irqsave_nested(spinlock_t *lock, int subclass)
36 __acquires(lock);
35unsigned long __lockfunc _read_lock_irqsave(rwlock_t *lock) 37unsigned long __lockfunc _read_lock_irqsave(rwlock_t *lock)
36 __acquires(lock); 38 __acquires(lock);
37unsigned long __lockfunc _write_lock_irqsave(rwlock_t *lock) 39unsigned long __lockfunc _write_lock_irqsave(rwlock_t *lock)
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 1b24bd45e080..d98562f1df76 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -6,10 +6,17 @@
6 **************************************************************** 6 ****************************************************************
7 **************************************************************** 7 ****************************************************************
8 ** 8 **
9 ** WARNING:
9 ** The values in this file are exported to user space via 10 ** The values in this file are exported to user space via
10 ** the sysctl() binary interface. However this interface 11 ** the sysctl() binary interface. Do *NOT* change the
11 ** is unstable and deprecated and will be removed in the future. 12 ** numbering of any existing values here, and do not change
12 ** For a stable interface use /proc/sys. 13 ** any numbers within any one set of values. If you have to
14 ** have to redefine an existing interface, use a new number for it.
15 ** The kernel will then return -ENOTDIR to any application using
16 ** the old binary interface.
17 **
18 ** For new interfaces unless you really need a binary number
19 ** please use CTL_UNNUMBERED.
13 ** 20 **
14 **************************************************************** 21 ****************************************************************
15 **************************************************************** 22 ****************************************************************
@@ -48,6 +55,7 @@ struct __sysctl_args {
48#ifdef __KERNEL__ 55#ifdef __KERNEL__
49#define CTL_ANY -1 /* Matches any name */ 56#define CTL_ANY -1 /* Matches any name */
50#define CTL_NONE 0 57#define CTL_NONE 0
58#define CTL_UNNUMBERED CTL_NONE /* sysctl without a binary number */
51#endif 59#endif
52 60
53enum 61enum
@@ -961,8 +969,8 @@ extern ctl_handler sysctl_ms_jiffies;
961/* 969/*
962 * Register a set of sysctl names by calling register_sysctl_table 970 * Register a set of sysctl names by calling register_sysctl_table
963 * with an initialised array of ctl_table's. An entry with zero 971 * with an initialised array of ctl_table's. An entry with zero
964 * ctl_name terminates the table. table->de will be set up by the 972 * ctl_name and NULL procname terminates the table. table->de will be
965 * registration and need not be initialised in advance. 973 * set up by the registration and need not be initialised in advance.
966 * 974 *
967 * sysctl names can be mirrored automatically under /proc/sys. The 975 * sysctl names can be mirrored automatically under /proc/sys. The
968 * procname supplied controls /proc naming. 976 * procname supplied controls /proc naming.
@@ -973,7 +981,10 @@ extern ctl_handler sysctl_ms_jiffies;
973 * Leaf nodes in the sysctl tree will be represented by a single file 981 * Leaf nodes in the sysctl tree will be represented by a single file
974 * under /proc; non-leaf nodes will be represented by directories. A 982 * under /proc; non-leaf nodes will be represented by directories. A
975 * null procname disables /proc mirroring at this node. 983 * null procname disables /proc mirroring at this node.
976 * 984 *
985 * sysctl entries with a zero ctl_name will not be available through
986 * the binary sysctl interface.
987 *
977 * sysctl(2) can automatically manage read and write requests through 988 * sysctl(2) can automatically manage read and write requests through
978 * the sysctl table. The data and maxlen fields of the ctl_table 989 * the sysctl table. The data and maxlen fields of the ctl_table
979 * struct enable minimal validation of the values being written to be 990 * struct enable minimal validation of the values being written to be
diff --git a/include/linux/taskstats_kern.h b/include/linux/taskstats_kern.h
index 16894b7edcc8..6562a2050a25 100644
--- a/include/linux/taskstats_kern.h
+++ b/include/linux/taskstats_kern.h
@@ -23,25 +23,26 @@ static inline void taskstats_exit_free(struct taskstats *tidstats)
23 23
24static inline void taskstats_tgid_init(struct signal_struct *sig) 24static inline void taskstats_tgid_init(struct signal_struct *sig)
25{ 25{
26 spin_lock_init(&sig->stats_lock);
27 sig->stats = NULL; 26 sig->stats = NULL;
28} 27}
29 28
30static inline void taskstats_tgid_alloc(struct signal_struct *sig) 29static inline void taskstats_tgid_alloc(struct task_struct *tsk)
31{ 30{
31 struct signal_struct *sig = tsk->signal;
32 struct taskstats *stats; 32 struct taskstats *stats;
33 unsigned long flags;
34 33
35 stats = kmem_cache_zalloc(taskstats_cache, SLAB_KERNEL); 34 if (sig->stats != NULL)
36 if (!stats)
37 return; 35 return;
38 36
39 spin_lock_irqsave(&sig->stats_lock, flags); 37 /* No problem if kmem_cache_zalloc() fails */
38 stats = kmem_cache_zalloc(taskstats_cache, SLAB_KERNEL);
39
40 spin_lock_irq(&tsk->sighand->siglock);
40 if (!sig->stats) { 41 if (!sig->stats) {
41 sig->stats = stats; 42 sig->stats = stats;
42 stats = NULL; 43 stats = NULL;
43 } 44 }
44 spin_unlock_irqrestore(&sig->stats_lock, flags); 45 spin_unlock_irq(&tsk->sighand->siglock);
45 46
46 if (stats) 47 if (stats)
47 kmem_cache_free(taskstats_cache, stats); 48 kmem_cache_free(taskstats_cache, stats);
@@ -49,23 +50,13 @@ static inline void taskstats_tgid_alloc(struct signal_struct *sig)
49 50
50static inline void taskstats_tgid_free(struct signal_struct *sig) 51static inline void taskstats_tgid_free(struct signal_struct *sig)
51{ 52{
52 struct taskstats *stats = NULL; 53 if (sig->stats)
53 unsigned long flags; 54 kmem_cache_free(taskstats_cache, sig->stats);
54
55 spin_lock_irqsave(&sig->stats_lock, flags);
56 if (sig->stats) {
57 stats = sig->stats;
58 sig->stats = NULL;
59 }
60 spin_unlock_irqrestore(&sig->stats_lock, flags);
61 if (stats)
62 kmem_cache_free(taskstats_cache, stats);
63} 55}
64 56
65extern void taskstats_exit_alloc(struct taskstats **, unsigned int *); 57extern void taskstats_exit_alloc(struct taskstats **, unsigned int *);
66extern void taskstats_exit_send(struct task_struct *, struct taskstats *, int, unsigned int); 58extern void taskstats_exit_send(struct task_struct *, struct taskstats *, int, unsigned int);
67extern void taskstats_init_early(void); 59extern void taskstats_init_early(void);
68extern void taskstats_tgid_alloc(struct signal_struct *);
69#else 60#else
70static inline void taskstats_exit_alloc(struct taskstats **ptidstats, unsigned int *mycpu) 61static inline void taskstats_exit_alloc(struct taskstats **ptidstats, unsigned int *mycpu)
71{} 62{}
@@ -77,7 +68,7 @@ static inline void taskstats_exit_send(struct task_struct *tsk,
77{} 68{}
78static inline void taskstats_tgid_init(struct signal_struct *sig) 69static inline void taskstats_tgid_init(struct signal_struct *sig)
79{} 70{}
80static inline void taskstats_tgid_alloc(struct signal_struct *sig) 71static inline void taskstats_tgid_alloc(struct task_struct *tsk)
81{} 72{}
82static inline void taskstats_tgid_free(struct signal_struct *sig) 73static inline void taskstats_tgid_free(struct signal_struct *sig)
83{} 74{}
diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h
index 61eef508b041..28967eda9d7b 100644
--- a/include/linux/ufs_fs.h
+++ b/include/linux/ufs_fs.h
@@ -908,7 +908,7 @@ struct ufs_super_block_third {
908 __fs64 fs_csaddr; /* blk addr of cyl grp summary area */ 908 __fs64 fs_csaddr; /* blk addr of cyl grp summary area */
909 __fs64 fs_pendingblocks;/* blocks in process of being freed */ 909 __fs64 fs_pendingblocks;/* blocks in process of being freed */
910 __fs32 fs_pendinginodes;/*inodes in process of being freed */ 910 __fs32 fs_pendinginodes;/*inodes in process of being freed */
911 } fs_u2; 911 } __attribute__ ((packed)) fs_u2;
912 } fs_un1; 912 } fs_un1;
913 union { 913 union {
914 struct { 914 struct {
diff --git a/include/linux/unwind.h b/include/linux/unwind.h
index 73e1751d03dd..749928c161fb 100644
--- a/include/linux/unwind.h
+++ b/include/linux/unwind.h
@@ -26,6 +26,7 @@ struct module;
26 * Initialize unwind support. 26 * Initialize unwind support.
27 */ 27 */
28extern void unwind_init(void); 28extern void unwind_init(void);
29extern void unwind_setup(void);
29 30
30#ifdef CONFIG_MODULES 31#ifdef CONFIG_MODULES
31 32
@@ -73,6 +74,7 @@ extern int unwind_to_user(struct unwind_frame_info *);
73struct unwind_frame_info {}; 74struct unwind_frame_info {};
74 75
75static inline void unwind_init(void) {} 76static inline void unwind_init(void) {}
77static inline void unwind_setup(void) {}
76 78
77#ifdef CONFIG_MODULES 79#ifdef CONFIG_MODULES
78 80
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index ce5f1482e6be..924e502905d4 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -23,13 +23,14 @@ struct vm_area_struct;
23#endif 23#endif
24 24
25struct vm_struct { 25struct vm_struct {
26 /* keep next,addr,size together to speedup lookups */
27 struct vm_struct *next;
26 void *addr; 28 void *addr;
27 unsigned long size; 29 unsigned long size;
28 unsigned long flags; 30 unsigned long flags;
29 struct page **pages; 31 struct page **pages;
30 unsigned int nr_pages; 32 unsigned int nr_pages;
31 unsigned long phys_addr; 33 unsigned long phys_addr;
32 struct vm_struct *next;
33}; 34};
34 35
35/* 36/*
@@ -60,7 +61,8 @@ extern struct vm_struct *get_vm_area(unsigned long size, unsigned long flags);
60extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags, 61extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags,
61 unsigned long start, unsigned long end); 62 unsigned long start, unsigned long end);
62extern struct vm_struct *get_vm_area_node(unsigned long size, 63extern struct vm_struct *get_vm_area_node(unsigned long size,
63 unsigned long flags, int node); 64 unsigned long flags, int node,
65 gfp_t gfp_mask);
64extern struct vm_struct *remove_vm_area(void *addr); 66extern struct vm_struct *remove_vm_area(void *addr);
65extern int map_vm_area(struct vm_struct *area, pgprot_t prot, 67extern int map_vm_area(struct vm_struct *area, pgprot_t prot,
66 struct page ***pages); 68 struct page ***pages);
diff --git a/include/linux/wait.h b/include/linux/wait.h
index b3b9048421d8..e820d00e1383 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -79,6 +79,15 @@ struct task_struct;
79 79
80extern void init_waitqueue_head(wait_queue_head_t *q); 80extern void init_waitqueue_head(wait_queue_head_t *q);
81 81
82#ifdef CONFIG_LOCKDEP
83# define __WAIT_QUEUE_HEAD_INIT_ONSTACK(name) \
84 ({ init_waitqueue_head(&name); name; })
85# define DECLARE_WAIT_QUEUE_HEAD_ONSTACK(name) \
86 wait_queue_head_t name = __WAIT_QUEUE_HEAD_INIT_ONSTACK(name)
87#else
88# define DECLARE_WAIT_QUEUE_HEAD_ONSTACK(name) DECLARE_WAIT_QUEUE_HEAD(name)
89#endif
90
82static inline void init_waitqueue_entry(wait_queue_t *q, struct task_struct *p) 91static inline void init_waitqueue_entry(wait_queue_t *q, struct task_struct *p)
83{ 92{
84 q->flags = 0; 93 q->flags = 0;
diff --git a/include/net/dn.h b/include/net/dn.h
index 465b78302782..ac4ce9091747 100644
--- a/include/net/dn.h
+++ b/include/net/dn.h
@@ -199,11 +199,6 @@ static inline void dn_sk_ports_copy(struct flowi *fl, struct dn_scp *scp)
199{ 199{
200 fl->uli_u.dnports.sport = scp->addrloc; 200 fl->uli_u.dnports.sport = scp->addrloc;
201 fl->uli_u.dnports.dport = scp->addrrem; 201 fl->uli_u.dnports.dport = scp->addrrem;
202 fl->uli_u.dnports.objnum = scp->addr.sdn_objnum;
203 if (fl->uli_u.dnports.objnum == 0) {
204 fl->uli_u.dnports.objnamel = (__u8)dn_ntohs(scp->addr.sdn_objnamel);
205 memcpy(fl->uli_u.dnports.objname, scp->addr.sdn_objname, 16);
206 }
207} 202}
208 203
209extern unsigned dn_mss_from_pmtu(struct net_device *dev, int mtu); 204extern unsigned dn_mss_from_pmtu(struct net_device *dev, int mtu);
diff --git a/include/net/flow.h b/include/net/flow.h
index 3b44d72b27d3..5cda27cd9deb 100644
--- a/include/net/flow.h
+++ b/include/net/flow.h
@@ -68,9 +68,6 @@ struct flowi {
68 struct { 68 struct {
69 __le16 sport; 69 __le16 sport;
70 __le16 dport; 70 __le16 dport;
71 __u8 objnum;
72 __u8 objnamel; /* Not 16 bits since max val is 16 */
73 __u8 objname[16]; /* Not zero terminated */
74 } dnports; 71 } dnports;
75 72
76 __be32 spi; 73 __be32 spi;
diff --git a/include/net/ieee80211softmac.h b/include/net/ieee80211softmac.h
index 425b3a57ac74..617b672b1132 100644
--- a/include/net/ieee80211softmac.h
+++ b/include/net/ieee80211softmac.h
@@ -63,13 +63,11 @@ struct ieee80211softmac_wpa {
63 63
64/* 64/*
65 * Information about association 65 * Information about association
66 *
67 * Do we need a lock for this?
68 * We only ever use this structure inlined
69 * into our global struct. I've used its lock,
70 * but maybe we need a local one here?
71 */ 66 */
72struct ieee80211softmac_assoc_info { 67struct ieee80211softmac_assoc_info {
68
69 struct mutex mutex;
70
73 /* 71 /*
74 * This is the requested ESSID. It is written 72 * This is the requested ESSID. It is written
75 * only by the WX handlers. 73 * only by the WX handlers.
@@ -99,12 +97,13 @@ struct ieee80211softmac_assoc_info {
99 * 97 *
100 * bssfixed is used for SIOCSIWAP. 98 * bssfixed is used for SIOCSIWAP.
101 */ 99 */
102 u8 static_essid:1, 100 u8 static_essid;
103 short_preamble_available:1, 101 u8 short_preamble_available;
104 associating:1, 102 u8 associating;
105 assoc_wait:1, 103 u8 associated;
106 bssvalid:1, 104 u8 assoc_wait;
107 bssfixed:1; 105 u8 bssvalid;
106 u8 bssfixed;
108 107
109 /* Scan retries remaining */ 108 /* Scan retries remaining */
110 int scan_retry; 109 int scan_retry;
@@ -229,12 +228,10 @@ struct ieee80211softmac_device {
229 /* private stuff follows */ 228 /* private stuff follows */
230 /* this lock protects this structure */ 229 /* this lock protects this structure */
231 spinlock_t lock; 230 spinlock_t lock;
232 231
233 /* couple of flags */ 232 u8 running; /* SoftMAC started? */
234 u8 scanning:1, /* protects scanning from being done multiple times at once */ 233 u8 scanning;
235 associated:1, 234
236 running:1;
237
238 struct ieee80211softmac_scaninfo *scaninfo; 235 struct ieee80211softmac_scaninfo *scaninfo;
239 struct ieee80211softmac_assoc_info associnfo; 236 struct ieee80211softmac_assoc_info associnfo;
240 struct ieee80211softmac_bss_info bssinfo; 237 struct ieee80211softmac_bss_info bssinfo;
@@ -250,7 +247,7 @@ struct ieee80211softmac_device {
250 247
251 /* we need to keep a list of network structs we copied */ 248 /* we need to keep a list of network structs we copied */
252 struct list_head network_list; 249 struct list_head network_list;
253 250
254 /* This must be the last item so that it points to the data 251 /* This must be the last item so that it points to the data
255 * allocated beyond this structure by alloc_ieee80211 */ 252 * allocated beyond this structure by alloc_ieee80211 */
256 u8 priv[0]; 253 u8 priv[0];
@@ -295,7 +292,7 @@ static inline u8 ieee80211softmac_suggest_txrate(struct ieee80211softmac_device
295{ 292{
296 struct ieee80211softmac_txrates *txrates = &mac->txrates; 293 struct ieee80211softmac_txrates *txrates = &mac->txrates;
297 294
298 if (!mac->associated) 295 if (!mac->associnfo.associated)
299 return txrates->mgt_mcast_rate; 296 return txrates->mgt_mcast_rate;
300 297
301 /* We are associated, sending unicast frame */ 298 /* We are associated, sending unicast frame */
diff --git a/include/net/inet_ecn.h b/include/net/inet_ecn.h
index d599c6bfbb86..7849844a4911 100644
--- a/include/net/inet_ecn.h
+++ b/include/net/inet_ecn.h
@@ -48,7 +48,7 @@ static inline __u8 INET_ECN_encapsulate(__u8 outer, __u8 inner)
48 48
49#define IP6_ECN_flow_xmit(sk, label) do { \ 49#define IP6_ECN_flow_xmit(sk, label) do { \
50 if (INET_ECN_is_capable(inet_sk(sk)->tos)) \ 50 if (INET_ECN_is_capable(inet_sk(sk)->tos)) \
51 (label) |= __constant_htons(INET_ECN_ECT_0 << 4); \ 51 (label) |= htonl(INET_ECN_ECT_0 << 20); \
52 } while (0) 52 } while (0)
53 53
54static inline int IP_ECN_set_ce(struct iphdr *iph) 54static inline int IP_ECN_set_ce(struct iphdr *iph)
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 49c717e3b040..903108e583f8 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -7,6 +7,7 @@
7#define _IP_VS_H 7#define _IP_VS_H
8 8
9#include <asm/types.h> /* For __uXX types */ 9#include <asm/types.h> /* For __uXX types */
10#include <linux/types.h> /* For __beXX types in userland */
10 11
11#define IP_VS_VERSION_CODE 0x010201 12#define IP_VS_VERSION_CODE 0x010201
12#define NVERSION(version) \ 13#define NVERSION(version) \
diff --git a/include/net/ipx.h b/include/net/ipx.h
index 5c0cf33826c5..c6b2ee610866 100644
--- a/include/net/ipx.h
+++ b/include/net/ipx.h
@@ -15,9 +15,9 @@
15#include <linux/list.h> 15#include <linux/list.h>
16 16
17struct ipx_address { 17struct ipx_address {
18 __u32 net; 18 __be32 net;
19 __u8 node[IPX_NODE_LEN]; 19 __u8 node[IPX_NODE_LEN];
20 __u16 sock; 20 __be16 sock;
21}; 21};
22 22
23#define ipx_broadcast_node "\377\377\377\377\377\377" 23#define ipx_broadcast_node "\377\377\377\377\377\377"
@@ -26,9 +26,9 @@ struct ipx_address {
26#define IPX_MAX_PPROP_HOPS 8 26#define IPX_MAX_PPROP_HOPS 8
27 27
28struct ipxhdr { 28struct ipxhdr {
29 __u16 ipx_checksum __attribute__ ((packed)); 29 __be16 ipx_checksum __attribute__ ((packed));
30#define IPX_NO_CHECKSUM 0xFFFF 30#define IPX_NO_CHECKSUM __constant_htons(0xFFFF)
31 __u16 ipx_pktsize __attribute__ ((packed)); 31 __be16 ipx_pktsize __attribute__ ((packed));
32 __u8 ipx_tctrl; 32 __u8 ipx_tctrl;
33 __u8 ipx_type; 33 __u8 ipx_type;
34#define IPX_TYPE_UNKNOWN 0x00 34#define IPX_TYPE_UNKNOWN 0x00
@@ -48,14 +48,14 @@ static __inline__ struct ipxhdr *ipx_hdr(struct sk_buff *skb)
48 48
49struct ipx_interface { 49struct ipx_interface {
50 /* IPX address */ 50 /* IPX address */
51 __u32 if_netnum; 51 __be32 if_netnum;
52 unsigned char if_node[IPX_NODE_LEN]; 52 unsigned char if_node[IPX_NODE_LEN];
53 atomic_t refcnt; 53 atomic_t refcnt;
54 54
55 /* physical device info */ 55 /* physical device info */
56 struct net_device *if_dev; 56 struct net_device *if_dev;
57 struct datalink_proto *if_dlink; 57 struct datalink_proto *if_dlink;
58 unsigned short if_dlink_type; 58 __be16 if_dlink_type;
59 59
60 /* socket support */ 60 /* socket support */
61 unsigned short if_sknum; 61 unsigned short if_sknum;
@@ -71,7 +71,7 @@ struct ipx_interface {
71}; 71};
72 72
73struct ipx_route { 73struct ipx_route {
74 __u32 ir_net; 74 __be32 ir_net;
75 struct ipx_interface *ir_intrfc; 75 struct ipx_interface *ir_intrfc;
76 unsigned char ir_routed; 76 unsigned char ir_routed;
77 unsigned char ir_router_node[IPX_NODE_LEN]; 77 unsigned char ir_router_node[IPX_NODE_LEN];
@@ -82,10 +82,10 @@ struct ipx_route {
82#ifdef __KERNEL__ 82#ifdef __KERNEL__
83struct ipx_cb { 83struct ipx_cb {
84 u8 ipx_tctrl; 84 u8 ipx_tctrl;
85 u32 ipx_dest_net; 85 __be32 ipx_dest_net;
86 u32 ipx_source_net; 86 __be32 ipx_source_net;
87 struct { 87 struct {
88 u32 netnum; 88 __be32 netnum;
89 int index; 89 int index;
90 } last_hop; 90 } last_hop;
91}; 91};
@@ -97,7 +97,7 @@ struct ipx_sock {
97 struct sock sk; 97 struct sock sk;
98 struct ipx_address dest_addr; 98 struct ipx_address dest_addr;
99 struct ipx_interface *intrfc; 99 struct ipx_interface *intrfc;
100 unsigned short port; 100 __be16 port;
101#ifdef CONFIG_IPX_INTERN 101#ifdef CONFIG_IPX_INTERN
102 unsigned char node[IPX_NODE_LEN]; 102 unsigned char node[IPX_NODE_LEN];
103#endif 103#endif
@@ -132,7 +132,7 @@ extern struct ipx_interface *ipx_primary_net;
132extern int ipx_proc_init(void); 132extern int ipx_proc_init(void);
133extern void ipx_proc_exit(void); 133extern void ipx_proc_exit(void);
134 134
135extern const char *ipx_frame_name(unsigned short); 135extern const char *ipx_frame_name(__be16);
136extern const char *ipx_device_name(struct ipx_interface *intrfc); 136extern const char *ipx_device_name(struct ipx_interface *intrfc);
137 137
138static __inline__ void ipxitf_hold(struct ipx_interface *intrfc) 138static __inline__ void ipxitf_hold(struct ipx_interface *intrfc)
diff --git a/include/net/sock.h b/include/net/sock.h
index 40bb90ebb2d1..9cdbae2a53a3 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -883,19 +883,23 @@ static inline int sk_filter(struct sock *sk, struct sk_buff *skb)
883} 883}
884 884
885/** 885/**
886 * sk_filter_release: Release a socket filter 886 * sk_filter_rcu_free: Free a socket filter
887 * @sk: socket 887 * @rcu: rcu_head that contains the sk_filter to free
888 * @fp: filter to remove
889 *
890 * Remove a filter from a socket and release its resources.
891 */ 888 */
892
893static inline void sk_filter_rcu_free(struct rcu_head *rcu) 889static inline void sk_filter_rcu_free(struct rcu_head *rcu)
894{ 890{
895 struct sk_filter *fp = container_of(rcu, struct sk_filter, rcu); 891 struct sk_filter *fp = container_of(rcu, struct sk_filter, rcu);
896 kfree(fp); 892 kfree(fp);
897} 893}
898 894
895/**
896 * sk_filter_release: Release a socket filter
897 * @sk: socket
898 * @fp: filter to remove
899 *
900 * Remove a filter from a socket and release its resources.
901 */
902
899static inline void sk_filter_release(struct sock *sk, struct sk_filter *fp) 903static inline void sk_filter_release(struct sock *sk, struct sk_filter *fp)
900{ 904{
901 unsigned int size = sk_filter_len(fp); 905 unsigned int size = sk_filter_len(fp);
diff --git a/include/rdma/ib_addr.h b/include/rdma/ib_addr.h
index 81b62307621d..c094e5012862 100644
--- a/include/rdma/ib_addr.h
+++ b/include/rdma/ib_addr.h
@@ -36,6 +36,22 @@
36#include <linux/socket.h> 36#include <linux/socket.h>
37#include <rdma/ib_verbs.h> 37#include <rdma/ib_verbs.h>
38 38
39struct rdma_addr_client {
40 atomic_t refcount;
41 struct completion comp;
42};
43
44/**
45 * rdma_addr_register_client - Register an address client.
46 */
47void rdma_addr_register_client(struct rdma_addr_client *client);
48
49/**
50 * rdma_addr_unregister_client - Deregister an address client.
51 * @client: Client object to deregister.
52 */
53void rdma_addr_unregister_client(struct rdma_addr_client *client);
54
39struct rdma_dev_addr { 55struct rdma_dev_addr {
40 unsigned char src_dev_addr[MAX_ADDR_LEN]; 56 unsigned char src_dev_addr[MAX_ADDR_LEN];
41 unsigned char dst_dev_addr[MAX_ADDR_LEN]; 57 unsigned char dst_dev_addr[MAX_ADDR_LEN];
@@ -52,6 +68,7 @@ int rdma_translate_ip(struct sockaddr *addr, struct rdma_dev_addr *dev_addr);
52/** 68/**
53 * rdma_resolve_ip - Resolve source and destination IP addresses to 69 * rdma_resolve_ip - Resolve source and destination IP addresses to
54 * RDMA hardware addresses. 70 * RDMA hardware addresses.
71 * @client: Address client associated with request.
55 * @src_addr: An optional source address to use in the resolution. If a 72 * @src_addr: An optional source address to use in the resolution. If a
56 * source address is not provided, a usable address will be returned via 73 * source address is not provided, a usable address will be returned via
57 * the callback. 74 * the callback.
@@ -64,7 +81,8 @@ int rdma_translate_ip(struct sockaddr *addr, struct rdma_dev_addr *dev_addr);
64 * or been canceled. A status of 0 indicates success. 81 * or been canceled. A status of 0 indicates success.
65 * @context: User-specified context associated with the call. 82 * @context: User-specified context associated with the call.
66 */ 83 */
67int rdma_resolve_ip(struct sockaddr *src_addr, struct sockaddr *dst_addr, 84int rdma_resolve_ip(struct rdma_addr_client *client,
85 struct sockaddr *src_addr, struct sockaddr *dst_addr,
68 struct rdma_dev_addr *addr, int timeout_ms, 86 struct rdma_dev_addr *addr, int timeout_ms,
69 void (*callback)(int status, struct sockaddr *src_addr, 87 void (*callback)(int status, struct sockaddr *src_addr,
70 struct rdma_dev_addr *addr, void *context), 88 struct rdma_dev_addr *addr, void *context),
diff --git a/include/rdma/ib_user_verbs.h b/include/rdma/ib_user_verbs.h
index db1b814b62cc..64a721fcbc1c 100644
--- a/include/rdma/ib_user_verbs.h
+++ b/include/rdma/ib_user_verbs.h
@@ -458,7 +458,7 @@ struct ib_uverbs_query_qp_resp {
458 __u8 cur_qp_state; 458 __u8 cur_qp_state;
459 __u8 path_mtu; 459 __u8 path_mtu;
460 __u8 path_mig_state; 460 __u8 path_mig_state;
461 __u8 en_sqd_async_notify; 461 __u8 sq_draining;
462 __u8 max_rd_atomic; 462 __u8 max_rd_atomic;
463 __u8 max_dest_rd_atomic; 463 __u8 max_dest_rd_atomic;
464 __u8 min_rnr_timer; 464 __u8 min_rnr_timer;
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h
index 401192e56e50..61eebec00a7b 100644
--- a/include/scsi/libiscsi.h
+++ b/include/scsi/libiscsi.h
@@ -136,7 +136,6 @@ struct iscsi_conn {
136 136
137 /* control data */ 137 /* control data */
138 int id; /* CID */ 138 int id; /* CID */
139 struct list_head item; /* maintains list of conns */
140 int c_stage; /* connection state */ 139 int c_stage; /* connection state */
141 /* 140 /*
142 * Preallocated buffer for pdus that have data but do not 141 * Preallocated buffer for pdus that have data but do not
@@ -235,10 +234,8 @@ struct iscsi_session {
235 * - mgmtpool, * 234 * - mgmtpool, *
236 * - r2tpool */ 235 * - r2tpool */
237 int state; /* session state */ 236 int state; /* session state */
238 struct list_head item;
239 int age; /* counts session re-opens */ 237 int age; /* counts session re-opens */
240 238
241 struct list_head connections; /* list of connections */
242 int cmds_max; /* size of cmds array */ 239 int cmds_max; /* size of cmds array */
243 struct iscsi_cmd_task **cmds; /* Original Cmds arr */ 240 struct iscsi_cmd_task **cmds; /* Original Cmds arr */
244 struct iscsi_queue cmdpool; /* PDU's pool */ 241 struct iscsi_queue cmdpool; /* PDU's pool */
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h
index 9582e8401669..1d77b63c5ea4 100644
--- a/include/scsi/libsas.h
+++ b/include/scsi/libsas.h
@@ -35,6 +35,7 @@
35#include <scsi/scsi_device.h> 35#include <scsi/scsi_device.h>
36#include <scsi/scsi_cmnd.h> 36#include <scsi/scsi_cmnd.h>
37#include <scsi/scsi_transport_sas.h> 37#include <scsi/scsi_transport_sas.h>
38#include <asm/scatterlist.h>
38 39
39struct block_device; 40struct block_device;
40 41
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
index 84a6d5fe0920..5c0e9791441c 100644
--- a/include/scsi/scsi.h
+++ b/include/scsi/scsi.h
@@ -97,6 +97,7 @@ extern const unsigned char scsi_command_size[8];
97#define PERSISTENT_RESERVE_IN 0x5e 97#define PERSISTENT_RESERVE_IN 0x5e
98#define PERSISTENT_RESERVE_OUT 0x5f 98#define PERSISTENT_RESERVE_OUT 0x5f
99#define REPORT_LUNS 0xa0 99#define REPORT_LUNS 0xa0
100#define MAINTENANCE_IN 0xa3
100#define MOVE_MEDIUM 0xa5 101#define MOVE_MEDIUM 0xa5
101#define EXCHANGE_MEDIUM 0xa6 102#define EXCHANGE_MEDIUM 0xa6
102#define READ_12 0xa8 103#define READ_12 0xa8
@@ -114,6 +115,8 @@ extern const unsigned char scsi_command_size[8];
114#define SERVICE_ACTION_IN 0x9e 115#define SERVICE_ACTION_IN 0x9e
115/* values for service action in */ 116/* values for service action in */
116#define SAI_READ_CAPACITY_16 0x10 117#define SAI_READ_CAPACITY_16 0x10
118/* values for maintenance in */
119#define MI_REPORT_TARGET_PGS 0x0a
117 120
118/* Values for T10/04-262r7 */ 121/* Values for T10/04-262r7 */
119#define ATA_16 0x85 /* 16-byte pass-thru */ 122#define ATA_16 0x85 /* 16-byte pass-thru */
@@ -430,7 +433,7 @@ struct scsi_lun {
430#define SCSI_IOCTL_GET_PCI 0x5387 433#define SCSI_IOCTL_GET_PCI 0x5387
431 434
432/* Pull a u32 out of a SCSI message (using BE SCSI conventions) */ 435/* Pull a u32 out of a SCSI message (using BE SCSI conventions) */
433static inline u32 scsi_to_u32(u8 *ptr) 436static inline __u32 scsi_to_u32(__u8 *ptr)
434{ 437{
435 return (ptr[0]<<24) + (ptr[1]<<16) + (ptr[2]<<8) + ptr[3]; 438 return (ptr[0]<<24) + (ptr[1]<<16) + (ptr[2]<<8) + ptr[3];
436} 439}
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h
index 39e833260bd0..4b95c89c95c9 100644
--- a/include/scsi/scsi_transport_iscsi.h
+++ b/include/scsi/scsi_transport_iscsi.h
@@ -29,7 +29,6 @@
29struct scsi_transport_template; 29struct scsi_transport_template;
30struct iscsi_transport; 30struct iscsi_transport;
31struct Scsi_Host; 31struct Scsi_Host;
32struct mempool_zone;
33struct iscsi_cls_conn; 32struct iscsi_cls_conn;
34struct iscsi_conn; 33struct iscsi_conn;
35struct iscsi_cmd_task; 34struct iscsi_cmd_task;
@@ -157,9 +156,6 @@ struct iscsi_cls_conn {
157 156
158 int active; /* must be accessed with the connlock */ 157 int active; /* must be accessed with the connlock */
159 struct device dev; /* sysfs transport/container device */ 158 struct device dev; /* sysfs transport/container device */
160 struct mempool_zone *z_error;
161 struct mempool_zone *z_pdu;
162 struct list_head freequeue;
163}; 159};
164 160
165#define iscsi_dev_to_conn(_dev) \ 161#define iscsi_dev_to_conn(_dev) \
diff --git a/include/sound/version.h b/include/sound/version.h
index 4ad86eb6440b..17137f3a3b6f 100644
--- a/include/sound/version.h
+++ b/include/sound/version.h
@@ -1,3 +1,3 @@
1/* include/version.h. Generated by alsa/ksync script. */ 1/* include/version.h. Generated by alsa/ksync script. */
2#define CONFIG_SND_VERSION "1.0.13" 2#define CONFIG_SND_VERSION "1.0.13"
3#define CONFIG_SND_DATE " (Fri Oct 06 18:28:19 2006 UTC)" 3#define CONFIG_SND_DATE " (Tue Nov 28 14:07:24 2006 UTC)"