aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-alpha/spinlock.h4
-rw-r--r--include/asm-alpha/unistd.h69
-rw-r--r--include/asm-arm/arch-clps711x/entry-macro.S2
-rw-r--r--include/asm-arm/arch-ebsa285/entry-macro.S2
-rw-r--r--include/asm-arm/arch-h720x/system.h2
-rw-r--r--include/asm-arm/arch-ixp4xx/system.h2
-rw-r--r--include/asm-arm/arch-omap/dmtimer.h2
-rw-r--r--include/asm-arm/arch-omap/mcbsp.h2
-rw-r--r--include/asm-arm/arch-omap/pm.h2
-rw-r--r--include/asm-arm/arch-pnx4008/clock.h1
-rw-r--r--include/asm-arm/arch-pnx4008/platform.h2
-rw-r--r--include/asm-arm/arch-pxa/pxafb.h14
-rw-r--r--include/asm-arm/arch-pxa/spitz.h4
-rw-r--r--include/asm-arm/arch-s3c2410/fb.h2
-rw-r--r--include/asm-arm/arch-s3c2410/regs-adc.h2
-rw-r--r--include/asm-arm/arch-s3c2410/regs-clock.h2
-rw-r--r--include/asm-arm/arch-s3c2410/regs-dsc.h2
-rw-r--r--include/asm-arm/arch-s3c2410/regs-gpio.h2
-rw-r--r--include/asm-arm/arch-s3c2410/regs-gpioj.h2
-rw-r--r--include/asm-arm/arch-s3c2410/regs-iis.h2
-rw-r--r--include/asm-arm/arch-s3c2410/regs-irq.h2
-rw-r--r--include/asm-arm/arch-s3c2410/regs-lcd.h2
-rw-r--r--include/asm-arm/arch-s3c2410/regs-rtc.h2
-rw-r--r--include/asm-arm/arch-s3c2410/regs-sdi.h2
-rw-r--r--include/asm-arm/arch-s3c2410/regs-timer.h2
-rw-r--r--include/asm-arm/arch-s3c2410/regs-udc.h2
-rw-r--r--include/asm-arm/arch-s3c2410/spi-gpio.h2
-rw-r--r--include/asm-arm/arch-sa1100/neponset.h2
-rw-r--r--include/asm-arm/arch-sa1100/uncompress.h2
-rw-r--r--include/asm-arm/arch-shark/vmalloc.h2
-rw-r--r--include/asm-arm/hardware/debug-8250.S2
-rw-r--r--include/asm-arm/hardware/debug-pl01x.S2
-rw-r--r--include/asm-arm/hardware/entry-macro-iomd.S2
-rw-r--r--include/asm-arm/hardware/sa1111.h2
-rw-r--r--include/asm-arm/spinlock.h4
-rw-r--r--include/asm-arm/timeofday.h4
-rw-r--r--include/asm-arm/unistd.h24
-rw-r--r--include/asm-arm26/assembler.h2
-rw-r--r--include/asm-arm26/namei.h2
-rw-r--r--include/asm-arm26/semaphore.h2
-rw-r--r--include/asm-arm26/unistd.h24
-rw-r--r--include/asm-avr32/unistd.h80
-rw-r--r--include/asm-cris/arch-v32/spinlock.h4
-rw-r--r--include/asm-cris/unistd.h61
-rw-r--r--include/asm-frv/namei.h2
-rw-r--r--include/asm-frv/pgtable.h2
-rw-r--r--include/asm-frv/timex.h5
-rw-r--r--include/asm-frv/unistd.h25
-rw-r--r--include/asm-generic/mutex-dec.h2
-rw-r--r--include/asm-generic/mutex-null.h2
-rw-r--r--include/asm-generic/mutex-xchg.h2
-rw-r--r--include/asm-generic/pgtable.h37
-rw-r--r--include/asm-generic/rtc.h2
-rw-r--r--include/asm-generic/tlb.h2
-rw-r--r--include/asm-h8300/keyboard.h8
-rw-r--r--include/asm-h8300/unistd.h51
-rw-r--r--include/asm-i386/bugs.h2
-rw-r--r--include/asm-i386/elf.h2
-rw-r--r--include/asm-i386/hw_irq.h3
-rw-r--r--include/asm-i386/hypertransport.h42
-rw-r--r--include/asm-i386/io_apic.h42
-rw-r--r--include/asm-i386/mach-default/irq_vectors_limits.h5
-rw-r--r--include/asm-i386/mach-summit/mach_apic.h2
-rw-r--r--include/asm-i386/mca_dma.h3
-rw-r--r--include/asm-i386/msi.h23
-rw-r--r--include/asm-i386/msidef.h47
-rw-r--r--include/asm-i386/pgtable-2level.h1
-rw-r--r--include/asm-i386/pgtable-3level.h16
-rw-r--r--include/asm-i386/pgtable.h80
-rw-r--r--include/asm-i386/ptrace.h3
-rw-r--r--include/asm-i386/smp.h2
-rw-r--r--include/asm-i386/spinlock.h4
-rw-r--r--include/asm-i386/topology.h1
-rw-r--r--include/asm-i386/unistd.h39
-rw-r--r--include/asm-ia64/machvec.h21
-rw-r--r--include/asm-ia64/machvec_sn2.h9
-rw-r--r--include/asm-ia64/msi.h29
-rw-r--r--include/asm-ia64/ptrace.h3
-rw-r--r--include/asm-ia64/spinlock.h4
-rw-r--r--include/asm-ia64/topology.h2
-rw-r--r--include/asm-ia64/unistd.h72
-rw-r--r--include/asm-m32r/m32104ut/m32104ut_pld.h2
-rw-r--r--include/asm-m32r/m32700ut/m32700ut_lan.h2
-rw-r--r--include/asm-m32r/m32700ut/m32700ut_lcd.h2
-rw-r--r--include/asm-m32r/m32700ut/m32700ut_pld.h2
-rw-r--r--include/asm-m32r/mappi2/mappi2_pld.h2
-rw-r--r--include/asm-m32r/mappi3/mappi3_pld.h2
-rw-r--r--include/asm-m32r/opsput/opsput_lan.h2
-rw-r--r--include/asm-m32r/opsput/opsput_lcd.h2
-rw-r--r--include/asm-m32r/opsput/opsput_pld.h2
-rw-r--r--include/asm-m32r/pgtable-2level.h2
-rw-r--r--include/asm-m32r/spinlock.h4
-rw-r--r--include/asm-m32r/timex.h3
-rw-r--r--include/asm-m32r/unistd.h37
-rw-r--r--include/asm-m68k/rtc.h2
-rw-r--r--include/asm-m68k/unistd.h6
-rw-r--r--include/asm-m68knommu/processor.h2
-rw-r--r--include/asm-m68knommu/unistd.h55
-rw-r--r--include/asm-mips/bootinfo.h12
-rw-r--r--include/asm-mips/cacheflush.h2
-rw-r--r--include/asm-mips/galileo-boards/ev96100.h55
-rw-r--r--include/asm-mips/galileo-boards/ev96100int.h12
-rw-r--r--include/asm-mips/irqflags.h25
-rw-r--r--include/asm-mips/it8172/it8172.h348
-rw-r--r--include/asm-mips/it8172/it8172_cir.h140
-rw-r--r--include/asm-mips/it8172/it8172_dbg.h38
-rw-r--r--include/asm-mips/it8172/it8172_int.h144
-rw-r--r--include/asm-mips/it8172/it8172_pci.h108
-rw-r--r--include/asm-mips/it8712.h28
-rw-r--r--include/asm-mips/mach-ev64120/mach-gt64120.h1
-rw-r--r--include/asm-mips/mach-ip27/topology.h1
-rw-r--r--include/asm-mips/ptrace.h3
-rw-r--r--include/asm-mips/serial.h51
-rw-r--r--include/asm-mips/spinlock.h4
-rw-r--r--include/asm-mips/stacktrace.h44
-rw-r--r--include/asm-mips/tx4938/tx4938_mips.h2
-rw-r--r--include/asm-mips/unistd.h39
-rw-r--r--include/asm-parisc/rtc.h2
-rw-r--r--include/asm-parisc/spinlock.h4
-rw-r--r--include/asm-parisc/unistd.h86
-rw-r--r--include/asm-powerpc/fs_pd.h45
-rw-r--r--include/asm-powerpc/io.h1
-rw-r--r--include/asm-powerpc/ipic.h2
-rw-r--r--include/asm-powerpc/kprobes.h22
-rw-r--r--include/asm-powerpc/mpc85xx.h53
-rw-r--r--include/asm-powerpc/ptrace.h2
-rw-r--r--include/asm-powerpc/spinlock.h4
-rw-r--r--include/asm-powerpc/time.h6
-rw-r--r--include/asm-powerpc/topology.h1
-rw-r--r--include/asm-powerpc/unistd.h7
-rw-r--r--include/asm-ppc/cpm2.h63
-rw-r--r--include/asm-ppc/fs_pd.h36
-rw-r--r--include/asm-ppc/mv64x60_defs.h2
-rw-r--r--include/asm-ppc/rheap.h6
-rw-r--r--include/asm-ppc/rtc.h2
-rw-r--r--include/asm-ppc/spinlock.h4
-rw-r--r--include/asm-s390/ptrace.h1
-rw-r--r--include/asm-s390/qdio.h2
-rw-r--r--include/asm-s390/setup.h1
-rw-r--r--include/asm-s390/spinlock.h35
-rw-r--r--include/asm-s390/spinlock_types.h6
-rw-r--r--include/asm-s390/unistd.h51
-rw-r--r--include/asm-sh/.gitignore3
-rw-r--r--include/asm-sh/bigsur/io.h2
-rw-r--r--include/asm-sh/bigsur/serial.h2
-rw-r--r--include/asm-sh/bugs.h2
-rw-r--r--include/asm-sh/cpu-sh3/rtc.h25
-rw-r--r--include/asm-sh/cpu-sh4/rtc.h25
-rw-r--r--include/asm-sh/dreamcast/sysasic.h2
-rw-r--r--include/asm-sh/ec3104/keyboard.h2
-rw-r--r--include/asm-sh/elf.h1
-rw-r--r--include/asm-sh/hd64465/io.h2
-rw-r--r--include/asm-sh/hs7751rvoip/io.h39
-rw-r--r--include/asm-sh/mpc1211/io.h2
-rw-r--r--include/asm-sh/mpc1211/keyboard.h4
-rw-r--r--include/asm-sh/rts7751r2d/io.h37
-rw-r--r--include/asm-sh/rts7751r2d/rts7751r2d.h3
-rw-r--r--include/asm-sh/sfp-machine.h2
-rw-r--r--include/asm-sh/spinlock.h13
-rw-r--r--include/asm-sh/string.h15
-rw-r--r--include/asm-sh/unistd.h70
-rw-r--r--include/asm-sh64/keyboard.h4
-rw-r--r--include/asm-sh64/serial.h2
-rw-r--r--include/asm-sh64/timex.h3
-rw-r--r--include/asm-sh64/unistd.h41
-rw-r--r--include/asm-sparc/reg.h2
-rw-r--r--include/asm-sparc/spinlock.h4
-rw-r--r--include/asm-sparc/unistd.h47
-rw-r--r--include/asm-sparc64/compat_signal.h30
-rw-r--r--include/asm-sparc64/signal.h42
-rw-r--r--include/asm-sparc64/spinlock.h4
-rw-r--r--include/asm-sparc64/unistd.h42
-rw-r--r--include/asm-um/unistd.h28
-rw-r--r--include/asm-v850/unistd.h51
-rw-r--r--include/asm-x86_64/cache.h2
-rw-r--r--include/asm-x86_64/hardirq.h3
-rw-r--r--include/asm-x86_64/hw_irq.h8
-rw-r--r--include/asm-x86_64/hypertransport.h42
-rw-r--r--include/asm-x86_64/io_apic.h43
-rw-r--r--include/asm-x86_64/irq.h7
-rw-r--r--include/asm-x86_64/msi.h24
-rw-r--r--include/asm-x86_64/msidef.h47
-rw-r--r--include/asm-x86_64/ptrace.h2
-rw-r--r--include/asm-x86_64/spinlock.h4
-rw-r--r--include/asm-x86_64/topology.h1
-rw-r--r--include/asm-x86_64/unistd.h93
-rw-r--r--include/asm-x86_64/vsyscall.h3
-rw-r--r--include/asm-xtensa/a.out.h2
-rw-r--r--include/asm-xtensa/cache.h2
-rw-r--r--include/asm-xtensa/coprocessor.h2
-rw-r--r--include/asm-xtensa/dma-mapping.h2
-rw-r--r--include/asm-xtensa/ioctls.h2
-rw-r--r--include/asm-xtensa/pgtable.h2
-rw-r--r--include/asm-xtensa/siginfo.h2
-rw-r--r--include/asm-xtensa/timex.h3
-rw-r--r--include/asm-xtensa/unistd.h5
-rw-r--r--include/linux/Kbuild3
-rw-r--r--include/linux/ac97_codec.h5
-rw-r--r--include/linux/acct.h4
-rw-r--r--include/linux/aio.h12
-rw-r--r--include/linux/aio_abi.h4
-rw-r--r--include/linux/awe_voice.h2
-rw-r--r--include/linux/compat.h2
-rw-r--r--include/linux/compat_ioctl.h14
-rw-r--r--include/linux/compiler.h8
-rw-r--r--include/linux/console.h3
-rw-r--r--include/linux/console_struct.h2
-rw-r--r--include/linux/consolemap.h1
-rw-r--r--include/linux/device-mapper.h14
-rw-r--r--include/linux/dm-ioctl.h4
-rw-r--r--include/linux/fb.h3
-rw-r--r--include/linux/fs.h58
-rw-r--r--include/linux/fs_enet_pd.h47
-rw-r--r--include/linux/fs_uart_pd.h14
-rw-r--r--include/linux/genalloc.h1
-rw-r--r--include/linux/hardirq.h7
-rw-r--r--include/linux/harrier_defs.h2
-rw-r--r--include/linux/htirq.h15
-rw-r--r--include/linux/ide.h12
-rw-r--r--include/linux/init_task.h12
-rw-r--r--include/linux/input.h272
-rw-r--r--include/linux/io.h4
-rw-r--r--include/linux/ipc.h55
-rw-r--r--include/linux/ipmi.h48
-rw-r--r--include/linux/irq.h57
-rw-r--r--include/linux/ite_gpio.h66
-rw-r--r--include/linux/kallsyms.h11
-rw-r--r--include/linux/kernel.h6
-rw-r--r--include/linux/kmod.h4
-rw-r--r--include/linux/kprobes.h8
-rw-r--r--include/linux/latency.h25
-rw-r--r--include/linux/libps2.h1
-rw-r--r--include/linux/lockd/bind.h2
-rw-r--r--include/linux/lockd/lockd.h63
-rw-r--r--include/linux/lockd/share.h3
-rw-r--r--include/linux/lockd/sm_inter.h5
-rw-r--r--include/linux/lockd/xdr4.h2
-rw-r--r--include/linux/memory.h4
-rw-r--r--include/linux/memory_hotplug.h2
-rw-r--r--include/linux/mm.h2
-rw-r--r--include/linux/module.h2
-rw-r--r--include/linux/msi.h49
-rw-r--r--include/linux/mtd/nand.h25
-rw-r--r--include/linux/mtd/onenand.h6
-rw-r--r--include/linux/mtd/onenand_regs.h4
-rw-r--r--include/linux/mtd/plat-ram.h2
-rw-r--r--include/linux/namei.h1
-rw-r--r--include/linux/namespace.h6
-rw-r--r--include/linux/ncp_fs.h1
-rw-r--r--include/linux/nfs_fs.h10
-rw-r--r--include/linux/nfsd/const.h20
-rw-r--r--include/linux/nfsd/export.h21
-rw-r--r--include/linux/nfsd/nfsd.h10
-rw-r--r--include/linux/nfsd/nfsfh.h11
-rw-r--r--include/linux/nfsd/stats.h2
-rw-r--r--include/linux/nfsd/syscall.h17
-rw-r--r--include/linux/nfsd/xdr.h4
-rw-r--r--include/linux/nfsd/xdr3.h2
-rw-r--r--include/linux/nfsd/xdr4.h2
-rw-r--r--include/linux/nodemask.h2
-rw-r--r--include/linux/notifier.h43
-rw-r--r--include/linux/nsproxy.h52
-rw-r--r--include/linux/pci.h12
-rw-r--r--include/linux/pci_ids.h5
-rw-r--r--include/linux/pci_regs.h21
-rw-r--r--include/linux/pid.h49
-rw-r--r--include/linux/ppdev.h2
-rw-r--r--include/linux/proc_fs.h10
-rw-r--r--include/linux/pspace.h23
-rw-r--r--include/linux/raid/bitmap.h2
-rw-r--r--include/linux/raid/md.h1
-rw-r--r--include/linux/raid/md_k.h11
-rw-r--r--include/linux/raid/md_u.h2
-rw-r--r--include/linux/raid/raid1.h1
-rw-r--r--include/linux/raid/raid10.h1
-rw-r--r--include/linux/raid/raid5.h7
-rw-r--r--include/linux/rcupdate.h7
-rw-r--r--include/linux/reiserfs_fs.h4
-rw-r--r--include/linux/reiserfs_fs_sb.h2
-rw-r--r--include/linux/rtc.h4
-rw-r--r--include/linux/sched.h72
-rw-r--r--include/linux/scx200.h2
-rw-r--r--include/linux/serial_core.h3
-rw-r--r--include/linux/serio.h3
-rw-r--r--include/linux/slab.h28
-rw-r--r--include/linux/sound.h2
-rw-r--r--include/linux/srcu.h53
-rw-r--r--include/linux/stat.h2
-rw-r--r--include/linux/stddef.h6
-rw-r--r--include/linux/string.h1
-rw-r--r--include/linux/sunrpc/auth.h3
-rw-r--r--include/linux/sunrpc/auth_gss.h2
-rw-r--r--include/linux/sunrpc/cache.h11
-rw-r--r--include/linux/sunrpc/gss_api.h2
-rw-r--r--include/linux/sunrpc/msg_prot.h42
-rw-r--r--include/linux/sunrpc/svc.h166
-rw-r--r--include/linux/sunrpc/svcauth.h1
-rw-r--r--include/linux/sunrpc/svcauth_gss.h2
-rw-r--r--include/linux/sunrpc/svcsock.h18
-rw-r--r--include/linux/sunrpc/xprt.h8
-rw-r--r--include/linux/synclink.h4
-rw-r--r--include/linux/syscalls.h2
-rw-r--r--include/linux/sysrq.h4
-rw-r--r--include/linux/taskstats.h64
-rw-r--r--include/linux/tifm.h158
-rw-r--r--include/linux/timex.h58
-rw-r--r--include/linux/topology.h46
-rw-r--r--include/linux/tsacct_kern.h34
-rw-r--r--include/linux/tty_driver.h3
-rw-r--r--include/linux/types.h2
-rw-r--r--include/linux/uinput.h35
-rw-r--r--include/linux/unistd.h6
-rw-r--r--include/linux/unwind.h2
-rw-r--r--include/linux/utime.h2
-rw-r--r--include/linux/utsname.h62
-rw-r--r--include/linux/videodev2.h80
-rw-r--r--include/linux/vt_kern.h7
-rw-r--r--include/linux/wavefront.h675
-rw-r--r--include/linux/writeback.h2
-rw-r--r--include/media/audiochip.h4
-rw-r--r--include/mtd/Kbuild3
-rw-r--r--include/mtd/mtd-abi.h6
-rw-r--r--include/net/genetlink.h18
-rw-r--r--include/net/sock.h1
-rw-r--r--include/sound/pcm.h1
-rw-r--r--include/video/s1d13xxxfb.h2
-rw-r--r--include/video/sstfb.h4
327 files changed, 2684 insertions, 3809 deletions
diff --git a/include/asm-alpha/spinlock.h b/include/asm-alpha/spinlock.h
index 0c294c9b0c..aeeb125f68 100644
--- a/include/asm-alpha/spinlock.h
+++ b/include/asm-alpha/spinlock.h
@@ -166,4 +166,8 @@ static inline void __raw_write_unlock(raw_rwlock_t * lock)
166 lock->lock = 0; 166 lock->lock = 0;
167} 167}
168 168
169#define _raw_spin_relax(lock) cpu_relax()
170#define _raw_read_relax(lock) cpu_relax()
171#define _raw_write_relax(lock) cpu_relax()
172
169#endif /* _ALPHA_SPINLOCK_H */ 173#endif /* _ALPHA_SPINLOCK_H */
diff --git a/include/asm-alpha/unistd.h b/include/asm-alpha/unistd.h
index bc6e6a9259..2cabbd465c 100644
--- a/include/asm-alpha/unistd.h
+++ b/include/asm-alpha/unistd.h
@@ -580,75 +580,6 @@ type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5, type6 arg6)\
580#define __ARCH_WANT_SYS_OLDUMOUNT 580#define __ARCH_WANT_SYS_OLDUMOUNT
581#define __ARCH_WANT_SYS_SIGPENDING 581#define __ARCH_WANT_SYS_SIGPENDING
582 582
583#ifdef __KERNEL_SYSCALLS__
584
585#include <linux/compiler.h>
586#include <linux/types.h>
587#include <linux/string.h>
588#include <linux/signal.h>
589#include <linux/syscalls.h>
590#include <asm/ptrace.h>
591
592static inline long open(const char * name, int mode, int flags)
593{
594 return sys_open(name, mode, flags);
595}
596
597static inline long dup(int fd)
598{
599 return sys_dup(fd);
600}
601
602static inline long close(int fd)
603{
604 return sys_close(fd);
605}
606
607static inline off_t lseek(int fd, off_t off, int whence)
608{
609 return sys_lseek(fd, off, whence);
610}
611
612static inline void _exit(int value)
613{
614 sys_exit(value);
615}
616
617#define exit(x) _exit(x)
618
619static inline long write(int fd, const char * buf, size_t nr)
620{
621 return sys_write(fd, buf, nr);
622}
623
624static inline long read(int fd, char * buf, size_t nr)
625{
626 return sys_read(fd, buf, nr);
627}
628
629extern int execve(char *, char **, char **);
630
631static inline long setsid(void)
632{
633 return sys_setsid();
634}
635
636static inline pid_t waitpid(int pid, int * wait_stat, int flags)
637{
638 return sys_wait4(pid, wait_stat, flags, NULL);
639}
640
641asmlinkage int sys_execve(char *ufilename, char **argv, char **envp,
642 unsigned long a3, unsigned long a4, unsigned long a5,
643 struct pt_regs regs);
644asmlinkage long sys_rt_sigaction(int sig,
645 const struct sigaction __user *act,
646 struct sigaction __user *oact,
647 size_t sigsetsize,
648 void *restorer);
649
650#endif /* __KERNEL_SYSCALLS__ */
651
652/* "Conditional" syscalls. What we want is 583/* "Conditional" syscalls. What we want is
653 584
654 __attribute__((weak,alias("sys_ni_syscall"))) 585 __attribute__((weak,alias("sys_ni_syscall")))
diff --git a/include/asm-arm/arch-clps711x/entry-macro.S b/include/asm-arm/arch-clps711x/entry-macro.S
index 21f6ee4858..de4481dd8b 100644
--- a/include/asm-arm/arch-clps711x/entry-macro.S
+++ b/include/asm-arm/arch-clps711x/entry-macro.S
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm-arm/arch-CLPS711x/entry-macro.S 2 * include/asm-arm/arch-clps711x/entry-macro.S
3 * 3 *
4 * Low-level IRQ helper macros for CLPS711X-based platforms 4 * Low-level IRQ helper macros for CLPS711X-based platforms
5 * 5 *
diff --git a/include/asm-arm/arch-ebsa285/entry-macro.S b/include/asm-arm/arch-ebsa285/entry-macro.S
index cf10ac96fd..ce812d4f4a 100644
--- a/include/asm-arm/arch-ebsa285/entry-macro.S
+++ b/include/asm-arm/arch-ebsa285/entry-macro.S
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm-arm/arch-footbridge/entry-macro.S 2 * include/asm-arm/arch-ebsa285/entry-macro.S
3 * 3 *
4 * Low-level IRQ helper macros for footbridge-based platforms 4 * Low-level IRQ helper macros for footbridge-based platforms
5 * 5 *
diff --git a/include/asm-arm/arch-h720x/system.h b/include/asm-arm/arch-h720x/system.h
index 09eda84592..8dc1460b23 100644
--- a/include/asm-arm/arch-h720x/system.h
+++ b/include/asm-arm/arch-h720x/system.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/arch/arm/mach-h720x/system.h 2 * linux/include/asm-arm/arch-h720x/system.h
3 * 3 *
4 * Copyright (C) 2001-2002 Jungjun Kim, Hynix Semiconductor Inc. 4 * Copyright (C) 2001-2002 Jungjun Kim, Hynix Semiconductor Inc.
5 * 5 *
diff --git a/include/asm-arm/arch-ixp4xx/system.h b/include/asm-arm/arch-ixp4xx/system.h
index 73589aad8d..8e1db423b1 100644
--- a/include/asm-arm/arch-ixp4xx/system.h
+++ b/include/asm-arm/arch-ixp4xx/system.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm-arm/arch-ixp4x//system.h 2 * include/asm-arm/arch-ixp4xx/system.h
3 * 3 *
4 * Copyright (C) 2002 Intel Corporation. 4 * Copyright (C) 2002 Intel Corporation.
5 * 5 *
diff --git a/include/asm-arm/arch-omap/dmtimer.h b/include/asm-arm/arch-omap/dmtimer.h
index b5f3a71b89..fefb276ed4 100644
--- a/include/asm-arm/arch-omap/dmtimer.h
+++ b/include/asm-arm/arch-omap/dmtimer.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/include/asm-arm/arm/arch-omap/dmtimer.h 2 * linux/include/asm-arm/arch-omap/dmtimer.h
3 * 3 *
4 * OMAP Dual-Mode Timers 4 * OMAP Dual-Mode Timers
5 * 5 *
diff --git a/include/asm-arm/arch-omap/mcbsp.h b/include/asm-arm/arch-omap/mcbsp.h
index ed0dde4f72..c7a0cc1c4e 100644
--- a/include/asm-arm/arch-omap/mcbsp.h
+++ b/include/asm-arm/arch-omap/mcbsp.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/include/asm-arm/arch-omap/gpio.h 2 * linux/include/asm-arm/arch-omap/mcbsp.h
3 * 3 *
4 * Defines for Multi-Channel Buffered Serial Port 4 * Defines for Multi-Channel Buffered Serial Port
5 * 5 *
diff --git a/include/asm-arm/arch-omap/pm.h b/include/asm-arm/arch-omap/pm.h
index e46623c61a..1458805998 100644
--- a/include/asm-arm/arch-omap/pm.h
+++ b/include/asm-arm/arch-omap/pm.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/include/asm/arch-omap/pm.h 2 * linux/include/asm-arm/arch-omap/pm.h
3 * 3 *
4 * Header file for OMAP Power Management Routines 4 * Header file for OMAP Power Management Routines
5 * 5 *
diff --git a/include/asm-arm/arch-pnx4008/clock.h b/include/asm-arm/arch-pnx4008/clock.h
index 91ae0030fd..ce155e1612 100644
--- a/include/asm-arm/arch-pnx4008/clock.h
+++ b/include/asm-arm/arch-pnx4008/clock.h
@@ -32,6 +32,7 @@ struct clk;
32#define KEYCLKCTRL_REG (PWRMAN_VA_BASE + 0xb0) 32#define KEYCLKCTRL_REG (PWRMAN_VA_BASE + 0xb0)
33#define TSCLKCTRL_REG (PWRMAN_VA_BASE + 0xb4) 33#define TSCLKCTRL_REG (PWRMAN_VA_BASE + 0xb4)
34#define PWMCLKCTRL_REG (PWRMAN_VA_BASE + 0xb8) 34#define PWMCLKCTRL_REG (PWRMAN_VA_BASE + 0xb8)
35#define TIMCLKCTRL_REG (PWRMAN_VA_BASE + 0xbc)
35#define SPICTRL_REG (PWRMAN_VA_BASE + 0xc4) 36#define SPICTRL_REG (PWRMAN_VA_BASE + 0xc4)
36#define FLASHCLKCTRL_REG (PWRMAN_VA_BASE + 0xc8) 37#define FLASHCLKCTRL_REG (PWRMAN_VA_BASE + 0xc8)
37#define UART3CLK_REG (PWRMAN_VA_BASE + 0xd0) 38#define UART3CLK_REG (PWRMAN_VA_BASE + 0xd0)
diff --git a/include/asm-arm/arch-pnx4008/platform.h b/include/asm-arm/arch-pnx4008/platform.h
index 485a3651b4..2613c7c669 100644
--- a/include/asm-arm/arch-pnx4008/platform.h
+++ b/include/asm-arm/arch-pnx4008/platform.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm-arm/arch-pnx4008/platfrom.h 2 * include/asm-arm/arch-pnx4008/platform.h
3 * 3 *
4 * PNX4008 Base addresses - header file 4 * PNX4008 Base addresses - header file
5 * 5 *
diff --git a/include/asm-arm/arch-pxa/pxafb.h b/include/asm-arm/arch-pxa/pxafb.h
index aba9b30f42..81c3928d60 100644
--- a/include/asm-arm/arch-pxa/pxafb.h
+++ b/include/asm-arm/arch-pxa/pxafb.h
@@ -12,12 +12,14 @@
12 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
13 */ 13 */
14 14
15#include <linux/fb.h>
16
15/* 17/*
16 * This structure describes the machine which we are running on. 18 * This structure describes the machine which we are running on.
17 * It is set in linux/arch/arm/mach-pxa/machine_name.c and used in the probe routine 19 * It is set in linux/arch/arm/mach-pxa/machine_name.c and used in the probe routine
18 * of linux/drivers/video/pxafb.c 20 * of linux/drivers/video/pxafb.c
19 */ 21 */
20struct pxafb_mach_info { 22struct pxafb_mode_info {
21 u_long pixclock; 23 u_long pixclock;
22 24
23 u_short xres; 25 u_short xres;
@@ -34,6 +36,14 @@ struct pxafb_mach_info {
34 u_char sync; 36 u_char sync;
35 37
36 u_int cmap_greyscale:1, 38 u_int cmap_greyscale:1,
39 unused:31;
40};
41
42struct pxafb_mach_info {
43 struct pxafb_mode_info *modes;
44 unsigned int num_modes;
45
46 u_int fixed_modes:1,
37 cmap_inverse:1, 47 cmap_inverse:1,
38 cmap_static:1, 48 cmap_static:1,
39 unused:29; 49 unused:29;
@@ -62,7 +72,7 @@ struct pxafb_mach_info {
62 u_int lccr3; 72 u_int lccr3;
63 73
64 void (*pxafb_backlight_power)(int); 74 void (*pxafb_backlight_power)(int);
65 void (*pxafb_lcd_power)(int); 75 void (*pxafb_lcd_power)(int, struct fb_var_screeninfo *);
66 76
67}; 77};
68void set_pxa_fb_info(struct pxafb_mach_info *hard_pxa_fb_info); 78void set_pxa_fb_info(struct pxafb_mach_info *hard_pxa_fb_info);
diff --git a/include/asm-arm/arch-pxa/spitz.h b/include/asm-arm/arch-pxa/spitz.h
index 62e1fe4d02..4953dd324d 100644
--- a/include/asm-arm/arch-pxa/spitz.h
+++ b/include/asm-arm/arch-pxa/spitz.h
@@ -15,6 +15,8 @@
15#define __ASM_ARCH_SPITZ_H 1 15#define __ASM_ARCH_SPITZ_H 1
16#endif 16#endif
17 17
18#include <linux/fb.h>
19
18/* Spitz/Akita GPIOs */ 20/* Spitz/Akita GPIOs */
19 21
20#define SPITZ_GPIO_KEY_INT (0) /* Key Interrupt */ 22#define SPITZ_GPIO_KEY_INT (0) /* Key Interrupt */
@@ -155,4 +157,4 @@ extern struct platform_device spitzscoop2_device;
155extern struct platform_device spitzssp_device; 157extern struct platform_device spitzssp_device;
156extern struct sharpsl_charger_machinfo spitz_pm_machinfo; 158extern struct sharpsl_charger_machinfo spitz_pm_machinfo;
157 159
158extern void spitz_lcd_power(int on); 160extern void spitz_lcd_power(int on, struct fb_var_screeninfo *var);
diff --git a/include/asm-arm/arch-s3c2410/fb.h b/include/asm-arm/arch-s3c2410/fb.h
index 71161797bc..90894214ca 100644
--- a/include/asm-arm/arch-s3c2410/fb.h
+++ b/include/asm-arm/arch-s3c2410/fb.h
@@ -1,4 +1,4 @@
1/* linux/include/asm/arch-s3c2410/fb.h 1/* linux/include/asm-arm/arch-s3c2410/fb.h
2 * 2 *
3 * Copyright (c) 2004 Arnaud Patard <arnaud.patard@rtp-net.org> 3 * Copyright (c) 2004 Arnaud Patard <arnaud.patard@rtp-net.org>
4 * 4 *
diff --git a/include/asm-arm/arch-s3c2410/regs-adc.h b/include/asm-arm/arch-s3c2410/regs-adc.h
index c7b90b3ecc..3196a2849e 100644
--- a/include/asm-arm/arch-s3c2410/regs-adc.h
+++ b/include/asm-arm/arch-s3c2410/regs-adc.h
@@ -1,4 +1,4 @@
1/* linux/include/asm/arch-s3c2410/regs-adc.h 1/* linux/include/asm-arm/arch-s3c2410/regs-adc.h
2 * 2 *
3 * Copyright (c) 2004 Shannon Holland <holland@loser.net> 3 * Copyright (c) 2004 Shannon Holland <holland@loser.net>
4 * 4 *
diff --git a/include/asm-arm/arch-s3c2410/regs-clock.h b/include/asm-arm/arch-s3c2410/regs-clock.h
index b2f4690c07..e39656b7a0 100644
--- a/include/asm-arm/arch-s3c2410/regs-clock.h
+++ b/include/asm-arm/arch-s3c2410/regs-clock.h
@@ -1,4 +1,4 @@
1/* linux/include/asm/arch-s3c2410/regs-clock.h 1/* linux/include/asm-arm/arch-s3c2410/regs-clock.h
2 * 2 *
3 * Copyright (c) 2003,2004,2005,2006 Simtec Electronics <linux@simtec.co.uk> 3 * Copyright (c) 2003,2004,2005,2006 Simtec Electronics <linux@simtec.co.uk>
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
diff --git a/include/asm-arm/arch-s3c2410/regs-dsc.h b/include/asm-arm/arch-s3c2410/regs-dsc.h
index a0a1248751..c0748511ed 100644
--- a/include/asm-arm/arch-s3c2410/regs-dsc.h
+++ b/include/asm-arm/arch-s3c2410/regs-dsc.h
@@ -1,4 +1,4 @@
1/* linux/include/asm/hardware/s3c2410/regs-dsc.h 1/* linux/include/asm-arm/arch-s3c2410/regs-dsc.h
2 * 2 *
3 * Copyright (c) 2004 Simtec Electronics <linux@simtec.co.uk> 3 * Copyright (c) 2004 Simtec Electronics <linux@simtec.co.uk>
4 * http://www.simtec.co.uk/products/SWLINUX/ 4 * http://www.simtec.co.uk/products/SWLINUX/
diff --git a/include/asm-arm/arch-s3c2410/regs-gpio.h b/include/asm-arm/arch-s3c2410/regs-gpio.h
index 93c49432db..b2893e32a2 100644
--- a/include/asm-arm/arch-s3c2410/regs-gpio.h
+++ b/include/asm-arm/arch-s3c2410/regs-gpio.h
@@ -1,4 +1,4 @@
1/* linux/include/asm/hardware/s3c2410/regs-gpio.h 1/* linux/include/asm-arm/arch-s3c2410/regs-gpio.h
2 * 2 *
3 * Copyright (c) 2003,2004 Simtec Electronics <linux@simtec.co.uk> 3 * Copyright (c) 2003,2004 Simtec Electronics <linux@simtec.co.uk>
4 * http://www.simtec.co.uk/products/SWLINUX/ 4 * http://www.simtec.co.uk/products/SWLINUX/
diff --git a/include/asm-arm/arch-s3c2410/regs-gpioj.h b/include/asm-arm/arch-s3c2410/regs-gpioj.h
index 91cefa2604..02131a5a1d 100644
--- a/include/asm-arm/arch-s3c2410/regs-gpioj.h
+++ b/include/asm-arm/arch-s3c2410/regs-gpioj.h
@@ -1,4 +1,4 @@
1/* linux/include/asm/hardware/s3c2410/regs-gpioj.h 1/* linux/include/asm-arm/arch-s3c2410/regs-gpioj.h
2 * 2 *
3 * Copyright (c) 2004 Simtec Electronics <linux@simtec.co.uk> 3 * Copyright (c) 2004 Simtec Electronics <linux@simtec.co.uk>
4 * http://www.simtec.co.uk/products/SWLINUX/ 4 * http://www.simtec.co.uk/products/SWLINUX/
diff --git a/include/asm-arm/arch-s3c2410/regs-iis.h b/include/asm-arm/arch-s3c2410/regs-iis.h
index 72cd250982..eaf77916a6 100644
--- a/include/asm-arm/arch-s3c2410/regs-iis.h
+++ b/include/asm-arm/arch-s3c2410/regs-iis.h
@@ -1,4 +1,4 @@
1/* linux/include/asm/arch-s3c2410/regs-iis.h 1/* linux/include/asm-arm/arch-s3c2410/regs-iis.h
2 * 2 *
3 * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk> 3 * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk>
4 * http://www.simtec.co.uk/products/SWLINUX/ 4 * http://www.simtec.co.uk/products/SWLINUX/
diff --git a/include/asm-arm/arch-s3c2410/regs-irq.h b/include/asm-arm/arch-s3c2410/regs-irq.h
index 29fb8ef670..498184cb8a 100644
--- a/include/asm-arm/arch-s3c2410/regs-irq.h
+++ b/include/asm-arm/arch-s3c2410/regs-irq.h
@@ -1,4 +1,4 @@
1/* linux/include/asm/arch-s3c2410/regs-irq.h 1/* linux/include/asm-arm/arch-s3c2410/regs-irq.h
2 * 2 *
3 * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk> 3 * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk>
4 * http://www.simtec.co.uk/products/SWLINUX/ 4 * http://www.simtec.co.uk/products/SWLINUX/
diff --git a/include/asm-arm/arch-s3c2410/regs-lcd.h b/include/asm-arm/arch-s3c2410/regs-lcd.h
index 6d7881c8cf..b7faeb04c0 100644
--- a/include/asm-arm/arch-s3c2410/regs-lcd.h
+++ b/include/asm-arm/arch-s3c2410/regs-lcd.h
@@ -1,4 +1,4 @@
1/* linux/include/asm/arch-s3c2410/regs-lcd.h 1/* linux/include/asm-arm/arch-s3c2410/regs-lcd.h
2 * 2 *
3 * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk> 3 * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk>
4 * http://www.simtec.co.uk/products/SWLINUX/ 4 * http://www.simtec.co.uk/products/SWLINUX/
diff --git a/include/asm-arm/arch-s3c2410/regs-rtc.h b/include/asm-arm/arch-s3c2410/regs-rtc.h
index cd88fd634d..93b03c4971 100644
--- a/include/asm-arm/arch-s3c2410/regs-rtc.h
+++ b/include/asm-arm/arch-s3c2410/regs-rtc.h
@@ -1,4 +1,4 @@
1/* linux/include/asm/arch-s3c2410/regs-rtc.h 1/* linux/include/asm-arm/arch-s3c2410/regs-rtc.h
2 * 2 *
3 * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk> 3 * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk>
4 * http://www.simtec.co.uk/products/SWLINUX/ 4 * http://www.simtec.co.uk/products/SWLINUX/
diff --git a/include/asm-arm/arch-s3c2410/regs-sdi.h b/include/asm-arm/arch-s3c2410/regs-sdi.h
index 06e716e5b4..bb9d30b729 100644
--- a/include/asm-arm/arch-s3c2410/regs-sdi.h
+++ b/include/asm-arm/arch-s3c2410/regs-sdi.h
@@ -1,4 +1,4 @@
1/* linux/include/asm/arch-s3c2410/regs-sdi.h 1/* linux/include/asm-arm/arch-s3c2410/regs-sdi.h
2 * 2 *
3 * Copyright (c) 2004 Simtec Electronics <linux@simtec.co.uk> 3 * Copyright (c) 2004 Simtec Electronics <linux@simtec.co.uk>
4 * http://www.simtec.co.uk/products/SWLINUX/ 4 * http://www.simtec.co.uk/products/SWLINUX/
diff --git a/include/asm-arm/arch-s3c2410/regs-timer.h b/include/asm-arm/arch-s3c2410/regs-timer.h
index 731918e778..6f8fe432fe 100644
--- a/include/asm-arm/arch-s3c2410/regs-timer.h
+++ b/include/asm-arm/arch-s3c2410/regs-timer.h
@@ -1,4 +1,4 @@
1/* linux/include/asm/arch-s3c2410/regs-timer.h 1/* linux/include/asm-arm/arch-s3c2410/regs-timer.h
2 * 2 *
3 * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk> 3 * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk>
4 * http://www.simtec.co.uk/products/SWLINUX/ 4 * http://www.simtec.co.uk/products/SWLINUX/
diff --git a/include/asm-arm/arch-s3c2410/regs-udc.h b/include/asm-arm/arch-s3c2410/regs-udc.h
index 3aa31a27da..487861d5b4 100644
--- a/include/asm-arm/arch-s3c2410/regs-udc.h
+++ b/include/asm-arm/arch-s3c2410/regs-udc.h
@@ -1,4 +1,4 @@
1/* linux/include/asm/arch-s3c2410/regs-udc.h 1/* linux/include/asm-arm/arch-s3c2410/regs-udc.h
2 * 2 *
3 * Copyright (C) 2004 Herbert Poetzl <herbert@13thfloor.at> 3 * Copyright (C) 2004 Herbert Poetzl <herbert@13thfloor.at>
4 * 4 *
diff --git a/include/asm-arm/arch-s3c2410/spi-gpio.h b/include/asm-arm/arch-s3c2410/spi-gpio.h
index 258c00bca2..c1e4db7c97 100644
--- a/include/asm-arm/arch-s3c2410/spi-gpio.h
+++ b/include/asm-arm/arch-s3c2410/spi-gpio.h
@@ -1,4 +1,4 @@
1/* linux/include/asm-arm/arch-s3c2410/spi.h 1/* linux/include/asm-arm/arch-s3c2410/spi-gpio.h
2 * 2 *
3 * Copyright (c) 2006 Simtec Electronics 3 * Copyright (c) 2006 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
diff --git a/include/asm-arm/arch-sa1100/neponset.h b/include/asm-arm/arch-sa1100/neponset.h
index 8051fd73a8..09ec9e2bd1 100644
--- a/include/asm-arm/arch-sa1100/neponset.h
+++ b/include/asm-arm/arch-sa1100/neponset.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/include/asm-arm/arch-sa1100/assabet.h 2 * linux/include/asm-arm/arch-sa1100/neponset.h
3 * 3 *
4 * Created 2000/06/05 by Nicolas Pitre <nico@cam.org> 4 * Created 2000/06/05 by Nicolas Pitre <nico@cam.org>
5 * 5 *
diff --git a/include/asm-arm/arch-sa1100/uncompress.h b/include/asm-arm/arch-sa1100/uncompress.h
index 2601a77a6d..17e64d232e 100644
--- a/include/asm-arm/arch-sa1100/uncompress.h
+++ b/include/asm-arm/arch-sa1100/uncompress.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/include/asm-arm/arch-brutus/uncompress.h 2 * linux/include/asm-arm/arch-sa1100/uncompress.h
3 * 3 *
4 * (C) 1999 Nicolas Pitre <nico@cam.org> 4 * (C) 1999 Nicolas Pitre <nico@cam.org>
5 * 5 *
diff --git a/include/asm-arm/arch-shark/vmalloc.h b/include/asm-arm/arch-shark/vmalloc.h
index 10db5d1882..fac37c636b 100644
--- a/include/asm-arm/arch-shark/vmalloc.h
+++ b/include/asm-arm/arch-shark/vmalloc.h
@@ -1,4 +1,4 @@
1/* 1/*
2 * linux/include/asm-arm/arch-rpc/vmalloc.h 2 * linux/include/asm-arm/arch-shark/vmalloc.h
3 */ 3 */
4#define VMALLOC_END (PAGE_OFFSET + 0x10000000) 4#define VMALLOC_END (PAGE_OFFSET + 0x10000000)
diff --git a/include/asm-arm/hardware/debug-8250.S b/include/asm-arm/hardware/debug-8250.S
index 4594fea91e..07c97fb233 100644
--- a/include/asm-arm/hardware/debug-8250.S
+++ b/include/asm-arm/hardware/debug-8250.S
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/include/asm-arm/hardware/debug-8250.h 2 * linux/include/asm-arm/hardware/debug-8250.S
3 * 3 *
4 * Copyright (C) 1994-1999 Russell King 4 * Copyright (C) 1994-1999 Russell King
5 * 5 *
diff --git a/include/asm-arm/hardware/debug-pl01x.S b/include/asm-arm/hardware/debug-pl01x.S
index db0d0f7de5..23c541a9e8 100644
--- a/include/asm-arm/hardware/debug-pl01x.S
+++ b/include/asm-arm/hardware/debug-pl01x.S
@@ -1,4 +1,4 @@
1/* linux/include/asm-arm/arch-integrator/debug-macro.S 1/* linux/include/asm-arm/hardware/debug-pl01x.S
2 * 2 *
3 * Debugging macro include header 3 * Debugging macro include header
4 * 4 *
diff --git a/include/asm-arm/hardware/entry-macro-iomd.S b/include/asm-arm/hardware/entry-macro-iomd.S
index 30c7b92c24..fbed08f298 100644
--- a/include/asm-arm/hardware/entry-macro-iomd.S
+++ b/include/asm-arm/hardware/entry-macro-iomd.S
@@ -1,5 +1,5 @@
1/* 1/*
2 * arch/arm/commond/entry-macro-iomd.S 2 * include/asm-arm/hardware/entry-macro-iomd.S
3 * 3 *
4 * Low-level IRQ helper macros for IOC/IOMD based platforms 4 * Low-level IRQ helper macros for IOC/IOMD based platforms
5 * 5 *
diff --git a/include/asm-arm/hardware/sa1111.h b/include/asm-arm/hardware/sa1111.h
index 319aea064c..6aa0a5b75b 100644
--- a/include/asm-arm/hardware/sa1111.h
+++ b/include/asm-arm/hardware/sa1111.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/include/asm-arm/hardware/SA-1111.h 2 * linux/include/asm-arm/hardware/sa1111.h
3 * 3 *
4 * Copyright (C) 2000 John G Dorsey <john+@cs.cmu.edu> 4 * Copyright (C) 2000 John G Dorsey <john+@cs.cmu.edu>
5 * 5 *
diff --git a/include/asm-arm/spinlock.h b/include/asm-arm/spinlock.h
index 01b7c26a30..861092fbaa 100644
--- a/include/asm-arm/spinlock.h
+++ b/include/asm-arm/spinlock.h
@@ -218,4 +218,8 @@ static inline int __raw_read_trylock(raw_rwlock_t *rw)
218/* read_can_lock - would read_trylock() succeed? */ 218/* read_can_lock - would read_trylock() succeed? */
219#define __raw_read_can_lock(x) ((x)->lock < 0x80000000) 219#define __raw_read_can_lock(x) ((x)->lock < 0x80000000)
220 220
221#define _raw_spin_relax(lock) cpu_relax()
222#define _raw_read_relax(lock) cpu_relax()
223#define _raw_write_relax(lock) cpu_relax()
224
221#endif /* __ASM_SPINLOCK_H */ 225#endif /* __ASM_SPINLOCK_H */
diff --git a/include/asm-arm/timeofday.h b/include/asm-arm/timeofday.h
deleted file mode 100644
index 27254bd5b9..0000000000
--- a/include/asm-arm/timeofday.h
+++ /dev/null
@@ -1,4 +0,0 @@
1#ifndef _ASM_ARM_TIMEOFDAY_H
2#define _ASM_ARM_TIMEOFDAY_H
3#include <asm-generic/timeofday.h>
4#endif
diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h
index 2ab4078334..14a87eec5a 100644
--- a/include/asm-arm/unistd.h
+++ b/include/asm-arm/unistd.h
@@ -549,30 +549,6 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6
549#define __ARCH_WANT_SYS_SOCKETCALL 549#define __ARCH_WANT_SYS_SOCKETCALL
550#endif 550#endif
551 551
552#ifdef __KERNEL_SYSCALLS__
553
554#include <linux/compiler.h>
555#include <linux/types.h>
556#include <linux/syscalls.h>
557
558extern long execve(const char *file, char **argv, char **envp);
559
560struct pt_regs;
561asmlinkage int sys_execve(char *filenamei, char **argv, char **envp,
562 struct pt_regs *regs);
563asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp,
564 struct pt_regs *regs);
565asmlinkage int sys_fork(struct pt_regs *regs);
566asmlinkage int sys_vfork(struct pt_regs *regs);
567asmlinkage int sys_pipe(unsigned long *fildes);
568struct sigaction;
569asmlinkage long sys_rt_sigaction(int sig,
570 const struct sigaction __user *act,
571 struct sigaction __user *oact,
572 size_t sigsetsize);
573
574#endif /* __KERNEL_SYSCALLS__ */
575
576/* 552/*
577 * "Conditional" syscalls 553 * "Conditional" syscalls
578 * 554 *
diff --git a/include/asm-arm26/assembler.h b/include/asm-arm26/assembler.h
index 83f9aec55e..bb507a9a4a 100644
--- a/include/asm-arm26/assembler.h
+++ b/include/asm-arm26/assembler.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/asm/assembler.h 2 * linux/include/asm-arm26/assembler.h
3 * 3 *
4 * This file contains arm architecture specific defines 4 * This file contains arm architecture specific defines
5 * for the different processors. 5 * for the different processors.
diff --git a/include/asm-arm26/namei.h b/include/asm-arm26/namei.h
index a402d3b9d0..3f5d340110 100644
--- a/include/asm-arm26/namei.h
+++ b/include/asm-arm26/namei.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/include/asm-arm/namei.h 2 * linux/include/asm-arm26/namei.h
3 * 3 *
4 * Routines to handle famous /usr/gnemul 4 * Routines to handle famous /usr/gnemul
5 * Derived from the Sparc version of this file 5 * Derived from the Sparc version of this file
diff --git a/include/asm-arm26/semaphore.h b/include/asm-arm26/semaphore.h
index ccf15e7041..1fda54375e 100644
--- a/include/asm-arm26/semaphore.h
+++ b/include/asm-arm26/semaphore.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/include/asm-arm/semaphore.h 2 * linux/include/asm-arm26/semaphore.h
3 */ 3 */
4#ifndef __ASM_ARM_SEMAPHORE_H 4#ifndef __ASM_ARM_SEMAPHORE_H
5#define __ASM_ARM_SEMAPHORE_H 5#define __ASM_ARM_SEMAPHORE_H
diff --git a/include/asm-arm26/unistd.h b/include/asm-arm26/unistd.h
index c6d2436c9d..25a5eead85 100644
--- a/include/asm-arm26/unistd.h
+++ b/include/asm-arm26/unistd.h
@@ -464,30 +464,6 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6
464#define __ARCH_WANT_SYS_SIGPROCMASK 464#define __ARCH_WANT_SYS_SIGPROCMASK
465#define __ARCH_WANT_SYS_RT_SIGACTION 465#define __ARCH_WANT_SYS_RT_SIGACTION
466 466
467#ifdef __KERNEL_SYSCALLS__
468
469#include <linux/compiler.h>
470#include <linux/types.h>
471#include <linux/syscalls.h>
472
473extern long execve(const char *file, char **argv, char **envp);
474
475struct pt_regs;
476asmlinkage int sys_execve(char *filenamei, char **argv, char **envp,
477 struct pt_regs *regs);
478asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp,
479 struct pt_regs *regs);
480asmlinkage int sys_fork(struct pt_regs *regs);
481asmlinkage int sys_vfork(struct pt_regs *regs);
482asmlinkage int sys_pipe(unsigned long *fildes);
483struct sigaction;
484asmlinkage long sys_rt_sigaction(int sig,
485 const struct sigaction __user *act,
486 struct sigaction __user *oact,
487 size_t sigsetsize);
488
489#endif /* __KERNEL_SYSCALLS__ */
490
491/* 467/*
492 * "Conditional" syscalls 468 * "Conditional" syscalls
493 * 469 *
diff --git a/include/asm-avr32/unistd.h b/include/asm-avr32/unistd.h
index 1f528f9269..a50e500455 100644
--- a/include/asm-avr32/unistd.h
+++ b/include/asm-avr32/unistd.h
@@ -281,30 +281,10 @@
281#define __NR_tee 263 281#define __NR_tee 263
282#define __NR_vmsplice 264 282#define __NR_vmsplice 264
283 283
284#ifdef __KERNEL__
284#define NR_syscalls 265 285#define NR_syscalls 265
285 286
286 287
287/*
288 * AVR32 calling convention for system calls:
289 * - System call number in r8
290 * - Parameters in r12 and downwards to r9 as well as r6 and r5.
291 * - Return value in r12
292 */
293
294/*
295 * user-visible error numbers are in the range -1 - -124: see
296 * <asm-generic/errno.h>
297 */
298
299#define __syscall_return(type, res) do { \
300 if ((unsigned long)(res) >= (unsigned long)(-125)) { \
301 errno = -(res); \
302 res = -1; \
303 } \
304 return (type) (res); \
305 } while (0)
306
307#ifdef __KERNEL__
308#define __ARCH_WANT_IPC_PARSE_VERSION 288#define __ARCH_WANT_IPC_PARSE_VERSION
309#define __ARCH_WANT_STAT64 289#define __ARCH_WANT_STAT64
310#define __ARCH_WANT_SYS_ALARM 290#define __ARCH_WANT_SYS_ALARM
@@ -319,62 +299,6 @@
319#define __ARCH_WANT_SYS_GETPGRP 299#define __ARCH_WANT_SYS_GETPGRP
320#define __ARCH_WANT_SYS_RT_SIGACTION 300#define __ARCH_WANT_SYS_RT_SIGACTION
321#define __ARCH_WANT_SYS_RT_SIGSUSPEND 301#define __ARCH_WANT_SYS_RT_SIGSUSPEND
322#endif
323
324#if defined(__KERNEL_SYSCALLS__) || defined(__CHECKER__)
325
326#include <linux/types.h>
327#include <linux/linkage.h>
328#include <asm/signal.h>
329
330struct pt_regs;
331
332/*
333 * we need this inline - forking from kernel space will result
334 * in NO COPY ON WRITE (!!!), until an execve is executed. This
335 * is no problem, but for the stack. This is handled by not letting
336 * main() use the stack at all after fork(). Thus, no function
337 * calls - which means inline code for fork too, as otherwise we
338 * would use the stack upon exit from 'fork()'.
339 *
340 * Actually only pause and fork are needed inline, so that there
341 * won't be any messing with the stack from main(), but we define
342 * some others too.
343 */
344static inline int execve(const char *file, char **argv, char **envp)
345{
346 register long scno asm("r8") = __NR_execve;
347 register long sc1 asm("r12") = (long)file;
348 register long sc2 asm("r11") = (long)argv;
349 register long sc3 asm("r10") = (long)envp;
350 int res;
351
352 asm volatile("scall"
353 : "=r"(sc1)
354 : "r"(scno), "0"(sc1), "r"(sc2), "r"(sc3)
355 : "lr", "memory");
356 res = sc1;
357 __syscall_return(int, res);
358}
359
360asmlinkage long sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize);
361asmlinkage int sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
362 struct pt_regs *regs);
363asmlinkage int sys_rt_sigreturn(struct pt_regs *regs);
364asmlinkage int sys_pipe(unsigned long __user *filedes);
365asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
366 unsigned long prot, unsigned long flags,
367 unsigned long fd, off_t offset);
368asmlinkage int sys_cacheflush(int operation, void __user *addr, size_t len);
369asmlinkage int sys_fork(struct pt_regs *regs);
370asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp,
371 unsigned long parent_tidptr,
372 unsigned long child_tidptr, struct pt_regs *regs);
373asmlinkage int sys_vfork(struct pt_regs *regs);
374asmlinkage int sys_execve(char __user *ufilename, char __user *__user *uargv,
375 char __user *__user *uenvp, struct pt_regs *regs);
376
377#endif
378 302
379/* 303/*
380 * "Conditional" syscalls 304 * "Conditional" syscalls
@@ -384,4 +308,6 @@ asmlinkage int sys_execve(char __user *ufilename, char __user *__user *uargv,
384 */ 308 */
385#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall"); 309#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall");
386 310
311#endif /* __KERNEL__ */
312
387#endif /* __ASM_AVR32_UNISTD_H */ 313#endif /* __ASM_AVR32_UNISTD_H */
diff --git a/include/asm-cris/arch-v32/spinlock.h b/include/asm-cris/arch-v32/spinlock.h
index 52df72a622..5f43df0a5f 100644
--- a/include/asm-cris/arch-v32/spinlock.h
+++ b/include/asm-cris/arch-v32/spinlock.h
@@ -160,4 +160,8 @@ static __inline__ int is_write_locked(rwlock_t *rw)
160 return rw->counter < 0; 160 return rw->counter < 0;
161} 161}
162 162
163#define _raw_spin_relax(lock) cpu_relax()
164#define _raw_read_relax(lock) cpu_relax()
165#define _raw_write_relax(lock) cpu_relax()
166
163#endif /* __ASM_ARCH_SPINLOCK_H */ 167#endif /* __ASM_ARCH_SPINLOCK_H */
diff --git a/include/asm-cris/unistd.h b/include/asm-cris/unistd.h
index 7372efae05..7c90fa970c 100644
--- a/include/asm-cris/unistd.h
+++ b/include/asm-cris/unistd.h
@@ -322,67 +322,6 @@
322#define __ARCH_WANT_SYS_SIGPROCMASK 322#define __ARCH_WANT_SYS_SIGPROCMASK
323#define __ARCH_WANT_SYS_RT_SIGACTION 323#define __ARCH_WANT_SYS_RT_SIGACTION
324 324
325#ifdef __KERNEL_SYSCALLS__
326
327#include <linux/compiler.h>
328#include <linux/types.h>
329#include <linux/linkage.h>
330
331/*
332 * we need this inline - forking from kernel space will result
333 * in NO COPY ON WRITE (!!!), until an execve is executed. This
334 * is no problem, but for the stack. This is handled by not letting
335 * main() use the stack at all after fork(). Thus, no function
336 * calls - which means inline code for fork too, as otherwise we
337 * would use the stack upon exit from 'fork()'.
338 *
339 * Actually only pause and fork are needed inline, so that there
340 * won't be any messing with the stack from main(), but we define
341 * some others too.
342 */
343#define __NR__exit __NR_exit
344static inline _syscall0(pid_t,setsid)
345static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count)
346static inline _syscall3(int,read,int,fd,char *,buf,off_t,count)
347static inline _syscall3(off_t,lseek,int,fd,off_t,offset,int,count)
348static inline _syscall1(int,dup,int,fd)
349static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp)
350static inline _syscall3(int,open,const char *,file,int,flag,int,mode)
351static inline _syscall1(int,close,int,fd)
352
353struct pt_regs;
354asmlinkage long sys_mmap2(
355 unsigned long addr, unsigned long len,
356 unsigned long prot, unsigned long flags,
357 unsigned long fd, unsigned long pgoff);
358asmlinkage int sys_execve(const char *fname, char **argv, char **envp,
359 long r13, long mof, long srp, struct pt_regs *regs);
360asmlinkage int sys_clone(unsigned long newusp, unsigned long flags,
361 int* parent_tid, int* child_tid, long mof, long srp,
362 struct pt_regs *regs);
363asmlinkage int sys_fork(long r10, long r11, long r12, long r13,
364 long mof, long srp, struct pt_regs *regs);
365asmlinkage int sys_vfork(long r10, long r11, long r12, long r13,
366 long mof, long srp, struct pt_regs *regs);
367asmlinkage int sys_pipe(unsigned long __user *fildes);
368struct sigaction;
369asmlinkage long sys_rt_sigaction(int sig,
370 const struct sigaction __user *act,
371 struct sigaction __user *oact,
372 size_t sigsetsize);
373
374/*
375 * Since we define it "external", it collides with the built-in
376 * definition, which has the "noreturn" attribute and will cause
377 * complaints. We don't want to use -fno-builtin, so just use a
378 * different name when in the kernel.
379 */
380#define _exit kernel_syscall_exit
381static inline _syscall1(int,_exit,int,exitcode)
382static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options)
383#endif /* __KERNEL_SYSCALLS__ */
384
385
386/* 325/*
387 * "Conditional" syscalls 326 * "Conditional" syscalls
388 * 327 *
diff --git a/include/asm-frv/namei.h b/include/asm-frv/namei.h
index 84ddd6445f..4ea57171d9 100644
--- a/include/asm-frv/namei.h
+++ b/include/asm-frv/namei.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * asm/namei.h 2 * include/asm-frv/namei.h
3 * 3 *
4 * Included from linux/fs/namei.c 4 * Included from linux/fs/namei.c
5 */ 5 */
diff --git a/include/asm-frv/pgtable.h b/include/asm-frv/pgtable.h
index 2fb3c6f05e..ba1b37df69 100644
--- a/include/asm-frv/pgtable.h
+++ b/include/asm-frv/pgtable.h
@@ -176,8 +176,6 @@ do { \
176} while(0) 176} while(0)
177#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) 177#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
178 178
179#define set_pte_atomic(pteptr, pteval) set_pte((pteptr), (pteval))
180
181/* 179/*
182 * pgd_offset() returns a (pgd_t *) 180 * pgd_offset() returns a (pgd_t *)
183 * pgd_index() is used get the offset into the pgd page's array of pgd_t's; 181 * pgd_index() is used get the offset into the pgd page's array of pgd_t's;
diff --git a/include/asm-frv/timex.h b/include/asm-frv/timex.h
index 2aa562fa06..a89bddefda 100644
--- a/include/asm-frv/timex.h
+++ b/include/asm-frv/timex.h
@@ -6,11 +6,6 @@
6#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ 6#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */
7#define CLOCK_TICK_FACTOR 20 /* Factor of both 1000000 and CLOCK_TICK_RATE */ 7#define CLOCK_TICK_FACTOR 20 /* Factor of both 1000000 and CLOCK_TICK_RATE */
8 8
9#define FINETUNE \
10((((((long)LATCH * HZ - CLOCK_TICK_RATE) << SHIFT_HZ) * \
11 (1000000/CLOCK_TICK_FACTOR) / (CLOCK_TICK_RATE/CLOCK_TICK_FACTOR)) \
12 << (SHIFT_SCALE-SHIFT_HZ)) / HZ)
13
14typedef unsigned long cycles_t; 9typedef unsigned long cycles_t;
15 10
16static inline cycles_t get_cycles(void) 11static inline cycles_t get_cycles(void)
diff --git a/include/asm-frv/unistd.h b/include/asm-frv/unistd.h
index d104d1b91d..725e854928 100644
--- a/include/asm-frv/unistd.h
+++ b/include/asm-frv/unistd.h
@@ -440,31 +440,6 @@ type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg
440 __syscall_return(type, __sc0); \ 440 __syscall_return(type, __sc0); \
441} 441}
442 442
443
444#ifdef __KERNEL_SYSCALLS__
445
446#include <linux/compiler.h>
447#include <linux/types.h>
448#include <linux/linkage.h>
449#include <asm/ptrace.h>
450
451/*
452 * we need this inline - forking from kernel space will result
453 * in NO COPY ON WRITE (!!!), until an execve is executed. This
454 * is no problem, but for the stack. This is handled by not letting
455 * main() use the stack at all after fork(). Thus, no function
456 * calls - which means inline code for fork too, as otherwise we
457 * would use the stack upon exit from 'fork()'.
458 *
459 * Actually only pause and fork are needed inline, so that there
460 * won't be any messing with the stack from main(), but we define
461 * some others too.
462 */
463#define __NR__exit __NR_exit
464static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp)
465
466#endif /* __KERNEL_SYSCALLS__ */
467
468#define __ARCH_WANT_IPC_PARSE_VERSION 443#define __ARCH_WANT_IPC_PARSE_VERSION
469/* #define __ARCH_WANT_OLD_READDIR */ 444/* #define __ARCH_WANT_OLD_READDIR */
470#define __ARCH_WANT_OLD_STAT 445#define __ARCH_WANT_OLD_STAT
diff --git a/include/asm-generic/mutex-dec.h b/include/asm-generic/mutex-dec.h
index 29c6ac34e2..0134151656 100644
--- a/include/asm-generic/mutex-dec.h
+++ b/include/asm-generic/mutex-dec.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * asm-generic/mutex-dec.h 2 * include/asm-generic/mutex-dec.h
3 * 3 *
4 * Generic implementation of the mutex fastpath, based on atomic 4 * Generic implementation of the mutex fastpath, based on atomic
5 * decrement/increment. 5 * decrement/increment.
diff --git a/include/asm-generic/mutex-null.h b/include/asm-generic/mutex-null.h
index 254a126ede..e1bbbc72b6 100644
--- a/include/asm-generic/mutex-null.h
+++ b/include/asm-generic/mutex-null.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * asm-generic/mutex-null.h 2 * include/asm-generic/mutex-null.h
3 * 3 *
4 * Generic implementation of the mutex fastpath, based on NOP :-) 4 * Generic implementation of the mutex fastpath, based on NOP :-)
5 * 5 *
diff --git a/include/asm-generic/mutex-xchg.h b/include/asm-generic/mutex-xchg.h
index 32a2100c1a..6a7e8c141b 100644
--- a/include/asm-generic/mutex-xchg.h
+++ b/include/asm-generic/mutex-xchg.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * asm-generic/mutex-xchg.h 2 * include/asm-generic/mutex-xchg.h
3 * 3 *
4 * Generic implementation of the mutex fastpath, based on xchg(). 4 * Generic implementation of the mutex fastpath, based on xchg().
5 * 5 *
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index 349260cd86..9d774d07d9 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -15,19 +15,11 @@
15 * Note: the old pte is known to not be writable, so we don't need to 15 * Note: the old pte is known to not be writable, so we don't need to
16 * worry about dirty bits etc getting lost. 16 * worry about dirty bits etc getting lost.
17 */ 17 */
18#ifndef __HAVE_ARCH_SET_PTE_ATOMIC
19#define ptep_establish(__vma, __address, __ptep, __entry) \ 18#define ptep_establish(__vma, __address, __ptep, __entry) \
20do { \ 19do { \
21 set_pte_at((__vma)->vm_mm, (__address), __ptep, __entry); \ 20 set_pte_at((__vma)->vm_mm, (__address), __ptep, __entry); \
22 flush_tlb_page(__vma, __address); \ 21 flush_tlb_page(__vma, __address); \
23} while (0) 22} while (0)
24#else /* __HAVE_ARCH_SET_PTE_ATOMIC */
25#define ptep_establish(__vma, __address, __ptep, __entry) \
26do { \
27 set_pte_atomic(__ptep, __entry); \
28 flush_tlb_page(__vma, __address); \
29} while (0)
30#endif /* __HAVE_ARCH_SET_PTE_ATOMIC */
31#endif 23#endif
32 24
33#ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS 25#ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
@@ -112,8 +104,13 @@ do { \
112}) 104})
113#endif 105#endif
114 106
115#ifndef __HAVE_ARCH_PTE_CLEAR_FULL 107/*
116#define pte_clear_full(__mm, __address, __ptep, __full) \ 108 * Some architectures may be able to avoid expensive synchronization
109 * primitives when modifications are made to PTE's which are already
110 * not present, or in the process of an address space destruction.
111 */
112#ifndef __HAVE_ARCH_PTE_CLEAR_NOT_PRESENT_FULL
113#define pte_clear_not_present_full(__mm, __address, __ptep, __full) \
117do { \ 114do { \
118 pte_clear((__mm), (__address), (__ptep)); \ 115 pte_clear((__mm), (__address), (__ptep)); \
119} while (0) 116} while (0)
@@ -166,6 +163,26 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addres
166#endif 163#endif
167 164
168/* 165/*
166 * A facility to provide lazy MMU batching. This allows PTE updates and
167 * page invalidations to be delayed until a call to leave lazy MMU mode
168 * is issued. Some architectures may benefit from doing this, and it is
169 * beneficial for both shadow and direct mode hypervisors, which may batch
170 * the PTE updates which happen during this window. Note that using this
171 * interface requires that read hazards be removed from the code. A read
172 * hazard could result in the direct mode hypervisor case, since the actual
173 * write to the page tables may not yet have taken place, so reads though
174 * a raw PTE pointer after it has been modified are not guaranteed to be
175 * up to date. This mode can only be entered and left under the protection of
176 * the page table locks for all page tables which may be modified. In the UP
177 * case, this is required so that preemption is disabled, and in the SMP case,
178 * it must synchronize the delayed page table writes properly on other CPUs.
179 */
180#ifndef __HAVE_ARCH_ENTER_LAZY_MMU_MODE
181#define arch_enter_lazy_mmu_mode() do {} while (0)
182#define arch_leave_lazy_mmu_mode() do {} while (0)
183#endif
184
185/*
169 * When walking page tables, get the address of the next boundary, 186 * When walking page tables, get the address of the next boundary,
170 * or the end address of the range if that comes earlier. Although no 187 * or the end address of the range if that comes earlier. Although no
171 * vma end wraps to 0, rounded up __boundary may wrap to 0 throughout. 188 * vma end wraps to 0, rounded up __boundary may wrap to 0 throughout.
diff --git a/include/asm-generic/rtc.h b/include/asm-generic/rtc.h
index 4087037a42..d3238f1f70 100644
--- a/include/asm-generic/rtc.h
+++ b/include/asm-generic/rtc.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * inclue/asm-generic/rtc.h 2 * include/asm-generic/rtc.h
3 * 3 *
4 * Author: Tom Rini <trini@mvista.com> 4 * Author: Tom Rini <trini@mvista.com>
5 * 5 *
diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h
index 867d9008fa..f490e43a90 100644
--- a/include/asm-generic/tlb.h
+++ b/include/asm-generic/tlb.h
@@ -1,4 +1,4 @@
1/* asm-generic/tlb.h 1/* include/asm-generic/tlb.h
2 * 2 *
3 * Generic TLB shootdown code 3 * Generic TLB shootdown code
4 * 4 *
diff --git a/include/asm-h8300/keyboard.h b/include/asm-h8300/keyboard.h
index fbad65e8a5..90efbd6553 100644
--- a/include/asm-h8300/keyboard.h
+++ b/include/asm-h8300/keyboard.h
@@ -18,14 +18,6 @@
18#define kbd_enable_irq(x...) do {;} while (0) 18#define kbd_enable_irq(x...) do {;} while (0)
19#define kbd_disable_irq(x...) do {;} while (0) 19#define kbd_disable_irq(x...) do {;} while (0)
20 20
21
22/* needed if MAGIC_SYSRQ is enabled for serial console */
23#ifndef SYSRQ_KEY
24#define SYSRQ_KEY ((unsigned char)(-1))
25#define kbd_sysrq_xlate ((unsigned char *)NULL)
26#endif
27
28
29#endif /* _H8300_KEYBOARD_H */ 21#endif /* _H8300_KEYBOARD_H */
30 22
31 23
diff --git a/include/asm-h8300/unistd.h b/include/asm-h8300/unistd.h
index a2dd90462d..747788d629 100644
--- a/include/asm-h8300/unistd.h
+++ b/include/asm-h8300/unistd.h
@@ -485,57 +485,6 @@ type name(atype a, btype b, ctype c, dtype d, etype e, ftype f) \
485#define __ARCH_WANT_SYS_SIGPROCMASK 485#define __ARCH_WANT_SYS_SIGPROCMASK
486#define __ARCH_WANT_SYS_RT_SIGACTION 486#define __ARCH_WANT_SYS_RT_SIGACTION
487 487
488#ifdef __KERNEL_SYSCALLS__
489
490#include <linux/compiler.h>
491#include <linux/types.h>
492
493/*
494 * we need this inline - forking from kernel space will result
495 * in NO COPY ON WRITE (!!!), until an execve is executed. This
496 * is no problem, but for the stack. This is handled by not letting
497 * main() use the stack at all after fork(). Thus, no function
498 * calls - which means inline code for fork too, as otherwise we
499 * would use the stack upon exit from 'fork()'.
500 *
501 * Actually only pause and fork are needed inline, so that there
502 * won't be any messing with the stack from main(), but we define
503 * some others too.
504 */
505#define __NR__exit __NR_exit
506static inline _syscall0(int,pause)
507static inline _syscall0(int,sync)
508static inline _syscall0(pid_t,setsid)
509static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count)
510static inline _syscall3(int,read,int,fd,char *,buf,off_t,count)
511static inline _syscall3(off_t,lseek,int,fd,off_t,offset,int,count)
512static inline _syscall1(int,dup,int,fd)
513static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp)
514static inline _syscall3(int,open,const char *,file,int,flag,int,mode)
515static inline _syscall1(int,close,int,fd)
516static inline _syscall1(int,_exit,int,exitcode)
517static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options)
518static inline _syscall1(int,delete_module,const char *,name)
519
520static inline pid_t wait(int * wait_stat)
521{
522 return waitpid(-1,wait_stat,0);
523}
524
525asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
526 unsigned long prot, unsigned long flags,
527 unsigned long fd, unsigned long pgoff);
528asmlinkage int sys_execve(char *name, char **argv, char **envp,
529 int dummy, ...);
530asmlinkage int sys_pipe(unsigned long *fildes);
531struct sigaction;
532asmlinkage long sys_rt_sigaction(int sig,
533 const struct sigaction __user *act,
534 struct sigaction __user *oact,
535 size_t sigsetsize);
536
537#endif /* __KERNEL_SYSCALLS__ */
538
539/* 488/*
540 * "Conditional" syscalls 489 * "Conditional" syscalls
541 */ 490 */
diff --git a/include/asm-i386/bugs.h b/include/asm-i386/bugs.h
index 2a9e4ee590..592ffeeda4 100644
--- a/include/asm-i386/bugs.h
+++ b/include/asm-i386/bugs.h
@@ -189,6 +189,6 @@ static void __init check_bugs(void)
189 check_fpu(); 189 check_fpu();
190 check_hlt(); 190 check_hlt();
191 check_popad(); 191 check_popad();
192 system_utsname.machine[1] = '0' + (boot_cpu_data.x86 > 6 ? 6 : boot_cpu_data.x86); 192 init_utsname()->machine[1] = '0' + (boot_cpu_data.x86 > 6 ? 6 : boot_cpu_data.x86);
193 alternative_instructions(); 193 alternative_instructions();
194} 194}
diff --git a/include/asm-i386/elf.h b/include/asm-i386/elf.h
index db4344d9f7..3a05436f31 100644
--- a/include/asm-i386/elf.h
+++ b/include/asm-i386/elf.h
@@ -112,7 +112,7 @@ typedef struct user_fxsr_struct elf_fpxregset_t;
112 For the moment, we have only optimizations for the Intel generations, 112 For the moment, we have only optimizations for the Intel generations,
113 but that could change... */ 113 but that could change... */
114 114
115#define ELF_PLATFORM (system_utsname.machine) 115#define ELF_PLATFORM (utsname()->machine)
116 116
117#define SET_PERSONALITY(ex, ibcs2) do { } while (0) 117#define SET_PERSONALITY(ex, ibcs2) do { } while (0)
118 118
diff --git a/include/asm-i386/hw_irq.h b/include/asm-i386/hw_irq.h
index 87e5a351d8..88f02a0735 100644
--- a/include/asm-i386/hw_irq.h
+++ b/include/asm-i386/hw_irq.h
@@ -17,8 +17,6 @@
17#include <asm/irq.h> 17#include <asm/irq.h>
18#include <asm/sections.h> 18#include <asm/sections.h>
19 19
20struct hw_interrupt_type;
21
22#define NMI_VECTOR 0x02 20#define NMI_VECTOR 0x02
23 21
24/* 22/*
@@ -30,7 +28,6 @@ struct hw_interrupt_type;
30 28
31extern u8 irq_vector[NR_IRQ_VECTORS]; 29extern u8 irq_vector[NR_IRQ_VECTORS];
32#define IO_APIC_VECTOR(irq) (irq_vector[irq]) 30#define IO_APIC_VECTOR(irq) (irq_vector[irq])
33#define AUTO_ASSIGN -1
34 31
35extern void (*interrupt[NR_IRQS])(void); 32extern void (*interrupt[NR_IRQS])(void);
36 33
diff --git a/include/asm-i386/hypertransport.h b/include/asm-i386/hypertransport.h
new file mode 100644
index 0000000000..c16c6ff4bd
--- /dev/null
+++ b/include/asm-i386/hypertransport.h
@@ -0,0 +1,42 @@
1#ifndef ASM_HYPERTRANSPORT_H
2#define ASM_HYPERTRANSPORT_H
3
4/*
5 * Constants for x86 Hypertransport Interrupts.
6 */
7
8#define HT_IRQ_LOW_BASE 0xf8000000
9
10#define HT_IRQ_LOW_VECTOR_SHIFT 16
11#define HT_IRQ_LOW_VECTOR_MASK 0x00ff0000
12#define HT_IRQ_LOW_VECTOR(v) (((v) << HT_IRQ_LOW_VECTOR_SHIFT) & HT_IRQ_LOW_VECTOR_MASK)
13
14#define HT_IRQ_LOW_DEST_ID_SHIFT 8
15#define HT_IRQ_LOW_DEST_ID_MASK 0x0000ff00
16#define HT_IRQ_LOW_DEST_ID(v) (((v) << HT_IRQ_LOW_DEST_ID_SHIFT) & HT_IRQ_LOW_DEST_ID_MASK)
17
18#define HT_IRQ_LOW_DM_PHYSICAL 0x0000000
19#define HT_IRQ_LOW_DM_LOGICAL 0x0000040
20
21#define HT_IRQ_LOW_RQEOI_EDGE 0x0000000
22#define HT_IRQ_LOW_RQEOI_LEVEL 0x0000020
23
24
25#define HT_IRQ_LOW_MT_FIXED 0x0000000
26#define HT_IRQ_LOW_MT_ARBITRATED 0x0000004
27#define HT_IRQ_LOW_MT_SMI 0x0000008
28#define HT_IRQ_LOW_MT_NMI 0x000000c
29#define HT_IRQ_LOW_MT_INIT 0x0000010
30#define HT_IRQ_LOW_MT_STARTUP 0x0000014
31#define HT_IRQ_LOW_MT_EXTINT 0x0000018
32#define HT_IRQ_LOW_MT_LINT1 0x000008c
33#define HT_IRQ_LOW_MT_LINT0 0x0000098
34
35#define HT_IRQ_LOW_IRQ_MASKED 0x0000001
36
37
38#define HT_IRQ_HIGH_DEST_ID_SHIFT 0
39#define HT_IRQ_HIGH_DEST_ID_MASK 0x00ffffff
40#define HT_IRQ_HIGH_DEST_ID(v) ((((v) >> 8) << HT_IRQ_HIGH_DEST_ID_SHIFT) & HT_IRQ_HIGH_DEST_ID_MASK)
41
42#endif /* ASM_HYPERTRANSPORT_H */
diff --git a/include/asm-i386/io_apic.h b/include/asm-i386/io_apic.h
index 5d309275a1..276ea7e814 100644
--- a/include/asm-i386/io_apic.h
+++ b/include/asm-i386/io_apic.h
@@ -12,46 +12,6 @@
12 12
13#ifdef CONFIG_X86_IO_APIC 13#ifdef CONFIG_X86_IO_APIC
14 14
15#ifdef CONFIG_PCI_MSI
16static inline int use_pci_vector(void) {return 1;}
17static inline void disable_edge_ioapic_vector(unsigned int vector) { }
18static inline void mask_and_ack_level_ioapic_vector(unsigned int vector) { }
19static inline void end_edge_ioapic_vector (unsigned int vector) { }
20#define startup_level_ioapic startup_level_ioapic_vector
21#define shutdown_level_ioapic mask_IO_APIC_vector
22#define enable_level_ioapic unmask_IO_APIC_vector
23#define disable_level_ioapic mask_IO_APIC_vector
24#define mask_and_ack_level_ioapic mask_and_ack_level_ioapic_vector
25#define end_level_ioapic end_level_ioapic_vector
26#define set_ioapic_affinity set_ioapic_affinity_vector
27
28#define startup_edge_ioapic startup_edge_ioapic_vector
29#define shutdown_edge_ioapic disable_edge_ioapic_vector
30#define enable_edge_ioapic unmask_IO_APIC_vector
31#define disable_edge_ioapic disable_edge_ioapic_vector
32#define ack_edge_ioapic ack_edge_ioapic_vector
33#define end_edge_ioapic end_edge_ioapic_vector
34#else
35static inline int use_pci_vector(void) {return 0;}
36static inline void disable_edge_ioapic_irq(unsigned int irq) { }
37static inline void mask_and_ack_level_ioapic_irq(unsigned int irq) { }
38static inline void end_edge_ioapic_irq (unsigned int irq) { }
39#define startup_level_ioapic startup_level_ioapic_irq
40#define shutdown_level_ioapic mask_IO_APIC_irq
41#define enable_level_ioapic unmask_IO_APIC_irq
42#define disable_level_ioapic mask_IO_APIC_irq
43#define mask_and_ack_level_ioapic mask_and_ack_level_ioapic_irq
44#define end_level_ioapic end_level_ioapic_irq
45#define set_ioapic_affinity set_ioapic_affinity_irq
46
47#define startup_edge_ioapic startup_edge_ioapic_irq
48#define shutdown_edge_ioapic disable_edge_ioapic_irq
49#define enable_edge_ioapic unmask_IO_APIC_irq
50#define disable_edge_ioapic disable_edge_ioapic_irq
51#define ack_edge_ioapic ack_edge_ioapic_irq
52#define end_edge_ioapic end_edge_ioapic_irq
53#endif
54
55#define IO_APIC_BASE(idx) \ 15#define IO_APIC_BASE(idx) \
56 ((volatile int *)(__fix_to_virt(FIX_IO_APIC_BASE_0 + idx) \ 16 ((volatile int *)(__fix_to_virt(FIX_IO_APIC_BASE_0 + idx) \
57 + (mp_ioapics[idx].mpc_apicaddr & ~PAGE_MASK))) 17 + (mp_ioapics[idx].mpc_apicaddr & ~PAGE_MASK)))
@@ -219,6 +179,4 @@ extern int (*ioapic_renumber_irq)(int ioapic, int irq);
219static inline void disable_ioapic_setup(void) { } 179static inline void disable_ioapic_setup(void) { }
220#endif 180#endif
221 181
222extern int assign_irq_vector(int irq);
223
224#endif 182#endif
diff --git a/include/asm-i386/mach-default/irq_vectors_limits.h b/include/asm-i386/mach-default/irq_vectors_limits.h
index b330026e6f..7f161e760b 100644
--- a/include/asm-i386/mach-default/irq_vectors_limits.h
+++ b/include/asm-i386/mach-default/irq_vectors_limits.h
@@ -1,10 +1,6 @@
1#ifndef _ASM_IRQ_VECTORS_LIMITS_H 1#ifndef _ASM_IRQ_VECTORS_LIMITS_H
2#define _ASM_IRQ_VECTORS_LIMITS_H 2#define _ASM_IRQ_VECTORS_LIMITS_H
3 3
4#ifdef CONFIG_PCI_MSI
5#define NR_IRQS FIRST_SYSTEM_VECTOR
6#define NR_IRQ_VECTORS NR_IRQS
7#else
8#ifdef CONFIG_X86_IO_APIC 4#ifdef CONFIG_X86_IO_APIC
9#define NR_IRQS 224 5#define NR_IRQS 224
10# if (224 >= 32 * NR_CPUS) 6# if (224 >= 32 * NR_CPUS)
@@ -16,6 +12,5 @@
16#define NR_IRQS 16 12#define NR_IRQS 16
17#define NR_IRQ_VECTORS NR_IRQS 13#define NR_IRQ_VECTORS NR_IRQS
18#endif 14#endif
19#endif
20 15
21#endif /* _ASM_IRQ_VECTORS_LIMITS_H */ 16#endif /* _ASM_IRQ_VECTORS_LIMITS_H */
diff --git a/include/asm-i386/mach-summit/mach_apic.h b/include/asm-i386/mach-summit/mach_apic.h
index 254a0fe01c..ef0671e5d5 100644
--- a/include/asm-i386/mach-summit/mach_apic.h
+++ b/include/asm-i386/mach-summit/mach_apic.h
@@ -88,7 +88,7 @@ static inline void clustered_apic_check(void)
88 88
89static inline int apicid_to_node(int logical_apicid) 89static inline int apicid_to_node(int logical_apicid)
90{ 90{
91 return apicid_2_node[logical_apicid]; 91 return apicid_2_node[hard_smp_processor_id()];
92} 92}
93 93
94/* Mapping from cpu number to logical apicid */ 94/* Mapping from cpu number to logical apicid */
diff --git a/include/asm-i386/mca_dma.h b/include/asm-i386/mca_dma.h
index 4b3b526c5a..fbb1f3b712 100644
--- a/include/asm-i386/mca_dma.h
+++ b/include/asm-i386/mca_dma.h
@@ -181,7 +181,7 @@ static __inline__ void mca_set_dma_io(unsigned int dmanr, unsigned int io_addr)
181 * @mode: mode to set 181 * @mode: mode to set
182 * 182 *
183 * The DMA controller supports several modes. The mode values you can 183 * The DMA controller supports several modes. The mode values you can
184 * set are : 184 * set are-
185 * 185 *
186 * %MCA_DMA_MODE_READ when reading from the DMA device. 186 * %MCA_DMA_MODE_READ when reading from the DMA device.
187 * 187 *
@@ -190,7 +190,6 @@ static __inline__ void mca_set_dma_io(unsigned int dmanr, unsigned int io_addr)
190 * %MCA_DMA_MODE_IO to do DMA to or from an I/O port. 190 * %MCA_DMA_MODE_IO to do DMA to or from an I/O port.
191 * 191 *
192 * %MCA_DMA_MODE_16 to do 16bit transfers. 192 * %MCA_DMA_MODE_16 to do 16bit transfers.
193 *
194 */ 193 */
195 194
196static __inline__ void mca_set_dma_mode(unsigned int dmanr, unsigned int mode) 195static __inline__ void mca_set_dma_mode(unsigned int dmanr, unsigned int mode)
diff --git a/include/asm-i386/msi.h b/include/asm-i386/msi.h
deleted file mode 100644
index b11c4b7dfa..0000000000
--- a/include/asm-i386/msi.h
+++ /dev/null
@@ -1,23 +0,0 @@
1/*
2 * Copyright (C) 2003-2004 Intel
3 * Copyright (C) Tom Long Nguyen (tom.l.nguyen@intel.com)
4 */
5
6#ifndef ASM_MSI_H
7#define ASM_MSI_H
8
9#include <asm/desc.h>
10#include <mach_apic.h>
11
12#define LAST_DEVICE_VECTOR (FIRST_SYSTEM_VECTOR - 1)
13#define MSI_TARGET_CPU_SHIFT 12
14
15extern struct msi_ops msi_apic_ops;
16
17static inline int msi_arch_init(void)
18{
19 msi_register(&msi_apic_ops);
20 return 0;
21}
22
23#endif /* ASM_MSI_H */
diff --git a/include/asm-i386/msidef.h b/include/asm-i386/msidef.h
new file mode 100644
index 0000000000..5b8acddb70
--- /dev/null
+++ b/include/asm-i386/msidef.h
@@ -0,0 +1,47 @@
1#ifndef ASM_MSIDEF_H
2#define ASM_MSIDEF_H
3
4/*
5 * Constants for Intel APIC based MSI messages.
6 */
7
8/*
9 * Shifts for MSI data
10 */
11
12#define MSI_DATA_VECTOR_SHIFT 0
13#define MSI_DATA_VECTOR_MASK 0x000000ff
14#define MSI_DATA_VECTOR(v) (((v) << MSI_DATA_VECTOR_SHIFT) & MSI_DATA_VECTOR_MASK)
15
16#define MSI_DATA_DELIVERY_MODE_SHIFT 8
17#define MSI_DATA_DELIVERY_FIXED (0 << MSI_DATA_DELIVERY_MODE_SHIFT)
18#define MSI_DATA_DELIVERY_LOWPRI (1 << MSI_DATA_DELIVERY_MODE_SHIFT)
19
20#define MSI_DATA_LEVEL_SHIFT 14
21#define MSI_DATA_LEVEL_DEASSERT (0 << MSI_DATA_LEVEL_SHIFT)
22#define MSI_DATA_LEVEL_ASSERT (1 << MSI_DATA_LEVEL_SHIFT)
23
24#define MSI_DATA_TRIGGER_SHIFT 15
25#define MSI_DATA_TRIGGER_EDGE (0 << MSI_DATA_TRIGGER_SHIFT)
26#define MSI_DATA_TRIGGER_LEVEL (1 << MSI_DATA_TRIGGER_SHIFT)
27
28/*
29 * Shift/mask fields for msi address
30 */
31
32#define MSI_ADDR_BASE_HI 0
33#define MSI_ADDR_BASE_LO 0xfee00000
34
35#define MSI_ADDR_DEST_MODE_SHIFT 2
36#define MSI_ADDR_DEST_MODE_PHYSICAL (0 << MSI_ADDR_DEST_MODE_SHIFT)
37#define MSI_ADDR_DEST_MODE_LOGICAL (1 << MSI_ADDR_DEST_MODE_SHIFT)
38
39#define MSI_ADDR_REDIRECTION_SHIFT 3
40#define MSI_ADDR_REDIRECTION_CPU (0 << MSI_ADDR_REDIRECTION_SHIFT) /* dedicated cpu */
41#define MSI_ADDR_REDIRECTION_LOWPRI (1 << MSI_ADDR_REDIRECTION_SHIFT) /* lowest priority */
42
43#define MSI_ADDR_DEST_ID_SHIFT 12
44#define MSI_ADDR_DEST_ID_MASK 0x00ffff0
45#define MSI_ADDR_DEST_ID(dest) (((dest) << MSI_ADDR_DEST_ID_SHIFT) & MSI_ADDR_DEST_ID_MASK)
46
47#endif /* ASM_MSIDEF_H */
diff --git a/include/asm-i386/pgtable-2level.h b/include/asm-i386/pgtable-2level.h
index 201c86a671..8d8d3b9ecd 100644
--- a/include/asm-i386/pgtable-2level.h
+++ b/include/asm-i386/pgtable-2level.h
@@ -16,6 +16,7 @@
16#define set_pte(pteptr, pteval) (*(pteptr) = pteval) 16#define set_pte(pteptr, pteval) (*(pteptr) = pteval)
17#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) 17#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
18#define set_pte_atomic(pteptr, pteval) set_pte(pteptr,pteval) 18#define set_pte_atomic(pteptr, pteval) set_pte(pteptr,pteval)
19#define set_pte_present(mm,addr,ptep,pteval) set_pte_at(mm,addr,ptep,pteval)
19#define set_pmd(pmdptr, pmdval) (*(pmdptr) = (pmdval)) 20#define set_pmd(pmdptr, pmdval) (*(pmdptr) = (pmdval))
20 21
21#define pte_clear(mm,addr,xp) do { set_pte_at(mm, addr, xp, __pte(0)); } while (0) 22#define pte_clear(mm,addr,xp) do { set_pte_at(mm, addr, xp, __pte(0)); } while (0)
diff --git a/include/asm-i386/pgtable-3level.h b/include/asm-i386/pgtable-3level.h
index 0d89917323..c2d701ea35 100644
--- a/include/asm-i386/pgtable-3level.h
+++ b/include/asm-i386/pgtable-3level.h
@@ -58,7 +58,21 @@ static inline void set_pte(pte_t *ptep, pte_t pte)
58} 58}
59#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) 59#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
60 60
61#define __HAVE_ARCH_SET_PTE_ATOMIC 61/*
62 * Since this is only called on user PTEs, and the page fault handler
63 * must handle the already racy situation of simultaneous page faults,
64 * we are justified in merely clearing the PTE present bit, followed
65 * by a set. The ordering here is important.
66 */
67static inline void set_pte_present(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pte)
68{
69 ptep->pte_low = 0;
70 smp_wmb();
71 ptep->pte_high = pte.pte_high;
72 smp_wmb();
73 ptep->pte_low = pte.pte_low;
74}
75
62#define set_pte_atomic(pteptr,pteval) \ 76#define set_pte_atomic(pteptr,pteval) \
63 set_64bit((unsigned long long *)(pteptr),pte_val(pteval)) 77 set_64bit((unsigned long long *)(pteptr),pte_val(pteval))
64#define set_pmd(pmdptr,pmdval) \ 78#define set_pmd(pmdptr,pmdval) \
diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h
index 541b3e2343..7d398f493d 100644
--- a/include/asm-i386/pgtable.h
+++ b/include/asm-i386/pgtable.h
@@ -247,6 +247,23 @@ static inline pte_t pte_mkhuge(pte_t pte) { (pte).pte_low |= _PAGE_PSE; return p
247#endif 247#endif
248 248
249/* 249/*
250 * Rules for using pte_update - it must be called after any PTE update which
251 * has not been done using the set_pte / clear_pte interfaces. It is used by
252 * shadow mode hypervisors to resynchronize the shadow page tables. Kernel PTE
253 * updates should either be sets, clears, or set_pte_atomic for P->P
254 * transitions, which means this hook should only be called for user PTEs.
255 * This hook implies a P->P protection or access change has taken place, which
256 * requires a subsequent TLB flush. The notification can optionally be delayed
257 * until the TLB flush event by using the pte_update_defer form of the
258 * interface, but care must be taken to assure that the flush happens while
259 * still holding the same page table lock so that the shadow and primary pages
260 * do not become out of sync on SMP.
261 */
262#define pte_update(mm, addr, ptep) do { } while (0)
263#define pte_update_defer(mm, addr, ptep) do { } while (0)
264
265
266/*
250 * We only update the dirty/accessed state if we set 267 * We only update the dirty/accessed state if we set
251 * the dirty bit by hand in the kernel, since the hardware 268 * the dirty bit by hand in the kernel, since the hardware
252 * will do the accessed bit for us, and we don't want to 269 * will do the accessed bit for us, and we don't want to
@@ -258,25 +275,54 @@ static inline pte_t pte_mkhuge(pte_t pte) { (pte).pte_low |= _PAGE_PSE; return p
258do { \ 275do { \
259 if (dirty) { \ 276 if (dirty) { \
260 (ptep)->pte_low = (entry).pte_low; \ 277 (ptep)->pte_low = (entry).pte_low; \
278 pte_update_defer((vma)->vm_mm, (addr), (ptep)); \
261 flush_tlb_page(vma, address); \ 279 flush_tlb_page(vma, address); \
262 } \ 280 } \
263} while (0) 281} while (0)
264 282
283/*
284 * We don't actually have these, but we want to advertise them so that
285 * we can encompass the flush here.
286 */
265#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY 287#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
266static inline int ptep_test_and_clear_dirty(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep)
267{
268 if (!pte_dirty(*ptep))
269 return 0;
270 return test_and_clear_bit(_PAGE_BIT_DIRTY, &ptep->pte_low);
271}
272
273#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG 288#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
274static inline int ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) 289
275{ 290/*
276 if (!pte_young(*ptep)) 291 * Rules for using ptep_establish: the pte MUST be a user pte, and
277 return 0; 292 * must be a present->present transition.
278 return test_and_clear_bit(_PAGE_BIT_ACCESSED, &ptep->pte_low); 293 */
279} 294#define __HAVE_ARCH_PTEP_ESTABLISH
295#define ptep_establish(vma, address, ptep, pteval) \
296do { \
297 set_pte_present((vma)->vm_mm, address, ptep, pteval); \
298 flush_tlb_page(vma, address); \
299} while (0)
300
301#define __HAVE_ARCH_PTEP_CLEAR_DIRTY_FLUSH
302#define ptep_clear_flush_dirty(vma, address, ptep) \
303({ \
304 int __dirty; \
305 __dirty = pte_dirty(*(ptep)); \
306 if (__dirty) { \
307 clear_bit(_PAGE_BIT_DIRTY, &(ptep)->pte_low); \
308 pte_update_defer((vma)->vm_mm, (addr), (ptep)); \
309 flush_tlb_page(vma, address); \
310 } \
311 __dirty; \
312})
313
314#define __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH
315#define ptep_clear_flush_young(vma, address, ptep) \
316({ \
317 int __young; \
318 __young = pte_young(*(ptep)); \
319 if (__young) { \
320 clear_bit(_PAGE_BIT_ACCESSED, &(ptep)->pte_low); \
321 pte_update_defer((vma)->vm_mm, (addr), (ptep)); \
322 flush_tlb_page(vma, address); \
323 } \
324 __young; \
325})
280 326
281#define __HAVE_ARCH_PTEP_GET_AND_CLEAR_FULL 327#define __HAVE_ARCH_PTEP_GET_AND_CLEAR_FULL
282static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm, unsigned long addr, pte_t *ptep, int full) 328static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm, unsigned long addr, pte_t *ptep, int full)
@@ -295,6 +341,7 @@ static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm, unsigned long
295static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep) 341static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
296{ 342{
297 clear_bit(_PAGE_BIT_RW, &ptep->pte_low); 343 clear_bit(_PAGE_BIT_RW, &ptep->pte_low);
344 pte_update(mm, addr, ptep);
298} 345}
299 346
300/* 347/*
@@ -426,6 +473,13 @@ extern pte_t *lookup_address(unsigned long address);
426#define pte_unmap_nested(pte) do { } while (0) 473#define pte_unmap_nested(pte) do { } while (0)
427#endif 474#endif
428 475
476/* Clear a kernel PTE and flush it from the TLB */
477#define kpte_clear_flush(ptep, vaddr) \
478do { \
479 pte_clear(&init_mm, vaddr, ptep); \
480 __flush_tlb_one(vaddr); \
481} while (0)
482
429/* 483/*
430 * The i386 doesn't have any external MMU info: the kernel page 484 * The i386 doesn't have any external MMU info: the kernel page
431 * tables contain all the necessary information. 485 * tables contain all the necessary information.
diff --git a/include/asm-i386/ptrace.h b/include/asm-i386/ptrace.h
index a4a0e5207d..d505f50107 100644
--- a/include/asm-i386/ptrace.h
+++ b/include/asm-i386/ptrace.h
@@ -47,7 +47,10 @@ static inline int user_mode_vm(struct pt_regs *regs)
47{ 47{
48 return ((regs->xcs & SEGMENT_RPL_MASK) | (regs->eflags & VM_MASK)) >= USER_RPL; 48 return ((regs->xcs & SEGMENT_RPL_MASK) | (regs->eflags & VM_MASK)) >= USER_RPL;
49} 49}
50
50#define instruction_pointer(regs) ((regs)->eip) 51#define instruction_pointer(regs) ((regs)->eip)
52#define regs_return_value(regs) ((regs)->eax)
53
51extern unsigned long profile_pc(struct pt_regs *regs); 54extern unsigned long profile_pc(struct pt_regs *regs);
52#endif /* __KERNEL__ */ 55#endif /* __KERNEL__ */
53 56
diff --git a/include/asm-i386/smp.h b/include/asm-i386/smp.h
index 915c26a31b..6aa1206f6e 100644
--- a/include/asm-i386/smp.h
+++ b/include/asm-i386/smp.h
@@ -84,6 +84,7 @@ static inline int hard_smp_processor_id(void)
84#endif 84#endif
85#endif 85#endif
86 86
87extern int safe_smp_processor_id(void);
87extern int __cpu_disable(void); 88extern int __cpu_disable(void);
88extern void __cpu_die(unsigned int cpu); 89extern void __cpu_die(unsigned int cpu);
89extern unsigned int num_processors; 90extern unsigned int num_processors;
@@ -92,6 +93,7 @@ extern unsigned int num_processors;
92 93
93#else /* CONFIG_SMP */ 94#else /* CONFIG_SMP */
94 95
96#define safe_smp_processor_id() 0
95#define cpu_physical_id(cpu) boot_cpu_physical_apicid 97#define cpu_physical_id(cpu) boot_cpu_physical_apicid
96 98
97#define NO_PROC_ID 0xFF /* No processor magic marker */ 99#define NO_PROC_ID 0xFF /* No processor magic marker */
diff --git a/include/asm-i386/spinlock.h b/include/asm-i386/spinlock.h
index b0b3043f05..c18b71fae6 100644
--- a/include/asm-i386/spinlock.h
+++ b/include/asm-i386/spinlock.h
@@ -205,4 +205,8 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw)
205 : "+m" (rw->lock) : : "memory"); 205 : "+m" (rw->lock) : : "memory");
206} 206}
207 207
208#define _raw_spin_relax(lock) cpu_relax()
209#define _raw_read_relax(lock) cpu_relax()
210#define _raw_write_relax(lock) cpu_relax()
211
208#endif /* __ASM_SPINLOCK_H */ 212#endif /* __ASM_SPINLOCK_H */
diff --git a/include/asm-i386/topology.h b/include/asm-i386/topology.h
index 6adbd9b1ae..978d095961 100644
--- a/include/asm-i386/topology.h
+++ b/include/asm-i386/topology.h
@@ -74,6 +74,7 @@ static inline int node_to_first_cpu(int node)
74#define SD_NODE_INIT (struct sched_domain) { \ 74#define SD_NODE_INIT (struct sched_domain) { \
75 .span = CPU_MASK_NONE, \ 75 .span = CPU_MASK_NONE, \
76 .parent = NULL, \ 76 .parent = NULL, \
77 .child = NULL, \
77 .groups = NULL, \ 78 .groups = NULL, \
78 .min_interval = 8, \ 79 .min_interval = 8, \
79 .max_interval = 32, \ 80 .max_interval = 32, \
diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h
index bd9987087a..3ca7ab963d 100644
--- a/include/asm-i386/unistd.h
+++ b/include/asm-i386/unistd.h
@@ -451,45 +451,6 @@ __syscall_return(type,__res); \
451#define __ARCH_WANT_SYS_RT_SIGACTION 451#define __ARCH_WANT_SYS_RT_SIGACTION
452#define __ARCH_WANT_SYS_RT_SIGSUSPEND 452#define __ARCH_WANT_SYS_RT_SIGSUSPEND
453 453
454#ifdef __KERNEL_SYSCALLS__
455
456#include <linux/compiler.h>
457#include <linux/types.h>
458#include <linux/linkage.h>
459#include <asm/ptrace.h>
460
461/*
462 * we need this inline - forking from kernel space will result
463 * in NO COPY ON WRITE (!!!), until an execve is executed. This
464 * is no problem, but for the stack. This is handled by not letting
465 * main() use the stack at all after fork(). Thus, no function
466 * calls - which means inline code for fork too, as otherwise we
467 * would use the stack upon exit from 'fork()'.
468 *
469 * Actually only pause and fork are needed inline, so that there
470 * won't be any messing with the stack from main(), but we define
471 * some others too.
472 */
473static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp)
474
475asmlinkage int sys_modify_ldt(int func, void __user *ptr, unsigned long bytecount);
476asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
477 unsigned long prot, unsigned long flags,
478 unsigned long fd, unsigned long pgoff);
479asmlinkage int sys_execve(struct pt_regs regs);
480asmlinkage int sys_clone(struct pt_regs regs);
481asmlinkage int sys_fork(struct pt_regs regs);
482asmlinkage int sys_vfork(struct pt_regs regs);
483asmlinkage int sys_pipe(unsigned long __user *fildes);
484asmlinkage long sys_iopl(unsigned long unused);
485struct sigaction;
486asmlinkage long sys_rt_sigaction(int sig,
487 const struct sigaction __user *act,
488 struct sigaction __user *oact,
489 size_t sigsetsize);
490
491#endif /* __KERNEL_SYSCALLS__ */
492
493/* 454/*
494 * "Conditional" syscalls 455 * "Conditional" syscalls
495 * 456 *
diff --git a/include/asm-ia64/machvec.h b/include/asm-ia64/machvec.h
index 15b545a897..90cba967df 100644
--- a/include/asm-ia64/machvec.h
+++ b/include/asm-ia64/machvec.h
@@ -20,6 +20,7 @@ struct page;
20struct mm_struct; 20struct mm_struct;
21struct pci_bus; 21struct pci_bus;
22struct task_struct; 22struct task_struct;
23struct pci_dev;
23 24
24typedef void ia64_mv_setup_t (char **); 25typedef void ia64_mv_setup_t (char **);
25typedef void ia64_mv_cpu_init_t (void); 26typedef void ia64_mv_cpu_init_t (void);
@@ -75,7 +76,9 @@ typedef unsigned char ia64_mv_readb_relaxed_t (const volatile void __iomem *);
75typedef unsigned short ia64_mv_readw_relaxed_t (const volatile void __iomem *); 76typedef unsigned short ia64_mv_readw_relaxed_t (const volatile void __iomem *);
76typedef unsigned int ia64_mv_readl_relaxed_t (const volatile void __iomem *); 77typedef unsigned int ia64_mv_readl_relaxed_t (const volatile void __iomem *);
77typedef unsigned long ia64_mv_readq_relaxed_t (const volatile void __iomem *); 78typedef unsigned long ia64_mv_readq_relaxed_t (const volatile void __iomem *);
78typedef int ia64_mv_msi_init_t (void); 79
80typedef int ia64_mv_setup_msi_irq_t (unsigned int irq, struct pci_dev *pdev);
81typedef void ia64_mv_teardown_msi_irq_t (unsigned int irq);
79 82
80static inline void 83static inline void
81machvec_noop (void) 84machvec_noop (void)
@@ -154,7 +157,8 @@ extern void machvec_tlb_migrate_finish (struct mm_struct *);
154# define platform_readl_relaxed ia64_mv.readl_relaxed 157# define platform_readl_relaxed ia64_mv.readl_relaxed
155# define platform_readq_relaxed ia64_mv.readq_relaxed 158# define platform_readq_relaxed ia64_mv.readq_relaxed
156# define platform_migrate ia64_mv.migrate 159# define platform_migrate ia64_mv.migrate
157# define platform_msi_init ia64_mv.msi_init 160# define platform_setup_msi_irq ia64_mv.setup_msi_irq
161# define platform_teardown_msi_irq ia64_mv.teardown_msi_irq
158# endif 162# endif
159 163
160/* __attribute__((__aligned__(16))) is required to make size of the 164/* __attribute__((__aligned__(16))) is required to make size of the
@@ -204,7 +208,8 @@ struct ia64_machine_vector {
204 ia64_mv_readl_relaxed_t *readl_relaxed; 208 ia64_mv_readl_relaxed_t *readl_relaxed;
205 ia64_mv_readq_relaxed_t *readq_relaxed; 209 ia64_mv_readq_relaxed_t *readq_relaxed;
206 ia64_mv_migrate_t *migrate; 210 ia64_mv_migrate_t *migrate;
207 ia64_mv_msi_init_t *msi_init; 211 ia64_mv_setup_msi_irq_t *setup_msi_irq;
212 ia64_mv_teardown_msi_irq_t *teardown_msi_irq;
208} __attribute__((__aligned__(16))); /* align attrib? see above comment */ 213} __attribute__((__aligned__(16))); /* align attrib? see above comment */
209 214
210#define MACHVEC_INIT(name) \ 215#define MACHVEC_INIT(name) \
@@ -250,7 +255,8 @@ struct ia64_machine_vector {
250 platform_readl_relaxed, \ 255 platform_readl_relaxed, \
251 platform_readq_relaxed, \ 256 platform_readq_relaxed, \
252 platform_migrate, \ 257 platform_migrate, \
253 platform_msi_init, \ 258 platform_setup_msi_irq, \
259 platform_teardown_msi_irq, \
254} 260}
255 261
256extern struct ia64_machine_vector ia64_mv; 262extern struct ia64_machine_vector ia64_mv;
@@ -404,8 +410,11 @@ extern int ia64_pci_legacy_write(struct pci_bus *bus, u16 port, u32 val, u8 size
404#ifndef platform_migrate 410#ifndef platform_migrate
405# define platform_migrate machvec_noop_task 411# define platform_migrate machvec_noop_task
406#endif 412#endif
407#ifndef platform_msi_init 413#ifndef platform_setup_msi_irq
408# define platform_msi_init ((ia64_mv_msi_init_t*)NULL) 414# define platform_setup_msi_irq ((ia64_mv_setup_msi_irq_t*)NULL)
415#endif
416#ifndef platform_teardown_msi_irq
417# define platform_teardown_msi_irq ((ia64_mv_teardown_msi_irq_t*)NULL)
409#endif 418#endif
410 419
411#endif /* _ASM_IA64_MACHVEC_H */ 420#endif /* _ASM_IA64_MACHVEC_H */
diff --git a/include/asm-ia64/machvec_sn2.h b/include/asm-ia64/machvec_sn2.h
index cf724dc79d..c54b165b1c 100644
--- a/include/asm-ia64/machvec_sn2.h
+++ b/include/asm-ia64/machvec_sn2.h
@@ -67,7 +67,8 @@ extern ia64_mv_dma_sync_sg_for_device sn_dma_sync_sg_for_device;
67extern ia64_mv_dma_mapping_error sn_dma_mapping_error; 67extern ia64_mv_dma_mapping_error sn_dma_mapping_error;
68extern ia64_mv_dma_supported sn_dma_supported; 68extern ia64_mv_dma_supported sn_dma_supported;
69extern ia64_mv_migrate_t sn_migrate; 69extern ia64_mv_migrate_t sn_migrate;
70extern ia64_mv_msi_init_t sn_msi_init; 70extern ia64_mv_setup_msi_irq_t sn_setup_msi_irq;
71extern ia64_mv_teardown_msi_irq_t sn_teardown_msi_irq;
71 72
72 73
73/* 74/*
@@ -120,9 +121,11 @@ extern ia64_mv_msi_init_t sn_msi_init;
120#define platform_dma_supported sn_dma_supported 121#define platform_dma_supported sn_dma_supported
121#define platform_migrate sn_migrate 122#define platform_migrate sn_migrate
122#ifdef CONFIG_PCI_MSI 123#ifdef CONFIG_PCI_MSI
123#define platform_msi_init sn_msi_init 124#define platform_setup_msi_irq sn_setup_msi_irq
125#define platform_teardown_msi_irq sn_teardown_msi_irq
124#else 126#else
125#define platform_msi_init ((ia64_mv_msi_init_t*)NULL) 127#define platform_setup_msi_irq ((ia64_mv_setup_msi_irq_t*)NULL)
128#define platform_teardown_msi_irq ((ia64_mv_teardown_msi_irq_t*)NULL)
126#endif 129#endif
127 130
128#include <asm/sn/io.h> 131#include <asm/sn/io.h>
diff --git a/include/asm-ia64/msi.h b/include/asm-ia64/msi.h
deleted file mode 100644
index bb92b0dbde..0000000000
--- a/include/asm-ia64/msi.h
+++ /dev/null
@@ -1,29 +0,0 @@
1/*
2 * Copyright (C) 2003-2004 Intel
3 * Copyright (C) Tom Long Nguyen (tom.l.nguyen@intel.com)
4 */
5
6#ifndef ASM_MSI_H
7#define ASM_MSI_H
8
9#define NR_VECTORS NR_IRQS
10#define FIRST_DEVICE_VECTOR IA64_FIRST_DEVICE_VECTOR
11#define LAST_DEVICE_VECTOR IA64_LAST_DEVICE_VECTOR
12static inline void set_intr_gate (int nr, void *func) {}
13#define IO_APIC_VECTOR(irq) (irq)
14#define ack_APIC_irq ia64_eoi
15#define MSI_TARGET_CPU_SHIFT 4
16
17extern struct msi_ops msi_apic_ops;
18
19static inline int msi_arch_init(void)
20{
21 if (platform_msi_init)
22 return platform_msi_init();
23
24 /* default ops for most ia64 platforms */
25 msi_register(&msi_apic_ops);
26 return 0;
27}
28
29#endif /* ASM_MSI_H */
diff --git a/include/asm-ia64/ptrace.h b/include/asm-ia64/ptrace.h
index 1414316efd..f4ef87a362 100644
--- a/include/asm-ia64/ptrace.h
+++ b/include/asm-ia64/ptrace.h
@@ -241,6 +241,9 @@ struct switch_stack {
241 * the canonical representation by adding to instruction pointer. 241 * the canonical representation by adding to instruction pointer.
242 */ 242 */
243# define instruction_pointer(regs) ((regs)->cr_iip + ia64_psr(regs)->ri) 243# define instruction_pointer(regs) ((regs)->cr_iip + ia64_psr(regs)->ri)
244
245#define regs_return_value(regs) ((regs)->r8)
246
244/* Conserve space in histogram by encoding slot bits in address 247/* Conserve space in histogram by encoding slot bits in address
245 * bits 2 and 3 rather than bits 0 and 1. 248 * bits 2 and 3 rather than bits 0 and 1.
246 */ 249 */
diff --git a/include/asm-ia64/spinlock.h b/include/asm-ia64/spinlock.h
index 9e83210dc3..ff857e3173 100644
--- a/include/asm-ia64/spinlock.h
+++ b/include/asm-ia64/spinlock.h
@@ -213,4 +213,8 @@ static inline int __raw_read_trylock(raw_rwlock_t *x)
213 return (u32)ia64_cmpxchg4_acq((__u32 *)(x), new.word, old.word) == old.word; 213 return (u32)ia64_cmpxchg4_acq((__u32 *)(x), new.word, old.word) == old.word;
214} 214}
215 215
216#define _raw_spin_relax(lock) cpu_relax()
217#define _raw_read_relax(lock) cpu_relax()
218#define _raw_write_relax(lock) cpu_relax()
219
216#endif /* _ASM_IA64_SPINLOCK_H */ 220#endif /* _ASM_IA64_SPINLOCK_H */
diff --git a/include/asm-ia64/topology.h b/include/asm-ia64/topology.h
index 937c212575..a6e38565ab 100644
--- a/include/asm-ia64/topology.h
+++ b/include/asm-ia64/topology.h
@@ -59,6 +59,7 @@ void build_cpu_to_node_map(void);
59#define SD_CPU_INIT (struct sched_domain) { \ 59#define SD_CPU_INIT (struct sched_domain) { \
60 .span = CPU_MASK_NONE, \ 60 .span = CPU_MASK_NONE, \
61 .parent = NULL, \ 61 .parent = NULL, \
62 .child = NULL, \
62 .groups = NULL, \ 63 .groups = NULL, \
63 .min_interval = 1, \ 64 .min_interval = 1, \
64 .max_interval = 4, \ 65 .max_interval = 4, \
@@ -84,6 +85,7 @@ void build_cpu_to_node_map(void);
84#define SD_NODE_INIT (struct sched_domain) { \ 85#define SD_NODE_INIT (struct sched_domain) { \
85 .span = CPU_MASK_NONE, \ 86 .span = CPU_MASK_NONE, \
86 .parent = NULL, \ 87 .parent = NULL, \
88 .child = NULL, \
87 .groups = NULL, \ 89 .groups = NULL, \
88 .min_interval = 8, \ 90 .min_interval = 8, \
89 .max_interval = 8*(min(num_online_cpus(), 32)), \ 91 .max_interval = 8*(min(num_online_cpus(), 32)), \
diff --git a/include/asm-ia64/unistd.h b/include/asm-ia64/unistd.h
index bb0eb727dc..53c5c0ee12 100644
--- a/include/asm-ia64/unistd.h
+++ b/include/asm-ia64/unistd.h
@@ -319,78 +319,6 @@
319 319
320extern long __ia64_syscall (long a0, long a1, long a2, long a3, long a4, long nr); 320extern long __ia64_syscall (long a0, long a1, long a2, long a3, long a4, long nr);
321 321
322#ifdef __KERNEL_SYSCALLS__
323
324#include <linux/compiler.h>
325#include <linux/string.h>
326#include <linux/signal.h>
327#include <asm/ptrace.h>
328#include <linux/stringify.h>
329#include <linux/syscalls.h>
330
331static inline long
332open (const char * name, int mode, int flags)
333{
334 return sys_open(name, mode, flags);
335}
336
337static inline long
338dup (int fd)
339{
340 return sys_dup(fd);
341}
342
343static inline long
344close (int fd)
345{
346 return sys_close(fd);
347}
348
349static inline off_t
350lseek (int fd, off_t off, int whence)
351{
352 return sys_lseek(fd, off, whence);
353}
354
355static inline void
356_exit (int value)
357{
358 sys_exit(value);
359}
360
361#define exit(x) _exit(x)
362
363static inline long
364write (int fd, const char * buf, size_t nr)
365{
366 return sys_write(fd, buf, nr);
367}
368
369static inline long
370read (int fd, char * buf, size_t nr)
371{
372 return sys_read(fd, buf, nr);
373}
374
375
376static inline long
377setsid (void)
378{
379 return sys_setsid();
380}
381
382static inline pid_t
383waitpid (int pid, int * wait_stat, int flags)
384{
385 return sys_wait4(pid, wait_stat, flags, NULL);
386}
387
388
389extern int execve (const char *filename, char *const av[], char *const ep[]);
390extern pid_t clone (unsigned long flags, void *sp);
391
392#endif /* __KERNEL_SYSCALLS__ */
393
394asmlinkage unsigned long sys_mmap( 322asmlinkage unsigned long sys_mmap(
395 unsigned long addr, unsigned long len, 323 unsigned long addr, unsigned long len,
396 int prot, int flags, 324 int prot, int flags,
diff --git a/include/asm-m32r/m32104ut/m32104ut_pld.h b/include/asm-m32r/m32104ut/m32104ut_pld.h
index 6ba4ddf7dc..cbdbc58914 100644
--- a/include/asm-m32r/m32104ut/m32104ut_pld.h
+++ b/include/asm-m32r/m32104ut/m32104ut_pld.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm/m32104ut/m32104ut_pld.h 2 * include/asm-m32r/m32104ut/m32104ut_pld.h
3 * 3 *
4 * Definitions for Programable Logic Device(PLD) on M32104UT board. 4 * Definitions for Programable Logic Device(PLD) on M32104UT board.
5 * Based on m32700ut_pld.h 5 * Based on m32700ut_pld.h
diff --git a/include/asm-m32r/m32700ut/m32700ut_lan.h b/include/asm-m32r/m32700ut/m32700ut_lan.h
index c050b19e81..f1e47ae1f8 100644
--- a/include/asm-m32r/m32700ut/m32700ut_lan.h
+++ b/include/asm-m32r/m32700ut/m32700ut_lan.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm/m32700ut_lan.h 2 * include/asm-m32r/m32700ut/m32700ut_lan.h
3 * 3 *
4 * M32700UT-LAN board 4 * M32700UT-LAN board
5 * 5 *
diff --git a/include/asm-m32r/m32700ut/m32700ut_lcd.h b/include/asm-m32r/m32700ut/m32700ut_lcd.h
index 4da4e822e2..e41c4aa48b 100644
--- a/include/asm-m32r/m32700ut/m32700ut_lcd.h
+++ b/include/asm-m32r/m32700ut/m32700ut_lcd.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm/m32700ut_lcd.h 2 * include/asm-m32r/m32700ut/m32700ut_lcd.h
3 * 3 *
4 * M32700UT-LCD board 4 * M32700UT-LCD board
5 * 5 *
diff --git a/include/asm-m32r/m32700ut/m32700ut_pld.h b/include/asm-m32r/m32700ut/m32700ut_pld.h
index f35f9159ac..a48c22c978 100644
--- a/include/asm-m32r/m32700ut/m32700ut_pld.h
+++ b/include/asm-m32r/m32700ut/m32700ut_pld.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm/m32700ut/m32700ut_pld.h 2 * include/asm-m32r/m32700ut/m32700ut_pld.h
3 * 3 *
4 * Definitions for Programable Logic Device(PLD) on M32700UT board. 4 * Definitions for Programable Logic Device(PLD) on M32700UT board.
5 * 5 *
diff --git a/include/asm-m32r/mappi2/mappi2_pld.h b/include/asm-m32r/mappi2/mappi2_pld.h
index 01dcdd19db..56a2b12f2b 100644
--- a/include/asm-m32r/mappi2/mappi2_pld.h
+++ b/include/asm-m32r/mappi2/mappi2_pld.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm/mappi2/mappi2_pld.h 2 * include/asm-m32r/mappi2/mappi2_pld.h
3 * 3 *
4 * Definitions for Extended IO Logic on MAPPI2 board. 4 * Definitions for Extended IO Logic on MAPPI2 board.
5 * based on m32700ut_pld.h by 5 * based on m32700ut_pld.h by
diff --git a/include/asm-m32r/mappi3/mappi3_pld.h b/include/asm-m32r/mappi3/mappi3_pld.h
index 031369a7af..92f10defae 100644
--- a/include/asm-m32r/mappi3/mappi3_pld.h
+++ b/include/asm-m32r/mappi3/mappi3_pld.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm/mappi3/mappi3_pld.h 2 * include/asm-m32r/mappi3/mappi3_pld.h
3 * 3 *
4 * Definitions for Extended IO Logic on MAPPI3 board. 4 * Definitions for Extended IO Logic on MAPPI3 board.
5 * based on m32700ut_pld.h 5 * based on m32700ut_pld.h
diff --git a/include/asm-m32r/opsput/opsput_lan.h b/include/asm-m32r/opsput/opsput_lan.h
index 61948296f4..f53e10187c 100644
--- a/include/asm-m32r/opsput/opsput_lan.h
+++ b/include/asm-m32r/opsput/opsput_lan.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm/opsput_lan.h 2 * include/asm-m32r/opsput/opsput_lan.h
3 * 3 *
4 * OPSPUT-LAN board 4 * OPSPUT-LAN board
5 * 5 *
diff --git a/include/asm-m32r/opsput/opsput_lcd.h b/include/asm-m32r/opsput/opsput_lcd.h
index 44cfd7fe2d..99f296e1b6 100644
--- a/include/asm-m32r/opsput/opsput_lcd.h
+++ b/include/asm-m32r/opsput/opsput_lcd.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm/opsput_lcd.h 2 * include/asm-m32r/opsput/opsput_lcd.h
3 * 3 *
4 * OPSPUT-LCD board 4 * OPSPUT-LCD board
5 * 5 *
diff --git a/include/asm-m32r/opsput/opsput_pld.h b/include/asm-m32r/opsput/opsput_pld.h
index 46296fe1ec..a8d6452076 100644
--- a/include/asm-m32r/opsput/opsput_pld.h
+++ b/include/asm-m32r/opsput/opsput_pld.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm/opsput/opsput_pld.h 2 * include/asm-m32r/opsput/opsput_pld.h
3 * 3 *
4 * Definitions for Programable Logic Device(PLD) on OPSPUT board. 4 * Definitions for Programable Logic Device(PLD) on OPSPUT board.
5 * 5 *
diff --git a/include/asm-m32r/pgtable-2level.h b/include/asm-m32r/pgtable-2level.h
index 6a674e3d37..84152760e0 100644
--- a/include/asm-m32r/pgtable-2level.h
+++ b/include/asm-m32r/pgtable-2level.h
@@ -44,7 +44,7 @@ static inline int pgd_present(pgd_t pgd) { return 1; }
44 */ 44 */
45#define set_pte(pteptr, pteval) (*(pteptr) = pteval) 45#define set_pte(pteptr, pteval) (*(pteptr) = pteval)
46#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) 46#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
47#define set_pte_atomic(pteptr, pteval) set_pte(pteptr, pteval) 47
48/* 48/*
49 * (pmds are folded into pgds so this doesnt get actually called, 49 * (pmds are folded into pgds so this doesnt get actually called,
50 * but the define is needed for a generic inline function.) 50 * but the define is needed for a generic inline function.)
diff --git a/include/asm-m32r/spinlock.h b/include/asm-m32r/spinlock.h
index f9f90727a4..f5cfba81ee 100644
--- a/include/asm-m32r/spinlock.h
+++ b/include/asm-m32r/spinlock.h
@@ -316,4 +316,8 @@ static inline int __raw_write_trylock(raw_rwlock_t *lock)
316 return 0; 316 return 0;
317} 317}
318 318
319#define _raw_spin_relax(lock) cpu_relax()
320#define _raw_read_relax(lock) cpu_relax()
321#define _raw_write_relax(lock) cpu_relax()
322
319#endif /* _ASM_M32R_SPINLOCK_H */ 323#endif /* _ASM_M32R_SPINLOCK_H */
diff --git a/include/asm-m32r/timex.h b/include/asm-m32r/timex.h
index e89bfd17db..019441c1d7 100644
--- a/include/asm-m32r/timex.h
+++ b/include/asm-m32r/timex.h
@@ -12,9 +12,6 @@
12 12
13#define CLOCK_TICK_RATE (CONFIG_BUS_CLOCK / CONFIG_TIMER_DIVIDE) 13#define CLOCK_TICK_RATE (CONFIG_BUS_CLOCK / CONFIG_TIMER_DIVIDE)
14#define CLOCK_TICK_FACTOR 20 /* Factor of both 1000000 and CLOCK_TICK_RATE */ 14#define CLOCK_TICK_FACTOR 20 /* Factor of both 1000000 and CLOCK_TICK_RATE */
15#define FINETUNE ((((((long)LATCH * HZ - CLOCK_TICK_RATE) << SHIFT_HZ) * \
16 (1000000/CLOCK_TICK_FACTOR) / (CLOCK_TICK_RATE/CLOCK_TICK_FACTOR)) \
17 << (SHIFT_SCALE-SHIFT_HZ)) / HZ)
18 15
19#ifdef __KERNEL__ 16#ifdef __KERNEL__
20/* 17/*
diff --git a/include/asm-m32r/unistd.h b/include/asm-m32r/unistd.h
index 5c6a9ac6cf..95aa34298d 100644
--- a/include/asm-m32r/unistd.h
+++ b/include/asm-m32r/unistd.h
@@ -424,43 +424,6 @@ __syscall_return(type,__res); \
424#define __ARCH_WANT_SYS_OLDUMOUNT 424#define __ARCH_WANT_SYS_OLDUMOUNT
425#define __ARCH_WANT_SYS_RT_SIGACTION 425#define __ARCH_WANT_SYS_RT_SIGACTION
426 426
427#ifdef __KERNEL_SYSCALLS__
428
429#include <linux/compiler.h>
430#include <linux/types.h>
431#include <linux/linkage.h>
432#include <asm/ptrace.h>
433
434/*
435 * we need this inline - forking from kernel space will result
436 * in NO COPY ON WRITE (!!!), until an execve is executed. This
437 * is no problem, but for the stack. This is handled by not letting
438 * main() use the stack at all after fork(). Thus, no function
439 * calls - which means inline code for fork too, as otherwise we
440 * would use the stack upon exit from 'fork()'.
441 *
442 * Actually only pause and fork are needed inline, so that there
443 * won't be any messing with the stack from main(), but we define
444 * some others too.
445 */
446static __inline__ _syscall3(int,execve,const char *,file,char **,argv,char **,envp)
447
448asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
449 unsigned long prot, unsigned long flags,
450 unsigned long fd, unsigned long pgoff);
451asmlinkage int sys_execve(struct pt_regs regs);
452asmlinkage int sys_clone(struct pt_regs regs);
453asmlinkage int sys_fork(struct pt_regs regs);
454asmlinkage int sys_vfork(struct pt_regs regs);
455asmlinkage int sys_pipe(unsigned long __user *fildes);
456struct sigaction;
457asmlinkage long sys_rt_sigaction(int sig,
458 const struct sigaction __user *act,
459 struct sigaction __user *oact,
460 size_t sigsetsize);
461
462#endif /* __KERNEL_SYSCALLS__ */
463
464/* 427/*
465 * "Conditional" syscalls 428 * "Conditional" syscalls
466 * 429 *
diff --git a/include/asm-m68k/rtc.h b/include/asm-m68k/rtc.h
index 71406fc4e5..5d3e038598 100644
--- a/include/asm-m68k/rtc.h
+++ b/include/asm-m68k/rtc.h
@@ -1,4 +1,4 @@
1/* asm-m68k/rtc.h 1/* include/asm-m68k/rtc.h
2 * 2 *
3 * Copyright Richard Zidlicky 3 * Copyright Richard Zidlicky
4 * implementation details for genrtc/q40rtc driver 4 * implementation details for genrtc/q40rtc driver
diff --git a/include/asm-m68k/unistd.h b/include/asm-m68k/unistd.h
index 751632b904..3ab716f0fc 100644
--- a/include/asm-m68k/unistd.h
+++ b/include/asm-m68k/unistd.h
@@ -409,12 +409,6 @@ __syscall_return(type,__res); \
409#define __ARCH_WANT_SYS_SIGPROCMASK 409#define __ARCH_WANT_SYS_SIGPROCMASK
410#define __ARCH_WANT_SYS_RT_SIGACTION 410#define __ARCH_WANT_SYS_RT_SIGACTION
411 411
412#ifdef __KERNEL_SYSCALLS__
413
414static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp)
415
416#endif /* __KERNEL_SYSCALLS__ */
417
418/* 412/*
419 * "Conditional" syscalls 413 * "Conditional" syscalls
420 * 414 *
diff --git a/include/asm-m68knommu/processor.h b/include/asm-m68knommu/processor.h
index 9d3a1bf412..91cba18acd 100644
--- a/include/asm-m68knommu/processor.h
+++ b/include/asm-m68knommu/processor.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm-m68k/processor.h 2 * include/asm-m68knommu/processor.h
3 * 3 *
4 * Copyright (C) 1995 Hamish Macdonald 4 * Copyright (C) 1995 Hamish Macdonald
5 */ 5 */
diff --git a/include/asm-m68knommu/unistd.h b/include/asm-m68knommu/unistd.h
index 21fdc37c5c..daafb5d43e 100644
--- a/include/asm-m68knommu/unistd.h
+++ b/include/asm-m68knommu/unistd.h
@@ -463,61 +463,6 @@ type name(atype a, btype b, ctype c, dtype d, etype e) \
463#define __ARCH_WANT_SYS_SIGPROCMASK 463#define __ARCH_WANT_SYS_SIGPROCMASK
464#define __ARCH_WANT_SYS_RT_SIGACTION 464#define __ARCH_WANT_SYS_RT_SIGACTION
465 465
466#ifdef __KERNEL_SYSCALLS__
467
468#include <linux/compiler.h>
469#include <linux/interrupt.h>
470#include <linux/types.h>
471
472/*
473 * we need this inline - forking from kernel space will result
474 * in NO COPY ON WRITE (!!!), until an execve is executed. This
475 * is no problem, but for the stack. This is handled by not letting
476 * main() use the stack at all after fork(). Thus, no function
477 * calls - which means inline code for fork too, as otherwise we
478 * would use the stack upon exit from 'fork()'.
479 *
480 * Actually only pause and fork are needed inline, so that there
481 * won't be any messing with the stack from main(), but we define
482 * some others too.
483 */
484#define __NR__exit __NR_exit
485static inline _syscall0(int,pause)
486static inline _syscall0(int,sync)
487static inline _syscall0(pid_t,setsid)
488static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count)
489static inline _syscall3(int,read,int,fd,char *,buf,off_t,count)
490static inline _syscall3(off_t,lseek,int,fd,off_t,offset,int,count)
491static inline _syscall1(int,dup,int,fd)
492static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp)
493static inline _syscall3(int,open,const char *,file,int,flag,int,mode)
494static inline _syscall1(int,close,int,fd)
495static inline _syscall1(int,_exit,int,exitcode)
496static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options)
497static inline _syscall1(int,delete_module,const char *,name)
498
499static inline pid_t wait(int * wait_stat)
500{
501 return waitpid(-1,wait_stat,0);
502}
503asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
504 unsigned long prot, unsigned long flags,
505 unsigned long fd, unsigned long pgoff);
506asmlinkage int sys_execve(char *name, char **argv, char **envp);
507asmlinkage int sys_pipe(unsigned long *fildes);
508struct pt_regs;
509int sys_request_irq(unsigned int,
510 irqreturn_t (*)(int, void *, struct pt_regs *),
511 unsigned long, const char *, void *);
512void sys_free_irq(unsigned int, void *);
513struct sigaction;
514asmlinkage long sys_rt_sigaction(int sig,
515 const struct sigaction __user *act,
516 struct sigaction __user *oact,
517 size_t sigsetsize);
518
519#endif /* __KERNEL_SYSCALLS__ */
520
521/* 466/*
522 * "Conditional" syscalls 467 * "Conditional" syscalls
523 * 468 *
diff --git a/include/asm-mips/bootinfo.h b/include/asm-mips/bootinfo.h
index 78c35ec463..1e5ccdad3b 100644
--- a/include/asm-mips/bootinfo.h
+++ b/include/asm-mips/bootinfo.h
@@ -125,12 +125,6 @@
125#define MACH_MOMENCO_OCELOT_3 4 125#define MACH_MOMENCO_OCELOT_3 4
126 126
127/* 127/*
128 * Valid machtype for group ITE
129 */
130#define MACH_GROUP_ITE 13 /* ITE Semi Eval Boards */
131#define MACH_QED_4N_S01B 0 /* ITE8172 based eval board */
132
133/*
134 * Valid machtype for group PHILIPS 128 * Valid machtype for group PHILIPS
135 */ 129 */
136#define MACH_GROUP_PHILIPS 14 130#define MACH_GROUP_PHILIPS 14
@@ -139,12 +133,6 @@
139#define MACH_PHILIPS_JBS 2 /* JBS */ 133#define MACH_PHILIPS_JBS 2 /* JBS */
140 134
141/* 135/*
142 * Valid machtype for group Globespan
143 */
144#define MACH_GROUP_GLOBESPAN 15 /* Globespan */
145#define MACH_IVR 0 /* IVR eval board */
146
147/*
148 * Valid machtype for group SIBYTE 136 * Valid machtype for group SIBYTE
149 */ 137 */
150#define MACH_GROUP_SIBYTE 16 /* Sibyte / Broadcom */ 138#define MACH_GROUP_SIBYTE 16 /* Sibyte / Broadcom */
diff --git a/include/asm-mips/cacheflush.h b/include/asm-mips/cacheflush.h
index 36416fdfcf..9ab59e2bb2 100644
--- a/include/asm-mips/cacheflush.h
+++ b/include/asm-mips/cacheflush.h
@@ -46,8 +46,6 @@ static inline void flush_dcache_page(struct page *page)
46#define flush_dcache_mmap_lock(mapping) do { } while (0) 46#define flush_dcache_mmap_lock(mapping) do { } while (0)
47#define flush_dcache_mmap_unlock(mapping) do { } while (0) 47#define flush_dcache_mmap_unlock(mapping) do { } while (0)
48 48
49extern void (*__flush_icache_page)(struct vm_area_struct *vma,
50 struct page *page);
51static inline void flush_icache_page(struct vm_area_struct *vma, 49static inline void flush_icache_page(struct vm_area_struct *vma,
52 struct page *page) 50 struct page *page)
53{ 51{
diff --git a/include/asm-mips/galileo-boards/ev96100.h b/include/asm-mips/galileo-boards/ev96100.h
deleted file mode 100644
index 070dfd84a8..0000000000
--- a/include/asm-mips/galileo-boards/ev96100.h
+++ /dev/null
@@ -1,55 +0,0 @@
1/*
2 *
3 */
4#ifndef _MIPS_EV96100_H
5#define _MIPS_EV96100_H
6
7#include <asm/addrspace.h>
8
9/*
10 * GT64120 config space base address
11 */
12#define GT64120_BASE (KSEG1ADDR(0x14000000))
13#define MIPS_GT_BASE GT64120_BASE
14
15/*
16 * PCI Bus allocation
17 */
18#define GT_PCI_MEM_BASE 0x12000000UL
19#define GT_PCI_MEM_SIZE 0x02000000UL
20#define GT_PCI_IO_BASE 0x10000000UL
21#define GT_PCI_IO_SIZE 0x02000000UL
22#define GT_ISA_IO_BASE PCI_IO_BASE
23
24/*
25 * Duart I/O ports.
26 */
27#define EV96100_COM1_BASE_ADDR (0xBD000000 + 0x20)
28#define EV96100_COM2_BASE_ADDR (0xBD000000 + 0x00)
29
30
31/*
32 * EV96100 interrupt controller register base.
33 */
34#define EV96100_ICTRL_REGS_BASE (KSEG1ADDR(0x1f000000))
35
36/*
37 * EV96100 UART register base.
38 */
39#define EV96100_UART0_REGS_BASE EV96100_COM1_BASE_ADDR
40#define EV96100_UART1_REGS_BASE EV96100_COM2_BASE_ADDR
41#define EV96100_BASE_BAUD ( 3686400 / 16 )
42
43
44/*
45 * Because of an error/peculiarity in the Galileo chip, we need to swap the
46 * bytes when running bigendian.
47 */
48#define __GT_READ(ofs) \
49 (*(volatile u32 *)(GT64120_BASE+(ofs)))
50#define __GT_WRITE(ofs, data) \
51 do { *(volatile u32 *)(GT64120_BASE+(ofs)) = (data); } while (0)
52#define GT_READ(ofs) le32_to_cpu(__GT_READ(ofs))
53#define GT_WRITE(ofs, data) __GT_WRITE(ofs, cpu_to_le32(data))
54
55#endif /* !(_MIPS_EV96100_H) */
diff --git a/include/asm-mips/galileo-boards/ev96100int.h b/include/asm-mips/galileo-boards/ev96100int.h
deleted file mode 100644
index c58b16d06d..0000000000
--- a/include/asm-mips/galileo-boards/ev96100int.h
+++ /dev/null
@@ -1,12 +0,0 @@
1/*
2 *
3 */
4#ifndef _MIPS_EV96100INT_H
5#define _MIPS_EV96100INT_H
6
7#define EV96100INT_UART_0 6 /* IP 6 */
8#define EV96100INT_TIMER 7 /* IP 7 */
9
10extern void ev96100int_init(void);
11
12#endif /* !(_MIPS_EV96100_H) */
diff --git a/include/asm-mips/irqflags.h b/include/asm-mips/irqflags.h
index 43ca09a3a3..46bf5de5ac 100644
--- a/include/asm-mips/irqflags.h
+++ b/include/asm-mips/irqflags.h
@@ -213,12 +213,37 @@ static inline int raw_irqs_disabled_flags(unsigned long flags)
213 * Do the CPU's IRQ-state tracing from assembly code. 213 * Do the CPU's IRQ-state tracing from assembly code.
214 */ 214 */
215#ifdef CONFIG_TRACE_IRQFLAGS 215#ifdef CONFIG_TRACE_IRQFLAGS
216/* Reload some registers clobbered by trace_hardirqs_on */
217#ifdef CONFIG_64BIT
218# define TRACE_IRQS_RELOAD_REGS \
219 LONG_L $11, PT_R11(sp); \
220 LONG_L $10, PT_R10(sp); \
221 LONG_L $9, PT_R9(sp); \
222 LONG_L $8, PT_R8(sp); \
223 LONG_L $7, PT_R7(sp); \
224 LONG_L $6, PT_R6(sp); \
225 LONG_L $5, PT_R5(sp); \
226 LONG_L $4, PT_R4(sp); \
227 LONG_L $2, PT_R2(sp)
228#else
229# define TRACE_IRQS_RELOAD_REGS \
230 LONG_L $7, PT_R7(sp); \
231 LONG_L $6, PT_R6(sp); \
232 LONG_L $5, PT_R5(sp); \
233 LONG_L $4, PT_R4(sp); \
234 LONG_L $2, PT_R2(sp)
235#endif
216# define TRACE_IRQS_ON \ 236# define TRACE_IRQS_ON \
237 CLI; /* make sure trace_hardirqs_on() is called in kernel level */ \
217 jal trace_hardirqs_on 238 jal trace_hardirqs_on
239# define TRACE_IRQS_ON_RELOAD \
240 TRACE_IRQS_ON; \
241 TRACE_IRQS_RELOAD_REGS
218# define TRACE_IRQS_OFF \ 242# define TRACE_IRQS_OFF \
219 jal trace_hardirqs_off 243 jal trace_hardirqs_off
220#else 244#else
221# define TRACE_IRQS_ON 245# define TRACE_IRQS_ON
246# define TRACE_IRQS_ON_RELOAD
222# define TRACE_IRQS_OFF 247# define TRACE_IRQS_OFF
223#endif 248#endif
224 249
diff --git a/include/asm-mips/it8172/it8172.h b/include/asm-mips/it8172/it8172.h
deleted file mode 100644
index 8f23af0a1e..0000000000
--- a/include/asm-mips/it8172/it8172.h
+++ /dev/null
@@ -1,348 +0,0 @@
1/*
2 *
3 * BRIEF MODULE DESCRIPTION
4 * IT8172 system controller defines.
5 *
6 * Copyright 2000 MontaVista Software Inc.
7 * Author: MontaVista Software, Inc.
8 * ppopov@mvista.com or source@mvista.com
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 *
15 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
16 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
17 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
18 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
21 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
22 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 * You should have received a copy of the GNU General Public License along
27 * with this program; if not, write to the Free Software Foundation, Inc.,
28 * 675 Mass Ave, Cambridge, MA 02139, USA.
29 */
30
31#ifndef __IT8172__H__
32#define __IT8172__H__
33
34#include <asm/addrspace.h>
35
36#define IT8172_BASE 0x18000000
37#define IT8172_PCI_IO_BASE 0x14000000
38#define IT8172_PCI_MEM_BASE 0x10000000
39
40// System registers offsets from IT8172_BASE
41#define IT_CMFPCR 0x0
42#define IT_DSRR 0x2
43#define IT_PCDCR 0x4
44#define IT_SPLLCR 0x6
45#define IT_CIDR 0x10
46#define IT_CRNR 0x12
47#define IT_CPUTR 0x14
48#define IT_CTCR 0x16
49#define IT_SDPR 0xF0
50
51// Power management register offset from IT8172_PCI_IO_BASE
52// Power Management Device Standby Register
53#define IT_PM_DSR 0x15800
54
55#define IT_PM_DSR_TMR0SB 0x0001
56#define IT_PM_DSR_TMR1SB 0x0002
57#define IT_PM_DSR_CIR0SB 0x0004
58#define IT_PM_DSR_CIR1SB 0x0008
59#define IT_PM_DSR_SCR0SB 0x0010
60#define IT_PM_DSR_SCR1SB 0x0020
61#define IT_PM_DSR_PPSB 0x0040
62#define IT_PM_DSR_I2CSB 0x0080
63#define IT_PM_DSR_UARTSB 0x0100
64#define IT_PM_DSR_IDESB 0x0200
65#define IT_PM_DSR_ACSB 0x0400
66#define IT_PM_DSR_M68KSB 0x0800
67
68// Power Management PCI Device Software Reset Register
69#define IT_PM_PCISR 0x15802
70
71#define IT_PM_PCISR_IDESR 0x0001
72#define IT_PM_PCISR_CDMASR 0x0002
73#define IT_PM_PCISR_USBSR 0x0004
74#define IT_PM_PCISR_DMASR 0x0008
75#define IT_PM_PCISR_ACSR 0x0010
76#define IT_PM_PCISR_MEMSR 0x0020
77#define IT_PM_PCISR_68KSR 0x0040
78
79
80// PCI Configuration address and data register offsets
81// from IT8172_BASE
82#define IT_CONFADDR 0x4000
83#define IT_BUSNUM_SHF 16
84#define IT_DEVNUM_SHF 11
85#define IT_FUNCNUM_SHF 8
86#define IT_REGNUM_SHF 2
87
88#define IT_CONFDATA 0x4004
89
90// PCI configuration header common register offsets
91#define IT_VID 0x00
92#define IT_DID 0x02
93#define IT_PCICMD 0x04
94#define IT_PCISTS 0x06
95#define IT_RID 0x08
96#define IT_CLASSC 0x09
97#define IT_HEADT 0x0E
98#define IT_SERIRQC 0x49
99
100// PCI to Internal/LPC Bus Bridge configuration header register offset
101#define IT_P2I_BCR 0x4C
102#define IT_P2I_D0IOSC 0x50
103#define IT_P2I_D1IOSC 0x54
104#define IT_P2I_D2IOSC 0x58
105#define IT_P2I_D3IOSC 0x5C
106#define IT_P2I_D4IOSC 0x60
107#define IT_P2I_D5IOSC 0x64
108#define IT_P2I_D6IOSC 0x68
109#define IT_P2I_D7IOSC 0x6C
110#define IT_P2I_D8IOSC 0x70
111#define IT_P2I_D9IOSC 0x74
112#define IT_P2I_D10IOSC 0x78
113#define IT_P2I_D11IOSC 0x7C
114
115// Memory controller register offsets from IT8172_BASE
116#define IT_MC_SDRMR 0x1000
117#define IT_MC_SDRTR 0x1004
118#define IT_MC_MCR 0x1008
119#define IT_MC_SDTYPE 0x100C
120#define IT_MC_WPBA 0x1010
121#define IT_MC_WPTA 0x1014
122#define IT_MC_HATR 0x1018
123#define IT_MC_PCICR 0x101C
124
125// Flash/ROM control register offsets from IT8172_BASE
126#define IT_FC_BRCR 0x2000
127#define IT_FC_FCR 0x2004
128#define IT_FC_DCR 0x2008
129
130// M68K interface bridge configuration header register offset
131#define IT_M68K_MBCSR 0x54
132#define IT_M68K_TMR 0x58
133#define IT_M68K_BCR 0x5C
134#define IT_M68K_BSR 0x5D
135#define IT_M68K_DTR 0x5F
136
137// Register offset from IT8172_PCI_IO_BASE
138// These registers are accessible through 8172 PCI IO window.
139
140// INTC
141#define IT_INTC_BASE 0x10000
142#define IT_INTC_LBDNIRR 0x10000
143#define IT_INTC_LBDNIMR 0x10002
144#define IT_INTC_LBDNITR 0x10004
145#define IT_INTC_LBDNIAR 0x10006
146#define IT_INTC_LPCNIRR 0x10010
147#define IT_INTC_LPCNIMR 0x10012
148#define IT_INTC_LPCNITR 0x10014
149#define IT_INTC_LPCNIAR 0x10016
150#define IT_INTC_PDNIRR 0x10020
151#define IT_INTC_PDNIMR 0x10022
152#define IT_INTC_PDNITR 0x10024
153#define IT_INTC_PDNIAR 0x10026
154#define IT_INTC_UMNIRR 0x10030
155#define IT_INTC_UMNITR 0x10034
156#define IT_INTC_UMNIAR 0x10036
157#define IT_INTC_TYPER 0x107FE
158
159// IT8172 PCI device number
160#define IT_C2P_DEVICE 0
161#define IT_AUDIO_DEVICE 1
162#define IT_DMAC_DEVICE 1
163#define IT_CDMAC_DEVICE 1
164#define IT_USB_DEVICE 1
165#define IT_P2I_DEVICE 1
166#define IT_IDE_DEVICE 1
167#define IT_M68K_DEVICE 1
168
169// IT8172 PCI function number
170#define IT_C2P_FUNCION 0
171#define IT_AUDIO_FUNCTION 0
172#define IT_DMAC_FUNCTION 1
173#define IT_CDMAC_FUNCTION 2
174#define IT_USB_FUNCTION 3
175#define IT_P2I_FUNCTION 4
176#define IT_IDE_FUNCTION 5
177#define IT_M68K_FUNCTION 6
178
179// IT8172 GPIO
180#define IT_GPADR 0x13800
181#define IT_GPBDR 0x13808
182#define IT_GPCDR 0x13810
183#define IT_GPACR 0x13802
184#define IT_GPBCR 0x1380A
185#define IT_GPCCR 0x13812
186#define IT_GPAICR 0x13804
187#define IT_GPBICR 0x1380C
188#define IT_GPCICR 0x13814
189#define IT_GPAISR 0x13806
190#define IT_GPBISR 0x1380E
191#define IT_GPCISR 0x13816
192#define IT_GCR 0x13818
193
194// IT8172 RTC
195#define IT_RTC_BASE 0x14800
196#define IT_RTC_CENTURY 0x14808
197
198#define IT_RTC_RIR0 0x00
199#define IT_RTC_RTR0 0x01
200#define IT_RTC_RIR1 0x02
201#define IT_RTC_RTR1 0x03
202#define IT_RTC_RIR2 0x04
203#define IT_RTC_RTR2 0x05
204#define IT_RTC_RCTR 0x08
205#define IT_RTC_RA 0x0A
206#define IT_RTC_RB 0x0B
207#define IT_RTC_RC 0x0C
208#define IT_RTC_RD 0x0D
209
210#define RTC_SEC_INDEX 0x00
211#define RTC_MIN_INDEX 0x02
212#define RTC_HOUR_INDEX 0x04
213#define RTC_DAY_INDEX 0x06
214#define RTC_DATE_INDEX 0x07
215#define RTC_MONTH_INDEX 0x08
216#define RTC_YEAR_INDEX 0x09
217
218// IT8172 internal device registers
219#define IT_TIMER_BASE 0x10800
220#define IT_CIR0_BASE 0x11000
221#define IT_UART_BASE 0x11800
222#define IT_SCR0_BASE 0x12000
223#define IT_SCR1_BASE 0x12800
224#define IT_PP_BASE 0x13000
225#define IT_I2C_BASE 0x14000
226#define IT_CIR1_BASE 0x15000
227
228// IT8172 Smart Card Reader offsets from IT_SCR*_BASE
229#define IT_SCR_SFR 0x08
230#define IT_SCR_SCDR 0x09
231
232// IT8172 IT_SCR_SFR bit definition & mask
233#define IT_SCR_SFR_GATE_UART 0x40
234#define IT_SCR_SFR_GATE_UART_BIT 6
235#define IT_SCR_SFR_GATE_UART_OFF 0
236#define IT_SCR_SFR_GATE_UART_ON 1
237#define IT_SCR_SFR_FET_CHARGE 0x30
238#define IT_SCR_SFR_FET_CHARGE_BIT 4
239#define IT_SCR_SFR_FET_CHARGE_3_3_US 3
240#define IT_SCR_SFR_FET_CHARGE_13_US 2
241#define IT_SCR_SFR_FET_CHARGE_53_US 1
242#define IT_SCR_SFR_FET_CHARGE_213_US 0
243#define IT_SCR_SFR_CARD_FREQ 0x0C
244#define IT_SCR_SFR_CARD_FREQ_BIT 2
245#define IT_SCR_SFR_CARD_FREQ_STOP 3
246#define IT_SCR_SFR_CARD_FREQ_3_5_MHZ 0
247#define IT_SCR_SFR_CARD_FREQ_7_1_MHZ 2
248#define IT_SCR_SFR_CARD_FREQ_96_DIV_MHZ 1
249#define IT_SCR_SFR_FET_ACTIVE 0x02
250#define IT_SCR_SFR_FET_ACTIVE_BIT 1
251#define IT_SCR_SFR_FET_ACTIVE_INVERT 0
252#define IT_SCR_SFR_FET_ACTIVE_NONINVERT 1
253#define IT_SCR_SFR_ENABLE 0x01
254#define IT_SCR_SFR_ENABLE_BIT 0
255#define IT_SCR_SFR_ENABLE_OFF 0
256#define IT_SCR_SFR_ENABLE_ON 1
257
258// IT8172 IT_SCR_SCDR bit definition & mask
259#define IT_SCR_SCDR_RESET_MODE 0x80
260#define IT_SCR_SCDR_RESET_MODE_BIT 7
261#define IT_SCR_SCDR_RESET_MODE_ASYNC 0
262#define IT_SCR_SCDR_RESET_MODE_SYNC 1
263#define IT_SCR_SCDR_DIVISOR 0x7F
264#define IT_SCR_SCDR_DIVISOR_BIT 0
265#define IT_SCR_SCDR_DIVISOR_STOP_VAL_1 0x00
266#define IT_SCR_SCDR_DIVISOR_STOP_VAL_2 0x01
267#define IT_SCR_SCDR_DIVISOR_STOP_VAL_3 0x7F
268
269// IT8172 DMA
270#define IT_DMAC_BASE 0x16000
271#define IT_DMAC_BCAR0 0x00
272#define IT_DMAC_BCAR1 0x04
273#define IT_DMAC_BCAR2 0x08
274#define IT_DMAC_BCAR3 0x0C
275#define IT_DMAC_BCCR0 0x02
276#define IT_DMAC_BCCR1 0x06
277#define IT_DMAC_BCCR2 0x0a
278#define IT_DMAC_BCCR3 0x0e
279#define IT_DMAC_CR 0x10
280#define IT_DMAC_SR 0x12
281#define IT_DMAC_ESR 0x13
282#define IT_DMAC_RQR 0x14
283#define IT_DMAC_MR 0x16
284#define IT_DMAC_EMR 0x17
285#define IT_DMAC_MKR 0x18
286#define IT_DMAC_PAR0 0x20
287#define IT_DMAC_PAR1 0x22
288#define IT_DMAC_PAR2 0x24
289#define IT_DMAC_PAR3 0x26
290
291// IT8172 IDE
292#define IT_IDE_BASE 0x17800
293#define IT_IDE_STATUS 0x1F7
294
295// IT8172 Audio Controller
296#define IT_AC_BASE 0x17000
297#define IT_AC_PCMOV 0x00
298#define IT_AC_FMOV 0x02
299#define IT_AC_I2SV 0x04
300#define IT_AC_DRSS 0x06
301#define IT_AC_PCC 0x08
302#define IT_AC_PCDL 0x0A
303#define IT_AC_PCB1STA 0x0C
304#define IT_AC_PCB2STA 0x10
305#define IT_AC_CAPCC 0x14
306#define IT_AC_CAPCDL 0x16
307#define IT_AC_CAPB1STA 0x18
308#define IT_AC_CAPB2STA 0x1C
309#define IT_AC_CODECC 0x22
310#define IT_AC_I2SMC 0x24
311#define IT_AC_VS 0x26
312#define IT_AC_SRCS 0x28
313#define IT_AC_CIRCP 0x2A
314#define IT_AC_CIRDP 0x2C
315#define IT_AC_TM 0x4A
316#define IT_AC_PFDP 0x4C
317#define IT_AC_GC 0x54
318#define IT_AC_IMC 0x56
319#define IT_AC_ISC 0x5B
320#define IT_AC_OPL3SR 0x68
321#define IT_AC_OPL3DWDR 0x69
322#define IT_AC_OPL3AB1W 0x6A
323#define IT_AC_OPL3DW 0x6B
324#define IT_AC_BPDC 0x70
325
326
327// IT8172 Timer
328#define IT_TIMER_BASE 0x10800
329#define TIMER_TCVR0 0x00
330#define TIMER_TRVR0 0x02
331#define TIMER_TCR0 0x04
332#define TIMER_TIRR 0x06
333#define TIMER_TCVR1 0x08
334#define TIMER_TRVR1 0x0A
335#define TIMER_TCR1 0x0C
336#define TIMER_TIDR 0x0E
337
338
339#define IT_WRITE(ofs, data) *(volatile u32 *)KSEG1ADDR((IT8172_BASE+ofs)) = data
340#define IT_READ(ofs, data) data = *(volatile u32 *)KSEG1ADDR((IT8172_BASE+ofs))
341
342#define IT_IO_WRITE(ofs, data) *(volatile u32 *)KSEG1ADDR((IT8172_PCI_IO_BASE+ofs)) = data
343#define IT_IO_READ(ofs, data) data = *(volatile u32 *)KSEG1ADDR((IT8172_PCI_IO_BASE+ofs))
344
345#define IT_IO_WRITE16(ofs, data) *(volatile u16 *)KSEG1ADDR((IT8172_PCI_IO_BASE+ofs)) = data
346#define IT_IO_READ16(ofs, data) data = *(volatile u16 *)KSEG1ADDR((IT8172_PCI_IO_BASE+ofs))
347
348#endif
diff --git a/include/asm-mips/it8172/it8172_cir.h b/include/asm-mips/it8172/it8172_cir.h
deleted file mode 100644
index 6a1dbd29f6..0000000000
--- a/include/asm-mips/it8172/it8172_cir.h
+++ /dev/null
@@ -1,140 +0,0 @@
1/*
2 *
3 * BRIEF MODULE DESCRIPTION
4 * IT8172 Consumer IR port defines.
5 *
6 * Copyright 2001 MontaVista Software Inc.
7 * Author: MontaVista Software, Inc.
8 * ppopov@mvista.com or source@mvista.com
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 *
15 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
16 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
17 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
18 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
21 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
22 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 * You should have received a copy of the GNU General Public License along
27 * with this program; if not, write to the Free Software Foundation, Inc.,
28 * 675 Mass Ave, Cambridge, MA 02139, USA.
29 */
30
31#define NUM_CIR_PORTS 2
32
33/* Master Control Register */
34#define CIR_RESET 0x1
35#define CIR_FIFO_CLEAR 0x2
36#define CIR_SET_FIFO_TL(x) (((x)&0x3)<<2)
37#define CIR_ILE 0x10
38#define CIR_ILSEL 0x20
39
40/* Interrupt Enable Register */
41#define CIR_TLDLIE 0x1
42#define CIR_RDAIE 0x2
43#define CIR_RFOIE 0x4
44#define CIR_IEC 0x80
45
46/* Interrupt Identification Register */
47#define CIR_TLDLI 0x1
48#define CIR_RDAI 0x2
49#define CIR_RFOI 0x4
50#define CIR_NIP 0x80
51
52/* Carrier Frequency Register */
53#define CIR_SET_CF(x) ((x)&0x1f)
54 #define CFQ_38_480 0xB /* 38 KHz low, 480 KHz high */
55#define CIR_HCFS 0x20
56 #define CIR_SET_HS(x) (((x)&0x1)<<5)
57
58
59/* Receiver Control Register */
60#define CIR_SET_RXDCR(x) ((x)&0x7)
61#define CIR_RXACT 0x8
62#define CIR_RXEND 0x10
63#define CIR_RDWOS 0x20
64 #define CIR_SET_RDWOS(x) (((x)&0x1)<<5)
65#define CIR_RXEN 0x80
66
67/* Transmitter Control Register */
68#define CIR_SET_TXMPW(x) ((x)&0x7)
69#define CIR_SET_TXMPM(x) (((x)&0x3)<<3)
70#define CIR_TXENDF 0x20
71#define CIR_TXRLE 0x40
72
73/* Receiver FIFO Status Register */
74#define CIR_RXFBC_MASK 0x3f
75#define CIR_RXFTO 0x80
76
77/* Wakeup Code Length Register */
78#define CIR_SET_WCL ((x)&0x3f)
79#define CIR_WCL_MASK(x) ((x)&0x3f)
80
81/* Wakeup Power Control/Status Register */
82#define CIR_BTMON 0x2
83#define CIR_CIRON 0x4
84#define CIR_RCRST 0x10
85#define CIR_WCRST 0x20
86
87struct cir_port {
88 int port;
89 unsigned short baud_rate;
90 unsigned char fifo_tl;
91 unsigned char cfq;
92 unsigned char hcfs;
93 unsigned char rdwos;
94 unsigned char rxdcr;
95};
96
97struct it8172_cir_regs {
98 unsigned char dr; /* data */
99 char pad;
100 unsigned char mstcr; /* master control */
101 char pad1;
102 unsigned char ier; /* interrupt enable */
103 char pad2;
104 unsigned char iir; /* interrupt identification */
105 char pad3;
106 unsigned char cfr; /* carrier frequency */
107 char pad4;
108 unsigned char rcr; /* receiver control */
109 char pad5;
110 unsigned char tcr; /* transmitter control */
111 char pad6;
112 char pad7;
113 char pad8;
114 unsigned char bdlr; /* baud rate divisor low byte */
115 char pad9;
116 unsigned char bdhr; /* baud rate divisor high byte */
117 char pad10;
118 unsigned char tfsr; /* tx fifo byte count */
119 char pad11;
120 unsigned char rfsr; /* rx fifo status */
121 char pad12;
122 unsigned char wcl; /* wakeup code length */
123 char pad13;
124 unsigned char wcr; /* wakeup code read/write */
125 char pad14;
126 unsigned char wps; /* wakeup power control/status */
127};
128
129int cir_port_init(struct cir_port *cir);
130extern void clear_fifo(struct cir_port *cir);
131extern void enable_receiver(struct cir_port *cir);
132extern void disable_receiver(struct cir_port *cir);
133extern void enable_rx_demodulation(struct cir_port *cir);
134extern void disable_rx_demodulation(struct cir_port *cir);
135extern void set_rx_active(struct cir_port *cir);
136extern void int_enable(struct cir_port *cir);
137extern void rx_int_enable(struct cir_port *cir);
138extern char get_int_status(struct cir_port *cir);
139extern int cir_get_rx_count(struct cir_port *cir);
140extern char cir_read_data(struct cir_port *cir);
diff --git a/include/asm-mips/it8172/it8172_dbg.h b/include/asm-mips/it8172/it8172_dbg.h
deleted file mode 100644
index f404ec7c03..0000000000
--- a/include/asm-mips/it8172/it8172_dbg.h
+++ /dev/null
@@ -1,38 +0,0 @@
1/*
2 *
3 * BRIEF MODULE DESCRIPTION
4 * Function prototypes for low level uart routines to
5 * directly access a 16550 uart.
6 *
7 * Copyright 2000 MontaVista Software Inc.
8 * Author: MontaVista Software, Inc.
9 * ppopov@mvista.com or source@mvista.com
10 *
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the
13 * Free Software Foundation; either version 2 of the License, or (at your
14 * option) any later version.
15 *
16 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
19 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
22 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
23 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 *
27 * You should have received a copy of the GNU General Public License along
28 * with this program; if not, write to the Free Software Foundation, Inc.,
29 * 675 Mass Ave, Cambridge, MA 02139, USA.
30 */
31
32#include <linux/types.h>
33
34extern void putch(const unsigned char c);
35extern void puts(unsigned char *cp);
36extern void fputs(unsigned char *cp);
37extern void put64(uint64_t ul);
38extern void put32(unsigned u);
diff --git a/include/asm-mips/it8172/it8172_int.h b/include/asm-mips/it8172/it8172_int.h
deleted file mode 100644
index 837e83ac25..0000000000
--- a/include/asm-mips/it8172/it8172_int.h
+++ /dev/null
@@ -1,144 +0,0 @@
1/*
2 *
3 * BRIEF MODULE DESCRIPTION
4 * ITE 8172 Interrupt Numbering
5 *
6 * Copyright 2000 MontaVista Software Inc.
7 * Author: MontaVista Software, Inc.
8 * ppopov@mvista.com or source@mvista.com
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 *
15 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
16 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
17 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
18 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
21 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
22 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 * You should have received a copy of the GNU General Public License along
27 * with this program; if not, write to the Free Software Foundation, Inc.,
28 * 675 Mass Ave, Cambridge, MA 02139, USA.
29 */
30
31#ifndef _MIPS_ITEINT_H
32#define _MIPS_ITEINT_H
33
34/*
35 * Here's the "strategy":
36 * We number the LPC serial irqs from 0 to 15,
37 * the local bus irqs from 16 to 31,
38 * the pci dev register interrupts from 32 to 47,
39 * and the non-maskable ints from 48 to 53.
40 */
41
42#define IT8172_LPC_IRQ_BASE 0 /* first LPC int number */
43#define IT8172_SERIRQ_0 (IT8172_LPC_IRQ_BASE + 0)
44#define IT8172_SERIRQ_1 (IT8172_LPC_IRQ_BASE + 1)
45#define IT8172_SERIRQ_2 (IT8172_LPC_IRQ_BASE + 2)
46#define IT8172_SERIRQ_3 (IT8172_LPC_IRQ_BASE + 3)
47#define IT8172_SERIRQ_4 (IT8172_LPC_IRQ_BASE + 4)
48#define IT8172_SERIRQ_5 (IT8172_LPC_IRQ_BASE + 5)
49#define IT8172_SERIRQ_6 (IT8172_LPC_IRQ_BASE + 6)
50#define IT8172_SERIRQ_7 (IT8172_LPC_IRQ_BASE + 7)
51#define IT8172_SERIRQ_8 (IT8172_LPC_IRQ_BASE + 8)
52#define IT8172_SERIRQ_9 (IT8172_LPC_IRQ_BASE + 9)
53#define IT8172_SERIRQ_10 (IT8172_LPC_IRQ_BASE + 10)
54#define IT8172_SERIRQ_11 (IT8172_LPC_IRQ_BASE + 11)
55#define IT8172_SERIRQ_12 (IT8172_LPC_IRQ_BASE + 12)
56#define IT8172_SERIRQ_13 (IT8172_LPC_IRQ_BASE + 13)
57#define IT8172_SERIRQ_14 (IT8172_LPC_IRQ_BASE + 14)
58#define IT8172_SERIRQ_15 (IT8172_LPC_IRQ_BASE + 15)
59
60#define IT8172_LB_IRQ_BASE 16 /* first local bus int number */
61#define IT8172_PPR_IRQ (IT8172_LB_IRQ_BASE + 0) /* parallel port */
62#define IT8172_TIMER0_IRQ (IT8172_LB_IRQ_BASE + 1)
63#define IT8172_TIMER1_IRQ (IT8172_LB_IRQ_BASE + 2)
64#define IT8172_I2C_IRQ (IT8172_LB_IRQ_BASE + 3)
65#define IT8172_GPIO_IRQ (IT8172_LB_IRQ_BASE + 4)
66#define IT8172_CIR0_IRQ (IT8172_LB_IRQ_BASE + 5)
67#define IT8172_CIR1_IRQ (IT8172_LB_IRQ_BASE + 6)
68#define IT8172_UART_IRQ (IT8172_LB_IRQ_BASE + 7)
69#define IT8172_SCR0_IRQ (IT8172_LB_IRQ_BASE + 8)
70#define IT8172_SCR1_IRQ (IT8172_LB_IRQ_BASE + 9)
71#define IT8172_RTC_IRQ (IT8172_LB_IRQ_BASE + 10)
72#define IT8172_IOCHK_IRQ (IT8172_LB_IRQ_BASE + 11)
73/* 12 - 15 reserved */
74
75/*
76 * Note here that the pci dev registers includes bits for more than
77 * just the pci devices.
78 */
79#define IT8172_PCI_DEV_IRQ_BASE 32 /* first pci dev irq */
80#define IT8172_AC97_IRQ (IT8172_PCI_DEV_IRQ_BASE + 0)
81#define IT8172_MC68K_IRQ (IT8172_PCI_DEV_IRQ_BASE + 1)
82#define IT8172_IDE_IRQ (IT8172_PCI_DEV_IRQ_BASE + 2)
83#define IT8172_USB_IRQ (IT8172_PCI_DEV_IRQ_BASE + 3)
84#define IT8172_BRIDGE_MASTER_IRQ (IT8172_PCI_DEV_IRQ_BASE + 4)
85#define IT8172_BRIDGE_TARGET_IRQ (IT8172_PCI_DEV_IRQ_BASE + 5)
86#define IT8172_PCI_INTA_IRQ (IT8172_PCI_DEV_IRQ_BASE + 6)
87#define IT8172_PCI_INTB_IRQ (IT8172_PCI_DEV_IRQ_BASE + 7)
88#define IT8172_PCI_INTC_IRQ (IT8172_PCI_DEV_IRQ_BASE + 8)
89#define IT8172_PCI_INTD_IRQ (IT8172_PCI_DEV_IRQ_BASE + 9)
90#define IT8172_S_INTA_IRQ (IT8172_PCI_DEV_IRQ_BASE + 10)
91#define IT8172_S_INTB_IRQ (IT8172_PCI_DEV_IRQ_BASE + 11)
92#define IT8172_S_INTC_IRQ (IT8172_PCI_DEV_IRQ_BASE + 12)
93#define IT8172_S_INTD_IRQ (IT8172_PCI_DEV_IRQ_BASE + 13)
94#define IT8172_CDMA_IRQ (IT8172_PCI_DEV_IRQ_BASE + 14)
95#define IT8172_DMA_IRQ (IT8172_PCI_DEV_IRQ_BASE + 15)
96
97#define IT8172_NMI_IRQ_BASE 48
98#define IT8172_SER_NMI_IRQ (IT8172_NMI_IRQ_BASE + 0)
99#define IT8172_PCI_NMI_IRQ (IT8172_NMI_IRQ_BASE + 1)
100#define IT8172_RTC_NMI_IRQ (IT8172_NMI_IRQ_BASE + 2)
101#define IT8172_CPUIF_NMI_IRQ (IT8172_NMI_IRQ_BASE + 3)
102#define IT8172_PMER_NMI_IRQ (IT8172_NMI_IRQ_BASE + 4)
103#define IT8172_POWER_NMI_IRQ (IT8172_NMI_IRQ_BASE + 5)
104
105#define IT8172_LAST_IRQ (IT8172_POWER_NMI_IRQ)
106/* Finally, let's move over here the mips cpu timer interrupt.
107 */
108#define MIPS_CPU_TIMER_IRQ (NR_IRQS-1)
109
110/*
111 * IT8172 Interrupt Controller Registers
112 */
113struct it8172_intc_regs {
114 volatile unsigned short lb_req; /* offset 0 */
115 volatile unsigned short lb_mask;
116 volatile unsigned short lb_trigger;
117 volatile unsigned short lb_level;
118 unsigned char pad0[8];
119
120 volatile unsigned short lpc_req; /* offset 0x10 */
121 volatile unsigned short lpc_mask;
122 volatile unsigned short lpc_trigger;
123 volatile unsigned short lpc_level;
124 unsigned char pad1[8];
125
126 volatile unsigned short pci_req; /* offset 0x20 */
127 volatile unsigned short pci_mask;
128 volatile unsigned short pci_trigger;
129 volatile unsigned short pci_level;
130 unsigned char pad2[8];
131
132 volatile unsigned short nmi_req; /* offset 0x30 */
133 volatile unsigned short nmi_mask;
134 volatile unsigned short nmi_trigger;
135 volatile unsigned short nmi_level;
136 unsigned char pad3[6];
137
138 volatile unsigned short nmi_redir; /* offset 0x3E */
139 unsigned char pad4[0xBE];
140
141 volatile unsigned short intstatus; /* offset 0xFE */
142};
143
144#endif /* _MIPS_ITEINT_H */
diff --git a/include/asm-mips/it8172/it8172_pci.h b/include/asm-mips/it8172/it8172_pci.h
deleted file mode 100644
index 42c61f56ee..0000000000
--- a/include/asm-mips/it8172/it8172_pci.h
+++ /dev/null
@@ -1,108 +0,0 @@
1/*
2 *
3 * BRIEF MODULE DESCRIPTION
4 * IT8172 system controller specific pci defines.
5 *
6 * Copyright 2000 MontaVista Software Inc.
7 * Author: MontaVista Software, Inc.
8 * ppopov@mvista.com or source@mvista.com
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 *
15 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
16 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
17 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
18 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
21 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
22 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 * You should have received a copy of the GNU General Public License along
27 * with this program; if not, write to the Free Software Foundation, Inc.,
28 * 675 Mass Ave, Cambridge, MA 02139, USA.
29 */
30
31#ifndef _8172PCI_H_
32#define _8172PCI_H_
33
34// PCI configuration space Type0
35#define PCI_IDREG 0x00
36#define PCI_CMDSTSREG 0x04
37#define PCI_CLASSREG 0x08
38#define PCI_BHLCREG 0x0C
39#define PCI_BASE1REG 0x10
40#define PCI_BASE2REG 0x14
41#define PCI_BASE3REG 0x18
42#define PCI_BASE4REG 0x1C
43#define PCI_BASE5REG 0x20
44#define PCI_BASE6REG 0x24
45#define PCI_ROMBASEREG 0x30
46#define PCI_INTRREG 0x3C
47
48// PCI configuration space Type1
49#define PCI_BUSNOREG 0x18
50
51#define IT_PCI_VENDORID(x) ((x) & 0xFFFF)
52#define IT_PCI_DEVICEID(x) (((x)>>16) & 0xFFFF)
53
54// Command register
55#define PCI_CMD_IOEN 0x00000001
56#define PCI_CMD_MEMEN 0x00000002
57#define PCI_CMD_BUSMASTER 0x00000004
58#define PCI_CMD_SPCYCLE 0x00000008
59#define PCI_CMD_WRINV 0x00000010
60#define PCI_CMD_VGASNOOP 0x00000020
61#define PCI_CMD_PERR 0x00000040
62#define PCI_CMD_WAITCTRL 0x00000080
63#define PCI_CMD_SERR 0x00000100
64#define PCI_CMD_FAST_BACKTOBACK 0x00000200
65
66// Status register
67#define PCI_STS_66MHZ 0x00200000
68#define PCI_STS_SUPPORT_UDF 0x00400000
69#define PCI_STS_FAST_BACKTOBACK 0x00800000
70#define PCI_STS_DATA_PERR 0x01000000
71#define PCI_STS_DEVSEL0 0x02000000
72#define PCI_STS_DEVSEL1 0x04000000
73#define PCI_STS_SIG_TGTABORT 0x08000000
74#define PCI_STS_RCV_TGTABORT 0x10000000
75#define PCI_STS_RCV_MSTABORT 0x20000000
76#define PCI_STS_SYSERR 0x40000000
77#define PCI_STS_DETCT_PERR 0x80000000
78
79#define IT_PCI_CLASS(x) (((x)>>24) & 0xFF)
80#define IT_PCI_SUBCLASS(x) (((x)>>16) & 0xFF)
81#define IT_PCI_INTERFACE(x) (((x)>>8) & 0xFF)
82#define IT_PCI_REVISION(x) ((x) & 0xFF)
83
84// PCI class code
85#define PCI_CLASS_BRIDGE 0x06
86
87// bridge subclass
88#define PCI_SUBCLASS_BRIDGE_HOST 0x00
89#define PCI_SUBCLASS_BRIDGE_PCI 0x04
90
91// BHLCREG
92#define IT_PCI_BIST(x) (((x)>>24) & 0xFF)
93#define IT_PCI_HEADERTYPE(x) (((x)>>16) & 0xFF)
94#define IT_PCI_LATENCYTIMER(x) (((x)>>8) & 0xFF)
95#define IT_PCI_CACHELINESIZE(x) ((x) & 0xFF)
96
97#define PCI_MULTIFUNC 0x80
98
99// INTRREG
100#define IT_PCI_MAXLAT(x) (((x)>>24) & 0xFF)
101#define IT_PCI_MINGNT(x) (((x)>>16) & 0xFF)
102#define IT_PCI_INTRPIN(x) (((x)>>8) & 0xFF)
103#define IT_PCI_INTRLINE(x) ((x) & 0xFF)
104
105#define PCI_VENDOR_NEC 0x1033
106#define PCI_VENDOR_DEC 0x1101
107
108#endif // _8172PCI_H_
diff --git a/include/asm-mips/it8712.h b/include/asm-mips/it8712.h
deleted file mode 100644
index ca2dee02a0..0000000000
--- a/include/asm-mips/it8712.h
+++ /dev/null
@@ -1,28 +0,0 @@
1
2#ifndef __IT8712_H__
3#define __IT8712_H__
4
5#define LPC_BASE_ADDR 0x14000000
6
7// MB PnP configuration register
8#define LPC_KEY_ADDR 0x1400002E
9#define LPC_DATA_ADDR 0x1400002F
10
11// Device LDN
12#define LDN_SERIAL1 0x01
13#define LDN_SERIAL2 0x02
14#define LDN_PARALLEL 0x03
15#define LDN_KEYBOARD 0x05
16#define LDN_MOUSE 0x06
17
18#define IT8712_UART1_PORT 0x3F8
19#define IT8712_UART2_PORT 0x2F8
20
21#ifndef ASM_ONLY
22
23void LPCSetConfig(char LdnNumber, char Index, char data);
24char LPCGetConfig(char LdnNumber, char Index);
25
26#endif
27
28#endif
diff --git a/include/asm-mips/mach-ev64120/mach-gt64120.h b/include/asm-mips/mach-ev64120/mach-gt64120.h
index 13b1443a7a..7e272ce57e 100644
--- a/include/asm-mips/mach-ev64120/mach-gt64120.h
+++ b/include/asm-mips/mach-ev64120/mach-gt64120.h
@@ -42,6 +42,7 @@ extern unsigned long gt64120_base;
42#define EV64120_UART0_REGS_BASE (KSEG1ADDR(EV64120_COM1_BASE_ADDR)) 42#define EV64120_UART0_REGS_BASE (KSEG1ADDR(EV64120_COM1_BASE_ADDR))
43#define EV64120_UART1_REGS_BASE (KSEG1ADDR(EV64120_COM2_BASE_ADDR)) 43#define EV64120_UART1_REGS_BASE (KSEG1ADDR(EV64120_COM2_BASE_ADDR))
44#define EV64120_BASE_BAUD ( 3686400 / 16 ) 44#define EV64120_BASE_BAUD ( 3686400 / 16 )
45#define EV64120_UART_IRQ 6
45 46
46/* 47/*
47 * PCI interrupts will come in on either the INTA or INTD interrups lines, 48 * PCI interrupts will come in on either the INTA or INTD interrups lines,
diff --git a/include/asm-mips/mach-ip27/topology.h b/include/asm-mips/mach-ip27/topology.h
index 59d26b52ba..a13b715fd9 100644
--- a/include/asm-mips/mach-ip27/topology.h
+++ b/include/asm-mips/mach-ip27/topology.h
@@ -22,6 +22,7 @@ extern unsigned char __node_distances[MAX_COMPACT_NODES][MAX_COMPACT_NODES];
22#define SD_NODE_INIT (struct sched_domain) { \ 22#define SD_NODE_INIT (struct sched_domain) { \
23 .span = CPU_MASK_NONE, \ 23 .span = CPU_MASK_NONE, \
24 .parent = NULL, \ 24 .parent = NULL, \
25 .child = NULL, \
25 .groups = NULL, \ 26 .groups = NULL, \
26 .min_interval = 8, \ 27 .min_interval = 8, \
27 .max_interval = 32, \ 28 .max_interval = 32, \
diff --git a/include/asm-mips/ptrace.h b/include/asm-mips/ptrace.h
index 4fb0fc43ff..5f3a9075cd 100644
--- a/include/asm-mips/ptrace.h
+++ b/include/asm-mips/ptrace.h
@@ -44,9 +44,8 @@ struct pt_regs {
44 unsigned long cp0_epc; 44 unsigned long cp0_epc;
45#ifdef CONFIG_MIPS_MT_SMTC 45#ifdef CONFIG_MIPS_MT_SMTC
46 unsigned long cp0_tcstatus; 46 unsigned long cp0_tcstatus;
47 unsigned long smtc_pad;
48#endif /* CONFIG_MIPS_MT_SMTC */ 47#endif /* CONFIG_MIPS_MT_SMTC */
49}; 48} __attribute__ ((aligned (8)));
50 49
51/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ 50/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
52#define PTRACE_GETREGS 12 51#define PTRACE_GETREGS 12
diff --git a/include/asm-mips/serial.h b/include/asm-mips/serial.h
index 035637c67e..d7a65135d8 100644
--- a/include/asm-mips/serial.h
+++ b/include/asm-mips/serial.h
@@ -55,51 +55,18 @@
55 * Galileo EV64120 evaluation board 55 * Galileo EV64120 evaluation board
56 */ 56 */
57#ifdef CONFIG_MIPS_EV64120 57#ifdef CONFIG_MIPS_EV64120
58#include <asm/galileo-boards/ev96100.h> 58#include <mach-gt64120.h>
59#include <asm/galileo-boards/ev96100int.h> 59#define EV64120_SERIAL_PORT_DEFNS \
60#define EV96100_SERIAL_PORT_DEFNS \ 60 { .baud_base = EV64120_BASE_BAUD, .irq = EV64120_UART_IRQ, \
61 { .baud_base = EV96100_BASE_BAUD, .irq = EV96100INT_UART_0, \
62 .flags = STD_COM_FLAGS, \ 61 .flags = STD_COM_FLAGS, \
63 .iomem_base = EV96100_UART0_REGS_BASE, .iomem_reg_shift = 2, \ 62 .iomem_base = EV64120_UART0_REGS_BASE, .iomem_reg_shift = 2, \
64 .io_type = SERIAL_IO_MEM }, \ 63 .io_type = SERIAL_IO_MEM }, \
65 { .baud_base = EV96100_BASE_BAUD, .irq = EV96100INT_UART_0, \ 64 { .baud_base = EV64120_BASE_BAUD, .irq = EV64120_UART_IRQ, \
66 .flags = STD_COM_FLAGS, \ 65 .flags = STD_COM_FLAGS, \
67 .iomem_base = EV96100_UART1_REGS_BASE, .iomem_reg_shift = 2, \ 66 .iomem_base = EV64120_UART1_REGS_BASE, .iomem_reg_shift = 2, \
68 .io_type = SERIAL_IO_MEM }, 67 .io_type = SERIAL_IO_MEM },
69#else 68#else
70#define EV96100_SERIAL_PORT_DEFNS 69#define EV64120_SERIAL_PORT_DEFNS
71#endif
72
73#ifdef CONFIG_MIPS_ITE8172
74#include <asm/it8172/it8172.h>
75#include <asm/it8172/it8172_int.h>
76#include <asm/it8712.h>
77#define ITE_SERIAL_PORT_DEFNS \
78 { .baud_base = BASE_BAUD, .port = (IT8172_PCI_IO_BASE + IT_UART_BASE), \
79 .irq = IT8172_UART_IRQ, .flags = STD_COM_FLAGS, .port = PORT_16550 }, \
80 { .baud_base = (24000000/(16*13)), .port = (IT8172_PCI_IO_BASE + IT8712_UART1_PORT), \
81 .irq = IT8172_SERIRQ_4, .flags = STD_COM_FLAGS, .port = PORT_16550 }, \
82 /* Smart Card Reader 0 */ \
83 { .baud_base = BASE_BAUD, .port = (IT8172_PCI_IO_BASE + IT_SCR0_BASE), \
84 .irq = IT8172_SCR0_IRQ, .flags = STD_COM_FLAGS, .port = PORT_16550 }, \
85 /* Smart Card Reader 1 */ \
86 { .baud_base = BASE_BAUD, .port = (IT8172_PCI_IO_BASE + IT_SCR1_BASE), \
87 .irq = IT8172_SCR1_IRQ, .flags = STD_COM_FLAGS, .port = PORT_16550 },
88#else
89#define ITE_SERIAL_PORT_DEFNS
90#endif
91
92#ifdef CONFIG_MIPS_IVR
93#include <asm/it8172/it8172.h>
94#include <asm/it8172/it8172_int.h>
95#define IVR_SERIAL_PORT_DEFNS \
96 { .baud_base = BASE_BAUD, .port = (IT8172_PCI_IO_BASE + IT_UART_BASE), \
97 .irq = IT8172_UART_IRQ, .flags = STD_COM_FLAGS, .port = PORT_16550 }, \
98 /* Smart Card Reader 1 */ \
99 { .baud_base = BASE_BAUD, .port = (IT8172_PCI_IO_BASE + IT_SCR1_BASE), \
100 .irq = IT8172_SCR1_IRQ, .flags = STD_COM_FLAGS, .port = PORT_16550 },
101#else
102#define IVR_SERIAL_PORT_DEFNS
103#endif 70#endif
104 71
105#ifdef CONFIG_HAVE_STD_PC_SERIAL_PORT 72#ifdef CONFIG_HAVE_STD_PC_SERIAL_PORT
@@ -239,10 +206,8 @@
239 206
240#define SERIAL_PORT_DFNS \ 207#define SERIAL_PORT_DFNS \
241 DDB5477_SERIAL_PORT_DEFNS \ 208 DDB5477_SERIAL_PORT_DEFNS \
242 EV96100_SERIAL_PORT_DEFNS \ 209 EV64120_SERIAL_PORT_DEFNS \
243 IP32_SERIAL_PORT_DEFNS \ 210 IP32_SERIAL_PORT_DEFNS \
244 ITE_SERIAL_PORT_DEFNS \
245 IVR_SERIAL_PORT_DEFNS \
246 JAZZ_SERIAL_PORT_DEFNS \ 211 JAZZ_SERIAL_PORT_DEFNS \
247 STD_SERIAL_PORT_DEFNS \ 212 STD_SERIAL_PORT_DEFNS \
248 MOMENCO_OCELOT_G_SERIAL_PORT_DEFNS \ 213 MOMENCO_OCELOT_G_SERIAL_PORT_DEFNS \
diff --git a/include/asm-mips/spinlock.h b/include/asm-mips/spinlock.h
index 4c1a1b53ae..c8d5587467 100644
--- a/include/asm-mips/spinlock.h
+++ b/include/asm-mips/spinlock.h
@@ -328,4 +328,8 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw)
328} 328}
329 329
330 330
331#define _raw_spin_relax(lock) cpu_relax()
332#define _raw_read_relax(lock) cpu_relax()
333#define _raw_write_relax(lock) cpu_relax()
334
331#endif /* _ASM_SPINLOCK_H */ 335#endif /* _ASM_SPINLOCK_H */
diff --git a/include/asm-mips/stacktrace.h b/include/asm-mips/stacktrace.h
new file mode 100644
index 0000000000..07f873351a
--- /dev/null
+++ b/include/asm-mips/stacktrace.h
@@ -0,0 +1,44 @@
1#ifndef _ASM_STACKTRACE_H
2#define _ASM_STACKTRACE_H
3
4#include <asm/ptrace.h>
5
6#ifdef CONFIG_KALLSYMS
7extern int raw_show_trace;
8extern unsigned long unwind_stack(struct task_struct *task, unsigned long *sp,
9 unsigned long pc, unsigned long *ra);
10#else
11#define raw_show_trace 1
12#define unwind_stack(task, sp, pc, ra) 0
13#endif
14
15static __always_inline void prepare_frametrace(struct pt_regs *regs)
16{
17#ifndef CONFIG_KALLSYMS
18 /*
19 * Remove any garbage that may be in regs (specially func
20 * addresses) to avoid show_raw_backtrace() to report them
21 */
22 memset(regs, 0, sizeof(*regs));
23#endif
24 __asm__ __volatile__(
25 ".set push\n\t"
26 ".set noat\n\t"
27#ifdef CONFIG_64BIT
28 "1: dla $1, 1b\n\t"
29 "sd $1, %0\n\t"
30 "sd $29, %1\n\t"
31 "sd $31, %2\n\t"
32#else
33 "1: la $1, 1b\n\t"
34 "sw $1, %0\n\t"
35 "sw $29, %1\n\t"
36 "sw $31, %2\n\t"
37#endif
38 ".set pop\n\t"
39 : "=m" (regs->cp0_epc),
40 "=m" (regs->regs[29]), "=m" (regs->regs[31])
41 : : "memory");
42}
43
44#endif /* _ASM_STACKTRACE_H */
diff --git a/include/asm-mips/tx4938/tx4938_mips.h b/include/asm-mips/tx4938/tx4938_mips.h
index cf89b205f1..5f8498fef0 100644
--- a/include/asm-mips/tx4938/tx4938_mips.h
+++ b/include/asm-mips/tx4938/tx4938_mips.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/include/asm-mips/tx4938/tx4938_bitmask.h 2 * linux/include/asm-mips/tx4938/tx4938_mips.h
3 * Generic bitmask definitions 3 * Generic bitmask definitions
4 * 4 *
5 * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the 5 * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
diff --git a/include/asm-mips/unistd.h b/include/asm-mips/unistd.h
index c39142920f..685c91467e 100644
--- a/include/asm-mips/unistd.h
+++ b/include/asm-mips/unistd.h
@@ -1212,45 +1212,6 @@ type name (atype a,btype b,ctype c,dtype d,etype e,ftype f) \
1212# define __ARCH_WANT_COMPAT_SYS_TIME 1212# define __ARCH_WANT_COMPAT_SYS_TIME
1213# endif 1213# endif
1214 1214
1215#ifdef __KERNEL_SYSCALLS__
1216
1217#include <linux/compiler.h>
1218#include <linux/types.h>
1219#include <linux/linkage.h>
1220#include <asm/ptrace.h>
1221#include <asm/sim.h>
1222
1223/*
1224 * we need this inline - forking from kernel space will result
1225 * in NO COPY ON WRITE (!!!), until an execve is executed. This
1226 * is no problem, but for the stack. This is handled by not letting
1227 * main() use the stack at all after fork(). Thus, no function
1228 * calls - which means inline code for fork too, as otherwise we
1229 * would use the stack upon exit from 'fork()'.
1230 *
1231 * Actually only pause and fork are needed inline, so that there
1232 * won't be any messing with the stack from main(), but we define
1233 * some others too.
1234 */
1235static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp)
1236
1237asmlinkage unsigned long sys_mmap(
1238 unsigned long addr, size_t len,
1239 int prot, int flags,
1240 int fd, off_t offset);
1241asmlinkage long sys_mmap2(
1242 unsigned long addr, unsigned long len,
1243 unsigned long prot, unsigned long flags,
1244 unsigned long fd, unsigned long pgoff);
1245asmlinkage int sys_execve(nabi_no_regargs struct pt_regs regs);
1246asmlinkage int sys_pipe(nabi_no_regargs struct pt_regs regs);
1247struct sigaction;
1248asmlinkage long sys_rt_sigaction(int sig,
1249 const struct sigaction __user *act,
1250 struct sigaction __user *oact,
1251 size_t sigsetsize);
1252
1253#endif /* __KERNEL_SYSCALLS__ */
1254#endif /* !__ASSEMBLY__ */ 1215#endif /* !__ASSEMBLY__ */
1255 1216
1256/* 1217/*
diff --git a/include/asm-parisc/rtc.h b/include/asm-parisc/rtc.h
index f3d3d6b110..f4ebff11dc 100644
--- a/include/asm-parisc/rtc.h
+++ b/include/asm-parisc/rtc.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * inclue/asm-parisc/rtc.h 2 * include/asm-parisc/rtc.h
3 * 3 *
4 * Copyright 2002 Randolph CHung <tausq@debian.org> 4 * Copyright 2002 Randolph CHung <tausq@debian.org>
5 * 5 *
diff --git a/include/asm-parisc/spinlock.h b/include/asm-parisc/spinlock.h
index a93960e232..e182553036 100644
--- a/include/asm-parisc/spinlock.h
+++ b/include/asm-parisc/spinlock.h
@@ -152,4 +152,8 @@ static __inline__ int __raw_write_can_lock(raw_rwlock_t *rw)
152 return !rw->counter; 152 return !rw->counter;
153} 153}
154 154
155#define _raw_spin_relax(lock) cpu_relax()
156#define _raw_read_relax(lock) cpu_relax()
157#define _raw_write_relax(lock) cpu_relax()
158
155#endif /* __ASM_SPINLOCK_H */ 159#endif /* __ASM_SPINLOCK_H */
diff --git a/include/asm-parisc/unistd.h b/include/asm-parisc/unistd.h
index 27bcfad1c3..53b0f5d290 100644
--- a/include/asm-parisc/unistd.h
+++ b/include/asm-parisc/unistd.h
@@ -952,92 +952,6 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
952#define __ARCH_WANT_SYS_SIGPROCMASK 952#define __ARCH_WANT_SYS_SIGPROCMASK
953#define __ARCH_WANT_SYS_RT_SIGACTION 953#define __ARCH_WANT_SYS_RT_SIGACTION
954 954
955/* mmap & mmap2 take 6 arguments */
956#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5,type6,arg6) \
957type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) \
958{ \
959 return K_INLINE_SYSCALL(name, 6, arg1, arg2, arg3, arg4, arg5, arg6); \
960}
961
962#ifdef __KERNEL_SYSCALLS__
963
964#include <asm/current.h>
965#include <linux/compiler.h>
966#include <linux/types.h>
967#include <linux/syscalls.h>
968
969static inline pid_t setsid(void)
970{
971 return sys_setsid();
972}
973
974static inline int write(int fd, const char *buf, off_t count)
975{
976 return sys_write(fd, buf, count);
977}
978
979static inline int read(int fd, char *buf, off_t count)
980{
981 return sys_read(fd, buf, count);
982}
983
984static inline off_t lseek(int fd, off_t offset, int count)
985{
986 return sys_lseek(fd, offset, count);
987}
988
989static inline int dup(int fd)
990{
991 return sys_dup(fd);
992}
993
994static inline int execve(char *filename, char * argv [],
995 char * envp[])
996{
997 extern int __execve(char *, char **, char **, struct task_struct *);
998 return __execve(filename, argv, envp, current);
999}
1000
1001static inline int open(const char *file, int flag, int mode)
1002{
1003 return sys_open(file, flag, mode);
1004}
1005
1006static inline int close(int fd)
1007{
1008 return sys_close(fd);
1009}
1010
1011static inline void _exit(int exitcode)
1012{
1013 sys_exit(exitcode);
1014}
1015
1016static inline pid_t waitpid(pid_t pid, int *wait_stat, int options)
1017{
1018 return sys_wait4(pid, wait_stat, options, NULL);
1019}
1020
1021asmlinkage unsigned long sys_mmap(unsigned long addr, unsigned long len,
1022 unsigned long prot, unsigned long flags,
1023 unsigned long fd, unsigned long offset);
1024asmlinkage unsigned long sys_mmap2(unsigned long addr, unsigned long len,
1025 unsigned long prot, unsigned long flags,
1026 unsigned long fd, unsigned long pgoff);
1027struct pt_regs;
1028asmlinkage int sys_execve(struct pt_regs *regs);
1029int sys_clone(unsigned long clone_flags, unsigned long usp,
1030 struct pt_regs *regs);
1031int sys_vfork(struct pt_regs *regs);
1032int sys_pipe(int *fildes);
1033struct sigaction;
1034asmlinkage long sys_rt_sigaction(int sig,
1035 const struct sigaction __user *act,
1036 struct sigaction __user *oact,
1037 size_t sigsetsize);
1038
1039#endif /* __KERNEL_SYSCALLS__ */
1040
1041#endif /* __ASSEMBLY__ */ 955#endif /* __ASSEMBLY__ */
1042 956
1043#undef STR 957#undef STR
diff --git a/include/asm-powerpc/fs_pd.h b/include/asm-powerpc/fs_pd.h
new file mode 100644
index 0000000000..3d0e819d37
--- /dev/null
+++ b/include/asm-powerpc/fs_pd.h
@@ -0,0 +1,45 @@
1/*
2 * Platform information definitions.
3 *
4 * 2006 (c) MontaVista Software, Inc.
5 * Vitaly Bordug <vbordug@ru.mvista.com>
6 *
7 * This file is licensed under the terms of the GNU General Public License
8 * version 2. This program is licensed "as is" without any warranty of any
9 * kind, whether express or implied.
10 */
11
12#ifndef FS_PD_H
13#define FS_PD_H
14#include <asm/cpm2.h>
15#include <sysdev/fsl_soc.h>
16#include <asm/time.h>
17
18static inline int uart_baudrate(void)
19{
20 return get_baudrate();
21}
22
23static inline int uart_clock(void)
24{
25 return ppc_proc_freq;
26}
27
28#define cpm2_map(member) \
29({ \
30 u32 offset = offsetof(cpm2_map_t, member); \
31 void *addr = ioremap (CPM_MAP_ADDR + offset, \
32 sizeof( ((cpm2_map_t*)0)->member)); \
33 addr; \
34})
35
36#define cpm2_map_size(member, size) \
37({ \
38 u32 offset = offsetof(cpm2_map_t, member); \
39 void *addr = ioremap (CPM_MAP_ADDR + offset, size); \
40 addr; \
41})
42
43#define cpm2_unmap(addr) iounmap(addr)
44
45#endif
diff --git a/include/asm-powerpc/io.h b/include/asm-powerpc/io.h
index 46bae1cf38..cbbd8c648d 100644
--- a/include/asm-powerpc/io.h
+++ b/include/asm-powerpc/io.h
@@ -11,6 +11,7 @@
11 11
12/* Check of existence of legacy devices */ 12/* Check of existence of legacy devices */
13extern int check_legacy_ioport(unsigned long base_port); 13extern int check_legacy_ioport(unsigned long base_port);
14#define PNPBIOS_BASE 0xf000 /* only relevant for PReP */
14 15
15#ifndef CONFIG_PPC64 16#ifndef CONFIG_PPC64
16#include <asm-ppc/io.h> 17#include <asm-ppc/io.h>
diff --git a/include/asm-powerpc/ipic.h b/include/asm-powerpc/ipic.h
index 53079ec3a5..1ce09a3590 100644
--- a/include/asm-powerpc/ipic.h
+++ b/include/asm-powerpc/ipic.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm-ppc/ipic.h 2 * include/asm-powerpc/ipic.h
3 * 3 *
4 * IPIC external definitions and structure. 4 * IPIC external definitions and structure.
5 * 5 *
diff --git a/include/asm-powerpc/kprobes.h b/include/asm-powerpc/kprobes.h
index 34e1f89a5f..2dafa376a6 100644
--- a/include/asm-powerpc/kprobes.h
+++ b/include/asm-powerpc/kprobes.h
@@ -44,6 +44,28 @@ typedef unsigned int kprobe_opcode_t;
44#define IS_TDI(instr) (((instr) & 0xfc000000) == 0x08000000) 44#define IS_TDI(instr) (((instr) & 0xfc000000) == 0x08000000)
45#define IS_TWI(instr) (((instr) & 0xfc000000) == 0x0c000000) 45#define IS_TWI(instr) (((instr) & 0xfc000000) == 0x0c000000)
46 46
47/*
48 * 64bit powerpc uses function descriptors.
49 * Handle cases where:
50 * - User passes a <.symbol> or <module:.symbol>
51 * - User passes a <symbol> or <module:symbol>
52 * - User passes a non-existant symbol, kallsyms_lookup_name
53 * returns 0. Don't deref the NULL pointer in that case
54 */
55#define kprobe_lookup_name(name, addr) \
56{ \
57 addr = (kprobe_opcode_t *)kallsyms_lookup_name(name); \
58 if (addr) { \
59 char *colon; \
60 if ((colon = strchr(name, ':')) != NULL) { \
61 colon++; \
62 if (*colon != '\0' && *colon != '.') \
63 addr = *(kprobe_opcode_t **)addr; \
64 } else if (name[0] != '.') \
65 addr = *(kprobe_opcode_t **)addr; \
66 } \
67}
68
47#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)((func_descr_t *)pentry) 69#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)((func_descr_t *)pentry)
48 70
49#define is_trap(instr) (IS_TW(instr) || IS_TD(instr) || \ 71#define is_trap(instr) (IS_TW(instr) || IS_TD(instr) || \
diff --git a/include/asm-powerpc/mpc85xx.h b/include/asm-powerpc/mpc85xx.h
new file mode 100644
index 0000000000..ccdb8a2113
--- /dev/null
+++ b/include/asm-powerpc/mpc85xx.h
@@ -0,0 +1,53 @@
1/*
2 * include/asm-powerpc/mpc85xx.h
3 *
4 * MPC85xx definitions
5 *
6 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
7 *
8 * Copyright 2004 Freescale Semiconductor, Inc
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 */
15
16#ifdef __KERNEL__
17#ifndef __ASM_MPC85xx_H__
18#define __ASM_MPC85xx_H__
19
20#include <asm/mmu.h>
21
22#ifdef CONFIG_85xx
23
24#if defined(CONFIG_MPC8540_ADS) || defined(CONFIG_MPC8560_ADS)
25#include <platforms/85xx/mpc85xx_ads.h>
26#endif
27#if defined(CONFIG_MPC8555_CDS) || defined(CONFIG_MPC8548_CDS)
28#include <platforms/85xx/mpc8555_cds.h>
29#endif
30#ifdef CONFIG_MPC85xx_CDS
31#include <platforms/85xx/mpc85xx_cds.h>
32#endif
33
34#define _IO_BASE isa_io_base
35#define _ISA_MEM_BASE isa_mem_base
36#ifdef CONFIG_PCI
37#define PCI_DRAM_OFFSET pci_dram_offset
38#else
39#define PCI_DRAM_OFFSET 0
40#endif
41
42/* Let modules/drivers get at CCSRBAR */
43extern phys_addr_t get_ccsrbar(void);
44
45#ifdef MODULE
46#define CCSRBAR get_ccsrbar()
47#else
48#define CCSRBAR BOARD_CCSRBAR
49#endif
50
51#endif /* CONFIG_85xx */
52#endif /* __ASM_MPC85xx_H__ */
53#endif /* __KERNEL__ */
diff --git a/include/asm-powerpc/ptrace.h b/include/asm-powerpc/ptrace.h
index 4435efe85d..4ad77a13f8 100644
--- a/include/asm-powerpc/ptrace.h
+++ b/include/asm-powerpc/ptrace.h
@@ -73,6 +73,8 @@ struct pt_regs {
73#ifndef __ASSEMBLY__ 73#ifndef __ASSEMBLY__
74 74
75#define instruction_pointer(regs) ((regs)->nip) 75#define instruction_pointer(regs) ((regs)->nip)
76#define regs_return_value(regs) ((regs)->gpr[3])
77
76#ifdef CONFIG_SMP 78#ifdef CONFIG_SMP
77extern unsigned long profile_pc(struct pt_regs *regs); 79extern unsigned long profile_pc(struct pt_regs *regs);
78#else 80#else
diff --git a/include/asm-powerpc/spinlock.h b/include/asm-powerpc/spinlock.h
index c31e4382a7..cc4cfceac6 100644
--- a/include/asm-powerpc/spinlock.h
+++ b/include/asm-powerpc/spinlock.h
@@ -285,5 +285,9 @@ static __inline__ void __raw_write_unlock(raw_rwlock_t *rw)
285 rw->lock = 0; 285 rw->lock = 0;
286} 286}
287 287
288#define _raw_spin_relax(lock) __spin_yield(lock)
289#define _raw_read_relax(lock) __rw_yield(lock)
290#define _raw_write_relax(lock) __rw_yield(lock)
291
288#endif /* __KERNEL__ */ 292#endif /* __KERNEL__ */
289#endif /* __ASM_SPINLOCK_H */ 293#endif /* __ASM_SPINLOCK_H */
diff --git a/include/asm-powerpc/time.h b/include/asm-powerpc/time.h
index 5785ac4737..b051d4c88c 100644
--- a/include/asm-powerpc/time.h
+++ b/include/asm-powerpc/time.h
@@ -39,6 +39,10 @@ extern void generic_calibrate_decr(void);
39extern void wakeup_decrementer(void); 39extern void wakeup_decrementer(void);
40extern void snapshot_timebase(void); 40extern void snapshot_timebase(void);
41 41
42#ifdef CONFIG_RTC_CLASS
43extern int __init rtc_class_hookup(void);
44#endif
45
42/* Some sane defaults: 125 MHz timebase, 1GHz processor */ 46/* Some sane defaults: 125 MHz timebase, 1GHz processor */
43extern unsigned long ppc_proc_freq; 47extern unsigned long ppc_proc_freq;
44#define DEFAULT_PROC_FREQ (DEFAULT_TB_FREQ * 8) 48#define DEFAULT_PROC_FREQ (DEFAULT_TB_FREQ * 8)
@@ -234,4 +238,4 @@ extern void snapshot_timebases(void);
234#endif 238#endif
235 239
236#endif /* __KERNEL__ */ 240#endif /* __KERNEL__ */
237#endif /* __PPC64_TIME_H */ 241#endif /* __POWERPC_TIME_H */
diff --git a/include/asm-powerpc/topology.h b/include/asm-powerpc/topology.h
index bbc3844b08..8f7ee16781 100644
--- a/include/asm-powerpc/topology.h
+++ b/include/asm-powerpc/topology.h
@@ -43,6 +43,7 @@ extern int pcibus_to_node(struct pci_bus *bus);
43#define SD_NODE_INIT (struct sched_domain) { \ 43#define SD_NODE_INIT (struct sched_domain) { \
44 .span = CPU_MASK_NONE, \ 44 .span = CPU_MASK_NONE, \
45 .parent = NULL, \ 45 .parent = NULL, \
46 .child = NULL, \
46 .groups = NULL, \ 47 .groups = NULL, \
47 .min_interval = 8, \ 48 .min_interval = 8, \
48 .max_interval = 32, \ 49 .max_interval = 32, \
diff --git a/include/asm-powerpc/unistd.h b/include/asm-powerpc/unistd.h
index eb66eae661..464a48cce7 100644
--- a/include/asm-powerpc/unistd.h
+++ b/include/asm-powerpc/unistd.h
@@ -479,13 +479,6 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6
479#endif 479#endif
480 480
481/* 481/*
482 * System call prototypes.
483 */
484#ifdef __KERNEL_SYSCALLS__
485extern int execve(const char *file, char **argv, char **envp);
486#endif /* __KERNEL_SYSCALLS__ */
487
488/*
489 * "Conditional" syscalls 482 * "Conditional" syscalls
490 * 483 *
491 * What we want is __attribute__((weak,alias("sys_ni_syscall"))), 484 * What we want is __attribute__((weak,alias("sys_ni_syscall"))),
diff --git a/include/asm-ppc/cpm2.h b/include/asm-ppc/cpm2.h
index f6a7ff04ff..220cc2debe 100644
--- a/include/asm-ppc/cpm2.h
+++ b/include/asm-ppc/cpm2.h
@@ -42,6 +42,8 @@
42#define CPM_CR_IDMA4_SBLOCK (0x17) 42#define CPM_CR_IDMA4_SBLOCK (0x17)
43#define CPM_CR_MCC1_SBLOCK (0x1c) 43#define CPM_CR_MCC1_SBLOCK (0x1c)
44 44
45#define CPM_CR_FCC_SBLOCK(x) (x + 0x10)
46
45#define CPM_CR_SCC1_PAGE (0x00) 47#define CPM_CR_SCC1_PAGE (0x00)
46#define CPM_CR_SCC2_PAGE (0x01) 48#define CPM_CR_SCC2_PAGE (0x01)
47#define CPM_CR_SCC3_PAGE (0x02) 49#define CPM_CR_SCC3_PAGE (0x02)
@@ -62,6 +64,8 @@
62#define CPM_CR_MCC1_PAGE (0x07) 64#define CPM_CR_MCC1_PAGE (0x07)
63#define CPM_CR_MCC2_PAGE (0x08) 65#define CPM_CR_MCC2_PAGE (0x08)
64 66
67#define CPM_CR_FCC_PAGE(x) (x + 0x04)
68
65/* Some opcodes (there are more...later) 69/* Some opcodes (there are more...later)
66*/ 70*/
67#define CPM_CR_INIT_TRX ((ushort)0x0000) 71#define CPM_CR_INIT_TRX ((ushort)0x0000)
@@ -173,6 +177,10 @@ typedef struct cpm_buf_desc {
173#define PROFF_I2C_BASE ((uint)0x8afc) 177#define PROFF_I2C_BASE ((uint)0x8afc)
174#define PROFF_IDMA4_BASE ((uint)0x8afe) 178#define PROFF_IDMA4_BASE ((uint)0x8afe)
175 179
180#define PROFF_SCC_SIZE ((uint)0x100)
181#define PROFF_FCC_SIZE ((uint)0x100)
182#define PROFF_SMC_SIZE ((uint)64)
183
176/* The SMCs are relocated to any of the first eight DPRAM pages. 184/* The SMCs are relocated to any of the first eight DPRAM pages.
177 * We will fix these at the first locations of DPRAM, until we 185 * We will fix these at the first locations of DPRAM, until we
178 * get some microcode patches :-). 186 * get some microcode patches :-).
@@ -1186,7 +1194,60 @@ typedef struct im_idma {
1186#define FCC_MEM_OFFSET(x) (CPM_FCC_SPECIAL_BASE + (x*128)) 1194#define FCC_MEM_OFFSET(x) (CPM_FCC_SPECIAL_BASE + (x*128))
1187#define FCC1_MEM_OFFSET FCC_MEM_OFFSET(0) 1195#define FCC1_MEM_OFFSET FCC_MEM_OFFSET(0)
1188#define FCC2_MEM_OFFSET FCC_MEM_OFFSET(1) 1196#define FCC2_MEM_OFFSET FCC_MEM_OFFSET(1)
1189#define FCC2_MEM_OFFSET FCC_MEM_OFFSET(2) 1197#define FCC3_MEM_OFFSET FCC_MEM_OFFSET(2)
1198
1199/* Clocks and GRG's */
1200
1201enum cpm_clk_dir {
1202 CPM_CLK_RX,
1203 CPM_CLK_TX,
1204 CPM_CLK_RTX
1205};
1206
1207enum cpm_clk_target {
1208 CPM_CLK_SCC1,
1209 CPM_CLK_SCC2,
1210 CPM_CLK_SCC3,
1211 CPM_CLK_SCC4,
1212 CPM_CLK_FCC1,
1213 CPM_CLK_FCC2,
1214 CPM_CLK_FCC3
1215};
1216
1217enum cpm_clk {
1218 CPM_CLK_NONE = 0,
1219 CPM_BRG1, /* Baud Rate Generator 1 */
1220 CPM_BRG2, /* Baud Rate Generator 2 */
1221 CPM_BRG3, /* Baud Rate Generator 3 */
1222 CPM_BRG4, /* Baud Rate Generator 4 */
1223 CPM_BRG5, /* Baud Rate Generator 5 */
1224 CPM_BRG6, /* Baud Rate Generator 6 */
1225 CPM_BRG7, /* Baud Rate Generator 7 */
1226 CPM_BRG8, /* Baud Rate Generator 8 */
1227 CPM_CLK1, /* Clock 1 */
1228 CPM_CLK2, /* Clock 2 */
1229 CPM_CLK3, /* Clock 3 */
1230 CPM_CLK4, /* Clock 4 */
1231 CPM_CLK5, /* Clock 5 */
1232 CPM_CLK6, /* Clock 6 */
1233 CPM_CLK7, /* Clock 7 */
1234 CPM_CLK8, /* Clock 8 */
1235 CPM_CLK9, /* Clock 9 */
1236 CPM_CLK10, /* Clock 10 */
1237 CPM_CLK11, /* Clock 11 */
1238 CPM_CLK12, /* Clock 12 */
1239 CPM_CLK13, /* Clock 13 */
1240 CPM_CLK14, /* Clock 14 */
1241 CPM_CLK15, /* Clock 15 */
1242 CPM_CLK16, /* Clock 16 */
1243 CPM_CLK17, /* Clock 17 */
1244 CPM_CLK18, /* Clock 18 */
1245 CPM_CLK19, /* Clock 19 */
1246 CPM_CLK20, /* Clock 20 */
1247 CPM_CLK_DUMMY
1248};
1249
1250extern int cpm2_clk_setup(enum cpm_clk_target target, int clock, int mode);
1190 1251
1191#endif /* __CPM2__ */ 1252#endif /* __CPM2__ */
1192#endif /* __KERNEL__ */ 1253#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/fs_pd.h b/include/asm-ppc/fs_pd.h
new file mode 100644
index 0000000000..8691327653
--- /dev/null
+++ b/include/asm-ppc/fs_pd.h
@@ -0,0 +1,36 @@
1/*
2 * Platform information definitions.
3 *
4 * 2006 (c) MontaVista Software, Inc.
5 * Vitaly Bordug <vbordug@ru.mvista.com>
6 *
7 * This file is licensed under the terms of the GNU General Public License
8 * version 2. This program is licensed "as is" without any warranty of any
9 * kind, whether express or implied.
10 */
11
12#ifndef FS_PD_H
13#define FS_PD_H
14
15static inline int uart_baudrate(void)
16{
17 int baud;
18 bd_t *bd = (bd_t *) __res;
19
20 if (bd->bi_baudrate)
21 baud = bd->bi_baudrate;
22 else
23 baud = -1;
24 return baud;
25}
26
27static inline int uart_clock(void)
28{
29 return (((bd_t *) __res)->bi_intfreq);
30}
31
32#define cpm2_map(member) (&cpm2_immr->member)
33#define cpm2_map_size(member, size) (&cpm2_immr->member)
34#define cpm2_unmap(addr) do {} while(0)
35
36#endif
diff --git a/include/asm-ppc/mv64x60_defs.h b/include/asm-ppc/mv64x60_defs.h
index f8f7f16b9b..5b0704a3e6 100644
--- a/include/asm-ppc/mv64x60_defs.h
+++ b/include/asm-ppc/mv64x60_defs.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm-ppc/gt64260_defs.h 2 * include/asm-ppc/mv64x60_defs.h
3 * 3 *
4 * Register definitions for the Marvell/Galileo GT64260, MV64360, etc. 4 * Register definitions for the Marvell/Galileo GT64260, MV64360, etc.
5 * host bridges. 5 * host bridges.
diff --git a/include/asm-ppc/rheap.h b/include/asm-ppc/rheap.h
index e6ca1f67ce..39a10d8622 100644
--- a/include/asm-ppc/rheap.h
+++ b/include/asm-ppc/rheap.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm-ppc/rheap.c 2 * include/asm-ppc/rheap.h
3 * 3 *
4 * Header file for the implementation of a remote heap. 4 * Header file for the implementation of a remote heap.
5 * 5 *
@@ -62,6 +62,10 @@ extern int rh_attach_region(rh_info_t * info, void *start, int size);
62/* Detach a free region */ 62/* Detach a free region */
63extern void *rh_detach_region(rh_info_t * info, void *start, int size); 63extern void *rh_detach_region(rh_info_t * info, void *start, int size);
64 64
65/* Allocate the given size from the remote heap (with alignment) */
66extern void *rh_alloc_align(rh_info_t * info, int size, int alignment,
67 const char *owner);
68
65/* Allocate the given size from the remote heap */ 69/* Allocate the given size from the remote heap */
66extern void *rh_alloc(rh_info_t * info, int size, const char *owner); 70extern void *rh_alloc(rh_info_t * info, int size, const char *owner);
67 71
diff --git a/include/asm-ppc/rtc.h b/include/asm-ppc/rtc.h
index 05fbf912ab..6025b46d0a 100644
--- a/include/asm-ppc/rtc.h
+++ b/include/asm-ppc/rtc.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * inclue/asm-ppc/rtc.h 2 * include/asm-ppc/rtc.h
3 * 3 *
4 * Author: Tom Rini <trini@mvista.com> 4 * Author: Tom Rini <trini@mvista.com>
5 * 5 *
diff --git a/include/asm-ppc/spinlock.h b/include/asm-ppc/spinlock.h
index 5c64b75f02..fccaf5531e 100644
--- a/include/asm-ppc/spinlock.h
+++ b/include/asm-ppc/spinlock.h
@@ -161,4 +161,8 @@ static __inline__ void __raw_write_unlock(raw_rwlock_t *rw)
161 rw->lock = 0; 161 rw->lock = 0;
162} 162}
163 163
164#define _raw_spin_relax(lock) cpu_relax()
165#define _raw_read_relax(lock) cpu_relax()
166#define _raw_write_relax(lock) cpu_relax()
167
164#endif /* __ASM_SPINLOCK_H */ 168#endif /* __ASM_SPINLOCK_H */
diff --git a/include/asm-s390/ptrace.h b/include/asm-s390/ptrace.h
index 8d2bf65b0b..7b768c5c68 100644
--- a/include/asm-s390/ptrace.h
+++ b/include/asm-s390/ptrace.h
@@ -472,6 +472,7 @@ struct user_regs_struct
472 472
473#define user_mode(regs) (((regs)->psw.mask & PSW_MASK_PSTATE) != 0) 473#define user_mode(regs) (((regs)->psw.mask & PSW_MASK_PSTATE) != 0)
474#define instruction_pointer(regs) ((regs)->psw.addr & PSW_ADDR_INSN) 474#define instruction_pointer(regs) ((regs)->psw.addr & PSW_ADDR_INSN)
475#define regs_return_value(regs)((regs)->gprs[2])
475#define profile_pc(regs) instruction_pointer(regs) 476#define profile_pc(regs) instruction_pointer(regs)
476extern void show_regs(struct pt_regs * regs); 477extern void show_regs(struct pt_regs * regs);
477#endif 478#endif
diff --git a/include/asm-s390/qdio.h b/include/asm-s390/qdio.h
index a2f37a9353..7189c79bc6 100644
--- a/include/asm-s390/qdio.h
+++ b/include/asm-s390/qdio.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/include/asm/qdio.h 2 * linux/include/asm-s390/qdio.h
3 * 3 *
4 * Linux for S/390 QDIO base support, Hipersocket base support 4 * Linux for S/390 QDIO base support, Hipersocket base support
5 * version 2 5 * version 2
diff --git a/include/asm-s390/setup.h b/include/asm-s390/setup.h
index f1959732b6..5d72eda8a1 100644
--- a/include/asm-s390/setup.h
+++ b/include/asm-s390/setup.h
@@ -39,6 +39,7 @@ extern unsigned long machine_flags;
39#define MACHINE_IS_P390 (machine_flags & 4) 39#define MACHINE_IS_P390 (machine_flags & 4)
40#define MACHINE_HAS_MVPG (machine_flags & 16) 40#define MACHINE_HAS_MVPG (machine_flags & 16)
41#define MACHINE_HAS_IDTE (machine_flags & 128) 41#define MACHINE_HAS_IDTE (machine_flags & 128)
42#define MACHINE_HAS_DIAG9C (machine_flags & 256)
42 43
43#ifndef __s390x__ 44#ifndef __s390x__
44#define MACHINE_HAS_IEEE (machine_flags & 2) 45#define MACHINE_HAS_IEEE (machine_flags & 2)
diff --git a/include/asm-s390/spinlock.h b/include/asm-s390/spinlock.h
index ce3edf6d63..6b78af1699 100644
--- a/include/asm-s390/spinlock.h
+++ b/include/asm-s390/spinlock.h
@@ -13,6 +13,8 @@
13 13
14#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2) 14#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)
15 15
16#include <linux/smp.h>
17
16static inline int 18static inline int
17_raw_compare_and_swap(volatile unsigned int *lock, 19_raw_compare_and_swap(volatile unsigned int *lock,
18 unsigned int old, unsigned int new) 20 unsigned int old, unsigned int new)
@@ -50,34 +52,46 @@ _raw_compare_and_swap(volatile unsigned int *lock,
50 * (the type definitions are in asm/spinlock_types.h) 52 * (the type definitions are in asm/spinlock_types.h)
51 */ 53 */
52 54
53#define __raw_spin_is_locked(x) ((x)->lock != 0) 55#define __raw_spin_is_locked(x) ((x)->owner_cpu != 0)
54#define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock) 56#define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock)
55#define __raw_spin_unlock_wait(lock) \ 57#define __raw_spin_unlock_wait(lock) \
56 do { while (__raw_spin_is_locked(lock)) cpu_relax(); } while (0) 58 do { while (__raw_spin_is_locked(lock)) \
59 _raw_spin_relax(lock); } while (0)
57 60
58extern void _raw_spin_lock_wait(raw_spinlock_t *lp, unsigned int pc); 61extern void _raw_spin_lock_wait(raw_spinlock_t *, unsigned int pc);
59extern int _raw_spin_trylock_retry(raw_spinlock_t *lp, unsigned int pc); 62extern int _raw_spin_trylock_retry(raw_spinlock_t *, unsigned int pc);
63extern void _raw_spin_relax(raw_spinlock_t *lock);
60 64
61static inline void __raw_spin_lock(raw_spinlock_t *lp) 65static inline void __raw_spin_lock(raw_spinlock_t *lp)
62{ 66{
63 unsigned long pc = 1 | (unsigned long) __builtin_return_address(0); 67 unsigned long pc = 1 | (unsigned long) __builtin_return_address(0);
64 68 int old;
65 if (unlikely(_raw_compare_and_swap(&lp->lock, 0, pc) != 0)) 69
66 _raw_spin_lock_wait(lp, pc); 70 old = _raw_compare_and_swap(&lp->owner_cpu, 0, ~smp_processor_id());
71 if (likely(old == 0)) {
72 lp->owner_pc = pc;
73 return;
74 }
75 _raw_spin_lock_wait(lp, pc);
67} 76}
68 77
69static inline int __raw_spin_trylock(raw_spinlock_t *lp) 78static inline int __raw_spin_trylock(raw_spinlock_t *lp)
70{ 79{
71 unsigned long pc = 1 | (unsigned long) __builtin_return_address(0); 80 unsigned long pc = 1 | (unsigned long) __builtin_return_address(0);
81 int old;
72 82
73 if (likely(_raw_compare_and_swap(&lp->lock, 0, pc) == 0)) 83 old = _raw_compare_and_swap(&lp->owner_cpu, 0, ~smp_processor_id());
84 if (likely(old == 0)) {
85 lp->owner_pc = pc;
74 return 1; 86 return 1;
87 }
75 return _raw_spin_trylock_retry(lp, pc); 88 return _raw_spin_trylock_retry(lp, pc);
76} 89}
77 90
78static inline void __raw_spin_unlock(raw_spinlock_t *lp) 91static inline void __raw_spin_unlock(raw_spinlock_t *lp)
79{ 92{
80 _raw_compare_and_swap(&lp->lock, lp->lock, 0); 93 lp->owner_pc = 0;
94 _raw_compare_and_swap(&lp->owner_cpu, lp->owner_cpu, 0);
81} 95}
82 96
83/* 97/*
@@ -154,4 +168,7 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw)
154 return _raw_write_trylock_retry(rw); 168 return _raw_write_trylock_retry(rw);
155} 169}
156 170
171#define _raw_read_relax(lock) cpu_relax()
172#define _raw_write_relax(lock) cpu_relax()
173
157#endif /* __ASM_SPINLOCK_H */ 174#endif /* __ASM_SPINLOCK_H */
diff --git a/include/asm-s390/spinlock_types.h b/include/asm-s390/spinlock_types.h
index f79a221620..b7ac13f7aa 100644
--- a/include/asm-s390/spinlock_types.h
+++ b/include/asm-s390/spinlock_types.h
@@ -6,16 +6,16 @@
6#endif 6#endif
7 7
8typedef struct { 8typedef struct {
9 volatile unsigned int lock; 9 volatile unsigned int owner_cpu;
10 volatile unsigned int owner_pc;
10} __attribute__ ((aligned (4))) raw_spinlock_t; 11} __attribute__ ((aligned (4))) raw_spinlock_t;
11 12
12#define __RAW_SPIN_LOCK_UNLOCKED { 0 } 13#define __RAW_SPIN_LOCK_UNLOCKED { 0 }
13 14
14typedef struct { 15typedef struct {
15 volatile unsigned int lock; 16 volatile unsigned int lock;
16 volatile unsigned int owner_pc;
17} raw_rwlock_t; 17} raw_rwlock_t;
18 18
19#define __RAW_RW_LOCK_UNLOCKED { 0, 0 } 19#define __RAW_RW_LOCK_UNLOCKED { 0 }
20 20
21#endif 21#endif
diff --git a/include/asm-s390/unistd.h b/include/asm-s390/unistd.h
index 0361ac5dcd..0cccfd83c4 100644
--- a/include/asm-s390/unistd.h
+++ b/include/asm-s390/unistd.h
@@ -523,57 +523,6 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
523# define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND 523# define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND
524# endif 524# endif
525 525
526#ifdef __KERNEL_SYSCALLS__
527
528#include <linux/compiler.h>
529#include <linux/types.h>
530#include <asm/ptrace.h>
531#include <asm/stat.h>
532#include <linux/syscalls.h>
533
534/*
535 * we need this inline - forking from kernel space will result
536 * in NO COPY ON WRITE (!!!), until an execve is executed. This
537 * is no problem, but for the stack. This is handled by not letting
538 * main() use the stack at all after fork(). Thus, no function
539 * calls - which means inline code for fork too, as otherwise we
540 * would use the stack upon exit from 'fork()'.
541 *
542 * Actually only pause and fork are needed inline, so that there
543 * won't be any messing with the stack from main(), but we define
544 * some others too.
545 */
546#define __NR__exit __NR_exit
547static inline _syscall0(pid_t,setsid)
548static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count)
549static inline _syscall3(int,read,int,fd,char *,buf,off_t,count)
550static inline _syscall3(off_t,lseek,int,fd,off_t,offset,int,count)
551static inline _syscall1(int,dup,int,fd)
552static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp)
553static inline _syscall3(int,open,const char *,file,int,flag,int,mode)
554static inline _syscall1(int,close,int,fd)
555static inline _syscall2(long,stat,char *,filename,struct stat *,statbuf)
556
557static inline pid_t waitpid(int pid, int *wait_stat, int flags)
558{
559 return sys_wait4(pid, wait_stat, flags, NULL);
560}
561struct mmap_arg_struct;
562asmlinkage long sys_mmap2(struct mmap_arg_struct __user *arg);
563
564asmlinkage long sys_execve(struct pt_regs regs);
565asmlinkage long sys_clone(struct pt_regs regs);
566asmlinkage long sys_fork(struct pt_regs regs);
567asmlinkage long sys_vfork(struct pt_regs regs);
568asmlinkage long sys_pipe(unsigned long __user *fildes);
569struct sigaction;
570asmlinkage long sys_rt_sigaction(int sig,
571 const struct sigaction __user *act,
572 struct sigaction __user *oact,
573 size_t sigsetsize);
574
575#endif /* __KERNEL_SYSCALLS__ */
576
577/* 526/*
578 * "Conditional" syscalls 527 * "Conditional" syscalls
579 * 528 *
diff --git a/include/asm-sh/.gitignore b/include/asm-sh/.gitignore
new file mode 100644
index 0000000000..9218ef82b6
--- /dev/null
+++ b/include/asm-sh/.gitignore
@@ -0,0 +1,3 @@
1cpu
2mach
3machtypes.h
diff --git a/include/asm-sh/bigsur/io.h b/include/asm-sh/bigsur/io.h
index 939735ee8d..1470ac8d4a 100644
--- a/include/asm-sh/bigsur/io.h
+++ b/include/asm-sh/bigsur/io.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm-sh/io_bigsur.h 2 * include/asm-sh/bigsur/io.h
3 * 3 *
4 * By Dustin McIntire (dustin@sensoria.com) (c)2001 4 * By Dustin McIntire (dustin@sensoria.com) (c)2001
5 * Derived from io_hd64465.h, which bore the message: 5 * Derived from io_hd64465.h, which bore the message:
diff --git a/include/asm-sh/bigsur/serial.h b/include/asm-sh/bigsur/serial.h
index 7233af42f7..a08fa82fe4 100644
--- a/include/asm-sh/bigsur/serial.h
+++ b/include/asm-sh/bigsur/serial.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm-sh/serial-bigsur.h 2 * include/asm-sh/bigsur/serial.h
3 * 3 *
4 * Configuration details for Big Sur 16550 based serial ports 4 * Configuration details for Big Sur 16550 based serial ports
5 * i.e. HD64465, PCMCIA, etc. 5 * i.e. HD64465, PCMCIA, etc.
diff --git a/include/asm-sh/bugs.h b/include/asm-sh/bugs.h
index b4000c8bf3..beeea40f54 100644
--- a/include/asm-sh/bugs.h
+++ b/include/asm-sh/bugs.h
@@ -18,7 +18,7 @@ static void __init check_bugs(void)
18{ 18{
19 extern char *get_cpu_subtype(void); 19 extern char *get_cpu_subtype(void);
20 extern unsigned long loops_per_jiffy; 20 extern unsigned long loops_per_jiffy;
21 char *p= &system_utsname.machine[2]; /* "sh" */ 21 char *p= &init_utsname()->machine[2]; /* "sh" */
22 22
23 cpu_data->loops_per_jiffy = loops_per_jiffy; 23 cpu_data->loops_per_jiffy = loops_per_jiffy;
24 24
diff --git a/include/asm-sh/cpu-sh3/rtc.h b/include/asm-sh/cpu-sh3/rtc.h
deleted file mode 100644
index 2d92667111..0000000000
--- a/include/asm-sh/cpu-sh3/rtc.h
+++ /dev/null
@@ -1,25 +0,0 @@
1#ifndef __ASM_CPU_SH3_RTC_H
2#define __ASM_CPU_SH3_RTC_H
3
4/* SH-3 RTC */
5#define R64CNT 0xfffffec0
6#define RSECCNT 0xfffffec2
7#define RMINCNT 0xfffffec4
8#define RHRCNT 0xfffffec6
9#define RWKCNT 0xfffffec8
10#define RDAYCNT 0xfffffeca
11#define RMONCNT 0xfffffecc
12#define RYRCNT 0xfffffece
13#define RSECAR 0xfffffed0
14#define RMINAR 0xfffffed2
15#define RHRAR 0xfffffed4
16#define RWKAR 0xfffffed6
17#define RDAYAR 0xfffffed8
18#define RMONAR 0xfffffeda
19#define RCR1 0xfffffedc
20#define RCR2 0xfffffede
21
22#define RTC_BIT_INVERTED 0 /* No bug on SH7708, SH7709A */
23
24#endif /* __ASM_CPU_SH3_RTC_H */
25
diff --git a/include/asm-sh/cpu-sh4/rtc.h b/include/asm-sh/cpu-sh4/rtc.h
deleted file mode 100644
index e091e32a67..0000000000
--- a/include/asm-sh/cpu-sh4/rtc.h
+++ /dev/null
@@ -1,25 +0,0 @@
1#ifndef __ASM_CPU_SH4_RTC_H
2#define __ASM_CPU_SH4_RTC_H
3
4/* SH-4 RTC */
5#define R64CNT 0xffc80000
6#define RSECCNT 0xffc80004
7#define RMINCNT 0xffc80008
8#define RHRCNT 0xffc8000c
9#define RWKCNT 0xffc80010
10#define RDAYCNT 0xffc80014
11#define RMONCNT 0xffc80018
12#define RYRCNT 0xffc8001c /* 16bit */
13#define RSECAR 0xffc80020
14#define RMINAR 0xffc80024
15#define RHRAR 0xffc80028
16#define RWKAR 0xffc8002c
17#define RDAYAR 0xffc80030
18#define RMONAR 0xffc80034
19#define RCR1 0xffc80038
20#define RCR2 0xffc8003c
21
22#define RTC_BIT_INVERTED 0x40 /* bug on SH7750, SH7750S */
23
24#endif /* __ASM_CPU_SH4_RTC_H */
25
diff --git a/include/asm-sh/dreamcast/sysasic.h b/include/asm-sh/dreamcast/sysasic.h
index c885853780..7874e3dac7 100644
--- a/include/asm-sh/dreamcast/sysasic.h
+++ b/include/asm-sh/dreamcast/sysasic.h
@@ -1,4 +1,4 @@
1/* include/asm-sh/dc_sysasic.h 1/* include/asm-sh/dreamcast/sysasic.h
2 * 2 *
3 * Definitions for the Dreamcast System ASIC and related peripherals. 3 * Definitions for the Dreamcast System ASIC and related peripherals.
4 * 4 *
diff --git a/include/asm-sh/ec3104/keyboard.h b/include/asm-sh/ec3104/keyboard.h
index 0dee7b05b4..c1253a6831 100644
--- a/include/asm-sh/ec3104/keyboard.h
+++ b/include/asm-sh/ec3104/keyboard.h
@@ -6,8 +6,6 @@ extern char ec3104_kbd_unexpected_up(unsigned char);
6extern void ec3104_kbd_leds(unsigned char); 6extern void ec3104_kbd_leds(unsigned char);
7extern void ec3104_kbd_init_hw(void); 7extern void ec3104_kbd_init_hw(void);
8 8
9#define SYSRQ_KEY 0x54
10
11#define kbd_sysrq_xlate ec3104_kbd_sysrq_xlate 9#define kbd_sysrq_xlate ec3104_kbd_sysrq_xlate
12#define kbd_setkeycode ec3104_kbd_setkeycode 10#define kbd_setkeycode ec3104_kbd_setkeycode
13#define kbd_getkeycode ec3104_kbd_getkeycode 11#define kbd_getkeycode ec3104_kbd_getkeycode
diff --git a/include/asm-sh/elf.h b/include/asm-sh/elf.h
index 3a07ab40ac..fc050fd764 100644
--- a/include/asm-sh/elf.h
+++ b/include/asm-sh/elf.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_SH_ELF_H 1#ifndef __ASM_SH_ELF_H
2#define __ASM_SH_ELF_H 2#define __ASM_SH_ELF_H
3 3
4#include <asm/processor.h>
5#include <asm/auxvec.h> 4#include <asm/auxvec.h>
6#include <asm/ptrace.h> 5#include <asm/ptrace.h>
7#include <asm/user.h> 6#include <asm/user.h>
diff --git a/include/asm-sh/hd64465/io.h b/include/asm-sh/hd64465/io.h
index 1100bcf496..139f1472e5 100644
--- a/include/asm-sh/hd64465/io.h
+++ b/include/asm-sh/hd64465/io.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm-sh/io_hd64465.h 2 * include/asm-sh/hd64465/io.h
3 * 3 *
4 * By Greg Banks <gbanks@pocketpenguins.com> 4 * By Greg Banks <gbanks@pocketpenguins.com>
5 * (c) 2000 PocketPenguins Inc. 5 * (c) 2000 PocketPenguins Inc.
diff --git a/include/asm-sh/hs7751rvoip/io.h b/include/asm-sh/hs7751rvoip/io.h
deleted file mode 100644
index 513c851400..0000000000
--- a/include/asm-sh/hs7751rvoip/io.h
+++ /dev/null
@@ -1,39 +0,0 @@
1/*
2 * include/asm-sh/hs7751rvoip/hs7751rvoip.h
3 *
4 * Modified version of io_se.h for the hs7751rvoip-specific functions.
5 *
6 * May be copied or modified under the terms of the GNU General Public
7 * License. See linux/COPYING for more information.
8 *
9 * IO functions for an Renesas Technology sales HS7751RVOIP
10 */
11
12#ifndef _ASM_SH_IO_HS7751RVOIP_H
13#define _ASM_SH_IO_HS7751RVOIP_H
14
15#include <asm/io_generic.h>
16
17extern unsigned char hs7751rvoip_inb(unsigned long port);
18extern unsigned short hs7751rvoip_inw(unsigned long port);
19extern unsigned int hs7751rvoip_inl(unsigned long port);
20
21extern void hs7751rvoip_outb(unsigned char value, unsigned long port);
22extern void hs7751rvoip_outw(unsigned short value, unsigned long port);
23extern void hs7751rvoip_outl(unsigned int value, unsigned long port);
24
25extern unsigned char hs7751rvoip_inb_p(unsigned long port);
26extern void hs7751rvoip_outb_p(unsigned char value, unsigned long port);
27
28extern void hs7751rvoip_insb(unsigned long port, void *addr, unsigned long count);
29extern void hs7751rvoip_insw(unsigned long port, void *addr, unsigned long count);
30extern void hs7751rvoip_insl(unsigned long port, void *addr, unsigned long count);
31extern void hs7751rvoip_outsb(unsigned long port, const void *addr, unsigned long count);
32extern void hs7751rvoip_outsw(unsigned long port, const void *addr, unsigned long count);
33extern void hs7751rvoip_outsl(unsigned long port, const void *addr, unsigned long count);
34
35extern void *hs7751rvoip_ioremap(unsigned long offset, unsigned long size);
36
37extern unsigned long hs7751rvoip_isa_port2addr(unsigned long offset);
38
39#endif /* _ASM_SH_IO_HS7751RVOIP_H */
diff --git a/include/asm-sh/mpc1211/io.h b/include/asm-sh/mpc1211/io.h
index eba8a0b5fd..6298370bec 100644
--- a/include/asm-sh/mpc1211/io.h
+++ b/include/asm-sh/mpc1211/io.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm-sh/io_mpc1211.h 2 * include/asm-sh/mpc1211/io.h
3 * 3 *
4 * Copyright 2001 Saito.K & Jeanne 4 * Copyright 2001 Saito.K & Jeanne
5 * 5 *
diff --git a/include/asm-sh/mpc1211/keyboard.h b/include/asm-sh/mpc1211/keyboard.h
index 71ef4cf424..9020feee7b 100644
--- a/include/asm-sh/mpc1211/keyboard.h
+++ b/include/asm-sh/mpc1211/keyboard.h
@@ -24,7 +24,6 @@ extern void pckbd_leds(unsigned char leds);
24extern void pckbd_init_hw(void); 24extern void pckbd_init_hw(void);
25extern int pckbd_pm_resume(struct pm_dev *, pm_request_t, void *); 25extern int pckbd_pm_resume(struct pm_dev *, pm_request_t, void *);
26extern pm_callback pm_kbd_request_override; 26extern pm_callback pm_kbd_request_override;
27extern unsigned char pckbd_sysrq_xlate[128];
28 27
29#define kbd_setkeycode pckbd_setkeycode 28#define kbd_setkeycode pckbd_setkeycode
30#define kbd_getkeycode pckbd_getkeycode 29#define kbd_getkeycode pckbd_getkeycode
@@ -32,9 +31,6 @@ extern unsigned char pckbd_sysrq_xlate[128];
32#define kbd_unexpected_up pckbd_unexpected_up 31#define kbd_unexpected_up pckbd_unexpected_up
33#define kbd_leds pckbd_leds 32#define kbd_leds pckbd_leds
34#define kbd_init_hw pckbd_init_hw 33#define kbd_init_hw pckbd_init_hw
35#define kbd_sysrq_xlate pckbd_sysrq_xlate
36
37#define SYSRQ_KEY 0x54
38 34
39/* resource allocation */ 35/* resource allocation */
40#define kbd_request_region() 36#define kbd_request_region()
diff --git a/include/asm-sh/rts7751r2d/io.h b/include/asm-sh/rts7751r2d/io.h
deleted file mode 100644
index 2410940205..0000000000
--- a/include/asm-sh/rts7751r2d/io.h
+++ /dev/null
@@ -1,37 +0,0 @@
1/*
2 * include/asm-sh/io_rts7751r2d.h
3 *
4 * Modified version of io_se.h for the rts7751r2d-specific functions.
5 *
6 * May be copied or modified under the terms of the GNU General Public
7 * License. See linux/COPYING for more information.
8 *
9 * IO functions for an Renesas Technology sales RTS7751R2D
10 */
11
12#ifndef _ASM_SH_IO_RTS7751R2D_H
13#define _ASM_SH_IO_RTS7751R2D_H
14
15extern unsigned char rts7751r2d_inb(unsigned long port);
16extern unsigned short rts7751r2d_inw(unsigned long port);
17extern unsigned int rts7751r2d_inl(unsigned long port);
18
19extern void rts7751r2d_outb(unsigned char value, unsigned long port);
20extern void rts7751r2d_outw(unsigned short value, unsigned long port);
21extern void rts7751r2d_outl(unsigned int value, unsigned long port);
22
23extern unsigned char rts7751r2d_inb_p(unsigned long port);
24extern void rts7751r2d_outb_p(unsigned char value, unsigned long port);
25
26extern void rts7751r2d_insb(unsigned long port, void *addr, unsigned long count);
27extern void rts7751r2d_insw(unsigned long port, void *addr, unsigned long count);
28extern void rts7751r2d_insl(unsigned long port, void *addr, unsigned long count);
29extern void rts7751r2d_outsb(unsigned long port, const void *addr, unsigned long count);
30extern void rts7751r2d_outsw(unsigned long port, const void *addr, unsigned long count);
31extern void rts7751r2d_outsl(unsigned long port, const void *addr, unsigned long count);
32
33extern void *rts7751r2d_ioremap(unsigned long offset, unsigned long size);
34
35extern unsigned long rts7751r2d_isa_port2addr(unsigned long offset);
36
37#endif /* _ASM_SH_IO_RTS7751R2D_H */
diff --git a/include/asm-sh/rts7751r2d/rts7751r2d.h b/include/asm-sh/rts7751r2d/rts7751r2d.h
index b112ae221f..796b8fcb81 100644
--- a/include/asm-sh/rts7751r2d/rts7751r2d.h
+++ b/include/asm-sh/rts7751r2d/rts7751r2d.h
@@ -68,4 +68,7 @@
68#define IRQ_PCISLOT2 10 /* PCI Slot #2 IRQ */ 68#define IRQ_PCISLOT2 10 /* PCI Slot #2 IRQ */
69#define IRQ_EXTENTION 11 /* EXTn IRQ */ 69#define IRQ_EXTENTION 11 /* EXTn IRQ */
70 70
71#define __IO_PREFIX rts7751r2d
72#include <asm/io_generic.h>
73
71#endif /* __ASM_SH_RENESAS_RTS7751R2D */ 74#endif /* __ASM_SH_RENESAS_RTS7751R2D */
diff --git a/include/asm-sh/sfp-machine.h b/include/asm-sh/sfp-machine.h
index 8a6399a8cf..d3c548443f 100644
--- a/include/asm-sh/sfp-machine.h
+++ b/include/asm-sh/sfp-machine.h
@@ -25,8 +25,6 @@
25#ifndef _SFP_MACHINE_H 25#ifndef _SFP_MACHINE_H
26#define _SFP_MACHINE_H 26#define _SFP_MACHINE_H
27 27
28#include <linux/config.h>
29
30#define _FP_W_TYPE_SIZE 32 28#define _FP_W_TYPE_SIZE 32
31#define _FP_W_TYPE unsigned long 29#define _FP_W_TYPE unsigned long
32#define _FP_WS_TYPE signed long 30#define _FP_WS_TYPE signed long
diff --git a/include/asm-sh/spinlock.h b/include/asm-sh/spinlock.h
index 846322d4c3..2586eef07d 100644
--- a/include/asm-sh/spinlock.h
+++ b/include/asm-sh/spinlock.h
@@ -88,7 +88,14 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw)
88 __raw_spin_unlock(&rw->lock); 88 __raw_spin_unlock(&rw->lock);
89} 89}
90 90
91#define __raw_read_trylock(lock) generic__raw_read_trylock(lock) 91static inline int __raw_read_trylock(raw_rwlock_t *lock)
92{
93 atomic_t *count = (atomic_t*)lock;
94 if (atomic_dec_return(count) >= 0)
95 return 1;
96 atomic_inc(count);
97 return 0;
98}
92 99
93static inline int __raw_write_trylock(raw_rwlock_t *rw) 100static inline int __raw_write_trylock(raw_rwlock_t *rw)
94{ 101{
@@ -100,4 +107,8 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw)
100 return 0; 107 return 0;
101} 108}
102 109
110#define _raw_spin_relax(lock) cpu_relax()
111#define _raw_read_relax(lock) cpu_relax()
112#define _raw_write_relax(lock) cpu_relax()
113
103#endif /* __ASM_SH_SPINLOCK_H */ 114#endif /* __ASM_SH_SPINLOCK_H */
diff --git a/include/asm-sh/string.h b/include/asm-sh/string.h
index 3e0cff04ca..95bc7db006 100644
--- a/include/asm-sh/string.h
+++ b/include/asm-sh/string.h
@@ -1,13 +1,15 @@
1#ifndef __ASM_SH_STRING_H 1#ifndef __ASM_SH_STRING_H
2#define __ASM_SH_STRING_H 2#define __ASM_SH_STRING_H
3 3
4#ifdef __KERNEL__
5
4/* 6/*
5 * Copyright (C) 1999 Niibe Yutaka 7 * Copyright (C) 1999 Niibe Yutaka
6 * But consider these trivial functions to be public domain. 8 * But consider these trivial functions to be public domain.
7 */ 9 */
8 10
9#define __HAVE_ARCH_STRCPY 11#define __HAVE_ARCH_STRCPY
10static __inline__ char *strcpy(char *__dest, const char *__src) 12static inline char *strcpy(char *__dest, const char *__src)
11{ 13{
12 register char *__xdest = __dest; 14 register char *__xdest = __dest;
13 unsigned long __dummy; 15 unsigned long __dummy;
@@ -26,7 +28,7 @@ static __inline__ char *strcpy(char *__dest, const char *__src)
26} 28}
27 29
28#define __HAVE_ARCH_STRNCPY 30#define __HAVE_ARCH_STRNCPY
29static __inline__ char *strncpy(char *__dest, const char *__src, size_t __n) 31static inline char *strncpy(char *__dest, const char *__src, size_t __n)
30{ 32{
31 register char *__xdest = __dest; 33 register char *__xdest = __dest;
32 unsigned long __dummy; 34 unsigned long __dummy;
@@ -52,7 +54,7 @@ static __inline__ char *strncpy(char *__dest, const char *__src, size_t __n)
52} 54}
53 55
54#define __HAVE_ARCH_STRCMP 56#define __HAVE_ARCH_STRCMP
55static __inline__ int strcmp(const char *__cs, const char *__ct) 57static inline int strcmp(const char *__cs, const char *__ct)
56{ 58{
57 register int __res; 59 register int __res;
58 unsigned long __dummy; 60 unsigned long __dummy;
@@ -78,7 +80,7 @@ static __inline__ int strcmp(const char *__cs, const char *__ct)
78} 80}
79 81
80#define __HAVE_ARCH_STRNCMP 82#define __HAVE_ARCH_STRNCMP
81static __inline__ int strncmp(const char *__cs, const char *__ct, size_t __n) 83static inline int strncmp(const char *__cs, const char *__ct, size_t __n)
82{ 84{
83 register int __res; 85 register int __res;
84 unsigned long __dummy; 86 unsigned long __dummy;
@@ -124,4 +126,9 @@ extern void *memchr(const void *__s, int __c, size_t __n);
124#define __HAVE_ARCH_STRLEN 126#define __HAVE_ARCH_STRLEN
125extern size_t strlen(const char *); 127extern size_t strlen(const char *);
126 128
129/* arch/sh/lib/strcasecmp.c */
130extern int strcasecmp(const char *, const char *);
131
132#endif /* __KERNEL__ */
133
127#endif /* __ASM_SH_STRING_H */ 134#endif /* __ASM_SH_STRING_H */
diff --git a/include/asm-sh/unistd.h b/include/asm-sh/unistd.h
index 5d5e9f94de..f1a0cbc966 100644
--- a/include/asm-sh/unistd.h
+++ b/include/asm-sh/unistd.h
@@ -472,76 +472,6 @@ __syscall_return(type,__sc0); \
472#define __ARCH_WANT_SYS_RT_SIGACTION 472#define __ARCH_WANT_SYS_RT_SIGACTION
473#define __ARCH_WANT_SYS_RT_SIGSUSPEND 473#define __ARCH_WANT_SYS_RT_SIGSUSPEND
474 474
475#ifdef __KERNEL_SYSCALLS__
476
477#include <linux/compiler.h>
478#include <linux/types.h>
479#include <linux/linkage.h>
480#include <asm/ptrace.h>
481
482/*
483 * we need this inline - forking from kernel space will result
484 * in NO COPY ON WRITE (!!!), until an execve is executed. This
485 * is no problem, but for the stack. This is handled by not letting
486 * main() use the stack at all after fork(). Thus, no function
487 * calls - which means inline code for fork too, as otherwise we
488 * would use the stack upon exit from 'fork()'.
489 *
490 * Actually only pause and fork are needed inline, so that there
491 * won't be any messing with the stack from main(), but we define
492 * some others too.
493 */
494#define __NR__exit __NR_exit
495static __inline__ _syscall0(int,pause)
496static __inline__ _syscall0(int,sync)
497static __inline__ _syscall0(pid_t,setsid)
498static __inline__ _syscall3(int,write,int,fd,const char *,buf,off_t,count)
499static __inline__ _syscall3(int,read,int,fd,char *,buf,off_t,count)
500static __inline__ _syscall3(off_t,lseek,int,fd,off_t,offset,int,count)
501static __inline__ _syscall1(int,dup,int,fd)
502static __inline__ _syscall3(int,execve,const char *,file,char **,argv,char **,envp)
503static __inline__ _syscall3(int,open,const char *,file,int,flag,int,mode)
504static __inline__ _syscall1(int,close,int,fd)
505static __inline__ _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options)
506static __inline__ _syscall1(int,delete_module,const char *,name)
507
508static __inline__ pid_t wait(int * wait_stat)
509{
510 return waitpid(-1,wait_stat,0);
511}
512
513asmlinkage long sys_mmap2(
514 unsigned long addr, unsigned long len,
515 unsigned long prot, unsigned long flags,
516 unsigned long fd, unsigned long pgoff);
517asmlinkage int sys_execve(char *ufilename, char **uargv,
518 char **uenvp, unsigned long r7,
519 struct pt_regs regs);
520asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp,
521 unsigned long parent_tidptr,
522 unsigned long child_tidptr,
523 struct pt_regs regs);
524asmlinkage int sys_fork(unsigned long r4, unsigned long r5,
525 unsigned long r6, unsigned long r7,
526 struct pt_regs regs);
527asmlinkage int sys_vfork(unsigned long r4, unsigned long r5,
528 unsigned long r6, unsigned long r7,
529 struct pt_regs regs);
530asmlinkage int sys_pipe(unsigned long r4, unsigned long r5,
531 unsigned long r6, unsigned long r7,
532 struct pt_regs regs);
533asmlinkage ssize_t sys_pread_wrapper(unsigned int fd, char *buf,
534 size_t count, long dummy, loff_t pos);
535asmlinkage ssize_t sys_pwrite_wrapper(unsigned int fd, const char *buf,
536 size_t count, long dummy, loff_t pos);
537struct sigaction;
538asmlinkage long sys_rt_sigaction(int sig,
539 const struct sigaction __user *act,
540 struct sigaction __user *oact,
541 size_t sigsetsize);
542
543#endif /* __KERNEL_SYSCALLS__ */
544
545/* 475/*
546 * "Conditional" syscalls 476 * "Conditional" syscalls
547 * 477 *
diff --git a/include/asm-sh64/keyboard.h b/include/asm-sh64/keyboard.h
index 1fab96d792..0b01c3beb2 100644
--- a/include/asm-sh64/keyboard.h
+++ b/include/asm-sh64/keyboard.h
@@ -30,7 +30,6 @@ extern int pckbd_translate(unsigned char scancode, unsigned char *keycode,
30extern char pckbd_unexpected_up(unsigned char keycode); 30extern char pckbd_unexpected_up(unsigned char keycode);
31extern void pckbd_leds(unsigned char leds); 31extern void pckbd_leds(unsigned char leds);
32extern void pckbd_init_hw(void); 32extern void pckbd_init_hw(void);
33extern unsigned char pckbd_sysrq_xlate[128];
34 33
35#define kbd_setkeycode pckbd_setkeycode 34#define kbd_setkeycode pckbd_setkeycode
36#define kbd_getkeycode pckbd_getkeycode 35#define kbd_getkeycode pckbd_getkeycode
@@ -38,9 +37,6 @@ extern unsigned char pckbd_sysrq_xlate[128];
38#define kbd_unexpected_up pckbd_unexpected_up 37#define kbd_unexpected_up pckbd_unexpected_up
39#define kbd_leds pckbd_leds 38#define kbd_leds pckbd_leds
40#define kbd_init_hw pckbd_init_hw 39#define kbd_init_hw pckbd_init_hw
41#define kbd_sysrq_xlate pckbd_sysrq_xlate
42
43#define SYSRQ_KEY 0x54
44 40
45/* resource allocation */ 41/* resource allocation */
46#define kbd_request_region() 42#define kbd_request_region()
diff --git a/include/asm-sh64/serial.h b/include/asm-sh64/serial.h
index 29c9be1511..e8d7b3f2da 100644
--- a/include/asm-sh64/serial.h
+++ b/include/asm-sh64/serial.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm-sh/serial.h 2 * include/asm-sh64/serial.h
3 * 3 *
4 * Configuration details for 8250, 16450, 16550, etc. serial ports 4 * Configuration details for 8250, 16450, 16550, etc. serial ports
5 */ 5 */
diff --git a/include/asm-sh64/timex.h b/include/asm-sh64/timex.h
index af0b792696..163e2b62fe 100644
--- a/include/asm-sh64/timex.h
+++ b/include/asm-sh64/timex.h
@@ -17,9 +17,6 @@
17 17
18#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ 18#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */
19#define CLOCK_TICK_FACTOR 20 /* Factor of both 1000000 and CLOCK_TICK_RATE */ 19#define CLOCK_TICK_FACTOR 20 /* Factor of both 1000000 and CLOCK_TICK_RATE */
20#define FINETUNE ((((((long)LATCH * HZ - CLOCK_TICK_RATE) << SHIFT_HZ) * \
21 (1000000/CLOCK_TICK_FACTOR) / (CLOCK_TICK_RATE/CLOCK_TICK_FACTOR)) \
22 << (SHIFT_SCALE-SHIFT_HZ)) / HZ)
23 20
24typedef unsigned long cycles_t; 21typedef unsigned long cycles_t;
25 22
diff --git a/include/asm-sh64/unistd.h b/include/asm-sh64/unistd.h
index c113566bef..ee7828b27a 100644
--- a/include/asm-sh64/unistd.h
+++ b/include/asm-sh64/unistd.h
@@ -513,47 +513,6 @@ __syscall_return(type,__sc0); \
513#define __ARCH_WANT_SYS_SIGPROCMASK 513#define __ARCH_WANT_SYS_SIGPROCMASK
514#define __ARCH_WANT_SYS_RT_SIGACTION 514#define __ARCH_WANT_SYS_RT_SIGACTION
515 515
516#ifdef __KERNEL_SYSCALLS__
517
518/* Copy from sh */
519#include <linux/compiler.h>
520#include <linux/types.h>
521#include <asm/ptrace.h>
522
523/*
524 * we need this inline - forking from kernel space will result
525 * in NO COPY ON WRITE (!!!), until an execve is executed. This
526 * is no problem, but for the stack. This is handled by not letting
527 * main() use the stack at all after fork(). Thus, no function
528 * calls - which means inline code for fork too, as otherwise we
529 * would use the stack upon exit from 'fork()'.
530 *
531 * Actually only pause and fork are needed inline, so that there
532 * won't be any messing with the stack from main(), but we define
533 * some others too.
534 */
535#define __NR__exit __NR_exit
536static inline _syscall0(int,pause)
537static inline _syscall1(int,setup,int,magic)
538static inline _syscall0(int,sync)
539static inline _syscall0(pid_t,setsid)
540static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count)
541static inline _syscall3(int,read,int,fd,char *,buf,off_t,count)
542static inline _syscall3(off_t,lseek,int,fd,off_t,offset,int,count)
543static inline _syscall1(int,dup,int,fd)
544static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp)
545static inline _syscall3(int,open,const char *,file,int,flag,int,mode)
546static inline _syscall1(int,close,int,fd)
547static inline _syscall1(int,_exit,int,exitcode)
548static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options)
549static inline _syscall1(int,delete_module,const char *,name)
550
551static inline pid_t wait(int * wait_stat)
552{
553 return waitpid(-1,wait_stat,0);
554}
555#endif /* __KERNEL_SYSCALLS__ */
556
557/* 516/*
558 * "Conditional" syscalls 517 * "Conditional" syscalls
559 * 518 *
diff --git a/include/asm-sparc/reg.h b/include/asm-sparc/reg.h
index ed60ebec59..ea0a7e590b 100644
--- a/include/asm-sparc/reg.h
+++ b/include/asm-sparc/reg.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/asm-sparc/reg.h 2 * linux/include/asm-sparc/reg.h
3 * Layout of the registers as expected by gdb on the Sparc 3 * Layout of the registers as expected by gdb on the Sparc
4 * we should replace the user.h definitions with those in 4 * we should replace the user.h definitions with those in
5 * this file, we don't even use the other 5 * this file, we don't even use the other
diff --git a/include/asm-sparc/spinlock.h b/include/asm-sparc/spinlock.h
index 1c75474ba1..557d08959d 100644
--- a/include/asm-sparc/spinlock.h
+++ b/include/asm-sparc/spinlock.h
@@ -154,6 +154,10 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw)
154#define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock) 154#define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock)
155#define __raw_read_trylock(lock) generic__raw_read_trylock(lock) 155#define __raw_read_trylock(lock) generic__raw_read_trylock(lock)
156 156
157#define _raw_spin_relax(lock) cpu_relax()
158#define _raw_read_relax(lock) cpu_relax()
159#define _raw_write_relax(lock) cpu_relax()
160
157#define __raw_read_can_lock(rw) (!((rw)->lock & 0xff)) 161#define __raw_read_can_lock(rw) (!((rw)->lock & 0xff))
158#define __raw_write_can_lock(rw) (!(rw)->lock) 162#define __raw_write_can_lock(rw) (!(rw)->lock)
159 163
diff --git a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h
index 2553762465..c7a495afc8 100644
--- a/include/asm-sparc/unistd.h
+++ b/include/asm-sparc/unistd.h
@@ -478,53 +478,6 @@ return -1; \
478#define __ARCH_WANT_SYS_SIGPROCMASK 478#define __ARCH_WANT_SYS_SIGPROCMASK
479#define __ARCH_WANT_SYS_RT_SIGSUSPEND 479#define __ARCH_WANT_SYS_RT_SIGSUSPEND
480 480
481#ifdef __KERNEL_SYSCALLS__
482
483#include <linux/compiler.h>
484#include <linux/types.h>
485
486/*
487 * we need this inline - forking from kernel space will result
488 * in NO COPY ON WRITE (!!!), until an execve is executed. This
489 * is no problem, but for the stack. This is handled by not letting
490 * main() use the stack at all after fork(). Thus, no function
491 * calls - which means inline code for fork too, as otherwise we
492 * would use the stack upon exit from 'fork()'.
493 *
494 * Actually only pause and fork are needed inline, so that there
495 * won't be any messing with the stack from main(), but we define
496 * some others too.
497 */
498#define __NR__exit __NR_exit
499static __inline__ _syscall0(pid_t,setsid)
500static __inline__ _syscall3(int,write,int,fd,__const__ char *,buf,off_t,count)
501static __inline__ _syscall3(int,read,int,fd,char *,buf,off_t,count)
502static __inline__ _syscall3(off_t,lseek,int,fd,off_t,offset,int,count)
503static __inline__ _syscall1(int,dup,int,fd)
504static __inline__ _syscall3(int,execve,__const__ char *,file,char **,argv,char **,envp)
505static __inline__ _syscall3(int,open,__const__ char *,file,int,flag,int,mode)
506static __inline__ _syscall1(int,close,int,fd)
507static __inline__ _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options)
508
509#include <linux/linkage.h>
510
511asmlinkage unsigned long sys_mmap(
512 unsigned long addr, unsigned long len,
513 unsigned long prot, unsigned long flags,
514 unsigned long fd, unsigned long off);
515asmlinkage unsigned long sys_mmap2(
516 unsigned long addr, unsigned long len,
517 unsigned long prot, unsigned long flags,
518 unsigned long fd, unsigned long pgoff);
519struct sigaction;
520asmlinkage long sys_rt_sigaction(int sig,
521 const struct sigaction __user *act,
522 struct sigaction __user *oact,
523 void __user *restorer,
524 size_t sigsetsize);
525
526#endif /* __KERNEL_SYSCALLS__ */
527
528/* 481/*
529 * "Conditional" syscalls 482 * "Conditional" syscalls
530 * 483 *
diff --git a/include/asm-sparc64/compat_signal.h b/include/asm-sparc64/compat_signal.h
new file mode 100644
index 0000000000..7aefa30132
--- /dev/null
+++ b/include/asm-sparc64/compat_signal.h
@@ -0,0 +1,30 @@
1#ifndef _COMPAT_SIGNAL_H
2#define _COMPAT_SIGNAL_H
3
4#include <linux/config.h>
5#include <linux/compat.h>
6#include <asm/signal.h>
7
8#ifdef CONFIG_COMPAT
9struct __new_sigaction32 {
10 unsigned sa_handler;
11 unsigned int sa_flags;
12 unsigned sa_restorer; /* not used by Linux/SPARC yet */
13 compat_sigset_t sa_mask;
14};
15
16struct __old_sigaction32 {
17 unsigned sa_handler;
18 compat_old_sigset_t sa_mask;
19 unsigned int sa_flags;
20 unsigned sa_restorer; /* not used by Linux/SPARC yet */
21};
22
23typedef struct sigaltstack32 {
24 u32 ss_sp;
25 int ss_flags;
26 compat_size_t ss_size;
27} stack_t32;
28#endif
29
30#endif /* !(_COMPAT_SIGNAL_H) */
diff --git a/include/asm-sparc64/signal.h b/include/asm-sparc64/signal.h
index 9968871103..fa6f467389 100644
--- a/include/asm-sparc64/signal.h
+++ b/include/asm-sparc64/signal.h
@@ -8,7 +8,6 @@
8#ifndef __ASSEMBLY__ 8#ifndef __ASSEMBLY__
9#include <linux/personality.h> 9#include <linux/personality.h>
10#include <linux/types.h> 10#include <linux/types.h>
11#include <linux/compat.h>
12#endif 11#endif
13#endif 12#endif
14 13
@@ -167,23 +166,6 @@ struct __new_sigaction {
167 __new_sigset_t sa_mask; 166 __new_sigset_t sa_mask;
168}; 167};
169 168
170#ifdef __KERNEL__
171
172#ifdef CONFIG_COMPAT
173struct __new_sigaction32 {
174 unsigned sa_handler;
175 unsigned int sa_flags;
176 unsigned sa_restorer; /* not used by Linux/SPARC yet */
177 compat_sigset_t sa_mask;
178};
179#endif
180
181struct k_sigaction {
182 struct __new_sigaction sa;
183 void __user *ka_restorer;
184};
185#endif
186
187struct __old_sigaction { 169struct __old_sigaction {
188 __sighandler_t sa_handler; 170 __sighandler_t sa_handler;
189 __old_sigset_t sa_mask; 171 __old_sigset_t sa_mask;
@@ -191,19 +173,6 @@ struct __old_sigaction {
191 void (*sa_restorer)(void); /* not used by Linux/SPARC yet */ 173 void (*sa_restorer)(void); /* not used by Linux/SPARC yet */
192}; 174};
193 175
194#ifdef __KERNEL__
195
196#ifdef CONFIG_COMPAT
197struct __old_sigaction32 {
198 unsigned sa_handler;
199 compat_old_sigset_t sa_mask;
200 unsigned int sa_flags;
201 unsigned sa_restorer; /* not used by Linux/SPARC yet */
202};
203#endif
204
205#endif
206
207typedef struct sigaltstack { 176typedef struct sigaltstack {
208 void __user *ss_sp; 177 void __user *ss_sp;
209 int ss_flags; 178 int ss_flags;
@@ -212,13 +181,10 @@ typedef struct sigaltstack {
212 181
213#ifdef __KERNEL__ 182#ifdef __KERNEL__
214 183
215#ifdef CONFIG_COMPAT 184struct k_sigaction {
216typedef struct sigaltstack32 { 185 struct __new_sigaction sa;
217 u32 ss_sp; 186 void __user *ka_restorer;
218 int ss_flags; 187};
219 compat_size_t ss_size;
220} stack_t32;
221#endif
222 188
223struct signal_deliver_cookie { 189struct signal_deliver_cookie {
224 int restart_syscall; 190 int restart_syscall;
diff --git a/include/asm-sparc64/spinlock.h b/include/asm-sparc64/spinlock.h
index bd5ffc76bc..0006fe9f8c 100644
--- a/include/asm-sparc64/spinlock.h
+++ b/include/asm-sparc64/spinlock.h
@@ -241,6 +241,10 @@ static int inline __write_trylock(raw_rwlock_t *lock)
241#define __raw_read_can_lock(rw) (!((rw)->lock & 0x80000000UL)) 241#define __raw_read_can_lock(rw) (!((rw)->lock & 0x80000000UL))
242#define __raw_write_can_lock(rw) (!(rw)->lock) 242#define __raw_write_can_lock(rw) (!(rw)->lock)
243 243
244#define _raw_spin_relax(lock) cpu_relax()
245#define _raw_read_relax(lock) cpu_relax()
246#define _raw_write_relax(lock) cpu_relax()
247
244#endif /* !(__ASSEMBLY__) */ 248#endif /* !(__ASSEMBLY__) */
245 249
246#endif /* !(__SPARC64_SPINLOCK_H) */ 250#endif /* !(__SPARC64_SPINLOCK_H) */
diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h
index badc73fdcb..124cf07671 100644
--- a/include/asm-sparc64/unistd.h
+++ b/include/asm-sparc64/unistd.h
@@ -445,48 +445,6 @@ if (__res>=0) \
445errno = -__res; \ 445errno = -__res; \
446return -1; \ 446return -1; \
447} 447}
448#ifdef __KERNEL_SYSCALLS__
449
450#include <linux/compiler.h>
451#include <linux/types.h>
452
453/*
454 * we need this inline - forking from kernel space will result
455 * in NO COPY ON WRITE (!!!), until an execve is executed. This
456 * is no problem, but for the stack. This is handled by not letting
457 * main() use the stack at all after fork(). Thus, no function
458 * calls - which means inline code for fork too, as otherwise we
459 * would use the stack upon exit from 'fork()'.
460 *
461 * Actually only pause and fork are needed inline, so that there
462 * won't be any messing with the stack from main(), but we define
463 * some others too.
464 */
465#define __NR__exit __NR_exit
466static __inline__ _syscall0(pid_t,setsid)
467static __inline__ _syscall3(int,write,int,fd,__const__ char *,buf,off_t,count)
468static __inline__ _syscall3(int,read,int,fd,char *,buf,off_t,count)
469static __inline__ _syscall3(off_t,lseek,int,fd,off_t,offset,int,count)
470static __inline__ _syscall1(int,dup,int,fd)
471static __inline__ _syscall3(int,execve,__const__ char *,file,char **,argv,char **,envp)
472static __inline__ _syscall3(int,open,__const__ char *,file,int,flag,int,mode)
473static __inline__ _syscall1(int,close,int,fd)
474static __inline__ _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options)
475
476#include <linux/linkage.h>
477
478asmlinkage unsigned long sys_mmap(
479 unsigned long addr, unsigned long len,
480 unsigned long prot, unsigned long flags,
481 unsigned long fd, unsigned long off);
482struct sigaction;
483asmlinkage long sys_rt_sigaction(int sig,
484 const struct sigaction __user *act,
485 struct sigaction __user *oact,
486 void __user *restorer,
487 size_t sigsetsize);
488
489#endif /* __KERNEL_SYSCALLS__ */
490 448
491/* sysconf options, for SunOS compatibility */ 449/* sysconf options, for SunOS compatibility */
492#define _SC_ARG_MAX 1 450#define _SC_ARG_MAX 1
diff --git a/include/asm-um/unistd.h b/include/asm-um/unistd.h
index afccfcaa9e..732c83f04c 100644
--- a/include/asm-um/unistd.h
+++ b/include/asm-um/unistd.h
@@ -37,34 +37,6 @@ extern int um_execve(const char *file, char *const argv[], char *const env[]);
37#define __ARCH_WANT_SYS_RT_SIGSUSPEND 37#define __ARCH_WANT_SYS_RT_SIGSUSPEND
38#endif 38#endif
39 39
40#ifdef __KERNEL_SYSCALLS__
41
42#include <linux/compiler.h>
43#include <linux/types.h>
44
45static inline int execve(const char *filename, char *const argv[],
46 char *const envp[])
47{
48 mm_segment_t fs;
49 int ret;
50
51 fs = get_fs();
52 set_fs(KERNEL_DS);
53 ret = um_execve(filename, argv, envp);
54 set_fs(fs);
55
56 if (ret >= 0)
57 return ret;
58
59 errno = -(long)ret;
60 return -1;
61}
62
63int sys_execve(char *file, char **argv, char **env);
64
65#endif /* __KERNEL_SYSCALLS__ */
66
67#undef __KERNEL_SYSCALLS__
68#include "asm/arch/unistd.h" 40#include "asm/arch/unistd.h"
69 41
70#endif /* _UM_UNISTD_H_*/ 42#endif /* _UM_UNISTD_H_*/
diff --git a/include/asm-v850/unistd.h b/include/asm-v850/unistd.h
index 552b7c873a..737401e7d3 100644
--- a/include/asm-v850/unistd.h
+++ b/include/asm-v850/unistd.h
@@ -387,57 +387,6 @@ type name (atype a, btype b, ctype c, dtype d, etype e, ftype f) \
387#define __ARCH_WANT_SYS_SIGPROCMASK 387#define __ARCH_WANT_SYS_SIGPROCMASK
388#define __ARCH_WANT_SYS_RT_SIGACTION 388#define __ARCH_WANT_SYS_RT_SIGACTION
389 389
390#ifdef __KERNEL_SYSCALLS__
391
392#include <linux/compiler.h>
393#include <linux/types.h>
394
395/*
396 * we need this inline - forking from kernel space will result
397 * in NO COPY ON WRITE (!!!), until an execve is executed. This
398 * is no problem, but for the stack. This is handled by not letting
399 * main() use the stack at all after fork(). Thus, no function
400 * calls - which means inline code for fork too, as otherwise we
401 * would use the stack upon exit from 'fork()'.
402 *
403 * Actually only pause and fork are needed inline, so that there
404 * won't be any messing with the stack from main(), but we define
405 * some others too.
406 */
407#define __NR__exit __NR_exit
408extern inline _syscall0(pid_t,setsid)
409extern inline _syscall3(int,write,int,fd,const char *,buf,off_t,count)
410extern inline _syscall3(int,read,int,fd,char *,buf,off_t,count)
411extern inline _syscall3(off_t,lseek,int,fd,off_t,offset,int,count)
412extern inline _syscall1(int,dup,int,fd)
413extern inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp)
414extern inline _syscall3(int,open,const char *,file,int,flag,int,mode)
415extern inline _syscall1(int,close,int,fd)
416extern inline _syscall1(int,_exit,int,exitcode)
417extern inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options)
418
419extern inline pid_t wait(int * wait_stat)
420{
421 return waitpid (-1, wait_stat, 0);
422}
423
424unsigned long sys_mmap(unsigned long addr, size_t len,
425 unsigned long prot, unsigned long flags,
426 unsigned long fd, off_t offset);
427unsigned long sys_mmap2(unsigned long addr, size_t len,
428 unsigned long prot, unsigned long flags,
429 unsigned long fd, unsigned long pgoff);
430struct pt_regs;
431int sys_execve (char *name, char **argv, char **envp, struct pt_regs *regs);
432int sys_pipe (int *fildes);
433struct sigaction;
434asmlinkage long sys_rt_sigaction(int sig,
435 const struct sigaction __user *act,
436 struct sigaction __user *oact,
437 size_t sigsetsize);
438
439#endif /* __KERNEL_SYSCALLS__ */
440
441/* 390/*
442 * "Conditional" syscalls 391 * "Conditional" syscalls
443 */ 392 */
diff --git a/include/asm-x86_64/cache.h b/include/asm-x86_64/cache.h
index ed8a9d2527..052df758ae 100644
--- a/include/asm-x86_64/cache.h
+++ b/include/asm-x86_64/cache.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm-x8664/cache.h 2 * include/asm-x86_64/cache.h
3 */ 3 */
4#ifndef __ARCH_X8664_CACHE_H 4#ifndef __ARCH_X8664_CACHE_H
5#define __ARCH_X8664_CACHE_H 5#define __ARCH_X8664_CACHE_H
diff --git a/include/asm-x86_64/hardirq.h b/include/asm-x86_64/hardirq.h
index 64a65ce2f4..95d5e090ed 100644
--- a/include/asm-x86_64/hardirq.h
+++ b/include/asm-x86_64/hardirq.h
@@ -6,6 +6,9 @@
6#include <asm/pda.h> 6#include <asm/pda.h>
7#include <asm/apic.h> 7#include <asm/apic.h>
8 8
9/* We can have at most NR_VECTORS irqs routed to a cpu at a time */
10#define MAX_HARDIRQS_PER_CPU NR_VECTORS
11
9#define __ARCH_IRQ_STAT 1 12#define __ARCH_IRQ_STAT 1
10 13
11#define local_softirq_pending() read_pda(__softirq_pending) 14#define local_softirq_pending() read_pda(__softirq_pending)
diff --git a/include/asm-x86_64/hw_irq.h b/include/asm-x86_64/hw_irq.h
index 48a4a5364e..53d0d9fd10 100644
--- a/include/asm-x86_64/hw_irq.h
+++ b/include/asm-x86_64/hw_irq.h
@@ -19,8 +19,7 @@
19#include <asm/irq.h> 19#include <asm/irq.h>
20#include <linux/profile.h> 20#include <linux/profile.h>
21#include <linux/smp.h> 21#include <linux/smp.h>
22 22#include <linux/percpu.h>
23struct hw_interrupt_type;
24#endif 23#endif
25 24
26#define NMI_VECTOR 0x02 25#define NMI_VECTOR 0x02
@@ -75,9 +74,10 @@ struct hw_interrupt_type;
75 74
76 75
77#ifndef __ASSEMBLY__ 76#ifndef __ASSEMBLY__
78extern u8 irq_vector[NR_IRQ_VECTORS]; 77extern unsigned int irq_vector[NR_IRQ_VECTORS];
78typedef int vector_irq_t[NR_VECTORS];
79DECLARE_PER_CPU(vector_irq_t, vector_irq);
79#define IO_APIC_VECTOR(irq) (irq_vector[irq]) 80#define IO_APIC_VECTOR(irq) (irq_vector[irq])
80#define AUTO_ASSIGN -1
81 81
82/* 82/*
83 * Various low-level irq details needed by irq.c, process.c, 83 * Various low-level irq details needed by irq.c, process.c,
diff --git a/include/asm-x86_64/hypertransport.h b/include/asm-x86_64/hypertransport.h
new file mode 100644
index 0000000000..c16c6ff4bd
--- /dev/null
+++ b/include/asm-x86_64/hypertransport.h
@@ -0,0 +1,42 @@
1#ifndef ASM_HYPERTRANSPORT_H
2#define ASM_HYPERTRANSPORT_H
3
4/*
5 * Constants for x86 Hypertransport Interrupts.
6 */
7
8#define HT_IRQ_LOW_BASE 0xf8000000
9
10#define HT_IRQ_LOW_VECTOR_SHIFT 16
11#define HT_IRQ_LOW_VECTOR_MASK 0x00ff0000
12#define HT_IRQ_LOW_VECTOR(v) (((v) << HT_IRQ_LOW_VECTOR_SHIFT) & HT_IRQ_LOW_VECTOR_MASK)
13
14#define HT_IRQ_LOW_DEST_ID_SHIFT 8
15#define HT_IRQ_LOW_DEST_ID_MASK 0x0000ff00
16#define HT_IRQ_LOW_DEST_ID(v) (((v) << HT_IRQ_LOW_DEST_ID_SHIFT) & HT_IRQ_LOW_DEST_ID_MASK)
17
18#define HT_IRQ_LOW_DM_PHYSICAL 0x0000000
19#define HT_IRQ_LOW_DM_LOGICAL 0x0000040
20
21#define HT_IRQ_LOW_RQEOI_EDGE 0x0000000
22#define HT_IRQ_LOW_RQEOI_LEVEL 0x0000020
23
24
25#define HT_IRQ_LOW_MT_FIXED 0x0000000
26#define HT_IRQ_LOW_MT_ARBITRATED 0x0000004
27#define HT_IRQ_LOW_MT_SMI 0x0000008
28#define HT_IRQ_LOW_MT_NMI 0x000000c
29#define HT_IRQ_LOW_MT_INIT 0x0000010
30#define HT_IRQ_LOW_MT_STARTUP 0x0000014
31#define HT_IRQ_LOW_MT_EXTINT 0x0000018
32#define HT_IRQ_LOW_MT_LINT1 0x000008c
33#define HT_IRQ_LOW_MT_LINT0 0x0000098
34
35#define HT_IRQ_LOW_IRQ_MASKED 0x0000001
36
37
38#define HT_IRQ_HIGH_DEST_ID_SHIFT 0
39#define HT_IRQ_HIGH_DEST_ID_MASK 0x00ffffff
40#define HT_IRQ_HIGH_DEST_ID(v) ((((v) >> 8) << HT_IRQ_HIGH_DEST_ID_SHIFT) & HT_IRQ_HIGH_DEST_ID_MASK)
41
42#endif /* ASM_HYPERTRANSPORT_H */
diff --git a/include/asm-x86_64/io_apic.h b/include/asm-x86_64/io_apic.h
index 5d1b5c68e3..171ec2dc8c 100644
--- a/include/asm-x86_64/io_apic.h
+++ b/include/asm-x86_64/io_apic.h
@@ -10,46 +10,6 @@
10 * Copyright (C) 1997, 1998, 1999, 2000 Ingo Molnar 10 * Copyright (C) 1997, 1998, 1999, 2000 Ingo Molnar
11 */ 11 */
12 12
13#ifdef CONFIG_PCI_MSI
14static inline int use_pci_vector(void) {return 1;}
15static inline void disable_edge_ioapic_vector(unsigned int vector) { }
16static inline void mask_and_ack_level_ioapic_vector(unsigned int vector) { }
17static inline void end_edge_ioapic_vector (unsigned int vector) { }
18#define startup_level_ioapic startup_level_ioapic_vector
19#define shutdown_level_ioapic mask_IO_APIC_vector
20#define enable_level_ioapic unmask_IO_APIC_vector
21#define disable_level_ioapic mask_IO_APIC_vector
22#define mask_and_ack_level_ioapic mask_and_ack_level_ioapic_vector
23#define end_level_ioapic end_level_ioapic_vector
24#define set_ioapic_affinity set_ioapic_affinity_vector
25
26#define startup_edge_ioapic startup_edge_ioapic_vector
27#define shutdown_edge_ioapic disable_edge_ioapic_vector
28#define enable_edge_ioapic unmask_IO_APIC_vector
29#define disable_edge_ioapic disable_edge_ioapic_vector
30#define ack_edge_ioapic ack_edge_ioapic_vector
31#define end_edge_ioapic end_edge_ioapic_vector
32#else
33static inline int use_pci_vector(void) {return 0;}
34static inline void disable_edge_ioapic_irq(unsigned int irq) { }
35static inline void mask_and_ack_level_ioapic_irq(unsigned int irq) { }
36static inline void end_edge_ioapic_irq (unsigned int irq) { }
37#define startup_level_ioapic startup_level_ioapic_irq
38#define shutdown_level_ioapic mask_IO_APIC_irq
39#define enable_level_ioapic unmask_IO_APIC_irq
40#define disable_level_ioapic mask_IO_APIC_irq
41#define mask_and_ack_level_ioapic mask_and_ack_level_ioapic_irq
42#define end_level_ioapic end_level_ioapic_irq
43#define set_ioapic_affinity set_ioapic_affinity_irq
44
45#define startup_edge_ioapic startup_edge_ioapic_irq
46#define shutdown_edge_ioapic disable_edge_ioapic_irq
47#define enable_edge_ioapic unmask_IO_APIC_irq
48#define disable_edge_ioapic disable_edge_ioapic_irq
49#define ack_edge_ioapic ack_edge_ioapic_irq
50#define end_edge_ioapic end_edge_ioapic_irq
51#endif
52
53#define APIC_MISMATCH_DEBUG 13#define APIC_MISMATCH_DEBUG
54 14
55#define IO_APIC_BASE(idx) \ 15#define IO_APIC_BASE(idx) \
@@ -202,13 +162,10 @@ extern int skip_ioapic_setup;
202extern int io_apic_get_version (int ioapic); 162extern int io_apic_get_version (int ioapic);
203extern int io_apic_get_redir_entries (int ioapic); 163extern int io_apic_get_redir_entries (int ioapic);
204extern int io_apic_set_pci_routing (int ioapic, int pin, int irq, int, int); 164extern int io_apic_set_pci_routing (int ioapic, int pin, int irq, int, int);
205extern int timer_uses_ioapic_pin_0;
206#endif 165#endif
207 166
208extern int sis_apic_bug; /* dummy */ 167extern int sis_apic_bug; /* dummy */
209 168
210extern int assign_irq_vector(int irq);
211
212void enable_NMI_through_LVT0 (void * dummy); 169void enable_NMI_through_LVT0 (void * dummy);
213 170
214extern spinlock_t i8259A_lock; 171extern spinlock_t i8259A_lock;
diff --git a/include/asm-x86_64/irq.h b/include/asm-x86_64/irq.h
index 43469d8ab7..5006c6e756 100644
--- a/include/asm-x86_64/irq.h
+++ b/include/asm-x86_64/irq.h
@@ -31,13 +31,8 @@
31 31
32#define FIRST_SYSTEM_VECTOR 0xef /* duplicated in hw_irq.h */ 32#define FIRST_SYSTEM_VECTOR 0xef /* duplicated in hw_irq.h */
33 33
34#ifdef CONFIG_PCI_MSI 34#define NR_IRQS (NR_VECTORS + (32 *NR_CPUS))
35#define NR_IRQS FIRST_SYSTEM_VECTOR
36#define NR_IRQ_VECTORS NR_IRQS 35#define NR_IRQ_VECTORS NR_IRQS
37#else
38#define NR_IRQS 224
39#define NR_IRQ_VECTORS (32 * NR_CPUS)
40#endif
41 36
42static __inline__ int irq_canonicalize(int irq) 37static __inline__ int irq_canonicalize(int irq)
43{ 38{
diff --git a/include/asm-x86_64/msi.h b/include/asm-x86_64/msi.h
deleted file mode 100644
index 3ad2346624..0000000000
--- a/include/asm-x86_64/msi.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * Copyright (C) 2003-2004 Intel
3 * Copyright (C) Tom Long Nguyen (tom.l.nguyen@intel.com)
4 */
5
6#ifndef ASM_MSI_H
7#define ASM_MSI_H
8
9#include <asm/desc.h>
10#include <asm/mach_apic.h>
11#include <asm/smp.h>
12
13#define LAST_DEVICE_VECTOR (FIRST_SYSTEM_VECTOR - 1)
14#define MSI_TARGET_CPU_SHIFT 12
15
16extern struct msi_ops msi_apic_ops;
17
18static inline int msi_arch_init(void)
19{
20 msi_register(&msi_apic_ops);
21 return 0;
22}
23
24#endif /* ASM_MSI_H */
diff --git a/include/asm-x86_64/msidef.h b/include/asm-x86_64/msidef.h
new file mode 100644
index 0000000000..5b8acddb70
--- /dev/null
+++ b/include/asm-x86_64/msidef.h
@@ -0,0 +1,47 @@
1#ifndef ASM_MSIDEF_H
2#define ASM_MSIDEF_H
3
4/*
5 * Constants for Intel APIC based MSI messages.
6 */
7
8/*
9 * Shifts for MSI data
10 */
11
12#define MSI_DATA_VECTOR_SHIFT 0
13#define MSI_DATA_VECTOR_MASK 0x000000ff
14#define MSI_DATA_VECTOR(v) (((v) << MSI_DATA_VECTOR_SHIFT) & MSI_DATA_VECTOR_MASK)
15
16#define MSI_DATA_DELIVERY_MODE_SHIFT 8
17#define MSI_DATA_DELIVERY_FIXED (0 << MSI_DATA_DELIVERY_MODE_SHIFT)
18#define MSI_DATA_DELIVERY_LOWPRI (1 << MSI_DATA_DELIVERY_MODE_SHIFT)
19
20#define MSI_DATA_LEVEL_SHIFT 14
21#define MSI_DATA_LEVEL_DEASSERT (0 << MSI_DATA_LEVEL_SHIFT)
22#define MSI_DATA_LEVEL_ASSERT (1 << MSI_DATA_LEVEL_SHIFT)
23
24#define MSI_DATA_TRIGGER_SHIFT 15
25#define MSI_DATA_TRIGGER_EDGE (0 << MSI_DATA_TRIGGER_SHIFT)
26#define MSI_DATA_TRIGGER_LEVEL (1 << MSI_DATA_TRIGGER_SHIFT)
27
28/*
29 * Shift/mask fields for msi address
30 */
31
32#define MSI_ADDR_BASE_HI 0
33#define MSI_ADDR_BASE_LO 0xfee00000
34
35#define MSI_ADDR_DEST_MODE_SHIFT 2
36#define MSI_ADDR_DEST_MODE_PHYSICAL (0 << MSI_ADDR_DEST_MODE_SHIFT)
37#define MSI_ADDR_DEST_MODE_LOGICAL (1 << MSI_ADDR_DEST_MODE_SHIFT)
38
39#define MSI_ADDR_REDIRECTION_SHIFT 3
40#define MSI_ADDR_REDIRECTION_CPU (0 << MSI_ADDR_REDIRECTION_SHIFT) /* dedicated cpu */
41#define MSI_ADDR_REDIRECTION_LOWPRI (1 << MSI_ADDR_REDIRECTION_SHIFT) /* lowest priority */
42
43#define MSI_ADDR_DEST_ID_SHIFT 12
44#define MSI_ADDR_DEST_ID_MASK 0x00ffff0
45#define MSI_ADDR_DEST_ID(dest) (((dest) << MSI_ADDR_DEST_ID_SHIFT) & MSI_ADDR_DEST_ID_MASK)
46
47#endif /* ASM_MSIDEF_H */
diff --git a/include/asm-x86_64/ptrace.h b/include/asm-x86_64/ptrace.h
index ab827dc381..5ea84dbb1e 100644
--- a/include/asm-x86_64/ptrace.h
+++ b/include/asm-x86_64/ptrace.h
@@ -39,6 +39,8 @@ struct pt_regs {
39#define user_mode(regs) (!!((regs)->cs & 3)) 39#define user_mode(regs) (!!((regs)->cs & 3))
40#define user_mode_vm(regs) user_mode(regs) 40#define user_mode_vm(regs) user_mode(regs)
41#define instruction_pointer(regs) ((regs)->rip) 41#define instruction_pointer(regs) ((regs)->rip)
42#define regs_return_value(regs) ((regs)->rax)
43
42extern unsigned long profile_pc(struct pt_regs *regs); 44extern unsigned long profile_pc(struct pt_regs *regs);
43void signal_fault(struct pt_regs *regs, void __user *frame, char *where); 45void signal_fault(struct pt_regs *regs, void __user *frame, char *where);
44 46
diff --git a/include/asm-x86_64/spinlock.h b/include/asm-x86_64/spinlock.h
index 3daf5b0059..05ef097ba5 100644
--- a/include/asm-x86_64/spinlock.h
+++ b/include/asm-x86_64/spinlock.h
@@ -133,4 +133,8 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw)
133 : "=m" (rw->lock) : : "memory"); 133 : "=m" (rw->lock) : : "memory");
134} 134}
135 135
136#define _raw_spin_relax(lock) cpu_relax()
137#define _raw_read_relax(lock) cpu_relax()
138#define _raw_write_relax(lock) cpu_relax()
139
136#endif /* __ASM_SPINLOCK_H */ 140#endif /* __ASM_SPINLOCK_H */
diff --git a/include/asm-x86_64/topology.h b/include/asm-x86_64/topology.h
index 6e7a2e976b..5c8f49280d 100644
--- a/include/asm-x86_64/topology.h
+++ b/include/asm-x86_64/topology.h
@@ -31,6 +31,7 @@ extern int __node_distance(int, int);
31#define SD_NODE_INIT (struct sched_domain) { \ 31#define SD_NODE_INIT (struct sched_domain) { \
32 .span = CPU_MASK_NONE, \ 32 .span = CPU_MASK_NONE, \
33 .parent = NULL, \ 33 .parent = NULL, \
34 .child = NULL, \
34 .groups = NULL, \ 35 .groups = NULL, \
35 .min_interval = 8, \ 36 .min_interval = 8, \
36 .max_interval = 32, \ 37 .max_interval = 32, \
diff --git a/include/asm-x86_64/unistd.h b/include/asm-x86_64/unistd.h
index 6137146516..777288eb7e 100644
--- a/include/asm-x86_64/unistd.h
+++ b/include/asm-x86_64/unistd.h
@@ -620,10 +620,11 @@ __SYSCALL(__NR_vmsplice, sys_vmsplice)
620#define __NR_move_pages 279 620#define __NR_move_pages 279
621__SYSCALL(__NR_move_pages, sys_move_pages) 621__SYSCALL(__NR_move_pages, sys_move_pages)
622 622
623#ifdef __KERNEL__
624
625#define __NR_syscall_max __NR_move_pages 623#define __NR_syscall_max __NR_move_pages
624
625#ifdef __KERNEL__
626#include <linux/err.h> 626#include <linux/err.h>
627#endif
627 628
628#ifndef __NO_STUBS 629#ifndef __NO_STUBS
629 630
@@ -663,8 +664,6 @@ do { \
663#define __ARCH_WANT_SYS_TIME 664#define __ARCH_WANT_SYS_TIME
664#define __ARCH_WANT_COMPAT_SYS_TIME 665#define __ARCH_WANT_COMPAT_SYS_TIME
665 666
666#ifndef __KERNEL_SYSCALLS__
667
668#define __syscall "syscall" 667#define __syscall "syscall"
669 668
670#define _syscall0(type,name) \ 669#define _syscall0(type,name) \
@@ -746,83 +745,7 @@ __asm__ volatile ("movq %5,%%r10 ; movq %6,%%r8 ; movq %7,%%r9 ; " __syscall \
746__syscall_return(type,__res); \ 745__syscall_return(type,__res); \
747} 746}
748 747
749#else /* __KERNEL_SYSCALLS__ */ 748#ifdef __KERNEL__
750
751#include <linux/syscalls.h>
752#include <asm/ptrace.h>
753
754/*
755 * we need this inline - forking from kernel space will result
756 * in NO COPY ON WRITE (!!!), until an execve is executed. This
757 * is no problem, but for the stack. This is handled by not letting
758 * main() use the stack at all after fork(). Thus, no function
759 * calls - which means inline code for fork too, as otherwise we
760 * would use the stack upon exit from 'fork()'.
761 *
762 * Actually only pause and fork are needed inline, so that there
763 * won't be any messing with the stack from main(), but we define
764 * some others too.
765 */
766#define __NR__exit __NR_exit
767
768static inline pid_t setsid(void)
769{
770 return sys_setsid();
771}
772
773static inline ssize_t write(unsigned int fd, char * buf, size_t count)
774{
775 return sys_write(fd, buf, count);
776}
777
778static inline ssize_t read(unsigned int fd, char * buf, size_t count)
779{
780 return sys_read(fd, buf, count);
781}
782
783static inline off_t lseek(unsigned int fd, off_t offset, unsigned int origin)
784{
785 return sys_lseek(fd, offset, origin);
786}
787
788static inline long dup(unsigned int fd)
789{
790 return sys_dup(fd);
791}
792
793/* implemented in asm in arch/x86_64/kernel/entry.S */
794extern int execve(const char *, char * const *, char * const *);
795
796static inline long open(const char * filename, int flags, int mode)
797{
798 return sys_open(filename, flags, mode);
799}
800
801static inline long close(unsigned int fd)
802{
803 return sys_close(fd);
804}
805
806static inline pid_t waitpid(int pid, int * wait_stat, int flags)
807{
808 return sys_wait4(pid, wait_stat, flags, NULL);
809}
810
811extern long sys_mmap(unsigned long addr, unsigned long len,
812 unsigned long prot, unsigned long flags,
813 unsigned long fd, unsigned long off);
814
815extern int sys_modify_ldt(int func, void *ptr, unsigned long bytecount);
816
817asmlinkage long sys_execve(char *name, char **argv, char **envp,
818 struct pt_regs regs);
819asmlinkage long sys_clone(unsigned long clone_flags, unsigned long newsp,
820 void *parent_tid, void *child_tid,
821 struct pt_regs regs);
822asmlinkage long sys_fork(struct pt_regs regs);
823asmlinkage long sys_vfork(struct pt_regs regs);
824asmlinkage long sys_pipe(int *fildes);
825
826#ifndef __ASSEMBLY__ 749#ifndef __ASSEMBLY__
827 750
828#include <linux/linkage.h> 751#include <linux/linkage.h>
@@ -839,8 +762,8 @@ asmlinkage long sys_rt_sigaction(int sig,
839 size_t sigsetsize); 762 size_t sigsetsize);
840 763
841#endif /* __ASSEMBLY__ */ 764#endif /* __ASSEMBLY__ */
842 765#endif /* __KERNEL__ */
843#endif /* __KERNEL_SYSCALLS__ */ 766#endif /* __NO_STUBS */
844 767
845/* 768/*
846 * "Conditional" syscalls 769 * "Conditional" syscalls
@@ -850,8 +773,4 @@ asmlinkage long sys_rt_sigaction(int sig,
850 */ 773 */
851#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") 774#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
852 775
853#endif /* __NO_STUBS */
854
855#endif /* __KERNEL__ */
856
857#endif /* _ASM_X86_64_UNISTD_H_ */ 776#endif /* _ASM_X86_64_UNISTD_H_ */
diff --git a/include/asm-x86_64/vsyscall.h b/include/asm-x86_64/vsyscall.h
index 2281e9399b..fd452fc2c0 100644
--- a/include/asm-x86_64/vsyscall.h
+++ b/include/asm-x86_64/vsyscall.h
@@ -17,7 +17,6 @@ enum vsyscall_num {
17 17
18#define __section_vxtime __attribute__ ((unused, __section__ (".vxtime"), aligned(16))) 18#define __section_vxtime __attribute__ ((unused, __section__ (".vxtime"), aligned(16)))
19#define __section_vgetcpu_mode __attribute__ ((unused, __section__ (".vgetcpu_mode"), aligned(16))) 19#define __section_vgetcpu_mode __attribute__ ((unused, __section__ (".vgetcpu_mode"), aligned(16)))
20#define __section_wall_jiffies __attribute__ ((unused, __section__ (".wall_jiffies"), aligned(16)))
21#define __section_jiffies __attribute__ ((unused, __section__ (".jiffies"), aligned(16))) 20#define __section_jiffies __attribute__ ((unused, __section__ (".jiffies"), aligned(16)))
22#define __section_sys_tz __attribute__ ((unused, __section__ (".sys_tz"), aligned(16))) 21#define __section_sys_tz __attribute__ ((unused, __section__ (".sys_tz"), aligned(16)))
23#define __section_sysctl_vsyscall __attribute__ ((unused, __section__ (".sysctl_vsyscall"), aligned(16))) 22#define __section_sysctl_vsyscall __attribute__ ((unused, __section__ (".sysctl_vsyscall"), aligned(16)))
@@ -48,14 +47,12 @@ extern struct vxtime_data __vxtime;
48extern int __vgetcpu_mode; 47extern int __vgetcpu_mode;
49extern struct timespec __xtime; 48extern struct timespec __xtime;
50extern volatile unsigned long __jiffies; 49extern volatile unsigned long __jiffies;
51extern unsigned long __wall_jiffies;
52extern struct timezone __sys_tz; 50extern struct timezone __sys_tz;
53extern seqlock_t __xtime_lock; 51extern seqlock_t __xtime_lock;
54 52
55/* kernel space (writeable) */ 53/* kernel space (writeable) */
56extern struct vxtime_data vxtime; 54extern struct vxtime_data vxtime;
57extern int vgetcpu_mode; 55extern int vgetcpu_mode;
58extern unsigned long wall_jiffies;
59extern struct timezone sys_tz; 56extern struct timezone sys_tz;
60extern int sysctl_vsyscall; 57extern int sysctl_vsyscall;
61extern seqlock_t xtime_lock; 58extern seqlock_t xtime_lock;
diff --git a/include/asm-xtensa/a.out.h b/include/asm-xtensa/a.out.h
index 3be701dfe0..ffc4dcfd6a 100644
--- a/include/asm-xtensa/a.out.h
+++ b/include/asm-xtensa/a.out.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm-xtensa/addrspace.h 2 * include/asm-xtensa/a.out.h
3 * 3 *
4 * Dummy a.out file. Xtensa does not support the a.out format, but the kernel 4 * Dummy a.out file. Xtensa does not support the a.out format, but the kernel
5 * seems to depend on it. 5 * seems to depend on it.
diff --git a/include/asm-xtensa/cache.h b/include/asm-xtensa/cache.h
index 5aae3f1240..1e79c0e274 100644
--- a/include/asm-xtensa/cache.h
+++ b/include/asm-xtensa/cache.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm-xtensa/cacheflush.h 2 * include/asm-xtensa/cache.h
3 * 3 *
4 * This file is subject to the terms and conditions of the GNU General Public 4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive 5 * License. See the file "COPYING" in the main directory of this archive
diff --git a/include/asm-xtensa/coprocessor.h b/include/asm-xtensa/coprocessor.h
index a91b96dc0e..5093034723 100644
--- a/include/asm-xtensa/coprocessor.h
+++ b/include/asm-xtensa/coprocessor.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm-xtensa/cpextra.h 2 * include/asm-xtensa/coprocessor.h
3 * 3 *
4 * This file is subject to the terms and conditions of the GNU General Public 4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive 5 * License. See the file "COPYING" in the main directory of this archive
diff --git a/include/asm-xtensa/dma-mapping.h b/include/asm-xtensa/dma-mapping.h
index c425f10d08..c39c91dfcc 100644
--- a/include/asm-xtensa/dma-mapping.h
+++ b/include/asm-xtensa/dma-mapping.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm-xtensa/dma_mapping.h 2 * include/asm-xtensa/dma-mapping.h
3 * 3 *
4 * This file is subject to the terms and conditions of the GNU General Public 4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive 5 * License. See the file "COPYING" in the main directory of this archive
diff --git a/include/asm-xtensa/ioctls.h b/include/asm-xtensa/ioctls.h
index 3b89a772d0..39e6f23921 100644
--- a/include/asm-xtensa/ioctls.h
+++ b/include/asm-xtensa/ioctls.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm-xtensa/ioctl.h 2 * include/asm-xtensa/ioctls.h
3 * 3 *
4 * This file is subject to the terms and conditions of the GNU General Public 4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive 5 * License. See the file "COPYING" in the main directory of this archive
diff --git a/include/asm-xtensa/pgtable.h b/include/asm-xtensa/pgtable.h
index a47cc734c2..b4318934b1 100644
--- a/include/asm-xtensa/pgtable.h
+++ b/include/asm-xtensa/pgtable.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/include/asm-xtensa/page.h 2 * linux/include/asm-xtensa/pgtable.h
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version2 as 5 * it under the terms of the GNU General Public License version2 as
diff --git a/include/asm-xtensa/siginfo.h b/include/asm-xtensa/siginfo.h
index 44f0ae77b5..6916248295 100644
--- a/include/asm-xtensa/siginfo.h
+++ b/include/asm-xtensa/siginfo.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm-xtensa/processor.h 2 * include/asm-xtensa/siginfo.h
3 * 3 *
4 * This file is subject to the terms and conditions of the GNU General Public 4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive 5 * License. See the file "COPYING" in the main directory of this archive
diff --git a/include/asm-xtensa/timex.h b/include/asm-xtensa/timex.h
index d14a3755a1..c7b705e666 100644
--- a/include/asm-xtensa/timex.h
+++ b/include/asm-xtensa/timex.h
@@ -31,9 +31,6 @@
31 31
32#define CLOCK_TICK_RATE 1193180 /* (everyone is using this value) */ 32#define CLOCK_TICK_RATE 1193180 /* (everyone is using this value) */
33#define CLOCK_TICK_FACTOR 20 /* Factor of both 10^6 and CLOCK_TICK_RATE */ 33#define CLOCK_TICK_FACTOR 20 /* Factor of both 10^6 and CLOCK_TICK_RATE */
34#define FINETUNE ((((((long)LATCH * HZ - CLOCK_TICK_RATE) << SHIFT_HZ) * \
35 (1000000/CLOCK_TICK_FACTOR) / (CLOCK_TICK_RATE/CLOCK_TICK_FACTOR)) \
36 << (SHIFT_SCALE-SHIFT_HZ)) / HZ)
37 34
38#ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT 35#ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT
39extern unsigned long ccount_per_jiffy; 36extern unsigned long ccount_per_jiffy;
diff --git a/include/asm-xtensa/unistd.h b/include/asm-xtensa/unistd.h
index 5e1b99dc4a..411f810a55 100644
--- a/include/asm-xtensa/unistd.h
+++ b/include/asm-xtensa/unistd.h
@@ -402,11 +402,6 @@ __asm__ __volatile__ ( \
402__syscall_return(type,__res); \ 402__syscall_return(type,__res); \
403} 403}
404 404
405
406#ifdef __KERNEL_SYSCALLS__
407static __inline__ _syscall3(int,execve,const char*,file,char**,argv,char**,envp)
408#endif
409
410/* 405/*
411 * "Conditional" syscalls 406 * "Conditional" syscalls
412 * 407 *
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index f7a52e19b4..7d564b6fc9 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -156,12 +156,10 @@ header-y += toshiba.h
156header-y += ultrasound.h 156header-y += ultrasound.h
157header-y += un.h 157header-y += un.h
158header-y += utime.h 158header-y += utime.h
159header-y += utsname.h
160header-y += video_decoder.h 159header-y += video_decoder.h
161header-y += video_encoder.h 160header-y += video_encoder.h
162header-y += videotext.h 161header-y += videotext.h
163header-y += vt.h 162header-y += vt.h
164header-y += wavefront.h
165header-y += wireless.h 163header-y += wireless.h
166header-y += xattr.h 164header-y += xattr.h
167header-y += x25.h 165header-y += x25.h
@@ -333,6 +331,7 @@ unifdef-y += unistd.h
333unifdef-y += usb_ch9.h 331unifdef-y += usb_ch9.h
334unifdef-y += usbdevice_fs.h 332unifdef-y += usbdevice_fs.h
335unifdef-y += user.h 333unifdef-y += user.h
334unifdef-y += utsname.h
336unifdef-y += videodev2.h 335unifdef-y += videodev2.h
337unifdef-y += videodev.h 336unifdef-y += videodev.h
338unifdef-y += wait.h 337unifdef-y += wait.h
diff --git a/include/linux/ac97_codec.h b/include/linux/ac97_codec.h
index 2ed2fd8551..22eb936723 100644
--- a/include/linux/ac97_codec.h
+++ b/include/linux/ac97_codec.h
@@ -331,8 +331,6 @@ extern int ac97_read_proc (char *page_out, char **start, off_t off,
331extern int ac97_probe_codec(struct ac97_codec *); 331extern int ac97_probe_codec(struct ac97_codec *);
332extern unsigned int ac97_set_adc_rate(struct ac97_codec *codec, unsigned int rate); 332extern unsigned int ac97_set_adc_rate(struct ac97_codec *codec, unsigned int rate);
333extern unsigned int ac97_set_dac_rate(struct ac97_codec *codec, unsigned int rate); 333extern unsigned int ac97_set_dac_rate(struct ac97_codec *codec, unsigned int rate);
334extern int ac97_save_state(struct ac97_codec *codec);
335extern int ac97_restore_state(struct ac97_codec *codec);
336 334
337extern struct ac97_codec *ac97_alloc_codec(void); 335extern struct ac97_codec *ac97_alloc_codec(void);
338extern void ac97_release_codec(struct ac97_codec *codec); 336extern void ac97_release_codec(struct ac97_codec *codec);
@@ -346,9 +344,6 @@ struct ac97_driver {
346 void (*remove) (struct ac97_codec *codec, struct ac97_driver *driver); 344 void (*remove) (struct ac97_codec *codec, struct ac97_driver *driver);
347}; 345};
348 346
349extern int ac97_register_driver(struct ac97_driver *driver);
350extern void ac97_unregister_driver(struct ac97_driver *driver);
351
352/* quirk types */ 347/* quirk types */
353enum { 348enum {
354 AC97_TUNE_DEFAULT = -1, /* use default from quirk list (not valid in list) */ 349 AC97_TUNE_DEFAULT = -1, /* use default from quirk list (not valid in list) */
diff --git a/include/linux/acct.h b/include/linux/acct.h
index e86bae7324..0496d1f099 100644
--- a/include/linux/acct.h
+++ b/include/linux/acct.h
@@ -124,16 +124,12 @@ extern void acct_auto_close(struct super_block *sb);
124extern void acct_init_pacct(struct pacct_struct *pacct); 124extern void acct_init_pacct(struct pacct_struct *pacct);
125extern void acct_collect(long exitcode, int group_dead); 125extern void acct_collect(long exitcode, int group_dead);
126extern void acct_process(void); 126extern void acct_process(void);
127extern void acct_update_integrals(struct task_struct *tsk);
128extern void acct_clear_integrals(struct task_struct *tsk);
129#else 127#else
130#define acct_auto_close_mnt(x) do { } while (0) 128#define acct_auto_close_mnt(x) do { } while (0)
131#define acct_auto_close(x) do { } while (0) 129#define acct_auto_close(x) do { } while (0)
132#define acct_init_pacct(x) do { } while (0) 130#define acct_init_pacct(x) do { } while (0)
133#define acct_collect(x,y) do { } while (0) 131#define acct_collect(x,y) do { } while (0)
134#define acct_process() do { } while (0) 132#define acct_process() do { } while (0)
135#define acct_update_integrals(x) do { } while (0)
136#define acct_clear_integrals(task) do { } while (0)
137#endif 133#endif
138 134
139/* 135/*
diff --git a/include/linux/aio.h b/include/linux/aio.h
index 00c8efa95c..0d71c0041f 100644
--- a/include/linux/aio.h
+++ b/include/linux/aio.h
@@ -4,8 +4,10 @@
4#include <linux/list.h> 4#include <linux/list.h>
5#include <linux/workqueue.h> 5#include <linux/workqueue.h>
6#include <linux/aio_abi.h> 6#include <linux/aio_abi.h>
7#include <linux/uio.h>
7 8
8#include <asm/atomic.h> 9#include <asm/atomic.h>
10#include <linux/uio.h>
9 11
10#define AIO_MAXSEGS 4 12#define AIO_MAXSEGS 4
11#define AIO_KIOGRP_NR_ATOMIC 8 13#define AIO_KIOGRP_NR_ATOMIC 8
@@ -110,8 +112,10 @@ struct kiocb {
110 char __user *ki_buf; /* remaining iocb->aio_buf */ 112 char __user *ki_buf; /* remaining iocb->aio_buf */
111 size_t ki_left; /* remaining bytes */ 113 size_t ki_left; /* remaining bytes */
112 long ki_retried; /* just for testing */ 114 long ki_retried; /* just for testing */
113 long ki_kicked; /* just for testing */ 115 struct iovec ki_inline_vec; /* inline vector */
114 long ki_queued; /* just for testing */ 116 struct iovec *ki_iovec;
117 unsigned long ki_nr_segs;
118 unsigned long ki_cur_seg;
115 119
116 struct list_head ki_list; /* the aio core uses this 120 struct list_head ki_list; /* the aio core uses this
117 * for cancellation */ 121 * for cancellation */
@@ -213,11 +217,11 @@ int FASTCALL(io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb,
213 struct iocb *iocb)); 217 struct iocb *iocb));
214 218
215#define get_ioctx(kioctx) do { \ 219#define get_ioctx(kioctx) do { \
216 BUG_ON(unlikely(atomic_read(&(kioctx)->users) <= 0)); \ 220 BUG_ON(atomic_read(&(kioctx)->users) <= 0); \
217 atomic_inc(&(kioctx)->users); \ 221 atomic_inc(&(kioctx)->users); \
218} while (0) 222} while (0)
219#define put_ioctx(kioctx) do { \ 223#define put_ioctx(kioctx) do { \
220 BUG_ON(unlikely(atomic_read(&(kioctx)->users) <= 0)); \ 224 BUG_ON(atomic_read(&(kioctx)->users) <= 0); \
221 if (unlikely(atomic_dec_and_test(&(kioctx)->users))) \ 225 if (unlikely(atomic_dec_and_test(&(kioctx)->users))) \
222 __put_ioctx(kioctx); \ 226 __put_ioctx(kioctx); \
223} while (0) 227} while (0)
diff --git a/include/linux/aio_abi.h b/include/linux/aio_abi.h
index 30fdcc89d1..e3ca0a485c 100644
--- a/include/linux/aio_abi.h
+++ b/include/linux/aio_abi.h
@@ -1,4 +1,4 @@
1/* linux/aio_abi.h 1/* include/linux/aio_abi.h
2 * 2 *
3 * Copyright 2000,2001,2002 Red Hat. 3 * Copyright 2000,2001,2002 Red Hat.
4 * 4 *
@@ -41,6 +41,8 @@ enum {
41 * IOCB_CMD_POLL = 5, 41 * IOCB_CMD_POLL = 5,
42 */ 42 */
43 IOCB_CMD_NOOP = 6, 43 IOCB_CMD_NOOP = 6,
44 IOCB_CMD_PREADV = 7,
45 IOCB_CMD_PWRITEV = 8,
44}; 46};
45 47
46/* read() from /dev/aio returns these structures. */ 48/* read() from /dev/aio returns these structures. */
diff --git a/include/linux/awe_voice.h b/include/linux/awe_voice.h
index 4bf9f33048..bf33f17bea 100644
--- a/include/linux/awe_voice.h
+++ b/include/linux/awe_voice.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * sound/awe_voice.h 2 * include/linux/awe_voice.h
3 * 3 *
4 * Voice information definitions for the low level driver for the 4 * Voice information definitions for the low level driver for the
5 * AWE32/SB32/AWE64 wave table synth. 5 * AWE32/SB32/AWE64 wave table synth.
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 9760753e66..ef5cd19278 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -13,6 +13,7 @@
13 13
14#include <asm/compat.h> 14#include <asm/compat.h>
15#include <asm/siginfo.h> 15#include <asm/siginfo.h>
16#include <asm/signal.h>
16 17
17#define compat_jiffies_to_clock_t(x) \ 18#define compat_jiffies_to_clock_t(x) \
18 (((unsigned long)(x) * COMPAT_USER_HZ) / HZ) 19 (((unsigned long)(x) * COMPAT_USER_HZ) / HZ)
@@ -227,6 +228,7 @@ static inline int compat_timespec_compare(struct compat_timespec *lhs,
227asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp); 228asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp);
228 229
229extern int compat_printk(const char *fmt, ...); 230extern int compat_printk(const char *fmt, ...);
231extern void sigset_from_compat(sigset_t *set, compat_sigset_t *compat);
230 232
231#endif /* CONFIG_COMPAT */ 233#endif /* CONFIG_COMPAT */
232#endif /* _LINUX_COMPAT_H */ 234#endif /* _LINUX_COMPAT_H */
diff --git a/include/linux/compat_ioctl.h b/include/linux/compat_ioctl.h
index d61ef59515..4e1663d769 100644
--- a/include/linux/compat_ioctl.h
+++ b/include/linux/compat_ioctl.h
@@ -122,10 +122,10 @@ COMPATIBLE_IOCTL(PROTECT_ARRAY)
122ULONG_IOCTL(HOT_ADD_DISK) 122ULONG_IOCTL(HOT_ADD_DISK)
123ULONG_IOCTL(SET_DISK_FAULTY) 123ULONG_IOCTL(SET_DISK_FAULTY)
124COMPATIBLE_IOCTL(RUN_ARRAY) 124COMPATIBLE_IOCTL(RUN_ARRAY)
125ULONG_IOCTL(START_ARRAY)
126COMPATIBLE_IOCTL(STOP_ARRAY) 125COMPATIBLE_IOCTL(STOP_ARRAY)
127COMPATIBLE_IOCTL(STOP_ARRAY_RO) 126COMPATIBLE_IOCTL(STOP_ARRAY_RO)
128COMPATIBLE_IOCTL(RESTART_ARRAY_RW) 127COMPATIBLE_IOCTL(RESTART_ARRAY_RW)
128ULONG_IOCTL(SET_BITMAP_FILE)
129/* DM */ 129/* DM */
130COMPATIBLE_IOCTL(DM_VERSION_32) 130COMPATIBLE_IOCTL(DM_VERSION_32)
131COMPATIBLE_IOCTL(DM_REMOVE_ALL_32) 131COMPATIBLE_IOCTL(DM_REMOVE_ALL_32)
@@ -569,18 +569,6 @@ COMPATIBLE_IOCTL(RAW_SETBIND)
569COMPATIBLE_IOCTL(RAW_GETBIND) 569COMPATIBLE_IOCTL(RAW_GETBIND)
570/* SMB ioctls which do not need any translations */ 570/* SMB ioctls which do not need any translations */
571COMPATIBLE_IOCTL(SMB_IOC_NEWCONN) 571COMPATIBLE_IOCTL(SMB_IOC_NEWCONN)
572/* NCP ioctls which do not need any translations */
573COMPATIBLE_IOCTL(NCP_IOC_CONN_LOGGED_IN)
574COMPATIBLE_IOCTL(NCP_IOC_SIGN_INIT)
575COMPATIBLE_IOCTL(NCP_IOC_SIGN_WANTED)
576COMPATIBLE_IOCTL(NCP_IOC_SET_SIGN_WANTED)
577COMPATIBLE_IOCTL(NCP_IOC_LOCKUNLOCK)
578COMPATIBLE_IOCTL(NCP_IOC_GETROOT)
579COMPATIBLE_IOCTL(NCP_IOC_SETROOT)
580COMPATIBLE_IOCTL(NCP_IOC_GETCHARSETS)
581COMPATIBLE_IOCTL(NCP_IOC_SETCHARSETS)
582COMPATIBLE_IOCTL(NCP_IOC_GETDENTRYTTL)
583COMPATIBLE_IOCTL(NCP_IOC_SETDENTRYTTL)
584/* Little a */ 572/* Little a */
585COMPATIBLE_IOCTL(ATMSIGD_CTRL) 573COMPATIBLE_IOCTL(ATMSIGD_CTRL)
586COMPATIBLE_IOCTL(ATMARPD_CTRL) 574COMPATIBLE_IOCTL(ATMARPD_CTRL)
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 0780de4402..538423d4a8 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -10,10 +10,10 @@
10# define __force __attribute__((force)) 10# define __force __attribute__((force))
11# define __nocast __attribute__((nocast)) 11# define __nocast __attribute__((nocast))
12# define __iomem __attribute__((noderef, address_space(2))) 12# define __iomem __attribute__((noderef, address_space(2)))
13# define __acquires(x) __attribute__((context(0,1))) 13# define __acquires(x) __attribute__((context(x,0,1)))
14# define __releases(x) __attribute__((context(1,0))) 14# define __releases(x) __attribute__((context(x,1,0)))
15# define __acquire(x) __context__(1) 15# define __acquire(x) __context__(x,1)
16# define __release(x) __context__(-1) 16# define __release(x) __context__(x,-1)
17# define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0) 17# define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0)
18extern void __chk_user_ptr(void __user *); 18extern void __chk_user_ptr(void __user *);
19extern void __chk_io_ptr(void __iomem *); 19extern void __chk_io_ptr(void __iomem *);
diff --git a/include/linux/console.h b/include/linux/console.h
index 76a1807726..7d0420274d 100644
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -129,6 +129,9 @@ static inline void suspend_console(void) {}
129static inline void resume_console(void) {} 129static inline void resume_console(void) {}
130#endif /* CONFIG_DISABLE_CONSOLE_SUSPEND */ 130#endif /* CONFIG_DISABLE_CONSOLE_SUSPEND */
131 131
132int mda_console_init(void);
133void prom_con_init(void);
134
132/* Some debug stub to catch some of the obvious races in the VT code */ 135/* Some debug stub to catch some of the obvious races in the VT code */
133#if 1 136#if 1
134#define WARN_CONSOLE_UNLOCKED() WARN_ON(!is_console_locked() && !oops_in_progress) 137#define WARN_CONSOLE_UNLOCKED() WARN_ON(!is_console_locked() && !oops_in_progress)
diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h
index 25423f79bf..ed6c0fee1a 100644
--- a/include/linux/console_struct.h
+++ b/include/linux/console_struct.h
@@ -54,7 +54,7 @@ struct vc_data {
54 struct tty_struct *vc_tty; /* TTY we are attached to */ 54 struct tty_struct *vc_tty; /* TTY we are attached to */
55 /* data for manual vt switching */ 55 /* data for manual vt switching */
56 struct vt_mode vt_mode; 56 struct vt_mode vt_mode;
57 int vt_pid; 57 struct pid *vt_pid;
58 int vt_newvt; 58 int vt_newvt;
59 wait_queue_head_t paste_wait; 59 wait_queue_head_t paste_wait;
60 /* mode flags */ 60 /* mode flags */
diff --git a/include/linux/consolemap.h b/include/linux/consolemap.h
index 65842efc1b..82c9a1f110 100644
--- a/include/linux/consolemap.h
+++ b/include/linux/consolemap.h
@@ -13,3 +13,4 @@ struct vc_data;
13extern unsigned char inverse_translate(struct vc_data *conp, int glyph); 13extern unsigned char inverse_translate(struct vc_data *conp, int glyph);
14extern unsigned short *set_translate(int m, struct vc_data *vc); 14extern unsigned short *set_translate(int m, struct vc_data *vc);
15extern int conv_uni_to_pc(struct vc_data *conp, long ucs); 15extern int conv_uni_to_pc(struct vc_data *conp, long ucs);
16void console_map_init(void);
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index e3d1c33d15..03ef41c1ea 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -55,8 +55,10 @@ typedef int (*dm_endio_fn) (struct dm_target *ti,
55 struct bio *bio, int error, 55 struct bio *bio, int error,
56 union map_info *map_context); 56 union map_info *map_context);
57 57
58typedef void (*dm_flush_fn) (struct dm_target *ti);
58typedef void (*dm_presuspend_fn) (struct dm_target *ti); 59typedef void (*dm_presuspend_fn) (struct dm_target *ti);
59typedef void (*dm_postsuspend_fn) (struct dm_target *ti); 60typedef void (*dm_postsuspend_fn) (struct dm_target *ti);
61typedef int (*dm_preresume_fn) (struct dm_target *ti);
60typedef void (*dm_resume_fn) (struct dm_target *ti); 62typedef void (*dm_resume_fn) (struct dm_target *ti);
61 63
62typedef int (*dm_status_fn) (struct dm_target *ti, status_type_t status_type, 64typedef int (*dm_status_fn) (struct dm_target *ti, status_type_t status_type,
@@ -64,9 +66,18 @@ typedef int (*dm_status_fn) (struct dm_target *ti, status_type_t status_type,
64 66
65typedef int (*dm_message_fn) (struct dm_target *ti, unsigned argc, char **argv); 67typedef int (*dm_message_fn) (struct dm_target *ti, unsigned argc, char **argv);
66 68
69typedef int (*dm_ioctl_fn) (struct dm_target *ti, struct inode *inode,
70 struct file *filp, unsigned int cmd,
71 unsigned long arg);
72
67void dm_error(const char *message); 73void dm_error(const char *message);
68 74
69/* 75/*
76 * Combine device limits.
77 */
78void dm_set_device_limits(struct dm_target *ti, struct block_device *bdev);
79
80/*
70 * Constructors should call these functions to ensure destination devices 81 * Constructors should call these functions to ensure destination devices
71 * are opened/closed correctly. 82 * are opened/closed correctly.
72 * FIXME: too many arguments. 83 * FIXME: too many arguments.
@@ -86,11 +97,14 @@ struct target_type {
86 dm_dtr_fn dtr; 97 dm_dtr_fn dtr;
87 dm_map_fn map; 98 dm_map_fn map;
88 dm_endio_fn end_io; 99 dm_endio_fn end_io;
100 dm_flush_fn flush;
89 dm_presuspend_fn presuspend; 101 dm_presuspend_fn presuspend;
90 dm_postsuspend_fn postsuspend; 102 dm_postsuspend_fn postsuspend;
103 dm_preresume_fn preresume;
91 dm_resume_fn resume; 104 dm_resume_fn resume;
92 dm_status_fn status; 105 dm_status_fn status;
93 dm_message_fn message; 106 dm_message_fn message;
107 dm_ioctl_fn ioctl;
94}; 108};
95 109
96struct io_restrictions { 110struct io_restrictions {
diff --git a/include/linux/dm-ioctl.h b/include/linux/dm-ioctl.h
index 9623bb6250..8853fc4d1c 100644
--- a/include/linux/dm-ioctl.h
+++ b/include/linux/dm-ioctl.h
@@ -285,9 +285,9 @@ typedef char ioctl_struct[308];
285#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) 285#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
286 286
287#define DM_VERSION_MAJOR 4 287#define DM_VERSION_MAJOR 4
288#define DM_VERSION_MINOR 7 288#define DM_VERSION_MINOR 10
289#define DM_VERSION_PATCHLEVEL 0 289#define DM_VERSION_PATCHLEVEL 0
290#define DM_VERSION_EXTRA "-ioctl (2006-06-24)" 290#define DM_VERSION_EXTRA "-ioctl (2006-09-14)"
291 291
292/* Status bits */ 292/* Status bits */
293#define DM_READONLY_FLAG (1 << 0) /* In/Out */ 293#define DM_READONLY_FLAG (1 << 0) /* In/Out */
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 2f335e9660..3e69241e6a 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -2,6 +2,7 @@
2#define _LINUX_FB_H 2#define _LINUX_FB_H
3 3
4#include <asm/types.h> 4#include <asm/types.h>
5#include <linux/i2c.h>
5 6
6/* Definitions of frame buffers */ 7/* Definitions of frame buffers */
7 8
@@ -775,6 +776,7 @@ struct fb_info {
775 struct fb_ops *fbops; 776 struct fb_ops *fbops;
776 struct device *device; 777 struct device *device;
777 struct class_device *class_device; /* sysfs per device attrs */ 778 struct class_device *class_device; /* sysfs per device attrs */
779 int class_flag; /* private sysfs flags */
778#ifdef CONFIG_FB_TILEBLITTING 780#ifdef CONFIG_FB_TILEBLITTING
779 struct fb_tile_ops *tileops; /* Tile Blitting */ 781 struct fb_tile_ops *tileops; /* Tile Blitting */
780#endif 782#endif
@@ -940,6 +942,7 @@ extern void fb_edid_to_monspecs(unsigned char *edid,
940 struct fb_monspecs *specs); 942 struct fb_monspecs *specs);
941extern void fb_destroy_modedb(struct fb_videomode *modedb); 943extern void fb_destroy_modedb(struct fb_videomode *modedb);
942extern int fb_find_mode_cvt(struct fb_videomode *mode, int margins, int rb); 944extern int fb_find_mode_cvt(struct fb_videomode *mode, int margins, int rb);
945extern unsigned char *fb_ddc_read(struct i2c_adapter *adapter);
943 946
944/* drivers/video/modedb.c */ 947/* drivers/video/modedb.c */
945#define VESA_MODEDB_SIZE 34 948#define VESA_MODEDB_SIZE 34
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 5baf3a1534..f53bf4ff19 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -684,7 +684,8 @@ extern struct block_device *I_BDEV(struct inode *inode);
684 684
685struct fown_struct { 685struct fown_struct {
686 rwlock_t lock; /* protects pid, uid, euid fields */ 686 rwlock_t lock; /* protects pid, uid, euid fields */
687 int pid; /* pid or -pgrp where SIGIO should be sent */ 687 struct pid *pid; /* pid or -pgrp where SIGIO should be sent */
688 enum pid_type pid_type; /* Kind of process group SIGIO should be sent to */
688 uid_t uid, euid; /* uid/euid of process setting the owner */ 689 uid_t uid, euid; /* uid/euid of process setting the owner */
689 int signum; /* posix.1b rt signal to be delivered on IO */ 690 int signum; /* posix.1b rt signal to be delivered on IO */
690}; 691};
@@ -880,8 +881,10 @@ extern void kill_fasync(struct fasync_struct **, int, int);
880/* only for net: no internal synchronization */ 881/* only for net: no internal synchronization */
881extern void __kill_fasync(struct fasync_struct *, int, int); 882extern void __kill_fasync(struct fasync_struct *, int, int);
882 883
884extern int __f_setown(struct file *filp, struct pid *, enum pid_type, int force);
883extern int f_setown(struct file *filp, unsigned long arg, int force); 885extern int f_setown(struct file *filp, unsigned long arg, int force);
884extern void f_delown(struct file *filp); 886extern void f_delown(struct file *filp);
887extern pid_t f_getown(struct file *filp);
885extern int send_sigurg(struct fown_struct *fown); 888extern int send_sigurg(struct fown_struct *fown);
886 889
887/* 890/*
@@ -1046,7 +1049,7 @@ int generic_osync_inode(struct inode *, struct address_space *, int);
1046 * This allows the kernel to read directories into kernel space or 1049 * This allows the kernel to read directories into kernel space or
1047 * to have different dirent layouts depending on the binary type. 1050 * to have different dirent layouts depending on the binary type.
1048 */ 1051 */
1049typedef int (*filldir_t)(void *, const char *, int, loff_t, ino_t, unsigned); 1052typedef int (*filldir_t)(void *, const char *, int, loff_t, u64, unsigned);
1050 1053
1051struct block_device_operations { 1054struct block_device_operations {
1052 int (*open) (struct inode *, struct file *); 1055 int (*open) (struct inode *, struct file *);
@@ -1097,9 +1100,9 @@ struct file_operations {
1097 struct module *owner; 1100 struct module *owner;
1098 loff_t (*llseek) (struct file *, loff_t, int); 1101 loff_t (*llseek) (struct file *, loff_t, int);
1099 ssize_t (*read) (struct file *, char __user *, size_t, loff_t *); 1102 ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);
1100 ssize_t (*aio_read) (struct kiocb *, char __user *, size_t, loff_t);
1101 ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *); 1103 ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
1102 ssize_t (*aio_write) (struct kiocb *, const char __user *, size_t, loff_t); 1104 ssize_t (*aio_read) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
1105 ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
1103 int (*readdir) (struct file *, void *, filldir_t); 1106 int (*readdir) (struct file *, void *, filldir_t);
1104 unsigned int (*poll) (struct file *, struct poll_table_struct *); 1107 unsigned int (*poll) (struct file *, struct poll_table_struct *);
1105 int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long); 1108 int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long);
@@ -1113,8 +1116,6 @@ struct file_operations {
1113 int (*aio_fsync) (struct kiocb *, int datasync); 1116 int (*aio_fsync) (struct kiocb *, int datasync);
1114 int (*fasync) (int, struct file *, int); 1117 int (*fasync) (int, struct file *, int);
1115 int (*lock) (struct file *, int, struct file_lock *); 1118 int (*lock) (struct file *, int, struct file_lock *);
1116 ssize_t (*readv) (struct file *, const struct iovec *, unsigned long, loff_t *);
1117 ssize_t (*writev) (struct file *, const struct iovec *, unsigned long, loff_t *);
1118 ssize_t (*sendfile) (struct file *, loff_t *, size_t, read_actor_t, void *); 1119 ssize_t (*sendfile) (struct file *, loff_t *, size_t, read_actor_t, void *);
1119 ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int); 1120 ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);
1120 unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); 1121 unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
@@ -1152,6 +1153,11 @@ struct inode_operations {
1152 1153
1153struct seq_file; 1154struct seq_file;
1154 1155
1156ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector,
1157 unsigned long nr_segs, unsigned long fast_segs,
1158 struct iovec *fast_pointer,
1159 struct iovec **ret_pointer);
1160
1155extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *); 1161extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *);
1156extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *); 1162extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *);
1157extern ssize_t vfs_readv(struct file *, const struct iovec __user *, 1163extern ssize_t vfs_readv(struct file *, const struct iovec __user *,
@@ -1216,15 +1222,30 @@ static inline void mark_inode_dirty_sync(struct inode *inode)
1216 __mark_inode_dirty(inode, I_DIRTY_SYNC); 1222 __mark_inode_dirty(inode, I_DIRTY_SYNC);
1217} 1223}
1218 1224
1219static inline void inode_inc_link_count(struct inode *inode) 1225static inline void inc_nlink(struct inode *inode)
1220{ 1226{
1221 inode->i_nlink++; 1227 inode->i_nlink++;
1228}
1229
1230static inline void inode_inc_link_count(struct inode *inode)
1231{
1232 inc_nlink(inode);
1222 mark_inode_dirty(inode); 1233 mark_inode_dirty(inode);
1223} 1234}
1224 1235
1225static inline void inode_dec_link_count(struct inode *inode) 1236static inline void drop_nlink(struct inode *inode)
1226{ 1237{
1227 inode->i_nlink--; 1238 inode->i_nlink--;
1239}
1240
1241static inline void clear_nlink(struct inode *inode)
1242{
1243 inode->i_nlink = 0;
1244}
1245
1246static inline void inode_dec_link_count(struct inode *inode)
1247{
1248 drop_nlink(inode);
1228 mark_inode_dirty(inode); 1249 mark_inode_dirty(inode);
1229} 1250}
1230 1251
@@ -1502,6 +1523,9 @@ extern const struct file_operations def_fifo_fops;
1502#ifdef CONFIG_BLOCK 1523#ifdef CONFIG_BLOCK
1503extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long); 1524extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long);
1504extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long); 1525extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long);
1526extern int blkdev_driver_ioctl(struct inode *inode, struct file *file,
1527 struct gendisk *disk, unsigned cmd,
1528 unsigned long arg);
1505extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); 1529extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long);
1506extern int blkdev_get(struct block_device *, mode_t, unsigned); 1530extern int blkdev_get(struct block_device *, mode_t, unsigned);
1507extern int blkdev_put(struct block_device *); 1531extern int blkdev_put(struct block_device *);
@@ -1623,6 +1647,9 @@ static inline void allow_write_access(struct file *file)
1623 atomic_inc(&file->f_dentry->d_inode->i_writecount); 1647 atomic_inc(&file->f_dentry->d_inode->i_writecount);
1624} 1648}
1625extern int do_pipe(int *); 1649extern int do_pipe(int *);
1650extern struct file *create_read_pipe(struct file *f);
1651extern struct file *create_write_pipe(void);
1652extern void free_write_pipe(struct file *);
1626 1653
1627extern int open_namei(int dfd, const char *, int, int, struct nameidata *); 1654extern int open_namei(int dfd, const char *, int, int, struct nameidata *);
1628extern int may_open(struct nameidata *, int, int); 1655extern int may_open(struct nameidata *, int, int);
@@ -1701,22 +1728,17 @@ extern int generic_file_mmap(struct file *, struct vm_area_struct *);
1701extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *); 1728extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *);
1702extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); 1729extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size);
1703extern int file_send_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); 1730extern int file_send_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size);
1704extern ssize_t generic_file_read(struct file *, char __user *, size_t, loff_t *);
1705int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk); 1731int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk);
1706extern ssize_t generic_file_write(struct file *, const char __user *, size_t, loff_t *); 1732extern ssize_t generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t);
1707extern ssize_t generic_file_aio_read(struct kiocb *, char __user *, size_t, loff_t); 1733extern ssize_t generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long, loff_t);
1708extern ssize_t __generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t *);
1709extern ssize_t generic_file_aio_write(struct kiocb *, const char __user *, size_t, loff_t);
1710extern ssize_t generic_file_aio_write_nolock(struct kiocb *, const struct iovec *, 1734extern ssize_t generic_file_aio_write_nolock(struct kiocb *, const struct iovec *,
1711 unsigned long, loff_t *); 1735 unsigned long, loff_t);
1712extern ssize_t generic_file_direct_write(struct kiocb *, const struct iovec *, 1736extern ssize_t generic_file_direct_write(struct kiocb *, const struct iovec *,
1713 unsigned long *, loff_t, loff_t *, size_t, size_t); 1737 unsigned long *, loff_t, loff_t *, size_t, size_t);
1714extern ssize_t generic_file_buffered_write(struct kiocb *, const struct iovec *, 1738extern ssize_t generic_file_buffered_write(struct kiocb *, const struct iovec *,
1715 unsigned long, loff_t, loff_t *, size_t, ssize_t); 1739 unsigned long, loff_t, loff_t *, size_t, ssize_t);
1716extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos); 1740extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos);
1717extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos); 1741extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos);
1718ssize_t generic_file_write_nolock(struct file *file, const struct iovec *iov,
1719 unsigned long nr_segs, loff_t *ppos);
1720extern ssize_t generic_file_sendfile(struct file *, loff_t *, size_t, read_actor_t, void *); 1742extern ssize_t generic_file_sendfile(struct file *, loff_t *, size_t, read_actor_t, void *);
1721extern void do_generic_mapping_read(struct address_space *mapping, 1743extern void do_generic_mapping_read(struct address_space *mapping,
1722 struct file_ra_state *, struct file *, 1744 struct file_ra_state *, struct file *,
@@ -1734,10 +1756,6 @@ extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out,
1734 1756
1735extern void 1757extern void
1736file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); 1758file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping);
1737extern ssize_t generic_file_readv(struct file *filp, const struct iovec *iov,
1738 unsigned long nr_segs, loff_t *ppos);
1739ssize_t generic_file_writev(struct file *filp, const struct iovec *iov,
1740 unsigned long nr_segs, loff_t *ppos);
1741extern loff_t no_llseek(struct file *file, loff_t offset, int origin); 1759extern loff_t no_llseek(struct file *file, loff_t offset, int origin);
1742extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin); 1760extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin);
1743extern loff_t remote_llseek(struct file *file, loff_t offset, int origin); 1761extern loff_t remote_llseek(struct file *file, loff_t offset, int origin);
diff --git a/include/linux/fs_enet_pd.h b/include/linux/fs_enet_pd.h
index 74ed35a00a..543cd3cd9e 100644
--- a/include/linux/fs_enet_pd.h
+++ b/include/linux/fs_enet_pd.h
@@ -55,6 +55,30 @@ static inline int fs_get_scc_index(enum fs_id id)
55 return -1; 55 return -1;
56} 56}
57 57
58static inline int fs_fec_index2id(int index)
59{
60 int id = fsid_fec1 + index - 1;
61 if (id >= fsid_fec1 && id <= fsid_fec2)
62 return id;
63 return FS_MAX_INDEX;
64 }
65
66static inline int fs_fcc_index2id(int index)
67{
68 int id = fsid_fcc1 + index - 1;
69 if (id >= fsid_fcc1 && id <= fsid_fcc3)
70 return id;
71 return FS_MAX_INDEX;
72}
73
74static inline int fs_scc_index2id(int index)
75{
76 int id = fsid_scc1 + index - 1;
77 if (id >= fsid_scc1 && id <= fsid_scc4)
78 return id;
79 return FS_MAX_INDEX;
80}
81
58enum fs_mii_method { 82enum fs_mii_method {
59 fsmii_fixed, 83 fsmii_fixed,
60 fsmii_fec, 84 fsmii_fec,
@@ -87,18 +111,21 @@ struct fs_mii_bb_platform_info {
87}; 111};
88 112
89struct fs_platform_info { 113struct fs_platform_info {
90 114
91 void(*init_ioports)(void); 115 void(*init_ioports)(struct fs_platform_info *);
92 /* device specific information */ 116 /* device specific information */
93 int fs_no; /* controller index */ 117 int fs_no; /* controller index */
118 char fs_type[4]; /* controller type */
94 119
95 u32 cp_page; /* CPM page */ 120 u32 cp_page; /* CPM page */
96 u32 cp_block; /* CPM sblock */ 121 u32 cp_block; /* CPM sblock */
97 122
98 u32 clk_trx; /* some stuff for pins & mux configuration*/ 123 u32 clk_trx; /* some stuff for pins & mux configuration*/
124 u32 clk_rx;
125 u32 clk_tx;
99 u32 clk_route; 126 u32 clk_route;
100 u32 clk_mask; 127 u32 clk_mask;
101 128
102 u32 mem_offset; 129 u32 mem_offset;
103 u32 dpram_offset; 130 u32 dpram_offset;
104 u32 fcc_regs_c; 131 u32 fcc_regs_c;
@@ -124,4 +151,16 @@ struct fs_mii_fec_platform_info {
124 u32 irq[32]; 151 u32 irq[32];
125 u32 mii_speed; 152 u32 mii_speed;
126}; 153};
154
155static inline int fs_get_id(struct fs_platform_info *fpi)
156{
157 if(strstr(fpi->fs_type, "SCC"))
158 return fs_scc_index2id(fpi->fs_no);
159 if(strstr(fpi->fs_type, "FCC"))
160 return fs_fcc_index2id(fpi->fs_no);
161 if(strstr(fpi->fs_type, "FEC"))
162 return fs_fec_index2id(fpi->fs_no);
163 return fpi->fs_no;
164}
165
127#endif 166#endif
diff --git a/include/linux/fs_uart_pd.h b/include/linux/fs_uart_pd.h
index f5975126b7..809bb9ffc7 100644
--- a/include/linux/fs_uart_pd.h
+++ b/include/linux/fs_uart_pd.h
@@ -46,15 +46,27 @@ static inline int fs_uart_id_fsid2smc(int id)
46} 46}
47 47
48struct fs_uart_platform_info { 48struct fs_uart_platform_info {
49 void(*init_ioports)(void); 49 void(*init_ioports)(struct fs_uart_platform_info *);
50 /* device specific information */ 50 /* device specific information */
51 int fs_no; /* controller index */ 51 int fs_no; /* controller index */
52 char fs_type[4]; /* controller type */
52 u32 uart_clk; 53 u32 uart_clk;
53 u8 tx_num_fifo; 54 u8 tx_num_fifo;
54 u8 tx_buf_size; 55 u8 tx_buf_size;
55 u8 rx_num_fifo; 56 u8 rx_num_fifo;
56 u8 rx_buf_size; 57 u8 rx_buf_size;
57 u8 brg; 58 u8 brg;
59 u8 clk_rx;
60 u8 clk_tx;
58}; 61};
59 62
63static inline int fs_uart_get_id(struct fs_uart_platform_info *fpi)
64{
65 if(strstr(fpi->fs_type, "SMC"))
66 return fs_uart_id_smc2fsid(fpi->fs_no);
67 if(strstr(fpi->fs_type, "SCC"))
68 return fs_uart_id_scc2fsid(fpi->fs_no);
69 return fpi->fs_no;
70}
71
60#endif 72#endif
diff --git a/include/linux/genalloc.h b/include/linux/genalloc.h
index 690c42803d..9869ef3674 100644
--- a/include/linux/genalloc.h
+++ b/include/linux/genalloc.h
@@ -31,5 +31,6 @@ struct gen_pool_chunk {
31 31
32extern struct gen_pool *gen_pool_create(int, int); 32extern struct gen_pool *gen_pool_create(int, int);
33extern int gen_pool_add(struct gen_pool *, unsigned long, size_t, int); 33extern int gen_pool_add(struct gen_pool *, unsigned long, size_t, int);
34extern void gen_pool_destroy(struct gen_pool *);
34extern unsigned long gen_pool_alloc(struct gen_pool *, size_t); 35extern unsigned long gen_pool_alloc(struct gen_pool *, size_t);
35extern void gen_pool_free(struct gen_pool *, unsigned long, size_t); 36extern void gen_pool_free(struct gen_pool *, unsigned long, size_t);
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index 50d8b5744c..612472aaa7 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -28,11 +28,16 @@
28 28
29#ifndef HARDIRQ_BITS 29#ifndef HARDIRQ_BITS
30#define HARDIRQ_BITS 12 30#define HARDIRQ_BITS 12
31
32#ifndef MAX_HARDIRQS_PER_CPU
33#define MAX_HARDIRQS_PER_CPU NR_IRQS
34#endif
35
31/* 36/*
32 * The hardirq mask has to be large enough to have space for potentially 37 * The hardirq mask has to be large enough to have space for potentially
33 * all IRQ sources in the system nesting on a single CPU. 38 * all IRQ sources in the system nesting on a single CPU.
34 */ 39 */
35#if (1 << HARDIRQ_BITS) < NR_IRQS 40#if (1 << HARDIRQ_BITS) < MAX_HARDIRQS_PER_CPU
36# error HARDIRQ_BITS is too low! 41# error HARDIRQ_BITS is too low!
37#endif 42#endif
38#endif 43#endif
diff --git a/include/linux/harrier_defs.h b/include/linux/harrier_defs.h
index 685b252e16..efef11db79 100644
--- a/include/linux/harrier_defs.h
+++ b/include/linux/harrier_defs.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * asm-ppc/harrier_defs.h 2 * include/linux/harrier_defs.h
3 * 3 *
4 * Definitions for Motorola MCG Harrier North Bridge & Memory controller 4 * Definitions for Motorola MCG Harrier North Bridge & Memory controller
5 * 5 *
diff --git a/include/linux/htirq.h b/include/linux/htirq.h
new file mode 100644
index 0000000000..1f15ce279a
--- /dev/null
+++ b/include/linux/htirq.h
@@ -0,0 +1,15 @@
1#ifndef LINUX_HTIRQ_H
2#define LINUX_HTIRQ_H
3
4/* Helper functions.. */
5void write_ht_irq_low(unsigned int irq, u32 data);
6void write_ht_irq_high(unsigned int irq, u32 data);
7u32 read_ht_irq_low(unsigned int irq);
8u32 read_ht_irq_high(unsigned int irq);
9void mask_ht_irq(unsigned int irq);
10void unmask_ht_irq(unsigned int irq);
11
12/* The arch hook for getting things started */
13int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev);
14
15#endif /* LINUX_HTIRQ_H */
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 99620451d9..07d8d72554 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -251,7 +251,8 @@ static inline void ide_std_init_ports(hw_regs_t *hw,
251 251
252#include <asm/ide.h> 252#include <asm/ide.h>
253 253
254#ifndef MAX_HWIFS 254#if !defined(MAX_HWIFS) || defined(CONFIG_EMBEDDED)
255#undef MAX_HWIFS
255#define MAX_HWIFS CONFIG_IDE_MAX_HWIFS 256#define MAX_HWIFS CONFIG_IDE_MAX_HWIFS
256#endif 257#endif
257 258
@@ -773,12 +774,13 @@ typedef struct hwif_s {
773 unsigned long dma_status; /* dma status register */ 774 unsigned long dma_status; /* dma status register */
774 unsigned long dma_vendor3; /* dma vendor 3 register */ 775 unsigned long dma_vendor3; /* dma vendor 3 register */
775 unsigned long dma_prdtable; /* actual prd table address */ 776 unsigned long dma_prdtable; /* actual prd table address */
776 unsigned long dma_base2; /* extended base addr for dma ports */
777 777
778 unsigned dma_extra; /* extra addr for dma ports */
779 unsigned long config_data; /* for use by chipset-specific code */ 778 unsigned long config_data; /* for use by chipset-specific code */
780 unsigned long select_data; /* for use by chipset-specific code */ 779 unsigned long select_data; /* for use by chipset-specific code */
781 780
781 unsigned long extra_base; /* extra addr for dma ports */
782 unsigned extra_ports; /* number of extra dma ports */
783
782 unsigned noprobe : 1; /* don't probe for this interface */ 784 unsigned noprobe : 1; /* don't probe for this interface */
783 unsigned present : 1; /* this interface exists */ 785 unsigned present : 1; /* this interface exists */
784 unsigned hold : 1; /* this interface is always present */ 786 unsigned hold : 1; /* this interface is always present */
@@ -823,6 +825,9 @@ typedef struct hwgroup_s {
823 unsigned int sleeping : 1; 825 unsigned int sleeping : 1;
824 /* BOOL: polling active & poll_timeout field valid */ 826 /* BOOL: polling active & poll_timeout field valid */
825 unsigned int polling : 1; 827 unsigned int polling : 1;
828 /* BOOL: in a polling reset situation. Must not trigger another reset yet */
829 unsigned int resetting : 1;
830
826 /* current drive */ 831 /* current drive */
827 ide_drive_t *drive; 832 ide_drive_t *drive;
828 /* ptr to current hwif in linked-list */ 833 /* ptr to current hwif in linked-list */
@@ -1190,7 +1195,6 @@ extern int ideprobe_init(void);
1190extern void ide_scan_pcibus(int scan_direction) __init; 1195extern void ide_scan_pcibus(int scan_direction) __init;
1191extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *owner); 1196extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *owner);
1192#define ide_pci_register_driver(d) __ide_pci_register_driver(d, THIS_MODULE) 1197#define ide_pci_register_driver(d) __ide_pci_register_driver(d, THIS_MODULE)
1193extern void ide_pci_unregister_driver(struct pci_driver *driver);
1194void ide_pci_setup_ports(struct pci_dev *, struct ide_pci_device_s *, int, ata_index_t *); 1198void ide_pci_setup_ports(struct pci_dev *, struct ide_pci_device_s *, int, ata_index_t *);
1195extern void ide_setup_pci_noise (struct pci_dev *dev, struct ide_pci_device_s *d); 1199extern void ide_setup_pci_noise (struct pci_dev *dev, struct ide_pci_device_s *d);
1196 1200
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 60aac2cea0..33c5daacc7 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -4,7 +4,9 @@
4#include <linux/file.h> 4#include <linux/file.h>
5#include <linux/rcupdate.h> 5#include <linux/rcupdate.h>
6#include <linux/irqflags.h> 6#include <linux/irqflags.h>
7#include <linux/utsname.h>
7#include <linux/lockdep.h> 8#include <linux/lockdep.h>
9#include <linux/ipc.h>
8 10
9#define INIT_FDTABLE \ 11#define INIT_FDTABLE \
10{ \ 12{ \
@@ -68,6 +70,15 @@
68 .session = 1, \ 70 .session = 1, \
69} 71}
70 72
73extern struct nsproxy init_nsproxy;
74#define INIT_NSPROXY(nsproxy) { \
75 .count = ATOMIC_INIT(1), \
76 .nslock = SPIN_LOCK_UNLOCKED, \
77 .uts_ns = &init_uts_ns, \
78 .namespace = NULL, \
79 INIT_IPC_NS(ipc_ns) \
80}
81
71#define INIT_SIGHAND(sighand) { \ 82#define INIT_SIGHAND(sighand) { \
72 .count = ATOMIC_INIT(1), \ 83 .count = ATOMIC_INIT(1), \
73 .action = { { { .sa_handler = NULL, } }, }, \ 84 .action = { { { .sa_handler = NULL, } }, }, \
@@ -117,6 +128,7 @@ extern struct group_info init_groups;
117 .files = &init_files, \ 128 .files = &init_files, \
118 .signal = &init_signals, \ 129 .signal = &init_signals, \
119 .sighand = &init_sighand, \ 130 .sighand = &init_sighand, \
131 .nsproxy = &init_nsproxy, \
120 .pending = { \ 132 .pending = { \
121 .list = LIST_HEAD_INIT(tsk.pending.list), \ 133 .list = LIST_HEAD_INIT(tsk.pending.list), \
122 .signal = {{0}}}, \ 134 .signal = {{0}}}, \
diff --git a/include/linux/input.h b/include/linux/input.h
index b3253ab72f..5770105471 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -349,6 +349,9 @@ struct input_absinfo {
349 349
350#define KEY_BATTERY 236 350#define KEY_BATTERY 236
351 351
352#define KEY_BLUETOOTH 237
353#define KEY_WLAN 238
354
352#define KEY_UNKNOWN 240 355#define KEY_UNKNOWN 240
353 356
354#define BTN_MISC 0x100 357#define BTN_MISC 0x100
@@ -645,6 +648,7 @@ struct input_absinfo {
645#define BUS_USB 0x03 648#define BUS_USB 0x03
646#define BUS_HIL 0x04 649#define BUS_HIL 0x04
647#define BUS_BLUETOOTH 0x05 650#define BUS_BLUETOOTH 0x05
651#define BUS_VIRTUAL 0x06
648 652
649#define BUS_ISA 0x10 653#define BUS_ISA 0x10
650#define BUS_I8042 0x11 654#define BUS_I8042 0x11
@@ -667,98 +671,167 @@ struct input_absinfo {
667 671
668/* 672/*
669 * Structures used in ioctls to upload effects to a device 673 * Structures used in ioctls to upload effects to a device
670 * The first structures are not passed directly by using ioctls. 674 * They are pieces of a bigger structure (called ff_effect)
671 * They are sub-structures of the actually sent structure (called ff_effect) 675 */
676
677/*
678 * All duration values are expressed in ms. Values above 32767 ms (0x7fff)
679 * should not be used and have unspecified results.
672 */ 680 */
673 681
682/**
683 * struct ff_replay - defines scheduling of the effect
684 * @length: duration of the effect
685 * @delay: delay before effect should start playing
686 */
674struct ff_replay { 687struct ff_replay {
675 __u16 length; /* Duration of an effect in ms. All other times are also expressed in ms */ 688 __u16 length;
676 __u16 delay; /* Time to wait before to start playing an effect */ 689 __u16 delay;
677}; 690};
678 691
692/**
693 * struct ff_trigger - defines what triggers the effect
694 * @button: number of the button triggering the effect
695 * @interval: controls how soon the effect can be re-triggered
696 */
679struct ff_trigger { 697struct ff_trigger {
680 __u16 button; /* Number of button triggering an effect */ 698 __u16 button;
681 __u16 interval; /* Time to wait before an effect can be re-triggered (ms) */ 699 __u16 interval;
682}; 700};
683 701
702/**
703 * struct ff_envelope - generic effect envelope
704 * @attack_length: duration of the attack (ms)
705 * @attack_level: level at the beginning of the attack
706 * @fade_length: duration of fade (ms)
707 * @fade_level: level at the end of fade
708 *
709 * The @attack_level and @fade_level are absolute values; when applying
710 * envelope force-feedback core will convert to positive/negative
711 * value based on polarity of the default level of the effect.
712 * Valid range for the attack and fade levels is 0x0000 - 0x7fff
713 */
684struct ff_envelope { 714struct ff_envelope {
685 __u16 attack_length; /* Duration of attack (ms) */ 715 __u16 attack_length;
686 __u16 attack_level; /* Level at beginning of attack */ 716 __u16 attack_level;
687 __u16 fade_length; /* Duration of fade (ms) */ 717 __u16 fade_length;
688 __u16 fade_level; /* Level at end of fade */ 718 __u16 fade_level;
689}; 719};
690 720
691/* FF_CONSTANT */ 721/**
722 * struct ff_constant_effect - defines parameters of a constant effect
723 * @level: strength of the effect; may be negative
724 * @envelope: envelope data
725 */
692struct ff_constant_effect { 726struct ff_constant_effect {
693 __s16 level; /* Strength of effect. Negative values are OK */ 727 __s16 level;
694 struct ff_envelope envelope; 728 struct ff_envelope envelope;
695}; 729};
696 730
697/* FF_RAMP */ 731/**
732 * struct ff_ramp_effect - defines parameters of a ramp effect
733 * @start_level: beginning strength of the effect; may be negative
734 * @end_level: final strength of the effect; may be negative
735 * @envelope: envelope data
736 */
698struct ff_ramp_effect { 737struct ff_ramp_effect {
699 __s16 start_level; 738 __s16 start_level;
700 __s16 end_level; 739 __s16 end_level;
701 struct ff_envelope envelope; 740 struct ff_envelope envelope;
702}; 741};
703 742
704/* FF_SPRING of FF_FRICTION */ 743/**
744 * struct ff_condition_effect - defines a spring or friction effect
745 * @right_saturation: maximum level when joystick moved all way to the right
746 * @left_saturation: same for the left side
747 * @right_coeff: controls how fast the force grows when the joystick moves
748 * to the right
749 * @left_coeff: same for the left side
750 * @deadband: size of the dead zone, where no force is produced
751 * @center: position of the dead zone
752 */
705struct ff_condition_effect { 753struct ff_condition_effect {
706 __u16 right_saturation; /* Max level when joystick is on the right */ 754 __u16 right_saturation;
707 __u16 left_saturation; /* Max level when joystick in on the left */ 755 __u16 left_saturation;
708
709 __s16 right_coeff; /* Indicates how fast the force grows when the
710 joystick moves to the right */
711 __s16 left_coeff; /* Same for left side */
712 756
713 __u16 deadband; /* Size of area where no force is produced */ 757 __s16 right_coeff;
714 __s16 center; /* Position of dead zone */ 758 __s16 left_coeff;
715 759
760 __u16 deadband;
761 __s16 center;
716}; 762};
717 763
718/* FF_PERIODIC */ 764/**
765 * struct ff_periodic_effect - defines parameters of a periodic effect
766 * @waveform: kind of the effect (wave)
767 * @period: period of the wave (ms)
768 * @magnitude: peak value
769 * @offset: mean value of the wave (roughly)
770 * @phase: 'horizontal' shift
771 * @envelope: envelope data
772 * @custom_len: number of samples (FF_CUSTOM only)
773 * @custom_data: buffer of samples (FF_CUSTOM only)
774 *
775 * Known waveforms - FF_SQUARE, FF_TRIANGLE, FF_SINE, FF_SAW_UP,
776 * FF_SAW_DOWN, FF_CUSTOM. The exact syntax FF_CUSTOM is undefined
777 * for the time being as no driver supports it yet.
778 *
779 * Note: the data pointed by custom_data is copied by the driver.
780 * You can therefore dispose of the memory after the upload/update.
781 */
719struct ff_periodic_effect { 782struct ff_periodic_effect {
720 __u16 waveform; /* Kind of wave (sine, square...) */ 783 __u16 waveform;
721 __u16 period; /* in ms */ 784 __u16 period;
722 __s16 magnitude; /* Peak value */ 785 __s16 magnitude;
723 __s16 offset; /* Mean value of wave (roughly) */ 786 __s16 offset;
724 __u16 phase; /* 'Horizontal' shift */ 787 __u16 phase;
725 788
726 struct ff_envelope envelope; 789 struct ff_envelope envelope;
727 790
728/* Only used if waveform == FF_CUSTOM */ 791 __u32 custom_len;
729 __u32 custom_len; /* Number of samples */ 792 __s16 *custom_data;
730 __s16 *custom_data; /* Buffer of samples */
731/* Note: the data pointed by custom_data is copied by the driver. You can
732 * therefore dispose of the memory after the upload/update */
733}; 793};
734 794
735/* FF_RUMBLE */ 795/**
736/* Some rumble pads have two motors of different weight. 796 * struct ff_rumble_effect - defines parameters of a periodic effect
737 strong_magnitude represents the magnitude of the vibration generated 797 * @strong_magnitude: magnitude of the heavy motor
738 by the heavy motor. 798 * @weak_magnitude: magnitude of the light one
739*/ 799 *
800 * Some rumble pads have two motors of different weight. Strong_magnitude
801 * represents the magnitude of the vibration generated by the heavy one.
802 */
740struct ff_rumble_effect { 803struct ff_rumble_effect {
741 __u16 strong_magnitude; /* Magnitude of the heavy motor */ 804 __u16 strong_magnitude;
742 __u16 weak_magnitude; /* Magnitude of the light one */ 805 __u16 weak_magnitude;
743}; 806};
744 807
745/* 808/**
746 * Structure sent through ioctl from the application to the driver 809 * struct ff_effect - defines force feedback effect
810 * @type: type of the effect (FF_CONSTANT, FF_PERIODIC, FF_RAMP, FF_SPRING,
811 * FF_FRICTION, FF_DAMPER, FF_RUMBLE, FF_INERTIA, or FF_CUSTOM)
812 * @id: an unique id assigned to an effect
813 * @direction: direction of the effect
814 * @trigger: trigger conditions (struct ff_trigger)
815 * @replay: scheduling of the effect (struct ff_replay)
816 * @u: effect-specific structure (one of ff_constant_effect, ff_ramp_effect,
817 * ff_periodic_effect, ff_condition_effect, ff_rumble_effect) further
818 * defining effect parameters
819 *
820 * This structure is sent through ioctl from the application to the driver.
821 * To create a new effect aplication should set its @id to -1; the kernel
822 * will return assigned @id which can later be used to update or delete
823 * this effect.
824 *
825 * Direction of the effect is encoded as follows:
826 * 0 deg -> 0x0000 (down)
827 * 90 deg -> 0x4000 (left)
828 * 180 deg -> 0x8000 (up)
829 * 270 deg -> 0xC000 (right)
747 */ 830 */
748struct ff_effect { 831struct ff_effect {
749 __u16 type; 832 __u16 type;
750/* Following field denotes the unique id assigned to an effect.
751 * If user sets if to -1, a new effect is created, and its id is returned in the same field
752 * Else, the user sets it to the effect id it wants to update.
753 */
754 __s16 id; 833 __s16 id;
755 834 __u16 direction;
756 __u16 direction; /* Direction. 0 deg -> 0x0000 (down)
757 90 deg -> 0x4000 (left)
758 180 deg -> 0x8000 (up)
759 270 deg -> 0xC000 (right)
760 */
761
762 struct ff_trigger trigger; 835 struct ff_trigger trigger;
763 struct ff_replay replay; 836 struct ff_replay replay;
764 837
@@ -784,6 +857,9 @@ struct ff_effect {
784#define FF_INERTIA 0x56 857#define FF_INERTIA 0x56
785#define FF_RAMP 0x57 858#define FF_RAMP 0x57
786 859
860#define FF_EFFECT_MIN FF_RUMBLE
861#define FF_EFFECT_MAX FF_RAMP
862
787/* 863/*
788 * Force feedback periodic effect types 864 * Force feedback periodic effect types
789 */ 865 */
@@ -795,6 +871,9 @@ struct ff_effect {
795#define FF_SAW_DOWN 0x5c 871#define FF_SAW_DOWN 0x5c
796#define FF_CUSTOM 0x5d 872#define FF_CUSTOM 0x5d
797 873
874#define FF_WAVEFORM_MIN FF_SQUARE
875#define FF_WAVEFORM_MAX FF_CUSTOM
876
798/* 877/*
799 * Set ff device properties 878 * Set ff device properties
800 */ 879 */
@@ -864,12 +943,13 @@ struct input_dev {
864 unsigned long sndbit[NBITS(SND_MAX)]; 943 unsigned long sndbit[NBITS(SND_MAX)];
865 unsigned long ffbit[NBITS(FF_MAX)]; 944 unsigned long ffbit[NBITS(FF_MAX)];
866 unsigned long swbit[NBITS(SW_MAX)]; 945 unsigned long swbit[NBITS(SW_MAX)];
867 int ff_effects_max;
868 946
869 unsigned int keycodemax; 947 unsigned int keycodemax;
870 unsigned int keycodesize; 948 unsigned int keycodesize;
871 void *keycode; 949 void *keycode;
872 950
951 struct ff_device *ff;
952
873 unsigned int repeat_key; 953 unsigned int repeat_key;
874 struct timer_list timer; 954 struct timer_list timer;
875 955
@@ -895,8 +975,6 @@ struct input_dev {
895 void (*close)(struct input_dev *dev); 975 void (*close)(struct input_dev *dev);
896 int (*flush)(struct input_dev *dev, struct file *file); 976 int (*flush)(struct input_dev *dev, struct file *file);
897 int (*event)(struct input_dev *dev, unsigned int type, unsigned int code, int value); 977 int (*event)(struct input_dev *dev, unsigned int type, unsigned int code, int value);
898 int (*upload_effect)(struct input_dev *dev, struct ff_effect *effect);
899 int (*erase_effect)(struct input_dev *dev, int effect_id);
900 978
901 struct input_handle *grab; 979 struct input_handle *grab;
902 980
@@ -904,9 +982,6 @@ struct input_dev {
904 unsigned int users; 982 unsigned int users;
905 983
906 struct class_device cdev; 984 struct class_device cdev;
907 struct device *dev; /* will be removed soon */
908
909 int dynalloc; /* temporarily */
910 985
911 struct list_head h_list; 986 struct list_head h_list;
912 struct list_head node; 987 struct list_head node;
@@ -985,16 +1060,16 @@ struct input_handler {
985 void *private; 1060 void *private;
986 1061
987 void (*event)(struct input_handle *handle, unsigned int type, unsigned int code, int value); 1062 void (*event)(struct input_handle *handle, unsigned int type, unsigned int code, int value);
988 struct input_handle* (*connect)(struct input_handler *handler, struct input_dev *dev, struct input_device_id *id); 1063 struct input_handle* (*connect)(struct input_handler *handler, struct input_dev *dev, const struct input_device_id *id);
989 void (*disconnect)(struct input_handle *handle); 1064 void (*disconnect)(struct input_handle *handle);
990 void (*start)(struct input_handle *handle); 1065 void (*start)(struct input_handle *handle);
991 1066
992 const struct file_operations *fops; 1067 const struct file_operations *fops;
993 int minor; 1068 int minor;
994 char *name; 1069 const char *name;
995 1070
996 struct input_device_id *id_table; 1071 const struct input_device_id *id_table;
997 struct input_device_id *blacklist; 1072 const struct input_device_id *blacklist;
998 1073
999 struct list_head h_list; 1074 struct list_head h_list;
1000 struct list_head node; 1075 struct list_head node;
@@ -1005,7 +1080,7 @@ struct input_handle {
1005 void *private; 1080 void *private;
1006 1081
1007 int open; 1082 int open;
1008 char *name; 1083 const char *name;
1009 1084
1010 struct input_dev *dev; 1085 struct input_dev *dev;
1011 struct input_handler *handler; 1086 struct input_handler *handler;
@@ -1019,12 +1094,6 @@ struct input_handle {
1019#define to_handle(n) container_of(n,struct input_handle,d_node) 1094#define to_handle(n) container_of(n,struct input_handle,d_node)
1020#define to_handle_h(n) container_of(n,struct input_handle,h_node) 1095#define to_handle_h(n) container_of(n,struct input_handle,h_node)
1021 1096
1022static inline void init_input_dev(struct input_dev *dev)
1023{
1024 INIT_LIST_HEAD(&dev->h_list);
1025 INIT_LIST_HEAD(&dev->node);
1026}
1027
1028struct input_dev *input_allocate_device(void); 1097struct input_dev *input_allocate_device(void);
1029void input_free_device(struct input_dev *dev); 1098void input_free_device(struct input_dev *dev);
1030 1099
@@ -1041,7 +1110,7 @@ static inline void input_put_device(struct input_dev *dev)
1041int input_register_device(struct input_dev *); 1110int input_register_device(struct input_dev *);
1042void input_unregister_device(struct input_dev *); 1111void input_unregister_device(struct input_dev *);
1043 1112
1044void input_register_handler(struct input_handler *); 1113int input_register_handler(struct input_handler *);
1045void input_unregister_handler(struct input_handler *); 1114void input_unregister_handler(struct input_handler *);
1046 1115
1047int input_grab_device(struct input_handle *); 1116int input_grab_device(struct input_handle *);
@@ -1070,11 +1139,6 @@ static inline void input_report_abs(struct input_dev *dev, unsigned int code, in
1070 input_event(dev, EV_ABS, code, value); 1139 input_event(dev, EV_ABS, code, value);
1071} 1140}
1072 1141
1073static inline void input_report_ff(struct input_dev *dev, unsigned int code, int value)
1074{
1075 input_event(dev, EV_FF, code, value);
1076}
1077
1078static inline void input_report_ff_status(struct input_dev *dev, unsigned int code, int value) 1142static inline void input_report_ff_status(struct input_dev *dev, unsigned int code, int value)
1079{ 1143{
1080 input_event(dev, EV_FF_STATUS, code, value); 1144 input_event(dev, EV_FF_STATUS, code, value);
@@ -1108,5 +1172,61 @@ static inline void input_set_abs_params(struct input_dev *dev, int axis, int min
1108 1172
1109extern struct class input_class; 1173extern struct class input_class;
1110 1174
1175/**
1176 * struct ff_device - force-feedback part of an input device
1177 * @upload: Called to upload an new effect into device
1178 * @erase: Called to erase an effect from device
1179 * @playback: Called to request device to start playing specified effect
1180 * @set_gain: Called to set specified gain
1181 * @set_autocenter: Called to auto-center device
1182 * @destroy: called by input core when parent input device is being
1183 * destroyed
1184 * @private: driver-specific data, will be freed automatically
1185 * @ffbit: bitmap of force feedback capabilities truly supported by
1186 * device (not emulated like ones in input_dev->ffbit)
1187 * @mutex: mutex for serializing access to the device
1188 * @max_effects: maximum number of effects supported by device
1189 * @effects: pointer to an array of effects currently loaded into device
1190 * @effect_owners: array of effect owners; when file handle owning
1191 * an effect gets closed the effcet is automatically erased
1192 *
1193 * Every force-feedback device must implement upload() and playback()
1194 * methods; erase() is optional. set_gain() and set_autocenter() need
1195 * only be implemented if driver sets up FF_GAIN and FF_AUTOCENTER
1196 * bits.
1197 */
1198struct ff_device {
1199 int (*upload)(struct input_dev *dev, struct ff_effect *effect,
1200 struct ff_effect *old);
1201 int (*erase)(struct input_dev *dev, int effect_id);
1202
1203 int (*playback)(struct input_dev *dev, int effect_id, int value);
1204 void (*set_gain)(struct input_dev *dev, u16 gain);
1205 void (*set_autocenter)(struct input_dev *dev, u16 magnitude);
1206
1207 void (*destroy)(struct ff_device *);
1208
1209 void *private;
1210
1211 unsigned long ffbit[NBITS(FF_MAX)];
1212
1213 struct mutex mutex;
1214
1215 int max_effects;
1216 struct ff_effect *effects;
1217 struct file *effect_owners[];
1218};
1219
1220int input_ff_create(struct input_dev *dev, int max_effects);
1221void input_ff_destroy(struct input_dev *dev);
1222
1223int input_ff_event(struct input_dev *dev, unsigned int type, unsigned int code, int value);
1224
1225int input_ff_upload(struct input_dev *dev, struct ff_effect *effect, struct file *file);
1226int input_ff_erase(struct input_dev *dev, int effect_id, struct file *file);
1227
1228int input_ff_create_memless(struct input_dev *dev, void *data,
1229 int (*play_effect)(struct input_dev *, void *, struct ff_effect *));
1230
1111#endif 1231#endif
1112#endif 1232#endif
diff --git a/include/linux/io.h b/include/linux/io.h
index 420e2fdf26..aa3f5af670 100644
--- a/include/linux/io.h
+++ b/include/linux/io.h
@@ -19,8 +19,12 @@
19#define _LINUX_IO_H 19#define _LINUX_IO_H
20 20
21#include <asm/io.h> 21#include <asm/io.h>
22#include <asm/page.h>
22 23
23void __iowrite32_copy(void __iomem *to, const void *from, size_t count); 24void __iowrite32_copy(void __iomem *to, const void *from, size_t count);
24void __iowrite64_copy(void __iomem *to, const void *from, size_t count); 25void __iowrite64_copy(void __iomem *to, const void *from, size_t count);
25 26
27int ioremap_page_range(unsigned long addr, unsigned long end,
28 unsigned long phys_addr, pgprot_t prot);
29
26#endif /* _LINUX_IO_H */ 30#endif /* _LINUX_IO_H */
diff --git a/include/linux/ipc.h b/include/linux/ipc.h
index b291189737..636094c29b 100644
--- a/include/linux/ipc.h
+++ b/include/linux/ipc.h
@@ -51,6 +51,8 @@ struct ipc_perm
51 51
52#ifdef __KERNEL__ 52#ifdef __KERNEL__
53 53
54#include <linux/kref.h>
55
54#define IPCMNI 32768 /* <= MAX_INT limit for ipc arrays (including sysctl changes) */ 56#define IPCMNI 32768 /* <= MAX_INT limit for ipc arrays (including sysctl changes) */
55 57
56/* used by in-kernel data structures */ 58/* used by in-kernel data structures */
@@ -68,6 +70,59 @@ struct kern_ipc_perm
68 void *security; 70 void *security;
69}; 71};
70 72
73struct ipc_ids;
74struct ipc_namespace {
75 struct kref kref;
76 struct ipc_ids *ids[3];
77
78 int sem_ctls[4];
79 int used_sems;
80
81 int msg_ctlmax;
82 int msg_ctlmnb;
83 int msg_ctlmni;
84
85 size_t shm_ctlmax;
86 size_t shm_ctlall;
87 int shm_ctlmni;
88 int shm_tot;
89};
90
91extern struct ipc_namespace init_ipc_ns;
92
93#ifdef CONFIG_SYSVIPC
94#define INIT_IPC_NS(ns) .ns = &init_ipc_ns,
95#else
96#define INIT_IPC_NS(ns)
97#endif
98
99#ifdef CONFIG_IPC_NS
100extern void free_ipc_ns(struct kref *kref);
101extern int copy_ipcs(unsigned long flags, struct task_struct *tsk);
102extern int unshare_ipcs(unsigned long flags, struct ipc_namespace **ns);
103#else
104static inline int copy_ipcs(unsigned long flags, struct task_struct *tsk)
105{
106 return 0;
107}
108#endif
109
110static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns)
111{
112#ifdef CONFIG_IPC_NS
113 if (ns)
114 kref_get(&ns->kref);
115#endif
116 return ns;
117}
118
119static inline void put_ipc_ns(struct ipc_namespace *ns)
120{
121#ifdef CONFIG_IPC_NS
122 kref_put(&ns->kref, free_ipc_ns);
123#endif
124}
125
71#endif /* __KERNEL__ */ 126#endif /* __KERNEL__ */
72 127
73#endif /* _LINUX_IPC_H */ 128#endif /* _LINUX_IPC_H */
diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h
index d09fbeabf1..796ca009fd 100644
--- a/include/linux/ipmi.h
+++ b/include/linux/ipmi.h
@@ -148,6 +148,13 @@ struct ipmi_lan_addr
148#define IPMI_BMC_CHANNEL 0xf 148#define IPMI_BMC_CHANNEL 0xf
149#define IPMI_NUM_CHANNELS 0x10 149#define IPMI_NUM_CHANNELS 0x10
150 150
151/*
152 * Used to signify an "all channel" bitmask. This is more than the
153 * actual number of channels because this is used in userland and
154 * will cover us if the number of channels is extended.
155 */
156#define IPMI_CHAN_ALL (~0)
157
151 158
152/* 159/*
153 * A raw IPMI message without any addressing. This covers both 160 * A raw IPMI message without any addressing. This covers both
@@ -350,18 +357,21 @@ int ipmi_request_supply_msgs(ipmi_user_t user,
350 357
351/* 358/*
352 * When commands come in to the SMS, the user can register to receive 359 * When commands come in to the SMS, the user can register to receive
353 * them. Only one user can be listening on a specific netfn/cmd pair 360 * them. Only one user can be listening on a specific netfn/cmd/chan tuple
354 * at a time, you will get an EBUSY error if the command is already 361 * at a time, you will get an EBUSY error if the command is already
355 * registered. If a command is received that does not have a user 362 * registered. If a command is received that does not have a user
356 * registered, the driver will automatically return the proper 363 * registered, the driver will automatically return the proper
357 * error. 364 * error. Channels are specified as a bitfield, use IPMI_CHAN_ALL to
365 * mean all channels.
358 */ 366 */
359int ipmi_register_for_cmd(ipmi_user_t user, 367int ipmi_register_for_cmd(ipmi_user_t user,
360 unsigned char netfn, 368 unsigned char netfn,
361 unsigned char cmd); 369 unsigned char cmd,
370 unsigned int chans);
362int ipmi_unregister_for_cmd(ipmi_user_t user, 371int ipmi_unregister_for_cmd(ipmi_user_t user,
363 unsigned char netfn, 372 unsigned char netfn,
364 unsigned char cmd); 373 unsigned char cmd,
374 unsigned int chans);
365 375
366/* 376/*
367 * Allow run-to-completion mode to be set for the interface of 377 * Allow run-to-completion mode to be set for the interface of
@@ -571,6 +581,36 @@ struct ipmi_cmdspec
571#define IPMICTL_UNREGISTER_FOR_CMD _IOR(IPMI_IOC_MAGIC, 15, \ 581#define IPMICTL_UNREGISTER_FOR_CMD _IOR(IPMI_IOC_MAGIC, 15, \
572 struct ipmi_cmdspec) 582 struct ipmi_cmdspec)
573 583
584/*
585 * Register to get commands from other entities on specific channels.
586 * This way, you can only listen on specific channels, or have messages
587 * from some channels go to one place and other channels to someplace
588 * else. The chans field is a bitmask, (1 << channel) for each channel.
589 * It may be IPMI_CHAN_ALL for all channels.
590 */
591struct ipmi_cmdspec_chans
592{
593 unsigned int netfn;
594 unsigned int cmd;
595 unsigned int chans;
596};
597
598/*
599 * Register to receive a specific command on specific channels. error values:
600 * - EFAULT - an address supplied was invalid.
601 * - EBUSY - One of the netfn/cmd/chans supplied was already in use.
602 * - ENOMEM - could not allocate memory for the entry.
603 */
604#define IPMICTL_REGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 28, \
605 struct ipmi_cmdspec_chans)
606/*
607 * Unregister some netfn/cmd/chans. error values:
608 * - EFAULT - an address supplied was invalid.
609 * - ENOENT - None of the netfn/cmd/chans were found registered for this user.
610 */
611#define IPMICTL_UNREGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 29, \
612 struct ipmi_cmdspec_chans)
613
574/* 614/*
575 * Set whether this interface receives events. Note that the first 615 * Set whether this interface receives events. Note that the first
576 * user registered for events will get all pending events for the 616 * user registered for events will get all pending events for the
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 48d3cb3b6a..6f463606c3 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -59,6 +59,7 @@
59#define IRQ_NOAUTOEN 0x08000000 /* IRQ will not be enabled on request irq */ 59#define IRQ_NOAUTOEN 0x08000000 /* IRQ will not be enabled on request irq */
60#define IRQ_DELAYED_DISABLE 0x10000000 /* IRQ disable (masking) happens delayed. */ 60#define IRQ_DELAYED_DISABLE 0x10000000 /* IRQ disable (masking) happens delayed. */
61#define IRQ_WAKEUP 0x20000000 /* IRQ triggers system wakeup */ 61#define IRQ_WAKEUP 0x20000000 /* IRQ triggers system wakeup */
62#define IRQ_MOVE_PENDING 0x40000000 /* need to re-target IRQ destination */
62 63
63struct proc_dir_entry; 64struct proc_dir_entry;
64 65
@@ -132,7 +133,6 @@ struct irq_chip {
132 * @affinity: IRQ affinity on SMP 133 * @affinity: IRQ affinity on SMP
133 * @cpu: cpu index useful for balancing 134 * @cpu: cpu index useful for balancing
134 * @pending_mask: pending rebalanced interrupts 135 * @pending_mask: pending rebalanced interrupts
135 * @move_irq: need to re-target IRQ destination
136 * @dir: /proc/irq/ procfs entry 136 * @dir: /proc/irq/ procfs entry
137 * @affinity_entry: /proc/irq/smp_affinity procfs entry on SMP 137 * @affinity_entry: /proc/irq/smp_affinity procfs entry on SMP
138 * 138 *
@@ -159,7 +159,6 @@ struct irq_desc {
159#endif 159#endif
160#if defined(CONFIG_GENERIC_PENDING_IRQ) || defined(CONFIG_IRQBALANCE) 160#if defined(CONFIG_GENERIC_PENDING_IRQ) || defined(CONFIG_IRQBALANCE)
161 cpumask_t pending_mask; 161 cpumask_t pending_mask;
162 unsigned int move_irq; /* need to re-target IRQ dest */
163#endif 162#endif
164#ifdef CONFIG_PROC_FS 163#ifdef CONFIG_PROC_FS
165 struct proc_dir_entry *dir; 164 struct proc_dir_entry *dir;
@@ -206,36 +205,7 @@ static inline void set_native_irq_info(int irq, cpumask_t mask)
206 205
207void set_pending_irq(unsigned int irq, cpumask_t mask); 206void set_pending_irq(unsigned int irq, cpumask_t mask);
208void move_native_irq(int irq); 207void move_native_irq(int irq);
209 208void move_masked_irq(int irq);
210#ifdef CONFIG_PCI_MSI
211/*
212 * Wonder why these are dummies?
213 * For e.g the set_ioapic_affinity_vector() calls the set_ioapic_affinity_irq()
214 * counter part after translating the vector to irq info. We need to perform
215 * this operation on the real irq, when we dont use vector, i.e when
216 * pci_use_vector() is false.
217 */
218static inline void move_irq(int irq)
219{
220}
221
222static inline void set_irq_info(int irq, cpumask_t mask)
223{
224}
225
226#else /* CONFIG_PCI_MSI */
227
228static inline void move_irq(int irq)
229{
230 move_native_irq(irq);
231}
232
233static inline void set_irq_info(int irq, cpumask_t mask)
234{
235 set_native_irq_info(irq, mask);
236}
237
238#endif /* CONFIG_PCI_MSI */
239 209
240#else /* CONFIG_GENERIC_PENDING_IRQ || CONFIG_IRQBALANCE */ 210#else /* CONFIG_GENERIC_PENDING_IRQ || CONFIG_IRQBALANCE */
241 211
@@ -247,21 +217,20 @@ static inline void move_native_irq(int irq)
247{ 217{
248} 218}
249 219
250static inline void set_pending_irq(unsigned int irq, cpumask_t mask) 220static inline void move_masked_irq(int irq)
251{ 221{
252} 222}
253 223
254static inline void set_irq_info(int irq, cpumask_t mask) 224static inline void set_pending_irq(unsigned int irq, cpumask_t mask)
255{ 225{
256 set_native_irq_info(irq, mask);
257} 226}
258 227
259#endif /* CONFIG_GENERIC_PENDING_IRQ */ 228#endif /* CONFIG_GENERIC_PENDING_IRQ */
260 229
261#else /* CONFIG_SMP */ 230#else /* CONFIG_SMP */
262 231
263#define move_irq(x)
264#define move_native_irq(x) 232#define move_native_irq(x)
233#define move_masked_irq(x)
265 234
266#endif /* CONFIG_SMP */ 235#endif /* CONFIG_SMP */
267 236
@@ -399,8 +368,22 @@ set_irq_chained_handler(unsigned int irq,
399 __set_irq_handler(irq, handle, 1); 368 __set_irq_handler(irq, handle, 1);
400} 369}
401 370
402/* Set/get chip/data for an IRQ: */ 371/* Handle dynamic irq creation and destruction */
372extern int create_irq(void);
373extern void destroy_irq(unsigned int irq);
403 374
375/* Test to see if a driver has successfully requested an irq */
376static inline int irq_has_action(unsigned int irq)
377{
378 struct irq_desc *desc = irq_desc + irq;
379 return desc->action != NULL;
380}
381
382/* Dynamic irq helper functions */
383extern void dynamic_irq_init(unsigned int irq);
384extern void dynamic_irq_cleanup(unsigned int irq);
385
386/* Set/get chip/data for an IRQ: */
404extern int set_irq_chip(unsigned int irq, struct irq_chip *chip); 387extern int set_irq_chip(unsigned int irq, struct irq_chip *chip);
405extern int set_irq_data(unsigned int irq, void *data); 388extern int set_irq_data(unsigned int irq, void *data);
406extern int set_irq_chip_data(unsigned int irq, void *data); 389extern int set_irq_chip_data(unsigned int irq, void *data);
diff --git a/include/linux/ite_gpio.h b/include/linux/ite_gpio.h
deleted file mode 100644
index b123a14292..0000000000
--- a/include/linux/ite_gpio.h
+++ /dev/null
@@ -1,66 +0,0 @@
1/*
2 * FILE NAME ite_gpio.h
3 *
4 * BRIEF MODULE DESCRIPTION
5 * Generic gpio.
6 *
7 * Author: MontaVista Software, Inc. <source@mvista.com>
8 * Hai-Pao Fan <haipao@mvista.com>
9 *
10 * Copyright 2001 MontaVista Software Inc.
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version.
16 *
17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
18 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
20 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
24 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * You should have received a copy of the GNU General Public License along
29 * with this program; if not, write to the Free Software Foundation, Inc.,
30 * 675 Mass Ave, Cambridge, MA 02139, USA.
31 */
32
33#ifndef __ITE_GPIO_H
34#define __ITE_GPIO_H
35
36#include <linux/ioctl.h>
37
38struct ite_gpio_ioctl_data {
39 __u32 device;
40 __u32 mask;
41 __u32 data;
42};
43
44#define ITE_GPIO_IOCTL_BASE 'Z'
45
46#define ITE_GPIO_IN _IOWR(ITE_GPIO_IOCTL_BASE, 0, struct ite_gpio_ioctl_data)
47#define ITE_GPIO_OUT _IOW (ITE_GPIO_IOCTL_BASE, 1, struct ite_gpio_ioctl_data)
48#define ITE_GPIO_INT_CTRL _IOW (ITE_GPIO_IOCTL_BASE, 2, struct ite_gpio_ioctl_data)
49#define ITE_GPIO_IN_STATUS _IOW (ITE_GPIO_IOCTL_BASE, 3, struct ite_gpio_ioctl_data)
50#define ITE_GPIO_OUT_STATUS _IOW (ITE_GPIO_IOCTL_BASE, 4, struct ite_gpio_ioctl_data)
51#define ITE_GPIO_GEN_CTRL _IOW (ITE_GPIO_IOCTL_BASE, 5, struct ite_gpio_ioctl_data)
52#define ITE_GPIO_INT_WAIT _IOW (ITE_GPIO_IOCTL_BASE, 6, struct ite_gpio_ioctl_data)
53
54#define ITE_GPIO_PORTA 0x01
55#define ITE_GPIO_PORTB 0x02
56#define ITE_GPIO_PORTC 0x04
57
58extern int ite_gpio_in(__u32 device, __u32 mask, volatile __u32 *data);
59extern int ite_gpio_out(__u32 device, __u32 mask, __u32 data);
60extern int ite_gpio_int_ctrl(__u32 device, __u32 mask, __u32 data);
61extern int ite_gpio_in_status(__u32 device, __u32 mask, volatile __u32 *data);
62extern int ite_gpio_out_status(__u32 device, __u32 mask, __u32 data);
63extern int ite_gpio_gen_ctrl(__u32 device, __u32 mask, __u32 data);
64extern int ite_gpio_int_wait(__u32 device, __u32 mask, __u32 data);
65
66#endif
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
index 849043ce4e..1cebcbc28b 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -12,6 +12,10 @@
12/* Lookup the address for a symbol. Returns 0 if not found. */ 12/* Lookup the address for a symbol. Returns 0 if not found. */
13unsigned long kallsyms_lookup_name(const char *name); 13unsigned long kallsyms_lookup_name(const char *name);
14 14
15extern int kallsyms_lookup_size_offset(unsigned long addr,
16 unsigned long *symbolsize,
17 unsigned long *offset);
18
15/* Lookup an address. modname is set to NULL if it's in the kernel. */ 19/* Lookup an address. modname is set to NULL if it's in the kernel. */
16const char *kallsyms_lookup(unsigned long addr, 20const char *kallsyms_lookup(unsigned long addr,
17 unsigned long *symbolsize, 21 unsigned long *symbolsize,
@@ -28,6 +32,13 @@ static inline unsigned long kallsyms_lookup_name(const char *name)
28 return 0; 32 return 0;
29} 33}
30 34
35static inline int kallsyms_lookup_size_offset(unsigned long addr,
36 unsigned long *symbolsize,
37 unsigned long *offset)
38{
39 return 0;
40}
41
31static inline const char *kallsyms_lookup(unsigned long addr, 42static inline const char *kallsyms_lookup(unsigned long addr,
32 unsigned long *symbolsize, 43 unsigned long *symbolsize,
33 unsigned long *offset, 44 unsigned long *offset,
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 4d00988dad..80f39cab47 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -216,8 +216,10 @@ extern void dump_stack(void);
216#define pr_debug(fmt,arg...) \ 216#define pr_debug(fmt,arg...) \
217 printk(KERN_DEBUG fmt,##arg) 217 printk(KERN_DEBUG fmt,##arg)
218#else 218#else
219#define pr_debug(fmt,arg...) \ 219static inline int __attribute__ ((format (printf, 1, 2))) pr_debug(const char * fmt, ...)
220 do { } while (0) 220{
221 return 0;
222}
221#endif 223#endif
222 224
223#define pr_info(fmt,arg...) \ 225#define pr_info(fmt,arg...) \
diff --git a/include/linux/kmod.h b/include/linux/kmod.h
index 0db22a1ab4..10f505c843 100644
--- a/include/linux/kmod.h
+++ b/include/linux/kmod.h
@@ -47,4 +47,8 @@ call_usermodehelper(char *path, char **argv, char **envp, int wait)
47 47
48extern void usermodehelper_init(void); 48extern void usermodehelper_init(void);
49 49
50struct file;
51extern int call_usermodehelper_pipe(char *path, char *argv[], char *envp[],
52 struct file **filp);
53
50#endif /* __LINUX_KMOD_H__ */ 54#endif /* __LINUX_KMOD_H__ */
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index 8bf6702da2..ac4c0559f7 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -77,6 +77,12 @@ struct kprobe {
77 /* location of the probe point */ 77 /* location of the probe point */
78 kprobe_opcode_t *addr; 78 kprobe_opcode_t *addr;
79 79
80 /* Allow user to indicate symbol name of the probe point */
81 char *symbol_name;
82
83 /* Offset into the symbol */
84 unsigned int offset;
85
80 /* Called before addr is executed. */ 86 /* Called before addr is executed. */
81 kprobe_pre_handler_t pre_handler; 87 kprobe_pre_handler_t pre_handler;
82 88
@@ -196,7 +202,7 @@ void unregister_kretprobe(struct kretprobe *rp);
196struct kretprobe_instance *get_free_rp_inst(struct kretprobe *rp); 202struct kretprobe_instance *get_free_rp_inst(struct kretprobe *rp);
197void add_rp_inst(struct kretprobe_instance *ri); 203void add_rp_inst(struct kretprobe_instance *ri);
198void kprobe_flush_task(struct task_struct *tk); 204void kprobe_flush_task(struct task_struct *tk);
199void recycle_rp_inst(struct kretprobe_instance *ri); 205void recycle_rp_inst(struct kretprobe_instance *ri, struct hlist_head *head);
200#else /* CONFIG_KPROBES */ 206#else /* CONFIG_KPROBES */
201 207
202#define __kprobes /**/ 208#define __kprobes /**/
diff --git a/include/linux/latency.h b/include/linux/latency.h
new file mode 100644
index 0000000000..c08b52bb55
--- /dev/null
+++ b/include/linux/latency.h
@@ -0,0 +1,25 @@
1/*
2 * latency.h: Explicit system-wide latency-expectation infrastructure
3 *
4 * (C) Copyright 2006 Intel Corporation
5 * Author: Arjan van de Ven <arjan@linux.intel.com>
6 *
7 */
8
9#ifndef _INCLUDE_GUARD_LATENCY_H_
10#define _INCLUDE_GUARD_LATENCY_H_
11
12#include <linux/notifier.h>
13
14void set_acceptable_latency(char *identifier, int usecs);
15void modify_acceptable_latency(char *identifier, int usecs);
16void remove_acceptable_latency(char *identifier);
17void synchronize_acceptable_latency(void);
18int system_latency_constraint(void);
19
20int register_latency_notifier(struct notifier_block * nb);
21int unregister_latency_notifier(struct notifier_block * nb);
22
23#define INFINITE_LATENCY 1000000
24
25#endif
diff --git a/include/linux/libps2.h b/include/linux/libps2.h
index 08a450a9db..f6f301e2b0 100644
--- a/include/linux/libps2.h
+++ b/include/linux/libps2.h
@@ -47,5 +47,6 @@ int ps2_schedule_command(struct ps2dev *ps2dev, unsigned char *param, int comman
47int ps2_handle_ack(struct ps2dev *ps2dev, unsigned char data); 47int ps2_handle_ack(struct ps2dev *ps2dev, unsigned char data);
48int ps2_handle_response(struct ps2dev *ps2dev, unsigned char data); 48int ps2_handle_response(struct ps2dev *ps2dev, unsigned char data);
49void ps2_cmd_aborted(struct ps2dev *ps2dev); 49void ps2_cmd_aborted(struct ps2dev *ps2dev);
50int ps2_is_keyboard_id(char id);
50 51
51#endif /* _LIBPS2_H */ 52#endif /* _LIBPS2_H */
diff --git a/include/linux/lockd/bind.h b/include/linux/lockd/bind.h
index b054debef2..81e3a185f9 100644
--- a/include/linux/lockd/bind.h
+++ b/include/linux/lockd/bind.h
@@ -30,7 +30,7 @@ extern struct nlmsvc_binding * nlmsvc_ops;
30 * Functions exported by the lockd module 30 * Functions exported by the lockd module
31 */ 31 */
32extern int nlmclnt_proc(struct inode *, int, struct file_lock *); 32extern int nlmclnt_proc(struct inode *, int, struct file_lock *);
33extern int lockd_up(void); 33extern int lockd_up(int proto);
34extern void lockd_down(void); 34extern void lockd_down(void);
35 35
36#endif /* LINUX_LOCKD_BIND_H */ 36#endif /* LINUX_LOCKD_BIND_H */
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index 0d92c468d5..2909619c02 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -37,17 +37,15 @@
37 * Lockd host handle (used both by the client and server personality). 37 * Lockd host handle (used both by the client and server personality).
38 */ 38 */
39struct nlm_host { 39struct nlm_host {
40 struct nlm_host * h_next; /* linked list (hash table) */ 40 struct hlist_node h_hash; /* doubly linked list */
41 struct sockaddr_in h_addr; /* peer address */ 41 struct sockaddr_in h_addr; /* peer address */
42 struct rpc_clnt * h_rpcclnt; /* RPC client to talk to peer */ 42 struct rpc_clnt * h_rpcclnt; /* RPC client to talk to peer */
43 char h_name[20]; /* remote hostname */ 43 char * h_name; /* remote hostname */
44 u32 h_version; /* interface version */ 44 u32 h_version; /* interface version */
45 unsigned short h_proto; /* transport proto */ 45 unsigned short h_proto; /* transport proto */
46 unsigned short h_reclaiming : 1, 46 unsigned short h_reclaiming : 1,
47 h_server : 1, /* server side, not client side */ 47 h_server : 1, /* server side, not client side */
48 h_inuse : 1, 48 h_inuse : 1;
49 h_killed : 1,
50 h_monitored : 1;
51 wait_queue_head_t h_gracewait; /* wait while reclaiming */ 49 wait_queue_head_t h_gracewait; /* wait while reclaiming */
52 struct rw_semaphore h_rwsem; /* Reboot recovery lock */ 50 struct rw_semaphore h_rwsem; /* Reboot recovery lock */
53 u32 h_state; /* pseudo-state counter */ 51 u32 h_state; /* pseudo-state counter */
@@ -61,6 +59,16 @@ struct nlm_host {
61 spinlock_t h_lock; 59 spinlock_t h_lock;
62 struct list_head h_granted; /* Locks in GRANTED state */ 60 struct list_head h_granted; /* Locks in GRANTED state */
63 struct list_head h_reclaim; /* Locks in RECLAIM state */ 61 struct list_head h_reclaim; /* Locks in RECLAIM state */
62 struct nsm_handle * h_nsmhandle; /* NSM status handle */
63};
64
65struct nsm_handle {
66 struct list_head sm_link;
67 atomic_t sm_count;
68 char * sm_name;
69 struct sockaddr_in sm_addr;
70 unsigned int sm_monitored : 1,
71 sm_sticky : 1; /* don't unmonitor */
64}; 72};
65 73
66/* 74/*
@@ -80,7 +88,7 @@ struct nlm_wait;
80/* 88/*
81 * Memory chunk for NLM client RPC request. 89 * Memory chunk for NLM client RPC request.
82 */ 90 */
83#define NLMCLNT_OHSIZE (sizeof(system_utsname.nodename)+10) 91#define NLMCLNT_OHSIZE (sizeof(utsname()->nodename)+10)
84struct nlm_rqst { 92struct nlm_rqst {
85 unsigned int a_flags; /* initial RPC task flags */ 93 unsigned int a_flags; /* initial RPC task flags */
86 struct nlm_host * a_host; /* host handle */ 94 struct nlm_host * a_host; /* host handle */
@@ -96,15 +104,14 @@ struct nlm_rqst {
96 * an NFS client. 104 * an NFS client.
97 */ 105 */
98struct nlm_file { 106struct nlm_file {
99 struct nlm_file * f_next; /* linked list */ 107 struct hlist_node f_list; /* linked list */
100 struct nfs_fh f_handle; /* NFS file handle */ 108 struct nfs_fh f_handle; /* NFS file handle */
101 struct file * f_file; /* VFS file pointer */ 109 struct file * f_file; /* VFS file pointer */
102 struct nlm_share * f_shares; /* DOS shares */ 110 struct nlm_share * f_shares; /* DOS shares */
103 struct nlm_block * f_blocks; /* blocked locks */ 111 struct list_head f_blocks; /* blocked locks */
104 unsigned int f_locks; /* guesstimate # of locks */ 112 unsigned int f_locks; /* guesstimate # of locks */
105 unsigned int f_count; /* reference count */ 113 unsigned int f_count; /* reference count */
106 struct semaphore f_sema; /* avoid concurrent access */ 114 struct mutex f_mutex; /* avoid concurrent access */
107 int f_hash; /* hash of f_handle */
108}; 115};
109 116
110/* 117/*
@@ -114,26 +121,18 @@ struct nlm_file {
114#define NLM_NEVER (~(unsigned long) 0) 121#define NLM_NEVER (~(unsigned long) 0)
115struct nlm_block { 122struct nlm_block {
116 struct kref b_count; /* Reference count */ 123 struct kref b_count; /* Reference count */
117 struct nlm_block * b_next; /* linked list (all blocks) */ 124 struct list_head b_list; /* linked list of all blocks */
118 struct nlm_block * b_fnext; /* linked list (per file) */ 125 struct list_head b_flist; /* linked list (per file) */
119 struct nlm_rqst * b_call; /* RPC args & callback info */ 126 struct nlm_rqst * b_call; /* RPC args & callback info */
120 struct svc_serv * b_daemon; /* NLM service */ 127 struct svc_serv * b_daemon; /* NLM service */
121 struct nlm_host * b_host; /* host handle for RPC clnt */ 128 struct nlm_host * b_host; /* host handle for RPC clnt */
122 unsigned long b_when; /* next re-xmit */ 129 unsigned long b_when; /* next re-xmit */
123 unsigned int b_id; /* block id */ 130 unsigned int b_id; /* block id */
124 unsigned char b_queued; /* re-queued */
125 unsigned char b_granted; /* VFS granted lock */ 131 unsigned char b_granted; /* VFS granted lock */
126 struct nlm_file * b_file; /* file in question */ 132 struct nlm_file * b_file; /* file in question */
127}; 133};
128 134
129/* 135/*
130 * Valid actions for nlmsvc_traverse_files
131 */
132#define NLM_ACT_CHECK 0 /* check for locks */
133#define NLM_ACT_MARK 1 /* mark & sweep */
134#define NLM_ACT_UNLOCK 2 /* release all locks */
135
136/*
137 * Global variables 136 * Global variables
138 */ 137 */
139extern struct rpc_program nlm_program; 138extern struct rpc_program nlm_program;
@@ -143,6 +142,7 @@ extern struct svc_procedure nlmsvc_procedures4[];
143#endif 142#endif
144extern int nlmsvc_grace_period; 143extern int nlmsvc_grace_period;
145extern unsigned long nlmsvc_timeout; 144extern unsigned long nlmsvc_timeout;
145extern int nsm_use_hostnames;
146 146
147/* 147/*
148 * Lockd client functions 148 * Lockd client functions
@@ -155,22 +155,31 @@ struct nlm_wait * nlmclnt_prepare_block(struct nlm_host *host, struct file_lock
155void nlmclnt_finish_block(struct nlm_wait *block); 155void nlmclnt_finish_block(struct nlm_wait *block);
156int nlmclnt_block(struct nlm_wait *block, struct nlm_rqst *req, long timeout); 156int nlmclnt_block(struct nlm_wait *block, struct nlm_rqst *req, long timeout);
157u32 nlmclnt_grant(const struct sockaddr_in *addr, const struct nlm_lock *); 157u32 nlmclnt_grant(const struct sockaddr_in *addr, const struct nlm_lock *);
158void nlmclnt_recovery(struct nlm_host *, u32); 158void nlmclnt_recovery(struct nlm_host *);
159int nlmclnt_reclaim(struct nlm_host *, struct file_lock *); 159int nlmclnt_reclaim(struct nlm_host *, struct file_lock *);
160void nlmclnt_next_cookie(struct nlm_cookie *);
160 161
161/* 162/*
162 * Host cache 163 * Host cache
163 */ 164 */
164struct nlm_host * nlmclnt_lookup_host(struct sockaddr_in *, int, int); 165struct nlm_host * nlmclnt_lookup_host(const struct sockaddr_in *, int, int, const char *, int);
165struct nlm_host * nlmsvc_lookup_host(struct svc_rqst *); 166struct nlm_host * nlmsvc_lookup_host(struct svc_rqst *, const char *, int);
166struct nlm_host * nlm_lookup_host(int server, struct sockaddr_in *, int, int); 167struct nlm_host * nlm_lookup_host(int server, const struct sockaddr_in *, int, int, const char *, int);
167struct rpc_clnt * nlm_bind_host(struct nlm_host *); 168struct rpc_clnt * nlm_bind_host(struct nlm_host *);
168void nlm_rebind_host(struct nlm_host *); 169void nlm_rebind_host(struct nlm_host *);
169struct nlm_host * nlm_get_host(struct nlm_host *); 170struct nlm_host * nlm_get_host(struct nlm_host *);
170void nlm_release_host(struct nlm_host *); 171void nlm_release_host(struct nlm_host *);
171void nlm_shutdown_hosts(void); 172void nlm_shutdown_hosts(void);
172extern struct nlm_host *nlm_find_client(void); 173extern void nlm_host_rebooted(const struct sockaddr_in *, const char *, int, u32);
174struct nsm_handle *nsm_find(const struct sockaddr_in *, const char *, int);
175void nsm_release(struct nsm_handle *);
176
173 177
178/*
179 * This is used in garbage collection and resource reclaim
180 * A return value != 0 means destroy the lock/block/share
181 */
182typedef int (*nlm_host_match_fn_t)(struct nlm_host *cur, struct nlm_host *ref);
174 183
175/* 184/*
176 * Server-side lock handling 185 * Server-side lock handling
@@ -183,8 +192,8 @@ u32 nlmsvc_testlock(struct nlm_file *, struct nlm_lock *,
183u32 nlmsvc_cancel_blocked(struct nlm_file *, struct nlm_lock *); 192u32 nlmsvc_cancel_blocked(struct nlm_file *, struct nlm_lock *);
184unsigned long nlmsvc_retry_blocked(void); 193unsigned long nlmsvc_retry_blocked(void);
185void nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *, 194void nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *,
186 int action); 195 nlm_host_match_fn_t match);
187void nlmsvc_grant_reply(struct svc_rqst *, struct nlm_cookie *, u32); 196void nlmsvc_grant_reply(struct nlm_cookie *, u32);
188 197
189/* 198/*
190 * File handling for the server personality 199 * File handling for the server personality
diff --git a/include/linux/lockd/share.h b/include/linux/lockd/share.h
index c75a424ebe..cd7816e74c 100644
--- a/include/linux/lockd/share.h
+++ b/include/linux/lockd/share.h
@@ -25,6 +25,7 @@ u32 nlmsvc_share_file(struct nlm_host *, struct nlm_file *,
25 struct nlm_args *); 25 struct nlm_args *);
26u32 nlmsvc_unshare_file(struct nlm_host *, struct nlm_file *, 26u32 nlmsvc_unshare_file(struct nlm_host *, struct nlm_file *,
27 struct nlm_args *); 27 struct nlm_args *);
28void nlmsvc_traverse_shares(struct nlm_host *, struct nlm_file *, int); 28void nlmsvc_traverse_shares(struct nlm_host *, struct nlm_file *,
29 nlm_host_match_fn_t);
29 30
30#endif /* LINUX_LOCKD_SHARE_H */ 31#endif /* LINUX_LOCKD_SHARE_H */
diff --git a/include/linux/lockd/sm_inter.h b/include/linux/lockd/sm_inter.h
index 1080bb6ae3..fc61d40964 100644
--- a/include/linux/lockd/sm_inter.h
+++ b/include/linux/lockd/sm_inter.h
@@ -28,7 +28,8 @@ struct nsm_args {
28 u32 prog; /* RPC callback info */ 28 u32 prog; /* RPC callback info */
29 u32 vers; 29 u32 vers;
30 u32 proc; 30 u32 proc;
31 u32 proto; /* protocol (udp/tcp) plus server/client flag */ 31
32 char * mon_name;
32}; 33};
33 34
34/* 35/*
@@ -41,6 +42,6 @@ struct nsm_res {
41 42
42int nsm_monitor(struct nlm_host *); 43int nsm_monitor(struct nlm_host *);
43int nsm_unmonitor(struct nlm_host *); 44int nsm_unmonitor(struct nlm_host *);
44extern u32 nsm_local_state; 45extern int nsm_local_state;
45 46
46#endif /* LINUX_LOCKD_SM_INTER_H */ 47#endif /* LINUX_LOCKD_SM_INTER_H */
diff --git a/include/linux/lockd/xdr4.h b/include/linux/lockd/xdr4.h
index cee36e7c05..3cc1ae2500 100644
--- a/include/linux/lockd/xdr4.h
+++ b/include/linux/lockd/xdr4.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/include/linux/lockd/xdr.h 2 * linux/include/linux/lockd/xdr4.h
3 * 3 *
4 * XDR types for the NLM protocol 4 * XDR types for the NLM protocol
5 * 5 *
diff --git a/include/linux/memory.h b/include/linux/memory.h
index 8f04143ca3..654ef55448 100644
--- a/include/linux/memory.h
+++ b/include/linux/memory.h
@@ -57,7 +57,7 @@ struct memory_block {
57struct notifier_block; 57struct notifier_block;
58struct mem_section; 58struct mem_section;
59 59
60#ifndef CONFIG_MEMORY_HOTPLUG 60#ifndef CONFIG_MEMORY_HOTPLUG_SPARSE
61static inline int memory_dev_init(void) 61static inline int memory_dev_init(void)
62{ 62{
63 return 0; 63 return 0;
@@ -78,7 +78,7 @@ extern int remove_memory_block(unsigned long, struct mem_section *, int);
78#define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT) 78#define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT)
79 79
80 80
81#endif /* CONFIG_MEMORY_HOTPLUG */ 81#endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */
82 82
83#define hotplug_memory_notifier(fn, pri) { \ 83#define hotplug_memory_notifier(fn, pri) { \
84 static struct notifier_block fn##_mem_nb = \ 84 static struct notifier_block fn##_mem_nb = \
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h
index 218501cfae..7b54666cea 100644
--- a/include/linux/memory_hotplug.h
+++ b/include/linux/memory_hotplug.h
@@ -172,5 +172,7 @@ static inline int __remove_pages(struct zone *zone, unsigned long start_pfn,
172extern int add_memory(int nid, 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); 173extern int arch_add_memory(int nid, u64 start, u64 size);
174extern int remove_memory(u64 start, u64 size); 174extern int remove_memory(u64 start, u64 size);
175extern int sparse_add_one_section(struct zone *zone, unsigned long start_pfn,
176 int nr_pages);
175 177
176#endif /* __LINUX_MEMORY_HOTPLUG_H */ 178#endif /* __LINUX_MEMORY_HOTPLUG_H */
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 4edf1934e5..b7966ab8cb 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -946,6 +946,8 @@ extern void mem_init(void);
946extern void show_mem(void); 946extern void show_mem(void);
947extern void si_meminfo(struct sysinfo * val); 947extern void si_meminfo(struct sysinfo * val);
948extern void si_meminfo_node(struct sysinfo *val, int nid); 948extern void si_meminfo_node(struct sysinfo *val, int nid);
949extern void zonetable_add(struct zone *zone, int nid, enum zone_type zid,
950 unsigned long pfn, unsigned long size);
949 951
950#ifdef CONFIG_NUMA 952#ifdef CONFIG_NUMA
951extern void setup_per_cpu_pageset(void); 953extern void setup_per_cpu_pageset(void);
diff --git a/include/linux/module.h b/include/linux/module.h
index 2c599175c5..4b2d8091a4 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -320,6 +320,8 @@ struct module
320 /* Am I GPL-compatible */ 320 /* Am I GPL-compatible */
321 int license_gplok; 321 int license_gplok;
322 322
323 unsigned int taints; /* same bits as kernel:tainted */
324
323#ifdef CONFIG_MODULE_UNLOAD 325#ifdef CONFIG_MODULE_UNLOAD
324 /* Reference counts */ 326 /* Reference counts */
325 struct module_ref ref[NR_CPUS]; 327 struct module_ref ref[NR_CPUS];
diff --git a/include/linux/msi.h b/include/linux/msi.h
new file mode 100644
index 0000000000..c7ef943436
--- /dev/null
+++ b/include/linux/msi.h
@@ -0,0 +1,49 @@
1#ifndef LINUX_MSI_H
2#define LINUX_MSI_H
3
4struct msi_msg {
5 u32 address_lo; /* low 32 bits of msi message address */
6 u32 address_hi; /* high 32 bits of msi message address */
7 u32 data; /* 16 bits of msi message data */
8};
9
10/* Heper functions */
11extern void mask_msi_irq(unsigned int irq);
12extern void unmask_msi_irq(unsigned int irq);
13extern void read_msi_msg(unsigned int irq, struct msi_msg *msg);
14
15extern void write_msi_msg(unsigned int irq, struct msi_msg *msg);
16
17struct msi_desc {
18 struct {
19 __u8 type : 5; /* {0: unused, 5h:MSI, 11h:MSI-X} */
20 __u8 maskbit : 1; /* mask-pending bit supported ? */
21 __u8 unused : 1;
22 __u8 is_64 : 1; /* Address size: 0=32bit 1=64bit */
23 __u8 pos; /* Location of the msi capability */
24 __u16 entry_nr; /* specific enabled entry */
25 unsigned default_irq; /* default pre-assigned irq */
26 }msi_attrib;
27
28 struct {
29 __u16 head;
30 __u16 tail;
31 }link;
32
33 void __iomem *mask_base;
34 struct pci_dev *dev;
35
36#ifdef CONFIG_PM
37 /* PM save area for MSIX address/data */
38 struct msi_msg msg_save;
39#endif
40};
41
42/*
43 * The arch hook for setup up msi irqs
44 */
45int arch_setup_msi_irq(unsigned int irq, struct pci_dev *dev);
46void arch_teardown_msi_irq(unsigned int irq);
47
48
49#endif /* LINUX_MSI_H */
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 0b4cd2fa64..70420bbae8 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -27,9 +27,17 @@
27struct mtd_info; 27struct mtd_info;
28/* Scan and identify a NAND device */ 28/* Scan and identify a NAND device */
29extern int nand_scan (struct mtd_info *mtd, int max_chips); 29extern int nand_scan (struct mtd_info *mtd, int max_chips);
30/* Separate phases of nand_scan(), allowing board driver to intervene
31 * and override command or ECC setup according to flash type */
32extern int nand_scan_ident(struct mtd_info *mtd, int max_chips);
33extern int nand_scan_tail(struct mtd_info *mtd);
34
30/* Free resources held by the NAND device */ 35/* Free resources held by the NAND device */
31extern void nand_release (struct mtd_info *mtd); 36extern void nand_release (struct mtd_info *mtd);
32 37
38/* Internal helper for board drivers which need to override command function */
39extern void nand_wait_ready(struct mtd_info *mtd);
40
33/* The maximum number of NAND chips in an array */ 41/* The maximum number of NAND chips in an array */
34#define NAND_MAX_CHIPS 8 42#define NAND_MAX_CHIPS 8
35 43
@@ -178,7 +186,9 @@ typedef enum {
178#define NAND_USE_FLASH_BBT 0x00010000 186#define NAND_USE_FLASH_BBT 0x00010000
179/* This option skips the bbt scan during initialization. */ 187/* This option skips the bbt scan during initialization. */
180#define NAND_SKIP_BBTSCAN 0x00020000 188#define NAND_SKIP_BBTSCAN 0x00020000
181 189/* This option is defined if the board driver allocates its own buffers
190 (e.g. because it needs them DMA-coherent */
191#define NAND_OWN_BUFFERS 0x00040000
182/* Options set by nand scan */ 192/* Options set by nand scan */
183/* Nand scan has allocated controller struct */ 193/* Nand scan has allocated controller struct */
184#define NAND_CONTROLLER_ALLOC 0x80000000 194#define NAND_CONTROLLER_ALLOC 0x80000000
@@ -228,6 +238,8 @@ struct nand_hw_control {
228 * be provided if an hardware ECC is available 238 * be provided if an hardware ECC is available
229 * @calculate: function for ecc calculation or readback from ecc hardware 239 * @calculate: function for ecc calculation or readback from ecc hardware
230 * @correct: function for ecc correction, matching to ecc generator (sw/hw) 240 * @correct: function for ecc correction, matching to ecc generator (sw/hw)
241 * @read_page_raw: function to read a raw page without ECC
242 * @write_page_raw: function to write a raw page without ECC
231 * @read_page: function to read a page according to the ecc generator requirements 243 * @read_page: function to read a page according to the ecc generator requirements
232 * @write_page: function to write a page according to the ecc generator requirements 244 * @write_page: function to write a page according to the ecc generator requirements
233 * @read_oob: function to read chip OOB data 245 * @read_oob: function to read chip OOB data
@@ -249,6 +261,12 @@ struct nand_ecc_ctrl {
249 int (*correct)(struct mtd_info *mtd, uint8_t *dat, 261 int (*correct)(struct mtd_info *mtd, uint8_t *dat,
250 uint8_t *read_ecc, 262 uint8_t *read_ecc,
251 uint8_t *calc_ecc); 263 uint8_t *calc_ecc);
264 int (*read_page_raw)(struct mtd_info *mtd,
265 struct nand_chip *chip,
266 uint8_t *buf);
267 void (*write_page_raw)(struct mtd_info *mtd,
268 struct nand_chip *chip,
269 const uint8_t *buf);
252 int (*read_page)(struct mtd_info *mtd, 270 int (*read_page)(struct mtd_info *mtd,
253 struct nand_chip *chip, 271 struct nand_chip *chip,
254 uint8_t *buf); 272 uint8_t *buf);
@@ -337,6 +355,7 @@ struct nand_buffers {
337 * @priv: [OPTIONAL] pointer to private chip date 355 * @priv: [OPTIONAL] pointer to private chip date
338 * @errstat: [OPTIONAL] hardware specific function to perform additional error status checks 356 * @errstat: [OPTIONAL] hardware specific function to perform additional error status checks
339 * (determine if errors are correctable) 357 * (determine if errors are correctable)
358 * @write_page [REPLACEABLE] High-level page write function
340 */ 359 */
341 360
342struct nand_chip { 361struct nand_chip {
@@ -359,6 +378,8 @@ struct nand_chip {
359 void (*erase_cmd)(struct mtd_info *mtd, int page); 378 void (*erase_cmd)(struct mtd_info *mtd, int page);
360 int (*scan_bbt)(struct mtd_info *mtd); 379 int (*scan_bbt)(struct mtd_info *mtd);
361 int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state, int status, int page); 380 int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state, int status, int page);
381 int (*write_page)(struct mtd_info *mtd, struct nand_chip *chip,
382 const uint8_t *buf, int page, int cached, int raw);
362 383
363 int chip_delay; 384 int chip_delay;
364 unsigned int options; 385 unsigned int options;
@@ -380,7 +401,7 @@ struct nand_chip {
380 struct nand_ecclayout *ecclayout; 401 struct nand_ecclayout *ecclayout;
381 402
382 struct nand_ecc_ctrl ecc; 403 struct nand_ecc_ctrl ecc;
383 struct nand_buffers buffers; 404 struct nand_buffers *buffers;
384 struct nand_hw_control hwcontrol; 405 struct nand_hw_control hwcontrol;
385 406
386 struct mtd_oob_ops ops; 407 struct mtd_oob_ops ops;
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h
index 1f49721552..6f045b586e 100644
--- a/include/linux/mtd/onenand.h
+++ b/include/linux/mtd/onenand.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * linux/include/linux/mtd/onenand.h 2 * linux/include/linux/mtd/onenand.h
3 * 3 *
4 * Copyright (C) 2005 Samsung Electronics 4 * Copyright (C) 2005-2006 Samsung Electronics
5 * Kyungmin Park <kyungmin.park@samsung.com> 5 * Kyungmin Park <kyungmin.park@samsung.com>
6 * 6 *
7 * 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
@@ -96,6 +96,7 @@ struct onenand_chip {
96 void __iomem *base; 96 void __iomem *base;
97 unsigned int chipsize; 97 unsigned int chipsize;
98 unsigned int device_id; 98 unsigned int device_id;
99 unsigned int version_id;
99 unsigned int density_mask; 100 unsigned int density_mask;
100 unsigned int options; 101 unsigned int options;
101 102
@@ -149,7 +150,8 @@ struct onenand_chip {
149/* 150/*
150 * Options bits 151 * Options bits
151 */ 152 */
152#define ONENAND_CONT_LOCK (0x0001) 153#define ONENAND_HAS_CONT_LOCK (0x0001)
154#define ONENAND_HAS_UNLOCK_ALL (0x0002)
153#define ONENAND_PAGEBUF_ALLOC (0x1000) 155#define ONENAND_PAGEBUF_ALLOC (0x1000)
154 156
155/* 157/*
diff --git a/include/linux/mtd/onenand_regs.h b/include/linux/mtd/onenand_regs.h
index 4a72818d25..9e409fe6de 100644
--- a/include/linux/mtd/onenand_regs.h
+++ b/include/linux/mtd/onenand_regs.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * OneNAND Register header file 4 * OneNAND Register header file
5 * 5 *
6 * Copyright (C) 2005 Samsung Electronics 6 * Copyright (C) 2005-2006 Samsung Electronics
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
@@ -72,6 +72,7 @@
72#define ONENAND_DEVICE_VCC_MASK (0x3) 72#define ONENAND_DEVICE_VCC_MASK (0x3)
73 73
74#define ONENAND_DEVICE_DENSITY_512Mb (0x002) 74#define ONENAND_DEVICE_DENSITY_512Mb (0x002)
75#define ONENAND_DEVICE_DENSITY_1Gb (0x003)
75 76
76/* 77/*
77 * Version ID Register F002h (R) 78 * Version ID Register F002h (R)
@@ -110,6 +111,7 @@
110#define ONENAND_CMD_UNLOCK (0x23) 111#define ONENAND_CMD_UNLOCK (0x23)
111#define ONENAND_CMD_LOCK (0x2A) 112#define ONENAND_CMD_LOCK (0x2A)
112#define ONENAND_CMD_LOCK_TIGHT (0x2C) 113#define ONENAND_CMD_LOCK_TIGHT (0x2C)
114#define ONENAND_CMD_UNLOCK_ALL (0x27)
113#define ONENAND_CMD_ERASE (0x94) 115#define ONENAND_CMD_ERASE (0x94)
114#define ONENAND_CMD_RESET (0xF0) 116#define ONENAND_CMD_RESET (0xF0)
115#define ONENAND_CMD_OTP_ACCESS (0x65) 117#define ONENAND_CMD_OTP_ACCESS (0x65)
diff --git a/include/linux/mtd/plat-ram.h b/include/linux/mtd/plat-ram.h
index 2332eda07e..9667863bd7 100644
--- a/include/linux/mtd/plat-ram.h
+++ b/include/linux/mtd/plat-ram.h
@@ -1,4 +1,4 @@
1/* linux/include/mtd/plat-ram.h 1/* linux/include/linux/mtd/plat-ram.h
2 * 2 *
3 * (c) 2004 Simtec Electronics 3 * (c) 2004 Simtec Electronics
4 * http://www.simtec.co.uk/products/SWLINUX/ 4 * http://www.simtec.co.uk/products/SWLINUX/
diff --git a/include/linux/namei.h b/include/linux/namei.h
index c6470ba006..f5f19606ef 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -1,6 +1,7 @@
1#ifndef _LINUX_NAMEI_H 1#ifndef _LINUX_NAMEI_H
2#define _LINUX_NAMEI_H 2#define _LINUX_NAMEI_H
3 3
4#include <linux/dcache.h>
4#include <linux/linkage.h> 5#include <linux/linkage.h>
5 6
6struct vfsmount; 7struct vfsmount;
diff --git a/include/linux/namespace.h b/include/linux/namespace.h
index 3abc8e3b48..d137009f0b 100644
--- a/include/linux/namespace.h
+++ b/include/linux/namespace.h
@@ -4,6 +4,7 @@
4 4
5#include <linux/mount.h> 5#include <linux/mount.h>
6#include <linux/sched.h> 6#include <linux/sched.h>
7#include <linux/nsproxy.h>
7 8
8struct namespace { 9struct namespace {
9 atomic_t count; 10 atomic_t count;
@@ -26,11 +27,8 @@ static inline void put_namespace(struct namespace *namespace)
26 27
27static inline void exit_namespace(struct task_struct *p) 28static inline void exit_namespace(struct task_struct *p)
28{ 29{
29 struct namespace *namespace = p->namespace; 30 struct namespace *namespace = p->nsproxy->namespace;
30 if (namespace) { 31 if (namespace) {
31 task_lock(p);
32 p->namespace = NULL;
33 task_unlock(p);
34 put_namespace(namespace); 32 put_namespace(namespace);
35 } 33 }
36} 34}
diff --git a/include/linux/ncp_fs.h b/include/linux/ncp_fs.h
index 02e352be71..0ea7f89e61 100644
--- a/include/linux/ncp_fs.h
+++ b/include/linux/ncp_fs.h
@@ -212,6 +212,7 @@ void ncp_date_unix2dos(int unix_date, __le16 * time, __le16 * date);
212 212
213/* linux/fs/ncpfs/ioctl.c */ 213/* linux/fs/ncpfs/ioctl.c */
214int ncp_ioctl(struct inode *, struct file *, unsigned int, unsigned long); 214int ncp_ioctl(struct inode *, struct file *, unsigned int, unsigned long);
215long ncp_compat_ioctl(struct file *, unsigned int, unsigned long);
215 216
216/* linux/fs/ncpfs/sock.c */ 217/* linux/fs/ncpfs/sock.c */
217int ncp_request2(struct ncp_server *server, int function, 218int ncp_request2(struct ncp_server *server, int function,
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 98c9b9f667..76ff54846a 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -367,10 +367,12 @@ extern int nfs3_removexattr (struct dentry *, const char *name);
367 */ 367 */
368extern ssize_t nfs_direct_IO(int, struct kiocb *, const struct iovec *, loff_t, 368extern ssize_t nfs_direct_IO(int, struct kiocb *, const struct iovec *, loff_t,
369 unsigned long); 369 unsigned long);
370extern ssize_t nfs_file_direct_read(struct kiocb *iocb, char __user *buf, 370extern ssize_t nfs_file_direct_read(struct kiocb *iocb,
371 size_t count, loff_t pos); 371 const struct iovec *iov, unsigned long nr_segs,
372extern ssize_t nfs_file_direct_write(struct kiocb *iocb, const char __user *buf, 372 loff_t pos);
373 size_t count, loff_t pos); 373extern ssize_t nfs_file_direct_write(struct kiocb *iocb,
374 const struct iovec *iov, unsigned long nr_segs,
375 loff_t pos);
374 376
375/* 377/*
376 * linux/fs/nfs/dir.c 378 * linux/fs/nfs/dir.c
diff --git a/include/linux/nfsd/const.h b/include/linux/nfsd/const.h
index b75bb1b38d..f0cc777905 100644
--- a/include/linux/nfsd/const.h
+++ b/include/linux/nfsd/const.h
@@ -20,17 +20,31 @@
20#define NFSSVC_MAXVERS 3 20#define NFSSVC_MAXVERS 3
21 21
22/* 22/*
23 * Maximum blocksize supported by daemon currently at 32K 23 * Maximum blocksizes supported by daemon under various circumstances.
24 */ 24 */
25#define NFSSVC_MAXBLKSIZE (32*1024) 25#define NFSSVC_MAXBLKSIZE RPCSVC_MAXPAYLOAD
26/* NFSv2 is limited by the protocol specification, see RFC 1094 */
27#define NFSSVC_MAXBLKSIZE_V2 (8*1024)
26 28
27#ifdef __KERNEL__ 29#ifdef __KERNEL__
28 30
31#include <linux/sunrpc/msg_prot.h>
32
29#ifndef NFS_SUPER_MAGIC 33#ifndef NFS_SUPER_MAGIC
30# define NFS_SUPER_MAGIC 0x6969 34# define NFS_SUPER_MAGIC 0x6969
31#endif 35#endif
32 36
33#define NFSD_BUFSIZE (1024 + NFSSVC_MAXBLKSIZE) 37/*
38 * Largest number of bytes we need to allocate for an NFS
39 * call or reply. Used to control buffer sizes. We use
40 * the length of v3 WRITE, READDIR and READDIR replies
41 * which are an RPC header, up to 26 XDR units of reply
42 * data, and some page data.
43 *
44 * Note that accuracy here doesn't matter too much as the
45 * size is rounded up to a page size when allocating space.
46 */
47#define NFSD_BUFSIZE ((RPC_MAX_HEADER_WITH_AUTH+26)*XDR_UNIT + NFSSVC_MAXBLKSIZE)
34 48
35#ifdef CONFIG_NFSD_V4 49#ifdef CONFIG_NFSD_V4
36# define NFSSVC_XDRSIZE NFS4_SVC_XDRSIZE 50# define NFSSVC_XDRSIZE NFS4_SVC_XDRSIZE
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h
index d2a8abb501..6e78ea969f 100644
--- a/include/linux/nfsd/export.h
+++ b/include/linux/nfsd/export.h
@@ -45,15 +45,36 @@
45 45
46#ifdef __KERNEL__ 46#ifdef __KERNEL__
47 47
48/*
49 * FS Locations
50 */
51
52#define MAX_FS_LOCATIONS 128
53
54struct nfsd4_fs_location {
55 char *hosts; /* colon separated list of hosts */
56 char *path; /* slash separated list of path components */
57};
58
59struct nfsd4_fs_locations {
60 uint32_t locations_count;
61 struct nfsd4_fs_location *locations;
62/* If we're not actually serving this data ourselves (only providing a
63 * list of replicas that do serve it) then we set "migrated": */
64 int migrated;
65};
66
48struct svc_export { 67struct svc_export {
49 struct cache_head h; 68 struct cache_head h;
50 struct auth_domain * ex_client; 69 struct auth_domain * ex_client;
51 int ex_flags; 70 int ex_flags;
52 struct vfsmount * ex_mnt; 71 struct vfsmount * ex_mnt;
53 struct dentry * ex_dentry; 72 struct dentry * ex_dentry;
73 char * ex_path;
54 uid_t ex_anon_uid; 74 uid_t ex_anon_uid;
55 gid_t ex_anon_gid; 75 gid_t ex_anon_gid;
56 int ex_fsid; 76 int ex_fsid;
77 struct nfsd4_fs_locations ex_fslocs;
57}; 78};
58 79
59/* an "export key" (expkey) maps a filehandlefragement to an 80/* an "export key" (expkey) maps a filehandlefragement to an
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h
index 2dcad295fe..d0d4aae708 100644
--- a/include/linux/nfsd/nfsd.h
+++ b/include/linux/nfsd/nfsd.h
@@ -140,6 +140,12 @@ struct posix_acl *nfsd_get_posix_acl(struct svc_fh *, int);
140int nfsd_set_posix_acl(struct svc_fh *, int, struct posix_acl *); 140int nfsd_set_posix_acl(struct svc_fh *, int, struct posix_acl *);
141#endif 141#endif
142 142
143enum vers_op {NFSD_SET, NFSD_CLEAR, NFSD_TEST, NFSD_AVAIL };
144int nfsd_vers(int vers, enum vers_op change);
145void nfsd_reset_versions(void);
146int nfsd_create_serv(void);
147
148extern int nfsd_max_blksize;
143 149
144/* 150/*
145 * NFSv4 State 151 * NFSv4 State
@@ -210,6 +216,7 @@ void nfsd_lockd_shutdown(void);
210#define nfserr_clid_inuse __constant_htonl(NFSERR_CLID_INUSE) 216#define nfserr_clid_inuse __constant_htonl(NFSERR_CLID_INUSE)
211#define nfserr_stale_clientid __constant_htonl(NFSERR_STALE_CLIENTID) 217#define nfserr_stale_clientid __constant_htonl(NFSERR_STALE_CLIENTID)
212#define nfserr_resource __constant_htonl(NFSERR_RESOURCE) 218#define nfserr_resource __constant_htonl(NFSERR_RESOURCE)
219#define nfserr_moved __constant_htonl(NFSERR_MOVED)
213#define nfserr_nofilehandle __constant_htonl(NFSERR_NOFILEHANDLE) 220#define nfserr_nofilehandle __constant_htonl(NFSERR_NOFILEHANDLE)
214#define nfserr_minor_vers_mismatch __constant_htonl(NFSERR_MINOR_VERS_MISMATCH) 221#define nfserr_minor_vers_mismatch __constant_htonl(NFSERR_MINOR_VERS_MISMATCH)
215#define nfserr_share_denied __constant_htonl(NFSERR_SHARE_DENIED) 222#define nfserr_share_denied __constant_htonl(NFSERR_SHARE_DENIED)
@@ -286,7 +293,6 @@ static inline int is_fsid(struct svc_fh *fh, struct knfsd_fh *reffh)
286/* 293/*
287 * The following attributes are currently not supported by the NFSv4 server: 294 * The following attributes are currently not supported by the NFSv4 server:
288 * ARCHIVE (deprecated anyway) 295 * ARCHIVE (deprecated anyway)
289 * FS_LOCATIONS (will be supported eventually)
290 * HIDDEN (unlikely to be supported any time soon) 296 * HIDDEN (unlikely to be supported any time soon)
291 * MIMETYPE (unlikely to be supported any time soon) 297 * MIMETYPE (unlikely to be supported any time soon)
292 * QUOTA_* (will be supported in a forthcoming patch) 298 * QUOTA_* (will be supported in a forthcoming patch)
@@ -302,7 +308,7 @@ static inline int is_fsid(struct svc_fh *fh, struct knfsd_fh *reffh)
302 | FATTR4_WORD0_ACLSUPPORT | FATTR4_WORD0_CANSETTIME | FATTR4_WORD0_CASE_INSENSITIVE \ 308 | FATTR4_WORD0_ACLSUPPORT | FATTR4_WORD0_CANSETTIME | FATTR4_WORD0_CASE_INSENSITIVE \
303 | FATTR4_WORD0_CASE_PRESERVING | FATTR4_WORD0_CHOWN_RESTRICTED \ 309 | FATTR4_WORD0_CASE_PRESERVING | FATTR4_WORD0_CHOWN_RESTRICTED \
304 | FATTR4_WORD0_FILEHANDLE | FATTR4_WORD0_FILEID | FATTR4_WORD0_FILES_AVAIL \ 310 | FATTR4_WORD0_FILEHANDLE | FATTR4_WORD0_FILEID | FATTR4_WORD0_FILES_AVAIL \
305 | FATTR4_WORD0_FILES_FREE | FATTR4_WORD0_FILES_TOTAL | FATTR4_WORD0_HOMOGENEOUS \ 311 | FATTR4_WORD0_FILES_FREE | FATTR4_WORD0_FILES_TOTAL | FATTR4_WORD0_FS_LOCATIONS | FATTR4_WORD0_HOMOGENEOUS \
306 | FATTR4_WORD0_MAXFILESIZE | FATTR4_WORD0_MAXLINK | FATTR4_WORD0_MAXNAME \ 312 | FATTR4_WORD0_MAXFILESIZE | FATTR4_WORD0_MAXLINK | FATTR4_WORD0_MAXNAME \
307 | FATTR4_WORD0_MAXREAD | FATTR4_WORD0_MAXWRITE | FATTR4_WORD0_ACL) 313 | FATTR4_WORD0_MAXREAD | FATTR4_WORD0_MAXWRITE | FATTR4_WORD0_ACL)
308 314
diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h
index 31a3cb617c..069257ea99 100644
--- a/include/linux/nfsd/nfsfh.h
+++ b/include/linux/nfsd/nfsfh.h
@@ -290,8 +290,9 @@ fill_post_wcc(struct svc_fh *fhp)
290 * vfs.c:nfsd_rename as it needs to grab 2 i_mutex's at once 290 * vfs.c:nfsd_rename as it needs to grab 2 i_mutex's at once
291 * so, any changes here should be reflected there. 291 * so, any changes here should be reflected there.
292 */ 292 */
293
293static inline void 294static inline void
294fh_lock(struct svc_fh *fhp) 295fh_lock_nested(struct svc_fh *fhp, unsigned int subclass)
295{ 296{
296 struct dentry *dentry = fhp->fh_dentry; 297 struct dentry *dentry = fhp->fh_dentry;
297 struct inode *inode; 298 struct inode *inode;
@@ -310,11 +311,17 @@ fh_lock(struct svc_fh *fhp)
310 } 311 }
311 312
312 inode = dentry->d_inode; 313 inode = dentry->d_inode;
313 mutex_lock(&inode->i_mutex); 314 mutex_lock_nested(&inode->i_mutex, subclass);
314 fill_pre_wcc(fhp); 315 fill_pre_wcc(fhp);
315 fhp->fh_locked = 1; 316 fhp->fh_locked = 1;
316} 317}
317 318
319static inline void
320fh_lock(struct svc_fh *fhp)
321{
322 fh_lock_nested(fhp, I_MUTEX_NORMAL);
323}
324
318/* 325/*
319 * Unlock a file handle/inode 326 * Unlock a file handle/inode
320 */ 327 */
diff --git a/include/linux/nfsd/stats.h b/include/linux/nfsd/stats.h
index 28a82fdd92..7678cfbe99 100644
--- a/include/linux/nfsd/stats.h
+++ b/include/linux/nfsd/stats.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/include/nfsd/stats.h 2 * linux/include/linux/nfsd/stats.h
3 * 3 *
4 * Statistics for NFS server. 4 * Statistics for NFS server.
5 * 5 *
diff --git a/include/linux/nfsd/syscall.h b/include/linux/nfsd/syscall.h
index dae0faea28..8bcddccb6c 100644
--- a/include/linux/nfsd/syscall.h
+++ b/include/linux/nfsd/syscall.h
@@ -38,21 +38,6 @@
38#define NFSCTL_GETFD 7 /* get an fh by path (used by mountd) */ 38#define NFSCTL_GETFD 7 /* get an fh by path (used by mountd) */
39#define NFSCTL_GETFS 8 /* get an fh by path with max FH len */ 39#define NFSCTL_GETFS 8 /* get an fh by path with max FH len */
40 40
41/*
42 * Macros used to set version
43 */
44#define NFSCTL_VERSET(_cltbits, _v) ((_cltbits) |= (1 << (_v)))
45#define NFSCTL_VERUNSET(_cltbits, _v) ((_cltbits) &= ~(1 << (_v)))
46#define NFSCTL_VERISSET(_cltbits, _v) ((_cltbits) & (1 << (_v)))
47
48#if defined(CONFIG_NFSD_V4)
49#define NFSCTL_VERALL (0x1c /* 0b011100 */)
50#elif defined(CONFIG_NFSD_V3)
51#define NFSCTL_VERALL (0x0c /* 0b001100 */)
52#else
53#define NFSCTL_VERALL (0x04 /* 0b000100 */)
54#endif
55
56/* SVC */ 41/* SVC */
57struct nfsctl_svc { 42struct nfsctl_svc {
58 unsigned short svc_port; 43 unsigned short svc_port;
@@ -134,8 +119,6 @@ extern int exp_delclient(struct nfsctl_client *ncp);
134extern int exp_export(struct nfsctl_export *nxp); 119extern int exp_export(struct nfsctl_export *nxp);
135extern int exp_unexport(struct nfsctl_export *nxp); 120extern int exp_unexport(struct nfsctl_export *nxp);
136 121
137extern unsigned int nfsd_versbits;
138
139#endif /* __KERNEL__ */ 122#endif /* __KERNEL__ */
140 123
141#endif /* NFSD_SYSCALL_H */ 124#endif /* NFSD_SYSCALL_H */
diff --git a/include/linux/nfsd/xdr.h b/include/linux/nfsd/xdr.h
index 3f4f7142bb..0e53de87d8 100644
--- a/include/linux/nfsd/xdr.h
+++ b/include/linux/nfsd/xdr.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/inxlude/linux/nfsd/xdr.h 2 * linux/include/linux/nfsd/xdr.h
3 * 3 *
4 * XDR types for nfsd. This is mainly a typing exercise. 4 * XDR types for nfsd. This is mainly a typing exercise.
5 */ 5 */
@@ -30,7 +30,6 @@ struct nfsd_readargs {
30 struct svc_fh fh; 30 struct svc_fh fh;
31 __u32 offset; 31 __u32 offset;
32 __u32 count; 32 __u32 count;
33 struct kvec vec[RPCSVC_MAXPAGES];
34 int vlen; 33 int vlen;
35}; 34};
36 35
@@ -38,7 +37,6 @@ struct nfsd_writeargs {
38 svc_fh fh; 37 svc_fh fh;
39 __u32 offset; 38 __u32 offset;
40 int len; 39 int len;
41 struct kvec vec[RPCSVC_MAXPAGES];
42 int vlen; 40 int vlen;
43}; 41};
44 42
diff --git a/include/linux/nfsd/xdr3.h b/include/linux/nfsd/xdr3.h
index a4322741f8..474d882dc2 100644
--- a/include/linux/nfsd/xdr3.h
+++ b/include/linux/nfsd/xdr3.h
@@ -33,7 +33,6 @@ struct nfsd3_readargs {
33 struct svc_fh fh; 33 struct svc_fh fh;
34 __u64 offset; 34 __u64 offset;
35 __u32 count; 35 __u32 count;
36 struct kvec vec[RPCSVC_MAXPAGES];
37 int vlen; 36 int vlen;
38}; 37};
39 38
@@ -43,7 +42,6 @@ struct nfsd3_writeargs {
43 __u32 count; 42 __u32 count;
44 int stable; 43 int stable;
45 __u32 len; 44 __u32 len;
46 struct kvec vec[RPCSVC_MAXPAGES];
47 int vlen; 45 int vlen;
48}; 46};
49 47
diff --git a/include/linux/nfsd/xdr4.h b/include/linux/nfsd/xdr4.h
index 77adba7d22..66e642762a 100644
--- a/include/linux/nfsd/xdr4.h
+++ b/include/linux/nfsd/xdr4.h
@@ -241,7 +241,6 @@ struct nfsd4_read {
241 stateid_t rd_stateid; /* request */ 241 stateid_t rd_stateid; /* request */
242 u64 rd_offset; /* request */ 242 u64 rd_offset; /* request */
243 u32 rd_length; /* request */ 243 u32 rd_length; /* request */
244 struct kvec rd_iov[RPCSVC_MAXPAGES];
245 int rd_vlen; 244 int rd_vlen;
246 struct file *rd_filp; 245 struct file *rd_filp;
247 246
@@ -326,7 +325,6 @@ struct nfsd4_write {
326 u64 wr_offset; /* request */ 325 u64 wr_offset; /* request */
327 u32 wr_stable_how; /* request */ 326 u32 wr_stable_how; /* request */
328 u32 wr_buflen; /* request */ 327 u32 wr_buflen; /* request */
329 struct kvec wr_vec[RPCSVC_MAXPAGES]; /* request */
330 int wr_vlen; 328 int wr_vlen;
331 329
332 u32 wr_bytes_written; /* response */ 330 u32 wr_bytes_written; /* response */
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h
index 1a9ef3e627..5dce5c2182 100644
--- a/include/linux/nodemask.h
+++ b/include/linux/nodemask.h
@@ -352,6 +352,7 @@ extern nodemask_t node_possible_map;
352#define node_possible(node) node_isset((node), node_possible_map) 352#define node_possible(node) node_isset((node), node_possible_map)
353#define first_online_node first_node(node_online_map) 353#define first_online_node first_node(node_online_map)
354#define next_online_node(nid) next_node((nid), node_online_map) 354#define next_online_node(nid) next_node((nid), node_online_map)
355int highest_possible_node_id(void);
355#else 356#else
356#define num_online_nodes() 1 357#define num_online_nodes() 1
357#define num_possible_nodes() 1 358#define num_possible_nodes() 1
@@ -359,6 +360,7 @@ extern nodemask_t node_possible_map;
359#define node_possible(node) ((node) == 0) 360#define node_possible(node) ((node) == 0)
360#define first_online_node 0 361#define first_online_node 0
361#define next_online_node(nid) (MAX_NUMNODES) 362#define next_online_node(nid) (MAX_NUMNODES)
363#define highest_possible_node_id() 0
362#endif 364#endif
363 365
364#define any_online_node(mask) \ 366#define any_online_node(mask) \
diff --git a/include/linux/notifier.h b/include/linux/notifier.h
index 7ff386a6ae..10a43ed052 100644
--- a/include/linux/notifier.h
+++ b/include/linux/notifier.h
@@ -12,9 +12,10 @@
12#include <linux/errno.h> 12#include <linux/errno.h>
13#include <linux/mutex.h> 13#include <linux/mutex.h>
14#include <linux/rwsem.h> 14#include <linux/rwsem.h>
15#include <linux/srcu.h>
15 16
16/* 17/*
17 * Notifier chains are of three types: 18 * Notifier chains are of four types:
18 * 19 *
19 * Atomic notifier chains: Chain callbacks run in interrupt/atomic 20 * Atomic notifier chains: Chain callbacks run in interrupt/atomic
20 * context. Callouts are not allowed to block. 21 * context. Callouts are not allowed to block.
@@ -23,13 +24,27 @@
23 * Raw notifier chains: There are no restrictions on callbacks, 24 * Raw notifier chains: There are no restrictions on callbacks,
24 * registration, or unregistration. All locking and protection 25 * registration, or unregistration. All locking and protection
25 * must be provided by the caller. 26 * must be provided by the caller.
27 * SRCU notifier chains: A variant of blocking notifier chains, with
28 * the same restrictions.
26 * 29 *
27 * atomic_notifier_chain_register() may be called from an atomic context, 30 * atomic_notifier_chain_register() may be called from an atomic context,
28 * but blocking_notifier_chain_register() must be called from a process 31 * but blocking_notifier_chain_register() and srcu_notifier_chain_register()
29 * context. Ditto for the corresponding _unregister() routines. 32 * must be called from a process context. Ditto for the corresponding
33 * _unregister() routines.
30 * 34 *
31 * atomic_notifier_chain_unregister() and blocking_notifier_chain_unregister() 35 * atomic_notifier_chain_unregister(), blocking_notifier_chain_unregister(),
32 * _must not_ be called from within the call chain. 36 * and srcu_notifier_chain_unregister() _must not_ be called from within
37 * the call chain.
38 *
39 * SRCU notifier chains are an alternative form of blocking notifier chains.
40 * They use SRCU (Sleepable Read-Copy Update) instead of rw-semaphores for
41 * protection of the chain links. This means there is _very_ low overhead
42 * in srcu_notifier_call_chain(): no cache bounces and no memory barriers.
43 * As compensation, srcu_notifier_chain_unregister() is rather expensive.
44 * SRCU notifier chains should be used when the chain will be called very
45 * often but notifier_blocks will seldom be removed. Also, SRCU notifier
46 * chains are slightly more difficult to use because they require special
47 * runtime initialization.
33 */ 48 */
34 49
35struct notifier_block { 50struct notifier_block {
@@ -52,6 +67,12 @@ struct raw_notifier_head {
52 struct notifier_block *head; 67 struct notifier_block *head;
53}; 68};
54 69
70struct srcu_notifier_head {
71 struct mutex mutex;
72 struct srcu_struct srcu;
73 struct notifier_block *head;
74};
75
55#define ATOMIC_INIT_NOTIFIER_HEAD(name) do { \ 76#define ATOMIC_INIT_NOTIFIER_HEAD(name) do { \
56 spin_lock_init(&(name)->lock); \ 77 spin_lock_init(&(name)->lock); \
57 (name)->head = NULL; \ 78 (name)->head = NULL; \
@@ -64,6 +85,11 @@ struct raw_notifier_head {
64 (name)->head = NULL; \ 85 (name)->head = NULL; \
65 } while (0) 86 } while (0)
66 87
88/* srcu_notifier_heads must be initialized and cleaned up dynamically */
89extern void srcu_init_notifier_head(struct srcu_notifier_head *nh);
90#define srcu_cleanup_notifier_head(name) \
91 cleanup_srcu_struct(&(name)->srcu);
92
67#define ATOMIC_NOTIFIER_INIT(name) { \ 93#define ATOMIC_NOTIFIER_INIT(name) { \
68 .lock = __SPIN_LOCK_UNLOCKED(name.lock), \ 94 .lock = __SPIN_LOCK_UNLOCKED(name.lock), \
69 .head = NULL } 95 .head = NULL }
@@ -72,6 +98,7 @@ struct raw_notifier_head {
72 .head = NULL } 98 .head = NULL }
73#define RAW_NOTIFIER_INIT(name) { \ 99#define RAW_NOTIFIER_INIT(name) { \
74 .head = NULL } 100 .head = NULL }
101/* srcu_notifier_heads cannot be initialized statically */
75 102
76#define ATOMIC_NOTIFIER_HEAD(name) \ 103#define ATOMIC_NOTIFIER_HEAD(name) \
77 struct atomic_notifier_head name = \ 104 struct atomic_notifier_head name = \
@@ -91,6 +118,8 @@ extern int blocking_notifier_chain_register(struct blocking_notifier_head *,
91 struct notifier_block *); 118 struct notifier_block *);
92extern int raw_notifier_chain_register(struct raw_notifier_head *, 119extern int raw_notifier_chain_register(struct raw_notifier_head *,
93 struct notifier_block *); 120 struct notifier_block *);
121extern int srcu_notifier_chain_register(struct srcu_notifier_head *,
122 struct notifier_block *);
94 123
95extern int atomic_notifier_chain_unregister(struct atomic_notifier_head *, 124extern int atomic_notifier_chain_unregister(struct atomic_notifier_head *,
96 struct notifier_block *); 125 struct notifier_block *);
@@ -98,6 +127,8 @@ extern int blocking_notifier_chain_unregister(struct blocking_notifier_head *,
98 struct notifier_block *); 127 struct notifier_block *);
99extern int raw_notifier_chain_unregister(struct raw_notifier_head *, 128extern int raw_notifier_chain_unregister(struct raw_notifier_head *,
100 struct notifier_block *); 129 struct notifier_block *);
130extern int srcu_notifier_chain_unregister(struct srcu_notifier_head *,
131 struct notifier_block *);
101 132
102extern int atomic_notifier_call_chain(struct atomic_notifier_head *, 133extern int atomic_notifier_call_chain(struct atomic_notifier_head *,
103 unsigned long val, void *v); 134 unsigned long val, void *v);
@@ -105,6 +136,8 @@ extern int blocking_notifier_call_chain(struct blocking_notifier_head *,
105 unsigned long val, void *v); 136 unsigned long val, void *v);
106extern int raw_notifier_call_chain(struct raw_notifier_head *, 137extern int raw_notifier_call_chain(struct raw_notifier_head *,
107 unsigned long val, void *v); 138 unsigned long val, void *v);
139extern int srcu_notifier_call_chain(struct srcu_notifier_head *,
140 unsigned long val, void *v);
108 141
109#define NOTIFY_DONE 0x0000 /* Don't care */ 142#define NOTIFY_DONE 0x0000 /* Don't care */
110#define NOTIFY_OK 0x0001 /* Suits me */ 143#define NOTIFY_OK 0x0001 /* Suits me */
diff --git a/include/linux/nsproxy.h b/include/linux/nsproxy.h
new file mode 100644
index 0000000000..f6baecdeec
--- /dev/null
+++ b/include/linux/nsproxy.h
@@ -0,0 +1,52 @@
1#ifndef _LINUX_NSPROXY_H
2#define _LINUX_NSPROXY_H
3
4#include <linux/spinlock.h>
5#include <linux/sched.h>
6
7struct namespace;
8struct uts_namespace;
9struct ipc_namespace;
10
11/*
12 * A structure to contain pointers to all per-process
13 * namespaces - fs (mount), uts, network, sysvipc, etc.
14 *
15 * 'count' is the number of tasks holding a reference.
16 * The count for each namespace, then, will be the number
17 * of nsproxies pointing to it, not the number of tasks.
18 *
19 * The nsproxy is shared by tasks which share all namespaces.
20 * As soon as a single namespace is cloned or unshared, the
21 * nsproxy is copied.
22 */
23struct nsproxy {
24 atomic_t count;
25 spinlock_t nslock;
26 struct uts_namespace *uts_ns;
27 struct ipc_namespace *ipc_ns;
28 struct namespace *namespace;
29};
30extern struct nsproxy init_nsproxy;
31
32struct nsproxy *dup_namespaces(struct nsproxy *orig);
33int copy_namespaces(int flags, struct task_struct *tsk);
34void get_task_namespaces(struct task_struct *tsk);
35void free_nsproxy(struct nsproxy *ns);
36
37static inline void put_nsproxy(struct nsproxy *ns)
38{
39 if (atomic_dec_and_test(&ns->count)) {
40 free_nsproxy(ns);
41 }
42}
43
44static inline void exit_task_namespaces(struct task_struct *p)
45{
46 struct nsproxy *ns = p->nsproxy;
47 if (ns) {
48 put_nsproxy(ns);
49 p->nsproxy = NULL;
50 }
51}
52#endif
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 5c3a4176eb..5c604f5fad 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -595,6 +595,7 @@ struct msix_entry {
595 u16 entry; /* driver uses to specify entry, OS writes */ 595 u16 entry; /* driver uses to specify entry, OS writes */
596}; 596};
597 597
598
598#ifndef CONFIG_PCI_MSI 599#ifndef CONFIG_PCI_MSI
599static inline void pci_scan_msi_device(struct pci_dev *dev) {} 600static inline void pci_scan_msi_device(struct pci_dev *dev) {}
600static inline int pci_enable_msi(struct pci_dev *dev) {return -1;} 601static inline int pci_enable_msi(struct pci_dev *dev) {return -1;}
@@ -613,6 +614,12 @@ extern void pci_disable_msix(struct pci_dev *dev);
613extern void msi_remove_pci_irq_vectors(struct pci_dev *dev); 614extern void msi_remove_pci_irq_vectors(struct pci_dev *dev);
614#endif 615#endif
615 616
617#ifdef CONFIG_HT_IRQ
618/* The functions a driver should call */
619int ht_create_irq(struct pci_dev *dev, int idx);
620void ht_destroy_irq(unsigned int irq);
621#endif /* CONFIG_HT_IRQ */
622
616extern void pci_block_user_cfg_access(struct pci_dev *dev); 623extern void pci_block_user_cfg_access(struct pci_dev *dev);
617extern void pci_unblock_user_cfg_access(struct pci_dev *dev); 624extern void pci_unblock_user_cfg_access(struct pci_dev *dev);
618 625
@@ -787,12 +794,13 @@ enum pci_fixup_pass {
787void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev); 794void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev);
788 795
789extern int pci_pci_problems; 796extern int pci_pci_problems;
790#define PCIPCI_FAIL 1 797#define PCIPCI_FAIL 1 /* No PCI PCI DMA */
791#define PCIPCI_TRITON 2 798#define PCIPCI_TRITON 2
792#define PCIPCI_NATOMA 4 799#define PCIPCI_NATOMA 4
793#define PCIPCI_VIAETBF 8 800#define PCIPCI_VIAETBF 8
794#define PCIPCI_VSFX 16 801#define PCIPCI_VSFX 16
795#define PCIPCI_ALIMAGIK 32 802#define PCIPCI_ALIMAGIK 32 /* Need low latency setting */
803#define PCIAGP_FAIL 64 /* No PCI to AGP DMA */
796 804
797#endif /* __KERNEL__ */ 805#endif /* __KERNEL__ */
798#endif /* LINUX_PCI_H */ 806#endif /* LINUX_PCI_H */
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index c9ffbc3843..f069df2454 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1615,8 +1615,6 @@
1615#define PCI_VENDOR_ID_ROCKWELL 0x127A 1615#define PCI_VENDOR_ID_ROCKWELL 0x127A
1616 1616
1617#define PCI_VENDOR_ID_ITE 0x1283 1617#define PCI_VENDOR_ID_ITE 0x1283
1618#define PCI_DEVICE_ID_ITE_IT8172G 0x8172
1619#define PCI_DEVICE_ID_ITE_IT8172G_AUDIO 0x0801
1620#define PCI_DEVICE_ID_ITE_8211 0x8211 1618#define PCI_DEVICE_ID_ITE_8211 0x8211
1621#define PCI_DEVICE_ID_ITE_8212 0x8212 1619#define PCI_DEVICE_ID_ITE_8212 0x8212
1622#define PCI_DEVICE_ID_ITE_8872 0x8872 1620#define PCI_DEVICE_ID_ITE_8872 0x8872
@@ -1883,6 +1881,8 @@
1883#define PCI_DEVICE_ID_PANACOM_QUADMODEM 0x0400 1881#define PCI_DEVICE_ID_PANACOM_QUADMODEM 0x0400
1884#define PCI_DEVICE_ID_PANACOM_DUALMODEM 0x0402 1882#define PCI_DEVICE_ID_PANACOM_DUALMODEM 0x0402
1885 1883
1884#define PCI_VENDOR_ID_SIPACKETS 0x14d9
1885#define PCI_DEVICE_ID_SP1011 0x0010
1886 1886
1887#define PCI_VENDOR_ID_AFAVLAB 0x14db 1887#define PCI_VENDOR_ID_AFAVLAB 0x14db
1888#define PCI_DEVICE_ID_AFAVLAB_P028 0x2180 1888#define PCI_DEVICE_ID_AFAVLAB_P028 0x2180
@@ -1997,6 +1997,7 @@
1997#define PCI_DEVICE_ID_FARSITE_TE1C 0x1612 1997#define PCI_DEVICE_ID_FARSITE_TE1C 0x1612
1998 1998
1999#define PCI_VENDOR_ID_SIBYTE 0x166d 1999#define PCI_VENDOR_ID_SIBYTE 0x166d
2000#define PCI_DEVICE_ID_BCM1250_PCI 0x0001
2000#define PCI_DEVICE_ID_BCM1250_HT 0x0002 2001#define PCI_DEVICE_ID_BCM1250_HT 0x0002
2001 2002
2002#define PCI_VENDOR_ID_NETCELL 0x169c 2003#define PCI_VENDOR_ID_NETCELL 0x169c
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h
index 7d0e26cba4..c312a12ad2 100644
--- a/include/linux/pci_regs.h
+++ b/include/linux/pci_regs.h
@@ -12,6 +12,11 @@
12 * PCI Local Bus Specification 12 * PCI Local Bus Specification
13 * PCI to PCI Bridge Specification 13 * PCI to PCI Bridge Specification
14 * PCI System Design Guide 14 * PCI System Design Guide
15 *
16 * For hypertransport information, please consult the following manuals
17 * from http://www.hypertransport.org
18 *
19 * The Hypertransport I/O Link Specification
15 */ 20 */
16 21
17#ifndef LINUX_PCI_REGS_H 22#ifndef LINUX_PCI_REGS_H
@@ -463,4 +468,20 @@
463#define PCI_PWR_CAP 12 /* Capability */ 468#define PCI_PWR_CAP 12 /* Capability */
464#define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */ 469#define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */
465 470
471/* Hypertransport sub capability types */
472#define HT_CAPTYPE_SLAVE 0x00 /* Slave/Primary link configuration */
473#define HT_CAPTYPE_HOST 0x20 /* Host/Secondary link configuration */
474#define HT_CAPTYPE_IRQ 0x80 /* IRQ Configuration */
475#define HT_CAPTYPE_REMAPPING_40 0xA0 /* 40 bit address remapping */
476#define HT_CAPTYPE_REMAPPING_64 0xA2 /* 64 bit address remapping */
477#define HT_CAPTYPE_UNITID_CLUMP 0x90 /* Unit ID clumping */
478#define HT_CAPTYPE_EXTCONF 0x98 /* Extended Configuration Space Access */
479#define HT_CAPTYPE_MSI_MAPPING 0xA8 /* MSI Mapping Capability */
480#define HT_CAPTYPE_DIRECT_ROUTE 0xB0 /* Direct routing configuration */
481#define HT_CAPTYPE_VCSET 0xB8 /* Virtual Channel configuration */
482#define HT_CAPTYPE_ERROR_RETRY 0xC0 /* Retry on error configuration */
483#define HT_CAPTYPE_GEN3 0xD0 /* Generation 3 hypertransport configuration */
484#define HT_CAPTYPE_PM 0xE0 /* Hypertransport powermanagement configuration */
485
486
466#endif /* LINUX_PCI_REGS_H */ 487#endif /* LINUX_PCI_REGS_H */
diff --git a/include/linux/pid.h b/include/linux/pid.h
index 93da7e2d9f..2c0007d172 100644
--- a/include/linux/pid.h
+++ b/include/linux/pid.h
@@ -68,6 +68,8 @@ extern struct task_struct *FASTCALL(pid_task(struct pid *pid, enum pid_type));
68extern struct task_struct *FASTCALL(get_pid_task(struct pid *pid, 68extern struct task_struct *FASTCALL(get_pid_task(struct pid *pid,
69 enum pid_type)); 69 enum pid_type));
70 70
71extern struct pid *get_task_pid(struct task_struct *task, enum pid_type type);
72
71/* 73/*
72 * attach_pid() and detach_pid() must be called with the tasklist_lock 74 * attach_pid() and detach_pid() must be called with the tasklist_lock
73 * write-held. 75 * write-held.
@@ -89,33 +91,42 @@ extern struct pid *FASTCALL(find_pid(int nr));
89 * Lookup a PID in the hash table, and return with it's count elevated. 91 * Lookup a PID in the hash table, and return with it's count elevated.
90 */ 92 */
91extern struct pid *find_get_pid(int nr); 93extern struct pid *find_get_pid(int nr);
94extern struct pid *find_ge_pid(int nr);
92 95
93extern struct pid *alloc_pid(void); 96extern struct pid *alloc_pid(void);
94extern void FASTCALL(free_pid(struct pid *pid)); 97extern void FASTCALL(free_pid(struct pid *pid));
95 98
96#define pid_next(task, type) \ 99static inline pid_t pid_nr(struct pid *pid)
97 ((task)->pids[(type)].node.next) 100{
98 101 pid_t nr = 0;
99#define pid_next_task(task, type) \ 102 if (pid)
100 hlist_entry(pid_next(task, type), struct task_struct, \ 103 nr = pid->nr;
101 pids[(type)].node) 104 return nr;
105}
102 106
103 107
104/* We could use hlist_for_each_entry_rcu here but it takes more arguments
105 * than the do_each_task_pid/while_each_task_pid. So we roll our own
106 * to preserve the existing interface.
107 */
108#define do_each_task_pid(who, type, task) \ 108#define do_each_task_pid(who, type, task) \
109 if ((task = find_task_by_pid_type(type, who))) { \ 109 do { \
110 prefetch(pid_next(task, type)); \ 110 struct hlist_node *pos___; \
111 do { 111 struct pid *pid___ = find_pid(who); \
112 if (pid___ != NULL) \
113 hlist_for_each_entry_rcu((task), pos___, \
114 &pid___->tasks[type], pids[type].node) {
112 115
113#define while_each_task_pid(who, type, task) \ 116#define while_each_task_pid(who, type, task) \
114 } while (pid_next(task, type) && ({ \ 117 } \
115 task = pid_next_task(task, type); \ 118 } while (0)
116 rcu_dereference(task); \ 119
117 prefetch(pid_next(task, type)); \ 120
118 1; }) ); \ 121#define do_each_pid_task(pid, type, task) \
119 } 122 do { \
123 struct hlist_node *pos___; \
124 if (pid != NULL) \
125 hlist_for_each_entry_rcu((task), pos___, \
126 &pid->tasks[type], pids[type].node) {
127
128#define while_each_pid_task(pid, type, task) \
129 } \
130 } while (0)
120 131
121#endif /* _LINUX_PID_H */ 132#endif /* _LINUX_PID_H */
diff --git a/include/linux/ppdev.h b/include/linux/ppdev.h
index f376a7598a..dc18c5d23e 100644
--- a/include/linux/ppdev.h
+++ b/include/linux/ppdev.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/drivers/char/ppdev.h 2 * linux/include/linux/ppdev.h
3 * 3 *
4 * User-space parallel port device driver (header file). 4 * User-space parallel port device driver (header file).
5 * 5 *
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index 57f70bc8b2..87dec8fe6d 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -244,13 +244,15 @@ static inline void kclist_add(struct kcore_list *new, void *addr, size_t size)
244extern void kclist_add(struct kcore_list *, void *, size_t); 244extern void kclist_add(struct kcore_list *, void *, size_t);
245#endif 245#endif
246 246
247union proc_op {
248 int (*proc_get_link)(struct inode *, struct dentry **, struct vfsmount **);
249 int (*proc_read)(struct task_struct *task, char *page);
250};
251
247struct proc_inode { 252struct proc_inode {
248 struct pid *pid; 253 struct pid *pid;
249 int fd; 254 int fd;
250 union { 255 union proc_op op;
251 int (*proc_get_link)(struct inode *, struct dentry **, struct vfsmount **);
252 int (*proc_read)(struct task_struct *task, char *page);
253 } op;
254 struct proc_dir_entry *pde; 256 struct proc_dir_entry *pde;
255 struct inode vfs_inode; 257 struct inode vfs_inode;
256}; 258};
diff --git a/include/linux/pspace.h b/include/linux/pspace.h
new file mode 100644
index 0000000000..91d48b8b2d
--- /dev/null
+++ b/include/linux/pspace.h
@@ -0,0 +1,23 @@
1#ifndef _LINUX_PSPACE_H
2#define _LINUX_PSPACE_H
3
4#include <linux/sched.h>
5#include <linux/mm.h>
6#include <linux/threads.h>
7#include <linux/pid.h>
8
9struct pidmap {
10 atomic_t nr_free;
11 void *page;
12};
13
14#define PIDMAP_ENTRIES ((PID_MAX_LIMIT + 8*PAGE_SIZE - 1)/PAGE_SIZE/8)
15
16struct pspace {
17 struct pidmap pidmap[PIDMAP_ENTRIES];
18 int last_pid;
19};
20
21extern struct pspace init_pspace;
22
23#endif /* _LINUX_PSPACE_H */
diff --git a/include/linux/raid/bitmap.h b/include/linux/raid/bitmap.h
index 63df898fe2..84d8877518 100644
--- a/include/linux/raid/bitmap.h
+++ b/include/linux/raid/bitmap.h
@@ -265,6 +265,8 @@ int bitmap_update_sb(struct bitmap *bitmap);
265int bitmap_setallbits(struct bitmap *bitmap); 265int bitmap_setallbits(struct bitmap *bitmap);
266void bitmap_write_all(struct bitmap *bitmap); 266void bitmap_write_all(struct bitmap *bitmap);
267 267
268void bitmap_dirty_bits(struct bitmap *bitmap, unsigned long s, unsigned long e);
269
268/* these are exported */ 270/* these are exported */
269int bitmap_startwrite(struct bitmap *bitmap, sector_t offset, 271int bitmap_startwrite(struct bitmap *bitmap, sector_t offset,
270 unsigned long sectors, int behind); 272 unsigned long sectors, int behind);
diff --git a/include/linux/raid/md.h b/include/linux/raid/md.h
index c588709acb..866a1e2b0c 100644
--- a/include/linux/raid/md.h
+++ b/include/linux/raid/md.h
@@ -95,7 +95,6 @@ extern int sync_page_io(struct block_device *bdev, sector_t sector, int size,
95extern void md_do_sync(mddev_t *mddev); 95extern void md_do_sync(mddev_t *mddev);
96extern void md_new_event(mddev_t *mddev); 96extern void md_new_event(mddev_t *mddev);
97 97
98extern void md_update_sb(mddev_t * mddev);
99 98
100#endif /* CONFIG_MD */ 99#endif /* CONFIG_MD */
101#endif 100#endif
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h
index 920b94fe31..8245c28216 100644
--- a/include/linux/raid/md_k.h
+++ b/include/linux/raid/md_k.h
@@ -31,18 +31,15 @@
31#define LEVEL_NONE (-1000000) 31#define LEVEL_NONE (-1000000)
32 32
33#define MaxSector (~(sector_t)0) 33#define MaxSector (~(sector_t)0)
34#define MD_THREAD_NAME_MAX 14
35 34
36typedef struct mddev_s mddev_t; 35typedef struct mddev_s mddev_t;
37typedef struct mdk_rdev_s mdk_rdev_t; 36typedef struct mdk_rdev_s mdk_rdev_t;
38 37
39#define MAX_MD_DEVS 256 /* Max number of md dev */
40
41/* 38/*
42 * options passed in raidrun: 39 * options passed in raidrun:
43 */ 40 */
44 41
45/* Currently this must fix in an 'int' */ 42/* Currently this must fit in an 'int' */
46#define MAX_CHUNK_SIZE (1<<30) 43#define MAX_CHUNK_SIZE (1<<30)
47 44
48/* 45/*
@@ -116,7 +113,11 @@ struct mddev_s
116 dev_t unit; 113 dev_t unit;
117 int md_minor; 114 int md_minor;
118 struct list_head disks; 115 struct list_head disks;
119 int sb_dirty; 116 unsigned long flags;
117#define MD_CHANGE_DEVS 0 /* Some device status has changed */
118#define MD_CHANGE_CLEAN 1 /* transition to or from 'clean' */
119#define MD_CHANGE_PENDING 2 /* superblock update in progress */
120
120 int ro; 121 int ro;
121 122
122 struct gendisk *gendisk; 123 struct gendisk *gendisk;
diff --git a/include/linux/raid/md_u.h b/include/linux/raid/md_u.h
index 81da20ccec..7192035fc4 100644
--- a/include/linux/raid/md_u.h
+++ b/include/linux/raid/md_u.h
@@ -41,7 +41,7 @@
41 41
42/* usage */ 42/* usage */
43#define RUN_ARRAY _IOW (MD_MAJOR, 0x30, mdu_param_t) 43#define RUN_ARRAY _IOW (MD_MAJOR, 0x30, mdu_param_t)
44#define START_ARRAY _IO (MD_MAJOR, 0x31) 44/* 0x31 was START_ARRAY */
45#define STOP_ARRAY _IO (MD_MAJOR, 0x32) 45#define STOP_ARRAY _IO (MD_MAJOR, 0x32)
46#define STOP_ARRAY_RO _IO (MD_MAJOR, 0x33) 46#define STOP_ARRAY_RO _IO (MD_MAJOR, 0x33)
47#define RESTART_ARRAY_RW _IO (MD_MAJOR, 0x34) 47#define RESTART_ARRAY_RW _IO (MD_MAJOR, 0x34)
diff --git a/include/linux/raid/raid1.h b/include/linux/raid/raid1.h
index 3009c813d8..0a9ba7c330 100644
--- a/include/linux/raid/raid1.h
+++ b/include/linux/raid/raid1.h
@@ -30,7 +30,6 @@ struct r1_private_data_s {
30 mddev_t *mddev; 30 mddev_t *mddev;
31 mirror_info_t *mirrors; 31 mirror_info_t *mirrors;
32 int raid_disks; 32 int raid_disks;
33 int working_disks;
34 int last_used; 33 int last_used;
35 sector_t next_seq_sect; 34 sector_t next_seq_sect;
36 spinlock_t device_lock; 35 spinlock_t device_lock;
diff --git a/include/linux/raid/raid10.h b/include/linux/raid/raid10.h
index c41e56a7c0..e9091cfeb2 100644
--- a/include/linux/raid/raid10.h
+++ b/include/linux/raid/raid10.h
@@ -16,7 +16,6 @@ struct r10_private_data_s {
16 mddev_t *mddev; 16 mddev_t *mddev;
17 mirror_info_t *mirrors; 17 mirror_info_t *mirrors;
18 int raid_disks; 18 int raid_disks;
19 int working_disks;
20 spinlock_t device_lock; 19 spinlock_t device_lock;
21 20
22 /* geometry */ 21 /* geometry */
diff --git a/include/linux/raid/raid5.h b/include/linux/raid/raid5.h
index 20ed4c9976..f13299a155 100644
--- a/include/linux/raid/raid5.h
+++ b/include/linux/raid/raid5.h
@@ -195,8 +195,9 @@ struct stripe_head {
195 * it to the count of prereading stripes. 195 * it to the count of prereading stripes.
196 * When write is initiated, or the stripe refcnt == 0 (just in case) we 196 * When write is initiated, or the stripe refcnt == 0 (just in case) we
197 * clear the PREREAD_ACTIVE flag and decrement the count 197 * clear the PREREAD_ACTIVE flag and decrement the count
198 * Whenever the delayed queue is empty and the device is not plugged, we 198 * Whenever the 'handle' queue is empty and the device is not plugged, we
199 * move any strips from delayed to handle and clear the DELAYED flag and set PREREAD_ACTIVE. 199 * move any strips from delayed to handle and clear the DELAYED flag and set
200 * PREREAD_ACTIVE.
200 * In stripe_handle, if we find pre-reading is necessary, we do it if 201 * In stripe_handle, if we find pre-reading is necessary, we do it if
201 * PREREAD_ACTIVE is set, else we set DELAYED which will send it to the delayed queue. 202 * PREREAD_ACTIVE is set, else we set DELAYED which will send it to the delayed queue.
202 * HANDLE gets cleared if stripe_handle leave nothing locked. 203 * HANDLE gets cleared if stripe_handle leave nothing locked.
@@ -213,7 +214,7 @@ struct raid5_private_data {
213 struct disk_info *spare; 214 struct disk_info *spare;
214 int chunk_size, level, algorithm; 215 int chunk_size, level, algorithm;
215 int max_degraded; 216 int max_degraded;
216 int raid_disks, working_disks, failed_disks; 217 int raid_disks;
217 int max_nr_stripes; 218 int max_nr_stripes;
218 219
219 /* used during an expand */ 220 /* used during an expand */
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index b4ca73d658..c6b7485eac 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -19,7 +19,7 @@
19 * 19 *
20 * Author: Dipankar Sarma <dipankar@in.ibm.com> 20 * Author: Dipankar Sarma <dipankar@in.ibm.com>
21 * 21 *
22 * Based on the original work by Paul McKenney <paul.mckenney@us.ibm.com> 22 * Based on the original work by Paul McKenney <paulmck@us.ibm.com>
23 * and inputs from Rusty Russell, Andrea Arcangeli and Andi Kleen. 23 * and inputs from Rusty Russell, Andrea Arcangeli and Andi Kleen.
24 * Papers: 24 * Papers:
25 * http://www.rdrop.com/users/paulmck/paper/rclockpdcsproof.pdf 25 * http://www.rdrop.com/users/paulmck/paper/rclockpdcsproof.pdf
@@ -66,6 +66,8 @@ struct rcu_ctrlblk {
66 long completed; /* Number of the last completed batch */ 66 long completed; /* Number of the last completed batch */
67 int next_pending; /* Is the next batch already waiting? */ 67 int next_pending; /* Is the next batch already waiting? */
68 68
69 int signaled;
70
69 spinlock_t lock ____cacheline_internodealigned_in_smp; 71 spinlock_t lock ____cacheline_internodealigned_in_smp;
70 cpumask_t cpumask; /* CPUs that need to switch in order */ 72 cpumask_t cpumask; /* CPUs that need to switch in order */
71 /* for current batch to proceed. */ 73 /* for current batch to proceed. */
@@ -106,9 +108,6 @@ struct rcu_data {
106 long blimit; /* Upper limit on a processed batch */ 108 long blimit; /* Upper limit on a processed batch */
107 int cpu; 109 int cpu;
108 struct rcu_head barrier; 110 struct rcu_head barrier;
109#ifdef CONFIG_SMP
110 long last_rs_qlen; /* qlen during the last resched */
111#endif
112}; 111};
113 112
114DECLARE_PER_CPU(struct rcu_data, rcu_data); 113DECLARE_PER_CPU(struct rcu_data, rcu_data);
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index 9c63abffd7..7bc6bfb862 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -2073,6 +2073,10 @@ void reiserfs_init_alloc_options(struct super_block *s);
2073 */ 2073 */
2074__le32 reiserfs_choose_packing(struct inode *dir); 2074__le32 reiserfs_choose_packing(struct inode *dir);
2075 2075
2076int reiserfs_init_bitmap_cache(struct super_block *sb);
2077void reiserfs_free_bitmap_cache(struct super_block *sb);
2078void reiserfs_cache_bitmap_metadata(struct super_block *sb, struct buffer_head *bh, struct reiserfs_bitmap_info *info);
2079struct buffer_head *reiserfs_read_bitmap_block(struct super_block *sb, unsigned int bitmap);
2076int is_reusable(struct super_block *s, b_blocknr_t block, int bit_value); 2080int is_reusable(struct super_block *s, b_blocknr_t block, int bit_value);
2077void reiserfs_free_block(struct reiserfs_transaction_handle *th, struct inode *, 2081void reiserfs_free_block(struct reiserfs_transaction_handle *th, struct inode *,
2078 b_blocknr_t, int for_unformatted); 2082 b_blocknr_t, int for_unformatted);
diff --git a/include/linux/reiserfs_fs_sb.h b/include/linux/reiserfs_fs_sb.h
index 31b4c0bd4f..73e0becec0 100644
--- a/include/linux/reiserfs_fs_sb.h
+++ b/include/linux/reiserfs_fs_sb.h
@@ -267,7 +267,6 @@ struct reiserfs_bitmap_info {
267 // FIXME: Won't work with block sizes > 8K 267 // FIXME: Won't work with block sizes > 8K
268 __u16 first_zero_hint; 268 __u16 first_zero_hint;
269 __u16 free_count; 269 __u16 free_count;
270 struct buffer_head *bh; /* the actual bitmap */
271}; 270};
272 271
273struct proc_dir_entry; 272struct proc_dir_entry;
@@ -414,6 +413,7 @@ struct reiserfs_sb_info {
414/* Definitions of reiserfs on-disk properties: */ 413/* Definitions of reiserfs on-disk properties: */
415#define REISERFS_3_5 0 414#define REISERFS_3_5 0
416#define REISERFS_3_6 1 415#define REISERFS_3_6 1
416#define REISERFS_OLD_FORMAT 2
417 417
418enum reiserfs_mount_options { 418enum reiserfs_mount_options {
419/* Mount options */ 419/* Mount options */
diff --git a/include/linux/rtc.h b/include/linux/rtc.h
index 5371e4e745..b89f093570 100644
--- a/include/linux/rtc.h
+++ b/include/linux/rtc.h
@@ -141,7 +141,7 @@ struct rtc_device
141 int id; 141 int id;
142 char name[RTC_DEVICE_NAME_SIZE]; 142 char name[RTC_DEVICE_NAME_SIZE];
143 143
144 struct rtc_class_ops *ops; 144 const struct rtc_class_ops *ops;
145 struct mutex ops_lock; 145 struct mutex ops_lock;
146 146
147 struct class_device *rtc_dev; 147 struct class_device *rtc_dev;
@@ -172,7 +172,7 @@ struct rtc_device
172 172
173extern struct rtc_device *rtc_device_register(const char *name, 173extern struct rtc_device *rtc_device_register(const char *name,
174 struct device *dev, 174 struct device *dev,
175 struct rtc_class_ops *ops, 175 const struct rtc_class_ops *ops,
176 struct module *owner); 176 struct module *owner);
177extern void rtc_device_unregister(struct rtc_device *rdev); 177extern void rtc_device_unregister(struct rtc_device *rdev);
178extern int rtc_interface_register(struct class_interface *intf); 178extern int rtc_interface_register(struct class_interface *intf);
diff --git a/include/linux/sched.h b/include/linux/sched.h
index fc4a9873ec..331f4502e9 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -24,6 +24,8 @@
24#define CLONE_UNTRACED 0x00800000 /* set if the tracing process can't force CLONE_PTRACE on this clone */ 24#define CLONE_UNTRACED 0x00800000 /* set if the tracing process can't force CLONE_PTRACE on this clone */
25#define CLONE_CHILD_SETTID 0x01000000 /* set the TID in the child */ 25#define CLONE_CHILD_SETTID 0x01000000 /* set the TID in the child */
26#define CLONE_STOPPED 0x02000000 /* Start in stopped state */ 26#define CLONE_STOPPED 0x02000000 /* Start in stopped state */
27#define CLONE_NEWUTS 0x04000000 /* New utsname group? */
28#define CLONE_NEWIPC 0x08000000 /* New ipcs */
27 29
28/* 30/*
29 * Scheduling policies 31 * Scheduling policies
@@ -118,7 +120,6 @@ extern unsigned long avenrun[]; /* Load averages */
118 120
119extern unsigned long total_forks; 121extern unsigned long total_forks;
120extern int nr_threads; 122extern int nr_threads;
121extern int last_pid;
122DECLARE_PER_CPU(unsigned long, process_counts); 123DECLARE_PER_CPU(unsigned long, process_counts);
123extern int nr_processes(void); 124extern int nr_processes(void);
124extern unsigned long nr_running(void); 125extern unsigned long nr_running(void);
@@ -239,7 +240,7 @@ extern signed long schedule_timeout_interruptible(signed long timeout);
239extern signed long schedule_timeout_uninterruptible(signed long timeout); 240extern signed long schedule_timeout_uninterruptible(signed long timeout);
240asmlinkage void schedule(void); 241asmlinkage void schedule(void);
241 242
242struct namespace; 243struct nsproxy;
243 244
244/* Maximum number of active map areas.. This is a random (large) number */ 245/* Maximum number of active map areas.. This is a random (large) number */
245#define DEFAULT_MAX_MAP_COUNT 65536 246#define DEFAULT_MAX_MAP_COUNT 65536
@@ -624,9 +625,17 @@ enum idle_type
624#define SD_WAKE_BALANCE 64 /* Perform balancing at task wakeup */ 625#define SD_WAKE_BALANCE 64 /* Perform balancing at task wakeup */
625#define SD_SHARE_CPUPOWER 128 /* Domain members share cpu power */ 626#define SD_SHARE_CPUPOWER 128 /* Domain members share cpu power */
626#define SD_POWERSAVINGS_BALANCE 256 /* Balance for power savings */ 627#define SD_POWERSAVINGS_BALANCE 256 /* Balance for power savings */
628#define SD_SHARE_PKG_RESOURCES 512 /* Domain members share cpu pkg resources */
627 629
628#define BALANCE_FOR_POWER ((sched_mc_power_savings || sched_smt_power_savings) \ 630#define BALANCE_FOR_MC_POWER \
629 ? SD_POWERSAVINGS_BALANCE : 0) 631 (sched_smt_power_savings ? SD_POWERSAVINGS_BALANCE : 0)
632
633#define BALANCE_FOR_PKG_POWER \
634 ((sched_mc_power_savings || sched_smt_power_savings) ? \
635 SD_POWERSAVINGS_BALANCE : 0)
636
637#define test_sd_parent(sd, flag) ((sd->parent && \
638 (sd->parent->flags & flag)) ? 1 : 0)
630 639
631 640
632struct sched_group { 641struct sched_group {
@@ -643,6 +652,7 @@ struct sched_group {
643struct sched_domain { 652struct sched_domain {
644 /* These fields must be setup */ 653 /* These fields must be setup */
645 struct sched_domain *parent; /* top domain must be null terminated */ 654 struct sched_domain *parent; /* top domain must be null terminated */
655 struct sched_domain *child; /* bottom domain must be null terminated */
646 struct sched_group *groups; /* the balancing groups of the domain */ 656 struct sched_group *groups; /* the balancing groups of the domain */
647 cpumask_t span; /* span of all CPUs in this domain */ 657 cpumask_t span; /* span of all CPUs in this domain */
648 unsigned long min_interval; /* Minimum balance interval ms */ 658 unsigned long min_interval; /* Minimum balance interval ms */
@@ -754,6 +764,7 @@ static inline void prefetch_stack(struct task_struct *t) { }
754struct audit_context; /* See audit.c */ 764struct audit_context; /* See audit.c */
755struct mempolicy; 765struct mempolicy;
756struct pipe_inode_info; 766struct pipe_inode_info;
767struct uts_namespace;
757 768
758enum sleep_type { 769enum sleep_type {
759 SLEEP_NORMAL, 770 SLEEP_NORMAL,
@@ -897,8 +908,8 @@ struct task_struct {
897 struct fs_struct *fs; 908 struct fs_struct *fs;
898/* open file information */ 909/* open file information */
899 struct files_struct *files; 910 struct files_struct *files;
900/* namespace */ 911/* namespaces */
901 struct namespace *namespace; 912 struct nsproxy *nsproxy;
902/* signal handlers */ 913/* signal handlers */
903 struct signal_struct *signal; 914 struct signal_struct *signal;
904 struct sighand_struct *sighand; 915 struct sighand_struct *sighand;
@@ -981,10 +992,10 @@ struct task_struct {
981 wait_queue_t *io_wait; 992 wait_queue_t *io_wait;
982/* i/o counters(bytes read/written, #syscalls */ 993/* i/o counters(bytes read/written, #syscalls */
983 u64 rchar, wchar, syscr, syscw; 994 u64 rchar, wchar, syscr, syscw;
984#if defined(CONFIG_BSD_PROCESS_ACCT) 995#if defined(CONFIG_TASK_XACCT)
985 u64 acct_rss_mem1; /* accumulated rss usage */ 996 u64 acct_rss_mem1; /* accumulated rss usage */
986 u64 acct_vm_mem1; /* accumulated virtual memory usage */ 997 u64 acct_vm_mem1; /* accumulated virtual memory usage */
987 clock_t acct_stimexpd; /* clock_t-converted stime since last update */ 998 cputime_t acct_stimexpd;/* stime since last update */
988#endif 999#endif
989#ifdef CONFIG_NUMA 1000#ifdef CONFIG_NUMA
990 struct mempolicy *mempolicy; 1001 struct mempolicy *mempolicy;
@@ -1020,6 +1031,26 @@ static inline pid_t process_group(struct task_struct *tsk)
1020 return tsk->signal->pgrp; 1031 return tsk->signal->pgrp;
1021} 1032}
1022 1033
1034static inline struct pid *task_pid(struct task_struct *task)
1035{
1036 return task->pids[PIDTYPE_PID].pid;
1037}
1038
1039static inline struct pid *task_tgid(struct task_struct *task)
1040{
1041 return task->group_leader->pids[PIDTYPE_PID].pid;
1042}
1043
1044static inline struct pid *task_pgrp(struct task_struct *task)
1045{
1046 return task->group_leader->pids[PIDTYPE_PGID].pid;
1047}
1048
1049static inline struct pid *task_session(struct task_struct *task)
1050{
1051 return task->group_leader->pids[PIDTYPE_SID].pid;
1052}
1053
1023/** 1054/**
1024 * pid_alive - check that a task structure is not stale 1055 * pid_alive - check that a task structure is not stale
1025 * @p: Task structure to be checked. 1056 * @p: Task structure to be checked.
@@ -1043,6 +1074,8 @@ static inline int is_init(struct task_struct *tsk)
1043 return tsk->pid == 1; 1074 return tsk->pid == 1;
1044} 1075}
1045 1076
1077extern struct pid *cad_pid;
1078
1046extern void free_task(struct task_struct *tsk); 1079extern void free_task(struct task_struct *tsk);
1047#define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0) 1080#define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0)
1048 1081
@@ -1247,10 +1280,15 @@ extern int send_sig_info(int, struct siginfo *, struct task_struct *);
1247extern int send_group_sig_info(int, struct siginfo *, struct task_struct *); 1280extern int send_group_sig_info(int, struct siginfo *, struct task_struct *);
1248extern int force_sigsegv(int, struct task_struct *); 1281extern int force_sigsegv(int, struct task_struct *);
1249extern int force_sig_info(int, struct siginfo *, struct task_struct *); 1282extern int force_sig_info(int, struct siginfo *, struct task_struct *);
1283extern int __kill_pgrp_info(int sig, struct siginfo *info, struct pid *pgrp);
1284extern int kill_pgrp_info(int sig, struct siginfo *info, struct pid *pgrp);
1285extern int kill_pid_info(int sig, struct siginfo *info, struct pid *pid);
1286extern int kill_pid_info_as_uid(int, struct siginfo *, struct pid *, uid_t, uid_t, u32);
1287extern int kill_pgrp(struct pid *pid, int sig, int priv);
1288extern int kill_pid(struct pid *pid, int sig, int priv);
1250extern int __kill_pg_info(int sig, struct siginfo *info, pid_t pgrp); 1289extern int __kill_pg_info(int sig, struct siginfo *info, pid_t pgrp);
1251extern int kill_pg_info(int, struct siginfo *, pid_t); 1290extern int kill_pg_info(int, struct siginfo *, pid_t);
1252extern int kill_proc_info(int, struct siginfo *, pid_t); 1291extern int kill_proc_info(int, struct siginfo *, pid_t);
1253extern int kill_proc_info_as_uid(int, struct siginfo *, pid_t, uid_t, uid_t, u32);
1254extern void do_notify_parent(struct task_struct *, int); 1292extern void do_notify_parent(struct task_struct *, int);
1255extern void force_sig(int, struct task_struct *); 1293extern void force_sig(int, struct task_struct *);
1256extern void force_sig_specific(int, struct task_struct *); 1294extern void force_sig_specific(int, struct task_struct *);
@@ -1265,6 +1303,11 @@ extern int send_group_sigqueue(int, struct sigqueue *, struct task_struct *);
1265extern int do_sigaction(int, struct k_sigaction *, struct k_sigaction *); 1303extern int do_sigaction(int, struct k_sigaction *, struct k_sigaction *);
1266extern int do_sigaltstack(const stack_t __user *, stack_t __user *, unsigned long); 1304extern int do_sigaltstack(const stack_t __user *, stack_t __user *, unsigned long);
1267 1305
1306static inline int kill_cad_pid(int sig, int priv)
1307{
1308 return kill_pid(cad_pid, sig, priv);
1309}
1310
1268/* These can be the second arg to send_sig_info/send_group_sig_info. */ 1311/* These can be the second arg to send_sig_info/send_group_sig_info. */
1269#define SEND_SIG_NOINFO ((struct siginfo *) 0) 1312#define SEND_SIG_NOINFO ((struct siginfo *) 0)
1270#define SEND_SIG_PRIV ((struct siginfo *) 1) 1313#define SEND_SIG_PRIV ((struct siginfo *) 1)
@@ -1358,6 +1401,17 @@ extern void wait_task_inactive(struct task_struct * p);
1358/* de_thread depends on thread_group_leader not being a pid based check */ 1401/* de_thread depends on thread_group_leader not being a pid based check */
1359#define thread_group_leader(p) (p == p->group_leader) 1402#define thread_group_leader(p) (p == p->group_leader)
1360 1403
1404/* Do to the insanities of de_thread it is possible for a process
1405 * to have the pid of the thread group leader without actually being
1406 * the thread group leader. For iteration through the pids in proc
1407 * all we care about is that we have a task with the appropriate
1408 * pid, we don't actually care if we have the right task.
1409 */
1410static inline int has_group_leader_pid(struct task_struct *p)
1411{
1412 return p->pid == p->tgid;
1413}
1414
1361static inline struct task_struct *next_thread(const struct task_struct *p) 1415static inline struct task_struct *next_thread(const struct task_struct *p)
1362{ 1416{
1363 return list_entry(rcu_dereference(p->thread_group.next), 1417 return list_entry(rcu_dereference(p->thread_group.next),
diff --git a/include/linux/scx200.h b/include/linux/scx200.h
index 693c0557e7..de466e11e2 100644
--- a/include/linux/scx200.h
+++ b/include/linux/scx200.h
@@ -32,7 +32,7 @@ extern unsigned scx200_cb_base;
32 32
33/* High Resolution Timer */ 33/* High Resolution Timer */
34#define SCx200_TIMER_OFFSET 0x08 34#define SCx200_TIMER_OFFSET 0x08
35#define SCx200_TIMER_SIZE 0x05 35#define SCx200_TIMER_SIZE 0x06
36 36
37/* Clock Generators */ 37/* Clock Generators */
38#define SCx200_CLOCKGEN_OFFSET 0x10 38#define SCx200_CLOCKGEN_OFFSET 0x10
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 86501a3de2..de2e68159d 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -319,6 +319,7 @@ struct uart_info {
319#define UIF_CTS_FLOW ((__force uif_t) (1 << 26)) 319#define UIF_CTS_FLOW ((__force uif_t) (1 << 26))
320#define UIF_NORMAL_ACTIVE ((__force uif_t) (1 << 29)) 320#define UIF_NORMAL_ACTIVE ((__force uif_t) (1 << 29))
321#define UIF_INITIALIZED ((__force uif_t) (1 << 31)) 321#define UIF_INITIALIZED ((__force uif_t) (1 << 31))
322#define UIF_SUSPENDED ((__force uif_t) (1 << 30))
322 323
323 int blocked_open; 324 int blocked_open;
324 325
@@ -414,7 +415,7 @@ uart_handle_sysrq_char(struct uart_port *port, unsigned int ch,
414#ifdef SUPPORT_SYSRQ 415#ifdef SUPPORT_SYSRQ
415 if (port->sysrq) { 416 if (port->sysrq) {
416 if (ch && time_before(jiffies, port->sysrq)) { 417 if (ch && time_before(jiffies, port->sysrq)) {
417 handle_sysrq(ch, regs, NULL); 418 handle_sysrq(ch, regs, port->info->tty);
418 port->sysrq = 0; 419 port->sysrq = 0;
419 return 1; 420 return 1;
420 } 421 }
diff --git a/include/linux/serio.h b/include/linux/serio.h
index 6348e83308..c9069310b6 100644
--- a/include/linux/serio.h
+++ b/include/linux/serio.h
@@ -217,5 +217,8 @@ static inline void serio_unpin_driver(struct serio *serio)
217#define SERIO_LKKBD 0x28 217#define SERIO_LKKBD 0x28
218#define SERIO_ELO 0x29 218#define SERIO_ELO 0x29
219#define SERIO_MICROTOUCH 0x30 219#define SERIO_MICROTOUCH 0x30
220#define SERIO_PENMOUNT 0x31
221#define SERIO_TOUCHRIGHT 0x32
222#define SERIO_TOUCHWIN 0x33
220 223
221#endif 224#endif
diff --git a/include/linux/slab.h b/include/linux/slab.h
index a96fd9310d..c4947b8a2c 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/mm/slab.h 2 * linux/include/linux/slab.h
3 * Written by Mark Hemment, 1996. 3 * Written by Mark Hemment, 1996.
4 * (markhe@nextd.demon.co.uk) 4 * (markhe@nextd.demon.co.uk)
5 */ 5 */
@@ -77,13 +77,6 @@ struct cache_sizes {
77extern struct cache_sizes malloc_sizes[]; 77extern struct cache_sizes malloc_sizes[];
78 78
79extern void *__kmalloc(size_t, gfp_t); 79extern void *__kmalloc(size_t, gfp_t);
80#ifndef CONFIG_DEBUG_SLAB
81#define ____kmalloc(size, flags) __kmalloc(size, flags)
82#else
83extern void *__kmalloc_track_caller(size_t, gfp_t, void*);
84#define ____kmalloc(size, flags) \
85 __kmalloc_track_caller(size, flags, __builtin_return_address(0))
86#endif
87 80
88/** 81/**
89 * kmalloc - allocate memory 82 * kmalloc - allocate memory
@@ -153,6 +146,23 @@ found:
153 return __kmalloc(size, flags); 146 return __kmalloc(size, flags);
154} 147}
155 148
149/*
150 * kmalloc_track_caller is a special version of kmalloc that records the
151 * calling function of the routine calling it for slab leak tracking instead
152 * of just the calling function (confusing, eh?).
153 * It's useful when the call to kmalloc comes from a widely-used standard
154 * allocator where we care about the real place the memory allocation
155 * request comes from.
156 */
157#ifndef CONFIG_DEBUG_SLAB
158#define kmalloc_track_caller(size, flags) \
159 __kmalloc(size, flags)
160#else
161extern void *__kmalloc_track_caller(size_t, gfp_t, void*);
162#define kmalloc_track_caller(size, flags) \
163 __kmalloc_track_caller(size, flags, __builtin_return_address(0))
164#endif
165
156extern void *__kzalloc(size_t, gfp_t); 166extern void *__kzalloc(size_t, gfp_t);
157 167
158/** 168/**
@@ -271,7 +281,7 @@ static inline void *kcalloc(size_t n, size_t size, gfp_t flags)
271#define kmem_cache_alloc_node(c, f, n) kmem_cache_alloc(c, f) 281#define kmem_cache_alloc_node(c, f, n) kmem_cache_alloc(c, f)
272#define kmalloc_node(s, f, n) kmalloc(s, f) 282#define kmalloc_node(s, f, n) kmalloc(s, f)
273#define kzalloc(s, f) __kzalloc(s, f) 283#define kzalloc(s, f) __kzalloc(s, f)
274#define ____kmalloc kmalloc 284#define kmalloc_track_caller kmalloc
275 285
276#endif /* CONFIG_SLOB */ 286#endif /* CONFIG_SLOB */
277 287
diff --git a/include/linux/sound.h b/include/linux/sound.h
index f63d8342ff..9e2a94feed 100644
--- a/include/linux/sound.h
+++ b/include/linux/sound.h
@@ -35,10 +35,8 @@ extern int register_sound_special_device(const struct file_operations *fops, int
35extern int register_sound_mixer(const struct file_operations *fops, int dev); 35extern int register_sound_mixer(const struct file_operations *fops, int dev);
36extern int register_sound_midi(const struct file_operations *fops, int dev); 36extern int register_sound_midi(const struct file_operations *fops, int dev);
37extern int register_sound_dsp(const struct file_operations *fops, int dev); 37extern int register_sound_dsp(const struct file_operations *fops, int dev);
38extern int register_sound_synth(const struct file_operations *fops, int dev);
39 38
40extern void unregister_sound_special(int unit); 39extern void unregister_sound_special(int unit);
41extern void unregister_sound_mixer(int unit); 40extern void unregister_sound_mixer(int unit);
42extern void unregister_sound_midi(int unit); 41extern void unregister_sound_midi(int unit);
43extern void unregister_sound_dsp(int unit); 42extern void unregister_sound_dsp(int unit);
44extern void unregister_sound_synth(int unit);
diff --git a/include/linux/srcu.h b/include/linux/srcu.h
new file mode 100644
index 0000000000..aca0eee539
--- /dev/null
+++ b/include/linux/srcu.h
@@ -0,0 +1,53 @@
1/*
2 * Sleepable Read-Copy Update mechanism for mutual exclusion
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 *
18 * Copyright (C) IBM Corporation, 2006
19 *
20 * Author: Paul McKenney <paulmck@us.ibm.com>
21 *
22 * For detailed explanation of Read-Copy Update mechanism see -
23 * Documentation/RCU/ *.txt
24 *
25 */
26
27#ifndef _LINUX_SRCU_H
28#define _LINUX_SRCU_H
29
30struct srcu_struct_array {
31 int c[2];
32};
33
34struct srcu_struct {
35 int completed;
36 struct srcu_struct_array *per_cpu_ref;
37 struct mutex mutex;
38};
39
40#ifndef CONFIG_PREEMPT
41#define srcu_barrier() barrier()
42#else /* #ifndef CONFIG_PREEMPT */
43#define srcu_barrier()
44#endif /* #else #ifndef CONFIG_PREEMPT */
45
46int init_srcu_struct(struct srcu_struct *sp);
47void cleanup_srcu_struct(struct srcu_struct *sp);
48int srcu_read_lock(struct srcu_struct *sp) __acquires(sp);
49void srcu_read_unlock(struct srcu_struct *sp, int idx) __releases(sp);
50void synchronize_srcu(struct srcu_struct *sp);
51long srcu_batches_completed(struct srcu_struct *sp);
52
53#endif
diff --git a/include/linux/stat.h b/include/linux/stat.h
index 8669291352..679ef0d70b 100644
--- a/include/linux/stat.h
+++ b/include/linux/stat.h
@@ -57,7 +57,7 @@
57#include <linux/time.h> 57#include <linux/time.h>
58 58
59struct kstat { 59struct kstat {
60 unsigned long ino; 60 u64 ino;
61 dev_t dev; 61 dev_t dev;
62 umode_t mode; 62 umode_t mode;
63 unsigned int nlink; 63 unsigned int nlink;
diff --git a/include/linux/stddef.h b/include/linux/stddef.h
index ea65dfb60c..6a40c76bdc 100644
--- a/include/linux/stddef.h
+++ b/include/linux/stddef.h
@@ -11,6 +11,12 @@
11#endif 11#endif
12 12
13#ifdef __KERNEL__ 13#ifdef __KERNEL__
14
15enum {
16 false = 0,
17 true = 1
18};
19
14#undef offsetof 20#undef offsetof
15#ifdef __compiler_offsetof 21#ifdef __compiler_offsetof
16#define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER) 22#define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER)
diff --git a/include/linux/string.h b/include/linux/string.h
index e4c7558603..4f69ef9e6e 100644
--- a/include/linux/string.h
+++ b/include/linux/string.h
@@ -99,6 +99,7 @@ extern void * memchr(const void *,int,__kernel_size_t);
99#endif 99#endif
100 100
101extern char *kstrdup(const char *s, gfp_t gfp); 101extern char *kstrdup(const char *s, gfp_t gfp);
102extern void *kmemdup(const void *src, size_t len, gfp_t gfp);
102 103
103#ifdef __cplusplus 104#ifdef __cplusplus
104} 105}
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h
index 862c0d8c83..534cdc7be5 100644
--- a/include/linux/sunrpc/auth.h
+++ b/include/linux/sunrpc/auth.h
@@ -20,9 +20,6 @@
20/* size of the nodename buffer */ 20/* size of the nodename buffer */
21#define UNX_MAXNODENAME 32 21#define UNX_MAXNODENAME 32
22 22
23/* Maximum size (in bytes) of an rpc credential or verifier */
24#define RPC_MAX_AUTH_SIZE (400)
25
26/* Work around the lack of a VFS credential */ 23/* Work around the lack of a VFS credential */
27struct auth_cred { 24struct auth_cred {
28 uid_t uid; 25 uid_t uid;
diff --git a/include/linux/sunrpc/auth_gss.h b/include/linux/sunrpc/auth_gss.h
index 03084dc4bb..97b62e97dd 100644
--- a/include/linux/sunrpc/auth_gss.h
+++ b/include/linux/sunrpc/auth_gss.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/include/linux/auth_gss.h 2 * linux/include/linux/sunrpc/auth_gss.h
3 * 3 *
4 * Declarations for RPCSEC_GSS 4 * Declarations for RPCSEC_GSS
5 * 5 *
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h
index b5612c958c..3699dff7db 100644
--- a/include/linux/sunrpc/cache.h
+++ b/include/linux/sunrpc/cache.h
@@ -163,6 +163,17 @@ static inline void cache_put(struct cache_head *h, struct cache_detail *cd)
163 kref_put(&h->ref, cd->cache_put); 163 kref_put(&h->ref, cd->cache_put);
164} 164}
165 165
166static inline int cache_valid(struct cache_head *h)
167{
168 /* If an item has been unhashed pending removal when
169 * the refcount drops to 0, the expiry_time will be
170 * set to 0. We don't want to consider such items
171 * valid in this context even though CACHE_VALID is
172 * set.
173 */
174 return (h->expiry_time != 0 && test_bit(CACHE_VALID, &h->flags));
175}
176
166extern int cache_check(struct cache_detail *detail, 177extern int cache_check(struct cache_detail *detail,
167 struct cache_head *h, struct cache_req *rqstp); 178 struct cache_head *h, struct cache_req *rqstp);
168extern void cache_flush(void); 179extern void cache_flush(void);
diff --git a/include/linux/sunrpc/gss_api.h b/include/linux/sunrpc/gss_api.h
index 6e112cc5cd..5eca9e4420 100644
--- a/include/linux/sunrpc/gss_api.h
+++ b/include/linux/sunrpc/gss_api.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/include/linux/gss_api.h 2 * linux/include/linux/sunrpc/gss_api.h
3 * 3 *
4 * Somewhat simplified version of the gss api. 4 * Somewhat simplified version of the gss api.
5 * 5 *
diff --git a/include/linux/sunrpc/msg_prot.h b/include/linux/sunrpc/msg_prot.h
index d9f5934ac9..1e65f2dd80 100644
--- a/include/linux/sunrpc/msg_prot.h
+++ b/include/linux/sunrpc/msg_prot.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/include/net/sunrpc/msg_prot.h 2 * linux/include/linux/sunrpc/msg_prot.h
3 * 3 *
4 * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de> 4 * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
5 */ 5 */
@@ -11,6 +11,9 @@
11 11
12#define RPC_VERSION 2 12#define RPC_VERSION 2
13 13
14/* size of an XDR encoding unit in bytes, i.e. 32bit */
15#define XDR_UNIT (4)
16
14/* spec defines authentication flavor as an unsigned 32 bit integer */ 17/* spec defines authentication flavor as an unsigned 32 bit integer */
15typedef u32 rpc_authflavor_t; 18typedef u32 rpc_authflavor_t;
16 19
@@ -34,6 +37,9 @@ enum rpc_auth_flavors {
34 RPC_AUTH_GSS_SPKMP = 390011, 37 RPC_AUTH_GSS_SPKMP = 390011,
35}; 38};
36 39
40/* Maximum size (in bytes) of an rpc credential or verifier */
41#define RPC_MAX_AUTH_SIZE (400)
42
37enum rpc_msg_type { 43enum rpc_msg_type {
38 RPC_CALL = 0, 44 RPC_CALL = 0,
39 RPC_REPLY = 1 45 RPC_REPLY = 1
@@ -101,5 +107,39 @@ typedef __be32 rpc_fraghdr;
101#define RPC_FRAGMENT_SIZE_MASK (~RPC_LAST_STREAM_FRAGMENT) 107#define RPC_FRAGMENT_SIZE_MASK (~RPC_LAST_STREAM_FRAGMENT)
102#define RPC_MAX_FRAGMENT_SIZE ((1U << 31) - 1) 108#define RPC_MAX_FRAGMENT_SIZE ((1U << 31) - 1)
103 109
110/*
111 * RPC call and reply header size as number of 32bit words (verifier
112 * size computed separately, see below)
113 */
114#define RPC_CALLHDRSIZE (6)
115#define RPC_REPHDRSIZE (4)
116
117
118/*
119 * Maximum RPC header size, including authentication,
120 * as number of 32bit words (see RFCs 1831, 1832).
121 *
122 * xid 1 xdr unit = 4 bytes
123 * mtype 1
124 * rpc_version 1
125 * program 1
126 * prog_version 1
127 * procedure 1
128 * cred {
129 * flavor 1
130 * length 1
131 * body<RPC_MAX_AUTH_SIZE> 100 xdr units = 400 bytes
132 * }
133 * verf {
134 * flavor 1
135 * length 1
136 * body<RPC_MAX_AUTH_SIZE> 100 xdr units = 400 bytes
137 * }
138 * TOTAL 210 xdr units = 840 bytes
139 */
140#define RPC_MAX_HEADER_WITH_AUTH \
141 (RPC_CALLHDRSIZE + 2*(2+RPC_MAX_AUTH_SIZE/4))
142
143
104#endif /* __KERNEL__ */ 144#endif /* __KERNEL__ */
105#endif /* _LINUX_SUNRPC_MSGPROT_H_ */ 145#endif /* _LINUX_SUNRPC_MSGPROT_H_ */
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 73140ee5c6..d6288e89fd 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -13,11 +13,36 @@
13#include <linux/in.h> 13#include <linux/in.h>
14#include <linux/sunrpc/types.h> 14#include <linux/sunrpc/types.h>
15#include <linux/sunrpc/xdr.h> 15#include <linux/sunrpc/xdr.h>
16#include <linux/sunrpc/auth.h>
16#include <linux/sunrpc/svcauth.h> 17#include <linux/sunrpc/svcauth.h>
17#include <linux/wait.h> 18#include <linux/wait.h>
18#include <linux/mm.h> 19#include <linux/mm.h>
19 20
20/* 21/*
22 * This is the RPC server thread function prototype
23 */
24typedef void (*svc_thread_fn)(struct svc_rqst *);
25
26/*
27 *
28 * RPC service thread pool.
29 *
30 * Pool of threads and temporary sockets. Generally there is only
31 * a single one of these per RPC service, but on NUMA machines those
32 * services that can benefit from it (i.e. nfs but not lockd) will
33 * have one pool per NUMA node. This optimisation reduces cross-
34 * node traffic on multi-node NUMA NFS servers.
35 */
36struct svc_pool {
37 unsigned int sp_id; /* pool id; also node id on NUMA */
38 spinlock_t sp_lock; /* protects all fields */
39 struct list_head sp_threads; /* idle server threads */
40 struct list_head sp_sockets; /* pending sockets */
41 unsigned int sp_nrthreads; /* # of threads in pool */
42 struct list_head sp_all_threads; /* all server threads */
43} ____cacheline_aligned_in_smp;
44
45/*
21 * RPC service. 46 * RPC service.
22 * 47 *
23 * An RPC service is a ``daemon,'' possibly multithreaded, which 48 * An RPC service is a ``daemon,'' possibly multithreaded, which
@@ -28,8 +53,6 @@
28 * We currently do not support more than one RPC program per daemon. 53 * We currently do not support more than one RPC program per daemon.
29 */ 54 */
30struct svc_serv { 55struct svc_serv {
31 struct list_head sv_threads; /* idle server threads */
32 struct list_head sv_sockets; /* pending sockets */
33 struct svc_program * sv_program; /* RPC program */ 56 struct svc_program * sv_program; /* RPC program */
34 struct svc_stat * sv_stats; /* RPC statistics */ 57 struct svc_stat * sv_stats; /* RPC statistics */
35 spinlock_t sv_lock; 58 spinlock_t sv_lock;
@@ -40,16 +63,61 @@ struct svc_serv {
40 struct list_head sv_permsocks; /* all permanent sockets */ 63 struct list_head sv_permsocks; /* all permanent sockets */
41 struct list_head sv_tempsocks; /* all temporary sockets */ 64 struct list_head sv_tempsocks; /* all temporary sockets */
42 int sv_tmpcnt; /* count of temporary sockets */ 65 int sv_tmpcnt; /* count of temporary sockets */
66 struct timer_list sv_temptimer; /* timer for aging temporary sockets */
43 67
44 char * sv_name; /* service name */ 68 char * sv_name; /* service name */
69
70 unsigned int sv_nrpools; /* number of thread pools */
71 struct svc_pool * sv_pools; /* array of thread pools */
72
73 void (*sv_shutdown)(struct svc_serv *serv);
74 /* Callback to use when last thread
75 * exits.
76 */
77
78 struct module * sv_module; /* optional module to count when
79 * adding threads */
80 svc_thread_fn sv_function; /* main function for threads */
81 int sv_kill_signal; /* signal to kill threads */
45}; 82};
46 83
47/* 84/*
85 * We use sv_nrthreads as a reference count. svc_destroy() drops
86 * this refcount, so we need to bump it up around operations that
87 * change the number of threads. Horrible, but there it is.
88 * Should be called with the BKL held.
89 */
90static inline void svc_get(struct svc_serv *serv)
91{
92 serv->sv_nrthreads++;
93}
94
95/*
48 * Maximum payload size supported by a kernel RPC server. 96 * Maximum payload size supported by a kernel RPC server.
49 * This is use to determine the max number of pages nfsd is 97 * This is use to determine the max number of pages nfsd is
50 * willing to return in a single READ operation. 98 * willing to return in a single READ operation.
99 *
100 * These happen to all be powers of 2, which is not strictly
101 * necessary but helps enforce the real limitation, which is
102 * that they should be multiples of PAGE_CACHE_SIZE.
103 *
104 * For UDP transports, a block plus NFS,RPC, and UDP headers
105 * has to fit into the IP datagram limit of 64K. The largest
106 * feasible number for all known page sizes is probably 48K,
107 * but we choose 32K here. This is the same as the historical
108 * Linux limit; someone who cares more about NFS/UDP performance
109 * can test a larger number.
110 *
111 * For TCP transports we have more freedom. A size of 1MB is
112 * chosen to match the client limit. Other OSes are known to
113 * have larger limits, but those numbers are probably beyond
114 * the point of diminishing returns.
51 */ 115 */
52#define RPCSVC_MAXPAYLOAD (64*1024u) 116#define RPCSVC_MAXPAYLOAD (1*1024*1024u)
117#define RPCSVC_MAXPAYLOAD_TCP RPCSVC_MAXPAYLOAD
118#define RPCSVC_MAXPAYLOAD_UDP (32*1024u)
119
120extern u32 svc_max_payload(const struct svc_rqst *rqstp);
53 121
54/* 122/*
55 * RPC Requsts and replies are stored in one or more pages. 123 * RPC Requsts and replies are stored in one or more pages.
@@ -123,15 +191,16 @@ static inline void svc_putu32(struct kvec *iov, __be32 val)
123/* 191/*
124 * The context of a single thread, including the request currently being 192 * The context of a single thread, including the request currently being
125 * processed. 193 * processed.
126 * NOTE: First two items must be prev/next.
127 */ 194 */
128struct svc_rqst { 195struct svc_rqst {
129 struct list_head rq_list; /* idle list */ 196 struct list_head rq_list; /* idle list */
197 struct list_head rq_all; /* all threads list */
130 struct svc_sock * rq_sock; /* socket */ 198 struct svc_sock * rq_sock; /* socket */
131 struct sockaddr_in rq_addr; /* peer address */ 199 struct sockaddr_in rq_addr; /* peer address */
132 int rq_addrlen; 200 int rq_addrlen;
133 201
134 struct svc_serv * rq_server; /* RPC service definition */ 202 struct svc_serv * rq_server; /* RPC service definition */
203 struct svc_pool * rq_pool; /* thread pool */
135 struct svc_procedure * rq_procinfo; /* procedure info */ 204 struct svc_procedure * rq_procinfo; /* procedure info */
136 struct auth_ops * rq_authop; /* authentication flavour */ 205 struct auth_ops * rq_authop; /* authentication flavour */
137 struct svc_cred rq_cred; /* auth info */ 206 struct svc_cred rq_cred; /* auth info */
@@ -140,12 +209,11 @@ struct svc_rqst {
140 209
141 struct xdr_buf rq_arg; 210 struct xdr_buf rq_arg;
142 struct xdr_buf rq_res; 211 struct xdr_buf rq_res;
143 struct page * rq_argpages[RPCSVC_MAXPAGES]; 212 struct page * rq_pages[RPCSVC_MAXPAGES];
144 struct page * rq_respages[RPCSVC_MAXPAGES]; 213 struct page * *rq_respages; /* points into rq_pages */
145 int rq_restailpage; 214 int rq_resused; /* number of pages used for result */
146 short rq_argused; /* pages used for argument */ 215
147 short rq_arghi; /* pages available in argument page list */ 216 struct kvec rq_vec[RPCSVC_MAXPAGES]; /* generally useful.. */
148 short rq_resused; /* pages used for result */
149 217
150 __be32 rq_xid; /* transmission id */ 218 __be32 rq_xid; /* transmission id */
151 u32 rq_prog; /* program number */ 219 u32 rq_prog; /* program number */
@@ -180,6 +248,7 @@ struct svc_rqst {
180 * to prevent encrypting page 248 * to prevent encrypting page
181 * cache pages */ 249 * cache pages */
182 wait_queue_head_t rq_wait; /* synchronization */ 250 wait_queue_head_t rq_wait; /* synchronization */
251 struct task_struct *rq_task; /* service thread */
183}; 252};
184 253
185/* 254/*
@@ -205,63 +274,18 @@ xdr_ressize_check(struct svc_rqst *rqstp, __be32 *p)
205 return vec->iov_len <= PAGE_SIZE; 274 return vec->iov_len <= PAGE_SIZE;
206} 275}
207 276
208static inline struct page * 277static inline void svc_free_res_pages(struct svc_rqst *rqstp)
209svc_take_res_page(struct svc_rqst *rqstp)
210{
211 if (rqstp->rq_arghi <= rqstp->rq_argused)
212 return NULL;
213 rqstp->rq_arghi--;
214 rqstp->rq_respages[rqstp->rq_resused] =
215 rqstp->rq_argpages[rqstp->rq_arghi];
216 return rqstp->rq_respages[rqstp->rq_resused++];
217}
218
219static inline void svc_take_page(struct svc_rqst *rqstp)
220{
221 if (rqstp->rq_arghi <= rqstp->rq_argused) {
222 WARN_ON(1);
223 return;
224 }
225 rqstp->rq_arghi--;
226 rqstp->rq_respages[rqstp->rq_resused] =
227 rqstp->rq_argpages[rqstp->rq_arghi];
228 rqstp->rq_resused++;
229}
230
231static inline void svc_pushback_allpages(struct svc_rqst *rqstp)
232{
233 while (rqstp->rq_resused) {
234 if (rqstp->rq_respages[--rqstp->rq_resused] == NULL)
235 continue;
236 rqstp->rq_argpages[rqstp->rq_arghi++] =
237 rqstp->rq_respages[rqstp->rq_resused];
238 rqstp->rq_respages[rqstp->rq_resused] = NULL;
239 }
240}
241
242static inline void svc_pushback_unused_pages(struct svc_rqst *rqstp)
243{ 278{
244 while (rqstp->rq_resused && 279 while (rqstp->rq_resused) {
245 rqstp->rq_res.pages != &rqstp->rq_respages[rqstp->rq_resused]) { 280 struct page **pp = (rqstp->rq_respages +
246 281 --rqstp->rq_resused);
247 if (rqstp->rq_respages[--rqstp->rq_resused] != NULL) { 282 if (*pp) {
248 rqstp->rq_argpages[rqstp->rq_arghi++] = 283 put_page(*pp);
249 rqstp->rq_respages[rqstp->rq_resused]; 284 *pp = NULL;
250 rqstp->rq_respages[rqstp->rq_resused] = NULL;
251 } 285 }
252 } 286 }
253} 287}
254 288
255static inline void svc_free_allpages(struct svc_rqst *rqstp)
256{
257 while (rqstp->rq_resused) {
258 if (rqstp->rq_respages[--rqstp->rq_resused] == NULL)
259 continue;
260 put_page(rqstp->rq_respages[rqstp->rq_resused]);
261 rqstp->rq_respages[rqstp->rq_resused] = NULL;
262 }
263}
264
265struct svc_deferred_req { 289struct svc_deferred_req {
266 u32 prot; /* protocol (UDP or TCP) */ 290 u32 prot; /* protocol (UDP or TCP) */
267 struct sockaddr_in addr; 291 struct sockaddr_in addr;
@@ -297,6 +321,9 @@ struct svc_version {
297 struct svc_procedure * vs_proc; /* per-procedure info */ 321 struct svc_procedure * vs_proc; /* per-procedure info */
298 u32 vs_xdrsize; /* xdrsize needed for this version */ 322 u32 vs_xdrsize; /* xdrsize needed for this version */
299 323
324 unsigned int vs_hidden : 1; /* Don't register with portmapper.
325 * Only used for nfsacl so far. */
326
300 /* Override dispatch function (e.g. when caching replies). 327 /* Override dispatch function (e.g. when caching replies).
301 * A return value of 0 means drop the request. 328 * A return value of 0 means drop the request.
302 * vs_dispatch == NULL means use default dispatcher. 329 * vs_dispatch == NULL means use default dispatcher.
@@ -321,20 +348,21 @@ struct svc_procedure {
321}; 348};
322 349
323/* 350/*
324 * This is the RPC server thread function prototype
325 */
326typedef void (*svc_thread_fn)(struct svc_rqst *);
327
328/*
329 * Function prototypes. 351 * Function prototypes.
330 */ 352 */
331struct svc_serv * svc_create(struct svc_program *, unsigned int); 353struct svc_serv * svc_create(struct svc_program *, unsigned int,
354 void (*shutdown)(struct svc_serv*));
332int svc_create_thread(svc_thread_fn, struct svc_serv *); 355int svc_create_thread(svc_thread_fn, struct svc_serv *);
333void svc_exit_thread(struct svc_rqst *); 356void svc_exit_thread(struct svc_rqst *);
357struct svc_serv * svc_create_pooled(struct svc_program *, unsigned int,
358 void (*shutdown)(struct svc_serv*),
359 svc_thread_fn, int sig, struct module *);
360int svc_set_num_threads(struct svc_serv *, struct svc_pool *, int);
334void svc_destroy(struct svc_serv *); 361void svc_destroy(struct svc_serv *);
335int svc_process(struct svc_serv *, struct svc_rqst *); 362int svc_process(struct svc_rqst *);
336int svc_register(struct svc_serv *, int, unsigned short); 363int svc_register(struct svc_serv *, int, unsigned short);
337void svc_wake_up(struct svc_serv *); 364void svc_wake_up(struct svc_serv *);
338void svc_reserve(struct svc_rqst *rqstp, int space); 365void svc_reserve(struct svc_rqst *rqstp, int space);
366struct svc_pool * svc_pool_for_cpu(struct svc_serv *serv, int cpu);
339 367
340#endif /* SUNRPC_SVC_H */ 368#endif /* SUNRPC_SVC_H */
diff --git a/include/linux/sunrpc/svcauth.h b/include/linux/sunrpc/svcauth.h
index a6601650de..de92619b08 100644
--- a/include/linux/sunrpc/svcauth.h
+++ b/include/linux/sunrpc/svcauth.h
@@ -126,6 +126,7 @@ extern struct auth_domain *auth_domain_find(char *name);
126extern struct auth_domain *auth_unix_lookup(struct in_addr addr); 126extern struct auth_domain *auth_unix_lookup(struct in_addr addr);
127extern int auth_unix_forget_old(struct auth_domain *dom); 127extern int auth_unix_forget_old(struct auth_domain *dom);
128extern void svcauth_unix_purge(void); 128extern void svcauth_unix_purge(void);
129extern void svcauth_unix_info_release(void *);
129 130
130static inline unsigned long hash_str(char *name, int bits) 131static inline unsigned long hash_str(char *name, int bits)
131{ 132{
diff --git a/include/linux/sunrpc/svcauth_gss.h b/include/linux/sunrpc/svcauth_gss.h
index 3a2206f61d..5a5db16ab6 100644
--- a/include/linux/sunrpc/svcauth_gss.h
+++ b/include/linux/sunrpc/svcauth_gss.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/include/linux/svcauth_gss.h 2 * linux/include/linux/sunrpc/svcauth_gss.h
3 * 3 *
4 * Bruce Fields <bfields@umich.edu> 4 * Bruce Fields <bfields@umich.edu>
5 * Copyright (c) 2002 The Regents of the Unviersity of Michigan 5 * Copyright (c) 2002 The Regents of the Unviersity of Michigan
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h
index b4acb3d37c..98b21ad370 100644
--- a/include/linux/sunrpc/svcsock.h
+++ b/include/linux/sunrpc/svcsock.h
@@ -20,8 +20,9 @@ struct svc_sock {
20 struct socket * sk_sock; /* berkeley socket layer */ 20 struct socket * sk_sock; /* berkeley socket layer */
21 struct sock * sk_sk; /* INET layer */ 21 struct sock * sk_sk; /* INET layer */
22 22
23 struct svc_pool * sk_pool; /* current pool iff queued */
23 struct svc_serv * sk_server; /* service for this socket */ 24 struct svc_serv * sk_server; /* service for this socket */
24 unsigned int sk_inuse; /* use count */ 25 atomic_t sk_inuse; /* use count */
25 unsigned long sk_flags; 26 unsigned long sk_flags;
26#define SK_BUSY 0 /* enqueued/receiving */ 27#define SK_BUSY 0 /* enqueued/receiving */
27#define SK_CONN 1 /* conn pending */ 28#define SK_CONN 1 /* conn pending */
@@ -31,9 +32,12 @@ struct svc_sock {
31#define SK_DEAD 6 /* socket closed */ 32#define SK_DEAD 6 /* socket closed */
32#define SK_CHNGBUF 7 /* need to change snd/rcv buffer sizes */ 33#define SK_CHNGBUF 7 /* need to change snd/rcv buffer sizes */
33#define SK_DEFERRED 8 /* request on sk_deferred */ 34#define SK_DEFERRED 8 /* request on sk_deferred */
35#define SK_OLD 9 /* used for temp socket aging mark+sweep */
36#define SK_DETACHED 10 /* detached from tempsocks list */
34 37
35 int sk_reserved; /* space on outq that is reserved */ 38 atomic_t sk_reserved; /* space on outq that is reserved */
36 39
40 spinlock_t sk_defer_lock; /* protects sk_deferred */
37 struct list_head sk_deferred; /* deferred requests that need to 41 struct list_head sk_deferred; /* deferred requests that need to
38 * be revisted */ 42 * be revisted */
39 struct mutex sk_mutex; /* to serialize sending data */ 43 struct mutex sk_mutex; /* to serialize sending data */
@@ -50,6 +54,9 @@ struct svc_sock {
50 int sk_reclen; /* length of record */ 54 int sk_reclen; /* length of record */
51 int sk_tcplen; /* current read length */ 55 int sk_tcplen; /* current read length */
52 time_t sk_lastrecv; /* time of last received request */ 56 time_t sk_lastrecv; /* time of last received request */
57
58 /* cache of various info for TCP sockets */
59 void *sk_info_authunix;
53}; 60};
54 61
55/* 62/*
@@ -57,9 +64,14 @@ struct svc_sock {
57 */ 64 */
58int svc_makesock(struct svc_serv *, int, unsigned short); 65int svc_makesock(struct svc_serv *, int, unsigned short);
59void svc_delete_socket(struct svc_sock *); 66void svc_delete_socket(struct svc_sock *);
60int svc_recv(struct svc_serv *, struct svc_rqst *, long); 67int svc_recv(struct svc_rqst *, long);
61int svc_send(struct svc_rqst *); 68int svc_send(struct svc_rqst *);
62void svc_drop(struct svc_rqst *); 69void svc_drop(struct svc_rqst *);
63void svc_sock_update_bufs(struct svc_serv *serv); 70void svc_sock_update_bufs(struct svc_serv *serv);
71int svc_sock_names(char *buf, struct svc_serv *serv, char *toclose);
72int svc_addsock(struct svc_serv *serv,
73 int fd,
74 char *name_return,
75 int *proto);
64 76
65#endif /* SUNRPC_SVCSOCK_H */ 77#endif /* SUNRPC_SVCSOCK_H */
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index 6cf6265807..60394fbc4c 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -15,6 +15,7 @@
15#include <linux/kref.h> 15#include <linux/kref.h>
16#include <linux/sunrpc/sched.h> 16#include <linux/sunrpc/sched.h>
17#include <linux/sunrpc/xdr.h> 17#include <linux/sunrpc/xdr.h>
18#include <linux/sunrpc/msg_prot.h>
18 19
19extern unsigned int xprt_udp_slot_table_entries; 20extern unsigned int xprt_udp_slot_table_entries;
20extern unsigned int xprt_tcp_slot_table_entries; 21extern unsigned int xprt_tcp_slot_table_entries;
@@ -24,13 +25,6 @@ extern unsigned int xprt_tcp_slot_table_entries;
24#define RPC_MAX_SLOT_TABLE (128U) 25#define RPC_MAX_SLOT_TABLE (128U)
25 26
26/* 27/*
27 * RPC call and reply header size as number of 32bit words (verifier
28 * size computed separately)
29 */
30#define RPC_CALLHDRSIZE 6
31#define RPC_REPHDRSIZE 4
32
33/*
34 * Parameters for choosing a free port 28 * Parameters for choosing a free port
35 */ 29 */
36extern unsigned int xprt_min_resvport; 30extern unsigned int xprt_min_resvport;
diff --git a/include/linux/synclink.h b/include/linux/synclink.h
index 0577f5284c..c8b042667a 100644
--- a/include/linux/synclink.h
+++ b/include/linux/synclink.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * SyncLink Multiprotocol Serial Adapter Driver 2 * SyncLink Multiprotocol Serial Adapter Driver
3 * 3 *
4 * $Id: synclink.h,v 3.13 2006/05/23 18:25:06 paulkf Exp $ 4 * $Id: synclink.h,v 3.14 2006/07/17 20:15:43 paulkf Exp $
5 * 5 *
6 * Copyright (C) 1998-2000 by Microgate Corporation 6 * Copyright (C) 1998-2000 by Microgate Corporation
7 * 7 *
@@ -124,6 +124,8 @@
124 124
125#define MGSL_MODE_ASYNC 1 125#define MGSL_MODE_ASYNC 1
126#define MGSL_MODE_HDLC 2 126#define MGSL_MODE_HDLC 2
127#define MGSL_MODE_MONOSYNC 3
128#define MGSL_MODE_BISYNC 4
127#define MGSL_MODE_RAW 6 129#define MGSL_MODE_RAW 6
128 130
129#define MGSL_BUS_TYPE_ISA 1 131#define MGSL_BUS_TYPE_ISA 1
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 2d1c3d5c83..3efcfc7e9c 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -599,4 +599,6 @@ asmlinkage long sys_set_robust_list(struct robust_list_head __user *head,
599 size_t len); 599 size_t len);
600asmlinkage long sys_getcpu(unsigned __user *cpu, unsigned __user *node, struct getcpu_cache __user *cache); 600asmlinkage long sys_getcpu(unsigned __user *cpu, unsigned __user *node, struct getcpu_cache __user *cache);
601 601
602int kernel_execve(const char *filename, char *const argv[], char *const envp[]);
603
602#endif 604#endif
diff --git a/include/linux/sysrq.h b/include/linux/sysrq.h
index 4812ff6056..e657e523b9 100644
--- a/include/linux/sysrq.h
+++ b/include/linux/sysrq.h
@@ -11,6 +11,8 @@
11 * based upon discusions in irc://irc.openprojects.net/#kernelnewbies 11 * based upon discusions in irc://irc.openprojects.net/#kernelnewbies
12 */ 12 */
13 13
14#ifndef _LINUX_SYSRQ_H
15#define _LINUX_SYSRQ_H
14 16
15struct pt_regs; 17struct pt_regs;
16struct tty_struct; 18struct tty_struct;
@@ -57,3 +59,5 @@ static inline int __reterr(void)
57#define unregister_sysrq_key(ig,nore) __reterr() 59#define unregister_sysrq_key(ig,nore) __reterr()
58 60
59#endif 61#endif
62
63#endif /* _LINUX_SYSRQ_H */
diff --git a/include/linux/taskstats.h b/include/linux/taskstats.h
index f1cb6cddd1..45248806ae 100644
--- a/include/linux/taskstats.h
+++ b/include/linux/taskstats.h
@@ -2,6 +2,7 @@
2 * 2 *
3 * Copyright (C) Shailabh Nagar, IBM Corp. 2006 3 * Copyright (C) Shailabh Nagar, IBM Corp. 2006
4 * (C) Balbir Singh, IBM Corp. 2006 4 * (C) Balbir Singh, IBM Corp. 2006
5 * (C) Jay Lan, SGI, 2006
5 * 6 *
6 * This program is free software; you can redistribute it and/or modify it 7 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of version 2.1 of the GNU Lesser General Public License 8 * under the terms of version 2.1 of the GNU Lesser General Public License
@@ -29,16 +30,25 @@
29 * c) add new fields after version comment; maintain 64-bit alignment 30 * c) add new fields after version comment; maintain 64-bit alignment
30 */ 31 */
31 32
32#define TASKSTATS_VERSION 1 33
34#define TASKSTATS_VERSION 2
35#define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN
36 * in linux/sched.h */
33 37
34struct taskstats { 38struct taskstats {
35 39
36 /* Version 1 */ 40 /* The version number of this struct. This field is always set to
41 * TAKSTATS_VERSION, which is defined in <linux/taskstats.h>.
42 * Each time the struct is changed, the value should be incremented.
43 */
37 __u16 version; 44 __u16 version;
38 __u16 padding[3]; /* Userspace should not interpret the padding 45 __u32 ac_exitcode; /* Exit status */
39 * field which can be replaced by useful 46
40 * fields if struct taskstats is extended. 47 /* The accounting flags of a task as defined in <linux/acct.h>
41 */ 48 * Defined values are AFORK, ASU, ACOMPAT, ACORE, and AXSIG.
49 */
50 __u8 ac_flag; /* Record flags */
51 __u8 ac_nice; /* task_nice */
42 52
43 /* Delay accounting fields start 53 /* Delay accounting fields start
44 * 54 *
@@ -88,6 +98,48 @@ struct taskstats {
88 __u64 cpu_run_virtual_total; 98 __u64 cpu_run_virtual_total;
89 /* Delay accounting fields end */ 99 /* Delay accounting fields end */
90 /* version 1 ends here */ 100 /* version 1 ends here */
101
102 /* Basic Accounting Fields start */
103 char ac_comm[TS_COMM_LEN]; /* Command name */
104 __u8 ac_sched; /* Scheduling discipline */
105 __u8 ac_pad[3];
106 __u32 ac_uid; /* User ID */
107 __u32 ac_gid; /* Group ID */
108 __u32 ac_pid; /* Process ID */
109 __u32 ac_ppid; /* Parent process ID */
110 __u32 ac_btime; /* Begin time [sec since 1970] */
111 __u64 ac_etime; /* Elapsed time [usec] */
112 __u64 ac_utime; /* User CPU time [usec] */
113 __u64 ac_stime; /* SYstem CPU time [usec] */
114 __u64 ac_minflt; /* Minor Page Fault Count */
115 __u64 ac_majflt; /* Major Page Fault Count */
116 /* Basic Accounting Fields end */
117
118 /* Extended accounting fields start */
119 /* Accumulated RSS usage in duration of a task, in MBytes-usecs.
120 * The current rss usage is added to this counter every time
121 * a tick is charged to a task's system time. So, at the end we
122 * will have memory usage multiplied by system time. Thus an
123 * average usage per system time unit can be calculated.
124 */
125 __u64 coremem; /* accumulated RSS usage in MB-usec */
126 /* Accumulated virtual memory usage in duration of a task.
127 * Same as acct_rss_mem1 above except that we keep track of VM usage.
128 */
129 __u64 virtmem; /* accumulated VM usage in MB-usec */
130
131 /* High watermark of RSS and virtual memory usage in duration of
132 * a task, in KBytes.
133 */
134 __u64 hiwater_rss; /* High-watermark of RSS usage, in KB */
135 __u64 hiwater_vm; /* High-water VM usage, in KB */
136
137 /* The following four fields are I/O statistics of a task. */
138 __u64 read_char; /* bytes read */
139 __u64 write_char; /* bytes written */
140 __u64 read_syscalls; /* read syscalls */
141 __u64 write_syscalls; /* write syscalls */
142 /* Extended accounting fields end */
91}; 143};
92 144
93 145
diff --git a/include/linux/tifm.h b/include/linux/tifm.h
new file mode 100644
index 0000000000..203dd5e11e
--- /dev/null
+++ b/include/linux/tifm.h
@@ -0,0 +1,158 @@
1/*
2 * tifm.h - TI FlashMedia driver
3 *
4 * Copyright (C) 2006 Alex Dubov <oakad@yahoo.com>
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 */
11
12#ifndef _TIFM_H
13#define _TIFM_H
14
15#include <linux/spinlock.h>
16#include <linux/interrupt.h>
17#include <linux/wait.h>
18#include <linux/delay.h>
19#include <linux/pci.h>
20
21/* Host registers (relative to pci base address): */
22enum {
23 FM_SET_INTERRUPT_ENABLE = 0x008,
24 FM_CLEAR_INTERRUPT_ENABLE = 0x00c,
25 FM_INTERRUPT_STATUS = 0x014 };
26
27/* Socket registers (relative to socket base address): */
28enum {
29 SOCK_CONTROL = 0x004,
30 SOCK_PRESENT_STATE = 0x008,
31 SOCK_DMA_ADDRESS = 0x00c,
32 SOCK_DMA_CONTROL = 0x010,
33 SOCK_DMA_FIFO_INT_ENABLE_SET = 0x014,
34 SOCK_DMA_FIFO_INT_ENABLE_CLEAR = 0x018,
35 SOCK_DMA_FIFO_STATUS = 0x020,
36 SOCK_FIFO_CONTROL = 0x024,
37 SOCK_FIFO_PAGE_SIZE = 0x028,
38 SOCK_MMCSD_COMMAND = 0x104,
39 SOCK_MMCSD_ARG_LOW = 0x108,
40 SOCK_MMCSD_ARG_HIGH = 0x10c,
41 SOCK_MMCSD_CONFIG = 0x110,
42 SOCK_MMCSD_STATUS = 0x114,
43 SOCK_MMCSD_INT_ENABLE = 0x118,
44 SOCK_MMCSD_COMMAND_TO = 0x11c,
45 SOCK_MMCSD_DATA_TO = 0x120,
46 SOCK_MMCSD_DATA = 0x124,
47 SOCK_MMCSD_BLOCK_LEN = 0x128,
48 SOCK_MMCSD_NUM_BLOCKS = 0x12c,
49 SOCK_MMCSD_BUFFER_CONFIG = 0x130,
50 SOCK_MMCSD_SPI_CONFIG = 0x134,
51 SOCK_MMCSD_SDIO_MODE_CONFIG = 0x138,
52 SOCK_MMCSD_RESPONSE = 0x144,
53 SOCK_MMCSD_SDIO_SR = 0x164,
54 SOCK_MMCSD_SYSTEM_CONTROL = 0x168,
55 SOCK_MMCSD_SYSTEM_STATUS = 0x16c,
56 SOCK_MS_COMMAND = 0x184,
57 SOCK_MS_DATA = 0x188,
58 SOCK_MS_STATUS = 0x18c,
59 SOCK_MS_SYSTEM = 0x190,
60 SOCK_FIFO_ACCESS = 0x200 };
61
62
63#define TIFM_IRQ_ENABLE 0x80000000
64#define TIFM_IRQ_SOCKMASK 0x00000001
65#define TIFM_IRQ_CARDMASK 0x00000100
66#define TIFM_IRQ_FIFOMASK 0x00010000
67#define TIFM_IRQ_SETALL 0xffffffff
68#define TIFM_IRQ_SETALLSOCK 0x0000000f
69
70#define TIFM_CTRL_LED 0x00000040
71#define TIFM_CTRL_FAST_CLK 0x00000100
72
73#define TIFM_SOCK_STATE_OCCUPIED 0x00000008
74#define TIFM_SOCK_STATE_POWERED 0x00000080
75
76#define TIFM_FIFO_ENABLE 0x00000001 /* Meaning of this constant is unverified */
77#define TIFM_FIFO_INT_SETALL 0x0000ffff
78#define TIFM_FIFO_INTMASK 0x00000005 /* Meaning of this constant is unverified */
79
80#define TIFM_DMA_RESET 0x00000002 /* Meaning of this constant is unverified */
81#define TIFM_DMA_TX 0x00008000 /* Meaning of this constant is unverified */
82#define TIFM_DMA_EN 0x00000001 /* Meaning of this constant is unverified */
83
84typedef enum {FM_NULL = 0, FM_XD = 0x01, FM_MS = 0x02, FM_SD = 0x03} tifm_media_id;
85
86struct tifm_driver;
87struct tifm_dev {
88 char __iomem *addr;
89 spinlock_t lock;
90 tifm_media_id media_id;
91 char wq_name[KOBJ_NAME_LEN];
92 struct workqueue_struct *wq;
93
94 unsigned int (*signal_irq)(struct tifm_dev *sock,
95 unsigned int sock_irq_status);
96
97 struct tifm_driver *drv;
98 struct device dev;
99};
100
101struct tifm_driver {
102 tifm_media_id *id_table;
103 int (*probe)(struct tifm_dev *dev);
104 void (*remove)(struct tifm_dev *dev);
105
106 struct device_driver driver;
107};
108
109struct tifm_adapter {
110 char __iomem *addr;
111 unsigned int irq_status;
112 unsigned int insert_mask;
113 unsigned int remove_mask;
114 spinlock_t lock;
115 unsigned int id;
116 unsigned int max_sockets;
117 char wq_name[KOBJ_NAME_LEN];
118 unsigned int inhibit_new_cards;
119 struct workqueue_struct *wq;
120 struct work_struct media_inserter;
121 struct work_struct media_remover;
122 struct tifm_dev **sockets;
123 struct class_device cdev;
124 struct device *dev;
125
126 void (*eject)(struct tifm_adapter *fm, struct tifm_dev *sock);
127};
128
129struct tifm_adapter *tifm_alloc_adapter(void);
130void tifm_free_device(struct device *dev);
131void tifm_free_adapter(struct tifm_adapter *fm);
132int tifm_add_adapter(struct tifm_adapter *fm);
133void tifm_remove_adapter(struct tifm_adapter *fm);
134struct tifm_dev *tifm_alloc_device(struct tifm_adapter *fm, unsigned int id);
135int tifm_register_driver(struct tifm_driver *drv);
136void tifm_unregister_driver(struct tifm_driver *drv);
137void tifm_eject(struct tifm_dev *sock);
138int tifm_map_sg(struct tifm_dev *sock, struct scatterlist *sg, int nents,
139 int direction);
140void tifm_unmap_sg(struct tifm_dev *sock, struct scatterlist *sg, int nents,
141 int direction);
142
143
144static inline void *tifm_get_drvdata(struct tifm_dev *dev)
145{
146 return dev_get_drvdata(&dev->dev);
147}
148
149static inline void tifm_set_drvdata(struct tifm_dev *dev, void *data)
150{
151 dev_set_drvdata(&dev->dev, data);
152}
153
154struct tifm_device_id {
155 tifm_media_id media_id;
156};
157
158#endif
diff --git a/include/linux/timex.h b/include/linux/timex.h
index d543d3871e..049dfe4a11 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -69,34 +69,28 @@
69 * zero to MAXTC, the PLL will converge in 15 minutes to 16 hours, 69 * zero to MAXTC, the PLL will converge in 15 minutes to 16 hours,
70 * respectively. 70 * respectively.
71 */ 71 */
72#define SHIFT_KG 6 /* phase factor (shift) */ 72#define SHIFT_PLL 4 /* PLL frequency factor (shift) */
73#define SHIFT_KF 16 /* PLL frequency factor (shift) */ 73#define SHIFT_FLL 2 /* FLL frequency factor (shift) */
74#define SHIFT_KH 2 /* FLL frequency factor (shift) */ 74#define MAXTC 10 /* maximum time constant (shift) */
75#define MAXTC 6 /* maximum time constant (shift) */
76 75
77/* 76/*
78 * The SHIFT_SCALE define establishes the decimal point of the time_phase 77 * The SHIFT_UPDATE define establishes the decimal point of the
79 * variable which serves as an extension to the low-order bits of the 78 * time_offset variable which represents the current offset with
80 * system clock variable. The SHIFT_UPDATE define establishes the decimal 79 * respect to standard time.
81 * point of the time_offset variable which represents the current offset
82 * with respect to standard time. The FINENSEC define represents 1 nsec in
83 * scaled units.
84 * 80 *
85 * SHIFT_USEC defines the scaling (shift) of the time_freq and 81 * SHIFT_USEC defines the scaling (shift) of the time_freq and
86 * time_tolerance variables, which represent the current frequency 82 * time_tolerance variables, which represent the current frequency
87 * offset and maximum frequency tolerance. 83 * offset and maximum frequency tolerance.
88 *
89 * FINENSEC is 1 ns in SHIFT_UPDATE units of the time_phase variable.
90 */ 84 */
91#define SHIFT_SCALE 22 /* phase scale (shift) */ 85#define SHIFT_UPDATE (SHIFT_HZ + 1) /* time offset scale (shift) */
92#define SHIFT_UPDATE (SHIFT_KG + MAXTC) /* time offset scale (shift) */
93#define SHIFT_USEC 16 /* frequency offset scale (shift) */ 86#define SHIFT_USEC 16 /* frequency offset scale (shift) */
94#define FINENSEC (1L << (SHIFT_SCALE - 10)) /* ~1 ns in phase units */ 87#define SHIFT_NSEC 12 /* kernel frequency offset scale */
95 88
96#define MAXPHASE 512000L /* max phase error (us) */ 89#define MAXPHASE 512000L /* max phase error (us) */
97#define MAXFREQ (512L << SHIFT_USEC) /* max frequency error (ppm) */ 90#define MAXFREQ (512L << SHIFT_USEC) /* max frequency error (ppm) */
98#define MINSEC 16L /* min interval between updates (s) */ 91#define MAXFREQ_NSEC (512000L << SHIFT_NSEC) /* max frequency error (ppb) */
99#define MAXSEC 1200L /* max interval between updates (s) */ 92#define MINSEC 256 /* min interval between updates (s) */
93#define MAXSEC 2048 /* max interval between updates (s) */
100#define NTP_PHASE_LIMIT (MAXPHASE << 5) /* beyond max. dispersion */ 94#define NTP_PHASE_LIMIT (MAXPHASE << 5) /* beyond max. dispersion */
101 95
102/* 96/*
@@ -204,33 +198,15 @@ extern int tickadj; /* amount of adjustment per tick */
204/* 198/*
205 * phase-lock loop variables 199 * phase-lock loop variables
206 */ 200 */
207extern int time_state; /* clock status */
208extern int time_status; /* clock synchronization status bits */ 201extern int time_status; /* clock synchronization status bits */
209extern long time_offset; /* time adjustment (us) */
210extern long time_constant; /* pll time constant */
211extern long time_tolerance; /* frequency tolerance (ppm) */
212extern long time_precision; /* clock precision (us) */
213extern long time_maxerror; /* maximum error */ 202extern long time_maxerror; /* maximum error */
214extern long time_esterror; /* estimated error */ 203extern long time_esterror; /* estimated error */
215 204
216extern long time_freq; /* frequency offset (scaled ppm) */ 205extern long time_freq; /* frequency offset (scaled ppm) */
217extern long time_reftime; /* time at last adjustment (s) */
218 206
219extern long time_adjust; /* The amount of adjtime left */ 207extern long time_adjust; /* The amount of adjtime left */
220extern long time_next_adjust; /* Value for time_adjust at next tick */
221 208
222/** 209extern void ntp_clear(void);
223 * ntp_clear - Clears the NTP state variables
224 *
225 * Must be called while holding a write on the xtime_lock
226 */
227static inline void ntp_clear(void)
228{
229 time_adjust = 0; /* stop active adjtime() */
230 time_status |= STA_UNSYNC;
231 time_maxerror = NTP_PHASE_LIMIT;
232 time_esterror = NTP_PHASE_LIMIT;
233}
234 210
235/** 211/**
236 * ntp_synced - Returns 1 if the NTP status is not UNSYNC 212 * ntp_synced - Returns 1 if the NTP status is not UNSYNC
@@ -294,11 +270,15 @@ extern void register_time_interpolator(struct time_interpolator *);
294extern void unregister_time_interpolator(struct time_interpolator *); 270extern void unregister_time_interpolator(struct time_interpolator *);
295extern void time_interpolator_reset(void); 271extern void time_interpolator_reset(void);
296extern unsigned long time_interpolator_get_offset(void); 272extern unsigned long time_interpolator_get_offset(void);
273extern void time_interpolator_update(long delta_nsec);
297 274
298#else /* !CONFIG_TIME_INTERPOLATION */ 275#else /* !CONFIG_TIME_INTERPOLATION */
299 276
300static inline void 277static inline void time_interpolator_reset(void)
301time_interpolator_reset(void) 278{
279}
280
281static inline void time_interpolator_update(long delta_nsec)
302{ 282{
303} 283}
304 284
@@ -309,6 +289,8 @@ time_interpolator_reset(void)
309/* Returns how long ticks are at present, in ns / 2^(SHIFT_SCALE-10). */ 289/* Returns how long ticks are at present, in ns / 2^(SHIFT_SCALE-10). */
310extern u64 current_tick_length(void); 290extern u64 current_tick_length(void);
311 291
292extern void second_overflow(void);
293extern void update_ntp_one_tick(void);
312extern int do_adjtimex(struct timex *); 294extern int do_adjtimex(struct timex *);
313 295
314#endif /* KERNEL */ 296#endif /* KERNEL */
diff --git a/include/linux/topology.h b/include/linux/topology.h
index ec1eca8529..da508d1998 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -89,6 +89,7 @@
89#define SD_SIBLING_INIT (struct sched_domain) { \ 89#define SD_SIBLING_INIT (struct sched_domain) { \
90 .span = CPU_MASK_NONE, \ 90 .span = CPU_MASK_NONE, \
91 .parent = NULL, \ 91 .parent = NULL, \
92 .child = NULL, \
92 .groups = NULL, \ 93 .groups = NULL, \
93 .min_interval = 1, \ 94 .min_interval = 1, \
94 .max_interval = 2, \ 95 .max_interval = 2, \
@@ -114,11 +115,44 @@
114#endif 115#endif
115#endif /* CONFIG_SCHED_SMT */ 116#endif /* CONFIG_SCHED_SMT */
116 117
118#ifdef CONFIG_SCHED_MC
119/* Common values for MC siblings. for now mostly derived from SD_CPU_INIT */
120#ifndef SD_MC_INIT
121#define SD_MC_INIT (struct sched_domain) { \
122 .span = CPU_MASK_NONE, \
123 .parent = NULL, \
124 .child = NULL, \
125 .groups = NULL, \
126 .min_interval = 1, \
127 .max_interval = 4, \
128 .busy_factor = 64, \
129 .imbalance_pct = 125, \
130 .cache_nice_tries = 1, \
131 .per_cpu_gain = 100, \
132 .busy_idx = 2, \
133 .idle_idx = 1, \
134 .newidle_idx = 2, \
135 .wake_idx = 1, \
136 .forkexec_idx = 1, \
137 .flags = SD_LOAD_BALANCE \
138 | SD_BALANCE_NEWIDLE \
139 | SD_BALANCE_EXEC \
140 | SD_WAKE_AFFINE \
141 | SD_SHARE_PKG_RESOURCES\
142 | BALANCE_FOR_MC_POWER, \
143 .last_balance = jiffies, \
144 .balance_interval = 1, \
145 .nr_balance_failed = 0, \
146}
147#endif
148#endif /* CONFIG_SCHED_MC */
149
117/* Common values for CPUs */ 150/* Common values for CPUs */
118#ifndef SD_CPU_INIT 151#ifndef SD_CPU_INIT
119#define SD_CPU_INIT (struct sched_domain) { \ 152#define SD_CPU_INIT (struct sched_domain) { \
120 .span = CPU_MASK_NONE, \ 153 .span = CPU_MASK_NONE, \
121 .parent = NULL, \ 154 .parent = NULL, \
155 .child = NULL, \
122 .groups = NULL, \ 156 .groups = NULL, \
123 .min_interval = 1, \ 157 .min_interval = 1, \
124 .max_interval = 4, \ 158 .max_interval = 4, \
@@ -135,7 +169,7 @@
135 | SD_BALANCE_NEWIDLE \ 169 | SD_BALANCE_NEWIDLE \
136 | SD_BALANCE_EXEC \ 170 | SD_BALANCE_EXEC \
137 | SD_WAKE_AFFINE \ 171 | SD_WAKE_AFFINE \
138 | BALANCE_FOR_POWER, \ 172 | BALANCE_FOR_PKG_POWER,\
139 .last_balance = jiffies, \ 173 .last_balance = jiffies, \
140 .balance_interval = 1, \ 174 .balance_interval = 1, \
141 .nr_balance_failed = 0, \ 175 .nr_balance_failed = 0, \
@@ -146,6 +180,7 @@
146#define SD_ALLNODES_INIT (struct sched_domain) { \ 180#define SD_ALLNODES_INIT (struct sched_domain) { \
147 .span = CPU_MASK_NONE, \ 181 .span = CPU_MASK_NONE, \
148 .parent = NULL, \ 182 .parent = NULL, \
183 .child = NULL, \
149 .groups = NULL, \ 184 .groups = NULL, \
150 .min_interval = 64, \ 185 .min_interval = 64, \
151 .max_interval = 64*num_online_cpus(), \ 186 .max_interval = 64*num_online_cpus(), \
@@ -165,15 +200,6 @@
165 .nr_balance_failed = 0, \ 200 .nr_balance_failed = 0, \
166} 201}
167 202
168#ifdef CONFIG_SCHED_MC
169#ifndef SD_MC_INIT
170/* for now its same as SD_CPU_INIT.
171 * TBD: Tune Domain parameters!
172 */
173#define SD_MC_INIT SD_CPU_INIT
174#endif
175#endif
176
177#ifdef CONFIG_NUMA 203#ifdef CONFIG_NUMA
178#ifndef SD_NODE_INIT 204#ifndef SD_NODE_INIT
179#error Please define an appropriate SD_NODE_INIT in include/asm/topology.h!!! 205#error Please define an appropriate SD_NODE_INIT in include/asm/topology.h!!!
diff --git a/include/linux/tsacct_kern.h b/include/linux/tsacct_kern.h
new file mode 100644
index 0000000000..7e50ac795b
--- /dev/null
+++ b/include/linux/tsacct_kern.h
@@ -0,0 +1,34 @@
1/*
2 * tsacct_kern.h - kernel header for system accounting over taskstats interface
3 *
4 * Copyright (C) Jay Lan SGI
5 */
6
7#ifndef _LINUX_TSACCT_KERN_H
8#define _LINUX_TSACCT_KERN_H
9
10#include <linux/taskstats.h>
11
12#ifdef CONFIG_TASKSTATS
13extern void bacct_add_tsk(struct taskstats *stats, struct task_struct *tsk);
14#else
15static inline void bacct_add_tsk(struct taskstats *stats, struct task_struct *tsk)
16{}
17#endif /* CONFIG_TASKSTATS */
18
19#ifdef CONFIG_TASK_XACCT
20extern void xacct_add_tsk(struct taskstats *stats, struct task_struct *p);
21extern void acct_update_integrals(struct task_struct *tsk);
22extern void acct_clear_integrals(struct task_struct *tsk);
23#else
24static inline void xacct_add_tsk(struct taskstats *stats, struct task_struct *p)
25{}
26static inline void acct_update_integrals(struct task_struct *tsk)
27{}
28static inline void acct_clear_integrals(struct task_struct *tsk)
29{}
30#endif /* CONFIG_TASK_XACCT */
31
32#endif
33
34
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h
index 58c961c9e1..5c8473bb68 100644
--- a/include/linux/tty_driver.h
+++ b/include/linux/tty_driver.h
@@ -219,7 +219,8 @@ extern struct list_head tty_drivers;
219 219
220struct tty_driver *alloc_tty_driver(int lines); 220struct tty_driver *alloc_tty_driver(int lines);
221void put_tty_driver(struct tty_driver *driver); 221void put_tty_driver(struct tty_driver *driver);
222void tty_set_operations(struct tty_driver *driver, struct tty_operations *op); 222void tty_set_operations(struct tty_driver *driver,
223 const struct tty_operations *op);
223 224
224/* tty driver magic number */ 225/* tty driver magic number */
225#define TTY_DRIVER_MAGIC 0x5402 226#define TTY_DRIVER_MAGIC 0x5402
diff --git a/include/linux/types.h b/include/linux/types.h
index 3f235660a3..406d4ae576 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -33,6 +33,8 @@ typedef __kernel_clockid_t clockid_t;
33typedef __kernel_mqd_t mqd_t; 33typedef __kernel_mqd_t mqd_t;
34 34
35#ifdef __KERNEL__ 35#ifdef __KERNEL__
36typedef _Bool bool;
37
36typedef __kernel_uid32_t uid_t; 38typedef __kernel_uid32_t uid_t;
37typedef __kernel_gid32_t gid_t; 39typedef __kernel_gid32_t gid_t;
38typedef __kernel_uid16_t uid16_t; 40typedef __kernel_uid16_t uid16_t;
diff --git a/include/linux/uinput.h b/include/linux/uinput.h
index 7168302f98..1fd61eeed6 100644
--- a/include/linux/uinput.h
+++ b/include/linux/uinput.h
@@ -22,12 +22,18 @@
22 * Author: Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org> 22 * Author: Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org>
23 * 23 *
24 * Changes/Revisions: 24 * Changes/Revisions:
25 * 0.3 24/05/2006 (Anssi Hannula <anssi.hannulagmail.com>)
26 * - update ff support for the changes in kernel interface
27 * - add UINPUT_VERSION
25 * 0.2 16/10/2004 (Micah Dowty <micah@navi.cx>) 28 * 0.2 16/10/2004 (Micah Dowty <micah@navi.cx>)
26 * - added force feedback support 29 * - added force feedback support
27 * - added UI_SET_PHYS 30 * - added UI_SET_PHYS
28 * 0.1 20/06/2002 31 * 0.1 20/06/2002
29 * - first public version 32 * - first public version
30 */ 33 */
34
35#define UINPUT_VERSION 3
36
31#ifdef __KERNEL__ 37#ifdef __KERNEL__
32#define UINPUT_MINOR 223 38#define UINPUT_MINOR 223
33#define UINPUT_NAME "uinput" 39#define UINPUT_NAME "uinput"
@@ -45,7 +51,10 @@ struct uinput_request {
45 51
46 union { 52 union {
47 int effect_id; 53 int effect_id;
48 struct ff_effect* effect; 54 struct {
55 struct ff_effect *effect;
56 struct ff_effect *old;
57 } upload;
49 } u; 58 } u;
50}; 59};
51 60
@@ -58,6 +67,7 @@ struct uinput_device {
58 unsigned char head; 67 unsigned char head;
59 unsigned char tail; 68 unsigned char tail;
60 struct input_event buff[UINPUT_BUFFER_SIZE]; 69 struct input_event buff[UINPUT_BUFFER_SIZE];
70 int ff_effects_max;
61 71
62 struct uinput_request *requests[UINPUT_NUM_REQUESTS]; 72 struct uinput_request *requests[UINPUT_NUM_REQUESTS];
63 wait_queue_head_t requests_waitq; 73 wait_queue_head_t requests_waitq;
@@ -69,6 +79,7 @@ struct uinput_ff_upload {
69 int request_id; 79 int request_id;
70 int retval; 80 int retval;
71 struct ff_effect effect; 81 struct ff_effect effect;
82 struct ff_effect old;
72}; 83};
73 84
74struct uinput_ff_erase { 85struct uinput_ff_erase {
@@ -98,33 +109,33 @@ struct uinput_ff_erase {
98#define UI_BEGIN_FF_ERASE _IOWR(UINPUT_IOCTL_BASE, 202, struct uinput_ff_erase) 109#define UI_BEGIN_FF_ERASE _IOWR(UINPUT_IOCTL_BASE, 202, struct uinput_ff_erase)
99#define UI_END_FF_ERASE _IOW(UINPUT_IOCTL_BASE, 203, struct uinput_ff_erase) 110#define UI_END_FF_ERASE _IOW(UINPUT_IOCTL_BASE, 203, struct uinput_ff_erase)
100 111
101/* To write a force-feedback-capable driver, the upload_effect 112/*
113 * To write a force-feedback-capable driver, the upload_effect
102 * and erase_effect callbacks in input_dev must be implemented. 114 * and erase_effect callbacks in input_dev must be implemented.
103 * The uinput driver will generate a fake input event when one of 115 * The uinput driver will generate a fake input event when one of
104 * these callbacks are invoked. The userspace code then uses 116 * these callbacks are invoked. The userspace code then uses
105 * ioctls to retrieve additional parameters and send the return code. 117 * ioctls to retrieve additional parameters and send the return code.
106 * The callback blocks until this return code is sent. 118 * The callback blocks until this return code is sent.
107 * 119 *
108 * The described callback mechanism is only used if EV_FF is set. 120 * The described callback mechanism is only used if ff_effects_max
109 * Otherwise, default implementations of upload_effect and erase_effect 121 * is set.
110 * are used.
111 * 122 *
112 * To implement upload_effect(): 123 * To implement upload_effect():
113 * 1. Wait for an event with type==EV_UINPUT and code==UI_FF_UPLOAD. 124 * 1. Wait for an event with type == EV_UINPUT and code == UI_FF_UPLOAD.
114 * A request ID will be given in 'value'. 125 * A request ID will be given in 'value'.
115 * 2. Allocate a uinput_ff_upload struct, fill in request_id with 126 * 2. Allocate a uinput_ff_upload struct, fill in request_id with
116 * the 'value' from the EV_UINPUT event. 127 * the 'value' from the EV_UINPUT event.
117 * 3. Issue a UI_BEGIN_FF_UPLOAD ioctl, giving it the 128 * 3. Issue a UI_BEGIN_FF_UPLOAD ioctl, giving it the
118 * uinput_ff_upload struct. It will be filled in with the 129 * uinput_ff_upload struct. It will be filled in with the
119 * ff_effect passed to upload_effect(). 130 * ff_effects passed to upload_effect().
120 * 4. Perform the effect upload, and place the modified ff_effect 131 * 4. Perform the effect upload, and place a return code back into
121 * and a return code back into the uinput_ff_upload struct. 132 the uinput_ff_upload struct.
122 * 5. Issue a UI_END_FF_UPLOAD ioctl, also giving it the 133 * 5. Issue a UI_END_FF_UPLOAD ioctl, also giving it the
123 * uinput_ff_upload_effect struct. This will complete execution 134 * uinput_ff_upload_effect struct. This will complete execution
124 * of our upload_effect() handler. 135 * of our upload_effect() handler.
125 * 136 *
126 * To implement erase_effect(): 137 * To implement erase_effect():
127 * 1. Wait for an event with type==EV_UINPUT and code==UI_FF_ERASE. 138 * 1. Wait for an event with type == EV_UINPUT and code == UI_FF_ERASE.
128 * A request ID will be given in 'value'. 139 * A request ID will be given in 'value'.
129 * 2. Allocate a uinput_ff_erase struct, fill in request_id with 140 * 2. Allocate a uinput_ff_erase struct, fill in request_id with
130 * the 'value' from the EV_UINPUT event. 141 * the 'value' from the EV_UINPUT event.
@@ -133,13 +144,13 @@ struct uinput_ff_erase {
133 * effect ID passed to erase_effect(). 144 * effect ID passed to erase_effect().
134 * 4. Perform the effect erasure, and place a return code back 145 * 4. Perform the effect erasure, and place a return code back
135 * into the uinput_ff_erase struct. 146 * into the uinput_ff_erase struct.
136 * and a return code back into the uinput_ff_erase struct.
137 * 5. Issue a UI_END_FF_ERASE ioctl, also giving it the 147 * 5. Issue a UI_END_FF_ERASE ioctl, also giving it the
138 * uinput_ff_erase_effect struct. This will complete execution 148 * uinput_ff_erase_effect struct. This will complete execution
139 * of our erase_effect() handler. 149 * of our erase_effect() handler.
140 */ 150 */
141 151
142/* This is the new event type, used only by uinput. 152/*
153 * This is the new event type, used only by uinput.
143 * 'code' is UI_FF_UPLOAD or UI_FF_ERASE, and 'value' 154 * 'code' is UI_FF_UPLOAD or UI_FF_ERASE, and 'value'
144 * is the unique request ID. This number was picked 155 * is the unique request ID. This number was picked
145 * arbitrarily, above EV_MAX (since the input system 156 * arbitrarily, above EV_MAX (since the input system
diff --git a/include/linux/unistd.h b/include/linux/unistd.h
index c18c60f325..aa8d5b5e2e 100644
--- a/include/linux/unistd.h
+++ b/include/linux/unistd.h
@@ -1,12 +1,8 @@
1#ifndef _LINUX_UNISTD_H_ 1#ifndef _LINUX_UNISTD_H_
2#define _LINUX_UNISTD_H_ 2#define _LINUX_UNISTD_H_
3 3
4#ifdef __KERNEL__
5extern int errno;
6#endif
7
8/* 4/*
9 * Include machine specific syscallX macros 5 * Include machine specific syscall numbers
10 */ 6 */
11#include <asm/unistd.h> 7#include <asm/unistd.h>
12 8
diff --git a/include/linux/unwind.h b/include/linux/unwind.h
index ce48e2cd37..73e1751d03 100644
--- a/include/linux/unwind.h
+++ b/include/linux/unwind.h
@@ -12,8 +12,6 @@
12 * is not much point in implementing the full Dwarf2 unwind API. 12 * is not much point in implementing the full Dwarf2 unwind API.
13 */ 13 */
14 14
15#include <linux/config.h>
16
17struct module; 15struct module;
18 16
19#ifdef CONFIG_STACK_UNWIND 17#ifdef CONFIG_STACK_UNWIND
diff --git a/include/linux/utime.h b/include/linux/utime.h
index c6bf27b789..640be6a195 100644
--- a/include/linux/utime.h
+++ b/include/linux/utime.h
@@ -1,6 +1,8 @@
1#ifndef _LINUX_UTIME_H 1#ifndef _LINUX_UTIME_H
2#define _LINUX_UTIME_H 2#define _LINUX_UTIME_H
3 3
4#include <linux/types.h>
5
4struct utimbuf { 6struct utimbuf {
5 time_t actime; 7 time_t actime;
6 time_t modtime; 8 time_t modtime;
diff --git a/include/linux/utsname.h b/include/linux/utsname.h
index 13e1da0c53..a4555fe375 100644
--- a/include/linux/utsname.h
+++ b/include/linux/utsname.h
@@ -30,7 +30,65 @@ struct new_utsname {
30 char domainname[65]; 30 char domainname[65];
31}; 31};
32 32
33extern struct new_utsname system_utsname; 33#ifdef __KERNEL__
34 34
35extern struct rw_semaphore uts_sem; 35#include <linux/sched.h>
36#include <linux/kref.h>
37#include <linux/nsproxy.h>
38#include <asm/atomic.h>
39
40struct uts_namespace {
41 struct kref kref;
42 struct new_utsname name;
43};
44extern struct uts_namespace init_uts_ns;
45
46static inline void get_uts_ns(struct uts_namespace *ns)
47{
48 kref_get(&ns->kref);
49}
50
51#ifdef CONFIG_UTS_NS
52extern int unshare_utsname(unsigned long unshare_flags,
53 struct uts_namespace **new_uts);
54extern int copy_utsname(int flags, struct task_struct *tsk);
55extern void free_uts_ns(struct kref *kref);
56
57static inline void put_uts_ns(struct uts_namespace *ns)
58{
59 kref_put(&ns->kref, free_uts_ns);
60}
61#else
62static inline int unshare_utsname(unsigned long unshare_flags,
63 struct uts_namespace **new_uts)
64{
65 if (unshare_flags & CLONE_NEWUTS)
66 return -EINVAL;
67
68 return 0;
69}
70
71static inline int copy_utsname(int flags, struct task_struct *tsk)
72{
73 return 0;
74}
75static inline void put_uts_ns(struct uts_namespace *ns)
76{
77}
36#endif 78#endif
79
80static inline struct new_utsname *utsname(void)
81{
82 return &current->nsproxy->uts_ns->name;
83}
84
85static inline struct new_utsname *init_utsname(void)
86{
87 return &init_uts_ns.name;
88}
89
90extern struct rw_semaphore uts_sem;
91
92#endif /* __KERNEL__ */
93
94#endif /* _LINUX_UTSNAME_H */
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 44c59da26e..c5fdf62595 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -276,6 +276,82 @@ struct v4l2_fmtdesc
276 276
277#define V4L2_FMT_FLAG_COMPRESSED 0x0001 277#define V4L2_FMT_FLAG_COMPRESSED 0x0001
278 278
279#if 1
280 /* Experimental Frame Size and frame rate enumeration */
281/*
282 * F R A M E S I Z E E N U M E R A T I O N
283 */
284enum v4l2_frmsizetypes
285{
286 V4L2_FRMSIZE_TYPE_DISCRETE = 1,
287 V4L2_FRMSIZE_TYPE_CONTINUOUS = 2,
288 V4L2_FRMSIZE_TYPE_STEPWISE = 3,
289};
290
291struct v4l2_frmsize_discrete
292{
293 __u32 width; /* Frame width [pixel] */
294 __u32 height; /* Frame height [pixel] */
295};
296
297struct v4l2_frmsize_stepwise
298{
299 __u32 min_width; /* Minimum frame width [pixel] */
300 __u32 max_width; /* Maximum frame width [pixel] */
301 __u32 step_width; /* Frame width step size [pixel] */
302 __u32 min_height; /* Minimum frame height [pixel] */
303 __u32 max_height; /* Maximum frame height [pixel] */
304 __u32 step_height; /* Frame height step size [pixel] */
305};
306
307struct v4l2_frmsizeenum
308{
309 __u32 index; /* Frame size number */
310 __u32 pixel_format; /* Pixel format */
311 __u32 type; /* Frame size type the device supports. */
312
313 union { /* Frame size */
314 struct v4l2_frmsize_discrete discrete;
315 struct v4l2_frmsize_stepwise stepwise;
316 };
317
318 __u32 reserved[2]; /* Reserved space for future use */
319};
320
321/*
322 * F R A M E R A T E E N U M E R A T I O N
323 */
324enum v4l2_frmivaltypes
325{
326 V4L2_FRMIVAL_TYPE_DISCRETE = 1,
327 V4L2_FRMIVAL_TYPE_CONTINUOUS = 2,
328 V4L2_FRMIVAL_TYPE_STEPWISE = 3,
329};
330
331struct v4l2_frmival_stepwise
332{
333 struct v4l2_fract min; /* Minimum frame interval [s] */
334 struct v4l2_fract max; /* Maximum frame interval [s] */
335 struct v4l2_fract step; /* Frame interval step size [s] */
336};
337
338struct v4l2_frmivalenum
339{
340 __u32 index; /* Frame format index */
341 __u32 pixel_format; /* Pixel format */
342 __u32 width; /* Frame width */
343 __u32 height; /* Frame height */
344 __u32 type; /* Frame interval type the device supports. */
345
346 union { /* Frame interval */
347 struct v4l2_fract discrete;
348 struct v4l2_frmival_stepwise stepwise;
349 };
350
351 __u32 reserved[2]; /* Reserved space for future use */
352};
353#endif
354
279/* 355/*
280 * T I M E C O D E 356 * T I M E C O D E
281 */ 357 */
@@ -1249,6 +1325,10 @@ struct v4l2_streamparm
1249#define VIDIOC_G_EXT_CTRLS _IOWR ('V', 71, struct v4l2_ext_controls) 1325#define VIDIOC_G_EXT_CTRLS _IOWR ('V', 71, struct v4l2_ext_controls)
1250#define VIDIOC_S_EXT_CTRLS _IOWR ('V', 72, struct v4l2_ext_controls) 1326#define VIDIOC_S_EXT_CTRLS _IOWR ('V', 72, struct v4l2_ext_controls)
1251#define VIDIOC_TRY_EXT_CTRLS _IOWR ('V', 73, struct v4l2_ext_controls) 1327#define VIDIOC_TRY_EXT_CTRLS _IOWR ('V', 73, struct v4l2_ext_controls)
1328#if 1
1329#define VIDIOC_ENUM_FRAMESIZES _IOWR ('V', 74, struct v4l2_frmsizeenum)
1330#define VIDIOC_ENUM_FRAMEINTERVALS _IOWR ('V', 75, struct v4l2_frmivalenum)
1331#endif
1252 1332
1253#ifdef __OLD_VIDIOC_ 1333#ifdef __OLD_VIDIOC_
1254/* for compatibility, will go away some day */ 1334/* for compatibility, will go away some day */
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h
index 1009d3fe1f..37a1a41f5b 100644
--- a/include/linux/vt_kern.h
+++ b/include/linux/vt_kern.h
@@ -84,4 +84,11 @@ void reset_vc(struct vc_data *vc);
84extern char con_buf[CON_BUF_SIZE]; 84extern char con_buf[CON_BUF_SIZE];
85extern struct semaphore con_buf_sem; 85extern struct semaphore con_buf_sem;
86 86
87struct vt_spawn_console {
88 spinlock_t lock;
89 struct pid *pid;
90 int sig;
91};
92extern struct vt_spawn_console vt_spawn_con;
93
87#endif /* _VT_KERN_H */ 94#endif /* _VT_KERN_H */
diff --git a/include/linux/wavefront.h b/include/linux/wavefront.h
deleted file mode 100644
index 51ab3c933a..0000000000
--- a/include/linux/wavefront.h
+++ /dev/null
@@ -1,675 +0,0 @@
1#ifndef __wavefront_h__
2#define __wavefront_h__
3
4/* WaveFront header file.
5 *
6 * Copyright (C) by Paul Barton-Davis 1998
7 *
8 * This program is distributed under the GNU GENERAL PUBLIC LICENSE (GPL)
9 * Version 2 (June 1991). See the "COPYING" file distributed with this software
10 * for more info.
11 */
12
13#if (!defined(__GNUC__) && !defined(__GNUG__))
14
15 You will not be able to compile this file correctly without gcc, because
16 it is necessary to pack the "wavefront_alias" structure to a size
17 of 22 bytes, corresponding to 16-bit alignment (as would have been
18 the case on the original platform, MS-DOS). If this is not done,
19 then WavePatch-format files cannot be read/written correctly.
20 The method used to do this here ("__attribute__((packed)") is
21 completely compiler dependent.
22
23 All other wavefront_* types end up aligned to 32 bit values and
24 still have the same (correct) size.
25
26#else
27
28 /* However, note that as of G++ 2.7.3.2, g++ was unable to
29 correctly parse *type* __attribute__ tags. It will do the
30 right thing if we use the "packed" attribute on each struct
31 member, which has the same semantics anyway.
32 */
33
34#endif /* __GNUC__ */
35
36/***************************** WARNING ********************************
37 PLEASE DO NOT MODIFY THIS FILE IN ANY WAY THAT AFFECTS ITS ABILITY TO
38 BE USED WITH EITHER C *OR* C++.
39 **********************************************************************/
40
41#ifndef NUM_MIDIKEYS
42#define NUM_MIDIKEYS 128
43#endif /* NUM_MIDIKEYS */
44
45#ifndef NUM_MIDICHANNELS
46#define NUM_MIDICHANNELS 16
47#endif /* NUM_MIDICHANNELS */
48
49/* These are very useful/important. the original wavefront interface
50 was developed on a 16 bit system, where sizeof(int) = 2
51 bytes. Defining things like this makes the code much more portable, and
52 easier to understand without having to toggle back and forth
53 between a 16-bit view of the world and a 32-bit one.
54 */
55
56typedef short INT16;
57typedef unsigned short UINT16;
58typedef int INT32;
59typedef unsigned int UINT32;
60typedef char CHAR8;
61typedef unsigned char UCHAR8;
62
63/* Pseudo-commands not part of the WaveFront command set.
64 These are used for various driver controls and direct
65 hardware control.
66 */
67
68#define WFC_DEBUG_DRIVER 0
69#define WFC_FX_IOCTL 1
70#define WFC_PATCH_STATUS 2
71#define WFC_PROGRAM_STATUS 3
72#define WFC_SAMPLE_STATUS 4
73#define WFC_DISABLE_INTERRUPTS 5
74#define WFC_ENABLE_INTERRUPTS 6
75#define WFC_INTERRUPT_STATUS 7
76#define WFC_ROMSAMPLES_RDONLY 8
77#define WFC_IDENTIFY_SLOT_TYPE 9
78
79/* Wavefront synth commands
80 */
81
82#define WFC_DOWNLOAD_SAMPLE 0x80
83#define WFC_DOWNLOAD_BLOCK 0x81
84#define WFC_DOWNLOAD_MULTISAMPLE 0x82
85#define WFC_DOWNLOAD_SAMPLE_ALIAS 0x83
86#define WFC_DELETE_SAMPLE 0x84
87#define WFC_REPORT_FREE_MEMORY 0x85
88#define WFC_DOWNLOAD_PATCH 0x86
89#define WFC_DOWNLOAD_PROGRAM 0x87
90#define WFC_SET_SYNTHVOL 0x89
91#define WFC_SET_NVOICES 0x8B
92#define WFC_DOWNLOAD_DRUM 0x90
93#define WFC_GET_SYNTHVOL 0x92
94#define WFC_GET_NVOICES 0x94
95#define WFC_DISABLE_CHANNEL 0x9A
96#define WFC_ENABLE_CHANNEL 0x9B
97#define WFC_MISYNTH_OFF 0x9D
98#define WFC_MISYNTH_ON 0x9E
99#define WFC_FIRMWARE_VERSION 0x9F
100#define WFC_GET_NSAMPLES 0xA0
101#define WFC_DISABLE_DRUM_PROGRAM 0xA2
102#define WFC_UPLOAD_PATCH 0xA3
103#define WFC_UPLOAD_PROGRAM 0xA4
104#define WFC_SET_TUNING 0xA6
105#define WFC_GET_TUNING 0xA7
106#define WFC_VMIDI_ON 0xA8
107#define WFC_VMIDI_OFF 0xA9
108#define WFC_MIDI_STATUS 0xAA
109#define WFC_GET_CHANNEL_STATUS 0xAB
110#define WFC_DOWNLOAD_SAMPLE_HEADER 0xAC
111#define WFC_UPLOAD_SAMPLE_HEADER 0xAD
112#define WFC_UPLOAD_MULTISAMPLE 0xAE
113#define WFC_UPLOAD_SAMPLE_ALIAS 0xAF
114#define WFC_IDENTIFY_SAMPLE_TYPE 0xB0
115#define WFC_DOWNLOAD_EDRUM_PROGRAM 0xB1
116#define WFC_UPLOAD_EDRUM_PROGRAM 0xB2
117#define WFC_SET_EDRUM_CHANNEL 0xB3
118#define WFC_INSTOUT_LEVELS 0xB4
119#define WFC_PEAKOUT_LEVELS 0xB5
120#define WFC_REPORT_CHANNEL_PROGRAMS 0xB6
121#define WFC_HARDWARE_VERSION 0xCF
122#define WFC_UPLOAD_SAMPLE_PARAMS 0xD7
123#define WFC_DOWNLOAD_OS 0xF1
124#define WFC_NOOP 0xFF
125
126#define WF_MAX_SAMPLE 512
127#define WF_MAX_PATCH 256
128#define WF_MAX_PROGRAM 128
129
130#define WF_SECTION_MAX 44 /* longest OS section length */
131
132/* # of bytes we send to the board when sending it various kinds of
133 substantive data, such as samples, patches and programs.
134*/
135
136#define WF_PROGRAM_BYTES 32
137#define WF_PATCH_BYTES 132
138#define WF_SAMPLE_BYTES 27
139#define WF_SAMPLE_HDR_BYTES 25
140#define WF_ALIAS_BYTES 25
141#define WF_DRUM_BYTES 9
142#define WF_MSAMPLE_BYTES 259 /* (MIDI_KEYS * 2) + 3 */
143
144#define WF_ACK 0x80
145#define WF_DMA_ACK 0x81
146
147/* OR-values for MIDI status bits */
148
149#define WF_MIDI_VIRTUAL_ENABLED 0x1
150#define WF_MIDI_VIRTUAL_IS_EXTERNAL 0x2
151#define WF_MIDI_IN_TO_SYNTH_DISABLED 0x4
152
153/* slot indexes for struct address_info: makes code a little more mnemonic */
154
155#define WF_SYNTH_SLOT 0
156#define WF_INTERNAL_MIDI_SLOT 1
157#define WF_EXTERNAL_MIDI_SLOT 2
158
159/* Magic MIDI bytes used to switch I/O streams on the ICS2115 MPU401
160 emulation. Note these NEVER show up in output from the device and
161 should NEVER be used in input unless Virtual MIDI mode has been
162 disabled. If they do show up as input, the results are unpredictable.
163*/
164
165#define WF_EXTERNAL_SWITCH 0xFD
166#define WF_INTERNAL_SWITCH 0xF9
167
168/* Debugging flags */
169
170#define WF_DEBUG_CMD 0x1
171#define WF_DEBUG_DATA 0x2
172#define WF_DEBUG_LOAD_PATCH 0x4
173#define WF_DEBUG_IO 0x8
174
175/* WavePatch file format stuff */
176
177#define WF_WAVEPATCH_VERSION 120; /* Current version number (1.2) */
178#define WF_MAX_COMMENT 64 /* Comment length */
179#define WF_NUM_LAYERS 4
180#define WF_NAME_LENGTH 32
181#define WF_SOURCE_LENGTH 260
182
183#define BankFileID "Bank"
184#define DrumkitFileID "DrumKit"
185#define ProgramFileID "Program"
186
187struct wf_envelope
188{
189 UCHAR8 attack_time:7;
190 UCHAR8 Unused1:1;
191
192 UCHAR8 decay1_time:7;
193 UCHAR8 Unused2:1;
194
195 UCHAR8 decay2_time:7;
196 UCHAR8 Unused3:1;
197
198 UCHAR8 sustain_time:7;
199 UCHAR8 Unused4:1;
200
201 UCHAR8 release_time:7;
202 UCHAR8 Unused5:1;
203
204 UCHAR8 release2_time:7;
205 UCHAR8 Unused6:1;
206
207 CHAR8 attack_level;
208 CHAR8 decay1_level;
209 CHAR8 decay2_level;
210 CHAR8 sustain_level;
211 CHAR8 release_level;
212
213 UCHAR8 attack_velocity:7;
214 UCHAR8 Unused7:1;
215
216 UCHAR8 volume_velocity:7;
217 UCHAR8 Unused8:1;
218
219 UCHAR8 keyboard_scaling:7;
220 UCHAR8 Unused9:1;
221};
222typedef struct wf_envelope wavefront_envelope;
223
224struct wf_lfo
225{
226 UCHAR8 sample_number;
227
228 UCHAR8 frequency:7;
229 UCHAR8 Unused1:1;
230
231 UCHAR8 am_src:4;
232 UCHAR8 fm_src:4;
233
234 CHAR8 fm_amount;
235 CHAR8 am_amount;
236 CHAR8 start_level;
237 CHAR8 end_level;
238
239 UCHAR8 ramp_delay:7;
240 UCHAR8 wave_restart:1; /* for LFO2 only */
241
242 UCHAR8 ramp_time:7;
243 UCHAR8 Unused2:1;
244};
245typedef struct wf_lfo wavefront_lfo;
246
247struct wf_patch
248{
249 INT16 frequency_bias; /* ** THIS IS IN MOTOROLA FORMAT!! ** */
250
251 UCHAR8 amplitude_bias:7;
252 UCHAR8 Unused1:1;
253
254 UCHAR8 portamento:7;
255 UCHAR8 Unused2:1;
256
257 UCHAR8 sample_number;
258
259 UCHAR8 pitch_bend:4;
260 UCHAR8 sample_msb:1;
261 UCHAR8 Unused3:3;
262
263 UCHAR8 mono:1;
264 UCHAR8 retrigger:1;
265 UCHAR8 nohold:1;
266 UCHAR8 restart:1;
267 UCHAR8 filterconfig:2; /* SDK says "not used" */
268 UCHAR8 reuse:1;
269 UCHAR8 reset_lfo:1;
270
271 UCHAR8 fm_src2:4;
272 UCHAR8 fm_src1:4;
273
274 CHAR8 fm_amount1;
275 CHAR8 fm_amount2;
276
277 UCHAR8 am_src:4;
278 UCHAR8 Unused4:4;
279
280 CHAR8 am_amount;
281
282 UCHAR8 fc1_mode:4;
283 UCHAR8 fc2_mode:4;
284
285 CHAR8 fc1_mod_amount;
286 CHAR8 fc1_keyboard_scaling;
287 CHAR8 fc1_bias;
288 CHAR8 fc2_mod_amount;
289 CHAR8 fc2_keyboard_scaling;
290 CHAR8 fc2_bias;
291
292 UCHAR8 randomizer:7;
293 UCHAR8 Unused5:1;
294
295 struct wf_envelope envelope1;
296 struct wf_envelope envelope2;
297 struct wf_lfo lfo1;
298 struct wf_lfo lfo2;
299};
300typedef struct wf_patch wavefront_patch;
301
302struct wf_layer
303{
304 UCHAR8 patch_number;
305
306 UCHAR8 mix_level:7;
307 UCHAR8 mute:1;
308
309 UCHAR8 split_point:7;
310 UCHAR8 play_below:1;
311
312 UCHAR8 pan_mod_src:2;
313 UCHAR8 pan_or_mod:1;
314 UCHAR8 pan:4;
315 UCHAR8 split_type:1;
316};
317typedef struct wf_layer wavefront_layer;
318
319struct wf_program
320{
321 struct wf_layer layer[WF_NUM_LAYERS];
322};
323typedef struct wf_program wavefront_program;
324
325struct wf_sample_offset
326{
327 INT32 Fraction:4;
328 INT32 Integer:20;
329 INT32 Unused:8;
330};
331typedef struct wf_sample_offset wavefront_sample_offset;
332
333/* Sample slot types */
334
335#define WF_ST_SAMPLE 0
336#define WF_ST_MULTISAMPLE 1
337#define WF_ST_ALIAS 2
338#define WF_ST_EMPTY 3
339
340/* pseudo's */
341
342#define WF_ST_DRUM 4
343#define WF_ST_PROGRAM 5
344#define WF_ST_PATCH 6
345#define WF_ST_SAMPLEHDR 7
346
347#define WF_ST_MASK 0xf
348
349/* Flags for slot status. These occupy the upper bits of the same byte
350 as a sample type.
351*/
352
353#define WF_SLOT_USED 0x80 /* XXX don't rely on this being accurate */
354#define WF_SLOT_FILLED 0x40
355#define WF_SLOT_ROM 0x20
356
357#define WF_SLOT_MASK 0xf0
358
359/* channel constants */
360
361#define WF_CH_MONO 0
362#define WF_CH_LEFT 1
363#define WF_CH_RIGHT 2
364
365/* Sample formats */
366
367#define LINEAR_16BIT 0
368#define WHITE_NOISE 1
369#define LINEAR_8BIT 2
370#define MULAW_8BIT 3
371
372#define WF_SAMPLE_IS_8BIT(smpl) ((smpl)->SampleResolution&2)
373
374
375/*
376
377 Because most/all of the sample data we pass in via pointers has
378 never been copied (just mmap-ed into user space straight from the
379 disk), it would be nice to allow handling of multi-channel sample
380 data without forcing user-level extraction of the relevant bytes.
381
382 So, we need a way of specifying which channel to use (the WaveFront
383 only handles mono samples in a given slot), and the only way to do
384 this without using some struct other than wavefront_sample as the
385 interface is the awful hack of using the unused bits in a
386 wavefront_sample:
387
388 Val Meaning
389 --- -------
390 0 no channel selection (use channel 1, sample is MONO)
391 1 use first channel, and skip one
392 2 use second channel, and skip one
393 3 use third channel, and skip two
394 4 use fourth channel, skip three
395 5 use fifth channel, skip four
396 6 use six channel, skip five
397
398
399 This can handle up to 4 channels, and anyone downloading >4 channels
400 of sample data just to select one of them needs to find some tools
401 like sox ...
402
403 NOTE: values 0, 1 and 2 correspond to WF_CH_* above. This is
404 important.
405
406*/
407
408#define WF_SET_CHANNEL(samp,chn) \
409 (samp)->Unused1 = chn & 0x1; \
410 (samp)->Unused2 = chn & 0x2; \
411 (samp)->Unused3 = chn & 0x4
412
413#define WF_GET_CHANNEL(samp) \
414 (((samp)->Unused3 << 2)|((samp)->Unused2<<1)|(samp)->Unused1)
415
416typedef struct wf_sample {
417 struct wf_sample_offset sampleStartOffset;
418 struct wf_sample_offset loopStartOffset;
419 struct wf_sample_offset loopEndOffset;
420 struct wf_sample_offset sampleEndOffset;
421 INT16 FrequencyBias;
422 UCHAR8 SampleResolution:2; /* sample_format */
423 UCHAR8 Unused1:1;
424 UCHAR8 Loop:1;
425 UCHAR8 Bidirectional:1;
426 UCHAR8 Unused2:1;
427 UCHAR8 Reverse:1;
428 UCHAR8 Unused3:1;
429} wavefront_sample;
430
431typedef struct wf_multisample {
432 INT16 NumberOfSamples; /* log2 of the number of samples */
433 INT16 SampleNumber[NUM_MIDIKEYS];
434} wavefront_multisample;
435
436typedef struct wf_alias {
437 INT16 OriginalSample;
438
439 struct wf_sample_offset sampleStartOffset;
440 struct wf_sample_offset loopStartOffset;
441 struct wf_sample_offset sampleEndOffset;
442 struct wf_sample_offset loopEndOffset;
443
444 INT16 FrequencyBias;
445
446 UCHAR8 SampleResolution:2;
447 UCHAR8 Unused1:1;
448 UCHAR8 Loop:1;
449 UCHAR8 Bidirectional:1;
450 UCHAR8 Unused2:1;
451 UCHAR8 Reverse:1;
452 UCHAR8 Unused3:1;
453
454 /* This structure is meant to be padded only to 16 bits on their
455 original. Of course, whoever wrote their documentation didn't
456 realize that sizeof(struct) can be >=
457 sum(sizeof(struct-fields)) and so thought that giving a C level
458 description of the structs used in WavePatch files was
459 sufficient. I suppose it was, as long as you remember the
460 standard 16->32 bit issues.
461 */
462
463 UCHAR8 sixteen_bit_padding;
464} __attribute__((packed)) wavefront_alias;
465
466typedef struct wf_drum {
467 UCHAR8 PatchNumber;
468 UCHAR8 MixLevel:7;
469 UCHAR8 Unmute:1;
470 UCHAR8 Group:4;
471 UCHAR8 Unused1:4;
472 UCHAR8 PanModSource:2;
473 UCHAR8 PanModulated:1;
474 UCHAR8 PanAmount:4;
475 UCHAR8 Unused2:1;
476} wavefront_drum;
477
478typedef struct wf_drumkit {
479 struct wf_drum drum[NUM_MIDIKEYS];
480} wavefront_drumkit;
481
482typedef struct wf_channel_programs {
483 UCHAR8 Program[NUM_MIDICHANNELS];
484} wavefront_channel_programs;
485
486/* How to get MIDI channel status from the data returned by
487 a WFC_GET_CHANNEL_STATUS command (a struct wf_channel_programs)
488*/
489
490#define WF_CHANNEL_STATUS(ch,wcp) (wcp)[(ch/7)] & (1<<((ch)%7))
491
492typedef union wf_any {
493 wavefront_sample s;
494 wavefront_multisample ms;
495 wavefront_alias a;
496 wavefront_program pr;
497 wavefront_patch p;
498 wavefront_drum d;
499} wavefront_any;
500
501/* Hannu Solvainen hoped that his "patch_info" struct in soundcard.h
502 might work for other wave-table based patch loading situations.
503 Alas, his fears were correct. The WaveFront doesn't even come with
504 just "patches", but several different kind of structures that
505 control the sound generation process.
506 */
507
508typedef struct wf_patch_info {
509
510 /* the first two fields are used by the OSS "patch loading" interface
511 only, and are unused by the current user-level library.
512 */
513
514 INT16 key; /* Use WAVEFRONT_PATCH here */
515 UINT16 devno; /* fill in when sending */
516 UCHAR8 subkey; /* WF_ST_{SAMPLE,ALIAS,etc.} */
517
518#define WAVEFRONT_FIND_FREE_SAMPLE_SLOT 999
519
520 UINT16 number; /* patch/sample/prog number */
521
522 UINT32 size; /* size of any data included in
523 one of the fields in `hdrptr', or
524 as `dataptr'.
525
526 NOTE: for actual samples, this is
527 the size of the *SELECTED CHANNEL*
528 even if more data is actually available.
529
530 So, a stereo sample (2 channels) of
531 6000 bytes total has `size' = 3000.
532
533 See the macros and comments for
534 WF_{GET,SET}_CHANNEL above.
535
536 */
537 wavefront_any __user *hdrptr; /* user-space ptr to hdr bytes */
538 UINT16 __user *dataptr; /* actual sample data */
539
540 wavefront_any hdr; /* kernel-space copy of hdr bytes */
541} wavefront_patch_info;
542
543/* The maximum number of bytes we will ever move to or from user space
544 in response to a WFC_* command. This obviously doesn't cover
545 actual sample data.
546*/
547
548#define WF_MAX_READ sizeof(wavefront_multisample)
549#define WF_MAX_WRITE sizeof(wavefront_multisample)
550
551/*
552 This allows us to execute any WF command except the download/upload
553 ones, which are handled differently due to copyin/copyout issues as
554 well as data-nybbling to/from the card.
555 */
556
557typedef struct wavefront_control {
558 int cmd; /* WFC_* */
559 char status; /* return status to user-space */
560 unsigned char rbuf[WF_MAX_READ]; /* bytes read from card */
561 unsigned char wbuf[WF_MAX_WRITE]; /* bytes written to card */
562} wavefront_control;
563
564#define WFCTL_WFCMD 0x1
565#define WFCTL_LOAD_SPP 0x2
566
567/* Modulator table */
568
569#define WF_MOD_LFO1 0
570#define WF_MOD_LFO2 1
571#define WF_MOD_ENV1 2
572#define WF_MOD_ENV2 3
573#define WF_MOD_KEYBOARD 4
574#define WF_MOD_LOGKEY 5
575#define WF_MOD_VELOCITY 6
576#define WF_MOD_LOGVEL 7
577#define WF_MOD_RANDOM 8
578#define WF_MOD_PRESSURE 9
579#define WF_MOD_MOD_WHEEL 10
580#define WF_MOD_1 WF_MOD_MOD_WHEEL
581#define WF_MOD_BREATH 11
582#define WF_MOD_2 WF_MOD_BREATH
583#define WF_MOD_FOOT 12
584#define WF_MOD_4 WF_MOD_FOOT
585#define WF_MOD_VOLUME 13
586#define WF_MOD_7 WF_MOD_VOLUME
587#define WF_MOD_PAN 14
588#define WF_MOD_10 WF_MOD_PAN
589#define WF_MOD_EXPR 15
590#define WF_MOD_11 WF_MOD_EXPR
591
592/* FX-related material */
593
594typedef struct wf_fx_info {
595 int request; /* see list below */
596 int data[4]; /* we don't need much */
597} wavefront_fx_info;
598
599/* support for each of these will be forthcoming once I or someone
600 else has figured out which of the addresses on page 6 and page 7 of
601 the YSS225 control each parameter. Incidentally, these come from
602 the Windows driver interface, but again, Turtle Beach didn't
603 document the API to use them.
604*/
605
606#define WFFX_SETOUTGAIN 0
607#define WFFX_SETSTEREOOUTGAIN 1
608#define WFFX_SETREVERBIN1GAIN 2
609#define WFFX_SETREVERBIN2GAIN 3
610#define WFFX_SETREVERBIN3GAIN 4
611#define WFFX_SETCHORUSINPORT 5
612#define WFFX_SETREVERBIN1PORT 6
613#define WFFX_SETREVERBIN2PORT 7
614#define WFFX_SETREVERBIN3PORT 8
615#define WFFX_SETEFFECTPORT 9
616#define WFFX_SETAUXPORT 10
617#define WFFX_SETREVERBTYPE 11
618#define WFFX_SETREVERBDELAY 12
619#define WFFX_SETCHORUSLFO 13
620#define WFFX_SETCHORUSPMD 14
621#define WFFX_SETCHORUSAMD 15
622#define WFFX_SETEFFECT 16
623#define WFFX_SETBASEALL 17
624#define WFFX_SETREVERBALL 18
625#define WFFX_SETCHORUSALL 20
626#define WFFX_SETREVERBDEF 22
627#define WFFX_SETCHORUSDEF 23
628#define WFFX_DELAYSETINGAIN 24
629#define WFFX_DELAYSETFBGAIN 25
630#define WFFX_DELAYSETFBLPF 26
631#define WFFX_DELAYSETGAIN 27
632#define WFFX_DELAYSETTIME 28
633#define WFFX_DELAYSETFBTIME 29
634#define WFFX_DELAYSETALL 30
635#define WFFX_DELAYSETDEF 32
636#define WFFX_SDELAYSETINGAIN 33
637#define WFFX_SDELAYSETFBGAIN 34
638#define WFFX_SDELAYSETFBLPF 35
639#define WFFX_SDELAYSETGAIN 36
640#define WFFX_SDELAYSETTIME 37
641#define WFFX_SDELAYSETFBTIME 38
642#define WFFX_SDELAYSETALL 39
643#define WFFX_SDELAYSETDEF 41
644#define WFFX_DEQSETINGAIN 42
645#define WFFX_DEQSETFILTER 43
646#define WFFX_DEQSETALL 44
647#define WFFX_DEQSETDEF 46
648#define WFFX_MUTE 47
649#define WFFX_FLANGESETBALANCE 48
650#define WFFX_FLANGESETDELAY 49
651#define WFFX_FLANGESETDWFFX_TH 50
652#define WFFX_FLANGESETFBGAIN 51
653#define WFFX_FLANGESETINGAIN 52
654#define WFFX_FLANGESETLFO 53
655#define WFFX_FLANGESETALL 54
656#define WFFX_FLANGESETDEF 56
657#define WFFX_PITCHSETSHIFT 57
658#define WFFX_PITCHSETBALANCE 58
659#define WFFX_PITCHSETALL 59
660#define WFFX_PITCHSETDEF 61
661#define WFFX_SRSSETINGAIN 62
662#define WFFX_SRSSETSPACE 63
663#define WFFX_SRSSETCENTER 64
664#define WFFX_SRSSETGAIN 65
665#define WFFX_SRSSETMODE 66
666#define WFFX_SRSSETDEF 68
667
668/* Allow direct user-space control over FX memory/coefficient data.
669 In theory this could be used to download the FX microprogram,
670 but it would be a little slower, and involve some weird code.
671 */
672
673#define WFFX_MEMSET 69
674
675#endif /* __wavefront_h__ */
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 4f4d98addb..a341c80328 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/linux/writeback.h. 2 * include/linux/writeback.h
3 */ 3 */
4#ifndef WRITEBACK_H 4#ifndef WRITEBACK_H
5#define WRITEBACK_H 5#define WRITEBACK_H
diff --git a/include/media/audiochip.h b/include/media/audiochip.h
index 1fd4a22075..db8823d45a 100644
--- a/include/media/audiochip.h
+++ b/include/media/audiochip.h
@@ -18,7 +18,9 @@ enum audiochip {
18 AUDIO_CHIP_TDA9874, 18 AUDIO_CHIP_TDA9874,
19 AUDIO_CHIP_PIC16C54, 19 AUDIO_CHIP_PIC16C54,
20 /* Provided by msp3400.c */ 20 /* Provided by msp3400.c */
21 AUDIO_CHIP_MSP34XX 21 AUDIO_CHIP_MSP34XX,
22 /* Provided by wm8775.c */
23 AUDIO_CHIP_WM8775
22}; 24};
23 25
24#endif /* AUDIOCHIP_H */ 26#endif /* AUDIOCHIP_H */
diff --git a/include/mtd/Kbuild b/include/mtd/Kbuild
index 13e7a3c6d7..e0fe92b03a 100644
--- a/include/mtd/Kbuild
+++ b/include/mtd/Kbuild
@@ -1,6 +1,5 @@
1header-y += inftl-user.h 1header-y += inftl-user.h
2header-y += jffs2-user.h 2header-y += jffs2-user.h
3header-y += mtd-abi.h
3header-y += mtd-user.h 4header-y += mtd-user.h
4header-y += nftl-user.h 5header-y += nftl-user.h
5
6unifdef-y += mtd-abi.h
diff --git a/include/mtd/mtd-abi.h b/include/mtd/mtd-abi.h
index b0a67b7ffd..f913c30d7b 100644
--- a/include/mtd/mtd-abi.h
+++ b/include/mtd/mtd-abi.h
@@ -7,12 +7,6 @@
7#ifndef __MTD_ABI_H__ 7#ifndef __MTD_ABI_H__
8#define __MTD_ABI_H__ 8#define __MTD_ABI_H__
9 9
10#ifndef __KERNEL__
11/* Urgh. The whole point of splitting this out into
12 separate files was to avoid #ifdef __KERNEL__ */
13#define __user
14#endif
15
16struct erase_info_user { 10struct erase_info_user {
17 uint32_t start; 11 uint32_t start;
18 uint32_t length; 12 uint32_t length;
diff --git a/include/net/genetlink.h b/include/net/genetlink.h
index 4a38d85e4e..b619314218 100644
--- a/include/net/genetlink.h
+++ b/include/net/genetlink.h
@@ -169,4 +169,22 @@ static inline int genlmsg_len(const struct genlmsghdr *gnlh)
169 return (nlh->nlmsg_len - GENL_HDRLEN - NLMSG_HDRLEN); 169 return (nlh->nlmsg_len - GENL_HDRLEN - NLMSG_HDRLEN);
170} 170}
171 171
172/**
173 * genlmsg_msg_size - length of genetlink message not including padding
174 * @payload: length of message payload
175 */
176static inline int genlmsg_msg_size(int payload)
177{
178 return GENL_HDRLEN + payload;
179}
180
181/**
182 * genlmsg_total_size - length of genetlink message including padding
183 * @payload: length of message payload
184 */
185static inline int genlmsg_total_size(int payload)
186{
187 return NLMSG_ALIGN(genlmsg_msg_size(payload));
188}
189
172#endif /* __NET_GENERIC_NETLINK_H */ 190#endif /* __NET_GENERIC_NETLINK_H */
diff --git a/include/net/sock.h b/include/net/sock.h
index edd4d73ce7..40bb90ebb2 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -665,7 +665,6 @@ struct sock_iocb {
665 struct sock *sk; 665 struct sock *sk;
666 struct scm_cookie *scm; 666 struct scm_cookie *scm;
667 struct msghdr *msg, async_msg; 667 struct msghdr *msg, async_msg;
668 struct iovec async_iov;
669 struct kiocb *kiocb; 668 struct kiocb *kiocb;
670}; 669};
671 670
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 60d40b34ef..afaf3e88e0 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -347,6 +347,7 @@ struct snd_pcm_substream {
347 int number; 347 int number;
348 char name[32]; /* substream name */ 348 char name[32]; /* substream name */
349 int stream; /* stream (direction) */ 349 int stream; /* stream (direction) */
350 char latency_id[20]; /* latency identifier */
350 size_t buffer_bytes_max; /* limit ring buffer size */ 351 size_t buffer_bytes_max; /* limit ring buffer size */
351 struct snd_dma_buffer dma_buffer; 352 struct snd_dma_buffer dma_buffer;
352 unsigned int dma_buf_id; 353 unsigned int dma_buf_id;
diff --git a/include/video/s1d13xxxfb.h b/include/video/s1d13xxxfb.h
index f06cc88607..c99d261df8 100644
--- a/include/video/s1d13xxxfb.h
+++ b/include/video/s1d13xxxfb.h
@@ -1,4 +1,4 @@
1/* drivers/video/s1d3xxxfb.h 1/* include/video/s1d13xxxfb.h
2 * 2 *
3 * (c) 2004 Simtec Electronics 3 * (c) 2004 Simtec Electronics
4 * (c) 2005 Thibaut VARENE <varenet@parisc-linux.org> 4 * (c) 2005 Thibaut VARENE <varenet@parisc-linux.org>
diff --git a/include/video/sstfb.h b/include/video/sstfb.h
index 3570f9c9b1..5dbf5e7e50 100644
--- a/include/video/sstfb.h
+++ b/include/video/sstfb.h
@@ -68,10 +68,6 @@
68# define print_var(X,Y...) 68# define print_var(X,Y...)
69#endif 69#endif
70 70
71#define eprintk(X...) printk(KERN_ERR "sstfb: " X)
72#define iprintk(X...) printk(KERN_INFO "sstfb: " X)
73#define wprintk(X...) printk(KERN_WARNING "sstfb: " X)
74
75#define BIT(x) (1ul<<(x)) 71#define BIT(x) (1ul<<(x))
76#define POW2(x) (1ul<<(x)) 72#define POW2(x) (1ul<<(x))
77 73