aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2006-06-29 19:57:46 -0400
committerLen Brown <len.brown@intel.com>2006-06-29 19:57:46 -0400
commitd120cfb544ed6161b9d32fb6c4648c471807ee6b (patch)
tree7757ad0198d8df76ff5c60f939a687687c41da00 /include
parent9dce0e950dbfab4148f35ac6f297d8638cdc63c4 (diff)
parentbf7e8511088963078484132636839b59e25cf14f (diff)
merge linus into release branch
Conflicts: drivers/acpi/acpi_memhotplug.c
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/mach/pci.h2
-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/asmmacro.h4
-rw-r--r--include/asm-mips/cpu-features.h20
-rw-r--r--include/asm-mips/fixmap.h4
-rw-r--r--include/asm-mips/hazards.h4
-rw-r--r--include/asm-mips/hw_irq.h8
-rw-r--r--include/asm-mips/irq.h4
-rw-r--r--include/asm-mips/mach-au1x00/au1xxx_psc.h2
-rw-r--r--include/asm-mips/mach-mips/irq.h6
-rw-r--r--include/asm-mips/mipsregs.h3
-rw-r--r--include/asm-mips/sn/ioc3.h2
-rw-r--r--include/asm-mips/sn/klconfig.h10
-rw-r--r--include/asm-mips/stackframe.h16
-rw-r--r--include/asm-mips/unistd.h15
-rw-r--r--include/asm-parisc/assembly.h2
-rw-r--r--include/asm-parisc/compat.h11
-rw-r--r--include/asm-parisc/hw_irq.h9
-rw-r--r--include/asm-parisc/irq.h5
-rw-r--r--include/asm-parisc/pdc.h21
-rw-r--r--include/asm-parisc/pgtable.h8
-rw-r--r--include/asm-parisc/processor.h14
-rw-r--r--include/asm-parisc/system.h26
-rw-r--r--include/asm-parisc/uaccess.h9
-rw-r--r--include/asm-parisc/unistd.h5
-rw-r--r--include/asm-powerpc/cputable.h48
-rw-r--r--include/asm-powerpc/hw_irq.h18
-rw-r--r--include/asm-powerpc/irq.h5
-rw-r--r--include/asm-powerpc/iseries/it_lp_queue.h40
-rw-r--r--include/asm-powerpc/kdump.h2
-rw-r--r--include/asm-powerpc/kexec.h9
-rw-r--r--include/asm-powerpc/machdep.h2
-rw-r--r--include/asm-powerpc/mmu.h1
-rw-r--r--include/asm-powerpc/mmu_context.h7
-rw-r--r--include/asm-powerpc/mpc86xx.h5
-rw-r--r--include/asm-powerpc/pci.h2
-rw-r--r--include/asm-powerpc/rtas.h3
-rw-r--r--include/asm-powerpc/time.h6
-rw-r--r--include/asm-powerpc/todc.h487
-rw-r--r--include/asm-powerpc/topology.h5
-rw-r--r--include/asm-powerpc/tsi108.h109
-rw-r--r--include/asm-powerpc/udbg.h3
-rw-r--r--include/asm-ppc/ocp.h1
-rw-r--r--include/asm-ppc/pci.h2
-rw-r--r--include/asm-s390/bitops.h42
-rw-r--r--include/asm-s390/cio.h2
-rw-r--r--include/asm-s390/cmb.h4
-rw-r--r--include/asm-s390/dasd.h8
-rw-r--r--include/asm-s390/thread_info.h1
-rw-r--r--include/asm-s390/unistd.h4
-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/compat_ioctl.h5
-rw-r--r--include/linux/cpu.h14
-rw-r--r--include/linux/devfs_fs.h41
-rw-r--r--include/linux/devfs_fs_kernel.h57
-rw-r--r--include/linux/dmaengine.h2
-rw-r--r--include/linux/efs_fs.h2
-rw-r--r--include/linux/elf-em.h5
-rw-r--r--include/linux/fb.h1
-rw-r--r--include/linux/fs.h4
-rw-r--r--include/linux/futex.h12
-rw-r--r--include/linux/genhd.h2
-rw-r--r--include/linux/ide.h2
-rw-r--r--include/linux/init_task.h3
-rw-r--r--include/linux/interrupt.h14
-rw-r--r--include/linux/ioport.h30
-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/miscdevice.h1
-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.h13
-rw-r--r--include/linux/pci_ids.h2
-rw-r--r--include/linux/plist.h248
-rw-r--r--include/linux/pnp.h7
-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/serial_core.h1
-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_driver.h14
-rw-r--r--include/linux/tty_flip.h2
-rw-r--r--include/linux/types.h7
-rw-r--r--include/linux/ufs_fs.h2
-rw-r--r--include/linux/watchdog.h10
-rw-r--r--include/media/cx2341x.h4
-rw-r--r--include/media/v4l2-dev.h1
-rw-r--r--include/sound/ac97_codec.h1
-rw-r--r--include/sound/ak4xxx-adda.h35
-rw-r--r--include/sound/initval.h3
170 files changed, 2537 insertions, 845 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/mach/pci.h b/include/asm-arm/mach/pci.h
index 25d540ed0079..923e0ca66200 100644
--- a/include/asm-arm/mach/pci.h
+++ b/include/asm-arm/mach/pci.h
@@ -28,7 +28,7 @@ struct hw_pci {
28struct pci_sys_data { 28struct pci_sys_data {
29 struct list_head node; 29 struct list_head node;
30 int busnr; /* primary bus number */ 30 int busnr; /* primary bus number */
31 unsigned long mem_offset; /* bus->cpu memory mapping offset */ 31 u64 mem_offset; /* bus->cpu memory mapping offset */
32 unsigned long io_offset; /* bus->cpu IO mapping offset */ 32 unsigned long io_offset; /* bus->cpu IO mapping offset */
33 struct pci_bus *bus; /* PCI bus */ 33 struct pci_bus *bus; /* PCI bus */
34 struct resource *resource[3]; /* Primary PCI bus resources */ 34 struct resource *resource[3]; /* Primary PCI bus resources */
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/asmmacro.h b/include/asm-mips/asmmacro.h
index 2c42f6b00a49..92e62ef711ed 100644
--- a/include/asm-mips/asmmacro.h
+++ b/include/asm-mips/asmmacro.h
@@ -26,14 +26,14 @@
26 ori \reg, \reg, TCSTATUS_IXMT 26 ori \reg, \reg, TCSTATUS_IXMT
27 xori \reg, \reg, TCSTATUS_IXMT 27 xori \reg, \reg, TCSTATUS_IXMT
28 mtc0 \reg, CP0_TCSTATUS 28 mtc0 \reg, CP0_TCSTATUS
29 ehb 29 _ehb
30 .endm 30 .endm
31 31
32 .macro local_irq_disable reg=t0 32 .macro local_irq_disable reg=t0
33 mfc0 \reg, CP0_TCSTATUS 33 mfc0 \reg, CP0_TCSTATUS
34 ori \reg, \reg, TCSTATUS_IXMT 34 ori \reg, \reg, TCSTATUS_IXMT
35 mtc0 \reg, CP0_TCSTATUS 35 mtc0 \reg, CP0_TCSTATUS
36 ehb 36 _ehb
37 .endm 37 .endm
38#else 38#else
39 .macro local_irq_enable reg=t0 39 .macro local_irq_enable reg=t0
diff --git a/include/asm-mips/cpu-features.h b/include/asm-mips/cpu-features.h
index 881ce1f9803d..44285a9d5520 100644
--- a/include/asm-mips/cpu-features.h
+++ b/include/asm-mips/cpu-features.h
@@ -187,19 +187,15 @@
187# endif 187# endif
188#endif 188#endif
189 189
190#ifdef CONFIG_CPU_MIPSR2 190#if defined(CONFIG_CPU_MIPSR2_IRQ_VI) && !defined(cpu_has_vint)
191# if defined(CONFIG_CPU_MIPSR2_IRQ_VI) && !defined(cpu_has_vint) 191# define cpu_has_vint (cpu_data[0].options & MIPS_CPU_VINT)
192# define cpu_has_vint (cpu_data[0].options & MIPS_CPU_VINT) 192#elif !defined(cpu_has_vint)
193# else
194# define cpu_has_vint 0
195# endif
196# if defined(CONFIG_CPU_MIPSR2_IRQ_EI) && !defined(cpu_has_veic)
197# define cpu_has_veic (cpu_data[0].options & MIPS_CPU_VEIC)
198# else
199# define cpu_has_veic 0
200# endif
201#else
202# define cpu_has_vint 0 193# define cpu_has_vint 0
194#endif
195
196#if defined(CONFIG_CPU_MIPSR2_IRQ_EI) && !defined(cpu_has_veic)
197# define cpu_has_veic (cpu_data[0].options & MIPS_CPU_VEIC)
198#elif !defined(cpu_has_veic)
203# define cpu_has_veic 0 199# define cpu_has_veic 0
204#endif 200#endif
205 201
diff --git a/include/asm-mips/fixmap.h b/include/asm-mips/fixmap.h
index 1cadefbbc037..6959bdb59310 100644
--- a/include/asm-mips/fixmap.h
+++ b/include/asm-mips/fixmap.h
@@ -69,7 +69,11 @@ extern void __set_fixmap (enum fixed_addresses idx,
69 * the start of the fixmap, and leave one page empty 69 * the start of the fixmap, and leave one page empty
70 * at the top of mem.. 70 * at the top of mem..
71 */ 71 */
72#if defined(CONFIG_CPU_TX39XX) || defined(CONFIG_CPU_TX49XX)
73#define FIXADDR_TOP (0xff000000UL - 0x2000)
74#else
72#define FIXADDR_TOP (0xffffe000UL) 75#define FIXADDR_TOP (0xffffe000UL)
76#endif
73#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT) 77#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
74#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE) 78#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
75 79
diff --git a/include/asm-mips/hazards.h b/include/asm-mips/hazards.h
index 66943c451c1d..25f5e8a4177d 100644
--- a/include/asm-mips/hazards.h
+++ b/include/asm-mips/hazards.h
@@ -69,10 +69,10 @@
69 * Use a macro for ehb unless explicit support for MIPSR2 is enabled 69 * Use a macro for ehb unless explicit support for MIPSR2 is enabled
70 */ 70 */
71 71
72#define irq_enable_hazard 72#define irq_enable_hazard \
73 _ehb 73 _ehb
74 74
75#define irq_disable_hazard 75#define irq_disable_hazard \
76 _ehb 76 _ehb
77 77
78#elif defined(CONFIG_CPU_R10000) || defined(CONFIG_CPU_RM9000) 78#elif defined(CONFIG_CPU_R10000) || defined(CONFIG_CPU_RM9000)
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/irq.h b/include/asm-mips/irq.h
index d35c61776a02..896550bad322 100644
--- a/include/asm-mips/irq.h
+++ b/include/asm-mips/irq.h
@@ -76,4 +76,8 @@ extern int setup_irq_smtc(unsigned int irq, struct irqaction * new,
76 unsigned long hwmask); 76 unsigned long hwmask);
77#endif /* CONFIG_MIPS_MT_SMTC */ 77#endif /* CONFIG_MIPS_MT_SMTC */
78 78
79#ifdef CONFIG_SMP
80#define ARCH_HAS_IRQ_PER_CPU
81#endif
82
79#endif /* _ASM_IRQ_H */ 83#endif /* _ASM_IRQ_H */
diff --git a/include/asm-mips/mach-au1x00/au1xxx_psc.h b/include/asm-mips/mach-au1x00/au1xxx_psc.h
index d7cbacdd21fe..1bd4e27caf6b 100644
--- a/include/asm-mips/mach-au1x00/au1xxx_psc.h
+++ b/include/asm-mips/mach-au1x00/au1xxx_psc.h
@@ -512,7 +512,7 @@ typedef struct psc_smb {
512 512
513/* Transmit register control. 513/* Transmit register control.
514*/ 514*/
515#define PSC_SMBTXRX_RSR (1 << 30) 515#define PSC_SMBTXRX_RSR (1 << 28)
516#define PSC_SMBTXRX_STP (1 << 29) 516#define PSC_SMBTXRX_STP (1 << 29)
517#define PSC_SMBTXRX_DATAMASK (0xff) 517#define PSC_SMBTXRX_DATAMASK (0xff)
518 518
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-mips/mipsregs.h b/include/asm-mips/mipsregs.h
index 673977901ed3..9192d76c133d 100644
--- a/include/asm-mips/mipsregs.h
+++ b/include/asm-mips/mipsregs.h
@@ -1459,7 +1459,8 @@ static inline void __emt(unsigned int previous)
1459static inline void __ehb(void) 1459static inline void __ehb(void)
1460{ 1460{
1461 __asm__ __volatile__( 1461 __asm__ __volatile__(
1462 " ehb \n"); 1462 " .set mips32r2 \n"
1463 " ehb \n" " .set mips0 \n");
1463} 1464}
1464 1465
1465/* 1466/*
diff --git a/include/asm-mips/sn/ioc3.h b/include/asm-mips/sn/ioc3.h
index f7d530f306f2..099677774d71 100644
--- a/include/asm-mips/sn/ioc3.h
+++ b/include/asm-mips/sn/ioc3.h
@@ -5,6 +5,8 @@
5#ifndef _IOC3_H 5#ifndef _IOC3_H
6#define _IOC3_H 6#define _IOC3_H
7 7
8#include <linux/types.h>
9
8/* SUPERIO uart register map */ 10/* SUPERIO uart register map */
9typedef volatile struct ioc3_uartregs { 11typedef volatile struct ioc3_uartregs {
10 union { 12 union {
diff --git a/include/asm-mips/sn/klconfig.h b/include/asm-mips/sn/klconfig.h
index 52238e65af8e..b63cd0655b3d 100644
--- a/include/asm-mips/sn/klconfig.h
+++ b/include/asm-mips/sn/klconfig.h
@@ -602,7 +602,7 @@ typedef struct klcpu_s { /* CPU */
602 602
603typedef struct klhub_s { /* HUB */ 603typedef struct klhub_s { /* HUB */
604 klinfo_t hub_info; 604 klinfo_t hub_info;
605 uint hub_flags; /* PCFG_HUB_xxx flags */ 605 unsigned int hub_flags; /* PCFG_HUB_xxx flags */
606 klport_t hub_port; /* hub is connected to this */ 606 klport_t hub_port; /* hub is connected to this */
607 nic_t hub_box_nic; /* nic of containing box */ 607 nic_t hub_box_nic; /* nic of containing box */
608 klconf_off_t hub_mfg_nic; /* MFG NIC string */ 608 klconf_off_t hub_mfg_nic; /* MFG NIC string */
@@ -611,7 +611,7 @@ typedef struct klhub_s { /* HUB */
611 611
612typedef struct klhub_uart_s { /* HUB */ 612typedef struct klhub_uart_s { /* HUB */
613 klinfo_t hubuart_info; 613 klinfo_t hubuart_info;
614 uint hubuart_flags; /* PCFG_HUB_xxx flags */ 614 unsigned int hubuart_flags; /* PCFG_HUB_xxx flags */
615 nic_t hubuart_box_nic; /* nic of containing box */ 615 nic_t hubuart_box_nic; /* nic of containing box */
616} klhub_uart_t ; 616} klhub_uart_t ;
617 617
@@ -710,7 +710,7 @@ typedef struct klvmed_s { /* VME DEVICE - VME BOARD */
710/* XXX - Don't we need the number of ports here?!? */ 710/* XXX - Don't we need the number of ports here?!? */
711typedef struct klrou_s { /* ROUTER */ 711typedef struct klrou_s { /* ROUTER */
712 klinfo_t rou_info ; 712 klinfo_t rou_info ;
713 uint rou_flags ; /* PCFG_ROUTER_xxx flags */ 713 unsigned int rou_flags ; /* PCFG_ROUTER_xxx flags */
714 nic_t rou_box_nic ; /* nic of the containing module */ 714 nic_t rou_box_nic ; /* nic of the containing module */
715 klport_t rou_port[MAX_ROUTER_PORTS + 1] ; /* array index 1 to 6 */ 715 klport_t rou_port[MAX_ROUTER_PORTS + 1] ; /* array index 1 to 6 */
716 klconf_off_t rou_mfg_nic ; /* MFG NIC string */ 716 klconf_off_t rou_mfg_nic ; /* MFG NIC string */
@@ -733,8 +733,8 @@ typedef struct klgfx_s { /* GRAPHICS Device */
733 klinfo_t gfx_info; 733 klinfo_t gfx_info;
734 klconf_off_t old_gndevs; /* for compatibility with older proms */ 734 klconf_off_t old_gndevs; /* for compatibility with older proms */
735 klconf_off_t old_gdoff0; /* for compatibility with older proms */ 735 klconf_off_t old_gdoff0; /* for compatibility with older proms */
736 uint cookie; /* for compatibility with older proms */ 736 unsigned int cookie; /* for compatibility with older proms */
737 uint moduleslot; 737 unsigned int moduleslot;
738 struct klgfx_s *gfx_next_pipe; 738 struct klgfx_s *gfx_next_pipe;
739 graphics_t gfx_specific; 739 graphics_t gfx_specific;
740 klconf_off_t pad0; /* for compatibility with older proms */ 740 klconf_off_t pad0; /* for compatibility with older proms */
diff --git a/include/asm-mips/stackframe.h b/include/asm-mips/stackframe.h
index 513aa5133830..158a4cd12e46 100644
--- a/include/asm-mips/stackframe.h
+++ b/include/asm-mips/stackframe.h
@@ -304,7 +304,7 @@
304 mfc0 v0, CP0_TCSTATUS 304 mfc0 v0, CP0_TCSTATUS
305 ori v0, TCSTATUS_IXMT 305 ori v0, TCSTATUS_IXMT
306 mtc0 v0, CP0_TCSTATUS 306 mtc0 v0, CP0_TCSTATUS
307 ehb 307 _ehb
308 DMT 5 # dmt a1 308 DMT 5 # dmt a1
309 jal mips_ihb 309 jal mips_ihb
310#endif /* CONFIG_MIPS_MT_SMTC */ 310#endif /* CONFIG_MIPS_MT_SMTC */
@@ -325,14 +325,14 @@
325 * restore TCStatus.IXMT. 325 * restore TCStatus.IXMT.
326 */ 326 */
327 LONG_L v1, PT_TCSTATUS(sp) 327 LONG_L v1, PT_TCSTATUS(sp)
328 ehb 328 _ehb
329 mfc0 v0, CP0_TCSTATUS 329 mfc0 v0, CP0_TCSTATUS
330 andi v1, TCSTATUS_IXMT 330 andi v1, TCSTATUS_IXMT
331 /* We know that TCStatua.IXMT should be set from above */ 331 /* We know that TCStatua.IXMT should be set from above */
332 xori v0, v0, TCSTATUS_IXMT 332 xori v0, v0, TCSTATUS_IXMT
333 or v0, v0, v1 333 or v0, v0, v1
334 mtc0 v0, CP0_TCSTATUS 334 mtc0 v0, CP0_TCSTATUS
335 ehb 335 _ehb
336 andi a1, a1, VPECONTROL_TE 336 andi a1, a1, VPECONTROL_TE
337 beqz a1, 1f 337 beqz a1, 1f
338 emt 338 emt
@@ -411,7 +411,7 @@
411 /* Clear TKSU, leave IXMT */ 411 /* Clear TKSU, leave IXMT */
412 xori t0, 0x00001800 412 xori t0, 0x00001800
413 mtc0 t0, CP0_TCSTATUS 413 mtc0 t0, CP0_TCSTATUS
414 ehb 414 _ehb
415 /* We need to leave the global IE bit set, but clear EXL...*/ 415 /* We need to leave the global IE bit set, but clear EXL...*/
416 mfc0 t0, CP0_STATUS 416 mfc0 t0, CP0_STATUS
417 ori t0, ST0_EXL | ST0_ERL 417 ori t0, ST0_EXL | ST0_ERL
@@ -438,7 +438,7 @@
438 * and enable interrupts only for the 438 * and enable interrupts only for the
439 * current TC, using the TCStatus register. 439 * current TC, using the TCStatus register.
440 */ 440 */
441 ehb 441 _ehb
442 mfc0 t0,CP0_TCSTATUS 442 mfc0 t0,CP0_TCSTATUS
443 /* Fortunately CU 0 is in the same place in both registers */ 443 /* Fortunately CU 0 is in the same place in both registers */
444 /* Set TCU0, TKSU (for later inversion) and IXMT */ 444 /* Set TCU0, TKSU (for later inversion) and IXMT */
@@ -447,7 +447,7 @@
447 /* Clear TKSU *and* IXMT */ 447 /* Clear TKSU *and* IXMT */
448 xori t0, 0x00001c00 448 xori t0, 0x00001c00
449 mtc0 t0, CP0_TCSTATUS 449 mtc0 t0, CP0_TCSTATUS
450 ehb 450 _ehb
451 /* We need to leave the global IE bit set, but clear EXL...*/ 451 /* We need to leave the global IE bit set, but clear EXL...*/
452 mfc0 t0, CP0_STATUS 452 mfc0 t0, CP0_STATUS
453 ori t0, ST0_EXL 453 ori t0, ST0_EXL
@@ -479,7 +479,7 @@
479 andi v1, v0, TCSTATUS_IXMT 479 andi v1, v0, TCSTATUS_IXMT
480 ori v0, TCSTATUS_IXMT 480 ori v0, TCSTATUS_IXMT
481 mtc0 v0, CP0_TCSTATUS 481 mtc0 v0, CP0_TCSTATUS
482 ehb 482 _ehb
483 DMT 2 # dmt v0 483 DMT 2 # dmt v0
484 /* 484 /*
485 * We don't know a priori if ra is "live" 485 * We don't know a priori if ra is "live"
@@ -495,7 +495,7 @@
495 xori t0, 0x1e 495 xori t0, 0x1e
496 mtc0 t0, CP0_STATUS 496 mtc0 t0, CP0_STATUS
497#ifdef CONFIG_MIPS_MT_SMTC 497#ifdef CONFIG_MIPS_MT_SMTC
498 ehb 498 _ehb
499 andi v0, v0, VPECONTROL_TE 499 andi v0, v0, VPECONTROL_TE
500 beqz v0, 2f 500 beqz v0, 2f
501 nop /* delay slot */ 501 nop /* delay slot */
diff --git a/include/asm-mips/unistd.h b/include/asm-mips/unistd.h
index 8bb0bb9b2e68..809f9f55bacb 100644
--- a/include/asm-mips/unistd.h
+++ b/include/asm-mips/unistd.h
@@ -326,16 +326,17 @@
326#define __NR_unshare (__NR_Linux + 303) 326#define __NR_unshare (__NR_Linux + 303)
327#define __NR_splice (__NR_Linux + 304) 327#define __NR_splice (__NR_Linux + 304)
328#define __NR_sync_file_range (__NR_Linux + 305) 328#define __NR_sync_file_range (__NR_Linux + 305)
329#define __NR_tee (__NR_Linux + 306)
329 330
330/* 331/*
331 * Offset of the last Linux o32 flavoured syscall 332 * Offset of the last Linux o32 flavoured syscall
332 */ 333 */
333#define __NR_Linux_syscalls 305 334#define __NR_Linux_syscalls 306
334 335
335#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ 336#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
336 337
337#define __NR_O32_Linux 4000 338#define __NR_O32_Linux 4000
338#define __NR_O32_Linux_syscalls 305 339#define __NR_O32_Linux_syscalls 306
339 340
340#if _MIPS_SIM == _MIPS_SIM_ABI64 341#if _MIPS_SIM == _MIPS_SIM_ABI64
341 342
@@ -608,16 +609,17 @@
608#define __NR_unshare (__NR_Linux + 262) 609#define __NR_unshare (__NR_Linux + 262)
609#define __NR_splice (__NR_Linux + 263) 610#define __NR_splice (__NR_Linux + 263)
610#define __NR_sync_file_range (__NR_Linux + 264) 611#define __NR_sync_file_range (__NR_Linux + 264)
612#define __NR_tee (__NR_Linux + 265)
611 613
612/* 614/*
613 * Offset of the last Linux 64-bit flavoured syscall 615 * Offset of the last Linux 64-bit flavoured syscall
614 */ 616 */
615#define __NR_Linux_syscalls 264 617#define __NR_Linux_syscalls 265
616 618
617#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ 619#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
618 620
619#define __NR_64_Linux 5000 621#define __NR_64_Linux 5000
620#define __NR_64_Linux_syscalls 264 622#define __NR_64_Linux_syscalls 265
621 623
622#if _MIPS_SIM == _MIPS_SIM_NABI32 624#if _MIPS_SIM == _MIPS_SIM_NABI32
623 625
@@ -894,16 +896,17 @@
894#define __NR_unshare (__NR_Linux + 266) 896#define __NR_unshare (__NR_Linux + 266)
895#define __NR_splice (__NR_Linux + 267) 897#define __NR_splice (__NR_Linux + 267)
896#define __NR_sync_file_range (__NR_Linux + 268) 898#define __NR_sync_file_range (__NR_Linux + 268)
899#define __NR_tee (__NR_Linux + 269)
897 900
898/* 901/*
899 * Offset of the last N32 flavoured syscall 902 * Offset of the last N32 flavoured syscall
900 */ 903 */
901#define __NR_Linux_syscalls 268 904#define __NR_Linux_syscalls 269
902 905
903#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ 906#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
904 907
905#define __NR_N32_Linux 6000 908#define __NR_N32_Linux 6000
906#define __NR_N32_Linux_syscalls 268 909#define __NR_N32_Linux_syscalls 269
907 910
908#ifdef __KERNEL__ 911#ifdef __KERNEL__
909 912
diff --git a/include/asm-parisc/assembly.h b/include/asm-parisc/assembly.h
index 3ce3440d1b0c..1a7bfe699e0c 100644
--- a/include/asm-parisc/assembly.h
+++ b/include/asm-parisc/assembly.h
@@ -48,6 +48,7 @@
48#define CALLEE_SAVE_FRAME_SIZE (CALLEE_REG_FRAME_SIZE + CALLEE_FLOAT_FRAME_SIZE) 48#define CALLEE_SAVE_FRAME_SIZE (CALLEE_REG_FRAME_SIZE + CALLEE_FLOAT_FRAME_SIZE)
49 49
50#ifdef CONFIG_PA20 50#ifdef CONFIG_PA20
51#define LDCW ldcw,co
51#define BL b,l 52#define BL b,l
52# ifdef CONFIG_64BIT 53# ifdef CONFIG_64BIT
53# define LEVEL 2.0w 54# define LEVEL 2.0w
@@ -55,6 +56,7 @@
55# define LEVEL 2.0 56# define LEVEL 2.0
56# endif 57# endif
57#else 58#else
59#define LDCW ldcw
58#define BL bl 60#define BL bl
59#define LEVEL 1.1 61#define LEVEL 1.1
60#endif 62#endif
diff --git a/include/asm-parisc/compat.h b/include/asm-parisc/compat.h
index 289624d8b2d4..71b4eeea205a 100644
--- a/include/asm-parisc/compat.h
+++ b/include/asm-parisc/compat.h
@@ -5,6 +5,7 @@
5 */ 5 */
6#include <linux/types.h> 6#include <linux/types.h>
7#include <linux/sched.h> 7#include <linux/sched.h>
8#include <linux/personality.h>
8 9
9#define COMPAT_USER_HZ 100 10#define COMPAT_USER_HZ 100
10 11
@@ -149,4 +150,14 @@ static __inline__ void __user *compat_alloc_user_space(long len)
149 return (void __user *)regs->gr[30]; 150 return (void __user *)regs->gr[30];
150} 151}
151 152
153static inline int __is_compat_task(struct task_struct *t)
154{
155 return personality(t->personality) == PER_LINUX32;
156}
157
158static inline int is_compat_task(void)
159{
160 return __is_compat_task(current);
161}
162
152#endif /* _ASM_PARISC_COMPAT_H */ 163#endif /* _ASM_PARISC_COMPAT_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-parisc/pdc.h b/include/asm-parisc/pdc.h
index 08364f957e7a..c9b2e35326ee 100644
--- a/include/asm-parisc/pdc.h
+++ b/include/asm-parisc/pdc.h
@@ -278,12 +278,11 @@ typedef struct {
278/* constants for OS (NVM...) */ 278/* constants for OS (NVM...) */
279#define OS_ID_NONE 0 /* Undefined OS ID */ 279#define OS_ID_NONE 0 /* Undefined OS ID */
280#define OS_ID_HPUX 1 /* HP-UX OS */ 280#define OS_ID_HPUX 1 /* HP-UX OS */
281#define OS_ID_LINUX OS_ID_HPUX /* just use the same value as hpux */
282#define OS_ID_MPEXL 2 /* MPE XL OS */ 281#define OS_ID_MPEXL 2 /* MPE XL OS */
283#define OS_ID_OSF 3 /* OSF OS */ 282#define OS_ID_OSF 3 /* OSF OS */
284#define OS_ID_HPRT 4 /* HP-RT OS */ 283#define OS_ID_HPRT 4 /* HP-RT OS */
285#define OS_ID_NOVEL 5 /* NOVELL OS */ 284#define OS_ID_NOVEL 5 /* NOVELL OS */
286#define OS_ID_NT 6 /* NT OS */ 285#define OS_ID_LINUX 6 /* Linux */
287 286
288 287
289/* constants for PDC_CHASSIS */ 288/* constants for PDC_CHASSIS */
@@ -352,8 +351,8 @@ struct pdc_cache_cf { /* for PDC_CACHE (I/D-caches) */
352 cc_wt : 1, /* 0 = WT-Dcache, 1 = WB-Dcache */ 351 cc_wt : 1, /* 0 = WT-Dcache, 1 = WB-Dcache */
353 cc_sh : 2, /* 0 = separate I/D-cache, else shared I/D-cache */ 352 cc_sh : 2, /* 0 = separate I/D-cache, else shared I/D-cache */
354 cc_cst : 3, /* 0 = incoherent D-cache, 1=coherent D-cache */ 353 cc_cst : 3, /* 0 = incoherent D-cache, 1=coherent D-cache */
355 cc_pad1 : 5, /* reserved */ 354 cc_pad1 : 10, /* reserved */
356 cc_assoc: 8; /* associativity of I/D-cache */ 355 cc_hv : 3; /* hversion dependent */
357}; 356};
358 357
359struct pdc_tlb_cf { /* for PDC_CACHE (I/D-TLB's) */ 358struct pdc_tlb_cf { /* for PDC_CACHE (I/D-TLB's) */
@@ -719,6 +718,7 @@ void setup_pdc(void); /* in inventory.c */
719int pdc_add_valid(unsigned long address); 718int pdc_add_valid(unsigned long address);
720int pdc_chassis_info(struct pdc_chassis_info *chassis_info, void *led_info, unsigned long len); 719int pdc_chassis_info(struct pdc_chassis_info *chassis_info, void *led_info, unsigned long len);
721int pdc_chassis_disp(unsigned long disp); 720int pdc_chassis_disp(unsigned long disp);
721int pdc_chassis_warn(unsigned long *warn);
722int pdc_coproc_cfg(struct pdc_coproc_cfg *pdc_coproc_info); 722int pdc_coproc_cfg(struct pdc_coproc_cfg *pdc_coproc_info);
723int pdc_iodc_read(unsigned long *actcnt, unsigned long hpa, unsigned int index, 723int pdc_iodc_read(unsigned long *actcnt, unsigned long hpa, unsigned int index,
724 void *iodc_data, unsigned int iodc_data_size); 724 void *iodc_data, unsigned int iodc_data_size);
@@ -732,6 +732,7 @@ int pdc_model_cpuid(unsigned long *cpu_id);
732int pdc_model_versions(unsigned long *versions, int id); 732int pdc_model_versions(unsigned long *versions, int id);
733int pdc_model_capabilities(unsigned long *capabilities); 733int pdc_model_capabilities(unsigned long *capabilities);
734int pdc_cache_info(struct pdc_cache_info *cache); 734int pdc_cache_info(struct pdc_cache_info *cache);
735int pdc_spaceid_bits(unsigned long *space_bits);
735#ifndef CONFIG_PA20 736#ifndef CONFIG_PA20
736int pdc_btlb_info(struct pdc_btlb_info *btlb); 737int pdc_btlb_info(struct pdc_btlb_info *btlb);
737int pdc_mem_map_hpa(struct pdc_memory_map *r_addr, struct pdc_module_path *mod_path); 738int pdc_mem_map_hpa(struct pdc_memory_map *r_addr, struct pdc_module_path *mod_path);
@@ -775,6 +776,18 @@ int pdc_sti_call(unsigned long func, unsigned long flags,
775 776
776extern void pdc_init(void); 777extern void pdc_init(void);
777 778
779static inline char * os_id_to_string(u16 os_id) {
780 switch(os_id) {
781 case OS_ID_NONE: return "No OS";
782 case OS_ID_HPUX: return "HP-UX";
783 case OS_ID_MPEXL: return "MPE-iX";
784 case OS_ID_OSF: return "OSF";
785 case OS_ID_HPRT: return "HP-RT";
786 case OS_ID_NOVEL: return "Novell Netware";
787 case OS_ID_LINUX: return "Linux";
788 default: return "Unknown";
789 }
790}
778#endif /* __ASSEMBLY__ */ 791#endif /* __ASSEMBLY__ */
779 792
780#endif /* _PARISC_PDC_H */ 793#endif /* _PARISC_PDC_H */
diff --git a/include/asm-parisc/pgtable.h b/include/asm-parisc/pgtable.h
index b6bcc672ba80..5066c54dae0a 100644
--- a/include/asm-parisc/pgtable.h
+++ b/include/asm-parisc/pgtable.h
@@ -506,13 +506,13 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr,
506 506
507/* TLB page size encoding - see table 3-1 in parisc20.pdf */ 507/* TLB page size encoding - see table 3-1 in parisc20.pdf */
508#define _PAGE_SIZE_ENCODING_4K 0 508#define _PAGE_SIZE_ENCODING_4K 0
509#define _PAGE_SIZE_ENCODING_16K 1 509#define _PAGE_SIZE_ENCODING_16K 1
510#define _PAGE_SIZE_ENCODING_64K 2 510#define _PAGE_SIZE_ENCODING_64K 2
511#define _PAGE_SIZE_ENCODING_256K 3 511#define _PAGE_SIZE_ENCODING_256K 3
512#define _PAGE_SIZE_ENCODING_1M 4 512#define _PAGE_SIZE_ENCODING_1M 4
513#define _PAGE_SIZE_ENCODING_4M 5 513#define _PAGE_SIZE_ENCODING_4M 5
514#define _PAGE_SIZE_ENCODING_16M 6 514#define _PAGE_SIZE_ENCODING_16M 6
515#define _PAGE_SIZE_ENCODING_64M 7 515#define _PAGE_SIZE_ENCODING_64M 7
516 516
517#if defined(CONFIG_PARISC_PAGE_SIZE_4KB) 517#if defined(CONFIG_PARISC_PAGE_SIZE_4KB)
518# define _PAGE_SIZE_ENCODING_DEFAULT _PAGE_SIZE_ENCODING_4K 518# define _PAGE_SIZE_ENCODING_DEFAULT _PAGE_SIZE_ENCODING_4K
diff --git a/include/asm-parisc/processor.h b/include/asm-parisc/processor.h
index ca49dc91f4fc..b73626f040da 100644
--- a/include/asm-parisc/processor.h
+++ b/include/asm-parisc/processor.h
@@ -26,14 +26,12 @@
26 * Default implementation of macro that returns current 26 * Default implementation of macro that returns current
27 * instruction pointer ("program counter"). 27 * instruction pointer ("program counter").
28 */ 28 */
29 29#ifdef CONFIG_PA20
30/* We cannot use MFIA as it was added for PA2.0 - prumpf 30#define current_ia(x) __asm__("mfia %0" : "=r"(x))
31 31#else /* mfia added in pa2.0 */
32 At one point there were no "0f/0b" type local symbols in gas for 32#define current_ia(x) __asm__("blr 0,%0\n\tnop" : "=r"(x))
33 PA-RISC. This is no longer true, but this still seems like the 33#endif
34 nicest way to implement this. */ 34#define current_text_addr() ({ void *pc; current_ia(pc); pc; })
35
36#define current_text_addr() ({ void *pc; __asm__("\n\tblr 0,%0\n\tnop":"=r" (pc)); pc; })
37 35
38#define TASK_SIZE (current->thread.task_size) 36#define TASK_SIZE (current->thread.task_size)
39#define TASK_UNMAPPED_BASE (current->thread.map_base) 37#define TASK_UNMAPPED_BASE (current->thread.map_base)
diff --git a/include/asm-parisc/system.h b/include/asm-parisc/system.h
index 863876134b2c..5fe2d2329ab5 100644
--- a/include/asm-parisc/system.h
+++ b/include/asm-parisc/system.h
@@ -155,13 +155,14 @@ static inline void set_eiem(unsigned long val)
155 type and dynamically select the 16-byte aligned int from the array 155 type and dynamically select the 16-byte aligned int from the array
156 for the semaphore. */ 156 for the semaphore. */
157 157
158#define __PA_LDCW_ALIGNMENT 16 158#define __PA_LDCW_ALIGNMENT 16
159#define __ldcw_align(a) ({ \ 159#define __ldcw_align(a) ({ \
160 unsigned long __ret = (unsigned long) &(a)->lock[0]; \ 160 unsigned long __ret = (unsigned long) &(a)->lock[0]; \
161 __ret = (__ret + __PA_LDCW_ALIGNMENT - 1) & ~(__PA_LDCW_ALIGNMENT - 1); \ 161 __ret = (__ret + __PA_LDCW_ALIGNMENT - 1) \
162 (volatile unsigned int *) __ret; \ 162 & ~(__PA_LDCW_ALIGNMENT - 1); \
163 (volatile unsigned int *) __ret; \
163}) 164})
164#define LDCW "ldcw" 165#define __LDCW "ldcw"
165 166
166#else /*CONFIG_PA20*/ 167#else /*CONFIG_PA20*/
167/* From: "Jim Hull" <jim.hull of hp.com> 168/* From: "Jim Hull" <jim.hull of hp.com>
@@ -171,17 +172,18 @@ static inline void set_eiem(unsigned long val)
171 they only require "natural" alignment (4-byte for ldcw, 8-byte for 172 they only require "natural" alignment (4-byte for ldcw, 8-byte for
172 ldcd). */ 173 ldcd). */
173 174
174#define __PA_LDCW_ALIGNMENT 4 175#define __PA_LDCW_ALIGNMENT 4
175#define __ldcw_align(a) ((volatile unsigned int *)a) 176#define __ldcw_align(a) ((volatile unsigned int *)a)
176#define LDCW "ldcw,co" 177#define __LDCW "ldcw,co"
177 178
178#endif /*!CONFIG_PA20*/ 179#endif /*!CONFIG_PA20*/
179 180
180/* LDCW, the only atomic read-write operation PA-RISC has. *sigh*. */ 181/* LDCW, the only atomic read-write operation PA-RISC has. *sigh*. */
181#define __ldcw(a) ({ \ 182#define __ldcw(a) ({ \
182 unsigned __ret; \ 183 unsigned __ret; \
183 __asm__ __volatile__(LDCW " 0(%1),%0" : "=r" (__ret) : "r" (a)); \ 184 __asm__ __volatile__(__LDCW " 0(%1),%0" \
184 __ret; \ 185 : "=r" (__ret) : "r" (a)); \
186 __ret; \
185}) 187})
186 188
187#ifdef CONFIG_SMP 189#ifdef CONFIG_SMP
diff --git a/include/asm-parisc/uaccess.h b/include/asm-parisc/uaccess.h
index f6c417c8c484..d973e8b3466c 100644
--- a/include/asm-parisc/uaccess.h
+++ b/include/asm-parisc/uaccess.h
@@ -172,7 +172,11 @@ struct exception_data {
172/* 172/*
173 * The "__put_user/kernel_asm()" macros tell gcc they read from memory 173 * The "__put_user/kernel_asm()" macros tell gcc they read from memory
174 * instead of writing. This is because they do not write to any memory 174 * instead of writing. This is because they do not write to any memory
175 * gcc knows about, so there are no aliasing issues. 175 * gcc knows about, so there are no aliasing issues. These macros must
176 * also be aware that "fixup_put_user_skip_[12]" are executed in the
177 * context of the fault, and any registers used there must be listed
178 * as clobbers. In this case only "r1" is used by the current routines.
179 * r8/r9 are already listed as err/val.
176 */ 180 */
177 181
178#ifdef __LP64__ 182#ifdef __LP64__
@@ -183,7 +187,8 @@ struct exception_data {
183 "\t.dword\t1b,fixup_put_user_skip_1\n" \ 187 "\t.dword\t1b,fixup_put_user_skip_1\n" \
184 "\t.previous" \ 188 "\t.previous" \
185 : "=r"(__pu_err) \ 189 : "=r"(__pu_err) \
186 : "r"(ptr), "r"(x), "0"(__pu_err)) 190 : "r"(ptr), "r"(x), "0"(__pu_err) \
191 : "r1")
187 192
188#define __put_user_asm(stx,x,ptr) \ 193#define __put_user_asm(stx,x,ptr) \
189 __asm__ __volatile__ ( \ 194 __asm__ __volatile__ ( \
diff --git a/include/asm-parisc/unistd.h b/include/asm-parisc/unistd.h
index 12b867238a47..27bcfad1c3e3 100644
--- a/include/asm-parisc/unistd.h
+++ b/include/asm-parisc/unistd.h
@@ -797,11 +797,6 @@
797 797
798#define SYS_ify(syscall_name) __NR_##syscall_name 798#define SYS_ify(syscall_name) __NR_##syscall_name
799 799
800/* Assume all syscalls are done from PIC code just to be
801 * safe. The worst case scenario is that you lose a register
802 * and save/restore r19 across the syscall. */
803#define PIC
804
805#ifndef ASM_LINE_SEP 800#ifndef ASM_LINE_SEP
806# define ASM_LINE_SEP ; 801# define ASM_LINE_SEP ;
807#endif 802#endif
diff --git a/include/asm-powerpc/cputable.h b/include/asm-powerpc/cputable.h
index fab41c280aa1..1ba3c9983614 100644
--- a/include/asm-powerpc/cputable.h
+++ b/include/asm-powerpc/cputable.h
@@ -117,38 +117,30 @@ extern void do_cpu_ftr_fixups(unsigned long offset);
117#define CPU_FTR_PPC_LE ASM_CONST(0x0000000000200000) 117#define CPU_FTR_PPC_LE ASM_CONST(0x0000000000200000)
118#define CPU_FTR_REAL_LE ASM_CONST(0x0000000000400000) 118#define CPU_FTR_REAL_LE ASM_CONST(0x0000000000400000)
119 119
120/*
121 * Add the 64-bit processor unique features in the top half of the word;
122 * on 32-bit, make the names available but defined to be 0.
123 */
120#ifdef __powerpc64__ 124#ifdef __powerpc64__
121/* Add the 64b processor unique features in the top half of the word */ 125#define LONG_ASM_CONST(x) ASM_CONST(x)
122#define CPU_FTR_SLB ASM_CONST(0x0000000100000000)
123#define CPU_FTR_16M_PAGE ASM_CONST(0x0000000200000000)
124#define CPU_FTR_TLBIEL ASM_CONST(0x0000000400000000)
125#define CPU_FTR_NOEXECUTE ASM_CONST(0x0000000800000000)
126#define CPU_FTR_IABR ASM_CONST(0x0000002000000000)
127#define CPU_FTR_MMCRA ASM_CONST(0x0000004000000000)
128#define CPU_FTR_CTRL ASM_CONST(0x0000008000000000)
129#define CPU_FTR_SMT ASM_CONST(0x0000010000000000)
130#define CPU_FTR_COHERENT_ICACHE ASM_CONST(0x0000020000000000)
131#define CPU_FTR_LOCKLESS_TLBIE ASM_CONST(0x0000040000000000)
132#define CPU_FTR_CI_LARGE_PAGE ASM_CONST(0x0000100000000000)
133#define CPU_FTR_PAUSE_ZERO ASM_CONST(0x0000200000000000)
134#define CPU_FTR_PURR ASM_CONST(0x0000400000000000)
135#else 126#else
136/* ensure on 32b processors the flags are available for compiling but 127#define LONG_ASM_CONST(x) 0
137 * don't do anything */
138#define CPU_FTR_SLB ASM_CONST(0x0)
139#define CPU_FTR_16M_PAGE ASM_CONST(0x0)
140#define CPU_FTR_TLBIEL ASM_CONST(0x0)
141#define CPU_FTR_NOEXECUTE ASM_CONST(0x0)
142#define CPU_FTR_IABR ASM_CONST(0x0)
143#define CPU_FTR_MMCRA ASM_CONST(0x0)
144#define CPU_FTR_CTRL ASM_CONST(0x0)
145#define CPU_FTR_SMT ASM_CONST(0x0)
146#define CPU_FTR_COHERENT_ICACHE ASM_CONST(0x0)
147#define CPU_FTR_LOCKLESS_TLBIE ASM_CONST(0x0)
148#define CPU_FTR_CI_LARGE_PAGE ASM_CONST(0x0)
149#define CPU_FTR_PURR ASM_CONST(0x0)
150#endif 128#endif
151 129
130#define CPU_FTR_SLB LONG_ASM_CONST(0x0000000100000000)
131#define CPU_FTR_16M_PAGE LONG_ASM_CONST(0x0000000200000000)
132#define CPU_FTR_TLBIEL LONG_ASM_CONST(0x0000000400000000)
133#define CPU_FTR_NOEXECUTE LONG_ASM_CONST(0x0000000800000000)
134#define CPU_FTR_IABR LONG_ASM_CONST(0x0000002000000000)
135#define CPU_FTR_MMCRA LONG_ASM_CONST(0x0000004000000000)
136#define CPU_FTR_CTRL LONG_ASM_CONST(0x0000008000000000)
137#define CPU_FTR_SMT LONG_ASM_CONST(0x0000010000000000)
138#define CPU_FTR_COHERENT_ICACHE LONG_ASM_CONST(0x0000020000000000)
139#define CPU_FTR_LOCKLESS_TLBIE LONG_ASM_CONST(0x0000040000000000)
140#define CPU_FTR_CI_LARGE_PAGE LONG_ASM_CONST(0x0000100000000000)
141#define CPU_FTR_PAUSE_ZERO LONG_ASM_CONST(0x0000200000000000)
142#define CPU_FTR_PURR LONG_ASM_CONST(0x0000400000000000)
143
152#ifndef __ASSEMBLY__ 144#ifndef __ASSEMBLY__
153 145
154#define CPU_FTR_PPCAS_ARCH_V2_BASE (CPU_FTR_SLB | \ 146#define CPU_FTR_PPCAS_ARCH_V2_BASE (CPU_FTR_SLB | \
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/iseries/it_lp_queue.h b/include/asm-powerpc/iseries/it_lp_queue.h
index b7c6fc12cce2..284c5a7db3ac 100644
--- a/include/asm-powerpc/iseries/it_lp_queue.h
+++ b/include/asm-powerpc/iseries/it_lp_queue.h
@@ -29,20 +29,20 @@
29 29
30struct HvLpEvent; 30struct HvLpEvent;
31 31
32#define ITMaxLpQueues 8 32#define IT_LP_MAX_QUEUES 8
33 33
34#define NotUsed 0 // Queue will not be used by PLIC 34#define IT_LP_NOT_USED 0 /* Queue will not be used by PLIC */
35#define DedicatedIo 1 // Queue dedicated to IO processor specified 35#define IT_LP_DEDICATED_IO 1 /* Queue dedicated to IO processor specified */
36#define DedicatedLp 2 // Queue dedicated to LP specified 36#define IT_LP_DEDICATED_LP 2 /* Queue dedicated to LP specified */
37#define Shared 3 // Queue shared for both IO and LP 37#define IT_LP_SHARED 3 /* Queue shared for both IO and LP */
38 38
39#define LpEventStackSize 4096 39#define IT_LP_EVENT_STACK_SIZE 4096
40#define LpEventMaxSize 256 40#define IT_LP_EVENT_MAX_SIZE 256
41#define LpEventAlign 64 41#define IT_LP_EVENT_ALIGN 64
42 42
43struct hvlpevent_queue { 43struct hvlpevent_queue {
44/* 44/*
45 * The xSlicCurEventPtr is the pointer to the next event stack entry 45 * The hq_current_event is the pointer to the next event stack entry
46 * that will become valid. The OS must peek at this entry to determine 46 * that will become valid. The OS must peek at this entry to determine
47 * if it is valid. PLIC will set the valid indicator as the very last 47 * if it is valid. PLIC will set the valid indicator as the very last
48 * store into that entry. 48 * store into that entry.
@@ -52,23 +52,23 @@ struct hvlpevent_queue {
52 * location again. 52 * location again.
53 * 53 *
54 * If the event stack fills and there are overflow events, then PLIC 54 * If the event stack fills and there are overflow events, then PLIC
55 * will set the xPlicOverflowIntPending flag in which case the OS will 55 * will set the hq_overflow_pending flag in which case the OS will
56 * have to fetch the additional LP events once they have drained the 56 * have to fetch the additional LP events once they have drained the
57 * event stack. 57 * event stack.
58 * 58 *
59 * The first 16-bytes are known by both the OS and PLIC. The remainder 59 * The first 16-bytes are known by both the OS and PLIC. The remainder
60 * of the cache line is for use by the OS. 60 * of the cache line is for use by the OS.
61 */ 61 */
62 u8 xPlicOverflowIntPending;// 0x00 Overflow events are pending 62 u8 hq_overflow_pending; /* 0x00 Overflow events are pending */
63 u8 xPlicStatus; // 0x01 DedicatedIo or DedicatedLp or NotUsed 63 u8 hq_status; /* 0x01 DedicatedIo or DedicatedLp or NotUsed */
64 u16 xSlicLogicalProcIndex; // 0x02 Logical Proc Index for correlation 64 u16 hq_proc_index; /* 0x02 Logical Proc Index for correlation */
65 u8 xPlicRsvd[12]; // 0x04 65 u8 hq_reserved1[12]; /* 0x04 */
66 char *xSlicCurEventPtr; // 0x10 66 char *hq_current_event; /* 0x10 */
67 char *xSlicLastValidEventPtr; // 0x18 67 char *hq_last_event; /* 0x18 */
68 char *xSlicEventStackPtr; // 0x20 68 char *hq_event_stack; /* 0x20 */
69 u8 xIndex; // 0x28 unique sequential index. 69 u8 hq_index; /* 0x28 unique sequential index. */
70 u8 xSlicRsvd[3]; // 0x29-2b 70 u8 hq_reserved2[3]; /* 0x29-2b */
71 spinlock_t lock; 71 spinlock_t hq_lock;
72}; 72};
73 73
74extern struct hvlpevent_queue hvlpevent_queue; 74extern struct hvlpevent_queue hvlpevent_queue;
diff --git a/include/asm-powerpc/kdump.h b/include/asm-powerpc/kdump.h
index 5a5c3b5ab1e0..dc1574c945f8 100644
--- a/include/asm-powerpc/kdump.h
+++ b/include/asm-powerpc/kdump.h
@@ -15,6 +15,8 @@
15#define KDUMP_TRAMPOLINE_START 0x0100 15#define KDUMP_TRAMPOLINE_START 0x0100
16#define KDUMP_TRAMPOLINE_END 0x3000 16#define KDUMP_TRAMPOLINE_END 0x3000
17 17
18#define KDUMP_MIN_TCE_ENTRIES 2048
19
18#else /* !CONFIG_CRASH_DUMP */ 20#else /* !CONFIG_CRASH_DUMP */
19 21
20#define PHYSICAL_START 0x0 22#define PHYSICAL_START 0x0
diff --git a/include/asm-powerpc/kexec.h b/include/asm-powerpc/kexec.h
index efe8872ec583..8f7fd5cfec34 100644
--- a/include/asm-powerpc/kexec.h
+++ b/include/asm-powerpc/kexec.h
@@ -112,9 +112,13 @@ static inline void crash_setup_regs(struct pt_regs *newregs,
112#ifdef __powerpc64__ 112#ifdef __powerpc64__
113extern void kexec_smp_wait(void); /* get and clear naca physid, wait for 113extern void kexec_smp_wait(void); /* get and clear naca physid, wait for
114 master to copy new code to 0 */ 114 master to copy new code to 0 */
115extern void __init kexec_setup(void);
116extern int crashing_cpu; 115extern int crashing_cpu;
117extern void crash_send_ipi(void (*crash_ipi_callback)(struct pt_regs *)); 116extern void crash_send_ipi(void (*crash_ipi_callback)(struct pt_regs *));
117extern cpumask_t cpus_in_sr;
118static inline int kexec_sr_activated(int cpu)
119{
120 return cpu_isset(cpu,cpus_in_sr);
121}
118#endif /* __powerpc64 __ */ 122#endif /* __powerpc64 __ */
119 123
120struct kimage; 124struct kimage;
@@ -124,10 +128,13 @@ extern int default_machine_kexec_prepare(struct kimage *image);
124extern void default_machine_crash_shutdown(struct pt_regs *regs); 128extern void default_machine_crash_shutdown(struct pt_regs *regs);
125 129
126extern void machine_kexec_simple(struct kimage *image); 130extern void machine_kexec_simple(struct kimage *image);
131extern void crash_kexec_secondary(struct pt_regs *regs);
127extern int overlaps_crashkernel(unsigned long start, unsigned long size); 132extern int overlaps_crashkernel(unsigned long start, unsigned long size);
128extern void reserve_crashkernel(void); 133extern void reserve_crashkernel(void);
129 134
130#else /* !CONFIG_KEXEC */ 135#else /* !CONFIG_KEXEC */
136static inline int kexec_sr_activated(int cpu) { return 0; }
137static inline void crash_kexec_secondary(struct pt_regs *regs) { }
131 138
132static inline int overlaps_crashkernel(unsigned long start, unsigned long size) 139static inline int overlaps_crashkernel(unsigned long start, unsigned long size)
133{ 140{
diff --git a/include/asm-powerpc/machdep.h b/include/asm-powerpc/machdep.h
index 73db1f71329d..eba133d149a7 100644
--- a/include/asm-powerpc/machdep.h
+++ b/include/asm-powerpc/machdep.h
@@ -81,6 +81,8 @@ struct machdep_calls {
81 void (*tce_free)(struct iommu_table *tbl, 81 void (*tce_free)(struct iommu_table *tbl,
82 long index, 82 long index,
83 long npages); 83 long npages);
84 unsigned long (*tce_get)(struct iommu_table *tbl,
85 long index);
84 void (*tce_flush)(struct iommu_table *tbl); 86 void (*tce_flush)(struct iommu_table *tbl);
85 void (*iommu_dev_setup)(struct pci_dev *dev); 87 void (*iommu_dev_setup)(struct pci_dev *dev);
86 void (*iommu_bus_setup)(struct pci_bus *bus); 88 void (*iommu_bus_setup)(struct pci_bus *bus);
diff --git a/include/asm-powerpc/mmu.h b/include/asm-powerpc/mmu.h
index 3a5ebe229af5..c3fc7a28e3cd 100644
--- a/include/asm-powerpc/mmu.h
+++ b/include/asm-powerpc/mmu.h
@@ -238,7 +238,6 @@ extern int hash_huge_page(struct mm_struct *mm, unsigned long access,
238 unsigned long ea, unsigned long vsid, int local, 238 unsigned long ea, unsigned long vsid, int local,
239 unsigned long trap); 239 unsigned long trap);
240 240
241extern void htab_finish_init(void);
242extern int htab_bolt_mapping(unsigned long vstart, unsigned long vend, 241extern int htab_bolt_mapping(unsigned long vstart, unsigned long vend,
243 unsigned long pstart, unsigned long mode, 242 unsigned long pstart, unsigned long mode,
244 int psize); 243 int psize);
diff --git a/include/asm-powerpc/mmu_context.h b/include/asm-powerpc/mmu_context.h
index 8c6b1a6d944f..083ac917bd29 100644
--- a/include/asm-powerpc/mmu_context.h
+++ b/include/asm-powerpc/mmu_context.h
@@ -25,8 +25,13 @@ static inline void enter_lazy_tlb(struct mm_struct *mm,
25{ 25{
26} 26}
27 27
28/*
29 * The proto-VSID space has 2^35 - 1 segments available for user mappings.
30 * Each segment contains 2^28 bytes. Each context maps 2^44 bytes,
31 * so we can support 2^19-1 contexts (19 == 35 + 28 - 44).
32 */
28#define NO_CONTEXT 0 33#define NO_CONTEXT 0
29#define MAX_CONTEXT (0x100000-1) 34#define MAX_CONTEXT ((1UL << 19) - 1)
30 35
31extern int init_new_context(struct task_struct *tsk, struct mm_struct *mm); 36extern int init_new_context(struct task_struct *tsk, struct mm_struct *mm);
32extern void destroy_context(struct mm_struct *mm); 37extern void destroy_context(struct mm_struct *mm);
diff --git a/include/asm-powerpc/mpc86xx.h b/include/asm-powerpc/mpc86xx.h
index d0a6718d188b..f260382739fa 100644
--- a/include/asm-powerpc/mpc86xx.h
+++ b/include/asm-powerpc/mpc86xx.h
@@ -15,15 +15,10 @@
15#ifndef __ASM_POWERPC_MPC86xx_H__ 15#ifndef __ASM_POWERPC_MPC86xx_H__
16#define __ASM_POWERPC_MPC86xx_H__ 16#define __ASM_POWERPC_MPC86xx_H__
17 17
18#include <linux/config.h>
19#include <asm/mmu.h> 18#include <asm/mmu.h>
20 19
21#ifdef CONFIG_PPC_86xx 20#ifdef CONFIG_PPC_86xx
22 21
23#ifdef CONFIG_MPC8641_HPCN
24#include <platforms/86xx/mpc8641_hpcn.h>
25#endif
26
27#define _IO_BASE isa_io_base 22#define _IO_BASE isa_io_base
28#define _ISA_MEM_BASE isa_mem_base 23#define _ISA_MEM_BASE isa_mem_base
29#ifdef CONFIG_PCI 24#ifdef CONFIG_PCI
diff --git a/include/asm-powerpc/pci.h b/include/asm-powerpc/pci.h
index 5d2c9e6c4be2..46afd29b904e 100644
--- a/include/asm-powerpc/pci.h
+++ b/include/asm-powerpc/pci.h
@@ -242,7 +242,7 @@ extern pgprot_t pci_phys_mem_access_prot(struct file *file,
242#define HAVE_ARCH_PCI_RESOURCE_TO_USER 242#define HAVE_ARCH_PCI_RESOURCE_TO_USER
243extern void pci_resource_to_user(const struct pci_dev *dev, int bar, 243extern void pci_resource_to_user(const struct pci_dev *dev, int bar,
244 const struct resource *rsrc, 244 const struct resource *rsrc,
245 u64 *start, u64 *end); 245 resource_size_t *start, resource_size_t *end);
246#endif /* CONFIG_PPC_MULTIPLATFORM || CONFIG_PPC32 */ 246#endif /* CONFIG_PPC_MULTIPLATFORM || CONFIG_PPC32 */
247 247
248#endif /* __KERNEL__ */ 248#endif /* __KERNEL__ */
diff --git a/include/asm-powerpc/rtas.h b/include/asm-powerpc/rtas.h
index 02e213e3d69f..a33c6acffa61 100644
--- a/include/asm-powerpc/rtas.h
+++ b/include/asm-powerpc/rtas.h
@@ -181,6 +181,9 @@ extern int rtas_set_rtc_time(struct rtc_time *rtc_time);
181extern unsigned int rtas_busy_delay_time(int status); 181extern unsigned int rtas_busy_delay_time(int status);
182extern unsigned int rtas_busy_delay(int status); 182extern unsigned int rtas_busy_delay(int status);
183 183
184extern int early_init_dt_scan_rtas(unsigned long node,
185 const char *uname, int depth, void *data);
186
184extern void pSeries_log_error(char *buf, unsigned int err_type, int fatal); 187extern void pSeries_log_error(char *buf, unsigned int err_type, int fatal);
185 188
186/* Error types logged. */ 189/* Error types logged. */
diff --git a/include/asm-powerpc/time.h b/include/asm-powerpc/time.h
index 4463148c659f..dcde4410348d 100644
--- a/include/asm-powerpc/time.h
+++ b/include/asm-powerpc/time.h
@@ -18,8 +18,9 @@
18#include <linux/percpu.h> 18#include <linux/percpu.h>
19 19
20#include <asm/processor.h> 20#include <asm/processor.h>
21#ifdef CONFIG_PPC64 21#ifdef CONFIG_PPC_ISERIES
22#include <asm/paca.h> 22#include <asm/paca.h>
23#include <asm/firmware.h>
23#include <asm/iseries/hv_call.h> 24#include <asm/iseries/hv_call.h>
24#endif 25#endif
25 26
@@ -177,7 +178,8 @@ static inline void set_dec(int val)
177#ifdef CONFIG_PPC_ISERIES 178#ifdef CONFIG_PPC_ISERIES
178 int cur_dec; 179 int cur_dec;
179 180
180 if (get_lppaca()->shared_proc) { 181 if (firmware_has_feature(FW_FEATURE_ISERIES) &&
182 get_lppaca()->shared_proc) {
181 get_lppaca()->virtual_decr = val; 183 get_lppaca()->virtual_decr = val;
182 cur_dec = get_dec(); 184 cur_dec = get_dec();
183 if (cur_dec > val) 185 if (cur_dec > val)
diff --git a/include/asm-powerpc/todc.h b/include/asm-powerpc/todc.h
new file mode 100644
index 000000000000..60a8c39b8c11
--- /dev/null
+++ b/include/asm-powerpc/todc.h
@@ -0,0 +1,487 @@
1/*
2 * Definitions for the M48Txx and mc146818 series of Time of day/Real Time
3 * Clock chips.
4 *
5 * Author: Mark A. Greer <mgreer@mvista.com>
6 *
7 * 2001 (c) MontaVista, Software, Inc. This file is licensed under
8 * the terms of the GNU General Public License version 2. This program
9 * is licensed "as is" without any warranty of any kind, whether express
10 * or implied.
11 */
12
13/*
14 * Support for the M48T37/M48T59/.../mc146818 Real Time Clock chips.
15 * Purpose is to make one generic file that handles all of these chips instead
16 * of every platform implementing the same code over & over again.
17 */
18
19#ifndef __PPC_KERNEL_TODC_H
20#define __PPC_KERNEL_TODC_H
21
22typedef struct {
23 uint rtc_type; /* your particular chip */
24
25 /*
26 * Following are the addresses of the AS0, AS1, and DATA registers
27 * of these chips. Note that these are board-specific.
28 */
29 unsigned int nvram_as0;
30 unsigned int nvram_as1;
31 unsigned int nvram_data;
32
33 /*
34 * Define bits to stop external set of regs from changing so
35 * the chip can be read/written reliably.
36 */
37 unsigned char enable_read;
38 unsigned char enable_write;
39
40 /*
41 * Following is the number of AS0 address bits. This is normally
42 * 8 but some bad hardware routes address lines incorrectly.
43 */
44 int as0_bits;
45
46 int nvram_size; /* Size of NVRAM on chip */
47 int sw_flags; /* Software control flags */
48
49 /* Following are the register offsets for the particular chip */
50 int year;
51 int month;
52 int day_of_month;
53 int day_of_week;
54 int hours;
55 int minutes;
56 int seconds;
57 int control_b;
58 int control_a;
59 int watchdog;
60 int interrupts;
61 int alarm_date;
62 int alarm_hour;
63 int alarm_minutes;
64 int alarm_seconds;
65 int century;
66 int flags;
67
68 /*
69 * Some RTC chips have their NVRAM buried behind a addr/data pair of
70 * regs on the first level/clock registers. The following fields
71 * are the addresses for those addr/data regs.
72 */
73 int nvram_addr_reg;
74 int nvram_data_reg;
75} todc_info_t;
76
77/*
78 * Define the types of TODC/RTC variants that are supported in
79 * arch/ppc/kernel/todc_time.c
80 * Make a new one of these for any chip somehow differs from what's already
81 * defined. That way, if you ever need to put in code to touch those
82 * bits/registers in todc_time.c, you can put it inside an
83 * 'if (todc_info->rtc_type == TODC_TYPE_XXX)' so you won't break
84 * anyone else.
85 */
86#define TODC_TYPE_MK48T35 1
87#define TODC_TYPE_MK48T37 2
88#define TODC_TYPE_MK48T59 3
89#define TODC_TYPE_DS1693 4 /* Dallas DS1693 RTC */
90#define TODC_TYPE_DS1743 5 /* Dallas DS1743 RTC */
91#define TODC_TYPE_DS1746 6 /* Dallas DS1746 RTC */
92#define TODC_TYPE_DS1747 7 /* Dallas DS1747 RTC */
93#define TODC_TYPE_DS1501 8 /* Dallas DS1501 RTC */
94#define TODC_TYPE_DS1643 9 /* Dallas DS1643 RTC */
95#define TODC_TYPE_PC97307 10 /* PC97307 internal RTC */
96#define TODC_TYPE_DS1557 11 /* Dallas DS1557 RTC */
97#define TODC_TYPE_DS17285 12 /* Dallas DS17285 RTC */
98#define TODC_TYPE_DS1553 13 /* Dallas DS1553 RTC */
99#define TODC_TYPE_MC146818 100 /* Leave room for m48txx's */
100
101/*
102 * Bit to clear/set to enable reads/writes to the chip
103 */
104#define TODC_MK48TXX_CNTL_A_R 0x40
105#define TODC_MK48TXX_CNTL_A_W 0x80
106#define TODC_MK48TXX_DAY_CB 0x80
107
108#define TODC_DS1501_CNTL_B_TE 0x80
109
110/*
111 * Define flag bits used by todc routines.
112 */
113#define TODC_FLAG_2_LEVEL_NVRAM 0x00000001
114
115/*
116 * Define the values for the various RTC's that should to into the todc_info
117 * table.
118 * Note: The XXX_NVRAM_SIZE, XXX_NVRAM_ADDR_REG, and XXX_NVRAM_DATA_REG only
119 * matter if XXX_SW_FLAGS has TODC_FLAG_2_LEVEL_NVRAM set.
120 */
121#define TODC_TYPE_MK48T35_NVRAM_SIZE 0x7ff8
122#define TODC_TYPE_MK48T35_SW_FLAGS 0
123#define TODC_TYPE_MK48T35_YEAR 0x7fff
124#define TODC_TYPE_MK48T35_MONTH 0x7ffe
125#define TODC_TYPE_MK48T35_DOM 0x7ffd /* Day of Month */
126#define TODC_TYPE_MK48T35_DOW 0x7ffc /* Day of Week */
127#define TODC_TYPE_MK48T35_HOURS 0x7ffb
128#define TODC_TYPE_MK48T35_MINUTES 0x7ffa
129#define TODC_TYPE_MK48T35_SECONDS 0x7ff9
130#define TODC_TYPE_MK48T35_CNTL_B 0x7ff9
131#define TODC_TYPE_MK48T35_CNTL_A 0x7ff8
132#define TODC_TYPE_MK48T35_WATCHDOG 0x0000
133#define TODC_TYPE_MK48T35_INTERRUPTS 0x0000
134#define TODC_TYPE_MK48T35_ALARM_DATE 0x0000
135#define TODC_TYPE_MK48T35_ALARM_HOUR 0x0000
136#define TODC_TYPE_MK48T35_ALARM_MINUTES 0x0000
137#define TODC_TYPE_MK48T35_ALARM_SECONDS 0x0000
138#define TODC_TYPE_MK48T35_CENTURY 0x0000
139#define TODC_TYPE_MK48T35_FLAGS 0x0000
140#define TODC_TYPE_MK48T35_NVRAM_ADDR_REG 0
141#define TODC_TYPE_MK48T35_NVRAM_DATA_REG 0
142
143#define TODC_TYPE_MK48T37_NVRAM_SIZE 0x7ff0
144#define TODC_TYPE_MK48T37_SW_FLAGS 0
145#define TODC_TYPE_MK48T37_YEAR 0x7fff
146#define TODC_TYPE_MK48T37_MONTH 0x7ffe
147#define TODC_TYPE_MK48T37_DOM 0x7ffd /* Day of Month */
148#define TODC_TYPE_MK48T37_DOW 0x7ffc /* Day of Week */
149#define TODC_TYPE_MK48T37_HOURS 0x7ffb
150#define TODC_TYPE_MK48T37_MINUTES 0x7ffa
151#define TODC_TYPE_MK48T37_SECONDS 0x7ff9
152#define TODC_TYPE_MK48T37_CNTL_B 0x7ff9
153#define TODC_TYPE_MK48T37_CNTL_A 0x7ff8
154#define TODC_TYPE_MK48T37_WATCHDOG 0x7ff7
155#define TODC_TYPE_MK48T37_INTERRUPTS 0x7ff6
156#define TODC_TYPE_MK48T37_ALARM_DATE 0x7ff5
157#define TODC_TYPE_MK48T37_ALARM_HOUR 0x7ff4
158#define TODC_TYPE_MK48T37_ALARM_MINUTES 0x7ff3
159#define TODC_TYPE_MK48T37_ALARM_SECONDS 0x7ff2
160#define TODC_TYPE_MK48T37_CENTURY 0x7ff1
161#define TODC_TYPE_MK48T37_FLAGS 0x7ff0
162#define TODC_TYPE_MK48T37_NVRAM_ADDR_REG 0
163#define TODC_TYPE_MK48T37_NVRAM_DATA_REG 0
164
165#define TODC_TYPE_MK48T59_NVRAM_SIZE 0x1ff0
166#define TODC_TYPE_MK48T59_SW_FLAGS 0
167#define TODC_TYPE_MK48T59_YEAR 0x1fff
168#define TODC_TYPE_MK48T59_MONTH 0x1ffe
169#define TODC_TYPE_MK48T59_DOM 0x1ffd /* Day of Month */
170#define TODC_TYPE_MK48T59_DOW 0x1ffc /* Day of Week */
171#define TODC_TYPE_MK48T59_HOURS 0x1ffb
172#define TODC_TYPE_MK48T59_MINUTES 0x1ffa
173#define TODC_TYPE_MK48T59_SECONDS 0x1ff9
174#define TODC_TYPE_MK48T59_CNTL_B 0x1ff9
175#define TODC_TYPE_MK48T59_CNTL_A 0x1ff8
176#define TODC_TYPE_MK48T59_WATCHDOG 0x1fff
177#define TODC_TYPE_MK48T59_INTERRUPTS 0x1fff
178#define TODC_TYPE_MK48T59_ALARM_DATE 0x1fff
179#define TODC_TYPE_MK48T59_ALARM_HOUR 0x1fff
180#define TODC_TYPE_MK48T59_ALARM_MINUTES 0x1fff
181#define TODC_TYPE_MK48T59_ALARM_SECONDS 0x1fff
182#define TODC_TYPE_MK48T59_CENTURY 0x1fff
183#define TODC_TYPE_MK48T59_FLAGS 0x1fff
184#define TODC_TYPE_MK48T59_NVRAM_ADDR_REG 0
185#define TODC_TYPE_MK48T59_NVRAM_DATA_REG 0
186
187#define TODC_TYPE_DS1501_NVRAM_SIZE 0x100
188#define TODC_TYPE_DS1501_SW_FLAGS TODC_FLAG_2_LEVEL_NVRAM
189#define TODC_TYPE_DS1501_YEAR (TODC_TYPE_DS1501_NVRAM_SIZE + 0x06)
190#define TODC_TYPE_DS1501_MONTH (TODC_TYPE_DS1501_NVRAM_SIZE + 0x05)
191#define TODC_TYPE_DS1501_DOM (TODC_TYPE_DS1501_NVRAM_SIZE + 0x04)
192#define TODC_TYPE_DS1501_DOW (TODC_TYPE_DS1501_NVRAM_SIZE + 0x03)
193#define TODC_TYPE_DS1501_HOURS (TODC_TYPE_DS1501_NVRAM_SIZE + 0x02)
194#define TODC_TYPE_DS1501_MINUTES (TODC_TYPE_DS1501_NVRAM_SIZE + 0x01)
195#define TODC_TYPE_DS1501_SECONDS (TODC_TYPE_DS1501_NVRAM_SIZE + 0x00)
196#define TODC_TYPE_DS1501_CNTL_B (TODC_TYPE_DS1501_NVRAM_SIZE + 0x0f)
197#define TODC_TYPE_DS1501_CNTL_A (TODC_TYPE_DS1501_NVRAM_SIZE + 0x0f)
198#define TODC_TYPE_DS1501_WATCHDOG (TODC_TYPE_DS1501_NVRAM_SIZE + 0xff)
199#define TODC_TYPE_DS1501_INTERRUPTS (TODC_TYPE_DS1501_NVRAM_SIZE + 0xff)
200#define TODC_TYPE_DS1501_ALARM_DATE (TODC_TYPE_DS1501_NVRAM_SIZE + 0x0b)
201#define TODC_TYPE_DS1501_ALARM_HOUR (TODC_TYPE_DS1501_NVRAM_SIZE + 0x0a)
202#define TODC_TYPE_DS1501_ALARM_MINUTES (TODC_TYPE_DS1501_NVRAM_SIZE + 0x09)
203#define TODC_TYPE_DS1501_ALARM_SECONDS (TODC_TYPE_DS1501_NVRAM_SIZE + 0x08)
204#define TODC_TYPE_DS1501_CENTURY (TODC_TYPE_DS1501_NVRAM_SIZE + 0x07)
205#define TODC_TYPE_DS1501_FLAGS (TODC_TYPE_DS1501_NVRAM_SIZE + 0xff)
206#define TODC_TYPE_DS1501_NVRAM_ADDR_REG 0x10
207#define TODC_TYPE_DS1501_NVRAM_DATA_REG 0x13
208
209#define TODC_TYPE_DS1553_NVRAM_SIZE 0x1ff0
210#define TODC_TYPE_DS1553_SW_FLAGS 0
211#define TODC_TYPE_DS1553_YEAR 0x1fff
212#define TODC_TYPE_DS1553_MONTH 0x1ffe
213#define TODC_TYPE_DS1553_DOM 0x1ffd /* Day of Month */
214#define TODC_TYPE_DS1553_DOW 0x1ffc /* Day of Week */
215#define TODC_TYPE_DS1553_HOURS 0x1ffb
216#define TODC_TYPE_DS1553_MINUTES 0x1ffa
217#define TODC_TYPE_DS1553_SECONDS 0x1ff9
218#define TODC_TYPE_DS1553_CNTL_B 0x1ff9
219#define TODC_TYPE_DS1553_CNTL_A 0x1ff8 /* control_a R/W regs */
220#define TODC_TYPE_DS1553_WATCHDOG 0x1ff7
221#define TODC_TYPE_DS1553_INTERRUPTS 0x1ff6
222#define TODC_TYPE_DS1553_ALARM_DATE 0x1ff5
223#define TODC_TYPE_DS1553_ALARM_HOUR 0x1ff4
224#define TODC_TYPE_DS1553_ALARM_MINUTES 0x1ff3
225#define TODC_TYPE_DS1553_ALARM_SECONDS 0x1ff2
226#define TODC_TYPE_DS1553_CENTURY 0x1ff8
227#define TODC_TYPE_DS1553_FLAGS 0x1ff0
228#define TODC_TYPE_DS1553_NVRAM_ADDR_REG 0
229#define TODC_TYPE_DS1553_NVRAM_DATA_REG 0
230
231#define TODC_TYPE_DS1557_NVRAM_SIZE 0x7fff0
232#define TODC_TYPE_DS1557_SW_FLAGS 0
233#define TODC_TYPE_DS1557_YEAR 0x7ffff
234#define TODC_TYPE_DS1557_MONTH 0x7fffe
235#define TODC_TYPE_DS1557_DOM 0x7fffd /* Day of Month */
236#define TODC_TYPE_DS1557_DOW 0x7fffc /* Day of Week */
237#define TODC_TYPE_DS1557_HOURS 0x7fffb
238#define TODC_TYPE_DS1557_MINUTES 0x7fffa
239#define TODC_TYPE_DS1557_SECONDS 0x7fff9
240#define TODC_TYPE_DS1557_CNTL_B 0x7fff9
241#define TODC_TYPE_DS1557_CNTL_A 0x7fff8 /* control_a R/W regs */
242#define TODC_TYPE_DS1557_WATCHDOG 0x7fff7
243#define TODC_TYPE_DS1557_INTERRUPTS 0x7fff6
244#define TODC_TYPE_DS1557_ALARM_DATE 0x7fff5
245#define TODC_TYPE_DS1557_ALARM_HOUR 0x7fff4
246#define TODC_TYPE_DS1557_ALARM_MINUTES 0x7fff3
247#define TODC_TYPE_DS1557_ALARM_SECONDS 0x7fff2
248#define TODC_TYPE_DS1557_CENTURY 0x7fff8
249#define TODC_TYPE_DS1557_FLAGS 0x7fff0
250#define TODC_TYPE_DS1557_NVRAM_ADDR_REG 0
251#define TODC_TYPE_DS1557_NVRAM_DATA_REG 0
252
253#define TODC_TYPE_DS1643_NVRAM_SIZE 0x1ff8
254#define TODC_TYPE_DS1643_SW_FLAGS 0
255#define TODC_TYPE_DS1643_YEAR 0x1fff
256#define TODC_TYPE_DS1643_MONTH 0x1ffe
257#define TODC_TYPE_DS1643_DOM 0x1ffd /* Day of Month */
258#define TODC_TYPE_DS1643_DOW 0x1ffc /* Day of Week */
259#define TODC_TYPE_DS1643_HOURS 0x1ffb
260#define TODC_TYPE_DS1643_MINUTES 0x1ffa
261#define TODC_TYPE_DS1643_SECONDS 0x1ff9
262#define TODC_TYPE_DS1643_CNTL_B 0x1ff9
263#define TODC_TYPE_DS1643_CNTL_A 0x1ff8 /* control_a R/W regs */
264#define TODC_TYPE_DS1643_WATCHDOG 0x1fff
265#define TODC_TYPE_DS1643_INTERRUPTS 0x1fff
266#define TODC_TYPE_DS1643_ALARM_DATE 0x1fff
267#define TODC_TYPE_DS1643_ALARM_HOUR 0x1fff
268#define TODC_TYPE_DS1643_ALARM_MINUTES 0x1fff
269#define TODC_TYPE_DS1643_ALARM_SECONDS 0x1fff
270#define TODC_TYPE_DS1643_CENTURY 0x1ff8
271#define TODC_TYPE_DS1643_FLAGS 0x1fff
272#define TODC_TYPE_DS1643_NVRAM_ADDR_REG 0
273#define TODC_TYPE_DS1643_NVRAM_DATA_REG 0
274
275#define TODC_TYPE_DS1693_NVRAM_SIZE 0 /* Not handled yet */
276#define TODC_TYPE_DS1693_SW_FLAGS 0
277#define TODC_TYPE_DS1693_YEAR 0x09
278#define TODC_TYPE_DS1693_MONTH 0x08
279#define TODC_TYPE_DS1693_DOM 0x07 /* Day of Month */
280#define TODC_TYPE_DS1693_DOW 0x06 /* Day of Week */
281#define TODC_TYPE_DS1693_HOURS 0x04
282#define TODC_TYPE_DS1693_MINUTES 0x02
283#define TODC_TYPE_DS1693_SECONDS 0x00
284#define TODC_TYPE_DS1693_CNTL_B 0x0b
285#define TODC_TYPE_DS1693_CNTL_A 0x0a
286#define TODC_TYPE_DS1693_WATCHDOG 0xff
287#define TODC_TYPE_DS1693_INTERRUPTS 0xff
288#define TODC_TYPE_DS1693_ALARM_DATE 0x49
289#define TODC_TYPE_DS1693_ALARM_HOUR 0x05
290#define TODC_TYPE_DS1693_ALARM_MINUTES 0x03
291#define TODC_TYPE_DS1693_ALARM_SECONDS 0x01
292#define TODC_TYPE_DS1693_CENTURY 0x48
293#define TODC_TYPE_DS1693_FLAGS 0xff
294#define TODC_TYPE_DS1693_NVRAM_ADDR_REG 0
295#define TODC_TYPE_DS1693_NVRAM_DATA_REG 0
296
297#define TODC_TYPE_DS1743_NVRAM_SIZE 0x1ff8
298#define TODC_TYPE_DS1743_SW_FLAGS 0
299#define TODC_TYPE_DS1743_YEAR 0x1fff
300#define TODC_TYPE_DS1743_MONTH 0x1ffe
301#define TODC_TYPE_DS1743_DOM 0x1ffd /* Day of Month */
302#define TODC_TYPE_DS1743_DOW 0x1ffc /* Day of Week */
303#define TODC_TYPE_DS1743_HOURS 0x1ffb
304#define TODC_TYPE_DS1743_MINUTES 0x1ffa
305#define TODC_TYPE_DS1743_SECONDS 0x1ff9
306#define TODC_TYPE_DS1743_CNTL_B 0x1ff9
307#define TODC_TYPE_DS1743_CNTL_A 0x1ff8 /* control_a R/W regs */
308#define TODC_TYPE_DS1743_WATCHDOG 0x1fff
309#define TODC_TYPE_DS1743_INTERRUPTS 0x1fff
310#define TODC_TYPE_DS1743_ALARM_DATE 0x1fff
311#define TODC_TYPE_DS1743_ALARM_HOUR 0x1fff
312#define TODC_TYPE_DS1743_ALARM_MINUTES 0x1fff
313#define TODC_TYPE_DS1743_ALARM_SECONDS 0x1fff
314#define TODC_TYPE_DS1743_CENTURY 0x1ff8
315#define TODC_TYPE_DS1743_FLAGS 0x1fff
316#define TODC_TYPE_DS1743_NVRAM_ADDR_REG 0
317#define TODC_TYPE_DS1743_NVRAM_DATA_REG 0
318
319#define TODC_TYPE_DS1746_NVRAM_SIZE 0x1fff8
320#define TODC_TYPE_DS1746_SW_FLAGS 0
321#define TODC_TYPE_DS1746_YEAR 0x1ffff
322#define TODC_TYPE_DS1746_MONTH 0x1fffe
323#define TODC_TYPE_DS1746_DOM 0x1fffd /* Day of Month */
324#define TODC_TYPE_DS1746_DOW 0x1fffc /* Day of Week */
325#define TODC_TYPE_DS1746_HOURS 0x1fffb
326#define TODC_TYPE_DS1746_MINUTES 0x1fffa
327#define TODC_TYPE_DS1746_SECONDS 0x1fff9
328#define TODC_TYPE_DS1746_CNTL_B 0x1fff9
329#define TODC_TYPE_DS1746_CNTL_A 0x1fff8 /* control_a R/W regs */
330#define TODC_TYPE_DS1746_WATCHDOG 0x00000
331#define TODC_TYPE_DS1746_INTERRUPTS 0x00000
332#define TODC_TYPE_DS1746_ALARM_DATE 0x00000
333#define TODC_TYPE_DS1746_ALARM_HOUR 0x00000
334#define TODC_TYPE_DS1746_ALARM_MINUTES 0x00000
335#define TODC_TYPE_DS1746_ALARM_SECONDS 0x00000
336#define TODC_TYPE_DS1746_CENTURY 0x00000
337#define TODC_TYPE_DS1746_FLAGS 0x00000
338#define TODC_TYPE_DS1746_NVRAM_ADDR_REG 0
339#define TODC_TYPE_DS1746_NVRAM_DATA_REG 0
340
341#define TODC_TYPE_DS1747_NVRAM_SIZE 0x7fff8
342#define TODC_TYPE_DS1747_SW_FLAGS 0
343#define TODC_TYPE_DS1747_YEAR 0x7ffff
344#define TODC_TYPE_DS1747_MONTH 0x7fffe
345#define TODC_TYPE_DS1747_DOM 0x7fffd /* Day of Month */
346#define TODC_TYPE_DS1747_DOW 0x7fffc /* Day of Week */
347#define TODC_TYPE_DS1747_HOURS 0x7fffb
348#define TODC_TYPE_DS1747_MINUTES 0x7fffa
349#define TODC_TYPE_DS1747_SECONDS 0x7fff9
350#define TODC_TYPE_DS1747_CNTL_B 0x7fff9
351#define TODC_TYPE_DS1747_CNTL_A 0x7fff8 /* control_a R/W regs */
352#define TODC_TYPE_DS1747_WATCHDOG 0x00000
353#define TODC_TYPE_DS1747_INTERRUPTS 0x00000
354#define TODC_TYPE_DS1747_ALARM_DATE 0x00000
355#define TODC_TYPE_DS1747_ALARM_HOUR 0x00000
356#define TODC_TYPE_DS1747_ALARM_MINUTES 0x00000
357#define TODC_TYPE_DS1747_ALARM_SECONDS 0x00000
358#define TODC_TYPE_DS1747_CENTURY 0x00000
359#define TODC_TYPE_DS1747_FLAGS 0x00000
360#define TODC_TYPE_DS1747_NVRAM_ADDR_REG 0
361#define TODC_TYPE_DS1747_NVRAM_DATA_REG 0
362
363#define TODC_TYPE_DS17285_NVRAM_SIZE (0x1000-0x80) /* 4Kx8 NVRAM (minus RTC regs) */
364#define TODC_TYPE_DS17285_SW_FLAGS TODC_FLAG_2_LEVEL_NVRAM
365#define TODC_TYPE_DS17285_SECONDS (TODC_TYPE_DS17285_NVRAM_SIZE + 0x00)
366#define TODC_TYPE_DS17285_ALARM_SECONDS (TODC_TYPE_DS17285_NVRAM_SIZE + 0x01)
367#define TODC_TYPE_DS17285_MINUTES (TODC_TYPE_DS17285_NVRAM_SIZE + 0x02)
368#define TODC_TYPE_DS17285_ALARM_MINUTES (TODC_TYPE_DS17285_NVRAM_SIZE + 0x03)
369#define TODC_TYPE_DS17285_HOURS (TODC_TYPE_DS17285_NVRAM_SIZE + 0x04)
370#define TODC_TYPE_DS17285_ALARM_HOUR (TODC_TYPE_DS17285_NVRAM_SIZE + 0x05)
371#define TODC_TYPE_DS17285_DOW (TODC_TYPE_DS17285_NVRAM_SIZE + 0x06)
372#define TODC_TYPE_DS17285_DOM (TODC_TYPE_DS17285_NVRAM_SIZE + 0x07)
373#define TODC_TYPE_DS17285_MONTH (TODC_TYPE_DS17285_NVRAM_SIZE + 0x08)
374#define TODC_TYPE_DS17285_YEAR (TODC_TYPE_DS17285_NVRAM_SIZE + 0x09)
375#define TODC_TYPE_DS17285_CNTL_A (TODC_TYPE_DS17285_NVRAM_SIZE + 0x0A)
376#define TODC_TYPE_DS17285_CNTL_B (TODC_TYPE_DS17285_NVRAM_SIZE + 0x0B)
377#define TODC_TYPE_DS17285_CNTL_C (TODC_TYPE_DS17285_NVRAM_SIZE + 0x0C)
378#define TODC_TYPE_DS17285_CNTL_D (TODC_TYPE_DS17285_NVRAM_SIZE + 0x0D)
379#define TODC_TYPE_DS17285_WATCHDOG 0
380#define TODC_TYPE_DS17285_INTERRUPTS 0
381#define TODC_TYPE_DS17285_ALARM_DATE 0
382#define TODC_TYPE_DS17285_CENTURY 0
383#define TODC_TYPE_DS17285_FLAGS 0
384#define TODC_TYPE_DS17285_NVRAM_ADDR_REG 0x50
385#define TODC_TYPE_DS17285_NVRAM_DATA_REG 0x53
386
387#define TODC_TYPE_MC146818_NVRAM_SIZE 0 /* XXXX */
388#define TODC_TYPE_MC146818_SW_FLAGS 0
389#define TODC_TYPE_MC146818_YEAR 0x09
390#define TODC_TYPE_MC146818_MONTH 0x08
391#define TODC_TYPE_MC146818_DOM 0x07 /* Day of Month */
392#define TODC_TYPE_MC146818_DOW 0x06 /* Day of Week */
393#define TODC_TYPE_MC146818_HOURS 0x04
394#define TODC_TYPE_MC146818_MINUTES 0x02
395#define TODC_TYPE_MC146818_SECONDS 0x00
396#define TODC_TYPE_MC146818_CNTL_B 0x0a
397#define TODC_TYPE_MC146818_CNTL_A 0x0b /* control_a R/W regs */
398#define TODC_TYPE_MC146818_WATCHDOG 0
399#define TODC_TYPE_MC146818_INTERRUPTS 0x0c
400#define TODC_TYPE_MC146818_ALARM_DATE 0xff
401#define TODC_TYPE_MC146818_ALARM_HOUR 0x05
402#define TODC_TYPE_MC146818_ALARM_MINUTES 0x03
403#define TODC_TYPE_MC146818_ALARM_SECONDS 0x01
404#define TODC_TYPE_MC146818_CENTURY 0xff
405#define TODC_TYPE_MC146818_FLAGS 0xff
406#define TODC_TYPE_MC146818_NVRAM_ADDR_REG 0
407#define TODC_TYPE_MC146818_NVRAM_DATA_REG 0
408
409#define TODC_TYPE_PC97307_NVRAM_SIZE 0 /* No NVRAM? */
410#define TODC_TYPE_PC97307_SW_FLAGS 0
411#define TODC_TYPE_PC97307_YEAR 0x09
412#define TODC_TYPE_PC97307_MONTH 0x08
413#define TODC_TYPE_PC97307_DOM 0x07 /* Day of Month */
414#define TODC_TYPE_PC97307_DOW 0x06 /* Day of Week */
415#define TODC_TYPE_PC97307_HOURS 0x04
416#define TODC_TYPE_PC97307_MINUTES 0x02
417#define TODC_TYPE_PC97307_SECONDS 0x00
418#define TODC_TYPE_PC97307_CNTL_B 0x0a
419#define TODC_TYPE_PC97307_CNTL_A 0x0b /* control_a R/W regs */
420#define TODC_TYPE_PC97307_WATCHDOG 0x0c
421#define TODC_TYPE_PC97307_INTERRUPTS 0x0d
422#define TODC_TYPE_PC97307_ALARM_DATE 0xff
423#define TODC_TYPE_PC97307_ALARM_HOUR 0x05
424#define TODC_TYPE_PC97307_ALARM_MINUTES 0x03
425#define TODC_TYPE_PC97307_ALARM_SECONDS 0x01
426#define TODC_TYPE_PC97307_CENTURY 0xff
427#define TODC_TYPE_PC97307_FLAGS 0xff
428#define TODC_TYPE_PC97307_NVRAM_ADDR_REG 0
429#define TODC_TYPE_PC97307_NVRAM_DATA_REG 0
430
431/*
432 * Define macros to allocate and init the todc_info_t table that will
433 * be used by the todc_time.c routines.
434 */
435#define TODC_ALLOC() \
436 static todc_info_t todc_info_alloc; \
437 todc_info_t *todc_info = &todc_info_alloc;
438
439#define TODC_INIT(clock_type, as0, as1, data, bits) { \
440 todc_info->rtc_type = clock_type; \
441 \
442 todc_info->nvram_as0 = (unsigned int)(as0); \
443 todc_info->nvram_as1 = (unsigned int)(as1); \
444 todc_info->nvram_data = (unsigned int)(data); \
445 \
446 todc_info->as0_bits = (bits); \
447 \
448 todc_info->nvram_size = clock_type ##_NVRAM_SIZE; \
449 todc_info->sw_flags = clock_type ##_SW_FLAGS; \
450 \
451 todc_info->year = clock_type ##_YEAR; \
452 todc_info->month = clock_type ##_MONTH; \
453 todc_info->day_of_month = clock_type ##_DOM; \
454 todc_info->day_of_week = clock_type ##_DOW; \
455 todc_info->hours = clock_type ##_HOURS; \
456 todc_info->minutes = clock_type ##_MINUTES; \
457 todc_info->seconds = clock_type ##_SECONDS; \
458 todc_info->control_b = clock_type ##_CNTL_B; \
459 todc_info->control_a = clock_type ##_CNTL_A; \
460 todc_info->watchdog = clock_type ##_WATCHDOG; \
461 todc_info->interrupts = clock_type ##_INTERRUPTS; \
462 todc_info->alarm_date = clock_type ##_ALARM_DATE; \
463 todc_info->alarm_hour = clock_type ##_ALARM_HOUR; \
464 todc_info->alarm_minutes = clock_type ##_ALARM_MINUTES; \
465 todc_info->alarm_seconds = clock_type ##_ALARM_SECONDS; \
466 todc_info->century = clock_type ##_CENTURY; \
467 todc_info->flags = clock_type ##_FLAGS; \
468 \
469 todc_info->nvram_addr_reg = clock_type ##_NVRAM_ADDR_REG; \
470 todc_info->nvram_data_reg = clock_type ##_NVRAM_DATA_REG; \
471}
472
473extern todc_info_t *todc_info;
474
475unsigned char todc_direct_read_val(int addr);
476void todc_direct_write_val(int addr, unsigned char val);
477unsigned char todc_m48txx_read_val(int addr);
478void todc_m48txx_write_val(int addr, unsigned char val);
479unsigned char todc_mc146818_read_val(int addr);
480void todc_mc146818_write_val(int addr, unsigned char val);
481
482long todc_time_init(void);
483void todc_get_rtc_time(struct rtc_time *);
484int todc_set_rtc_time(struct rtc_time *);
485void todc_calibrate_decr(void);
486
487#endif /* __PPC_KERNEL_TODC_H */
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-powerpc/tsi108.h b/include/asm-powerpc/tsi108.h
new file mode 100644
index 000000000000..c4c278d72f71
--- /dev/null
+++ b/include/asm-powerpc/tsi108.h
@@ -0,0 +1,109 @@
1/*
2 * include/asm-ppc/tsi108.h
3 *
4 * common routine and memory layout for Tundra TSI108(Grendel) host bridge
5 * memory controller.
6 *
7 * Author: Jacob Pan (jacob.pan@freescale.com)
8 * Alex Bounine (alexandreb@tundra.com)
9 * 2004 (c) Freescale Semiconductor Inc. This file is licensed under
10 * the terms of the GNU General Public License version 2. This program
11 * is licensed "as is" without any warranty of any kind, whether express
12 * or implied.
13 */
14#ifndef __PPC_KERNEL_TSI108_H
15#define __PPC_KERNEL_TSI108_H
16
17#include <asm/pci-bridge.h>
18
19/* Size of entire register space */
20#define TSI108_REG_SIZE (0x10000)
21
22/* Sizes of register spaces for individual blocks */
23#define TSI108_HLP_SIZE 0x1000
24#define TSI108_PCI_SIZE 0x1000
25#define TSI108_CLK_SIZE 0x1000
26#define TSI108_PB_SIZE 0x1000
27#define TSI108_SD_SIZE 0x1000
28#define TSI108_DMA_SIZE 0x1000
29#define TSI108_ETH_SIZE 0x1000
30#define TSI108_I2C_SIZE 0x400
31#define TSI108_MPIC_SIZE 0x400
32#define TSI108_UART0_SIZE 0x200
33#define TSI108_GPIO_SIZE 0x200
34#define TSI108_UART1_SIZE 0x200
35
36/* Offsets within Tsi108(A) CSR space for individual blocks */
37#define TSI108_HLP_OFFSET 0x0000
38#define TSI108_PCI_OFFSET 0x1000
39#define TSI108_CLK_OFFSET 0x2000
40#define TSI108_PB_OFFSET 0x3000
41#define TSI108_SD_OFFSET 0x4000
42#define TSI108_DMA_OFFSET 0x5000
43#define TSI108_ETH_OFFSET 0x6000
44#define TSI108_I2C_OFFSET 0x7000
45#define TSI108_MPIC_OFFSET 0x7400
46#define TSI108_UART0_OFFSET 0x7800
47#define TSI108_GPIO_OFFSET 0x7A00
48#define TSI108_UART1_OFFSET 0x7C00
49
50/* Tsi108 registers used by common code components */
51#define TSI108_PCI_CSR (0x004)
52#define TSI108_PCI_IRP_CFG_CTL (0x180)
53#define TSI108_PCI_IRP_STAT (0x184)
54#define TSI108_PCI_IRP_ENABLE (0x188)
55#define TSI108_PCI_IRP_INTAD (0x18C)
56
57#define TSI108_PCI_IRP_STAT_P_INT (0x00400000)
58#define TSI108_PCI_IRP_ENABLE_P_INT (0x00400000)
59
60#define TSI108_CG_PWRUP_STATUS (0x234)
61
62#define TSI108_PB_ISR (0x00C)
63#define TSI108_PB_ERRCS (0x404)
64#define TSI108_PB_AERR (0x408)
65
66#define TSI108_PB_ERRCS_ES (1 << 1)
67#define TSI108_PB_ISR_PBS_RD_ERR (1 << 8)
68
69#define TSI108_PCI_CFG_BASE_PHYS (0xfb000000)
70#define TSI108_PCI_CFG_SIZE (0x01000000)
71/* Global variables */
72
73extern u32 tsi108_pci_cfg_base;
74/* Exported functions */
75
76extern int tsi108_bridge_init(struct pci_controller *hose, uint phys_csr_base);
77extern unsigned long tsi108_get_mem_size(void);
78extern unsigned long tsi108_get_cpu_clk(void);
79extern unsigned long tsi108_get_sdc_clk(void);
80extern int tsi108_direct_write_config(struct pci_bus *bus, unsigned int devfn,
81 int offset, int len, u32 val);
82extern int tsi108_direct_read_config(struct pci_bus *bus, unsigned int devfn,
83 int offset, int len, u32 * val);
84extern void tsi108_clear_pci_error(u32 pci_cfg_base);
85
86extern phys_addr_t get_csrbase(void);
87
88typedef struct {
89 u32 regs; /* hw registers base address */
90 u32 phyregs; /* phy registers base address */
91 u16 phy; /* phy address */
92 u16 irq_num; /* irq number */
93 u8 mac_addr[6]; /* phy mac address */
94} hw_info;
95
96extern u32 get_vir_csrbase(void);
97extern u32 tsi108_csr_vir_base;
98
99extern inline u32 tsi108_read_reg(u32 reg_offset)
100{
101 return in_be32((volatile u32 *)(tsi108_csr_vir_base + reg_offset));
102}
103
104extern inline void tsi108_write_reg(u32 reg_offset, u32 val)
105{
106 out_be32((volatile u32 *)(tsi108_csr_vir_base + reg_offset), val);
107}
108
109#endif /* __PPC_KERNEL_TSI108_H */
diff --git a/include/asm-powerpc/udbg.h b/include/asm-powerpc/udbg.h
index 19a1517ac43b..55e57844fa78 100644
--- a/include/asm-powerpc/udbg.h
+++ b/include/asm-powerpc/udbg.h
@@ -42,7 +42,8 @@ extern void __init udbg_init_debug_lpar(void);
42extern void __init udbg_init_pmac_realmode(void); 42extern void __init udbg_init_pmac_realmode(void);
43extern void __init udbg_init_maple_realmode(void); 43extern void __init udbg_init_maple_realmode(void);
44extern void __init udbg_init_iseries(void); 44extern void __init udbg_init_iseries(void);
45extern void __init udbg_init_rtas(void); 45extern void __init udbg_init_rtas_panel(void);
46extern void __init udbg_init_rtas_console(void);
46 47
47#endif /* __KERNEL__ */ 48#endif /* __KERNEL__ */
48#endif /* _ASM_POWERPC_UDBG_H */ 49#endif /* _ASM_POWERPC_UDBG_H */
diff --git a/include/asm-ppc/ocp.h b/include/asm-ppc/ocp.h
index 3be5d760ffcd..16dbc7d17450 100644
--- a/include/asm-ppc/ocp.h
+++ b/include/asm-ppc/ocp.h
@@ -26,7 +26,6 @@
26 26
27#include <linux/init.h> 27#include <linux/init.h>
28#include <linux/list.h> 28#include <linux/list.h>
29#include <linux/devfs_fs_kernel.h>
30#include <linux/device.h> 29#include <linux/device.h>
31 30
32#include <asm/mmu.h> 31#include <asm/mmu.h>
diff --git a/include/asm-ppc/pci.h b/include/asm-ppc/pci.h
index 61434edbad7b..11ffaaa5da16 100644
--- a/include/asm-ppc/pci.h
+++ b/include/asm-ppc/pci.h
@@ -133,7 +133,7 @@ extern pgprot_t pci_phys_mem_access_prot(struct file *file,
133#define HAVE_ARCH_PCI_RESOURCE_TO_USER 133#define HAVE_ARCH_PCI_RESOURCE_TO_USER
134extern void pci_resource_to_user(const struct pci_dev *dev, int bar, 134extern void pci_resource_to_user(const struct pci_dev *dev, int bar,
135 const struct resource *rsrc, 135 const struct resource *rsrc,
136 u64 *start, u64 *end); 136 resource_size_t *start, resource_size_t *end);
137 137
138 138
139#endif /* __KERNEL__ */ 139#endif /* __KERNEL__ */
diff --git a/include/asm-s390/bitops.h b/include/asm-s390/bitops.h
index 4d2b126ba159..0ddcdba79e4a 100644
--- a/include/asm-s390/bitops.h
+++ b/include/asm-s390/bitops.h
@@ -12,6 +12,9 @@
12 * Copyright (C) 1992, Linus Torvalds 12 * Copyright (C) 1992, Linus Torvalds
13 * 13 *
14 */ 14 */
15
16#ifdef __KERNEL__
17
15#include <linux/compiler.h> 18#include <linux/compiler.h>
16 19
17/* 20/*
@@ -50,19 +53,6 @@
50 * with operation of the form "set_bit(bitnr, flags)". 53 * with operation of the form "set_bit(bitnr, flags)".
51 */ 54 */
52 55
53/* set ALIGN_CS to 1 if the SMP safe bit operations should
54 * align the address to 4 byte boundary. It seems to work
55 * without the alignment.
56 */
57#ifdef __KERNEL__
58#define ALIGN_CS 0
59#else
60#define ALIGN_CS 1
61#ifndef CONFIG_SMP
62#error "bitops won't work without CONFIG_SMP"
63#endif
64#endif
65
66/* bitmap tables from arch/S390/kernel/bitmap.S */ 56/* bitmap tables from arch/S390/kernel/bitmap.S */
67extern const char _oi_bitmap[]; 57extern const char _oi_bitmap[];
68extern const char _ni_bitmap[]; 58extern const char _ni_bitmap[];
@@ -121,10 +111,6 @@ static inline void set_bit_cs(unsigned long nr, volatile unsigned long *ptr)
121 unsigned long addr, old, new, mask; 111 unsigned long addr, old, new, mask;
122 112
123 addr = (unsigned long) ptr; 113 addr = (unsigned long) ptr;
124#if ALIGN_CS == 1
125 nr += (addr & __BITOPS_ALIGN) << 3; /* add alignment to bit number */
126 addr ^= addr & __BITOPS_ALIGN; /* align address to 8 */
127#endif
128 /* calculate address for CS */ 114 /* calculate address for CS */
129 addr += (nr ^ (nr & (__BITOPS_WORDSIZE - 1))) >> 3; 115 addr += (nr ^ (nr & (__BITOPS_WORDSIZE - 1))) >> 3;
130 /* make OR mask */ 116 /* make OR mask */
@@ -141,10 +127,6 @@ static inline void clear_bit_cs(unsigned long nr, volatile unsigned long *ptr)
141 unsigned long addr, old, new, mask; 127 unsigned long addr, old, new, mask;
142 128
143 addr = (unsigned long) ptr; 129 addr = (unsigned long) ptr;
144#if ALIGN_CS == 1
145 nr += (addr & __BITOPS_ALIGN) << 3; /* add alignment to bit number */
146 addr ^= addr & __BITOPS_ALIGN; /* align address to 8 */
147#endif
148 /* calculate address for CS */ 130 /* calculate address for CS */
149 addr += (nr ^ (nr & (__BITOPS_WORDSIZE - 1))) >> 3; 131 addr += (nr ^ (nr & (__BITOPS_WORDSIZE - 1))) >> 3;
150 /* make AND mask */ 132 /* make AND mask */
@@ -161,10 +143,6 @@ static inline void change_bit_cs(unsigned long nr, volatile unsigned long *ptr)
161 unsigned long addr, old, new, mask; 143 unsigned long addr, old, new, mask;
162 144
163 addr = (unsigned long) ptr; 145 addr = (unsigned long) ptr;
164#if ALIGN_CS == 1
165 nr += (addr & __BITOPS_ALIGN) << 3; /* add alignment to bit number */
166 addr ^= addr & __BITOPS_ALIGN; /* align address to 8 */
167#endif
168 /* calculate address for CS */ 146 /* calculate address for CS */
169 addr += (nr ^ (nr & (__BITOPS_WORDSIZE - 1))) >> 3; 147 addr += (nr ^ (nr & (__BITOPS_WORDSIZE - 1))) >> 3;
170 /* make XOR mask */ 148 /* make XOR mask */
@@ -182,10 +160,6 @@ test_and_set_bit_cs(unsigned long nr, volatile unsigned long *ptr)
182 unsigned long addr, old, new, mask; 160 unsigned long addr, old, new, mask;
183 161
184 addr = (unsigned long) ptr; 162 addr = (unsigned long) ptr;
185#if ALIGN_CS == 1
186 nr += (addr & __BITOPS_ALIGN) << 3; /* add alignment to bit number */
187 addr ^= addr & __BITOPS_ALIGN; /* align address to 8 */
188#endif
189 /* calculate address for CS */ 163 /* calculate address for CS */
190 addr += (nr ^ (nr & (__BITOPS_WORDSIZE - 1))) >> 3; 164 addr += (nr ^ (nr & (__BITOPS_WORDSIZE - 1))) >> 3;
191 /* make OR/test mask */ 165 /* make OR/test mask */
@@ -205,10 +179,6 @@ test_and_clear_bit_cs(unsigned long nr, volatile unsigned long *ptr)
205 unsigned long addr, old, new, mask; 179 unsigned long addr, old, new, mask;
206 180
207 addr = (unsigned long) ptr; 181 addr = (unsigned long) ptr;
208#if ALIGN_CS == 1
209 nr += (addr & __BITOPS_ALIGN) << 3; /* add alignment to bit number */
210 addr ^= addr & __BITOPS_ALIGN; /* align address to 8 */
211#endif
212 /* calculate address for CS */ 182 /* calculate address for CS */
213 addr += (nr ^ (nr & (__BITOPS_WORDSIZE - 1))) >> 3; 183 addr += (nr ^ (nr & (__BITOPS_WORDSIZE - 1))) >> 3;
214 /* make AND/test mask */ 184 /* make AND/test mask */
@@ -228,10 +198,6 @@ test_and_change_bit_cs(unsigned long nr, volatile unsigned long *ptr)
228 unsigned long addr, old, new, mask; 198 unsigned long addr, old, new, mask;
229 199
230 addr = (unsigned long) ptr; 200 addr = (unsigned long) ptr;
231#if ALIGN_CS == 1
232 nr += (addr & __BITOPS_ALIGN) << 3; /* add alignment to bit number */
233 addr ^= addr & __BITOPS_ALIGN; /* align address to 8 */
234#endif
235 /* calculate address for CS */ 201 /* calculate address for CS */
236 addr += (nr ^ (nr & (__BITOPS_WORDSIZE - 1))) >> 3; 202 addr += (nr ^ (nr & (__BITOPS_WORDSIZE - 1))) >> 3;
237 /* make XOR/test mask */ 203 /* make XOR/test mask */
@@ -834,8 +800,6 @@ static inline int sched_find_first_bit(unsigned long *b)
834 800
835#include <asm-generic/bitops/hweight.h> 801#include <asm-generic/bitops/hweight.h>
836 802
837#ifdef __KERNEL__
838
839/* 803/*
840 * ATTENTION: intel byte ordering convention for ext2 and minix !! 804 * ATTENTION: intel byte ordering convention for ext2 and minix !!
841 * bit 0 is the LSB of addr; bit 31 is the MSB of addr; 805 * bit 0 is the LSB of addr; bit 31 is the MSB of addr;
diff --git a/include/asm-s390/cio.h b/include/asm-s390/cio.h
index 089cf567c317..2b1619306351 100644
--- a/include/asm-s390/cio.h
+++ b/include/asm-s390/cio.h
@@ -276,6 +276,8 @@ extern void wait_cons_dev(void);
276 276
277extern void clear_all_subchannels(void); 277extern void clear_all_subchannels(void);
278 278
279extern void css_schedule_reprobe(void);
280
279#endif 281#endif
280 282
281#endif 283#endif
diff --git a/include/asm-s390/cmb.h b/include/asm-s390/cmb.h
index 2d09950a9c11..241756f80df3 100644
--- a/include/asm-s390/cmb.h
+++ b/include/asm-s390/cmb.h
@@ -44,10 +44,6 @@ struct cmbdata {
44#define BIODASDCMFENABLE _IO(DASD_IOCTL_LETTER,32) 44#define BIODASDCMFENABLE _IO(DASD_IOCTL_LETTER,32)
45/* enable channel measurement */ 45/* enable channel measurement */
46#define BIODASDCMFDISABLE _IO(DASD_IOCTL_LETTER,33) 46#define BIODASDCMFDISABLE _IO(DASD_IOCTL_LETTER,33)
47/* reset channel measurement block */
48#define BIODASDRESETCMB _IO(DASD_IOCTL_LETTER,34)
49/* read channel measurement data */
50#define BIODASDREADCMB _IOWR(DASD_IOCTL_LETTER,32,__u64)
51/* read channel measurement data */ 47/* read channel measurement data */
52#define BIODASDREADALLCMB _IOWR(DASD_IOCTL_LETTER,33,struct cmbdata) 48#define BIODASDREADALLCMB _IOWR(DASD_IOCTL_LETTER,33,struct cmbdata)
53 49
diff --git a/include/asm-s390/dasd.h b/include/asm-s390/dasd.h
index 1630c26e8f45..c042f9578081 100644
--- a/include/asm-s390/dasd.h
+++ b/include/asm-s390/dasd.h
@@ -68,10 +68,12 @@ typedef struct dasd_information2_t {
68 * 0x00: default features 68 * 0x00: default features
69 * 0x01: readonly (ro) 69 * 0x01: readonly (ro)
70 * 0x02: use diag discipline (diag) 70 * 0x02: use diag discipline (diag)
71 * 0x04: set the device initially online (internal use only)
71 */ 72 */
72#define DASD_FEATURE_DEFAULT 0 73#define DASD_FEATURE_DEFAULT 0x00
73#define DASD_FEATURE_READONLY 1 74#define DASD_FEATURE_READONLY 0x01
74#define DASD_FEATURE_USEDIAG 2 75#define DASD_FEATURE_USEDIAG 0x02
76#define DASD_FEATURE_INITIAL_ONLINE 0x04
75 77
76#define DASD_PARTN_BITS 2 78#define DASD_PARTN_BITS 2
77 79
diff --git a/include/asm-s390/thread_info.h b/include/asm-s390/thread_info.h
index 8e0c7ed73d03..0a518915bf90 100644
--- a/include/asm-s390/thread_info.h
+++ b/include/asm-s390/thread_info.h
@@ -63,6 +63,7 @@ struct thread_info {
63 .exec_domain = &default_exec_domain, \ 63 .exec_domain = &default_exec_domain, \
64 .flags = 0, \ 64 .flags = 0, \
65 .cpu = 0, \ 65 .cpu = 0, \
66 .preempt_count = 1, \
66 .restart_block = { \ 67 .restart_block = { \
67 .fn = do_no_restart_syscall, \ 68 .fn = do_no_restart_syscall, \
68 }, \ 69 }, \
diff --git a/include/asm-s390/unistd.h b/include/asm-s390/unistd.h
index e21443d3ea1d..aa7a243862e1 100644
--- a/include/asm-s390/unistd.h
+++ b/include/asm-s390/unistd.h
@@ -394,11 +394,9 @@
394 394
395#ifdef __KERNEL__ 395#ifdef __KERNEL__
396 396
397/* user-visible error numbers are in the range -1 - -122: see <asm-s390/errno.h> */
398
399#define __syscall_return(type, res) \ 397#define __syscall_return(type, res) \
400do { \ 398do { \
401 if ((unsigned long)(res) >= (unsigned long)(-125)) { \ 399 if ((unsigned long)(res) >= (unsigned long)(-4095)) {\
402 errno = -(res); \ 400 errno = -(res); \
403 res = -1; \ 401 res = -1; \
404 } \ 402 } \
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/compat_ioctl.h b/include/linux/compat_ioctl.h
index 917d62e41480..269d000bb2a3 100644
--- a/include/linux/compat_ioctl.h
+++ b/include/linux/compat_ioctl.h
@@ -567,11 +567,6 @@ COMPATIBLE_IOCTL(AUTOFS_IOC_PROTOSUBVER)
567COMPATIBLE_IOCTL(AUTOFS_IOC_ASKREGHOST) 567COMPATIBLE_IOCTL(AUTOFS_IOC_ASKREGHOST)
568COMPATIBLE_IOCTL(AUTOFS_IOC_TOGGLEREGHOST) 568COMPATIBLE_IOCTL(AUTOFS_IOC_TOGGLEREGHOST)
569COMPATIBLE_IOCTL(AUTOFS_IOC_ASKUMOUNT) 569COMPATIBLE_IOCTL(AUTOFS_IOC_ASKUMOUNT)
570/* DEVFS */
571COMPATIBLE_IOCTL(DEVFSDIOC_GET_PROTO_REV)
572COMPATIBLE_IOCTL(DEVFSDIOC_SET_EVENT_MASK)
573COMPATIBLE_IOCTL(DEVFSDIOC_RELEASE_EVENT_QUEUE)
574COMPATIBLE_IOCTL(DEVFSDIOC_SET_DEBUG_MASK)
575/* Raw devices */ 570/* Raw devices */
576COMPATIBLE_IOCTL(RAW_SETBIND) 571COMPATIBLE_IOCTL(RAW_SETBIND)
577COMPATIBLE_IOCTL(RAW_GETBIND) 572COMPATIBLE_IOCTL(RAW_GETBIND)
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/devfs_fs.h b/include/linux/devfs_fs.h
deleted file mode 100644
index de236f431877..000000000000
--- a/include/linux/devfs_fs.h
+++ /dev/null
@@ -1,41 +0,0 @@
1#ifndef _LINUX_DEVFS_FS_H
2#define _LINUX_DEVFS_FS_H
3
4#include <linux/ioctl.h>
5
6#define DEVFSD_PROTOCOL_REVISION_KERNEL 5
7
8#define DEVFSD_IOCTL_BASE 'd'
9
10/* These are the various ioctls */
11#define DEVFSDIOC_GET_PROTO_REV _IOR(DEVFSD_IOCTL_BASE, 0, int)
12#define DEVFSDIOC_SET_EVENT_MASK _IOW(DEVFSD_IOCTL_BASE, 2, int)
13#define DEVFSDIOC_RELEASE_EVENT_QUEUE _IOW(DEVFSD_IOCTL_BASE, 3, int)
14#define DEVFSDIOC_SET_DEBUG_MASK _IOW(DEVFSD_IOCTL_BASE, 4, int)
15
16#define DEVFSD_NOTIFY_REGISTERED 0
17#define DEVFSD_NOTIFY_UNREGISTERED 1
18#define DEVFSD_NOTIFY_ASYNC_OPEN 2
19#define DEVFSD_NOTIFY_CLOSE 3
20#define DEVFSD_NOTIFY_LOOKUP 4
21#define DEVFSD_NOTIFY_CHANGE 5
22#define DEVFSD_NOTIFY_CREATE 6
23#define DEVFSD_NOTIFY_DELETE 7
24
25#define DEVFS_PATHLEN 1024 /* Never change this otherwise the
26 binary interface will change */
27
28struct devfsd_notify_struct { /* Use native C types to ensure same types in kernel and user space */
29 unsigned int type; /* DEVFSD_NOTIFY_* value */
30 unsigned int mode; /* Mode of the inode or device entry */
31 unsigned int major; /* Major number of device entry */
32 unsigned int minor; /* Minor number of device entry */
33 unsigned int uid; /* Uid of process, inode or device entry */
34 unsigned int gid; /* Gid of process, inode or device entry */
35 unsigned int overrun_count; /* Number of lost events */
36 unsigned int namelen; /* Number of characters not including '\0' */
37 /* The device name MUST come last */
38 char devname[DEVFS_PATHLEN]; /* This will be '\0' terminated */
39};
40
41#endif /* _LINUX_DEVFS_FS_H */
diff --git a/include/linux/devfs_fs_kernel.h b/include/linux/devfs_fs_kernel.h
deleted file mode 100644
index 0d74a6f22abc..000000000000
--- a/include/linux/devfs_fs_kernel.h
+++ /dev/null
@@ -1,57 +0,0 @@
1#ifndef _LINUX_DEVFS_FS_KERNEL_H
2#define _LINUX_DEVFS_FS_KERNEL_H
3
4#include <linux/fs.h>
5#include <linux/spinlock.h>
6#include <linux/types.h>
7
8#include <asm/semaphore.h>
9
10#define DEVFS_SUPER_MAGIC 0x1373
11
12#ifdef CONFIG_DEVFS_FS
13extern int devfs_mk_bdev(dev_t dev, umode_t mode, const char *fmt, ...)
14 __attribute__ ((format(printf, 3, 4)));
15extern int devfs_mk_cdev(dev_t dev, umode_t mode, const char *fmt, ...)
16 __attribute__ ((format(printf, 3, 4)));
17extern int devfs_mk_symlink(const char *name, const char *link);
18extern int devfs_mk_dir(const char *fmt, ...)
19 __attribute__ ((format(printf, 1, 2)));
20extern void devfs_remove(const char *fmt, ...)
21 __attribute__ ((format(printf, 1, 2)));
22extern int devfs_register_tape(const char *name);
23extern void devfs_unregister_tape(int num);
24extern void mount_devfs_fs(void);
25#else /* CONFIG_DEVFS_FS */
26static inline int devfs_mk_bdev(dev_t dev, umode_t mode, const char *fmt, ...)
27{
28 return 0;
29}
30static inline int devfs_mk_cdev(dev_t dev, umode_t mode, const char *fmt, ...)
31{
32 return 0;
33}
34static inline int devfs_mk_symlink(const char *name, const char *link)
35{
36 return 0;
37}
38static inline int devfs_mk_dir(const char *fmt, ...)
39{
40 return 0;
41}
42static inline void devfs_remove(const char *fmt, ...)
43{
44}
45static inline int devfs_register_tape(const char *name)
46{
47 return -1;
48}
49static inline void devfs_unregister_tape(int num)
50{
51}
52static inline void mount_devfs_fs(void)
53{
54 return;
55}
56#endif /* CONFIG_DEVFS_FS */
57#endif /* _LINUX_DEVFS_FS_KERNEL_H */
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/elf-em.h b/include/linux/elf-em.h
index 114a96d25652..6a5796c81c90 100644
--- a/include/linux/elf-em.h
+++ b/include/linux/elf-em.h
@@ -11,7 +11,12 @@
11#define EM_486 6 /* Perhaps disused */ 11#define EM_486 6 /* Perhaps disused */
12#define EM_860 7 12#define EM_860 7
13#define EM_MIPS 8 /* MIPS R3000 (officially, big-endian only) */ 13#define EM_MIPS 8 /* MIPS R3000 (officially, big-endian only) */
14 /* Next two are historical and binaries and
15 modules of these types will be rejected by
16 Linux. */
17#define EM_MIPS_RS3_LE 10 /* MIPS R3000 little-endian */
14#define EM_MIPS_RS4_BE 10 /* MIPS R4000 big-endian */ 18#define EM_MIPS_RS4_BE 10 /* MIPS R4000 big-endian */
19
15#define EM_PARISC 15 /* HPPA */ 20#define EM_PARISC 15 /* HPPA */
16#define EM_SPARC32PLUS 18 /* Sun's "v8plus" */ 21#define EM_SPARC32PLUS 18 /* Sun's "v8plus" */
17#define EM_PPC 20 /* PowerPC */ 22#define EM_PPC 20 /* PowerPC */
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 07a08e92bc73..b45928f5c63f 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -380,7 +380,6 @@ struct fb_cursor {
380#include <linux/tty.h> 380#include <linux/tty.h>
381#include <linux/device.h> 381#include <linux/device.h>
382#include <linux/workqueue.h> 382#include <linux/workqueue.h>
383#include <linux/devfs_fs_kernel.h>
384#include <linux/notifier.h> 383#include <linux/notifier.h>
385#include <linux/list.h> 384#include <linux/list.h>
386#include <asm/io.h> 385#include <asm/io.h>
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/genhd.h b/include/linux/genhd.h
index 3498a0c68184..e4af57e87c17 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -112,8 +112,6 @@ struct gendisk {
112 sector_t capacity; 112 sector_t capacity;
113 113
114 int flags; 114 int flags;
115 char devfs_name[64]; /* devfs crap */
116 int number; /* more of the same */
117 struct device *driverfs_dev; 115 struct device *driverfs_dev;
118 struct kobject kobj; 116 struct kobject kobj;
119 struct kobject *holder_dir; 117 struct kobject *holder_dir;
diff --git a/include/linux/ide.h b/include/linux/ide.h
index ef7bef207f48..285316c836b5 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -552,7 +552,6 @@ typedef struct ide_drive_s {
552 struct hd_driveid *id; /* drive model identification info */ 552 struct hd_driveid *id; /* drive model identification info */
553 struct proc_dir_entry *proc; /* /proc/ide/ directory entry */ 553 struct proc_dir_entry *proc; /* /proc/ide/ directory entry */
554 struct ide_settings_s *settings;/* /proc/ide/ drive settings */ 554 struct ide_settings_s *settings;/* /proc/ide/ drive settings */
555 char devfs_name[64]; /* devfs crap */
556 555
557 struct hwif_s *hwif; /* actually (ide_hwif_t *) */ 556 struct hwif_s *hwif; /* actually (ide_hwif_t *) */
558 557
@@ -793,6 +792,7 @@ typedef struct hwif_s {
793 unsigned auto_poll : 1; /* supports nop auto-poll */ 792 unsigned auto_poll : 1; /* supports nop auto-poll */
794 unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */ 793 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 */ 794 unsigned no_io_32bit : 1; /* 1 = can not do 32-bit IO ops */
795 unsigned err_stops_fifo : 1; /* 1=data FIFO is cleared by an error */
796 796
797 struct device gendev; 797 struct device gendev;
798 struct completion gendev_rel_comp; /* To deal with device release() */ 798 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 cd6bd001ba4e..87a9fc039b47 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -9,13 +9,15 @@
9#define _LINUX_IOPORT_H 9#define _LINUX_IOPORT_H
10 10
11#include <linux/compiler.h> 11#include <linux/compiler.h>
12#include <linux/types.h>
12/* 13/*
13 * Resources are tree-like, allowing 14 * Resources are tree-like, allowing
14 * nesting etc.. 15 * nesting etc..
15 */ 16 */
16struct resource { 17struct resource {
18 resource_size_t start;
19 resource_size_t end;
17 const char *name; 20 const char *name;
18 unsigned long start, end;
19 unsigned long flags; 21 unsigned long flags;
20 struct resource *parent, *sibling, *child; 22 struct resource *parent, *sibling, *child;
21}; 23};
@@ -96,31 +98,37 @@ extern struct resource * ____request_resource(struct resource *root, struct reso
96extern int release_resource(struct resource *new); 98extern int release_resource(struct resource *new);
97extern __deprecated_for_modules int insert_resource(struct resource *parent, struct resource *new); 99extern __deprecated_for_modules int insert_resource(struct resource *parent, struct resource *new);
98extern int allocate_resource(struct resource *root, struct resource *new, 100extern int allocate_resource(struct resource *root, struct resource *new,
99 unsigned long size, 101 resource_size_t size, resource_size_t min,
100 unsigned long min, unsigned long max, 102 resource_size_t max, resource_size_t align,
101 unsigned long align,
102 void (*alignf)(void *, struct resource *, 103 void (*alignf)(void *, struct resource *,
103 unsigned long, unsigned long), 104 resource_size_t, resource_size_t),
104 void *alignf_data); 105 void *alignf_data);
105int adjust_resource(struct resource *res, unsigned long start, 106int adjust_resource(struct resource *res, resource_size_t start,
106 unsigned long size); 107 resource_size_t size);
108
109/* get registered SYSTEM_RAM resources in specified area */
110extern int find_next_system_ram(struct resource *res);
107 111
108/* Convenience shorthand with allocation */ 112/* Convenience shorthand with allocation */
109#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))
110#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))
111#define rename_region(region, newname) do { (region)->name = (newname); } while (0) 115#define rename_region(region, newname) do { (region)->name = (newname); } while (0)
112 116
113extern struct resource * __request_region(struct resource *, unsigned long start, unsigned long n, const char *name); 117extern struct resource * __request_region(struct resource *,
118 resource_size_t start,
119 resource_size_t n, const char *name);
114 120
115/* Compatibility cruft */ 121/* Compatibility cruft */
116#define release_region(start,n) __release_region(&ioport_resource, (start), (n)) 122#define release_region(start,n) __release_region(&ioport_resource, (start), (n))
117#define check_mem_region(start,n) __check_region(&iomem_resource, (start), (n)) 123#define check_mem_region(start,n) __check_region(&iomem_resource, (start), (n))
118#define release_mem_region(start,n) __release_region(&iomem_resource, (start), (n)) 124#define release_mem_region(start,n) __release_region(&iomem_resource, (start), (n))
119 125
120extern int __check_region(struct resource *, unsigned long, unsigned long); 126extern int __check_region(struct resource *, resource_size_t, resource_size_t);
121extern void __release_region(struct resource *, unsigned long, unsigned long); 127extern void __release_region(struct resource *, resource_size_t,
128 resource_size_t);
122 129
123static inline int __deprecated check_region(unsigned long s, unsigned long n) 130static inline int __deprecated check_region(resource_size_t s,
131 resource_size_t n)
124{ 132{
125 return __check_region(&ioport_resource, s, n); 133 return __check_region(&ioport_resource, s, n);
126} 134}
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/miscdevice.h b/include/linux/miscdevice.h
index 5b584dafb5a6..b03cfb91e228 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -40,7 +40,6 @@ struct miscdevice {
40 struct list_head list; 40 struct list_head list;
41 struct device *dev; 41 struct device *dev;
42 struct class_device *class; 42 struct class_device *class;
43 char devfs_name[64];
44}; 43};
45 44
46extern int misc_register(struct miscdevice * misc); 45extern int misc_register(struct miscdevice * misc);
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.h b/include/linux/pci.h
index 62a8c22f5f60..983fca251b25 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -404,8 +404,8 @@ int pcibios_enable_device(struct pci_dev *, int mask);
404char *pcibios_setup (char *str); 404char *pcibios_setup (char *str);
405 405
406/* Used only when drivers/pci/setup.c is used */ 406/* Used only when drivers/pci/setup.c is used */
407void pcibios_align_resource(void *, struct resource *, 407void pcibios_align_resource(void *, struct resource *, resource_size_t,
408 unsigned long, unsigned long); 408 resource_size_t);
409void pcibios_update_irq(struct pci_dev *, int irq); 409void pcibios_update_irq(struct pci_dev *, int irq);
410 410
411/* Generic PCI functions used internally */ 411/* Generic PCI functions used internally */
@@ -532,10 +532,10 @@ void pci_release_region(struct pci_dev *, int);
532 532
533/* drivers/pci/bus.c */ 533/* drivers/pci/bus.c */
534int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, 534int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res,
535 unsigned long size, unsigned long align, 535 resource_size_t size, resource_size_t align,
536 unsigned long min, unsigned int type_mask, 536 resource_size_t min, unsigned int type_mask,
537 void (*alignf)(void *, struct resource *, 537 void (*alignf)(void *, struct resource *,
538 unsigned long, unsigned long), 538 resource_size_t, resource_size_t),
539 void *alignf_data); 539 void *alignf_data);
540void pci_enable_bridges(struct pci_bus *bus); 540void pci_enable_bridges(struct pci_bus *bus);
541 541
@@ -730,7 +730,8 @@ static inline char *pci_name(struct pci_dev *pdev)
730 */ 730 */
731#ifndef HAVE_ARCH_PCI_RESOURCE_TO_USER 731#ifndef HAVE_ARCH_PCI_RESOURCE_TO_USER
732static inline void pci_resource_to_user(const struct pci_dev *dev, int bar, 732static inline void pci_resource_to_user(const struct pci_dev *dev, int bar,
733 const struct resource *rsrc, u64 *start, u64 *end) 733 const struct resource *rsrc, resource_size_t *start,
734 resource_size_t *end)
734{ 735{
735 *start = rsrc->start; 736 *start = rsrc->start;
736 *end = rsrc->end; 737 *end = rsrc->end;
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/pnp.h b/include/linux/pnp.h
index 93b0959eb40f..ab8a8dd8d64c 100644
--- a/include/linux/pnp.h
+++ b/include/linux/pnp.h
@@ -389,7 +389,8 @@ int pnp_start_dev(struct pnp_dev *dev);
389int pnp_stop_dev(struct pnp_dev *dev); 389int pnp_stop_dev(struct pnp_dev *dev);
390int pnp_activate_dev(struct pnp_dev *dev); 390int pnp_activate_dev(struct pnp_dev *dev);
391int pnp_disable_dev(struct pnp_dev *dev); 391int pnp_disable_dev(struct pnp_dev *dev);
392void pnp_resource_change(struct resource *resource, unsigned long start, unsigned long size); 392void pnp_resource_change(struct resource *resource, resource_size_t start,
393 resource_size_t size);
393 394
394/* protocol helpers */ 395/* protocol helpers */
395int pnp_is_active(struct pnp_dev * dev); 396int pnp_is_active(struct pnp_dev * dev);
@@ -434,7 +435,9 @@ static inline int pnp_start_dev(struct pnp_dev *dev) { return -ENODEV; }
434static inline int pnp_stop_dev(struct pnp_dev *dev) { return -ENODEV; } 435static inline int pnp_stop_dev(struct pnp_dev *dev) { return -ENODEV; }
435static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; } 436static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; }
436static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; } 437static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; }
437static inline void pnp_resource_change(struct resource *resource, unsigned long start, unsigned long size) { } 438static inline void pnp_resource_change(struct resource *resource,
439 resource_size_t start,
440 resource_size_t size) { }
438 441
439/* protocol helpers */ 442/* protocol helpers */
440static inline int pnp_is_active(struct pnp_dev * dev) { return 0; } 443static inline int pnp_is_active(struct pnp_dev * dev) { return 0; }
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/serial_core.h b/include/linux/serial_core.h
index 951c4e858274..fc1104a2cfa9 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -336,7 +336,6 @@ struct uart_driver {
336 struct module *owner; 336 struct module *owner;
337 const char *driver_name; 337 const char *driver_name;
338 const char *dev_name; 338 const char *dev_name;
339 const char *devfs_name;
340 int major; 339 int major;
341 int minor; 340 int minor;
342 int nr; 341 int nr;
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_driver.h b/include/linux/tty_driver.h
index b368b296d035..58c961c9e170 100644
--- a/include/linux/tty_driver.h
+++ b/include/linux/tty_driver.h
@@ -157,7 +157,6 @@ struct tty_driver {
157 struct cdev cdev; 157 struct cdev cdev;
158 struct module *owner; 158 struct module *owner;
159 const char *driver_name; 159 const char *driver_name;
160 const char *devfs_name;
161 const char *name; 160 const char *name;
162 int name_base; /* offset of printed name */ 161 int name_base; /* offset of printed name */
163 int major; /* major device number */ 162 int major; /* major device number */
@@ -242,8 +241,15 @@ void tty_set_operations(struct tty_driver *driver, struct tty_operations *op);
242 * is also a promise, if the above case is true, not to signal 241 * is also a promise, if the above case is true, not to signal
243 * overruns, either.) 242 * overruns, either.)
244 * 243 *
245 * TTY_DRIVER_NO_DEVFS --- if set, do not create devfs entries. This 244 * TTY_DRIVER_DYNAMIC_DEV --- if set, the individual tty devices need
246 * is only used by tty_register_driver(). 245 * to be registered with a call to tty_register_driver() when the
246 * device is found in the system and unregistered with a call to
247 * tty_unregister_device() so the devices will be show up
248 * properly in sysfs. If not set, driver->num entries will be
249 * created by the tty core in sysfs when tty_register_driver() is
250 * called. This is to be used by drivers that have tty devices
251 * that can appear and disappear while the main tty driver is
252 * registered with the tty core.
247 * 253 *
248 * TTY_DRIVER_DEVPTS_MEM -- don't use the standard arrays, instead 254 * TTY_DRIVER_DEVPTS_MEM -- don't use the standard arrays, instead
249 * use dynamic memory keyed through the devpts filesystem. This 255 * use dynamic memory keyed through the devpts filesystem. This
@@ -252,7 +258,7 @@ void tty_set_operations(struct tty_driver *driver, struct tty_operations *op);
252#define TTY_DRIVER_INSTALLED 0x0001 258#define TTY_DRIVER_INSTALLED 0x0001
253#define TTY_DRIVER_RESET_TERMIOS 0x0002 259#define TTY_DRIVER_RESET_TERMIOS 0x0002
254#define TTY_DRIVER_REAL_RAW 0x0004 260#define TTY_DRIVER_REAL_RAW 0x0004
255#define TTY_DRIVER_NO_DEVFS 0x0008 261#define TTY_DRIVER_DYNAMIC_DEV 0x0008
256#define TTY_DRIVER_DEVPTS_MEM 0x0010 262#define TTY_DRIVER_DEVPTS_MEM 0x0010
257 263
258/* tty driver types */ 264/* tty driver types */
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/types.h b/include/linux/types.h
index a5e46e783ffa..3f235660a3cd 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -177,8 +177,15 @@ typedef __u64 __bitwise __be64;
177 177
178#ifdef __KERNEL__ 178#ifdef __KERNEL__
179typedef unsigned __bitwise__ gfp_t; 179typedef unsigned __bitwise__ gfp_t;
180
181#ifdef CONFIG_RESOURCES_64BIT
182typedef u64 resource_size_t;
183#else
184typedef u32 resource_size_t;
180#endif 185#endif
181 186
187#endif /* __KERNEL__ */
188
182struct ustat { 189struct ustat {
183 __kernel_daddr_t f_tfree; 190 __kernel_daddr_t f_tfree;
184 __kernel_ino_t f_tinode; 191 __kernel_ino_t f_tinode;
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"
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h
index a1b473190e65..62dae1a8c441 100644
--- a/include/media/v4l2-dev.h
+++ b/include/media/v4l2-dev.h
@@ -314,7 +314,6 @@ void *priv;
314 /* for videodev.c intenal usage -- please don't touch */ 314 /* for videodev.c intenal usage -- please don't touch */
315 int users; /* video_exclusive_{open|close} ... */ 315 int users; /* video_exclusive_{open|close} ... */
316 struct mutex lock; /* ... helper function uses these */ 316 struct mutex lock; /* ... helper function uses these */
317 char devfs_name[64]; /* devfs */
318 struct class_device class_dev; /* sysfs */ 317 struct class_device class_dev; /* sysfs */
319}; 318};
320 319
diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h
index 446afc3ea27f..758f8bf133c7 100644
--- a/include/sound/ac97_codec.h
+++ b/include/sound/ac97_codec.h
@@ -265,6 +265,7 @@
265 265
266/* specific - Analog Devices */ 266/* specific - Analog Devices */
267#define AC97_AD_TEST 0x5a /* test register */ 267#define AC97_AD_TEST 0x5a /* test register */
268#define AC97_AD_TEST2 0x5c /* undocumented test register 2 */
268#define AC97_AD_CODEC_CFG 0x70 /* codec configuration */ 269#define AC97_AD_CODEC_CFG 0x70 /* codec configuration */
269#define AC97_AD_JACK_SPDIF 0x72 /* Jack Sense & S/PDIF */ 270#define AC97_AD_JACK_SPDIF 0x72 /* Jack Sense & S/PDIF */
270#define AC97_AD_SERIAL_CFG 0x74 /* Serial Configuration */ 271#define AC97_AD_SERIAL_CFG 0x74 /* Serial Configuration */
diff --git a/include/sound/ak4xxx-adda.h b/include/sound/ak4xxx-adda.h
index 3bf5911fe827..3d9888492026 100644
--- a/include/sound/ak4xxx-adda.h
+++ b/include/sound/ak4xxx-adda.h
@@ -32,8 +32,8 @@ struct snd_akm4xxx;
32struct snd_ak4xxx_ops { 32struct snd_ak4xxx_ops {
33 void (*lock)(struct snd_akm4xxx *ak, int chip); 33 void (*lock)(struct snd_akm4xxx *ak, int chip);
34 void (*unlock)(struct snd_akm4xxx *ak, int chip); 34 void (*unlock)(struct snd_akm4xxx *ak, int chip);
35 void (*write)(struct snd_akm4xxx *ak, int chip, unsigned char reg, unsigned char val); 35 void (*write)(struct snd_akm4xxx *ak, int chip, unsigned char reg,
36 // unsigned char (*read)(struct snd_akm4xxx *ak, int chip, unsigned char reg); 36 unsigned char val);
37 void (*set_rate_val)(struct snd_akm4xxx *ak, unsigned int rate); 37 void (*set_rate_val)(struct snd_akm4xxx *ak, unsigned int rate);
38}; 38};
39 39
@@ -41,29 +41,40 @@ struct snd_ak4xxx_ops {
41 41
42struct snd_akm4xxx { 42struct snd_akm4xxx {
43 struct snd_card *card; 43 struct snd_card *card;
44 unsigned int num_adcs; /* AK4524 or AK4528 ADCs */ 44 unsigned int num_adcs; /* AK4524 or AK4528 ADCs */
45 unsigned int num_dacs; /* AK4524 or AK4528 DACs */ 45 unsigned int num_dacs; /* AK4524 or AK4528 DACs */
46 unsigned char images[AK4XXX_IMAGE_SIZE]; /* saved register image */ 46 unsigned char images[AK4XXX_IMAGE_SIZE]; /* saved register image */
47 unsigned char ipga_gain[AK4XXX_MAX_CHIPS][2]; /* saved register image for IPGA (AK4528) */ 47 unsigned char ipga_gain[AK4XXX_MAX_CHIPS][2]; /* saved register image
48 * for IPGA (AK4528)
49 */
48 unsigned long private_value[AK4XXX_MAX_CHIPS]; /* helper for driver */ 50 unsigned long private_value[AK4XXX_MAX_CHIPS]; /* helper for driver */
49 void *private_data[AK4XXX_MAX_CHIPS]; /* helper for driver */ 51 void *private_data[AK4XXX_MAX_CHIPS]; /* helper for driver */
50 /* template should fill the following fields */ 52 /* template should fill the following fields */
51 unsigned int idx_offset; /* control index offset */ 53 unsigned int idx_offset; /* control index offset */
52 enum { 54 enum {
53 SND_AK4524, SND_AK4528, SND_AK4529, 55 SND_AK4524, SND_AK4528, SND_AK4529,
54 SND_AK4355, SND_AK4358, SND_AK4381 56 SND_AK4355, SND_AK4358, SND_AK4381
55 } type; 57 } type;
58 unsigned int *num_stereo; /* array of combined counts
59 * for the mixer
60 */
61 char **channel_names; /* array of mixer channel names */
56 struct snd_ak4xxx_ops ops; 62 struct snd_ak4xxx_ops ops;
57}; 63};
58 64
59void snd_akm4xxx_write(struct snd_akm4xxx *ak, int chip, unsigned char reg, unsigned char val); 65void snd_akm4xxx_write(struct snd_akm4xxx *ak, int chip, unsigned char reg,
66 unsigned char val);
60void snd_akm4xxx_reset(struct snd_akm4xxx *ak, int state); 67void snd_akm4xxx_reset(struct snd_akm4xxx *ak, int state);
61void snd_akm4xxx_init(struct snd_akm4xxx *ak); 68void snd_akm4xxx_init(struct snd_akm4xxx *ak);
62int snd_akm4xxx_build_controls(struct snd_akm4xxx *ak); 69int snd_akm4xxx_build_controls(struct snd_akm4xxx *ak);
63 70
64#define snd_akm4xxx_get(ak,chip,reg) (ak)->images[(chip) * 16 + (reg)] 71#define snd_akm4xxx_get(ak,chip,reg) \
65#define snd_akm4xxx_set(ak,chip,reg,val) ((ak)->images[(chip) * 16 + (reg)] = (val)) 72 (ak)->images[(chip) * 16 + (reg)]
66#define snd_akm4xxx_get_ipga(ak,chip,reg) (ak)->ipga_gain[chip][(reg)-4] 73#define snd_akm4xxx_set(ak,chip,reg,val) \
67#define snd_akm4xxx_set_ipga(ak,chip,reg,val) ((ak)->ipga_gain[chip][(reg)-4] = (val)) 74 ((ak)->images[(chip) * 16 + (reg)] = (val))
75#define snd_akm4xxx_get_ipga(ak,chip,reg) \
76 (ak)->ipga_gain[chip][(reg)-4]
77#define snd_akm4xxx_set_ipga(ak,chip,reg,val) \
78 ((ak)->ipga_gain[chip][(reg)-4] = (val))
68 79
69#endif /* __SOUND_AK4XXX_ADDA_H */ 80#endif /* __SOUND_AK4XXX_ADDA_H */
diff --git a/include/sound/initval.h b/include/sound/initval.h
index d29e3d31d149..d45170b9e0b7 100644
--- a/include/sound/initval.h
+++ b/include/sound/initval.h
@@ -62,7 +62,8 @@ static int snd_legacy_find_free_irq(int *irq_table)
62{ 62{
63 while (*irq_table != -1) { 63 while (*irq_table != -1) {
64 if (!request_irq(*irq_table, snd_legacy_empty_irq_handler, 64 if (!request_irq(*irq_table, snd_legacy_empty_irq_handler,
65 SA_INTERRUPT, "ALSA Test IRQ", (void *) irq_table)) { 65 SA_INTERRUPT | SA_PROBEIRQ, "ALSA Test IRQ",
66 (void *) irq_table)) {
66 free_irq(*irq_table, (void *) irq_table); 67 free_irq(*irq_table, (void *) irq_table);
67 return *irq_table; 68 return *irq_table;
68 } 69 }