aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor@insightbb.com>2006-09-19 01:56:44 -0400
committerDmitry Torokhov <dtor@insightbb.com>2006-09-19 01:56:44 -0400
commit0612ec48762bf8712db1925b2e67246d2237ebab (patch)
tree01b0d69c9c9915015c0f23ad4263646dd5413e99 /include
parent4263cf0fac28122c8381b6f4f9441a43cd93c81f (diff)
parent47a5c6fa0e204a2b63309c648bb2fde36836c826 (diff)
Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acconfig.h2
-rw-r--r--include/acpi/acinterp.h10
-rw-r--r--include/acpi/aclocal.h4
-rw-r--r--include/acpi/acmacros.h8
-rw-r--r--include/acpi/acresrc.h8
-rw-r--r--include/acpi/platform/aclinux.h27
-rw-r--r--include/asm-alpha/Kbuild2
-rw-r--r--include/asm-alpha/barrier.h3
-rw-r--r--include/asm-alpha/compiler.h3
-rw-r--r--include/asm-alpha/page.h6
-rw-r--r--include/asm-arm/arch-at91rm9200/irqs.h8
-rw-r--r--include/asm-arm/arch-iop3xx/iop331-irqs.h4
-rw-r--r--include/asm-arm/arch-omap/clock.h2
-rw-r--r--include/asm-arm/arch-pxa/ssp.h4
-rw-r--r--include/asm-arm/arch-s3c2410/anubis-cpld.h3
-rw-r--r--include/asm-arm/arch-s3c2410/anubis-irq.h4
-rw-r--r--include/asm-arm/arch-s3c2410/anubis-map.h2
-rw-r--r--include/asm-arm/arch-s3c2410/audio.h4
-rw-r--r--include/asm-arm/arch-s3c2410/bast-cpld.h5
-rw-r--r--include/asm-arm/arch-s3c2410/bast-irq.h6
-rw-r--r--include/asm-arm/arch-s3c2410/bast-map.h4
-rw-r--r--include/asm-arm/arch-s3c2410/bast-pmu.h3
-rw-r--r--include/asm-arm/arch-s3c2410/debug-macro.S3
-rw-r--r--include/asm-arm/arch-s3c2410/dma.h151
-rw-r--r--include/asm-arm/arch-s3c2410/fb.h7
-rw-r--r--include/asm-arm/arch-s3c2410/hardware.h10
-rw-r--r--include/asm-arm/arch-s3c2410/idle.h4
-rw-r--r--include/asm-arm/arch-s3c2410/iic.h4
-rw-r--r--include/asm-arm/arch-s3c2410/io.h8
-rw-r--r--include/asm-arm/arch-s3c2410/irqs.h9
-rw-r--r--include/asm-arm/arch-s3c2410/map.h7
-rw-r--r--include/asm-arm/arch-s3c2410/memory.h14
-rw-r--r--include/asm-arm/arch-s3c2410/nand.h3
-rw-r--r--include/asm-arm/arch-s3c2410/osiris-map.h2
-rw-r--r--include/asm-arm/arch-s3c2410/regs-adc.h3
-rw-r--r--include/asm-arm/arch-s3c2410/regs-clock.h12
-rw-r--r--include/asm-arm/arch-s3c2410/regs-gpio.h15
-rw-r--r--include/asm-arm/arch-s3c2410/regs-gpioj.h4
-rw-r--r--include/asm-arm/arch-s3c2410/regs-iic.h4
-rw-r--r--include/asm-arm/arch-s3c2410/regs-iis.h12
-rw-r--r--include/asm-arm/arch-s3c2410/regs-irq.h9
-rw-r--r--include/asm-arm/arch-s3c2410/regs-lcd.h8
-rw-r--r--include/asm-arm/arch-s3c2410/regs-mem.h6
-rw-r--r--include/asm-arm/arch-s3c2410/regs-nand.h4
-rw-r--r--include/asm-arm/arch-s3c2410/regs-power.h34
-rw-r--r--include/asm-arm/arch-s3c2410/regs-rtc.h7
-rw-r--r--include/asm-arm/arch-s3c2410/regs-sdi.h5
-rw-r--r--include/asm-arm/arch-s3c2410/regs-serial.h5
-rw-r--r--include/asm-arm/arch-s3c2410/regs-spi.h8
-rw-r--r--include/asm-arm/arch-s3c2410/regs-timer.h7
-rw-r--r--include/asm-arm/arch-s3c2410/regs-udc.h8
-rw-r--r--include/asm-arm/arch-s3c2410/regs-watchdog.h7
-rw-r--r--include/asm-arm/arch-s3c2410/system.h9
-rw-r--r--include/asm-arm/arch-s3c2410/timex.h6
-rw-r--r--include/asm-arm/arch-s3c2410/uncompress.h9
-rw-r--r--include/asm-arm/arch-s3c2410/usb-control.h5
-rw-r--r--include/asm-arm/arch-s3c2410/vmalloc.h6
-rw-r--r--include/asm-arm/arch-s3c2410/vr1000-cpld.h4
-rw-r--r--include/asm-arm/arch-s3c2410/vr1000-irq.h6
-rw-r--r--include/asm-arm/arch-s3c2410/vr1000-map.h6
-rw-r--r--include/asm-arm/arch-versatile/platform.h2
-rw-r--r--include/asm-arm/cacheflush.h18
-rw-r--r--include/asm-arm/elf.h2
-rw-r--r--include/asm-arm/hardware/ssp.h4
-rw-r--r--include/asm-arm/io.h7
-rw-r--r--include/asm-arm/page.h4
-rw-r--r--include/asm-arm/procinfo.h1
-rw-r--r--include/asm-arm/spinlock.h16
-rw-r--r--include/asm-arm/system.h1
-rw-r--r--include/asm-arm26/system.h1
-rw-r--r--include/asm-cris/system.h1
-rw-r--r--include/asm-frv/elf.h6
-rw-r--r--include/asm-frv/gdb-stub.h22
-rw-r--r--include/asm-frv/processor.h3
-rw-r--r--include/asm-frv/ptrace.h12
-rw-r--r--include/asm-frv/registers.h97
-rw-r--r--include/asm-frv/system.h1
-rw-r--r--include/asm-frv/thread_info.h24
-rw-r--r--include/asm-generic/Kbuild.asm7
-rw-r--r--include/asm-generic/audit_read.h8
-rw-r--r--include/asm-generic/audit_write.h11
-rw-r--r--include/asm-h8300/page.h1
-rw-r--r--include/asm-h8300/processor.h3
-rw-r--r--include/asm-h8300/system.h1
-rw-r--r--include/asm-i386/Kbuild4
-rw-r--r--include/asm-i386/alternative.h20
-rw-r--r--include/asm-i386/atomic.h30
-rw-r--r--include/asm-i386/elf.h10
-rw-r--r--include/asm-i386/futex.h10
-rw-r--r--include/asm-i386/kprobes.h1
-rw-r--r--include/asm-i386/local.h14
-rw-r--r--include/asm-i386/mach-default/mach_mpspec.h4
-rw-r--r--include/asm-i386/mmzone.h2
-rw-r--r--include/asm-i386/posix_types.h4
-rw-r--r--include/asm-i386/rwlock.h28
-rw-r--r--include/asm-i386/rwsem.h35
-rw-r--r--include/asm-i386/semaphore.h8
-rw-r--r--include/asm-i386/setup.h2
-rw-r--r--include/asm-i386/signal.h4
-rw-r--r--include/asm-i386/spinlock.h27
-rw-r--r--include/asm-i386/system.h31
-rw-r--r--include/asm-i386/thread_info.h7
-rw-r--r--include/asm-i386/unwind.h1
-rw-r--r--include/asm-ia64/Kbuild2
-rw-r--r--include/asm-ia64/io.h2
-rw-r--r--include/asm-ia64/kprobes.h1
-rw-r--r--include/asm-ia64/meminit.h7
-rw-r--r--include/asm-ia64/mman.h8
-rw-r--r--include/asm-ia64/page.h4
-rw-r--r--include/asm-ia64/pal.h7
-rw-r--r--include/asm-ia64/ptrace.h10
-rw-r--r--include/asm-ia64/sn/sn_sal.h6
-rw-r--r--include/asm-ia64/sn/xp.h22
-rw-r--r--include/asm-ia64/sn/xpc.h8
-rw-r--r--include/asm-ia64/system.h5
-rw-r--r--include/asm-ia64/unistd.h3
-rw-r--r--include/asm-ia64/ustack.h7
-rw-r--r--include/asm-m32r/system.h1
-rw-r--r--include/asm-m68k/oplib.h5
-rw-r--r--include/asm-m68k/system.h1
-rw-r--r--include/asm-m68knommu/processor.h3
-rw-r--r--include/asm-m68knommu/system.h1
-rw-r--r--include/asm-m68knommu/uaccess.h12
-rw-r--r--include/asm-mips/apm.h1
-rw-r--r--include/asm-mips/atomic.h2
-rw-r--r--include/asm-mips/bitops.h2
-rw-r--r--include/asm-mips/cpu-features.h10
-rw-r--r--include/asm-mips/cpu.h2
-rw-r--r--include/asm-mips/inst.h2
-rw-r--r--include/asm-mips/irqflags.h (renamed from include/asm-mips/interrupt.h)70
-rw-r--r--include/asm-mips/mach-cobalt/cpu-feature-overrides.h2
-rw-r--r--include/asm-mips/mach-dec/mc146818rtc.h2
-rw-r--r--include/asm-mips/mach-excite/cpu-feature-overrides.h2
-rw-r--r--include/asm-mips/mach-excite/excite.h1
-rw-r--r--include/asm-mips/mach-ip27/cpu-feature-overrides.h2
-rw-r--r--include/asm-mips/mach-ja/cpu-feature-overrides.h2
-rw-r--r--include/asm-mips/mach-mips/cpu-feature-overrides.h4
-rw-r--r--include/asm-mips/mach-ocelot3/cpu-feature-overrides.h2
-rw-r--r--include/asm-mips/mach-sibyte/cpu-feature-overrides.h2
-rw-r--r--include/asm-mips/mach-sim/cpu-feature-overrides.h4
-rw-r--r--include/asm-mips/mach-yosemite/cpu-feature-overrides.h2
-rw-r--r--include/asm-mips/mipsregs.h4
-rw-r--r--include/asm-mips/page.h20
-rw-r--r--include/asm-mips/system.h5
-rw-r--r--include/asm-mips/time.h4
-rw-r--r--include/asm-mips/unistd.h18
-rw-r--r--include/asm-mips/vr41xx/capcella.h2
-rw-r--r--include/asm-mips/vr41xx/cmbvr4133.h6
-rw-r--r--include/asm-mips/vr41xx/e55.h43
-rw-r--r--include/asm-mips/vr41xx/irq.h101
-rw-r--r--include/asm-mips/vr41xx/mpc30x.h2
-rw-r--r--include/asm-mips/vr41xx/tb0219.h2
-rw-r--r--include/asm-mips/vr41xx/tb0226.h2
-rw-r--r--include/asm-mips/vr41xx/tb0287.h2
-rw-r--r--include/asm-mips/vr41xx/vr41xx.h53
-rw-r--r--include/asm-mips/vr41xx/vrc4173.h221
-rw-r--r--include/asm-mips/vr41xx/workpad.h43
-rw-r--r--include/asm-parisc/system.h2
-rw-r--r--include/asm-powerpc/atomic.h32
-rw-r--r--include/asm-powerpc/backlight.h16
-rw-r--r--include/asm-powerpc/bitops.h16
-rw-r--r--include/asm-powerpc/eeh.h3
-rw-r--r--include/asm-powerpc/futex.h28
-rw-r--r--include/asm-powerpc/io.h50
-rw-r--r--include/asm-powerpc/ipic.h12
-rw-r--r--include/asm-powerpc/irq.h38
-rw-r--r--include/asm-powerpc/kdump.h2
-rw-r--r--include/asm-powerpc/kexec.h3
-rw-r--r--include/asm-powerpc/kprobes.h1
-rw-r--r--include/asm-powerpc/mpc86xx.h3
-rw-r--r--include/asm-powerpc/mpic.h125
-rw-r--r--include/asm-powerpc/paca.h1
-rw-r--r--include/asm-powerpc/pgalloc.h2
-rw-r--r--include/asm-powerpc/prom.h4
-rw-r--r--include/asm-powerpc/rtas.h1
-rw-r--r--include/asm-powerpc/spinlock.h17
-rw-r--r--include/asm-powerpc/system.h26
-rw-r--r--include/asm-powerpc/time.h4
-rw-r--r--include/asm-powerpc/tsi108.h14
-rw-r--r--include/asm-powerpc/tsi108_irq.h124
-rw-r--r--include/asm-ppc/cpm2.h95
-rw-r--r--include/asm-ppc/io.h20
-rw-r--r--include/asm-ppc/mpc8260.h1
-rw-r--r--include/asm-ppc/mpc8xx.h1
-rw-r--r--include/asm-ppc/system.h1
-rw-r--r--include/asm-s390/bug.h11
-rw-r--r--include/asm-s390/ccwdev.h2
-rw-r--r--include/asm-s390/cio.h2
-rw-r--r--include/asm-s390/debug.h2
-rw-r--r--include/asm-s390/elf.h28
-rw-r--r--include/asm-s390/futex.h5
-rw-r--r--include/asm-s390/irqflags.h18
-rw-r--r--include/asm-s390/pgalloc.h2
-rw-r--r--include/asm-s390/processor.h16
-rw-r--r--include/asm-s390/setup.h3
-rw-r--r--include/asm-s390/system.h10
-rw-r--r--include/asm-s390/timex.h4
-rw-r--r--include/asm-sh/page.h2
-rw-r--r--include/asm-sh/processor.h3
-rw-r--r--include/asm-sh/system.h1
-rw-r--r--include/asm-sh64/bug.h16
-rw-r--r--include/asm-sh64/byteorder.h4
-rw-r--r--include/asm-sh64/dma-mapping.h16
-rw-r--r--include/asm-sh64/io.h7
-rw-r--r--include/asm-sh64/processor.h3
-rw-r--r--include/asm-sh64/ptrace.h2
-rw-r--r--include/asm-sh64/system.h3
-rw-r--r--include/asm-sh64/uaccess.h19
-rw-r--r--include/asm-sparc/mman.h8
-rw-r--r--include/asm-sparc/oplib.h5
-rw-r--r--include/asm-sparc/signal.h2
-rw-r--r--include/asm-sparc/system.h1
-rw-r--r--include/asm-sparc64/Kbuild2
-rw-r--r--include/asm-sparc64/dma-mapping.h14
-rw-r--r--include/asm-sparc64/kprobes.h1
-rw-r--r--include/asm-sparc64/mman.h8
-rw-r--r--include/asm-sparc64/openprom.h2
-rw-r--r--include/asm-sparc64/oplib.h5
-rw-r--r--include/asm-sparc64/pgtable.h4
-rw-r--r--include/asm-sparc64/sfp-machine.h2
-rw-r--r--include/asm-sparc64/system.h2
-rw-r--r--include/asm-v850/processor.h3
-rw-r--r--include/asm-v850/system.h1
-rw-r--r--include/asm-x86_64/alternative.h21
-rw-r--r--include/asm-x86_64/calgary.h11
-rw-r--r--include/asm-x86_64/elf.h20
-rw-r--r--include/asm-x86_64/kprobes.h1
-rw-r--r--include/asm-x86_64/page.h2
-rw-r--r--include/asm-x86_64/processor.h6
-rw-r--r--include/asm-x86_64/signal.h2
-rw-r--r--include/asm-x86_64/spinlock.h11
-rw-r--r--include/asm-x86_64/swiotlb.h2
-rw-r--r--include/asm-x86_64/system.h1
-rw-r--r--include/asm-x86_64/tce.h8
-rw-r--r--include/asm-x86_64/unistd.h11
-rw-r--r--include/asm-x86_64/unwind.h1
-rw-r--r--include/asm-x86_64/vsyscall.h3
-rw-r--r--include/asm-xtensa/processor.h3
-rw-r--r--include/asm-xtensa/system.h1
-rw-r--r--include/linux/atmdev.h2
-rw-r--r--include/linux/audit.h54
-rw-r--r--include/linux/blktrace_api.h5
-rw-r--r--include/linux/bootmem.h2
-rw-r--r--include/linux/cn_proc.h3
-rw-r--r--include/linux/compat_ioctl.h1
-rw-r--r--include/linux/completion.h5
-rw-r--r--include/linux/console_struct.h1
-rw-r--r--include/linux/cpu.h6
-rw-r--r--include/linux/cpufreq.h3
-rw-r--r--include/linux/debug_locks.h2
-rw-r--r--include/linux/delayacct.h121
-rw-r--r--include/linux/elfcore.h10
-rw-r--r--include/linux/ext3_fs.h9
-rw-r--r--include/linux/fb.h5
-rw-r--r--include/linux/fs.h8
-rw-r--r--include/linux/fs_enet_pd.h50
-rw-r--r--include/linux/fsnotify.h6
-rw-r--r--include/linux/futex.h3
-rw-r--r--include/linux/hdlc.h2
-rw-r--r--include/linux/hrtimer.h1
-rw-r--r--include/linux/i2c-id.h1
-rw-r--r--include/linux/i2c.h2
-rw-r--r--include/linux/ide.h1
-rw-r--r--include/linux/if_vlan.h10
-rw-r--r--include/linux/ioport.h2
-rw-r--r--include/linux/ioprio.h23
-rw-r--r--include/linux/irq.h5
-rw-r--r--include/linux/jbd.h3
-rw-r--r--include/linux/jiffies.h4
-rw-r--r--include/linux/kernel.h2
-rw-r--r--include/linux/kobject.h2
-rw-r--r--include/linux/kthread.h1
-rw-r--r--include/linux/ktime.h7
-rw-r--r--include/linux/libata.h87
-rw-r--r--include/linux/list.h11
-rw-r--r--include/linux/lockd/lockd.h1
-rw-r--r--include/linux/lockdep.h2
-rw-r--r--include/linux/mc146818rtc.h7
-rw-r--r--include/linux/mm.h1
-rw-r--r--include/linux/mmc/host.h2
-rw-r--r--include/linux/mmc/mmc.h2
-rw-r--r--include/linux/mmzone.h1
-rw-r--r--include/linux/module.h10
-rw-r--r--include/linux/namei.h2
-rw-r--r--include/linux/netdevice.h41
-rw-r--r--include/linux/netfilter/Kbuild2
-rw-r--r--include/linux/netfilter_bridge.h17
-rw-r--r--include/linux/nfs4.h6
-rw-r--r--include/linux/nfs_fs.h64
-rw-r--r--include/linux/nfs_xdr.h4
-rw-r--r--include/linux/nfsd/stats.h6
-rw-r--r--include/linux/node.h10
-rw-r--r--include/linux/nsc_gpio.h2
-rw-r--r--include/linux/pci.h1
-rw-r--r--include/linux/pci_ids.h14
-rw-r--r--include/linux/pci_regs.h16
-rw-r--r--include/linux/phy.h1
-rw-r--r--include/linux/pm_legacy.h7
-rw-r--r--include/linux/pmu.h3
-rw-r--r--include/linux/raid/md_k.h3
-rw-r--r--include/linux/root_dev.h2
-rw-r--r--include/linux/rwsem.h17
-rw-r--r--include/linux/sched.h63
-rw-r--r--include/linux/security.h40
-rw-r--r--include/linux/serial_core.h1
-rw-r--r--include/linux/skbuff.h65
-rw-r--r--include/linux/sunrpc/rpc_pipe_fs.h4
-rw-r--r--include/linux/sunrpc/xprt.h4
-rw-r--r--include/linux/taskstats.h137
-rw-r--r--include/linux/taskstats_kern.h89
-rw-r--r--include/linux/time.h12
-rw-r--r--include/linux/timex.h3
-rw-r--r--include/linux/tty.h13
-rw-r--r--include/linux/usb.h9
-rw-r--r--include/linux/usb/serial.h300
-rw-r--r--include/linux/usb_ch9.h7
-rw-r--r--include/linux/usb_gadget.h4
-rw-r--r--include/linux/usb_usual.h4
-rw-r--r--include/linux/videodev.h6
-rw-r--r--include/linux/videodev2.h4
-rw-r--r--include/linux/vmalloc.h1
-rw-r--r--include/linux/vmstat.h17
-rw-r--r--include/linux/vt.h11
-rw-r--r--include/linux/vt_kern.h1
-rw-r--r--include/linux/wait.h12
-rw-r--r--include/media/v4l2-dev.h16
-rw-r--r--include/net/af_unix.h6
-rw-r--r--include/net/genetlink.h20
-rw-r--r--include/net/ieee80211softmac.h1
-rw-r--r--include/net/ip6_route.h12
-rw-r--r--include/net/ipv6.h3
-rw-r--r--include/net/netdma.h4
-rw-r--r--include/net/netevent.h33
-rw-r--r--include/net/pkt_sched.h18
-rw-r--r--include/net/protocol.h2
-rw-r--r--include/net/red.h2
-rw-r--r--include/net/scm.h29
-rw-r--r--include/net/sctp/sctp.h13
-rw-r--r--include/net/sctp/sm.h3
-rw-r--r--include/net/sctp/structs.h11
-rw-r--r--include/net/sctp/user.h9
-rw-r--r--include/net/tcp.h4
-rw-r--r--include/rdma/ib_addr.h10
-rw-r--r--include/rdma/ib_fmr_pool.h2
-rw-r--r--include/rdma/ib_mad.h7
-rw-r--r--include/scsi/libiscsi.h19
-rw-r--r--include/scsi/scsi_cmnd.h9
-rw-r--r--include/scsi/scsi_transport_iscsi.h4
-rw-r--r--include/scsi/scsi_transport_sas.h7
-rw-r--r--include/sound/core.h2
-rw-r--r--include/sound/cs46xx.h1
-rw-r--r--include/video/mbxfb.h28
352 files changed, 2857 insertions, 1719 deletions
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index b492857fe721..9e6c23c360b2 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -63,7 +63,7 @@
63 63
64/* Current ACPICA subsystem version in YYYYMMDD format */ 64/* Current ACPICA subsystem version in YYYYMMDD format */
65 65
66#define ACPI_CA_VERSION 0x20060623 66#define ACPI_CA_VERSION 0x20060707
67 67
68/* 68/*
69 * OS name, used for the _OS object. The _OS object is essentially obsolete, 69 * OS name, used for the _OS object. The _OS object is essentially obsolete,
diff --git a/include/acpi/acinterp.h b/include/acpi/acinterp.h
index 216339a8f1f6..91586d0d5bb5 100644
--- a/include/acpi/acinterp.h
+++ b/include/acpi/acinterp.h
@@ -53,10 +53,14 @@
53#define ACPI_EXD_TABLE_SIZE(name) (sizeof(name) / sizeof (struct acpi_exdump_info)) 53#define ACPI_EXD_TABLE_SIZE(name) (sizeof(name) / sizeof (struct acpi_exdump_info))
54 54
55/* 55/*
56 * If possible, pack the following structure to byte alignment, since we 56 * If possible, pack the following structures to byte alignment, since we
57 * don't care about performance for debug output 57 * don't care about performance for debug output. Two cases where we cannot
58 * pack the structures:
59 *
60 * 1) Hardware does not support misaligned memory transfers
61 * 2) Compiler does not support pointers within packed structures
58 */ 62 */
59#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED 63#if (!defined(ACPI_MISALIGNMENT_NOT_SUPPORTED) && !defined(ACPI_PACKED_POINTERS_NOT_SUPPORTED))
60#pragma pack(1) 64#pragma pack(1)
61#endif 65#endif
62 66
diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h
index 56b802486161..a4d0e73d5aca 100644
--- a/include/acpi/aclocal.h
+++ b/include/acpi/aclocal.h
@@ -127,7 +127,7 @@ typedef u8 acpi_owner_id;
127 127
128/* This Thread ID means that the mutex is not in use (unlocked) */ 128/* This Thread ID means that the mutex is not in use (unlocked) */
129 129
130#define ACPI_MUTEX_NOT_ACQUIRED (u32) -1 130#define ACPI_MUTEX_NOT_ACQUIRED (acpi_thread_id) 0
131 131
132/* Table for the global mutexes */ 132/* Table for the global mutexes */
133 133
@@ -204,7 +204,7 @@ struct acpi_namespace_node {
204/* Namespace Node flags */ 204/* Namespace Node flags */
205 205
206#define ANOBJ_END_OF_PEER_LIST 0x01 /* End-of-list, Peer field points to parent */ 206#define ANOBJ_END_OF_PEER_LIST 0x01 /* End-of-list, Peer field points to parent */
207#define ANOBJ_DATA_WIDTH_32 0x02 /* Parent table uses 32-bit math */ 207#define ANOBJ_RESERVED 0x02 /* Available for future use */
208#define ANOBJ_METHOD_ARG 0x04 /* Node is a method argument */ 208#define ANOBJ_METHOD_ARG 0x04 /* Node is a method argument */
209#define ANOBJ_METHOD_LOCAL 0x08 /* Node is a method local */ 209#define ANOBJ_METHOD_LOCAL 0x08 /* Node is a method local */
210#define ANOBJ_SUBTREE_HAS_INI 0x10 /* Used to optimize device initialization */ 210#define ANOBJ_SUBTREE_HAS_INI 0x10 /* Used to optimize device initialization */
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h
index f1ac6109556e..192fa095a515 100644
--- a/include/acpi/acmacros.h
+++ b/include/acpi/acmacros.h
@@ -724,9 +724,15 @@
724 724
725/* Memory allocation */ 725/* Memory allocation */
726 726
727#ifndef ACPI_ALLOCATE
727#define ACPI_ALLOCATE(a) acpi_ut_allocate((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__) 728#define ACPI_ALLOCATE(a) acpi_ut_allocate((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__)
729#endif
730#ifndef ACPI_ALLOCATE_ZEROED
728#define ACPI_ALLOCATE_ZEROED(a) acpi_ut_allocate_zeroed((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__) 731#define ACPI_ALLOCATE_ZEROED(a) acpi_ut_allocate_zeroed((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__)
729#define ACPI_FREE(a) kfree(a) 732#endif
733#ifndef ACPI_FREE
734#define ACPI_FREE(a) acpio_os_free(a)
735#endif
730#define ACPI_MEM_TRACKING(a) 736#define ACPI_MEM_TRACKING(a)
731 737
732#else 738#else
diff --git a/include/acpi/acresrc.h b/include/acpi/acresrc.h
index ad11fc13fbef..80a3b33571b4 100644
--- a/include/acpi/acresrc.h
+++ b/include/acpi/acresrc.h
@@ -50,9 +50,13 @@
50 50
51/* 51/*
52 * If possible, pack the following structures to byte alignment, since we 52 * If possible, pack the following structures to byte alignment, since we
53 * don't care about performance for debug output 53 * don't care about performance for debug output. Two cases where we cannot
54 * pack the structures:
55 *
56 * 1) Hardware does not support misaligned memory transfers
57 * 2) Compiler does not support pointers within packed structures
54 */ 58 */
55#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED 59#if (!defined(ACPI_MISALIGNMENT_NOT_SUPPORTED) && !defined(ACPI_PACKED_POINTERS_NOT_SUPPORTED))
56#pragma pack(1) 60#pragma pack(1)
57#endif 61#endif
58 62
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index 3f853cabbd41..47faf27913a5 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -59,6 +59,7 @@
59#include <asm/acpi.h> 59#include <asm/acpi.h>
60#include <linux/slab.h> 60#include <linux/slab.h>
61#include <linux/spinlock_types.h> 61#include <linux/spinlock_types.h>
62#include <asm/current.h>
62 63
63/* Host-dependent types and defines */ 64/* Host-dependent types and defines */
64 65
@@ -100,8 +101,30 @@
100 101
101#define acpi_cpu_flags unsigned long 102#define acpi_cpu_flags unsigned long
102 103
103#define acpi_thread_id u32 104#define acpi_thread_id struct task_struct *
104 105
105static inline acpi_thread_id acpi_os_get_thread_id(void) { return 0; } 106static inline acpi_thread_id acpi_os_get_thread_id(void) { return current; }
107
108/*
109 * The irqs_disabled() check is for resume from RAM.
110 * Interrupts are off during resume, just like they are for boot.
111 * However, boot has (system_state != SYSTEM_RUNNING)
112 * to quiet __might_sleep() in kmalloc() and resume does not.
113 */
114#include <acpi/actypes.h>
115static inline void *acpi_os_allocate(acpi_size size) {
116 return kmalloc(size, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL);
117}
118static inline void *acpi_os_allocate_zeroed(acpi_size size) {
119 return kzalloc(size, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL);
120}
121
122static inline void *acpi_os_acquire_object(acpi_cache_t * cache) {
123 return kmem_cache_zalloc(cache, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL);
124}
125
126#define ACPI_ALLOCATE(a) acpi_os_allocate(a)
127#define ACPI_ALLOCATE_ZEROED(a) acpi_os_allocate_zeroed(a)
128#define ACPI_FREE(a) kfree(a)
106 129
107#endif /* __ACLINUX_H__ */ 130#endif /* __ACLINUX_H__ */
diff --git a/include/asm-alpha/Kbuild b/include/asm-alpha/Kbuild
index e57fd57538b8..2b06b3bad5ff 100644
--- a/include/asm-alpha/Kbuild
+++ b/include/asm-alpha/Kbuild
@@ -1,5 +1,5 @@
1include include/asm-generic/Kbuild.asm 1include include/asm-generic/Kbuild.asm
2 2
3unifdef-y += console.h fpu.h sysinfo.h 3unifdef-y += console.h fpu.h sysinfo.h compiler.h
4 4
5header-y += gentrap.h regdef.h pal.h reg.h 5header-y += gentrap.h regdef.h pal.h reg.h
diff --git a/include/asm-alpha/barrier.h b/include/asm-alpha/barrier.h
index 681ff581afa5..384dc08d6f53 100644
--- a/include/asm-alpha/barrier.h
+++ b/include/asm-alpha/barrier.h
@@ -30,7 +30,4 @@ __asm__ __volatile__("mb": : :"memory")
30#define set_mb(var, value) \ 30#define set_mb(var, value) \
31do { var = value; mb(); } while (0) 31do { var = value; mb(); } while (0)
32 32
33#define set_wmb(var, value) \
34do { var = value; wmb(); } while (0)
35
36#endif /* __BARRIER_H */ 33#endif /* __BARRIER_H */
diff --git a/include/asm-alpha/compiler.h b/include/asm-alpha/compiler.h
index 00c6f57ad9a7..d2768cc3d7a4 100644
--- a/include/asm-alpha/compiler.h
+++ b/include/asm-alpha/compiler.h
@@ -90,6 +90,7 @@
90 __asm__("stw %1,%0" : "=m"(mem) : "r"(val)) 90 __asm__("stw %1,%0" : "=m"(mem) : "r"(val))
91#endif 91#endif
92 92
93#ifdef __KERNEL__
93/* Some idiots over in <linux/compiler.h> thought inline should imply 94/* Some idiots over in <linux/compiler.h> thought inline should imply
94 always_inline. This breaks stuff. We'll include this file whenever 95 always_inline. This breaks stuff. We'll include this file whenever
95 we run into such problems. */ 96 we run into such problems. */
@@ -101,4 +102,6 @@
101#undef __always_inline 102#undef __always_inline
102#define __always_inline inline __attribute__((always_inline)) 103#define __always_inline inline __attribute__((always_inline))
103 104
105#endif /* __KERNEL__ */
106
104#endif /* __ALPHA_COMPILER_H */ 107#endif /* __ALPHA_COMPILER_H */
diff --git a/include/asm-alpha/page.h b/include/asm-alpha/page.h
index 8c7cd50d4eae..d2bed3cb33ff 100644
--- a/include/asm-alpha/page.h
+++ b/include/asm-alpha/page.h
@@ -1,6 +1,8 @@
1#ifndef _ALPHA_PAGE_H 1#ifndef _ALPHA_PAGE_H
2#define _ALPHA_PAGE_H 2#define _ALPHA_PAGE_H
3 3
4#ifdef __KERNEL__
5
4#include <asm/pal.h> 6#include <asm/pal.h>
5 7
6/* PAGE_SHIFT determines the page size */ 8/* PAGE_SHIFT determines the page size */
@@ -8,8 +10,6 @@
8#define PAGE_SIZE (1UL << PAGE_SHIFT) 10#define PAGE_SIZE (1UL << PAGE_SHIFT)
9#define PAGE_MASK (~(PAGE_SIZE-1)) 11#define PAGE_MASK (~(PAGE_SIZE-1))
10 12
11#ifdef __KERNEL__
12
13#ifndef __ASSEMBLY__ 13#ifndef __ASSEMBLY__
14 14
15#define STRICT_MM_TYPECHECKS 15#define STRICT_MM_TYPECHECKS
@@ -92,9 +92,9 @@ typedef unsigned long pgprot_t;
92 92
93#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ 93#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
94 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) 94 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
95#endif /* __KERNEL__ */
96 95
97#include <asm-generic/memory_model.h> 96#include <asm-generic/memory_model.h>
98#include <asm-generic/page.h> 97#include <asm-generic/page.h>
99 98
99#endif /* __KERNEL__ */
100#endif /* _ALPHA_PAGE_H */ 100#endif /* _ALPHA_PAGE_H */
diff --git a/include/asm-arm/arch-at91rm9200/irqs.h b/include/asm-arm/arch-at91rm9200/irqs.h
index 2dc93b174a8f..f63842c2c093 100644
--- a/include/asm-arm/arch-at91rm9200/irqs.h
+++ b/include/asm-arm/arch-at91rm9200/irqs.h
@@ -39,12 +39,4 @@
39 */ 39 */
40#define NR_IRQS (NR_AIC_IRQS + (4 * 32)) 40#define NR_IRQS (NR_AIC_IRQS + (4 * 32))
41 41
42
43#ifndef __ASSEMBLY__
44/*
45 * Initialize the IRQ controller.
46 */
47extern void at91rm9200_init_irq(unsigned int priority[]);
48#endif
49
50#endif 42#endif
diff --git a/include/asm-arm/arch-iop3xx/iop331-irqs.h b/include/asm-arm/arch-iop3xx/iop331-irqs.h
index 8ff73d487222..7135ad7e335e 100644
--- a/include/asm-arm/arch-iop3xx/iop331-irqs.h
+++ b/include/asm-arm/arch-iop3xx/iop331-irqs.h
@@ -91,7 +91,6 @@
91#define NR_IRQS NR_IOP331_IRQS 91#define NR_IRQS NR_IOP331_IRQS
92 92
93 93
94#if defined(CONFIG_ARCH_IQ80331)
95/* 94/*
96 * Interrupts available on the IQ80331 board 95 * Interrupts available on the IQ80331 board
97 */ 96 */
@@ -111,7 +110,6 @@
111#define IRQ_IQ80331_INTC IRQ_IOP331_XINT2 110#define IRQ_IQ80331_INTC IRQ_IOP331_XINT2
112#define IRQ_IQ80331_INTD IRQ_IOP331_XINT3 111#define IRQ_IQ80331_INTD IRQ_IOP331_XINT3
113 112
114#elif defined(CONFIG_MACH_IQ80332)
115/* 113/*
116 * Interrupts available on the IQ80332 board 114 * Interrupts available on the IQ80332 board
117 */ 115 */
@@ -131,6 +129,4 @@
131#define IRQ_IQ80332_INTC IRQ_IOP331_XINT2 129#define IRQ_IQ80332_INTC IRQ_IOP331_XINT2
132#define IRQ_IQ80332_INTD IRQ_IOP331_XINT3 130#define IRQ_IQ80332_INTD IRQ_IOP331_XINT3
133 131
134#endif
135
136#endif // _IOP331_IRQ_H_ 132#endif // _IOP331_IRQ_H_
diff --git a/include/asm-arm/arch-omap/clock.h b/include/asm-arm/arch-omap/clock.h
index 3c4eb9fbe48a..f83003f5287b 100644
--- a/include/asm-arm/arch-omap/clock.h
+++ b/include/asm-arm/arch-omap/clock.h
@@ -48,8 +48,6 @@ struct clk_functions {
48}; 48};
49 49
50extern unsigned int mpurate; 50extern unsigned int mpurate;
51extern struct list_head clocks;
52extern spinlock_t clockfw_lock;
53 51
54extern int clk_init(struct clk_functions * custom_clocks); 52extern int clk_init(struct clk_functions * custom_clocks);
55extern int clk_register(struct clk *clk); 53extern int clk_register(struct clk *clk);
diff --git a/include/asm-arm/arch-pxa/ssp.h b/include/asm-arm/arch-pxa/ssp.h
index 949878c0d908..ea200551a75f 100644
--- a/include/asm-arm/arch-pxa/ssp.h
+++ b/include/asm-arm/arch-pxa/ssp.h
@@ -40,8 +40,8 @@ struct ssp_dev {
40}; 40};
41 41
42int ssp_write_word(struct ssp_dev *dev, u32 data); 42int ssp_write_word(struct ssp_dev *dev, u32 data);
43int ssp_read_word(struct ssp_dev *dev); 43int ssp_read_word(struct ssp_dev *dev, u32 *data);
44void ssp_flush(struct ssp_dev *dev); 44int ssp_flush(struct ssp_dev *dev);
45void ssp_enable(struct ssp_dev *dev); 45void ssp_enable(struct ssp_dev *dev);
46void ssp_disable(struct ssp_dev *dev); 46void ssp_disable(struct ssp_dev *dev);
47void ssp_save_state(struct ssp_dev *dev, struct ssp_state *ssp); 47void ssp_save_state(struct ssp_dev *dev, struct ssp_state *ssp);
diff --git a/include/asm-arm/arch-s3c2410/anubis-cpld.h b/include/asm-arm/arch-s3c2410/anubis-cpld.h
index 5675b1796b55..40e8e270d337 100644
--- a/include/asm-arm/arch-s3c2410/anubis-cpld.h
+++ b/include/asm-arm/arch-s3c2410/anubis-cpld.h
@@ -9,9 +9,6 @@
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as 10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
12 *
13 * Changelog:
14 *
15*/ 12*/
16 13
17#ifndef __ASM_ARCH_ANUBISCPLD_H 14#ifndef __ASM_ARCH_ANUBISCPLD_H
diff --git a/include/asm-arm/arch-s3c2410/anubis-irq.h b/include/asm-arm/arch-s3c2410/anubis-irq.h
index 82f15dbd97e8..4b5f423779df 100644
--- a/include/asm-arm/arch-s3c2410/anubis-irq.h
+++ b/include/asm-arm/arch-s3c2410/anubis-irq.h
@@ -9,9 +9,7 @@
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as 10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
12 * 12*/
13 * Changelog:
14 */
15 13
16#ifndef __ASM_ARCH_ANUBISIRQ_H 14#ifndef __ASM_ARCH_ANUBISIRQ_H
17#define __ASM_ARCH_ANUBISIRQ_H 15#define __ASM_ARCH_ANUBISIRQ_H
diff --git a/include/asm-arm/arch-s3c2410/anubis-map.h b/include/asm-arm/arch-s3c2410/anubis-map.h
index d529ffda8599..058a2104b035 100644
--- a/include/asm-arm/arch-s3c2410/anubis-map.h
+++ b/include/asm-arm/arch-s3c2410/anubis-map.h
@@ -9,8 +9,6 @@
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as 10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
12 *
13 * Changelog:
14*/ 12*/
15 13
16/* needs arch/map.h including with this */ 14/* needs arch/map.h including with this */
diff --git a/include/asm-arm/arch-s3c2410/audio.h b/include/asm-arm/arch-s3c2410/audio.h
index 0d276e67f2fb..7e0222276c98 100644
--- a/include/asm-arm/arch-s3c2410/audio.h
+++ b/include/asm-arm/arch-s3c2410/audio.h
@@ -9,10 +9,6 @@
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as 10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
12 *
13 * Changelog:
14 * 20-Nov-2004 BJD Created file
15 * 07-Mar-2005 BJD Added suspend/resume calls
16*/ 12*/
17 13
18#ifndef __ASM_ARCH_AUDIO_H 14#ifndef __ASM_ARCH_AUDIO_H
diff --git a/include/asm-arm/arch-s3c2410/bast-cpld.h b/include/asm-arm/arch-s3c2410/bast-cpld.h
index e28ca51a4975..8969cffe83fa 100644
--- a/include/asm-arm/arch-s3c2410/bast-cpld.h
+++ b/include/asm-arm/arch-s3c2410/bast-cpld.h
@@ -8,11 +8,6 @@
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
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11 *
12 * Changelog:
13 * 25-May-2003 BJD Created file, added CTRL1 registers
14 * 30-Aug-2004 BJD Updated definitions from 2.4.26 port
15 * 30-Aug-2004 BJD Added CTRL3 and CTRL4 definitions
16*/ 11*/
17 12
18#ifndef __ASM_ARCH_BASTCPLD_H 13#ifndef __ASM_ARCH_BASTCPLD_H
diff --git a/include/asm-arm/arch-s3c2410/bast-irq.h b/include/asm-arm/arch-s3c2410/bast-irq.h
index b79b47f0d126..15ffa66f5011 100644
--- a/include/asm-arm/arch-s3c2410/bast-irq.h
+++ b/include/asm-arm/arch-s3c2410/bast-irq.h
@@ -8,11 +8,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
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11 * 11*/
12 * Changelog:
13 * 14-Sep-2004 BJD Fixed IRQ_USBOC definition
14 * 06-Jan-2003 BJD Linux 2.6.0 version
15 */
16 12
17#ifndef __ASM_ARCH_BASTIRQ_H 13#ifndef __ASM_ARCH_BASTIRQ_H
18#define __ASM_ARCH_BASTIRQ_H 14#define __ASM_ARCH_BASTIRQ_H
diff --git a/include/asm-arm/arch-s3c2410/bast-map.h b/include/asm-arm/arch-s3c2410/bast-map.h
index 29c07e302b04..727cef84c70e 100644
--- a/include/asm-arm/arch-s3c2410/bast-map.h
+++ b/include/asm-arm/arch-s3c2410/bast-map.h
@@ -8,10 +8,6 @@
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
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11 *
12 * Changelog:
13 * 06-Jan-2003 BJD Linux 2.6.0 version, moved bast specifics from arch/map.h
14 * 12-Mar-2004 BJD Fixed header include protection
15*/ 11*/
16 12
17/* needs arch/map.h including with this */ 13/* needs arch/map.h including with this */
diff --git a/include/asm-arm/arch-s3c2410/bast-pmu.h b/include/asm-arm/arch-s3c2410/bast-pmu.h
index 758c5c59d4bf..82836027f00f 100644
--- a/include/asm-arm/arch-s3c2410/bast-pmu.h
+++ b/include/asm-arm/arch-s3c2410/bast-pmu.h
@@ -9,9 +9,6 @@
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as 10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
12 *
13 * Changelog:
14 * 08-Oct-2003 BJD Initial creation
15*/ 12*/
16 13
17#ifndef __ASM_ARCH_BASTPMU_H 14#ifndef __ASM_ARCH_BASTPMU_H
diff --git a/include/asm-arm/arch-s3c2410/debug-macro.S b/include/asm-arm/arch-s3c2410/debug-macro.S
index b7d15d125458..93064860e0e5 100644
--- a/include/asm-arm/arch-s3c2410/debug-macro.S
+++ b/include/asm-arm/arch-s3c2410/debug-macro.S
@@ -10,9 +10,6 @@
10 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as 11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
13 *
14 * Modifications:
15 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
16*/ 13*/
17 14
18#include <asm/arch/map.h> 15#include <asm/arch/map.h>
diff --git a/include/asm-arm/arch-s3c2410/dma.h b/include/asm-arm/arch-s3c2410/dma.h
index 72964f9b8414..3661e465b0a5 100644
--- a/include/asm-arm/arch-s3c2410/dma.h
+++ b/include/asm-arm/arch-s3c2410/dma.h
@@ -1,18 +1,13 @@
1/* linux/include/asm-arm/arch-bast/dma.h 1/* linux/include/asm-arm/arch-s3c2410/dma.h
2 * 2 *
3 * Copyright (C) 2003,2004 Simtec Electronics 3 * Copyright (C) 2003,2004,2006 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * Samsung S3C2410X DMA support 6 * Samsung S3C241XX DMA support
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
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11 *
12 * Changelog:
13 * ??-May-2003 BJD Created file
14 * ??-Jun-2003 BJD Added more dma functionality to go with arch
15 * 10-Nov-2004 BJD Added sys_device support
16*/ 11*/
17 12
18#ifndef __ASM_ARCH_DMA_H 13#ifndef __ASM_ARCH_DMA_H
@@ -21,28 +16,26 @@
21#include <linux/sysdev.h> 16#include <linux/sysdev.h>
22#include "hardware.h" 17#include "hardware.h"
23 18
24
25/* 19/*
26 * This is the maximum DMA address(physical address) that can be DMAd to. 20 * This is the maximum DMA address(physical address) that can be DMAd to.
27 * 21 *
28 */ 22 */
29#define MAX_DMA_ADDRESS 0x20000000 23#define MAX_DMA_ADDRESS 0x40000000
30#define MAX_DMA_TRANSFER_SIZE 0x100000 /* Data Unit is half word */ 24#define MAX_DMA_TRANSFER_SIZE 0x100000 /* Data Unit is half word */
31 25
32
33/* we have 4 dma channels */ 26/* we have 4 dma channels */
34#define S3C2410_DMA_CHANNELS (4) 27#define S3C2410_DMA_CHANNELS (4)
35 28
36/* types */ 29/* types */
37 30
38typedef enum { 31enum s3c2410_dma_state {
39 S3C2410_DMA_IDLE, 32 S3C2410_DMA_IDLE,
40 S3C2410_DMA_RUNNING, 33 S3C2410_DMA_RUNNING,
41 S3C2410_DMA_PAUSED 34 S3C2410_DMA_PAUSED
42} s3c2410_dma_state_t; 35};
43 36
44 37
45/* s3c2410_dma_loadst_t 38/* enum s3c2410_dma_loadst
46 * 39 *
47 * This represents the state of the DMA engine, wrt to the loaded / running 40 * This represents the state of the DMA engine, wrt to the loaded / running
48 * transfers. Since we don't have any way of knowing exactly the state of 41 * transfers. Since we don't have any way of knowing exactly the state of
@@ -70,44 +63,40 @@ typedef enum {
70 * currently running. 63 * currently running.
71*/ 64*/
72 65
73typedef enum { 66enum s3c2410_dma_loadst {
74 S3C2410_DMALOAD_NONE, 67 S3C2410_DMALOAD_NONE,
75 S3C2410_DMALOAD_1LOADED, 68 S3C2410_DMALOAD_1LOADED,
76 S3C2410_DMALOAD_1RUNNING, 69 S3C2410_DMALOAD_1RUNNING,
77 S3C2410_DMALOAD_1LOADED_1RUNNING, 70 S3C2410_DMALOAD_1LOADED_1RUNNING,
78} s3c2410_dma_loadst_t; 71};
79 72
80typedef enum { 73enum s3c2410_dma_buffresult {
81 S3C2410_RES_OK, 74 S3C2410_RES_OK,
82 S3C2410_RES_ERR, 75 S3C2410_RES_ERR,
83 S3C2410_RES_ABORT 76 S3C2410_RES_ABORT
84} s3c2410_dma_buffresult_t; 77};
85
86
87typedef enum s3c2410_dmasrc_e s3c2410_dmasrc_t;
88 78
89enum s3c2410_dmasrc_e { 79enum s3c2410_dmasrc {
90 S3C2410_DMASRC_HW, /* source is memory */ 80 S3C2410_DMASRC_HW, /* source is memory */
91 S3C2410_DMASRC_MEM /* source is hardware */ 81 S3C2410_DMASRC_MEM /* source is hardware */
92}; 82};
93 83
94/* enum s3c2410_chan_op_e 84/* enum s3c2410_chan_op
95 * 85 *
96 * operation codes passed to the DMA code by the user, and also used 86 * operation codes passed to the DMA code by the user, and also used
97 * to inform the current channel owner of any changes to the system state 87 * to inform the current channel owner of any changes to the system state
98*/ 88*/
99 89
100enum s3c2410_chan_op_e { 90enum s3c2410_chan_op {
101 S3C2410_DMAOP_START, 91 S3C2410_DMAOP_START,
102 S3C2410_DMAOP_STOP, 92 S3C2410_DMAOP_STOP,
103 S3C2410_DMAOP_PAUSE, 93 S3C2410_DMAOP_PAUSE,
104 S3C2410_DMAOP_RESUME, 94 S3C2410_DMAOP_RESUME,
105 S3C2410_DMAOP_FLUSH, 95 S3C2410_DMAOP_FLUSH,
106 S3C2410_DMAOP_TIMEOUT, /* internal signal to handler */ 96 S3C2410_DMAOP_TIMEOUT, /* internal signal to handler */
97 S3C2410_DMAOP_STARTED, /* indicate channel started */
107}; 98};
108 99
109typedef enum s3c2410_chan_op_e s3c2410_chan_op_t;
110
111/* flags */ 100/* flags */
112 101
113#define S3C2410_DMAF_SLOW (1<<0) /* slow, so don't worry about 102#define S3C2410_DMAF_SLOW (1<<0) /* slow, so don't worry about
@@ -116,104 +105,100 @@ typedef enum s3c2410_chan_op_e s3c2410_chan_op_t;
116 105
117/* dma buffer */ 106/* dma buffer */
118 107
119typedef struct s3c2410_dma_buf_s s3c2410_dma_buf_t;
120
121struct s3c2410_dma_client { 108struct s3c2410_dma_client {
122 char *name; 109 char *name;
123}; 110};
124 111
125typedef struct s3c2410_dma_client s3c2410_dma_client_t;
126
127/* s3c2410_dma_buf_s 112/* s3c2410_dma_buf_s
128 * 113 *
129 * internally used buffer structure to describe a queued or running 114 * internally used buffer structure to describe a queued or running
130 * buffer. 115 * buffer.
131*/ 116*/
132 117
133struct s3c2410_dma_buf_s { 118struct s3c2410_dma_buf;
134 s3c2410_dma_buf_t *next; 119struct s3c2410_dma_buf {
135 int magic; /* magic */ 120 struct s3c2410_dma_buf *next;
136 int size; /* buffer size in bytes */ 121 int magic; /* magic */
137 dma_addr_t data; /* start of DMA data */ 122 int size; /* buffer size in bytes */
138 dma_addr_t ptr; /* where the DMA got to [1] */ 123 dma_addr_t data; /* start of DMA data */
139 void *id; /* client's id */ 124 dma_addr_t ptr; /* where the DMA got to [1] */
125 void *id; /* client's id */
140}; 126};
141 127
142/* [1] is this updated for both recv/send modes? */ 128/* [1] is this updated for both recv/send modes? */
143 129
144typedef struct s3c2410_dma_chan_s s3c2410_dma_chan_t; 130struct s3c2410_dma_chan;
145 131
146/* s3c2410_dma_cbfn_t 132/* s3c2410_dma_cbfn_t
147 * 133 *
148 * buffer callback routine type 134 * buffer callback routine type
149*/ 135*/
150 136
151typedef void (*s3c2410_dma_cbfn_t)(s3c2410_dma_chan_t *, void *buf, int size, 137typedef void (*s3c2410_dma_cbfn_t)(struct s3c2410_dma_chan *,
152 s3c2410_dma_buffresult_t result); 138 void *buf, int size,
139 enum s3c2410_dma_buffresult result);
153 140
154typedef int (*s3c2410_dma_opfn_t)(s3c2410_dma_chan_t *, 141typedef int (*s3c2410_dma_opfn_t)(struct s3c2410_dma_chan *,
155 s3c2410_chan_op_t ); 142 enum s3c2410_chan_op );
156 143
157struct s3c2410_dma_stats_s { 144struct s3c2410_dma_stats {
158 unsigned long loads; 145 unsigned long loads;
159 unsigned long timeout_longest; 146 unsigned long timeout_longest;
160 unsigned long timeout_shortest; 147 unsigned long timeout_shortest;
161 unsigned long timeout_avg; 148 unsigned long timeout_avg;
162 unsigned long timeout_failed; 149 unsigned long timeout_failed;
163}; 150};
164 151
165typedef struct s3c2410_dma_stats_s s3c2410_dma_stats_t; 152/* struct s3c2410_dma_chan
166
167/* struct s3c2410_dma_chan_s
168 * 153 *
169 * full state information for each DMA channel 154 * full state information for each DMA channel
170*/ 155*/
171 156
172struct s3c2410_dma_chan_s { 157struct s3c2410_dma_chan {
173 /* channel state flags and information */ 158 /* channel state flags and information */
174 unsigned char number; /* number of this dma channel */ 159 unsigned char number; /* number of this dma channel */
175 unsigned char in_use; /* channel allocated */ 160 unsigned char in_use; /* channel allocated */
176 unsigned char irq_claimed; /* irq claimed for channel */ 161 unsigned char irq_claimed; /* irq claimed for channel */
177 unsigned char irq_enabled; /* irq enabled for channel */ 162 unsigned char irq_enabled; /* irq enabled for channel */
178 unsigned char xfer_unit; /* size of an transfer */ 163 unsigned char xfer_unit; /* size of an transfer */
179 164
180 /* channel state */ 165 /* channel state */
181 166
182 s3c2410_dma_state_t state; 167 enum s3c2410_dma_state state;
183 s3c2410_dma_loadst_t load_state; 168 enum s3c2410_dma_loadst load_state;
184 s3c2410_dma_client_t *client; 169 struct s3c2410_dma_client *client;
185 170
186 /* channel configuration */ 171 /* channel configuration */
187 s3c2410_dmasrc_t source; 172 enum s3c2410_dmasrc source;
188 unsigned long dev_addr; 173 unsigned long dev_addr;
189 unsigned long load_timeout; 174 unsigned long load_timeout;
190 unsigned int flags; /* channel flags */ 175 unsigned int flags; /* channel flags */
191 176
192 /* channel's hardware position and configuration */ 177 /* channel's hardware position and configuration */
193 void __iomem *regs; /* channels registers */ 178 void __iomem *regs; /* channels registers */
194 void __iomem *addr_reg; /* data address register */ 179 void __iomem *addr_reg; /* data address register */
195 unsigned int irq; /* channel irq */ 180 unsigned int irq; /* channel irq */
196 unsigned long dcon; /* default value of DCON */ 181 unsigned long dcon; /* default value of DCON */
197 182
198 /* driver handles */ 183 /* driver handles */
199 s3c2410_dma_cbfn_t callback_fn; /* buffer done callback */ 184 s3c2410_dma_cbfn_t callback_fn; /* buffer done callback */
200 s3c2410_dma_opfn_t op_fn; /* channel operation callback */ 185 s3c2410_dma_opfn_t op_fn; /* channel op callback */
201 186
202 /* stats gathering */ 187 /* stats gathering */
203 s3c2410_dma_stats_t *stats; 188 struct s3c2410_dma_stats *stats;
204 s3c2410_dma_stats_t stats_store; 189 struct s3c2410_dma_stats stats_store;
205 190
206 /* buffer list and information */ 191 /* buffer list and information */
207 s3c2410_dma_buf_t *curr; /* current dma buffer */ 192 struct s3c2410_dma_buf *curr; /* current dma buffer */
208 s3c2410_dma_buf_t *next; /* next buffer to load */ 193 struct s3c2410_dma_buf *next; /* next buffer to load */
209 s3c2410_dma_buf_t *end; /* end of queue */ 194 struct s3c2410_dma_buf *end; /* end of queue */
210 195
211 /* system device */ 196 /* system device */
212 struct sys_device dev; 197 struct sys_device dev;
213}; 198};
214 199
215/* the currently allocated channel information */ 200/* the currently allocated channel information */
216extern s3c2410_dma_chan_t s3c2410_chans[]; 201extern struct s3c2410_dma_chan s3c2410_chans[];
217 202
218/* note, we don't really use dma_device_t at the moment */ 203/* note, we don't really use dma_device_t at the moment */
219typedef unsigned long dma_device_t; 204typedef unsigned long dma_device_t;
@@ -226,7 +211,7 @@ typedef unsigned long dma_device_t;
226*/ 211*/
227 212
228extern int s3c2410_dma_request(dmach_t channel, 213extern int s3c2410_dma_request(dmach_t channel,
229 s3c2410_dma_client_t *, void *dev); 214 struct s3c2410_dma_client *, void *dev);
230 215
231 216
232/* s3c2410_dma_ctrl 217/* s3c2410_dma_ctrl
@@ -234,7 +219,7 @@ extern int s3c2410_dma_request(dmach_t channel,
234 * change the state of the dma channel 219 * change the state of the dma channel
235*/ 220*/
236 221
237extern int s3c2410_dma_ctrl(dmach_t channel, s3c2410_chan_op_t op); 222extern int s3c2410_dma_ctrl(dmach_t channel, enum s3c2410_chan_op op);
238 223
239/* s3c2410_dma_setflags 224/* s3c2410_dma_setflags
240 * 225 *
@@ -249,7 +234,7 @@ extern int s3c2410_dma_setflags(dmach_t channel,
249 * free the dma channel (will also abort any outstanding operations) 234 * free the dma channel (will also abort any outstanding operations)
250*/ 235*/
251 236
252extern int s3c2410_dma_free(dmach_t channel, s3c2410_dma_client_t *); 237extern int s3c2410_dma_free(dmach_t channel, struct s3c2410_dma_client *);
253 238
254/* s3c2410_dma_enqueue 239/* s3c2410_dma_enqueue
255 * 240 *
@@ -273,7 +258,7 @@ extern int s3c2410_dma_config(dmach_t channel, int xferunit, int dcon);
273 * configure the device we're talking to 258 * configure the device we're talking to
274*/ 259*/
275 260
276extern int s3c2410_dma_devconfig(int channel, s3c2410_dmasrc_t source, 261extern int s3c2410_dma_devconfig(int channel, enum s3c2410_dmasrc source,
277 int hwcfg, unsigned long devaddr); 262 int hwcfg, unsigned long devaddr);
278 263
279/* s3c2410_dma_getposition 264/* s3c2410_dma_getposition
diff --git a/include/asm-arm/arch-s3c2410/fb.h b/include/asm-arm/arch-s3c2410/fb.h
index 4790491ba9d0..71161797bc89 100644
--- a/include/asm-arm/arch-s3c2410/fb.h
+++ b/include/asm-arm/arch-s3c2410/fb.h
@@ -7,13 +7,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
8 * it under the terms of the GNU General Public License version 2 as 8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
10 *
11 *
12 * Changelog:
13 * 07-Sep-2004 RTP Created file
14 * 03-Nov-2004 BJD Updated and minor cleanups
15 * 03-Aug-2005 RTP Renamed to fb.h
16 * 26-Oct-2005 BJD Changed name of platdata init
17*/ 10*/
18 11
19#ifndef __ASM_ARM_FB_H 12#ifndef __ASM_ARM_FB_H
diff --git a/include/asm-arm/arch-s3c2410/hardware.h b/include/asm-arm/arch-s3c2410/hardware.h
index a2330bf83695..871f8af09b8b 100644
--- a/include/asm-arm/arch-s3c2410/hardware.h
+++ b/include/asm-arm/arch-s3c2410/hardware.h
@@ -8,16 +8,6 @@
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
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11 *
12 * Changelog:
13 * 21-May-2003 BJD Created file
14 * 06-Jun-2003 BJD Added CPU frequency settings
15 * 03-Sep-2003 BJD Linux v2.6 support
16 * 12-Mar-2004 BJD Fixed include protection, fixed type of clock vars
17 * 14-Sep-2004 BJD Added misccr and getpin to gpio
18 * 01-Oct-2004 BJD Added the new gpio functions
19 * 16-Oct-2004 BJD Removed the clock variables
20 * 15-Jan-2006 LCVR Added s3c2400_gpio_getirq()
21*/ 11*/
22 12
23#ifndef __ASM_ARCH_HARDWARE_H 13#ifndef __ASM_ARCH_HARDWARE_H
diff --git a/include/asm-arm/arch-s3c2410/idle.h b/include/asm-arm/arch-s3c2410/idle.h
index 749227c09576..eed450608f9c 100644
--- a/include/asm-arm/arch-s3c2410/idle.h
+++ b/include/asm-arm/arch-s3c2410/idle.h
@@ -8,10 +8,6 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 * 9 *
10 * S3C2410 CPU Idle controls 10 * S3C2410 CPU Idle controls
11 *
12 * Changelog:
13 * 28-Oct-2004 BJD Initial version
14 *
15*/ 11*/
16 12
17#ifndef __ASM_ARCH_IDLE_H 13#ifndef __ASM_ARCH_IDLE_H
diff --git a/include/asm-arm/arch-s3c2410/iic.h b/include/asm-arm/arch-s3c2410/iic.h
index 518547f6d7a7..ed3d6c7bf6d7 100644
--- a/include/asm-arm/arch-s3c2410/iic.h
+++ b/include/asm-arm/arch-s3c2410/iic.h
@@ -8,10 +8,6 @@
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
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11 *
12 * Changelog:
13 * 05-Oct-2004 BJD Created file
14 * 19-Oct-2004 BJD Updated for s3c2440
15*/ 11*/
16 12
17#ifndef __ASM_ARCH_IIC_H 13#ifndef __ASM_ARCH_IIC_H
diff --git a/include/asm-arm/arch-s3c2410/io.h b/include/asm-arm/arch-s3c2410/io.h
index 16fbc8afffd9..6b35a4f2630e 100644
--- a/include/asm-arm/arch-s3c2410/io.h
+++ b/include/asm-arm/arch-s3c2410/io.h
@@ -4,13 +4,7 @@
4 * 4 *
5 * Copyright (C) 1997 Russell King 5 * Copyright (C) 1997 Russell King
6 * (C) 2003 Simtec Electronics 6 * (C) 2003 Simtec Electronics
7 * 7*/
8 * Modifications:
9 * 06-Dec-1997 RMK Created.
10 * 02-Sep-2003 BJD Modified for S3C2410
11 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
12 * 13-Oct-2005 BJD Fixed problems with LDRH/STRH offset range
13 */
14 8
15#ifndef __ASM_ARM_ARCH_IO_H 9#ifndef __ASM_ARM_ARCH_IO_H
16#define __ASM_ARM_ARCH_IO_H 10#define __ASM_ARM_ARCH_IO_H
diff --git a/include/asm-arm/arch-s3c2410/irqs.h b/include/asm-arm/arch-s3c2410/irqs.h
index d9773d697268..39a69829d163 100644
--- a/include/asm-arm/arch-s3c2410/irqs.h
+++ b/include/asm-arm/arch-s3c2410/irqs.h
@@ -6,14 +6,7 @@
6 * This program is free software; you can redistribute it and/or modify 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 7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 * 9*/
10 * Changelog:
11 * 12-May-2003 BJD Created file
12 * 08-Jan-2003 BJD Linux 2.6.0 version, moved BAST bits out
13 * 12-Mar-2004 BJD Fixed bug in header protection
14 * 10-Feb-2005 BJD Added camera IRQ from guillaume.gourat@nexvision.tv
15 * 28-Feb-2005 BJD Updated s3c2440 IRQs
16 */
17 10
18 11
19#ifndef __ASM_ARCH_IRQS_H 12#ifndef __ASM_ARCH_IRQS_H
diff --git a/include/asm-arm/arch-s3c2410/map.h b/include/asm-arm/arch-s3c2410/map.h
index fae2766ff32b..27ba0ac3fdd5 100644
--- a/include/asm-arm/arch-s3c2410/map.h
+++ b/include/asm-arm/arch-s3c2410/map.h
@@ -8,13 +8,6 @@
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
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11 *
12 * Changelog:
13 * 12-May-2003 BJD Created file
14 * 06-Jan-2003 BJD Linux 2.6.0 version, moved bast specifics out
15 * 10-Feb-2005 BJD Added CAMIF definition from guillaume.gourat@nexvision.tv
16 * 10-Mar-2005 LCVR Added support to S3C2400, changed {VA,SZ} names
17 * 15-Jan-2006 LCVR Added S3C24XX_PA macros for common S3C24XX resources
18*/ 11*/
19 12
20#ifndef __ASM_ARCH_MAP_H 13#ifndef __ASM_ARCH_MAP_H
diff --git a/include/asm-arm/arch-s3c2410/memory.h b/include/asm-arm/arch-s3c2410/memory.h
index 6ab834a14c8e..4be6a74c4303 100644
--- a/include/asm-arm/arch-s3c2410/memory.h
+++ b/include/asm-arm/arch-s3c2410/memory.h
@@ -1,6 +1,4 @@
1/* 1/* linux/include/asm-arm/arch-s3c2410/memory.h
2 * linux/include/asm-arm/arch-s3c2410/memory.h
3 *
4 * from linux/include/asm-arm/arch-rpc/memory.h 2 * from linux/include/asm-arm/arch-rpc/memory.h
5 * 3 *
6 * Copyright (C) 1996,1997,1998 Russell King. 4 * Copyright (C) 1996,1997,1998 Russell King.
@@ -8,16 +6,6 @@
8 * This program is free software; you can redistribute it and/or modify 6 * 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 7 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
11 *
12 * Changelog:
13 * 20-Oct-1996 RMK Created
14 * 31-Dec-1997 RMK Fixed definitions to reduce warnings
15 * 11-Jan-1998 RMK Uninlined to reduce hits on cache
16 * 08-Feb-1998 RMK Added __virt_to_bus and __bus_to_virt
17 * 21-Mar-1999 RMK Renamed to memory.h
18 * RMK Added TASK_SIZE and PAGE_OFFSET
19 * 05-Apr-2004 BJD Copied and altered for arch-s3c2410
20 * 17-Mar-2005 LCVR Modified for S3C2400
21*/ 9*/
22 10
23#ifndef __ASM_ARCH_MEMORY_H 11#ifndef __ASM_ARCH_MEMORY_H
diff --git a/include/asm-arm/arch-s3c2410/nand.h b/include/asm-arm/arch-s3c2410/nand.h
index 9148ac045b0d..e350ae2acfc6 100644
--- a/include/asm-arm/arch-s3c2410/nand.h
+++ b/include/asm-arm/arch-s3c2410/nand.h
@@ -8,9 +8,6 @@
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
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11 *
12 * Changelog:
13 * 23-Sep-2004 BJD Created file
14*/ 11*/
15 12
16/* struct s3c2410_nand_set 13/* struct s3c2410_nand_set
diff --git a/include/asm-arm/arch-s3c2410/osiris-map.h b/include/asm-arm/arch-s3c2410/osiris-map.h
index 7c4b0cd2d14d..e2d406218ae5 100644
--- a/include/asm-arm/arch-s3c2410/osiris-map.h
+++ b/include/asm-arm/arch-s3c2410/osiris-map.h
@@ -9,8 +9,6 @@
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as 10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
12 *
13 * Changelog:
14*/ 12*/
15 13
16/* needs arch/map.h including with this */ 14/* needs arch/map.h including with this */
diff --git a/include/asm-arm/arch-s3c2410/regs-adc.h b/include/asm-arm/arch-s3c2410/regs-adc.h
index 15bfc2f5754e..c7b90b3ecc9e 100644
--- a/include/asm-arm/arch-s3c2410/regs-adc.h
+++ b/include/asm-arm/arch-s3c2410/regs-adc.h
@@ -7,9 +7,6 @@
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * S3C2410 ADC registers 9 * S3C2410 ADC registers
10 *
11 * Changelog:
12 * 27-09-2004 SAH Created file
13*/ 10*/
14 11
15#ifndef __ASM_ARCH_REGS_ADC_H 12#ifndef __ASM_ARCH_REGS_ADC_H
diff --git a/include/asm-arm/arch-s3c2410/regs-clock.h b/include/asm-arm/arch-s3c2410/regs-clock.h
index a7c61feb8433..b2f4690c0791 100644
--- a/include/asm-arm/arch-s3c2410/regs-clock.h
+++ b/include/asm-arm/arch-s3c2410/regs-clock.h
@@ -8,18 +8,6 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 * 9 *
10 * S3C2410 clock register definitions 10 * S3C2410 clock register definitions
11 *
12 * Changelog:
13 * 18-Aug-2004 Ben Dooks Added 2440 definitions
14 * 08-Aug-2004 Herbert Pötzl Added CLKCON definitions
15 * 19-06-2003 Ben Dooks Created file
16 * 12-03-2004 Ben Dooks Updated include protection
17 * 29-Sep-2004 Ben Dooks Fixed usage for assembly inclusion
18 * 10-Feb-2005 Ben Dooks Fixed CAMDIVN address (Guillaume Gourat)
19 * 10-Mar-2005 Lucas Villa Real Changed S3C2410_VA to S3C24XX_VA
20 * 27-Aug-2005 Ben Dooks Add clock-slow info
21 * 20-Oct-2005 Ben Dooks Fixed overflow in PLL (Guillaume Gourat)
22 * 20-Oct-2005 Ben Dooks Add masks for DCLK (Guillaume Gourat)
23*/ 11*/
24 12
25#ifndef __ASM_ARM_REGS_CLOCK 13#ifndef __ASM_ARM_REGS_CLOCK
diff --git a/include/asm-arm/arch-s3c2410/regs-gpio.h b/include/asm-arm/arch-s3c2410/regs-gpio.h
index 6dd17f0f84e0..93c49432db95 100644
--- a/include/asm-arm/arch-s3c2410/regs-gpio.h
+++ b/include/asm-arm/arch-s3c2410/regs-gpio.h
@@ -8,21 +8,6 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 * 9 *
10 * S3C2410 GPIO register definitions 10 * S3C2410 GPIO register definitions
11 *
12 * Changelog:
13 * 19-06-2003 BJD Created file
14 * 23-06-2003 BJD Updated GSTATUS registers
15 * 12-03-2004 BJD Updated include protection
16 * 20-07-2004 BJD Added GPIO pin numbers, added Port A definitions
17 * 04-10-2004 BJD Fixed number of bugs, added EXT IRQ filter defs
18 * 17-10-2004 BJD Added GSTATUS1 register definitions
19 * 18-11-2004 BJD Fixed definitions of GPE3, GPE4, GPE5 and GPE6
20 * 18-11-2004 BJD Added S3C2440 AC97 controls
21 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
22 * 28-Mar-2005 LCVR Fixed definition of GPB10
23 * 26-Oct-2005 BJD Added generic configuration types
24 * 27-Nov-2005 LCVR Added definitions to S3C2400 registers
25 * 15-Jan-2006 LCVR Written S3C24XX_GPIO_BASE() macro
26*/ 11*/
27 12
28 13
diff --git a/include/asm-arm/arch-s3c2410/regs-gpioj.h b/include/asm-arm/arch-s3c2410/regs-gpioj.h
index 18edae50d0b8..91cefa260497 100644
--- a/include/asm-arm/arch-s3c2410/regs-gpioj.h
+++ b/include/asm-arm/arch-s3c2410/regs-gpioj.h
@@ -8,10 +8,6 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 * 9 *
10 * S3C2440 GPIO J register definitions 10 * S3C2440 GPIO J register definitions
11 *
12 * Changelog:
13 * 11-Aug-2004 BJD Created file
14 * 10-Feb-2005 BJD Fix GPJ12 definition (Guillaume Gourat)
15*/ 11*/
16 12
17 13
diff --git a/include/asm-arm/arch-s3c2410/regs-iic.h b/include/asm-arm/arch-s3c2410/regs-iic.h
index fed3288e2046..2ae29522f253 100644
--- a/include/asm-arm/arch-s3c2410/regs-iic.h
+++ b/include/asm-arm/arch-s3c2410/regs-iic.h
@@ -8,10 +8,6 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 * 9 *
10 * S3C2410 I2C Controller 10 * S3C2410 I2C Controller
11 *
12 * Changelog:
13 * 03-Oct-2004 BJD Initial include for Linux
14 * 08-Nov-2004 BJD Added S3C2440 filter register
15*/ 11*/
16 12
17#ifndef __ASM_ARCH_REGS_IIC_H 13#ifndef __ASM_ARCH_REGS_IIC_H
diff --git a/include/asm-arm/arch-s3c2410/regs-iis.h b/include/asm-arm/arch-s3c2410/regs-iis.h
index 7fdde9b91cb4..72cd2509822e 100644
--- a/include/asm-arm/arch-s3c2410/regs-iis.h
+++ b/include/asm-arm/arch-s3c2410/regs-iis.h
@@ -8,17 +8,7 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 * 9 *
10 * S3C2410 IIS register definition 10 * S3C2410 IIS register definition
11 * 11*/
12 * Changelog:
13 * 19-06-2003 BJD Created file
14 * 26-06-2003 BJD Finished off definitions for register addresses
15 * 12-03-2004 BJD Updated include protection
16 * 07-03-2005 BJD Added FIFO size flags and S3C2440 MPLL
17 * 05-04-2005 LCVR Added IISFCON definitions for the S3C2400
18 * 18-07-2005 DA Change IISCON_MPLL to IISMOD_MPLL
19 * Correct IISMOD_256FS and IISMOD_384FS
20 * Add IISCON_PSCEN
21 */
22 12
23#ifndef __ASM_ARCH_REGS_IIS_H 13#ifndef __ASM_ARCH_REGS_IIS_H
24#define __ASM_ARCH_REGS_IIS_H 14#define __ASM_ARCH_REGS_IIS_H
diff --git a/include/asm-arm/arch-s3c2410/regs-irq.h b/include/asm-arm/arch-s3c2410/regs-irq.h
index 572fca5d9acf..29fb8ef670f0 100644
--- a/include/asm-arm/arch-s3c2410/regs-irq.h
+++ b/include/asm-arm/arch-s3c2410/regs-irq.h
@@ -6,14 +6,7 @@
6 * This program is free software; you can redistribute it and/or modify 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 7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 * 9*/
10 *
11 *
12 * Changelog:
13 * 19-06-2003 BJD Created file
14 * 12-03-2004 BJD Updated include protection
15 * 10-03-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
16 */
17 10
18 11
19#ifndef ___ASM_ARCH_REGS_IRQ_H 12#ifndef ___ASM_ARCH_REGS_IRQ_H
diff --git a/include/asm-arm/arch-s3c2410/regs-lcd.h b/include/asm-arm/arch-s3c2410/regs-lcd.h
index b6b1b4e8bbeb..b306d6e3135d 100644
--- a/include/asm-arm/arch-s3c2410/regs-lcd.h
+++ b/include/asm-arm/arch-s3c2410/regs-lcd.h
@@ -6,14 +6,6 @@
6 * This program is free software; you can redistribute it and/or modify 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 7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 *
10 *
11 *
12 * Changelog:
13 * 12-06-2003 BJD Created file
14 * 26-06-2003 BJD Updated LCDCON register definitions
15 * 12-03-2004 BJD Updated include protection
16 * 10-03-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
17*/ 9*/
18 10
19 11
diff --git a/include/asm-arm/arch-s3c2410/regs-mem.h b/include/asm-arm/arch-s3c2410/regs-mem.h
index a2d7d0cec042..375dca50364e 100644
--- a/include/asm-arm/arch-s3c2410/regs-mem.h
+++ b/include/asm-arm/arch-s3c2410/regs-mem.h
@@ -8,12 +8,6 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 * 9 *
10 * S3C2410 Memory Control register definitions 10 * S3C2410 Memory Control register definitions
11 *
12 * Changelog:
13 * 29-Sep-2004 BJD Initial include for Linux
14 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
15 * 04-Apr-2005 LCVR Added S3C2400 DRAM/BANKSIZE_MASK definitions
16 *
17*/ 11*/
18 12
19#ifndef __ASM_ARM_MEMREGS_H 13#ifndef __ASM_ARM_MEMREGS_H
diff --git a/include/asm-arm/arch-s3c2410/regs-nand.h b/include/asm-arm/arch-s3c2410/regs-nand.h
index c1470c695c33..b824d371ae0b 100644
--- a/include/asm-arm/arch-s3c2410/regs-nand.h
+++ b/include/asm-arm/arch-s3c2410/regs-nand.h
@@ -8,10 +8,6 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 * 9 *
10 * S3C2410 NAND register definitions 10 * S3C2410 NAND register definitions
11 *
12 * Changelog:
13 * 18-Aug-2004 BJD Copied file from 2.4 and updated
14 * 01-May-2005 BJD Added definitions for s3c2440 controller
15*/ 11*/
16 12
17#ifndef __ASM_ARM_REGS_NAND 13#ifndef __ASM_ARM_REGS_NAND
diff --git a/include/asm-arm/arch-s3c2410/regs-power.h b/include/asm-arm/arch-s3c2410/regs-power.h
new file mode 100644
index 000000000000..6c319ea2afac
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/regs-power.h
@@ -0,0 +1,34 @@
1/* linux/include/asm/arch-s3c2410/regs-power.h
2 *
3 * Copyright (c) 2003,2004,2005,2006 Simtec Electronics <linux@simtec.co.uk>
4 * http://armlinux.simtec.co.uk/
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 * S3C24XX power control register definitions
11*/
12
13#ifndef __ASM_ARM_REGS_PWR
14#define __ASM_ARM_REGS_PWR __FILE__
15
16#define S3C24XX_PWRREG(x) ((x) + S3C24XX_VA_CLKPWR)
17
18#define S3C2412_PWRMODECON S3C24XX_PWRREG(0x20)
19#define S3C2412_PWRCFG S3C24XX_PWRREG(0x24)
20
21#define S3C2412_PWRCFG_BATF_IGNORE (0<<0)
22#define S3C2412_PWRCFG_BATF_SLEEP (3<<0)
23#define S3C2412_PWRCFG_BATF_MASK (3<<0)
24
25#define S3C2412_PWRCFG_STANDBYWFI_IGNORE (0<<6)
26#define S3C2412_PWRCFG_STANDBYWFI_IDLE (1<<6)
27#define S3C2412_PWRCFG_STANDBYWFI_STOP (2<<6)
28#define S3C2412_PWRCFG_STANDBYWFI_SLEEP (3<<6)
29#define S3C2412_PWRCFG_STANDBYWFI_MASK (3<<6)
30
31#define S3C2412_PWRCFG_RTC_MASKIRQ (1<<8)
32#define S3C2412_PWRCFG_NAND_NORST (1<<9)
33
34#endif /* __ASM_ARM_REGS_PWR */
diff --git a/include/asm-arm/arch-s3c2410/regs-rtc.h b/include/asm-arm/arch-s3c2410/regs-rtc.h
index 228983f89bc8..cd88fd634d12 100644
--- a/include/asm-arm/arch-s3c2410/regs-rtc.h
+++ b/include/asm-arm/arch-s3c2410/regs-rtc.h
@@ -8,17 +8,12 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 * 9 *
10 * S3C2410 Internal RTC register definition 10 * S3C2410 Internal RTC register definition
11 *
12 * Changelog:
13 * 19-06-2003 BJD Created file
14 * 12-03-2004 BJD Updated include protection
15 * 15-01-2005 LCVR Changed S3C2410_VA to S3C24XX_VA (s3c2400 support)
16*/ 11*/
17 12
18#ifndef __ASM_ARCH_REGS_RTC_H 13#ifndef __ASM_ARCH_REGS_RTC_H
19#define __ASM_ARCH_REGS_RTC_H __FILE__ 14#define __ASM_ARCH_REGS_RTC_H __FILE__
20 15
21#define S3C2410_RTCREG(x) ((x) + S3C24XX_VA_RTC) 16#define S3C2410_RTCREG(x) (x)
22 17
23#define S3C2410_RTCCON S3C2410_RTCREG(0x40) 18#define S3C2410_RTCCON S3C2410_RTCREG(0x40)
24#define S3C2410_RTCCON_RTCEN (1<<0) 19#define S3C2410_RTCCON_RTCEN (1<<0)
diff --git a/include/asm-arm/arch-s3c2410/regs-sdi.h b/include/asm-arm/arch-s3c2410/regs-sdi.h
index ca9a26fbecec..06e716e5b46d 100644
--- a/include/asm-arm/arch-s3c2410/regs-sdi.h
+++ b/include/asm-arm/arch-s3c2410/regs-sdi.h
@@ -8,11 +8,6 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 * 9 *
10 * S3C2410 MMC/SDIO register definitions 10 * S3C2410 MMC/SDIO register definitions
11 *
12 * Changelog:
13 * 18-Aug-2004 Ben Dooks Created initial file
14 * 29-Nov-2004 Koen Martens Added some missing defines, fixed duplicates
15 * 29-Nov-2004 Ben Dooks Updated Koen's patch
16*/ 11*/
17 12
18#ifndef __ASM_ARM_REGS_SDI 13#ifndef __ASM_ARM_REGS_SDI
diff --git a/include/asm-arm/arch-s3c2410/regs-serial.h b/include/asm-arm/arch-s3c2410/regs-serial.h
index 93f651ae2967..19c77da9c3fe 100644
--- a/include/asm-arm/arch-s3c2410/regs-serial.h
+++ b/include/asm-arm/arch-s3c2410/regs-serial.h
@@ -27,10 +27,7 @@
27 * You should have received a copy of the GNU General Public License 27 * You should have received a copy of the GNU General Public License
28 * along with this program; if not, write to the Free Software 28 * along with this program; if not, write to the Free Software
29 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 29 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30 * 30*/
31 * Modifications:
32 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA (s3c2400 support)
33 */
34 31
35#ifndef __ASM_ARM_REGS_SERIAL_H 32#ifndef __ASM_ARM_REGS_SERIAL_H
36#define __ASM_ARM_REGS_SERIAL_H 33#define __ASM_ARM_REGS_SERIAL_H
diff --git a/include/asm-arm/arch-s3c2410/regs-spi.h b/include/asm-arm/arch-s3c2410/regs-spi.h
index 338217858c73..3552280d1e8f 100644
--- a/include/asm-arm/arch-s3c2410/regs-spi.h
+++ b/include/asm-arm/arch-s3c2410/regs-spi.h
@@ -7,13 +7,7 @@
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * S3C2410 SPI register definition 9 * S3C2410 SPI register definition
10 * 10*/
11 * Changelog:
12 * 20-04-2004 KF Created file
13 * 04-10-2004 BJD Removed VA address (no longer mapped)
14 * tidied file for submission
15 * 03-04-2005 LCVR Added S3C2400_SPPIN_nCS definition
16 */
17 11
18#ifndef __ASM_ARCH_REGS_SPI_H 12#ifndef __ASM_ARCH_REGS_SPI_H
19#define __ASM_ARCH_REGS_SPI_H 13#define __ASM_ARCH_REGS_SPI_H
diff --git a/include/asm-arm/arch-s3c2410/regs-timer.h b/include/asm-arm/arch-s3c2410/regs-timer.h
index 169064e27520..731918e77831 100644
--- a/include/asm-arm/arch-s3c2410/regs-timer.h
+++ b/include/asm-arm/arch-s3c2410/regs-timer.h
@@ -8,13 +8,6 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 * 9 *
10 * S3C2410 Timer configuration 10 * S3C2410 Timer configuration
11 *
12 * Changelog:
13 * 05-06-2003 BJD Created file
14 * 26-06-2003 BJD Added more timer definitions to mux / control
15 * 12-03-2004 BJD Updated include protection
16 * 10-02-2005 BJD Added S3C2410_TCFG1_MUX4_SHIFT (Guillaume Gourat)
17 * 10-03-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
18*/ 11*/
19 12
20 13
diff --git a/include/asm-arm/arch-s3c2410/regs-udc.h b/include/asm-arm/arch-s3c2410/regs-udc.h
index bf315b763252..3aa31a27da1a 100644
--- a/include/asm-arm/arch-s3c2410/regs-udc.h
+++ b/include/asm-arm/arch-s3c2410/regs-udc.h
@@ -6,13 +6,7 @@
6 * modify it under the terms of the GNU General Public License as 6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of 7 * published by the Free Software Foundation; either version 2 of
8 * the License, or (at your option) any later version. 8 * the License, or (at your option) any later version.
9 * 9*/
10 * Changelog:
11 * 01-08-2004 Initial creation
12 * 12-09-2004 Cleanup for submission
13 * 24-10-2004 Fixed S3C2410_UDC_MAXP_REG definition
14 * 10-03-2005 Changed S3C2410_VA to S3C24XX_VA
15 */
16 10
17#ifndef __ASM_ARCH_REGS_UDC_H 11#ifndef __ASM_ARCH_REGS_UDC_H
18#define __ASM_ARCH_REGS_UDC_H 12#define __ASM_ARCH_REGS_UDC_H
diff --git a/include/asm-arm/arch-s3c2410/regs-watchdog.h b/include/asm-arm/arch-s3c2410/regs-watchdog.h
index d199ca6aff22..f4fff448c7bd 100644
--- a/include/asm-arm/arch-s3c2410/regs-watchdog.h
+++ b/include/asm-arm/arch-s3c2410/regs-watchdog.h
@@ -1,4 +1,4 @@
1/* linux/include/asm/arch-s3c2410/regs0watchdog.h 1/* linux/include/asm/arch-s3c2410/regs-watchdog.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/
@@ -8,11 +8,6 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 * 9 *
10 * S3C2410 Watchdog timer control 10 * S3C2410 Watchdog timer control
11 *
12 * Changelog:
13 * 21-06-2003 BJD Created file
14 * 12-03-2004 BJD Updated include protection
15 * 10-03-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
16*/ 11*/
17 12
18 13
diff --git a/include/asm-arm/arch-s3c2410/system.h b/include/asm-arm/arch-s3c2410/system.h
index 9b0d85024cb4..718246d85952 100644
--- a/include/asm-arm/arch-s3c2410/system.h
+++ b/include/asm-arm/arch-s3c2410/system.h
@@ -8,14 +8,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
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11 * 11*/
12 * Changelog:
13 * 12-May-2003 BJD Created file
14 * 14-May-2003 BJD Removed idle to aid debugging
15 * 12-Jun-2003 BJD Added reset via watchdog
16 * 04-Sep-2003 BJD Moved to v2.6
17 * 28-Oct-2004 BJD Added over-ride for idle, and fixed reset panic()
18 */
19 12
20#include <asm/hardware.h> 13#include <asm/hardware.h>
21#include <asm/io.h> 14#include <asm/io.h>
diff --git a/include/asm-arm/arch-s3c2410/timex.h b/include/asm-arm/arch-s3c2410/timex.h
index 3558a3a750bf..703c337c5617 100644
--- a/include/asm-arm/arch-s3c2410/timex.h
+++ b/include/asm-arm/arch-s3c2410/timex.h
@@ -8,12 +8,6 @@
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
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11 *
12 * Changelog:
13 * 02-Sep-2003 BJD Created file
14 * 05-Jan-2004 BJD Updated for Linux 2.6.0
15 * 22-Nov-2004 BJD Fixed CLOCK_TICK_RATE
16 * 10-Jan-2004 BJD Removed s3c2410_clock_tick_rate
17*/ 11*/
18 12
19#ifndef __ASM_ARCH_TIMEX_H 13#ifndef __ASM_ARCH_TIMEX_H
diff --git a/include/asm-arm/arch-s3c2410/uncompress.h b/include/asm-arm/arch-s3c2410/uncompress.h
index 8e152a05e533..81b3e91c56ab 100644
--- a/include/asm-arm/arch-s3c2410/uncompress.h
+++ b/include/asm-arm/arch-s3c2410/uncompress.h
@@ -8,15 +8,6 @@
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
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11 *
12 * Changelog:
13 * 22-May-2003 BJD Created
14 * 08-Sep-2003 BJD Moved to linux v2.6
15 * 12-Mar-2004 BJD Updated header protection
16 * 12-Oct-2004 BJD Take account of debug uart configuration
17 * 15-Nov-2004 BJD Fixed uart configuration
18 * 22-Feb-2005 BJD Added watchdog to uncompress
19 * 04-Apr-2005 LCVR Added support to S3C2400 (no cpuid at GSTATUS1)
20*/ 11*/
21 12
22#ifndef __ASM_ARCH_UNCOMPRESS_H 13#ifndef __ASM_ARCH_UNCOMPRESS_H
diff --git a/include/asm-arm/arch-s3c2410/usb-control.h b/include/asm-arm/arch-s3c2410/usb-control.h
index bd43b566db3e..35723569a17a 100644
--- a/include/asm-arm/arch-s3c2410/usb-control.h
+++ b/include/asm-arm/arch-s3c2410/usb-control.h
@@ -8,11 +8,6 @@
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
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11 *
12 * Changelog:
13 * 11-Sep-2004 BJD Created file
14 * 21-Sep-2004 BJD Updated port info
15 * 09-Aug-2005 BJD Renamed s3c2410_report_oc s3c2410_usb_report_oc
16*/ 11*/
17 12
18#ifndef __ASM_ARCH_USBCONTROL_H 13#ifndef __ASM_ARCH_USBCONTROL_H
diff --git a/include/asm-arm/arch-s3c2410/vmalloc.h b/include/asm-arm/arch-s3c2410/vmalloc.h
index 33963cd5461b..0ae3bdb7e03b 100644
--- a/include/asm-arm/arch-s3c2410/vmalloc.h
+++ b/include/asm-arm/arch-s3c2410/vmalloc.h
@@ -10,11 +10,7 @@
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11 * 11 *
12 * S3C2410 vmalloc definition 12 * S3C2410 vmalloc definition
13 * 13*/
14 * Changelog:
15 * 12-Mar-2004 BJD Fixed header, added include protection
16 * 12=Mar-2004 BJD Fixed VMALLOC_END definitions
17 */
18 14
19#ifndef __ASM_ARCH_VMALLOC_H 15#ifndef __ASM_ARCH_VMALLOC_H
20#define __ASM_ARCH_VMALLOC_H 16#define __ASM_ARCH_VMALLOC_H
diff --git a/include/asm-arm/arch-s3c2410/vr1000-cpld.h b/include/asm-arm/arch-s3c2410/vr1000-cpld.h
index 0ee373ac60d4..a341b1e1bd98 100644
--- a/include/asm-arm/arch-s3c2410/vr1000-cpld.h
+++ b/include/asm-arm/arch-s3c2410/vr1000-cpld.h
@@ -8,10 +8,6 @@
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
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11 *
12 * Changelog:
13 * 25-May-2003 BJD Created file, added CTRL1 registers
14 * 19-Mar-2004 BJD Added VR1000 CPLD definitions
15*/ 11*/
16 12
17#ifndef __ASM_ARCH_VR1000CPLD_H 13#ifndef __ASM_ARCH_VR1000CPLD_H
diff --git a/include/asm-arm/arch-s3c2410/vr1000-irq.h b/include/asm-arm/arch-s3c2410/vr1000-irq.h
index 694f7715d2da..c39a0ffa670d 100644
--- a/include/asm-arm/arch-s3c2410/vr1000-irq.h
+++ b/include/asm-arm/arch-s3c2410/vr1000-irq.h
@@ -8,11 +8,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
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11 * 11*/
12 * Changelog:
13 * 06-Jan-2003 BJD Linux 2.6.0 version
14 * 19-Mar-2004 BJD Updates for VR1000
15 */
16 12
17#ifndef __ASM_ARCH_VR1000IRQ_H 13#ifndef __ASM_ARCH_VR1000IRQ_H
18#define __ASM_ARCH_VR1000IRQ_H 14#define __ASM_ARCH_VR1000IRQ_H
diff --git a/include/asm-arm/arch-s3c2410/vr1000-map.h b/include/asm-arm/arch-s3c2410/vr1000-map.h
index 867c9355fd39..1fe4db36c834 100644
--- a/include/asm-arm/arch-s3c2410/vr1000-map.h
+++ b/include/asm-arm/arch-s3c2410/vr1000-map.h
@@ -8,12 +8,6 @@
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
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11 *
12 * Changelog:
13 * 06-Jan-2003 BJD Linux 2.6.0 version, split specifics from arch/map.h
14 * 12-Mar-2004 BJD Fixed header include protection
15 * 19-Mar-2004 BJD Copied to VR1000 machine headers.
16 * 19-Jan-2005 BJD Updated map definitions
17*/ 11*/
18 12
19/* needs arch/map.h including with this */ 13/* needs arch/map.h including with this */
diff --git a/include/asm-arm/arch-versatile/platform.h b/include/asm-arm/arch-versatile/platform.h
index 72ef874567d5..2af9d7c9c63c 100644
--- a/include/asm-arm/arch-versatile/platform.h
+++ b/include/asm-arm/arch-versatile/platform.h
@@ -65,6 +65,8 @@
65#define VERSATILE_SYS_OSC1_OFFSET 0x1C 65#define VERSATILE_SYS_OSC1_OFFSET 0x1C
66#endif 66#endif
67 67
68#define VERSATILE_SYS_OSCCLCD_OFFSET 0x1c
69
68#define VERSATILE_SYS_LOCK_OFFSET 0x20 70#define VERSATILE_SYS_LOCK_OFFSET 0x20
69#define VERSATILE_SYS_100HZ_OFFSET 0x24 71#define VERSATILE_SYS_100HZ_OFFSET 0x24
70#define VERSATILE_SYS_CFGDATA1_OFFSET 0x28 72#define VERSATILE_SYS_CFGDATA1_OFFSET 0x28
diff --git a/include/asm-arm/cacheflush.h b/include/asm-arm/cacheflush.h
index fe0c744e0266..e4a2569c636c 100644
--- a/include/asm-arm/cacheflush.h
+++ b/include/asm-arm/cacheflush.h
@@ -247,14 +247,12 @@ extern void dmac_flush_range(unsigned long, unsigned long);
247 */ 247 */
248#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ 248#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
249 do { \ 249 do { \
250 flush_cache_page(vma, vaddr, page_to_pfn(page));\
251 memcpy(dst, src, len); \ 250 memcpy(dst, src, len); \
252 flush_dcache_page(page); \ 251 flush_ptrace_access(vma, page, vaddr, dst, len, 1);\
253 } while (0) 252 } while (0)
254 253
255#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ 254#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
256 do { \ 255 do { \
257 flush_cache_page(vma, vaddr, page_to_pfn(page));\
258 memcpy(dst, src, len); \ 256 memcpy(dst, src, len); \
259 } while (0) 257 } while (0)
260 258
@@ -285,10 +283,24 @@ flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsigned l
285 __cpuc_flush_user_range(addr, addr + PAGE_SIZE, vma->vm_flags); 283 __cpuc_flush_user_range(addr, addr + PAGE_SIZE, vma->vm_flags);
286 } 284 }
287} 285}
286
287static inline void
288flush_ptrace_access(struct vm_area_struct *vma, struct page *page,
289 unsigned long uaddr, void *kaddr,
290 unsigned long len, int write)
291{
292 if (cpu_isset(smp_processor_id(), vma->vm_mm->cpu_vm_mask)) {
293 unsigned long addr = (unsigned long)kaddr;
294 __cpuc_coherent_kern_range(addr, addr + len);
295 }
296}
288#else 297#else
289extern void flush_cache_mm(struct mm_struct *mm); 298extern void flush_cache_mm(struct mm_struct *mm);
290extern void flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end); 299extern void flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end);
291extern void flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsigned long pfn); 300extern void flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsigned long pfn);
301extern void flush_ptrace_access(struct vm_area_struct *vma, struct page *page,
302 unsigned long uaddr, void *kaddr,
303 unsigned long len, int write);
292#endif 304#endif
293 305
294/* 306/*
diff --git a/include/asm-arm/elf.h b/include/asm-arm/elf.h
index 71061ca5c5d0..ae7baa6c73f7 100644
--- a/include/asm-arm/elf.h
+++ b/include/asm-arm/elf.h
@@ -8,7 +8,9 @@
8 8
9#include <asm/ptrace.h> 9#include <asm/ptrace.h>
10#include <asm/user.h> 10#include <asm/user.h>
11#ifdef __KERNEL
11#include <asm/procinfo.h> 12#include <asm/procinfo.h>
13#endif
12 14
13typedef unsigned long elf_greg_t; 15typedef unsigned long elf_greg_t;
14typedef unsigned long elf_freg_t[3]; 16typedef unsigned long elf_freg_t[3];
diff --git a/include/asm-arm/hardware/ssp.h b/include/asm-arm/hardware/ssp.h
index 28aa11b769cd..3b42e181997c 100644
--- a/include/asm-arm/hardware/ssp.h
+++ b/include/asm-arm/hardware/ssp.h
@@ -16,8 +16,8 @@ struct ssp_state {
16}; 16};
17 17
18int ssp_write_word(u16 data); 18int ssp_write_word(u16 data);
19int ssp_read_word(void); 19int ssp_read_word(u16 *data);
20void ssp_flush(void); 20int ssp_flush(void);
21void ssp_enable(void); 21void ssp_enable(void);
22void ssp_disable(void); 22void ssp_disable(void);
23void ssp_save_state(struct ssp_state *ssp); 23void ssp_save_state(struct ssp_state *ssp);
diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h
index b3479fc1cc8f..bf7b9dea30f1 100644
--- a/include/asm-arm/io.h
+++ b/include/asm-arm/io.h
@@ -291,5 +291,12 @@ extern void pci_iounmap(struct pci_dev *dev, void __iomem *addr);
291 */ 291 */
292#define xlate_dev_kmem_ptr(p) p 292#define xlate_dev_kmem_ptr(p) p
293 293
294/*
295 * Register ISA memory and port locations for glibc iopl/inb/outb
296 * emulation.
297 */
298extern void register_isa_ports(unsigned int mmio, unsigned int io,
299 unsigned int io_shift);
300
294#endif /* __KERNEL__ */ 301#endif /* __KERNEL__ */
295#endif /* __ASM_ARM_IO_H */ 302#endif /* __ASM_ARM_IO_H */
diff --git a/include/asm-arm/page.h b/include/asm-arm/page.h
index 63d12f0244c5..b721270b9986 100644
--- a/include/asm-arm/page.h
+++ b/include/asm-arm/page.h
@@ -193,8 +193,8 @@ extern pmd_t *top_pmd;
193#define ARCH_SLAB_MINALIGN 8 193#define ARCH_SLAB_MINALIGN 8
194#endif 194#endif
195 195
196#endif /* __KERNEL__ */
197
198#include <asm-generic/page.h> 196#include <asm-generic/page.h>
199 197
198#endif /* __KERNEL__ */
199
200#endif 200#endif
diff --git a/include/asm-arm/procinfo.h b/include/asm-arm/procinfo.h
index edb7b6502fcf..91a31adfa8a8 100644
--- a/include/asm-arm/procinfo.h
+++ b/include/asm-arm/procinfo.h
@@ -55,5 +55,6 @@ extern unsigned int elf_hwcap;
55#define HWCAP_VFP 64 55#define HWCAP_VFP 64
56#define HWCAP_EDSP 128 56#define HWCAP_EDSP 128
57#define HWCAP_JAVA 256 57#define HWCAP_JAVA 256
58#define HWCAP_IWMMXT 512
58 59
59#endif 60#endif
diff --git a/include/asm-arm/spinlock.h b/include/asm-arm/spinlock.h
index 406ca97a8ab2..01b7c26a3038 100644
--- a/include/asm-arm/spinlock.h
+++ b/include/asm-arm/spinlock.h
@@ -199,7 +199,21 @@ static inline void __raw_read_unlock(raw_rwlock_t *rw)
199 : "cc"); 199 : "cc");
200} 200}
201 201
202#define __raw_read_trylock(lock) generic__raw_read_trylock(lock) 202static inline int __raw_read_trylock(raw_rwlock_t *rw)
203{
204 unsigned long tmp, tmp2 = 1;
205
206 __asm__ __volatile__(
207"1: ldrex %0, [%2]\n"
208" adds %0, %0, #1\n"
209" strexpl %1, %0, [%2]\n"
210 : "=&r" (tmp), "+r" (tmp2)
211 : "r" (&rw->lock)
212 : "cc");
213
214 smp_mb();
215 return tmp2 == 0;
216}
203 217
204/* read_can_lock - would read_trylock() succeed? */ 218/* read_can_lock - would read_trylock() succeed? */
205#define __raw_read_can_lock(x) ((x)->lock < 0x80000000) 219#define __raw_read_can_lock(x) ((x)->lock < 0x80000000)
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h
index 6001febfe63b..0947cbf9b69a 100644
--- a/include/asm-arm/system.h
+++ b/include/asm-arm/system.h
@@ -176,7 +176,6 @@ extern unsigned int user_debug;
176#define wmb() mb() 176#define wmb() mb()
177#define read_barrier_depends() do { } while(0) 177#define read_barrier_depends() do { } while(0)
178#define set_mb(var, value) do { var = value; mb(); } while (0) 178#define set_mb(var, value) do { var = value; mb(); } while (0)
179#define set_wmb(var, value) do { var = value; wmb(); } while (0)
180#define nop() __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t"); 179#define nop() __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t");
181 180
182/* 181/*
diff --git a/include/asm-arm26/system.h b/include/asm-arm26/system.h
index d1f69d706198..00ae32aa1dba 100644
--- a/include/asm-arm26/system.h
+++ b/include/asm-arm26/system.h
@@ -90,7 +90,6 @@ extern unsigned int user_debug;
90 90
91#define read_barrier_depends() do { } while(0) 91#define read_barrier_depends() do { } while(0)
92#define set_mb(var, value) do { var = value; mb(); } while (0) 92#define set_mb(var, value) do { var = value; mb(); } while (0)
93#define set_wmb(var, value) do { var = value; wmb(); } while (0)
94 93
95/* 94/*
96 * We assume knowledge of how 95 * We assume knowledge of how
diff --git a/include/asm-cris/system.h b/include/asm-cris/system.h
index b1c593b6dbff..b869f6161aaa 100644
--- a/include/asm-cris/system.h
+++ b/include/asm-cris/system.h
@@ -17,7 +17,6 @@ extern struct task_struct *resume(struct task_struct *prev, struct task_struct *
17#define wmb() mb() 17#define wmb() mb()
18#define read_barrier_depends() do { } while(0) 18#define read_barrier_depends() do { } while(0)
19#define set_mb(var, value) do { var = value; mb(); } while (0) 19#define set_mb(var, value) do { var = value; mb(); } while (0)
20#define set_wmb(var, value) do { var = value; wmb(); } while (0)
21 20
22#ifdef CONFIG_SMP 21#ifdef CONFIG_SMP
23#define smp_mb() mb() 22#define smp_mb() mb()
diff --git a/include/asm-frv/elf.h b/include/asm-frv/elf.h
index 38656da00e40..7df58a3e6e4a 100644
--- a/include/asm-frv/elf.h
+++ b/include/asm-frv/elf.h
@@ -64,7 +64,7 @@ typedef unsigned long elf_greg_t;
64#define ELF_NGREG (sizeof(struct pt_regs) / sizeof(elf_greg_t)) 64#define ELF_NGREG (sizeof(struct pt_regs) / sizeof(elf_greg_t))
65typedef elf_greg_t elf_gregset_t[ELF_NGREG]; 65typedef elf_greg_t elf_gregset_t[ELF_NGREG];
66 66
67typedef struct fpmedia_struct elf_fpregset_t; 67typedef struct user_fpmedia_regs elf_fpregset_t;
68 68
69/* 69/*
70 * This is used to ensure we don't load something for the wrong architecture. 70 * This is used to ensure we don't load something for the wrong architecture.
@@ -116,6 +116,7 @@ do { \
116} while(0) 116} while(0)
117 117
118#define USE_ELF_CORE_DUMP 118#define USE_ELF_CORE_DUMP
119#define ELF_FDPIC_CORE_EFLAGS EF_FRV_FDPIC
119#define ELF_EXEC_PAGESIZE 16384 120#define ELF_EXEC_PAGESIZE 16384
120 121
121/* This is the location that an ET_DYN program is loaded if exec'ed. Typical 122/* This is the location that an ET_DYN program is loaded if exec'ed. Typical
@@ -125,9 +126,6 @@ do { \
125 126
126#define ELF_ET_DYN_BASE 0x08000000UL 127#define ELF_ET_DYN_BASE 0x08000000UL
127 128
128#define ELF_CORE_COPY_REGS(pr_reg, regs) \
129 memcpy(&pr_reg[0], &regs->sp, 31 * sizeof(uint32_t));
130
131/* This yields a mask that user programs can use to figure out what 129/* This yields a mask that user programs can use to figure out what
132 instruction set this cpu supports. */ 130 instruction set this cpu supports. */
133 131
diff --git a/include/asm-frv/gdb-stub.h b/include/asm-frv/gdb-stub.h
index c58479a4be99..24f9738670bd 100644
--- a/include/asm-frv/gdb-stub.h
+++ b/include/asm-frv/gdb-stub.h
@@ -89,6 +89,7 @@ extern void gdbstub_do_rx(void);
89 89
90extern asmlinkage void __debug_stub_init_break(void); 90extern asmlinkage void __debug_stub_init_break(void);
91extern asmlinkage void __break_hijack_kernel_event(void); 91extern asmlinkage void __break_hijack_kernel_event(void);
92extern asmlinkage void __break_hijack_kernel_event_breaks_here(void);
92extern asmlinkage void start_kernel(void); 93extern asmlinkage void start_kernel(void);
93 94
94extern asmlinkage void gdbstub_rx_handler(void); 95extern asmlinkage void gdbstub_rx_handler(void);
@@ -114,5 +115,26 @@ extern void console_set_baud(unsigned baud);
114#define gdbstub_proto(FMT,...) ({ 0; }) 115#define gdbstub_proto(FMT,...) ({ 0; })
115#endif 116#endif
116 117
118/*
119 * we dedicate GR31 to keeping a pointer to the gdbstub exception frame
120 * - gr31 is destroyed on entry to the gdbstub if !MMU
121 * - gr31 is saved in scr3 on entry to the gdbstub if in !MMU
122 */
123register struct frv_frame0 *__debug_frame0 asm("gr31");
124
125#define __debug_frame (&__debug_frame0->regs)
126#define __debug_user_context (&__debug_frame0->uc)
127#define __debug_regs (&__debug_frame0->debug)
128#define __debug_reg(X) ((unsigned long *) ((unsigned long) &__debug_frame0 + (X)))
129
130struct frv_debug_status {
131 unsigned long bpsr;
132 unsigned long dcr;
133 unsigned long brr;
134 unsigned long nmar;
135};
136
137extern struct frv_debug_status __debug_status;
138
117#endif /* _LANGUAGE_ASSEMBLY */ 139#endif /* _LANGUAGE_ASSEMBLY */
118#endif /* __ASM_GDB_STUB_H */ 140#endif /* __ASM_GDB_STUB_H */
diff --git a/include/asm-frv/processor.h b/include/asm-frv/processor.h
index 1c4dba1c5f57..3744f2e47f48 100644
--- a/include/asm-frv/processor.h
+++ b/include/asm-frv/processor.h
@@ -21,6 +21,7 @@
21 */ 21 */
22#define current_text_addr() ({ __label__ _l; _l: &&_l;}) 22#define current_text_addr() ({ __label__ _l; _l: &&_l;})
23 23
24#include <linux/compiler.h>
24#include <linux/linkage.h> 25#include <linux/linkage.h>
25#include <asm/sections.h> 26#include <asm/sections.h>
26#include <asm/segment.h> 27#include <asm/segment.h>
@@ -139,7 +140,7 @@ unsigned long get_wchan(struct task_struct *p);
139extern struct task_struct *alloc_task_struct(void); 140extern struct task_struct *alloc_task_struct(void);
140extern void free_task_struct(struct task_struct *p); 141extern void free_task_struct(struct task_struct *p);
141 142
142#define cpu_relax() do { } while (0) 143#define cpu_relax() barrier()
143 144
144/* data cache prefetch */ 145/* data cache prefetch */
145#define ARCH_HAS_PREFETCH 146#define ARCH_HAS_PREFETCH
diff --git a/include/asm-frv/ptrace.h b/include/asm-frv/ptrace.h
index b2cce0718e57..7ff525162a72 100644
--- a/include/asm-frv/ptrace.h
+++ b/include/asm-frv/ptrace.h
@@ -62,18 +62,10 @@
62#ifndef __ASSEMBLY__ 62#ifndef __ASSEMBLY__
63 63
64/* 64/*
65 * dedicate GR28; to keeping the a pointer to the current exception frame 65 * we dedicate GR28 to keeping a pointer to the current exception frame
66 * - gr28 is destroyed on entry to the kernel from userspace
66 */ 67 */
67register struct pt_regs *__frame asm("gr28"); 68register struct pt_regs *__frame asm("gr28");
68register struct pt_regs *__debug_frame asm("gr31");
69
70#ifndef container_of
71#define container_of(ptr, type, member) ({ \
72 const typeof( ((type *)0)->member ) *__mptr = (ptr); \
73 (type *)( (char *)__mptr - offsetof(type,member) );})
74#endif
75
76#define __debug_regs container_of(__debug_frame, struct pt_debug_regs, normal_regs)
77 69
78#define user_mode(regs) (!((regs)->psr & PSR_S)) 70#define user_mode(regs) (!((regs)->psr & PSR_S))
79#define instruction_pointer(regs) ((regs)->pc) 71#define instruction_pointer(regs) ((regs)->pc)
diff --git a/include/asm-frv/registers.h b/include/asm-frv/registers.h
index fccfd95cff68..9666119fcf6e 100644
--- a/include/asm-frv/registers.h
+++ b/include/asm-frv/registers.h
@@ -23,7 +23,13 @@
23 * 23 *
24 * +0x2000 +---------------------- 24 * +0x2000 +----------------------
25 * | union { 25 * | union {
26 * | struct user_context 26 * | struct frv_frame0 {
27 * | struct user_context {
28 * | struct user_int_regs
29 * | struct user_fpmedia_regs
30 * | }
31 * | struct frv_debug_regs
32 * | }
27 * | struct pt_regs [user exception] 33 * | struct pt_regs [user exception]
28 * | } 34 * | }
29 * +---------------------- <-- __kernel_frame0_ptr (maybe GR28) 35 * +---------------------- <-- __kernel_frame0_ptr (maybe GR28)
@@ -51,11 +57,11 @@
51#define _ASM_REGISTERS_H 57#define _ASM_REGISTERS_H
52 58
53#ifndef __ASSEMBLY__ 59#ifndef __ASSEMBLY__
54#define __OFFSET(X) (X) 60#define __OFFSET(X,N) ((X)+(N)*4)
55#define __OFFSETC(X,N) xxxxxxxxxxxxxxxxxxxxxxxx 61#define __OFFSETC(X,N) xxxxxxxxxxxxxxxxxxxxxxxx
56#else 62#else
57#define __OFFSET(X) ((X)*4) 63#define __OFFSET(X,N) ((X)+(N)*4)
58#define __OFFSETC(X,N) ((X)*4+(N)) 64#define __OFFSETC(X,N) ((X)+(N))
59#endif 65#endif
60 66
61/*****************************************************************************/ 67/*****************************************************************************/
@@ -117,30 +123,13 @@ struct pt_regs {
117 123
118#endif 124#endif
119 125
120#define REG_PSR __OFFSET( 0) /* Processor Status Register */
121#define REG_ISR __OFFSET( 1) /* Integer Status Register */
122#define REG_CCR __OFFSET( 2) /* Condition Code Register */
123#define REG_CCCR __OFFSET( 3) /* Condition Code for Conditional Insns Register */
124#define REG_LR __OFFSET( 4) /* Link Register */
125#define REG_LCR __OFFSET( 5) /* Loop Count Register */
126#define REG_PC __OFFSET( 6) /* Program Counter */
127
128#define REG__STATUS __OFFSET( 7) /* exception status */
129#define REG__STATUS_STEP 0x00000001 /* - reenable single stepping on return */ 126#define REG__STATUS_STEP 0x00000001 /* - reenable single stepping on return */
130#define REG__STATUS_STEPPED 0x00000002 /* - single step caused exception */ 127#define REG__STATUS_STEPPED 0x00000002 /* - single step caused exception */
131#define REG__STATUS_BROKE 0x00000004 /* - BREAK insn caused exception */ 128#define REG__STATUS_BROKE 0x00000004 /* - BREAK insn caused exception */
132#define REG__STATUS_SYSC_ENTRY 0x40000000 /* - T on syscall entry (ptrace.c only) */ 129#define REG__STATUS_SYSC_ENTRY 0x40000000 /* - T on syscall entry (ptrace.c only) */
133#define REG__STATUS_SYSC_EXIT 0x80000000 /* - T on syscall exit (ptrace.c only) */ 130#define REG__STATUS_SYSC_EXIT 0x80000000 /* - T on syscall exit (ptrace.c only) */
134 131
135#define REG_SYSCALLNO __OFFSET( 8) /* syscall number or -1 */ 132#define REG_GR(R) __OFFSET(REG_GR0, (R))
136#define REG_ORIG_GR8 __OFFSET( 9) /* saved GR8 for signal handling */
137#define REG_GNER0 __OFFSET(10)
138#define REG_GNER1 __OFFSET(11)
139#define REG_IACC0 __OFFSET(12)
140
141#define REG_TBR __OFFSET(14) /* Trap Vector Register */
142#define REG_GR(R) __OFFSET((14+(R)))
143#define REG__END REG_GR(32)
144 133
145#define REG_SP REG_GR(1) 134#define REG_SP REG_GR(1)
146#define REG_FP REG_GR(2) 135#define REG_FP REG_GR(2)
@@ -149,27 +138,21 @@ struct pt_regs {
149 138
150/*****************************************************************************/ 139/*****************************************************************************/
151/* 140/*
152 * extension tacked in front of the exception frame in debug mode 141 * debugging registers
153 */ 142 */
154#ifndef __ASSEMBLY__ 143#ifndef __ASSEMBLY__
155 144
156struct pt_debug_regs 145struct frv_debug_regs
157{ 146{
158 unsigned long bpsr;
159 unsigned long dcr; 147 unsigned long dcr;
160 unsigned long brr; 148 unsigned long ibar[4] __attribute__((aligned(8)));
161 unsigned long nmar; 149 unsigned long dbar[4] __attribute__((aligned(8)));
162 struct pt_regs normal_regs; 150 unsigned long dbdr[4][4] __attribute__((aligned(8)));
151 unsigned long dbmr[4][4] __attribute__((aligned(8)));
163} __attribute__((aligned(8))); 152} __attribute__((aligned(8)));
164 153
165#endif 154#endif
166 155
167#define REG_NMAR __OFFSET(-1)
168#define REG_BRR __OFFSET(-2)
169#define REG_DCR __OFFSET(-3)
170#define REG_BPSR __OFFSET(-4)
171#define REG__DEBUG_XTRA __OFFSET(4)
172
173/*****************************************************************************/ 156/*****************************************************************************/
174/* 157/*
175 * userspace registers 158 * userspace registers
@@ -223,33 +206,27 @@ struct user_context
223 void *extension; 206 void *extension;
224} __attribute__((aligned(8))); 207} __attribute__((aligned(8)));
225 208
209struct frv_frame0 {
210 union {
211 struct pt_regs regs;
212 struct user_context uc;
213 };
214
215 struct frv_debug_regs debug;
216
217} __attribute__((aligned(32)));
218
226#endif 219#endif
227 220
228#define NR_USER_INT_REGS (14 + 64) 221#define __INT_GR(R) __OFFSET(__INT_GR0, (R))
229#define NR_USER_FPMEDIA_REGS (64 + 2 + 2 + 8 + 8/4 + 1) 222
230#define NR_USER_CONTEXT (NR_USER_INT_REGS + NR_USER_FPMEDIA_REGS + 1) 223#define __FPMEDIA_FR(R) __OFFSET(__FPMEDIA_FR0, (R))
231 224#define __FPMEDIA_FNER(R) __OFFSET(__FPMEDIA_FNER0, (R))
232#define USER_CONTEXT_SIZE (((NR_USER_CONTEXT + 1) & ~1) * 4) 225#define __FPMEDIA_MSR(R) __OFFSET(__FPMEDIA_MSR0, (R))
233 226#define __FPMEDIA_ACC(R) __OFFSET(__FPMEDIA_ACC0, (R))
234#define __THREAD_FRAME __OFFSET(0) 227#define __FPMEDIA_ACCG(R) __OFFSETC(__FPMEDIA_ACCG0, (R))
235#define __THREAD_CURR __OFFSET(1) 228#define __FPMEDIA_FSR(R) __OFFSET(__FPMEDIA_FSR0, (R))
236#define __THREAD_SP __OFFSET(2) 229
237#define __THREAD_FP __OFFSET(3) 230#define __THREAD_GR(R) __OFFSET(__THREAD_GR16, (R) - 16)
238#define __THREAD_LR __OFFSET(4)
239#define __THREAD_PC __OFFSET(5)
240#define __THREAD_GR(R) __OFFSET(6 + (R) - 16)
241#define __THREAD_FRAME0 __OFFSET(19)
242#define __THREAD_USER __OFFSET(19)
243
244#define __USER_INT __OFFSET(0)
245#define __INT_GR(R) __OFFSET(14 + (R))
246
247#define __USER_FPMEDIA __OFFSET(NR_USER_INT_REGS)
248#define __FPMEDIA_FR(R) __OFFSET(NR_USER_INT_REGS + (R))
249#define __FPMEDIA_FNER(R) __OFFSET(NR_USER_INT_REGS + 64 + (R))
250#define __FPMEDIA_MSR(R) __OFFSET(NR_USER_INT_REGS + 66 + (R))
251#define __FPMEDIA_ACC(R) __OFFSET(NR_USER_INT_REGS + 68 + (R))
252#define __FPMEDIA_ACCG(R) __OFFSETC(NR_USER_INT_REGS + 76, (R))
253#define __FPMEDIA_FSR(R) __OFFSET(NR_USER_INT_REGS + 78 + (R))
254 231
255#endif /* _ASM_REGISTERS_H */ 232#endif /* _ASM_REGISTERS_H */
diff --git a/include/asm-frv/system.h b/include/asm-frv/system.h
index 351863dfd06e..1166899317d7 100644
--- a/include/asm-frv/system.h
+++ b/include/asm-frv/system.h
@@ -179,7 +179,6 @@ do { \
179#define rmb() asm volatile ("membar" : : :"memory") 179#define rmb() asm volatile ("membar" : : :"memory")
180#define wmb() asm volatile ("membar" : : :"memory") 180#define wmb() asm volatile ("membar" : : :"memory")
181#define set_mb(var, value) do { var = value; mb(); } while (0) 181#define set_mb(var, value) do { var = value; mb(); } while (0)
182#define set_wmb(var, value) do { var = value; wmb(); } while (0)
183 182
184#define smp_mb() mb() 183#define smp_mb() mb()
185#define smp_rmb() rmb() 184#define smp_rmb() rmb()
diff --git a/include/asm-frv/thread_info.h b/include/asm-frv/thread_info.h
index ea426abf01d3..d66c48e6ef14 100644
--- a/include/asm-frv/thread_info.h
+++ b/include/asm-frv/thread_info.h
@@ -19,6 +19,8 @@
19#include <asm/processor.h> 19#include <asm/processor.h>
20#endif 20#endif
21 21
22#define THREAD_SIZE 8192
23
22/* 24/*
23 * low level task data that entry.S needs immediate access to 25 * low level task data that entry.S needs immediate access to
24 * - this struct should fit entirely inside of one cache line 26 * - this struct should fit entirely inside of one cache line
@@ -46,15 +48,7 @@ struct thread_info {
46 48
47#else /* !__ASSEMBLY__ */ 49#else /* !__ASSEMBLY__ */
48 50
49/* offsets into the thread_info struct for assembly code access */ 51#include <asm/asm-offsets.h>
50#define TI_TASK 0x00000000
51#define TI_EXEC_DOMAIN 0x00000004
52#define TI_FLAGS 0x00000008
53#define TI_STATUS 0x0000000C
54#define TI_CPU 0x00000010
55#define TI_PRE_COUNT 0x00000014
56#define TI_ADDR_LIMIT 0x00000018
57#define TI_RESTART_BLOCK 0x0000001C
58 52
59#endif 53#endif
60 54
@@ -83,12 +77,6 @@ struct thread_info {
83#define init_thread_info (init_thread_union.thread_info) 77#define init_thread_info (init_thread_union.thread_info)
84#define init_stack (init_thread_union.stack) 78#define init_stack (init_thread_union.stack)
85 79
86#ifdef CONFIG_SMALL_TASKS
87#define THREAD_SIZE 4096
88#else
89#define THREAD_SIZE 8192
90#endif
91
92/* how to get the thread information struct from C */ 80/* how to get the thread information struct from C */
93register struct thread_info *__current_thread_info asm("gr15"); 81register struct thread_info *__current_thread_info asm("gr15");
94 82
@@ -111,11 +99,7 @@ register struct thread_info *__current_thread_info asm("gr15");
111 99
112#define free_thread_info(info) kfree(info) 100#define free_thread_info(info) kfree(info)
113 101
114#else /* !__ASSEMBLY__ */ 102#endif /* __ASSEMBLY__ */
115
116#define THREAD_SIZE 8192
117
118#endif
119 103
120/* 104/*
121 * thread information flags 105 * thread information flags
diff --git a/include/asm-generic/Kbuild.asm b/include/asm-generic/Kbuild.asm
index d8d0bcecd23f..c00de6028fa8 100644
--- a/include/asm-generic/Kbuild.asm
+++ b/include/asm-generic/Kbuild.asm
@@ -1,11 +1,8 @@
1unifdef-y += a.out.h auxvec.h byteorder.h errno.h fcntl.h ioctl.h \ 1unifdef-y += a.out.h auxvec.h byteorder.h errno.h fcntl.h ioctl.h \
2 ioctls.h ipcbuf.h irq.h mman.h msgbuf.h param.h poll.h \ 2 ioctls.h ipcbuf.h mman.h msgbuf.h param.h poll.h \
3 posix_types.h ptrace.h resource.h sembuf.h shmbuf.h shmparam.h \ 3 posix_types.h ptrace.h resource.h sembuf.h shmbuf.h shmparam.h \
4 sigcontext.h siginfo.h signal.h socket.h sockios.h stat.h \ 4 sigcontext.h siginfo.h signal.h socket.h sockios.h stat.h \
5 statfs.h termbits.h termios.h timex.h types.h unistd.h user.h 5 statfs.h termbits.h termios.h types.h unistd.h user.h
6
7# These really shouldn't be exported
8unifdef-y += atomic.h io.h
9 6
10# These probably shouldn't be exported 7# These probably shouldn't be exported
11unifdef-y += elf.h page.h 8unifdef-y += elf.h page.h
diff --git a/include/asm-generic/audit_read.h b/include/asm-generic/audit_read.h
new file mode 100644
index 000000000000..0e87464d9847
--- /dev/null
+++ b/include/asm-generic/audit_read.h
@@ -0,0 +1,8 @@
1__NR_readlink,
2__NR_quotactl,
3__NR_listxattr,
4__NR_llistxattr,
5__NR_flistxattr,
6__NR_getxattr,
7__NR_lgetxattr,
8__NR_fgetxattr,
diff --git a/include/asm-generic/audit_write.h b/include/asm-generic/audit_write.h
new file mode 100644
index 000000000000..f10d367fb2a5
--- /dev/null
+++ b/include/asm-generic/audit_write.h
@@ -0,0 +1,11 @@
1#include <asm-generic/audit_dir_write.h>
2__NR_acct,
3__NR_swapon,
4__NR_quotactl,
5__NR_truncate,
6#ifdef __NR_truncate64
7__NR_truncate64,
8#endif
9#ifdef __NR_bind
10__NR_bind, /* bind can affect fs object only in one way... */
11#endif
diff --git a/include/asm-h8300/page.h b/include/asm-h8300/page.h
index f9f9d3eea8ed..d673077d2fd6 100644
--- a/include/asm-h8300/page.h
+++ b/include/asm-h8300/page.h
@@ -66,7 +66,6 @@ extern unsigned long memory_end;
66 66
67#define MAP_NR(addr) (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT) 67#define MAP_NR(addr) (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT)
68#define virt_to_page(addr) (mem_map + (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT)) 68#define virt_to_page(addr) (mem_map + (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT))
69#define virt_to_page(addr) (mem_map + (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT))
70#define page_to_virt(page) ((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET) 69#define page_to_virt(page) ((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET)
71#define pfn_valid(page) (page < max_mapnr) 70#define pfn_valid(page) (page < max_mapnr)
72 71
diff --git a/include/asm-h8300/processor.h b/include/asm-h8300/processor.h
index c7e2f454b83a..99b664aa2083 100644
--- a/include/asm-h8300/processor.h
+++ b/include/asm-h8300/processor.h
@@ -17,6 +17,7 @@
17 */ 17 */
18#define current_text_addr() ({ __label__ _l; _l: &&_l;}) 18#define current_text_addr() ({ __label__ _l; _l: &&_l;})
19 19
20#include <linux/compiler.h>
20#include <asm/segment.h> 21#include <asm/segment.h>
21#include <asm/fpu.h> 22#include <asm/fpu.h>
22#include <asm/ptrace.h> 23#include <asm/ptrace.h>
@@ -129,6 +130,6 @@ unsigned long get_wchan(struct task_struct *p);
129 eip; }) 130 eip; })
130#define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp) 131#define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp)
131 132
132#define cpu_relax() do { } while (0) 133#define cpu_relax() barrier()
133 134
134#endif 135#endif
diff --git a/include/asm-h8300/system.h b/include/asm-h8300/system.h
index 134e0929fce5..5084a9d42922 100644
--- a/include/asm-h8300/system.h
+++ b/include/asm-h8300/system.h
@@ -84,7 +84,6 @@ asmlinkage void resume(void);
84#define wmb() asm volatile ("" : : :"memory") 84#define wmb() asm volatile ("" : : :"memory")
85#define set_rmb(var, value) do { xchg(&var, value); } while (0) 85#define set_rmb(var, value) do { xchg(&var, value); } while (0)
86#define set_mb(var, value) set_rmb(var, value) 86#define set_mb(var, value) set_rmb(var, value)
87#define set_wmb(var, value) do { var = value; wmb(); } while (0)
88 87
89#ifdef CONFIG_SMP 88#ifdef CONFIG_SMP
90#define smp_mb() mb() 89#define smp_mb() mb()
diff --git a/include/asm-i386/Kbuild b/include/asm-i386/Kbuild
index c064a8e9170f..2308190321da 100644
--- a/include/asm-i386/Kbuild
+++ b/include/asm-i386/Kbuild
@@ -1,5 +1,5 @@
1include include/asm-generic/Kbuild.asm 1include include/asm-generic/Kbuild.asm
2 2
3header-y += boot.h cpufeature.h debugreg.h ldt.h setup.h ucontext.h 3header-y += boot.h debugreg.h ldt.h ucontext.h
4 4
5unifdef-y += mtrr.h vm86.h 5unifdef-y += mtrr.h setup.h vm86.h
diff --git a/include/asm-i386/alternative.h b/include/asm-i386/alternative.h
index 96adbabec740..b01a7ec409ce 100644
--- a/include/asm-i386/alternative.h
+++ b/include/asm-i386/alternative.h
@@ -88,9 +88,6 @@ static inline void alternatives_smp_switch(int smp) {}
88/* 88/*
89 * Alternative inline assembly for SMP. 89 * Alternative inline assembly for SMP.
90 * 90 *
91 * alternative_smp() takes two versions (SMP first, UP second) and is
92 * for more complex stuff such as spinlocks.
93 *
94 * The LOCK_PREFIX macro defined here replaces the LOCK and 91 * The LOCK_PREFIX macro defined here replaces the LOCK and
95 * LOCK_PREFIX macros used everywhere in the source tree. 92 * LOCK_PREFIX macros used everywhere in the source tree.
96 * 93 *
@@ -110,21 +107,6 @@ static inline void alternatives_smp_switch(int smp) {}
110 */ 107 */
111 108
112#ifdef CONFIG_SMP 109#ifdef CONFIG_SMP
113#define alternative_smp(smpinstr, upinstr, args...) \
114 asm volatile ("661:\n\t" smpinstr "\n662:\n" \
115 ".section .smp_altinstructions,\"a\"\n" \
116 " .align 4\n" \
117 " .long 661b\n" /* label */ \
118 " .long 663f\n" /* new instruction */ \
119 " .byte 0x68\n" /* X86_FEATURE_UP */ \
120 " .byte 662b-661b\n" /* sourcelen */ \
121 " .byte 664f-663f\n" /* replacementlen */ \
122 ".previous\n" \
123 ".section .smp_altinstr_replacement,\"awx\"\n" \
124 "663:\n\t" upinstr "\n" /* replacement */ \
125 "664:\n\t.fill 662b-661b,1,0x42\n" /* space for original */ \
126 ".previous" : args)
127
128#define LOCK_PREFIX \ 110#define LOCK_PREFIX \
129 ".section .smp_locks,\"a\"\n" \ 111 ".section .smp_locks,\"a\"\n" \
130 " .align 4\n" \ 112 " .align 4\n" \
@@ -133,8 +115,6 @@ static inline void alternatives_smp_switch(int smp) {}
133 "661:\n\tlock; " 115 "661:\n\tlock; "
134 116
135#else /* ! CONFIG_SMP */ 117#else /* ! CONFIG_SMP */
136#define alternative_smp(smpinstr, upinstr, args...) \
137 asm volatile (upinstr : args)
138#define LOCK_PREFIX "" 118#define LOCK_PREFIX ""
139#endif 119#endif
140 120
diff --git a/include/asm-i386/atomic.h b/include/asm-i386/atomic.h
index 4f061fa73794..51a166242522 100644
--- a/include/asm-i386/atomic.h
+++ b/include/asm-i386/atomic.h
@@ -46,8 +46,8 @@ static __inline__ void atomic_add(int i, atomic_t *v)
46{ 46{
47 __asm__ __volatile__( 47 __asm__ __volatile__(
48 LOCK_PREFIX "addl %1,%0" 48 LOCK_PREFIX "addl %1,%0"
49 :"=m" (v->counter) 49 :"+m" (v->counter)
50 :"ir" (i), "m" (v->counter)); 50 :"ir" (i));
51} 51}
52 52
53/** 53/**
@@ -61,8 +61,8 @@ static __inline__ void atomic_sub(int i, atomic_t *v)
61{ 61{
62 __asm__ __volatile__( 62 __asm__ __volatile__(
63 LOCK_PREFIX "subl %1,%0" 63 LOCK_PREFIX "subl %1,%0"
64 :"=m" (v->counter) 64 :"+m" (v->counter)
65 :"ir" (i), "m" (v->counter)); 65 :"ir" (i));
66} 66}
67 67
68/** 68/**
@@ -80,8 +80,8 @@ static __inline__ int atomic_sub_and_test(int i, atomic_t *v)
80 80
81 __asm__ __volatile__( 81 __asm__ __volatile__(
82 LOCK_PREFIX "subl %2,%0; sete %1" 82 LOCK_PREFIX "subl %2,%0; sete %1"
83 :"=m" (v->counter), "=qm" (c) 83 :"+m" (v->counter), "=qm" (c)
84 :"ir" (i), "m" (v->counter) : "memory"); 84 :"ir" (i) : "memory");
85 return c; 85 return c;
86} 86}
87 87
@@ -95,8 +95,7 @@ static __inline__ void atomic_inc(atomic_t *v)
95{ 95{
96 __asm__ __volatile__( 96 __asm__ __volatile__(
97 LOCK_PREFIX "incl %0" 97 LOCK_PREFIX "incl %0"
98 :"=m" (v->counter) 98 :"+m" (v->counter));
99 :"m" (v->counter));
100} 99}
101 100
102/** 101/**
@@ -109,8 +108,7 @@ static __inline__ void atomic_dec(atomic_t *v)
109{ 108{
110 __asm__ __volatile__( 109 __asm__ __volatile__(
111 LOCK_PREFIX "decl %0" 110 LOCK_PREFIX "decl %0"
112 :"=m" (v->counter) 111 :"+m" (v->counter));
113 :"m" (v->counter));
114} 112}
115 113
116/** 114/**
@@ -127,8 +125,8 @@ static __inline__ int atomic_dec_and_test(atomic_t *v)
127 125
128 __asm__ __volatile__( 126 __asm__ __volatile__(
129 LOCK_PREFIX "decl %0; sete %1" 127 LOCK_PREFIX "decl %0; sete %1"
130 :"=m" (v->counter), "=qm" (c) 128 :"+m" (v->counter), "=qm" (c)
131 :"m" (v->counter) : "memory"); 129 : : "memory");
132 return c != 0; 130 return c != 0;
133} 131}
134 132
@@ -146,8 +144,8 @@ static __inline__ int atomic_inc_and_test(atomic_t *v)
146 144
147 __asm__ __volatile__( 145 __asm__ __volatile__(
148 LOCK_PREFIX "incl %0; sete %1" 146 LOCK_PREFIX "incl %0; sete %1"
149 :"=m" (v->counter), "=qm" (c) 147 :"+m" (v->counter), "=qm" (c)
150 :"m" (v->counter) : "memory"); 148 : : "memory");
151 return c != 0; 149 return c != 0;
152} 150}
153 151
@@ -166,8 +164,8 @@ static __inline__ int atomic_add_negative(int i, atomic_t *v)
166 164
167 __asm__ __volatile__( 165 __asm__ __volatile__(
168 LOCK_PREFIX "addl %2,%0; sets %1" 166 LOCK_PREFIX "addl %2,%0; sets %1"
169 :"=m" (v->counter), "=qm" (c) 167 :"+m" (v->counter), "=qm" (c)
170 :"ir" (i), "m" (v->counter) : "memory"); 168 :"ir" (i) : "memory");
171 return c; 169 return c;
172} 170}
173 171
diff --git a/include/asm-i386/elf.h b/include/asm-i386/elf.h
index 1eac92cb5b16..db4344d9f73f 100644
--- a/include/asm-i386/elf.h
+++ b/include/asm-i386/elf.h
@@ -7,10 +7,7 @@
7 7
8#include <asm/ptrace.h> 8#include <asm/ptrace.h>
9#include <asm/user.h> 9#include <asm/user.h>
10#include <asm/processor.h>
11#include <asm/system.h> /* for savesegment */
12#include <asm/auxvec.h> 10#include <asm/auxvec.h>
13#include <asm/desc.h>
14 11
15#include <linux/utsname.h> 12#include <linux/utsname.h>
16 13
@@ -48,6 +45,12 @@ typedef struct user_fxsr_struct elf_fpxregset_t;
48#define ELF_DATA ELFDATA2LSB 45#define ELF_DATA ELFDATA2LSB
49#define ELF_ARCH EM_386 46#define ELF_ARCH EM_386
50 47
48#ifdef __KERNEL__
49
50#include <asm/processor.h>
51#include <asm/system.h> /* for savesegment */
52#include <asm/desc.h>
53
51/* SVR4/i386 ABI (pages 3-31, 3-32) says that when the program starts %edx 54/* SVR4/i386 ABI (pages 3-31, 3-32) says that when the program starts %edx
52 contains a pointer to a function which might be registered using `atexit'. 55 contains a pointer to a function which might be registered using `atexit'.
53 This provides a mean for the dynamic linker to call DT_FINI functions for 56 This provides a mean for the dynamic linker to call DT_FINI functions for
@@ -111,7 +114,6 @@ typedef struct user_fxsr_struct elf_fpxregset_t;
111 114
112#define ELF_PLATFORM (system_utsname.machine) 115#define ELF_PLATFORM (system_utsname.machine)
113 116
114#ifdef __KERNEL__
115#define SET_PERSONALITY(ex, ibcs2) do { } while (0) 117#define SET_PERSONALITY(ex, ibcs2) do { } while (0)
116 118
117/* 119/*
diff --git a/include/asm-i386/futex.h b/include/asm-i386/futex.h
index 7b8ceefd010f..946d97cfea23 100644
--- a/include/asm-i386/futex.h
+++ b/include/asm-i386/futex.h
@@ -20,8 +20,8 @@
20 .align 8\n\ 20 .align 8\n\
21 .long 1b,3b\n\ 21 .long 1b,3b\n\
22 .previous" \ 22 .previous" \
23 : "=r" (oldval), "=r" (ret), "=m" (*uaddr) \ 23 : "=r" (oldval), "=r" (ret), "+m" (*uaddr) \
24 : "i" (-EFAULT), "m" (*uaddr), "0" (oparg), "1" (0)) 24 : "i" (-EFAULT), "0" (oparg), "1" (0))
25 25
26#define __futex_atomic_op2(insn, ret, oldval, uaddr, oparg) \ 26#define __futex_atomic_op2(insn, ret, oldval, uaddr, oparg) \
27 __asm__ __volatile ( \ 27 __asm__ __volatile ( \
@@ -38,9 +38,9 @@
38 .align 8\n\ 38 .align 8\n\
39 .long 1b,4b,2b,4b\n\ 39 .long 1b,4b,2b,4b\n\
40 .previous" \ 40 .previous" \
41 : "=&a" (oldval), "=&r" (ret), "=m" (*uaddr), \ 41 : "=&a" (oldval), "=&r" (ret), "+m" (*uaddr), \
42 "=&r" (tem) \ 42 "=&r" (tem) \
43 : "r" (oparg), "i" (-EFAULT), "m" (*uaddr), "1" (0)) 43 : "r" (oparg), "i" (-EFAULT), "1" (0))
44 44
45static inline int 45static inline int
46futex_atomic_op_inuser (int encoded_op, int __user *uaddr) 46futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
@@ -123,7 +123,7 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
123 " .long 1b,3b \n" 123 " .long 1b,3b \n"
124 " .previous \n" 124 " .previous \n"
125 125
126 : "=a" (oldval), "=m" (*uaddr) 126 : "=a" (oldval), "+m" (*uaddr)
127 : "i" (-EFAULT), "r" (newval), "0" (oldval) 127 : "i" (-EFAULT), "r" (newval), "0" (oldval)
128 : "memory" 128 : "memory"
129 ); 129 );
diff --git a/include/asm-i386/kprobes.h b/include/asm-i386/kprobes.h
index 0730a20f6db8..8774d06689da 100644
--- a/include/asm-i386/kprobes.h
+++ b/include/asm-i386/kprobes.h
@@ -45,6 +45,7 @@ typedef u8 kprobe_opcode_t;
45#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry 45#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry
46#define ARCH_SUPPORTS_KRETPROBES 46#define ARCH_SUPPORTS_KRETPROBES
47#define ARCH_INACTIVE_KPROBE_COUNT 0 47#define ARCH_INACTIVE_KPROBE_COUNT 0
48#define flush_insn_slot(p) do { } while (0)
48 49
49void arch_remove_kprobe(struct kprobe *p); 50void arch_remove_kprobe(struct kprobe *p);
50void kretprobe_trampoline(void); 51void kretprobe_trampoline(void);
diff --git a/include/asm-i386/local.h b/include/asm-i386/local.h
index 3b4998c51d08..12060e22f7e2 100644
--- a/include/asm-i386/local.h
+++ b/include/asm-i386/local.h
@@ -17,32 +17,30 @@ static __inline__ void local_inc(local_t *v)
17{ 17{
18 __asm__ __volatile__( 18 __asm__ __volatile__(
19 "incl %0" 19 "incl %0"
20 :"=m" (v->counter) 20 :"+m" (v->counter));
21 :"m" (v->counter));
22} 21}
23 22
24static __inline__ void local_dec(local_t *v) 23static __inline__ void local_dec(local_t *v)
25{ 24{
26 __asm__ __volatile__( 25 __asm__ __volatile__(
27 "decl %0" 26 "decl %0"
28 :"=m" (v->counter) 27 :"+m" (v->counter));
29 :"m" (v->counter));
30} 28}
31 29
32static __inline__ void local_add(long i, local_t *v) 30static __inline__ void local_add(long i, local_t *v)
33{ 31{
34 __asm__ __volatile__( 32 __asm__ __volatile__(
35 "addl %1,%0" 33 "addl %1,%0"
36 :"=m" (v->counter) 34 :"+m" (v->counter)
37 :"ir" (i), "m" (v->counter)); 35 :"ir" (i));
38} 36}
39 37
40static __inline__ void local_sub(long i, local_t *v) 38static __inline__ void local_sub(long i, local_t *v)
41{ 39{
42 __asm__ __volatile__( 40 __asm__ __volatile__(
43 "subl %1,%0" 41 "subl %1,%0"
44 :"=m" (v->counter) 42 :"+m" (v->counter)
45 :"ir" (i), "m" (v->counter)); 43 :"ir" (i));
46} 44}
47 45
48/* On x86, these are no better than the atomic variants. */ 46/* On x86, these are no better than the atomic variants. */
diff --git a/include/asm-i386/mach-default/mach_mpspec.h b/include/asm-i386/mach-default/mach_mpspec.h
index 6b5dadcf1d0e..51c9a9775932 100644
--- a/include/asm-i386/mach-default/mach_mpspec.h
+++ b/include/asm-i386/mach-default/mach_mpspec.h
@@ -3,6 +3,10 @@
3 3
4#define MAX_IRQ_SOURCES 256 4#define MAX_IRQ_SOURCES 256
5 5
6#if CONFIG_BASE_SMALL == 0
7#define MAX_MP_BUSSES 256
8#else
6#define MAX_MP_BUSSES 32 9#define MAX_MP_BUSSES 32
10#endif
7 11
8#endif /* __ASM_MACH_MPSPEC_H */ 12#endif /* __ASM_MACH_MPSPEC_H */
diff --git a/include/asm-i386/mmzone.h b/include/asm-i386/mmzone.h
index e33e9f9e4c66..22cb07cc8f32 100644
--- a/include/asm-i386/mmzone.h
+++ b/include/asm-i386/mmzone.h
@@ -14,7 +14,7 @@ extern struct pglist_data *node_data[];
14 14
15#ifdef CONFIG_X86_NUMAQ 15#ifdef CONFIG_X86_NUMAQ
16 #include <asm/numaq.h> 16 #include <asm/numaq.h>
17#else /* summit or generic arch */ 17#elif defined(CONFIG_ACPI_SRAT)/* summit or generic arch */
18 #include <asm/srat.h> 18 #include <asm/srat.h>
19#endif 19#endif
20 20
diff --git a/include/asm-i386/posix_types.h b/include/asm-i386/posix_types.h
index 4e47ed059ad6..133e31e7dfde 100644
--- a/include/asm-i386/posix_types.h
+++ b/include/asm-i386/posix_types.h
@@ -51,12 +51,12 @@ typedef struct {
51#undef __FD_SET 51#undef __FD_SET
52#define __FD_SET(fd,fdsetp) \ 52#define __FD_SET(fd,fdsetp) \
53 __asm__ __volatile__("btsl %1,%0": \ 53 __asm__ __volatile__("btsl %1,%0": \
54 "=m" (*(__kernel_fd_set *) (fdsetp)):"r" ((int) (fd))) 54 "+m" (*(__kernel_fd_set *) (fdsetp)):"r" ((int) (fd)))
55 55
56#undef __FD_CLR 56#undef __FD_CLR
57#define __FD_CLR(fd,fdsetp) \ 57#define __FD_CLR(fd,fdsetp) \
58 __asm__ __volatile__("btrl %1,%0": \ 58 __asm__ __volatile__("btrl %1,%0": \
59 "=m" (*(__kernel_fd_set *) (fdsetp)):"r" ((int) (fd))) 59 "+m" (*(__kernel_fd_set *) (fdsetp)):"r" ((int) (fd)))
60 60
61#undef __FD_ISSET 61#undef __FD_ISSET
62#define __FD_ISSET(fd,fdsetp) (__extension__ ({ \ 62#define __FD_ISSET(fd,fdsetp) (__extension__ ({ \
diff --git a/include/asm-i386/rwlock.h b/include/asm-i386/rwlock.h
index 94f00195d543..87c069ccba08 100644
--- a/include/asm-i386/rwlock.h
+++ b/include/asm-i386/rwlock.h
@@ -21,23 +21,21 @@
21#define RW_LOCK_BIAS_STR "0x01000000" 21#define RW_LOCK_BIAS_STR "0x01000000"
22 22
23#define __build_read_lock_ptr(rw, helper) \ 23#define __build_read_lock_ptr(rw, helper) \
24 alternative_smp("lock; subl $1,(%0)\n\t" \ 24 asm volatile(LOCK_PREFIX " subl $1,(%0)\n\t" \
25 "jns 1f\n" \ 25 "jns 1f\n" \
26 "call " helper "\n\t" \ 26 "call " helper "\n\t" \
27 "1:\n", \ 27 "1:\n" \
28 "subl $1,(%0)\n\t", \ 28 ::"a" (rw) : "memory")
29 :"a" (rw) : "memory")
30 29
31#define __build_read_lock_const(rw, helper) \ 30#define __build_read_lock_const(rw, helper) \
32 alternative_smp("lock; subl $1,%0\n\t" \ 31 asm volatile(LOCK_PREFIX " subl $1,%0\n\t" \
33 "jns 1f\n" \ 32 "jns 1f\n" \
34 "pushl %%eax\n\t" \ 33 "pushl %%eax\n\t" \
35 "leal %0,%%eax\n\t" \ 34 "leal %0,%%eax\n\t" \
36 "call " helper "\n\t" \ 35 "call " helper "\n\t" \
37 "popl %%eax\n\t" \ 36 "popl %%eax\n\t" \
38 "1:\n", \ 37 "1:\n" \
39 "subl $1,%0\n\t", \ 38 :"+m" (*(volatile int *)rw) : : "memory")
40 "=m" (*(volatile int *)rw) : : "memory")
41 39
42#define __build_read_lock(rw, helper) do { \ 40#define __build_read_lock(rw, helper) do { \
43 if (__builtin_constant_p(rw)) \ 41 if (__builtin_constant_p(rw)) \
@@ -47,23 +45,21 @@
47 } while (0) 45 } while (0)
48 46
49#define __build_write_lock_ptr(rw, helper) \ 47#define __build_write_lock_ptr(rw, helper) \
50 alternative_smp("lock; subl $" RW_LOCK_BIAS_STR ",(%0)\n\t" \ 48 asm volatile(LOCK_PREFIX " subl $" RW_LOCK_BIAS_STR ",(%0)\n\t" \
51 "jz 1f\n" \ 49 "jz 1f\n" \
52 "call " helper "\n\t" \ 50 "call " helper "\n\t" \
53 "1:\n", \ 51 "1:\n" \
54 "subl $" RW_LOCK_BIAS_STR ",(%0)\n\t", \ 52 ::"a" (rw) : "memory")
55 :"a" (rw) : "memory")
56 53
57#define __build_write_lock_const(rw, helper) \ 54#define __build_write_lock_const(rw, helper) \
58 alternative_smp("lock; subl $" RW_LOCK_BIAS_STR ",%0\n\t" \ 55 asm volatile(LOCK_PREFIX " subl $" RW_LOCK_BIAS_STR ",%0\n\t" \
59 "jz 1f\n" \ 56 "jz 1f\n" \
60 "pushl %%eax\n\t" \ 57 "pushl %%eax\n\t" \
61 "leal %0,%%eax\n\t" \ 58 "leal %0,%%eax\n\t" \
62 "call " helper "\n\t" \ 59 "call " helper "\n\t" \
63 "popl %%eax\n\t" \ 60 "popl %%eax\n\t" \
64 "1:\n", \ 61 "1:\n" \
65 "subl $" RW_LOCK_BIAS_STR ",%0\n\t", \ 62 :"+m" (*(volatile int *)rw) : : "memory")
66 "=m" (*(volatile int *)rw) : : "memory")
67 63
68#define __build_write_lock(rw, helper) do { \ 64#define __build_write_lock(rw, helper) do { \
69 if (__builtin_constant_p(rw)) \ 65 if (__builtin_constant_p(rw)) \
diff --git a/include/asm-i386/rwsem.h b/include/asm-i386/rwsem.h
index 2f07601562e7..43113f5608eb 100644
--- a/include/asm-i386/rwsem.h
+++ b/include/asm-i386/rwsem.h
@@ -111,8 +111,8 @@ LOCK_PREFIX " incl (%%eax)\n\t" /* adds 0x00000001, returns the old value
111 " jmp 1b\n" 111 " jmp 1b\n"
112 LOCK_SECTION_END 112 LOCK_SECTION_END
113 "# ending down_read\n\t" 113 "# ending down_read\n\t"
114 : "=m"(sem->count) 114 : "+m" (sem->count)
115 : "a"(sem), "m"(sem->count) 115 : "a" (sem)
116 : "memory", "cc"); 116 : "memory", "cc");
117} 117}
118 118
@@ -133,8 +133,8 @@ LOCK_PREFIX " cmpxchgl %2,%0\n\t"
133 " jnz 1b\n\t" 133 " jnz 1b\n\t"
134 "2:\n\t" 134 "2:\n\t"
135 "# ending __down_read_trylock\n\t" 135 "# ending __down_read_trylock\n\t"
136 : "+m"(sem->count), "=&a"(result), "=&r"(tmp) 136 : "+m" (sem->count), "=&a" (result), "=&r" (tmp)
137 : "i"(RWSEM_ACTIVE_READ_BIAS) 137 : "i" (RWSEM_ACTIVE_READ_BIAS)
138 : "memory", "cc"); 138 : "memory", "cc");
139 return result>=0 ? 1 : 0; 139 return result>=0 ? 1 : 0;
140} 140}
@@ -161,8 +161,8 @@ LOCK_PREFIX " xadd %%edx,(%%eax)\n\t" /* subtract 0x0000ffff, returns the
161 " jmp 1b\n" 161 " jmp 1b\n"
162 LOCK_SECTION_END 162 LOCK_SECTION_END
163 "# ending down_write" 163 "# ending down_write"
164 : "=m"(sem->count), "=d"(tmp) 164 : "+m" (sem->count), "=d" (tmp)
165 : "a"(sem), "1"(tmp), "m"(sem->count) 165 : "a" (sem), "1" (tmp)
166 : "memory", "cc"); 166 : "memory", "cc");
167} 167}
168 168
@@ -205,8 +205,8 @@ LOCK_PREFIX " xadd %%edx,(%%eax)\n\t" /* subtracts 1, returns the old valu
205 " jmp 1b\n" 205 " jmp 1b\n"
206 LOCK_SECTION_END 206 LOCK_SECTION_END
207 "# ending __up_read\n" 207 "# ending __up_read\n"
208 : "=m"(sem->count), "=d"(tmp) 208 : "+m" (sem->count), "=d" (tmp)
209 : "a"(sem), "1"(tmp), "m"(sem->count) 209 : "a" (sem), "1" (tmp)
210 : "memory", "cc"); 210 : "memory", "cc");
211} 211}
212 212
@@ -231,8 +231,8 @@ LOCK_PREFIX " xaddl %%edx,(%%eax)\n\t" /* tries to transition 0xffff0001 ->
231 " jmp 1b\n" 231 " jmp 1b\n"
232 LOCK_SECTION_END 232 LOCK_SECTION_END
233 "# ending __up_write\n" 233 "# ending __up_write\n"
234 : "=m"(sem->count) 234 : "+m" (sem->count)
235 : "a"(sem), "i"(-RWSEM_ACTIVE_WRITE_BIAS), "m"(sem->count) 235 : "a" (sem), "i" (-RWSEM_ACTIVE_WRITE_BIAS)
236 : "memory", "cc", "edx"); 236 : "memory", "cc", "edx");
237} 237}
238 238
@@ -256,8 +256,8 @@ LOCK_PREFIX " addl %2,(%%eax)\n\t" /* transitions 0xZZZZ0001 -> 0xYYYY0001
256 " jmp 1b\n" 256 " jmp 1b\n"
257 LOCK_SECTION_END 257 LOCK_SECTION_END
258 "# ending __downgrade_write\n" 258 "# ending __downgrade_write\n"
259 : "=m"(sem->count) 259 : "+m" (sem->count)
260 : "a"(sem), "i"(-RWSEM_WAITING_BIAS), "m"(sem->count) 260 : "a" (sem), "i" (-RWSEM_WAITING_BIAS)
261 : "memory", "cc"); 261 : "memory", "cc");
262} 262}
263 263
@@ -268,8 +268,8 @@ static inline void rwsem_atomic_add(int delta, struct rw_semaphore *sem)
268{ 268{
269 __asm__ __volatile__( 269 __asm__ __volatile__(
270LOCK_PREFIX "addl %1,%0" 270LOCK_PREFIX "addl %1,%0"
271 : "=m"(sem->count) 271 : "+m" (sem->count)
272 : "ir"(delta), "m"(sem->count)); 272 : "ir" (delta));
273} 273}
274 274
275/* 275/*
@@ -280,10 +280,9 @@ static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem)
280 int tmp = delta; 280 int tmp = delta;
281 281
282 __asm__ __volatile__( 282 __asm__ __volatile__(
283LOCK_PREFIX "xadd %0,(%2)" 283LOCK_PREFIX "xadd %0,%1"
284 : "+r"(tmp), "=m"(sem->count) 284 : "+r" (tmp), "+m" (sem->count)
285 : "r"(sem), "m"(sem->count) 285 : : "memory");
286 : "memory");
287 286
288 return tmp+delta; 287 return tmp+delta;
289} 288}
diff --git a/include/asm-i386/semaphore.h b/include/asm-i386/semaphore.h
index f7a0f310c524..d51e800acf29 100644
--- a/include/asm-i386/semaphore.h
+++ b/include/asm-i386/semaphore.h
@@ -107,7 +107,7 @@ static inline void down(struct semaphore * sem)
107 "call __down_failed\n\t" 107 "call __down_failed\n\t"
108 "jmp 1b\n" 108 "jmp 1b\n"
109 LOCK_SECTION_END 109 LOCK_SECTION_END
110 :"=m" (sem->count) 110 :"+m" (sem->count)
111 : 111 :
112 :"memory","ax"); 112 :"memory","ax");
113} 113}
@@ -132,7 +132,7 @@ static inline int down_interruptible(struct semaphore * sem)
132 "call __down_failed_interruptible\n\t" 132 "call __down_failed_interruptible\n\t"
133 "jmp 1b\n" 133 "jmp 1b\n"
134 LOCK_SECTION_END 134 LOCK_SECTION_END
135 :"=a" (result), "=m" (sem->count) 135 :"=a" (result), "+m" (sem->count)
136 : 136 :
137 :"memory"); 137 :"memory");
138 return result; 138 return result;
@@ -157,7 +157,7 @@ static inline int down_trylock(struct semaphore * sem)
157 "call __down_failed_trylock\n\t" 157 "call __down_failed_trylock\n\t"
158 "jmp 1b\n" 158 "jmp 1b\n"
159 LOCK_SECTION_END 159 LOCK_SECTION_END
160 :"=a" (result), "=m" (sem->count) 160 :"=a" (result), "+m" (sem->count)
161 : 161 :
162 :"memory"); 162 :"memory");
163 return result; 163 return result;
@@ -182,7 +182,7 @@ static inline void up(struct semaphore * sem)
182 "jmp 1b\n" 182 "jmp 1b\n"
183 LOCK_SECTION_END 183 LOCK_SECTION_END
184 ".subsection 0\n" 184 ".subsection 0\n"
185 :"=m" (sem->count) 185 :"+m" (sem->count)
186 : 186 :
187 :"memory","ax"); 187 :"memory","ax");
188} 188}
diff --git a/include/asm-i386/setup.h b/include/asm-i386/setup.h
index f737e423029e..2734909eff84 100644
--- a/include/asm-i386/setup.h
+++ b/include/asm-i386/setup.h
@@ -6,6 +6,7 @@
6#ifndef _i386_SETUP_H 6#ifndef _i386_SETUP_H
7#define _i386_SETUP_H 7#define _i386_SETUP_H
8 8
9#ifdef __KERNEL__
9#include <linux/pfn.h> 10#include <linux/pfn.h>
10 11
11/* 12/*
@@ -13,6 +14,7 @@
13 */ 14 */
14#define MAXMEM_PFN PFN_DOWN(MAXMEM) 15#define MAXMEM_PFN PFN_DOWN(MAXMEM)
15#define MAX_NONPAE_PFN (1 << 20) 16#define MAX_NONPAE_PFN (1 << 20)
17#endif
16 18
17#define PARAM_SIZE 4096 19#define PARAM_SIZE 4096
18#define COMMAND_LINE_SIZE 256 20#define COMMAND_LINE_SIZE 256
diff --git a/include/asm-i386/signal.h b/include/asm-i386/signal.h
index 3824a502351f..c3e8adec5918 100644
--- a/include/asm-i386/signal.h
+++ b/include/asm-i386/signal.h
@@ -2,7 +2,6 @@
2#define _ASMi386_SIGNAL_H 2#define _ASMi386_SIGNAL_H
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/linkage.h>
6#include <linux/time.h> 5#include <linux/time.h>
7#include <linux/compiler.h> 6#include <linux/compiler.h>
8 7
@@ -10,6 +9,9 @@
10struct siginfo; 9struct siginfo;
11 10
12#ifdef __KERNEL__ 11#ifdef __KERNEL__
12
13#include <linux/linkage.h>
14
13/* Most things should be clean enough to redefine this at will, if care 15/* Most things should be clean enough to redefine this at will, if care
14 is taken to make libc match. */ 16 is taken to make libc match. */
15 17
diff --git a/include/asm-i386/spinlock.h b/include/asm-i386/spinlock.h
index 87c40f830653..d1020363c41a 100644
--- a/include/asm-i386/spinlock.h
+++ b/include/asm-i386/spinlock.h
@@ -22,7 +22,7 @@
22 22
23#define __raw_spin_lock_string \ 23#define __raw_spin_lock_string \
24 "\n1:\t" \ 24 "\n1:\t" \
25 "lock ; decb %0\n\t" \ 25 LOCK_PREFIX " ; decb %0\n\t" \
26 "jns 3f\n" \ 26 "jns 3f\n" \
27 "2:\t" \ 27 "2:\t" \
28 "rep;nop\n\t" \ 28 "rep;nop\n\t" \
@@ -38,7 +38,7 @@
38 */ 38 */
39#define __raw_spin_lock_string_flags \ 39#define __raw_spin_lock_string_flags \
40 "\n1:\t" \ 40 "\n1:\t" \
41 "lock ; decb %0\n\t" \ 41 LOCK_PREFIX " ; decb %0\n\t" \
42 "jns 5f\n" \ 42 "jns 5f\n" \
43 "2:\t" \ 43 "2:\t" \
44 "testl $0x200, %1\n\t" \ 44 "testl $0x200, %1\n\t" \
@@ -57,15 +57,9 @@
57 "jmp 4b\n" \ 57 "jmp 4b\n" \
58 "5:\n\t" 58 "5:\n\t"
59 59
60#define __raw_spin_lock_string_up \
61 "\n\tdecb %0"
62
63static inline void __raw_spin_lock(raw_spinlock_t *lock) 60static inline void __raw_spin_lock(raw_spinlock_t *lock)
64{ 61{
65 alternative_smp( 62 asm(__raw_spin_lock_string : "+m" (lock->slock) : : "memory");
66 __raw_spin_lock_string,
67 __raw_spin_lock_string_up,
68 "=m" (lock->slock) : : "memory");
69} 63}
70 64
71/* 65/*
@@ -76,10 +70,7 @@ static inline void __raw_spin_lock(raw_spinlock_t *lock)
76#ifndef CONFIG_PROVE_LOCKING 70#ifndef CONFIG_PROVE_LOCKING
77static inline void __raw_spin_lock_flags(raw_spinlock_t *lock, unsigned long flags) 71static inline void __raw_spin_lock_flags(raw_spinlock_t *lock, unsigned long flags)
78{ 72{
79 alternative_smp( 73 asm(__raw_spin_lock_string_flags : "+m" (lock->slock) : "r" (flags) : "memory");
80 __raw_spin_lock_string_flags,
81 __raw_spin_lock_string_up,
82 "=m" (lock->slock) : "r" (flags) : "memory");
83} 74}
84#endif 75#endif
85 76
@@ -88,7 +79,7 @@ static inline int __raw_spin_trylock(raw_spinlock_t *lock)
88 char oldval; 79 char oldval;
89 __asm__ __volatile__( 80 __asm__ __volatile__(
90 "xchgb %b0,%1" 81 "xchgb %b0,%1"
91 :"=q" (oldval), "=m" (lock->slock) 82 :"=q" (oldval), "+m" (lock->slock)
92 :"0" (0) : "memory"); 83 :"0" (0) : "memory");
93 return oldval > 0; 84 return oldval > 0;
94} 85}
@@ -104,7 +95,7 @@ static inline int __raw_spin_trylock(raw_spinlock_t *lock)
104 95
105#define __raw_spin_unlock_string \ 96#define __raw_spin_unlock_string \
106 "movb $1,%0" \ 97 "movb $1,%0" \
107 :"=m" (lock->slock) : : "memory" 98 :"+m" (lock->slock) : : "memory"
108 99
109 100
110static inline void __raw_spin_unlock(raw_spinlock_t *lock) 101static inline void __raw_spin_unlock(raw_spinlock_t *lock)
@@ -118,7 +109,7 @@ static inline void __raw_spin_unlock(raw_spinlock_t *lock)
118 109
119#define __raw_spin_unlock_string \ 110#define __raw_spin_unlock_string \
120 "xchgb %b0, %1" \ 111 "xchgb %b0, %1" \
121 :"=q" (oldval), "=m" (lock->slock) \ 112 :"=q" (oldval), "+m" (lock->slock) \
122 :"0" (oldval) : "memory" 113 :"0" (oldval) : "memory"
123 114
124static inline void __raw_spin_unlock(raw_spinlock_t *lock) 115static inline void __raw_spin_unlock(raw_spinlock_t *lock)
@@ -199,13 +190,13 @@ static inline int __raw_write_trylock(raw_rwlock_t *lock)
199 190
200static inline void __raw_read_unlock(raw_rwlock_t *rw) 191static inline void __raw_read_unlock(raw_rwlock_t *rw)
201{ 192{
202 asm volatile(LOCK_PREFIX "incl %0" :"=m" (rw->lock) : : "memory"); 193 asm volatile(LOCK_PREFIX "incl %0" :"+m" (rw->lock) : : "memory");
203} 194}
204 195
205static inline void __raw_write_unlock(raw_rwlock_t *rw) 196static inline void __raw_write_unlock(raw_rwlock_t *rw)
206{ 197{
207 asm volatile(LOCK_PREFIX "addl $" RW_LOCK_BIAS_STR ", %0" 198 asm volatile(LOCK_PREFIX "addl $" RW_LOCK_BIAS_STR ", %0"
208 : "=m" (rw->lock) : : "memory"); 199 : "+m" (rw->lock) : : "memory");
209} 200}
210 201
211#endif /* __ASM_SPINLOCK_H */ 202#endif /* __ASM_SPINLOCK_H */
diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h
index db398d88b1d9..098bcee94e38 100644
--- a/include/asm-i386/system.h
+++ b/include/asm-i386/system.h
@@ -11,9 +11,14 @@
11struct task_struct; /* one of the stranger aspects of C forward declarations.. */ 11struct task_struct; /* one of the stranger aspects of C forward declarations.. */
12extern struct task_struct * FASTCALL(__switch_to(struct task_struct *prev, struct task_struct *next)); 12extern struct task_struct * FASTCALL(__switch_to(struct task_struct *prev, struct task_struct *next));
13 13
14/*
15 * Saving eflags is important. It switches not only IOPL between tasks,
16 * it also protects other tasks from NT leaking through sysenter etc.
17 */
14#define switch_to(prev,next,last) do { \ 18#define switch_to(prev,next,last) do { \
15 unsigned long esi,edi; \ 19 unsigned long esi,edi; \
16 asm volatile("pushl %%ebp\n\t" \ 20 asm volatile("pushfl\n\t" /* Save flags */ \
21 "pushl %%ebp\n\t" \
17 "movl %%esp,%0\n\t" /* save ESP */ \ 22 "movl %%esp,%0\n\t" /* save ESP */ \
18 "movl %5,%%esp\n\t" /* restore ESP */ \ 23 "movl %5,%%esp\n\t" /* restore ESP */ \
19 "movl $1f,%1\n\t" /* save EIP */ \ 24 "movl $1f,%1\n\t" /* save EIP */ \
@@ -21,6 +26,7 @@ extern struct task_struct * FASTCALL(__switch_to(struct task_struct *prev, struc
21 "jmp __switch_to\n" \ 26 "jmp __switch_to\n" \
22 "1:\t" \ 27 "1:\t" \
23 "popl %%ebp\n\t" \ 28 "popl %%ebp\n\t" \
29 "popfl" \
24 :"=m" (prev->thread.esp),"=m" (prev->thread.eip), \ 30 :"=m" (prev->thread.esp),"=m" (prev->thread.eip), \
25 "=a" (last),"=S" (esi),"=D" (edi) \ 31 "=a" (last),"=S" (esi),"=D" (edi) \
26 :"m" (next->thread.esp),"m" (next->thread.eip), \ 32 :"m" (next->thread.esp),"m" (next->thread.eip), \
@@ -82,10 +88,6 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \
82#define savesegment(seg, value) \ 88#define savesegment(seg, value) \
83 asm volatile("mov %%" #seg ",%0":"=rm" (value)) 89 asm volatile("mov %%" #seg ",%0":"=rm" (value))
84 90
85/*
86 * Clear and set 'TS' bit respectively
87 */
88#define clts() __asm__ __volatile__ ("clts")
89#define read_cr0() ({ \ 91#define read_cr0() ({ \
90 unsigned int __dummy; \ 92 unsigned int __dummy; \
91 __asm__ __volatile__( \ 93 __asm__ __volatile__( \
@@ -94,7 +96,7 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \
94 __dummy; \ 96 __dummy; \
95}) 97})
96#define write_cr0(x) \ 98#define write_cr0(x) \
97 __asm__ __volatile__("movl %0,%%cr0": :"r" (x)); 99 __asm__ __volatile__("movl %0,%%cr0": :"r" (x))
98 100
99#define read_cr2() ({ \ 101#define read_cr2() ({ \
100 unsigned int __dummy; \ 102 unsigned int __dummy; \
@@ -104,7 +106,7 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \
104 __dummy; \ 106 __dummy; \
105}) 107})
106#define write_cr2(x) \ 108#define write_cr2(x) \
107 __asm__ __volatile__("movl %0,%%cr2": :"r" (x)); 109 __asm__ __volatile__("movl %0,%%cr2": :"r" (x))
108 110
109#define read_cr3() ({ \ 111#define read_cr3() ({ \
110 unsigned int __dummy; \ 112 unsigned int __dummy; \
@@ -114,7 +116,7 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \
114 __dummy; \ 116 __dummy; \
115}) 117})
116#define write_cr3(x) \ 118#define write_cr3(x) \
117 __asm__ __volatile__("movl %0,%%cr3": :"r" (x)); 119 __asm__ __volatile__("movl %0,%%cr3": :"r" (x))
118 120
119#define read_cr4() ({ \ 121#define read_cr4() ({ \
120 unsigned int __dummy; \ 122 unsigned int __dummy; \
@@ -123,7 +125,6 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \
123 :"=r" (__dummy)); \ 125 :"=r" (__dummy)); \
124 __dummy; \ 126 __dummy; \
125}) 127})
126
127#define read_cr4_safe() ({ \ 128#define read_cr4_safe() ({ \
128 unsigned int __dummy; \ 129 unsigned int __dummy; \
129 /* This could fault if %cr4 does not exist */ \ 130 /* This could fault if %cr4 does not exist */ \
@@ -135,15 +136,19 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \
135 : "=r" (__dummy): "0" (0)); \ 136 : "=r" (__dummy): "0" (0)); \
136 __dummy; \ 137 __dummy; \
137}) 138})
138
139#define write_cr4(x) \ 139#define write_cr4(x) \
140 __asm__ __volatile__("movl %0,%%cr4": :"r" (x)); 140 __asm__ __volatile__("movl %0,%%cr4": :"r" (x))
141
142/*
143 * Clear and set 'TS' bit respectively
144 */
145#define clts() __asm__ __volatile__ ("clts")
141#define stts() write_cr0(8 | read_cr0()) 146#define stts() write_cr0(8 | read_cr0())
142 147
143#endif /* __KERNEL__ */ 148#endif /* __KERNEL__ */
144 149
145#define wbinvd() \ 150#define wbinvd() \
146 __asm__ __volatile__ ("wbinvd": : :"memory"); 151 __asm__ __volatile__ ("wbinvd": : :"memory")
147 152
148static inline unsigned long get_limit(unsigned long segment) 153static inline unsigned long get_limit(unsigned long segment)
149{ 154{
@@ -454,8 +459,6 @@ static inline unsigned long long __cmpxchg64(volatile void *ptr, unsigned long l
454#define set_mb(var, value) do { var = value; barrier(); } while (0) 459#define set_mb(var, value) do { var = value; barrier(); } while (0)
455#endif 460#endif
456 461
457#define set_wmb(var, value) do { var = value; wmb(); } while (0)
458
459#include <linux/irqflags.h> 462#include <linux/irqflags.h>
460 463
461/* 464/*
diff --git a/include/asm-i386/thread_info.h b/include/asm-i386/thread_info.h
index 2833fa2c0dd0..54d6d7aea938 100644
--- a/include/asm-i386/thread_info.h
+++ b/include/asm-i386/thread_info.h
@@ -140,6 +140,8 @@ static inline struct thread_info *current_thread_info(void)
140#define TIF_SECCOMP 8 /* secure computing */ 140#define TIF_SECCOMP 8 /* secure computing */
141#define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal() */ 141#define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal() */
142#define TIF_MEMDIE 16 142#define TIF_MEMDIE 16
143#define TIF_DEBUG 17 /* uses debug registers */
144#define TIF_IO_BITMAP 18 /* uses I/O bitmap */
143 145
144#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 146#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
145#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) 147#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
@@ -151,6 +153,8 @@ static inline struct thread_info *current_thread_info(void)
151#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) 153#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT)
152#define _TIF_SECCOMP (1<<TIF_SECCOMP) 154#define _TIF_SECCOMP (1<<TIF_SECCOMP)
153#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) 155#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
156#define _TIF_DEBUG (1<<TIF_DEBUG)
157#define _TIF_IO_BITMAP (1<<TIF_IO_BITMAP)
154 158
155/* work to do on interrupt/exception return */ 159/* work to do on interrupt/exception return */
156#define _TIF_WORK_MASK \ 160#define _TIF_WORK_MASK \
@@ -159,6 +163,9 @@ static inline struct thread_info *current_thread_info(void)
159/* work to do on any return to u-space */ 163/* work to do on any return to u-space */
160#define _TIF_ALLWORK_MASK (0x0000FFFF & ~_TIF_SECCOMP) 164#define _TIF_ALLWORK_MASK (0x0000FFFF & ~_TIF_SECCOMP)
161 165
166/* flags to check in __switch_to() */
167#define _TIF_WORK_CTXSW (_TIF_DEBUG|_TIF_IO_BITMAP)
168
162/* 169/*
163 * Thread-synchronous status. 170 * Thread-synchronous status.
164 * 171 *
diff --git a/include/asm-i386/unwind.h b/include/asm-i386/unwind.h
index 69f0f1df6722..4c1a0b968569 100644
--- a/include/asm-i386/unwind.h
+++ b/include/asm-i386/unwind.h
@@ -87,6 +87,7 @@ static inline int arch_unw_user_mode(const struct unwind_frame_info *info)
87#else 87#else
88 88
89#define UNW_PC(frame) ((void)(frame), 0) 89#define UNW_PC(frame) ((void)(frame), 0)
90#define UNW_SP(frame) ((void)(frame), 0)
90 91
91static inline int arch_unw_user_mode(const void *info) 92static inline int arch_unw_user_mode(const void *info)
92{ 93{
diff --git a/include/asm-ia64/Kbuild b/include/asm-ia64/Kbuild
index 85d6f8005eb4..f1cb00f39c22 100644
--- a/include/asm-ia64/Kbuild
+++ b/include/asm-ia64/Kbuild
@@ -4,4 +4,4 @@ header-y += break.h fpu.h fpswa.h gcc_intrin.h ia64regs.h \
4 intel_intrin.h intrinsics.h perfmon_default_smpl.h \ 4 intel_intrin.h intrinsics.h perfmon_default_smpl.h \
5 ptrace_offsets.h rse.h setup.h ucontext.h 5 ptrace_offsets.h rse.h setup.h ucontext.h
6 6
7unifdef-y += perfmon.h 7unifdef-y += perfmon.h ustack.h
diff --git a/include/asm-ia64/io.h b/include/asm-ia64/io.h
index 781ee2c7e8c3..43bfff6c6b87 100644
--- a/include/asm-ia64/io.h
+++ b/include/asm-ia64/io.h
@@ -90,7 +90,7 @@ phys_to_virt (unsigned long address)
90#define ARCH_HAS_VALID_PHYS_ADDR_RANGE 90#define ARCH_HAS_VALID_PHYS_ADDR_RANGE
91extern u64 kern_mem_attribute (unsigned long phys_addr, unsigned long size); 91extern u64 kern_mem_attribute (unsigned long phys_addr, unsigned long size);
92extern int valid_phys_addr_range (unsigned long addr, size_t count); /* efi.c */ 92extern int valid_phys_addr_range (unsigned long addr, size_t count); /* efi.c */
93extern int valid_mmap_phys_addr_range (unsigned long addr, size_t count); 93extern int valid_mmap_phys_addr_range (unsigned long pfn, size_t count);
94 94
95/* 95/*
96 * The following two macros are deprecated and scheduled for removal. 96 * The following two macros are deprecated and scheduled for removal.
diff --git a/include/asm-ia64/kprobes.h b/include/asm-ia64/kprobes.h
index 2418a787c405..938904910115 100644
--- a/include/asm-ia64/kprobes.h
+++ b/include/asm-ia64/kprobes.h
@@ -125,5 +125,6 @@ static inline void jprobe_return(void)
125} 125}
126extern void invalidate_stacked_regs(void); 126extern void invalidate_stacked_regs(void);
127extern void flush_register_stack(void); 127extern void flush_register_stack(void);
128extern void flush_insn_slot(struct kprobe *p);
128 129
129#endif /* _ASM_KPROBES_H */ 130#endif /* _ASM_KPROBES_H */
diff --git a/include/asm-ia64/meminit.h b/include/asm-ia64/meminit.h
index 894bc4d89dc0..6a33a07b3f1d 100644
--- a/include/asm-ia64/meminit.h
+++ b/include/asm-ia64/meminit.h
@@ -56,6 +56,11 @@ extern void efi_memmap_init(unsigned long *, unsigned long *);
56 extern struct page *vmem_map; 56 extern struct page *vmem_map;
57 extern int find_largest_hole (u64 start, u64 end, void *arg); 57 extern int find_largest_hole (u64 start, u64 end, void *arg);
58 extern int create_mem_map_page_table (u64 start, u64 end, void *arg); 58 extern int create_mem_map_page_table (u64 start, u64 end, void *arg);
59 extern int vmemmap_find_next_valid_pfn(int, int);
60#else
61static inline int vmemmap_find_next_valid_pfn(int node, int i)
62{
63 return i + 1;
64}
59#endif 65#endif
60
61#endif /* meminit_h */ 66#endif /* meminit_h */
diff --git a/include/asm-ia64/mman.h b/include/asm-ia64/mman.h
index 6ba179f12718..c73b87832a1e 100644
--- a/include/asm-ia64/mman.h
+++ b/include/asm-ia64/mman.h
@@ -22,4 +22,12 @@
22#define MCL_CURRENT 1 /* lock all current mappings */ 22#define MCL_CURRENT 1 /* lock all current mappings */
23#define MCL_FUTURE 2 /* lock all future mappings */ 23#define MCL_FUTURE 2 /* lock all future mappings */
24 24
25#ifdef __KERNEL__
26#ifndef __ASSEMBLY__
27#define arch_mmap_check ia64_mmap_check
28int ia64_mmap_check(unsigned long addr, unsigned long len,
29 unsigned long flags);
30#endif
31#endif
32
25#endif /* _ASM_IA64_MMAN_H */ 33#endif /* _ASM_IA64_MMAN_H */
diff --git a/include/asm-ia64/page.h b/include/asm-ia64/page.h
index f5a949ec6e1e..947cb72b520e 100644
--- a/include/asm-ia64/page.h
+++ b/include/asm-ia64/page.h
@@ -7,6 +7,7 @@
7 * David Mosberger-Tang <davidm@hpl.hp.com> 7 * David Mosberger-Tang <davidm@hpl.hp.com>
8 */ 8 */
9 9
10# ifdef __KERNEL__
10 11
11#include <asm/intrinsics.h> 12#include <asm/intrinsics.h>
12#include <asm/types.h> 13#include <asm/types.h>
@@ -64,7 +65,6 @@
64# define __pa(x) ((x) - PAGE_OFFSET) 65# define __pa(x) ((x) - PAGE_OFFSET)
65# define __va(x) ((x) + PAGE_OFFSET) 66# define __va(x) ((x) + PAGE_OFFSET)
66#else /* !__ASSEMBLY */ 67#else /* !__ASSEMBLY */
67# ifdef __KERNEL__
68# define STRICT_MM_TYPECHECKS 68# define STRICT_MM_TYPECHECKS
69 69
70extern void clear_page (void *page); 70extern void clear_page (void *page);
@@ -174,7 +174,6 @@ get_order (unsigned long size)
174 return order; 174 return order;
175} 175}
176 176
177# endif /* __KERNEL__ */
178#endif /* !__ASSEMBLY__ */ 177#endif /* !__ASSEMBLY__ */
179 178
180#ifdef STRICT_MM_TYPECHECKS 179#ifdef STRICT_MM_TYPECHECKS
@@ -228,4 +227,5 @@ get_order (unsigned long size)
228 (((current->personality & READ_IMPLIES_EXEC) != 0) \ 227 (((current->personality & READ_IMPLIES_EXEC) != 0) \
229 ? VM_EXEC : 0)) 228 ? VM_EXEC : 0))
230 229
230# endif /* __KERNEL__ */
231#endif /* _ASM_IA64_PAGE_H */ 231#endif /* _ASM_IA64_PAGE_H */
diff --git a/include/asm-ia64/pal.h b/include/asm-ia64/pal.h
index 37e52a2836b0..20a8d618c845 100644
--- a/include/asm-ia64/pal.h
+++ b/include/asm-ia64/pal.h
@@ -1433,7 +1433,12 @@ typedef union pal_version_u {
1433} pal_version_u_t; 1433} pal_version_u_t;
1434 1434
1435 1435
1436/* Return PAL version information */ 1436/*
1437 * Return PAL version information. While the documentation states that
1438 * PAL_VERSION can be called in either physical or virtual mode, some
1439 * implementations only allow physical calls. We don't call it very often,
1440 * so the overhead isn't worth eliminating.
1441 */
1437static inline s64 1442static inline s64
1438ia64_pal_version (pal_version_u_t *pal_min_version, pal_version_u_t *pal_cur_version) 1443ia64_pal_version (pal_version_u_t *pal_min_version, pal_version_u_t *pal_cur_version)
1439{ 1444{
diff --git a/include/asm-ia64/ptrace.h b/include/asm-ia64/ptrace.h
index 415abb23b210..1414316efd40 100644
--- a/include/asm-ia64/ptrace.h
+++ b/include/asm-ia64/ptrace.h
@@ -56,6 +56,8 @@
56 56
57 57
58#include <asm/fpu.h> 58#include <asm/fpu.h>
59
60#ifdef __KERNEL__
59#ifndef ASM_OFFSETS_C 61#ifndef ASM_OFFSETS_C
60#include <asm/asm-offsets.h> 62#include <asm/asm-offsets.h>
61#endif 63#endif
@@ -79,10 +81,9 @@
79 81
80#define KERNEL_STACK_SIZE IA64_STK_OFFSET 82#define KERNEL_STACK_SIZE IA64_STK_OFFSET
81 83
82#ifndef __ASSEMBLY__ 84#endif /* __KERNEL__ */
83 85
84#include <asm/current.h> 86#ifndef __ASSEMBLY__
85#include <asm/page.h>
86 87
87/* 88/*
88 * This struct defines the way the registers are saved on system 89 * This struct defines the way the registers are saved on system
@@ -229,6 +230,9 @@ struct switch_stack {
229 230
230#ifdef __KERNEL__ 231#ifdef __KERNEL__
231 232
233#include <asm/current.h>
234#include <asm/page.h>
235
232#define __ARCH_SYS_PTRACE 1 236#define __ARCH_SYS_PTRACE 1
233 237
234/* 238/*
diff --git a/include/asm-ia64/sn/sn_sal.h b/include/asm-ia64/sn/sn_sal.h
index bd4452bda357..ba826b3f75bb 100644
--- a/include/asm-ia64/sn/sn_sal.h
+++ b/include/asm-ia64/sn/sn_sal.h
@@ -706,12 +706,9 @@ static inline int
706sn_change_memprotect(u64 paddr, u64 len, u64 perms, u64 *nasid_array) 706sn_change_memprotect(u64 paddr, u64 len, u64 perms, u64 *nasid_array)
707{ 707{
708 struct ia64_sal_retval ret_stuff; 708 struct ia64_sal_retval ret_stuff;
709 unsigned long irq_flags;
710 709
711 local_irq_save(irq_flags);
712 ia64_sal_oemcall_nolock(&ret_stuff, SN_SAL_MEMPROTECT, paddr, len, 710 ia64_sal_oemcall_nolock(&ret_stuff, SN_SAL_MEMPROTECT, paddr, len,
713 (u64)nasid_array, perms, 0, 0, 0); 711 (u64)nasid_array, perms, 0, 0, 0);
714 local_irq_restore(irq_flags);
715 return ret_stuff.status; 712 return ret_stuff.status;
716} 713}
717#define SN_MEMPROT_ACCESS_CLASS_0 0x14a080 714#define SN_MEMPROT_ACCESS_CLASS_0 0x14a080
@@ -1143,12 +1140,9 @@ static inline int
1143sn_inject_error(u64 paddr, u64 *data, u64 *ecc) 1140sn_inject_error(u64 paddr, u64 *data, u64 *ecc)
1144{ 1141{
1145 struct ia64_sal_retval ret_stuff; 1142 struct ia64_sal_retval ret_stuff;
1146 unsigned long irq_flags;
1147 1143
1148 local_irq_save(irq_flags);
1149 ia64_sal_oemcall_nolock(&ret_stuff, SN_SAL_INJECT_ERROR, paddr, (u64)data, 1144 ia64_sal_oemcall_nolock(&ret_stuff, SN_SAL_INJECT_ERROR, paddr, (u64)data,
1150 (u64)ecc, 0, 0, 0, 0); 1145 (u64)ecc, 0, 0, 0, 0);
1151 local_irq_restore(irq_flags);
1152 return ret_stuff.status; 1146 return ret_stuff.status;
1153} 1147}
1154 1148
diff --git a/include/asm-ia64/sn/xp.h b/include/asm-ia64/sn/xp.h
index 9bd2f9bf329b..6f807e0193b7 100644
--- a/include/asm-ia64/sn/xp.h
+++ b/include/asm-ia64/sn/xp.h
@@ -60,23 +60,37 @@
60 * the bte_copy() once in the hope that the failure was due to a temporary 60 * the bte_copy() once in the hope that the failure was due to a temporary
61 * aberration (i.e., the link going down temporarily). 61 * aberration (i.e., the link going down temporarily).
62 * 62 *
63 * See bte_copy for definition of the input parameters. 63 * src - physical address of the source of the transfer.
64 * vdst - virtual address of the destination of the transfer.
65 * len - number of bytes to transfer from source to destination.
66 * mode - see bte_copy() for definition.
67 * notification - see bte_copy() for definition.
64 * 68 *
65 * Note: xp_bte_copy() should never be called while holding a spinlock. 69 * Note: xp_bte_copy() should never be called while holding a spinlock.
66 */ 70 */
67static inline bte_result_t 71static inline bte_result_t
68xp_bte_copy(u64 src, u64 dest, u64 len, u64 mode, void *notification) 72xp_bte_copy(u64 src, u64 vdst, u64 len, u64 mode, void *notification)
69{ 73{
70 bte_result_t ret; 74 bte_result_t ret;
75 u64 pdst = ia64_tpa(vdst);
71 76
72 77
73 ret = bte_copy(src, dest, len, mode, notification); 78 /*
79 * Ensure that the physically mapped memory is contiguous.
80 *
81 * We do this by ensuring that the memory is from region 7 only.
82 * If the need should arise to use memory from one of the other
83 * regions, then modify the BUG_ON() statement to ensure that the
84 * memory from that region is always physically contiguous.
85 */
86 BUG_ON(REGION_NUMBER(vdst) != RGN_KERNEL);
74 87
88 ret = bte_copy(src, pdst, len, mode, notification);
75 if (ret != BTE_SUCCESS) { 89 if (ret != BTE_SUCCESS) {
76 if (!in_interrupt()) { 90 if (!in_interrupt()) {
77 cond_resched(); 91 cond_resched();
78 } 92 }
79 ret = bte_copy(src, dest, len, mode, notification); 93 ret = bte_copy(src, pdst, len, mode, notification);
80 } 94 }
81 95
82 return ret; 96 return ret;
diff --git a/include/asm-ia64/sn/xpc.h b/include/asm-ia64/sn/xpc.h
index 8406f1ef4caf..35e1386f37ab 100644
--- a/include/asm-ia64/sn/xpc.h
+++ b/include/asm-ia64/sn/xpc.h
@@ -683,7 +683,9 @@ extern struct xpc_vars *xpc_vars;
683extern struct xpc_rsvd_page *xpc_rsvd_page; 683extern struct xpc_rsvd_page *xpc_rsvd_page;
684extern struct xpc_vars_part *xpc_vars_part; 684extern struct xpc_vars_part *xpc_vars_part;
685extern struct xpc_partition xpc_partitions[XP_MAX_PARTITIONS + 1]; 685extern struct xpc_partition xpc_partitions[XP_MAX_PARTITIONS + 1];
686extern char xpc_remote_copy_buffer[]; 686extern char *xpc_remote_copy_buffer;
687extern void *xpc_remote_copy_buffer_base;
688extern void *xpc_kmalloc_cacheline_aligned(size_t, gfp_t, void **);
687extern struct xpc_rsvd_page *xpc_rsvd_page_init(void); 689extern struct xpc_rsvd_page *xpc_rsvd_page_init(void);
688extern void xpc_allow_IPI_ops(void); 690extern void xpc_allow_IPI_ops(void);
689extern void xpc_restrict_IPI_ops(void); 691extern void xpc_restrict_IPI_ops(void);
@@ -1124,8 +1126,8 @@ xpc_notify_IRQ_send_local(struct xpc_channel *ch, u8 ipi_flag,
1124#define XPC_GET_IPI_FLAGS(_amo, _c) ((u8) (((_amo) >> ((_c) * 8)) & 0xff)) 1126#define XPC_GET_IPI_FLAGS(_amo, _c) ((u8) (((_amo) >> ((_c) * 8)) & 0xff))
1125#define XPC_SET_IPI_FLAGS(_amo, _c, _f) (_amo) |= ((u64) (_f) << ((_c) * 8)) 1127#define XPC_SET_IPI_FLAGS(_amo, _c, _f) (_amo) |= ((u64) (_f) << ((_c) * 8))
1126 1128
1127#define XPC_ANY_OPENCLOSE_IPI_FLAGS_SET(_amo) ((_amo) & 0x0f0f0f0f0f0f0f0f) 1129#define XPC_ANY_OPENCLOSE_IPI_FLAGS_SET(_amo) ((_amo) & __IA64_UL_CONST(0x0f0f0f0f0f0f0f0f))
1128#define XPC_ANY_MSG_IPI_FLAGS_SET(_amo) ((_amo) & 0x1010101010101010) 1130#define XPC_ANY_MSG_IPI_FLAGS_SET(_amo) ((_amo) & __IA64_UL_CONST(0x1010101010101010))
1129 1131
1130 1132
1131static inline void 1133static inline void
diff --git a/include/asm-ia64/system.h b/include/asm-ia64/system.h
index 65db43ce4de6..384fbf7f2a0f 100644
--- a/include/asm-ia64/system.h
+++ b/include/asm-ia64/system.h
@@ -24,7 +24,7 @@
24 * 0xa000000000000000+2*PERCPU_PAGE_SIZE 24 * 0xa000000000000000+2*PERCPU_PAGE_SIZE
25 * - 0xa000000000000000+3*PERCPU_PAGE_SIZE remain unmapped (guard page) 25 * - 0xa000000000000000+3*PERCPU_PAGE_SIZE remain unmapped (guard page)
26 */ 26 */
27#define KERNEL_START (GATE_ADDR+0x100000000) 27#define KERNEL_START (GATE_ADDR+__IA64_UL_CONST(0x100000000))
28#define PERCPU_ADDR (-PERCPU_PAGE_SIZE) 28#define PERCPU_ADDR (-PERCPU_PAGE_SIZE)
29 29
30#ifndef __ASSEMBLY__ 30#ifndef __ASSEMBLY__
@@ -98,12 +98,11 @@ extern struct ia64_boot_param {
98#endif 98#endif
99 99
100/* 100/*
101 * XXX check on these---I suspect what Linus really wants here is 101 * XXX check on this ---I suspect what Linus really wants here is
102 * acquire vs release semantics but we can't discuss this stuff with 102 * acquire vs release semantics but we can't discuss this stuff with
103 * Linus just yet. Grrr... 103 * Linus just yet. Grrr...
104 */ 104 */
105#define set_mb(var, value) do { (var) = (value); mb(); } while (0) 105#define set_mb(var, value) do { (var) = (value); mb(); } while (0)
106#define set_wmb(var, value) do { (var) = (value); mb(); } while (0)
107 106
108#define safe_halt() ia64_pal_halt_light() /* PAL_HALT_LIGHT */ 107#define safe_halt() ia64_pal_halt_light() /* PAL_HALT_LIGHT */
109 108
diff --git a/include/asm-ia64/unistd.h b/include/asm-ia64/unistd.h
index bb0eb727dcd0..f581662c5ab8 100644
--- a/include/asm-ia64/unistd.h
+++ b/include/asm-ia64/unistd.h
@@ -286,8 +286,7 @@
286/* 1294, 1295 reserved for pselect/ppoll */ 286/* 1294, 1295 reserved for pselect/ppoll */
287#define __NR_unshare 1296 287#define __NR_unshare 1296
288#define __NR_splice 1297 288#define __NR_splice 1297
289#define __NR_set_robust_list 1298 289/* 1298, 1299 reserved for set_robust_list/get_robust_list */
290#define __NR_get_robust_list 1299
291#define __NR_sync_file_range 1300 290#define __NR_sync_file_range 1300
292#define __NR_tee 1301 291#define __NR_tee 1301
293#define __NR_vmsplice 1302 292#define __NR_vmsplice 1302
diff --git a/include/asm-ia64/ustack.h b/include/asm-ia64/ustack.h
index da55c91246e3..a349467913ea 100644
--- a/include/asm-ia64/ustack.h
+++ b/include/asm-ia64/ustack.h
@@ -5,12 +5,15 @@
5 * Constants for the user stack size 5 * Constants for the user stack size
6 */ 6 */
7 7
8#ifdef __KERNEL__
8#include <asm/page.h> 9#include <asm/page.h>
9 10
10/* The absolute hard limit for stack size is 1/2 of the mappable space in the region */ 11/* The absolute hard limit for stack size is 1/2 of the mappable space in the region */
11#define MAX_USER_STACK_SIZE (RGN_MAP_LIMIT/2) 12#define MAX_USER_STACK_SIZE (RGN_MAP_LIMIT/2)
12/* Make a default stack size of 2GB */
13#define DEFAULT_USER_STACK_SIZE (1UL << 31)
14#define STACK_TOP (0x6000000000000000UL + RGN_MAP_LIMIT) 13#define STACK_TOP (0x6000000000000000UL + RGN_MAP_LIMIT)
14#endif
15
16/* Make a default stack size of 2GiB */
17#define DEFAULT_USER_STACK_SIZE (1UL << 31)
15 18
16#endif /* _ASM_IA64_USTACK_H */ 19#endif /* _ASM_IA64_USTACK_H */
diff --git a/include/asm-m32r/system.h b/include/asm-m32r/system.h
index 311cebf44eff..9e618afec6ed 100644
--- a/include/asm-m32r/system.h
+++ b/include/asm-m32r/system.h
@@ -336,7 +336,6 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
336#endif 336#endif
337 337
338#define set_mb(var, value) do { xchg(&var, value); } while (0) 338#define set_mb(var, value) do { xchg(&var, value); } while (0)
339#define set_wmb(var, value) do { var = value; wmb(); } while (0)
340 339
341#define arch_align_stack(x) (x) 340#define arch_align_stack(x) (x)
342 341
diff --git a/include/asm-m68k/oplib.h b/include/asm-m68k/oplib.h
index c3594f473ef7..06caa2d08451 100644
--- a/include/asm-m68k/oplib.h
+++ b/include/asm-m68k/oplib.h
@@ -244,11 +244,6 @@ extern void prom_getstring(int node, char *prop, char *buf, int bufsize);
244/* Does the passed node have the given "name"? YES=1 NO=0 */ 244/* Does the passed node have the given "name"? YES=1 NO=0 */
245extern int prom_nodematch(int thisnode, char *name); 245extern int prom_nodematch(int thisnode, char *name);
246 246
247/* Puts in buffer a prom name in the form name@x,y or name (x for which_io
248 * and y for first regs phys address
249 */
250extern int prom_getname(int node, char *buf, int buflen);
251
252/* Search all siblings starting at the passed node for "name" matching 247/* Search all siblings starting at the passed node for "name" matching
253 * the given string. Returns the node on success, zero on failure. 248 * the given string. Returns the node on success, zero on failure.
254 */ 249 */
diff --git a/include/asm-m68k/system.h b/include/asm-m68k/system.h
index d6dd8052cd6f..131a0cb0f491 100644
--- a/include/asm-m68k/system.h
+++ b/include/asm-m68k/system.h
@@ -80,7 +80,6 @@ static inline int irqs_disabled(void)
80#define wmb() barrier() 80#define wmb() barrier()
81#define read_barrier_depends() do { } while(0) 81#define read_barrier_depends() do { } while(0)
82#define set_mb(var, value) do { xchg(&var, value); } while (0) 82#define set_mb(var, value) do { xchg(&var, value); } while (0)
83#define set_wmb(var, value) do { var = value; wmb(); } while (0)
84 83
85#define smp_mb() barrier() 84#define smp_mb() barrier()
86#define smp_rmb() barrier() 85#define smp_rmb() barrier()
diff --git a/include/asm-m68knommu/processor.h b/include/asm-m68knommu/processor.h
index 0ee158e09abb..9d3a1bf41231 100644
--- a/include/asm-m68knommu/processor.h
+++ b/include/asm-m68knommu/processor.h
@@ -13,6 +13,7 @@
13 */ 13 */
14#define current_text_addr() ({ __label__ _l; _l: &&_l;}) 14#define current_text_addr() ({ __label__ _l; _l: &&_l;})
15 15
16#include <linux/compiler.h>
16#include <linux/threads.h> 17#include <linux/threads.h>
17#include <asm/types.h> 18#include <asm/types.h>
18#include <asm/segment.h> 19#include <asm/segment.h>
@@ -137,6 +138,6 @@ unsigned long get_wchan(struct task_struct *p);
137 eip; }) 138 eip; })
138#define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp) 139#define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp)
139 140
140#define cpu_relax() do { } while (0) 141#define cpu_relax() barrier()
141 142
142#endif 143#endif
diff --git a/include/asm-m68knommu/system.h b/include/asm-m68knommu/system.h
index 2bbe2db00a22..2a814498672d 100644
--- a/include/asm-m68knommu/system.h
+++ b/include/asm-m68knommu/system.h
@@ -106,7 +106,6 @@ asmlinkage void resume(void);
106#define wmb() asm volatile ("" : : :"memory") 106#define wmb() asm volatile ("" : : :"memory")
107#define set_rmb(var, value) do { xchg(&var, value); } while (0) 107#define set_rmb(var, value) do { xchg(&var, value); } while (0)
108#define set_mb(var, value) set_rmb(var, value) 108#define set_mb(var, value) set_rmb(var, value)
109#define set_wmb(var, value) do { var = value; wmb(); } while (0)
110 109
111#ifdef CONFIG_SMP 110#ifdef CONFIG_SMP
112#define smp_mb() mb() 111#define smp_mb() mb()
diff --git a/include/asm-m68knommu/uaccess.h b/include/asm-m68knommu/uaccess.h
index 05be9515a2d2..62b29b10bc6d 100644
--- a/include/asm-m68knommu/uaccess.h
+++ b/include/asm-m68knommu/uaccess.h
@@ -93,7 +93,7 @@ extern int __put_user_bad(void);
93#define get_user(x, ptr) \ 93#define get_user(x, ptr) \
94({ \ 94({ \
95 int __gu_err = 0; \ 95 int __gu_err = 0; \
96 typeof(*(ptr)) __gu_val = 0; \ 96 typeof(x) __gu_val = 0; \
97 switch (sizeof(*(ptr))) { \ 97 switch (sizeof(*(ptr))) { \
98 case 1: \ 98 case 1: \
99 __get_user_asm(__gu_err, __gu_val, ptr, b, "=d"); \ 99 __get_user_asm(__gu_err, __gu_val, ptr, b, "=d"); \
@@ -105,23 +105,23 @@ extern int __put_user_bad(void);
105 __get_user_asm(__gu_err, __gu_val, ptr, l, "=r"); \ 105 __get_user_asm(__gu_err, __gu_val, ptr, l, "=r"); \
106 break; \ 106 break; \
107 case 8: \ 107 case 8: \
108 memcpy(&__gu_val, ptr, sizeof (*(ptr))); \ 108 memcpy((void *) &__gu_val, ptr, sizeof (*(ptr))); \
109 break; \ 109 break; \
110 default: \ 110 default: \
111 __gu_val = 0; \ 111 __gu_val = 0; \
112 __gu_err = __get_user_bad(); \ 112 __gu_err = __get_user_bad(); \
113 break; \ 113 break; \
114 } \ 114 } \
115 (x) = __gu_val; \ 115 (x) = (typeof(*(ptr))) __gu_val; \
116 __gu_err; \ 116 __gu_err; \
117}) 117})
118#define __get_user(x, ptr) get_user(x, ptr) 118#define __get_user(x, ptr) get_user(x, ptr)
119 119
120extern int __get_user_bad(void); 120extern int __get_user_bad(void);
121 121
122#define __get_user_asm(err,x,ptr,bwl,reg) \ 122#define __get_user_asm(err,x,ptr,bwl,reg) \
123 __asm__ ("move" #bwl " %1,%0" \ 123 __asm__ ("move" #bwl " %1,%0" \
124 : "=d" (x) \ 124 : "=d" (x) \
125 : "m" (*__ptr(ptr))) 125 : "m" (*__ptr(ptr)))
126 126
127#define copy_from_user(to, from, n) (memcpy(to, from, n), 0) 127#define copy_from_user(to, from, n) (memcpy(to, from, n), 0)
diff --git a/include/asm-mips/apm.h b/include/asm-mips/apm.h
index e8c69208f63a..4b99ffc11529 100644
--- a/include/asm-mips/apm.h
+++ b/include/asm-mips/apm.h
@@ -13,7 +13,6 @@
13#ifndef MIPS_ASM_SA1100_APM_H 13#ifndef MIPS_ASM_SA1100_APM_H
14#define MIPS_ASM_SA1100_APM_H 14#define MIPS_ASM_SA1100_APM_H
15 15
16#include <linux/config.h>
17#include <linux/apm_bios.h> 16#include <linux/apm_bios.h>
18 17
19/* 18/*
diff --git a/include/asm-mips/atomic.h b/include/asm-mips/atomic.h
index 13d44e14025a..e64abc0d8221 100644
--- a/include/asm-mips/atomic.h
+++ b/include/asm-mips/atomic.h
@@ -22,8 +22,8 @@
22#ifndef _ASM_ATOMIC_H 22#ifndef _ASM_ATOMIC_H
23#define _ASM_ATOMIC_H 23#define _ASM_ATOMIC_H
24 24
25#include <linux/irqflags.h>
25#include <asm/cpu-features.h> 26#include <asm/cpu-features.h>
26#include <asm/interrupt.h>
27#include <asm/war.h> 27#include <asm/war.h>
28 28
29typedef struct { volatile int counter; } atomic_t; 29typedef struct { volatile int counter; } atomic_t;
diff --git a/include/asm-mips/bitops.h b/include/asm-mips/bitops.h
index 098cec263681..1bb89c5a10ee 100644
--- a/include/asm-mips/bitops.h
+++ b/include/asm-mips/bitops.h
@@ -31,7 +31,7 @@
31 31
32#ifdef __KERNEL__ 32#ifdef __KERNEL__
33 33
34#include <asm/interrupt.h> 34#include <linux/irqflags.h>
35#include <asm/sgidefs.h> 35#include <asm/sgidefs.h>
36#include <asm/war.h> 36#include <asm/war.h>
37 37
diff --git a/include/asm-mips/cpu-features.h b/include/asm-mips/cpu-features.h
index 44285a9d5520..eadca266f159 100644
--- a/include/asm-mips/cpu-features.h
+++ b/include/asm-mips/cpu-features.h
@@ -143,12 +143,8 @@
143#define cpu_has_dsp (cpu_data[0].ases & MIPS_ASE_DSP) 143#define cpu_has_dsp (cpu_data[0].ases & MIPS_ASE_DSP)
144#endif 144#endif
145 145
146#ifdef CONFIG_MIPS_MT
147#ifndef cpu_has_mipsmt 146#ifndef cpu_has_mipsmt
148# define cpu_has_mipsmt (cpu_data[0].ases & MIPS_ASE_MIPSMT) 147#define cpu_has_mipsmt (cpu_data[0].ases & MIPS_ASE_MIPSMT)
149#endif
150#else
151# define cpu_has_mipsmt 0
152#endif 148#endif
153 149
154#ifdef CONFIG_32BIT 150#ifdef CONFIG_32BIT
@@ -199,8 +195,8 @@
199# define cpu_has_veic 0 195# define cpu_has_veic 0
200#endif 196#endif
201 197
202#ifndef cpu_has_subset_pcaches 198#ifndef cpu_has_inclusive_pcaches
203#define cpu_has_subset_pcaches (cpu_data[0].options & MIPS_CPU_SUBSET_CACHES) 199#define cpu_has_inclusive_pcaches (cpu_data[0].options & MIPS_CPU_INCLUSIVE_CACHES)
204#endif 200#endif
205 201
206#ifndef cpu_dcache_line_size 202#ifndef cpu_dcache_line_size
diff --git a/include/asm-mips/cpu.h b/include/asm-mips/cpu.h
index dff2a0a52f8f..d38fdbf845b2 100644
--- a/include/asm-mips/cpu.h
+++ b/include/asm-mips/cpu.h
@@ -242,7 +242,7 @@
242#define MIPS_CPU_EJTAG 0x00008000 /* EJTAG exception */ 242#define MIPS_CPU_EJTAG 0x00008000 /* EJTAG exception */
243#define MIPS_CPU_NOFPUEX 0x00010000 /* no FPU exception */ 243#define MIPS_CPU_NOFPUEX 0x00010000 /* no FPU exception */
244#define MIPS_CPU_LLSC 0x00020000 /* CPU has ll/sc instructions */ 244#define MIPS_CPU_LLSC 0x00020000 /* CPU has ll/sc instructions */
245#define MIPS_CPU_SUBSET_CACHES 0x00040000 /* P-cache subset enforced */ 245#define MIPS_CPU_INCLUSIVE_CACHES 0x00040000 /* P-cache subset enforced */
246#define MIPS_CPU_PREFETCH 0x00080000 /* CPU has usable prefetch */ 246#define MIPS_CPU_PREFETCH 0x00080000 /* CPU has usable prefetch */
247#define MIPS_CPU_VINT 0x00100000 /* CPU supports MIPSR2 vectored interrupts */ 247#define MIPS_CPU_VINT 0x00100000 /* CPU supports MIPSR2 vectored interrupts */
248#define MIPS_CPU_VEIC 0x00200000 /* CPU supports MIPSR2 external interrupt controller mode */ 248#define MIPS_CPU_VEIC 0x00200000 /* CPU supports MIPSR2 external interrupt controller mode */
diff --git a/include/asm-mips/inst.h b/include/asm-mips/inst.h
index 1ed8d0f62577..6489f00731ca 100644
--- a/include/asm-mips/inst.h
+++ b/include/asm-mips/inst.h
@@ -74,7 +74,7 @@ enum spec3_op {
74 ins_op, dinsm_op, dinsu_op, dins_op, 74 ins_op, dinsm_op, dinsu_op, dins_op,
75 bshfl_op = 0x20, 75 bshfl_op = 0x20,
76 dbshfl_op = 0x24, 76 dbshfl_op = 0x24,
77 rdhwr_op = 0x3f 77 rdhwr_op = 0x3b
78}; 78};
79 79
80/* 80/*
diff --git a/include/asm-mips/interrupt.h b/include/asm-mips/irqflags.h
index a99d6867510f..43ca09a3a3d0 100644
--- a/include/asm-mips/interrupt.h
+++ b/include/asm-mips/irqflags.h
@@ -8,13 +8,15 @@
8 * Copyright (C) 1999 Silicon Graphics 8 * Copyright (C) 1999 Silicon Graphics
9 * Copyright (C) 2000 MIPS Technologies, Inc. 9 * Copyright (C) 2000 MIPS Technologies, Inc.
10 */ 10 */
11#ifndef _ASM_INTERRUPT_H 11#ifndef _ASM_IRQFLAGS_H
12#define _ASM_INTERRUPT_H 12#define _ASM_IRQFLAGS_H
13
14#ifndef __ASSEMBLY__
13 15
14#include <asm/hazards.h> 16#include <asm/hazards.h>
15 17
16__asm__ ( 18__asm__ (
17 " .macro local_irq_enable \n" 19 " .macro raw_local_irq_enable \n"
18 " .set push \n" 20 " .set push \n"
19 " .set reorder \n" 21 " .set reorder \n"
20 " .set noat \n" 22 " .set noat \n"
@@ -35,10 +37,10 @@ __asm__ (
35 " .set pop \n" 37 " .set pop \n"
36 " .endm"); 38 " .endm");
37 39
38static inline void local_irq_enable(void) 40static inline void raw_local_irq_enable(void)
39{ 41{
40 __asm__ __volatile__( 42 __asm__ __volatile__(
41 "local_irq_enable" 43 "raw_local_irq_enable"
42 : /* no outputs */ 44 : /* no outputs */
43 : /* no inputs */ 45 : /* no inputs */
44 : "memory"); 46 : "memory");
@@ -63,7 +65,7 @@ static inline void local_irq_enable(void)
63 * Workaround: mask EXL bit of the result or place a nop before mfc0. 65 * Workaround: mask EXL bit of the result or place a nop before mfc0.
64 */ 66 */
65__asm__ ( 67__asm__ (
66 " .macro local_irq_disable\n" 68 " .macro raw_local_irq_disable\n"
67 " .set push \n" 69 " .set push \n"
68 " .set noat \n" 70 " .set noat \n"
69#ifdef CONFIG_MIPS_MT_SMTC 71#ifdef CONFIG_MIPS_MT_SMTC
@@ -84,17 +86,17 @@ __asm__ (
84 " .set pop \n" 86 " .set pop \n"
85 " .endm \n"); 87 " .endm \n");
86 88
87static inline void local_irq_disable(void) 89static inline void raw_local_irq_disable(void)
88{ 90{
89 __asm__ __volatile__( 91 __asm__ __volatile__(
90 "local_irq_disable" 92 "raw_local_irq_disable"
91 : /* no outputs */ 93 : /* no outputs */
92 : /* no inputs */ 94 : /* no inputs */
93 : "memory"); 95 : "memory");
94} 96}
95 97
96__asm__ ( 98__asm__ (
97 " .macro local_save_flags flags \n" 99 " .macro raw_local_save_flags flags \n"
98 " .set push \n" 100 " .set push \n"
99 " .set reorder \n" 101 " .set reorder \n"
100#ifdef CONFIG_MIPS_MT_SMTC 102#ifdef CONFIG_MIPS_MT_SMTC
@@ -105,13 +107,13 @@ __asm__ (
105 " .set pop \n" 107 " .set pop \n"
106 " .endm \n"); 108 " .endm \n");
107 109
108#define local_save_flags(x) \ 110#define raw_local_save_flags(x) \
109__asm__ __volatile__( \ 111__asm__ __volatile__( \
110 "local_save_flags %0" \ 112 "raw_local_save_flags %0" \
111 : "=r" (x)) 113 : "=r" (x))
112 114
113__asm__ ( 115__asm__ (
114 " .macro local_irq_save result \n" 116 " .macro raw_local_irq_save result \n"
115 " .set push \n" 117 " .set push \n"
116 " .set reorder \n" 118 " .set reorder \n"
117 " .set noat \n" 119 " .set noat \n"
@@ -135,15 +137,15 @@ __asm__ (
135 " .set pop \n" 137 " .set pop \n"
136 " .endm \n"); 138 " .endm \n");
137 139
138#define local_irq_save(x) \ 140#define raw_local_irq_save(x) \
139__asm__ __volatile__( \ 141__asm__ __volatile__( \
140 "local_irq_save\t%0" \ 142 "raw_local_irq_save\t%0" \
141 : "=r" (x) \ 143 : "=r" (x) \
142 : /* no inputs */ \ 144 : /* no inputs */ \
143 : "memory") 145 : "memory")
144 146
145__asm__ ( 147__asm__ (
146 " .macro local_irq_restore flags \n" 148 " .macro raw_local_irq_restore flags \n"
147 " .set push \n" 149 " .set push \n"
148 " .set noreorder \n" 150 " .set noreorder \n"
149 " .set noat \n" 151 " .set noat \n"
@@ -182,40 +184,42 @@ __asm__ (
182 " .set pop \n" 184 " .set pop \n"
183 " .endm \n"); 185 " .endm \n");
184 186
185#define local_irq_restore(flags) \ 187#define raw_local_irq_restore(flags) \
186do { \ 188do { \
187 unsigned long __tmp1; \ 189 unsigned long __tmp1; \
188 \ 190 \
189 __asm__ __volatile__( \ 191 __asm__ __volatile__( \
190 "local_irq_restore\t%0" \ 192 "raw_local_irq_restore\t%0" \
191 : "=r" (__tmp1) \ 193 : "=r" (__tmp1) \
192 : "0" (flags) \ 194 : "0" (flags) \
193 : "memory"); \ 195 : "memory"); \
194} while(0) 196} while(0)
195 197
196static inline int irqs_disabled(void) 198static inline int raw_irqs_disabled_flags(unsigned long flags)
197{ 199{
198#ifdef CONFIG_MIPS_MT_SMTC 200#ifdef CONFIG_MIPS_MT_SMTC
199 /* 201 /*
200 * SMTC model uses TCStatus.IXMT to disable interrupts for a thread/CPU 202 * SMTC model uses TCStatus.IXMT to disable interrupts for a thread/CPU
201 */ 203 */
202 unsigned long __result; 204 return flags & 0x400;
203
204 __asm__ __volatile__(
205 " .set noreorder \n"
206 " mfc0 %0, $2, 1 \n"
207 " andi %0, 0x400 \n"
208 " slt %0, $0, %0 \n"
209 " .set reorder \n"
210 : "=r" (__result));
211
212 return __result;
213#else 205#else
214 unsigned long flags;
215 local_save_flags(flags);
216
217 return !(flags & 1); 206 return !(flags & 1);
218#endif 207#endif
219} 208}
220 209
221#endif /* _ASM_INTERRUPT_H */ 210#endif
211
212/*
213 * Do the CPU's IRQ-state tracing from assembly code.
214 */
215#ifdef CONFIG_TRACE_IRQFLAGS
216# define TRACE_IRQS_ON \
217 jal trace_hardirqs_on
218# define TRACE_IRQS_OFF \
219 jal trace_hardirqs_off
220#else
221# define TRACE_IRQS_ON
222# define TRACE_IRQS_OFF
223#endif
224
225#endif /* _ASM_IRQFLAGS_H */
diff --git a/include/asm-mips/mach-cobalt/cpu-feature-overrides.h b/include/asm-mips/mach-cobalt/cpu-feature-overrides.h
index e0e08fc5d7f7..c6dfa59d1986 100644
--- a/include/asm-mips/mach-cobalt/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-cobalt/cpu-feature-overrides.h
@@ -27,7 +27,7 @@
27#define cpu_has_mcheck 0 27#define cpu_has_mcheck 0
28#define cpu_has_ejtag 0 28#define cpu_has_ejtag 0
29 29
30#define cpu_has_subset_pcaches 0 30#define cpu_has_inclusive_pcaches 0
31#define cpu_dcache_line_size() 32 31#define cpu_dcache_line_size() 32
32#define cpu_icache_line_size() 32 32#define cpu_icache_line_size() 32
33#define cpu_scache_line_size() 0 33#define cpu_scache_line_size() 0
diff --git a/include/asm-mips/mach-dec/mc146818rtc.h b/include/asm-mips/mach-dec/mc146818rtc.h
index 6d37a5675803..6724e99e43e1 100644
--- a/include/asm-mips/mach-dec/mc146818rtc.h
+++ b/include/asm-mips/mach-dec/mc146818rtc.h
@@ -19,6 +19,8 @@
19 19
20extern volatile u8 *dec_rtc_base; 20extern volatile u8 *dec_rtc_base;
21 21
22#define ARCH_RTC_LOCATION
23
22#define RTC_PORT(x) CPHYSADDR((long)dec_rtc_base) 24#define RTC_PORT(x) CPHYSADDR((long)dec_rtc_base)
23#define RTC_IO_EXTENT dec_kn_slot_size 25#define RTC_IO_EXTENT dec_kn_slot_size
24#define RTC_IOMAPPED 0 26#define RTC_IOMAPPED 0
diff --git a/include/asm-mips/mach-excite/cpu-feature-overrides.h b/include/asm-mips/mach-excite/cpu-feature-overrides.h
index abb76b2fd865..0d31854222f9 100644
--- a/include/asm-mips/mach-excite/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-excite/cpu-feature-overrides.h
@@ -31,7 +31,7 @@
31#define cpu_has_nofpuex 0 31#define cpu_has_nofpuex 0
32#define cpu_has_64bits 1 32#define cpu_has_64bits 1
33 33
34#define cpu_has_subset_pcaches 0 34#define cpu_has_inclusive_pcaches 0
35 35
36#define cpu_dcache_line_size() 32 36#define cpu_dcache_line_size() 32
37#define cpu_icache_line_size() 32 37#define cpu_icache_line_size() 32
diff --git a/include/asm-mips/mach-excite/excite.h b/include/asm-mips/mach-excite/excite.h
index c52610de2b3a..130bd4b8edce 100644
--- a/include/asm-mips/mach-excite/excite.h
+++ b/include/asm-mips/mach-excite/excite.h
@@ -1,7 +1,6 @@
1#ifndef __EXCITE_H__ 1#ifndef __EXCITE_H__
2#define __EXCITE_H__ 2#define __EXCITE_H__
3 3
4#include <linux/config.h>
5#include <linux/init.h> 4#include <linux/init.h>
6#include <asm/addrspace.h> 5#include <asm/addrspace.h>
7#include <asm/types.h> 6#include <asm/types.h>
diff --git a/include/asm-mips/mach-ip27/cpu-feature-overrides.h b/include/asm-mips/mach-ip27/cpu-feature-overrides.h
index 19c2d135985b..a071974b67bb 100644
--- a/include/asm-mips/mach-ip27/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-ip27/cpu-feature-overrides.h
@@ -34,7 +34,7 @@
34#define cpu_has_4kex 1 34#define cpu_has_4kex 1
35#define cpu_has_4k_cache 1 35#define cpu_has_4k_cache 1
36 36
37#define cpu_has_subset_pcaches 1 37#define cpu_has_inclusive_pcaches 1
38 38
39#define cpu_dcache_line_size() 32 39#define cpu_dcache_line_size() 32
40#define cpu_icache_line_size() 64 40#define cpu_icache_line_size() 64
diff --git a/include/asm-mips/mach-ja/cpu-feature-overrides.h b/include/asm-mips/mach-ja/cpu-feature-overrides.h
index 90ff087083b9..84b6dead0e8a 100644
--- a/include/asm-mips/mach-ja/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-ja/cpu-feature-overrides.h
@@ -31,7 +31,7 @@
31#define cpu_has_nofpuex 0 31#define cpu_has_nofpuex 0
32#define cpu_has_64bits 1 32#define cpu_has_64bits 1
33 33
34#define cpu_has_subset_pcaches 0 34#define cpu_has_inclusive_pcaches 0
35 35
36#define cpu_dcache_line_size() 32 36#define cpu_dcache_line_size() 32
37#define cpu_icache_line_size() 32 37#define cpu_icache_line_size() 32
diff --git a/include/asm-mips/mach-mips/cpu-feature-overrides.h b/include/asm-mips/mach-mips/cpu-feature-overrides.h
index e960679f54ba..7f3e3f9bd23a 100644
--- a/include/asm-mips/mach-mips/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-mips/cpu-feature-overrides.h
@@ -39,7 +39,7 @@
39#define cpu_has_nofpuex 0 39#define cpu_has_nofpuex 0
40/* #define cpu_has_64bits ? */ 40/* #define cpu_has_64bits ? */
41/* #define cpu_has_64bit_zero_reg ? */ 41/* #define cpu_has_64bit_zero_reg ? */
42/* #define cpu_has_subset_pcaches ? */ 42/* #define cpu_has_inclusive_pcaches ? */
43#define cpu_icache_snoops_remote_store 1 43#define cpu_icache_snoops_remote_store 1
44#endif 44#endif
45 45
@@ -65,7 +65,7 @@
65#define cpu_has_nofpuex 0 65#define cpu_has_nofpuex 0
66/* #define cpu_has_64bits ? */ 66/* #define cpu_has_64bits ? */
67/* #define cpu_has_64bit_zero_reg ? */ 67/* #define cpu_has_64bit_zero_reg ? */
68/* #define cpu_has_subset_pcaches ? */ 68/* #define cpu_has_inclusive_pcaches ? */
69#define cpu_icache_snoops_remote_store 1 69#define cpu_icache_snoops_remote_store 1
70#endif 70#endif
71 71
diff --git a/include/asm-mips/mach-ocelot3/cpu-feature-overrides.h b/include/asm-mips/mach-ocelot3/cpu-feature-overrides.h
index 782b986241dd..57a12ded0613 100644
--- a/include/asm-mips/mach-ocelot3/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-ocelot3/cpu-feature-overrides.h
@@ -34,7 +34,7 @@
34#define cpu_has_nofpuex 0 34#define cpu_has_nofpuex 0
35#define cpu_has_64bits 1 35#define cpu_has_64bits 1
36 36
37#define cpu_has_subset_pcaches 0 37#define cpu_has_inclusive_pcaches 0
38 38
39#define cpu_dcache_line_size() 32 39#define cpu_dcache_line_size() 32
40#define cpu_icache_line_size() 32 40#define cpu_icache_line_size() 32
diff --git a/include/asm-mips/mach-sibyte/cpu-feature-overrides.h b/include/asm-mips/mach-sibyte/cpu-feature-overrides.h
index 193a666cd131..a25968f277a2 100644
--- a/include/asm-mips/mach-sibyte/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-sibyte/cpu-feature-overrides.h
@@ -31,7 +31,7 @@
31#define cpu_has_nofpuex 0 31#define cpu_has_nofpuex 0
32#define cpu_has_64bits 1 32#define cpu_has_64bits 1
33 33
34#define cpu_has_subset_pcaches 0 34#define cpu_has_inclusive_pcaches 0
35 35
36#define cpu_dcache_line_size() 32 36#define cpu_dcache_line_size() 32
37#define cpu_icache_line_size() 32 37#define cpu_icache_line_size() 32
diff --git a/include/asm-mips/mach-sim/cpu-feature-overrides.h b/include/asm-mips/mach-sim/cpu-feature-overrides.h
index d736bdadb6df..779b02205737 100644
--- a/include/asm-mips/mach-sim/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-sim/cpu-feature-overrides.h
@@ -34,7 +34,7 @@
34#define cpu_has_nofpuex 0 34#define cpu_has_nofpuex 0
35/* #define cpu_has_64bits ? */ 35/* #define cpu_has_64bits ? */
36/* #define cpu_has_64bit_zero_reg ? */ 36/* #define cpu_has_64bit_zero_reg ? */
37/* #define cpu_has_subset_pcaches ? */ 37/* #define cpu_has_inclusive_pcaches ? */
38#endif 38#endif
39 39
40#ifdef CONFIG_CPU_MIPS64 40#ifdef CONFIG_CPU_MIPS64
@@ -59,7 +59,7 @@
59#define cpu_has_nofpuex 0 59#define cpu_has_nofpuex 0
60/* #define cpu_has_64bits ? */ 60/* #define cpu_has_64bits ? */
61/* #define cpu_has_64bit_zero_reg ? */ 61/* #define cpu_has_64bit_zero_reg ? */
62/* #define cpu_has_subset_pcaches ? */ 62/* #define cpu_has_inclusive_pcaches ? */
63#endif 63#endif
64 64
65#endif /* __ASM_MACH_MIPS_CPU_FEATURE_OVERRIDES_H */ 65#endif /* __ASM_MACH_MIPS_CPU_FEATURE_OVERRIDES_H */
diff --git a/include/asm-mips/mach-yosemite/cpu-feature-overrides.h b/include/asm-mips/mach-yosemite/cpu-feature-overrides.h
index 3073542c93c7..42cebb7ce7a6 100644
--- a/include/asm-mips/mach-yosemite/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-yosemite/cpu-feature-overrides.h
@@ -31,7 +31,7 @@
31#define cpu_has_nofpuex 0 31#define cpu_has_nofpuex 0
32#define cpu_has_64bits 1 32#define cpu_has_64bits 1
33 33
34#define cpu_has_subset_pcaches 0 34#define cpu_has_inclusive_pcaches 0
35 35
36#define cpu_dcache_line_size() 32 36#define cpu_dcache_line_size() 32
37#define cpu_icache_line_size() 32 37#define cpu_icache_line_size() 32
diff --git a/include/asm-mips/mipsregs.h b/include/asm-mips/mipsregs.h
index 9192d76c133d..1f318d707998 100644
--- a/include/asm-mips/mipsregs.h
+++ b/include/asm-mips/mipsregs.h
@@ -470,6 +470,8 @@
470 470
471/* Bits specific to the VR41xx. */ 471/* Bits specific to the VR41xx. */
472#define VR41_CONF_CS (_ULCAST_(1) << 12) 472#define VR41_CONF_CS (_ULCAST_(1) << 12)
473#define VR41_CONF_P4K (_ULCAST_(1) << 13)
474#define VR41_CONF_BP (_ULCAST_(1) << 16)
473#define VR41_CONF_M16 (_ULCAST_(1) << 20) 475#define VR41_CONF_M16 (_ULCAST_(1) << 20)
474#define VR41_CONF_AD (_ULCAST_(1) << 23) 476#define VR41_CONF_AD (_ULCAST_(1) << 23)
475 477
@@ -1416,7 +1418,7 @@ change_c0_##name(unsigned int change, unsigned int new) \
1416 1418
1417#else /* SMTC versions that manage MT scheduling */ 1419#else /* SMTC versions that manage MT scheduling */
1418 1420
1419#include <asm/interrupt.h> 1421#include <linux/irqflags.h>
1420 1422
1421/* 1423/*
1422 * This is a duplicate of dmt() in mipsmtregs.h to avoid problems with 1424 * This is a duplicate of dmt() in mipsmtregs.h to avoid problems with
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h
index 6b97744f00cd..219d359861f3 100644
--- a/include/asm-mips/page.h
+++ b/include/asm-mips/page.h
@@ -14,8 +14,6 @@
14 14
15#include <spaces.h> 15#include <spaces.h>
16 16
17#endif
18
19/* 17/*
20 * PAGE_SHIFT determines the page size 18 * PAGE_SHIFT determines the page size
21 */ 19 */
@@ -34,8 +32,6 @@
34#define PAGE_SIZE (1UL << PAGE_SHIFT) 32#define PAGE_SIZE (1UL << PAGE_SHIFT)
35#define PAGE_MASK (~((1 << PAGE_SHIFT) - 1)) 33#define PAGE_MASK (~((1 << PAGE_SHIFT) - 1))
36 34
37
38#ifdef __KERNEL__
39#ifndef __ASSEMBLY__ 35#ifndef __ASSEMBLY__
40 36
41extern void clear_page(void * page); 37extern void clear_page(void * page);
@@ -138,16 +134,14 @@ typedef struct { unsigned long pgprot; } pgprot_t;
138 134
139#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) 135#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)
140 136
141#ifndef CONFIG_SPARSEMEM
142#ifndef CONFIG_NEED_MULTIPLE_NODES
143#define pfn_valid(pfn) ((pfn) < max_mapnr)
144#endif
145#endif
146
147#ifdef CONFIG_FLATMEM 137#ifdef CONFIG_FLATMEM
148 138
149#define pfn_valid(pfn) ((pfn) < max_mapnr) 139#define pfn_valid(pfn) ((pfn) < max_mapnr)
150 140
141#elif defined(CONFIG_SPARSEMEM)
142
143/* pfn_valid is defined in linux/mmzone.h */
144
151#elif defined(CONFIG_NEED_MULTIPLE_NODES) 145#elif defined(CONFIG_NEED_MULTIPLE_NODES)
152 146
153#define pfn_valid(pfn) \ 147#define pfn_valid(pfn) \
@@ -159,8 +153,6 @@ typedef struct { unsigned long pgprot; } pgprot_t;
159 : 0); \ 153 : 0); \
160}) 154})
161 155
162#else
163#error Provide a definition of pfn_valid
164#endif 156#endif
165 157
166#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) 158#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
@@ -172,8 +164,6 @@ typedef struct { unsigned long pgprot; } pgprot_t;
172#define UNCAC_ADDR(addr) ((addr) - PAGE_OFFSET + UNCAC_BASE) 164#define UNCAC_ADDR(addr) ((addr) - PAGE_OFFSET + UNCAC_BASE)
173#define CAC_ADDR(addr) ((addr) - UNCAC_BASE + PAGE_OFFSET) 165#define CAC_ADDR(addr) ((addr) - UNCAC_BASE + PAGE_OFFSET)
174 166
175#endif /* defined (__KERNEL__) */
176
177#ifdef CONFIG_LIMITED_DMA 167#ifdef CONFIG_LIMITED_DMA
178#define WANT_PAGE_VIRTUAL 168#define WANT_PAGE_VIRTUAL
179#endif 169#endif
@@ -181,4 +171,6 @@ typedef struct { unsigned long pgprot; } pgprot_t;
181#include <asm-generic/memory_model.h> 171#include <asm-generic/memory_model.h>
182#include <asm-generic/page.h> 172#include <asm-generic/page.h>
183 173
174#endif /* defined (__KERNEL__) */
175
184#endif /* _ASM_PAGE_H */ 176#endif /* _ASM_PAGE_H */
diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h
index 130333d7c4ee..dcb4701d5728 100644
--- a/include/asm-mips/system.h
+++ b/include/asm-mips/system.h
@@ -13,13 +13,13 @@
13#define _ASM_SYSTEM_H 13#define _ASM_SYSTEM_H
14 14
15#include <linux/types.h> 15#include <linux/types.h>
16#include <linux/irqflags.h>
16 17
17#include <asm/addrspace.h> 18#include <asm/addrspace.h>
18#include <asm/cpu-features.h> 19#include <asm/cpu-features.h>
19#include <asm/dsp.h> 20#include <asm/dsp.h>
20#include <asm/ptrace.h> 21#include <asm/ptrace.h>
21#include <asm/war.h> 22#include <asm/war.h>
22#include <asm/interrupt.h>
23 23
24/* 24/*
25 * read_barrier_depends - Flush all pending reads that subsequents reads 25 * read_barrier_depends - Flush all pending reads that subsequents reads
@@ -143,9 +143,6 @@
143#define set_mb(var, value) \ 143#define set_mb(var, value) \
144do { var = value; mb(); } while (0) 144do { var = value; mb(); } while (0)
145 145
146#define set_wmb(var, value) \
147do { var = value; wmb(); } while (0)
148
149/* 146/*
150 * switch_to(n) should switch tasks to task nr n, first 147 * switch_to(n) should switch tasks to task nr n, first
151 * checking that n isn't the current task, in which case it does nothing. 148 * checking that n isn't the current task, in which case it does nothing.
diff --git a/include/asm-mips/time.h b/include/asm-mips/time.h
index d897c8bb554d..2d543735668b 100644
--- a/include/asm-mips/time.h
+++ b/include/asm-mips/time.h
@@ -83,11 +83,11 @@ extern asmlinkage void ll_local_timer_interrupt(int irq, struct pt_regs *regs);
83/* 83/*
84 * board specific routines required by time_init(). 84 * board specific routines required by time_init().
85 * board_time_init is defaulted to NULL and can remain so. 85 * board_time_init is defaulted to NULL and can remain so.
86 * board_timer_setup must be setup properly in machine setup routine. 86 * plat_timer_setup must be setup properly in machine setup routine.
87 */ 87 */
88struct irqaction; 88struct irqaction;
89extern void (*board_time_init)(void); 89extern void (*board_time_init)(void);
90extern void (*board_timer_setup)(struct irqaction *irq); 90extern void plat_timer_setup(struct irqaction *irq);
91 91
92/* 92/*
93 * mips_hpt_frequency - must be set if you intend to use an R4k-compatible 93 * mips_hpt_frequency - must be set if you intend to use an R4k-compatible
diff --git a/include/asm-mips/unistd.h b/include/asm-mips/unistd.h
index 809f9f55bacb..610ccb8a50b3 100644
--- a/include/asm-mips/unistd.h
+++ b/include/asm-mips/unistd.h
@@ -327,16 +327,18 @@
327#define __NR_splice (__NR_Linux + 304) 327#define __NR_splice (__NR_Linux + 304)
328#define __NR_sync_file_range (__NR_Linux + 305) 328#define __NR_sync_file_range (__NR_Linux + 305)
329#define __NR_tee (__NR_Linux + 306) 329#define __NR_tee (__NR_Linux + 306)
330#define __NR_vmsplice (__NR_Linux + 307)
331#define __NR_move_pages (__NR_Linux + 308)
330 332
331/* 333/*
332 * Offset of the last Linux o32 flavoured syscall 334 * Offset of the last Linux o32 flavoured syscall
333 */ 335 */
334#define __NR_Linux_syscalls 306 336#define __NR_Linux_syscalls 308
335 337
336#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ 338#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
337 339
338#define __NR_O32_Linux 4000 340#define __NR_O32_Linux 4000
339#define __NR_O32_Linux_syscalls 306 341#define __NR_O32_Linux_syscalls 308
340 342
341#if _MIPS_SIM == _MIPS_SIM_ABI64 343#if _MIPS_SIM == _MIPS_SIM_ABI64
342 344
@@ -610,16 +612,18 @@
610#define __NR_splice (__NR_Linux + 263) 612#define __NR_splice (__NR_Linux + 263)
611#define __NR_sync_file_range (__NR_Linux + 264) 613#define __NR_sync_file_range (__NR_Linux + 264)
612#define __NR_tee (__NR_Linux + 265) 614#define __NR_tee (__NR_Linux + 265)
615#define __NR_vmsplice (__NR_Linux + 266)
616#define __NR_move_pages (__NR_Linux + 267)
613 617
614/* 618/*
615 * Offset of the last Linux 64-bit flavoured syscall 619 * Offset of the last Linux 64-bit flavoured syscall
616 */ 620 */
617#define __NR_Linux_syscalls 265 621#define __NR_Linux_syscalls 267
618 622
619#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ 623#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
620 624
621#define __NR_64_Linux 5000 625#define __NR_64_Linux 5000
622#define __NR_64_Linux_syscalls 265 626#define __NR_64_Linux_syscalls 267
623 627
624#if _MIPS_SIM == _MIPS_SIM_NABI32 628#if _MIPS_SIM == _MIPS_SIM_NABI32
625 629
@@ -897,16 +901,18 @@
897#define __NR_splice (__NR_Linux + 267) 901#define __NR_splice (__NR_Linux + 267)
898#define __NR_sync_file_range (__NR_Linux + 268) 902#define __NR_sync_file_range (__NR_Linux + 268)
899#define __NR_tee (__NR_Linux + 269) 903#define __NR_tee (__NR_Linux + 269)
904#define __NR_vmsplice (__NR_Linux + 270)
905#define __NR_move_pages (__NR_Linux + 271)
900 906
901/* 907/*
902 * Offset of the last N32 flavoured syscall 908 * Offset of the last N32 flavoured syscall
903 */ 909 */
904#define __NR_Linux_syscalls 269 910#define __NR_Linux_syscalls 271
905 911
906#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ 912#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
907 913
908#define __NR_N32_Linux 6000 914#define __NR_N32_Linux 6000
909#define __NR_N32_Linux_syscalls 269 915#define __NR_N32_Linux_syscalls 271
910 916
911#ifdef __KERNEL__ 917#ifdef __KERNEL__
912 918
diff --git a/include/asm-mips/vr41xx/capcella.h b/include/asm-mips/vr41xx/capcella.h
index d10ffda50de7..e0ee05a3dfcc 100644
--- a/include/asm-mips/vr41xx/capcella.h
+++ b/include/asm-mips/vr41xx/capcella.h
@@ -20,7 +20,7 @@
20#ifndef __ZAO_CAPCELLA_H 20#ifndef __ZAO_CAPCELLA_H
21#define __ZAO_CAPCELLA_H 21#define __ZAO_CAPCELLA_H
22 22
23#include <asm/vr41xx/vr41xx.h> 23#include <asm/vr41xx/irq.h>
24 24
25/* 25/*
26 * General-Purpose I/O Pin Number 26 * General-Purpose I/O Pin Number
diff --git a/include/asm-mips/vr41xx/cmbvr4133.h b/include/asm-mips/vr41xx/cmbvr4133.h
index 42af389019ea..9490ade58b46 100644
--- a/include/asm-mips/vr41xx/cmbvr4133.h
+++ b/include/asm-mips/vr41xx/cmbvr4133.h
@@ -15,8 +15,7 @@
15#ifndef __NEC_CMBVR4133_H 15#ifndef __NEC_CMBVR4133_H
16#define __NEC_CMBVR4133_H 16#define __NEC_CMBVR4133_H
17 17
18#include <asm/addrspace.h> 18#include <asm/vr41xx/irq.h>
19#include <asm/vr41xx/vr41xx.h>
20 19
21/* 20/*
22 * General-Purpose I/O Pin Number 21 * General-Purpose I/O Pin Number
@@ -55,7 +54,4 @@
55#define IDE_SECONDARY_IRQ I8259_IRQ(15) 54#define IDE_SECONDARY_IRQ I8259_IRQ(15)
56#define I8259_IRQ_LAST IDE_SECONDARY_IRQ 55#define I8259_IRQ_LAST IDE_SECONDARY_IRQ
57 56
58#define RTC_PORT(x) (0xaf000100 + (x))
59#define RTC_IO_EXTENT 0x140
60
61#endif /* __NEC_CMBVR4133_H */ 57#endif /* __NEC_CMBVR4133_H */
diff --git a/include/asm-mips/vr41xx/e55.h b/include/asm-mips/vr41xx/e55.h
deleted file mode 100644
index 558f2269bf37..000000000000
--- a/include/asm-mips/vr41xx/e55.h
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2 * e55.h, Include file for CASIO CASSIOPEIA E-10/15/55/65.
3 *
4 * Copyright (C) 2002-2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
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 as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef __CASIO_E55_H
21#define __CASIO_E55_H
22
23#include <asm/addrspace.h>
24#include <asm/vr41xx/vr41xx.h>
25
26/*
27 * Board specific address mapping
28 */
29#define VR41XX_ISA_MEM_BASE 0x10000000
30#define VR41XX_ISA_MEM_SIZE 0x04000000
31
32/* VR41XX_ISA_IO_BASE includes offset from real base. */
33#define VR41XX_ISA_IO_BASE 0x1400c000
34#define VR41XX_ISA_IO_SIZE 0x03ff4000
35
36#define ISA_BUS_IO_BASE 0
37#define ISA_BUS_IO_SIZE VR41XX_ISA_IO_SIZE
38
39#define IO_PORT_BASE KSEG1ADDR(VR41XX_ISA_IO_BASE)
40#define IO_PORT_RESOURCE_START ISA_BUS_IO_BASE
41#define IO_PORT_RESOURCE_END (ISA_BUS_IO_BASE + ISA_BUS_IO_SIZE - 1)
42
43#endif /* __CASIO_E55_H */
diff --git a/include/asm-mips/vr41xx/irq.h b/include/asm-mips/vr41xx/irq.h
new file mode 100644
index 000000000000..d315dfbc08f2
--- /dev/null
+++ b/include/asm-mips/vr41xx/irq.h
@@ -0,0 +1,101 @@
1/*
2 * include/asm-mips/vr41xx/irq.h
3 *
4 * Interrupt numbers for NEC VR4100 series.
5 *
6 * Copyright (C) 1999 Michael Klar
7 * Copyright (C) 2001, 2002 Paul Mundt
8 * Copyright (C) 2002 MontaVista Software, Inc.
9 * Copyright (C) 2002 TimeSys Corp.
10 * Copyright (C) 2003-2006 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
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#ifndef __NEC_VR41XX_IRQ_H
18#define __NEC_VR41XX_IRQ_H
19
20/*
21 * CPU core Interrupt Numbers
22 */
23#define MIPS_CPU_IRQ_BASE 0
24#define MIPS_CPU_IRQ(x) (MIPS_CPU_IRQ_BASE + (x))
25#define MIPS_SOFTINT0_IRQ MIPS_CPU_IRQ(0)
26#define MIPS_SOFTINT1_IRQ MIPS_CPU_IRQ(1)
27#define INT0_IRQ MIPS_CPU_IRQ(2)
28#define INT1_IRQ MIPS_CPU_IRQ(3)
29#define INT2_IRQ MIPS_CPU_IRQ(4)
30#define INT3_IRQ MIPS_CPU_IRQ(5)
31#define INT4_IRQ MIPS_CPU_IRQ(6)
32#define TIMER_IRQ MIPS_CPU_IRQ(7)
33
34/*
35 * SYINT1 Interrupt Numbers
36 */
37#define SYSINT1_IRQ_BASE 8
38#define SYSINT1_IRQ(x) (SYSINT1_IRQ_BASE + (x))
39#define BATTRY_IRQ SYSINT1_IRQ(0)
40#define POWER_IRQ SYSINT1_IRQ(1)
41#define RTCLONG1_IRQ SYSINT1_IRQ(2)
42#define ELAPSEDTIME_IRQ SYSINT1_IRQ(3)
43/* RFU */
44#define PIU_IRQ SYSINT1_IRQ(5)
45#define AIU_IRQ SYSINT1_IRQ(6)
46#define KIU_IRQ SYSINT1_IRQ(7)
47#define GIUINT_IRQ SYSINT1_IRQ(8)
48#define SIU_IRQ SYSINT1_IRQ(9)
49#define BUSERR_IRQ SYSINT1_IRQ(10)
50#define SOFTINT_IRQ SYSINT1_IRQ(11)
51#define CLKRUN_IRQ SYSINT1_IRQ(12)
52#define DOZEPIU_IRQ SYSINT1_IRQ(13)
53#define SYSINT1_IRQ_LAST DOZEPIU_IRQ
54
55/*
56 * SYSINT2 Interrupt Numbers
57 */
58#define SYSINT2_IRQ_BASE 24
59#define SYSINT2_IRQ(x) (SYSINT2_IRQ_BASE + (x))
60#define RTCLONG2_IRQ SYSINT2_IRQ(0)
61#define LED_IRQ SYSINT2_IRQ(1)
62#define HSP_IRQ SYSINT2_IRQ(2)
63#define TCLOCK_IRQ SYSINT2_IRQ(3)
64#define FIR_IRQ SYSINT2_IRQ(4)
65#define CEU_IRQ SYSINT2_IRQ(4) /* same number as FIR_IRQ */
66#define DSIU_IRQ SYSINT2_IRQ(5)
67#define PCI_IRQ SYSINT2_IRQ(6)
68#define SCU_IRQ SYSINT2_IRQ(7)
69#define CSI_IRQ SYSINT2_IRQ(8)
70#define BCU_IRQ SYSINT2_IRQ(9)
71#define ETHERNET_IRQ SYSINT2_IRQ(10)
72#define SYSINT2_IRQ_LAST ETHERNET_IRQ
73
74/*
75 * GIU Interrupt Numbers
76 */
77#define GIU_IRQ_BASE 40
78#define GIU_IRQ(x) (GIU_IRQ_BASE + (x)) /* IRQ 40-71 */
79#define GIU_IRQ_LAST GIU_IRQ(31)
80
81/*
82 * VRC4173 Interrupt Numbers
83 */
84#define VRC4173_IRQ_BASE 72
85#define VRC4173_IRQ(x) (VRC4173_IRQ_BASE + (x))
86#define VRC4173_USB_IRQ VRC4173_IRQ(0)
87#define VRC4173_PCMCIA2_IRQ VRC4173_IRQ(1)
88#define VRC4173_PCMCIA1_IRQ VRC4173_IRQ(2)
89#define VRC4173_PS2CH2_IRQ VRC4173_IRQ(3)
90#define VRC4173_PS2CH1_IRQ VRC4173_IRQ(4)
91#define VRC4173_PIU_IRQ VRC4173_IRQ(5)
92#define VRC4173_AIU_IRQ VRC4173_IRQ(6)
93#define VRC4173_KIU_IRQ VRC4173_IRQ(7)
94#define VRC4173_GIU_IRQ VRC4173_IRQ(8)
95#define VRC4173_AC97_IRQ VRC4173_IRQ(9)
96#define VRC4173_AC97INT1_IRQ VRC4173_IRQ(10)
97/* RFU */
98#define VRC4173_DOZEPIU_IRQ VRC4173_IRQ(13)
99#define VRC4173_IRQ_LAST VRC4173_DOZEPIU_IRQ
100
101#endif /* __NEC_VR41XX_IRQ_H */
diff --git a/include/asm-mips/vr41xx/mpc30x.h b/include/asm-mips/vr41xx/mpc30x.h
index a6cbe4da6667..1d67df843dc3 100644
--- a/include/asm-mips/vr41xx/mpc30x.h
+++ b/include/asm-mips/vr41xx/mpc30x.h
@@ -20,7 +20,7 @@
20#ifndef __VICTOR_MPC30X_H 20#ifndef __VICTOR_MPC30X_H
21#define __VICTOR_MPC30X_H 21#define __VICTOR_MPC30X_H
22 22
23#include <asm/vr41xx/vr41xx.h> 23#include <asm/vr41xx/irq.h>
24 24
25/* 25/*
26 * General-Purpose I/O Pin Number 26 * General-Purpose I/O Pin Number
diff --git a/include/asm-mips/vr41xx/tb0219.h b/include/asm-mips/vr41xx/tb0219.h
index b318b9612a83..dc981b4be0a4 100644
--- a/include/asm-mips/vr41xx/tb0219.h
+++ b/include/asm-mips/vr41xx/tb0219.h
@@ -23,7 +23,7 @@
23#ifndef __TANBAC_TB0219_H 23#ifndef __TANBAC_TB0219_H
24#define __TANBAC_TB0219_H 24#define __TANBAC_TB0219_H
25 25
26#include <asm/vr41xx/vr41xx.h> 26#include <asm/vr41xx/irq.h>
27 27
28/* 28/*
29 * General-Purpose I/O Pin Number 29 * General-Purpose I/O Pin Number
diff --git a/include/asm-mips/vr41xx/tb0226.h b/include/asm-mips/vr41xx/tb0226.h
index 2513f450e2d6..de527dcfa5f3 100644
--- a/include/asm-mips/vr41xx/tb0226.h
+++ b/include/asm-mips/vr41xx/tb0226.h
@@ -20,7 +20,7 @@
20#ifndef __TANBAC_TB0226_H 20#ifndef __TANBAC_TB0226_H
21#define __TANBAC_TB0226_H 21#define __TANBAC_TB0226_H
22 22
23#include <asm/vr41xx/vr41xx.h> 23#include <asm/vr41xx/irq.h>
24 24
25/* 25/*
26 * General-Purpose I/O Pin Number 26 * General-Purpose I/O Pin Number
diff --git a/include/asm-mips/vr41xx/tb0287.h b/include/asm-mips/vr41xx/tb0287.h
index dd9832313afe..61bead68abf0 100644
--- a/include/asm-mips/vr41xx/tb0287.h
+++ b/include/asm-mips/vr41xx/tb0287.h
@@ -22,7 +22,7 @@
22#ifndef __TANBAC_TB0287_H 22#ifndef __TANBAC_TB0287_H
23#define __TANBAC_TB0287_H 23#define __TANBAC_TB0287_H
24 24
25#include <asm/vr41xx/vr41xx.h> 25#include <asm/vr41xx/irq.h>
26 26
27/* 27/*
28 * General-Purpose I/O Pin Number 28 * General-Purpose I/O Pin Number
diff --git a/include/asm-mips/vr41xx/vr41xx.h b/include/asm-mips/vr41xx/vr41xx.h
index 70828d5fae9c..dd3eb3dc5886 100644
--- a/include/asm-mips/vr41xx/vr41xx.h
+++ b/include/asm-mips/vr41xx/vr41xx.h
@@ -74,59 +74,6 @@ extern void vr41xx_mask_clock(vr41xx_clock_t clock);
74/* 74/*
75 * Interrupt Control Unit 75 * Interrupt Control Unit
76 */ 76 */
77/* CPU core Interrupt Numbers */
78#define MIPS_CPU_IRQ_BASE 0
79#define MIPS_CPU_IRQ(x) (MIPS_CPU_IRQ_BASE + (x))
80#define MIPS_SOFTINT0_IRQ MIPS_CPU_IRQ(0)
81#define MIPS_SOFTINT1_IRQ MIPS_CPU_IRQ(1)
82#define INT0_IRQ MIPS_CPU_IRQ(2)
83#define INT1_IRQ MIPS_CPU_IRQ(3)
84#define INT2_IRQ MIPS_CPU_IRQ(4)
85#define INT3_IRQ MIPS_CPU_IRQ(5)
86#define INT4_IRQ MIPS_CPU_IRQ(6)
87#define TIMER_IRQ MIPS_CPU_IRQ(7)
88
89/* SYINT1 Interrupt Numbers */
90#define SYSINT1_IRQ_BASE 8
91#define SYSINT1_IRQ(x) (SYSINT1_IRQ_BASE + (x))
92#define BATTRY_IRQ SYSINT1_IRQ(0)
93#define POWER_IRQ SYSINT1_IRQ(1)
94#define RTCLONG1_IRQ SYSINT1_IRQ(2)
95#define ELAPSEDTIME_IRQ SYSINT1_IRQ(3)
96/* RFU */
97#define PIU_IRQ SYSINT1_IRQ(5)
98#define AIU_IRQ SYSINT1_IRQ(6)
99#define KIU_IRQ SYSINT1_IRQ(7)
100#define GIUINT_IRQ SYSINT1_IRQ(8)
101#define SIU_IRQ SYSINT1_IRQ(9)
102#define BUSERR_IRQ SYSINT1_IRQ(10)
103#define SOFTINT_IRQ SYSINT1_IRQ(11)
104#define CLKRUN_IRQ SYSINT1_IRQ(12)
105#define DOZEPIU_IRQ SYSINT1_IRQ(13)
106#define SYSINT1_IRQ_LAST DOZEPIU_IRQ
107
108/* SYSINT2 Interrupt Numbers */
109#define SYSINT2_IRQ_BASE 24
110#define SYSINT2_IRQ(x) (SYSINT2_IRQ_BASE + (x))
111#define RTCLONG2_IRQ SYSINT2_IRQ(0)
112#define LED_IRQ SYSINT2_IRQ(1)
113#define HSP_IRQ SYSINT2_IRQ(2)
114#define TCLOCK_IRQ SYSINT2_IRQ(3)
115#define FIR_IRQ SYSINT2_IRQ(4)
116#define CEU_IRQ SYSINT2_IRQ(4) /* same number as FIR_IRQ */
117#define DSIU_IRQ SYSINT2_IRQ(5)
118#define PCI_IRQ SYSINT2_IRQ(6)
119#define SCU_IRQ SYSINT2_IRQ(7)
120#define CSI_IRQ SYSINT2_IRQ(8)
121#define BCU_IRQ SYSINT2_IRQ(9)
122#define ETHERNET_IRQ SYSINT2_IRQ(10)
123#define SYSINT2_IRQ_LAST ETHERNET_IRQ
124
125/* GIU Interrupt Numbers */
126#define GIU_IRQ_BASE 40
127#define GIU_IRQ(x) (GIU_IRQ_BASE + (x)) /* IRQ 40-71 */
128#define GIU_IRQ_LAST GIU_IRQ(31)
129
130extern int vr41xx_set_intassign(unsigned int irq, unsigned char intassign); 77extern int vr41xx_set_intassign(unsigned int irq, unsigned char intassign);
131extern int cascade_irq(unsigned int irq, int (*get_irq)(unsigned int, struct pt_regs *)); 78extern int cascade_irq(unsigned int irq, int (*get_irq)(unsigned int, struct pt_regs *));
132 79
diff --git a/include/asm-mips/vr41xx/vrc4173.h b/include/asm-mips/vr41xx/vrc4173.h
deleted file mode 100644
index 96fdcd54cec7..000000000000
--- a/include/asm-mips/vr41xx/vrc4173.h
+++ /dev/null
@@ -1,221 +0,0 @@
1/*
2 * vrc4173.h, Include file for NEC VRC4173.
3 *
4 * Copyright (C) 2000 Michael R. McDonald
5 * Copyright (C) 2001-2003 Montavista Software Inc.
6 * Author: Yoichi Yuasa <yyuasa@mvista.com, or source@mvista.com>
7 * Copyright (C) 2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
8 * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org)
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24#ifndef __NEC_VRC4173_H
25#define __NEC_VRC4173_H
26
27#include <asm/io.h>
28
29/*
30 * Interrupt Number
31 */
32#define VRC4173_IRQ_BASE 72
33#define VRC4173_IRQ(x) (VRC4173_IRQ_BASE + (x))
34#define VRC4173_USB_IRQ VRC4173_IRQ(0)
35#define VRC4173_PCMCIA2_IRQ VRC4173_IRQ(1)
36#define VRC4173_PCMCIA1_IRQ VRC4173_IRQ(2)
37#define VRC4173_PS2CH2_IRQ VRC4173_IRQ(3)
38#define VRC4173_PS2CH1_IRQ VRC4173_IRQ(4)
39#define VRC4173_PIU_IRQ VRC4173_IRQ(5)
40#define VRC4173_AIU_IRQ VRC4173_IRQ(6)
41#define VRC4173_KIU_IRQ VRC4173_IRQ(7)
42#define VRC4173_GIU_IRQ VRC4173_IRQ(8)
43#define VRC4173_AC97_IRQ VRC4173_IRQ(9)
44#define VRC4173_AC97INT1_IRQ VRC4173_IRQ(10)
45/* RFU */
46#define VRC4173_DOZEPIU_IRQ VRC4173_IRQ(13)
47#define VRC4173_IRQ_LAST VRC4173_DOZEPIU_IRQ
48
49/*
50 * PCI I/O accesses
51 */
52#ifdef CONFIG_VRC4173
53
54extern unsigned long vrc4173_io_offset;
55
56#define set_vrc4173_io_offset(offset) do { vrc4173_io_offset = (offset); } while (0)
57
58#define vrc4173_outb(val,port) outb((val), vrc4173_io_offset+(port))
59#define vrc4173_outw(val,port) outw((val), vrc4173_io_offset+(port))
60#define vrc4173_outl(val,port) outl((val), vrc4173_io_offset+(port))
61#define vrc4173_outb_p(val,port) outb_p((val), vrc4173_io_offset+(port))
62#define vrc4173_outw_p(val,port) outw_p((val), vrc4173_io_offset+(port))
63#define vrc4173_outl_p(val,port) outl_p((val), vrc4173_io_offset+(port))
64
65#define vrc4173_inb(port) inb(vrc4173_io_offset+(port))
66#define vrc4173_inw(port) inw(vrc4173_io_offset+(port))
67#define vrc4173_inl(port) inl(vrc4173_io_offset+(port))
68#define vrc4173_inb_p(port) inb_p(vrc4173_io_offset+(port))
69#define vrc4173_inw_p(port) inw_p(vrc4173_io_offset+(port))
70#define vrc4173_inl_p(port) inl_p(vrc4173_io_offset+(port))
71
72#define vrc4173_outsb(port,addr,count) outsb(vrc4173_io_offset+(port),(addr),(count))
73#define vrc4173_outsw(port,addr,count) outsw(vrc4173_io_offset+(port),(addr),(count))
74#define vrc4173_outsl(port,addr,count) outsl(vrc4173_io_offset+(port),(addr),(count))
75
76#define vrc4173_insb(port,addr,count) insb(vrc4173_io_offset+(port),(addr),(count))
77#define vrc4173_insw(port,addr,count) insw(vrc4173_io_offset+(port),(addr),(count))
78#define vrc4173_insl(port,addr,count) insl(vrc4173_io_offset+(port),(addr),(count))
79
80#else
81
82#define set_vrc4173_io_offset(offset) do {} while (0)
83
84#define vrc4173_outb(val,port) do {} while (0)
85#define vrc4173_outw(val,port) do {} while (0)
86#define vrc4173_outl(val,port) do {} while (0)
87#define vrc4173_outb_p(val,port) do {} while (0)
88#define vrc4173_outw_p(val,port) do {} while (0)
89#define vrc4173_outl_p(val,port) do {} while (0)
90
91#define vrc4173_inb(port) 0
92#define vrc4173_inw(port) 0
93#define vrc4173_inl(port) 0
94#define vrc4173_inb_p(port) 0
95#define vrc4173_inw_p(port) 0
96#define vrc4173_inl_p(port) 0
97
98#define vrc4173_outsb(port,addr,count) do {} while (0)
99#define vrc4173_outsw(port,addr,count) do {} while (0)
100#define vrc4173_outsl(port,addr,count) do {} while (0)
101
102#define vrc4173_insb(port,addr,count) do {} while (0)
103#define vrc4173_insw(port,addr,count) do {} while (0)
104#define vrc4173_insl(port,addr,count) do {} while (0)
105
106#endif
107
108/*
109 * Clock Mask Unit
110 */
111typedef enum vrc4173_clock {
112 VRC4173_PIU_CLOCK,
113 VRC4173_KIU_CLOCK,
114 VRC4173_AIU_CLOCK,
115 VRC4173_PS2_CH1_CLOCK,
116 VRC4173_PS2_CH2_CLOCK,
117 VRC4173_USBU_PCI_CLOCK,
118 VRC4173_CARDU1_PCI_CLOCK,
119 VRC4173_CARDU2_PCI_CLOCK,
120 VRC4173_AC97U_PCI_CLOCK,
121 VRC4173_USBU_48MHz_CLOCK,
122 VRC4173_EXT_48MHz_CLOCK,
123 VRC4173_48MHz_CLOCK,
124} vrc4173_clock_t;
125
126#ifdef CONFIG_VRC4173
127
128extern void vrc4173_supply_clock(vrc4173_clock_t clock);
129extern void vrc4173_mask_clock(vrc4173_clock_t clock);
130
131#else
132
133static inline void vrc4173_supply_clock(vrc4173_clock_t clock) {}
134static inline void vrc4173_mask_clock(vrc4173_clock_t clock) {}
135
136#endif
137
138/*
139 * Interupt Control Unit
140 */
141
142#define VRC4173_PIUINT_COMMAND 0x0040
143#define VRC4173_PIUINT_DATA 0x0020
144#define VRC4173_PIUINT_PAGE1 0x0010
145#define VRC4173_PIUINT_PAGE0 0x0008
146#define VRC4173_PIUINT_DATALOST 0x0004
147#define VRC4173_PIUINT_STATUSCHANGE 0x0001
148
149#ifdef CONFIG_VRC4173
150
151extern void vrc4173_enable_piuint(uint16_t mask);
152extern void vrc4173_disable_piuint(uint16_t mask);
153
154#else
155
156static inline void vrc4173_enable_piuint(uint16_t mask) {}
157static inline void vrc4173_disable_piuint(uint16_t mask) {}
158
159#endif
160
161#define VRC4173_AIUINT_INPUT_DMAEND 0x0800
162#define VRC4173_AIUINT_INPUT_DMAHALT 0x0400
163#define VRC4173_AIUINT_INPUT_DATALOST 0x0200
164#define VRC4173_AIUINT_INPUT_DATA 0x0100
165#define VRC4173_AIUINT_OUTPUT_DMAEND 0x0008
166#define VRC4173_AIUINT_OUTPUT_DMAHALT 0x0004
167#define VRC4173_AIUINT_OUTPUT_NODATA 0x0002
168
169#ifdef CONFIG_VRC4173
170
171extern void vrc4173_enable_aiuint(uint16_t mask);
172extern void vrc4173_disable_aiuint(uint16_t mask);
173
174#else
175
176static inline void vrc4173_enable_aiuint(uint16_t mask) {}
177static inline void vrc4173_disable_aiuint(uint16_t mask) {}
178
179#endif
180
181#define VRC4173_KIUINT_DATALOST 0x0004
182#define VRC4173_KIUINT_DATAREADY 0x0002
183#define VRC4173_KIUINT_SCAN 0x0001
184
185#ifdef CONFIG_VRC4173
186
187extern void vrc4173_enable_kiuint(uint16_t mask);
188extern void vrc4173_disable_kiuint(uint16_t mask);
189
190#else
191
192static inline void vrc4173_enable_kiuint(uint16_t mask) {}
193static inline void vrc4173_disable_kiuint(uint16_t mask) {}
194
195#endif
196
197/*
198 * General-Purpose I/O Unit
199 */
200typedef enum vrc4173_function {
201 PS2_CHANNEL1,
202 PS2_CHANNEL2,
203 TOUCHPANEL,
204 KEYBOARD_8SCANLINES,
205 KEYBOARD_10SCANLINES,
206 KEYBOARD_12SCANLINES,
207 GPIO_0_15PINS,
208 GPIO_16_20PINS,
209} vrc4173_function_t;
210
211#ifdef CONFIG_VRC4173
212
213extern void vrc4173_select_function(vrc4173_function_t function);
214
215#else
216
217static inline void vrc4173_select_function(vrc4173_function_t function) {}
218
219#endif
220
221#endif /* __NEC_VRC4173_H */
diff --git a/include/asm-mips/vr41xx/workpad.h b/include/asm-mips/vr41xx/workpad.h
deleted file mode 100644
index 6bfa9c009a9b..000000000000
--- a/include/asm-mips/vr41xx/workpad.h
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2 * workpad.h, Include file for IBM WorkPad z50.
3 *
4 * Copyright (C) 2002-2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
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 as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef __IBM_WORKPAD_H
21#define __IBM_WORKPAD_H
22
23#include <asm/addrspace.h>
24#include <asm/vr41xx/vr41xx.h>
25
26/*
27 * Board specific address mapping
28 */
29#define VR41XX_ISA_MEM_BASE 0x10000000
30#define VR41XX_ISA_MEM_SIZE 0x04000000
31
32/* VR41XX_ISA_IO_BASE includes offset from real base. */
33#define VR41XX_ISA_IO_BASE 0x15000000
34#define VR41XX_ISA_IO_SIZE 0x03000000
35
36#define ISA_BUS_IO_BASE 0
37#define ISA_BUS_IO_SIZE VR41XX_ISA_IO_SIZE
38
39#define IO_PORT_BASE KSEG1ADDR(VR41XX_ISA_IO_BASE)
40#define IO_PORT_RESOURCE_START ISA_BUS_IO_BASE
41#define IO_PORT_RESOURCE_END (ISA_BUS_IO_BASE + ISA_BUS_IO_SIZE - 1)
42
43#endif /* __IBM_WORKPAD_H */
diff --git a/include/asm-parisc/system.h b/include/asm-parisc/system.h
index 5fe2d2329ab5..74f037a39e6f 100644
--- a/include/asm-parisc/system.h
+++ b/include/asm-parisc/system.h
@@ -143,8 +143,6 @@ static inline void set_eiem(unsigned long val)
143#define read_barrier_depends() do { } while(0) 143#define read_barrier_depends() do { } while(0)
144 144
145#define set_mb(var, value) do { var = value; mb(); } while (0) 145#define set_mb(var, value) do { var = value; mb(); } while (0)
146#define set_wmb(var, value) do { var = value; wmb(); } while (0)
147
148 146
149#ifndef CONFIG_PA20 147#ifndef CONFIG_PA20
150/* Because kmalloc only guarantees 8-byte alignment for kmalloc'd data, 148/* Because kmalloc only guarantees 8-byte alignment for kmalloc'd data,
diff --git a/include/asm-powerpc/atomic.h b/include/asm-powerpc/atomic.h
index bb3c0ab7e667..53283e2540b3 100644
--- a/include/asm-powerpc/atomic.h
+++ b/include/asm-powerpc/atomic.h
@@ -27,8 +27,8 @@ static __inline__ void atomic_add(int a, atomic_t *v)
27 PPC405_ERR77(0,%3) 27 PPC405_ERR77(0,%3)
28" stwcx. %0,0,%3 \n\ 28" stwcx. %0,0,%3 \n\
29 bne- 1b" 29 bne- 1b"
30 : "=&r" (t), "=m" (v->counter) 30 : "=&r" (t), "+m" (v->counter)
31 : "r" (a), "r" (&v->counter), "m" (v->counter) 31 : "r" (a), "r" (&v->counter)
32 : "cc"); 32 : "cc");
33} 33}
34 34
@@ -63,8 +63,8 @@ static __inline__ void atomic_sub(int a, atomic_t *v)
63 PPC405_ERR77(0,%3) 63 PPC405_ERR77(0,%3)
64" stwcx. %0,0,%3 \n\ 64" stwcx. %0,0,%3 \n\
65 bne- 1b" 65 bne- 1b"
66 : "=&r" (t), "=m" (v->counter) 66 : "=&r" (t), "+m" (v->counter)
67 : "r" (a), "r" (&v->counter), "m" (v->counter) 67 : "r" (a), "r" (&v->counter)
68 : "cc"); 68 : "cc");
69} 69}
70 70
@@ -97,8 +97,8 @@ static __inline__ void atomic_inc(atomic_t *v)
97 PPC405_ERR77(0,%2) 97 PPC405_ERR77(0,%2)
98" stwcx. %0,0,%2 \n\ 98" stwcx. %0,0,%2 \n\
99 bne- 1b" 99 bne- 1b"
100 : "=&r" (t), "=m" (v->counter) 100 : "=&r" (t), "+m" (v->counter)
101 : "r" (&v->counter), "m" (v->counter) 101 : "r" (&v->counter)
102 : "cc"); 102 : "cc");
103} 103}
104 104
@@ -141,8 +141,8 @@ static __inline__ void atomic_dec(atomic_t *v)
141 PPC405_ERR77(0,%2)\ 141 PPC405_ERR77(0,%2)\
142" stwcx. %0,0,%2\n\ 142" stwcx. %0,0,%2\n\
143 bne- 1b" 143 bne- 1b"
144 : "=&r" (t), "=m" (v->counter) 144 : "=&r" (t), "+m" (v->counter)
145 : "r" (&v->counter), "m" (v->counter) 145 : "r" (&v->counter)
146 : "cc"); 146 : "cc");
147} 147}
148 148
@@ -253,8 +253,8 @@ static __inline__ void atomic64_add(long a, atomic64_t *v)
253 add %0,%2,%0\n\ 253 add %0,%2,%0\n\
254 stdcx. %0,0,%3 \n\ 254 stdcx. %0,0,%3 \n\
255 bne- 1b" 255 bne- 1b"
256 : "=&r" (t), "=m" (v->counter) 256 : "=&r" (t), "+m" (v->counter)
257 : "r" (a), "r" (&v->counter), "m" (v->counter) 257 : "r" (a), "r" (&v->counter)
258 : "cc"); 258 : "cc");
259} 259}
260 260
@@ -287,8 +287,8 @@ static __inline__ void atomic64_sub(long a, atomic64_t *v)
287 subf %0,%2,%0\n\ 287 subf %0,%2,%0\n\
288 stdcx. %0,0,%3 \n\ 288 stdcx. %0,0,%3 \n\
289 bne- 1b" 289 bne- 1b"
290 : "=&r" (t), "=m" (v->counter) 290 : "=&r" (t), "+m" (v->counter)
291 : "r" (a), "r" (&v->counter), "m" (v->counter) 291 : "r" (a), "r" (&v->counter)
292 : "cc"); 292 : "cc");
293} 293}
294 294
@@ -319,8 +319,8 @@ static __inline__ void atomic64_inc(atomic64_t *v)
319 addic %0,%0,1\n\ 319 addic %0,%0,1\n\
320 stdcx. %0,0,%2 \n\ 320 stdcx. %0,0,%2 \n\
321 bne- 1b" 321 bne- 1b"
322 : "=&r" (t), "=m" (v->counter) 322 : "=&r" (t), "+m" (v->counter)
323 : "r" (&v->counter), "m" (v->counter) 323 : "r" (&v->counter)
324 : "cc"); 324 : "cc");
325} 325}
326 326
@@ -361,8 +361,8 @@ static __inline__ void atomic64_dec(atomic64_t *v)
361 addic %0,%0,-1\n\ 361 addic %0,%0,-1\n\
362 stdcx. %0,0,%2\n\ 362 stdcx. %0,0,%2\n\
363 bne- 1b" 363 bne- 1b"
364 : "=&r" (t), "=m" (v->counter) 364 : "=&r" (t), "+m" (v->counter)
365 : "r" (&v->counter), "m" (v->counter) 365 : "r" (&v->counter)
366 : "cc"); 366 : "cc");
367} 367}
368 368
diff --git a/include/asm-powerpc/backlight.h b/include/asm-powerpc/backlight.h
index a5e9e656e332..8cf5c37c3817 100644
--- a/include/asm-powerpc/backlight.h
+++ b/include/asm-powerpc/backlight.h
@@ -16,16 +16,26 @@
16extern struct backlight_device *pmac_backlight; 16extern struct backlight_device *pmac_backlight;
17extern struct mutex pmac_backlight_mutex; 17extern struct mutex pmac_backlight_mutex;
18 18
19extern void pmac_backlight_calc_curve(struct fb_info*);
20extern int pmac_backlight_curve_lookup(struct fb_info *info, int value); 19extern int pmac_backlight_curve_lookup(struct fb_info *info, int value);
21 20
22extern int pmac_has_backlight_type(const char *type); 21extern int pmac_has_backlight_type(const char *type);
23 22
24extern void pmac_backlight_key_up(void); 23extern void pmac_backlight_key(int direction);
25extern void pmac_backlight_key_down(void); 24static inline void pmac_backlight_key_up(void)
25{
26 pmac_backlight_key(0);
27}
28static inline void pmac_backlight_key_down(void)
29{
30 pmac_backlight_key(1);
31}
26 32
33extern void pmac_backlight_set_legacy_brightness_pmu(int brightness);
27extern int pmac_backlight_set_legacy_brightness(int brightness); 34extern int pmac_backlight_set_legacy_brightness(int brightness);
28extern int pmac_backlight_get_legacy_brightness(void); 35extern int pmac_backlight_get_legacy_brightness(void);
29 36
37extern void pmac_backlight_enable(void);
38extern void pmac_backlight_disable(void);
39
30#endif /* __KERNEL__ */ 40#endif /* __KERNEL__ */
31#endif 41#endif
diff --git a/include/asm-powerpc/bitops.h b/include/asm-powerpc/bitops.h
index 76e2f08c3c83..c341063d0804 100644
--- a/include/asm-powerpc/bitops.h
+++ b/include/asm-powerpc/bitops.h
@@ -65,8 +65,8 @@ static __inline__ void set_bit(int nr, volatile unsigned long *addr)
65 PPC405_ERR77(0,%3) 65 PPC405_ERR77(0,%3)
66 PPC_STLCX "%0,0,%3\n" 66 PPC_STLCX "%0,0,%3\n"
67 "bne- 1b" 67 "bne- 1b"
68 : "=&r"(old), "=m"(*p) 68 : "=&r" (old), "+m" (*p)
69 : "r"(mask), "r"(p), "m"(*p) 69 : "r" (mask), "r" (p)
70 : "cc" ); 70 : "cc" );
71} 71}
72 72
@@ -82,8 +82,8 @@ static __inline__ void clear_bit(int nr, volatile unsigned long *addr)
82 PPC405_ERR77(0,%3) 82 PPC405_ERR77(0,%3)
83 PPC_STLCX "%0,0,%3\n" 83 PPC_STLCX "%0,0,%3\n"
84 "bne- 1b" 84 "bne- 1b"
85 : "=&r"(old), "=m"(*p) 85 : "=&r" (old), "+m" (*p)
86 : "r"(mask), "r"(p), "m"(*p) 86 : "r" (mask), "r" (p)
87 : "cc" ); 87 : "cc" );
88} 88}
89 89
@@ -99,8 +99,8 @@ static __inline__ void change_bit(int nr, volatile unsigned long *addr)
99 PPC405_ERR77(0,%3) 99 PPC405_ERR77(0,%3)
100 PPC_STLCX "%0,0,%3\n" 100 PPC_STLCX "%0,0,%3\n"
101 "bne- 1b" 101 "bne- 1b"
102 : "=&r"(old), "=m"(*p) 102 : "=&r" (old), "+m" (*p)
103 : "r"(mask), "r"(p), "m"(*p) 103 : "r" (mask), "r" (p)
104 : "cc" ); 104 : "cc" );
105} 105}
106 106
@@ -179,8 +179,8 @@ static __inline__ void set_bits(unsigned long mask, unsigned long *addr)
179 "or %0,%0,%2\n" 179 "or %0,%0,%2\n"
180 PPC_STLCX "%0,0,%3\n" 180 PPC_STLCX "%0,0,%3\n"
181 "bne- 1b" 181 "bne- 1b"
182 : "=&r" (old), "=m" (*addr) 182 : "=&r" (old), "+m" (*addr)
183 : "r" (mask), "r" (addr), "m" (*addr) 183 : "r" (mask), "r" (addr)
184 : "cc"); 184 : "cc");
185} 185}
186 186
diff --git a/include/asm-powerpc/eeh.h b/include/asm-powerpc/eeh.h
index 4df3e80118f4..6a784396660b 100644
--- a/include/asm-powerpc/eeh.h
+++ b/include/asm-powerpc/eeh.h
@@ -205,6 +205,7 @@ static inline void eeh_memset_io(volatile void __iomem *addr, int c,
205 lc |= lc << 8; 205 lc |= lc << 8;
206 lc |= lc << 16; 206 lc |= lc << 16;
207 207
208 __asm__ __volatile__ ("sync" : : : "memory");
208 while(n && !EEH_CHECK_ALIGN(p, 4)) { 209 while(n && !EEH_CHECK_ALIGN(p, 4)) {
209 *((volatile u8 *)p) = c; 210 *((volatile u8 *)p) = c;
210 p++; 211 p++;
@@ -229,6 +230,7 @@ static inline void eeh_memcpy_fromio(void *dest, const volatile void __iomem *sr
229 void *destsave = dest; 230 void *destsave = dest;
230 unsigned long nsave = n; 231 unsigned long nsave = n;
231 232
233 __asm__ __volatile__ ("sync" : : : "memory");
232 while(n && (!EEH_CHECK_ALIGN(vsrc, 4) || !EEH_CHECK_ALIGN(dest, 4))) { 234 while(n && (!EEH_CHECK_ALIGN(vsrc, 4) || !EEH_CHECK_ALIGN(dest, 4))) {
233 *((u8 *)dest) = *((volatile u8 *)vsrc); 235 *((u8 *)dest) = *((volatile u8 *)vsrc);
234 __asm__ __volatile__ ("eieio" : : : "memory"); 236 __asm__ __volatile__ ("eieio" : : : "memory");
@@ -266,6 +268,7 @@ static inline void eeh_memcpy_toio(volatile void __iomem *dest, const void *src,
266{ 268{
267 void *vdest = (void __force *) dest; 269 void *vdest = (void __force *) dest;
268 270
271 __asm__ __volatile__ ("sync" : : : "memory");
269 while(n && (!EEH_CHECK_ALIGN(vdest, 4) || !EEH_CHECK_ALIGN(src, 4))) { 272 while(n && (!EEH_CHECK_ALIGN(vdest, 4) || !EEH_CHECK_ALIGN(src, 4))) {
270 *((volatile u8 *)vdest) = *((u8 *)src); 273 *((volatile u8 *)vdest) = *((u8 *)src);
271 src++; 274 src++;
diff --git a/include/asm-powerpc/futex.h b/include/asm-powerpc/futex.h
index f1b3c00bc1ce..936422e54891 100644
--- a/include/asm-powerpc/futex.h
+++ b/include/asm-powerpc/futex.h
@@ -84,7 +84,33 @@ static inline int futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
84static inline int 84static inline int
85futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) 85futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
86{ 86{
87 return -ENOSYS; 87 int prev;
88
89 if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int)))
90 return -EFAULT;
91
92 __asm__ __volatile__ (
93 LWSYNC_ON_SMP
94"1: lwarx %0,0,%2 # futex_atomic_cmpxchg_inatomic\n\
95 cmpw 0,%0,%3\n\
96 bne- 3f\n"
97 PPC405_ERR77(0,%2)
98"2: stwcx. %4,0,%2\n\
99 bne- 1b\n"
100 ISYNC_ON_SMP
101"3: .section .fixup,\"ax\"\n\
1024: li %0,%5\n\
103 b 3b\n\
104 .previous\n\
105 .section __ex_table,\"a\"\n\
106 .align 3\n\
107 " PPC_LONG "1b,4b,2b,4b\n\
108 .previous" \
109 : "=&r" (prev), "+m" (*uaddr)
110 : "r" (uaddr), "r" (oldval), "r" (newval), "i" (-EFAULT)
111 : "cc", "memory");
112
113 return prev;
88} 114}
89 115
90#endif /* __KERNEL__ */ 116#endif /* __KERNEL__ */
diff --git a/include/asm-powerpc/io.h b/include/asm-powerpc/io.h
index a9496f34b048..212428db0d8b 100644
--- a/include/asm-powerpc/io.h
+++ b/include/asm-powerpc/io.h
@@ -19,6 +19,7 @@ extern int check_legacy_ioport(unsigned long base_port);
19#include <linux/compiler.h> 19#include <linux/compiler.h>
20#include <asm/page.h> 20#include <asm/page.h>
21#include <asm/byteorder.h> 21#include <asm/byteorder.h>
22#include <asm/paca.h>
22#ifdef CONFIG_PPC_ISERIES 23#ifdef CONFIG_PPC_ISERIES
23#include <asm/iseries/iseries_io.h> 24#include <asm/iseries/iseries_io.h>
24#endif 25#endif
@@ -72,6 +73,9 @@ extern unsigned long pci_io_base;
72 * Neither do the standard versions now, these are just here 73 * Neither do the standard versions now, these are just here
73 * for older code. 74 * for older code.
74 */ 75 */
76#define insb(port, buf, ns) _insb((u8 __iomem *)((port)+pci_io_base), (buf), (ns))
77#define insw(port, buf, ns) _insw_ns((u8 __iomem *)((port)+pci_io_base), (buf), (ns))
78#define insl(port, buf, nl) _insl_ns((u8 __iomem *)((port)+pci_io_base), (buf), (nl))
75#define insw_ns(port, buf, ns) _insw_ns((u16 __iomem *)((port)+pci_io_base), (buf), (ns)) 79#define insw_ns(port, buf, ns) _insw_ns((u16 __iomem *)((port)+pci_io_base), (buf), (ns))
76#define insl_ns(port, buf, nl) _insl_ns((u32 __iomem *)((port)+pci_io_base), (buf), (nl)) 80#define insl_ns(port, buf, nl) _insl_ns((u32 __iomem *)((port)+pci_io_base), (buf), (nl))
77#else 81#else
@@ -137,12 +141,12 @@ static inline void __raw_writeq(unsigned long v, volatile void __iomem *addr)
137#define insw_ns(port, buf, ns) eeh_insw_ns((port), (buf), (ns)) 141#define insw_ns(port, buf, ns) eeh_insw_ns((port), (buf), (ns))
138#define insl_ns(port, buf, nl) eeh_insl_ns((port), (buf), (nl)) 142#define insl_ns(port, buf, nl) eeh_insl_ns((port), (buf), (nl))
139 143
144#endif
145
140#define outsb(port, buf, ns) _outsb((u8 __iomem *)((port)+pci_io_base), (buf), (ns)) 146#define outsb(port, buf, ns) _outsb((u8 __iomem *)((port)+pci_io_base), (buf), (ns))
141#define outsw(port, buf, ns) _outsw_ns((u16 __iomem *)((port)+pci_io_base), (buf), (ns)) 147#define outsw(port, buf, ns) _outsw_ns((u16 __iomem *)((port)+pci_io_base), (buf), (ns))
142#define outsl(port, buf, nl) _outsl_ns((u32 __iomem *)((port)+pci_io_base), (buf), (nl)) 148#define outsl(port, buf, nl) _outsl_ns((u32 __iomem *)((port)+pci_io_base), (buf), (nl))
143 149
144#endif
145
146#define readb_relaxed(addr) readb(addr) 150#define readb_relaxed(addr) readb(addr)
147#define readw_relaxed(addr) readw(addr) 151#define readw_relaxed(addr) readw(addr)
148#define readl_relaxed(addr) readl(addr) 152#define readl_relaxed(addr) readl(addr)
@@ -159,7 +163,11 @@ extern void _outsw_ns(volatile u16 __iomem *port, const void *buf, int ns);
159extern void _insl_ns(volatile u32 __iomem *port, void *buf, int nl); 163extern void _insl_ns(volatile u32 __iomem *port, void *buf, int nl);
160extern void _outsl_ns(volatile u32 __iomem *port, const void *buf, int nl); 164extern void _outsl_ns(volatile u32 __iomem *port, const void *buf, int nl);
161 165
162#define mmiowb() 166static inline void mmiowb(void)
167{
168 __asm__ __volatile__ ("sync" : : : "memory");
169 get_paca()->io_sync = 0;
170}
163 171
164/* 172/*
165 * output pause versions need a delay at least for the 173 * output pause versions need a delay at least for the
@@ -275,22 +283,23 @@ static inline int in_8(const volatile unsigned char __iomem *addr)
275{ 283{
276 int ret; 284 int ret;
277 285
278 __asm__ __volatile__("lbz%U1%X1 %0,%1; twi 0,%0,0; isync" 286 __asm__ __volatile__("sync; lbz%U1%X1 %0,%1; twi 0,%0,0; isync"
279 : "=r" (ret) : "m" (*addr)); 287 : "=r" (ret) : "m" (*addr));
280 return ret; 288 return ret;
281} 289}
282 290
283static inline void out_8(volatile unsigned char __iomem *addr, int val) 291static inline void out_8(volatile unsigned char __iomem *addr, int val)
284{ 292{
285 __asm__ __volatile__("stb%U0%X0 %1,%0; sync" 293 __asm__ __volatile__("sync; stb%U0%X0 %1,%0"
286 : "=m" (*addr) : "r" (val)); 294 : "=m" (*addr) : "r" (val));
295 get_paca()->io_sync = 1;
287} 296}
288 297
289static inline int in_le16(const volatile unsigned short __iomem *addr) 298static inline int in_le16(const volatile unsigned short __iomem *addr)
290{ 299{
291 int ret; 300 int ret;
292 301
293 __asm__ __volatile__("lhbrx %0,0,%1; twi 0,%0,0; isync" 302 __asm__ __volatile__("sync; lhbrx %0,0,%1; twi 0,%0,0; isync"
294 : "=r" (ret) : "r" (addr), "m" (*addr)); 303 : "=r" (ret) : "r" (addr), "m" (*addr));
295 return ret; 304 return ret;
296} 305}
@@ -299,28 +308,30 @@ static inline int in_be16(const volatile unsigned short __iomem *addr)
299{ 308{
300 int ret; 309 int ret;
301 310
302 __asm__ __volatile__("lhz%U1%X1 %0,%1; twi 0,%0,0; isync" 311 __asm__ __volatile__("sync; lhz%U1%X1 %0,%1; twi 0,%0,0; isync"
303 : "=r" (ret) : "m" (*addr)); 312 : "=r" (ret) : "m" (*addr));
304 return ret; 313 return ret;
305} 314}
306 315
307static inline void out_le16(volatile unsigned short __iomem *addr, int val) 316static inline void out_le16(volatile unsigned short __iomem *addr, int val)
308{ 317{
309 __asm__ __volatile__("sthbrx %1,0,%2; sync" 318 __asm__ __volatile__("sync; sthbrx %1,0,%2"
310 : "=m" (*addr) : "r" (val), "r" (addr)); 319 : "=m" (*addr) : "r" (val), "r" (addr));
320 get_paca()->io_sync = 1;
311} 321}
312 322
313static inline void out_be16(volatile unsigned short __iomem *addr, int val) 323static inline void out_be16(volatile unsigned short __iomem *addr, int val)
314{ 324{
315 __asm__ __volatile__("sth%U0%X0 %1,%0; sync" 325 __asm__ __volatile__("sync; sth%U0%X0 %1,%0"
316 : "=m" (*addr) : "r" (val)); 326 : "=m" (*addr) : "r" (val));
327 get_paca()->io_sync = 1;
317} 328}
318 329
319static inline unsigned in_le32(const volatile unsigned __iomem *addr) 330static inline unsigned in_le32(const volatile unsigned __iomem *addr)
320{ 331{
321 unsigned ret; 332 unsigned ret;
322 333
323 __asm__ __volatile__("lwbrx %0,0,%1; twi 0,%0,0; isync" 334 __asm__ __volatile__("sync; lwbrx %0,0,%1; twi 0,%0,0; isync"
324 : "=r" (ret) : "r" (addr), "m" (*addr)); 335 : "=r" (ret) : "r" (addr), "m" (*addr));
325 return ret; 336 return ret;
326} 337}
@@ -329,21 +340,23 @@ static inline unsigned in_be32(const volatile unsigned __iomem *addr)
329{ 340{
330 unsigned ret; 341 unsigned ret;
331 342
332 __asm__ __volatile__("lwz%U1%X1 %0,%1; twi 0,%0,0; isync" 343 __asm__ __volatile__("sync; lwz%U1%X1 %0,%1; twi 0,%0,0; isync"
333 : "=r" (ret) : "m" (*addr)); 344 : "=r" (ret) : "m" (*addr));
334 return ret; 345 return ret;
335} 346}
336 347
337static inline void out_le32(volatile unsigned __iomem *addr, int val) 348static inline void out_le32(volatile unsigned __iomem *addr, int val)
338{ 349{
339 __asm__ __volatile__("stwbrx %1,0,%2; sync" : "=m" (*addr) 350 __asm__ __volatile__("sync; stwbrx %1,0,%2" : "=m" (*addr)
340 : "r" (val), "r" (addr)); 351 : "r" (val), "r" (addr));
352 get_paca()->io_sync = 1;
341} 353}
342 354
343static inline void out_be32(volatile unsigned __iomem *addr, int val) 355static inline void out_be32(volatile unsigned __iomem *addr, int val)
344{ 356{
345 __asm__ __volatile__("stw%U0%X0 %1,%0; sync" 357 __asm__ __volatile__("sync; stw%U0%X0 %1,%0"
346 : "=m" (*addr) : "r" (val)); 358 : "=m" (*addr) : "r" (val));
359 get_paca()->io_sync = 1;
347} 360}
348 361
349static inline unsigned long in_le64(const volatile unsigned long __iomem *addr) 362static inline unsigned long in_le64(const volatile unsigned long __iomem *addr)
@@ -351,6 +364,7 @@ static inline unsigned long in_le64(const volatile unsigned long __iomem *addr)
351 unsigned long tmp, ret; 364 unsigned long tmp, ret;
352 365
353 __asm__ __volatile__( 366 __asm__ __volatile__(
367 "sync\n"
354 "ld %1,0(%2)\n" 368 "ld %1,0(%2)\n"
355 "twi 0,%1,0\n" 369 "twi 0,%1,0\n"
356 "isync\n" 370 "isync\n"
@@ -369,7 +383,7 @@ static inline unsigned long in_be64(const volatile unsigned long __iomem *addr)
369{ 383{
370 unsigned long ret; 384 unsigned long ret;
371 385
372 __asm__ __volatile__("ld%U1%X1 %0,%1; twi 0,%0,0; isync" 386 __asm__ __volatile__("sync; ld%U1%X1 %0,%1; twi 0,%0,0; isync"
373 : "=r" (ret) : "m" (*addr)); 387 : "=r" (ret) : "m" (*addr));
374 return ret; 388 return ret;
375} 389}
@@ -386,14 +400,16 @@ static inline void out_le64(volatile unsigned long __iomem *addr, unsigned long
386 "rldicl %1,%1,32,0\n" 400 "rldicl %1,%1,32,0\n"
387 "rlwimi %0,%1,8,8,31\n" 401 "rlwimi %0,%1,8,8,31\n"
388 "rlwimi %0,%1,24,16,23\n" 402 "rlwimi %0,%1,24,16,23\n"
389 "std %0,0(%3)\n" 403 "sync\n"
390 "sync" 404 "std %0,0(%3)"
391 : "=&r" (tmp) , "=&r" (val) : "1" (val) , "b" (addr) , "m" (*addr)); 405 : "=&r" (tmp) , "=&r" (val) : "1" (val) , "b" (addr) , "m" (*addr));
406 get_paca()->io_sync = 1;
392} 407}
393 408
394static inline void out_be64(volatile unsigned long __iomem *addr, unsigned long val) 409static inline void out_be64(volatile unsigned long __iomem *addr, unsigned long val)
395{ 410{
396 __asm__ __volatile__("std%U0%X0 %1,%0; sync" : "=m" (*addr) : "r" (val)); 411 __asm__ __volatile__("sync; std%U0%X0 %1,%0" : "=m" (*addr) : "r" (val));
412 get_paca()->io_sync = 1;
397} 413}
398 414
399#ifndef CONFIG_PPC_ISERIES 415#ifndef CONFIG_PPC_ISERIES
diff --git a/include/asm-powerpc/ipic.h b/include/asm-powerpc/ipic.h
index 0fe396a2b666..53079ec3a515 100644
--- a/include/asm-powerpc/ipic.h
+++ b/include/asm-powerpc/ipic.h
@@ -69,9 +69,6 @@ enum ipic_mcp_irq {
69 IPIC_MCP_MU = 7, 69 IPIC_MCP_MU = 7,
70}; 70};
71 71
72extern void ipic_init(phys_addr_t phys_addr, unsigned int flags,
73 unsigned int irq_offset,
74 unsigned char *senses, unsigned int senses_count);
75extern int ipic_set_priority(unsigned int irq, unsigned int priority); 72extern int ipic_set_priority(unsigned int irq, unsigned int priority);
76extern void ipic_set_highest_priority(unsigned int irq); 73extern void ipic_set_highest_priority(unsigned int irq);
77extern void ipic_set_default_priority(void); 74extern void ipic_set_default_priority(void);
@@ -79,7 +76,16 @@ extern void ipic_enable_mcp(enum ipic_mcp_irq mcp_irq);
79extern void ipic_disable_mcp(enum ipic_mcp_irq mcp_irq); 76extern void ipic_disable_mcp(enum ipic_mcp_irq mcp_irq);
80extern u32 ipic_get_mcp_status(void); 77extern u32 ipic_get_mcp_status(void);
81extern void ipic_clear_mcp_status(u32 mask); 78extern void ipic_clear_mcp_status(u32 mask);
79
80#ifdef CONFIG_PPC_MERGE
81extern void ipic_init(struct device_node *node, unsigned int flags);
82extern unsigned int ipic_get_irq(struct pt_regs *regs);
83#else
84extern void ipic_init(phys_addr_t phys_addr, unsigned int flags,
85 unsigned int irq_offset,
86 unsigned char *senses, unsigned int senses_count);
82extern int ipic_get_irq(struct pt_regs *regs); 87extern int ipic_get_irq(struct pt_regs *regs);
88#endif
83 89
84#endif /* __ASM_IPIC_H__ */ 90#endif /* __ASM_IPIC_H__ */
85#endif /* __KERNEL__ */ 91#endif /* __KERNEL__ */
diff --git a/include/asm-powerpc/irq.h b/include/asm-powerpc/irq.h
index e05754752028..d903a62959da 100644
--- a/include/asm-powerpc/irq.h
+++ b/include/asm-powerpc/irq.h
@@ -83,25 +83,24 @@ struct irq_host_ops {
83 int (*match)(struct irq_host *h, struct device_node *node); 83 int (*match)(struct irq_host *h, struct device_node *node);
84 84
85 /* Create or update a mapping between a virtual irq number and a hw 85 /* Create or update a mapping between a virtual irq number and a hw
86 * irq number. This can be called several times for the same mapping 86 * irq number. This is called only once for a given mapping.
87 * but with different flags, though unmap shall always be called
88 * before the virq->hw mapping is changed.
89 */ 87 */
90 int (*map)(struct irq_host *h, unsigned int virq, 88 int (*map)(struct irq_host *h, unsigned int virq, irq_hw_number_t hw);
91 irq_hw_number_t hw, unsigned int flags);
92 89
93 /* Dispose of such a mapping */ 90 /* Dispose of such a mapping */
94 void (*unmap)(struct irq_host *h, unsigned int virq); 91 void (*unmap)(struct irq_host *h, unsigned int virq);
95 92
96 /* Translate device-tree interrupt specifier from raw format coming 93 /* Translate device-tree interrupt specifier from raw format coming
97 * from the firmware to a irq_hw_number_t (interrupt line number) and 94 * from the firmware to a irq_hw_number_t (interrupt line number) and
98 * trigger flags that can be passed to irq_create_mapping(). 95 * type (sense) that can be passed to set_irq_type(). In the absence
99 * If no translation is provided, raw format is assumed to be one cell 96 * of this callback, irq_create_of_mapping() and irq_of_parse_and_map()
100 * for interrupt line and default sense. 97 * will return the hw number in the first cell and IRQ_TYPE_NONE for
98 * the type (which amount to keeping whatever default value the
99 * interrupt controller has for that line)
101 */ 100 */
102 int (*xlate)(struct irq_host *h, struct device_node *ctrler, 101 int (*xlate)(struct irq_host *h, struct device_node *ctrler,
103 u32 *intspec, unsigned int intsize, 102 u32 *intspec, unsigned int intsize,
104 irq_hw_number_t *out_hwirq, unsigned int *out_flags); 103 irq_hw_number_t *out_hwirq, unsigned int *out_type);
105}; 104};
106 105
107struct irq_host { 106struct irq_host {
@@ -193,25 +192,14 @@ extern void irq_set_virq_count(unsigned int count);
193 * irq_create_mapping - Map a hardware interrupt into linux virq space 192 * irq_create_mapping - Map a hardware interrupt into linux virq space
194 * @host: host owning this hardware interrupt or NULL for default host 193 * @host: host owning this hardware interrupt or NULL for default host
195 * @hwirq: hardware irq number in that host space 194 * @hwirq: hardware irq number in that host space
196 * @flags: flags passed to the controller. contains the trigger type among
197 * others. Use IRQ_TYPE_* defined in include/linux/irq.h
198 * 195 *
199 * Only one mapping per hardware interrupt is permitted. Returns a linux 196 * Only one mapping per hardware interrupt is permitted. Returns a linux
200 * virq number. The flags can be used to provide sense information to the 197 * virq number.
201 * controller (typically extracted from the device-tree). If no information 198 * If the sense/trigger is to be specified, set_irq_type() should be called
202 * is passed, the controller defaults will apply (for example, xics can only 199 * on the number returned from that call.
203 * do edge so flags are irrelevant for some pseries specific irqs).
204 *
205 * The device-tree generally contains the trigger info in an encoding that is
206 * specific to a given type of controller. In that case, you can directly use
207 * host->ops->trigger_xlate() to translate that.
208 *
209 * It is recommended that new PICs that don't have existing OF bindings chose
210 * to use a representation of triggers identical to linux.
211 */ 200 */
212extern unsigned int irq_create_mapping(struct irq_host *host, 201extern unsigned int irq_create_mapping(struct irq_host *host,
213 irq_hw_number_t hwirq, 202 irq_hw_number_t hwirq);
214 unsigned int flags);
215 203
216 204
217/*** 205/***
@@ -295,7 +283,7 @@ extern void irq_free_virt(unsigned int virq, unsigned int count);
295 * 283 *
296 * This function is identical to irq_create_mapping except that it takes 284 * This function is identical to irq_create_mapping except that it takes
297 * as input informations straight from the device-tree (typically the results 285 * as input informations straight from the device-tree (typically the results
298 * of the of_irq_map_*() functions 286 * of the of_irq_map_*() functions.
299 */ 287 */
300extern unsigned int irq_create_of_mapping(struct device_node *controller, 288extern unsigned int irq_create_of_mapping(struct device_node *controller,
301 u32 *intspec, unsigned int intsize); 289 u32 *intspec, unsigned int intsize);
diff --git a/include/asm-powerpc/kdump.h b/include/asm-powerpc/kdump.h
index dc1574c945f8..10e8eb1e6f4f 100644
--- a/include/asm-powerpc/kdump.h
+++ b/include/asm-powerpc/kdump.h
@@ -7,7 +7,7 @@
7/* How many bytes to reserve at zero for kdump. The reserve limit should 7/* How many bytes to reserve at zero for kdump. The reserve limit should
8 * be greater or equal to the trampoline's end address. 8 * be greater or equal to the trampoline's end address.
9 * Reserve to the end of the FWNMI area, see head_64.S */ 9 * Reserve to the end of the FWNMI area, see head_64.S */
10#define KDUMP_RESERVE_LIMIT 0x8000 10#define KDUMP_RESERVE_LIMIT 0x10000 /* 64K */
11 11
12#ifdef CONFIG_CRASH_DUMP 12#ifdef CONFIG_CRASH_DUMP
13 13
diff --git a/include/asm-powerpc/kexec.h b/include/asm-powerpc/kexec.h
index 8f7fd5cfec34..11cbdf81fd2e 100644
--- a/include/asm-powerpc/kexec.h
+++ b/include/asm-powerpc/kexec.h
@@ -32,6 +32,7 @@
32#endif 32#endif
33 33
34#ifndef __ASSEMBLY__ 34#ifndef __ASSEMBLY__
35#include <linux/cpumask.h>
35 36
36#ifdef CONFIG_KEXEC 37#ifdef CONFIG_KEXEC
37 38
@@ -109,7 +110,6 @@ static inline void crash_setup_regs(struct pt_regs *newregs,
109 110
110#define MAX_NOTE_BYTES 1024 111#define MAX_NOTE_BYTES 1024
111 112
112#ifdef __powerpc64__
113extern void kexec_smp_wait(void); /* get and clear naca physid, wait for 113extern void kexec_smp_wait(void); /* get and clear naca physid, wait for
114 master to copy new code to 0 */ 114 master to copy new code to 0 */
115extern int crashing_cpu; 115extern int crashing_cpu;
@@ -119,7 +119,6 @@ static inline int kexec_sr_activated(int cpu)
119{ 119{
120 return cpu_isset(cpu,cpus_in_sr); 120 return cpu_isset(cpu,cpus_in_sr);
121} 121}
122#endif /* __powerpc64 __ */
123 122
124struct kimage; 123struct kimage;
125struct pt_regs; 124struct pt_regs;
diff --git a/include/asm-powerpc/kprobes.h b/include/asm-powerpc/kprobes.h
index 2d0af52c823d..34e1f89a5fa0 100644
--- a/include/asm-powerpc/kprobes.h
+++ b/include/asm-powerpc/kprobes.h
@@ -51,6 +51,7 @@ typedef unsigned int kprobe_opcode_t;
51 51
52#define ARCH_SUPPORTS_KRETPROBES 52#define ARCH_SUPPORTS_KRETPROBES
53#define ARCH_INACTIVE_KPROBE_COUNT 1 53#define ARCH_INACTIVE_KPROBE_COUNT 1
54#define flush_insn_slot(p) do { } while (0)
54 55
55void kretprobe_trampoline(void); 56void kretprobe_trampoline(void);
56extern void arch_remove_kprobe(struct kprobe *p); 57extern void arch_remove_kprobe(struct kprobe *p);
diff --git a/include/asm-powerpc/mpc86xx.h b/include/asm-powerpc/mpc86xx.h
index f260382739fa..b85df45b1a84 100644
--- a/include/asm-powerpc/mpc86xx.h
+++ b/include/asm-powerpc/mpc86xx.h
@@ -23,8 +23,6 @@
23#define _ISA_MEM_BASE isa_mem_base 23#define _ISA_MEM_BASE isa_mem_base
24#ifdef CONFIG_PCI 24#ifdef CONFIG_PCI
25#define PCI_DRAM_OFFSET pci_dram_offset 25#define PCI_DRAM_OFFSET pci_dram_offset
26#else
27#define PCI_DRAM_OFFSET 0
28#endif 26#endif
29 27
30#define CPU0_BOOT_RELEASE 0x01000000 28#define CPU0_BOOT_RELEASE 0x01000000
@@ -33,7 +31,6 @@
33#define MCM_PORT_CONFIG_OFFSET 0x1010 31#define MCM_PORT_CONFIG_OFFSET 0x1010
34 32
35/* Offset from CCSRBAR */ 33/* Offset from CCSRBAR */
36#define MPC86xx_OPENPIC_OFFSET (0x40000)
37#define MPC86xx_MCM_OFFSET (0x00000) 34#define MPC86xx_MCM_OFFSET (0x00000)
38#define MPC86xx_MCM_SIZE (0x02000) 35#define MPC86xx_MCM_SIZE (0x02000)
39 36
diff --git a/include/asm-powerpc/mpic.h b/include/asm-powerpc/mpic.h
index eb241c99c457..a9f9604b9eff 100644
--- a/include/asm-powerpc/mpic.h
+++ b/include/asm-powerpc/mpic.h
@@ -41,6 +41,7 @@
41#define MPIC_GREG_IPI_VECTOR_PRI_1 0x000b0 41#define MPIC_GREG_IPI_VECTOR_PRI_1 0x000b0
42#define MPIC_GREG_IPI_VECTOR_PRI_2 0x000c0 42#define MPIC_GREG_IPI_VECTOR_PRI_2 0x000c0
43#define MPIC_GREG_IPI_VECTOR_PRI_3 0x000d0 43#define MPIC_GREG_IPI_VECTOR_PRI_3 0x000d0
44#define MPIC_GREG_IPI_STRIDE 0x10
44#define MPIC_GREG_SPURIOUS 0x000e0 45#define MPIC_GREG_SPURIOUS 0x000e0
45#define MPIC_GREG_TIMER_FREQ 0x000f0 46#define MPIC_GREG_TIMER_FREQ 0x000f0
46 47
@@ -68,6 +69,7 @@
68#define MPIC_CPU_IPI_DISPATCH_1 0x00050 69#define MPIC_CPU_IPI_DISPATCH_1 0x00050
69#define MPIC_CPU_IPI_DISPATCH_2 0x00060 70#define MPIC_CPU_IPI_DISPATCH_2 0x00060
70#define MPIC_CPU_IPI_DISPATCH_3 0x00070 71#define MPIC_CPU_IPI_DISPATCH_3 0x00070
72#define MPIC_CPU_IPI_DISPATCH_STRIDE 0x00010
71#define MPIC_CPU_CURRENT_TASK_PRI 0x00080 73#define MPIC_CPU_CURRENT_TASK_PRI 0x00080
72#define MPIC_CPU_TASKPRI_MASK 0x0000000f 74#define MPIC_CPU_TASKPRI_MASK 0x0000000f
73#define MPIC_CPU_WHOAMI 0x00090 75#define MPIC_CPU_WHOAMI 0x00090
@@ -114,6 +116,103 @@
114#define MPIC_VEC_TIMER_1 248 116#define MPIC_VEC_TIMER_1 248
115#define MPIC_VEC_TIMER_0 247 117#define MPIC_VEC_TIMER_0 247
116 118
119/*
120 * Tsi108 implementation of MPIC has many differences from the original one
121 */
122
123/*
124 * Global registers
125 */
126
127#define TSI108_GREG_BASE 0x00000
128#define TSI108_GREG_FEATURE_0 0x00000
129#define TSI108_GREG_GLOBAL_CONF_0 0x00004
130#define TSI108_GREG_VENDOR_ID 0x0000c
131#define TSI108_GREG_IPI_VECTOR_PRI_0 0x00204 /* Doorbell 0 */
132#define TSI108_GREG_IPI_STRIDE 0x0c
133#define TSI108_GREG_SPURIOUS 0x00010
134#define TSI108_GREG_TIMER_FREQ 0x00014
135
136/*
137 * Timer registers
138 */
139#define TSI108_TIMER_BASE 0x0030
140#define TSI108_TIMER_STRIDE 0x10
141#define TSI108_TIMER_CURRENT_CNT 0x00000
142#define TSI108_TIMER_BASE_CNT 0x00004
143#define TSI108_TIMER_VECTOR_PRI 0x00008
144#define TSI108_TIMER_DESTINATION 0x0000c
145
146/*
147 * Per-Processor registers
148 */
149#define TSI108_CPU_BASE 0x00300
150#define TSI108_CPU_STRIDE 0x00040
151#define TSI108_CPU_IPI_DISPATCH_0 0x00200
152#define TSI108_CPU_IPI_DISPATCH_STRIDE 0x00000
153#define TSI108_CPU_CURRENT_TASK_PRI 0x00000
154#define TSI108_CPU_WHOAMI 0xffffffff
155#define TSI108_CPU_INTACK 0x00004
156#define TSI108_CPU_EOI 0x00008
157
158/*
159 * Per-source registers
160 */
161#define TSI108_IRQ_BASE 0x00100
162#define TSI108_IRQ_STRIDE 0x00008
163#define TSI108_IRQ_VECTOR_PRI 0x00000
164#define TSI108_VECPRI_VECTOR_MASK 0x000000ff
165#define TSI108_VECPRI_POLARITY_POSITIVE 0x01000000
166#define TSI108_VECPRI_POLARITY_NEGATIVE 0x00000000
167#define TSI108_VECPRI_SENSE_LEVEL 0x02000000
168#define TSI108_VECPRI_SENSE_EDGE 0x00000000
169#define TSI108_VECPRI_POLARITY_MASK 0x01000000
170#define TSI108_VECPRI_SENSE_MASK 0x02000000
171#define TSI108_IRQ_DESTINATION 0x00004
172
173/* weird mpic register indices and mask bits in the HW info array */
174enum {
175 MPIC_IDX_GREG_BASE = 0,
176 MPIC_IDX_GREG_FEATURE_0,
177 MPIC_IDX_GREG_GLOBAL_CONF_0,
178 MPIC_IDX_GREG_VENDOR_ID,
179 MPIC_IDX_GREG_IPI_VECTOR_PRI_0,
180 MPIC_IDX_GREG_IPI_STRIDE,
181 MPIC_IDX_GREG_SPURIOUS,
182 MPIC_IDX_GREG_TIMER_FREQ,
183
184 MPIC_IDX_TIMER_BASE,
185 MPIC_IDX_TIMER_STRIDE,
186 MPIC_IDX_TIMER_CURRENT_CNT,
187 MPIC_IDX_TIMER_BASE_CNT,
188 MPIC_IDX_TIMER_VECTOR_PRI,
189 MPIC_IDX_TIMER_DESTINATION,
190
191 MPIC_IDX_CPU_BASE,
192 MPIC_IDX_CPU_STRIDE,
193 MPIC_IDX_CPU_IPI_DISPATCH_0,
194 MPIC_IDX_CPU_IPI_DISPATCH_STRIDE,
195 MPIC_IDX_CPU_CURRENT_TASK_PRI,
196 MPIC_IDX_CPU_WHOAMI,
197 MPIC_IDX_CPU_INTACK,
198 MPIC_IDX_CPU_EOI,
199
200 MPIC_IDX_IRQ_BASE,
201 MPIC_IDX_IRQ_STRIDE,
202 MPIC_IDX_IRQ_VECTOR_PRI,
203
204 MPIC_IDX_VECPRI_VECTOR_MASK,
205 MPIC_IDX_VECPRI_POLARITY_POSITIVE,
206 MPIC_IDX_VECPRI_POLARITY_NEGATIVE,
207 MPIC_IDX_VECPRI_SENSE_LEVEL,
208 MPIC_IDX_VECPRI_SENSE_EDGE,
209 MPIC_IDX_VECPRI_POLARITY_MASK,
210 MPIC_IDX_VECPRI_SENSE_MASK,
211 MPIC_IDX_IRQ_DESTINATION,
212 MPIC_IDX_END
213};
214
215
117#ifdef CONFIG_MPIC_BROKEN_U3 216#ifdef CONFIG_MPIC_BROKEN_U3
118/* Fixup table entry */ 217/* Fixup table entry */
119struct mpic_irq_fixup 218struct mpic_irq_fixup
@@ -171,15 +270,29 @@ struct mpic
171 volatile u32 __iomem *cpuregs[MPIC_MAX_CPUS]; 270 volatile u32 __iomem *cpuregs[MPIC_MAX_CPUS];
172 volatile u32 __iomem *isus[MPIC_MAX_ISU]; 271 volatile u32 __iomem *isus[MPIC_MAX_ISU];
173 272
273#ifdef CONFIG_MPIC_WEIRD
274 /* Pointer to HW info array */
275 u32 *hw_set;
276#endif
277
174 /* link */ 278 /* link */
175 struct mpic *next; 279 struct mpic *next;
176}; 280};
177 281
282/*
283 * MPIC flags (passed to mpic_alloc)
284 *
285 * The top 4 bits contain an MPIC bhw id that is used to index the
286 * register offsets and some masks when CONFIG_MPIC_WEIRD is set.
287 * Note setting any ID (leaving those bits to 0) means standard MPIC
288 */
289
178/* This is the primary controller, only that one has IPIs and 290/* This is the primary controller, only that one has IPIs and
179 * has afinity control. A non-primary MPIC always uses CPU0 291 * has afinity control. A non-primary MPIC always uses CPU0
180 * registers only 292 * registers only
181 */ 293 */
182#define MPIC_PRIMARY 0x00000001 294#define MPIC_PRIMARY 0x00000001
295
183/* Set this for a big-endian MPIC */ 296/* Set this for a big-endian MPIC */
184#define MPIC_BIG_ENDIAN 0x00000002 297#define MPIC_BIG_ENDIAN 0x00000002
185/* Broken U3 MPIC */ 298/* Broken U3 MPIC */
@@ -188,6 +301,18 @@ struct mpic
188#define MPIC_BROKEN_IPI 0x00000008 301#define MPIC_BROKEN_IPI 0x00000008
189/* MPIC wants a reset */ 302/* MPIC wants a reset */
190#define MPIC_WANTS_RESET 0x00000010 303#define MPIC_WANTS_RESET 0x00000010
304/* Spurious vector requires EOI */
305#define MPIC_SPV_EOI 0x00000020
306/* No passthrough disable */
307#define MPIC_NO_PTHROU_DIS 0x00000040
308
309/* MPIC HW modification ID */
310#define MPIC_REGSET_MASK 0xf0000000
311#define MPIC_REGSET(val) (((val) & 0xf ) << 28)
312#define MPIC_GET_REGSET(flags) (((flags) >> 28) & 0xf)
313
314#define MPIC_REGSET_STANDARD MPIC_REGSET(0) /* Original MPIC */
315#define MPIC_REGSET_TSI108 MPIC_REGSET(1) /* Tsi108/109 PIC */
191 316
192/* Allocate the controller structure and setup the linux irq descs 317/* Allocate the controller structure and setup the linux irq descs
193 * for the range if interrupts passed in. No HW initialization is 318 * for the range if interrupts passed in. No HW initialization is
diff --git a/include/asm-powerpc/paca.h b/include/asm-powerpc/paca.h
index 2d4585f06209..3d5d590bc4b0 100644
--- a/include/asm-powerpc/paca.h
+++ b/include/asm-powerpc/paca.h
@@ -93,6 +93,7 @@ struct paca_struct {
93 u64 saved_r1; /* r1 save for RTAS calls */ 93 u64 saved_r1; /* r1 save for RTAS calls */
94 u64 saved_msr; /* MSR saved here by enter_rtas */ 94 u64 saved_msr; /* MSR saved here by enter_rtas */
95 u8 proc_enabled; /* irq soft-enable flag */ 95 u8 proc_enabled; /* irq soft-enable flag */
96 u8 io_sync; /* writel() needs spin_unlock sync */
96 97
97 /* Stuff for accurate time accounting */ 98 /* Stuff for accurate time accounting */
98 u64 user_time; /* accumulated usermode TB ticks */ 99 u64 user_time; /* accumulated usermode TB ticks */
diff --git a/include/asm-powerpc/pgalloc.h b/include/asm-powerpc/pgalloc.h
index 9f0917c68659..ae63db7b3e7d 100644
--- a/include/asm-powerpc/pgalloc.h
+++ b/include/asm-powerpc/pgalloc.h
@@ -117,7 +117,7 @@ static inline void pte_free(struct page *ptepage)
117 pte_free_kernel(page_address(ptepage)); 117 pte_free_kernel(page_address(ptepage));
118} 118}
119 119
120#define PGF_CACHENUM_MASK 0xf 120#define PGF_CACHENUM_MASK 0x3
121 121
122typedef struct pgtable_free { 122typedef struct pgtable_free {
123 unsigned long val; 123 unsigned long val;
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
index b095a285c84b..d0fa1b9aed35 100644
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -276,6 +276,7 @@ extern void of_irq_map_init(unsigned int flags);
276 * of_irq_map_raw - Low level interrupt tree parsing 276 * of_irq_map_raw - Low level interrupt tree parsing
277 * @parent: the device interrupt parent 277 * @parent: the device interrupt parent
278 * @intspec: interrupt specifier ("interrupts" property of the device) 278 * @intspec: interrupt specifier ("interrupts" property of the device)
279 * @ointsize: size of the passed in interrupt specifier
279 * @addr: address specifier (start of "reg" property of the device) 280 * @addr: address specifier (start of "reg" property of the device)
280 * @out_irq: structure of_irq filled by this function 281 * @out_irq: structure of_irq filled by this function
281 * 282 *
@@ -288,7 +289,8 @@ extern void of_irq_map_init(unsigned int flags);
288 * 289 *
289 */ 290 */
290 291
291extern int of_irq_map_raw(struct device_node *parent, u32 *intspec, u32 *addr, 292extern int of_irq_map_raw(struct device_node *parent, u32 *intspec,
293 u32 ointsize, u32 *addr,
292 struct of_irq *out_irq); 294 struct of_irq *out_irq);
293 295
294 296
diff --git a/include/asm-powerpc/rtas.h b/include/asm-powerpc/rtas.h
index a33c6acffa61..82a27e9a041f 100644
--- a/include/asm-powerpc/rtas.h
+++ b/include/asm-powerpc/rtas.h
@@ -170,6 +170,7 @@ extern int rtas_get_sensor(int sensor, int index, int *state);
170extern int rtas_get_power_level(int powerdomain, int *level); 170extern int rtas_get_power_level(int powerdomain, int *level);
171extern int rtas_set_power_level(int powerdomain, int level, int *setlevel); 171extern int rtas_set_power_level(int powerdomain, int level, int *setlevel);
172extern int rtas_set_indicator(int indicator, int index, int new_value); 172extern int rtas_set_indicator(int indicator, int index, int new_value);
173extern int rtas_set_indicator_fast(int indicator, int index, int new_value);
173extern void rtas_progress(char *s, unsigned short hex); 174extern void rtas_progress(char *s, unsigned short hex);
174extern void rtas_initialize(void); 175extern void rtas_initialize(void);
175 176
diff --git a/include/asm-powerpc/spinlock.h b/include/asm-powerpc/spinlock.h
index 895cb6d3a42a..c31e4382a775 100644
--- a/include/asm-powerpc/spinlock.h
+++ b/include/asm-powerpc/spinlock.h
@@ -36,6 +36,19 @@
36#define LOCK_TOKEN 1 36#define LOCK_TOKEN 1
37#endif 37#endif
38 38
39#if defined(CONFIG_PPC64) && defined(CONFIG_SMP)
40#define CLEAR_IO_SYNC (get_paca()->io_sync = 0)
41#define SYNC_IO do { \
42 if (unlikely(get_paca()->io_sync)) { \
43 mb(); \
44 get_paca()->io_sync = 0; \
45 } \
46 } while (0)
47#else
48#define CLEAR_IO_SYNC
49#define SYNC_IO
50#endif
51
39/* 52/*
40 * This returns the old value in the lock, so we succeeded 53 * This returns the old value in the lock, so we succeeded
41 * in getting the lock if the return value is 0. 54 * in getting the lock if the return value is 0.
@@ -61,6 +74,7 @@ static __inline__ unsigned long __spin_trylock(raw_spinlock_t *lock)
61 74
62static int __inline__ __raw_spin_trylock(raw_spinlock_t *lock) 75static int __inline__ __raw_spin_trylock(raw_spinlock_t *lock)
63{ 76{
77 CLEAR_IO_SYNC;
64 return __spin_trylock(lock) == 0; 78 return __spin_trylock(lock) == 0;
65} 79}
66 80
@@ -91,6 +105,7 @@ extern void __rw_yield(raw_rwlock_t *lock);
91 105
92static void __inline__ __raw_spin_lock(raw_spinlock_t *lock) 106static void __inline__ __raw_spin_lock(raw_spinlock_t *lock)
93{ 107{
108 CLEAR_IO_SYNC;
94 while (1) { 109 while (1) {
95 if (likely(__spin_trylock(lock) == 0)) 110 if (likely(__spin_trylock(lock) == 0))
96 break; 111 break;
@@ -107,6 +122,7 @@ static void __inline__ __raw_spin_lock_flags(raw_spinlock_t *lock, unsigned long
107{ 122{
108 unsigned long flags_dis; 123 unsigned long flags_dis;
109 124
125 CLEAR_IO_SYNC;
110 while (1) { 126 while (1) {
111 if (likely(__spin_trylock(lock) == 0)) 127 if (likely(__spin_trylock(lock) == 0))
112 break; 128 break;
@@ -124,6 +140,7 @@ static void __inline__ __raw_spin_lock_flags(raw_spinlock_t *lock, unsigned long
124 140
125static __inline__ void __raw_spin_unlock(raw_spinlock_t *lock) 141static __inline__ void __raw_spin_unlock(raw_spinlock_t *lock)
126{ 142{
143 SYNC_IO;
127 __asm__ __volatile__("# __raw_spin_unlock\n\t" 144 __asm__ __volatile__("# __raw_spin_unlock\n\t"
128 LWSYNC_ON_SMP: : :"memory"); 145 LWSYNC_ON_SMP: : :"memory");
129 lock->slock = 0; 146 lock->slock = 0;
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h
index d075725bf444..4c9f5229e833 100644
--- a/include/asm-powerpc/system.h
+++ b/include/asm-powerpc/system.h
@@ -39,7 +39,6 @@
39#define read_barrier_depends() do { } while(0) 39#define read_barrier_depends() do { } while(0)
40 40
41#define set_mb(var, value) do { var = value; mb(); } while (0) 41#define set_mb(var, value) do { var = value; mb(); } while (0)
42#define set_wmb(var, value) do { var = value; wmb(); } while (0)
43 42
44#ifdef __KERNEL__ 43#ifdef __KERNEL__
45#ifdef CONFIG_SMP 44#ifdef CONFIG_SMP
@@ -54,6 +53,15 @@
54#define smp_read_barrier_depends() do { } while(0) 53#define smp_read_barrier_depends() do { } while(0)
55#endif /* CONFIG_SMP */ 54#endif /* CONFIG_SMP */
56 55
56/*
57 * This is a barrier which prevents following instructions from being
58 * started until the value of the argument x is known. For example, if
59 * x is a variable loaded from memory, this prevents following
60 * instructions from being executed until the load has been performed.
61 */
62#define data_barrier(x) \
63 asm volatile("twi 0,%0,0; isync" : : "r" (x) : "memory");
64
57struct task_struct; 65struct task_struct;
58struct pt_regs; 66struct pt_regs;
59 67
@@ -220,8 +228,8 @@ __xchg_u32(volatile void *p, unsigned long val)
220" stwcx. %3,0,%2 \n\ 228" stwcx. %3,0,%2 \n\
221 bne- 1b" 229 bne- 1b"
222 ISYNC_ON_SMP 230 ISYNC_ON_SMP
223 : "=&r" (prev), "=m" (*(volatile unsigned int *)p) 231 : "=&r" (prev), "+m" (*(volatile unsigned int *)p)
224 : "r" (p), "r" (val), "m" (*(volatile unsigned int *)p) 232 : "r" (p), "r" (val)
225 : "cc", "memory"); 233 : "cc", "memory");
226 234
227 return prev; 235 return prev;
@@ -240,8 +248,8 @@ __xchg_u64(volatile void *p, unsigned long val)
240" stdcx. %3,0,%2 \n\ 248" stdcx. %3,0,%2 \n\
241 bne- 1b" 249 bne- 1b"
242 ISYNC_ON_SMP 250 ISYNC_ON_SMP
243 : "=&r" (prev), "=m" (*(volatile unsigned long *)p) 251 : "=&r" (prev), "+m" (*(volatile unsigned long *)p)
244 : "r" (p), "r" (val), "m" (*(volatile unsigned long *)p) 252 : "r" (p), "r" (val)
245 : "cc", "memory"); 253 : "cc", "memory");
246 254
247 return prev; 255 return prev;
@@ -299,8 +307,8 @@ __cmpxchg_u32(volatile unsigned int *p, unsigned long old, unsigned long new)
299 ISYNC_ON_SMP 307 ISYNC_ON_SMP
300 "\n\ 308 "\n\
3012:" 3092:"
302 : "=&r" (prev), "=m" (*p) 310 : "=&r" (prev), "+m" (*p)
303 : "r" (p), "r" (old), "r" (new), "m" (*p) 311 : "r" (p), "r" (old), "r" (new)
304 : "cc", "memory"); 312 : "cc", "memory");
305 313
306 return prev; 314 return prev;
@@ -322,8 +330,8 @@ __cmpxchg_u64(volatile unsigned long *p, unsigned long old, unsigned long new)
322 ISYNC_ON_SMP 330 ISYNC_ON_SMP
323 "\n\ 331 "\n\
3242:" 3322:"
325 : "=&r" (prev), "=m" (*p) 333 : "=&r" (prev), "+m" (*p)
326 : "r" (p), "r" (old), "r" (new), "m" (*p) 334 : "r" (p), "r" (old), "r" (new)
327 : "cc", "memory"); 335 : "cc", "memory");
328 336
329 return prev; 337 return prev;
diff --git a/include/asm-powerpc/time.h b/include/asm-powerpc/time.h
index dcde4410348d..5785ac4737b5 100644
--- a/include/asm-powerpc/time.h
+++ b/include/asm-powerpc/time.h
@@ -30,10 +30,6 @@ extern unsigned long tb_ticks_per_usec;
30extern unsigned long tb_ticks_per_sec; 30extern unsigned long tb_ticks_per_sec;
31extern u64 tb_to_xs; 31extern u64 tb_to_xs;
32extern unsigned tb_to_us; 32extern unsigned tb_to_us;
33extern unsigned long tb_last_stamp;
34extern u64 tb_last_jiffy;
35
36DECLARE_PER_CPU(unsigned long, last_jiffy);
37 33
38struct rtc_time; 34struct rtc_time;
39extern void to_tm(int tim, struct rtc_time * tm); 35extern void to_tm(int tim, struct rtc_time * tm);
diff --git a/include/asm-powerpc/tsi108.h b/include/asm-powerpc/tsi108.h
index c4c278d72f71..2c702d35a7cf 100644
--- a/include/asm-powerpc/tsi108.h
+++ b/include/asm-powerpc/tsi108.h
@@ -1,16 +1,18 @@
1/* 1/*
2 * include/asm-ppc/tsi108.h
3 *
4 * common routine and memory layout for Tundra TSI108(Grendel) host bridge 2 * common routine and memory layout for Tundra TSI108(Grendel) host bridge
5 * memory controller. 3 * memory controller.
6 * 4 *
7 * Author: Jacob Pan (jacob.pan@freescale.com) 5 * Author: Jacob Pan (jacob.pan@freescale.com)
8 * Alex Bounine (alexandreb@tundra.com) 6 * Alex Bounine (alexandreb@tundra.com)
9 * 2004 (c) Freescale Semiconductor Inc. This file is licensed under 7 *
10 * the terms of the GNU General Public License version 2. This program 8 * Copyright 2004-2006 Freescale Semiconductor, Inc.
11 * is licensed "as is" without any warranty of any kind, whether express 9 *
12 * or implied. 10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version
13 * 2 of the License, or (at your option) any later version.
13 */ 14 */
15
14#ifndef __PPC_KERNEL_TSI108_H 16#ifndef __PPC_KERNEL_TSI108_H
15#define __PPC_KERNEL_TSI108_H 17#define __PPC_KERNEL_TSI108_H
16 18
diff --git a/include/asm-powerpc/tsi108_irq.h b/include/asm-powerpc/tsi108_irq.h
new file mode 100644
index 000000000000..3e4d04effa57
--- /dev/null
+++ b/include/asm-powerpc/tsi108_irq.h
@@ -0,0 +1,124 @@
1/*
2 * (C) Copyright 2005 Tundra Semiconductor Corp.
3 * Alex Bounine, <alexandreb at tundra.com).
4 *
5 * See file CREDITS for list of people who contributed to this
6 * project.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21 * MA 02111-1307 USA
22 */
23
24/*
25 * definitions for interrupt controller initialization and external interrupt
26 * demultiplexing on TSI108EMU/SVB boards.
27 */
28
29#ifndef _ASM_PPC_TSI108_IRQ_H
30#define _ASM_PPC_TSI108_IRQ_H
31
32/*
33 * Tsi108 interrupts
34 */
35#ifndef TSI108_IRQ_REG_BASE
36#define TSI108_IRQ_REG_BASE 0
37#endif
38
39#define TSI108_IRQ(x) (TSI108_IRQ_REG_BASE + (x))
40
41#define TSI108_MAX_VECTORS (36 + 4) /* 36 sources + PCI INT demux */
42#define MAX_TASK_PRIO 0xF
43
44#define TSI108_IRQ_SPURIOUS (TSI108_MAX_VECTORS)
45
46#define DEFAULT_PRIO_LVL 10 /* initial priority level */
47
48/* Interrupt vectors assignment to external and internal
49 * sources of requests. */
50
51/* EXTERNAL INTERRUPT SOURCES */
52
53#define IRQ_TSI108_EXT_INT0 TSI108_IRQ(0) /* External Source at INT[0] */
54#define IRQ_TSI108_EXT_INT1 TSI108_IRQ(1) /* External Source at INT[1] */
55#define IRQ_TSI108_EXT_INT2 TSI108_IRQ(2) /* External Source at INT[2] */
56#define IRQ_TSI108_EXT_INT3 TSI108_IRQ(3) /* External Source at INT[3] */
57
58/* INTERNAL INTERRUPT SOURCES */
59
60#define IRQ_TSI108_RESERVED0 TSI108_IRQ(4) /* Reserved IRQ */
61#define IRQ_TSI108_RESERVED1 TSI108_IRQ(5) /* Reserved IRQ */
62#define IRQ_TSI108_RESERVED2 TSI108_IRQ(6) /* Reserved IRQ */
63#define IRQ_TSI108_RESERVED3 TSI108_IRQ(7) /* Reserved IRQ */
64#define IRQ_TSI108_DMA0 TSI108_IRQ(8) /* DMA0 */
65#define IRQ_TSI108_DMA1 TSI108_IRQ(9) /* DMA1 */
66#define IRQ_TSI108_DMA2 TSI108_IRQ(10) /* DMA2 */
67#define IRQ_TSI108_DMA3 TSI108_IRQ(11) /* DMA3 */
68#define IRQ_TSI108_UART0 TSI108_IRQ(12) /* UART0 */
69#define IRQ_TSI108_UART1 TSI108_IRQ(13) /* UART1 */
70#define IRQ_TSI108_I2C TSI108_IRQ(14) /* I2C */
71#define IRQ_TSI108_GPIO TSI108_IRQ(15) /* GPIO */
72#define IRQ_TSI108_GIGE0 TSI108_IRQ(16) /* GIGE0 */
73#define IRQ_TSI108_GIGE1 TSI108_IRQ(17) /* GIGE1 */
74#define IRQ_TSI108_RESERVED4 TSI108_IRQ(18) /* Reserved IRQ */
75#define IRQ_TSI108_HLP TSI108_IRQ(19) /* HLP */
76#define IRQ_TSI108_SDRAM TSI108_IRQ(20) /* SDC */
77#define IRQ_TSI108_PROC_IF TSI108_IRQ(21) /* Processor IF */
78#define IRQ_TSI108_RESERVED5 TSI108_IRQ(22) /* Reserved IRQ */
79#define IRQ_TSI108_PCI TSI108_IRQ(23) /* PCI/X block */
80
81#define IRQ_TSI108_MBOX0 TSI108_IRQ(24) /* Mailbox 0 register */
82#define IRQ_TSI108_MBOX1 TSI108_IRQ(25) /* Mailbox 1 register */
83#define IRQ_TSI108_MBOX2 TSI108_IRQ(26) /* Mailbox 2 register */
84#define IRQ_TSI108_MBOX3 TSI108_IRQ(27) /* Mailbox 3 register */
85
86#define IRQ_TSI108_DBELL0 TSI108_IRQ(28) /* Doorbell 0 */
87#define IRQ_TSI108_DBELL1 TSI108_IRQ(29) /* Doorbell 1 */
88#define IRQ_TSI108_DBELL2 TSI108_IRQ(30) /* Doorbell 2 */
89#define IRQ_TSI108_DBELL3 TSI108_IRQ(31) /* Doorbell 3 */
90
91#define IRQ_TSI108_TIMER0 TSI108_IRQ(32) /* Global Timer 0 */
92#define IRQ_TSI108_TIMER1 TSI108_IRQ(33) /* Global Timer 1 */
93#define IRQ_TSI108_TIMER2 TSI108_IRQ(34) /* Global Timer 2 */
94#define IRQ_TSI108_TIMER3 TSI108_IRQ(35) /* Global Timer 3 */
95
96/*
97 * PCI bus INTA# - INTD# lines demultiplexor
98 */
99#define IRQ_PCI_INTAD_BASE TSI108_IRQ(36)
100#define IRQ_PCI_INTA (IRQ_PCI_INTAD_BASE + 0)
101#define IRQ_PCI_INTB (IRQ_PCI_INTAD_BASE + 1)
102#define IRQ_PCI_INTC (IRQ_PCI_INTAD_BASE + 2)
103#define IRQ_PCI_INTD (IRQ_PCI_INTAD_BASE + 3)
104#define NUM_PCI_IRQS (4)
105
106/* number of entries in vector dispatch table */
107#define IRQ_TSI108_TAB_SIZE (TSI108_MAX_VECTORS + 1)
108
109/* Mapping of MPIC outputs to processors' interrupt pins */
110
111#define IDIR_INT_OUT0 0x1
112#define IDIR_INT_OUT1 0x2
113#define IDIR_INT_OUT2 0x4
114#define IDIR_INT_OUT3 0x8
115
116/*---------------------------------------------------------------
117 * IRQ line configuration parameters */
118
119/* Interrupt delivery modes */
120typedef enum {
121 TSI108_IRQ_DIRECTED,
122 TSI108_IRQ_DISTRIBUTED,
123} TSI108_IRQ_MODE;
124#endif /* _ASM_PPC_TSI108_IRQ_H */
diff --git a/include/asm-ppc/cpm2.h b/include/asm-ppc/cpm2.h
index c70344b91049..f6a7ff04ffe5 100644
--- a/include/asm-ppc/cpm2.h
+++ b/include/asm-ppc/cpm2.h
@@ -1093,5 +1093,100 @@ typedef struct im_idma {
1093 1093
1094#define FCC_PSMR_RMII ((uint)0x00020000) /* Use RMII interface */ 1094#define FCC_PSMR_RMII ((uint)0x00020000) /* Use RMII interface */
1095 1095
1096/* FCC iop & clock configuration. BSP code is responsible to define Fx_RXCLK & Fx_TXCLK
1097 * in order to use clock-computing stuff below for the FCC x
1098 */
1099
1100/* Automatically generates register configurations */
1101#define PC_CLK(x) ((uint)(1<<(x-1))) /* FCC CLK I/O ports */
1102
1103#define CMXFCR_RF1CS(x) ((uint)((x-5)<<27)) /* FCC1 Receive Clock Source */
1104#define CMXFCR_TF1CS(x) ((uint)((x-5)<<24)) /* FCC1 Transmit Clock Source */
1105#define CMXFCR_RF2CS(x) ((uint)((x-9)<<19)) /* FCC2 Receive Clock Source */
1106#define CMXFCR_TF2CS(x) ((uint)((x-9)<<16)) /* FCC2 Transmit Clock Source */
1107#define CMXFCR_RF3CS(x) ((uint)((x-9)<<11)) /* FCC3 Receive Clock Source */
1108#define CMXFCR_TF3CS(x) ((uint)((x-9)<<8)) /* FCC3 Transmit Clock Source */
1109
1110#define PC_F1RXCLK PC_CLK(F1_RXCLK)
1111#define PC_F1TXCLK PC_CLK(F1_TXCLK)
1112#define CMX1_CLK_ROUTE (CMXFCR_RF1CS(F1_RXCLK) | CMXFCR_TF1CS(F1_TXCLK))
1113#define CMX1_CLK_MASK ((uint)0xff000000)
1114
1115#define PC_F2RXCLK PC_CLK(F2_RXCLK)
1116#define PC_F2TXCLK PC_CLK(F2_TXCLK)
1117#define CMX2_CLK_ROUTE (CMXFCR_RF2CS(F2_RXCLK) | CMXFCR_TF2CS(F2_TXCLK))
1118#define CMX2_CLK_MASK ((uint)0x00ff0000)
1119
1120#define PC_F3RXCLK PC_CLK(F3_RXCLK)
1121#define PC_F3TXCLK PC_CLK(F3_TXCLK)
1122#define CMX3_CLK_ROUTE (CMXFCR_RF3CS(F3_RXCLK) | CMXFCR_TF3CS(F3_TXCLK))
1123#define CMX3_CLK_MASK ((uint)0x0000ff00)
1124
1125#define CPMUX_CLK_MASK (CMX3_CLK_MASK | CMX2_CLK_MASK)
1126#define CPMUX_CLK_ROUTE (CMX3_CLK_ROUTE | CMX2_CLK_ROUTE)
1127
1128#define CLK_TRX (PC_F3TXCLK | PC_F3RXCLK | PC_F2TXCLK | PC_F2RXCLK)
1129
1130/* I/O Pin assignment for FCC1. I don't yet know the best way to do this,
1131 * but there is little variation among the choices.
1132 */
1133#define PA1_COL 0x00000001U
1134#define PA1_CRS 0x00000002U
1135#define PA1_TXER 0x00000004U
1136#define PA1_TXEN 0x00000008U
1137#define PA1_RXDV 0x00000010U
1138#define PA1_RXER 0x00000020U
1139#define PA1_TXDAT 0x00003c00U
1140#define PA1_RXDAT 0x0003c000U
1141#define PA1_PSORA0 (PA1_RXDAT | PA1_TXDAT)
1142#define PA1_PSORA1 (PA1_COL | PA1_CRS | PA1_TXER | PA1_TXEN | \
1143 PA1_RXDV | PA1_RXER)
1144#define PA1_DIRA0 (PA1_RXDAT | PA1_CRS | PA1_COL | PA1_RXER | PA1_RXDV)
1145#define PA1_DIRA1 (PA1_TXDAT | PA1_TXEN | PA1_TXER)
1146
1147
1148/* I/O Pin assignment for FCC2. I don't yet know the best way to do this,
1149 * but there is little variation among the choices.
1150 */
1151#define PB2_TXER 0x00000001U
1152#define PB2_RXDV 0x00000002U
1153#define PB2_TXEN 0x00000004U
1154#define PB2_RXER 0x00000008U
1155#define PB2_COL 0x00000010U
1156#define PB2_CRS 0x00000020U
1157#define PB2_TXDAT 0x000003c0U
1158#define PB2_RXDAT 0x00003c00U
1159#define PB2_PSORB0 (PB2_RXDAT | PB2_TXDAT | PB2_CRS | PB2_COL | \
1160 PB2_RXER | PB2_RXDV | PB2_TXER)
1161#define PB2_PSORB1 (PB2_TXEN)
1162#define PB2_DIRB0 (PB2_RXDAT | PB2_CRS | PB2_COL | PB2_RXER | PB2_RXDV)
1163#define PB2_DIRB1 (PB2_TXDAT | PB2_TXEN | PB2_TXER)
1164
1165
1166/* I/O Pin assignment for FCC3. I don't yet know the best way to do this,
1167 * but there is little variation among the choices.
1168 */
1169#define PB3_RXDV 0x00004000U
1170#define PB3_RXER 0x00008000U
1171#define PB3_TXER 0x00010000U
1172#define PB3_TXEN 0x00020000U
1173#define PB3_COL 0x00040000U
1174#define PB3_CRS 0x00080000U
1175#define PB3_TXDAT 0x0f000000U
1176#define PC3_TXDAT 0x00000010U
1177#define PB3_RXDAT 0x00f00000U
1178#define PB3_PSORB0 (PB3_RXDAT | PB3_TXDAT | PB3_CRS | PB3_COL | \
1179 PB3_RXER | PB3_RXDV | PB3_TXER | PB3_TXEN)
1180#define PB3_PSORB1 0
1181#define PB3_DIRB0 (PB3_RXDAT | PB3_CRS | PB3_COL | PB3_RXER | PB3_RXDV)
1182#define PB3_DIRB1 (PB3_TXDAT | PB3_TXEN | PB3_TXER)
1183#define PC3_DIRC1 (PC3_TXDAT)
1184
1185/* Handy macro to specify mem for FCCs*/
1186#define FCC_MEM_OFFSET(x) (CPM_FCC_SPECIAL_BASE + (x*128))
1187#define FCC1_MEM_OFFSET FCC_MEM_OFFSET(0)
1188#define FCC2_MEM_OFFSET FCC_MEM_OFFSET(1)
1189#define FCC2_MEM_OFFSET FCC_MEM_OFFSET(2)
1190
1096#endif /* __CPM2__ */ 1191#endif /* __CPM2__ */
1097#endif /* __KERNEL__ */ 1192#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/io.h b/include/asm-ppc/io.h
index 89c6f1bc3aab..680555be22ec 100644
--- a/include/asm-ppc/io.h
+++ b/include/asm-ppc/io.h
@@ -63,7 +63,7 @@ extern inline int in_8(const volatile unsigned char __iomem *addr)
63 int ret; 63 int ret;
64 64
65 __asm__ __volatile__( 65 __asm__ __volatile__(
66 "lbz%U1%X1 %0,%1;\n" 66 "sync; lbz%U1%X1 %0,%1;\n"
67 "twi 0,%0,0;\n" 67 "twi 0,%0,0;\n"
68 "isync" : "=r" (ret) : "m" (*addr)); 68 "isync" : "=r" (ret) : "m" (*addr));
69 return ret; 69 return ret;
@@ -78,7 +78,7 @@ extern inline int in_le16(const volatile unsigned short __iomem *addr)
78{ 78{
79 int ret; 79 int ret;
80 80
81 __asm__ __volatile__("lhbrx %0,0,%1;\n" 81 __asm__ __volatile__("sync; lhbrx %0,0,%1;\n"
82 "twi 0,%0,0;\n" 82 "twi 0,%0,0;\n"
83 "isync" : "=r" (ret) : 83 "isync" : "=r" (ret) :
84 "r" (addr), "m" (*addr)); 84 "r" (addr), "m" (*addr));
@@ -89,7 +89,7 @@ extern inline int in_be16(const volatile unsigned short __iomem *addr)
89{ 89{
90 int ret; 90 int ret;
91 91
92 __asm__ __volatile__("lhz%U1%X1 %0,%1;\n" 92 __asm__ __volatile__("sync; lhz%U1%X1 %0,%1;\n"
93 "twi 0,%0,0;\n" 93 "twi 0,%0,0;\n"
94 "isync" : "=r" (ret) : "m" (*addr)); 94 "isync" : "=r" (ret) : "m" (*addr));
95 return ret; 95 return ret;
@@ -97,20 +97,20 @@ extern inline int in_be16(const volatile unsigned short __iomem *addr)
97 97
98extern inline void out_le16(volatile unsigned short __iomem *addr, int val) 98extern inline void out_le16(volatile unsigned short __iomem *addr, int val)
99{ 99{
100 __asm__ __volatile__("sthbrx %1,0,%2; eieio" : "=m" (*addr) : 100 __asm__ __volatile__("sync; sthbrx %1,0,%2" : "=m" (*addr) :
101 "r" (val), "r" (addr)); 101 "r" (val), "r" (addr));
102} 102}
103 103
104extern inline void out_be16(volatile unsigned short __iomem *addr, int val) 104extern inline void out_be16(volatile unsigned short __iomem *addr, int val)
105{ 105{
106 __asm__ __volatile__("sth%U0%X0 %1,%0; eieio" : "=m" (*addr) : "r" (val)); 106 __asm__ __volatile__("sync; sth%U0%X0 %1,%0" : "=m" (*addr) : "r" (val));
107} 107}
108 108
109extern inline unsigned in_le32(const volatile unsigned __iomem *addr) 109extern inline unsigned in_le32(const volatile unsigned __iomem *addr)
110{ 110{
111 unsigned ret; 111 unsigned ret;
112 112
113 __asm__ __volatile__("lwbrx %0,0,%1;\n" 113 __asm__ __volatile__("sync; lwbrx %0,0,%1;\n"
114 "twi 0,%0,0;\n" 114 "twi 0,%0,0;\n"
115 "isync" : "=r" (ret) : 115 "isync" : "=r" (ret) :
116 "r" (addr), "m" (*addr)); 116 "r" (addr), "m" (*addr));
@@ -121,7 +121,7 @@ extern inline unsigned in_be32(const volatile unsigned __iomem *addr)
121{ 121{
122 unsigned ret; 122 unsigned ret;
123 123
124 __asm__ __volatile__("lwz%U1%X1 %0,%1;\n" 124 __asm__ __volatile__("sync; lwz%U1%X1 %0,%1;\n"
125 "twi 0,%0,0;\n" 125 "twi 0,%0,0;\n"
126 "isync" : "=r" (ret) : "m" (*addr)); 126 "isync" : "=r" (ret) : "m" (*addr));
127 return ret; 127 return ret;
@@ -129,13 +129,13 @@ extern inline unsigned in_be32(const volatile unsigned __iomem *addr)
129 129
130extern inline void out_le32(volatile unsigned __iomem *addr, int val) 130extern inline void out_le32(volatile unsigned __iomem *addr, int val)
131{ 131{
132 __asm__ __volatile__("stwbrx %1,0,%2; eieio" : "=m" (*addr) : 132 __asm__ __volatile__("sync; stwbrx %1,0,%2" : "=m" (*addr) :
133 "r" (val), "r" (addr)); 133 "r" (val), "r" (addr));
134} 134}
135 135
136extern inline void out_be32(volatile unsigned __iomem *addr, int val) 136extern inline void out_be32(volatile unsigned __iomem *addr, int val)
137{ 137{
138 __asm__ __volatile__("stw%U0%X0 %1,%0; eieio" : "=m" (*addr) : "r" (val)); 138 __asm__ __volatile__("sync; stw%U0%X0 %1,%0" : "=m" (*addr) : "r" (val));
139} 139}
140#if defined (CONFIG_8260_PCI9) 140#if defined (CONFIG_8260_PCI9)
141#define readb(addr) in_8((volatile u8 *)(addr)) 141#define readb(addr) in_8((volatile u8 *)(addr))
@@ -259,6 +259,7 @@ extern __inline__ unsigned int name(unsigned int port) \
259{ \ 259{ \
260 unsigned int x; \ 260 unsigned int x; \
261 __asm__ __volatile__( \ 261 __asm__ __volatile__( \
262 "sync\n" \
262 "0:" op " %0,0,%1\n" \ 263 "0:" op " %0,0,%1\n" \
263 "1: twi 0,%0,0\n" \ 264 "1: twi 0,%0,0\n" \
264 "2: isync\n" \ 265 "2: isync\n" \
@@ -284,6 +285,7 @@ extern __inline__ unsigned int name(unsigned int port) \
284extern __inline__ void name(unsigned int val, unsigned int port) \ 285extern __inline__ void name(unsigned int val, unsigned int port) \
285{ \ 286{ \
286 __asm__ __volatile__( \ 287 __asm__ __volatile__( \
288 "sync\n" \
287 "0:" op " %0,0,%1\n" \ 289 "0:" op " %0,0,%1\n" \
288 "1: sync\n" \ 290 "1: sync\n" \
289 "2:\n" \ 291 "2:\n" \
diff --git a/include/asm-ppc/mpc8260.h b/include/asm-ppc/mpc8260.h
index 4b93481e7679..23579d4afae7 100644
--- a/include/asm-ppc/mpc8260.h
+++ b/include/asm-ppc/mpc8260.h
@@ -82,6 +82,7 @@ enum ppc_sys_devices {
82 MPC82xx_CPM_SMC2, 82 MPC82xx_CPM_SMC2,
83 MPC82xx_CPM_USB, 83 MPC82xx_CPM_USB,
84 MPC82xx_SEC1, 84 MPC82xx_SEC1,
85 MPC82xx_MDIO_BB,
85 NUM_PPC_SYS_DEVS, 86 NUM_PPC_SYS_DEVS,
86}; 87};
87 88
diff --git a/include/asm-ppc/mpc8xx.h b/include/asm-ppc/mpc8xx.h
index adcce33f20ae..d3a2f2fe230c 100644
--- a/include/asm-ppc/mpc8xx.h
+++ b/include/asm-ppc/mpc8xx.h
@@ -110,6 +110,7 @@ enum ppc_sys_devices {
110 MPC8xx_CPM_SMC1, 110 MPC8xx_CPM_SMC1,
111 MPC8xx_CPM_SMC2, 111 MPC8xx_CPM_SMC2,
112 MPC8xx_CPM_USB, 112 MPC8xx_CPM_USB,
113 MPC8xx_MDIO_FEC,
113 NUM_PPC_SYS_DEVS, 114 NUM_PPC_SYS_DEVS,
114}; 115};
115 116
diff --git a/include/asm-ppc/system.h b/include/asm-ppc/system.h
index fb49c0c49ea1..738943584c01 100644
--- a/include/asm-ppc/system.h
+++ b/include/asm-ppc/system.h
@@ -33,7 +33,6 @@
33#define read_barrier_depends() do { } while(0) 33#define read_barrier_depends() do { } while(0)
34 34
35#define set_mb(var, value) do { var = value; mb(); } while (0) 35#define set_mb(var, value) do { var = value; mb(); } while (0)
36#define set_wmb(var, value) do { var = value; wmb(); } while (0)
37 36
38#ifdef CONFIG_SMP 37#ifdef CONFIG_SMP
39#define smp_mb() mb() 38#define smp_mb() mb()
diff --git a/include/asm-s390/bug.h b/include/asm-s390/bug.h
index 7ddaa05b98d8..876898363944 100644
--- a/include/asm-s390/bug.h
+++ b/include/asm-s390/bug.h
@@ -5,9 +5,18 @@
5 5
6#ifdef CONFIG_BUG 6#ifdef CONFIG_BUG
7 7
8static inline __attribute__((noreturn)) void __do_illegal_op(void)
9{
10#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
11 __builtin_trap();
12#else
13 asm volatile(".long 0");
14#endif
15}
16
8#define BUG() do { \ 17#define BUG() do { \
9 printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ 18 printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
10 __builtin_trap(); \ 19 __do_illegal_op(); \
11} while (0) 20} while (0)
12 21
13#define HAVE_ARCH_BUG 22#define HAVE_ARCH_BUG
diff --git a/include/asm-s390/ccwdev.h b/include/asm-s390/ccwdev.h
index 12456cb2f882..58c70acffc73 100644
--- a/include/asm-s390/ccwdev.h
+++ b/include/asm-s390/ccwdev.h
@@ -63,7 +63,7 @@ ccw_device_id_match(const struct ccw_device_id *array,
63 return id; 63 return id;
64 } 64 }
65 65
66 return 0; 66 return NULL;
67} 67}
68 68
69/* The struct ccw device is our replacement for the globally accessible 69/* The struct ccw device is our replacement for the globally accessible
diff --git a/include/asm-s390/cio.h b/include/asm-s390/cio.h
index 2b1619306351..28fdd6e2b8ba 100644
--- a/include/asm-s390/cio.h
+++ b/include/asm-s390/cio.h
@@ -276,6 +276,8 @@ extern void wait_cons_dev(void);
276 276
277extern void clear_all_subchannels(void); 277extern void clear_all_subchannels(void);
278 278
279extern void cio_reset_channel_paths(void);
280
279extern void css_schedule_reprobe(void); 281extern void css_schedule_reprobe(void);
280 282
281#endif 283#endif
diff --git a/include/asm-s390/debug.h b/include/asm-s390/debug.h
index 7f1ef99fd1e1..c00dd2b3dc50 100644
--- a/include/asm-s390/debug.h
+++ b/include/asm-s390/debug.h
@@ -10,7 +10,6 @@
10#define DEBUG_H 10#define DEBUG_H
11 11
12#include <linux/fs.h> 12#include <linux/fs.h>
13#include <linux/string.h>
14 13
15/* Note: 14/* Note:
16 * struct __debug_entry must be defined outside of #ifdef __KERNEL__ 15 * struct __debug_entry must be defined outside of #ifdef __KERNEL__
@@ -35,6 +34,7 @@ struct __debug_entry{
35#define __DEBUG_FEATURE_VERSION 2 /* version of debug feature */ 34#define __DEBUG_FEATURE_VERSION 2 /* version of debug feature */
36 35
37#ifdef __KERNEL__ 36#ifdef __KERNEL__
37#include <linux/string.h>
38#include <linux/spinlock.h> 38#include <linux/spinlock.h>
39#include <linux/kernel.h> 39#include <linux/kernel.h>
40#include <linux/time.h> 40#include <linux/time.h>
diff --git a/include/asm-s390/elf.h b/include/asm-s390/elf.h
index 710646e64f7d..c0d629d61d3e 100644
--- a/include/asm-s390/elf.h
+++ b/include/asm-s390/elf.h
@@ -93,19 +93,6 @@
93#define R_390_NUM 61 93#define R_390_NUM 61
94 94
95/* 95/*
96 * ELF register definitions..
97 */
98
99#include <linux/sched.h> /* for task_struct */
100#include <asm/ptrace.h>
101#include <asm/user.h>
102#include <asm/system.h> /* for save_access_regs */
103
104
105typedef s390_fp_regs elf_fpregset_t;
106typedef s390_regs elf_gregset_t;
107
108/*
109 * These are used to set parameters in the core dumps. 96 * These are used to set parameters in the core dumps.
110 */ 97 */
111#ifndef __s390x__ 98#ifndef __s390x__
@@ -117,6 +104,20 @@ typedef s390_regs elf_gregset_t;
117#define ELF_ARCH EM_S390 104#define ELF_ARCH EM_S390
118 105
119/* 106/*
107 * ELF register definitions..
108 */
109
110#include <asm/ptrace.h>
111#include <asm/user.h>
112
113typedef s390_fp_regs elf_fpregset_t;
114typedef s390_regs elf_gregset_t;
115
116#ifdef __KERNEL__
117#include <linux/sched.h> /* for task_struct */
118#include <asm/system.h> /* for save_access_regs */
119
120/*
120 * This is used to ensure we don't load something for the wrong architecture. 121 * This is used to ensure we don't load something for the wrong architecture.
121 */ 122 */
122#define elf_check_arch(x) \ 123#define elf_check_arch(x) \
@@ -198,7 +199,6 @@ static inline int dump_task_fpu(struct task_struct *tsk, elf_fpregset_t *fpregs)
198 199
199#define ELF_PLATFORM (NULL) 200#define ELF_PLATFORM (NULL)
200 201
201#ifdef __KERNEL__
202#ifndef __s390x__ 202#ifndef __s390x__
203#define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX) 203#define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX)
204#else /* __s390x__ */ 204#else /* __s390x__ */
diff --git a/include/asm-s390/futex.h b/include/asm-s390/futex.h
index 1802775568b9..ffedf14f89f6 100644
--- a/include/asm-s390/futex.h
+++ b/include/asm-s390/futex.h
@@ -98,9 +98,10 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
98 98
99 if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) 99 if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
100 return -EFAULT; 100 return -EFAULT;
101 asm volatile(" cs %1,%4,0(%5)\n" 101 asm volatile(" sacf 256\n"
102 " cs %1,%4,0(%5)\n"
102 "0: lr %0,%1\n" 103 "0: lr %0,%1\n"
103 "1:\n" 104 "1: sacf 0\n"
104#ifndef __s390x__ 105#ifndef __s390x__
105 ".section __ex_table,\"a\"\n" 106 ".section __ex_table,\"a\"\n"
106 " .align 4\n" 107 " .align 4\n"
diff --git a/include/asm-s390/irqflags.h b/include/asm-s390/irqflags.h
index 65f4db627e7a..3b566a5b3cc7 100644
--- a/include/asm-s390/irqflags.h
+++ b/include/asm-s390/irqflags.h
@@ -25,16 +25,22 @@
25 __flags; \ 25 __flags; \
26 }) 26 })
27 27
28#define raw_local_save_flags(x) \ 28#define raw_local_save_flags(x) \
29 __asm__ __volatile__("stosm 0(%1),0" : "=m" (x) : "a" (&x), "m" (x) ) 29do { \
30 30 typecheck(unsigned long, x); \
31#define raw_local_irq_restore(x) \ 31 __asm__ __volatile__("stosm 0(%1),0" : "=m" (x) : "a" (&x), "m" (x) ); \
32 __asm__ __volatile__("ssm 0(%0)" : : "a" (&x), "m" (x) : "memory") 32} while (0)
33
34#define raw_local_irq_restore(x) \
35do { \
36 typecheck(unsigned long, x); \
37 __asm__ __volatile__("ssm 0(%0)" : : "a" (&x), "m" (x) : "memory"); \
38} while (0)
33 39
34#define raw_irqs_disabled() \ 40#define raw_irqs_disabled() \
35({ \ 41({ \
36 unsigned long flags; \ 42 unsigned long flags; \
37 local_save_flags(flags); \ 43 raw_local_save_flags(flags); \
38 !((flags >> __FLAG_SHIFT) & 3); \ 44 !((flags >> __FLAG_SHIFT) & 3); \
39}) 45})
40 46
diff --git a/include/asm-s390/pgalloc.h b/include/asm-s390/pgalloc.h
index 3002fda89d33..a78e853e0dd5 100644
--- a/include/asm-s390/pgalloc.h
+++ b/include/asm-s390/pgalloc.h
@@ -142,7 +142,7 @@ pte_alloc_one(struct mm_struct *mm, unsigned long vmaddr)
142 pte_t *pte = pte_alloc_one_kernel(mm, vmaddr); 142 pte_t *pte = pte_alloc_one_kernel(mm, vmaddr);
143 if (pte) 143 if (pte)
144 return virt_to_page(pte); 144 return virt_to_page(pte);
145 return 0; 145 return NULL;
146} 146}
147 147
148static inline void pte_free_kernel(pte_t *pte) 148static inline void pte_free_kernel(pte_t *pte)
diff --git a/include/asm-s390/processor.h b/include/asm-s390/processor.h
index c5cbc4bd8414..5b71d3731723 100644
--- a/include/asm-s390/processor.h
+++ b/include/asm-s390/processor.h
@@ -199,15 +199,13 @@ unsigned long get_wchan(struct task_struct *p);
199/* 199/*
200 * Give up the time slice of the virtual PU. 200 * Give up the time slice of the virtual PU.
201 */ 201 */
202#ifndef __s390x__ 202static inline void cpu_relax(void)
203# define cpu_relax() asm volatile ("diag 0,0,68" : : : "memory") 203{
204#else /* __s390x__ */ 204 if (MACHINE_HAS_DIAG44)
205# define cpu_relax() \ 205 asm volatile ("diag 0,0,68" : : : "memory");
206 do { \ 206 else
207 if (MACHINE_HAS_DIAG44) \ 207 barrier();
208 asm volatile ("diag 0,0,68" : : : "memory"); \ 208}
209 } while (0)
210#endif /* __s390x__ */
211 209
212/* 210/*
213 * Set PSW to specified value. 211 * Set PSW to specified value.
diff --git a/include/asm-s390/setup.h b/include/asm-s390/setup.h
index da3fd4a7bb32..19e31979309a 100644
--- a/include/asm-s390/setup.h
+++ b/include/asm-s390/setup.h
@@ -40,15 +40,16 @@ extern unsigned long machine_flags;
40#define MACHINE_IS_VM (machine_flags & 1) 40#define MACHINE_IS_VM (machine_flags & 1)
41#define MACHINE_IS_P390 (machine_flags & 4) 41#define MACHINE_IS_P390 (machine_flags & 4)
42#define MACHINE_HAS_MVPG (machine_flags & 16) 42#define MACHINE_HAS_MVPG (machine_flags & 16)
43#define MACHINE_HAS_DIAG44 (machine_flags & 32)
44#define MACHINE_HAS_IDTE (machine_flags & 128) 43#define MACHINE_HAS_IDTE (machine_flags & 128)
45 44
46#ifndef __s390x__ 45#ifndef __s390x__
47#define MACHINE_HAS_IEEE (machine_flags & 2) 46#define MACHINE_HAS_IEEE (machine_flags & 2)
48#define MACHINE_HAS_CSP (machine_flags & 8) 47#define MACHINE_HAS_CSP (machine_flags & 8)
48#define MACHINE_HAS_DIAG44 (1)
49#else /* __s390x__ */ 49#else /* __s390x__ */
50#define MACHINE_HAS_IEEE (1) 50#define MACHINE_HAS_IEEE (1)
51#define MACHINE_HAS_CSP (1) 51#define MACHINE_HAS_CSP (1)
52#define MACHINE_HAS_DIAG44 (machine_flags & 32)
52#endif /* __s390x__ */ 53#endif /* __s390x__ */
53 54
54 55
diff --git a/include/asm-s390/system.h b/include/asm-s390/system.h
index 9ab186ffde23..16040048cd1b 100644
--- a/include/asm-s390/system.h
+++ b/include/asm-s390/system.h
@@ -128,8 +128,13 @@ extern void account_system_vtime(struct task_struct *);
128 128
129#define nop() __asm__ __volatile__ ("nop") 129#define nop() __asm__ __volatile__ ("nop")
130 130
131#define xchg(ptr,x) \ 131#define xchg(ptr,x) \
132 ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(void *)(ptr),sizeof(*(ptr)))) 132({ \
133 __typeof__(*(ptr)) __ret; \
134 __ret = (__typeof__(*(ptr))) \
135 __xchg((unsigned long)(x), (void *)(ptr),sizeof(*(ptr))); \
136 __ret; \
137})
133 138
134static inline unsigned long __xchg(unsigned long x, void * ptr, int size) 139static inline unsigned long __xchg(unsigned long x, void * ptr, int size)
135{ 140{
@@ -299,7 +304,6 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
299 304
300 305
301#define set_mb(var, value) do { var = value; mb(); } while (0) 306#define set_mb(var, value) do { var = value; mb(); } while (0)
302#define set_wmb(var, value) do { var = value; wmb(); } while (0)
303 307
304#ifdef __s390x__ 308#ifdef __s390x__
305 309
diff --git a/include/asm-s390/timex.h b/include/asm-s390/timex.h
index 4848057dafe4..5d0332a4c2bd 100644
--- a/include/asm-s390/timex.h
+++ b/include/asm-s390/timex.h
@@ -19,7 +19,7 @@ static inline cycles_t get_cycles(void)
19{ 19{
20 cycles_t cycles; 20 cycles_t cycles;
21 21
22 __asm__("stck 0(%1)" : "=m" (cycles) : "a" (&cycles) : "cc"); 22 __asm__ __volatile__ ("stck 0(%1)" : "=m" (cycles) : "a" (&cycles) : "cc");
23 return cycles >> 2; 23 return cycles >> 2;
24} 24}
25 25
@@ -27,7 +27,7 @@ static inline unsigned long long get_clock (void)
27{ 27{
28 unsigned long long clk; 28 unsigned long long clk;
29 29
30 __asm__("stck 0(%1)" : "=m" (clk) : "a" (&clk) : "cc"); 30 __asm__ __volatile__ ("stck 0(%1)" : "=m" (clk) : "a" (&clk) : "cc");
31 return clk; 31 return clk;
32} 32}
33 33
diff --git a/include/asm-sh/page.h b/include/asm-sh/page.h
index a5559e38744e..5a057b00f19a 100644
--- a/include/asm-sh/page.h
+++ b/include/asm-sh/page.h
@@ -104,7 +104,7 @@ typedef struct { unsigned long pgprot; } pgprot_t;
104 104
105/* PFN start number, because of __MEMORY_START */ 105/* PFN start number, because of __MEMORY_START */
106#define PFN_START (__MEMORY_START >> PAGE_SHIFT) 106#define PFN_START (__MEMORY_START >> PAGE_SHIFT)
107#define ARCH_PFN_OFFSET (FPN_START) 107#define ARCH_PFN_OFFSET (PFN_START)
108#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) 108#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
109#define pfn_valid(pfn) (((pfn) - PFN_START) < max_mapnr) 109#define pfn_valid(pfn) (((pfn) - PFN_START) < max_mapnr)
110#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) 110#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
diff --git a/include/asm-sh/processor.h b/include/asm-sh/processor.h
index fa5bd2d8803e..eeb0f48bb99e 100644
--- a/include/asm-sh/processor.h
+++ b/include/asm-sh/processor.h
@@ -9,6 +9,7 @@
9#define __ASM_SH_PROCESSOR_H 9#define __ASM_SH_PROCESSOR_H
10#ifdef __KERNEL__ 10#ifdef __KERNEL__
11 11
12#include <linux/compiler.h>
12#include <asm/page.h> 13#include <asm/page.h>
13#include <asm/types.h> 14#include <asm/types.h>
14#include <asm/cache.h> 15#include <asm/cache.h>
@@ -263,7 +264,7 @@ extern unsigned long get_wchan(struct task_struct *p);
263#define KSTK_ESP(tsk) ((tsk)->thread.sp) 264#define KSTK_ESP(tsk) ((tsk)->thread.sp)
264 265
265#define cpu_sleep() __asm__ __volatile__ ("sleep" : : : "memory") 266#define cpu_sleep() __asm__ __volatile__ ("sleep" : : : "memory")
266#define cpu_relax() do { } while (0) 267#define cpu_relax() barrier()
267 268
268#endif /* __KERNEL__ */ 269#endif /* __KERNEL__ */
269#endif /* __ASM_SH_PROCESSOR_H */ 270#endif /* __ASM_SH_PROCESSOR_H */
diff --git a/include/asm-sh/system.h b/include/asm-sh/system.h
index ce2e60664a86..ad35ad4958f4 100644
--- a/include/asm-sh/system.h
+++ b/include/asm-sh/system.h
@@ -101,7 +101,6 @@ extern void __xchg_called_with_bad_pointer(void);
101#endif 101#endif
102 102
103#define set_mb(var, value) do { xchg(&var, value); } while (0) 103#define set_mb(var, value) do { xchg(&var, value); } while (0)
104#define set_wmb(var, value) do { var = value; wmb(); } while (0)
105 104
106/* Interrupt Control */ 105/* Interrupt Control */
107static __inline__ void local_irq_enable(void) 106static __inline__ void local_irq_enable(void)
diff --git a/include/asm-sh64/bug.h b/include/asm-sh64/bug.h
index 81f722efeb63..f3a9c9248ef4 100644
--- a/include/asm-sh64/bug.h
+++ b/include/asm-sh64/bug.h
@@ -1,7 +1,7 @@
1#ifndef __ASM_SH64_BUG_H 1#ifndef __ASM_SH64_BUG_H
2#define __ASM_SH64_BUG_H 2#define __ASM_SH64_BUG_H
3 3
4 4#ifdef CONFIG_BUG
5/* 5/*
6 * Tell the user there is some problem, then force a segfault (in process 6 * Tell the user there is some problem, then force a segfault (in process
7 * context) or a panic (interrupt context). 7 * context) or a panic (interrupt context).
@@ -11,17 +11,9 @@
11 *(volatile int *)0 = 0; \ 11 *(volatile int *)0 = 0; \
12} while (0) 12} while (0)
13 13
14#define BUG_ON(condition) do { \ 14#define HAVE_ARCH_BUG
15 if (unlikely((condition)!=0)) \ 15#endif
16 BUG(); \
17} while(0)
18 16
19#define WARN_ON(condition) do { \ 17#include <asm-generic/bug.h>
20 if (unlikely((condition)!=0)) { \
21 printk("Badness in %s at %s:%d\n", __FUNCTION__, __FILE__, __LINE__); \
22 dump_stack(); \
23 } \
24} while (0)
25 18
26#endif /* __ASM_SH64_BUG_H */ 19#endif /* __ASM_SH64_BUG_H */
27
diff --git a/include/asm-sh64/byteorder.h b/include/asm-sh64/byteorder.h
index f602ebe334eb..7419d78820ee 100644
--- a/include/asm-sh64/byteorder.h
+++ b/include/asm-sh64/byteorder.h
@@ -14,7 +14,7 @@
14 14
15#include <asm/types.h> 15#include <asm/types.h>
16 16
17static __inline__ __const__ __u32 ___arch__swab32(__u32 x) 17static inline __attribute_const__ __u32 ___arch__swab32(__u32 x)
18{ 18{
19 __asm__("byterev %0, %0\n\t" 19 __asm__("byterev %0, %0\n\t"
20 "shari %0, 32, %0" 20 "shari %0, 32, %0"
@@ -23,7 +23,7 @@ static __inline__ __const__ __u32 ___arch__swab32(__u32 x)
23 return x; 23 return x;
24} 24}
25 25
26static __inline__ __const__ __u16 ___arch__swab16(__u16 x) 26static inline __attribute_const__ __u16 ___arch__swab16(__u16 x)
27{ 27{
28 __asm__("byterev %0, %0\n\t" 28 __asm__("byterev %0, %0\n\t"
29 "shari %0, 48, %0" 29 "shari %0, 48, %0"
diff --git a/include/asm-sh64/dma-mapping.h b/include/asm-sh64/dma-mapping.h
index a74a49e47922..68e27a8fca31 100644
--- a/include/asm-sh64/dma-mapping.h
+++ b/include/asm-sh64/dma-mapping.h
@@ -126,22 +126,30 @@ static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg,
126static inline void dma_sync_single_for_cpu(struct device *dev, 126static inline void dma_sync_single_for_cpu(struct device *dev,
127 dma_addr_t dma_handle, size_t size, 127 dma_addr_t dma_handle, size_t size,
128 enum dma_data_direction dir) 128 enum dma_data_direction dir)
129 __attribute__ ((alias("dma_sync_single"))); 129{
130 dma_sync_single(dev, dma_handle, size, dir);
131}
130 132
131static inline void dma_sync_single_for_device(struct device *dev, 133static inline void dma_sync_single_for_device(struct device *dev,
132 dma_addr_t dma_handle, size_t size, 134 dma_addr_t dma_handle, size_t size,
133 enum dma_data_direction dir) 135 enum dma_data_direction dir)
134 __attribute__ ((alias("dma_sync_single"))); 136{
137 dma_sync_single(dev, dma_handle, size, dir);
138}
135 139
136static inline void dma_sync_sg_for_cpu(struct device *dev, 140static inline void dma_sync_sg_for_cpu(struct device *dev,
137 struct scatterlist *sg, int nelems, 141 struct scatterlist *sg, int nelems,
138 enum dma_data_direction dir) 142 enum dma_data_direction dir)
139 __attribute__ ((alias("dma_sync_sg"))); 143{
144 dma_sync_sg(dev, sg, nelems, dir);
145}
140 146
141static inline void dma_sync_sg_for_device(struct device *dev, 147static inline void dma_sync_sg_for_device(struct device *dev,
142 struct scatterlist *sg, int nelems, 148 struct scatterlist *sg, int nelems,
143 enum dma_data_direction dir) 149 enum dma_data_direction dir)
144 __attribute__ ((alias("dma_sync_sg"))); 150{
151 dma_sync_sg(dev, sg, nelems, dir);
152}
145 153
146static inline int dma_get_cache_alignment(void) 154static inline int dma_get_cache_alignment(void)
147{ 155{
diff --git a/include/asm-sh64/io.h b/include/asm-sh64/io.h
index dee4f77929a4..252fedbb6621 100644
--- a/include/asm-sh64/io.h
+++ b/include/asm-sh64/io.h
@@ -123,6 +123,13 @@ void insw(unsigned long port, void *addr, unsigned long count);
123void outsl(unsigned long port, const void *addr, unsigned long count); 123void outsl(unsigned long port, const void *addr, unsigned long count);
124void insl(unsigned long port, void *addr, unsigned long count); 124void insl(unsigned long port, void *addr, unsigned long count);
125 125
126#define __raw_readb readb
127#define __raw_readw readw
128#define __raw_readl readl
129#define __raw_writeb writeb
130#define __raw_writew writew
131#define __raw_writel writel
132
126void memcpy_toio(void __iomem *to, const void *from, long count); 133void memcpy_toio(void __iomem *to, const void *from, long count);
127void memcpy_fromio(void *to, void __iomem *from, long count); 134void memcpy_fromio(void *to, void __iomem *from, long count);
128 135
diff --git a/include/asm-sh64/processor.h b/include/asm-sh64/processor.h
index 1bf252dad824..eb2bee4b47b9 100644
--- a/include/asm-sh64/processor.h
+++ b/include/asm-sh64/processor.h
@@ -22,6 +22,7 @@
22#include <asm/cache.h> 22#include <asm/cache.h>
23#include <asm/registers.h> 23#include <asm/registers.h>
24#include <linux/threads.h> 24#include <linux/threads.h>
25#include <linux/compiler.h>
25 26
26/* 27/*
27 * Default implementation of macro that returns current 28 * Default implementation of macro that returns current
@@ -279,7 +280,7 @@ extern unsigned long get_wchan(struct task_struct *p);
279#define KSTK_EIP(tsk) ((tsk)->thread.pc) 280#define KSTK_EIP(tsk) ((tsk)->thread.pc)
280#define KSTK_ESP(tsk) ((tsk)->thread.sp) 281#define KSTK_ESP(tsk) ((tsk)->thread.sp)
281 282
282#define cpu_relax() do { } while (0) 283#define cpu_relax() barrier()
283 284
284#endif /* __ASSEMBLY__ */ 285#endif /* __ASSEMBLY__ */
285#endif /* __ASM_SH64_PROCESSOR_H */ 286#endif /* __ASM_SH64_PROCESSOR_H */
diff --git a/include/asm-sh64/ptrace.h b/include/asm-sh64/ptrace.h
index 56190f521587..a6d4da519db6 100644
--- a/include/asm-sh64/ptrace.h
+++ b/include/asm-sh64/ptrace.h
@@ -28,7 +28,7 @@ struct pt_regs {
28#ifdef __KERNEL__ 28#ifdef __KERNEL__
29#define user_mode(regs) (((regs)->sr & 0x40000000)==0) 29#define user_mode(regs) (((regs)->sr & 0x40000000)==0)
30#define instruction_pointer(regs) ((regs)->pc) 30#define instruction_pointer(regs) ((regs)->pc)
31#define profile_pc(regs) instruction_pointer(regs) 31#define profile_pc(regs) ((unsigned long)instruction_pointer(regs))
32extern void show_regs(struct pt_regs *); 32extern void show_regs(struct pt_regs *);
33#endif 33#endif
34 34
diff --git a/include/asm-sh64/system.h b/include/asm-sh64/system.h
index 7606f6e1f01e..b1598c26fcb0 100644
--- a/include/asm-sh64/system.h
+++ b/include/asm-sh64/system.h
@@ -64,9 +64,8 @@ extern void __xchg_called_with_bad_pointer(void);
64#define smp_read_barrier_depends() do { } while (0) 64#define smp_read_barrier_depends() do { } while (0)
65#endif /* CONFIG_SMP */ 65#endif /* CONFIG_SMP */
66 66
67#define set_rmb(var, value) do { xchg(&var, value); } while (0) 67#define set_rmb(var, value) do { (void)xchg(&var, value); } while (0)
68#define set_mb(var, value) set_rmb(var, value) 68#define set_mb(var, value) set_rmb(var, value)
69#define set_wmb(var, value) do { var = value; wmb(); } while (0)
70 69
71/* Interrupt Control */ 70/* Interrupt Control */
72#ifndef HARD_CLI 71#ifndef HARD_CLI
diff --git a/include/asm-sh64/uaccess.h b/include/asm-sh64/uaccess.h
index f4936d8fa617..644c67b65f94 100644
--- a/include/asm-sh64/uaccess.h
+++ b/include/asm-sh64/uaccess.h
@@ -128,25 +128,20 @@ do { \
128 128
129#define __get_user_nocheck(x,ptr,size) \ 129#define __get_user_nocheck(x,ptr,size) \
130({ \ 130({ \
131 long __gu_addr = (long)(ptr); \ 131 long __gu_err, __gu_val; \
132 long __gu_err; \ 132 __get_user_size((void *)&__gu_val, (long)(ptr), \
133 __typeof(*(ptr)) __gu_val; \ 133 (size), __gu_err); \
134 __asm__ ("":"=r" (__gu_val)); \ 134 (x) = (__typeof__(*(ptr)))__gu_val; \
135 __asm__ ("":"=r" (__gu_err)); \
136 __get_user_size((void *)&__gu_val, __gu_addr, (size), __gu_err); \
137 (x) = (__typeof__(*(ptr))) __gu_val; \
138 __gu_err; \ 135 __gu_err; \
139}) 136})
140 137
141#define __get_user_check(x,ptr,size) \ 138#define __get_user_check(x,ptr,size) \
142({ \ 139({ \
143 long __gu_addr = (long)(ptr); \ 140 long __gu_addr = (long)(ptr); \
144 long __gu_err = -EFAULT; \ 141 long __gu_err = -EFAULT, __gu_val; \
145 __typeof(*(ptr)) __gu_val; \
146 __asm__ ("":"=r" (__gu_val)); \
147 __asm__ ("":"=r" (__gu_err)); \
148 if (__access_ok(__gu_addr, (size))) \ 142 if (__access_ok(__gu_addr, (size))) \
149 __get_user_size((void *)&__gu_val, __gu_addr, (size), __gu_err); \ 143 __get_user_size((void *)&__gu_val, __gu_addr, \
144 (size), __gu_err); \
150 (x) = (__typeof__(*(ptr))) __gu_val; \ 145 (x) = (__typeof__(*(ptr))) __gu_val; \
151 __gu_err; \ 146 __gu_err; \
152}) 147})
diff --git a/include/asm-sparc/mman.h b/include/asm-sparc/mman.h
index 88d1886abf3b..b7dc40bc68f4 100644
--- a/include/asm-sparc/mman.h
+++ b/include/asm-sparc/mman.h
@@ -35,4 +35,12 @@
35 35
36#define MADV_FREE 0x5 /* (Solaris) contents can be freed */ 36#define MADV_FREE 0x5 /* (Solaris) contents can be freed */
37 37
38#ifdef __KERNEL__
39#ifndef __ASSEMBLY__
40#define arch_mmap_check sparc_mmap_check
41int sparc_mmap_check(unsigned long addr, unsigned long len,
42 unsigned long flags);
43#endif
44#endif
45
38#endif /* __SPARC_MMAN_H__ */ 46#endif /* __SPARC_MMAN_H__ */
diff --git a/include/asm-sparc/oplib.h b/include/asm-sparc/oplib.h
index f283f8aaf6a9..91691e52c058 100644
--- a/include/asm-sparc/oplib.h
+++ b/include/asm-sparc/oplib.h
@@ -267,11 +267,6 @@ extern void prom_getstring(int node, char *prop, char *buf, int bufsize);
267/* Does the passed node have the given "name"? YES=1 NO=0 */ 267/* Does the passed node have the given "name"? YES=1 NO=0 */
268extern int prom_nodematch(int thisnode, char *name); 268extern int prom_nodematch(int thisnode, char *name);
269 269
270/* Puts in buffer a prom name in the form name@x,y or name (x for which_io
271 * and y for first regs phys address
272 */
273extern int prom_getname(int node, char *buf, int buflen);
274
275/* Search all siblings starting at the passed node for "name" matching 270/* Search all siblings starting at the passed node for "name" matching
276 * the given string. Returns the node on success, zero on failure. 271 * the given string. Returns the node on success, zero on failure.
277 */ 272 */
diff --git a/include/asm-sparc/signal.h b/include/asm-sparc/signal.h
index 0ae5084c427b..d03a21c97abb 100644
--- a/include/asm-sparc/signal.h
+++ b/include/asm-sparc/signal.h
@@ -168,7 +168,7 @@ struct sigstack {
168 * statically allocated data.. which is NOT GOOD. 168 * statically allocated data.. which is NOT GOOD.
169 * 169 *
170 */ 170 */
171#define SA_STATIC_ALLOC 0x80 171#define SA_STATIC_ALLOC 0x8000
172#endif 172#endif
173 173
174#include <asm-generic/signal.h> 174#include <asm-generic/signal.h>
diff --git a/include/asm-sparc/system.h b/include/asm-sparc/system.h
index cb7dda1e5e91..100c3eaf3c1f 100644
--- a/include/asm-sparc/system.h
+++ b/include/asm-sparc/system.h
@@ -199,7 +199,6 @@ static inline unsigned long getipl(void)
199#define wmb() mb() 199#define wmb() mb()
200#define read_barrier_depends() do { } while(0) 200#define read_barrier_depends() do { } while(0)
201#define set_mb(__var, __value) do { __var = __value; mb(); } while(0) 201#define set_mb(__var, __value) do { __var = __value; mb(); } while(0)
202#define set_wmb(__var, __value) set_mb(__var, __value)
203#define smp_mb() __asm__ __volatile__("":::"memory") 202#define smp_mb() __asm__ __volatile__("":::"memory")
204#define smp_rmb() __asm__ __volatile__("":::"memory") 203#define smp_rmb() __asm__ __volatile__("":::"memory")
205#define smp_wmb() __asm__ __volatile__("":::"memory") 204#define smp_wmb() __asm__ __volatile__("":::"memory")
diff --git a/include/asm-sparc64/Kbuild b/include/asm-sparc64/Kbuild
index c78d44bb195f..9284c3cb27ec 100644
--- a/include/asm-sparc64/Kbuild
+++ b/include/asm-sparc64/Kbuild
@@ -4,7 +4,7 @@ ALTARCH := sparc
4ARCHDEF := defined __sparc__ && defined __arch64__ 4ARCHDEF := defined __sparc__ && defined __arch64__
5ALTARCHDEF := defined __sparc__ && !defined __arch64__ 5ALTARCHDEF := defined __sparc__ && !defined __arch64__
6 6
7unifdef-y := fbio.h perfctr.h 7unifdef-y += fbio.h perfctr.h
8header-y += apb.h asi.h bbc.h bpp.h display7seg.h envctrl.h floppy.h \ 8header-y += apb.h asi.h bbc.h bpp.h display7seg.h envctrl.h floppy.h \
9 ipc.h kdebug.h mostek.h openprom.h openpromio.h parport.h \ 9 ipc.h kdebug.h mostek.h openprom.h openpromio.h parport.h \
10 pconf.h psrcompat.h pstate.h reg.h uctx.h utrap.h watchdog.h 10 pconf.h psrcompat.h pstate.h reg.h uctx.h utrap.h watchdog.h
diff --git a/include/asm-sparc64/dma-mapping.h b/include/asm-sparc64/dma-mapping.h
index 0f5b89c9323b..27c46fbeebd6 100644
--- a/include/asm-sparc64/dma-mapping.h
+++ b/include/asm-sparc64/dma-mapping.h
@@ -160,6 +160,20 @@ static inline void dma_free_coherent(struct device *dev, size_t size,
160 BUG(); 160 BUG();
161} 161}
162 162
163static inline void
164dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size,
165 enum dma_data_direction direction)
166{
167 BUG();
168}
169
170static inline void
171dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size,
172 enum dma_data_direction direction)
173{
174 BUG();
175}
176
163#endif /* PCI */ 177#endif /* PCI */
164 178
165 179
diff --git a/include/asm-sparc64/kprobes.h b/include/asm-sparc64/kprobes.h
index 15065af566c2..c9f5c34d318c 100644
--- a/include/asm-sparc64/kprobes.h
+++ b/include/asm-sparc64/kprobes.h
@@ -13,6 +13,7 @@ typedef u32 kprobe_opcode_t;
13#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry 13#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry
14#define arch_remove_kprobe(p) do {} while (0) 14#define arch_remove_kprobe(p) do {} while (0)
15#define ARCH_INACTIVE_KPROBE_COUNT 0 15#define ARCH_INACTIVE_KPROBE_COUNT 0
16#define flush_insn_slot(p) do { } while (0)
16 17
17/* Architecture specific copy of original instruction*/ 18/* Architecture specific copy of original instruction*/
18struct arch_specific_insn { 19struct arch_specific_insn {
diff --git a/include/asm-sparc64/mman.h b/include/asm-sparc64/mman.h
index 6fd878e61435..8cc1860be630 100644
--- a/include/asm-sparc64/mman.h
+++ b/include/asm-sparc64/mman.h
@@ -35,4 +35,12 @@
35 35
36#define MADV_FREE 0x5 /* (Solaris) contents can be freed */ 36#define MADV_FREE 0x5 /* (Solaris) contents can be freed */
37 37
38#ifdef __KERNEL__
39#ifndef __ASSEMBLY__
40#define arch_mmap_check sparc64_mmap_check
41int sparc64_mmap_check(unsigned long addr, unsigned long len,
42 unsigned long flags);
43#endif
44#endif
45
38#endif /* __SPARC64_MMAN_H__ */ 46#endif /* __SPARC64_MMAN_H__ */
diff --git a/include/asm-sparc64/openprom.h b/include/asm-sparc64/openprom.h
index b4959d2b0d99..e01b80559c93 100644
--- a/include/asm-sparc64/openprom.h
+++ b/include/asm-sparc64/openprom.h
@@ -175,7 +175,7 @@ struct linux_nodeops {
175}; 175};
176 176
177/* More fun PROM structures for device probing. */ 177/* More fun PROM structures for device probing. */
178#define PROMREG_MAX 16 178#define PROMREG_MAX 24
179#define PROMVADDR_MAX 16 179#define PROMVADDR_MAX 16
180#define PROMINTR_MAX 15 180#define PROMINTR_MAX 15
181 181
diff --git a/include/asm-sparc64/oplib.h b/include/asm-sparc64/oplib.h
index a68b0bb05958..6a0da3b1695c 100644
--- a/include/asm-sparc64/oplib.h
+++ b/include/asm-sparc64/oplib.h
@@ -287,11 +287,6 @@ extern void prom_getstring(int node, const char *prop, char *buf, int bufsize);
287/* Does the passed node have the given "name"? YES=1 NO=0 */ 287/* Does the passed node have the given "name"? YES=1 NO=0 */
288extern int prom_nodematch(int thisnode, const char *name); 288extern int prom_nodematch(int thisnode, const char *name);
289 289
290/* Puts in buffer a prom name in the form name@x,y or name (x for which_io
291 * and y for first regs phys address
292 */
293extern int prom_getname(int node, char *buf, int buflen);
294
295/* Search all siblings starting at the passed node for "name" matching 290/* Search all siblings starting at the passed node for "name" matching
296 * the given string. Returns the node on success, zero on failure. 291 * the given string. Returns the node on success, zero on failure.
297 */ 292 */
diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h
index 03f5bc9b6bec..ebfe395cfb87 100644
--- a/include/asm-sparc64/pgtable.h
+++ b/include/asm-sparc64/pgtable.h
@@ -234,7 +234,7 @@ static inline pte_t pfn_pte(unsigned long pfn, pgprot_t prot)
234 sz_bits = 0UL; 234 sz_bits = 0UL;
235 if (_PAGE_SZBITS_4U != 0UL || _PAGE_SZBITS_4V != 0UL) { 235 if (_PAGE_SZBITS_4U != 0UL || _PAGE_SZBITS_4V != 0UL) {
236 __asm__ __volatile__( 236 __asm__ __volatile__(
237 "\n661: sethi %uhi(%1), %0\n" 237 "\n661: sethi %%uhi(%1), %0\n"
238 " sllx %0, 32, %0\n" 238 " sllx %0, 32, %0\n"
239 " .section .sun4v_2insn_patch, \"ax\"\n" 239 " .section .sun4v_2insn_patch, \"ax\"\n"
240 " .word 661b\n" 240 " .word 661b\n"
@@ -339,7 +339,7 @@ static inline pgprot_t pgprot_noncached(pgprot_t prot)
339 " .section .sun4v_2insn_patch, \"ax\"\n" 339 " .section .sun4v_2insn_patch, \"ax\"\n"
340 " .word 661b\n" 340 " .word 661b\n"
341 " andn %0, %4, %0\n" 341 " andn %0, %4, %0\n"
342 " or %0, %3, %0\n" 342 " or %0, %5, %0\n"
343 " .previous\n" 343 " .previous\n"
344 : "=r" (val) 344 : "=r" (val)
345 : "0" (val), "i" (_PAGE_CP_4U | _PAGE_CV_4U), "i" (_PAGE_E_4U), 345 : "0" (val), "i" (_PAGE_CP_4U | _PAGE_CV_4U), "i" (_PAGE_E_4U),
diff --git a/include/asm-sparc64/sfp-machine.h b/include/asm-sparc64/sfp-machine.h
index 5015bb8d6c32..89d42431efb5 100644
--- a/include/asm-sparc64/sfp-machine.h
+++ b/include/asm-sparc64/sfp-machine.h
@@ -34,7 +34,7 @@
34#define _FP_MUL_MEAT_D(R,X,Y) \ 34#define _FP_MUL_MEAT_D(R,X,Y) \
35 _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm) 35 _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
36#define _FP_MUL_MEAT_Q(R,X,Y) \ 36#define _FP_MUL_MEAT_Q(R,X,Y) \
37 _FP_MUL_MEAT_2_wide_3mul(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm) 37 _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
38 38
39#define _FP_DIV_MEAT_S(R,X,Y) _FP_DIV_MEAT_1_imm(S,R,X,Y,_FP_DIV_HELP_imm) 39#define _FP_DIV_MEAT_S(R,X,Y) _FP_DIV_MEAT_1_imm(S,R,X,Y,_FP_DIV_HELP_imm)
40#define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_1_udiv_norm(D,R,X,Y) 40#define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_1_udiv_norm(D,R,X,Y)
diff --git a/include/asm-sparc64/system.h b/include/asm-sparc64/system.h
index 4ca68600c670..a8b7432c9a70 100644
--- a/include/asm-sparc64/system.h
+++ b/include/asm-sparc64/system.h
@@ -123,8 +123,6 @@ do { __asm__ __volatile__("ba,pt %%xcc, 1f\n\t" \
123#define read_barrier_depends() do { } while(0) 123#define read_barrier_depends() do { } while(0)
124#define set_mb(__var, __value) \ 124#define set_mb(__var, __value) \
125 do { __var = __value; membar_storeload_storestore(); } while(0) 125 do { __var = __value; membar_storeload_storestore(); } while(0)
126#define set_wmb(__var, __value) \
127 do { __var = __value; wmb(); } while(0)
128 126
129#ifdef CONFIG_SMP 127#ifdef CONFIG_SMP
130#define smp_mb() mb() 128#define smp_mb() mb()
diff --git a/include/asm-v850/processor.h b/include/asm-v850/processor.h
index 6965b66ccaed..979e3467f9af 100644
--- a/include/asm-v850/processor.h
+++ b/include/asm-v850/processor.h
@@ -18,6 +18,7 @@
18#include <linux/thread_info.h> 18#include <linux/thread_info.h>
19#endif 19#endif
20 20
21#include <linux/compiler.h>
21#include <asm/ptrace.h> 22#include <asm/ptrace.h>
22#include <asm/entry.h> 23#include <asm/entry.h>
23 24
@@ -106,7 +107,7 @@ unsigned long get_wchan (struct task_struct *p);
106#define KSTK_ESP(task) task_sp (task) 107#define KSTK_ESP(task) task_sp (task)
107 108
108 109
109#define cpu_relax() ((void)0) 110#define cpu_relax() barrier()
110 111
111 112
112#else /* __ASSEMBLY__ */ 113#else /* __ASSEMBLY__ */
diff --git a/include/asm-v850/system.h b/include/asm-v850/system.h
index 7091af4b7866..da39916f10b0 100644
--- a/include/asm-v850/system.h
+++ b/include/asm-v850/system.h
@@ -68,7 +68,6 @@ static inline int irqs_disabled (void)
68#define read_barrier_depends() ((void)0) 68#define read_barrier_depends() ((void)0)
69#define set_rmb(var, value) do { xchg (&var, value); } while (0) 69#define set_rmb(var, value) do { xchg (&var, value); } while (0)
70#define set_mb(var, value) set_rmb (var, value) 70#define set_mb(var, value) set_rmb (var, value)
71#define set_wmb(var, value) do { var = value; wmb (); } while (0)
72 71
73#define smp_mb() mb () 72#define smp_mb() mb ()
74#define smp_rmb() rmb () 73#define smp_rmb() rmb ()
diff --git a/include/asm-x86_64/alternative.h b/include/asm-x86_64/alternative.h
index aa67bfd1b3ce..a584826cc570 100644
--- a/include/asm-x86_64/alternative.h
+++ b/include/asm-x86_64/alternative.h
@@ -4,6 +4,7 @@
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#include <linux/types.h> 6#include <linux/types.h>
7#include <asm/cpufeature.h>
7 8
8struct alt_instr { 9struct alt_instr {
9 u8 *instr; /* original instruction */ 10 u8 *instr; /* original instruction */
@@ -102,9 +103,6 @@ static inline void alternatives_smp_switch(int smp) {}
102/* 103/*
103 * Alternative inline assembly for SMP. 104 * Alternative inline assembly for SMP.
104 * 105 *
105 * alternative_smp() takes two versions (SMP first, UP second) and is
106 * for more complex stuff such as spinlocks.
107 *
108 * The LOCK_PREFIX macro defined here replaces the LOCK and 106 * The LOCK_PREFIX macro defined here replaces the LOCK and
109 * LOCK_PREFIX macros used everywhere in the source tree. 107 * LOCK_PREFIX macros used everywhere in the source tree.
110 * 108 *
@@ -124,21 +122,6 @@ static inline void alternatives_smp_switch(int smp) {}
124 */ 122 */
125 123
126#ifdef CONFIG_SMP 124#ifdef CONFIG_SMP
127#define alternative_smp(smpinstr, upinstr, args...) \
128 asm volatile ("661:\n\t" smpinstr "\n662:\n" \
129 ".section .smp_altinstructions,\"a\"\n" \
130 " .align 8\n" \
131 " .quad 661b\n" /* label */ \
132 " .quad 663f\n" /* new instruction */ \
133 " .byte 0x66\n" /* X86_FEATURE_UP */ \
134 " .byte 662b-661b\n" /* sourcelen */ \
135 " .byte 664f-663f\n" /* replacementlen */ \
136 ".previous\n" \
137 ".section .smp_altinstr_replacement,\"awx\"\n" \
138 "663:\n\t" upinstr "\n" /* replacement */ \
139 "664:\n\t.fill 662b-661b,1,0x42\n" /* space for original */ \
140 ".previous" : args)
141
142#define LOCK_PREFIX \ 125#define LOCK_PREFIX \
143 ".section .smp_locks,\"a\"\n" \ 126 ".section .smp_locks,\"a\"\n" \
144 " .align 8\n" \ 127 " .align 8\n" \
@@ -147,8 +130,6 @@ static inline void alternatives_smp_switch(int smp) {}
147 "661:\n\tlock; " 130 "661:\n\tlock; "
148 131
149#else /* ! CONFIG_SMP */ 132#else /* ! CONFIG_SMP */
150#define alternative_smp(smpinstr, upinstr, args...) \
151 asm volatile (upinstr : args)
152#define LOCK_PREFIX "" 133#define LOCK_PREFIX ""
153#endif 134#endif
154 135
diff --git a/include/asm-x86_64/calgary.h b/include/asm-x86_64/calgary.h
index 6e1654f30986..4e3919524240 100644
--- a/include/asm-x86_64/calgary.h
+++ b/include/asm-x86_64/calgary.h
@@ -1,8 +1,10 @@
1/* 1/*
2 * Derived from include/asm-powerpc/iommu.h 2 * Derived from include/asm-powerpc/iommu.h
3 * 3 *
4 * Copyright (C) 2006 Jon Mason <jdmason@us.ibm.com>, IBM Corporation 4 * Copyright (C) IBM Corporation, 2006
5 * Copyright (C) 2006 Muli Ben-Yehuda <muli@il.ibm.com>, IBM Corporation 5 *
6 * Author: Jon Mason <jdmason@us.ibm.com>
7 * Author: Muli Ben-Yehuda <muli@il.ibm.com>
6 * 8 *
7 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 10 * it under the terms of the GNU General Public License as published by
@@ -58,9 +60,4 @@ static inline int calgary_iommu_init(void) { return 1; }
58static inline void detect_calgary(void) { return; } 60static inline void detect_calgary(void) { return; }
59#endif 61#endif
60 62
61static inline unsigned int bus_to_phb(unsigned char busno)
62{
63 return ((busno % 15 == 0) ? 0 : busno / 2 + 1);
64}
65
66#endif /* _ASM_X86_64_CALGARY_H */ 63#endif /* _ASM_X86_64_CALGARY_H */
diff --git a/include/asm-x86_64/elf.h b/include/asm-x86_64/elf.h
index b4f8f4a41a6e..a406fcb1e924 100644
--- a/include/asm-x86_64/elf.h
+++ b/include/asm-x86_64/elf.h
@@ -7,8 +7,6 @@
7 7
8#include <asm/ptrace.h> 8#include <asm/ptrace.h>
9#include <asm/user.h> 9#include <asm/user.h>
10#include <asm/processor.h>
11#include <asm/compat.h>
12 10
13/* x86-64 relocation types */ 11/* x86-64 relocation types */
14#define R_X86_64_NONE 0 /* No reloc */ 12#define R_X86_64_NONE 0 /* No reloc */
@@ -39,18 +37,23 @@ typedef elf_greg_t elf_gregset_t[ELF_NGREG];
39typedef struct user_i387_struct elf_fpregset_t; 37typedef struct user_i387_struct elf_fpregset_t;
40 38
41/* 39/*
42 * This is used to ensure we don't load something for the wrong architecture.
43 */
44#define elf_check_arch(x) \
45 ((x)->e_machine == EM_X86_64)
46
47/*
48 * These are used to set parameters in the core dumps. 40 * These are used to set parameters in the core dumps.
49 */ 41 */
50#define ELF_CLASS ELFCLASS64 42#define ELF_CLASS ELFCLASS64
51#define ELF_DATA ELFDATA2LSB 43#define ELF_DATA ELFDATA2LSB
52#define ELF_ARCH EM_X86_64 44#define ELF_ARCH EM_X86_64
53 45
46#ifdef __KERNEL__
47#include <asm/processor.h>
48#include <asm/compat.h>
49
50/*
51 * This is used to ensure we don't load something for the wrong architecture.
52 */
53#define elf_check_arch(x) \
54 ((x)->e_machine == EM_X86_64)
55
56
54/* SVR4/i386 ABI (pages 3-31, 3-32) says that when the program starts %edx 57/* SVR4/i386 ABI (pages 3-31, 3-32) says that when the program starts %edx
55 contains a pointer to a function which might be registered using `atexit'. 58 contains a pointer to a function which might be registered using `atexit'.
56 This provides a mean for the dynamic linker to call DT_FINI functions for 59 This provides a mean for the dynamic linker to call DT_FINI functions for
@@ -141,7 +144,6 @@ typedef struct user_i387_struct elf_fpregset_t;
141/* I'm not sure if we can use '-' here */ 144/* I'm not sure if we can use '-' here */
142#define ELF_PLATFORM ("x86_64") 145#define ELF_PLATFORM ("x86_64")
143 146
144#ifdef __KERNEL__
145extern void set_personality_64bit(void); 147extern void set_personality_64bit(void);
146#define SET_PERSONALITY(ex, ibcs2) set_personality_64bit() 148#define SET_PERSONALITY(ex, ibcs2) set_personality_64bit()
147/* 149/*
diff --git a/include/asm-x86_64/kprobes.h b/include/asm-x86_64/kprobes.h
index d36febd9bb18..cf5317898fb0 100644
--- a/include/asm-x86_64/kprobes.h
+++ b/include/asm-x86_64/kprobes.h
@@ -47,6 +47,7 @@ typedef u8 kprobe_opcode_t;
47 47
48void kretprobe_trampoline(void); 48void kretprobe_trampoline(void);
49extern void arch_remove_kprobe(struct kprobe *p); 49extern void arch_remove_kprobe(struct kprobe *p);
50#define flush_insn_slot(p) do { } while (0)
50 51
51/* Architecture specific copy of original instruction*/ 52/* Architecture specific copy of original instruction*/
52struct arch_specific_insn { 53struct arch_specific_insn {
diff --git a/include/asm-x86_64/page.h b/include/asm-x86_64/page.h
index f7bf875aae40..10f346165cab 100644
--- a/include/asm-x86_64/page.h
+++ b/include/asm-x86_64/page.h
@@ -19,7 +19,7 @@
19#define EXCEPTION_STACK_ORDER 0 19#define EXCEPTION_STACK_ORDER 0
20#define EXCEPTION_STKSZ (PAGE_SIZE << EXCEPTION_STACK_ORDER) 20#define EXCEPTION_STKSZ (PAGE_SIZE << EXCEPTION_STACK_ORDER)
21 21
22#define DEBUG_STACK_ORDER EXCEPTION_STACK_ORDER 22#define DEBUG_STACK_ORDER (EXCEPTION_STACK_ORDER + 1)
23#define DEBUG_STKSZ (PAGE_SIZE << DEBUG_STACK_ORDER) 23#define DEBUG_STKSZ (PAGE_SIZE << DEBUG_STACK_ORDER)
24 24
25#define IRQSTACK_ORDER 2 25#define IRQSTACK_ORDER 2
diff --git a/include/asm-x86_64/processor.h b/include/asm-x86_64/processor.h
index 3b3c1217fe61..de9c3147ee4c 100644
--- a/include/asm-x86_64/processor.h
+++ b/include/asm-x86_64/processor.h
@@ -232,8 +232,14 @@ struct tss_struct {
232 unsigned long io_bitmap[IO_BITMAP_LONGS + 1]; 232 unsigned long io_bitmap[IO_BITMAP_LONGS + 1];
233} __attribute__((packed)) ____cacheline_aligned; 233} __attribute__((packed)) ____cacheline_aligned;
234 234
235
235extern struct cpuinfo_x86 boot_cpu_data; 236extern struct cpuinfo_x86 boot_cpu_data;
236DECLARE_PER_CPU(struct tss_struct,init_tss); 237DECLARE_PER_CPU(struct tss_struct,init_tss);
238/* Save the original ist values for checking stack pointers during debugging */
239struct orig_ist {
240 unsigned long ist[7];
241};
242DECLARE_PER_CPU(struct orig_ist, orig_ist);
237 243
238#ifdef CONFIG_X86_VSMP 244#ifdef CONFIG_X86_VSMP
239#define ARCH_MIN_TASKALIGN (1 << INTERNODE_CACHE_SHIFT) 245#define ARCH_MIN_TASKALIGN (1 << INTERNODE_CACHE_SHIFT)
diff --git a/include/asm-x86_64/signal.h b/include/asm-x86_64/signal.h
index cef7a7d51b7e..3ede2a61973a 100644
--- a/include/asm-x86_64/signal.h
+++ b/include/asm-x86_64/signal.h
@@ -3,13 +3,13 @@
3 3
4#ifndef __ASSEMBLY__ 4#ifndef __ASSEMBLY__
5#include <linux/types.h> 5#include <linux/types.h>
6#include <linux/linkage.h>
7#include <linux/time.h> 6#include <linux/time.h>
8 7
9/* Avoid too many header ordering problems. */ 8/* Avoid too many header ordering problems. */
10struct siginfo; 9struct siginfo;
11 10
12#ifdef __KERNEL__ 11#ifdef __KERNEL__
12#include <linux/linkage.h>
13/* Most things should be clean enough to redefine this at will, if care 13/* Most things should be clean enough to redefine this at will, if care
14 is taken to make libc match. */ 14 is taken to make libc match. */
15 15
diff --git a/include/asm-x86_64/spinlock.h b/include/asm-x86_64/spinlock.h
index 8d3421996f94..248a79f0eaff 100644
--- a/include/asm-x86_64/spinlock.h
+++ b/include/asm-x86_64/spinlock.h
@@ -21,7 +21,7 @@
21 21
22#define __raw_spin_lock_string \ 22#define __raw_spin_lock_string \
23 "\n1:\t" \ 23 "\n1:\t" \
24 "lock ; decl %0\n\t" \ 24 LOCK_PREFIX " ; decl %0\n\t" \
25 "js 2f\n" \ 25 "js 2f\n" \
26 LOCK_SECTION_START("") \ 26 LOCK_SECTION_START("") \
27 "2:\t" \ 27 "2:\t" \
@@ -40,10 +40,7 @@
40 40
41static inline void __raw_spin_lock(raw_spinlock_t *lock) 41static inline void __raw_spin_lock(raw_spinlock_t *lock)
42{ 42{
43 alternative_smp( 43 asm volatile(__raw_spin_lock_string : "=m" (lock->slock) : : "memory");
44 __raw_spin_lock_string,
45 __raw_spin_lock_string_up,
46 "=m" (lock->slock) : : "memory");
47} 44}
48 45
49#define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock) 46#define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock)
@@ -125,12 +122,12 @@ static inline int __raw_write_trylock(raw_rwlock_t *lock)
125 122
126static inline void __raw_read_unlock(raw_rwlock_t *rw) 123static inline void __raw_read_unlock(raw_rwlock_t *rw)
127{ 124{
128 asm volatile("lock ; incl %0" :"=m" (rw->lock) : : "memory"); 125 asm volatile(LOCK_PREFIX " ; incl %0" :"=m" (rw->lock) : : "memory");
129} 126}
130 127
131static inline void __raw_write_unlock(raw_rwlock_t *rw) 128static inline void __raw_write_unlock(raw_rwlock_t *rw)
132{ 129{
133 asm volatile("lock ; addl $" RW_LOCK_BIAS_STR ",%0" 130 asm volatile(LOCK_PREFIX " ; addl $" RW_LOCK_BIAS_STR ",%0"
134 : "=m" (rw->lock) : : "memory"); 131 : "=m" (rw->lock) : : "memory");
135} 132}
136 133
diff --git a/include/asm-x86_64/swiotlb.h b/include/asm-x86_64/swiotlb.h
index 5f9a01805821..ba94ab3d2673 100644
--- a/include/asm-x86_64/swiotlb.h
+++ b/include/asm-x86_64/swiotlb.h
@@ -42,6 +42,8 @@ extern void swiotlb_free_coherent (struct device *hwdev, size_t size,
42extern int swiotlb_dma_supported(struct device *hwdev, u64 mask); 42extern int swiotlb_dma_supported(struct device *hwdev, u64 mask);
43extern void swiotlb_init(void); 43extern void swiotlb_init(void);
44 44
45extern int swiotlb_force;
46
45#ifdef CONFIG_SWIOTLB 47#ifdef CONFIG_SWIOTLB
46extern int swiotlb; 48extern int swiotlb;
47#else 49#else
diff --git a/include/asm-x86_64/system.h b/include/asm-x86_64/system.h
index f67f2873a922..6bf170bceae1 100644
--- a/include/asm-x86_64/system.h
+++ b/include/asm-x86_64/system.h
@@ -240,7 +240,6 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
240#endif 240#endif
241#define read_barrier_depends() do {} while(0) 241#define read_barrier_depends() do {} while(0)
242#define set_mb(var, value) do { (void) xchg(&var, value); } while (0) 242#define set_mb(var, value) do { (void) xchg(&var, value); } while (0)
243#define set_wmb(var, value) do { var = value; wmb(); } while (0)
244 243
245#define warn_if_not_ulong(x) do { unsigned long foo; (void) (&(x) == &foo); } while (0) 244#define warn_if_not_ulong(x) do { unsigned long foo; (void) (&(x) == &foo); } while (0)
246 245
diff --git a/include/asm-x86_64/tce.h b/include/asm-x86_64/tce.h
index ee51d31528d6..53e9a68b3336 100644
--- a/include/asm-x86_64/tce.h
+++ b/include/asm-x86_64/tce.h
@@ -1,9 +1,11 @@
1/* 1/*
2 * Copyright (C) 2006 Muli Ben-Yehuda <muli@il.ibm.com>, IBM Corporation
3 * Copyright (C) 2006 Jon Mason <jdmason@us.ibm.com>, IBM Corporation
4 *
5 * This file is derived from asm-powerpc/tce.h. 2 * This file is derived from asm-powerpc/tce.h.
6 * 3 *
4 * Copyright (C) IBM Corporation, 2006
5 *
6 * Author: Muli Ben-Yehuda <muli@il.ibm.com>
7 * Author: Jon Mason <jdmason@us.ibm.com>
8 *
7 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 10 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or 11 * the Free Software Foundation; either version 2 of the License, or
diff --git a/include/asm-x86_64/unistd.h b/include/asm-x86_64/unistd.h
index 94387c915e53..80fd48e84bbb 100644
--- a/include/asm-x86_64/unistd.h
+++ b/include/asm-x86_64/unistd.h
@@ -821,8 +821,6 @@ asmlinkage long sys_fork(struct pt_regs regs);
821asmlinkage long sys_vfork(struct pt_regs regs); 821asmlinkage long sys_vfork(struct pt_regs regs);
822asmlinkage long sys_pipe(int *fildes); 822asmlinkage long sys_pipe(int *fildes);
823 823
824#endif /* __KERNEL_SYSCALLS__ */
825
826#ifndef __ASSEMBLY__ 824#ifndef __ASSEMBLY__
827 825
828#include <linux/linkage.h> 826#include <linux/linkage.h>
@@ -838,9 +836,9 @@ asmlinkage long sys_rt_sigaction(int sig,
838 struct sigaction __user *oact, 836 struct sigaction __user *oact,
839 size_t sigsetsize); 837 size_t sigsetsize);
840 838
841#endif /* __ASSEMBLY__ */ 839#endif /* __ASSEMBLY__ */
842 840
843#endif /* __NO_STUBS */ 841#endif /* __KERNEL_SYSCALLS__ */
844 842
845/* 843/*
846 * "Conditional" syscalls 844 * "Conditional" syscalls
@@ -850,5 +848,8 @@ asmlinkage long sys_rt_sigaction(int sig,
850 */ 848 */
851#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") 849#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
852 850
851#endif /* __NO_STUBS */
852
853#endif /* __KERNEL__ */ 853#endif /* __KERNEL__ */
854#endif 854
855#endif /* _ASM_X86_64_UNISTD_H_ */
diff --git a/include/asm-x86_64/unwind.h b/include/asm-x86_64/unwind.h
index f3e7124effe3..1f6e9bfb569e 100644
--- a/include/asm-x86_64/unwind.h
+++ b/include/asm-x86_64/unwind.h
@@ -95,6 +95,7 @@ static inline int arch_unw_user_mode(const struct unwind_frame_info *info)
95#else 95#else
96 96
97#define UNW_PC(frame) ((void)(frame), 0) 97#define UNW_PC(frame) ((void)(frame), 0)
98#define UNW_SP(frame) ((void)(frame), 0)
98 99
99static inline int arch_unw_user_mode(const void *info) 100static inline int arch_unw_user_mode(const void *info)
100{ 101{
diff --git a/include/asm-x86_64/vsyscall.h b/include/asm-x86_64/vsyscall.h
index a85e16f56d73..146b24402a5f 100644
--- a/include/asm-x86_64/vsyscall.h
+++ b/include/asm-x86_64/vsyscall.h
@@ -1,8 +1,6 @@
1#ifndef _ASM_X86_64_VSYSCALL_H_ 1#ifndef _ASM_X86_64_VSYSCALL_H_
2#define _ASM_X86_64_VSYSCALL_H_ 2#define _ASM_X86_64_VSYSCALL_H_
3 3
4#include <linux/seqlock.h>
5
6enum vsyscall_num { 4enum vsyscall_num {
7 __NR_vgettimeofday, 5 __NR_vgettimeofday,
8 __NR_vtime, 6 __NR_vtime,
@@ -14,6 +12,7 @@ enum vsyscall_num {
14#define VSYSCALL_ADDR(vsyscall_nr) (VSYSCALL_START+VSYSCALL_SIZE*(vsyscall_nr)) 12#define VSYSCALL_ADDR(vsyscall_nr) (VSYSCALL_START+VSYSCALL_SIZE*(vsyscall_nr))
15 13
16#ifdef __KERNEL__ 14#ifdef __KERNEL__
15#include <linux/seqlock.h>
17 16
18#define __section_vxtime __attribute__ ((unused, __section__ (".vxtime"), aligned(16))) 17#define __section_vxtime __attribute__ ((unused, __section__ (".vxtime"), aligned(16)))
19#define __section_wall_jiffies __attribute__ ((unused, __section__ (".wall_jiffies"), aligned(16))) 18#define __section_wall_jiffies __attribute__ ((unused, __section__ (".wall_jiffies"), aligned(16)))
diff --git a/include/asm-xtensa/processor.h b/include/asm-xtensa/processor.h
index d1d72ad36f08..8b96e77c9d82 100644
--- a/include/asm-xtensa/processor.h
+++ b/include/asm-xtensa/processor.h
@@ -20,6 +20,7 @@
20#include <xtensa/config/tie.h> 20#include <xtensa/config/tie.h>
21#include <xtensa/config/system.h> 21#include <xtensa/config/system.h>
22 22
23#include <linux/compiler.h>
23#include <asm/ptrace.h> 24#include <asm/ptrace.h>
24#include <asm/types.h> 25#include <asm/types.h>
25#include <asm/coprocessor.h> 26#include <asm/coprocessor.h>
@@ -191,7 +192,7 @@ extern unsigned long get_wchan(struct task_struct *p);
191#define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc) 192#define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc)
192#define KSTK_ESP(tsk) (task_pt_regs(tsk)->areg[1]) 193#define KSTK_ESP(tsk) (task_pt_regs(tsk)->areg[1])
193 194
194#define cpu_relax() do { } while (0) 195#define cpu_relax() barrier()
195 196
196/* Special register access. */ 197/* Special register access. */
197 198
diff --git a/include/asm-xtensa/system.h b/include/asm-xtensa/system.h
index f986170bd2a1..932bda92a21c 100644
--- a/include/asm-xtensa/system.h
+++ b/include/asm-xtensa/system.h
@@ -99,7 +99,6 @@ static inline void disable_coprocessor(int i)
99#endif 99#endif
100 100
101#define set_mb(var, value) do { var = value; mb(); } while (0) 101#define set_mb(var, value) do { var = value; mb(); } while (0)
102#define set_wmb(var, value) do { var = value; wmb(); } while (0)
103 102
104#if !defined (__ASSEMBLY__) 103#if !defined (__ASSEMBLY__)
105 104
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
index 41788a31c438..2096e5c72827 100644
--- a/include/linux/atmdev.h
+++ b/include/linux/atmdev.h
@@ -7,7 +7,6 @@
7#define LINUX_ATMDEV_H 7#define LINUX_ATMDEV_H
8 8
9 9
10#include <linux/device.h>
11#include <linux/atmapi.h> 10#include <linux/atmapi.h>
12#include <linux/atm.h> 11#include <linux/atm.h>
13#include <linux/atmioc.h> 12#include <linux/atmioc.h>
@@ -210,6 +209,7 @@ struct atm_cirange {
210 209
211#ifdef __KERNEL__ 210#ifdef __KERNEL__
212 211
212#include <linux/device.h>
213#include <linux/wait.h> /* wait_queue_head_t */ 213#include <linux/wait.h> /* wait_queue_head_t */
214#include <linux/time.h> /* struct timeval */ 214#include <linux/time.h> /* struct timeval */
215#include <linux/net.h> 215#include <linux/net.h>
diff --git a/include/linux/audit.h b/include/linux/audit.h
index b27d7debc5a1..40a6c26294ae 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -132,6 +132,10 @@
132#define AUDIT_CLASS_DIR_WRITE_32 1 132#define AUDIT_CLASS_DIR_WRITE_32 1
133#define AUDIT_CLASS_CHATTR 2 133#define AUDIT_CLASS_CHATTR 2
134#define AUDIT_CLASS_CHATTR_32 3 134#define AUDIT_CLASS_CHATTR_32 3
135#define AUDIT_CLASS_READ 4
136#define AUDIT_CLASS_READ_32 5
137#define AUDIT_CLASS_WRITE 6
138#define AUDIT_CLASS_WRITE_32 7
135 139
136/* This bitmask is used to validate user input. It represents all bits that 140/* This bitmask is used to validate user input. It represents all bits that
137 * are currently used in an audit field constant understood by the kernel. 141 * are currently used in an audit field constant understood by the kernel.
@@ -177,6 +181,7 @@
177#define AUDIT_EXIT 103 181#define AUDIT_EXIT 103
178#define AUDIT_SUCCESS 104 /* exit >= 0; value ignored */ 182#define AUDIT_SUCCESS 104 /* exit >= 0; value ignored */
179#define AUDIT_WATCH 105 183#define AUDIT_WATCH 105
184#define AUDIT_PERM 106
180 185
181#define AUDIT_ARG0 200 186#define AUDIT_ARG0 200
182#define AUDIT_ARG1 (AUDIT_ARG0+1) 187#define AUDIT_ARG1 (AUDIT_ARG0+1)
@@ -252,6 +257,11 @@
252#define AUDIT_ARCH_V850 (EM_V850|__AUDIT_ARCH_LE) 257#define AUDIT_ARCH_V850 (EM_V850|__AUDIT_ARCH_LE)
253#define AUDIT_ARCH_X86_64 (EM_X86_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) 258#define AUDIT_ARCH_X86_64 (EM_X86_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
254 259
260#define AUDIT_PERM_EXEC 1
261#define AUDIT_PERM_WRITE 2
262#define AUDIT_PERM_READ 4
263#define AUDIT_PERM_ATTR 8
264
255struct audit_status { 265struct audit_status {
256 __u32 mask; /* Bit mask for valid entries */ 266 __u32 mask; /* Bit mask for valid entries */
257 __u32 enabled; /* 1 = enabled, 0 = disabled */ 267 __u32 enabled; /* 1 = enabled, 0 = disabled */
@@ -314,6 +324,7 @@ struct mqstat;
314#define AUDITSC_FAILURE 2 324#define AUDITSC_FAILURE 2
315#define AUDITSC_RESULT(x) ( ((long)(x))<0?AUDITSC_FAILURE:AUDITSC_SUCCESS ) 325#define AUDITSC_RESULT(x) ( ((long)(x))<0?AUDITSC_FAILURE:AUDITSC_SUCCESS )
316extern int __init audit_register_class(int class, unsigned *list); 326extern int __init audit_register_class(int class, unsigned *list);
327extern int audit_classify_syscall(int abi, unsigned syscall);
317#ifdef CONFIG_AUDITSYSCALL 328#ifdef CONFIG_AUDITSYSCALL
318/* These are defined in auditsc.c */ 329/* These are defined in auditsc.c */
319 /* Public API */ 330 /* Public API */
@@ -327,21 +338,31 @@ extern void __audit_getname(const char *name);
327extern void audit_putname(const char *name); 338extern void audit_putname(const char *name);
328extern void __audit_inode(const char *name, const struct inode *inode); 339extern void __audit_inode(const char *name, const struct inode *inode);
329extern void __audit_inode_child(const char *dname, const struct inode *inode, 340extern void __audit_inode_child(const char *dname, const struct inode *inode,
330 unsigned long pino); 341 const struct inode *parent);
342extern void __audit_inode_update(const struct inode *inode);
343static inline int audit_dummy_context(void)
344{
345 void *p = current->audit_context;
346 return !p || *(int *)p;
347}
331static inline void audit_getname(const char *name) 348static inline void audit_getname(const char *name)
332{ 349{
333 if (unlikely(current->audit_context)) 350 if (unlikely(!audit_dummy_context()))
334 __audit_getname(name); 351 __audit_getname(name);
335} 352}
336static inline void audit_inode(const char *name, const struct inode *inode) { 353static inline void audit_inode(const char *name, const struct inode *inode) {
337 if (unlikely(current->audit_context)) 354 if (unlikely(!audit_dummy_context()))
338 __audit_inode(name, inode); 355 __audit_inode(name, inode);
339} 356}
340static inline void audit_inode_child(const char *dname, 357static inline void audit_inode_child(const char *dname,
341 const struct inode *inode, 358 const struct inode *inode,
342 unsigned long pino) { 359 const struct inode *parent) {
343 if (unlikely(current->audit_context)) 360 if (unlikely(!audit_dummy_context()))
344 __audit_inode_child(dname, inode, pino); 361 __audit_inode_child(dname, inode, parent);
362}
363static inline void audit_inode_update(const struct inode *inode) {
364 if (unlikely(!audit_dummy_context()))
365 __audit_inode_update(inode);
345} 366}
346 367
347 /* Private API (for audit.c only) */ 368 /* Private API (for audit.c only) */
@@ -365,57 +386,61 @@ extern int __audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat);
365 386
366static inline int audit_ipc_obj(struct kern_ipc_perm *ipcp) 387static inline int audit_ipc_obj(struct kern_ipc_perm *ipcp)
367{ 388{
368 if (unlikely(current->audit_context)) 389 if (unlikely(!audit_dummy_context()))
369 return __audit_ipc_obj(ipcp); 390 return __audit_ipc_obj(ipcp);
370 return 0; 391 return 0;
371} 392}
372static inline int audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode) 393static inline int audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode)
373{ 394{
374 if (unlikely(current->audit_context)) 395 if (unlikely(!audit_dummy_context()))
375 return __audit_ipc_set_perm(qbytes, uid, gid, mode); 396 return __audit_ipc_set_perm(qbytes, uid, gid, mode);
376 return 0; 397 return 0;
377} 398}
378static inline int audit_mq_open(int oflag, mode_t mode, struct mq_attr __user *u_attr) 399static inline int audit_mq_open(int oflag, mode_t mode, struct mq_attr __user *u_attr)
379{ 400{
380 if (unlikely(current->audit_context)) 401 if (unlikely(!audit_dummy_context()))
381 return __audit_mq_open(oflag, mode, u_attr); 402 return __audit_mq_open(oflag, mode, u_attr);
382 return 0; 403 return 0;
383} 404}
384static inline int audit_mq_timedsend(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec __user *u_abs_timeout) 405static inline int audit_mq_timedsend(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec __user *u_abs_timeout)
385{ 406{
386 if (unlikely(current->audit_context)) 407 if (unlikely(!audit_dummy_context()))
387 return __audit_mq_timedsend(mqdes, msg_len, msg_prio, u_abs_timeout); 408 return __audit_mq_timedsend(mqdes, msg_len, msg_prio, u_abs_timeout);
388 return 0; 409 return 0;
389} 410}
390static inline int audit_mq_timedreceive(mqd_t mqdes, size_t msg_len, unsigned int __user *u_msg_prio, const struct timespec __user *u_abs_timeout) 411static inline int audit_mq_timedreceive(mqd_t mqdes, size_t msg_len, unsigned int __user *u_msg_prio, const struct timespec __user *u_abs_timeout)
391{ 412{
392 if (unlikely(current->audit_context)) 413 if (unlikely(!audit_dummy_context()))
393 return __audit_mq_timedreceive(mqdes, msg_len, u_msg_prio, u_abs_timeout); 414 return __audit_mq_timedreceive(mqdes, msg_len, u_msg_prio, u_abs_timeout);
394 return 0; 415 return 0;
395} 416}
396static inline int audit_mq_notify(mqd_t mqdes, const struct sigevent __user *u_notification) 417static inline int audit_mq_notify(mqd_t mqdes, const struct sigevent __user *u_notification)
397{ 418{
398 if (unlikely(current->audit_context)) 419 if (unlikely(!audit_dummy_context()))
399 return __audit_mq_notify(mqdes, u_notification); 420 return __audit_mq_notify(mqdes, u_notification);
400 return 0; 421 return 0;
401} 422}
402static inline int audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat) 423static inline int audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat)
403{ 424{
404 if (unlikely(current->audit_context)) 425 if (unlikely(!audit_dummy_context()))
405 return __audit_mq_getsetattr(mqdes, mqstat); 426 return __audit_mq_getsetattr(mqdes, mqstat);
406 return 0; 427 return 0;
407} 428}
429extern int audit_n_rules;
408#else 430#else
409#define audit_alloc(t) ({ 0; }) 431#define audit_alloc(t) ({ 0; })
410#define audit_free(t) do { ; } while (0) 432#define audit_free(t) do { ; } while (0)
411#define audit_syscall_entry(ta,a,b,c,d,e) do { ; } while (0) 433#define audit_syscall_entry(ta,a,b,c,d,e) do { ; } while (0)
412#define audit_syscall_exit(f,r) do { ; } while (0) 434#define audit_syscall_exit(f,r) do { ; } while (0)
435#define audit_dummy_context() 1
413#define audit_getname(n) do { ; } while (0) 436#define audit_getname(n) do { ; } while (0)
414#define audit_putname(n) do { ; } while (0) 437#define audit_putname(n) do { ; } while (0)
415#define __audit_inode(n,i) do { ; } while (0) 438#define __audit_inode(n,i) do { ; } while (0)
416#define __audit_inode_child(d,i,p) do { ; } while (0) 439#define __audit_inode_child(d,i,p) do { ; } while (0)
440#define __audit_inode_update(i) do { ; } while (0)
417#define audit_inode(n,i) do { ; } while (0) 441#define audit_inode(n,i) do { ; } while (0)
418#define audit_inode_child(d,i,p) do { ; } while (0) 442#define audit_inode_child(d,i,p) do { ; } while (0)
443#define audit_inode_update(i) do { ; } while (0)
419#define auditsc_get_stamp(c,t,s) do { BUG(); } while (0) 444#define auditsc_get_stamp(c,t,s) do { BUG(); } while (0)
420#define audit_get_loginuid(c) ({ -1; }) 445#define audit_get_loginuid(c) ({ -1; })
421#define audit_ipc_obj(i) ({ 0; }) 446#define audit_ipc_obj(i) ({ 0; })
@@ -430,6 +455,7 @@ static inline int audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat)
430#define audit_mq_timedreceive(d,l,p,t) ({ 0; }) 455#define audit_mq_timedreceive(d,l,p,t) ({ 0; })
431#define audit_mq_notify(d,n) ({ 0; }) 456#define audit_mq_notify(d,n) ({ 0; })
432#define audit_mq_getsetattr(d,s) ({ 0; }) 457#define audit_mq_getsetattr(d,s) ({ 0; })
458#define audit_n_rules 0
433#endif 459#endif
434 460
435#ifdef CONFIG_AUDIT 461#ifdef CONFIG_AUDIT
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
index a7e8cef73d15..7520cc1ff9e2 100644
--- a/include/linux/blktrace_api.h
+++ b/include/linux/blktrace_api.h
@@ -11,7 +11,7 @@ enum blktrace_cat {
11 BLK_TC_READ = 1 << 0, /* reads */ 11 BLK_TC_READ = 1 << 0, /* reads */
12 BLK_TC_WRITE = 1 << 1, /* writes */ 12 BLK_TC_WRITE = 1 << 1, /* writes */
13 BLK_TC_BARRIER = 1 << 2, /* barrier */ 13 BLK_TC_BARRIER = 1 << 2, /* barrier */
14 BLK_TC_SYNC = 1 << 3, /* barrier */ 14 BLK_TC_SYNC = 1 << 3, /* sync IO */
15 BLK_TC_QUEUE = 1 << 4, /* queueing/merging */ 15 BLK_TC_QUEUE = 1 << 4, /* queueing/merging */
16 BLK_TC_REQUEUE = 1 << 5, /* requeueing */ 16 BLK_TC_REQUEUE = 1 << 5, /* requeueing */
17 BLK_TC_ISSUE = 1 << 6, /* issue */ 17 BLK_TC_ISSUE = 1 << 6, /* issue */
@@ -19,6 +19,7 @@ enum blktrace_cat {
19 BLK_TC_FS = 1 << 8, /* fs requests */ 19 BLK_TC_FS = 1 << 8, /* fs requests */
20 BLK_TC_PC = 1 << 9, /* pc requests */ 20 BLK_TC_PC = 1 << 9, /* pc requests */
21 BLK_TC_NOTIFY = 1 << 10, /* special message */ 21 BLK_TC_NOTIFY = 1 << 10, /* special message */
22 BLK_TC_AHEAD = 1 << 11, /* readahead */
22 23
23 BLK_TC_END = 1 << 15, /* only 16-bits, reminder */ 24 BLK_TC_END = 1 << 15, /* only 16-bits, reminder */
24}; 25};
@@ -147,7 +148,7 @@ static inline void blk_add_trace_rq(struct request_queue *q, struct request *rq,
147 u32 what) 148 u32 what)
148{ 149{
149 struct blk_trace *bt = q->blk_trace; 150 struct blk_trace *bt = q->blk_trace;
150 int rw = rq->flags & 0x07; 151 int rw = rq->flags & 0x03;
151 152
152 if (likely(!bt)) 153 if (likely(!bt))
153 return; 154 return;
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
index 22866fa2d960..1021f508d82c 100644
--- a/include/linux/bootmem.h
+++ b/include/linux/bootmem.h
@@ -91,7 +91,7 @@ static inline void *alloc_remap(int nid, unsigned long size)
91} 91}
92#endif 92#endif
93 93
94extern unsigned long nr_kernel_pages; 94extern unsigned long __meminitdata nr_kernel_pages;
95extern unsigned long nr_all_pages; 95extern unsigned long nr_all_pages;
96 96
97extern void *__init alloc_large_system_hash(const char *tablename, 97extern void *__init alloc_large_system_hash(const char *tablename,
diff --git a/include/linux/cn_proc.h b/include/linux/cn_proc.h
index dbb7769009be..1c86d65bc4b9 100644
--- a/include/linux/cn_proc.h
+++ b/include/linux/cn_proc.h
@@ -57,7 +57,8 @@ struct proc_event {
57 PROC_EVENT_EXIT = 0x80000000 57 PROC_EVENT_EXIT = 0x80000000
58 } what; 58 } what;
59 __u32 cpu; 59 __u32 cpu;
60 struct timespec timestamp; 60 __u64 __attribute__((aligned(8))) timestamp_ns;
61 /* Number of nano seconds since system boot */
61 union { /* must be last field of proc_event struct */ 62 union { /* must be last field of proc_event struct */
62 struct { 63 struct {
63 __u32 err; 64 __u32 err;
diff --git a/include/linux/compat_ioctl.h b/include/linux/compat_ioctl.h
index 269d000bb2a3..bea0255196c4 100644
--- a/include/linux/compat_ioctl.h
+++ b/include/linux/compat_ioctl.h
@@ -216,6 +216,7 @@ COMPATIBLE_IOCTL(VT_RESIZE)
216COMPATIBLE_IOCTL(VT_RESIZEX) 216COMPATIBLE_IOCTL(VT_RESIZEX)
217COMPATIBLE_IOCTL(VT_LOCKSWITCH) 217COMPATIBLE_IOCTL(VT_LOCKSWITCH)
218COMPATIBLE_IOCTL(VT_UNLOCKSWITCH) 218COMPATIBLE_IOCTL(VT_UNLOCKSWITCH)
219COMPATIBLE_IOCTL(VT_GETHIFONTMASK)
219/* Little p (/dev/rtc, /dev/envctrl, etc.) */ 220/* Little p (/dev/rtc, /dev/envctrl, etc.) */
220COMPATIBLE_IOCTL(RTC_AIE_ON) 221COMPATIBLE_IOCTL(RTC_AIE_ON)
221COMPATIBLE_IOCTL(RTC_AIE_OFF) 222COMPATIBLE_IOCTL(RTC_AIE_OFF)
diff --git a/include/linux/completion.h b/include/linux/completion.h
index 251c41e3ddd5..268c5a4a2bd4 100644
--- a/include/linux/completion.h
+++ b/include/linux/completion.h
@@ -18,6 +18,9 @@ struct completion {
18#define COMPLETION_INITIALIZER(work) \ 18#define COMPLETION_INITIALIZER(work) \
19 { 0, __WAIT_QUEUE_HEAD_INITIALIZER((work).wait) } 19 { 0, __WAIT_QUEUE_HEAD_INITIALIZER((work).wait) }
20 20
21#define COMPLETION_INITIALIZER_ONSTACK(work) \
22 ({ init_completion(&work); work; })
23
21#define DECLARE_COMPLETION(work) \ 24#define DECLARE_COMPLETION(work) \
22 struct completion work = COMPLETION_INITIALIZER(work) 25 struct completion work = COMPLETION_INITIALIZER(work)
23 26
@@ -28,7 +31,7 @@ struct completion {
28 */ 31 */
29#ifdef CONFIG_LOCKDEP 32#ifdef CONFIG_LOCKDEP
30# define DECLARE_COMPLETION_ONSTACK(work) \ 33# define DECLARE_COMPLETION_ONSTACK(work) \
31 struct completion work = ({ init_completion(&work); work; }) 34 struct completion work = COMPLETION_INITIALIZER_ONSTACK(work)
32#else 35#else
33# define DECLARE_COMPLETION_ONSTACK(work) DECLARE_COMPLETION(work) 36# define DECLARE_COMPLETION_ONSTACK(work) DECLARE_COMPLETION(work)
34#endif 37#endif
diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h
index f8e5587a0f92..25423f79bf9f 100644
--- a/include/linux/console_struct.h
+++ b/include/linux/console_struct.h
@@ -9,6 +9,7 @@
9 * to achieve effects such as fast scrolling by changing the origin. 9 * to achieve effects such as fast scrolling by changing the origin.
10 */ 10 */
11 11
12#include <linux/wait.h>
12#include <linux/vt.h> 13#include <linux/vt.h>
13 14
14struct vt_struct; 15struct vt_struct;
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 44a11f1ccaf2..8fb344a9abd8 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -48,7 +48,6 @@ static inline void unregister_cpu_notifier(struct notifier_block *nb)
48{ 48{
49} 49}
50#endif 50#endif
51extern int current_in_cpu_hotplug(void);
52 51
53int cpu_up(unsigned int cpu); 52int cpu_up(unsigned int cpu);
54 53
@@ -61,10 +60,6 @@ static inline int register_cpu_notifier(struct notifier_block *nb)
61static inline void unregister_cpu_notifier(struct notifier_block *nb) 60static inline void unregister_cpu_notifier(struct notifier_block *nb)
62{ 61{
63} 62}
64static inline int current_in_cpu_hotplug(void)
65{
66 return 0;
67}
68 63
69#endif /* CONFIG_SMP */ 64#endif /* CONFIG_SMP */
70extern struct sysdev_class cpu_sysdev_class; 65extern struct sysdev_class cpu_sysdev_class;
@@ -73,7 +68,6 @@ extern struct sysdev_class cpu_sysdev_class;
73/* Stop CPUs going up and down. */ 68/* Stop CPUs going up and down. */
74extern void lock_cpu_hotplug(void); 69extern void lock_cpu_hotplug(void);
75extern void unlock_cpu_hotplug(void); 70extern void unlock_cpu_hotplug(void);
76extern int lock_cpu_hotplug_interruptible(void);
77#define hotcpu_notifier(fn, pri) { \ 71#define hotcpu_notifier(fn, pri) { \
78 static struct notifier_block fn##_nb = \ 72 static struct notifier_block fn##_nb = \
79 { .notifier_call = fn, .priority = pri }; \ 73 { .notifier_call = fn, .priority = pri }; \
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 35e137636b0b..4ea39fee99c7 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -172,9 +172,6 @@ extern int __cpufreq_driver_target(struct cpufreq_policy *policy,
172 unsigned int relation); 172 unsigned int relation);
173 173
174 174
175/* pass an event to the cpufreq governor */
176int cpufreq_governor(unsigned int cpu, unsigned int event);
177
178int cpufreq_register_governor(struct cpufreq_governor *governor); 175int cpufreq_register_governor(struct cpufreq_governor *governor);
179void cpufreq_unregister_governor(struct cpufreq_governor *governor); 176void cpufreq_unregister_governor(struct cpufreq_governor *governor);
180 177
diff --git a/include/linux/debug_locks.h b/include/linux/debug_locks.h
index 6a7047851e48..88dafa246d87 100644
--- a/include/linux/debug_locks.h
+++ b/include/linux/debug_locks.h
@@ -1,6 +1,8 @@
1#ifndef __LINUX_DEBUG_LOCKING_H 1#ifndef __LINUX_DEBUG_LOCKING_H
2#define __LINUX_DEBUG_LOCKING_H 2#define __LINUX_DEBUG_LOCKING_H
3 3
4struct task_struct;
5
4extern int debug_locks; 6extern int debug_locks;
5extern int debug_locks_silent; 7extern int debug_locks_silent;
6 8
diff --git a/include/linux/delayacct.h b/include/linux/delayacct.h
new file mode 100644
index 000000000000..561e2a77805c
--- /dev/null
+++ b/include/linux/delayacct.h
@@ -0,0 +1,121 @@
1/* delayacct.h - per-task delay accounting
2 *
3 * Copyright (C) Shailabh Nagar, IBM Corp. 2006
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
13 * the GNU General Public License for more details.
14 *
15 */
16
17#ifndef _LINUX_DELAYACCT_H
18#define _LINUX_DELAYACCT_H
19
20#include <linux/sched.h>
21#include <linux/taskstats_kern.h>
22
23/*
24 * Per-task flags relevant to delay accounting
25 * maintained privately to avoid exhausting similar flags in sched.h:PF_*
26 * Used to set current->delays->flags
27 */
28#define DELAYACCT_PF_SWAPIN 0x00000001 /* I am doing a swapin */
29
30#ifdef CONFIG_TASK_DELAY_ACCT
31
32extern int delayacct_on; /* Delay accounting turned on/off */
33extern kmem_cache_t *delayacct_cache;
34extern void delayacct_init(void);
35extern void __delayacct_tsk_init(struct task_struct *);
36extern void __delayacct_tsk_exit(struct task_struct *);
37extern void __delayacct_blkio_start(void);
38extern void __delayacct_blkio_end(void);
39extern int __delayacct_add_tsk(struct taskstats *, struct task_struct *);
40extern __u64 __delayacct_blkio_ticks(struct task_struct *);
41
42static inline void delayacct_set_flag(int flag)
43{
44 if (current->delays)
45 current->delays->flags |= flag;
46}
47
48static inline void delayacct_clear_flag(int flag)
49{
50 if (current->delays)
51 current->delays->flags &= ~flag;
52}
53
54static inline void delayacct_tsk_init(struct task_struct *tsk)
55{
56 /* reinitialize in case parent's non-null pointer was dup'ed*/
57 tsk->delays = NULL;
58 if (delayacct_on)
59 __delayacct_tsk_init(tsk);
60}
61
62/* Free tsk->delays. Called from bad fork and __put_task_struct
63 * where there's no risk of tsk->delays being accessed elsewhere
64 */
65static inline void delayacct_tsk_free(struct task_struct *tsk)
66{
67 if (tsk->delays)
68 kmem_cache_free(delayacct_cache, tsk->delays);
69 tsk->delays = NULL;
70}
71
72static inline void delayacct_blkio_start(void)
73{
74 if (current->delays)
75 __delayacct_blkio_start();
76}
77
78static inline void delayacct_blkio_end(void)
79{
80 if (current->delays)
81 __delayacct_blkio_end();
82}
83
84static inline int delayacct_add_tsk(struct taskstats *d,
85 struct task_struct *tsk)
86{
87 if (!delayacct_on || !tsk->delays)
88 return 0;
89 return __delayacct_add_tsk(d, tsk);
90}
91
92static inline __u64 delayacct_blkio_ticks(struct task_struct *tsk)
93{
94 if (tsk->delays)
95 return __delayacct_blkio_ticks(tsk);
96 return 0;
97}
98
99#else
100static inline void delayacct_set_flag(int flag)
101{}
102static inline void delayacct_clear_flag(int flag)
103{}
104static inline void delayacct_init(void)
105{}
106static inline void delayacct_tsk_init(struct task_struct *tsk)
107{}
108static inline void delayacct_tsk_free(struct task_struct *tsk)
109{}
110static inline void delayacct_blkio_start(void)
111{}
112static inline void delayacct_blkio_end(void)
113{}
114static inline int delayacct_add_tsk(struct taskstats *d,
115 struct task_struct *tsk)
116{ return 0; }
117static inline __u64 delayacct_blkio_ticks(struct task_struct *tsk)
118{ return 0; }
119#endif /* CONFIG_TASK_DELAY_ACCT */
120
121#endif
diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h
index 0cf0bea010fe..9631dddae348 100644
--- a/include/linux/elfcore.h
+++ b/include/linux/elfcore.h
@@ -60,6 +60,16 @@ struct elf_prstatus
60 long pr_instr; /* Current instruction */ 60 long pr_instr; /* Current instruction */
61#endif 61#endif
62 elf_gregset_t pr_reg; /* GP registers */ 62 elf_gregset_t pr_reg; /* GP registers */
63#ifdef CONFIG_BINFMT_ELF_FDPIC
64 /* When using FDPIC, the loadmap addresses need to be communicated
65 * to GDB in order for GDB to do the necessary relocations. The
66 * fields (below) used to communicate this information are placed
67 * immediately after ``pr_reg'', so that the loadmap addresses may
68 * be viewed as part of the register set if so desired.
69 */
70 unsigned long pr_exec_fdpic_loadmap;
71 unsigned long pr_interp_fdpic_loadmap;
72#endif
63 int pr_fpvalid; /* True if math co-processor being used. */ 73 int pr_fpvalid; /* True if math co-processor being used. */
64}; 74};
65 75
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index 5607e6457a65..9f9cce7bd86d 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -492,6 +492,15 @@ static inline struct ext3_inode_info *EXT3_I(struct inode *inode)
492{ 492{
493 return container_of(inode, struct ext3_inode_info, vfs_inode); 493 return container_of(inode, struct ext3_inode_info, vfs_inode);
494} 494}
495
496static inline int ext3_valid_inum(struct super_block *sb, unsigned long ino)
497{
498 return ino == EXT3_ROOT_INO ||
499 ino == EXT3_JOURNAL_INO ||
500 ino == EXT3_RESIZE_INO ||
501 (ino >= EXT3_FIRST_INO(sb) &&
502 ino <= le32_to_cpu(EXT3_SB(sb)->s_es->s_inodes_count));
503}
495#else 504#else
496/* Assume that user mode programs are passing in an ext3fs superblock, not 505/* Assume that user mode programs are passing in an ext3fs superblock, not
497 * a kernel struct super_block. This will allow us to call the feature-test 506 * a kernel struct super_block. This will allow us to call the feature-test
diff --git a/include/linux/fb.h b/include/linux/fb.h
index ffefeeeeca93..2f335e966011 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -1,7 +1,6 @@
1#ifndef _LINUX_FB_H 1#ifndef _LINUX_FB_H
2#define _LINUX_FB_H 2#define _LINUX_FB_H
3 3
4#include <linux/backlight.h>
5#include <asm/types.h> 4#include <asm/types.h>
6 5
7/* Definitions of frame buffers */ 6/* Definitions of frame buffers */
@@ -377,11 +376,11 @@ struct fb_cursor {
377 376
378#include <linux/fs.h> 377#include <linux/fs.h>
379#include <linux/init.h> 378#include <linux/init.h>
380#include <linux/tty.h>
381#include <linux/device.h> 379#include <linux/device.h>
382#include <linux/workqueue.h> 380#include <linux/workqueue.h>
383#include <linux/notifier.h> 381#include <linux/notifier.h>
384#include <linux/list.h> 382#include <linux/list.h>
383#include <linux/backlight.h>
385#include <asm/io.h> 384#include <asm/io.h>
386 385
387struct vm_area_struct; 386struct vm_area_struct;
@@ -525,7 +524,7 @@ struct fb_event {
525 524
526extern int fb_register_client(struct notifier_block *nb); 525extern int fb_register_client(struct notifier_block *nb);
527extern int fb_unregister_client(struct notifier_block *nb); 526extern int fb_unregister_client(struct notifier_block *nb);
528 527extern int fb_notifier_call_chain(unsigned long val, void *v);
529/* 528/*
530 * Pixmap structure definition 529 * Pixmap structure definition
531 * 530 *
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 134b32068246..555bc195c420 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -27,6 +27,10 @@
27#define BLOCK_SIZE_BITS 10 27#define BLOCK_SIZE_BITS 10
28#define BLOCK_SIZE (1<<BLOCK_SIZE_BITS) 28#define BLOCK_SIZE (1<<BLOCK_SIZE_BITS)
29 29
30#define SEEK_SET 0 /* seek relative to beginning of file */
31#define SEEK_CUR 1 /* seek relative to current file position */
32#define SEEK_END 2 /* seek relative to end of file */
33
30/* And dynamically-tunable limits and defaults: */ 34/* And dynamically-tunable limits and defaults: */
31struct files_stat_struct { 35struct files_stat_struct {
32 int nr_files; /* read only */ 36 int nr_files; /* read only */
@@ -566,13 +570,14 @@ struct inode {
566 * 3: quota file 570 * 3: quota file
567 * 571 *
568 * The locking order between these classes is 572 * The locking order between these classes is
569 * parent -> child -> normal -> quota 573 * parent -> child -> normal -> xattr -> quota
570 */ 574 */
571enum inode_i_mutex_lock_class 575enum inode_i_mutex_lock_class
572{ 576{
573 I_MUTEX_NORMAL, 577 I_MUTEX_NORMAL,
574 I_MUTEX_PARENT, 578 I_MUTEX_PARENT,
575 I_MUTEX_CHILD, 579 I_MUTEX_CHILD,
580 I_MUTEX_XATTR,
576 I_MUTEX_QUOTA 581 I_MUTEX_QUOTA
577}; 582};
578 583
@@ -716,6 +721,7 @@ extern spinlock_t files_lock;
716#define FL_POSIX 1 721#define FL_POSIX 1
717#define FL_FLOCK 2 722#define FL_FLOCK 2
718#define FL_ACCESS 8 /* not trying to lock, just looking */ 723#define FL_ACCESS 8 /* not trying to lock, just looking */
724#define FL_EXISTS 16 /* when unlocking, test for existence */
719#define FL_LEASE 32 /* lease held on this file */ 725#define FL_LEASE 32 /* lease held on this file */
720#define FL_CLOSE 64 /* unlock on close */ 726#define FL_CLOSE 64 /* unlock on close */
721#define FL_SLEEP 128 /* A blocking lock */ 727#define FL_SLEEP 128 /* A blocking lock */
diff --git a/include/linux/fs_enet_pd.h b/include/linux/fs_enet_pd.h
index 783c476b8674..74ed35a00a94 100644
--- a/include/linux/fs_enet_pd.h
+++ b/include/linux/fs_enet_pd.h
@@ -69,34 +69,21 @@ enum fs_ioport {
69 fsiop_porte, 69 fsiop_porte,
70}; 70};
71 71
72struct fs_mii_bus_info { 72struct fs_mii_bit {
73 int method; /* mii method */ 73 u32 offset;
74 int id; /* the id of the mii_bus */ 74 u8 bit;
75 int disable_aneg; /* if the controller needs to negothiate speed & duplex */ 75 u8 polarity;
76 int lpa; /* the default board-specific vallues will be applied otherwise */ 76};
77 77struct fs_mii_bb_platform_info {
78 union { 78 struct fs_mii_bit mdio_dir;
79 struct { 79 struct fs_mii_bit mdio_dat;
80 int duplex; 80 struct fs_mii_bit mdc_dat;
81 int speed; 81 int mdio_port; /* port & bit for MDIO */
82 } fixed; 82 int mdio_bit;
83 83 int mdc_port; /* port & bit for MDC */
84 struct { 84 int mdc_bit;
85 /* nothing */ 85 int delay; /* delay in us */
86 } fec; 86 int irq[32]; /* irqs per phy's */
87
88 struct {
89 /* nothing */
90 } scc;
91
92 struct {
93 int mdio_port; /* port & bit for MDIO */
94 int mdio_bit;
95 int mdc_port; /* port & bit for MDC */
96 int mdc_bit;
97 int delay; /* delay in us */
98 } bitbang;
99 } i;
100}; 87};
101 88
102struct fs_platform_info { 89struct fs_platform_info {
@@ -119,6 +106,7 @@ struct fs_platform_info {
119 u32 device_flags; 106 u32 device_flags;
120 107
121 int phy_addr; /* the phy address (-1 no phy) */ 108 int phy_addr; /* the phy address (-1 no phy) */
109 const char* bus_id;
122 int phy_irq; /* the phy irq (if it exists) */ 110 int phy_irq; /* the phy irq (if it exists) */
123 111
124 const struct fs_mii_bus_info *bus_info; 112 const struct fs_mii_bus_info *bus_info;
@@ -130,6 +118,10 @@ struct fs_platform_info {
130 int napi_weight; /* NAPI weight */ 118 int napi_weight; /* NAPI weight */
131 119
132 int use_rmii; /* use RMII mode */ 120 int use_rmii; /* use RMII mode */
121 int has_phy; /* if the network is phy container as well...*/
122};
123struct fs_mii_fec_platform_info {
124 u32 irq[32];
125 u32 mii_speed;
133}; 126};
134
135#endif 127#endif
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h
index cc5dec70c32c..d4f219ffaa5d 100644
--- a/include/linux/fsnotify.h
+++ b/include/linux/fsnotify.h
@@ -67,7 +67,7 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir,
67 if (source) { 67 if (source) {
68 inotify_inode_queue_event(source, IN_MOVE_SELF, 0, NULL, NULL); 68 inotify_inode_queue_event(source, IN_MOVE_SELF, 0, NULL, NULL);
69 } 69 }
70 audit_inode_child(new_name, source, new_dir->i_ino); 70 audit_inode_child(new_name, source, new_dir);
71} 71}
72 72
73/* 73/*
@@ -98,7 +98,7 @@ static inline void fsnotify_create(struct inode *inode, struct dentry *dentry)
98 inode_dir_notify(inode, DN_CREATE); 98 inode_dir_notify(inode, DN_CREATE);
99 inotify_inode_queue_event(inode, IN_CREATE, 0, dentry->d_name.name, 99 inotify_inode_queue_event(inode, IN_CREATE, 0, dentry->d_name.name,
100 dentry->d_inode); 100 dentry->d_inode);
101 audit_inode_child(dentry->d_name.name, dentry->d_inode, inode->i_ino); 101 audit_inode_child(dentry->d_name.name, dentry->d_inode, inode);
102} 102}
103 103
104/* 104/*
@@ -109,7 +109,7 @@ static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry)
109 inode_dir_notify(inode, DN_CREATE); 109 inode_dir_notify(inode, DN_CREATE);
110 inotify_inode_queue_event(inode, IN_CREATE | IN_ISDIR, 0, 110 inotify_inode_queue_event(inode, IN_CREATE | IN_ISDIR, 0,
111 dentry->d_name.name, dentry->d_inode); 111 dentry->d_name.name, dentry->d_inode);
112 audit_inode_child(dentry->d_name.name, dentry->d_inode, inode->i_ino); 112 audit_inode_child(dentry->d_name.name, dentry->d_inode, inode);
113} 113}
114 114
115/* 115/*
diff --git a/include/linux/futex.h b/include/linux/futex.h
index 34c3a215f2cd..d097b5b72bc6 100644
--- a/include/linux/futex.h
+++ b/include/linux/futex.h
@@ -96,7 +96,8 @@ struct robust_list_head {
96long do_futex(u32 __user *uaddr, int op, u32 val, unsigned long timeout, 96long do_futex(u32 __user *uaddr, int op, u32 val, unsigned long timeout,
97 u32 __user *uaddr2, u32 val2, u32 val3); 97 u32 __user *uaddr2, u32 val2, u32 val3);
98 98
99extern int handle_futex_death(u32 __user *uaddr, struct task_struct *curr); 99extern int
100handle_futex_death(u32 __user *uaddr, struct task_struct *curr, int pi);
100 101
101#ifdef CONFIG_FUTEX 102#ifdef CONFIG_FUTEX
102extern void exit_robust_list(struct task_struct *curr); 103extern void exit_robust_list(struct task_struct *curr);
diff --git a/include/linux/hdlc.h b/include/linux/hdlc.h
index 4513f9e40937..d5ebbb29aeae 100644
--- a/include/linux/hdlc.h
+++ b/include/linux/hdlc.h
@@ -224,8 +224,6 @@ static __inline__ void debug_frame(const struct sk_buff *skb)
224int hdlc_open(struct net_device *dev); 224int hdlc_open(struct net_device *dev);
225/* Must be called by hardware driver when HDLC device is being closed */ 225/* Must be called by hardware driver when HDLC device is being closed */
226void hdlc_close(struct net_device *dev); 226void hdlc_close(struct net_device *dev);
227/* Called by hardware driver when DCD line level changes */
228void hdlc_set_carrier(int on, struct net_device *dev);
229 227
230/* May be used by hardware driver to gain control over HDLC device */ 228/* May be used by hardware driver to gain control over HDLC device */
231static __inline__ void hdlc_proto_detach(hdlc_device *hdlc) 229static __inline__ void hdlc_proto_detach(hdlc_device *hdlc)
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index e4bccbcc2750..4fc379de6c2f 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -80,6 +80,7 @@ struct hrtimer_sleeper {
80 * @get_softirq_time: function to retrieve the current time from the softirq 80 * @get_softirq_time: function to retrieve the current time from the softirq
81 * @curr_timer: the timer which is executing a callback right now 81 * @curr_timer: the timer which is executing a callback right now
82 * @softirq_time: the time when running the hrtimer queue in the softirq 82 * @softirq_time: the time when running the hrtimer queue in the softirq
83 * @lock_key: the lock_class_key for use with lockdep
83 */ 84 */
84struct hrtimer_base { 85struct hrtimer_base {
85 clockid_t index; 86 clockid_t index;
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h
index 21338bb3441d..9418519a55d1 100644
--- a/include/linux/i2c-id.h
+++ b/include/linux/i2c-id.h
@@ -115,6 +115,7 @@
115#define I2C_DRIVERID_BT866 85 /* Conexant bt866 video encoder */ 115#define I2C_DRIVERID_BT866 85 /* Conexant bt866 video encoder */
116#define I2C_DRIVERID_KS0127 86 /* Samsung ks0127 video decoder */ 116#define I2C_DRIVERID_KS0127 86 /* Samsung ks0127 video decoder */
117#define I2C_DRIVERID_TLV320AIC23B 87 /* TI TLV320AIC23B audio codec */ 117#define I2C_DRIVERID_TLV320AIC23B 87 /* TI TLV320AIC23B audio codec */
118#define I2C_DRIVERID_ISL1208 88 /* Intersil ISL1208 RTC */
118 119
119#define I2C_DRIVERID_I2CDEV 900 120#define I2C_DRIVERID_I2CDEV 900
120#define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */ 121#define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 526ddc8eecfb..eb0628a7ecc6 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -193,6 +193,8 @@ struct i2c_algorithm {
193 to NULL. If an adapter algorithm can do SMBus access, set 193 to NULL. If an adapter algorithm can do SMBus access, set
194 smbus_xfer. If set to NULL, the SMBus protocol is simulated 194 smbus_xfer. If set to NULL, the SMBus protocol is simulated
195 using common I2C messages */ 195 using common I2C messages */
196 /* master_xfer should return the number of messages successfully
197 processed, or a negative value on error */
196 int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg *msgs, 198 int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg *msgs,
197 int num); 199 int num);
198 int (*smbus_xfer) (struct i2c_adapter *adap, u16 addr, 200 int (*smbus_xfer) (struct i2c_adapter *adap, u16 addr,
diff --git a/include/linux/ide.h b/include/linux/ide.h
index dc7abef10965..99620451d958 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -571,6 +571,7 @@ typedef struct ide_drive_s {
571 u8 waiting_for_dma; /* dma currently in progress */ 571 u8 waiting_for_dma; /* dma currently in progress */
572 u8 unmask; /* okay to unmask other irqs */ 572 u8 unmask; /* okay to unmask other irqs */
573 u8 bswap; /* byte swap data */ 573 u8 bswap; /* byte swap data */
574 u8 noflush; /* don't attempt flushes */
574 u8 dsc_overlap; /* DSC overlap */ 575 u8 dsc_overlap; /* DSC overlap */
575 u8 nice1; /* give potential excess bandwidth */ 576 u8 nice1; /* give potential excess bandwidth */
576 577
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index eef0876d8307..ab2740832742 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -23,8 +23,8 @@ struct vlan_collection;
23struct vlan_dev_info; 23struct vlan_dev_info;
24struct hlist_node; 24struct hlist_node;
25 25
26#include <linux/proc_fs.h> /* for proc_dir_entry */
27#include <linux/netdevice.h> 26#include <linux/netdevice.h>
27#include <linux/etherdevice.h>
28 28
29#define VLAN_HLEN 4 /* The additional bytes (on top of the Ethernet header) 29#define VLAN_HLEN 4 /* The additional bytes (on top of the Ethernet header)
30 * that VLAN requires. 30 * that VLAN requires.
@@ -155,6 +155,11 @@ static inline int __vlan_hwaccel_rx(struct sk_buff *skb,
155{ 155{
156 struct net_device_stats *stats; 156 struct net_device_stats *stats;
157 157
158 if (skb_bond_should_drop(skb)) {
159 dev_kfree_skb_any(skb);
160 return NET_RX_DROP;
161 }
162
158 skb->dev = grp->vlan_devices[vlan_tag & VLAN_VID_MASK]; 163 skb->dev = grp->vlan_devices[vlan_tag & VLAN_VID_MASK];
159 if (skb->dev == NULL) { 164 if (skb->dev == NULL) {
160 dev_kfree_skb_any(skb); 165 dev_kfree_skb_any(skb);
@@ -185,7 +190,8 @@ static inline int __vlan_hwaccel_rx(struct sk_buff *skb,
185 * This allows the VLAN to have a different MAC than the underlying 190 * This allows the VLAN to have a different MAC than the underlying
186 * device, and still route correctly. 191 * device, and still route correctly.
187 */ 192 */
188 if (!memcmp(eth_hdr(skb)->h_dest, skb->dev->dev_addr, ETH_ALEN)) 193 if (!compare_ether_addr(eth_hdr(skb)->h_dest,
194 skb->dev->dev_addr))
189 skb->pkt_type = PACKET_HOST; 195 skb->pkt_type = PACKET_HOST;
190 break; 196 break;
191 }; 197 };
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 5612dfeeae50..d42c83399071 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -97,7 +97,7 @@ extern struct resource iomem_resource;
97extern int request_resource(struct resource *root, struct resource *new); 97extern int request_resource(struct resource *root, struct resource *new);
98extern struct resource * ____request_resource(struct resource *root, struct resource *new); 98extern struct resource * ____request_resource(struct resource *root, struct resource *new);
99extern int release_resource(struct resource *new); 99extern int release_resource(struct resource *new);
100extern __deprecated_for_modules int insert_resource(struct resource *parent, struct resource *new); 100extern int insert_resource(struct resource *parent, struct resource *new);
101extern int allocate_resource(struct resource *root, struct resource *new, 101extern int allocate_resource(struct resource *root, struct resource *new,
102 resource_size_t size, resource_size_t min, 102 resource_size_t size, resource_size_t min,
103 resource_size_t max, resource_size_t align, 103 resource_size_t max, resource_size_t align,
diff --git a/include/linux/ioprio.h b/include/linux/ioprio.h
index 88d5961f7a3f..8e2042b9d471 100644
--- a/include/linux/ioprio.h
+++ b/include/linux/ioprio.h
@@ -59,27 +59,6 @@ static inline int task_nice_ioprio(struct task_struct *task)
59/* 59/*
60 * For inheritance, return the highest of the two given priorities 60 * For inheritance, return the highest of the two given priorities
61 */ 61 */
62static inline int ioprio_best(unsigned short aprio, unsigned short bprio) 62extern int ioprio_best(unsigned short aprio, unsigned short bprio);
63{
64 unsigned short aclass = IOPRIO_PRIO_CLASS(aprio);
65 unsigned short bclass = IOPRIO_PRIO_CLASS(bprio);
66
67 if (!ioprio_valid(aprio))
68 return bprio;
69 if (!ioprio_valid(bprio))
70 return aprio;
71
72 if (aclass == IOPRIO_CLASS_NONE)
73 aclass = IOPRIO_CLASS_BE;
74 if (bclass == IOPRIO_CLASS_NONE)
75 bclass = IOPRIO_CLASS_BE;
76
77 if (aclass == bclass)
78 return min(aprio, bprio);
79 if (aclass > bclass)
80 return bprio;
81 else
82 return aprio;
83}
84 63
85#endif 64#endif
diff --git a/include/linux/irq.h b/include/linux/irq.h
index b48eae32dc61..fbf6d901e9c2 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -47,8 +47,8 @@
47#define IRQ_WAITING 0x00200000 /* IRQ not yet seen - for autodetection */ 47#define IRQ_WAITING 0x00200000 /* IRQ not yet seen - for autodetection */
48#define IRQ_LEVEL 0x00400000 /* IRQ level triggered */ 48#define IRQ_LEVEL 0x00400000 /* IRQ level triggered */
49#define IRQ_MASKED 0x00800000 /* IRQ masked - shouldn't be seen again */ 49#define IRQ_MASKED 0x00800000 /* IRQ masked - shouldn't be seen again */
50#define IRQ_PER_CPU 0x01000000 /* IRQ is per CPU */
50#ifdef CONFIG_IRQ_PER_CPU 51#ifdef CONFIG_IRQ_PER_CPU
51# define IRQ_PER_CPU 0x01000000 /* IRQ is per CPU */
52# define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU) 52# define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU)
53#else 53#else
54# define CHECK_IRQ_PER_CPU(var) 0 54# define CHECK_IRQ_PER_CPU(var) 0
@@ -58,6 +58,7 @@
58#define IRQ_NOREQUEST 0x04000000 /* IRQ cannot be requested */ 58#define IRQ_NOREQUEST 0x04000000 /* IRQ cannot be requested */
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 62
62struct proc_dir_entry; 63struct proc_dir_entry;
63 64
@@ -124,6 +125,7 @@ struct irq_chip {
124 * @action: the irq action chain 125 * @action: the irq action chain
125 * @status: status information 126 * @status: status information
126 * @depth: disable-depth, for nested irq_disable() calls 127 * @depth: disable-depth, for nested irq_disable() calls
128 * @wake_depth: enable depth, for multiple set_irq_wake() callers
127 * @irq_count: stats field to detect stalled irqs 129 * @irq_count: stats field to detect stalled irqs
128 * @irqs_unhandled: stats field for spurious unhandled interrupts 130 * @irqs_unhandled: stats field for spurious unhandled interrupts
129 * @lock: locking for SMP 131 * @lock: locking for SMP
@@ -147,6 +149,7 @@ struct irq_desc {
147 unsigned int status; /* IRQ status */ 149 unsigned int status; /* IRQ status */
148 150
149 unsigned int depth; /* nested irq disables */ 151 unsigned int depth; /* nested irq disables */
152 unsigned int wake_depth; /* nested wake enables */
150 unsigned int irq_count; /* For detecting broken IRQs */ 153 unsigned int irq_count; /* For detecting broken IRQs */
151 unsigned int irqs_unhandled; 154 unsigned int irqs_unhandled;
152 spinlock_t lock; 155 spinlock_t lock;
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index 20eb34403d0c..a04c154c5207 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -72,6 +72,9 @@ extern int journal_enable_debug;
72#endif 72#endif
73 73
74extern void * __jbd_kmalloc (const char *where, size_t size, gfp_t flags, int retry); 74extern void * __jbd_kmalloc (const char *where, size_t size, gfp_t flags, int retry);
75extern void * jbd_slab_alloc(size_t size, gfp_t flags);
76extern void jbd_slab_free(void *ptr, size_t size);
77
75#define jbd_kmalloc(size, flags) \ 78#define jbd_kmalloc(size, flags) \
76 __jbd_kmalloc(__FUNCTION__, (size), (flags), journal_oom_retry) 79 __jbd_kmalloc(__FUNCTION__, (size), (flags), journal_oom_retry)
77#define jbd_rep_kmalloc(size, flags) \ 80#define jbd_rep_kmalloc(size, flags) \
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h
index 043376920f51..329ebcffa106 100644
--- a/include/linux/jiffies.h
+++ b/include/linux/jiffies.h
@@ -47,8 +47,8 @@
47 * - (NOM / DEN) fits in (32 - LSH) bits. 47 * - (NOM / DEN) fits in (32 - LSH) bits.
48 * - (NOM % DEN) fits in (32 - LSH) bits. 48 * - (NOM % DEN) fits in (32 - LSH) bits.
49 */ 49 */
50#define SH_DIV(NOM,DEN,LSH) ( ((NOM / DEN) << LSH) \ 50#define SH_DIV(NOM,DEN,LSH) ( (((NOM) / (DEN)) << (LSH)) \
51 + (((NOM % DEN) << LSH) + DEN / 2) / DEN) 51 + ((((NOM) % (DEN)) << (LSH)) + (DEN) / 2) / (DEN))
52 52
53/* HZ is the requested value. ACTHZ is actual HZ ("<< 8" is for accuracy) */ 53/* HZ is the requested value. ACTHZ is actual HZ ("<< 8" is for accuracy) */
54#define ACTHZ (SH_DIV (CLOCK_TICK_RATE, LATCH, 8)) 54#define ACTHZ (SH_DIV (CLOCK_TICK_RATE, LATCH, 8))
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 5c1ec1f84eab..851aa1bcfc1a 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -33,6 +33,7 @@ extern const char linux_banner[];
33#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) 33#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
34#define ALIGN(x,a) (((x)+(a)-1)&~((a)-1)) 34#define ALIGN(x,a) (((x)+(a)-1)&~((a)-1))
35#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f)) 35#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
36#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
36 37
37#define KERN_EMERG "<0>" /* system is unusable */ 38#define KERN_EMERG "<0>" /* system is unusable */
38#define KERN_ALERT "<1>" /* action must be taken immediately */ 39#define KERN_ALERT "<1>" /* action must be taken immediately */
@@ -209,6 +210,7 @@ extern enum system_states {
209extern void dump_stack(void); 210extern void dump_stack(void);
210 211
211#ifdef DEBUG 212#ifdef DEBUG
213/* If you are writing a driver, please use dev_dbg instead */
212#define pr_debug(fmt,arg...) \ 214#define pr_debug(fmt,arg...) \
213 printk(KERN_DEBUG fmt,##arg) 215 printk(KERN_DEBUG fmt,##arg)
214#else 216#else
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 0503b2ed8bae..2d229327959e 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -46,8 +46,6 @@ enum kobject_action {
46 KOBJ_UMOUNT = (__force kobject_action_t) 0x05, /* umount event for block devices (broken) */ 46 KOBJ_UMOUNT = (__force kobject_action_t) 0x05, /* umount event for block devices (broken) */
47 KOBJ_OFFLINE = (__force kobject_action_t) 0x06, /* device offline */ 47 KOBJ_OFFLINE = (__force kobject_action_t) 0x06, /* device offline */
48 KOBJ_ONLINE = (__force kobject_action_t) 0x07, /* device online */ 48 KOBJ_ONLINE = (__force kobject_action_t) 0x07, /* device online */
49 KOBJ_UNDOCK = (__force kobject_action_t) 0x08, /* undocking */
50 KOBJ_DOCK = (__force kobject_action_t) 0x09, /* dock */
51}; 49};
52 50
53struct kobject { 51struct kobject {
diff --git a/include/linux/kthread.h b/include/linux/kthread.h
index 7cce5dfa092f..1c65e7a9f186 100644
--- a/include/linux/kthread.h
+++ b/include/linux/kthread.h
@@ -28,7 +28,6 @@ struct task_struct *kthread_create(int (*threadfn)(void *data),
28 28
29void kthread_bind(struct task_struct *k, unsigned int cpu); 29void kthread_bind(struct task_struct *k, unsigned int cpu);
30int kthread_stop(struct task_struct *k); 30int kthread_stop(struct task_struct *k);
31int kthread_stop_sem(struct task_struct *k, struct semaphore *s);
32int kthread_should_stop(void); 31int kthread_should_stop(void);
33 32
34#endif /* _LINUX_KTHREAD_H */ 33#endif /* _LINUX_KTHREAD_H */
diff --git a/include/linux/ktime.h b/include/linux/ktime.h
index ed3396dcc4f7..84eeecd60a02 100644
--- a/include/linux/ktime.h
+++ b/include/linux/ktime.h
@@ -56,7 +56,8 @@ typedef union {
56#endif 56#endif
57} ktime_t; 57} ktime_t;
58 58
59#define KTIME_MAX (~((u64)1 << 63)) 59#define KTIME_MAX ((s64)~((u64)1 << 63))
60#define KTIME_SEC_MAX (KTIME_MAX / NSEC_PER_SEC)
60 61
61/* 62/*
62 * ktime_t definitions when using the 64-bit scalar representation: 63 * ktime_t definitions when using the 64-bit scalar representation:
@@ -73,6 +74,10 @@ typedef union {
73 */ 74 */
74static inline ktime_t ktime_set(const long secs, const unsigned long nsecs) 75static inline ktime_t ktime_set(const long secs, const unsigned long nsecs)
75{ 76{
77#if (BITS_PER_LONG == 64)
78 if (unlikely(secs >= KTIME_SEC_MAX))
79 return (ktime_t){ .tv64 = KTIME_MAX };
80#endif
76 return (ktime_t) { .tv64 = (s64)secs * NSEC_PER_SEC + (s64)nsecs }; 81 return (ktime_t) { .tv64 = (s64)secs * NSEC_PER_SEC + (s64)nsecs };
77} 82}
78 83
diff --git a/include/linux/libata.h b/include/linux/libata.h
index f4284bf89758..66c3100c2b94 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -131,6 +131,7 @@ enum {
131 ATA_DFLAG_CFG_MASK = (1 << 8) - 1, 131 ATA_DFLAG_CFG_MASK = (1 << 8) - 1,
132 132
133 ATA_DFLAG_PIO = (1 << 8), /* device currently in PIO mode */ 133 ATA_DFLAG_PIO = (1 << 8), /* device currently in PIO mode */
134 ATA_DFLAG_SUSPENDED = (1 << 9), /* device suspended */
134 ATA_DFLAG_INIT_MASK = (1 << 16) - 1, 135 ATA_DFLAG_INIT_MASK = (1 << 16) - 1,
135 136
136 ATA_DFLAG_DETACH = (1 << 16), 137 ATA_DFLAG_DETACH = (1 << 16),
@@ -160,22 +161,28 @@ enum {
160 ATA_FLAG_HRST_TO_RESUME = (1 << 11), /* hardreset to resume phy */ 161 ATA_FLAG_HRST_TO_RESUME = (1 << 11), /* hardreset to resume phy */
161 ATA_FLAG_SKIP_D2H_BSY = (1 << 12), /* can't wait for the first D2H 162 ATA_FLAG_SKIP_D2H_BSY = (1 << 12), /* can't wait for the first D2H
162 * Register FIS clearing BSY */ 163 * Register FIS clearing BSY */
163
164 ATA_FLAG_DEBUGMSG = (1 << 13), 164 ATA_FLAG_DEBUGMSG = (1 << 13),
165 ATA_FLAG_FLUSH_PORT_TASK = (1 << 14), /* flush port task */
166 165
167 ATA_FLAG_EH_PENDING = (1 << 15), /* EH pending */ 166 /* The following flag belongs to ap->pflags but is kept in
168 ATA_FLAG_EH_IN_PROGRESS = (1 << 16), /* EH in progress */ 167 * ap->flags because it's referenced in many LLDs and will be
169 ATA_FLAG_FROZEN = (1 << 17), /* port is frozen */ 168 * removed in not-too-distant future.
170 ATA_FLAG_RECOVERED = (1 << 18), /* recovery action performed */ 169 */
171 ATA_FLAG_LOADING = (1 << 19), /* boot/loading probe */ 170 ATA_FLAG_DISABLED = (1 << 23), /* port is disabled, ignore it */
172 ATA_FLAG_UNLOADING = (1 << 20), /* module is unloading */ 171
173 ATA_FLAG_SCSI_HOTPLUG = (1 << 21), /* SCSI hotplug scheduled */ 172 /* bits 24:31 of ap->flags are reserved for LLD specific flags */
174 173
175 ATA_FLAG_DISABLED = (1 << 22), /* port is disabled, ignore it */ 174 /* struct ata_port pflags */
176 ATA_FLAG_SUSPENDED = (1 << 23), /* port is suspended (power) */ 175 ATA_PFLAG_EH_PENDING = (1 << 0), /* EH pending */
176 ATA_PFLAG_EH_IN_PROGRESS = (1 << 1), /* EH in progress */
177 ATA_PFLAG_FROZEN = (1 << 2), /* port is frozen */
178 ATA_PFLAG_RECOVERED = (1 << 3), /* recovery action performed */
179 ATA_PFLAG_LOADING = (1 << 4), /* boot/loading probe */
180 ATA_PFLAG_UNLOADING = (1 << 5), /* module is unloading */
181 ATA_PFLAG_SCSI_HOTPLUG = (1 << 6), /* SCSI hotplug scheduled */
177 182
178 /* bits 24:31 of ap->flags are reserved for LLDD specific flags */ 183 ATA_PFLAG_FLUSH_PORT_TASK = (1 << 16), /* flush port task */
184 ATA_PFLAG_SUSPENDED = (1 << 17), /* port is suspended (power) */
185 ATA_PFLAG_PM_PENDING = (1 << 18), /* PM operation pending */
179 186
180 /* struct ata_queued_cmd flags */ 187 /* struct ata_queued_cmd flags */
181 ATA_QCFLAG_ACTIVE = (1 << 0), /* cmd not yet ack'd to scsi lyer */ 188 ATA_QCFLAG_ACTIVE = (1 << 0), /* cmd not yet ack'd to scsi lyer */
@@ -248,15 +255,24 @@ enum {
248 ATA_EH_REVALIDATE = (1 << 0), 255 ATA_EH_REVALIDATE = (1 << 0),
249 ATA_EH_SOFTRESET = (1 << 1), 256 ATA_EH_SOFTRESET = (1 << 1),
250 ATA_EH_HARDRESET = (1 << 2), 257 ATA_EH_HARDRESET = (1 << 2),
258 ATA_EH_SUSPEND = (1 << 3),
259 ATA_EH_RESUME = (1 << 4),
260 ATA_EH_PM_FREEZE = (1 << 5),
251 261
252 ATA_EH_RESET_MASK = ATA_EH_SOFTRESET | ATA_EH_HARDRESET, 262 ATA_EH_RESET_MASK = ATA_EH_SOFTRESET | ATA_EH_HARDRESET,
253 ATA_EH_PERDEV_MASK = ATA_EH_REVALIDATE, 263 ATA_EH_PERDEV_MASK = ATA_EH_REVALIDATE | ATA_EH_SUSPEND |
264 ATA_EH_RESUME | ATA_EH_PM_FREEZE,
254 265
255 /* ata_eh_info->flags */ 266 /* ata_eh_info->flags */
256 ATA_EHI_HOTPLUGGED = (1 << 0), /* could have been hotplugged */ 267 ATA_EHI_HOTPLUGGED = (1 << 0), /* could have been hotplugged */
268 ATA_EHI_RESUME_LINK = (1 << 1), /* resume link (reset modifier) */
269 ATA_EHI_NO_AUTOPSY = (1 << 2), /* no autopsy */
270 ATA_EHI_QUIET = (1 << 3), /* be quiet */
257 271
258 ATA_EHI_DID_RESET = (1 << 16), /* already reset this port */ 272 ATA_EHI_DID_RESET = (1 << 16), /* already reset this port */
259 273
274 ATA_EHI_RESET_MODIFIER_MASK = ATA_EHI_RESUME_LINK,
275
260 /* max repeat if error condition is still set after ->error_handler */ 276 /* max repeat if error condition is still set after ->error_handler */
261 ATA_EH_MAX_REPEAT = 5, 277 ATA_EH_MAX_REPEAT = 5,
262 278
@@ -486,6 +502,7 @@ struct ata_port {
486 const struct ata_port_operations *ops; 502 const struct ata_port_operations *ops;
487 spinlock_t *lock; 503 spinlock_t *lock;
488 unsigned long flags; /* ATA_FLAG_xxx */ 504 unsigned long flags; /* ATA_FLAG_xxx */
505 unsigned int pflags; /* ATA_PFLAG_xxx */
489 unsigned int id; /* unique id req'd by scsi midlyr */ 506 unsigned int id; /* unique id req'd by scsi midlyr */
490 unsigned int port_no; /* unique port #; from zero */ 507 unsigned int port_no; /* unique port #; from zero */
491 unsigned int hard_port_no; /* hardware port #; from zero */ 508 unsigned int hard_port_no; /* hardware port #; from zero */
@@ -535,6 +552,9 @@ struct ata_port {
535 struct list_head eh_done_q; 552 struct list_head eh_done_q;
536 wait_queue_head_t eh_wait_q; 553 wait_queue_head_t eh_wait_q;
537 554
555 pm_message_t pm_mesg;
556 int *pm_result;
557
538 void *private_data; 558 void *private_data;
539 559
540 u8 sector_buf[ATA_SECT_SIZE]; /* owned by EH */ 560 u8 sector_buf[ATA_SECT_SIZE]; /* owned by EH */
@@ -589,6 +609,9 @@ struct ata_port_operations {
589 void (*scr_write) (struct ata_port *ap, unsigned int sc_reg, 609 void (*scr_write) (struct ata_port *ap, unsigned int sc_reg,
590 u32 val); 610 u32 val);
591 611
612 int (*port_suspend) (struct ata_port *ap, pm_message_t mesg);
613 int (*port_resume) (struct ata_port *ap);
614
592 int (*port_start) (struct ata_port *ap); 615 int (*port_start) (struct ata_port *ap);
593 void (*port_stop) (struct ata_port *ap); 616 void (*port_stop) (struct ata_port *ap);
594 617
@@ -622,9 +645,18 @@ struct ata_timing {
622 645
623#define FIT(v,vmin,vmax) max_t(short,min_t(short,v,vmax),vmin) 646#define FIT(v,vmin,vmax) max_t(short,min_t(short,v,vmax),vmin)
624 647
625extern const unsigned long sata_deb_timing_boot[]; 648extern const unsigned long sata_deb_timing_normal[];
626extern const unsigned long sata_deb_timing_eh[]; 649extern const unsigned long sata_deb_timing_hotplug[];
627extern const unsigned long sata_deb_timing_before_fsrst[]; 650extern const unsigned long sata_deb_timing_long[];
651
652static inline const unsigned long *
653sata_ehc_deb_timing(struct ata_eh_context *ehc)
654{
655 if (ehc->i.flags & ATA_EHI_HOTPLUGGED)
656 return sata_deb_timing_hotplug;
657 else
658 return sata_deb_timing_normal;
659}
628 660
629extern void ata_port_probe(struct ata_port *); 661extern void ata_port_probe(struct ata_port *);
630extern void __sata_phy_reset(struct ata_port *ap); 662extern void __sata_phy_reset(struct ata_port *ap);
@@ -644,6 +676,8 @@ extern void ata_std_ports(struct ata_ioports *ioaddr);
644extern int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info, 676extern int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info,
645 unsigned int n_ports); 677 unsigned int n_ports);
646extern void ata_pci_remove_one (struct pci_dev *pdev); 678extern void ata_pci_remove_one (struct pci_dev *pdev);
679extern void ata_pci_device_do_suspend(struct pci_dev *pdev, pm_message_t state);
680extern void ata_pci_device_do_resume(struct pci_dev *pdev);
647extern int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t state); 681extern int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t state);
648extern int ata_pci_device_resume(struct pci_dev *pdev); 682extern int ata_pci_device_resume(struct pci_dev *pdev);
649extern int ata_pci_clear_simplex(struct pci_dev *pdev); 683extern int ata_pci_clear_simplex(struct pci_dev *pdev);
@@ -664,8 +698,9 @@ extern int ata_port_online(struct ata_port *ap);
664extern int ata_port_offline(struct ata_port *ap); 698extern int ata_port_offline(struct ata_port *ap);
665extern int ata_scsi_device_resume(struct scsi_device *); 699extern int ata_scsi_device_resume(struct scsi_device *);
666extern int ata_scsi_device_suspend(struct scsi_device *, pm_message_t state); 700extern int ata_scsi_device_suspend(struct scsi_device *, pm_message_t state);
667extern int ata_device_resume(struct ata_device *); 701extern int ata_host_set_suspend(struct ata_host_set *host_set,
668extern int ata_device_suspend(struct ata_device *, pm_message_t state); 702 pm_message_t mesg);
703extern void ata_host_set_resume(struct ata_host_set *host_set);
669extern int ata_ratelimit(void); 704extern int ata_ratelimit(void);
670extern unsigned int ata_busy_sleep(struct ata_port *ap, 705extern unsigned int ata_busy_sleep(struct ata_port *ap,
671 unsigned long timeout_pat, 706 unsigned long timeout_pat,
@@ -825,19 +860,24 @@ extern void ata_do_eh(struct ata_port *ap, ata_prereset_fn_t prereset,
825 (ehi)->desc_len = 0; \ 860 (ehi)->desc_len = 0; \
826} while (0) 861} while (0)
827 862
828static inline void ata_ehi_hotplugged(struct ata_eh_info *ehi) 863static inline void __ata_ehi_hotplugged(struct ata_eh_info *ehi)
829{ 864{
830 if (ehi->flags & ATA_EHI_HOTPLUGGED) 865 if (ehi->flags & ATA_EHI_HOTPLUGGED)
831 return; 866 return;
832 867
833 ehi->flags |= ATA_EHI_HOTPLUGGED; 868 ehi->flags |= ATA_EHI_HOTPLUGGED | ATA_EHI_RESUME_LINK;
834 ehi->hotplug_timestamp = jiffies; 869 ehi->hotplug_timestamp = jiffies;
835 870
836 ehi->err_mask |= AC_ERR_ATA_BUS;
837 ehi->action |= ATA_EH_SOFTRESET; 871 ehi->action |= ATA_EH_SOFTRESET;
838 ehi->probe_mask |= (1 << ATA_MAX_DEVICES) - 1; 872 ehi->probe_mask |= (1 << ATA_MAX_DEVICES) - 1;
839} 873}
840 874
875static inline void ata_ehi_hotplugged(struct ata_eh_info *ehi)
876{
877 __ata_ehi_hotplugged(ehi);
878 ehi->err_mask |= AC_ERR_ATA_BUS;
879}
880
841/* 881/*
842 * qc helpers 882 * qc helpers
843 */ 883 */
@@ -921,6 +961,11 @@ static inline unsigned int ata_dev_absent(const struct ata_device *dev)
921 return ata_class_absent(dev->class); 961 return ata_class_absent(dev->class);
922} 962}
923 963
964static inline unsigned int ata_dev_ready(const struct ata_device *dev)
965{
966 return ata_dev_enabled(dev) && !(dev->flags & ATA_DFLAG_SUSPENDED);
967}
968
924/* 969/*
925 * port helpers 970 * port helpers
926 */ 971 */
diff --git a/include/linux/list.h b/include/linux/list.h
index 6b74adf5297f..65a5b5ceda49 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -265,6 +265,17 @@ static inline void list_move_tail(struct list_head *list,
265} 265}
266 266
267/** 267/**
268 * list_is_last - tests whether @list is the last entry in list @head
269 * @list: the entry to test
270 * @head: the head of the list
271 */
272static inline int list_is_last(const struct list_head *list,
273 const struct list_head *head)
274{
275 return list->next == head;
276}
277
278/**
268 * list_empty - tests whether a list is empty 279 * list_empty - tests whether a list is empty
269 * @head: the list to test. 280 * @head: the list to test.
270 */ 281 */
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index aa4fe905bb4d..0d92c468d55a 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -123,7 +123,6 @@ struct nlm_block {
123 unsigned int b_id; /* block id */ 123 unsigned int b_id; /* block id */
124 unsigned char b_queued; /* re-queued */ 124 unsigned char b_queued; /* re-queued */
125 unsigned char b_granted; /* VFS granted lock */ 125 unsigned char b_granted; /* VFS granted lock */
126 unsigned char b_done; /* callback complete */
127 struct nlm_file * b_file; /* file in question */ 126 struct nlm_file * b_file; /* file in question */
128}; 127};
129 128
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index 316e0fb8d7b1..c040a8c969aa 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -120,7 +120,7 @@ struct lock_class {
120 */ 120 */
121struct lockdep_map { 121struct lockdep_map {
122 struct lock_class_key *key; 122 struct lock_class_key *key;
123 struct lock_class *class[MAX_LOCKDEP_SUBCLASSES]; 123 struct lock_class *class_cache;
124 const char *name; 124 const char *name;
125}; 125};
126 126
diff --git a/include/linux/mc146818rtc.h b/include/linux/mc146818rtc.h
index bbc93ae217e1..432b2fa24929 100644
--- a/include/linux/mc146818rtc.h
+++ b/include/linux/mc146818rtc.h
@@ -89,4 +89,11 @@ extern spinlock_t rtc_lock; /* serialize CMOS RAM access */
89# define RTC_VRT 0x80 /* valid RAM and time */ 89# define RTC_VRT 0x80 /* valid RAM and time */
90/**********************************************************************/ 90/**********************************************************************/
91 91
92#ifndef ARCH_RTC_LOCATION /* Override by <asm/mc146818rtc.h>? */
93
94#define RTC_IO_EXTENT 0x8
95#define RTC_IOMAPPED 1 /* Default to I/O mapping. */
96
97#endif /* ARCH_RTC_LOCATION */
98
92#endif /* _MC146818RTC_H */ 99#endif /* _MC146818RTC_H */
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 990957e0929f..f0b135cd86da 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -336,6 +336,7 @@ static inline void init_page_count(struct page *page)
336} 336}
337 337
338void put_page(struct page *page); 338void put_page(struct page *page);
339void put_pages_list(struct list_head *pages);
339 340
340void split_page(struct page *page, unsigned int order); 341void split_page(struct page *page, unsigned int order);
341 342
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index c1f021eddffa..ba095aebedff 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -77,7 +77,7 @@ struct mmc_host {
77 struct device *dev; 77 struct device *dev;
78 struct class_device class_dev; 78 struct class_device class_dev;
79 int index; 79 int index;
80 struct mmc_host_ops *ops; 80 const struct mmc_host_ops *ops;
81 unsigned int f_min; 81 unsigned int f_min;
82 unsigned int f_max; 82 unsigned int f_max;
83 u32 ocr_avail; 83 u32 ocr_avail;
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
index 03a14a30c46a..627e2c08ce41 100644
--- a/include/linux/mmc/mmc.h
+++ b/include/linux/mmc/mmc.h
@@ -105,6 +105,8 @@ extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int);
105extern int mmc_wait_for_app_cmd(struct mmc_host *, unsigned int, 105extern int mmc_wait_for_app_cmd(struct mmc_host *, unsigned int,
106 struct mmc_command *, int); 106 struct mmc_command *, int);
107 107
108extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *, int);
109
108extern int __mmc_claim_host(struct mmc_host *host, struct mmc_card *card); 110extern int __mmc_claim_host(struct mmc_host *host, struct mmc_card *card);
109 111
110static inline void mmc_claim_host(struct mmc_host *host) 112static inline void mmc_claim_host(struct mmc_host *host)
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 656b588a9f96..f45163c528e8 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -77,6 +77,7 @@ struct per_cpu_pages {
77struct per_cpu_pageset { 77struct per_cpu_pageset {
78 struct per_cpu_pages pcp[2]; /* 0: hot. 1: cold */ 78 struct per_cpu_pages pcp[2]; /* 0: hot. 1: cold */
79#ifdef CONFIG_SMP 79#ifdef CONFIG_SMP
80 s8 stat_threshold;
80 s8 vm_stat_diff[NR_VM_ZONE_STAT_ITEMS]; 81 s8 vm_stat_diff[NR_VM_ZONE_STAT_ITEMS];
81#endif 82#endif
82} ____cacheline_aligned_in_smp; 83} ____cacheline_aligned_in_smp;
diff --git a/include/linux/module.h b/include/linux/module.h
index d06c74fb8c26..0dfb794c52d3 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -362,10 +362,8 @@ int is_module_address(unsigned long addr);
362 362
363/* Returns module and fills in value, defined and namebuf, or NULL if 363/* Returns module and fills in value, defined and namebuf, or NULL if
364 symnum out of range. */ 364 symnum out of range. */
365struct module *module_get_kallsym(unsigned int symnum, 365struct module *module_get_kallsym(unsigned int symnum, unsigned long *value,
366 unsigned long *value, 366 char *type, char *name, size_t namelen);
367 char *type,
368 char namebuf[128]);
369 367
370/* Look for this name: can be of form module:name. */ 368/* Look for this name: can be of form module:name. */
371unsigned long module_kallsyms_lookup_name(const char *name); 369unsigned long module_kallsyms_lookup_name(const char *name);
@@ -535,8 +533,8 @@ static inline const char *module_address_lookup(unsigned long addr,
535 533
536static inline struct module *module_get_kallsym(unsigned int symnum, 534static inline struct module *module_get_kallsym(unsigned int symnum,
537 unsigned long *value, 535 unsigned long *value,
538 char *type, 536 char *type, char *name,
539 char namebuf[128]) 537 size_t namelen)
540{ 538{
541 return NULL; 539 return NULL;
542} 540}
diff --git a/include/linux/namei.h b/include/linux/namei.h
index 58cb3d3d44b4..45511a5918d3 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -11,7 +11,7 @@ struct open_intent {
11 struct file *file; 11 struct file *file;
12}; 12};
13 13
14enum { MAX_NESTED_LINKS = 5 }; 14enum { MAX_NESTED_LINKS = 8 };
15 15
16struct nameidata { 16struct nameidata {
17 struct dentry *dentry; 17 struct dentry *dentry;
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 85f99f60deea..50a4719512ed 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -320,6 +320,9 @@ struct net_device
320#define NETIF_F_TSO_ECN (SKB_GSO_TCP_ECN << NETIF_F_GSO_SHIFT) 320#define NETIF_F_TSO_ECN (SKB_GSO_TCP_ECN << NETIF_F_GSO_SHIFT)
321#define NETIF_F_TSO6 (SKB_GSO_TCPV6 << NETIF_F_GSO_SHIFT) 321#define NETIF_F_TSO6 (SKB_GSO_TCPV6 << NETIF_F_GSO_SHIFT)
322 322
323 /* List of features with software fallbacks. */
324#define NETIF_F_GSO_SOFTWARE (NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6)
325
323#define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM) 326#define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM)
324#define NETIF_F_ALL_CSUM (NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM) 327#define NETIF_F_ALL_CSUM (NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM)
325 328
@@ -549,6 +552,7 @@ struct packet_type {
549 struct net_device *); 552 struct net_device *);
550 struct sk_buff *(*gso_segment)(struct sk_buff *skb, 553 struct sk_buff *(*gso_segment)(struct sk_buff *skb,
551 int features); 554 int features);
555 int (*gso_send_check)(struct sk_buff *skb);
552 void *af_packet_priv; 556 void *af_packet_priv;
553 struct list_head list; 557 struct list_head list;
554}; 558};
@@ -923,10 +927,10 @@ static inline void netif_tx_lock_bh(struct net_device *dev)
923 927
924static inline int netif_tx_trylock(struct net_device *dev) 928static inline int netif_tx_trylock(struct net_device *dev)
925{ 929{
926 int err = spin_trylock(&dev->_xmit_lock); 930 int ok = spin_trylock(&dev->_xmit_lock);
927 if (!err) 931 if (likely(ok))
928 dev->xmit_lock_owner = smp_processor_id(); 932 dev->xmit_lock_owner = smp_processor_id();
929 return err; 933 return ok;
930} 934}
931 935
932static inline void netif_tx_unlock(struct net_device *dev) 936static inline void netif_tx_unlock(struct net_device *dev)
@@ -1001,13 +1005,38 @@ static inline int net_gso_ok(int features, int gso_type)
1001 1005
1002static inline int skb_gso_ok(struct sk_buff *skb, int features) 1006static inline int skb_gso_ok(struct sk_buff *skb, int features)
1003{ 1007{
1004 return net_gso_ok(features, skb_shinfo(skb)->gso_size ? 1008 return net_gso_ok(features, skb_shinfo(skb)->gso_type);
1005 skb_shinfo(skb)->gso_type : 0);
1006} 1009}
1007 1010
1008static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb) 1011static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb)
1009{ 1012{
1010 return !skb_gso_ok(skb, dev->features); 1013 return skb_is_gso(skb) &&
1014 (!skb_gso_ok(skb, dev->features) ||
1015 unlikely(skb->ip_summed != CHECKSUM_HW));
1016}
1017
1018/* On bonding slaves other than the currently active slave, suppress
1019 * duplicates except for 802.3ad ETH_P_SLOW and alb non-mcast/bcast.
1020 */
1021static inline int skb_bond_should_drop(struct sk_buff *skb)
1022{
1023 struct net_device *dev = skb->dev;
1024 struct net_device *master = dev->master;
1025
1026 if (master &&
1027 (dev->priv_flags & IFF_SLAVE_INACTIVE)) {
1028 if (master->priv_flags & IFF_MASTER_ALB) {
1029 if (skb->pkt_type != PACKET_BROADCAST &&
1030 skb->pkt_type != PACKET_MULTICAST)
1031 return 0;
1032 }
1033 if (master->priv_flags & IFF_MASTER_8023AD &&
1034 skb->protocol == __constant_htons(ETH_P_SLOW))
1035 return 0;
1036
1037 return 1;
1038 }
1039 return 0;
1011} 1040}
1012 1041
1013#endif /* __KERNEL__ */ 1042#endif /* __KERNEL__ */
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild
index d06311acd448..1d3a14e2da6e 100644
--- a/include/linux/netfilter/Kbuild
+++ b/include/linux/netfilter/Kbuild
@@ -5,7 +5,7 @@ header-y := nf_conntrack_sctp.h nf_conntrack_tuple_common.h \
5 xt_helper.h xt_length.h xt_limit.h xt_mac.h xt_mark.h \ 5 xt_helper.h xt_length.h xt_limit.h xt_mac.h xt_mark.h \
6 xt_MARK.h xt_multiport.h xt_NFQUEUE.h xt_pkttype.h \ 6 xt_MARK.h xt_multiport.h xt_NFQUEUE.h xt_pkttype.h \
7 xt_policy.h xt_realm.h xt_sctp.h xt_state.h xt_string.h \ 7 xt_policy.h xt_realm.h xt_sctp.h xt_state.h xt_string.h \
8 xt_tcpmss.h xt_tcpudp.h 8 xt_tcpmss.h xt_tcpudp.h xt_SECMARK.h xt_CONNSECMARK.h
9 9
10unifdef-y := nf_conntrack_common.h nf_conntrack_ftp.h \ 10unifdef-y := nf_conntrack_common.h nf_conntrack_ftp.h \
11 nf_conntrack_tcp.h nfnetlink.h x_tables.h xt_physdev.h 11 nf_conntrack_tcp.h nfnetlink.h x_tables.h xt_physdev.h
diff --git a/include/linux/netfilter_bridge.h b/include/linux/netfilter_bridge.h
index 87764022cc67..427c67ff89e9 100644
--- a/include/linux/netfilter_bridge.h
+++ b/include/linux/netfilter_bridge.h
@@ -6,7 +6,6 @@
6 6
7#include <linux/netfilter.h> 7#include <linux/netfilter.h>
8#if defined(__KERNEL__) && defined(CONFIG_BRIDGE_NETFILTER) 8#if defined(__KERNEL__) && defined(CONFIG_BRIDGE_NETFILTER)
9#include <asm/atomic.h>
10#include <linux/if_ether.h> 9#include <linux/if_ether.h>
11#endif 10#endif
12 11
@@ -49,15 +48,25 @@ enum nf_br_hook_priorities {
49 48
50/* Only used in br_forward.c */ 49/* Only used in br_forward.c */
51static inline 50static inline
52void nf_bridge_maybe_copy_header(struct sk_buff *skb) 51int nf_bridge_maybe_copy_header(struct sk_buff *skb)
53{ 52{
53 int err;
54
54 if (skb->nf_bridge) { 55 if (skb->nf_bridge) {
55 if (skb->protocol == __constant_htons(ETH_P_8021Q)) { 56 if (skb->protocol == __constant_htons(ETH_P_8021Q)) {
57 err = skb_cow(skb, 18);
58 if (err)
59 return err;
56 memcpy(skb->data - 18, skb->nf_bridge->data, 18); 60 memcpy(skb->data - 18, skb->nf_bridge->data, 18);
57 skb_push(skb, 4); 61 skb_push(skb, 4);
58 } else 62 } else {
63 err = skb_cow(skb, 16);
64 if (err)
65 return err;
59 memcpy(skb->data - 16, skb->nf_bridge->data, 16); 66 memcpy(skb->data - 16, skb->nf_bridge->data, 16);
67 }
60 } 68 }
69 return 0;
61} 70}
62 71
63/* This is called by the IP fragmenting code and it ensures there is 72/* This is called by the IP fragmenting code and it ensures there is
@@ -79,6 +88,8 @@ struct bridge_skb_cb {
79 __u32 ipv4; 88 __u32 ipv4;
80 } daddr; 89 } daddr;
81}; 90};
91
92extern int brnf_deferred_hooks;
82#endif /* CONFIG_BRIDGE_NETFILTER */ 93#endif /* CONFIG_BRIDGE_NETFILTER */
83 94
84#endif /* __KERNEL__ */ 95#endif /* __KERNEL__ */
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
index 5f681d534295..db05182ca0e8 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -157,6 +157,12 @@ enum nfs_opnum4 {
157 OP_ILLEGAL = 10044, 157 OP_ILLEGAL = 10044,
158}; 158};
159 159
160/*Defining first and last NFS4 operations implemented.
161Needs to be updated if more operations are defined in future.*/
162
163#define FIRST_NFS4_OP OP_ACCESS
164#define LAST_NFS4_OP OP_RELEASE_LOCKOWNER
165
160enum nfsstat4 { 166enum nfsstat4 {
161 NFS4_OK = 0, 167 NFS4_OK = 0,
162 NFS4ERR_PERM = 1, 168 NFS4ERR_PERM = 1,
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 55ea853d57bc..6c2066caeaab 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -9,27 +9,6 @@
9#ifndef _LINUX_NFS_FS_H 9#ifndef _LINUX_NFS_FS_H
10#define _LINUX_NFS_FS_H 10#define _LINUX_NFS_FS_H
11 11
12#include <linux/in.h>
13#include <linux/mm.h>
14#include <linux/pagemap.h>
15#include <linux/rwsem.h>
16#include <linux/wait.h>
17
18#include <linux/sunrpc/debug.h>
19#include <linux/sunrpc/auth.h>
20#include <linux/sunrpc/clnt.h>
21
22#include <linux/nfs.h>
23#include <linux/nfs2.h>
24#include <linux/nfs3.h>
25#include <linux/nfs4.h>
26#include <linux/nfs_xdr.h>
27
28#include <linux/nfs_fs_sb.h>
29
30#include <linux/rwsem.h>
31#include <linux/mempool.h>
32
33/* 12/*
34 * Enable debugging support for nfs client. 13 * Enable debugging support for nfs client.
35 * Requires RPC_DEBUG. 14 * Requires RPC_DEBUG.
@@ -48,11 +27,6 @@
48#define NFS_SUPER_MAGIC 0x6969 27#define NFS_SUPER_MAGIC 0x6969
49 28
50/* 29/*
51 * These are the default flags for swap requests
52 */
53#define NFS_RPC_SWAPFLAGS (RPC_TASK_SWAPPER|RPC_TASK_ROOTCREDS)
54
55/*
56 * When flushing a cluster of dirty pages, there can be different 30 * When flushing a cluster of dirty pages, there can be different
57 * strategies: 31 * strategies:
58 */ 32 */
@@ -65,6 +39,32 @@
65 39
66#ifdef __KERNEL__ 40#ifdef __KERNEL__
67 41
42#include <linux/in.h>
43#include <linux/mm.h>
44#include <linux/pagemap.h>
45#include <linux/rwsem.h>
46#include <linux/wait.h>
47
48#include <linux/sunrpc/debug.h>
49#include <linux/sunrpc/auth.h>
50#include <linux/sunrpc/clnt.h>
51
52#include <linux/nfs.h>
53#include <linux/nfs2.h>
54#include <linux/nfs3.h>
55#include <linux/nfs4.h>
56#include <linux/nfs_xdr.h>
57
58#include <linux/nfs_fs_sb.h>
59
60#include <linux/rwsem.h>
61#include <linux/mempool.h>
62
63/*
64 * These are the default flags for swap requests
65 */
66#define NFS_RPC_SWAPFLAGS (RPC_TASK_SWAPPER|RPC_TASK_ROOTCREDS)
67
68/* 68/*
69 * NFSv3/v4 Access mode cache entry 69 * NFSv3/v4 Access mode cache entry
70 */ 70 */
@@ -427,7 +427,7 @@ extern int nfs_writeback_done(struct rpc_task *, struct nfs_write_data *);
427extern void nfs_writedata_release(void *); 427extern void nfs_writedata_release(void *);
428 428
429#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) 429#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
430struct nfs_write_data *nfs_commit_alloc(unsigned int pagecount); 430struct nfs_write_data *nfs_commit_alloc(void);
431void nfs_commit_free(struct nfs_write_data *p); 431void nfs_commit_free(struct nfs_write_data *p);
432#endif 432#endif
433 433
@@ -476,10 +476,9 @@ static inline int nfs_wb_page(struct inode *inode, struct page* page)
476} 476}
477 477
478/* 478/*
479 * Allocate and free nfs_write_data structures 479 * Allocate nfs_write_data structures
480 */ 480 */
481extern struct nfs_write_data *nfs_writedata_alloc(unsigned int pagecount); 481extern struct nfs_write_data *nfs_writedata_alloc(size_t len);
482extern void nfs_writedata_free(struct nfs_write_data *p);
483 482
484/* 483/*
485 * linux/fs/nfs/read.c 484 * linux/fs/nfs/read.c
@@ -491,10 +490,9 @@ extern int nfs_readpage_result(struct rpc_task *, struct nfs_read_data *);
491extern void nfs_readdata_release(void *data); 490extern void nfs_readdata_release(void *data);
492 491
493/* 492/*
494 * Allocate and free nfs_read_data structures 493 * Allocate nfs_read_data structures
495 */ 494 */
496extern struct nfs_read_data *nfs_readdata_alloc(unsigned int pagecount); 495extern struct nfs_read_data *nfs_readdata_alloc(size_t len);
497extern void nfs_readdata_free(struct nfs_read_data *p);
498 496
499/* 497/*
500 * linux/fs/nfs3proc.c 498 * linux/fs/nfs3proc.c
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 7c7320fa51aa..41e5a19199e9 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -659,7 +659,7 @@ struct nfs4_rename_res {
659struct nfs4_setclientid { 659struct nfs4_setclientid {
660 const nfs4_verifier * sc_verifier; /* request */ 660 const nfs4_verifier * sc_verifier; /* request */
661 unsigned int sc_name_len; 661 unsigned int sc_name_len;
662 char sc_name[32]; /* request */ 662 char sc_name[48]; /* request */
663 u32 sc_prog; /* request */ 663 u32 sc_prog; /* request */
664 unsigned int sc_netid_len; 664 unsigned int sc_netid_len;
665 char sc_netid[4]; /* request */ 665 char sc_netid[4]; /* request */
@@ -729,6 +729,7 @@ struct nfs_read_data {
729 struct list_head pages; /* Coalesced read requests */ 729 struct list_head pages; /* Coalesced read requests */
730 struct nfs_page *req; /* multi ops per nfs_page */ 730 struct nfs_page *req; /* multi ops per nfs_page */
731 struct page **pagevec; 731 struct page **pagevec;
732 unsigned int npages; /* Max length of pagevec */
732 struct nfs_readargs args; 733 struct nfs_readargs args;
733 struct nfs_readres res; 734 struct nfs_readres res;
734#ifdef CONFIG_NFS_V4 735#ifdef CONFIG_NFS_V4
@@ -747,6 +748,7 @@ struct nfs_write_data {
747 struct list_head pages; /* Coalesced requests we wish to flush */ 748 struct list_head pages; /* Coalesced requests we wish to flush */
748 struct nfs_page *req; /* multi ops per nfs_page */ 749 struct nfs_page *req; /* multi ops per nfs_page */
749 struct page **pagevec; 750 struct page **pagevec;
751 unsigned int npages; /* Max length of pagevec */
750 struct nfs_writeargs args; /* argument struct */ 752 struct nfs_writeargs args; /* argument struct */
751 struct nfs_writeres res; /* result struct */ 753 struct nfs_writeres res; /* result struct */
752#ifdef CONFIG_NFS_V4 754#ifdef CONFIG_NFS_V4
diff --git a/include/linux/nfsd/stats.h b/include/linux/nfsd/stats.h
index b6f1e0cda4f2..28a82fdd922f 100644
--- a/include/linux/nfsd/stats.h
+++ b/include/linux/nfsd/stats.h
@@ -9,6 +9,8 @@
9#ifndef LINUX_NFSD_STATS_H 9#ifndef LINUX_NFSD_STATS_H
10#define LINUX_NFSD_STATS_H 10#define LINUX_NFSD_STATS_H
11 11
12#include <linux/nfs4.h>
13
12struct nfsd_stats { 14struct nfsd_stats {
13 unsigned int rchits; /* repcache hits */ 15 unsigned int rchits; /* repcache hits */
14 unsigned int rcmisses; /* repcache hits */ 16 unsigned int rcmisses; /* repcache hits */
@@ -27,6 +29,10 @@ struct nfsd_stats {
27 unsigned int ra_size; /* size of ra cache */ 29 unsigned int ra_size; /* size of ra cache */
28 unsigned int ra_depth[11]; /* number of times ra entry was found that deep 30 unsigned int ra_depth[11]; /* number of times ra entry was found that deep
29 * in the cache (10percentiles). [10] = not found */ 31 * in the cache (10percentiles). [10] = not found */
32#ifdef CONFIG_NFSD_V4
33 unsigned int nfs4_opcount[LAST_NFS4_OP + 1]; /* count of individual nfsv4 operations */
34#endif
35
30}; 36};
31 37
32/* thread usage wraps very million seconds (approx one fortnight) */ 38/* thread usage wraps very million seconds (approx one fortnight) */
diff --git a/include/linux/node.h b/include/linux/node.h
index 81dcec84cd8f..bc001bc225c3 100644
--- a/include/linux/node.h
+++ b/include/linux/node.h
@@ -30,12 +30,20 @@ extern struct node node_devices[];
30 30
31extern int register_node(struct node *, int, struct node *); 31extern int register_node(struct node *, int, struct node *);
32extern void unregister_node(struct node *node); 32extern void unregister_node(struct node *node);
33#ifdef CONFIG_NUMA
33extern int register_one_node(int nid); 34extern int register_one_node(int nid);
34extern void unregister_one_node(int nid); 35extern void unregister_one_node(int nid);
35#ifdef CONFIG_NUMA
36extern int register_cpu_under_node(unsigned int cpu, unsigned int nid); 36extern int register_cpu_under_node(unsigned int cpu, unsigned int nid);
37extern int unregister_cpu_under_node(unsigned int cpu, unsigned int nid); 37extern int unregister_cpu_under_node(unsigned int cpu, unsigned int nid);
38#else 38#else
39static inline int register_one_node(int nid)
40{
41 return 0;
42}
43static inline int unregister_one_node(int nid)
44{
45 return 0;
46}
39static inline int register_cpu_under_node(unsigned int cpu, unsigned int nid) 47static inline int register_cpu_under_node(unsigned int cpu, unsigned int nid)
40{ 48{
41 return 0; 49 return 0;
diff --git a/include/linux/nsc_gpio.h b/include/linux/nsc_gpio.h
index 135742cfada5..7da0cf3702ee 100644
--- a/include/linux/nsc_gpio.h
+++ b/include/linux/nsc_gpio.h
@@ -25,8 +25,6 @@ struct nsc_gpio_ops {
25 void (*gpio_dump) (struct nsc_gpio_ops *amp, unsigned iminor); 25 void (*gpio_dump) (struct nsc_gpio_ops *amp, unsigned iminor);
26 int (*gpio_get) (unsigned iminor); 26 int (*gpio_get) (unsigned iminor);
27 void (*gpio_set) (unsigned iminor, int state); 27 void (*gpio_set) (unsigned iminor, int state);
28 void (*gpio_set_high)(unsigned iminor);
29 void (*gpio_set_low) (unsigned iminor);
30 void (*gpio_change) (unsigned iminor); 28 void (*gpio_change) (unsigned iminor);
31 int (*gpio_current) (unsigned iminor); 29 int (*gpio_current) (unsigned iminor);
32 struct device* dev; /* for dev_dbg() support, set in init */ 30 struct device* dev; /* for dev_dbg() support, set in init */
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 983fca251b25..8565b81d7fbc 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -161,6 +161,7 @@ struct pci_dev {
161 unsigned int is_enabled:1; /* pci_enable_device has been called */ 161 unsigned int is_enabled:1; /* pci_enable_device has been called */
162 unsigned int is_busmaster:1; /* device is busmaster */ 162 unsigned int is_busmaster:1; /* device is busmaster */
163 unsigned int no_msi:1; /* device may not use msi */ 163 unsigned int no_msi:1; /* device may not use msi */
164 unsigned int no_d1d2:1; /* only allow d0 or d3 */
164 unsigned int block_ucfg_access:1; /* userspace config space access is blocked */ 165 unsigned int block_ucfg_access:1; /* userspace config space access is blocked */
165 unsigned int broken_parity_status:1; /* Device generates false positive parity */ 166 unsigned int broken_parity_status:1; /* Device generates false positive parity */
166 unsigned int msi_enabled:1; 167 unsigned int msi_enabled:1;
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 685081c01342..7a249155ee4e 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -648,6 +648,8 @@
648#define PCI_DEVICE_ID_SI_962 0x0962 648#define PCI_DEVICE_ID_SI_962 0x0962
649#define PCI_DEVICE_ID_SI_963 0x0963 649#define PCI_DEVICE_ID_SI_963 0x0963
650#define PCI_DEVICE_ID_SI_965 0x0965 650#define PCI_DEVICE_ID_SI_965 0x0965
651#define PCI_DEVICE_ID_SI_966 0x0966
652#define PCI_DEVICE_ID_SI_968 0x0968
651#define PCI_DEVICE_ID_SI_5511 0x5511 653#define PCI_DEVICE_ID_SI_5511 0x5511
652#define PCI_DEVICE_ID_SI_5513 0x5513 654#define PCI_DEVICE_ID_SI_5513 0x5513
653#define PCI_DEVICE_ID_SI_5517 0x5517 655#define PCI_DEVICE_ID_SI_5517 0x5517
@@ -1292,6 +1294,7 @@
1292#define PCI_DEVICE_ID_VIA_8367_0 0x3099 1294#define PCI_DEVICE_ID_VIA_8367_0 0x3099
1293#define PCI_DEVICE_ID_VIA_8653_0 0x3101 1295#define PCI_DEVICE_ID_VIA_8653_0 0x3101
1294#define PCI_DEVICE_ID_VIA_8622 0x3102 1296#define PCI_DEVICE_ID_VIA_8622 0x3102
1297#define PCI_DEVICE_ID_VIA_8235_USB_2 0x3104
1295#define PCI_DEVICE_ID_VIA_8233C_0 0x3109 1298#define PCI_DEVICE_ID_VIA_8233C_0 0x3109
1296#define PCI_DEVICE_ID_VIA_8361 0x3112 1299#define PCI_DEVICE_ID_VIA_8361 0x3112
1297#define PCI_DEVICE_ID_VIA_XM266 0x3116 1300#define PCI_DEVICE_ID_VIA_XM266 0x3116
@@ -1726,6 +1729,9 @@
1726#define PCI_VENDOR_ID_DOMEX 0x134a 1729#define PCI_VENDOR_ID_DOMEX 0x134a
1727#define PCI_DEVICE_ID_DOMEX_DMX3191D 0x0001 1730#define PCI_DEVICE_ID_DOMEX_DMX3191D 0x0001
1728 1731
1732#define PCI_VENDOR_ID_INTASHIELD 0x135a
1733#define PCI_DEVICE_ID_INTASHIELD_IS200 0x0d80
1734
1729#define PCI_VENDOR_ID_QUATECH 0x135C 1735#define PCI_VENDOR_ID_QUATECH 0x135C
1730#define PCI_DEVICE_ID_QUATECH_QSC100 0x0010 1736#define PCI_DEVICE_ID_QUATECH_QSC100 0x0010
1731#define PCI_DEVICE_ID_QUATECH_DSC100 0x0020 1737#define PCI_DEVICE_ID_QUATECH_DSC100 0x0020
@@ -2019,6 +2025,13 @@
2019#define PCI_VENDOR_ID_TDI 0x192E 2025#define PCI_VENDOR_ID_TDI 0x192E
2020#define PCI_DEVICE_ID_TDI_EHCI 0x0101 2026#define PCI_DEVICE_ID_TDI_EHCI 0x0101
2021 2027
2028#define PCI_VENDOR_ID_JMICRON 0x197B
2029#define PCI_DEVICE_ID_JMICRON_JMB360 0x2360
2030#define PCI_DEVICE_ID_JMICRON_JMB361 0x2361
2031#define PCI_DEVICE_ID_JMICRON_JMB363 0x2363
2032#define PCI_DEVICE_ID_JMICRON_JMB365 0x2365
2033#define PCI_DEVICE_ID_JMICRON_JMB366 0x2366
2034#define PCI_DEVICE_ID_JMICRON_JMB368 0x2368
2022 2035
2023#define PCI_VENDOR_ID_TEKRAM 0x1de1 2036#define PCI_VENDOR_ID_TEKRAM 0x1de1
2024#define PCI_DEVICE_ID_TEKRAM_DC290 0xdc29 2037#define PCI_DEVICE_ID_TEKRAM_DC290 0xdc29
@@ -2135,6 +2148,7 @@
2135#define PCI_DEVICE_ID_INTEL_82820_UP_HB 0x2501 2148#define PCI_DEVICE_ID_INTEL_82820_UP_HB 0x2501
2136#define PCI_DEVICE_ID_INTEL_82850_HB 0x2530 2149#define PCI_DEVICE_ID_INTEL_82850_HB 0x2530
2137#define PCI_DEVICE_ID_INTEL_82860_HB 0x2531 2150#define PCI_DEVICE_ID_INTEL_82860_HB 0x2531
2151#define PCI_DEVICE_ID_INTEL_E7501_MCH 0x254c
2138#define PCI_DEVICE_ID_INTEL_82845G_HB 0x2560 2152#define PCI_DEVICE_ID_INTEL_82845G_HB 0x2560
2139#define PCI_DEVICE_ID_INTEL_82845G_IG 0x2562 2153#define PCI_DEVICE_ID_INTEL_82845G_IG 0x2562
2140#define PCI_DEVICE_ID_INTEL_82865_HB 0x2570 2154#define PCI_DEVICE_ID_INTEL_82865_HB 0x2570
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h
index 6bce4a240364..96930cb5927c 100644
--- a/include/linux/pci_regs.h
+++ b/include/linux/pci_regs.h
@@ -422,7 +422,23 @@
422#define PCI_ERR_CAP_ECRC_CHKE 0x00000100 /* ECRC Check Enable */ 422#define PCI_ERR_CAP_ECRC_CHKE 0x00000100 /* ECRC Check Enable */
423#define PCI_ERR_HEADER_LOG 28 /* Header Log Register (16 bytes) */ 423#define PCI_ERR_HEADER_LOG 28 /* Header Log Register (16 bytes) */
424#define PCI_ERR_ROOT_COMMAND 44 /* Root Error Command */ 424#define PCI_ERR_ROOT_COMMAND 44 /* Root Error Command */
425/* Correctable Err Reporting Enable */
426#define PCI_ERR_ROOT_CMD_COR_EN 0x00000001
427/* Non-fatal Err Reporting Enable */
428#define PCI_ERR_ROOT_CMD_NONFATAL_EN 0x00000002
429/* Fatal Err Reporting Enable */
430#define PCI_ERR_ROOT_CMD_FATAL_EN 0x00000004
425#define PCI_ERR_ROOT_STATUS 48 431#define PCI_ERR_ROOT_STATUS 48
432#define PCI_ERR_ROOT_COR_RCV 0x00000001 /* ERR_COR Received */
433/* Multi ERR_COR Received */
434#define PCI_ERR_ROOT_MULTI_COR_RCV 0x00000002
435/* ERR_FATAL/NONFATAL Recevied */
436#define PCI_ERR_ROOT_UNCOR_RCV 0x00000004
437/* Multi ERR_FATAL/NONFATAL Recevied */
438#define PCI_ERR_ROOT_MULTI_UNCOR_RCV 0x00000008
439#define PCI_ERR_ROOT_FIRST_FATAL 0x00000010 /* First Fatal */
440#define PCI_ERR_ROOT_NONFATAL_RCV 0x00000020 /* Non-Fatal Received */
441#define PCI_ERR_ROOT_FATAL_RCV 0x00000040 /* Fatal Received */
426#define PCI_ERR_ROOT_COR_SRC 52 442#define PCI_ERR_ROOT_COR_SRC 52
427#define PCI_ERR_ROOT_SRC 54 443#define PCI_ERR_ROOT_SRC 54
428 444
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 331521a10a2d..9447a57ee8a9 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -378,6 +378,7 @@ int phy_mii_ioctl(struct phy_device *phydev,
378 struct mii_ioctl_data *mii_data, int cmd); 378 struct mii_ioctl_data *mii_data, int cmd);
379int phy_start_interrupts(struct phy_device *phydev); 379int phy_start_interrupts(struct phy_device *phydev);
380void phy_print_status(struct phy_device *phydev); 380void phy_print_status(struct phy_device *phydev);
381struct phy_device* phy_device_create(struct mii_bus *bus, int addr, int phy_id);
381 382
382extern struct bus_type mdio_bus_type; 383extern struct bus_type mdio_bus_type;
383#endif /* __PHY_H */ 384#endif /* __PHY_H */
diff --git a/include/linux/pm_legacy.h b/include/linux/pm_legacy.h
index 78027c533b94..514729a44688 100644
--- a/include/linux/pm_legacy.h
+++ b/include/linux/pm_legacy.h
@@ -15,11 +15,6 @@ struct pm_dev __deprecated *
15pm_register(pm_dev_t type, unsigned long id, pm_callback callback); 15pm_register(pm_dev_t type, unsigned long id, pm_callback callback);
16 16
17/* 17/*
18 * Unregister all devices with matching callback
19 */
20void __deprecated pm_unregister_all(pm_callback callback);
21
22/*
23 * Send a request to all devices 18 * Send a request to all devices
24 */ 19 */
25int __deprecated pm_send_all(pm_request_t rqst, void *data); 20int __deprecated pm_send_all(pm_request_t rqst, void *data);
@@ -35,8 +30,6 @@ static inline struct pm_dev *pm_register(pm_dev_t type,
35 return NULL; 30 return NULL;
36} 31}
37 32
38static inline void pm_unregister_all(pm_callback callback) {}
39
40static inline int pm_send_all(pm_request_t rqst, void *data) 33static inline int pm_send_all(pm_request_t rqst, void *data)
41{ 34{
42 return 0; 35 return 0;
diff --git a/include/linux/pmu.h b/include/linux/pmu.h
index 2ed807ddc08c..783177387ac6 100644
--- a/include/linux/pmu.h
+++ b/include/linux/pmu.h
@@ -231,7 +231,6 @@ extern struct pmu_battery_info pmu_batteries[PMU_MAX_BATTERIES];
231extern unsigned int pmu_power_flags; 231extern unsigned int pmu_power_flags;
232 232
233/* Backlight */ 233/* Backlight */
234extern int disable_kernel_backlight; 234extern void pmu_backlight_init(void);
235extern void pmu_backlight_init(struct device_node*);
236 235
237#endif /* __KERNEL__ */ 236#endif /* __KERNEL__ */
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h
index c1e0ac55bab5..d28890295852 100644
--- a/include/linux/raid/md_k.h
+++ b/include/linux/raid/md_k.h
@@ -148,9 +148,10 @@ struct mddev_s
148 148
149 struct mdk_thread_s *thread; /* management thread */ 149 struct mdk_thread_s *thread; /* management thread */
150 struct mdk_thread_s *sync_thread; /* doing resync or reconstruct */ 150 struct mdk_thread_s *sync_thread; /* doing resync or reconstruct */
151 sector_t curr_resync; /* blocks scheduled */ 151 sector_t curr_resync; /* last block scheduled */
152 unsigned long resync_mark; /* a recent timestamp */ 152 unsigned long resync_mark; /* a recent timestamp */
153 sector_t resync_mark_cnt;/* blocks written at resync_mark */ 153 sector_t resync_mark_cnt;/* blocks written at resync_mark */
154 sector_t curr_mark_cnt; /* blocks scheduled now */
154 155
155 sector_t resync_max_sectors; /* may be set by personality */ 156 sector_t resync_max_sectors; /* may be set by personality */
156 157
diff --git a/include/linux/root_dev.h b/include/linux/root_dev.h
index ea4bc9d13735..ed241aad7c17 100644
--- a/include/linux/root_dev.h
+++ b/include/linux/root_dev.h
@@ -2,6 +2,8 @@
2#define _ROOT_DEV_H_ 2#define _ROOT_DEV_H_
3 3
4#include <linux/major.h> 4#include <linux/major.h>
5#include <linux/types.h>
6#include <linux/kdev_t.h>
5 7
6enum { 8enum {
7 Root_NFS = MKDEV(UNNAMED_MAJOR, 255), 9 Root_NFS = MKDEV(UNNAMED_MAJOR, 255),
diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h
index 658afb37c3f5..7b524b4109a0 100644
--- a/include/linux/rwsem.h
+++ b/include/linux/rwsem.h
@@ -61,12 +61,25 @@ extern void downgrade_write(struct rw_semaphore *sem);
61 61
62#ifdef CONFIG_DEBUG_LOCK_ALLOC 62#ifdef CONFIG_DEBUG_LOCK_ALLOC
63/* 63/*
64 * nested locking: 64 * nested locking. NOTE: rwsems are not allowed to recurse
65 * (which occurs if the same task tries to acquire the same
66 * lock instance multiple times), but multiple locks of the
67 * same lock class might be taken, if the order of the locks
68 * is always the same. This ordering rule can be expressed
69 * to lockdep via the _nested() APIs, but enumerating the
70 * subclasses that are used. (If the nesting relationship is
71 * static then another method for expressing nested locking is
72 * the explicit definition of lock class keys and the use of
73 * lockdep_set_class() at lock initialization time.
74 * See Documentation/lockdep-design.txt for more details.)
65 */ 75 */
66extern void down_read_nested(struct rw_semaphore *sem, int subclass); 76extern void down_read_nested(struct rw_semaphore *sem, int subclass);
67extern void down_write_nested(struct rw_semaphore *sem, int subclass); 77extern void down_write_nested(struct rw_semaphore *sem, int subclass);
68/* 78/*
69 * Take/release a lock when not the owner will release it: 79 * Take/release a lock when not the owner will release it.
80 *
81 * [ This API should be avoided as much as possible - the
82 * proper abstraction for this case is completions. ]
70 */ 83 */
71extern void down_read_non_owner(struct rw_semaphore *sem); 84extern void down_read_non_owner(struct rw_semaphore *sem);
72extern void up_read_non_owner(struct rw_semaphore *sem); 85extern void up_read_non_owner(struct rw_semaphore *sem);
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 1c876e27ff93..34ed0d99b1bd 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -463,6 +463,10 @@ struct signal_struct {
463#ifdef CONFIG_BSD_PROCESS_ACCT 463#ifdef CONFIG_BSD_PROCESS_ACCT
464 struct pacct_struct pacct; /* per-process accounting information */ 464 struct pacct_struct pacct; /* per-process accounting information */
465#endif 465#endif
466#ifdef CONFIG_TASKSTATS
467 spinlock_t stats_lock;
468 struct taskstats *stats;
469#endif
466}; 470};
467 471
468/* Context switch must be unlocked if interrupts are to be enabled */ 472/* Context switch must be unlocked if interrupts are to be enabled */
@@ -537,7 +541,7 @@ extern struct user_struct root_user;
537struct backing_dev_info; 541struct backing_dev_info;
538struct reclaim_state; 542struct reclaim_state;
539 543
540#ifdef CONFIG_SCHEDSTATS 544#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT)
541struct sched_info { 545struct sched_info {
542 /* cumulative counters */ 546 /* cumulative counters */
543 unsigned long cpu_time, /* time spent on the cpu */ 547 unsigned long cpu_time, /* time spent on the cpu */
@@ -548,9 +552,53 @@ struct sched_info {
548 unsigned long last_arrival, /* when we last ran on a cpu */ 552 unsigned long last_arrival, /* when we last ran on a cpu */
549 last_queued; /* when we were last queued to run */ 553 last_queued; /* when we were last queued to run */
550}; 554};
555#endif /* defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) */
551 556
557#ifdef CONFIG_SCHEDSTATS
552extern struct file_operations proc_schedstat_operations; 558extern struct file_operations proc_schedstat_operations;
559#endif /* CONFIG_SCHEDSTATS */
560
561#ifdef CONFIG_TASK_DELAY_ACCT
562struct task_delay_info {
563 spinlock_t lock;
564 unsigned int flags; /* Private per-task flags */
565
566 /* For each stat XXX, add following, aligned appropriately
567 *
568 * struct timespec XXX_start, XXX_end;
569 * u64 XXX_delay;
570 * u32 XXX_count;
571 *
572 * Atomicity of updates to XXX_delay, XXX_count protected by
573 * single lock above (split into XXX_lock if contention is an issue).
574 */
575
576 /*
577 * XXX_count is incremented on every XXX operation, the delay
578 * associated with the operation is added to XXX_delay.
579 * XXX_delay contains the accumulated delay time in nanoseconds.
580 */
581 struct timespec blkio_start, blkio_end; /* Shared by blkio, swapin */
582 u64 blkio_delay; /* wait for sync block io completion */
583 u64 swapin_delay; /* wait for swapin block io completion */
584 u32 blkio_count; /* total count of the number of sync block */
585 /* io operations performed */
586 u32 swapin_count; /* total count of the number of swapin block */
587 /* io operations performed */
588};
589#endif /* CONFIG_TASK_DELAY_ACCT */
590
591static inline int sched_info_on(void)
592{
593#ifdef CONFIG_SCHEDSTATS
594 return 1;
595#elif defined(CONFIG_TASK_DELAY_ACCT)
596 extern int delayacct_on;
597 return delayacct_on;
598#else
599 return 0;
553#endif 600#endif
601}
554 602
555enum idle_type 603enum idle_type
556{ 604{
@@ -747,7 +795,7 @@ struct task_struct {
747 cpumask_t cpus_allowed; 795 cpumask_t cpus_allowed;
748 unsigned int time_slice, first_time_slice; 796 unsigned int time_slice, first_time_slice;
749 797
750#ifdef CONFIG_SCHEDSTATS 798#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT)
751 struct sched_info sched_info; 799 struct sched_info sched_info;
752#endif 800#endif
753 801
@@ -945,6 +993,9 @@ struct task_struct {
945 * cache last used pipe for splice 993 * cache last used pipe for splice
946 */ 994 */
947 struct pipe_inode_info *splice_pipe; 995 struct pipe_inode_info *splice_pipe;
996#ifdef CONFIG_TASK_DELAY_ACCT
997 struct task_delay_info *delays;
998#endif
948}; 999};
949 1000
950static inline pid_t process_group(struct task_struct *tsk) 1001static inline pid_t process_group(struct task_struct *tsk)
@@ -1506,6 +1557,14 @@ static inline void freeze(struct task_struct *p)
1506} 1557}
1507 1558
1508/* 1559/*
1560 * Sometimes we may need to cancel the previous 'freeze' request
1561 */
1562static inline void do_not_freeze(struct task_struct *p)
1563{
1564 p->flags &= ~PF_FREEZE;
1565}
1566
1567/*
1509 * Wake up a frozen process 1568 * Wake up a frozen process
1510 */ 1569 */
1511static inline int thaw_process(struct task_struct *p) 1570static inline int thaw_process(struct task_struct *p)
diff --git a/include/linux/security.h b/include/linux/security.h
index f75303831d09..6bc2aad494ff 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -1109,6 +1109,16 @@ struct swap_info_struct;
1109 * @name contains the name of the security module being unstacked. 1109 * @name contains the name of the security module being unstacked.
1110 * @ops contains a pointer to the struct security_operations of the module to unstack. 1110 * @ops contains a pointer to the struct security_operations of the module to unstack.
1111 * 1111 *
1112 * @secid_to_secctx:
1113 * Convert secid to security context.
1114 * @secid contains the security ID.
1115 * @secdata contains the pointer that stores the converted security context.
1116 *
1117 * @release_secctx:
1118 * Release the security context.
1119 * @secdata contains the security context.
1120 * @seclen contains the length of the security context.
1121 *
1112 * This is the main security structure. 1122 * This is the main security structure.
1113 */ 1123 */
1114struct security_operations { 1124struct security_operations {
@@ -1289,6 +1299,8 @@ struct security_operations {
1289 1299
1290 int (*getprocattr)(struct task_struct *p, char *name, void *value, size_t size); 1300 int (*getprocattr)(struct task_struct *p, char *name, void *value, size_t size);
1291 int (*setprocattr)(struct task_struct *p, char *name, void *value, size_t size); 1301 int (*setprocattr)(struct task_struct *p, char *name, void *value, size_t size);
1302 int (*secid_to_secctx)(u32 secid, char **secdata, u32 *seclen);
1303 void (*release_secctx)(char *secdata, u32 seclen);
1292 1304
1293#ifdef CONFIG_SECURITY_NETWORK 1305#ifdef CONFIG_SECURITY_NETWORK
1294 int (*unix_stream_connect) (struct socket * sock, 1306 int (*unix_stream_connect) (struct socket * sock,
@@ -1317,7 +1329,7 @@ struct security_operations {
1317 int (*socket_shutdown) (struct socket * sock, int how); 1329 int (*socket_shutdown) (struct socket * sock, int how);
1318 int (*socket_sock_rcv_skb) (struct sock * sk, struct sk_buff * skb); 1330 int (*socket_sock_rcv_skb) (struct sock * sk, struct sk_buff * skb);
1319 int (*socket_getpeersec_stream) (struct socket *sock, char __user *optval, int __user *optlen, unsigned len); 1331 int (*socket_getpeersec_stream) (struct socket *sock, char __user *optval, int __user *optlen, unsigned len);
1320 int (*socket_getpeersec_dgram) (struct sk_buff *skb, char **secdata, u32 *seclen); 1332 int (*socket_getpeersec_dgram) (struct socket *sock, struct sk_buff *skb, u32 *secid);
1321 int (*sk_alloc_security) (struct sock *sk, int family, gfp_t priority); 1333 int (*sk_alloc_security) (struct sock *sk, int family, gfp_t priority);
1322 void (*sk_free_security) (struct sock *sk); 1334 void (*sk_free_security) (struct sock *sk);
1323 unsigned int (*sk_getsid) (struct sock *sk, struct flowi *fl, u8 dir); 1335 unsigned int (*sk_getsid) (struct sock *sk, struct flowi *fl, u8 dir);
@@ -2059,6 +2071,16 @@ static inline int security_netlink_recv(struct sk_buff * skb, int cap)
2059 return security_ops->netlink_recv(skb, cap); 2071 return security_ops->netlink_recv(skb, cap);
2060} 2072}
2061 2073
2074static inline int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen)
2075{
2076 return security_ops->secid_to_secctx(secid, secdata, seclen);
2077}
2078
2079static inline void security_release_secctx(char *secdata, u32 seclen)
2080{
2081 return security_ops->release_secctx(secdata, seclen);
2082}
2083
2062/* prototypes */ 2084/* prototypes */
2063extern int security_init (void); 2085extern int security_init (void);
2064extern int register_security (struct security_operations *ops); 2086extern int register_security (struct security_operations *ops);
@@ -2725,6 +2747,14 @@ static inline void securityfs_remove(struct dentry *dentry)
2725{ 2747{
2726} 2748}
2727 2749
2750static inline int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen)
2751{
2752 return -EOPNOTSUPP;
2753}
2754
2755static inline void security_release_secctx(char *secdata, u32 seclen)
2756{
2757}
2728#endif /* CONFIG_SECURITY */ 2758#endif /* CONFIG_SECURITY */
2729 2759
2730#ifdef CONFIG_SECURITY_NETWORK 2760#ifdef CONFIG_SECURITY_NETWORK
@@ -2840,10 +2870,9 @@ static inline int security_socket_getpeersec_stream(struct socket *sock, char __
2840 return security_ops->socket_getpeersec_stream(sock, optval, optlen, len); 2870 return security_ops->socket_getpeersec_stream(sock, optval, optlen, len);
2841} 2871}
2842 2872
2843static inline int security_socket_getpeersec_dgram(struct sk_buff *skb, char **secdata, 2873static inline int security_socket_getpeersec_dgram(struct socket *sock, struct sk_buff *skb, u32 *secid)
2844 u32 *seclen)
2845{ 2874{
2846 return security_ops->socket_getpeersec_dgram(skb, secdata, seclen); 2875 return security_ops->socket_getpeersec_dgram(sock, skb, secid);
2847} 2876}
2848 2877
2849static inline int security_sk_alloc(struct sock *sk, int family, gfp_t priority) 2878static inline int security_sk_alloc(struct sock *sk, int family, gfp_t priority)
@@ -2968,8 +2997,7 @@ static inline int security_socket_getpeersec_stream(struct socket *sock, char __
2968 return -ENOPROTOOPT; 2997 return -ENOPROTOOPT;
2969} 2998}
2970 2999
2971static inline int security_socket_getpeersec_dgram(struct sk_buff *skb, char **secdata, 3000static inline int security_socket_getpeersec_dgram(struct socket *sock, struct sk_buff *skb, u32 *secid)
2972 u32 *seclen)
2973{ 3001{
2974 return -ENOPROTOOPT; 3002 return -ENOPROTOOPT;
2975} 3003}
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 058cba70818a..86501a3de2ac 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -227,6 +227,7 @@ struct uart_port {
227#define UPIO_MEM (2) 227#define UPIO_MEM (2)
228#define UPIO_MEM32 (3) 228#define UPIO_MEM32 (3)
229#define UPIO_AU (4) /* Au1x00 type IO */ 229#define UPIO_AU (4) /* Au1x00 type IO */
230#define UPIO_TSI (5) /* Tsi108/109 type IO */
230 231
231 unsigned int read_status_mask; /* driver specific */ 232 unsigned int read_status_mask; /* driver specific */
232 unsigned int ignore_status_mask; /* driver specific */ 233 unsigned int ignore_status_mask; /* driver specific */
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 3597b4f14389..755e9cddac47 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -604,12 +604,17 @@ static inline __u32 skb_queue_len(const struct sk_buff_head *list_)
604 return list_->qlen; 604 return list_->qlen;
605} 605}
606 606
607extern struct lock_class_key skb_queue_lock_key; 607/*
608 608 * This function creates a split out lock class for each invocation;
609 * this is needed for now since a whole lot of users of the skb-queue
610 * infrastructure in drivers have different locking usage (in hardirq)
611 * than the networking core (in softirq only). In the long run either the
612 * network layer or drivers should need annotation to consolidate the
613 * main types of usage into 3 classes.
614 */
609static inline void skb_queue_head_init(struct sk_buff_head *list) 615static inline void skb_queue_head_init(struct sk_buff_head *list)
610{ 616{
611 spin_lock_init(&list->lock); 617 spin_lock_init(&list->lock);
612 lockdep_set_class(&list->lock, &skb_queue_lock_key);
613 list->prev = list->next = (struct sk_buff *)list; 618 list->prev = list->next = (struct sk_buff *)list;
614 list->qlen = 0; 619 list->qlen = 0;
615} 620}
@@ -1035,6 +1040,21 @@ static inline int pskb_trim(struct sk_buff *skb, unsigned int len)
1035} 1040}
1036 1041
1037/** 1042/**
1043 * pskb_trim_unique - remove end from a paged unique (not cloned) buffer
1044 * @skb: buffer to alter
1045 * @len: new length
1046 *
1047 * This is identical to pskb_trim except that the caller knows that
1048 * the skb is not cloned so we should never get an error due to out-
1049 * of-memory.
1050 */
1051static inline void pskb_trim_unique(struct sk_buff *skb, unsigned int len)
1052{
1053 int err = pskb_trim(skb, len);
1054 BUG_ON(err);
1055}
1056
1057/**
1038 * skb_orphan - orphan a buffer 1058 * skb_orphan - orphan a buffer
1039 * @skb: buffer to orphan 1059 * @skb: buffer to orphan
1040 * 1060 *
@@ -1066,9 +1086,8 @@ static inline void __skb_queue_purge(struct sk_buff_head *list)
1066 kfree_skb(skb); 1086 kfree_skb(skb);
1067} 1087}
1068 1088
1069#ifndef CONFIG_HAVE_ARCH_DEV_ALLOC_SKB
1070/** 1089/**
1071 * __dev_alloc_skb - allocate an skbuff for sending 1090 * __dev_alloc_skb - allocate an skbuff for receiving
1072 * @length: length to allocate 1091 * @length: length to allocate
1073 * @gfp_mask: get_free_pages mask, passed to alloc_skb 1092 * @gfp_mask: get_free_pages mask, passed to alloc_skb
1074 * 1093 *
@@ -1077,7 +1096,7 @@ static inline void __skb_queue_purge(struct sk_buff_head *list)
1077 * the headroom they think they need without accounting for the 1096 * the headroom they think they need without accounting for the
1078 * built in space. The built in space is used for optimisations. 1097 * built in space. The built in space is used for optimisations.
1079 * 1098 *
1080 * %NULL is returned in there is no free memory. 1099 * %NULL is returned if there is no free memory.
1081 */ 1100 */
1082static inline struct sk_buff *__dev_alloc_skb(unsigned int length, 1101static inline struct sk_buff *__dev_alloc_skb(unsigned int length,
1083 gfp_t gfp_mask) 1102 gfp_t gfp_mask)
@@ -1087,12 +1106,9 @@ static inline struct sk_buff *__dev_alloc_skb(unsigned int length,
1087 skb_reserve(skb, NET_SKB_PAD); 1106 skb_reserve(skb, NET_SKB_PAD);
1088 return skb; 1107 return skb;
1089} 1108}
1090#else
1091extern struct sk_buff *__dev_alloc_skb(unsigned int length, int gfp_mask);
1092#endif
1093 1109
1094/** 1110/**
1095 * dev_alloc_skb - allocate an skbuff for sending 1111 * dev_alloc_skb - allocate an skbuff for receiving
1096 * @length: length to allocate 1112 * @length: length to allocate
1097 * 1113 *
1098 * Allocate a new &sk_buff and assign it a usage count of one. The 1114 * Allocate a new &sk_buff and assign it a usage count of one. The
@@ -1100,7 +1116,7 @@ extern struct sk_buff *__dev_alloc_skb(unsigned int length, int gfp_mask);
1100 * the headroom they think they need without accounting for the 1116 * the headroom they think they need without accounting for the
1101 * built in space. The built in space is used for optimisations. 1117 * built in space. The built in space is used for optimisations.
1102 * 1118 *
1103 * %NULL is returned in there is no free memory. Although this function 1119 * %NULL is returned if there is no free memory. Although this function
1104 * allocates memory it can be called from an interrupt. 1120 * allocates memory it can be called from an interrupt.
1105 */ 1121 */
1106static inline struct sk_buff *dev_alloc_skb(unsigned int length) 1122static inline struct sk_buff *dev_alloc_skb(unsigned int length)
@@ -1108,6 +1124,28 @@ static inline struct sk_buff *dev_alloc_skb(unsigned int length)
1108 return __dev_alloc_skb(length, GFP_ATOMIC); 1124 return __dev_alloc_skb(length, GFP_ATOMIC);
1109} 1125}
1110 1126
1127extern struct sk_buff *__netdev_alloc_skb(struct net_device *dev,
1128 unsigned int length, gfp_t gfp_mask);
1129
1130/**
1131 * netdev_alloc_skb - allocate an skbuff for rx on a specific device
1132 * @dev: network device to receive on
1133 * @length: length to allocate
1134 *
1135 * Allocate a new &sk_buff and assign it a usage count of one. The
1136 * buffer has unspecified headroom built in. Users should allocate
1137 * the headroom they think they need without accounting for the
1138 * built in space. The built in space is used for optimisations.
1139 *
1140 * %NULL is returned if there is no free memory. Although this function
1141 * allocates memory it can be called from an interrupt.
1142 */
1143static inline struct sk_buff *netdev_alloc_skb(struct net_device *dev,
1144 unsigned int length)
1145{
1146 return __netdev_alloc_skb(dev, length, GFP_ATOMIC);
1147}
1148
1111/** 1149/**
1112 * skb_cow - copy header of skb when it is required 1150 * skb_cow - copy header of skb when it is required
1113 * @skb: buffer to cow 1151 * @skb: buffer to cow
@@ -1455,5 +1493,10 @@ static inline void skb_init_secmark(struct sk_buff *skb)
1455{ } 1493{ }
1456#endif 1494#endif
1457 1495
1496static inline int skb_is_gso(const struct sk_buff *skb)
1497{
1498 return skb_shinfo(skb)->gso_size;
1499}
1500
1458#endif /* __KERNEL__ */ 1501#endif /* __KERNEL__ */
1459#endif /* _LINUX_SKBUFF_H */ 1502#endif /* _LINUX_SKBUFF_H */
diff --git a/include/linux/sunrpc/rpc_pipe_fs.h b/include/linux/sunrpc/rpc_pipe_fs.h
index 2c2189cb30aa..a481472c9484 100644
--- a/include/linux/sunrpc/rpc_pipe_fs.h
+++ b/include/linux/sunrpc/rpc_pipe_fs.h
@@ -42,9 +42,9 @@ RPC_I(struct inode *inode)
42extern int rpc_queue_upcall(struct inode *, struct rpc_pipe_msg *); 42extern int rpc_queue_upcall(struct inode *, struct rpc_pipe_msg *);
43 43
44extern struct dentry *rpc_mkdir(char *, struct rpc_clnt *); 44extern struct dentry *rpc_mkdir(char *, struct rpc_clnt *);
45extern int rpc_rmdir(char *); 45extern int rpc_rmdir(struct dentry *);
46extern struct dentry *rpc_mkpipe(char *, void *, struct rpc_pipe_ops *, int flags); 46extern struct dentry *rpc_mkpipe(char *, void *, struct rpc_pipe_ops *, int flags);
47extern int rpc_unlink(char *); 47extern int rpc_unlink(struct dentry *);
48extern struct vfsmount *rpc_get_mount(void); 48extern struct vfsmount *rpc_get_mount(void);
49extern void rpc_put_mount(void); 49extern void rpc_put_mount(void);
50 50
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index e8bbe8118de8..3a0cca255b76 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -37,7 +37,7 @@ extern unsigned int xprt_max_resvport;
37 37
38#define RPC_MIN_RESVPORT (1U) 38#define RPC_MIN_RESVPORT (1U)
39#define RPC_MAX_RESVPORT (65535U) 39#define RPC_MAX_RESVPORT (65535U)
40#define RPC_DEF_MIN_RESVPORT (650U) 40#define RPC_DEF_MIN_RESVPORT (665U)
41#define RPC_DEF_MAX_RESVPORT (1023U) 41#define RPC_DEF_MAX_RESVPORT (1023U)
42 42
43/* 43/*
@@ -229,7 +229,7 @@ int xprt_reserve_xprt(struct rpc_task *task);
229int xprt_reserve_xprt_cong(struct rpc_task *task); 229int xprt_reserve_xprt_cong(struct rpc_task *task);
230int xprt_prepare_transmit(struct rpc_task *task); 230int xprt_prepare_transmit(struct rpc_task *task);
231void xprt_transmit(struct rpc_task *task); 231void xprt_transmit(struct rpc_task *task);
232void xprt_abort_transmit(struct rpc_task *task); 232void xprt_end_transmit(struct rpc_task *task);
233int xprt_adjust_timeout(struct rpc_rqst *req); 233int xprt_adjust_timeout(struct rpc_rqst *req);
234void xprt_release_xprt(struct rpc_xprt *xprt, struct rpc_task *task); 234void xprt_release_xprt(struct rpc_xprt *xprt, struct rpc_task *task);
235void xprt_release_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task); 235void xprt_release_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task);
diff --git a/include/linux/taskstats.h b/include/linux/taskstats.h
new file mode 100644
index 000000000000..f1cb6cddd19d
--- /dev/null
+++ b/include/linux/taskstats.h
@@ -0,0 +1,137 @@
1/* taskstats.h - exporting per-task statistics
2 *
3 * Copyright (C) Shailabh Nagar, IBM Corp. 2006
4 * (C) Balbir Singh, IBM Corp. 2006
5 *
6 * 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 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it would be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 */
14
15#ifndef _LINUX_TASKSTATS_H
16#define _LINUX_TASKSTATS_H
17
18/* Format for per-task data returned to userland when
19 * - a task exits
20 * - listener requests stats for a task
21 *
22 * The struct is versioned. Newer versions should only add fields to
23 * the bottom of the struct to maintain backward compatibility.
24 *
25 *
26 * To add new fields
27 * a) bump up TASKSTATS_VERSION
28 * b) add comment indicating new version number at end of struct
29 * c) add new fields after version comment; maintain 64-bit alignment
30 */
31
32#define TASKSTATS_VERSION 1
33
34struct taskstats {
35
36 /* Version 1 */
37 __u16 version;
38 __u16 padding[3]; /* Userspace should not interpret the padding
39 * field which can be replaced by useful
40 * fields if struct taskstats is extended.
41 */
42
43 /* Delay accounting fields start
44 *
45 * All values, until comment "Delay accounting fields end" are
46 * available only if delay accounting is enabled, even though the last
47 * few fields are not delays
48 *
49 * xxx_count is the number of delay values recorded
50 * xxx_delay_total is the corresponding cumulative delay in nanoseconds
51 *
52 * xxx_delay_total wraps around to zero on overflow
53 * xxx_count incremented regardless of overflow
54 */
55
56 /* Delay waiting for cpu, while runnable
57 * count, delay_total NOT updated atomically
58 */
59 __u64 cpu_count;
60 __u64 cpu_delay_total;
61
62 /* Following four fields atomically updated using task->delays->lock */
63
64 /* Delay waiting for synchronous block I/O to complete
65 * does not account for delays in I/O submission
66 */
67 __u64 blkio_count;
68 __u64 blkio_delay_total;
69
70 /* Delay waiting for page fault I/O (swap in only) */
71 __u64 swapin_count;
72 __u64 swapin_delay_total;
73
74 /* cpu "wall-clock" running time
75 * On some architectures, value will adjust for cpu time stolen
76 * from the kernel in involuntary waits due to virtualization.
77 * Value is cumulative, in nanoseconds, without a corresponding count
78 * and wraps around to zero silently on overflow
79 */
80 __u64 cpu_run_real_total;
81
82 /* cpu "virtual" running time
83 * Uses time intervals seen by the kernel i.e. no adjustment
84 * for kernel's involuntary waits due to virtualization.
85 * Value is cumulative, in nanoseconds, without a corresponding count
86 * and wraps around to zero silently on overflow
87 */
88 __u64 cpu_run_virtual_total;
89 /* Delay accounting fields end */
90 /* version 1 ends here */
91};
92
93
94/*
95 * Commands sent from userspace
96 * Not versioned. New commands should only be inserted at the enum's end
97 * prior to __TASKSTATS_CMD_MAX
98 */
99
100enum {
101 TASKSTATS_CMD_UNSPEC = 0, /* Reserved */
102 TASKSTATS_CMD_GET, /* user->kernel request/get-response */
103 TASKSTATS_CMD_NEW, /* kernel->user event */
104 __TASKSTATS_CMD_MAX,
105};
106
107#define TASKSTATS_CMD_MAX (__TASKSTATS_CMD_MAX - 1)
108
109enum {
110 TASKSTATS_TYPE_UNSPEC = 0, /* Reserved */
111 TASKSTATS_TYPE_PID, /* Process id */
112 TASKSTATS_TYPE_TGID, /* Thread group id */
113 TASKSTATS_TYPE_STATS, /* taskstats structure */
114 TASKSTATS_TYPE_AGGR_PID, /* contains pid + stats */
115 TASKSTATS_TYPE_AGGR_TGID, /* contains tgid + stats */
116 __TASKSTATS_TYPE_MAX,
117};
118
119#define TASKSTATS_TYPE_MAX (__TASKSTATS_TYPE_MAX - 1)
120
121enum {
122 TASKSTATS_CMD_ATTR_UNSPEC = 0,
123 TASKSTATS_CMD_ATTR_PID,
124 TASKSTATS_CMD_ATTR_TGID,
125 TASKSTATS_CMD_ATTR_REGISTER_CPUMASK,
126 TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK,
127 __TASKSTATS_CMD_ATTR_MAX,
128};
129
130#define TASKSTATS_CMD_ATTR_MAX (__TASKSTATS_CMD_ATTR_MAX - 1)
131
132/* NETLINK_GENERIC related info */
133
134#define TASKSTATS_GENL_NAME "TASKSTATS"
135#define TASKSTATS_GENL_VERSION 0x1
136
137#endif /* _LINUX_TASKSTATS_H */
diff --git a/include/linux/taskstats_kern.h b/include/linux/taskstats_kern.h
new file mode 100644
index 000000000000..16894b7edcc8
--- /dev/null
+++ b/include/linux/taskstats_kern.h
@@ -0,0 +1,89 @@
1/* taskstats_kern.h - kernel header for per-task statistics interface
2 *
3 * Copyright (C) Shailabh Nagar, IBM Corp. 2006
4 * (C) Balbir Singh, IBM Corp. 2006
5 */
6
7#ifndef _LINUX_TASKSTATS_KERN_H
8#define _LINUX_TASKSTATS_KERN_H
9
10#include <linux/taskstats.h>
11#include <linux/sched.h>
12#include <net/genetlink.h>
13
14#ifdef CONFIG_TASKSTATS
15extern kmem_cache_t *taskstats_cache;
16extern struct mutex taskstats_exit_mutex;
17
18static inline void taskstats_exit_free(struct taskstats *tidstats)
19{
20 if (tidstats)
21 kmem_cache_free(taskstats_cache, tidstats);
22}
23
24static inline void taskstats_tgid_init(struct signal_struct *sig)
25{
26 spin_lock_init(&sig->stats_lock);
27 sig->stats = NULL;
28}
29
30static inline void taskstats_tgid_alloc(struct signal_struct *sig)
31{
32 struct taskstats *stats;
33 unsigned long flags;
34
35 stats = kmem_cache_zalloc(taskstats_cache, SLAB_KERNEL);
36 if (!stats)
37 return;
38
39 spin_lock_irqsave(&sig->stats_lock, flags);
40 if (!sig->stats) {
41 sig->stats = stats;
42 stats = NULL;
43 }
44 spin_unlock_irqrestore(&sig->stats_lock, flags);
45
46 if (stats)
47 kmem_cache_free(taskstats_cache, stats);
48}
49
50static inline void taskstats_tgid_free(struct signal_struct *sig)
51{
52 struct taskstats *stats = NULL;
53 unsigned long flags;
54
55 spin_lock_irqsave(&sig->stats_lock, flags);
56 if (sig->stats) {
57 stats = sig->stats;
58 sig->stats = NULL;
59 }
60 spin_unlock_irqrestore(&sig->stats_lock, flags);
61 if (stats)
62 kmem_cache_free(taskstats_cache, stats);
63}
64
65extern void taskstats_exit_alloc(struct taskstats **, unsigned int *);
66extern void taskstats_exit_send(struct task_struct *, struct taskstats *, int, unsigned int);
67extern void taskstats_init_early(void);
68extern void taskstats_tgid_alloc(struct signal_struct *);
69#else
70static inline void taskstats_exit_alloc(struct taskstats **ptidstats, unsigned int *mycpu)
71{}
72static inline void taskstats_exit_free(struct taskstats *ptidstats)
73{}
74static inline void taskstats_exit_send(struct task_struct *tsk,
75 struct taskstats *tidstats,
76 int group_dead, unsigned int cpu)
77{}
78static inline void taskstats_tgid_init(struct signal_struct *sig)
79{}
80static inline void taskstats_tgid_alloc(struct signal_struct *sig)
81{}
82static inline void taskstats_tgid_free(struct signal_struct *sig)
83{}
84static inline void taskstats_init_early(void)
85{}
86#endif /* CONFIG_TASKSTATS */
87
88#endif
89
diff --git a/include/linux/time.h b/include/linux/time.h
index c05f8bb9a323..a5b739967b74 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -71,6 +71,18 @@ extern unsigned long mktime(const unsigned int year, const unsigned int mon,
71extern void set_normalized_timespec(struct timespec *ts, time_t sec, long nsec); 71extern void set_normalized_timespec(struct timespec *ts, time_t sec, long nsec);
72 72
73/* 73/*
74 * sub = lhs - rhs, in normalized form
75 */
76static inline struct timespec timespec_sub(struct timespec lhs,
77 struct timespec rhs)
78{
79 struct timespec ts_delta;
80 set_normalized_timespec(&ts_delta, lhs.tv_sec - rhs.tv_sec,
81 lhs.tv_nsec - rhs.tv_nsec);
82 return ts_delta;
83}
84
85/*
74 * Returns true if the timespec is norm, false if denorm: 86 * Returns true if the timespec is norm, false if denorm:
75 */ 87 */
76#define timespec_valid(ts) \ 88#define timespec_valid(ts) \
diff --git a/include/linux/timex.h b/include/linux/timex.h
index 19bb6538b49e..d543d3871e38 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -57,7 +57,6 @@
57#include <linux/time.h> 57#include <linux/time.h>
58 58
59#include <asm/param.h> 59#include <asm/param.h>
60#include <asm/timex.h>
61 60
62/* 61/*
63 * SHIFT_KG and SHIFT_KF establish the damping of the PLL and are chosen 62 * SHIFT_KG and SHIFT_KF establish the damping of the PLL and are chosen
@@ -191,6 +190,8 @@ struct timex {
191#define TIME_BAD TIME_ERROR /* bw compat */ 190#define TIME_BAD TIME_ERROR /* bw compat */
192 191
193#ifdef __KERNEL__ 192#ifdef __KERNEL__
193#include <asm/timex.h>
194
194/* 195/*
195 * kernel variables 196 * kernel variables
196 * Note: maximum error = NTP synch distance = dispersion + delay / 2; 197 * Note: maximum error = NTP synch distance = dispersion + delay / 2;
diff --git a/include/linux/tty.h b/include/linux/tty.h
index b3b807e4b050..04827ca65781 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -5,16 +5,6 @@
5 * 'tty.h' defines some structures used by tty_io.c and some defines. 5 * 'tty.h' defines some structures used by tty_io.c and some defines.
6 */ 6 */
7 7
8/*
9 * These constants are also useful for user-level apps (e.g., VC
10 * resizing).
11 */
12#define MIN_NR_CONSOLES 1 /* must be at least 1 */
13#define MAX_NR_CONSOLES 63 /* serial lines start at 64 */
14#define MAX_NR_USER_CONSOLES 63 /* must be root to allocate above this */
15 /* Note: the ioctl VT_GETSTATE does not work for
16 consoles 16 and higher (since it returns a short) */
17
18#ifdef __KERNEL__ 8#ifdef __KERNEL__
19#include <linux/fs.h> 9#include <linux/fs.h>
20#include <linux/major.h> 10#include <linux/major.h>
@@ -22,7 +12,6 @@
22#include <linux/workqueue.h> 12#include <linux/workqueue.h>
23#include <linux/tty_driver.h> 13#include <linux/tty_driver.h>
24#include <linux/tty_ldisc.h> 14#include <linux/tty_ldisc.h>
25#include <linux/screen_info.h>
26#include <linux/mutex.h> 15#include <linux/mutex.h>
27 16
28#include <asm/system.h> 17#include <asm/system.h>
@@ -70,6 +59,7 @@ struct tty_bufhead {
70 struct tty_buffer *head; /* Queue head */ 59 struct tty_buffer *head; /* Queue head */
71 struct tty_buffer *tail; /* Active buffer */ 60 struct tty_buffer *tail; /* Active buffer */
72 struct tty_buffer *free; /* Free queue head */ 61 struct tty_buffer *free; /* Free queue head */
62 int memory_used; /* Buffer space used excluding free queue */
73}; 63};
74/* 64/*
75 * The pty uses char_buf and flag_buf as a contiguous buffer 65 * The pty uses char_buf and flag_buf as a contiguous buffer
@@ -270,7 +260,6 @@ struct tty_struct {
270extern void tty_write_flush(struct tty_struct *); 260extern void tty_write_flush(struct tty_struct *);
271 261
272extern struct termios tty_std_termios; 262extern struct termios tty_std_termios;
273extern int fg_console, last_console, want_console;
274 263
275extern int kmsg_redirect; 264extern int kmsg_redirect;
276 265
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 8dead32e7ebf..d2bd0c8e0154 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -48,7 +48,7 @@ struct ep_device;
48 * @urb_list: urbs queued to this endpoint; maintained by usbcore 48 * @urb_list: urbs queued to this endpoint; maintained by usbcore
49 * @hcpriv: for use by HCD; typically holds hardware dma queue head (QH) 49 * @hcpriv: for use by HCD; typically holds hardware dma queue head (QH)
50 * with one or more transfer descriptors (TDs) per urb 50 * with one or more transfer descriptors (TDs) per urb
51 * @kobj: kobject for sysfs info 51 * @ep_dev: ep_device for sysfs info
52 * @extra: descriptors following this endpoint in the configuration 52 * @extra: descriptors following this endpoint in the configuration
53 * @extralen: how many bytes of "extra" are valid 53 * @extralen: how many bytes of "extra" are valid
54 * 54 *
@@ -103,8 +103,7 @@ enum usb_interface_condition {
103 * @condition: binding state of the interface: not bound, binding 103 * @condition: binding state of the interface: not bound, binding
104 * (in probe()), bound to a driver, or unbinding (in disconnect()) 104 * (in probe()), bound to a driver, or unbinding (in disconnect())
105 * @dev: driver model's view of this device 105 * @dev: driver model's view of this device
106 * @usb_dev: if an interface is bound to the USB major, this will point 106 * @class_dev: driver model's class view of this device.
107 * to the sysfs representation for that device.
108 * 107 *
109 * USB device drivers attach to interfaces on a physical device. Each 108 * USB device drivers attach to interfaces on a physical device. Each
110 * interface encapsulates a single high level function, such as feeding 109 * interface encapsulates a single high level function, such as feeding
@@ -144,7 +143,7 @@ struct usb_interface {
144 * bound to */ 143 * bound to */
145 enum usb_interface_condition condition; /* state of binding */ 144 enum usb_interface_condition condition; /* state of binding */
146 struct device dev; /* interface specific device info */ 145 struct device dev; /* interface specific device info */
147 struct device *usb_dev; /* pointer to the usb class's device, if any */ 146 struct class_device *class_dev;
148}; 147};
149#define to_usb_interface(d) container_of(d, struct usb_interface, dev) 148#define to_usb_interface(d) container_of(d, struct usb_interface, dev)
150#define interface_to_usbdev(intf) \ 149#define interface_to_usbdev(intf) \
@@ -361,7 +360,7 @@ struct usb_device {
361 char *serial; /* iSerialNumber string, if present */ 360 char *serial; /* iSerialNumber string, if present */
362 361
363 struct list_head filelist; 362 struct list_head filelist;
364 struct device *usbfs_dev; 363 struct class_device *class_dev;
365 struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */ 364 struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */
366 365
367 /* 366 /*
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
new file mode 100644
index 000000000000..91c983eef899
--- /dev/null
+++ b/include/linux/usb/serial.h
@@ -0,0 +1,300 @@
1/*
2 * USB Serial Converter stuff
3 *
4 * Copyright (C) 1999 - 2005
5 * Greg Kroah-Hartman (greg@kroah.com)
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 */
12
13
14#ifndef __LINUX_USB_SERIAL_H
15#define __LINUX_USB_SERIAL_H
16
17#include <linux/kref.h>
18#include <linux/mutex.h>
19
20#define SERIAL_TTY_MAJOR 188 /* Nice legal number now */
21#define SERIAL_TTY_MINORS 255 /* loads of devices :) */
22
23#define MAX_NUM_PORTS 8 /* The maximum number of ports one device can grab at once */
24
25/* parity check flag */
26#define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK))
27
28/**
29 * usb_serial_port: structure for the specific ports of a device.
30 * @serial: pointer back to the struct usb_serial owner of this port.
31 * @tty: pointer to the corresponding tty for this port.
32 * @lock: spinlock to grab when updating portions of this structure.
33 * @mutex: mutex used to synchronize serial_open() and serial_close()
34 * access for this port.
35 * @number: the number of the port (the minor number).
36 * @interrupt_in_buffer: pointer to the interrupt in buffer for this port.
37 * @interrupt_in_urb: pointer to the interrupt in struct urb for this port.
38 * @interrupt_in_endpointAddress: endpoint address for the interrupt in pipe
39 * for this port.
40 * @interrupt_out_buffer: pointer to the interrupt out buffer for this port.
41 * @interrupt_out_size: the size of the interrupt_out_buffer, in bytes.
42 * @interrupt_out_urb: pointer to the interrupt out struct urb for this port.
43 * @interrupt_out_endpointAddress: endpoint address for the interrupt out pipe
44 * for this port.
45 * @bulk_in_buffer: pointer to the bulk in buffer for this port.
46 * @read_urb: pointer to the bulk in struct urb for this port.
47 * @bulk_in_endpointAddress: endpoint address for the bulk in pipe for this
48 * port.
49 * @bulk_out_buffer: pointer to the bulk out buffer for this port.
50 * @bulk_out_size: the size of the bulk_out_buffer, in bytes.
51 * @write_urb: pointer to the bulk out struct urb for this port.
52 * @bulk_out_endpointAddress: endpoint address for the bulk out pipe for this
53 * port.
54 * @write_wait: a wait_queue_head_t used by the port.
55 * @work: work queue entry for the line discipline waking up.
56 * @open_count: number of times this port has been opened.
57 *
58 * This structure is used by the usb-serial core and drivers for the specific
59 * ports of a device.
60 */
61struct usb_serial_port {
62 struct usb_serial * serial;
63 struct tty_struct * tty;
64 spinlock_t lock;
65 struct mutex mutex;
66 unsigned char number;
67
68 unsigned char * interrupt_in_buffer;
69 struct urb * interrupt_in_urb;
70 __u8 interrupt_in_endpointAddress;
71
72 unsigned char * interrupt_out_buffer;
73 int interrupt_out_size;
74 struct urb * interrupt_out_urb;
75 __u8 interrupt_out_endpointAddress;
76
77 unsigned char * bulk_in_buffer;
78 int bulk_in_size;
79 struct urb * read_urb;
80 __u8 bulk_in_endpointAddress;
81
82 unsigned char * bulk_out_buffer;
83 int bulk_out_size;
84 struct urb * write_urb;
85 int write_urb_busy;
86 __u8 bulk_out_endpointAddress;
87
88 wait_queue_head_t write_wait;
89 struct work_struct work;
90 int open_count;
91 struct device dev;
92};
93#define to_usb_serial_port(d) container_of(d, struct usb_serial_port, dev)
94
95/* get and set the port private data pointer helper functions */
96static inline void *usb_get_serial_port_data (struct usb_serial_port *port)
97{
98 return dev_get_drvdata(&port->dev);
99}
100
101static inline void usb_set_serial_port_data (struct usb_serial_port *port, void *data)
102{
103 dev_set_drvdata(&port->dev, data);
104}
105
106/**
107 * usb_serial - structure used by the usb-serial core for a device
108 * @dev: pointer to the struct usb_device for this device
109 * @type: pointer to the struct usb_serial_driver for this device
110 * @interface: pointer to the struct usb_interface for this device
111 * @minor: the starting minor number for this device
112 * @num_ports: the number of ports this device has
113 * @num_interrupt_in: number of interrupt in endpoints we have
114 * @num_interrupt_out: number of interrupt out endpoints we have
115 * @num_bulk_in: number of bulk in endpoints we have
116 * @num_bulk_out: number of bulk out endpoints we have
117 * @port: array of struct usb_serial_port structures for the different ports.
118 * @private: place to put any driver specific information that is needed. The
119 * usb-serial driver is required to manage this data, the usb-serial core
120 * will not touch this. Use usb_get_serial_data() and
121 * usb_set_serial_data() to access this.
122 */
123struct usb_serial {
124 struct usb_device * dev;
125 struct usb_serial_driver * type;
126 struct usb_interface * interface;
127 unsigned char minor;
128 unsigned char num_ports;
129 unsigned char num_port_pointers;
130 char num_interrupt_in;
131 char num_interrupt_out;
132 char num_bulk_in;
133 char num_bulk_out;
134 struct usb_serial_port * port[MAX_NUM_PORTS];
135 struct kref kref;
136 void * private;
137};
138#define to_usb_serial(d) container_of(d, struct usb_serial, kref)
139
140#define NUM_DONT_CARE (-1)
141
142/* get and set the serial private data pointer helper functions */
143static inline void *usb_get_serial_data (struct usb_serial *serial)
144{
145 return serial->private;
146}
147
148static inline void usb_set_serial_data (struct usb_serial *serial, void *data)
149{
150 serial->private = data;
151}
152
153/**
154 * usb_serial_driver - describes a usb serial driver
155 * @description: pointer to a string that describes this driver. This string used
156 * in the syslog messages when a device is inserted or removed.
157 * @id_table: pointer to a list of usb_device_id structures that define all
158 * of the devices this structure can support.
159 * @num_interrupt_in: the number of interrupt in endpoints this device will
160 * have.
161 * @num_interrupt_out: the number of interrupt out endpoints this device will
162 * have.
163 * @num_bulk_in: the number of bulk in endpoints this device will have.
164 * @num_bulk_out: the number of bulk out endpoints this device will have.
165 * @num_ports: the number of different ports this device will have.
166 * @calc_num_ports: pointer to a function to determine how many ports this
167 * device has dynamically. It will be called after the probe()
168 * callback is called, but before attach()
169 * @probe: pointer to the driver's probe function.
170 * This will be called when the device is inserted into the system,
171 * but before the device has been fully initialized by the usb_serial
172 * subsystem. Use this function to download any firmware to the device,
173 * or any other early initialization that might be needed.
174 * Return 0 to continue on with the initialization sequence. Anything
175 * else will abort it.
176 * @attach: pointer to the driver's attach function.
177 * This will be called when the struct usb_serial structure is fully set
178 * set up. Do any local initialization of the device, or any private
179 * memory structure allocation at this point in time.
180 * @shutdown: pointer to the driver's shutdown function. This will be
181 * called when the device is removed from the system.
182 *
183 * This structure is defines a USB Serial driver. It provides all of
184 * the information that the USB serial core code needs. If the function
185 * pointers are defined, then the USB serial core code will call them when
186 * the corresponding tty port functions are called. If they are not
187 * called, the generic serial function will be used instead.
188 *
189 * The driver.owner field should be set to the module owner of this driver.
190 * The driver.name field should be set to the name of this driver (remember
191 * it will show up in sysfs, so it needs to be short and to the point.
192 * Useing the module name is a good idea.)
193 */
194struct usb_serial_driver {
195 const char *description;
196 const struct usb_device_id *id_table;
197 char num_interrupt_in;
198 char num_interrupt_out;
199 char num_bulk_in;
200 char num_bulk_out;
201 char num_ports;
202
203 struct list_head driver_list;
204 struct device_driver driver;
205
206 int (*probe) (struct usb_serial *serial, const struct usb_device_id *id);
207 int (*attach) (struct usb_serial *serial);
208 int (*calc_num_ports) (struct usb_serial *serial);
209
210 void (*shutdown) (struct usb_serial *serial);
211
212 int (*port_probe) (struct usb_serial_port *port);
213 int (*port_remove) (struct usb_serial_port *port);
214
215 /* serial function calls */
216 int (*open) (struct usb_serial_port *port, struct file * filp);
217 void (*close) (struct usb_serial_port *port, struct file * filp);
218 int (*write) (struct usb_serial_port *port, const unsigned char *buf, int count);
219 int (*write_room) (struct usb_serial_port *port);
220 int (*ioctl) (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg);
221 void (*set_termios) (struct usb_serial_port *port, struct termios * old);
222 void (*break_ctl) (struct usb_serial_port *port, int break_state);
223 int (*chars_in_buffer) (struct usb_serial_port *port);
224 void (*throttle) (struct usb_serial_port *port);
225 void (*unthrottle) (struct usb_serial_port *port);
226 int (*tiocmget) (struct usb_serial_port *port, struct file *file);
227 int (*tiocmset) (struct usb_serial_port *port, struct file *file, unsigned int set, unsigned int clear);
228
229 void (*read_int_callback)(struct urb *urb, struct pt_regs *regs);
230 void (*write_int_callback)(struct urb *urb, struct pt_regs *regs);
231 void (*read_bulk_callback)(struct urb *urb, struct pt_regs *regs);
232 void (*write_bulk_callback)(struct urb *urb, struct pt_regs *regs);
233};
234#define to_usb_serial_driver(d) container_of(d, struct usb_serial_driver, driver)
235
236extern int usb_serial_register(struct usb_serial_driver *driver);
237extern void usb_serial_deregister(struct usb_serial_driver *driver);
238extern void usb_serial_port_softint(struct usb_serial_port *port);
239
240extern int usb_serial_probe(struct usb_interface *iface, const struct usb_device_id *id);
241extern void usb_serial_disconnect(struct usb_interface *iface);
242
243extern int ezusb_writememory (struct usb_serial *serial, int address, unsigned char *data, int length, __u8 bRequest);
244extern int ezusb_set_reset (struct usb_serial *serial, unsigned char reset_bit);
245
246/* USB Serial console functions */
247#ifdef CONFIG_USB_SERIAL_CONSOLE
248extern void usb_serial_console_init (int debug, int minor);
249extern void usb_serial_console_exit (void);
250extern void usb_serial_console_disconnect(struct usb_serial *serial);
251#else
252static inline void usb_serial_console_init (int debug, int minor) { }
253static inline void usb_serial_console_exit (void) { }
254static inline void usb_serial_console_disconnect(struct usb_serial *serial) {}
255#endif
256
257/* Functions needed by other parts of the usbserial core */
258extern struct usb_serial *usb_serial_get_by_index (unsigned int minor);
259extern void usb_serial_put(struct usb_serial *serial);
260extern int usb_serial_generic_open (struct usb_serial_port *port, struct file *filp);
261extern int usb_serial_generic_write (struct usb_serial_port *port, const unsigned char *buf, int count);
262extern void usb_serial_generic_close (struct usb_serial_port *port, struct file *filp);
263extern int usb_serial_generic_write_room (struct usb_serial_port *port);
264extern int usb_serial_generic_chars_in_buffer (struct usb_serial_port *port);
265extern void usb_serial_generic_read_bulk_callback (struct urb *urb, struct pt_regs *regs);
266extern void usb_serial_generic_write_bulk_callback (struct urb *urb, struct pt_regs *regs);
267extern void usb_serial_generic_shutdown (struct usb_serial *serial);
268extern int usb_serial_generic_register (int debug);
269extern void usb_serial_generic_deregister (void);
270
271extern int usb_serial_bus_register (struct usb_serial_driver *device);
272extern void usb_serial_bus_deregister (struct usb_serial_driver *device);
273
274extern struct usb_serial_driver usb_serial_generic_device;
275extern struct bus_type usb_serial_bus_type;
276extern struct tty_driver *usb_serial_tty_driver;
277
278static inline void usb_serial_debug_data(int debug,
279 struct device *dev,
280 const char *function, int size,
281 const unsigned char *data)
282{
283 int i;
284
285 if (debug) {
286 dev_printk(KERN_DEBUG, dev, "%s - length = %d, data = ", function, size);
287 for (i = 0; i < size; ++i)
288 printk ("%.2x ", data[i]);
289 printk ("\n");
290 }
291}
292
293/* Use our own dbg macro */
294#undef dbg
295#define dbg(format, arg...) do { if (debug) printk(KERN_DEBUG "%s: " format "\n" , __FILE__ , ## arg); } while (0)
296
297
298
299#endif /* ifdef __LINUX_USB_SERIAL_H */
300
diff --git a/include/linux/usb_ch9.h b/include/linux/usb_ch9.h
index a2aacfc7af2f..c720d107ff29 100644
--- a/include/linux/usb_ch9.h
+++ b/include/linux/usb_ch9.h
@@ -51,6 +51,9 @@
51#define USB_RECIP_INTERFACE 0x01 51#define USB_RECIP_INTERFACE 0x01
52#define USB_RECIP_ENDPOINT 0x02 52#define USB_RECIP_ENDPOINT 0x02
53#define USB_RECIP_OTHER 0x03 53#define USB_RECIP_OTHER 0x03
54/* From Wireless USB 1.0 */
55#define USB_RECIP_PORT 0x04
56#define USB_RECIP_RPIPE 0x05
54 57
55/* 58/*
56 * Standard requests, for the bRequest field of a SETUP packet. 59 * Standard requests, for the bRequest field of a SETUP packet.
@@ -73,7 +76,9 @@
73 76
74#define USB_REQ_SET_ENCRYPTION 0x0D /* Wireless USB */ 77#define USB_REQ_SET_ENCRYPTION 0x0D /* Wireless USB */
75#define USB_REQ_GET_ENCRYPTION 0x0E 78#define USB_REQ_GET_ENCRYPTION 0x0E
79#define USB_REQ_RPIPE_ABORT 0x0E
76#define USB_REQ_SET_HANDSHAKE 0x0F 80#define USB_REQ_SET_HANDSHAKE 0x0F
81#define USB_REQ_RPIPE_RESET 0x0F
77#define USB_REQ_GET_HANDSHAKE 0x10 82#define USB_REQ_GET_HANDSHAKE 0x10
78#define USB_REQ_SET_CONNECTION 0x11 83#define USB_REQ_SET_CONNECTION 0x11
79#define USB_REQ_SET_SECURITY_DATA 0x12 84#define USB_REQ_SET_SECURITY_DATA 0x12
@@ -159,6 +164,8 @@ struct usb_ctrlrequest {
159#define USB_DT_BOS 0x0f 164#define USB_DT_BOS 0x0f
160#define USB_DT_DEVICE_CAPABILITY 0x10 165#define USB_DT_DEVICE_CAPABILITY 0x10
161#define USB_DT_WIRELESS_ENDPOINT_COMP 0x11 166#define USB_DT_WIRELESS_ENDPOINT_COMP 0x11
167#define USB_DT_WIRE_ADAPTER 0x21
168#define USB_DT_RPIPE 0x22
162 169
163/* conventional codes for class-specific descriptors */ 170/* conventional codes for class-specific descriptors */
164#define USB_DT_CS_DEVICE 0x21 171#define USB_DT_CS_DEVICE 0x21
diff --git a/include/linux/usb_gadget.h b/include/linux/usb_gadget.h
index 1d78870ed8af..e17186dbcdca 100644
--- a/include/linux/usb_gadget.h
+++ b/include/linux/usb_gadget.h
@@ -872,9 +872,9 @@ int usb_gadget_config_buf(const struct usb_config_descriptor *config,
872/* utility wrapping a simple endpoint selection policy */ 872/* utility wrapping a simple endpoint selection policy */
873 873
874extern struct usb_ep *usb_ep_autoconfig (struct usb_gadget *, 874extern struct usb_ep *usb_ep_autoconfig (struct usb_gadget *,
875 struct usb_endpoint_descriptor *) __init; 875 struct usb_endpoint_descriptor *) __devinit;
876 876
877extern void usb_ep_autoconfig_reset (struct usb_gadget *) __init; 877extern void usb_ep_autoconfig_reset (struct usb_gadget *) __devinit;
878 878
879#endif /* __KERNEL__ */ 879#endif /* __KERNEL__ */
880 880
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h
index 608487a62c98..e7fc5fed5b98 100644
--- a/include/linux/usb_usual.h
+++ b/include/linux/usb_usual.h
@@ -43,6 +43,10 @@
43 /* Need delay after Command phase */ \ 43 /* Need delay after Command phase */ \
44 US_FLAG(NO_WP_DETECT, 0x00000200) \ 44 US_FLAG(NO_WP_DETECT, 0x00000200) \
45 /* Don't check for write-protect */ \ 45 /* Don't check for write-protect */ \
46 US_FLAG(MAX_SECTORS_64, 0x00000400) \
47 /* Sets max_sectors to 64 */ \
48 US_FLAG(IGNORE_DEVICE, 0x00000800) \
49 /* Don't claim device */
46 50
47#define US_FLAG(name, value) US_FL_##name = value , 51#define US_FLAG(name, value) US_FL_##name = value ,
48enum { US_DO_ALL_FLAGS }; 52enum { US_DO_ALL_FLAGS };
diff --git a/include/linux/videodev.h b/include/linux/videodev.h
index 41bc7e9603cd..8dba97a291f6 100644
--- a/include/linux/videodev.h
+++ b/include/linux/videodev.h
@@ -12,10 +12,10 @@
12#ifndef __LINUX_VIDEODEV_H 12#ifndef __LINUX_VIDEODEV_H
13#define __LINUX_VIDEODEV_H 13#define __LINUX_VIDEODEV_H
14 14
15#define HAVE_V4L1 1
16
17#include <linux/videodev2.h> 15#include <linux/videodev2.h>
18 16
17#if defined(CONFIG_VIDEO_V4L1_COMPAT) || !defined (__KERNEL__)
18
19struct video_capability 19struct video_capability
20{ 20{
21 char name[32]; 21 char name[32];
@@ -336,6 +336,8 @@ struct video_code
336#define VID_HARDWARE_SN9C102 38 336#define VID_HARDWARE_SN9C102 38
337#define VID_HARDWARE_ARV 39 337#define VID_HARDWARE_ARV 39
338 338
339#endif /* CONFIG_VIDEO_V4L1_COMPAT */
340
339#endif /* __LINUX_VIDEODEV_H */ 341#endif /* __LINUX_VIDEODEV_H */
340 342
341/* 343/*
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index a62673dad76e..e3715d774197 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -22,8 +22,6 @@
22#endif 22#endif
23#include <linux/types.h> 23#include <linux/types.h>
24 24
25#define HAVE_V4L2 1
26
27/* 25/*
28 * Common stuff for both V4L1 and V4L2 26 * Common stuff for both V4L1 and V4L2
29 * Moved from videodev.h 27 * Moved from videodev.h
@@ -716,7 +714,7 @@ struct v4l2_ext_control
716 __s64 value64; 714 __s64 value64;
717 void *reserved; 715 void *reserved;
718 }; 716 };
719}; 717} __attribute__ ((packed));
720 718
721struct v4l2_ext_controls 719struct v4l2_ext_controls
722{ 720{
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index f6024ab4eff0..71b6363caaaf 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -11,6 +11,7 @@ struct vm_area_struct;
11#define VM_ALLOC 0x00000002 /* vmalloc() */ 11#define VM_ALLOC 0x00000002 /* vmalloc() */
12#define VM_MAP 0x00000004 /* vmap()ed pages */ 12#define VM_MAP 0x00000004 /* vmap()ed pages */
13#define VM_USERMAP 0x00000008 /* suitable for remap_vmalloc_range */ 13#define VM_USERMAP 0x00000008 /* suitable for remap_vmalloc_range */
14#define VM_VPAGES 0x00000010 /* buffer for pages was vmalloc'ed */
14/* bits [20..32] reserved for arch specific ioremap internals */ 15/* bits [20..32] reserved for arch specific ioremap internals */
15 16
16/* 17/*
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
index 3e0daf54133e..2d9b1b60798a 100644
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -41,23 +41,23 @@ DECLARE_PER_CPU(struct vm_event_state, vm_event_states);
41 41
42static inline void __count_vm_event(enum vm_event_item item) 42static inline void __count_vm_event(enum vm_event_item item)
43{ 43{
44 __get_cpu_var(vm_event_states.event[item])++; 44 __get_cpu_var(vm_event_states).event[item]++;
45} 45}
46 46
47static inline void count_vm_event(enum vm_event_item item) 47static inline void count_vm_event(enum vm_event_item item)
48{ 48{
49 get_cpu_var(vm_event_states.event[item])++; 49 get_cpu_var(vm_event_states).event[item]++;
50 put_cpu(); 50 put_cpu();
51} 51}
52 52
53static inline void __count_vm_events(enum vm_event_item item, long delta) 53static inline void __count_vm_events(enum vm_event_item item, long delta)
54{ 54{
55 __get_cpu_var(vm_event_states.event[item]) += delta; 55 __get_cpu_var(vm_event_states).event[item] += delta;
56} 56}
57 57
58static inline void count_vm_events(enum vm_event_item item, long delta) 58static inline void count_vm_events(enum vm_event_item item, long delta)
59{ 59{
60 get_cpu_var(vm_event_states.event[item])++; 60 get_cpu_var(vm_event_states).event[item] += delta;
61 put_cpu(); 61 put_cpu();
62} 62}
63 63
@@ -186,11 +186,16 @@ static inline void __mod_zone_page_state(struct zone *zone,
186 zone_page_state_add(delta, zone, item); 186 zone_page_state_add(delta, zone, item);
187} 187}
188 188
189static inline void __inc_zone_state(struct zone *zone, enum zone_stat_item item)
190{
191 atomic_long_inc(&zone->vm_stat[item]);
192 atomic_long_inc(&vm_stat[item]);
193}
194
189static inline void __inc_zone_page_state(struct page *page, 195static inline void __inc_zone_page_state(struct page *page,
190 enum zone_stat_item item) 196 enum zone_stat_item item)
191{ 197{
192 atomic_long_inc(&page_zone(page)->vm_stat[item]); 198 __inc_zone_state(page_zone(page), item);
193 atomic_long_inc(&vm_stat[item]);
194} 199}
195 200
196static inline void __dec_zone_page_state(struct page *page, 201static inline void __dec_zone_page_state(struct page *page,
diff --git a/include/linux/vt.h b/include/linux/vt.h
index 9f95b0bea5b3..ba806e8711be 100644
--- a/include/linux/vt.h
+++ b/include/linux/vt.h
@@ -1,6 +1,16 @@
1#ifndef _LINUX_VT_H 1#ifndef _LINUX_VT_H
2#define _LINUX_VT_H 2#define _LINUX_VT_H
3 3
4/*
5 * These constants are also useful for user-level apps (e.g., VC
6 * resizing).
7 */
8#define MIN_NR_CONSOLES 1 /* must be at least 1 */
9#define MAX_NR_CONSOLES 63 /* serial lines start at 64 */
10#define MAX_NR_USER_CONSOLES 63 /* must be root to allocate above this */
11 /* Note: the ioctl VT_GETSTATE does not work for
12 consoles 16 and higher (since it returns a short) */
13
4/* 0x56 is 'V', to avoid collision with termios and kd */ 14/* 0x56 is 'V', to avoid collision with termios and kd */
5 15
6#define VT_OPENQRY 0x5600 /* find available vt */ 16#define VT_OPENQRY 0x5600 /* find available vt */
@@ -50,5 +60,6 @@ struct vt_consize {
50#define VT_RESIZEX 0x560A /* set kernel's idea of screensize + more */ 60#define VT_RESIZEX 0x560A /* set kernel's idea of screensize + more */
51#define VT_LOCKSWITCH 0x560B /* disallow vt switching */ 61#define VT_LOCKSWITCH 0x560B /* disallow vt switching */
52#define VT_UNLOCKSWITCH 0x560C /* allow vt switching */ 62#define VT_UNLOCKSWITCH 0x560C /* allow vt switching */
63#define VT_GETHIFONTMASK 0x560D /* return hi font mask */
53 64
54#endif /* _LINUX_VT_H */ 65#endif /* _LINUX_VT_H */
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h
index 940d0261a545..918a29763aea 100644
--- a/include/linux/vt_kern.h
+++ b/include/linux/vt_kern.h
@@ -26,6 +26,7 @@
26 26
27extern void kd_mksound(unsigned int hz, unsigned int ticks); 27extern void kd_mksound(unsigned int hz, unsigned int ticks);
28extern int kbd_rate(struct kbd_repeat *rep); 28extern int kbd_rate(struct kbd_repeat *rep);
29extern int fg_console, last_console, want_console;
29 30
30/* console.c */ 31/* console.c */
31 32
diff --git a/include/linux/wait.h b/include/linux/wait.h
index 794be7af58ae..b3b9048421d8 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -77,17 +77,7 @@ struct task_struct;
77#define __WAIT_BIT_KEY_INITIALIZER(word, bit) \ 77#define __WAIT_BIT_KEY_INITIALIZER(word, bit) \
78 { .flags = word, .bit_nr = bit, } 78 { .flags = word, .bit_nr = bit, }
79 79
80/* 80extern void init_waitqueue_head(wait_queue_head_t *q);
81 * lockdep: we want one lock-class for all waitqueue locks.
82 */
83extern struct lock_class_key waitqueue_lock_key;
84
85static inline void init_waitqueue_head(wait_queue_head_t *q)
86{
87 spin_lock_init(&q->lock);
88 lockdep_set_class(&q->lock, &waitqueue_lock_key);
89 INIT_LIST_HEAD(&q->task_list);
90}
91 81
92static inline void init_waitqueue_entry(wait_queue_t *q, struct task_struct *p) 82static inline void init_waitqueue_entry(wait_queue_t *q, struct task_struct *p)
93{ 83{
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h
index 62dae1a8c441..810462f8a374 100644
--- a/include/media/v4l2-dev.h
+++ b/include/media/v4l2-dev.h
@@ -16,7 +16,7 @@
16#include <linux/device.h> 16#include <linux/device.h>
17#include <linux/mutex.h> 17#include <linux/mutex.h>
18#include <linux/compiler.h> /* need __user */ 18#include <linux/compiler.h> /* need __user */
19#ifdef CONFIG_VIDEO_V4L1 19#ifdef CONFIG_VIDEO_V4L1_COMPAT
20#include <linux/videodev.h> 20#include <linux/videodev.h>
21#else 21#else
22#include <linux/videodev2.h> 22#include <linux/videodev2.h>
@@ -194,7 +194,7 @@ struct video_device
194 194
195 195
196 int (*vidioc_overlay) (struct file *file, void *fh, unsigned int i); 196 int (*vidioc_overlay) (struct file *file, void *fh, unsigned int i);
197#ifdef HAVE_V4L1 197#ifdef CONFIG_VIDEO_V4L1_COMPAT
198 /* buffer type is struct vidio_mbuf * */ 198 /* buffer type is struct vidio_mbuf * */
199 int (*vidiocgmbuf) (struct file *file, void *fh, struct video_mbuf *p); 199 int (*vidiocgmbuf) (struct file *file, void *fh, struct video_mbuf *p);
200#endif 200#endif
@@ -335,17 +335,20 @@ extern int video_usercopy(struct inode *inode, struct file *file,
335 unsigned int cmd, void *arg)); 335 unsigned int cmd, void *arg));
336 336
337 337
338#ifdef HAVE_V4L1 338#ifdef CONFIG_VIDEO_V4L1_COMPAT
339#include <linux/mm.h> 339#include <linux/mm.h>
340 340
341extern struct video_device* video_devdata(struct file*); 341extern struct video_device* video_devdata(struct file*);
342 342
343#define to_video_device(cd) container_of(cd, struct video_device, class_dev) 343#define to_video_device(cd) container_of(cd, struct video_device, class_dev)
344static inline void 344static inline int
345video_device_create_file(struct video_device *vfd, 345video_device_create_file(struct video_device *vfd,
346 struct class_device_attribute *attr) 346 struct class_device_attribute *attr)
347{ 347{
348 class_device_create_file(&vfd->class_dev, attr); 348 int ret = class_device_create_file(&vfd->class_dev, attr);
349 if (ret < 0)
350 printk(KERN_WARNING "%s error: %d\n", __FUNCTION__, ret);
351 return ret;
349} 352}
350static inline void 353static inline void
351video_device_remove_file(struct video_device *vfd, 354video_device_remove_file(struct video_device *vfd,
@@ -354,6 +357,8 @@ video_device_remove_file(struct video_device *vfd,
354 class_device_remove_file(&vfd->class_dev, attr); 357 class_device_remove_file(&vfd->class_dev, attr);
355} 358}
356 359
360#endif /* CONFIG_VIDEO_V4L1_COMPAT */
361
357#ifdef OBSOLETE_OWNER /* to be removed soon */ 362#ifdef OBSOLETE_OWNER /* to be removed soon */
358/* helper functions to access driver private data. */ 363/* helper functions to access driver private data. */
359static inline void *video_get_drvdata(struct video_device *dev) 364static inline void *video_get_drvdata(struct video_device *dev)
@@ -369,6 +374,5 @@ static inline void video_set_drvdata(struct video_device *dev, void *data)
369 374
370extern int video_exclusive_open(struct inode *inode, struct file *file); 375extern int video_exclusive_open(struct inode *inode, struct file *file);
371extern int video_exclusive_release(struct inode *inode, struct file *file); 376extern int video_exclusive_release(struct inode *inode, struct file *file);
372#endif /* HAVE_V4L1 */
373 377
374#endif /* _V4L2_DEV_H */ 378#endif /* _V4L2_DEV_H */
diff --git a/include/net/af_unix.h b/include/net/af_unix.h
index 2fec827c8801..c0398f5a8cb9 100644
--- a/include/net/af_unix.h
+++ b/include/net/af_unix.h
@@ -54,15 +54,13 @@ struct unix_skb_parms {
54 struct ucred creds; /* Skb credentials */ 54 struct ucred creds; /* Skb credentials */
55 struct scm_fp_list *fp; /* Passed files */ 55 struct scm_fp_list *fp; /* Passed files */
56#ifdef CONFIG_SECURITY_NETWORK 56#ifdef CONFIG_SECURITY_NETWORK
57 char *secdata; /* Security context */ 57 u32 secid; /* Security ID */
58 u32 seclen; /* Security length */
59#endif 58#endif
60}; 59};
61 60
62#define UNIXCB(skb) (*(struct unix_skb_parms*)&((skb)->cb)) 61#define UNIXCB(skb) (*(struct unix_skb_parms*)&((skb)->cb))
63#define UNIXCREDS(skb) (&UNIXCB((skb)).creds) 62#define UNIXCREDS(skb) (&UNIXCB((skb)).creds)
64#define UNIXSECDATA(skb) (&UNIXCB((skb)).secdata) 63#define UNIXSID(skb) (&UNIXCB((skb)).secid)
65#define UNIXSECLEN(skb) (&UNIXCB((skb)).seclen)
66 64
67#define unix_state_rlock(s) spin_lock(&unix_sk(s)->lock) 65#define unix_state_rlock(s) spin_lock(&unix_sk(s)->lock)
68#define unix_state_runlock(s) spin_unlock(&unix_sk(s)->lock) 66#define unix_state_runlock(s) spin_unlock(&unix_sk(s)->lock)
diff --git a/include/net/genetlink.h b/include/net/genetlink.h
index 805de50df00d..8c2287264266 100644
--- a/include/net/genetlink.h
+++ b/include/net/genetlink.h
@@ -150,4 +150,24 @@ static inline int genlmsg_unicast(struct sk_buff *skb, u32 pid)
150 return nlmsg_unicast(genl_sock, skb, pid); 150 return nlmsg_unicast(genl_sock, skb, pid);
151} 151}
152 152
153/**
154 * gennlmsg_data - head of message payload
155 * @gnlh: genetlink messsage header
156 */
157static inline void *genlmsg_data(const struct genlmsghdr *gnlh)
158{
159 return ((unsigned char *) gnlh + GENL_HDRLEN);
160}
161
162/**
163 * genlmsg_len - length of message payload
164 * @gnlh: genetlink message header
165 */
166static inline int genlmsg_len(const struct genlmsghdr *gnlh)
167{
168 struct nlmsghdr *nlh = (struct nlmsghdr *)((unsigned char *)gnlh -
169 NLMSG_HDRLEN);
170 return (nlh->nlmsg_len - GENL_HDRLEN - NLMSG_HDRLEN);
171}
172
153#endif /* __NET_GENERIC_NETLINK_H */ 173#endif /* __NET_GENERIC_NETLINK_H */
diff --git a/include/net/ieee80211softmac.h b/include/net/ieee80211softmac.h
index 7a483ab4022f..00ad810eb883 100644
--- a/include/net/ieee80211softmac.h
+++ b/include/net/ieee80211softmac.h
@@ -104,6 +104,7 @@ struct ieee80211softmac_assoc_info {
104 */ 104 */
105 u8 static_essid:1, 105 u8 static_essid:1,
106 associating:1, 106 associating:1,
107 assoc_wait:1,
107 bssvalid:1, 108 bssvalid:1,
108 bssfixed:1; 109 bssfixed:1;
109 110
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index ab29dafb1a6a..96b0e66406ec 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -139,16 +139,22 @@ extern rwlock_t rt6_lock;
139/* 139/*
140 * Store a destination cache entry in a socket 140 * Store a destination cache entry in a socket
141 */ 141 */
142static inline void ip6_dst_store(struct sock *sk, struct dst_entry *dst, 142static inline void __ip6_dst_store(struct sock *sk, struct dst_entry *dst,
143 struct in6_addr *daddr) 143 struct in6_addr *daddr)
144{ 144{
145 struct ipv6_pinfo *np = inet6_sk(sk); 145 struct ipv6_pinfo *np = inet6_sk(sk);
146 struct rt6_info *rt = (struct rt6_info *) dst; 146 struct rt6_info *rt = (struct rt6_info *) dst;
147 147
148 write_lock(&sk->sk_dst_lock);
149 sk_setup_caps(sk, dst); 148 sk_setup_caps(sk, dst);
150 np->daddr_cache = daddr; 149 np->daddr_cache = daddr;
151 np->dst_cookie = rt->rt6i_node ? rt->rt6i_node->fn_sernum : 0; 150 np->dst_cookie = rt->rt6i_node ? rt->rt6i_node->fn_sernum : 0;
151}
152
153static inline void ip6_dst_store(struct sock *sk, struct dst_entry *dst,
154 struct in6_addr *daddr)
155{
156 write_lock(&sk->sk_dst_lock);
157 __ip6_dst_store(sk, dst, daddr);
152 write_unlock(&sk->sk_dst_lock); 158 write_unlock(&sk->sk_dst_lock);
153} 159}
154 160
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index a8fdf7970b37..ece7e8a84ffd 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -468,6 +468,9 @@ extern void ip6_flush_pending_frames(struct sock *sk);
468extern int ip6_dst_lookup(struct sock *sk, 468extern int ip6_dst_lookup(struct sock *sk,
469 struct dst_entry **dst, 469 struct dst_entry **dst,
470 struct flowi *fl); 470 struct flowi *fl);
471extern int ip6_sk_dst_lookup(struct sock *sk,
472 struct dst_entry **dst,
473 struct flowi *fl);
471 474
472/* 475/*
473 * skb processing functions 476 * skb processing functions
diff --git a/include/net/netdma.h b/include/net/netdma.h
index 19760eb131aa..7f53cd1d8b1e 100644
--- a/include/net/netdma.h
+++ b/include/net/netdma.h
@@ -29,7 +29,7 @@ static inline struct dma_chan *get_softnet_dma(void)
29{ 29{
30 struct dma_chan *chan; 30 struct dma_chan *chan;
31 rcu_read_lock(); 31 rcu_read_lock();
32 chan = rcu_dereference(__get_cpu_var(softnet_data.net_dma)); 32 chan = rcu_dereference(__get_cpu_var(softnet_data).net_dma);
33 if (chan) 33 if (chan)
34 dma_chan_get(chan); 34 dma_chan_get(chan);
35 rcu_read_unlock(); 35 rcu_read_unlock();
@@ -37,7 +37,7 @@ static inline struct dma_chan *get_softnet_dma(void)
37} 37}
38 38
39int dma_skb_copy_datagram_iovec(struct dma_chan* chan, 39int dma_skb_copy_datagram_iovec(struct dma_chan* chan,
40 const struct sk_buff *skb, int offset, struct iovec *to, 40 struct sk_buff *skb, int offset, struct iovec *to,
41 size_t len, struct dma_pinned_list *pinned_list); 41 size_t len, struct dma_pinned_list *pinned_list);
42 42
43#endif /* CONFIG_NET_DMA */ 43#endif /* CONFIG_NET_DMA */
diff --git a/include/net/netevent.h b/include/net/netevent.h
new file mode 100644
index 000000000000..e5d216241423
--- /dev/null
+++ b/include/net/netevent.h
@@ -0,0 +1,33 @@
1#ifndef _NET_EVENT_H
2#define _NET_EVENT_H
3
4/*
5 * Generic netevent notifiers
6 *
7 * Authors:
8 * Tom Tucker <tom@opengridcomputing.com>
9 * Steve Wise <swise@opengridcomputing.com>
10 *
11 * Changes:
12 */
13#ifdef __KERNEL__
14
15#include <net/dst.h>
16
17struct netevent_redirect {
18 struct dst_entry *old;
19 struct dst_entry *new;
20};
21
22enum netevent_notif_type {
23 NETEVENT_NEIGH_UPDATE = 1, /* arg is struct neighbour ptr */
24 NETEVENT_PMTU_UPDATE, /* arg is struct dst_entry ptr */
25 NETEVENT_REDIRECT, /* arg is struct netevent_redirect ptr */
26};
27
28extern int register_netevent_notifier(struct notifier_block *nb);
29extern int unregister_netevent_notifier(struct notifier_block *nb);
30extern int call_netevent_notifiers(unsigned long val, void *v);
31
32#endif
33#endif
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 1925c65e617b..f6afee73235d 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -169,23 +169,17 @@ psched_tod_diff(int delta_sec, int bound)
169 169
170#define PSCHED_TADD2(tv, delta, tv_res) \ 170#define PSCHED_TADD2(tv, delta, tv_res) \
171({ \ 171({ \
172 int __delta = (delta); \ 172 int __delta = (tv).tv_usec + (delta); \
173 (tv_res) = (tv); \ 173 (tv_res).tv_sec = (tv).tv_sec; \
174 while(__delta >= USEC_PER_SEC){ \ 174 while (__delta >= USEC_PER_SEC) { (tv_res).tv_sec++; __delta -= USEC_PER_SEC; } \
175 (tv_res).tv_sec++; \
176 __delta -= USEC_PER_SEC; \
177 } \
178 (tv_res).tv_usec = __delta; \ 175 (tv_res).tv_usec = __delta; \
179}) 176})
180 177
181#define PSCHED_TADD(tv, delta) \ 178#define PSCHED_TADD(tv, delta) \
182({ \ 179({ \
183 int __delta = (delta); \ 180 (tv).tv_usec += (delta); \
184 while(__delta >= USEC_PER_SEC){ \ 181 while ((tv).tv_usec >= USEC_PER_SEC) { (tv).tv_sec++; \
185 (tv).tv_sec++; \ 182 (tv).tv_usec -= USEC_PER_SEC; } \
186 __delta -= USEC_PER_SEC; \
187 } \
188 (tv).tv_usec = __delta; \
189}) 183})
190 184
191/* Set/check that time is in the "past perfect"; 185/* Set/check that time is in the "past perfect";
diff --git a/include/net/protocol.h b/include/net/protocol.h
index a225d6371cb1..c643bce64e55 100644
--- a/include/net/protocol.h
+++ b/include/net/protocol.h
@@ -36,6 +36,7 @@
36struct net_protocol { 36struct net_protocol {
37 int (*handler)(struct sk_buff *skb); 37 int (*handler)(struct sk_buff *skb);
38 void (*err_handler)(struct sk_buff *skb, u32 info); 38 void (*err_handler)(struct sk_buff *skb, u32 info);
39 int (*gso_send_check)(struct sk_buff *skb);
39 struct sk_buff *(*gso_segment)(struct sk_buff *skb, 40 struct sk_buff *(*gso_segment)(struct sk_buff *skb,
40 int features); 41 int features);
41 int no_policy; 42 int no_policy;
@@ -51,6 +52,7 @@ struct inet6_protocol
51 int type, int code, int offset, 52 int type, int code, int offset,
52 __u32 info); 53 __u32 info);
53 54
55 int (*gso_send_check)(struct sk_buff *skb);
54 struct sk_buff *(*gso_segment)(struct sk_buff *skb, 56 struct sk_buff *(*gso_segment)(struct sk_buff *skb,
55 int features); 57 int features);
56 58
diff --git a/include/net/red.h b/include/net/red.h
index 5ccdbb3d4722..a4eb37946f2c 100644
--- a/include/net/red.h
+++ b/include/net/red.h
@@ -212,7 +212,7 @@ static inline unsigned long red_calc_qavg_from_idle_time(struct red_parms *p)
212 * Seems, it is the best solution to 212 * Seems, it is the best solution to
213 * problem of too coarse exponent tabulation. 213 * problem of too coarse exponent tabulation.
214 */ 214 */
215 us_idle = (p->qavg * us_idle) >> p->Scell_log; 215 us_idle = (p->qavg * (u64)us_idle) >> p->Scell_log;
216 216
217 if (us_idle < (p->qavg >> 1)) 217 if (us_idle < (p->qavg >> 1))
218 return p->qavg - us_idle; 218 return p->qavg - us_idle;
diff --git a/include/net/scm.h b/include/net/scm.h
index 02daa097cdcd..5637d5e22d5f 100644
--- a/include/net/scm.h
+++ b/include/net/scm.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/limits.h> 4#include <linux/limits.h>
5#include <linux/net.h> 5#include <linux/net.h>
6#include <linux/security.h>
6 7
7/* Well, we should have at least one descriptor open 8/* Well, we should have at least one descriptor open
8 * to accept passed FDs 8) 9 * to accept passed FDs 8)
@@ -20,8 +21,7 @@ struct scm_cookie
20 struct ucred creds; /* Skb credentials */ 21 struct ucred creds; /* Skb credentials */
21 struct scm_fp_list *fp; /* Passed files */ 22 struct scm_fp_list *fp; /* Passed files */
22#ifdef CONFIG_SECURITY_NETWORK 23#ifdef CONFIG_SECURITY_NETWORK
23 char *secdata; /* Security context */ 24 u32 secid; /* Passed security ID */
24 u32 seclen; /* Security length */
25#endif 25#endif
26 unsigned long seq; /* Connection seqno */ 26 unsigned long seq; /* Connection seqno */
27}; 27};
@@ -32,6 +32,16 @@ extern int __scm_send(struct socket *sock, struct msghdr *msg, struct scm_cookie
32extern void __scm_destroy(struct scm_cookie *scm); 32extern void __scm_destroy(struct scm_cookie *scm);
33extern struct scm_fp_list * scm_fp_dup(struct scm_fp_list *fpl); 33extern struct scm_fp_list * scm_fp_dup(struct scm_fp_list *fpl);
34 34
35#ifdef CONFIG_SECURITY_NETWORK
36static __inline__ void unix_get_peersec_dgram(struct socket *sock, struct scm_cookie *scm)
37{
38 security_socket_getpeersec_dgram(sock, NULL, &scm->secid);
39}
40#else
41static __inline__ void unix_get_peersec_dgram(struct socket *sock, struct scm_cookie *scm)
42{ }
43#endif /* CONFIG_SECURITY_NETWORK */
44
35static __inline__ void scm_destroy(struct scm_cookie *scm) 45static __inline__ void scm_destroy(struct scm_cookie *scm)
36{ 46{
37 if (scm && scm->fp) 47 if (scm && scm->fp)
@@ -47,6 +57,7 @@ static __inline__ int scm_send(struct socket *sock, struct msghdr *msg,
47 scm->creds.pid = p->tgid; 57 scm->creds.pid = p->tgid;
48 scm->fp = NULL; 58 scm->fp = NULL;
49 scm->seq = 0; 59 scm->seq = 0;
60 unix_get_peersec_dgram(sock, scm);
50 if (msg->msg_controllen <= 0) 61 if (msg->msg_controllen <= 0)
51 return 0; 62 return 0;
52 return __scm_send(sock, msg, scm); 63 return __scm_send(sock, msg, scm);
@@ -55,8 +66,18 @@ static __inline__ int scm_send(struct socket *sock, struct msghdr *msg,
55#ifdef CONFIG_SECURITY_NETWORK 66#ifdef CONFIG_SECURITY_NETWORK
56static inline void scm_passec(struct socket *sock, struct msghdr *msg, struct scm_cookie *scm) 67static inline void scm_passec(struct socket *sock, struct msghdr *msg, struct scm_cookie *scm)
57{ 68{
58 if (test_bit(SOCK_PASSSEC, &sock->flags) && scm->secdata != NULL) 69 char *secdata;
59 put_cmsg(msg, SOL_SOCKET, SCM_SECURITY, scm->seclen, scm->secdata); 70 u32 seclen;
71 int err;
72
73 if (test_bit(SOCK_PASSSEC, &sock->flags)) {
74 err = security_secid_to_secctx(scm->secid, &secdata, &seclen);
75
76 if (!err) {
77 put_cmsg(msg, SOL_SOCKET, SCM_SECURITY, seclen, secdata);
78 security_release_secctx(secdata, seclen);
79 }
80 }
60} 81}
61#else 82#else
62static inline void scm_passec(struct socket *sock, struct msghdr *msg, struct scm_cookie *scm) 83static inline void scm_passec(struct socket *sock, struct msghdr *msg, struct scm_cookie *scm)
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index a9663b49ea54..92eae0e0f3f1 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -404,19 +404,6 @@ static inline int sctp_list_single_entry(struct list_head *head)
404 return ((head->next != head) && (head->next == head->prev)); 404 return ((head->next != head) && (head->next == head->prev));
405} 405}
406 406
407/* Calculate the size (in bytes) occupied by the data of an iovec. */
408static inline size_t get_user_iov_size(struct iovec *iov, int iovlen)
409{
410 size_t retval = 0;
411
412 for (; iovlen > 0; --iovlen) {
413 retval += iov->iov_len;
414 iov++;
415 }
416
417 return retval;
418}
419
420/* Generate a random jitter in the range of -50% ~ +50% of input RTO. */ 407/* Generate a random jitter in the range of -50% ~ +50% of input RTO. */
421static inline __s32 sctp_jitter(__u32 rto) 408static inline __s32 sctp_jitter(__u32 rto)
422{ 409{
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h
index 1eac3d0eb7a9..de313de4fefe 100644
--- a/include/net/sctp/sm.h
+++ b/include/net/sctp/sm.h
@@ -221,8 +221,7 @@ struct sctp_chunk *sctp_make_abort_no_data(const struct sctp_association *,
221 const struct sctp_chunk *, 221 const struct sctp_chunk *,
222 __u32 tsn); 222 __u32 tsn);
223struct sctp_chunk *sctp_make_abort_user(const struct sctp_association *, 223struct sctp_chunk *sctp_make_abort_user(const struct sctp_association *,
224 const struct sctp_chunk *, 224 const struct msghdr *, size_t msg_len);
225 const struct msghdr *);
226struct sctp_chunk *sctp_make_abort_violation(const struct sctp_association *, 225struct sctp_chunk *sctp_make_abort_violation(const struct sctp_association *,
227 const struct sctp_chunk *, 226 const struct sctp_chunk *,
228 const __u8 *, 227 const __u8 *,
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 5f69158c1006..e5aa7ff1f5b5 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -445,6 +445,7 @@ typedef struct sctp_sender_hb_info {
445 struct sctp_paramhdr param_hdr; 445 struct sctp_paramhdr param_hdr;
446 union sctp_addr daddr; 446 union sctp_addr daddr;
447 unsigned long sent_at; 447 unsigned long sent_at;
448 __u64 hb_nonce;
448} __attribute__((packed)) sctp_sender_hb_info_t; 449} __attribute__((packed)) sctp_sender_hb_info_t;
449 450
450/* 451/*
@@ -730,13 +731,10 @@ void sctp_init_addrs(struct sctp_chunk *, union sctp_addr *,
730const union sctp_addr *sctp_source(const struct sctp_chunk *chunk); 731const union sctp_addr *sctp_source(const struct sctp_chunk *chunk);
731 732
732/* This is a structure for holding either an IPv6 or an IPv4 address. */ 733/* This is a structure for holding either an IPv6 or an IPv4 address. */
733/* sin_family -- AF_INET or AF_INET6
734 * sin_port -- ordinary port number
735 * sin_addr -- cast to either (struct in_addr) or (struct in6_addr)
736 */
737struct sctp_sockaddr_entry { 734struct sctp_sockaddr_entry {
738 struct list_head list; 735 struct list_head list;
739 union sctp_addr a; 736 union sctp_addr a;
737 __u8 use_as_src;
740}; 738};
741 739
742typedef struct sctp_chunk *(sctp_packet_phandler_t)(struct sctp_association *); 740typedef struct sctp_chunk *(sctp_packet_phandler_t)(struct sctp_association *);
@@ -984,6 +982,9 @@ struct sctp_transport {
984 */ 982 */
985 char cacc_saw_newack; 983 char cacc_saw_newack;
986 } cacc; 984 } cacc;
985
986 /* 64-bit random number sent with heartbeat. */
987 __u64 hb_nonce;
987}; 988};
988 989
989struct sctp_transport *sctp_transport_new(const union sctp_addr *, 990struct sctp_transport *sctp_transport_new(const union sctp_addr *,
@@ -1138,7 +1139,7 @@ int sctp_bind_addr_copy(struct sctp_bind_addr *dest,
1138 sctp_scope_t scope, gfp_t gfp, 1139 sctp_scope_t scope, gfp_t gfp,
1139 int flags); 1140 int flags);
1140int sctp_add_bind_addr(struct sctp_bind_addr *, union sctp_addr *, 1141int sctp_add_bind_addr(struct sctp_bind_addr *, union sctp_addr *,
1141 gfp_t gfp); 1142 __u8 use_as_src, gfp_t gfp);
1142int sctp_del_bind_addr(struct sctp_bind_addr *, union sctp_addr *); 1143int sctp_del_bind_addr(struct sctp_bind_addr *, union sctp_addr *);
1143int sctp_bind_addr_match(struct sctp_bind_addr *, const union sctp_addr *, 1144int sctp_bind_addr_match(struct sctp_bind_addr *, const union sctp_addr *,
1144 struct sctp_sock *); 1145 struct sctp_sock *);
diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h
index 8a6bef6f91eb..1b7aae6cdd82 100644
--- a/include/net/sctp/user.h
+++ b/include/net/sctp/user.h
@@ -560,9 +560,18 @@ struct sctp_paddrinfo {
560} __attribute__((packed, aligned(4))); 560} __attribute__((packed, aligned(4)));
561 561
562/* Peer addresses's state. */ 562/* Peer addresses's state. */
563/* UNKNOWN: Peer address passed by the upper layer in sendmsg or connect[x]
564 * calls.
565 * UNCONFIRMED: Peer address received in INIT/INIT-ACK address parameters.
566 * Not yet confirmed by a heartbeat and not available for data
567 * transfers.
568 * ACTIVE : Peer address confirmed, active and available for data transfers.
569 * INACTIVE: Peer address inactive and not available for data transfers.
570 */
563enum sctp_spinfo_state { 571enum sctp_spinfo_state {
564 SCTP_INACTIVE, 572 SCTP_INACTIVE,
565 SCTP_ACTIVE, 573 SCTP_ACTIVE,
574 SCTP_UNCONFIRMED,
566 SCTP_UNKNOWN = 0xffff /* Value used for transport state unknown */ 575 SCTP_UNKNOWN = 0xffff /* Value used for transport state unknown */
567}; 576};
568 577
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 3cd803b0d7a5..7a093d0aa0fe 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -914,6 +914,9 @@ static inline void tcp_set_state(struct sock *sk, int state)
914 914
915static inline void tcp_done(struct sock *sk) 915static inline void tcp_done(struct sock *sk)
916{ 916{
917 if(sk->sk_state == TCP_SYN_SENT || sk->sk_state == TCP_SYN_RECV)
918 TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS);
919
917 tcp_set_state(sk, TCP_CLOSE); 920 tcp_set_state(sk, TCP_CLOSE);
918 tcp_clear_xmit_timers(sk); 921 tcp_clear_xmit_timers(sk);
919 922
@@ -1086,6 +1089,7 @@ extern struct request_sock_ops tcp_request_sock_ops;
1086 1089
1087extern int tcp_v4_destroy_sock(struct sock *sk); 1090extern int tcp_v4_destroy_sock(struct sock *sk);
1088 1091
1092extern int tcp_v4_gso_send_check(struct sk_buff *skb);
1089extern struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features); 1093extern struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features);
1090 1094
1091#ifdef CONFIG_PROC_FS 1095#ifdef CONFIG_PROC_FS
diff --git a/include/rdma/ib_addr.h b/include/rdma/ib_addr.h
index fcb5ba87dcc5..0ff67398928d 100644
--- a/include/rdma/ib_addr.h
+++ b/include/rdma/ib_addr.h
@@ -89,9 +89,10 @@ static inline void ib_addr_set_pkey(struct rdma_dev_addr *dev_addr, u16 pkey)
89 dev_addr->broadcast[9] = (unsigned char) pkey; 89 dev_addr->broadcast[9] = (unsigned char) pkey;
90} 90}
91 91
92static inline union ib_gid *ib_addr_get_sgid(struct rdma_dev_addr *dev_addr) 92static inline void ib_addr_get_sgid(struct rdma_dev_addr *dev_addr,
93 union ib_gid *gid)
93{ 94{
94 return (union ib_gid *) (dev_addr->src_dev_addr + 4); 95 memcpy(gid, dev_addr->src_dev_addr + 4, sizeof *gid);
95} 96}
96 97
97static inline void ib_addr_set_sgid(struct rdma_dev_addr *dev_addr, 98static inline void ib_addr_set_sgid(struct rdma_dev_addr *dev_addr,
@@ -100,9 +101,10 @@ static inline void ib_addr_set_sgid(struct rdma_dev_addr *dev_addr,
100 memcpy(dev_addr->src_dev_addr + 4, gid, sizeof *gid); 101 memcpy(dev_addr->src_dev_addr + 4, gid, sizeof *gid);
101} 102}
102 103
103static inline union ib_gid *ib_addr_get_dgid(struct rdma_dev_addr *dev_addr) 104static inline void ib_addr_get_dgid(struct rdma_dev_addr *dev_addr,
105 union ib_gid *gid)
104{ 106{
105 return (union ib_gid *) (dev_addr->dst_dev_addr + 4); 107 memcpy(gid, dev_addr->dst_dev_addr + 4, sizeof *gid);
106} 108}
107 109
108static inline void ib_addr_set_dgid(struct rdma_dev_addr *dev_addr, 110static inline void ib_addr_set_dgid(struct rdma_dev_addr *dev_addr,
diff --git a/include/rdma/ib_fmr_pool.h b/include/rdma/ib_fmr_pool.h
index 4ace54cd0cce..00dadbf94e1d 100644
--- a/include/rdma/ib_fmr_pool.h
+++ b/include/rdma/ib_fmr_pool.h
@@ -88,7 +88,7 @@ int ib_flush_fmr_pool(struct ib_fmr_pool *pool);
88struct ib_pool_fmr *ib_fmr_pool_map_phys(struct ib_fmr_pool *pool_handle, 88struct ib_pool_fmr *ib_fmr_pool_map_phys(struct ib_fmr_pool *pool_handle,
89 u64 *page_list, 89 u64 *page_list,
90 int list_len, 90 int list_len,
91 u64 *io_virtual_address); 91 u64 io_virtual_address);
92 92
93int ib_fmr_pool_unmap(struct ib_pool_fmr *fmr); 93int ib_fmr_pool_unmap(struct ib_pool_fmr *fmr);
94 94
diff --git a/include/rdma/ib_mad.h b/include/rdma/ib_mad.h
index 5ff77558013b..585d28e960dd 100644
--- a/include/rdma/ib_mad.h
+++ b/include/rdma/ib_mad.h
@@ -75,6 +75,7 @@
75#define IB_MGMT_METHOD_TRAP_REPRESS 0x07 75#define IB_MGMT_METHOD_TRAP_REPRESS 0x07
76 76
77#define IB_MGMT_METHOD_RESP 0x80 77#define IB_MGMT_METHOD_RESP 0x80
78#define IB_BM_ATTR_MOD_RESP cpu_to_be32(1)
78 79
79#define IB_MGMT_MAX_METHODS 128 80#define IB_MGMT_MAX_METHODS 128
80 81
@@ -247,6 +248,12 @@ struct ib_mad_send_buf {
247}; 248};
248 249
249/** 250/**
251 * ib_response_mad - Returns if the specified MAD has been generated in
252 * response to a sent request or trap.
253 */
254int ib_response_mad(struct ib_mad *mad);
255
256/**
250 * ib_get_rmpp_resptime - Returns the RMPP response time. 257 * ib_get_rmpp_resptime - Returns the RMPP response time.
251 * @rmpp_hdr: An RMPP header. 258 * @rmpp_hdr: An RMPP header.
252 */ 259 */
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h
index ba2760802ded..41904f611d12 100644
--- a/include/scsi/libiscsi.h
+++ b/include/scsi/libiscsi.h
@@ -60,6 +60,7 @@ struct iscsi_nopin;
60#define TMABORT_SUCCESS 0x1 60#define TMABORT_SUCCESS 0x1
61#define TMABORT_FAILED 0x2 61#define TMABORT_FAILED 0x2
62#define TMABORT_TIMEDOUT 0x3 62#define TMABORT_TIMEDOUT 0x3
63#define TMABORT_NOT_FOUND 0x4
63 64
64/* Connection suspend "bit" */ 65/* Connection suspend "bit" */
65#define ISCSI_SUSPEND_BIT 1 66#define ISCSI_SUSPEND_BIT 1
@@ -83,6 +84,12 @@ struct iscsi_mgmt_task {
83 struct list_head running; 84 struct list_head running;
84}; 85};
85 86
87enum {
88 ISCSI_TASK_COMPLETED,
89 ISCSI_TASK_PENDING,
90 ISCSI_TASK_RUNNING,
91};
92
86struct iscsi_cmd_task { 93struct iscsi_cmd_task {
87 /* 94 /*
88 * Becuae LLDs allocate their hdr differently, this is a pointer to 95 * Becuae LLDs allocate their hdr differently, this is a pointer to
@@ -101,6 +108,8 @@ struct iscsi_cmd_task {
101 struct iscsi_conn *conn; /* used connection */ 108 struct iscsi_conn *conn; /* used connection */
102 struct iscsi_mgmt_task *mtask; /* tmf mtask in progr */ 109 struct iscsi_mgmt_task *mtask; /* tmf mtask in progr */
103 110
111 /* state set/tested under session->lock */
112 int state;
104 struct list_head running; /* running cmd list */ 113 struct list_head running; /* running cmd list */
105 void *dd_data; /* driver/transport data */ 114 void *dd_data; /* driver/transport data */
106}; 115};
@@ -126,6 +135,14 @@ struct iscsi_conn {
126 int id; /* CID */ 135 int id; /* CID */
127 struct list_head item; /* maintains list of conns */ 136 struct list_head item; /* maintains list of conns */
128 int c_stage; /* connection state */ 137 int c_stage; /* connection state */
138 /*
139 * Preallocated buffer for pdus that have data but do not
140 * originate from scsi-ml. We never have two pdus using the
141 * buffer at the same time. It is only allocated to
142 * the default max recv size because the pdus we support
143 * should always fit in this buffer
144 */
145 char *data;
129 struct iscsi_mgmt_task *login_mtask; /* mtask used for login/text */ 146 struct iscsi_mgmt_task *login_mtask; /* mtask used for login/text */
130 struct iscsi_mgmt_task *mtask; /* xmit mtask in progress */ 147 struct iscsi_mgmt_task *mtask; /* xmit mtask in progress */
131 struct iscsi_cmd_task *ctask; /* xmit ctask in progress */ 148 struct iscsi_cmd_task *ctask; /* xmit ctask in progress */
@@ -134,7 +151,7 @@ struct iscsi_conn {
134 struct kfifo *immqueue; /* immediate xmit queue */ 151 struct kfifo *immqueue; /* immediate xmit queue */
135 struct kfifo *mgmtqueue; /* mgmt (control) xmit queue */ 152 struct kfifo *mgmtqueue; /* mgmt (control) xmit queue */
136 struct list_head mgmt_run_list; /* list of control tasks */ 153 struct list_head mgmt_run_list; /* list of control tasks */
137 struct kfifo *xmitqueue; /* data-path cmd queue */ 154 struct list_head xmitqueue; /* data-path cmd queue */
138 struct list_head run_list; /* list of cmds in progress */ 155 struct list_head run_list; /* list of cmds in progress */
139 struct work_struct xmitwork; /* per-conn. xmit workqueue */ 156 struct work_struct xmitwork; /* per-conn. xmit workqueue */
140 /* 157 /*
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
index 371f70d9aa92..58e6444eebee 100644
--- a/include/scsi/scsi_cmnd.h
+++ b/include/scsi/scsi_cmnd.h
@@ -58,9 +58,7 @@ struct scsi_cmnd {
58 int timeout_per_command; 58 int timeout_per_command;
59 59
60 unsigned char cmd_len; 60 unsigned char cmd_len;
61 unsigned char old_cmd_len;
62 enum dma_data_direction sc_data_direction; 61 enum dma_data_direction sc_data_direction;
63 enum dma_data_direction sc_old_data_direction;
64 62
65 /* These elements define the operation we are about to perform */ 63 /* These elements define the operation we are about to perform */
66#define MAX_COMMAND_SIZE 16 64#define MAX_COMMAND_SIZE 16
@@ -71,18 +69,11 @@ struct scsi_cmnd {
71 void *request_buffer; /* Actual requested buffer */ 69 void *request_buffer; /* Actual requested buffer */
72 70
73 /* These elements define the operation we ultimately want to perform */ 71 /* These elements define the operation we ultimately want to perform */
74 unsigned char data_cmnd[MAX_COMMAND_SIZE];
75 unsigned short old_use_sg; /* We save use_sg here when requesting
76 * sense info */
77 unsigned short use_sg; /* Number of pieces of scatter-gather */ 72 unsigned short use_sg; /* Number of pieces of scatter-gather */
78 unsigned short sglist_len; /* size of malloc'd scatter-gather list */ 73 unsigned short sglist_len; /* size of malloc'd scatter-gather list */
79 unsigned bufflen; /* Size of data buffer */
80 void *buffer; /* Data buffer */
81 74
82 unsigned underflow; /* Return error if less than 75 unsigned underflow; /* Return error if less than
83 this amount is transferred */ 76 this amount is transferred */
84 unsigned old_underflow; /* save underflow here when reusing the
85 * command for error handling */
86 77
87 unsigned transfersize; /* How much we are guaranteed to 78 unsigned transfersize; /* How much we are guaranteed to
88 transfer with each SCSI transfer 79 transfer with each SCSI transfer
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h
index 5a3df1d7085f..39e833260bd0 100644
--- a/include/scsi/scsi_transport_iscsi.h
+++ b/include/scsi/scsi_transport_iscsi.h
@@ -57,8 +57,6 @@ struct sockaddr;
57 * @stop_conn: suspend/recover/terminate connection 57 * @stop_conn: suspend/recover/terminate connection
58 * @send_pdu: send iSCSI PDU, Login, Logout, NOP-Out, Reject, Text. 58 * @send_pdu: send iSCSI PDU, Login, Logout, NOP-Out, Reject, Text.
59 * @session_recovery_timedout: notify LLD a block during recovery timed out 59 * @session_recovery_timedout: notify LLD a block during recovery timed out
60 * @suspend_conn_recv: susepend the recv side of the connection
61 * @termincate_conn: destroy socket connection. Called with mutex lock.
62 * @init_cmd_task: Initialize a iscsi_cmd_task and any internal structs. 60 * @init_cmd_task: Initialize a iscsi_cmd_task and any internal structs.
63 * Called from queuecommand with session lock held. 61 * Called from queuecommand with session lock held.
64 * @init_mgmt_task: Initialize a iscsi_mgmt_task and any internal structs. 62 * @init_mgmt_task: Initialize a iscsi_mgmt_task and any internal structs.
@@ -112,8 +110,6 @@ struct iscsi_transport {
112 char *data, uint32_t data_size); 110 char *data, uint32_t data_size);
113 void (*get_stats) (struct iscsi_cls_conn *conn, 111 void (*get_stats) (struct iscsi_cls_conn *conn,
114 struct iscsi_stats *stats); 112 struct iscsi_stats *stats);
115 void (*suspend_conn_recv) (struct iscsi_conn *conn);
116 void (*terminate_conn) (struct iscsi_conn *conn);
117 void (*init_cmd_task) (struct iscsi_cmd_task *ctask); 113 void (*init_cmd_task) (struct iscsi_cmd_task *ctask);
118 void (*init_mgmt_task) (struct iscsi_conn *conn, 114 void (*init_mgmt_task) (struct iscsi_conn *conn,
119 struct iscsi_mgmt_task *mtask, 115 struct iscsi_mgmt_task *mtask,
diff --git a/include/scsi/scsi_transport_sas.h b/include/scsi/scsi_transport_sas.h
index e3c503cd175e..6cc2314098cf 100644
--- a/include/scsi/scsi_transport_sas.h
+++ b/include/scsi/scsi_transport_sas.h
@@ -106,6 +106,7 @@ struct sas_end_device {
106 106
107struct sas_expander_device { 107struct sas_expander_device {
108 int level; 108 int level;
109 int next_port_id;
109 110
110 #define SAS_EXPANDER_VENDOR_ID_LEN 8 111 #define SAS_EXPANDER_VENDOR_ID_LEN 8
111 char vendor_id[SAS_EXPANDER_VENDOR_ID_LEN+1]; 112 char vendor_id[SAS_EXPANDER_VENDOR_ID_LEN+1];
@@ -127,8 +128,10 @@ struct sas_expander_device {
127struct sas_port { 128struct sas_port {
128 struct device dev; 129 struct device dev;
129 130
130 u8 port_identifier; 131 int port_identifier;
131 int num_phys; 132 int num_phys;
133 /* port flags */
134 unsigned int is_backlink:1;
132 135
133 /* the other end of the link */ 136 /* the other end of the link */
134 struct sas_rphy *rphy; 137 struct sas_rphy *rphy;
@@ -168,11 +171,13 @@ extern void sas_rphy_delete(struct sas_rphy *);
168extern int scsi_is_sas_rphy(const struct device *); 171extern int scsi_is_sas_rphy(const struct device *);
169 172
170struct sas_port *sas_port_alloc(struct device *, int); 173struct sas_port *sas_port_alloc(struct device *, int);
174struct sas_port *sas_port_alloc_num(struct device *);
171int sas_port_add(struct sas_port *); 175int sas_port_add(struct sas_port *);
172void sas_port_free(struct sas_port *); 176void sas_port_free(struct sas_port *);
173void sas_port_delete(struct sas_port *); 177void sas_port_delete(struct sas_port *);
174void sas_port_add_phy(struct sas_port *, struct sas_phy *); 178void sas_port_add_phy(struct sas_port *, struct sas_phy *);
175void sas_port_delete_phy(struct sas_port *, struct sas_phy *); 179void sas_port_delete_phy(struct sas_port *, struct sas_phy *);
180void sas_port_mark_backlink(struct sas_port *);
176int scsi_is_sas_port(const struct device *); 181int scsi_is_sas_port(const struct device *);
177 182
178extern struct scsi_transport_template * 183extern struct scsi_transport_template *
diff --git a/include/sound/core.h b/include/sound/core.h
index 5d184be0ff72..bab3ff457e40 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -188,8 +188,6 @@ struct snd_minor {
188 int device; /* device number */ 188 int device; /* device number */
189 const struct file_operations *f_ops; /* file operations */ 189 const struct file_operations *f_ops; /* file operations */
190 void *private_data; /* private data for f_ops->open */ 190 void *private_data; /* private data for f_ops->open */
191 char name[0]; /* device name (keep at the end of
192 structure) */
193}; 191};
194 192
195/* sound.c */ 193/* sound.c */
diff --git a/include/sound/cs46xx.h b/include/sound/cs46xx.h
index 80b2979c0cba..685928e6f65a 100644
--- a/include/sound/cs46xx.h
+++ b/include/sound/cs46xx.h
@@ -1704,6 +1704,7 @@ struct snd_cs46xx {
1704 int acpi_port; 1704 int acpi_port;
1705 struct snd_kcontrol *eapd_switch; /* for amplifier hack */ 1705 struct snd_kcontrol *eapd_switch; /* for amplifier hack */
1706 int accept_valid; /* accept mmap valid (for OSS) */ 1706 int accept_valid; /* accept mmap valid (for OSS) */
1707 int in_suspend;
1707 1708
1708 struct gameport *gameport; 1709 struct gameport *gameport;
1709 1710
diff --git a/include/video/mbxfb.h b/include/video/mbxfb.h
new file mode 100644
index 000000000000..3bde0f5cd55c
--- /dev/null
+++ b/include/video/mbxfb.h
@@ -0,0 +1,28 @@
1#ifndef __MBX_FB_H
2#define __MBX_FB_H
3
4struct mbxfb_val {
5 unsigned int defval;
6 unsigned int min;
7 unsigned int max;
8};
9
10struct fb_info;
11
12struct mbxfb_platform_data {
13 /* Screen info */
14 struct mbxfb_val xres;
15 struct mbxfb_val yres;
16 struct mbxfb_val bpp;
17
18 /* Memory info */
19 unsigned long memsize; /* if 0 use ODFB? */
20 unsigned long timings1;
21 unsigned long timings2;
22 unsigned long timings3;
23
24 int (*probe)(struct fb_info *fb);
25 int (*remove)(struct fb_info *fb);
26};
27
28#endif /* __MBX_FB_H */