aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-alpha/core_t2.h2
-rw-r--r--include/asm-alpha/hw_irq.h2
-rw-r--r--include/asm-arm/arch-at91rm9200/memory.h2
-rw-r--r--include/asm-arm/arch-h720x/memory.h2
-rw-r--r--include/asm-arm/arch-imx/memory.h6
-rw-r--r--include/asm-arm/arch-ixp23xx/ixp23xx.h11
-rw-r--r--include/asm-arm/arch-ixp23xx/platform.h10
-rw-r--r--include/asm-arm/arch-ixp23xx/uncompress.h2
-rw-r--r--include/asm-arm/arch-s3c2410/regs-dsc.h16
-rw-r--r--include/asm-arm/arch-s3c2410/regs-nand.h48
-rw-r--r--include/asm-arm/bugs.h4
-rw-r--r--include/asm-arm/domain.h7
-rw-r--r--include/asm-arm/fpstate.h8
-rw-r--r--include/asm-arm/mach/map.h9
-rw-r--r--include/asm-arm/memory.h75
-rw-r--r--include/asm-arm/mmu.h16
-rw-r--r--include/asm-arm/mmu_context.h2
-rw-r--r--include/asm-arm/page-nommu.h51
-rw-r--r--include/asm-arm/page.h8
-rw-r--r--include/asm-arm/pgalloc.h8
-rw-r--r--include/asm-arm/pgtable-nommu.h123
-rw-r--r--include/asm-arm/pgtable.h10
-rw-r--r--include/asm-arm/proc-fns.h4
-rw-r--r--include/asm-arm/ptrace.h5
-rw-r--r--include/asm-arm/thread_info.h6
-rw-r--r--include/asm-arm/uaccess.h184
-rw-r--r--include/asm-arm/ucontext.h14
-rw-r--r--include/asm-cris/hw_irq.h2
-rw-r--r--include/asm-cris/irq.h5
-rw-r--r--include/asm-generic/bug.h6
-rw-r--r--include/asm-generic/vmlinux.lds.h28
-rw-r--r--include/asm-i386/cpu.h2
-rw-r--r--include/asm-i386/elf.h53
-rw-r--r--include/asm-i386/fixmap.h10
-rw-r--r--include/asm-i386/hw_irq.h10
-rw-r--r--include/asm-i386/mach-visws/setup_arch.h3
-rw-r--r--include/asm-i386/mmu.h1
-rw-r--r--include/asm-i386/node.h29
-rw-r--r--include/asm-i386/page.h3
-rw-r--r--include/asm-i386/processor.h8
-rw-r--r--include/asm-i386/thread_info.h11
-rw-r--r--include/asm-i386/topology.h11
-rw-r--r--include/asm-i386/unwind.h4
-rw-r--r--include/asm-ia64/hw_irq.h3
-rw-r--r--include/asm-ia64/irq.h5
-rw-r--r--include/asm-ia64/nodedata.h12
-rw-r--r--include/asm-ia64/sn/sn_sal.h10
-rw-r--r--include/asm-ia64/topology.h1
-rw-r--r--include/asm-m32r/hw_irq.h5
-rw-r--r--include/asm-m68knommu/bootstd.h12
-rw-r--r--include/asm-m68knommu/ptrace.h2
-rw-r--r--include/asm-mips/hw_irq.h8
-rw-r--r--include/asm-mips/mach-mips/irq.h6
-rw-r--r--include/asm-parisc/hw_irq.h9
-rw-r--r--include/asm-parisc/irq.h5
-rw-r--r--include/asm-powerpc/hw_irq.h18
-rw-r--r--include/asm-powerpc/irq.h5
-rw-r--r--include/asm-powerpc/topology.h5
-rw-r--r--include/asm-sh/hw_irq.h5
-rw-r--r--include/asm-sh64/hw_irq.h1
-rw-r--r--include/asm-sparc64/topology.h3
-rw-r--r--include/asm-um/hw_irq.h3
-rw-r--r--include/asm-v850/hw_irq.h4
-rw-r--r--include/asm-x86_64/hw_irq.h11
-rw-r--r--include/asm-x86_64/topology.h2
-rw-r--r--include/asm-xtensa/hw_irq.h4
-rw-r--r--include/linux/ac97_codec.h2
-rw-r--r--include/linux/acpi.h6
-rw-r--r--include/linux/buffer_head.h2
-rw-r--r--include/linux/coda_linux.h4
-rw-r--r--include/linux/cpu.h14
-rw-r--r--include/linux/dmaengine.h2
-rw-r--r--include/linux/efs_fs.h2
-rw-r--r--include/linux/fs.h4
-rw-r--r--include/linux/futex.h12
-rw-r--r--include/linux/ide.h1
-rw-r--r--include/linux/init_task.h3
-rw-r--r--include/linux/interrupt.h14
-rw-r--r--include/linux/ioport.h3
-rw-r--r--include/linux/ipmi.h4
-rw-r--r--include/linux/irq.h346
-rw-r--r--include/linux/isdn/tpam.h55
-rw-r--r--include/linux/jffs2.h1
-rw-r--r--include/linux/kbd_kern.h4
-rw-r--r--include/linux/key.h8
-rw-r--r--include/linux/libata.h15
-rw-r--r--include/linux/list.h9
-rw-r--r--include/linux/memory_hotplug.h73
-rw-r--r--include/linux/mm.h13
-rw-r--r--include/linux/module.h20
-rw-r--r--include/linux/nfs_fs.h2
-rw-r--r--include/linux/node.h17
-rw-r--r--include/linux/nsc_gpio.h42
-rw-r--r--include/linux/pci_ids.h2
-rw-r--r--include/linux/plist.h248
-rw-r--r--include/linux/poison.h58
-rw-r--r--include/linux/rcupdate.h1
-rw-r--r--include/linux/reiserfs_fs.h2
-rw-r--r--include/linux/rtmutex.h117
-rw-r--r--include/linux/sched.h59
-rw-r--r--include/linux/scx200.h7
-rw-r--r--include/linux/scx200_gpio.h21
-rw-r--r--include/linux/spi/spi.h6
-rw-r--r--include/linux/swap.h2
-rw-r--r--include/linux/syscalls.h4
-rw-r--r--include/linux/sysctl.h2
-rw-r--r--include/linux/topology.h3
-rw-r--r--include/linux/tty.h2
-rw-r--r--include/linux/tty_flip.h2
-rw-r--r--include/linux/ufs_fs.h2
-rw-r--r--include/linux/watchdog.h10
-rw-r--r--include/media/cx2341x.h4
112 files changed, 1675 insertions, 515 deletions
diff --git a/include/asm-alpha/core_t2.h b/include/asm-alpha/core_t2.h
index dba70c62a16c..457c34b6eb09 100644
--- a/include/asm-alpha/core_t2.h
+++ b/include/asm-alpha/core_t2.h
@@ -435,7 +435,7 @@ static inline void t2_outl(u32 b, unsigned long addr)
435 set_hae(msb); \ 435 set_hae(msb); \
436} 436}
437 437
438static spinlock_t t2_hae_lock = SPIN_LOCK_UNLOCKED; 438static DEFINE_SPINLOCK(t2_hae_lock);
439 439
440__EXTERN_INLINE u8 t2_readb(const volatile void __iomem *xaddr) 440__EXTERN_INLINE u8 t2_readb(const volatile void __iomem *xaddr)
441{ 441{
diff --git a/include/asm-alpha/hw_irq.h b/include/asm-alpha/hw_irq.h
index ca9d43b63502..a37db0f95092 100644
--- a/include/asm-alpha/hw_irq.h
+++ b/include/asm-alpha/hw_irq.h
@@ -2,8 +2,6 @@
2#define _ALPHA_HW_IRQ_H 2#define _ALPHA_HW_IRQ_H
3 3
4 4
5static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {}
6
7extern volatile unsigned long irq_err_count; 5extern volatile unsigned long irq_err_count;
8 6
9#ifdef CONFIG_ALPHA_GENERIC 7#ifdef CONFIG_ALPHA_GENERIC
diff --git a/include/asm-arm/arch-at91rm9200/memory.h b/include/asm-arm/arch-at91rm9200/memory.h
index 3c327c404373..f985069e6d01 100644
--- a/include/asm-arm/arch-at91rm9200/memory.h
+++ b/include/asm-arm/arch-at91rm9200/memory.h
@@ -33,9 +33,7 @@
33 * bus_to_virt: Used to convert an address for DMA operations 33 * bus_to_virt: Used to convert an address for DMA operations
34 * to an address that the kernel can use. 34 * to an address that the kernel can use.
35 */ 35 */
36#define __virt_to_bus__is_a_macro
37#define __virt_to_bus(x) __virt_to_phys(x) 36#define __virt_to_bus(x) __virt_to_phys(x)
38#define __bus_to_virt__is_a_macro
39#define __bus_to_virt(x) __phys_to_virt(x) 37#define __bus_to_virt(x) __phys_to_virt(x)
40 38
41#endif 39#endif
diff --git a/include/asm-arm/arch-h720x/memory.h b/include/asm-arm/arch-h720x/memory.h
index 4a1bfd78a0fe..53e923dba76e 100644
--- a/include/asm-arm/arch-h720x/memory.h
+++ b/include/asm-arm/arch-h720x/memory.h
@@ -23,9 +23,7 @@
23 * There is something to do here later !, Mar 2000, Jungjun Kim 23 * There is something to do here later !, Mar 2000, Jungjun Kim
24 */ 24 */
25 25
26#define __virt_to_bus__is_a_macro
27#define __virt_to_bus(x) __virt_to_phys(x) 26#define __virt_to_bus(x) __virt_to_phys(x)
28#define __bus_to_virt__is_a_macro
29#define __bus_to_virt(x) __phys_to_virt(x) 27#define __bus_to_virt(x) __phys_to_virt(x)
30 28
31#endif 29#endif
diff --git a/include/asm-arm/arch-imx/memory.h b/include/asm-arm/arch-imx/memory.h
index d09ae32cd2f4..5ad90127915f 100644
--- a/include/asm-arm/arch-imx/memory.h
+++ b/include/asm-arm/arch-imx/memory.h
@@ -30,9 +30,7 @@
30 * bus_to_virt: Used to convert an address for DMA operations 30 * bus_to_virt: Used to convert an address for DMA operations
31 * to an address that the kernel can use. 31 * to an address that the kernel can use.
32 */ 32 */
33#define __virt_to_bus__is_a_macro 33#define __virt_to_bus(x) (x - PAGE_OFFSET + PHYS_OFFSET)
34#define __virt_to_bus(x) (x - PAGE_OFFSET + PHYS_OFFSET) 34#define __bus_to_virt(x) (x - PHYS_OFFSET + PAGE_OFFSET)
35#define __bus_to_virt__is_a_macro
36#define __bus_to_virt(x) (x - PHYS_OFFSET + PAGE_OFFSET)
37 35
38#endif 36#endif
diff --git a/include/asm-arm/arch-ixp23xx/ixp23xx.h b/include/asm-arm/arch-ixp23xx/ixp23xx.h
index d0a72201ee96..3927b1d61b17 100644
--- a/include/asm-arm/arch-ixp23xx/ixp23xx.h
+++ b/include/asm-arm/arch-ixp23xx/ixp23xx.h
@@ -295,15 +295,4 @@
295#define IXP23XX_PCI_CPP_ADDR_BITS IXP23XX_PCI_CSR(0x0160) 295#define IXP23XX_PCI_CPP_ADDR_BITS IXP23XX_PCI_CSR(0x0160)
296 296
297 297
298#ifndef __ASSEMBLY__
299/*
300 * Is system memory on the XSI or CPP bus?
301 */
302static inline unsigned ixp23xx_cpp_boot(void)
303{
304 return (*IXP23XX_EXP_CFG0 & IXP23XX_EXP_CFG0_XSI_NOT_PRES);
305}
306#endif
307
308
309#endif 298#endif
diff --git a/include/asm-arm/arch-ixp23xx/platform.h b/include/asm-arm/arch-ixp23xx/platform.h
index 19a73b39c864..56e16d66645a 100644
--- a/include/asm-arm/arch-ixp23xx/platform.h
+++ b/include/asm-arm/arch-ixp23xx/platform.h
@@ -43,5 +43,15 @@ extern struct sys_timer ixp23xx_timer;
43 43
44#define IXP23XX_UART_XTAL 14745600 44#define IXP23XX_UART_XTAL 14745600
45 45
46#ifndef __ASSEMBLY__
47/*
48 * Is system memory on the XSI or CPP bus?
49 */
50static inline unsigned ixp23xx_cpp_boot(void)
51{
52 return (*IXP23XX_EXP_CFG0 & IXP23XX_EXP_CFG0_XSI_NOT_PRES);
53}
54#endif
55
46 56
47#endif 57#endif
diff --git a/include/asm-arm/arch-ixp23xx/uncompress.h b/include/asm-arm/arch-ixp23xx/uncompress.h
index 013575e6a9a1..16c1110f2304 100644
--- a/include/asm-arm/arch-ixp23xx/uncompress.h
+++ b/include/asm-arm/arch-ixp23xx/uncompress.h
@@ -11,7 +11,7 @@
11#ifndef __ASM_ARCH_UNCOMPRESS_H 11#ifndef __ASM_ARCH_UNCOMPRESS_H
12#define __ASM_ARCH_UNCOMPRESS_H 12#define __ASM_ARCH_UNCOMPRESS_H
13 13
14#include <asm/hardware.h> 14#include <asm/arch/ixp23xx.h>
15#include <linux/serial_reg.h> 15#include <linux/serial_reg.h>
16 16
17#define UART_BASE ((volatile u32 *)IXP23XX_UART1_PHYS) 17#define UART_BASE ((volatile u32 *)IXP23XX_UART1_PHYS)
diff --git a/include/asm-arm/arch-s3c2410/regs-dsc.h b/include/asm-arm/arch-s3c2410/regs-dsc.h
index 84aca61cbaa3..a0a124875164 100644
--- a/include/asm-arm/arch-s3c2410/regs-dsc.h
+++ b/include/asm-arm/arch-s3c2410/regs-dsc.h
@@ -7,25 +7,23 @@
7 * it under the terms of the GNU General Public License version 2 as 7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 * 9 *
10 * S3C2440 Signal Drive Strength Control 10 * S3C2440/S3C2412 Signal Drive Strength Control
11 *
12 * Changelog:
13 * 11-Aug-2004 BJD Created file
14 * 25-Aug-2004 BJD Added the _SELECT_* defs for using with functions
15*/ 11*/
16 12
17 13
18#ifndef __ASM_ARCH_REGS_DSC_H 14#ifndef __ASM_ARCH_REGS_DSC_H
19#define __ASM_ARCH_REGS_DSC_H "2440-dsc" 15#define __ASM_ARCH_REGS_DSC_H "2440-dsc"
20 16
21#ifdef CONFIG_CPU_S3C2440 17#if defined(CONFIG_CPU_S3C2412)
18#define S3C2412_DSC0 S3C2410_GPIOREG(0xdc)
19#define S3C2412_DSC1 S3C2410_GPIOREG(0xe0)
20#endif
21
22#if defined(CONFIG_CPU_S3C2440)
22 23
23#define S3C2440_DSC0 S3C2410_GPIOREG(0xc4) 24#define S3C2440_DSC0 S3C2410_GPIOREG(0xc4)
24#define S3C2440_DSC1 S3C2410_GPIOREG(0xc8) 25#define S3C2440_DSC1 S3C2410_GPIOREG(0xc8)
25 26
26#define S3C2412_DSC0 S3C2410_GPIOREG(0xdc)
27#define S3C2412_DSC1 S3C2410_GPIOREG(0xe0)
28
29#define S3C2440_SELECT_DSC0 (0) 27#define S3C2440_SELECT_DSC0 (0)
30#define S3C2440_SELECT_DSC1 (1<<31) 28#define S3C2440_SELECT_DSC1 (1<<31)
31 29
diff --git a/include/asm-arm/arch-s3c2410/regs-nand.h b/include/asm-arm/arch-s3c2410/regs-nand.h
index 7cff235e667a..c1470c695c33 100644
--- a/include/asm-arm/arch-s3c2410/regs-nand.h
+++ b/include/asm-arm/arch-s3c2410/regs-nand.h
@@ -39,10 +39,19 @@
39#define S3C2440_NFESTAT1 S3C2410_NFREG(0x28) 39#define S3C2440_NFESTAT1 S3C2410_NFREG(0x28)
40#define S3C2440_NFMECC0 S3C2410_NFREG(0x2C) 40#define S3C2440_NFMECC0 S3C2410_NFREG(0x2C)
41#define S3C2440_NFMECC1 S3C2410_NFREG(0x30) 41#define S3C2440_NFMECC1 S3C2410_NFREG(0x30)
42#define S3C2440_NFSECC S3C2410_NFREG(0x34) 42#define S3C2440_NFSECC S3C24E10_NFREG(0x34)
43#define S3C2440_NFSBLK S3C2410_NFREG(0x38) 43#define S3C2440_NFSBLK S3C2410_NFREG(0x38)
44#define S3C2440_NFEBLK S3C2410_NFREG(0x3C) 44#define S3C2440_NFEBLK S3C2410_NFREG(0x3C)
45 45
46#define S3C2412_NFSBLK S3C2410_NFREG(0x20)
47#define S3C2412_NFEBLK S3C2410_NFREG(0x24)
48#define S3C2412_NFSTAT S3C2410_NFREG(0x28)
49#define S3C2412_NFMECC_ERR0 S3C2410_NFREG(0x2C)
50#define S3C2412_NFMECC_ERR1 S3C2410_NFREG(0x30)
51#define S3C2412_NFMECC0 S3C2410_NFREG(0x34)
52#define S3C2412_NFMECC1 S3C2410_NFREG(0x38)
53#define S3C2412_NFSECC S3C2410_NFREG(0x3C)
54
46#define S3C2410_NFCONF_EN (1<<15) 55#define S3C2410_NFCONF_EN (1<<15)
47#define S3C2410_NFCONF_512BYTE (1<<14) 56#define S3C2410_NFCONF_512BYTE (1<<14)
48#define S3C2410_NFCONF_4STEP (1<<13) 57#define S3C2410_NFCONF_4STEP (1<<13)
@@ -77,5 +86,42 @@
77#define S3C2440_NFSTAT_RnB_CHANGE (1<<2) 86#define S3C2440_NFSTAT_RnB_CHANGE (1<<2)
78#define S3C2440_NFSTAT_ILLEGAL_ACCESS (1<<3) 87#define S3C2440_NFSTAT_ILLEGAL_ACCESS (1<<3)
79 88
89#define S3C2412_NFCONF_NANDBOOT (1<<31)
90#define S3C2412_NFCONF_ECCCLKCON (1<<30)
91#define S3C2412_NFCONF_ECC_MLC (1<<24)
92#define S3C2412_NFCONF_TACLS_MASK (7<<12) /* 1 extra bit of Tacls */
93
94#define S3C2412_NFCONT_ECC4_DIRWR (1<<18)
95#define S3C2412_NFCONT_LOCKTIGHT (1<<17)
96#define S3C2412_NFCONT_SOFTLOCK (1<<16)
97#define S3C2412_NFCONT_ECC4_ENCINT (1<<13)
98#define S3C2412_NFCONT_ECC4_DECINT (1<<12)
99#define S3C2412_NFCONT_MAIN_ECC_LOCK (1<<7)
100#define S3C2412_NFCONT_INIT_MAIN_ECC (1<<5)
101#define S3C2412_NFCONT_nFCE1 (1<<2)
102#define S3C2412_NFCONT_nFCE0 (1<<1)
103
104#define S3C2412_NFSTAT_ECC_ENCDONE (1<<7)
105#define S3C2412_NFSTAT_ECC_DECDONE (1<<6)
106#define S3C2412_NFSTAT_ILLEGAL_ACCESS (1<<5)
107#define S3C2412_NFSTAT_RnB_CHANGE (1<<4)
108#define S3C2412_NFSTAT_nFCE1 (1<<3)
109#define S3C2412_NFSTAT_nFCE0 (1<<2)
110#define S3C2412_NFSTAT_Res1 (1<<1)
111#define S3C2412_NFSTAT_READY (1<<0)
112
113#define S3C2412_NFECCERR_SERRDATA(x) (((x) >> 21) & 0xf)
114#define S3C2412_NFECCERR_SERRBIT(x) (((x) >> 18) & 0x7)
115#define S3C2412_NFECCERR_MERRDATA(x) (((x) >> 7) & 0x3ff)
116#define S3C2412_NFECCERR_MERRBIT(x) (((x) >> 4) & 0x7)
117#define S3C2412_NFECCERR_SPARE_ERR(x) (((x) >> 2) & 0x3)
118#define S3C2412_NFECCERR_MAIN_ERR(x) (((x) >> 2) & 0x3)
119#define S3C2412_NFECCERR_NONE (0)
120#define S3C2412_NFECCERR_1BIT (1)
121#define S3C2412_NFECCERR_MULTIBIT (2)
122#define S3C2412_NFECCERR_ECCAREA (3)
123
124
125
80#endif /* __ASM_ARM_REGS_NAND */ 126#endif /* __ASM_ARM_REGS_NAND */
81 127
diff --git a/include/asm-arm/bugs.h b/include/asm-arm/bugs.h
index 4c80ec519d45..ca54eb0f12d7 100644
--- a/include/asm-arm/bugs.h
+++ b/include/asm-arm/bugs.h
@@ -10,8 +10,12 @@
10#ifndef __ASM_BUGS_H 10#ifndef __ASM_BUGS_H
11#define __ASM_BUGS_H 11#define __ASM_BUGS_H
12 12
13#ifdef CONFIG_MMU
13extern void check_writebuffer_bugs(void); 14extern void check_writebuffer_bugs(void);
14 15
15#define check_bugs() check_writebuffer_bugs() 16#define check_bugs() check_writebuffer_bugs()
17#else
18#define check_bugs() do { } while (0)
19#endif
16 20
17#endif 21#endif
diff --git a/include/asm-arm/domain.h b/include/asm-arm/domain.h
index f8ea2de4848e..4c2885abbe6c 100644
--- a/include/asm-arm/domain.h
+++ b/include/asm-arm/domain.h
@@ -50,6 +50,8 @@
50#define domain_val(dom,type) ((type) << (2*(dom))) 50#define domain_val(dom,type) ((type) << (2*(dom)))
51 51
52#ifndef __ASSEMBLY__ 52#ifndef __ASSEMBLY__
53
54#ifdef CONFIG_MMU
53#define set_domain(x) \ 55#define set_domain(x) \
54 do { \ 56 do { \
55 __asm__ __volatile__( \ 57 __asm__ __volatile__( \
@@ -66,5 +68,10 @@
66 set_domain(thread->cpu_domain); \ 68 set_domain(thread->cpu_domain); \
67 } while (0) 69 } while (0)
68 70
71#else
72#define set_domain(x) do { } while (0)
73#define modify_domain(dom,type) do { } while (0)
74#endif
75
69#endif 76#endif
70#endif /* !__ASSEMBLY__ */ 77#endif /* !__ASSEMBLY__ */
diff --git a/include/asm-arm/fpstate.h b/include/asm-arm/fpstate.h
index 132c3c5628b2..6af4e6bd1290 100644
--- a/include/asm-arm/fpstate.h
+++ b/include/asm-arm/fpstate.h
@@ -72,6 +72,14 @@ union fp_state {
72 72
73#define FP_SIZE (sizeof(union fp_state) / sizeof(int)) 73#define FP_SIZE (sizeof(union fp_state) / sizeof(int))
74 74
75struct crunch_state {
76 unsigned int mvdx[16][2];
77 unsigned int mvax[4][3];
78 unsigned int dspsc[2];
79};
80
81#define CRUNCH_SIZE sizeof(struct crunch_state)
82
75#endif 83#endif
76 84
77#endif 85#endif
diff --git a/include/asm-arm/mach/map.h b/include/asm-arm/mach/map.h
index e8ea67c97c73..cef5364ed5fe 100644
--- a/include/asm-arm/mach/map.h
+++ b/include/asm-arm/mach/map.h
@@ -16,8 +16,6 @@ struct map_desc {
16 unsigned int type; 16 unsigned int type;
17}; 17};
18 18
19struct meminfo;
20
21#define MT_DEVICE 0 19#define MT_DEVICE 0
22#define MT_CACHECLEAN 1 20#define MT_CACHECLEAN 1
23#define MT_MINICLEAN 2 21#define MT_MINICLEAN 2
@@ -28,7 +26,8 @@ struct meminfo;
28#define MT_IXP2000_DEVICE 7 26#define MT_IXP2000_DEVICE 7
29#define MT_NONSHARED_DEVICE 8 27#define MT_NONSHARED_DEVICE 8
30 28
31extern void create_memmap_holes(struct meminfo *); 29#ifdef CONFIG_MMU
32extern void memtable_init(struct meminfo *);
33extern void iotable_init(struct map_desc *, int); 30extern void iotable_init(struct map_desc *, int);
34extern void setup_io_desc(void); 31#else
32#define iotable_init(map,num) do { } while (0)
33#endif
diff --git a/include/asm-arm/memory.h b/include/asm-arm/memory.h
index 731e321a57d1..94f973b704f1 100644
--- a/include/asm-arm/memory.h
+++ b/include/asm-arm/memory.h
@@ -2,6 +2,7 @@
2 * linux/include/asm-arm/memory.h 2 * linux/include/asm-arm/memory.h
3 * 3 *
4 * Copyright (C) 2000-2002 Russell King 4 * Copyright (C) 2000-2002 Russell King
5 * modification for nommu, Hyok S. Choi, 2004
5 * 6 *
6 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as 8 * it under the terms of the GNU General Public License version 2 as
@@ -26,6 +27,8 @@
26#include <asm/arch/memory.h> 27#include <asm/arch/memory.h>
27#include <asm/sizes.h> 28#include <asm/sizes.h>
28 29
30#ifdef CONFIG_MMU
31
29#ifndef TASK_SIZE 32#ifndef TASK_SIZE
30/* 33/*
31 * TASK_SIZE - the maximum size of a user space task. 34 * TASK_SIZE - the maximum size of a user space task.
@@ -48,6 +51,60 @@
48#endif 51#endif
49 52
50/* 53/*
54 * The module space lives between the addresses given by TASK_SIZE
55 * and PAGE_OFFSET - it must be within 32MB of the kernel text.
56 */
57#define MODULE_END (PAGE_OFFSET)
58#define MODULE_START (MODULE_END - 16*1048576)
59
60#if TASK_SIZE > MODULE_START
61#error Top of user space clashes with start of module space
62#endif
63
64/*
65 * The XIP kernel gets mapped at the bottom of the module vm area.
66 * Since we use sections to map it, this macro replaces the physical address
67 * with its virtual address while keeping offset from the base section.
68 */
69#define XIP_VIRT_ADDR(physaddr) (MODULE_START + ((physaddr) & 0x000fffff))
70
71#else /* CONFIG_MMU */
72
73/*
74 * The limitation of user task size can grow up to the end of free ram region.
75 * It is difficult to define and perhaps will never meet the original meaning
76 * of this define that was meant to.
77 * Fortunately, there is no reference for this in noMMU mode, for now.
78 */
79#ifndef TASK_SIZE
80#define TASK_SIZE (CONFIG_DRAM_SIZE)
81#endif
82
83#ifndef TASK_UNMAPPED_BASE
84#define TASK_UNMAPPED_BASE UL(0x00000000)
85#endif
86
87#ifndef PHYS_OFFSET
88#define PHYS_OFFSET (CONFIG_DRAM_BASE)
89#endif
90
91#ifndef END_MEM
92#define END_MEM (CONFIG_DRAM_BASE + CONFIG_DRAM_SIZE)
93#endif
94
95#ifndef PAGE_OFFSET
96#define PAGE_OFFSET (PHYS_OFFSET)
97#endif
98
99/*
100 * The module can be at any place in ram in nommu mode.
101 */
102#define MODULE_END (END_MEM)
103#define MODULE_START (PHYS_OFFSET)
104
105#endif /* !CONFIG_MMU */
106
107/*
51 * Size of DMA-consistent memory region. Must be multiple of 2M, 108 * Size of DMA-consistent memory region. Must be multiple of 2M,
52 * between 2MB and 14MB inclusive. 109 * between 2MB and 14MB inclusive.
53 */ 110 */
@@ -71,24 +128,6 @@
71#define __phys_to_pfn(paddr) ((paddr) >> PAGE_SHIFT) 128#define __phys_to_pfn(paddr) ((paddr) >> PAGE_SHIFT)
72#define __pfn_to_phys(pfn) ((pfn) << PAGE_SHIFT) 129#define __pfn_to_phys(pfn) ((pfn) << PAGE_SHIFT)
73 130
74/*
75 * The module space lives between the addresses given by TASK_SIZE
76 * and PAGE_OFFSET - it must be within 32MB of the kernel text.
77 */
78#define MODULE_END (PAGE_OFFSET)
79#define MODULE_START (MODULE_END - 16*1048576)
80
81#if TASK_SIZE > MODULE_START
82#error Top of user space clashes with start of module space
83#endif
84
85/*
86 * The XIP kernel gets mapped at the bottom of the module vm area.
87 * Since we use sections to map it, this macro replaces the physical address
88 * with its virtual address while keeping offset from the base section.
89 */
90#define XIP_VIRT_ADDR(physaddr) (MODULE_START + ((physaddr) & 0x000fffff))
91
92#ifndef __ASSEMBLY__ 131#ifndef __ASSEMBLY__
93 132
94/* 133/*
diff --git a/include/asm-arm/mmu.h b/include/asm-arm/mmu.h
index a457cb71984f..23dde52e0945 100644
--- a/include/asm-arm/mmu.h
+++ b/include/asm-arm/mmu.h
@@ -1,6 +1,8 @@
1#ifndef __ARM_MMU_H 1#ifndef __ARM_MMU_H
2#define __ARM_MMU_H 2#define __ARM_MMU_H
3 3
4#ifdef CONFIG_MMU
5
4typedef struct { 6typedef struct {
5#if __LINUX_ARM_ARCH__ >= 6 7#if __LINUX_ARM_ARCH__ >= 6
6 unsigned int id; 8 unsigned int id;
@@ -13,4 +15,18 @@ typedef struct {
13#define ASID(mm) (0) 15#define ASID(mm) (0)
14#endif 16#endif
15 17
18#else
19
20/*
21 * From nommu.h:
22 * Copyright (C) 2002, David McCullough <davidm@snapgear.com>
23 * modified for 2.6 by Hyok S. Choi <hyok.choi@samsung.com>
24 */
25typedef struct {
26 struct vm_list_struct *vmlist;
27 unsigned long end_brk;
28} mm_context_t;
29
30#endif
31
16#endif 32#endif
diff --git a/include/asm-arm/mmu_context.h b/include/asm-arm/mmu_context.h
index 81c59facea3b..9fadb01e030d 100644
--- a/include/asm-arm/mmu_context.h
+++ b/include/asm-arm/mmu_context.h
@@ -82,6 +82,7 @@ static inline void
82switch_mm(struct mm_struct *prev, struct mm_struct *next, 82switch_mm(struct mm_struct *prev, struct mm_struct *next,
83 struct task_struct *tsk) 83 struct task_struct *tsk)
84{ 84{
85#ifdef CONFIG_MMU
85 unsigned int cpu = smp_processor_id(); 86 unsigned int cpu = smp_processor_id();
86 87
87 if (prev != next) { 88 if (prev != next) {
@@ -91,6 +92,7 @@ switch_mm(struct mm_struct *prev, struct mm_struct *next,
91 if (cache_is_vivt()) 92 if (cache_is_vivt())
92 cpu_clear(cpu, prev->cpu_vm_mask); 93 cpu_clear(cpu, prev->cpu_vm_mask);
93 } 94 }
95#endif
94} 96}
95 97
96#define deactivate_mm(tsk,mm) do { } while (0) 98#define deactivate_mm(tsk,mm) do { } while (0)
diff --git a/include/asm-arm/page-nommu.h b/include/asm-arm/page-nommu.h
new file mode 100644
index 000000000000..a1bcad060480
--- /dev/null
+++ b/include/asm-arm/page-nommu.h
@@ -0,0 +1,51 @@
1/*
2 * linux/include/asm-arm/page-nommu.h
3 *
4 * Copyright (C) 2004 Hyok S. Choi
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#ifndef _ASMARM_PAGE_NOMMU_H
11#define _ASMARM_PAGE_NOMMU_H
12
13#if !defined(CONFIG_SMALL_TASKS) && PAGE_SHIFT < 13
14#define KTHREAD_SIZE (8192)
15#else
16#define KTHREAD_SIZE PAGE_SIZE
17#endif
18
19#define get_user_page(vaddr) __get_free_page(GFP_KERNEL)
20#define free_user_page(page, addr) free_page(addr)
21
22#define clear_page(page) memset((page), 0, PAGE_SIZE)
23#define copy_page(to,from) memcpy((to), (from), PAGE_SIZE)
24
25#define clear_user_page(page, vaddr, pg) clear_page(page)
26#define copy_user_page(to, from, vaddr, pg) copy_page(to, from)
27
28/*
29 * These are used to make use of C type-checking..
30 */
31typedef unsigned long pte_t;
32typedef unsigned long pmd_t;
33typedef unsigned long pgd_t[2];
34typedef unsigned long pgprot_t;
35
36#define pte_val(x) (x)
37#define pmd_val(x) (x)
38#define pgd_val(x) ((x)[0])
39#define pgprot_val(x) (x)
40
41#define __pte(x) (x)
42#define __pmd(x) (x)
43#define __pgprot(x) (x)
44
45/* to align the pointer to the (next) page boundary */
46#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
47
48extern unsigned long memory_start;
49extern unsigned long memory_end;
50
51#endif
diff --git a/include/asm-arm/page.h b/include/asm-arm/page.h
index 66cfeb5290ea..63d12f0244c5 100644
--- a/include/asm-arm/page.h
+++ b/include/asm-arm/page.h
@@ -23,6 +23,12 @@
23 23
24#ifndef __ASSEMBLY__ 24#ifndef __ASSEMBLY__
25 25
26#ifndef CONFIG_MMU
27
28#include "page-nommu.h"
29
30#else
31
26#include <asm/glue.h> 32#include <asm/glue.h>
27 33
28/* 34/*
@@ -171,6 +177,8 @@ typedef unsigned long pgprot_t;
171/* the upper-most page table pointer */ 177/* the upper-most page table pointer */
172extern pmd_t *top_pmd; 178extern pmd_t *top_pmd;
173 179
180#endif /* CONFIG_MMU */
181
174#include <asm/memory.h> 182#include <asm/memory.h>
175 183
176#endif /* !__ASSEMBLY__ */ 184#endif /* !__ASSEMBLY__ */
diff --git a/include/asm-arm/pgalloc.h b/include/asm-arm/pgalloc.h
index c4ac2e67768d..4d4394552911 100644
--- a/include/asm-arm/pgalloc.h
+++ b/include/asm-arm/pgalloc.h
@@ -16,6 +16,10 @@
16#include <asm/cacheflush.h> 16#include <asm/cacheflush.h>
17#include <asm/tlbflush.h> 17#include <asm/tlbflush.h>
18 18
19#define check_pgt_cache() do { } while (0)
20
21#ifdef CONFIG_MMU
22
19#define _PAGE_USER_TABLE (PMD_TYPE_TABLE | PMD_BIT4 | PMD_DOMAIN(DOMAIN_USER)) 23#define _PAGE_USER_TABLE (PMD_TYPE_TABLE | PMD_BIT4 | PMD_DOMAIN(DOMAIN_USER))
20#define _PAGE_KERNEL_TABLE (PMD_TYPE_TABLE | PMD_BIT4 | PMD_DOMAIN(DOMAIN_KERNEL)) 24#define _PAGE_KERNEL_TABLE (PMD_TYPE_TABLE | PMD_BIT4 | PMD_DOMAIN(DOMAIN_KERNEL))
21 25
@@ -32,8 +36,6 @@ extern void free_pgd_slow(pgd_t *pgd);
32#define pgd_alloc(mm) get_pgd_slow(mm) 36#define pgd_alloc(mm) get_pgd_slow(mm)
33#define pgd_free(pgd) free_pgd_slow(pgd) 37#define pgd_free(pgd) free_pgd_slow(pgd)
34 38
35#define check_pgt_cache() do { } while (0)
36
37/* 39/*
38 * Allocate one PTE table. 40 * Allocate one PTE table.
39 * 41 *
@@ -126,4 +128,6 @@ pmd_populate(struct mm_struct *mm, pmd_t *pmdp, struct page *ptep)
126 __pmd_populate(pmdp, page_to_pfn(ptep) << PAGE_SHIFT | _PAGE_USER_TABLE); 128 __pmd_populate(pmdp, page_to_pfn(ptep) << PAGE_SHIFT | _PAGE_USER_TABLE);
127} 129}
128 130
131#endif /* CONFIG_MMU */
132
129#endif 133#endif
diff --git a/include/asm-arm/pgtable-nommu.h b/include/asm-arm/pgtable-nommu.h
new file mode 100644
index 000000000000..b13322dccf41
--- /dev/null
+++ b/include/asm-arm/pgtable-nommu.h
@@ -0,0 +1,123 @@
1/*
2 * linux/include/asm-arm/pgtable-nommu.h
3 *
4 * Copyright (C) 1995-2002 Russell King
5 * Copyright (C) 2004 Hyok S. Choi
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#ifndef _ASMARM_PGTABLE_NOMMU_H
12#define _ASMARM_PGTABLE_NOMMU_H
13
14#ifndef __ASSEMBLY__
15
16#include <linux/config.h>
17#include <linux/slab.h>
18#include <asm/processor.h>
19#include <asm/page.h>
20#include <asm/io.h>
21
22/*
23 * Trivial page table functions.
24 */
25#define pgd_present(pgd) (1)
26#define pgd_none(pgd) (0)
27#define pgd_bad(pgd) (0)
28#define pgd_clear(pgdp)
29#define kern_addr_valid(addr) (1)
30#define pmd_offset(a, b) ((void *)0)
31/* FIXME */
32/*
33 * PMD_SHIFT determines the size of the area a second-level page table can map
34 * PGDIR_SHIFT determines what a third-level page table entry can map
35 */
36#define PGDIR_SHIFT 21
37
38#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
39#define PGDIR_MASK (~(PGDIR_SIZE-1))
40/* FIXME */
41
42#define PAGE_NONE __pgprot(0)
43#define PAGE_SHARED __pgprot(0)
44#define PAGE_COPY __pgprot(0)
45#define PAGE_READONLY __pgprot(0)
46#define PAGE_KERNEL __pgprot(0)
47
48//extern void paging_init(struct meminfo *, struct machine_desc *);
49#define swapper_pg_dir ((pgd_t *) 0)
50
51#define __swp_type(x) (0)
52#define __swp_offset(x) (0)
53#define __swp_entry(typ,off) ((swp_entry_t) { ((typ) | ((off) << 7)) })
54#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
55#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
56
57
58typedef pte_t *pte_addr_t;
59
60static inline int pte_file(pte_t pte) { return 0; }
61
62/*
63 * ZERO_PAGE is a global shared page that is always zero: used
64 * for zero-mapped memory areas etc..
65 */
66#define ZERO_PAGE(vaddr) (virt_to_page(0))
67
68/*
69 * Mark the prot value as uncacheable and unbufferable.
70 */
71#define pgprot_noncached(prot) __pgprot(0)
72#define pgprot_writecombine(prot) __pgprot(0)
73
74
75/*
76 * These would be in other places but having them here reduces the diffs.
77 */
78extern unsigned int kobjsize(const void *objp);
79extern int is_in_rom(unsigned long);
80
81/*
82 * No page table caches to initialise.
83 */
84#define pgtable_cache_init() do { } while (0)
85#define io_remap_page_range remap_page_range
86#define io_remap_pfn_range remap_pfn_range
87
88#define MK_IOSPACE_PFN(space, pfn) (pfn)
89#define GET_IOSPACE(pfn) 0
90#define GET_PFN(pfn) (pfn)
91
92
93/*
94 * All 32bit addresses are effectively valid for vmalloc...
95 * Sort of meaningless for non-VM targets.
96 */
97#define VMALLOC_START 0
98#define VMALLOC_END 0xffffffff
99
100#define FIRST_USER_ADDRESS (0)
101
102#else
103
104/*
105 * dummy tlb and user structures.
106 */
107#define v3_tlb_fns (0)
108#define v4_tlb_fns (0)
109#define v4wb_tlb_fns (0)
110#define v4wbi_tlb_fns (0)
111#define v6_tlb_fns (0)
112
113#define v3_user_fns (0)
114#define v4_user_fns (0)
115#define v4_mc_user_fns (0)
116#define v4wb_user_fns (0)
117#define v4wt_user_fns (0)
118#define v6_user_fns (0)
119#define xscale_mc_user_fns (0)
120
121#endif /*__ASSEMBLY__*/
122
123#endif /* _ASMARM_PGTABLE_H */
diff --git a/include/asm-arm/pgtable.h b/include/asm-arm/pgtable.h
index e85c08d78dda..8d3919c6458c 100644
--- a/include/asm-arm/pgtable.h
+++ b/include/asm-arm/pgtable.h
@@ -11,9 +11,15 @@
11#define _ASMARM_PGTABLE_H 11#define _ASMARM_PGTABLE_H
12 12
13#include <asm-generic/4level-fixup.h> 13#include <asm-generic/4level-fixup.h>
14#include <asm/proc-fns.h>
15
16#ifndef CONFIG_MMU
17
18#include "pgtable-nommu.h"
19
20#else
14 21
15#include <asm/memory.h> 22#include <asm/memory.h>
16#include <asm/proc-fns.h>
17#include <asm/arch/vmalloc.h> 23#include <asm/arch/vmalloc.h>
18 24
19/* 25/*
@@ -378,4 +384,6 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
378 384
379#endif /* !__ASSEMBLY__ */ 385#endif /* !__ASSEMBLY__ */
380 386
387#endif /* CONFIG_MMU */
388
381#endif /* _ASMARM_PGTABLE_H */ 389#endif /* _ASMARM_PGTABLE_H */
diff --git a/include/asm-arm/proc-fns.h b/include/asm-arm/proc-fns.h
index e9310895e79d..1bde92cdaebd 100644
--- a/include/asm-arm/proc-fns.h
+++ b/include/asm-arm/proc-fns.h
@@ -165,6 +165,8 @@
165 165
166#include <asm/memory.h> 166#include <asm/memory.h>
167 167
168#ifdef CONFIG_MMU
169
168#define cpu_switch_mm(pgd,mm) cpu_do_switch_mm(virt_to_phys(pgd),mm) 170#define cpu_switch_mm(pgd,mm) cpu_do_switch_mm(virt_to_phys(pgd),mm)
169 171
170#define cpu_get_pgd() \ 172#define cpu_get_pgd() \
@@ -176,6 +178,8 @@
176 (pgd_t *)phys_to_virt(pg); \ 178 (pgd_t *)phys_to_virt(pg); \
177 }) 179 })
178 180
181#endif
182
179#endif /* __ASSEMBLY__ */ 183#endif /* __ASSEMBLY__ */
180#endif /* __KERNEL__ */ 184#endif /* __KERNEL__ */
181#endif /* __ASM_PROCFNS_H */ 185#endif /* __ASM_PROCFNS_H */
diff --git a/include/asm-arm/ptrace.h b/include/asm-arm/ptrace.h
index 2bebe3dc0a30..5a8ef787dbf8 100644
--- a/include/asm-arm/ptrace.h
+++ b/include/asm-arm/ptrace.h
@@ -25,6 +25,11 @@
25 25
26#define PTRACE_SET_SYSCALL 23 26#define PTRACE_SET_SYSCALL 23
27 27
28/* PTRACE_SYSCALL is 24 */
29
30#define PTRACE_GETCRUNCHREGS 25
31#define PTRACE_SETCRUNCHREGS 26
32
28/* 33/*
29 * PSR bits 34 * PSR bits
30 */ 35 */
diff --git a/include/asm-arm/thread_info.h b/include/asm-arm/thread_info.h
index cfbccb63c67b..c46b5c84275f 100644
--- a/include/asm-arm/thread_info.h
+++ b/include/asm-arm/thread_info.h
@@ -59,6 +59,7 @@ struct thread_info {
59 struct cpu_context_save cpu_context; /* cpu context */ 59 struct cpu_context_save cpu_context; /* cpu context */
60 __u8 used_cp[16]; /* thread used copro */ 60 __u8 used_cp[16]; /* thread used copro */
61 unsigned long tp_value; 61 unsigned long tp_value;
62 struct crunch_state crunchstate;
62 union fp_state fpstate __attribute__((aligned(8))); 63 union fp_state fpstate __attribute__((aligned(8)));
63 union vfp_state vfpstate; 64 union vfp_state vfpstate;
64 struct restart_block restart_block; 65 struct restart_block restart_block;
@@ -101,6 +102,11 @@ extern void free_thread_info(struct thread_info *);
101#define thread_saved_fp(tsk) \ 102#define thread_saved_fp(tsk) \
102 ((unsigned long)(task_thread_info(tsk)->cpu_context.fp)) 103 ((unsigned long)(task_thread_info(tsk)->cpu_context.fp))
103 104
105extern void crunch_task_disable(struct thread_info *);
106extern void crunch_task_copy(struct thread_info *, void *);
107extern void crunch_task_restore(struct thread_info *, void *);
108extern void crunch_task_release(struct thread_info *);
109
104extern void iwmmxt_task_disable(struct thread_info *); 110extern void iwmmxt_task_disable(struct thread_info *);
105extern void iwmmxt_task_copy(struct thread_info *, void *); 111extern void iwmmxt_task_copy(struct thread_info *, void *);
106extern void iwmmxt_task_restore(struct thread_info *, void *); 112extern void iwmmxt_task_restore(struct thread_info *, void *);
diff --git a/include/asm-arm/uaccess.h b/include/asm-arm/uaccess.h
index 064f0f5e8e2b..87aba57a66c4 100644
--- a/include/asm-arm/uaccess.h
+++ b/include/asm-arm/uaccess.h
@@ -41,15 +41,24 @@ struct exception_table_entry
41extern int fixup_exception(struct pt_regs *regs); 41extern int fixup_exception(struct pt_regs *regs);
42 42
43/* 43/*
44 * These two are intentionally not defined anywhere - if the kernel
45 * code generates any references to them, that's a bug.
46 */
47extern int __get_user_bad(void);
48extern int __put_user_bad(void);
49
50/*
44 * Note that this is actually 0x1,0000,0000 51 * Note that this is actually 0x1,0000,0000
45 */ 52 */
46#define KERNEL_DS 0x00000000 53#define KERNEL_DS 0x00000000
47#define USER_DS TASK_SIZE
48
49#define get_ds() (KERNEL_DS) 54#define get_ds() (KERNEL_DS)
55
56#ifdef CONFIG_MMU
57
58#define USER_DS TASK_SIZE
50#define get_fs() (current_thread_info()->addr_limit) 59#define get_fs() (current_thread_info()->addr_limit)
51 60
52static inline void set_fs (mm_segment_t fs) 61static inline void set_fs(mm_segment_t fs)
53{ 62{
54 current_thread_info()->addr_limit = fs; 63 current_thread_info()->addr_limit = fs;
55 modify_domain(DOMAIN_KERNEL, fs ? DOMAIN_CLIENT : DOMAIN_MANAGER); 64 modify_domain(DOMAIN_KERNEL, fs ? DOMAIN_CLIENT : DOMAIN_MANAGER);
@@ -75,8 +84,6 @@ static inline void set_fs (mm_segment_t fs)
75 : "cc"); \ 84 : "cc"); \
76 flag; }) 85 flag; })
77 86
78#define access_ok(type,addr,size) (__range_ok(addr,size) == 0)
79
80/* 87/*
81 * Single-value transfer routines. They automatically use the right 88 * Single-value transfer routines. They automatically use the right
82 * size if we just have the right pointer type. Note that the functions 89 * size if we just have the right pointer type. Note that the functions
@@ -87,20 +94,10 @@ static inline void set_fs (mm_segment_t fs)
87 * fixup code, but there are a few places where it intrudes on the 94 * fixup code, but there are a few places where it intrudes on the
88 * main code path. When we only write to user space, there is no 95 * main code path. When we only write to user space, there is no
89 * problem. 96 * problem.
90 *
91 * The "__xxx" versions of the user access functions do not verify the
92 * address space - it must have been done previously with a separate
93 * "access_ok()" call.
94 *
95 * The "xxx_error" versions set the third argument to EFAULT if an
96 * error occurs, and leave it unchanged on success. Note that these
97 * versions are void (ie, don't return a value as such).
98 */ 97 */
99
100extern int __get_user_1(void *); 98extern int __get_user_1(void *);
101extern int __get_user_2(void *); 99extern int __get_user_2(void *);
102extern int __get_user_4(void *); 100extern int __get_user_4(void *);
103extern int __get_user_bad(void);
104 101
105#define __get_user_x(__r2,__p,__e,__s,__i...) \ 102#define __get_user_x(__r2,__p,__e,__s,__i...) \
106 __asm__ __volatile__ ( \ 103 __asm__ __volatile__ ( \
@@ -131,6 +128,74 @@ extern int __get_user_bad(void);
131 __e; \ 128 __e; \
132 }) 129 })
133 130
131extern int __put_user_1(void *, unsigned int);
132extern int __put_user_2(void *, unsigned int);
133extern int __put_user_4(void *, unsigned int);
134extern int __put_user_8(void *, unsigned long long);
135
136#define __put_user_x(__r2,__p,__e,__s) \
137 __asm__ __volatile__ ( \
138 __asmeq("%0", "r0") __asmeq("%2", "r2") \
139 "bl __put_user_" #__s \
140 : "=&r" (__e) \
141 : "0" (__p), "r" (__r2) \
142 : "ip", "lr", "cc")
143
144#define put_user(x,p) \
145 ({ \
146 const register typeof(*(p)) __r2 asm("r2") = (x); \
147 const register typeof(*(p)) __user *__p asm("r0") = (p);\
148 register int __e asm("r0"); \
149 switch (sizeof(*(__p))) { \
150 case 1: \
151 __put_user_x(__r2, __p, __e, 1); \
152 break; \
153 case 2: \
154 __put_user_x(__r2, __p, __e, 2); \
155 break; \
156 case 4: \
157 __put_user_x(__r2, __p, __e, 4); \
158 break; \
159 case 8: \
160 __put_user_x(__r2, __p, __e, 8); \
161 break; \
162 default: __e = __put_user_bad(); break; \
163 } \
164 __e; \
165 })
166
167#else /* CONFIG_MMU */
168
169/*
170 * uClinux has only one addr space, so has simplified address limits.
171 */
172#define USER_DS KERNEL_DS
173
174#define segment_eq(a,b) (1)
175#define __addr_ok(addr) (1)
176#define __range_ok(addr,size) (0)
177#define get_fs() (KERNEL_DS)
178
179static inline void set_fs(mm_segment_t fs)
180{
181}
182
183#define get_user(x,p) __get_user(x,p)
184#define put_user(x,p) __put_user(x,p)
185
186#endif /* CONFIG_MMU */
187
188#define access_ok(type,addr,size) (__range_ok(addr,size) == 0)
189
190/*
191 * The "__xxx" versions of the user access functions do not verify the
192 * address space - it must have been done previously with a separate
193 * "access_ok()" call.
194 *
195 * The "xxx_error" versions set the third argument to EFAULT if an
196 * error occurs, and leave it unchanged on success. Note that these
197 * versions are void (ie, don't return a value as such).
198 */
134#define __get_user(x,ptr) \ 199#define __get_user(x,ptr) \
135({ \ 200({ \
136 long __gu_err = 0; \ 201 long __gu_err = 0; \
@@ -212,43 +277,6 @@ do { \
212 : "r" (addr), "i" (-EFAULT) \ 277 : "r" (addr), "i" (-EFAULT) \
213 : "cc") 278 : "cc")
214 279
215extern int __put_user_1(void *, unsigned int);
216extern int __put_user_2(void *, unsigned int);
217extern int __put_user_4(void *, unsigned int);
218extern int __put_user_8(void *, unsigned long long);
219extern int __put_user_bad(void);
220
221#define __put_user_x(__r2,__p,__e,__s) \
222 __asm__ __volatile__ ( \
223 __asmeq("%0", "r0") __asmeq("%2", "r2") \
224 "bl __put_user_" #__s \
225 : "=&r" (__e) \
226 : "0" (__p), "r" (__r2) \
227 : "ip", "lr", "cc")
228
229#define put_user(x,p) \
230 ({ \
231 const register typeof(*(p)) __r2 asm("r2") = (x); \
232 const register typeof(*(p)) __user *__p asm("r0") = (p);\
233 register int __e asm("r0"); \
234 switch (sizeof(*(__p))) { \
235 case 1: \
236 __put_user_x(__r2, __p, __e, 1); \
237 break; \
238 case 2: \
239 __put_user_x(__r2, __p, __e, 2); \
240 break; \
241 case 4: \
242 __put_user_x(__r2, __p, __e, 4); \
243 break; \
244 case 8: \
245 __put_user_x(__r2, __p, __e, 8); \
246 break; \
247 default: __e = __put_user_bad(); break; \
248 } \
249 __e; \
250 })
251
252#define __put_user(x,ptr) \ 280#define __put_user(x,ptr) \
253({ \ 281({ \
254 long __pu_err = 0; \ 282 long __pu_err = 0; \
@@ -353,66 +381,54 @@ do { \
353 : "r" (x), "i" (-EFAULT) \ 381 : "r" (x), "i" (-EFAULT) \
354 : "cc") 382 : "cc")
355 383
356extern unsigned long __arch_copy_from_user(void *to, const void __user *from, unsigned long n); 384
357extern unsigned long __arch_copy_to_user(void __user *to, const void *from, unsigned long n); 385#ifdef CONFIG_MMU
358extern unsigned long __arch_clear_user(void __user *addr, unsigned long n); 386extern unsigned long __copy_from_user(void *to, const void __user *from, unsigned long n);
359extern unsigned long __arch_strncpy_from_user(char *to, const char __user *from, unsigned long count); 387extern unsigned long __copy_to_user(void __user *to, const void *from, unsigned long n);
360extern unsigned long __arch_strnlen_user(const char __user *s, long n); 388extern unsigned long __clear_user(void __user *addr, unsigned long n);
389#else
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)
392#define __clear_user(addr,n) (memset((void __force *)addr, 0, n), 0)
393#endif
394
395extern unsigned long __strncpy_from_user(char *to, const char __user *from, unsigned long count);
396extern unsigned long __strnlen_user(const char __user *s, long n);
361 397
362static inline unsigned long copy_from_user(void *to, const void __user *from, unsigned long n) 398static inline unsigned long copy_from_user(void *to, const void __user *from, unsigned long n)
363{ 399{
364 if (access_ok(VERIFY_READ, from, n)) 400 if (access_ok(VERIFY_READ, from, n))
365 n = __arch_copy_from_user(to, from, n); 401 n = __copy_from_user(to, from, n);
366 else /* security hole - plug it */ 402 else /* security hole - plug it */
367 memzero(to, n); 403 memzero(to, n);
368 return n; 404 return n;
369} 405}
370 406
371static inline unsigned long __copy_from_user(void *to, const void __user *from, unsigned long n)
372{
373 return __arch_copy_from_user(to, from, n);
374}
375
376static inline unsigned long copy_to_user(void __user *to, const void *from, unsigned long n) 407static inline unsigned long copy_to_user(void __user *to, const void *from, unsigned long n)
377{ 408{
378 if (access_ok(VERIFY_WRITE, to, n)) 409 if (access_ok(VERIFY_WRITE, to, n))
379 n = __arch_copy_to_user(to, from, n); 410 n = __copy_to_user(to, from, n);
380 return n; 411 return n;
381} 412}
382 413
383static inline unsigned long __copy_to_user(void __user *to, const void *from, unsigned long n)
384{
385 return __arch_copy_to_user(to, from, n);
386}
387
388#define __copy_to_user_inatomic __copy_to_user 414#define __copy_to_user_inatomic __copy_to_user
389#define __copy_from_user_inatomic __copy_from_user 415#define __copy_from_user_inatomic __copy_from_user
390 416
391static inline unsigned long clear_user (void __user *to, unsigned long n) 417static inline unsigned long clear_user(void __user *to, unsigned long n)
392{ 418{
393 if (access_ok(VERIFY_WRITE, to, n)) 419 if (access_ok(VERIFY_WRITE, to, n))
394 n = __arch_clear_user(to, n); 420 n = __clear_user(to, n);
395 return n; 421 return n;
396} 422}
397 423
398static inline unsigned long __clear_user (void __user *to, unsigned long n) 424static inline long strncpy_from_user(char *dst, const char __user *src, long count)
399{
400 return __arch_clear_user(to, n);
401}
402
403static inline long strncpy_from_user (char *dst, const char __user *src, long count)
404{ 425{
405 long res = -EFAULT; 426 long res = -EFAULT;
406 if (access_ok(VERIFY_READ, src, 1)) 427 if (access_ok(VERIFY_READ, src, 1))
407 res = __arch_strncpy_from_user(dst, src, count); 428 res = __strncpy_from_user(dst, src, count);
408 return res; 429 return res;
409} 430}
410 431
411static inline long __strncpy_from_user (char *dst, const char __user *src, long count)
412{
413 return __arch_strncpy_from_user(dst, src, count);
414}
415
416#define strlen_user(s) strnlen_user(s, ~0UL >> 1) 432#define strlen_user(s) strnlen_user(s, ~0UL >> 1)
417 433
418static inline long strnlen_user(const char __user *s, long n) 434static inline long strnlen_user(const char __user *s, long n)
@@ -420,7 +436,7 @@ static inline long strnlen_user(const char __user *s, long n)
420 unsigned long res = 0; 436 unsigned long res = 0;
421 437
422 if (__addr_ok(s)) 438 if (__addr_ok(s))
423 res = __arch_strnlen_user(s, n); 439 res = __strnlen_user(s, n);
424 440
425 return res; 441 return res;
426} 442}
diff --git a/include/asm-arm/ucontext.h b/include/asm-arm/ucontext.h
index 9e6f7ca9f5ae..bf65e9f4525d 100644
--- a/include/asm-arm/ucontext.h
+++ b/include/asm-arm/ucontext.h
@@ -35,6 +35,17 @@ struct ucontext {
35 * bytes, to prevent unpredictable padding in the signal frame. 35 * bytes, to prevent unpredictable padding in the signal frame.
36 */ 36 */
37 37
38#ifdef CONFIG_CRUNCH
39#define CRUNCH_MAGIC 0x5065cf03
40#define CRUNCH_STORAGE_SIZE (CRUNCH_SIZE + 8)
41
42struct crunch_sigframe {
43 unsigned long magic;
44 unsigned long size;
45 struct crunch_state storage;
46} __attribute__((__aligned__(8)));
47#endif
48
38#ifdef CONFIG_IWMMXT 49#ifdef CONFIG_IWMMXT
39/* iwmmxt_area is 0x98 bytes long, preceeded by 8 bytes of signature */ 50/* iwmmxt_area is 0x98 bytes long, preceeded by 8 bytes of signature */
40#define IWMMXT_MAGIC 0x12ef842a 51#define IWMMXT_MAGIC 0x12ef842a
@@ -74,6 +85,9 @@ struct vfp_sigframe
74 * one of these. 85 * one of these.
75 */ 86 */
76struct aux_sigframe { 87struct aux_sigframe {
88#ifdef CONFIG_CRUNCH
89 struct crunch_sigframe crunch;
90#endif
77#ifdef CONFIG_IWMMXT 91#ifdef CONFIG_IWMMXT
78 struct iwmmxt_sigframe iwmmxt; 92 struct iwmmxt_sigframe iwmmxt;
79#endif 93#endif
diff --git a/include/asm-cris/hw_irq.h b/include/asm-cris/hw_irq.h
index 341536a234e9..298066020af2 100644
--- a/include/asm-cris/hw_irq.h
+++ b/include/asm-cris/hw_irq.h
@@ -1,7 +1,5 @@
1#ifndef _ASM_HW_IRQ_H 1#ifndef _ASM_HW_IRQ_H
2#define _ASM_HW_IRQ_H 2#define _ASM_HW_IRQ_H
3 3
4static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {}
5
6#endif 4#endif
7 5
diff --git a/include/asm-cris/irq.h b/include/asm-cris/irq.h
index 4b338792218b..998cce9f3200 100644
--- a/include/asm-cris/irq.h
+++ b/include/asm-cris/irq.h
@@ -1,11 +1,6 @@
1#ifndef _ASM_IRQ_H 1#ifndef _ASM_IRQ_H
2#define _ASM_IRQ_H 2#define _ASM_IRQ_H
3 3
4/*
5 * IRQ line status macro IRQ_PER_CPU is used
6 */
7#define ARCH_HAS_IRQ_PER_CPU
8
9#include <asm/arch/irq.h> 4#include <asm/arch/irq.h>
10 5
11static inline int irq_canonicalize(int irq) 6static inline int irq_canonicalize(int irq)
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index 845cb67ad8ea..8ceab7bcd8b4 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -51,4 +51,10 @@
51 __ret; \ 51 __ret; \
52}) 52})
53 53
54#ifdef CONFIG_SMP
55# define WARN_ON_SMP(x) WARN_ON(x)
56#else
57# define WARN_ON_SMP(x) do { } while (0)
58#endif
59
54#endif 60#endif
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 9d11550b4818..db5a3732f106 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -58,6 +58,20 @@
58 VMLINUX_SYMBOL(__stop___ksymtab_gpl) = .; \ 58 VMLINUX_SYMBOL(__stop___ksymtab_gpl) = .; \
59 } \ 59 } \
60 \ 60 \
61 /* Kernel symbol table: Normal unused symbols */ \
62 __ksymtab_unused : AT(ADDR(__ksymtab_unused) - LOAD_OFFSET) { \
63 VMLINUX_SYMBOL(__start___ksymtab_unused) = .; \
64 *(__ksymtab_unused) \
65 VMLINUX_SYMBOL(__stop___ksymtab_unused) = .; \
66 } \
67 \
68 /* Kernel symbol table: GPL-only unused symbols */ \
69 __ksymtab_unused_gpl : AT(ADDR(__ksymtab_unused_gpl) - LOAD_OFFSET) { \
70 VMLINUX_SYMBOL(__start___ksymtab_unused_gpl) = .; \
71 *(__ksymtab_unused_gpl) \
72 VMLINUX_SYMBOL(__stop___ksymtab_unused_gpl) = .; \
73 } \
74 \
61 /* Kernel symbol table: GPL-future-only symbols */ \ 75 /* Kernel symbol table: GPL-future-only symbols */ \
62 __ksymtab_gpl_future : AT(ADDR(__ksymtab_gpl_future) - LOAD_OFFSET) { \ 76 __ksymtab_gpl_future : AT(ADDR(__ksymtab_gpl_future) - LOAD_OFFSET) { \
63 VMLINUX_SYMBOL(__start___ksymtab_gpl_future) = .; \ 77 VMLINUX_SYMBOL(__start___ksymtab_gpl_future) = .; \
@@ -79,6 +93,20 @@
79 VMLINUX_SYMBOL(__stop___kcrctab_gpl) = .; \ 93 VMLINUX_SYMBOL(__stop___kcrctab_gpl) = .; \
80 } \ 94 } \
81 \ 95 \
96 /* Kernel symbol table: Normal unused symbols */ \
97 __kcrctab_unused : AT(ADDR(__kcrctab_unused) - LOAD_OFFSET) { \
98 VMLINUX_SYMBOL(__start___kcrctab_unused) = .; \
99 *(__kcrctab_unused) \
100 VMLINUX_SYMBOL(__stop___kcrctab_unused) = .; \
101 } \
102 \
103 /* Kernel symbol table: GPL-only unused symbols */ \
104 __kcrctab_unused_gpl : AT(ADDR(__kcrctab_unused_gpl) - LOAD_OFFSET) { \
105 VMLINUX_SYMBOL(__start___kcrctab_unused_gpl) = .; \
106 *(__kcrctab_unused_gpl) \
107 VMLINUX_SYMBOL(__stop___kcrctab_unused_gpl) = .; \
108 } \
109 \
82 /* Kernel symbol table: GPL-future-only symbols */ \ 110 /* Kernel symbol table: GPL-future-only symbols */ \
83 __kcrctab_gpl_future : AT(ADDR(__kcrctab_gpl_future) - LOAD_OFFSET) { \ 111 __kcrctab_gpl_future : AT(ADDR(__kcrctab_gpl_future) - LOAD_OFFSET) { \
84 VMLINUX_SYMBOL(__start___kcrctab_gpl_future) = .; \ 112 VMLINUX_SYMBOL(__start___kcrctab_gpl_future) = .; \
diff --git a/include/asm-i386/cpu.h b/include/asm-i386/cpu.h
index e7252c216ca8..b1bc7b1b64b0 100644
--- a/include/asm-i386/cpu.h
+++ b/include/asm-i386/cpu.h
@@ -7,8 +7,6 @@
7#include <linux/nodemask.h> 7#include <linux/nodemask.h>
8#include <linux/percpu.h> 8#include <linux/percpu.h>
9 9
10#include <asm/node.h>
11
12struct i386_cpu { 10struct i386_cpu {
13 struct cpu cpu; 11 struct cpu cpu;
14}; 12};
diff --git a/include/asm-i386/elf.h b/include/asm-i386/elf.h
index 4153d80e4d2b..1eac92cb5b16 100644
--- a/include/asm-i386/elf.h
+++ b/include/asm-i386/elf.h
@@ -10,6 +10,7 @@
10#include <asm/processor.h> 10#include <asm/processor.h>
11#include <asm/system.h> /* for savesegment */ 11#include <asm/system.h> /* for savesegment */
12#include <asm/auxvec.h> 12#include <asm/auxvec.h>
13#include <asm/desc.h>
13 14
14#include <linux/utsname.h> 15#include <linux/utsname.h>
15 16
@@ -129,15 +130,41 @@ extern int dump_task_extended_fpu (struct task_struct *, struct user_fxsr_struct
129#define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs) 130#define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs)
130#define ELF_CORE_COPY_XFPREGS(tsk, elf_xfpregs) dump_task_extended_fpu(tsk, elf_xfpregs) 131#define ELF_CORE_COPY_XFPREGS(tsk, elf_xfpregs) dump_task_extended_fpu(tsk, elf_xfpregs)
131 132
132#define VSYSCALL_BASE (__fix_to_virt(FIX_VSYSCALL)) 133#define VDSO_HIGH_BASE (__fix_to_virt(FIX_VDSO))
133#define VSYSCALL_EHDR ((const struct elfhdr *) VSYSCALL_BASE) 134#define VDSO_BASE ((unsigned long)current->mm->context.vdso)
134#define VSYSCALL_ENTRY ((unsigned long) &__kernel_vsyscall) 135
136#ifdef CONFIG_COMPAT_VDSO
137# define VDSO_COMPAT_BASE VDSO_HIGH_BASE
138# define VDSO_PRELINK VDSO_HIGH_BASE
139#else
140# define VDSO_COMPAT_BASE VDSO_BASE
141# define VDSO_PRELINK 0
142#endif
143
144#define VDSO_COMPAT_SYM(x) \
145 (VDSO_COMPAT_BASE + (unsigned long)(x) - VDSO_PRELINK)
146
147#define VDSO_SYM(x) \
148 (VDSO_BASE + (unsigned long)(x) - VDSO_PRELINK)
149
150#define VDSO_HIGH_EHDR ((const struct elfhdr *) VDSO_HIGH_BASE)
151#define VDSO_EHDR ((const struct elfhdr *) VDSO_COMPAT_BASE)
152
135extern void __kernel_vsyscall; 153extern void __kernel_vsyscall;
136 154
155#define VDSO_ENTRY VDSO_SYM(&__kernel_vsyscall)
156
157#define ARCH_HAS_SETUP_ADDITIONAL_PAGES
158struct linux_binprm;
159extern int arch_setup_additional_pages(struct linux_binprm *bprm,
160 int executable_stack);
161
162extern unsigned int vdso_enabled;
163
137#define ARCH_DLINFO \ 164#define ARCH_DLINFO \
138do { \ 165do if (vdso_enabled) { \
139 NEW_AUX_ENT(AT_SYSINFO, VSYSCALL_ENTRY); \ 166 NEW_AUX_ENT(AT_SYSINFO, VDSO_ENTRY); \
140 NEW_AUX_ENT(AT_SYSINFO_EHDR, VSYSCALL_BASE); \ 167 NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_COMPAT_BASE); \
141} while (0) 168} while (0)
142 169
143/* 170/*
@@ -148,15 +175,15 @@ do { \
148 * Dumping its extra ELF program headers includes all the other information 175 * Dumping its extra ELF program headers includes all the other information
149 * a debugger needs to easily find how the vsyscall DSO was being used. 176 * a debugger needs to easily find how the vsyscall DSO was being used.
150 */ 177 */
151#define ELF_CORE_EXTRA_PHDRS (VSYSCALL_EHDR->e_phnum) 178#define ELF_CORE_EXTRA_PHDRS (VDSO_HIGH_EHDR->e_phnum)
152#define ELF_CORE_WRITE_EXTRA_PHDRS \ 179#define ELF_CORE_WRITE_EXTRA_PHDRS \
153do { \ 180do { \
154 const struct elf_phdr *const vsyscall_phdrs = \ 181 const struct elf_phdr *const vsyscall_phdrs = \
155 (const struct elf_phdr *) (VSYSCALL_BASE \ 182 (const struct elf_phdr *) (VDSO_HIGH_BASE \
156 + VSYSCALL_EHDR->e_phoff); \ 183 + VDSO_HIGH_EHDR->e_phoff); \
157 int i; \ 184 int i; \
158 Elf32_Off ofs = 0; \ 185 Elf32_Off ofs = 0; \
159 for (i = 0; i < VSYSCALL_EHDR->e_phnum; ++i) { \ 186 for (i = 0; i < VDSO_HIGH_EHDR->e_phnum; ++i) { \
160 struct elf_phdr phdr = vsyscall_phdrs[i]; \ 187 struct elf_phdr phdr = vsyscall_phdrs[i]; \
161 if (phdr.p_type == PT_LOAD) { \ 188 if (phdr.p_type == PT_LOAD) { \
162 BUG_ON(ofs != 0); \ 189 BUG_ON(ofs != 0); \
@@ -174,10 +201,10 @@ do { \
174#define ELF_CORE_WRITE_EXTRA_DATA \ 201#define ELF_CORE_WRITE_EXTRA_DATA \
175do { \ 202do { \
176 const struct elf_phdr *const vsyscall_phdrs = \ 203 const struct elf_phdr *const vsyscall_phdrs = \
177 (const struct elf_phdr *) (VSYSCALL_BASE \ 204 (const struct elf_phdr *) (VDSO_HIGH_BASE \
178 + VSYSCALL_EHDR->e_phoff); \ 205 + VDSO_HIGH_EHDR->e_phoff); \
179 int i; \ 206 int i; \
180 for (i = 0; i < VSYSCALL_EHDR->e_phnum; ++i) { \ 207 for (i = 0; i < VDSO_HIGH_EHDR->e_phnum; ++i) { \
181 if (vsyscall_phdrs[i].p_type == PT_LOAD) \ 208 if (vsyscall_phdrs[i].p_type == PT_LOAD) \
182 DUMP_WRITE((void *) vsyscall_phdrs[i].p_vaddr, \ 209 DUMP_WRITE((void *) vsyscall_phdrs[i].p_vaddr, \
183 PAGE_ALIGN(vsyscall_phdrs[i].p_memsz)); \ 210 PAGE_ALIGN(vsyscall_phdrs[i].p_memsz)); \
diff --git a/include/asm-i386/fixmap.h b/include/asm-i386/fixmap.h
index f7e068f4d2f9..a48cc3f7ccc6 100644
--- a/include/asm-i386/fixmap.h
+++ b/include/asm-i386/fixmap.h
@@ -51,7 +51,7 @@
51 */ 51 */
52enum fixed_addresses { 52enum fixed_addresses {
53 FIX_HOLE, 53 FIX_HOLE,
54 FIX_VSYSCALL, 54 FIX_VDSO,
55#ifdef CONFIG_X86_LOCAL_APIC 55#ifdef CONFIG_X86_LOCAL_APIC
56 FIX_APIC_BASE, /* local (CPU) APIC) -- required for SMP or not */ 56 FIX_APIC_BASE, /* local (CPU) APIC) -- required for SMP or not */
57#endif 57#endif
@@ -115,14 +115,6 @@ extern void __set_fixmap (enum fixed_addresses idx,
115#define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT)) 115#define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT))
116#define __virt_to_fix(x) ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT) 116#define __virt_to_fix(x) ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT)
117 117
118/*
119 * This is the range that is readable by user mode, and things
120 * acting like user mode such as get_user_pages.
121 */
122#define FIXADDR_USER_START (__fix_to_virt(FIX_VSYSCALL))
123#define FIXADDR_USER_END (FIXADDR_USER_START + PAGE_SIZE)
124
125
126extern void __this_fixmap_does_not_exist(void); 118extern void __this_fixmap_does_not_exist(void);
127 119
128/* 120/*
diff --git a/include/asm-i386/hw_irq.h b/include/asm-i386/hw_irq.h
index a4c0a5a9ffd8..87e5a351d881 100644
--- a/include/asm-i386/hw_irq.h
+++ b/include/asm-i386/hw_irq.h
@@ -69,14 +69,4 @@ extern atomic_t irq_mis_count;
69 69
70#define IO_APIC_IRQ(x) (((x) >= 16) || ((1<<(x)) & io_apic_irqs)) 70#define IO_APIC_IRQ(x) (((x) >= 16) || ((1<<(x)) & io_apic_irqs))
71 71
72#if defined(CONFIG_X86_IO_APIC)
73static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i)
74{
75 if (IO_APIC_IRQ(i))
76 send_IPI_self(IO_APIC_VECTOR(i));
77}
78#else
79static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {}
80#endif
81
82#endif /* _ASM_HW_IRQ_H */ 72#endif /* _ASM_HW_IRQ_H */
diff --git a/include/asm-i386/mach-visws/setup_arch.h b/include/asm-i386/mach-visws/setup_arch.h
index b92d6d9a4d3c..33f700ef6831 100644
--- a/include/asm-i386/mach-visws/setup_arch.h
+++ b/include/asm-i386/mach-visws/setup_arch.h
@@ -1,5 +1,8 @@
1/* Hook to call BIOS initialisation function */ 1/* Hook to call BIOS initialisation function */
2 2
3extern unsigned long sgivwfb_mem_phys;
4extern unsigned long sgivwfb_mem_size;
5
3/* no action for visws */ 6/* no action for visws */
4 7
5#define ARCH_SETUP 8#define ARCH_SETUP
diff --git a/include/asm-i386/mmu.h b/include/asm-i386/mmu.h
index f431a0b86d4c..8358dd3df7aa 100644
--- a/include/asm-i386/mmu.h
+++ b/include/asm-i386/mmu.h
@@ -12,6 +12,7 @@ typedef struct {
12 int size; 12 int size;
13 struct semaphore sem; 13 struct semaphore sem;
14 void *ldt; 14 void *ldt;
15 void *vdso;
15} mm_context_t; 16} mm_context_t;
16 17
17#endif 18#endif
diff --git a/include/asm-i386/node.h b/include/asm-i386/node.h
deleted file mode 100644
index e13c6ffa72ae..000000000000
--- a/include/asm-i386/node.h
+++ /dev/null
@@ -1,29 +0,0 @@
1#ifndef _ASM_I386_NODE_H_
2#define _ASM_I386_NODE_H_
3
4#include <linux/device.h>
5#include <linux/mmzone.h>
6#include <linux/node.h>
7#include <linux/topology.h>
8#include <linux/nodemask.h>
9
10struct i386_node {
11 struct node node;
12};
13extern struct i386_node node_devices[MAX_NUMNODES];
14
15static inline int arch_register_node(int num){
16 int p_node;
17 struct node *parent = NULL;
18
19 if (!node_online(num))
20 return 0;
21 p_node = parent_node(num);
22
23 if (p_node != num)
24 parent = &node_devices[p_node].node;
25
26 return register_node(&node_devices[num].node, num, parent);
27}
28
29#endif /* _ASM_I386_NODE_H_ */
diff --git a/include/asm-i386/page.h b/include/asm-i386/page.h
index e3a552fa5538..f5bf544c729a 100644
--- a/include/asm-i386/page.h
+++ b/include/asm-i386/page.h
@@ -96,6 +96,8 @@ typedef struct { unsigned long pgprot; } pgprot_t;
96 96
97#ifndef __ASSEMBLY__ 97#ifndef __ASSEMBLY__
98 98
99struct vm_area_struct;
100
99/* 101/*
100 * This much address space is reserved for vmalloc() and iomap() 102 * This much address space is reserved for vmalloc() and iomap()
101 * as well as fixmap mappings. 103 * as well as fixmap mappings.
@@ -139,6 +141,7 @@ extern int page_is_ram(unsigned long pagenr);
139#include <asm-generic/memory_model.h> 141#include <asm-generic/memory_model.h>
140#include <asm-generic/page.h> 142#include <asm-generic/page.h>
141 143
144#define __HAVE_ARCH_GATE_AREA 1
142#endif /* __KERNEL__ */ 145#endif /* __KERNEL__ */
143 146
144#endif /* _I386_PAGE_H */ 147#endif /* _I386_PAGE_H */
diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h
index 55ea992da329..b32346d62e10 100644
--- a/include/asm-i386/processor.h
+++ b/include/asm-i386/processor.h
@@ -71,8 +71,12 @@ struct cpuinfo_x86 {
71 cpumask_t llc_shared_map; /* cpus sharing the last level cache */ 71 cpumask_t llc_shared_map; /* cpus sharing the last level cache */
72#endif 72#endif
73 unsigned char x86_max_cores; /* cpuid returned max cores value */ 73 unsigned char x86_max_cores; /* cpuid returned max cores value */
74 unsigned char booted_cores; /* number of cores as seen by OS */
75 unsigned char apicid; 74 unsigned char apicid;
75#ifdef CONFIG_SMP
76 unsigned char booted_cores; /* number of cores as seen by OS */
77 __u8 phys_proc_id; /* Physical processor id. */
78 __u8 cpu_core_id; /* Core id */
79#endif
76} __attribute__((__aligned__(SMP_CACHE_BYTES))); 80} __attribute__((__aligned__(SMP_CACHE_BYTES)));
77 81
78#define X86_VENDOR_INTEL 0 82#define X86_VENDOR_INTEL 0
@@ -104,8 +108,6 @@ extern struct cpuinfo_x86 cpu_data[];
104#define current_cpu_data boot_cpu_data 108#define current_cpu_data boot_cpu_data
105#endif 109#endif
106 110
107extern int phys_proc_id[NR_CPUS];
108extern int cpu_core_id[NR_CPUS];
109extern int cpu_llc_id[NR_CPUS]; 111extern int cpu_llc_id[NR_CPUS];
110extern char ignore_fpu_irq; 112extern char ignore_fpu_irq;
111 113
diff --git a/include/asm-i386/thread_info.h b/include/asm-i386/thread_info.h
index fdbc7f422ea5..2833fa2c0dd0 100644
--- a/include/asm-i386/thread_info.h
+++ b/include/asm-i386/thread_info.h
@@ -37,6 +37,7 @@ struct thread_info {
37 0-0xBFFFFFFF for user-thead 37 0-0xBFFFFFFF for user-thead
38 0-0xFFFFFFFF for kernel-thread 38 0-0xFFFFFFFF for kernel-thread
39 */ 39 */
40 void *sysenter_return;
40 struct restart_block restart_block; 41 struct restart_block restart_block;
41 42
42 unsigned long previous_esp; /* ESP of the previous stack in case 43 unsigned long previous_esp; /* ESP of the previous stack in case
@@ -83,17 +84,15 @@ struct thread_info {
83#define init_stack (init_thread_union.stack) 84#define init_stack (init_thread_union.stack)
84 85
85 86
87/* how to get the current stack pointer from C */
88register unsigned long current_stack_pointer asm("esp") __attribute_used__;
89
86/* how to get the thread information struct from C */ 90/* how to get the thread information struct from C */
87static inline struct thread_info *current_thread_info(void) 91static inline struct thread_info *current_thread_info(void)
88{ 92{
89 struct thread_info *ti; 93 return (struct thread_info *)(current_stack_pointer & ~(THREAD_SIZE - 1));
90 __asm__("andl %%esp,%0; ":"=r" (ti) : "0" (~(THREAD_SIZE - 1)));
91 return ti;
92} 94}
93 95
94/* how to get the current stack pointer from C */
95register unsigned long current_stack_pointer asm("esp") __attribute_used__;
96
97/* thread information allocation */ 96/* thread information allocation */
98#ifdef CONFIG_DEBUG_STACK_USAGE 97#ifdef CONFIG_DEBUG_STACK_USAGE
99#define alloc_thread_info(tsk) \ 98#define alloc_thread_info(tsk) \
diff --git a/include/asm-i386/topology.h b/include/asm-i386/topology.h
index b94e5eeef917..6adbd9b1ae88 100644
--- a/include/asm-i386/topology.h
+++ b/include/asm-i386/topology.h
@@ -28,10 +28,8 @@
28#define _ASM_I386_TOPOLOGY_H 28#define _ASM_I386_TOPOLOGY_H
29 29
30#ifdef CONFIG_X86_HT 30#ifdef CONFIG_X86_HT
31#define topology_physical_package_id(cpu) \ 31#define topology_physical_package_id(cpu) (cpu_data[cpu].phys_proc_id)
32 (phys_proc_id[cpu] == BAD_APICID ? -1 : phys_proc_id[cpu]) 32#define topology_core_id(cpu) (cpu_data[cpu].cpu_core_id)
33#define topology_core_id(cpu) \
34 (cpu_core_id[cpu] == BAD_APICID ? 0 : cpu_core_id[cpu])
35#define topology_core_siblings(cpu) (cpu_core_map[cpu]) 33#define topology_core_siblings(cpu) (cpu_core_map[cpu])
36#define topology_thread_siblings(cpu) (cpu_sibling_map[cpu]) 34#define topology_thread_siblings(cpu) (cpu_sibling_map[cpu])
37#endif 35#endif
@@ -114,4 +112,9 @@ extern unsigned long node_remap_size[];
114 112
115extern cpumask_t cpu_coregroup_map(int cpu); 113extern cpumask_t cpu_coregroup_map(int cpu);
116 114
115#ifdef CONFIG_SMP
116#define mc_capable() (boot_cpu_data.x86_max_cores > 1)
117#define smt_capable() (smp_num_siblings > 1)
118#endif
119
117#endif /* _ASM_I386_TOPOLOGY_H */ 120#endif /* _ASM_I386_TOPOLOGY_H */
diff --git a/include/asm-i386/unwind.h b/include/asm-i386/unwind.h
index d480f2e38215..69f0f1df6722 100644
--- a/include/asm-i386/unwind.h
+++ b/include/asm-i386/unwind.h
@@ -78,8 +78,8 @@ static inline int arch_unw_user_mode(const struct unwind_frame_info *info)
78 return user_mode_vm(&info->regs); 78 return user_mode_vm(&info->regs);
79#else 79#else
80 return info->regs.eip < PAGE_OFFSET 80 return info->regs.eip < PAGE_OFFSET
81 || (info->regs.eip >= __fix_to_virt(FIX_VSYSCALL) 81 || (info->regs.eip >= __fix_to_virt(FIX_VDSO)
82 && info->regs.eip < __fix_to_virt(FIX_VSYSCALL) + PAGE_SIZE) 82 && info->regs.eip < __fix_to_virt(FIX_VDSO) + PAGE_SIZE)
83 || info->regs.esp < PAGE_OFFSET; 83 || info->regs.esp < PAGE_OFFSET;
84#endif 84#endif
85} 85}
diff --git a/include/asm-ia64/hw_irq.h b/include/asm-ia64/hw_irq.h
index ea8b8c407ab4..27f9df6b9145 100644
--- a/include/asm-ia64/hw_irq.h
+++ b/include/asm-ia64/hw_irq.h
@@ -97,8 +97,7 @@ extern int reserve_irq_vector (int vector);
97extern void ia64_send_ipi (int cpu, int vector, int delivery_mode, int redirect); 97extern void ia64_send_ipi (int cpu, int vector, int delivery_mode, int redirect);
98extern void register_percpu_irq (ia64_vector vec, struct irqaction *action); 98extern void register_percpu_irq (ia64_vector vec, struct irqaction *action);
99 99
100static inline void 100static inline void ia64_resend_irq(unsigned int vector)
101hw_resend_irq (struct hw_interrupt_type *h, unsigned int vector)
102{ 101{
103 platform_send_ipi(smp_processor_id(), vector, IA64_IPI_DM_INT, 0); 102 platform_send_ipi(smp_processor_id(), vector, IA64_IPI_DM_INT, 0);
104} 103}
diff --git a/include/asm-ia64/irq.h b/include/asm-ia64/irq.h
index dbe86c0bbce5..79479e2c6966 100644
--- a/include/asm-ia64/irq.h
+++ b/include/asm-ia64/irq.h
@@ -14,11 +14,6 @@
14#define NR_IRQS 256 14#define NR_IRQS 256
15#define NR_IRQ_VECTORS NR_IRQS 15#define NR_IRQ_VECTORS NR_IRQS
16 16
17/*
18 * IRQ line status macro IRQ_PER_CPU is used
19 */
20#define ARCH_HAS_IRQ_PER_CPU
21
22static __inline__ int 17static __inline__ int
23irq_canonicalize (int irq) 18irq_canonicalize (int irq)
24{ 19{
diff --git a/include/asm-ia64/nodedata.h b/include/asm-ia64/nodedata.h
index a140310bf84d..2fb337b0e9b7 100644
--- a/include/asm-ia64/nodedata.h
+++ b/include/asm-ia64/nodedata.h
@@ -46,6 +46,18 @@ struct ia64_node_data {
46 */ 46 */
47#define NODE_DATA(nid) (local_node_data->pg_data_ptrs[nid]) 47#define NODE_DATA(nid) (local_node_data->pg_data_ptrs[nid])
48 48
49/*
50 * LOCAL_DATA_ADDR - This is to calculate the address of other node's
51 * "local_node_data" at hot-plug phase. The local_node_data
52 * is pointed by per_cpu_page. Kernel usually use it for
53 * just executing cpu. However, when new node is hot-added,
54 * the addresses of local data for other nodes are necessary
55 * to update all of them.
56 */
57#define LOCAL_DATA_ADDR(pgdat) \
58 ((struct ia64_node_data *)((u64)(pgdat) + \
59 L1_CACHE_ALIGN(sizeof(struct pglist_data))))
60
49#endif /* CONFIG_NUMA */ 61#endif /* CONFIG_NUMA */
50 62
51#endif /* _ASM_IA64_NODEDATA_H */ 63#endif /* _ASM_IA64_NODEDATA_H */
diff --git a/include/asm-ia64/sn/sn_sal.h b/include/asm-ia64/sn/sn_sal.h
index cd490b20d592..bd4452bda357 100644
--- a/include/asm-ia64/sn/sn_sal.h
+++ b/include/asm-ia64/sn/sn_sal.h
@@ -85,6 +85,7 @@
85#define SN_SAL_GET_PROM_FEATURE_SET 0x02000065 85#define SN_SAL_GET_PROM_FEATURE_SET 0x02000065
86#define SN_SAL_SET_OS_FEATURE_SET 0x02000066 86#define SN_SAL_SET_OS_FEATURE_SET 0x02000066
87#define SN_SAL_INJECT_ERROR 0x02000067 87#define SN_SAL_INJECT_ERROR 0x02000067
88#define SN_SAL_SET_CPU_NUMBER 0x02000068
88 89
89/* 90/*
90 * Service-specific constants 91 * Service-specific constants
@@ -1150,4 +1151,13 @@ sn_inject_error(u64 paddr, u64 *data, u64 *ecc)
1150 local_irq_restore(irq_flags); 1151 local_irq_restore(irq_flags);
1151 return ret_stuff.status; 1152 return ret_stuff.status;
1152} 1153}
1154
1155static inline int
1156ia64_sn_set_cpu_number(int cpu)
1157{
1158 struct ia64_sal_retval rv;
1159
1160 SAL_CALL_NOLOCK(rv, SN_SAL_SET_CPU_NUMBER, cpu, 0, 0, 0, 0, 0, 0);
1161 return rv.status;
1162}
1153#endif /* _ASM_IA64_SN_SN_SAL_H */ 1163#endif /* _ASM_IA64_SN_SN_SAL_H */
diff --git a/include/asm-ia64/topology.h b/include/asm-ia64/topology.h
index 616b5ed2aa72..937c21257523 100644
--- a/include/asm-ia64/topology.h
+++ b/include/asm-ia64/topology.h
@@ -112,6 +112,7 @@ void build_cpu_to_node_map(void);
112#define topology_core_id(cpu) (cpu_data(cpu)->core_id) 112#define topology_core_id(cpu) (cpu_data(cpu)->core_id)
113#define topology_core_siblings(cpu) (cpu_core_map[cpu]) 113#define topology_core_siblings(cpu) (cpu_core_map[cpu])
114#define topology_thread_siblings(cpu) (cpu_sibling_map[cpu]) 114#define topology_thread_siblings(cpu) (cpu_sibling_map[cpu])
115#define smt_capable() (smp_num_siblings > 1)
115#endif 116#endif
116 117
117#include <asm-generic/topology.h> 118#include <asm-generic/topology.h>
diff --git a/include/asm-m32r/hw_irq.h b/include/asm-m32r/hw_irq.h
index 8d7e9d0e09e8..7138537cda03 100644
--- a/include/asm-m32r/hw_irq.h
+++ b/include/asm-m32r/hw_irq.h
@@ -1,9 +1,4 @@
1#ifndef _ASM_M32R_HW_IRQ_H 1#ifndef _ASM_M32R_HW_IRQ_H
2#define _ASM_M32R_HW_IRQ_H 2#define _ASM_M32R_HW_IRQ_H
3 3
4static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i)
5{
6 /* Nothing to do */
7}
8
9#endif /* _ASM_M32R_HW_IRQ_H */ 4#endif /* _ASM_M32R_HW_IRQ_H */
diff --git a/include/asm-m68knommu/bootstd.h b/include/asm-m68knommu/bootstd.h
index 3fdc79f06d50..bdc1a4ac4fe9 100644
--- a/include/asm-m68knommu/bootstd.h
+++ b/include/asm-m68knommu/bootstd.h
@@ -52,7 +52,7 @@ type name(void) \
52 __asm__ __volatile__ ("trap #2" \ 52 __asm__ __volatile__ ("trap #2" \
53 : "=g" (__res) \ 53 : "=g" (__res) \
54 : "0" (__res) \ 54 : "0" (__res) \
55 : "%d0"); \ 55 ); \
56 __bsc_return(type,__res); \ 56 __bsc_return(type,__res); \
57} 57}
58 58
@@ -64,7 +64,7 @@ type name(atype a) \
64 __asm__ __volatile__ ("trap #2" \ 64 __asm__ __volatile__ ("trap #2" \
65 : "=g" (__res) \ 65 : "=g" (__res) \
66 : "0" (__res), "d" (__a) \ 66 : "0" (__res), "d" (__a) \
67 : "%d0"); \ 67 ); \
68 __bsc_return(type,__res); \ 68 __bsc_return(type,__res); \
69} 69}
70 70
@@ -77,7 +77,7 @@ type name(atype a, btype b) \
77 __asm__ __volatile__ ("trap #2" \ 77 __asm__ __volatile__ ("trap #2" \
78 : "=g" (__res) \ 78 : "=g" (__res) \
79 : "0" (__res), "d" (__a), "d" (__b) \ 79 : "0" (__res), "d" (__a), "d" (__b) \
80 : "%d0"); \ 80 ); \
81 __bsc_return(type,__res); \ 81 __bsc_return(type,__res); \
82} 82}
83 83
@@ -92,7 +92,7 @@ type name(atype a, btype b, ctype c) \
92 : "=g" (__res) \ 92 : "=g" (__res) \
93 : "0" (__res), "d" (__a), "d" (__b), \ 93 : "0" (__res), "d" (__a), "d" (__b), \
94 "d" (__c) \ 94 "d" (__c) \
95 : "%d0"); \ 95 ); \
96 __bsc_return(type,__res); \ 96 __bsc_return(type,__res); \
97} 97}
98 98
@@ -108,7 +108,7 @@ type name(atype a, btype b, ctype c, dtype d) \
108 : "=g" (__res) \ 108 : "=g" (__res) \
109 : "0" (__res), "d" (__a), "d" (__b), \ 109 : "0" (__res), "d" (__a), "d" (__b), \
110 "d" (__c), "d" (__d) \ 110 "d" (__c), "d" (__d) \
111 : "%d0"); \ 111 ); \
112 __bsc_return(type,__res); \ 112 __bsc_return(type,__res); \
113} 113}
114 114
@@ -125,7 +125,7 @@ type name(atype a, btype b, ctype c, dtype d, etype e) \
125 : "=g" (__res) \ 125 : "=g" (__res) \
126 : "0" (__res), "d" (__a), "d" (__b), \ 126 : "0" (__res), "d" (__a), "d" (__b), \
127 "d" (__c), "d" (__d), "d" (__e) \ 127 "d" (__c), "d" (__d), "d" (__e) \
128 : "%d0"); \ 128 ); \
129 __bsc_return(type,__res); \ 129 __bsc_return(type,__res); \
130} 130}
131 131
diff --git a/include/asm-m68knommu/ptrace.h b/include/asm-m68knommu/ptrace.h
index 1e19c457de7d..47258e86e8c4 100644
--- a/include/asm-m68knommu/ptrace.h
+++ b/include/asm-m68knommu/ptrace.h
@@ -46,11 +46,9 @@ struct pt_regs {
46#else 46#else
47 unsigned short sr; 47 unsigned short sr;
48 unsigned long pc; 48 unsigned long pc;
49#ifndef NO_FORMAT_VEC
50 unsigned format : 4; /* frame format specifier */ 49 unsigned format : 4; /* frame format specifier */
51 unsigned vector : 12; /* vector offset */ 50 unsigned vector : 12; /* vector offset */
52#endif 51#endif
53#endif
54}; 52};
55 53
56/* 54/*
diff --git a/include/asm-mips/hw_irq.h b/include/asm-mips/hw_irq.h
index c854d017c0e5..458d9fdc76bf 100644
--- a/include/asm-mips/hw_irq.h
+++ b/include/asm-mips/hw_irq.h
@@ -19,9 +19,9 @@ extern void init_8259A(int aeoi);
19 19
20extern atomic_t irq_err_count; 20extern atomic_t irq_err_count;
21 21
22/* This may not be apropriate for all machines, we'll see ... */ 22/*
23static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) 23 * interrupt-retrigger: NOP for now. This may not be apropriate for all
24{ 24 * machines, we'll see ...
25} 25 */
26 26
27#endif /* __ASM_HW_IRQ_H */ 27#endif /* __ASM_HW_IRQ_H */
diff --git a/include/asm-mips/mach-mips/irq.h b/include/asm-mips/mach-mips/irq.h
index 083d9c512a04..e994b0c01227 100644
--- a/include/asm-mips/mach-mips/irq.h
+++ b/include/asm-mips/mach-mips/irq.h
@@ -4,10 +4,4 @@
4 4
5#define NR_IRQS 256 5#define NR_IRQS 256
6 6
7#ifdef CONFIG_SMP
8
9#define ARCH_HAS_IRQ_PER_CPU
10
11#endif
12
13#endif /* __ASM_MACH_MIPS_IRQ_H */ 7#endif /* __ASM_MACH_MIPS_IRQ_H */
diff --git a/include/asm-parisc/hw_irq.h b/include/asm-parisc/hw_irq.h
index 151426e27521..6707f7df3921 100644
--- a/include/asm-parisc/hw_irq.h
+++ b/include/asm-parisc/hw_irq.h
@@ -3,15 +3,6 @@
3 3
4/* 4/*
5 * linux/include/asm/hw_irq.h 5 * linux/include/asm/hw_irq.h
6 *
7 * (C) 1992, 1993 Linus Torvalds, (C) 1997 Ingo Molnar
8 *
9 * moved some of the old arch/i386/kernel/irq.h to here. VY
10 *
11 * IRQ/IPI changes taken from work by Thomas Radke
12 * <tomsoft@informatik.tu-chemnitz.de>
13 */ 6 */
14 7
15extern void hw_resend_irq(struct hw_interrupt_type *, unsigned int);
16
17#endif 8#endif
diff --git a/include/asm-parisc/irq.h b/include/asm-parisc/irq.h
index 377ba90c7d02..5cae260615a2 100644
--- a/include/asm-parisc/irq.h
+++ b/include/asm-parisc/irq.h
@@ -26,11 +26,6 @@
26 26
27#define NR_IRQS (CPU_IRQ_MAX + 1) 27#define NR_IRQS (CPU_IRQ_MAX + 1)
28 28
29/*
30 * IRQ line status macro IRQ_PER_CPU is used
31 */
32#define ARCH_HAS_IRQ_PER_CPU
33
34static __inline__ int irq_canonicalize(int irq) 29static __inline__ int irq_canonicalize(int irq)
35{ 30{
36 return (irq == 2) ? 9 : irq; 31 return (irq == 2) ? 9 : irq;
diff --git a/include/asm-powerpc/hw_irq.h b/include/asm-powerpc/hw_irq.h
index ce0f7db63c16..d40359204aba 100644
--- a/include/asm-powerpc/hw_irq.h
+++ b/include/asm-powerpc/hw_irq.h
@@ -86,27 +86,27 @@ static inline void local_irq_save_ptr(unsigned long *flags)
86#define mask_irq(irq) \ 86#define mask_irq(irq) \
87 ({ \ 87 ({ \
88 irq_desc_t *desc = get_irq_desc(irq); \ 88 irq_desc_t *desc = get_irq_desc(irq); \
89 if (desc->handler && desc->handler->disable) \ 89 if (desc->chip && desc->chip->disable) \
90 desc->handler->disable(irq); \ 90 desc->chip->disable(irq); \
91 }) 91 })
92#define unmask_irq(irq) \ 92#define unmask_irq(irq) \
93 ({ \ 93 ({ \
94 irq_desc_t *desc = get_irq_desc(irq); \ 94 irq_desc_t *desc = get_irq_desc(irq); \
95 if (desc->handler && desc->handler->enable) \ 95 if (desc->chip && desc->chip->enable) \
96 desc->handler->enable(irq); \ 96 desc->chip->enable(irq); \
97 }) 97 })
98#define ack_irq(irq) \ 98#define ack_irq(irq) \
99 ({ \ 99 ({ \
100 irq_desc_t *desc = get_irq_desc(irq); \ 100 irq_desc_t *desc = get_irq_desc(irq); \
101 if (desc->handler && desc->handler->ack) \ 101 if (desc->chip && desc->chip->ack) \
102 desc->handler->ack(irq); \ 102 desc->chip->ack(irq); \
103 }) 103 })
104 104
105/* Should we handle this via lost interrupts and IPIs or should we don't care like 105/*
106 * we do now ? --BenH. 106 * interrupt-retrigger: should we handle this via lost interrupts and IPIs
107 * or should we not care like we do now ? --BenH.
107 */ 108 */
108struct hw_interrupt_type; 109struct hw_interrupt_type;
109static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {}
110 110
111#endif /* __KERNEL__ */ 111#endif /* __KERNEL__ */
112#endif /* _ASM_POWERPC_HW_IRQ_H */ 112#endif /* _ASM_POWERPC_HW_IRQ_H */
diff --git a/include/asm-powerpc/irq.h b/include/asm-powerpc/irq.h
index a10feec29d4d..eb5f33e1977a 100644
--- a/include/asm-powerpc/irq.h
+++ b/include/asm-powerpc/irq.h
@@ -30,11 +30,6 @@
30#define IRQ_POLARITY_POSITIVE 0x2 /* high level or low->high edge */ 30#define IRQ_POLARITY_POSITIVE 0x2 /* high level or low->high edge */
31#define IRQ_POLARITY_NEGATIVE 0x0 /* low level or high->low edge */ 31#define IRQ_POLARITY_NEGATIVE 0x0 /* low level or high->low edge */
32 32
33/*
34 * IRQ line status macro IRQ_PER_CPU is used
35 */
36#define ARCH_HAS_IRQ_PER_CPU
37
38#define get_irq_desc(irq) (&irq_desc[(irq)]) 33#define get_irq_desc(irq) (&irq_desc[(irq)])
39 34
40/* Define a way to iterate across irqs. */ 35/* Define a way to iterate across irqs. */
diff --git a/include/asm-powerpc/topology.h b/include/asm-powerpc/topology.h
index 92f3e5507d22..bbc3844b086f 100644
--- a/include/asm-powerpc/topology.h
+++ b/include/asm-powerpc/topology.h
@@ -93,5 +93,10 @@ static inline void sysfs_remove_device_from_node(struct sys_device *dev,
93 93
94#endif /* CONFIG_NUMA */ 94#endif /* CONFIG_NUMA */
95 95
96#ifdef CONFIG_SMP
97#include <asm/cputable.h>
98#define smt_capable() (cpu_has_feature(CPU_FTR_SMT))
99#endif
100
96#endif /* __KERNEL__ */ 101#endif /* __KERNEL__ */
97#endif /* _ASM_POWERPC_TOPOLOGY_H */ 102#endif /* _ASM_POWERPC_TOPOLOGY_H */
diff --git a/include/asm-sh/hw_irq.h b/include/asm-sh/hw_irq.h
index 1d934fb2c581..fed26616967a 100644
--- a/include/asm-sh/hw_irq.h
+++ b/include/asm-sh/hw_irq.h
@@ -1,9 +1,4 @@
1#ifndef __ASM_SH_HW_IRQ_H 1#ifndef __ASM_SH_HW_IRQ_H
2#define __ASM_SH_HW_IRQ_H 2#define __ASM_SH_HW_IRQ_H
3 3
4static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i)
5{
6 /* Nothing to do */
7}
8
9#endif /* __ASM_SH_HW_IRQ_H */ 4#endif /* __ASM_SH_HW_IRQ_H */
diff --git a/include/asm-sh64/hw_irq.h b/include/asm-sh64/hw_irq.h
index ae718d1f2d6c..ebb39089b0ac 100644
--- a/include/asm-sh64/hw_irq.h
+++ b/include/asm-sh64/hw_irq.h
@@ -11,6 +11,5 @@
11 * Copyright (C) 2000, 2001 Paolo Alberelli 11 * Copyright (C) 2000, 2001 Paolo Alberelli
12 * 12 *
13 */ 13 */
14static __inline__ void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) { /* Nothing to do */ }
15 14
16#endif /* __ASM_SH64_HW_IRQ_H */ 15#endif /* __ASM_SH64_HW_IRQ_H */
diff --git a/include/asm-sparc64/topology.h b/include/asm-sparc64/topology.h
index 0e234e201bd6..98a6c613589d 100644
--- a/include/asm-sparc64/topology.h
+++ b/include/asm-sparc64/topology.h
@@ -1,6 +1,9 @@
1#ifndef _ASM_SPARC64_TOPOLOGY_H 1#ifndef _ASM_SPARC64_TOPOLOGY_H
2#define _ASM_SPARC64_TOPOLOGY_H 2#define _ASM_SPARC64_TOPOLOGY_H
3 3
4#include <asm/spitfire.h>
5#define smt_capable() (tlb_type == hypervisor)
6
4#include <asm-generic/topology.h> 7#include <asm-generic/topology.h>
5 8
6#endif /* _ASM_SPARC64_TOPOLOGY_H */ 9#endif /* _ASM_SPARC64_TOPOLOGY_H */
diff --git a/include/asm-um/hw_irq.h b/include/asm-um/hw_irq.h
index 4ee38c0b6a64..1cf84cf5f21a 100644
--- a/include/asm-um/hw_irq.h
+++ b/include/asm-um/hw_irq.h
@@ -4,7 +4,4 @@
4#include "asm/irq.h" 4#include "asm/irq.h"
5#include "asm/archparam.h" 5#include "asm/archparam.h"
6 6
7static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i)
8{}
9
10#endif 7#endif
diff --git a/include/asm-v850/hw_irq.h b/include/asm-v850/hw_irq.h
index a8aab4342712..043e94bb6bd8 100644
--- a/include/asm-v850/hw_irq.h
+++ b/include/asm-v850/hw_irq.h
@@ -1,8 +1,4 @@
1#ifndef __V850_HW_IRQ_H__ 1#ifndef __V850_HW_IRQ_H__
2#define __V850_HW_IRQ_H__ 2#define __V850_HW_IRQ_H__
3 3
4static inline void hw_resend_irq (struct hw_interrupt_type *h, unsigned int i)
5{
6}
7
8#endif /* __V850_HW_IRQ_H__ */ 4#endif /* __V850_HW_IRQ_H__ */
diff --git a/include/asm-x86_64/hw_irq.h b/include/asm-x86_64/hw_irq.h
index 1b2ac55d3204..48a4a5364e85 100644
--- a/include/asm-x86_64/hw_irq.h
+++ b/include/asm-x86_64/hw_irq.h
@@ -124,18 +124,9 @@ asmlinkage void IRQ_NAME(nr); \
124__asm__( \ 124__asm__( \
125"\n.p2align\n" \ 125"\n.p2align\n" \
126"IRQ" #nr "_interrupt:\n\t" \ 126"IRQ" #nr "_interrupt:\n\t" \
127 "push $" #nr "-256 ; " \ 127 "push $~(" #nr ") ; " \
128 "jmp common_interrupt"); 128 "jmp common_interrupt");
129 129
130#if defined(CONFIG_X86_IO_APIC)
131static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {
132 if (IO_APIC_IRQ(i))
133 send_IPI_self(IO_APIC_VECTOR(i));
134}
135#else
136static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {}
137#endif
138
139#define platform_legacy_irq(irq) ((irq) < 16) 130#define platform_legacy_irq(irq) ((irq) < 16)
140 131
141#endif 132#endif
diff --git a/include/asm-x86_64/topology.h b/include/asm-x86_64/topology.h
index c4e46e7fa7ba..6e7a2e976b04 100644
--- a/include/asm-x86_64/topology.h
+++ b/include/asm-x86_64/topology.h
@@ -59,6 +59,8 @@ extern int __node_distance(int, int);
59#define topology_core_id(cpu) (cpu_data[cpu].cpu_core_id) 59#define topology_core_id(cpu) (cpu_data[cpu].cpu_core_id)
60#define topology_core_siblings(cpu) (cpu_core_map[cpu]) 60#define topology_core_siblings(cpu) (cpu_core_map[cpu])
61#define topology_thread_siblings(cpu) (cpu_sibling_map[cpu]) 61#define topology_thread_siblings(cpu) (cpu_sibling_map[cpu])
62#define mc_capable() (boot_cpu_data.x86_max_cores > 1)
63#define smt_capable() (smp_num_siblings > 1)
62#endif 64#endif
63 65
64#include <asm-generic/topology.h> 66#include <asm-generic/topology.h>
diff --git a/include/asm-xtensa/hw_irq.h b/include/asm-xtensa/hw_irq.h
index ccf436249eaa..3ddbea759b2b 100644
--- a/include/asm-xtensa/hw_irq.h
+++ b/include/asm-xtensa/hw_irq.h
@@ -11,8 +11,4 @@
11#ifndef _XTENSA_HW_IRQ_H 11#ifndef _XTENSA_HW_IRQ_H
12#define _XTENSA_HW_IRQ_H 12#define _XTENSA_HW_IRQ_H
13 13
14static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i)
15{
16}
17
18#endif 14#endif
diff --git a/include/linux/ac97_codec.h b/include/linux/ac97_codec.h
index c35833824e11..2ed2fd855133 100644
--- a/include/linux/ac97_codec.h
+++ b/include/linux/ac97_codec.h
@@ -259,7 +259,7 @@ struct ac97_codec {
259 int type; 259 int type;
260 u32 model; 260 u32 model;
261 261
262 int modem:1; 262 unsigned int modem:1;
263 263
264 struct ac97_ops *codec_ops; 264 struct ac97_ops *codec_ops;
265 265
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 90d6df1551ed..88b5dfd8ee12 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -528,12 +528,18 @@ static inline void acpi_set_cstate_limit(unsigned int new_limit) { return; }
528 528
529#ifdef CONFIG_ACPI_NUMA 529#ifdef CONFIG_ACPI_NUMA
530int acpi_get_pxm(acpi_handle handle); 530int acpi_get_pxm(acpi_handle handle);
531int acpi_get_node(acpi_handle *handle);
531#else 532#else
532static inline int acpi_get_pxm(acpi_handle handle) 533static inline int acpi_get_pxm(acpi_handle handle)
533{ 534{
534 return 0; 535 return 0;
535} 536}
537static inline int acpi_get_node(acpi_handle *handle)
538{
539 return 0;
540}
536#endif 541#endif
542extern int acpi_paddr_to_node(u64 start_addr, u64 size);
537 543
538extern int pnpacpi_disabled; 544extern int pnpacpi_disabled;
539 545
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index fb7e9b7ccbe3..737e407d0cd1 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -149,7 +149,6 @@ void create_empty_buffers(struct page *, unsigned long,
149 unsigned long b_state); 149 unsigned long b_state);
150void end_buffer_read_sync(struct buffer_head *bh, int uptodate); 150void end_buffer_read_sync(struct buffer_head *bh, int uptodate);
151void end_buffer_write_sync(struct buffer_head *bh, int uptodate); 151void end_buffer_write_sync(struct buffer_head *bh, int uptodate);
152void end_buffer_async_write(struct buffer_head *bh, int uptodate);
153 152
154/* Things to do with buffers at mapping->private_list */ 153/* Things to do with buffers at mapping->private_list */
155void mark_buffer_dirty_inode(struct buffer_head *bh, struct inode *inode); 154void mark_buffer_dirty_inode(struct buffer_head *bh, struct inode *inode);
@@ -214,6 +213,7 @@ int nobh_truncate_page(struct address_space *, loff_t);
214int nobh_writepage(struct page *page, get_block_t *get_block, 213int nobh_writepage(struct page *page, get_block_t *get_block,
215 struct writeback_control *wbc); 214 struct writeback_control *wbc);
216 215
216void buffer_init(void);
217 217
218/* 218/*
219 * inline definitions 219 * inline definitions
diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h
index 7b5c5df5cb69..be512cc98791 100644
--- a/include/linux/coda_linux.h
+++ b/include/linux/coda_linux.h
@@ -27,8 +27,8 @@ extern struct inode_operations coda_dir_inode_operations;
27extern struct inode_operations coda_file_inode_operations; 27extern struct inode_operations coda_file_inode_operations;
28extern struct inode_operations coda_ioctl_inode_operations; 28extern struct inode_operations coda_ioctl_inode_operations;
29 29
30extern struct address_space_operations coda_file_aops; 30extern const struct address_space_operations coda_file_aops;
31extern struct address_space_operations coda_symlink_aops; 31extern const struct address_space_operations coda_symlink_aops;
32 32
33extern const struct file_operations coda_dir_operations; 33extern const struct file_operations coda_dir_operations;
34extern const struct file_operations coda_file_operations; 34extern const struct file_operations coda_file_operations;
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 08d50c53aab4..a3caf6866bae 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -31,17 +31,23 @@ struct cpu {
31 struct sys_device sysdev; 31 struct sys_device sysdev;
32}; 32};
33 33
34extern int register_cpu(struct cpu *, int, struct node *); 34extern int register_cpu(struct cpu *cpu, int num);
35extern struct sys_device *get_cpu_sysdev(unsigned cpu); 35extern struct sys_device *get_cpu_sysdev(unsigned cpu);
36#ifdef CONFIG_HOTPLUG_CPU 36#ifdef CONFIG_HOTPLUG_CPU
37extern void unregister_cpu(struct cpu *, struct node *); 37extern void unregister_cpu(struct cpu *cpu);
38#endif 38#endif
39struct notifier_block; 39struct notifier_block;
40 40
41#ifdef CONFIG_SMP 41#ifdef CONFIG_SMP
42/* Need to know about CPUs going up/down? */ 42/* Need to know about CPUs going up/down? */
43extern int register_cpu_notifier(struct notifier_block *nb); 43extern int register_cpu_notifier(struct notifier_block *nb);
44#ifdef CONFIG_HOTPLUG_CPU
44extern void unregister_cpu_notifier(struct notifier_block *nb); 45extern void unregister_cpu_notifier(struct notifier_block *nb);
46#else
47static inline void unregister_cpu_notifier(struct notifier_block *nb)
48{
49}
50#endif
45extern int current_in_cpu_hotplug(void); 51extern int current_in_cpu_hotplug(void);
46 52
47int cpu_up(unsigned int cpu); 53int cpu_up(unsigned int cpu);
@@ -73,6 +79,8 @@ extern int lock_cpu_hotplug_interruptible(void);
73 { .notifier_call = fn, .priority = pri }; \ 79 { .notifier_call = fn, .priority = pri }; \
74 register_cpu_notifier(&fn##_nb); \ 80 register_cpu_notifier(&fn##_nb); \
75} 81}
82#define register_hotcpu_notifier(nb) register_cpu_notifier(nb)
83#define unregister_hotcpu_notifier(nb) unregister_cpu_notifier(nb)
76int cpu_down(unsigned int cpu); 84int cpu_down(unsigned int cpu);
77#define cpu_is_offline(cpu) unlikely(!cpu_online(cpu)) 85#define cpu_is_offline(cpu) unlikely(!cpu_online(cpu))
78#else 86#else
@@ -80,6 +88,8 @@ int cpu_down(unsigned int cpu);
80#define unlock_cpu_hotplug() do { } while (0) 88#define unlock_cpu_hotplug() do { } while (0)
81#define lock_cpu_hotplug_interruptible() 0 89#define lock_cpu_hotplug_interruptible() 0
82#define hotcpu_notifier(fn, pri) 90#define hotcpu_notifier(fn, pri)
91#define register_hotcpu_notifier(nb)
92#define unregister_hotcpu_notifier(nb)
83 93
84/* CPUs don't go offline once they're online w/o CONFIG_HOTPLUG_CPU */ 94/* CPUs don't go offline once they're online w/o CONFIG_HOTPLUG_CPU */
85static inline int cpu_is_offline(int cpu) { return 0; } 95static inline int cpu_is_offline(int cpu) { return 0; }
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 78b236ca04f8..272010a6078a 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -20,7 +20,7 @@
20 */ 20 */
21#ifndef DMAENGINE_H 21#ifndef DMAENGINE_H
22#define DMAENGINE_H 22#define DMAENGINE_H
23#include <linux/config.h> 23
24#ifdef CONFIG_DMA_ENGINE 24#ifdef CONFIG_DMA_ENGINE
25 25
26#include <linux/device.h> 26#include <linux/device.h>
diff --git a/include/linux/efs_fs.h b/include/linux/efs_fs.h
index fbfa6b52e2fb..278ef4495819 100644
--- a/include/linux/efs_fs.h
+++ b/include/linux/efs_fs.h
@@ -38,7 +38,7 @@ struct statfs;
38 38
39extern struct inode_operations efs_dir_inode_operations; 39extern struct inode_operations efs_dir_inode_operations;
40extern const struct file_operations efs_dir_operations; 40extern const struct file_operations efs_dir_operations;
41extern struct address_space_operations efs_symlink_aops; 41extern const struct address_space_operations efs_symlink_aops;
42 42
43extern void efs_read_inode(struct inode *); 43extern void efs_read_inode(struct inode *);
44extern efs_block_t efs_map_block(struct inode *, efs_block_t); 44extern efs_block_t efs_map_block(struct inode *, efs_block_t);
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 2d8b348c1192..e04a5cfe874f 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -392,7 +392,7 @@ struct address_space {
392 unsigned int truncate_count; /* Cover race condition with truncate */ 392 unsigned int truncate_count; /* Cover race condition with truncate */
393 unsigned long nrpages; /* number of total pages */ 393 unsigned long nrpages; /* number of total pages */
394 pgoff_t writeback_index;/* writeback starts here */ 394 pgoff_t writeback_index;/* writeback starts here */
395 struct address_space_operations *a_ops; /* methods */ 395 const struct address_space_operations *a_ops; /* methods */
396 unsigned long flags; /* error bits/gfp mask */ 396 unsigned long flags; /* error bits/gfp mask */
397 struct backing_dev_info *backing_dev_info; /* device readahead, etc */ 397 struct backing_dev_info *backing_dev_info; /* device readahead, etc */
398 spinlock_t private_lock; /* for use by the address_space */ 398 spinlock_t private_lock; /* for use by the address_space */
@@ -1405,7 +1405,7 @@ extern void bd_forget(struct inode *inode);
1405extern void bdput(struct block_device *); 1405extern void bdput(struct block_device *);
1406extern struct block_device *open_by_devnum(dev_t, unsigned); 1406extern struct block_device *open_by_devnum(dev_t, unsigned);
1407extern const struct file_operations def_blk_fops; 1407extern const struct file_operations def_blk_fops;
1408extern struct address_space_operations def_blk_aops; 1408extern const struct address_space_operations def_blk_aops;
1409extern const struct file_operations def_chr_fops; 1409extern const struct file_operations def_chr_fops;
1410extern const struct file_operations bad_sock_fops; 1410extern const struct file_operations bad_sock_fops;
1411extern const struct file_operations def_fifo_fops; 1411extern const struct file_operations def_fifo_fops;
diff --git a/include/linux/futex.h b/include/linux/futex.h
index 966a5b3da439..34c3a215f2cd 100644
--- a/include/linux/futex.h
+++ b/include/linux/futex.h
@@ -12,6 +12,9 @@
12#define FUTEX_REQUEUE 3 12#define FUTEX_REQUEUE 3
13#define FUTEX_CMP_REQUEUE 4 13#define FUTEX_CMP_REQUEUE 4
14#define FUTEX_WAKE_OP 5 14#define FUTEX_WAKE_OP 5
15#define FUTEX_LOCK_PI 6
16#define FUTEX_UNLOCK_PI 7
17#define FUTEX_TRYLOCK_PI 8
15 18
16/* 19/*
17 * Support for robust futexes: the kernel cleans up held futexes at 20 * Support for robust futexes: the kernel cleans up held futexes at
@@ -90,18 +93,21 @@ struct robust_list_head {
90 */ 93 */
91#define ROBUST_LIST_LIMIT 2048 94#define ROBUST_LIST_LIMIT 2048
92 95
93long do_futex(unsigned long uaddr, int op, int val, 96long do_futex(u32 __user *uaddr, int op, u32 val, unsigned long timeout,
94 unsigned long timeout, unsigned long uaddr2, int val2, 97 u32 __user *uaddr2, u32 val2, u32 val3);
95 int val3);
96 98
97extern int handle_futex_death(u32 __user *uaddr, struct task_struct *curr); 99extern int handle_futex_death(u32 __user *uaddr, struct task_struct *curr);
98 100
99#ifdef CONFIG_FUTEX 101#ifdef CONFIG_FUTEX
100extern void exit_robust_list(struct task_struct *curr); 102extern void exit_robust_list(struct task_struct *curr);
103extern void exit_pi_state_list(struct task_struct *curr);
101#else 104#else
102static inline void exit_robust_list(struct task_struct *curr) 105static inline void exit_robust_list(struct task_struct *curr)
103{ 106{
104} 107}
108static inline void exit_pi_state_list(struct task_struct *curr)
109{
110}
105#endif 111#endif
106 112
107#define FUTEX_OP_SET 0 /* *(int *)UADDR2 = OPARG; */ 113#define FUTEX_OP_SET 0 /* *(int *)UADDR2 = OPARG; */
diff --git a/include/linux/ide.h b/include/linux/ide.h
index ef7bef207f48..0c100168c0cf 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -793,6 +793,7 @@ typedef struct hwif_s {
793 unsigned auto_poll : 1; /* supports nop auto-poll */ 793 unsigned auto_poll : 1; /* supports nop auto-poll */
794 unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */ 794 unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */
795 unsigned no_io_32bit : 1; /* 1 = can not do 32-bit IO ops */ 795 unsigned no_io_32bit : 1; /* 1 = can not do 32-bit IO ops */
796 unsigned err_stops_fifo : 1; /* 1=data FIFO is cleared by an error */
796 797
797 struct device gendev; 798 struct device gendev;
798 struct completion gendev_rel_comp; /* To deal with device release() */ 799 struct completion gendev_rel_comp; /* To deal with device release() */
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index e127ef7e8da8..3a256957fb56 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -87,6 +87,7 @@ extern struct group_info init_groups;
87 .lock_depth = -1, \ 87 .lock_depth = -1, \
88 .prio = MAX_PRIO-20, \ 88 .prio = MAX_PRIO-20, \
89 .static_prio = MAX_PRIO-20, \ 89 .static_prio = MAX_PRIO-20, \
90 .normal_prio = MAX_PRIO-20, \
90 .policy = SCHED_NORMAL, \ 91 .policy = SCHED_NORMAL, \
91 .cpus_allowed = CPU_MASK_ALL, \ 92 .cpus_allowed = CPU_MASK_ALL, \
92 .mm = NULL, \ 93 .mm = NULL, \
@@ -122,6 +123,8 @@ extern struct group_info init_groups;
122 .journal_info = NULL, \ 123 .journal_info = NULL, \
123 .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \ 124 .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \
124 .fs_excl = ATOMIC_INIT(0), \ 125 .fs_excl = ATOMIC_INIT(0), \
126 .pi_lock = SPIN_LOCK_UNLOCKED, \
127 INIT_RT_MUTEXES(tsk) \
125} 128}
126 129
127 130
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 70741e170114..db2a63a11633 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -36,6 +36,20 @@ extern void free_irq(unsigned int, void *);
36extern void disable_irq_nosync(unsigned int irq); 36extern void disable_irq_nosync(unsigned int irq);
37extern void disable_irq(unsigned int irq); 37extern void disable_irq(unsigned int irq);
38extern void enable_irq(unsigned int irq); 38extern void enable_irq(unsigned int irq);
39
40/* IRQ wakeup (PM) control: */
41extern int set_irq_wake(unsigned int irq, unsigned int on);
42
43static inline int enable_irq_wake(unsigned int irq)
44{
45 return set_irq_wake(irq, 1);
46}
47
48static inline int disable_irq_wake(unsigned int irq)
49{
50 return set_irq_wake(irq, 0);
51}
52
39#endif 53#endif
40 54
41#ifndef __ARCH_SET_SOFTIRQ_PENDING 55#ifndef __ARCH_SET_SOFTIRQ_PENDING
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index d4895236b7e9..87a9fc039b47 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -106,6 +106,9 @@ extern int allocate_resource(struct resource *root, struct resource *new,
106int adjust_resource(struct resource *res, resource_size_t start, 106int adjust_resource(struct resource *res, resource_size_t start,
107 resource_size_t size); 107 resource_size_t size);
108 108
109/* get registered SYSTEM_RAM resources in specified area */
110extern int find_next_system_ram(struct resource *res);
111
109/* Convenience shorthand with allocation */ 112/* Convenience shorthand with allocation */
110#define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name)) 113#define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name))
111#define request_mem_region(start,n,name) __request_region(&iomem_resource, (start), (n), (name)) 114#define request_mem_region(start,n,name) __request_region(&iomem_resource, (start), (n), (name))
diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h
index 5653b2f23b6a..d09fbeabf1dc 100644
--- a/include/linux/ipmi.h
+++ b/include/linux/ipmi.h
@@ -210,11 +210,7 @@ struct kernel_ipmi_msg
210#include <linux/list.h> 210#include <linux/list.h>
211#include <linux/module.h> 211#include <linux/module.h>
212#include <linux/device.h> 212#include <linux/device.h>
213
214#ifdef CONFIG_PROC_FS
215#include <linux/proc_fs.h> 213#include <linux/proc_fs.h>
216extern struct proc_dir_entry *proc_ipmi_root;
217#endif /* CONFIG_PROC_FS */
218 214
219/* Opaque type for a IPMI message user. One of these is needed to 215/* Opaque type for a IPMI message user. One of these is needed to
220 send and receive messages. */ 216 send and receive messages. */
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 676e00dfb21a..0832149cdb18 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -1,5 +1,5 @@
1#ifndef __irq_h 1#ifndef _LINUX_IRQ_H
2#define __irq_h 2#define _LINUX_IRQ_H
3 3
4/* 4/*
5 * Please do not include this file in generic code. There is currently 5 * Please do not include this file in generic code. There is currently
@@ -11,7 +11,7 @@
11 11
12#include <linux/smp.h> 12#include <linux/smp.h>
13 13
14#if !defined(CONFIG_S390) 14#ifndef CONFIG_S390
15 15
16#include <linux/linkage.h> 16#include <linux/linkage.h>
17#include <linux/cache.h> 17#include <linux/cache.h>
@@ -33,75 +33,160 @@
33#define IRQ_WAITING 32 /* IRQ not yet seen - for autodetection */ 33#define IRQ_WAITING 32 /* IRQ not yet seen - for autodetection */
34#define IRQ_LEVEL 64 /* IRQ level triggered */ 34#define IRQ_LEVEL 64 /* IRQ level triggered */
35#define IRQ_MASKED 128 /* IRQ masked - shouldn't be seen again */ 35#define IRQ_MASKED 128 /* IRQ masked - shouldn't be seen again */
36#if defined(ARCH_HAS_IRQ_PER_CPU) 36#ifdef CONFIG_IRQ_PER_CPU
37# define IRQ_PER_CPU 256 /* IRQ is per CPU */ 37# define IRQ_PER_CPU 256 /* IRQ is per CPU */
38# define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU) 38# define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU)
39#else 39#else
40# define CHECK_IRQ_PER_CPU(var) 0 40# define CHECK_IRQ_PER_CPU(var) 0
41#endif 41#endif
42 42
43#define IRQ_NOPROBE 512 /* IRQ is not valid for probing */
44#define IRQ_NOREQUEST 1024 /* IRQ cannot be requested */
45#define IRQ_NOAUTOEN 2048 /* IRQ will not be enabled on request irq */
46#define IRQ_DELAYED_DISABLE \
47 4096 /* IRQ disable (masking) happens delayed. */
48
43/* 49/*
44 * Interrupt controller descriptor. This is all we need 50 * IRQ types, see also include/linux/interrupt.h
45 * to describe about the low-level hardware.
46 */ 51 */
47struct hw_interrupt_type { 52#define IRQ_TYPE_NONE 0x0000 /* Default, unspecified type */
48 const char * typename; 53#define IRQ_TYPE_EDGE_RISING 0x0001 /* Edge rising type */
49 unsigned int (*startup)(unsigned int irq); 54#define IRQ_TYPE_EDGE_FALLING 0x0002 /* Edge falling type */
50 void (*shutdown)(unsigned int irq); 55#define IRQ_TYPE_EDGE_BOTH (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING)
51 void (*enable)(unsigned int irq); 56#define IRQ_TYPE_LEVEL_HIGH 0x0004 /* Level high type */
52 void (*disable)(unsigned int irq); 57#define IRQ_TYPE_LEVEL_LOW 0x0008 /* Level low type */
53 void (*ack)(unsigned int irq); 58#define IRQ_TYPE_SENSE_MASK 0x000f /* Mask of the above */
54 void (*end)(unsigned int irq); 59#define IRQ_TYPE_SIMPLE 0x0010 /* Simple type */
55 void (*set_affinity)(unsigned int irq, cpumask_t dest); 60#define IRQ_TYPE_PERCPU 0x0020 /* Per CPU type */
61#define IRQ_TYPE_PROBE 0x0040 /* Probing in progress */
62
63struct proc_dir_entry;
64
65/**
66 * struct irq_chip - hardware interrupt chip descriptor
67 *
68 * @name: name for /proc/interrupts
69 * @startup: start up the interrupt (defaults to ->enable if NULL)
70 * @shutdown: shut down the interrupt (defaults to ->disable if NULL)
71 * @enable: enable the interrupt (defaults to chip->unmask if NULL)
72 * @disable: disable the interrupt (defaults to chip->mask if NULL)
73 * @ack: start of a new interrupt
74 * @mask: mask an interrupt source
75 * @mask_ack: ack and mask an interrupt source
76 * @unmask: unmask an interrupt source
77 * @eoi: end of interrupt - chip level
78 * @end: end of interrupt - flow level
79 * @set_affinity: set the CPU affinity on SMP machines
80 * @retrigger: resend an IRQ to the CPU
81 * @set_type: set the flow type (IRQ_TYPE_LEVEL/etc.) of an IRQ
82 * @set_wake: enable/disable power-management wake-on of an IRQ
83 *
84 * @release: release function solely used by UML
85 * @typename: obsoleted by name, kept as migration helper
86 */
87struct irq_chip {
88 const char *name;
89 unsigned int (*startup)(unsigned int irq);
90 void (*shutdown)(unsigned int irq);
91 void (*enable)(unsigned int irq);
92 void (*disable)(unsigned int irq);
93
94 void (*ack)(unsigned int irq);
95 void (*mask)(unsigned int irq);
96 void (*mask_ack)(unsigned int irq);
97 void (*unmask)(unsigned int irq);
98 void (*eoi)(unsigned int irq);
99
100 void (*end)(unsigned int irq);
101 void (*set_affinity)(unsigned int irq, cpumask_t dest);
102 int (*retrigger)(unsigned int irq);
103 int (*set_type)(unsigned int irq, unsigned int flow_type);
104 int (*set_wake)(unsigned int irq, unsigned int on);
105
56 /* Currently used only by UML, might disappear one day.*/ 106 /* Currently used only by UML, might disappear one day.*/
57#ifdef CONFIG_IRQ_RELEASE_METHOD 107#ifdef CONFIG_IRQ_RELEASE_METHOD
58 void (*release)(unsigned int irq, void *dev_id); 108 void (*release)(unsigned int irq, void *dev_id);
59#endif 109#endif
110 /*
111 * For compatibility, ->typename is copied into ->name.
112 * Will disappear.
113 */
114 const char *typename;
60}; 115};
61 116
62typedef struct hw_interrupt_type hw_irq_controller; 117/**
63 118 * struct irq_desc - interrupt descriptor
64/* 119 *
65 * This is the "IRQ descriptor", which contains various information 120 * @handle_irq: highlevel irq-events handler [if NULL, __do_IRQ()]
66 * about the irq, including what kind of hardware handling it has, 121 * @chip: low level interrupt hardware access
67 * whether it is disabled etc etc. 122 * @handler_data: per-IRQ data for the irq_chip methods
123 * @chip_data: platform-specific per-chip private data for the chip
124 * methods, to allow shared chip implementations
125 * @action: the irq action chain
126 * @status: status information
127 * @depth: disable-depth, for nested irq_disable() calls
128 * @irq_count: stats field to detect stalled irqs
129 * @irqs_unhandled: stats field for spurious unhandled interrupts
130 * @lock: locking for SMP
131 * @affinity: IRQ affinity on SMP
132 * @cpu: cpu index useful for balancing
133 * @pending_mask: pending rebalanced interrupts
134 * @move_irq: need to re-target IRQ destination
135 * @dir: /proc/irq/ procfs entry
136 * @affinity_entry: /proc/irq/smp_affinity procfs entry on SMP
68 * 137 *
69 * Pad this out to 32 bytes for cache and indexing reasons. 138 * Pad this out to 32 bytes for cache and indexing reasons.
70 */ 139 */
71typedef struct irq_desc { 140struct irq_desc {
72 hw_irq_controller *handler; 141 void fastcall (*handle_irq)(unsigned int irq,
73 void *handler_data; 142 struct irq_desc *desc,
74 struct irqaction *action; /* IRQ action list */ 143 struct pt_regs *regs);
75 unsigned int status; /* IRQ status */ 144 struct irq_chip *chip;
76 unsigned int depth; /* nested irq disables */ 145 void *handler_data;
77 unsigned int irq_count; /* For detecting broken interrupts */ 146 void *chip_data;
78 unsigned int irqs_unhandled; 147 struct irqaction *action; /* IRQ action list */
79 spinlock_t lock; 148 unsigned int status; /* IRQ status */
80#if defined (CONFIG_GENERIC_PENDING_IRQ) || defined (CONFIG_IRQBALANCE) 149
81 unsigned int move_irq; /* Flag need to re-target intr dest*/ 150 unsigned int depth; /* nested irq disables */
151 unsigned int irq_count; /* For detecting broken IRQs */
152 unsigned int irqs_unhandled;
153 spinlock_t lock;
154#ifdef CONFIG_SMP
155 cpumask_t affinity;
156 unsigned int cpu;
157#endif
158#if defined(CONFIG_GENERIC_PENDING_IRQ) || defined(CONFIG_IRQBALANCE)
159 cpumask_t pending_mask;
160 unsigned int move_irq; /* need to re-target IRQ dest */
82#endif 161#endif
83} ____cacheline_aligned irq_desc_t; 162#ifdef CONFIG_PROC_FS
163 struct proc_dir_entry *dir;
164#endif
165} ____cacheline_aligned;
84 166
85extern irq_desc_t irq_desc [NR_IRQS]; 167extern struct irq_desc irq_desc[NR_IRQS];
86 168
87/* Return a pointer to the irq descriptor for IRQ. */ 169/*
88static inline irq_desc_t * 170 * Migration helpers for obsolete names, they will go away:
89irq_descp (int irq) 171 */
90{ 172#define hw_interrupt_type irq_chip
91 return irq_desc + irq; 173typedef struct irq_chip hw_irq_controller;
92} 174#define no_irq_type no_irq_chip
175typedef struct irq_desc irq_desc_t;
93 176
94#include <asm/hw_irq.h> /* the arch dependent stuff */ 177/*
178 * Pick up the arch-dependent methods:
179 */
180#include <asm/hw_irq.h>
95 181
96extern int setup_irq(unsigned int irq, struct irqaction * new); 182extern int setup_irq(unsigned int irq, struct irqaction *new);
97 183
98#ifdef CONFIG_GENERIC_HARDIRQS 184#ifdef CONFIG_GENERIC_HARDIRQS
99extern cpumask_t irq_affinity[NR_IRQS];
100 185
101#ifdef CONFIG_SMP 186#ifdef CONFIG_SMP
102static inline void set_native_irq_info(int irq, cpumask_t mask) 187static inline void set_native_irq_info(int irq, cpumask_t mask)
103{ 188{
104 irq_affinity[irq] = mask; 189 irq_desc[irq].affinity = mask;
105} 190}
106#else 191#else
107static inline void set_native_irq_info(int irq, cpumask_t mask) 192static inline void set_native_irq_info(int irq, cpumask_t mask)
@@ -111,8 +196,7 @@ static inline void set_native_irq_info(int irq, cpumask_t mask)
111 196
112#ifdef CONFIG_SMP 197#ifdef CONFIG_SMP
113 198
114#if defined (CONFIG_GENERIC_PENDING_IRQ) || defined (CONFIG_IRQBALANCE) 199#if defined(CONFIG_GENERIC_PENDING_IRQ) || defined(CONFIG_IRQBALANCE)
115extern cpumask_t pending_irq_cpumask[NR_IRQS];
116 200
117void set_pending_irq(unsigned int irq, cpumask_t mask); 201void set_pending_irq(unsigned int irq, cpumask_t mask);
118void move_native_irq(int irq); 202void move_native_irq(int irq);
@@ -133,7 +217,7 @@ static inline void set_irq_info(int irq, cpumask_t mask)
133{ 217{
134} 218}
135 219
136#else // CONFIG_PCI_MSI 220#else /* CONFIG_PCI_MSI */
137 221
138static inline void move_irq(int irq) 222static inline void move_irq(int irq)
139{ 223{
@@ -144,26 +228,36 @@ static inline void set_irq_info(int irq, cpumask_t mask)
144{ 228{
145 set_native_irq_info(irq, mask); 229 set_native_irq_info(irq, mask);
146} 230}
147#endif // CONFIG_PCI_MSI
148 231
149#else // CONFIG_GENERIC_PENDING_IRQ || CONFIG_IRQBALANCE 232#endif /* CONFIG_PCI_MSI */
233
234#else /* CONFIG_GENERIC_PENDING_IRQ || CONFIG_IRQBALANCE */
235
236static inline void move_irq(int irq)
237{
238}
239
240static inline void move_native_irq(int irq)
241{
242}
243
244static inline void set_pending_irq(unsigned int irq, cpumask_t mask)
245{
246}
150 247
151#define move_irq(x)
152#define move_native_irq(x)
153#define set_pending_irq(x,y)
154static inline void set_irq_info(int irq, cpumask_t mask) 248static inline void set_irq_info(int irq, cpumask_t mask)
155{ 249{
156 set_native_irq_info(irq, mask); 250 set_native_irq_info(irq, mask);
157} 251}
158 252
159#endif // CONFIG_GENERIC_PENDING_IRQ 253#endif /* CONFIG_GENERIC_PENDING_IRQ */
160 254
161#else // CONFIG_SMP 255#else /* CONFIG_SMP */
162 256
163#define move_irq(x) 257#define move_irq(x)
164#define move_native_irq(x) 258#define move_native_irq(x)
165 259
166#endif // CONFIG_SMP 260#endif /* CONFIG_SMP */
167 261
168#ifdef CONFIG_IRQBALANCE 262#ifdef CONFIG_IRQBALANCE
169extern void set_balance_irq_affinity(unsigned int irq, cpumask_t mask); 263extern void set_balance_irq_affinity(unsigned int irq, cpumask_t mask);
@@ -173,32 +267,138 @@ static inline void set_balance_irq_affinity(unsigned int irq, cpumask_t mask)
173} 267}
174#endif 268#endif
175 269
270#ifdef CONFIG_AUTO_IRQ_AFFINITY
271extern int select_smp_affinity(unsigned int irq);
272#else
273static inline int select_smp_affinity(unsigned int irq)
274{
275 return 1;
276}
277#endif
278
176extern int no_irq_affinity; 279extern int no_irq_affinity;
177extern int noirqdebug_setup(char *str);
178 280
179extern fastcall irqreturn_t handle_IRQ_event(unsigned int irq, struct pt_regs *regs, 281/* Handle irq action chains: */
180 struct irqaction *action); 282extern int handle_IRQ_event(unsigned int irq, struct pt_regs *regs,
283 struct irqaction *action);
284
285/*
286 * Built-in IRQ handlers for various IRQ types,
287 * callable via desc->chip->handle_irq()
288 */
289extern void fastcall
290handle_level_irq(unsigned int irq, struct irq_desc *desc, struct pt_regs *regs);
291extern void fastcall
292handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc,
293 struct pt_regs *regs);
294extern void fastcall
295handle_edge_irq(unsigned int irq, struct irq_desc *desc, struct pt_regs *regs);
296extern void fastcall
297handle_simple_irq(unsigned int irq, struct irq_desc *desc,
298 struct pt_regs *regs);
299extern void fastcall
300handle_percpu_irq(unsigned int irq, struct irq_desc *desc,
301 struct pt_regs *regs);
302extern void fastcall
303handle_bad_irq(unsigned int irq, struct irq_desc *desc, struct pt_regs *regs);
304
305/*
306 * Get a descriptive string for the highlevel handler, for
307 * /proc/interrupts output:
308 */
309extern const char *
310handle_irq_name(void fastcall (*handle)(unsigned int, struct irq_desc *,
311 struct pt_regs *));
312
313/*
314 * Monolithic do_IRQ implementation.
315 * (is an explicit fastcall, because i386 4KSTACKS calls it from assembly)
316 */
181extern fastcall unsigned int __do_IRQ(unsigned int irq, struct pt_regs *regs); 317extern fastcall unsigned int __do_IRQ(unsigned int irq, struct pt_regs *regs);
182extern void note_interrupt(unsigned int irq, irq_desc_t *desc,
183 int action_ret, struct pt_regs *regs);
184extern int can_request_irq(unsigned int irq, unsigned long irqflags);
185 318
319/*
320 * Architectures call this to let the generic IRQ layer
321 * handle an interrupt. If the descriptor is attached to an
322 * irqchip-style controller then we call the ->handle_irq() handler,
323 * and it calls __do_IRQ() if it's attached to an irqtype-style controller.
324 */
325static inline void generic_handle_irq(unsigned int irq, struct pt_regs *regs)
326{
327 struct irq_desc *desc = irq_desc + irq;
328
329 if (likely(desc->handle_irq))
330 desc->handle_irq(irq, desc, regs);
331 else
332 __do_IRQ(irq, regs);
333}
334
335/* Handling of unhandled and spurious interrupts: */
336extern void note_interrupt(unsigned int irq, struct irq_desc *desc,
337 int action_ret, struct pt_regs *regs);
338
339/* Resending of interrupts :*/
340void check_irq_resend(struct irq_desc *desc, unsigned int irq);
341
342/* Initialize /proc/irq/ */
186extern void init_irq_proc(void); 343extern void init_irq_proc(void);
187 344
188#ifdef CONFIG_AUTO_IRQ_AFFINITY 345/* Enable/disable irq debugging output: */
189extern int select_smp_affinity(unsigned int irq); 346extern int noirqdebug_setup(char *str);
190#else 347
191static inline int 348/* Checks whether the interrupt can be requested by request_irq(): */
192select_smp_affinity(unsigned int irq) 349extern int can_request_irq(unsigned int irq, unsigned long irqflags);
350
351/* Dummy irq-chip implementation: */
352extern struct irq_chip no_irq_chip;
353
354extern void
355set_irq_chip_and_handler(unsigned int irq, struct irq_chip *chip,
356 void fastcall (*handle)(unsigned int,
357 struct irq_desc *,
358 struct pt_regs *));
359extern void
360__set_irq_handler(unsigned int irq,
361 void fastcall (*handle)(unsigned int, struct irq_desc *,
362 struct pt_regs *),
363 int is_chained);
364
365/*
366 * Set a highlevel flow handler for a given IRQ:
367 */
368static inline void
369set_irq_handler(unsigned int irq,
370 void fastcall (*handle)(unsigned int, struct irq_desc *,
371 struct pt_regs *))
193{ 372{
194 return 1; 373 __set_irq_handler(irq, handle, 0);
195} 374}
196#endif
197 375
198#endif 376/*
377 * Set a highlevel chained flow handler for a given IRQ.
378 * (a chained handler is automatically enabled and set to
379 * IRQ_NOREQUEST and IRQ_NOPROBE)
380 */
381static inline void
382set_irq_chained_handler(unsigned int irq,
383 void fastcall (*handle)(unsigned int, struct irq_desc *,
384 struct pt_regs *))
385{
386 __set_irq_handler(irq, handle, 1);
387}
199 388
200extern hw_irq_controller no_irq_type; /* needed in every arch ? */ 389/* Set/get chip/data for an IRQ: */
201 390
202#endif 391extern int set_irq_chip(unsigned int irq, struct irq_chip *chip);
392extern int set_irq_data(unsigned int irq, void *data);
393extern int set_irq_chip_data(unsigned int irq, void *data);
394extern int set_irq_type(unsigned int irq, unsigned int type);
395
396#define get_irq_chip(irq) (irq_desc[irq].chip)
397#define get_irq_chip_data(irq) (irq_desc[irq].chip_data)
398#define get_irq_data(irq) (irq_desc[irq].handler_data)
399
400#endif /* CONFIG_GENERIC_HARDIRQS */
401
402#endif /* !CONFIG_S390 */
203 403
204#endif /* __irq_h */ 404#endif /* _LINUX_IRQ_H */
diff --git a/include/linux/isdn/tpam.h b/include/linux/isdn/tpam.h
deleted file mode 100644
index d18dd0dc570d..000000000000
--- a/include/linux/isdn/tpam.h
+++ /dev/null
@@ -1,55 +0,0 @@
1/* $Id: tpam.h,v 1.1.2.1 2001/06/08 08:23:46 kai Exp $
2 *
3 * Turbo PAM ISDN driver for Linux. (Kernel Driver)
4 *
5 * Copyright 2001 Stelian Pop <stelian.pop@fr.alcove.com>, Alcôve
6 *
7 * For all support questions please contact: <support@auvertech.fr>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2, or (at your option)
12 * any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 *
23 */
24
25#ifndef _TPAM_H_
26#define _TPAM_H_
27
28#include <linux/types.h>
29
30/* IOCTL commands */
31#define TPAM_CMD_DSPLOAD 0x0001
32#define TPAM_CMD_DSPSAVE 0x0002
33#define TPAM_CMD_DSPRUN 0x0003
34#define TPAM_CMD_LOOPMODEON 0x0004
35#define TPAM_CMD_LOOPMODEOFF 0x0005
36
37/* addresses of debug information zones on board */
38#define TPAM_TRAPAUDIT_REGISTER 0x005493e4
39#define TPAM_NCOAUDIT_REGISTER 0x00500000
40#define TPAM_MSGAUDIT_REGISTER 0x008E30F0
41
42/* length of debug information zones on board */
43#define TPAM_TRAPAUDIT_LENGTH 10000
44#define TPAM_NCOAUDIT_LENGTH 300000
45#define TPAM_NCOAUDIT_COUNT 30
46#define TPAM_MSGAUDIT_LENGTH 60000
47
48/* IOCTL load/save parameter */
49typedef struct tpam_dsp_ioctl {
50 __u32 address; /* address to load/save data */
51 __u32 data_len; /* size of data to be loaded/saved */
52 __u8 data[0]; /* data */
53} tpam_dsp_ioctl;
54
55#endif /* _TPAM_H_ */
diff --git a/include/linux/jffs2.h b/include/linux/jffs2.h
index c6f70660b371..c9c760700bc3 100644
--- a/include/linux/jffs2.h
+++ b/include/linux/jffs2.h
@@ -186,6 +186,7 @@ struct jffs2_raw_xref
186 jint32_t hdr_crc; 186 jint32_t hdr_crc;
187 jint32_t ino; /* inode number */ 187 jint32_t ino; /* inode number */
188 jint32_t xid; /* XATTR identifier number */ 188 jint32_t xid; /* XATTR identifier number */
189 jint32_t xseqno; /* xref sequencial number */
189 jint32_t node_crc; 190 jint32_t node_crc;
190} __attribute__((packed)); 191} __attribute__((packed));
191 192
diff --git a/include/linux/kbd_kern.h b/include/linux/kbd_kern.h
index 4eb851ece080..efe0ee4cc80b 100644
--- a/include/linux/kbd_kern.h
+++ b/include/linux/kbd_kern.h
@@ -155,10 +155,8 @@ static inline void con_schedule_flip(struct tty_struct *t)
155{ 155{
156 unsigned long flags; 156 unsigned long flags;
157 spin_lock_irqsave(&t->buf.lock, flags); 157 spin_lock_irqsave(&t->buf.lock, flags);
158 if (t->buf.tail != NULL) { 158 if (t->buf.tail != NULL)
159 t->buf.tail->active = 0;
160 t->buf.tail->commit = t->buf.tail->used; 159 t->buf.tail->commit = t->buf.tail->used;
161 }
162 spin_unlock_irqrestore(&t->buf.lock, flags); 160 spin_unlock_irqrestore(&t->buf.lock, flags);
163 schedule_work(&t->buf.work); 161 schedule_work(&t->buf.work);
164} 162}
diff --git a/include/linux/key.h b/include/linux/key.h
index e693e729bc92..169f05e4863e 100644
--- a/include/linux/key.h
+++ b/include/linux/key.h
@@ -177,7 +177,8 @@ struct key {
177/* 177/*
178 * kernel managed key type definition 178 * kernel managed key type definition
179 */ 179 */
180typedef int (*request_key_actor_t)(struct key *key, struct key *authkey, const char *op); 180typedef int (*request_key_actor_t)(struct key *key, struct key *authkey,
181 const char *op, void *aux);
181 182
182struct key_type { 183struct key_type {
183 /* name of the type */ 184 /* name of the type */
@@ -285,6 +286,11 @@ extern struct key *request_key(struct key_type *type,
285 const char *description, 286 const char *description,
286 const char *callout_info); 287 const char *callout_info);
287 288
289extern struct key *request_key_with_auxdata(struct key_type *type,
290 const char *description,
291 const char *callout_info,
292 void *aux);
293
288extern int key_validate(struct key *key); 294extern int key_validate(struct key *key);
289 295
290extern key_ref_t key_create_or_update(key_ref_t keyring, 296extern key_ref_t key_create_or_update(key_ref_t keyring,
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 20b1cf527c60..f4284bf89758 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -30,6 +30,7 @@
30#include <linux/interrupt.h> 30#include <linux/interrupt.h>
31#include <linux/pci.h> 31#include <linux/pci.h>
32#include <linux/dma-mapping.h> 32#include <linux/dma-mapping.h>
33#include <asm/scatterlist.h>
33#include <asm/io.h> 34#include <asm/io.h>
34#include <linux/ata.h> 35#include <linux/ata.h>
35#include <linux/workqueue.h> 36#include <linux/workqueue.h>
@@ -887,6 +888,9 @@ static inline unsigned int ata_tag_internal(unsigned int tag)
887 return tag == ATA_MAX_QUEUE - 1; 888 return tag == ATA_MAX_QUEUE - 1;
888} 889}
889 890
891/*
892 * device helpers
893 */
890static inline unsigned int ata_class_enabled(unsigned int class) 894static inline unsigned int ata_class_enabled(unsigned int class)
891{ 895{
892 return class == ATA_DEV_ATA || class == ATA_DEV_ATAPI; 896 return class == ATA_DEV_ATA || class == ATA_DEV_ATAPI;
@@ -917,6 +921,17 @@ static inline unsigned int ata_dev_absent(const struct ata_device *dev)
917 return ata_class_absent(dev->class); 921 return ata_class_absent(dev->class);
918} 922}
919 923
924/*
925 * port helpers
926 */
927static inline int ata_port_max_devices(const struct ata_port *ap)
928{
929 if (ap->flags & ATA_FLAG_SLAVE_POSS)
930 return 2;
931 return 1;
932}
933
934
920static inline u8 ata_chk_status(struct ata_port *ap) 935static inline u8 ata_chk_status(struct ata_port *ap)
921{ 936{
922 return ap->ops->check_status(ap); 937 return ap->ops->check_status(ap);
diff --git a/include/linux/list.h b/include/linux/list.h
index 37ca31b21bb7..6b74adf5297f 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -4,18 +4,11 @@
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#include <linux/stddef.h> 6#include <linux/stddef.h>
7#include <linux/poison.h>
7#include <linux/prefetch.h> 8#include <linux/prefetch.h>
8#include <asm/system.h> 9#include <asm/system.h>
9 10
10/* 11/*
11 * These are non-NULL pointers that will result in page faults
12 * under normal circumstances, used to verify that nobody uses
13 * non-initialized list entries.
14 */
15#define LIST_POISON1 ((void *) 0x00100100)
16#define LIST_POISON2 ((void *) 0x00200200)
17
18/*
19 * Simple doubly linked list implementation. 12 * Simple doubly linked list implementation.
20 * 13 *
21 * Some of the internal functions ("__xxx") are useful when 14 * Some of the internal functions ("__xxx") are useful when
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h
index 911206386171..218501cfaeb9 100644
--- a/include/linux/memory_hotplug.h
+++ b/include/linux/memory_hotplug.h
@@ -63,6 +63,76 @@ extern int online_pages(unsigned long, unsigned long);
63/* reasonably generic interface to expand the physical pages in a zone */ 63/* reasonably generic interface to expand the physical pages in a zone */
64extern int __add_pages(struct zone *zone, unsigned long start_pfn, 64extern int __add_pages(struct zone *zone, unsigned long start_pfn,
65 unsigned long nr_pages); 65 unsigned long nr_pages);
66
67#ifdef CONFIG_NUMA
68extern int memory_add_physaddr_to_nid(u64 start);
69#else
70static inline int memory_add_physaddr_to_nid(u64 start)
71{
72 return 0;
73}
74#endif
75
76#ifdef CONFIG_HAVE_ARCH_NODEDATA_EXTENSION
77/*
78 * For supporting node-hotadd, we have to allocate a new pgdat.
79 *
80 * If an arch has generic style NODE_DATA(),
81 * node_data[nid] = kzalloc() works well. But it depends on the architecture.
82 *
83 * In general, generic_alloc_nodedata() is used.
84 * Now, arch_free_nodedata() is just defined for error path of node_hot_add.
85 *
86 */
87extern pg_data_t *arch_alloc_nodedata(int nid);
88extern void arch_free_nodedata(pg_data_t *pgdat);
89extern void arch_refresh_nodedata(int nid, pg_data_t *pgdat);
90
91#else /* CONFIG_HAVE_ARCH_NODEDATA_EXTENSION */
92
93#define arch_alloc_nodedata(nid) generic_alloc_nodedata(nid)
94#define arch_free_nodedata(pgdat) generic_free_nodedata(pgdat)
95
96#ifdef CONFIG_NUMA
97/*
98 * If ARCH_HAS_NODEDATA_EXTENSION=n, this func is used to allocate pgdat.
99 * XXX: kmalloc_node() can't work well to get new node's memory at this time.
100 * Because, pgdat for the new node is not allocated/initialized yet itself.
101 * To use new node's memory, more consideration will be necessary.
102 */
103#define generic_alloc_nodedata(nid) \
104({ \
105 kzalloc(sizeof(pg_data_t), GFP_KERNEL); \
106})
107/*
108 * This definition is just for error path in node hotadd.
109 * For node hotremove, we have to replace this.
110 */
111#define generic_free_nodedata(pgdat) kfree(pgdat)
112
113extern pg_data_t *node_data[];
114static inline void arch_refresh_nodedata(int nid, pg_data_t *pgdat)
115{
116 node_data[nid] = pgdat;
117}
118
119#else /* !CONFIG_NUMA */
120
121/* never called */
122static inline pg_data_t *generic_alloc_nodedata(int nid)
123{
124 BUG();
125 return NULL;
126}
127static inline void generic_free_nodedata(pg_data_t *pgdat)
128{
129}
130static inline void arch_refresh_nodedata(int nid, pg_data_t *pgdat)
131{
132}
133#endif /* CONFIG_NUMA */
134#endif /* CONFIG_HAVE_ARCH_NODEDATA_EXTENSION */
135
66#else /* ! CONFIG_MEMORY_HOTPLUG */ 136#else /* ! CONFIG_MEMORY_HOTPLUG */
67/* 137/*
68 * Stub functions for when hotplug is off 138 * Stub functions for when hotplug is off
@@ -99,7 +169,8 @@ static inline int __remove_pages(struct zone *zone, unsigned long start_pfn,
99 return -ENOSYS; 169 return -ENOSYS;
100} 170}
101 171
102extern int add_memory(u64 start, u64 size); 172extern int add_memory(int nid, u64 start, u64 size);
173extern int arch_add_memory(int nid, u64 start, u64 size);
103extern int remove_memory(u64 start, u64 size); 174extern int remove_memory(u64 start, u64 size);
104 175
105#endif /* __LINUX_MEMORY_HOTPLUG_H */ 176#endif /* __LINUX_MEMORY_HOTPLUG_H */
diff --git a/include/linux/mm.h b/include/linux/mm.h
index a929ea197e48..c41a1299b8cf 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1030,13 +1030,20 @@ static inline void vm_stat_account(struct mm_struct *mm,
1030} 1030}
1031#endif /* CONFIG_PROC_FS */ 1031#endif /* CONFIG_PROC_FS */
1032 1032
1033static inline void
1034debug_check_no_locks_freed(const void *from, unsigned long len)
1035{
1036 mutex_debug_check_no_locks_freed(from, len);
1037 rt_mutex_debug_check_no_locks_freed(from, len);
1038}
1039
1033#ifndef CONFIG_DEBUG_PAGEALLOC 1040#ifndef CONFIG_DEBUG_PAGEALLOC
1034static inline void 1041static inline void
1035kernel_map_pages(struct page *page, int numpages, int enable) 1042kernel_map_pages(struct page *page, int numpages, int enable)
1036{ 1043{
1037 if (!PageHighMem(page) && !enable) 1044 if (!PageHighMem(page) && !enable)
1038 mutex_debug_check_no_locks_freed(page_address(page), 1045 debug_check_no_locks_freed(page_address(page),
1039 numpages * PAGE_SIZE); 1046 numpages * PAGE_SIZE);
1040} 1047}
1041#endif 1048#endif
1042 1049
@@ -1065,5 +1072,7 @@ void drop_slab(void);
1065extern int randomize_va_space; 1072extern int randomize_va_space;
1066#endif 1073#endif
1067 1074
1075const char *arch_vma_name(struct vm_area_struct *vma);
1076
1068#endif /* __KERNEL__ */ 1077#endif /* __KERNEL__ */
1069#endif /* _LINUX_MM_H */ 1078#endif /* _LINUX_MM_H */
diff --git a/include/linux/module.h b/include/linux/module.h
index 9ebbb74b7b72..9e9dc7c24d95 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -203,6 +203,15 @@ void *__symbol_get_gpl(const char *symbol);
203#define EXPORT_SYMBOL_GPL_FUTURE(sym) \ 203#define EXPORT_SYMBOL_GPL_FUTURE(sym) \
204 __EXPORT_SYMBOL(sym, "_gpl_future") 204 __EXPORT_SYMBOL(sym, "_gpl_future")
205 205
206
207#ifdef CONFIG_UNUSED_SYMBOLS
208#define EXPORT_UNUSED_SYMBOL(sym) __EXPORT_SYMBOL(sym, "_unused")
209#define EXPORT_UNUSED_SYMBOL_GPL(sym) __EXPORT_SYMBOL(sym, "_unused_gpl")
210#else
211#define EXPORT_UNUSED_SYMBOL(sym)
212#define EXPORT_UNUSED_SYMBOL_GPL(sym)
213#endif
214
206#endif 215#endif
207 216
208struct module_ref 217struct module_ref
@@ -261,6 +270,15 @@ struct module
261 unsigned int num_gpl_syms; 270 unsigned int num_gpl_syms;
262 const unsigned long *gpl_crcs; 271 const unsigned long *gpl_crcs;
263 272
273 /* unused exported symbols. */
274 const struct kernel_symbol *unused_syms;
275 unsigned int num_unused_syms;
276 const unsigned long *unused_crcs;
277 /* GPL-only, unused exported symbols. */
278 const struct kernel_symbol *unused_gpl_syms;
279 unsigned int num_unused_gpl_syms;
280 const unsigned long *unused_gpl_crcs;
281
264 /* symbols that will be GPL-only in the near future. */ 282 /* symbols that will be GPL-only in the near future. */
265 const struct kernel_symbol *gpl_future_syms; 283 const struct kernel_symbol *gpl_future_syms;
266 unsigned int num_gpl_future_syms; 284 unsigned int num_gpl_future_syms;
@@ -456,6 +474,8 @@ void module_remove_driver(struct device_driver *);
456#define EXPORT_SYMBOL(sym) 474#define EXPORT_SYMBOL(sym)
457#define EXPORT_SYMBOL_GPL(sym) 475#define EXPORT_SYMBOL_GPL(sym)
458#define EXPORT_SYMBOL_GPL_FUTURE(sym) 476#define EXPORT_SYMBOL_GPL_FUTURE(sym)
477#define EXPORT_UNUSED_SYMBOL(sym)
478#define EXPORT_UNUSED_SYMBOL_GPL(sym)
459 479
460/* Given an address, look for it in the exception tables. */ 480/* Given an address, look for it in the exception tables. */
461static inline const struct exception_table_entry * 481static inline const struct exception_table_entry *
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 0a1740b2532e..d90b1bb37563 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -335,7 +335,7 @@ extern struct inode_operations nfs_file_inode_operations;
335extern struct inode_operations nfs3_file_inode_operations; 335extern struct inode_operations nfs3_file_inode_operations;
336#endif /* CONFIG_NFS_V3 */ 336#endif /* CONFIG_NFS_V3 */
337extern const struct file_operations nfs_file_operations; 337extern const struct file_operations nfs_file_operations;
338extern struct address_space_operations nfs_file_aops; 338extern const struct address_space_operations nfs_file_aops;
339 339
340static inline struct rpc_cred *nfs_file_cred(struct file *file) 340static inline struct rpc_cred *nfs_file_cred(struct file *file)
341{ 341{
diff --git a/include/linux/node.h b/include/linux/node.h
index 254dc3de650b..81dcec84cd8f 100644
--- a/include/linux/node.h
+++ b/include/linux/node.h
@@ -26,8 +26,25 @@ struct node {
26 struct sys_device sysdev; 26 struct sys_device sysdev;
27}; 27};
28 28
29extern struct node node_devices[];
30
29extern int register_node(struct node *, int, struct node *); 31extern int register_node(struct node *, int, struct node *);
30extern void unregister_node(struct node *node); 32extern void unregister_node(struct node *node);
33extern int register_one_node(int nid);
34extern void unregister_one_node(int nid);
35#ifdef CONFIG_NUMA
36extern int register_cpu_under_node(unsigned int cpu, unsigned int nid);
37extern int unregister_cpu_under_node(unsigned int cpu, unsigned int nid);
38#else
39static inline int register_cpu_under_node(unsigned int cpu, unsigned int nid)
40{
41 return 0;
42}
43static inline int unregister_cpu_under_node(unsigned int cpu, unsigned int nid)
44{
45 return 0;
46}
47#endif
31 48
32#define to_node(sys_device) container_of(sys_device, struct node, sysdev) 49#define to_node(sys_device) container_of(sys_device, struct node, sysdev)
33 50
diff --git a/include/linux/nsc_gpio.h b/include/linux/nsc_gpio.h
new file mode 100644
index 000000000000..135742cfada5
--- /dev/null
+++ b/include/linux/nsc_gpio.h
@@ -0,0 +1,42 @@
1/**
2 nsc_gpio.c
3
4 National Semiconductor GPIO common access methods.
5
6 struct nsc_gpio_ops abstracts the low-level access
7 operations for the GPIO units on 2 NSC chip families; the GEODE
8 integrated CPU, and the PC-8736[03456] integrated PC-peripheral
9 chips.
10
11 The GPIO units on these chips have the same pin architecture, but
12 the access methods differ. Thus, scx200_gpio and pc8736x_gpio
13 implement their own versions of these routines; and use the common
14 file-operations routines implemented in nsc_gpio module.
15
16 Copyright (c) 2005 Jim Cromie <jim.cromie@gmail.com>
17
18 NB: this work was tested on the Geode SC-1100 and PC-87366 chips.
19 NSC sold the GEODE line to AMD, and the PC-8736x line to Winbond.
20*/
21
22struct nsc_gpio_ops {
23 struct module* owner;
24 u32 (*gpio_config) (unsigned iminor, u32 mask, u32 bits);
25 void (*gpio_dump) (struct nsc_gpio_ops *amp, unsigned iminor);
26 int (*gpio_get) (unsigned iminor);
27 void (*gpio_set) (unsigned iminor, int state);
28 void (*gpio_set_high)(unsigned iminor);
29 void (*gpio_set_low) (unsigned iminor);
30 void (*gpio_change) (unsigned iminor);
31 int (*gpio_current) (unsigned iminor);
32 struct device* dev; /* for dev_dbg() support, set in init */
33};
34
35extern ssize_t nsc_gpio_write(struct file *file, const char __user *data,
36 size_t len, loff_t *ppos);
37
38extern ssize_t nsc_gpio_read(struct file *file, char __user *buf,
39 size_t len, loff_t *ppos);
40
41extern void nsc_gpio_dump(struct nsc_gpio_ops *amp, unsigned index);
42
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index c2fd2d19938b..9ae6b1a75366 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1202,6 +1202,7 @@
1202#define PCI_DEVICE_ID_NVIDIA_NVENET_19 0x03EF 1202#define PCI_DEVICE_ID_NVIDIA_NVENET_19 0x03EF
1203#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA2 0x03F6 1203#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA2 0x03F6
1204#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA3 0x03F7 1204#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA3 0x03F7
1205#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP65_IDE 0x0448
1205#define PCI_DEVICE_ID_NVIDIA_NVENET_20 0x0450 1206#define PCI_DEVICE_ID_NVIDIA_NVENET_20 0x0450
1206#define PCI_DEVICE_ID_NVIDIA_NVENET_21 0x0451 1207#define PCI_DEVICE_ID_NVIDIA_NVENET_21 0x0451
1207#define PCI_DEVICE_ID_NVIDIA_NVENET_22 0x0452 1208#define PCI_DEVICE_ID_NVIDIA_NVENET_22 0x0452
@@ -2170,7 +2171,6 @@
2170#define PCI_DEVICE_ID_INTEL_ICH8_4 0x2815 2171#define PCI_DEVICE_ID_INTEL_ICH8_4 0x2815
2171#define PCI_DEVICE_ID_INTEL_ICH8_5 0x283e 2172#define PCI_DEVICE_ID_INTEL_ICH8_5 0x283e
2172#define PCI_DEVICE_ID_INTEL_ICH8_6 0x2850 2173#define PCI_DEVICE_ID_INTEL_ICH8_6 0x2850
2173#define PCI_DEVICE_ID_INTEL_GD31244 0x3200
2174#define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340 2174#define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340
2175#define PCI_DEVICE_ID_INTEL_82830_HB 0x3575 2175#define PCI_DEVICE_ID_INTEL_82830_HB 0x3575
2176#define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577 2176#define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577
diff --git a/include/linux/plist.h b/include/linux/plist.h
new file mode 100644
index 000000000000..b95818a037ad
--- /dev/null
+++ b/include/linux/plist.h
@@ -0,0 +1,248 @@
1/*
2 * Descending-priority-sorted double-linked list
3 *
4 * (C) 2002-2003 Intel Corp
5 * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>.
6 *
7 * 2001-2005 (c) MontaVista Software, Inc.
8 * Daniel Walker <dwalker@mvista.com>
9 *
10 * (C) 2005 Thomas Gleixner <tglx@linutronix.de>
11 *
12 * Simplifications of the original code by
13 * Oleg Nesterov <oleg@tv-sign.ru>
14 *
15 * Licensed under the FSF's GNU Public License v2 or later.
16 *
17 * Based on simple lists (include/linux/list.h).
18 *
19 * This is a priority-sorted list of nodes; each node has a
20 * priority from INT_MIN (highest) to INT_MAX (lowest).
21 *
22 * Addition is O(K), removal is O(1), change of priority of a node is
23 * O(K) and K is the number of RT priority levels used in the system.
24 * (1 <= K <= 99)
25 *
26 * This list is really a list of lists:
27 *
28 * - The tier 1 list is the prio_list, different priority nodes.
29 *
30 * - The tier 2 list is the node_list, serialized nodes.
31 *
32 * Simple ASCII art explanation:
33 *
34 * |HEAD |
35 * | |
36 * |prio_list.prev|<------------------------------------|
37 * |prio_list.next|<->|pl|<->|pl|<--------------->|pl|<-|
38 * |10 | |10| |21| |21| |21| |40| (prio)
39 * | | | | | | | | | | | |
40 * | | | | | | | | | | | |
41 * |node_list.next|<->|nl|<->|nl|<->|nl|<->|nl|<->|nl|<-|
42 * |node_list.prev|<------------------------------------|
43 *
44 * The nodes on the prio_list list are sorted by priority to simplify
45 * the insertion of new nodes. There are no nodes with duplicate
46 * priorites on the list.
47 *
48 * The nodes on the node_list is ordered by priority and can contain
49 * entries which have the same priority. Those entries are ordered
50 * FIFO
51 *
52 * Addition means: look for the prio_list node in the prio_list
53 * for the priority of the node and insert it before the node_list
54 * entry of the next prio_list node. If it is the first node of
55 * that priority, add it to the prio_list in the right position and
56 * insert it into the serialized node_list list
57 *
58 * Removal means remove it from the node_list and remove it from
59 * the prio_list if the node_list list_head is non empty. In case
60 * of removal from the prio_list it must be checked whether other
61 * entries of the same priority are on the list or not. If there
62 * is another entry of the same priority then this entry has to
63 * replace the removed entry on the prio_list. If the entry which
64 * is removed is the only entry of this priority then a simple
65 * remove from both list is sufficient.
66 *
67 * INT_MIN is the highest priority, 0 is the medium highest, INT_MAX
68 * is lowest priority.
69 *
70 * No locking is done, up to the caller.
71 *
72 */
73#ifndef _LINUX_PLIST_H_
74#define _LINUX_PLIST_H_
75
76#include <linux/kernel.h>
77#include <linux/list.h>
78#include <linux/spinlock_types.h>
79
80struct plist_head {
81 struct list_head prio_list;
82 struct list_head node_list;
83#ifdef CONFIG_DEBUG_PI_LIST
84 spinlock_t *lock;
85#endif
86};
87
88struct plist_node {
89 int prio;
90 struct plist_head plist;
91};
92
93#ifdef CONFIG_DEBUG_PI_LIST
94# define PLIST_HEAD_LOCK_INIT(_lock) .lock = _lock
95#else
96# define PLIST_HEAD_LOCK_INIT(_lock)
97#endif
98
99/**
100 * #PLIST_HEAD_INIT - static struct plist_head initializer
101 *
102 * @head: struct plist_head variable name
103 */
104#define PLIST_HEAD_INIT(head, _lock) \
105{ \
106 .prio_list = LIST_HEAD_INIT((head).prio_list), \
107 .node_list = LIST_HEAD_INIT((head).node_list), \
108 PLIST_HEAD_LOCK_INIT(&(_lock)) \
109}
110
111/**
112 * #PLIST_NODE_INIT - static struct plist_node initializer
113 *
114 * @node: struct plist_node variable name
115 * @__prio: initial node priority
116 */
117#define PLIST_NODE_INIT(node, __prio) \
118{ \
119 .prio = (__prio), \
120 .plist = PLIST_HEAD_INIT((node).plist, NULL), \
121}
122
123/**
124 * plist_head_init - dynamic struct plist_head initializer
125 *
126 * @head: &struct plist_head pointer
127 */
128static inline void
129plist_head_init(struct plist_head *head, spinlock_t *lock)
130{
131 INIT_LIST_HEAD(&head->prio_list);
132 INIT_LIST_HEAD(&head->node_list);
133#ifdef CONFIG_DEBUG_PI_LIST
134 head->lock = lock;
135#endif
136}
137
138/**
139 * plist_node_init - Dynamic struct plist_node initializer
140 *
141 * @node: &struct plist_node pointer
142 * @prio: initial node priority
143 */
144static inline void plist_node_init(struct plist_node *node, int prio)
145{
146 node->prio = prio;
147 plist_head_init(&node->plist, NULL);
148}
149
150extern void plist_add(struct plist_node *node, struct plist_head *head);
151extern void plist_del(struct plist_node *node, struct plist_head *head);
152
153/**
154 * plist_for_each - iterate over the plist
155 *
156 * @pos1: the type * to use as a loop counter.
157 * @head: the head for your list.
158 */
159#define plist_for_each(pos, head) \
160 list_for_each_entry(pos, &(head)->node_list, plist.node_list)
161
162/**
163 * plist_for_each_entry_safe - iterate over a plist of given type safe
164 * against removal of list entry
165 *
166 * @pos1: the type * to use as a loop counter.
167 * @n1: another type * to use as temporary storage
168 * @head: the head for your list.
169 */
170#define plist_for_each_safe(pos, n, head) \
171 list_for_each_entry_safe(pos, n, &(head)->node_list, plist.node_list)
172
173/**
174 * plist_for_each_entry - iterate over list of given type
175 *
176 * @pos: the type * to use as a loop counter.
177 * @head: the head for your list.
178 * @member: the name of the list_struct within the struct.
179 */
180#define plist_for_each_entry(pos, head, mem) \
181 list_for_each_entry(pos, &(head)->node_list, mem.plist.node_list)
182
183/**
184 * plist_for_each_entry_safe - iterate over list of given type safe against
185 * removal of list entry
186 *
187 * @pos: the type * to use as a loop counter.
188 * @n: another type * to use as temporary storage
189 * @head: the head for your list.
190 * @m: the name of the list_struct within the struct.
191 */
192#define plist_for_each_entry_safe(pos, n, head, m) \
193 list_for_each_entry_safe(pos, n, &(head)->node_list, m.plist.node_list)
194
195/**
196 * plist_head_empty - return !0 if a plist_head is empty
197 *
198 * @head: &struct plist_head pointer
199 */
200static inline int plist_head_empty(const struct plist_head *head)
201{
202 return list_empty(&head->node_list);
203}
204
205/**
206 * plist_node_empty - return !0 if plist_node is not on a list
207 *
208 * @node: &struct plist_node pointer
209 */
210static inline int plist_node_empty(const struct plist_node *node)
211{
212 return plist_head_empty(&node->plist);
213}
214
215/* All functions below assume the plist_head is not empty. */
216
217/**
218 * plist_first_entry - get the struct for the first entry
219 *
220 * @ptr: the &struct plist_head pointer.
221 * @type: the type of the struct this is embedded in.
222 * @member: the name of the list_struct within the struct.
223 */
224#ifdef CONFIG_DEBUG_PI_LIST
225# define plist_first_entry(head, type, member) \
226({ \
227 WARN_ON(plist_head_empty(head)); \
228 container_of(plist_first(head), type, member); \
229})
230#else
231# define plist_first_entry(head, type, member) \
232 container_of(plist_first(head), type, member)
233#endif
234
235/**
236 * plist_first - return the first node (and thus, highest priority)
237 *
238 * @head: the &struct plist_head pointer
239 *
240 * Assumes the plist is _not_ empty.
241 */
242static inline struct plist_node* plist_first(const struct plist_head *head)
243{
244 return list_entry(head->node_list.next,
245 struct plist_node, plist.node_list);
246}
247
248#endif
diff --git a/include/linux/poison.h b/include/linux/poison.h
new file mode 100644
index 000000000000..a5347c02432e
--- /dev/null
+++ b/include/linux/poison.h
@@ -0,0 +1,58 @@
1#ifndef _LINUX_POISON_H
2#define _LINUX_POISON_H
3
4/********** include/linux/list.h **********/
5/*
6 * These are non-NULL pointers that will result in page faults
7 * under normal circumstances, used to verify that nobody uses
8 * non-initialized list entries.
9 */
10#define LIST_POISON1 ((void *) 0x00100100)
11#define LIST_POISON2 ((void *) 0x00200200)
12
13/********** mm/slab.c **********/
14/*
15 * Magic nums for obj red zoning.
16 * Placed in the first word before and the first word after an obj.
17 */
18#define RED_INACTIVE 0x5A2CF071UL /* when obj is inactive */
19#define RED_ACTIVE 0x170FC2A5UL /* when obj is active */
20
21/* ...and for poisoning */
22#define POISON_INUSE 0x5a /* for use-uninitialised poisoning */
23#define POISON_FREE 0x6b /* for use-after-free poisoning */
24#define POISON_END 0xa5 /* end-byte of poisoning */
25
26/********** arch/$ARCH/mm/init.c **********/
27#define POISON_FREE_INITMEM 0xcc
28
29/********** arch/x86_64/mm/init.c **********/
30#define POISON_FREE_INITDATA 0xba
31
32/********** arch/ia64/hp/common/sba_iommu.c **********/
33/*
34 * arch/ia64/hp/common/sba_iommu.c uses a 16-byte poison string with a
35 * value of "SBAIOMMU POISON\0" for spill-over poisoning.
36 */
37
38/********** fs/jbd/journal.c **********/
39#define JBD_POISON_FREE 0x5b
40
41/********** drivers/base/dmapool.c **********/
42#define POOL_POISON_FREED 0xa7 /* !inuse */
43#define POOL_POISON_ALLOCATED 0xa9 /* !initted */
44
45/********** drivers/atm/ **********/
46#define ATM_POISON_FREE 0x12
47
48/********** kernel/mutexes **********/
49#define MUTEX_DEBUG_INIT 0x11
50#define MUTEX_DEBUG_FREE 0x22
51
52/********** security/ **********/
53#define KEY_DESTROY 0xbd
54
55/********** sound/oss/ **********/
56#define OSS_POISON_FREE 0xAB
57
58#endif
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 6312758393b6..48dfe00070c7 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -258,6 +258,7 @@ extern void rcu_init(void);
258extern void rcu_check_callbacks(int cpu, int user); 258extern void rcu_check_callbacks(int cpu, int user);
259extern void rcu_restart_cpu(int cpu); 259extern void rcu_restart_cpu(int cpu);
260extern long rcu_batches_completed(void); 260extern long rcu_batches_completed(void);
261extern long rcu_batches_completed_bh(void);
261 262
262/* Exported interfaces */ 263/* Exported interfaces */
263extern void FASTCALL(call_rcu(struct rcu_head *head, 264extern void FASTCALL(call_rcu(struct rcu_head *head,
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index 5676c4210e2c..daa2d83cefe8 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -1973,7 +1973,7 @@ void reiserfs_unmap_buffer(struct buffer_head *);
1973/* file.c */ 1973/* file.c */
1974extern struct inode_operations reiserfs_file_inode_operations; 1974extern struct inode_operations reiserfs_file_inode_operations;
1975extern const struct file_operations reiserfs_file_operations; 1975extern const struct file_operations reiserfs_file_operations;
1976extern struct address_space_operations reiserfs_address_space_operations; 1976extern const struct address_space_operations reiserfs_address_space_operations;
1977 1977
1978/* fix_nodes.c */ 1978/* fix_nodes.c */
1979 1979
diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h
new file mode 100644
index 000000000000..fa4a3b82ba70
--- /dev/null
+++ b/include/linux/rtmutex.h
@@ -0,0 +1,117 @@
1/*
2 * RT Mutexes: blocking mutual exclusion locks with PI support
3 *
4 * started by Ingo Molnar and Thomas Gleixner:
5 *
6 * Copyright (C) 2004-2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com>
7 * Copyright (C) 2006, Timesys Corp., Thomas Gleixner <tglx@timesys.com>
8 *
9 * This file contains the public data structure and API definitions.
10 */
11
12#ifndef __LINUX_RT_MUTEX_H
13#define __LINUX_RT_MUTEX_H
14
15#include <linux/linkage.h>
16#include <linux/plist.h>
17#include <linux/spinlock_types.h>
18
19/*
20 * The rt_mutex structure
21 *
22 * @wait_lock: spinlock to protect the structure
23 * @wait_list: pilist head to enqueue waiters in priority order
24 * @owner: the mutex owner
25 */
26struct rt_mutex {
27 spinlock_t wait_lock;
28 struct plist_head wait_list;
29 struct task_struct *owner;
30#ifdef CONFIG_DEBUG_RT_MUTEXES
31 int save_state;
32 struct list_head held_list_entry;
33 unsigned long acquire_ip;
34 const char *name, *file;
35 int line;
36 void *magic;
37#endif
38};
39
40struct rt_mutex_waiter;
41struct hrtimer_sleeper;
42
43#ifdef CONFIG_DEBUG_RT_MUTEXES
44 extern int rt_mutex_debug_check_no_locks_freed(const void *from,
45 unsigned long len);
46 extern void rt_mutex_debug_check_no_locks_held(struct task_struct *task);
47#else
48 static inline int rt_mutex_debug_check_no_locks_freed(const void *from,
49 unsigned long len)
50 {
51 return 0;
52 }
53# define rt_mutex_debug_check_no_locks_held(task) do { } while (0)
54#endif
55
56#ifdef CONFIG_DEBUG_RT_MUTEXES
57# define __DEBUG_RT_MUTEX_INITIALIZER(mutexname) \
58 , .name = #mutexname, .file = __FILE__, .line = __LINE__
59# define rt_mutex_init(mutex) __rt_mutex_init(mutex, __FUNCTION__)
60 extern void rt_mutex_debug_task_free(struct task_struct *tsk);
61#else
62# define __DEBUG_RT_MUTEX_INITIALIZER(mutexname)
63# define rt_mutex_init(mutex) __rt_mutex_init(mutex, NULL)
64# define rt_mutex_debug_task_free(t) do { } while (0)
65#endif
66
67#define __RT_MUTEX_INITIALIZER(mutexname) \
68 { .wait_lock = SPIN_LOCK_UNLOCKED \
69 , .wait_list = PLIST_HEAD_INIT(mutexname.wait_list, mutexname.wait_lock) \
70 , .owner = NULL \
71 __DEBUG_RT_MUTEX_INITIALIZER(mutexname)}
72
73#define DEFINE_RT_MUTEX(mutexname) \
74 struct rt_mutex mutexname = __RT_MUTEX_INITIALIZER(mutexname)
75
76/***
77 * rt_mutex_is_locked - is the mutex locked
78 * @lock: the mutex to be queried
79 *
80 * Returns 1 if the mutex is locked, 0 if unlocked.
81 */
82static inline int rt_mutex_is_locked(struct rt_mutex *lock)
83{
84 return lock->owner != NULL;
85}
86
87extern void __rt_mutex_init(struct rt_mutex *lock, const char *name);
88extern void rt_mutex_destroy(struct rt_mutex *lock);
89
90extern void rt_mutex_lock(struct rt_mutex *lock);
91extern int rt_mutex_lock_interruptible(struct rt_mutex *lock,
92 int detect_deadlock);
93extern int rt_mutex_timed_lock(struct rt_mutex *lock,
94 struct hrtimer_sleeper *timeout,
95 int detect_deadlock);
96
97extern int rt_mutex_trylock(struct rt_mutex *lock);
98
99extern void rt_mutex_unlock(struct rt_mutex *lock);
100
101#ifdef CONFIG_DEBUG_RT_MUTEXES
102# define INIT_RT_MUTEX_DEBUG(tsk) \
103 .held_list_head = LIST_HEAD_INIT(tsk.held_list_head), \
104 .held_list_lock = SPIN_LOCK_UNLOCKED
105#else
106# define INIT_RT_MUTEX_DEBUG(tsk)
107#endif
108
109#ifdef CONFIG_RT_MUTEXES
110# define INIT_RT_MUTEXES(tsk) \
111 .pi_waiters = PLIST_HEAD_INIT(tsk.pi_waiters, tsk.pi_lock), \
112 INIT_RT_MUTEX_DEBUG(tsk)
113#else
114# define INIT_RT_MUTEXES(tsk)
115#endif
116
117#endif
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 122a25c1b997..821f0481ebe1 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -73,6 +73,7 @@ struct sched_param {
73#include <linux/seccomp.h> 73#include <linux/seccomp.h>
74#include <linux/rcupdate.h> 74#include <linux/rcupdate.h>
75#include <linux/futex.h> 75#include <linux/futex.h>
76#include <linux/rtmutex.h>
76 77
77#include <linux/time.h> 78#include <linux/time.h>
78#include <linux/param.h> 79#include <linux/param.h>
@@ -83,6 +84,7 @@ struct sched_param {
83#include <asm/processor.h> 84#include <asm/processor.h>
84 85
85struct exec_domain; 86struct exec_domain;
87struct futex_pi_state;
86 88
87/* 89/*
88 * List of flags we want to share for kernel threads, 90 * List of flags we want to share for kernel threads,
@@ -123,6 +125,7 @@ extern unsigned long nr_running(void);
123extern unsigned long nr_uninterruptible(void); 125extern unsigned long nr_uninterruptible(void);
124extern unsigned long nr_active(void); 126extern unsigned long nr_active(void);
125extern unsigned long nr_iowait(void); 127extern unsigned long nr_iowait(void);
128extern unsigned long weighted_cpuload(const int cpu);
126 129
127 130
128/* 131/*
@@ -494,8 +497,11 @@ struct signal_struct {
494 497
495#define MAX_PRIO (MAX_RT_PRIO + 40) 498#define MAX_PRIO (MAX_RT_PRIO + 40)
496 499
497#define rt_task(p) (unlikely((p)->prio < MAX_RT_PRIO)) 500#define rt_prio(prio) unlikely((prio) < MAX_RT_PRIO)
501#define rt_task(p) rt_prio((p)->prio)
498#define batch_task(p) (unlikely((p)->policy == SCHED_BATCH)) 502#define batch_task(p) (unlikely((p)->policy == SCHED_BATCH))
503#define has_rt_policy(p) \
504 unlikely((p)->policy != SCHED_NORMAL && (p)->policy != SCHED_BATCH)
499 505
500/* 506/*
501 * Some day this will be a full-fledged user tracking system.. 507 * Some day this will be a full-fledged user tracking system..
@@ -558,9 +564,9 @@ enum idle_type
558/* 564/*
559 * sched-domains (multiprocessor balancing) declarations: 565 * sched-domains (multiprocessor balancing) declarations:
560 */ 566 */
561#ifdef CONFIG_SMP
562#define SCHED_LOAD_SCALE 128UL /* increase resolution of load */ 567#define SCHED_LOAD_SCALE 128UL /* increase resolution of load */
563 568
569#ifdef CONFIG_SMP
564#define SD_LOAD_BALANCE 1 /* Do load balancing on this domain. */ 570#define SD_LOAD_BALANCE 1 /* Do load balancing on this domain. */
565#define SD_BALANCE_NEWIDLE 2 /* Balance when about to become idle */ 571#define SD_BALANCE_NEWIDLE 2 /* Balance when about to become idle */
566#define SD_BALANCE_EXEC 4 /* Balance on exec */ 572#define SD_BALANCE_EXEC 4 /* Balance on exec */
@@ -569,6 +575,11 @@ enum idle_type
569#define SD_WAKE_AFFINE 32 /* Wake task to waking CPU */ 575#define SD_WAKE_AFFINE 32 /* Wake task to waking CPU */
570#define SD_WAKE_BALANCE 64 /* Perform balancing at task wakeup */ 576#define SD_WAKE_BALANCE 64 /* Perform balancing at task wakeup */
571#define SD_SHARE_CPUPOWER 128 /* Domain members share cpu power */ 577#define SD_SHARE_CPUPOWER 128 /* Domain members share cpu power */
578#define SD_POWERSAVINGS_BALANCE 256 /* Balance for power savings */
579
580#define BALANCE_FOR_POWER ((sched_mc_power_savings || sched_smt_power_savings) \
581 ? SD_POWERSAVINGS_BALANCE : 0)
582
572 583
573struct sched_group { 584struct sched_group {
574 struct sched_group *next; /* Must be a circular list */ 585 struct sched_group *next; /* Must be a circular list */
@@ -638,7 +649,7 @@ struct sched_domain {
638#endif 649#endif
639}; 650};
640 651
641extern void partition_sched_domains(cpumask_t *partition1, 652extern int partition_sched_domains(cpumask_t *partition1,
642 cpumask_t *partition2); 653 cpumask_t *partition2);
643 654
644/* 655/*
@@ -713,10 +724,13 @@ struct task_struct {
713 724
714 int lock_depth; /* BKL lock depth */ 725 int lock_depth; /* BKL lock depth */
715 726
716#if defined(CONFIG_SMP) && defined(__ARCH_WANT_UNLOCKED_CTXSW) 727#ifdef CONFIG_SMP
728#ifdef __ARCH_WANT_UNLOCKED_CTXSW
717 int oncpu; 729 int oncpu;
718#endif 730#endif
719 int prio, static_prio; 731#endif
732 int load_weight; /* for niceness load balancing purposes */
733 int prio, static_prio, normal_prio;
720 struct list_head run_list; 734 struct list_head run_list;
721 prio_array_t *array; 735 prio_array_t *array;
722 736
@@ -843,6 +857,20 @@ struct task_struct {
843/* Protection of (de-)allocation: mm, files, fs, tty, keyrings */ 857/* Protection of (de-)allocation: mm, files, fs, tty, keyrings */
844 spinlock_t alloc_lock; 858 spinlock_t alloc_lock;
845 859
860 /* Protection of the PI data structures: */
861 spinlock_t pi_lock;
862
863#ifdef CONFIG_RT_MUTEXES
864 /* PI waiters blocked on a rt_mutex held by this task */
865 struct plist_head pi_waiters;
866 /* Deadlock detection and priority inheritance handling */
867 struct rt_mutex_waiter *pi_blocked_on;
868# ifdef CONFIG_DEBUG_RT_MUTEXES
869 spinlock_t held_list_lock;
870 struct list_head held_list_head;
871# endif
872#endif
873
846#ifdef CONFIG_DEBUG_MUTEXES 874#ifdef CONFIG_DEBUG_MUTEXES
847 /* mutex deadlock detection */ 875 /* mutex deadlock detection */
848 struct mutex_waiter *blocked_on; 876 struct mutex_waiter *blocked_on;
@@ -888,6 +916,8 @@ struct task_struct {
888#ifdef CONFIG_COMPAT 916#ifdef CONFIG_COMPAT
889 struct compat_robust_list_head __user *compat_robust_list; 917 struct compat_robust_list_head __user *compat_robust_list;
890#endif 918#endif
919 struct list_head pi_state_list;
920 struct futex_pi_state *pi_state_cache;
891 921
892 atomic_t fs_excl; /* holding fs exclusive resources */ 922 atomic_t fs_excl; /* holding fs exclusive resources */
893 struct rcu_head rcu; 923 struct rcu_head rcu;
@@ -955,6 +985,7 @@ static inline void put_task_struct(struct task_struct *t)
955#define PF_SPREAD_PAGE 0x01000000 /* Spread page cache over cpuset */ 985#define PF_SPREAD_PAGE 0x01000000 /* Spread page cache over cpuset */
956#define PF_SPREAD_SLAB 0x02000000 /* Spread some slab caches over cpuset */ 986#define PF_SPREAD_SLAB 0x02000000 /* Spread some slab caches over cpuset */
957#define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */ 987#define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */
988#define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */
958 989
959/* 990/*
960 * Only the _current_ task can read/write to tsk->flags, but other 991 * Only the _current_ task can read/write to tsk->flags, but other
@@ -1009,6 +1040,19 @@ static inline void idle_task_exit(void) {}
1009#endif 1040#endif
1010 1041
1011extern void sched_idle_next(void); 1042extern void sched_idle_next(void);
1043
1044#ifdef CONFIG_RT_MUTEXES
1045extern int rt_mutex_getprio(task_t *p);
1046extern void rt_mutex_setprio(task_t *p, int prio);
1047extern void rt_mutex_adjust_pi(task_t *p);
1048#else
1049static inline int rt_mutex_getprio(task_t *p)
1050{
1051 return p->normal_prio;
1052}
1053# define rt_mutex_adjust_pi(p) do { } while (0)
1054#endif
1055
1012extern void set_user_nice(task_t *p, long nice); 1056extern void set_user_nice(task_t *p, long nice);
1013extern int task_prio(const task_t *p); 1057extern int task_prio(const task_t *p);
1014extern int task_nice(const task_t *p); 1058extern int task_nice(const task_t *p);
@@ -1408,6 +1452,11 @@ static inline void arch_pick_mmap_layout(struct mm_struct *mm)
1408extern long sched_setaffinity(pid_t pid, cpumask_t new_mask); 1452extern long sched_setaffinity(pid_t pid, cpumask_t new_mask);
1409extern long sched_getaffinity(pid_t pid, cpumask_t *mask); 1453extern long sched_getaffinity(pid_t pid, cpumask_t *mask);
1410 1454
1455#include <linux/sysdev.h>
1456extern int sched_mc_power_savings, sched_smt_power_savings;
1457extern struct sysdev_attribute attr_sched_mc_power_savings, attr_sched_smt_power_savings;
1458extern int sched_create_sysfs_power_savings_entries(struct sysdev_class *cls);
1459
1411extern void normalize_rt_tasks(void); 1460extern void normalize_rt_tasks(void);
1412 1461
1413#ifdef CONFIG_PM 1462#ifdef CONFIG_PM
diff --git a/include/linux/scx200.h b/include/linux/scx200.h
index a22f9e173ad2..693c0557e70b 100644
--- a/include/linux/scx200.h
+++ b/include/linux/scx200.h
@@ -49,10 +49,3 @@ extern unsigned scx200_cb_base;
49#define SCx200_REV 0x3d /* Revision Register */ 49#define SCx200_REV 0x3d /* Revision Register */
50#define SCx200_CBA 0x3e /* Configuration Base Address Register */ 50#define SCx200_CBA 0x3e /* Configuration Base Address Register */
51#define SCx200_CBA_SCRATCH 0x64 /* Configuration Base Address Scratchpad */ 51#define SCx200_CBA_SCRATCH 0x64 /* Configuration Base Address Scratchpad */
52
53/*
54 Local variables:
55 compile-command: "make -C ../.. bzImage modules"
56 c-basic-offset: 8
57 End:
58*/
diff --git a/include/linux/scx200_gpio.h b/include/linux/scx200_gpio.h
index 30cdd648ba79..90dd069cc145 100644
--- a/include/linux/scx200_gpio.h
+++ b/include/linux/scx200_gpio.h
@@ -1,6 +1,6 @@
1#include <linux/spinlock.h> 1#include <linux/spinlock.h>
2 2
3u32 scx200_gpio_configure(int index, u32 set, u32 clear); 3u32 scx200_gpio_configure(unsigned index, u32 set, u32 clear);
4 4
5extern unsigned scx200_gpio_base; 5extern unsigned scx200_gpio_base;
6extern long scx200_gpio_shadow[2]; 6extern long scx200_gpio_shadow[2];
@@ -17,7 +17,7 @@ extern long scx200_gpio_shadow[2];
17 17
18/* returns the value of the GPIO pin */ 18/* returns the value of the GPIO pin */
19 19
20static inline int scx200_gpio_get(int index) { 20static inline int scx200_gpio_get(unsigned index) {
21 __SCx200_GPIO_BANK; 21 __SCx200_GPIO_BANK;
22 __SCx200_GPIO_IOADDR + 0x04; 22 __SCx200_GPIO_IOADDR + 0x04;
23 __SCx200_GPIO_INDEX; 23 __SCx200_GPIO_INDEX;
@@ -29,7 +29,7 @@ static inline int scx200_gpio_get(int index) {
29 driven if the GPIO is configured as an output, it might not be the 29 driven if the GPIO is configured as an output, it might not be the
30 state of the GPIO right now if the GPIO is configured as an input) */ 30 state of the GPIO right now if the GPIO is configured as an input) */
31 31
32static inline int scx200_gpio_current(int index) { 32static inline int scx200_gpio_current(unsigned index) {
33 __SCx200_GPIO_BANK; 33 __SCx200_GPIO_BANK;
34 __SCx200_GPIO_INDEX; 34 __SCx200_GPIO_INDEX;
35 35
@@ -38,7 +38,7 @@ static inline int scx200_gpio_current(int index) {
38 38
39/* drive the GPIO signal high */ 39/* drive the GPIO signal high */
40 40
41static inline void scx200_gpio_set_high(int index) { 41static inline void scx200_gpio_set_high(unsigned index) {
42 __SCx200_GPIO_BANK; 42 __SCx200_GPIO_BANK;
43 __SCx200_GPIO_IOADDR; 43 __SCx200_GPIO_IOADDR;
44 __SCx200_GPIO_SHADOW; 44 __SCx200_GPIO_SHADOW;
@@ -49,7 +49,7 @@ static inline void scx200_gpio_set_high(int index) {
49 49
50/* drive the GPIO signal low */ 50/* drive the GPIO signal low */
51 51
52static inline void scx200_gpio_set_low(int index) { 52static inline void scx200_gpio_set_low(unsigned index) {
53 __SCx200_GPIO_BANK; 53 __SCx200_GPIO_BANK;
54 __SCx200_GPIO_IOADDR; 54 __SCx200_GPIO_IOADDR;
55 __SCx200_GPIO_SHADOW; 55 __SCx200_GPIO_SHADOW;
@@ -60,7 +60,7 @@ static inline void scx200_gpio_set_low(int index) {
60 60
61/* drive the GPIO signal to state */ 61/* drive the GPIO signal to state */
62 62
63static inline void scx200_gpio_set(int index, int state) { 63static inline void scx200_gpio_set(unsigned index, int state) {
64 __SCx200_GPIO_BANK; 64 __SCx200_GPIO_BANK;
65 __SCx200_GPIO_IOADDR; 65 __SCx200_GPIO_IOADDR;
66 __SCx200_GPIO_SHADOW; 66 __SCx200_GPIO_SHADOW;
@@ -73,7 +73,7 @@ static inline void scx200_gpio_set(int index, int state) {
73} 73}
74 74
75/* toggle the GPIO signal */ 75/* toggle the GPIO signal */
76static inline void scx200_gpio_change(int index) { 76static inline void scx200_gpio_change(unsigned index) {
77 __SCx200_GPIO_BANK; 77 __SCx200_GPIO_BANK;
78 __SCx200_GPIO_IOADDR; 78 __SCx200_GPIO_IOADDR;
79 __SCx200_GPIO_SHADOW; 79 __SCx200_GPIO_SHADOW;
@@ -87,10 +87,3 @@ static inline void scx200_gpio_change(int index) {
87#undef __SCx200_GPIO_SHADOW 87#undef __SCx200_GPIO_SHADOW
88#undef __SCx200_GPIO_INDEX 88#undef __SCx200_GPIO_INDEX
89#undef __SCx200_GPIO_OUT 89#undef __SCx200_GPIO_OUT
90
91/*
92 Local variables:
93 compile-command: "make -C ../.. bzImage modules"
94 c-basic-offset: 8
95 End:
96*/
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index e928c0dcc297..c8bb68099eb9 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -642,10 +642,14 @@ struct spi_board_info {
642 u16 bus_num; 642 u16 bus_num;
643 u16 chip_select; 643 u16 chip_select;
644 644
645 /* mode becomes spi_device.mode, and is essential for chips
646 * where the default of SPI_CS_HIGH = 0 is wrong.
647 */
648 u8 mode;
649
645 /* ... may need additional spi_device chip config data here. 650 /* ... may need additional spi_device chip config data here.
646 * avoid stuff protocol drivers can set; but include stuff 651 * avoid stuff protocol drivers can set; but include stuff
647 * needed to behave without being bound to a driver: 652 * needed to behave without being bound to a driver:
648 * - chipselect polarity
649 * - quirks like clock rate mattering when not selected 653 * - quirks like clock rate mattering when not selected
650 */ 654 */
651}; 655};
diff --git a/include/linux/swap.h b/include/linux/swap.h
index dc3f3aa0c83e..c41e2d6d1acc 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -199,6 +199,8 @@ static inline int zone_reclaim(struct zone *z, gfp_t mask, unsigned int order)
199} 199}
200#endif 200#endif
201 201
202extern int kswapd_run(int nid);
203
202#ifdef CONFIG_MMU 204#ifdef CONFIG_MMU
203/* linux/mm/shmem.c */ 205/* linux/mm/shmem.c */
204extern int shmem_unuse(swp_entry_t entry, struct page *page); 206extern int shmem_unuse(swp_entry_t entry, struct page *page);
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 33785b79d548..008f04c56737 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -174,9 +174,9 @@ asmlinkage long sys_waitid(int which, pid_t pid,
174 int options, struct rusage __user *ru); 174 int options, struct rusage __user *ru);
175asmlinkage long sys_waitpid(pid_t pid, int __user *stat_addr, int options); 175asmlinkage long sys_waitpid(pid_t pid, int __user *stat_addr, int options);
176asmlinkage long sys_set_tid_address(int __user *tidptr); 176asmlinkage long sys_set_tid_address(int __user *tidptr);
177asmlinkage long sys_futex(u32 __user *uaddr, int op, int val, 177asmlinkage long sys_futex(u32 __user *uaddr, int op, u32 val,
178 struct timespec __user *utime, u32 __user *uaddr2, 178 struct timespec __user *utime, u32 __user *uaddr2,
179 int val3); 179 u32 val3);
180 180
181asmlinkage long sys_init_module(void __user *umod, unsigned long len, 181asmlinkage long sys_init_module(void __user *umod, unsigned long len,
182 const char __user *uargs); 182 const char __user *uargs);
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 349ef908a222..46e4d8f2771f 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -149,6 +149,7 @@ enum
149 KERN_ACPI_VIDEO_FLAGS=71, /* int: flags for setting up video after ACPI sleep */ 149 KERN_ACPI_VIDEO_FLAGS=71, /* int: flags for setting up video after ACPI sleep */
150 KERN_IA64_UNALIGNED=72, /* int: ia64 unaligned userland trap enable */ 150 KERN_IA64_UNALIGNED=72, /* int: ia64 unaligned userland trap enable */
151 KERN_COMPAT_LOG=73, /* int: print compat layer messages */ 151 KERN_COMPAT_LOG=73, /* int: print compat layer messages */
152 KERN_MAX_LOCK_DEPTH=74,
152}; 153};
153 154
154 155
@@ -189,6 +190,7 @@ enum
189 VM_ZONE_RECLAIM_MODE=31, /* reclaim local zone memory before going off node */ 190 VM_ZONE_RECLAIM_MODE=31, /* reclaim local zone memory before going off node */
190 VM_ZONE_RECLAIM_INTERVAL=32, /* time period to wait after reclaim failure */ 191 VM_ZONE_RECLAIM_INTERVAL=32, /* time period to wait after reclaim failure */
191 VM_PANIC_ON_OOM=33, /* panic at out-of-memory */ 192 VM_PANIC_ON_OOM=33, /* panic at out-of-memory */
193 VM_VDSO_ENABLED=34, /* map VDSO into new processes? */
192}; 194};
193 195
194 196
diff --git a/include/linux/topology.h b/include/linux/topology.h
index a305ae2e44b6..ec1eca85290a 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -134,7 +134,8 @@
134 .flags = SD_LOAD_BALANCE \ 134 .flags = SD_LOAD_BALANCE \
135 | SD_BALANCE_NEWIDLE \ 135 | SD_BALANCE_NEWIDLE \
136 | SD_BALANCE_EXEC \ 136 | SD_BALANCE_EXEC \
137 | SD_WAKE_AFFINE, \ 137 | SD_WAKE_AFFINE \
138 | BALANCE_FOR_POWER, \
138 .last_balance = jiffies, \ 139 .last_balance = jiffies, \
139 .balance_interval = 1, \ 140 .balance_interval = 1, \
140 .nr_balance_failed = 0, \ 141 .nr_balance_failed = 0, \
diff --git a/include/linux/tty.h b/include/linux/tty.h
index cb35ca50a0a6..b3b807e4b050 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -57,7 +57,6 @@ struct tty_buffer {
57 unsigned char *flag_buf_ptr; 57 unsigned char *flag_buf_ptr;
58 int used; 58 int used;
59 int size; 59 int size;
60 int active;
61 int commit; 60 int commit;
62 int read; 61 int read;
63 /* Data points here */ 62 /* Data points here */
@@ -259,7 +258,6 @@ struct tty_struct {
259#define TTY_DO_WRITE_WAKEUP 5 /* Call write_wakeup after queuing new */ 258#define TTY_DO_WRITE_WAKEUP 5 /* Call write_wakeup after queuing new */
260#define TTY_PUSH 6 /* n_tty private */ 259#define TTY_PUSH 6 /* n_tty private */
261#define TTY_CLOSING 7 /* ->close() in progress */ 260#define TTY_CLOSING 7 /* ->close() in progress */
262#define TTY_DONT_FLIP 8 /* Defer buffer flip */
263#define TTY_LDISC 9 /* Line discipline attached */ 261#define TTY_LDISC 9 /* Line discipline attached */
264#define TTY_HW_COOK_OUT 14 /* Hardware can do output cooking */ 262#define TTY_HW_COOK_OUT 14 /* Hardware can do output cooking */
265#define TTY_HW_COOK_IN 15 /* Hardware can do input cooking */ 263#define TTY_HW_COOK_IN 15 /* Hardware can do input cooking */
diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h
index 31548303ee37..eb677cf56106 100644
--- a/include/linux/tty_flip.h
+++ b/include/linux/tty_flip.h
@@ -12,7 +12,7 @@ static inline int tty_insert_flip_char(struct tty_struct *tty,
12 unsigned char ch, char flag) 12 unsigned char ch, char flag)
13{ 13{
14 struct tty_buffer *tb = tty->buf.tail; 14 struct tty_buffer *tb = tty->buf.tail;
15 if (tb && tb->active && tb->used < tb->size) { 15 if (tb && tb->used < tb->size) {
16 tb->flag_buf_ptr[tb->used] = flag; 16 tb->flag_buf_ptr[tb->used] = flag;
17 tb->char_buf_ptr[tb->used++] = ch; 17 tb->char_buf_ptr[tb->used++] = ch;
18 return 1; 18 return 1;
diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h
index 914f911325be..e39b7cc43390 100644
--- a/include/linux/ufs_fs.h
+++ b/include/linux/ufs_fs.h
@@ -966,7 +966,7 @@ extern void ufs_set_link(struct inode *dir, struct ufs_dir_entry *de,
966extern struct inode_operations ufs_file_inode_operations; 966extern struct inode_operations ufs_file_inode_operations;
967extern const struct file_operations ufs_file_operations; 967extern const struct file_operations ufs_file_operations;
968 968
969extern struct address_space_operations ufs_aops; 969extern const struct address_space_operations ufs_aops;
970 970
971/* ialloc.c */ 971/* ialloc.c */
972extern void ufs_free_inode (struct inode *inode); 972extern void ufs_free_inode (struct inode *inode);
diff --git a/include/linux/watchdog.h b/include/linux/watchdog.h
index 1192ed8f4fe8..011bcfeb9f09 100644
--- a/include/linux/watchdog.h
+++ b/include/linux/watchdog.h
@@ -28,6 +28,9 @@ struct watchdog_info {
28#define WDIOC_KEEPALIVE _IOR(WATCHDOG_IOCTL_BASE, 5, int) 28#define WDIOC_KEEPALIVE _IOR(WATCHDOG_IOCTL_BASE, 5, int)
29#define WDIOC_SETTIMEOUT _IOWR(WATCHDOG_IOCTL_BASE, 6, int) 29#define WDIOC_SETTIMEOUT _IOWR(WATCHDOG_IOCTL_BASE, 6, int)
30#define WDIOC_GETTIMEOUT _IOR(WATCHDOG_IOCTL_BASE, 7, int) 30#define WDIOC_GETTIMEOUT _IOR(WATCHDOG_IOCTL_BASE, 7, int)
31#define WDIOC_SETPRETIMEOUT _IOWR(WATCHDOG_IOCTL_BASE, 8, int)
32#define WDIOC_GETPRETIMEOUT _IOR(WATCHDOG_IOCTL_BASE, 9, int)
33#define WDIOC_GETTIMELEFT _IOR(WATCHDOG_IOCTL_BASE, 10, int)
31 34
32#define WDIOF_UNKNOWN -1 /* Unknown flag error */ 35#define WDIOF_UNKNOWN -1 /* Unknown flag error */
33#define WDIOS_UNKNOWN -1 /* Unknown status error */ 36#define WDIOS_UNKNOWN -1 /* Unknown status error */
@@ -38,9 +41,10 @@ struct watchdog_info {
38#define WDIOF_EXTERN2 0x0008 /* External relay 2 */ 41#define WDIOF_EXTERN2 0x0008 /* External relay 2 */
39#define WDIOF_POWERUNDER 0x0010 /* Power bad/power fault */ 42#define WDIOF_POWERUNDER 0x0010 /* Power bad/power fault */
40#define WDIOF_CARDRESET 0x0020 /* Card previously reset the CPU */ 43#define WDIOF_CARDRESET 0x0020 /* Card previously reset the CPU */
41#define WDIOF_POWEROVER 0x0040 /* Power over voltage */ 44#define WDIOF_POWEROVER 0x0040 /* Power over voltage */
42#define WDIOF_SETTIMEOUT 0x0080 /* Set timeout (in seconds) */ 45#define WDIOF_SETTIMEOUT 0x0080 /* Set timeout (in seconds) */
43#define WDIOF_MAGICCLOSE 0x0100 /* Supports magic close char */ 46#define WDIOF_MAGICCLOSE 0x0100 /* Supports magic close char */
47#define WDIOF_PRETIMEOUT 0x0200 /* Pretimeout (in seconds), get/set */
44#define WDIOF_KEEPALIVEPING 0x8000 /* Keep alive ping reply */ 48#define WDIOF_KEEPALIVEPING 0x8000 /* Keep alive ping reply */
45 49
46#define WDIOS_DISABLECARD 0x0001 /* Turn off the watchdog timer */ 50#define WDIOS_DISABLECARD 0x0001 /* Turn off the watchdog timer */
diff --git a/include/media/cx2341x.h b/include/media/cx2341x.h
index 074c4008ad52..d91d88f93c8b 100644
--- a/include/media/cx2341x.h
+++ b/include/media/cx2341x.h
@@ -89,9 +89,9 @@ int cx2341x_ctrl_query(struct cx2341x_mpeg_params *params,
89 struct v4l2_queryctrl *qctrl); 89 struct v4l2_queryctrl *qctrl);
90const char **cx2341x_ctrl_get_menu(u32 id); 90const char **cx2341x_ctrl_get_menu(u32 id);
91int cx2341x_ext_ctrls(struct cx2341x_mpeg_params *params, 91int cx2341x_ext_ctrls(struct cx2341x_mpeg_params *params,
92 struct v4l2_ext_controls *ctrls, int cmd); 92 struct v4l2_ext_controls *ctrls, unsigned int cmd);
93void cx2341x_fill_defaults(struct cx2341x_mpeg_params *p); 93void cx2341x_fill_defaults(struct cx2341x_mpeg_params *p);
94void cx2341x_log_status(struct cx2341x_mpeg_params *p, int cardid); 94void cx2341x_log_status(struct cx2341x_mpeg_params *p, const char *prefix);
95 95
96/* Firmware names */ 96/* Firmware names */
97#define CX2341X_FIRM_ENC_FILENAME "v4l-cx2341x-enc.fw" 97#define CX2341X_FIRM_ENC_FILENAME "v4l-cx2341x-enc.fw"