aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-10-02 08:45:08 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2006-10-02 08:45:08 -0400
commit59458f40e25915a355d8b1d701425fe9f4f9ea23 (patch)
treef1c9a2934df686e36d75f759ab7313b6f0e0e5f9 /include
parent825f9075d74028d11d7f5932f04e1b5db3022b51 (diff)
parentd834c16516d1ebec4766fc58c059bf01311e6045 (diff)
Merge branch 'master' into gfs2
Diffstat (limited to 'include')
-rw-r--r--include/asm-alpha/spinlock.h4
-rw-r--r--include/asm-arm/arch-at91rm9200/at91rm9200.h118
-rw-r--r--include/asm-arm/arch-at91rm9200/at91rm9200_sys.h3
-rw-r--r--include/asm-arm/arch-at91rm9200/at91rm9200_twi.h57
-rw-r--r--include/asm-arm/arch-at91rm9200/gpio.h18
-rw-r--r--include/asm-arm/arch-at91rm9200/hardware.h28
-rw-r--r--include/asm-arm/arch-at91rm9200/irqs.h2
-rw-r--r--include/asm-arm/arch-clps711x/time.h2
-rw-r--r--include/asm-arm/arch-iop32x/debug-macro.S20
-rw-r--r--include/asm-arm/arch-iop32x/dma.h (renamed from include/asm-arm/arch-iop3xx/dma.h)4
-rw-r--r--include/asm-arm/arch-iop32x/entry-macro.S21
-rw-r--r--include/asm-arm/arch-iop32x/glantank.h13
-rw-r--r--include/asm-arm/arch-iop32x/hardware.h44
-rw-r--r--include/asm-arm/arch-iop32x/io.h (renamed from include/asm-arm/arch-iop3xx/io.h)11
-rw-r--r--include/asm-arm/arch-iop32x/iop32x.h28
-rw-r--r--include/asm-arm/arch-iop32x/iq31244.h (renamed from include/asm-arm/arch-iop3xx/iq31244.h)15
-rw-r--r--include/asm-arm/arch-iop32x/iq80321.h (renamed from include/asm-arm/arch-iop3xx/iq80321.h)15
-rw-r--r--include/asm-arm/arch-iop32x/irqs.h50
-rw-r--r--include/asm-arm/arch-iop32x/memory.h26
-rw-r--r--include/asm-arm/arch-iop32x/n2100.h19
-rw-r--r--include/asm-arm/arch-iop32x/system.h33
-rw-r--r--include/asm-arm/arch-iop32x/timex.h9
-rw-r--r--include/asm-arm/arch-iop32x/uncompress.h39
-rw-r--r--include/asm-arm/arch-iop32x/vmalloc.h5
-rw-r--r--include/asm-arm/arch-iop33x/debug-macro.S24
-rw-r--r--include/asm-arm/arch-iop33x/dma.h9
-rw-r--r--include/asm-arm/arch-iop33x/entry-macro.S22
-rw-r--r--include/asm-arm/arch-iop33x/hardware.h46
-rw-r--r--include/asm-arm/arch-iop33x/io.h21
-rw-r--r--include/asm-arm/arch-iop33x/iop33x.h33
-rw-r--r--include/asm-arm/arch-iop33x/iq80331.h (renamed from include/asm-arm/arch-iop3xx/iq80331.h)15
-rw-r--r--include/asm-arm/arch-iop33x/iq80332.h (renamed from include/asm-arm/arch-iop3xx/iq80332.h)15
-rw-r--r--include/asm-arm/arch-iop33x/irqs.h60
-rw-r--r--include/asm-arm/arch-iop33x/memory.h26
-rw-r--r--include/asm-arm/arch-iop33x/system.h22
-rw-r--r--include/asm-arm/arch-iop33x/timex.h9
-rw-r--r--include/asm-arm/arch-iop33x/uncompress.h37
-rw-r--r--include/asm-arm/arch-iop33x/vmalloc.h5
-rw-r--r--include/asm-arm/arch-iop3xx/debug-macro.S35
-rw-r--r--include/asm-arm/arch-iop3xx/entry-macro.S57
-rw-r--r--include/asm-arm/arch-iop3xx/hardware.h57
-rw-r--r--include/asm-arm/arch-iop3xx/iop321-irqs.h100
-rw-r--r--include/asm-arm/arch-iop3xx/iop321.h345
-rw-r--r--include/asm-arm/arch-iop3xx/iop331-irqs.h132
-rw-r--r--include/asm-arm/arch-iop3xx/iop331.h363
-rw-r--r--include/asm-arm/arch-iop3xx/irqs.h21
-rw-r--r--include/asm-arm/arch-iop3xx/memory.h38
-rw-r--r--include/asm-arm/arch-iop3xx/system.h35
-rw-r--r--include/asm-arm/arch-iop3xx/timex.h20
-rw-r--r--include/asm-arm/arch-iop3xx/uncompress.h48
-rw-r--r--include/asm-arm/arch-iop3xx/vmalloc.h16
-rw-r--r--include/asm-arm/arch-ixp4xx/platform.h5
-rw-r--r--include/asm-arm/arch-l7200/io.h8
-rw-r--r--include/asm-arm/arch-l7200/time.h2
-rw-r--r--include/asm-arm/arch-omap/board-ams-delta.h11
-rw-r--r--include/asm-arm/arch-omap/clock.h1
-rw-r--r--include/asm-arm/arch-omap/dma.h16
-rw-r--r--include/asm-arm/arch-omap/dmtimer.h2
-rw-r--r--include/asm-arm/arch-omap/gpmc.h4
-rw-r--r--include/asm-arm/arch-omap/irqs.h2
-rw-r--r--include/asm-arm/arch-omap/keypad.h3
-rw-r--r--include/asm-arm/arch-omap/mux.h25
-rw-r--r--include/asm-arm/arch-s3c2410/dma.h66
-rw-r--r--include/asm-arm/arch-s3c2410/map.h5
-rw-r--r--include/asm-arm/arch-s3c2410/osiris-map.h18
-rw-r--r--include/asm-arm/arch-s3c2410/regs-ac97.h23
-rw-r--r--include/asm-arm/arch-s3c2410/regs-lcd.h30
-rw-r--r--include/asm-arm/atomic.h16
-rw-r--r--include/asm-arm/bitops.h24
-rw-r--r--include/asm-arm/cacheflush.h22
-rw-r--r--include/asm-arm/flat.h16
-rw-r--r--include/asm-arm/hardware/iop3xx.h301
-rw-r--r--include/asm-arm/hardware/locomo.h33
-rw-r--r--include/asm-arm/hardware/sharpsl_pm.h1
-rw-r--r--include/asm-arm/io.h4
-rw-r--r--include/asm-arm/irqflags.h132
-rw-r--r--include/asm-arm/mach/pci.h10
-rw-r--r--include/asm-arm/mach/time.h2
-rw-r--r--include/asm-arm/page.h3
-rw-r--r--include/asm-arm/pgtable.h7
-rw-r--r--include/asm-arm/proc-fns.h40
-rw-r--r--include/asm-arm/setup.h12
-rw-r--r--include/asm-arm/spinlock.h4
-rw-r--r--include/asm-arm/system.h137
-rw-r--r--include/asm-arm/timeofday.h4
-rw-r--r--include/asm-arm/tlbflush.h76
-rw-r--r--include/asm-arm/unaligned.h62
-rw-r--r--include/asm-cris/arch-v32/spinlock.h4
-rw-r--r--include/asm-frv/pgtable.h2
-rw-r--r--include/asm-frv/timex.h5
-rw-r--r--include/asm-generic/bug.h32
-rw-r--r--include/asm-generic/pgtable.h37
-rw-r--r--include/asm-h8300/keyboard.h8
-rw-r--r--include/asm-i386/dma-mapping.h12
-rw-r--r--include/asm-i386/mach-default/do_timer.h2
-rw-r--r--include/asm-i386/mach-summit/mach_apic.h2
-rw-r--r--include/asm-i386/mach-visws/do_timer.h2
-rw-r--r--include/asm-i386/mach-voyager/do_timer.h2
-rw-r--r--include/asm-i386/nmi.h6
-rw-r--r--include/asm-i386/pgtable-2level.h1
-rw-r--r--include/asm-i386/pgtable-3level.h16
-rw-r--r--include/asm-i386/pgtable.h80
-rw-r--r--include/asm-i386/smp.h4
-rw-r--r--include/asm-i386/spinlock.h4
-rw-r--r--include/asm-ia64/spinlock.h4
-rw-r--r--include/asm-m32r/pgtable-2level.h2
-rw-r--r--include/asm-m32r/spinlock.h4
-rw-r--r--include/asm-m32r/timex.h3
-rw-r--r--include/asm-mips/spinlock.h4
-rw-r--r--include/asm-parisc/spinlock.h4
-rw-r--r--include/asm-powerpc/bug.h12
-rw-r--r--include/asm-powerpc/io.h2
-rw-r--r--include/asm-powerpc/spinlock.h4
-rw-r--r--include/asm-ppc/spinlock.h4
-rw-r--r--include/asm-s390/appldata.h2
-rw-r--r--include/asm-s390/atomic.h120
-rw-r--r--include/asm-s390/bitops.h626
-rw-r--r--include/asm-s390/byteorder.h50
-rw-r--r--include/asm-s390/checksum.h176
-rw-r--r--include/asm-s390/div64.h48
-rw-r--r--include/asm-s390/ebcdic.h20
-rw-r--r--include/asm-s390/io.h14
-rw-r--r--include/asm-s390/irq.h3
-rw-r--r--include/asm-s390/irqflags.h110
-rw-r--r--include/asm-s390/lowcore.h2
-rw-r--r--include/asm-s390/page.h111
-rw-r--r--include/asm-s390/pgtable.h90
-rw-r--r--include/asm-s390/processor.h130
-rw-r--r--include/asm-s390/ptrace.h2
-rw-r--r--include/asm-s390/rwsem.h238
-rw-r--r--include/asm-s390/semaphore.h16
-rw-r--r--include/asm-s390/setup.h1
-rw-r--r--include/asm-s390/sfp-machine.h64
-rw-r--r--include/asm-s390/sigp.h65
-rw-r--r--include/asm-s390/smp.h2
-rw-r--r--include/asm-s390/spinlock.h62
-rw-r--r--include/asm-s390/spinlock_types.h6
-rw-r--r--include/asm-s390/string.h56
-rw-r--r--include/asm-s390/system.h342
-rw-r--r--include/asm-s390/timex.h19
-rw-r--r--include/asm-s390/tlbflush.h32
-rw-r--r--include/asm-s390/uaccess.h13
-rw-r--r--include/asm-s390/unistd.h258
-rw-r--r--include/asm-sh/ec3104/keyboard.h2
-rw-r--r--include/asm-sh/mpc1211/keyboard.h4
-rw-r--r--include/asm-sh/spinlock.h4
-rw-r--r--include/asm-sh64/keyboard.h4
-rw-r--r--include/asm-sh64/timex.h3
-rw-r--r--include/asm-sparc/spinlock.h4
-rw-r--r--include/asm-sparc64/spinlock.h4
-rw-r--r--include/asm-um/pgtable.h6
-rw-r--r--include/asm-x86_64/dma-mapping.h7
-rw-r--r--include/asm-x86_64/nmi.h7
-rw-r--r--include/asm-x86_64/semaphore.h4
-rw-r--r--include/asm-x86_64/spinlock.h4
-rw-r--r--include/asm-x86_64/uaccess.h7
-rw-r--r--include/asm-x86_64/vsyscall.h3
-rw-r--r--include/asm-xtensa/timex.h3
-rw-r--r--include/linux/Kbuild4
-rw-r--r--include/linux/acct.h4
-rw-r--r--include/linux/aio.h12
-rw-r--r--include/linux/aio_abi.h2
-rw-r--r--include/linux/atalk.h40
-rw-r--r--include/linux/atmlec.h119
-rw-r--r--include/linux/audit.h5
-rw-r--r--include/linux/bio.h2
-rw-r--r--include/linux/blkdev.h337
-rw-r--r--include/linux/blktrace_api.h3
-rw-r--r--include/linux/buffer_head.h19
-rw-r--r--include/linux/compat_ioctl.h20
-rw-r--r--include/linux/compiler.h12
-rw-r--r--include/linux/cpuset.h4
-rw-r--r--include/linux/cramfs_fs.h2
-rw-r--r--include/linux/dma-mapping.h7
-rw-r--r--include/linux/dmi.h3
-rw-r--r--include/linux/elevator.h68
-rw-r--r--include/linux/errqueue.h2
-rw-r--r--include/linux/ext2_fs.h64
-rw-r--r--include/linux/ext3_fs.h26
-rw-r--r--include/linux/file.h1
-rw-r--r--include/linux/fs.h126
-rw-r--r--include/linux/generic_acl.h36
-rw-r--r--include/linux/genhd.h4
-rw-r--r--include/linux/getcpu.h12
-rw-r--r--include/linux/hrtimer.h1
-rw-r--r--include/linux/i2c-id.h1
-rw-r--r--include/linux/icmp.h12
-rw-r--r--include/linux/if.h130
-rw-r--r--include/linux/if_arp.h6
-rw-r--r--include/linux/if_link.h136
-rw-r--r--include/linux/igmp.h38
-rw-r--r--include/linux/in.h12
-rw-r--r--include/linux/in6.h6
-rw-r--r--include/linux/inet_diag.h10
-rw-r--r--include/linux/inetdevice.h24
-rw-r--r--include/linux/interrupt.h16
-rw-r--r--include/linux/io.h4
-rw-r--r--include/linux/ip.h14
-rw-r--r--include/linux/ipmi.h48
-rw-r--r--include/linux/ipv6.h16
-rw-r--r--include/linux/jbd.h1
-rw-r--r--include/linux/kmod.h4
-rw-r--r--include/linux/latency.h25
-rw-r--r--include/linux/leds.h3
-rw-r--r--include/linux/list.h15
-rw-r--r--include/linux/lockdep.h4
-rw-r--r--include/linux/loop.h5
-rw-r--r--include/linux/memory.h4
-rw-r--r--include/linux/memory_hotplug.h2
-rw-r--r--include/linux/mm.h6
-rw-r--r--include/linux/mmc/host.h2
-rw-r--r--include/linux/mmc/mmc.h1
-rw-r--r--include/linux/module.h4
-rw-r--r--include/linux/mpage.h7
-rw-r--r--include/linux/mroute.h14
-rw-r--r--include/linux/msdos_fs.h3
-rw-r--r--include/linux/namei.h2
-rw-r--r--include/linux/ncp_fs.h1
-rw-r--r--include/linux/netdevice.h2
-rw-r--r--include/linux/netfilter_arp/arp_tables.h6
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack.h2
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_h323.h6
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_tuple.h16
-rw-r--r--include/linux/netfilter_ipv4/ip_nat.h2
-rw-r--r--include/linux/netfilter_ipv4/ip_queue.h2
-rw-r--r--include/linux/netfilter_ipv4/ipt_iprange.h2
-rw-r--r--include/linux/nfs_fs.h10
-rw-r--r--include/linux/nmi.h3
-rw-r--r--include/linux/page-flags.h11
-rw-r--r--include/linux/pci.h5
-rw-r--r--include/linux/pci_ids.h6
-rw-r--r--include/linux/percpu.h2
-rw-r--r--include/linux/posix-timers.h4
-rw-r--r--include/linux/ptrace.h4
-rw-r--r--include/linux/raid/md.h3
-rw-r--r--include/linux/raid/md_k.h3
-rw-r--r--include/linux/ramfs.h1
-rw-r--r--include/linux/rbtree.h2
-rw-r--r--include/linux/reiserfs_acl.h17
-rw-r--r--include/linux/reiserfs_fs.h41
-rw-r--r--include/linux/reiserfs_fs_i.h5
-rw-r--r--include/linux/reiserfs_fs_sb.h2
-rw-r--r--include/linux/reiserfs_xattr.h8
-rw-r--r--include/linux/rtc.h4
-rw-r--r--include/linux/rtnetlink.h2
-rw-r--r--include/linux/sched.h28
-rw-r--r--include/linux/scx200_gpio.h1
-rw-r--r--include/linux/security.h1
-rw-r--r--include/linux/shmem_fs.h24
-rw-r--r--include/linux/spinlock.h14
-rw-r--r--include/linux/spinlock_api_smp.h50
-rw-r--r--include/linux/stddef.h6
-rw-r--r--include/linux/string.h1
-rw-r--r--include/linux/sunrpc/auth.h16
-rw-r--r--include/linux/sunrpc/msg_prot.h2
-rw-r--r--include/linux/sunrpc/svc.h45
-rw-r--r--include/linux/sunrpc/svcauth.h4
-rw-r--r--include/linux/sunrpc/xdr.h38
-rw-r--r--include/linux/sunrpc/xprt.h12
-rw-r--r--include/linux/synclink.h4
-rw-r--r--include/linux/syscalls.h2
-rw-r--r--include/linux/sysrq.h4
-rw-r--r--include/linux/taskstats.h64
-rw-r--r--include/linux/tcp.h23
-rw-r--r--include/linux/timex.h58
-rw-r--r--include/linux/trdevice.h2
-rw-r--r--include/linux/tsacct_kern.h34
-rw-r--r--include/linux/tty.h6
-rw-r--r--include/linux/types.h2
-rw-r--r--include/linux/udp.h8
-rw-r--r--include/linux/unwind.h2
-rw-r--r--include/linux/usb.h2
-rw-r--r--include/linux/utime.h2
-rw-r--r--include/linux/videodev2.h5
-rw-r--r--include/linux/vmstat.h1
-rw-r--r--include/linux/vt_kern.h3
-rw-r--r--include/linux/writeback.h3
-rw-r--r--include/linux/xfrm.h16
-rw-r--r--include/media/ir-common.h2
-rw-r--r--include/media/tuner-types.h3
-rw-r--r--include/media/tuner.h1
-rw-r--r--include/media/v4l2-common.h16
-rw-r--r--include/media/v4l2-dev.h10
-rw-r--r--include/net/arp.h8
-rw-r--r--include/net/bluetooth/hci.h11
-rw-r--r--include/net/bluetooth/hci_core.h18
-rw-r--r--include/net/cipso_ipv4.h5
-rw-r--r--include/net/dst.h2
-rw-r--r--include/net/flow.h10
-rw-r--r--include/net/genetlink.h18
-rw-r--r--include/net/icmp.h2
-rw-r--r--include/net/inet_connection_sock.h6
-rw-r--r--include/net/inet_hashtables.h56
-rw-r--r--include/net/inet_sock.h34
-rw-r--r--include/net/inet_timewait_sock.h10
-rw-r--r--include/net/inetpeer.h4
-rw-r--r--include/net/ip.h10
-rw-r--r--include/net/ip_fib.h28
-rw-r--r--include/net/ip_mp_alg.h4
-rw-r--r--include/net/ip_vs.h68
-rw-r--r--include/net/ipv6.h6
-rw-r--r--include/net/irda/irlan_common.h10
-rw-r--r--include/net/irda/irlap_frame.h31
-rw-r--r--include/net/irda/irlmp.h2
-rw-r--r--include/net/netlabel.h8
-rw-r--r--include/net/netlink.h12
-rw-r--r--include/net/route.h24
-rw-r--r--include/net/sock.h1
-rw-r--r--include/net/xfrm.h26
-rw-r--r--include/scsi/scsi_device.h4
-rw-r--r--include/scsi/scsi_tcq.h5
-rw-r--r--include/sound/pcm.h1
312 files changed, 4779 insertions, 4170 deletions
diff --git a/include/asm-alpha/spinlock.h b/include/asm-alpha/spinlock.h
index 0c294c9b0c55..aeeb125f6851 100644
--- a/include/asm-alpha/spinlock.h
+++ b/include/asm-alpha/spinlock.h
@@ -166,4 +166,8 @@ static inline void __raw_write_unlock(raw_rwlock_t * lock)
166 lock->lock = 0; 166 lock->lock = 0;
167} 167}
168 168
169#define _raw_spin_relax(lock) cpu_relax()
170#define _raw_read_relax(lock) cpu_relax()
171#define _raw_write_relax(lock) cpu_relax()
172
169#endif /* _ALPHA_SPINLOCK_H */ 173#endif /* _ALPHA_SPINLOCK_H */
diff --git a/include/asm-arm/arch-at91rm9200/at91rm9200.h b/include/asm-arm/arch-at91rm9200/at91rm9200.h
index 58f40931a5c1..a5a86b1ff886 100644
--- a/include/asm-arm/arch-at91rm9200/at91rm9200.h
+++ b/include/asm-arm/arch-at91rm9200/at91rm9200.h
@@ -19,67 +19,80 @@
19/* 19/*
20 * Peripheral identifiers/interrupts. 20 * Peripheral identifiers/interrupts.
21 */ 21 */
22#define AT91_ID_FIQ 0 /* Advanced Interrupt Controller (FIQ) */ 22#define AT91_ID_FIQ 0 /* Advanced Interrupt Controller (FIQ) */
23#define AT91_ID_SYS 1 /* System Peripheral */ 23#define AT91_ID_SYS 1 /* System Peripheral */
24#define AT91_ID_PIOA 2 /* Parallel IO Controller A */ 24#define AT91RM9200_ID_PIOA 2 /* Parallel IO Controller A */
25#define AT91_ID_PIOB 3 /* Parallel IO Controller B */ 25#define AT91RM9200_ID_PIOB 3 /* Parallel IO Controller B */
26#define AT91_ID_PIOC 4 /* Parallel IO Controller C */ 26#define AT91RM9200_ID_PIOC 4 /* Parallel IO Controller C */
27#define AT91_ID_PIOD 5 /* Parallel IO Controller D */ 27#define AT91RM9200_ID_PIOD 5 /* Parallel IO Controller D */
28#define AT91_ID_US0 6 /* USART 0 */ 28#define AT91RM9200_ID_US0 6 /* USART 0 */
29#define AT91_ID_US1 7 /* USART 1 */ 29#define AT91RM9200_ID_US1 7 /* USART 1 */
30#define AT91_ID_US2 8 /* USART 2 */ 30#define AT91RM9200_ID_US2 8 /* USART 2 */
31#define AT91_ID_US3 9 /* USART 3 */ 31#define AT91RM9200_ID_US3 9 /* USART 3 */
32#define AT91_ID_MCI 10 /* Multimedia Card Interface */ 32#define AT91RM9200_ID_MCI 10 /* Multimedia Card Interface */
33#define AT91_ID_UDP 11 /* USB Device Port */ 33#define AT91RM9200_ID_UDP 11 /* USB Device Port */
34#define AT91_ID_TWI 12 /* Two-Wire Interface */ 34#define AT91RM9200_ID_TWI 12 /* Two-Wire Interface */
35#define AT91_ID_SPI 13 /* Serial Peripheral Interface */ 35#define AT91RM9200_ID_SPI 13 /* Serial Peripheral Interface */
36#define AT91_ID_SSC0 14 /* Serial Synchronous Controller 0 */ 36#define AT91RM9200_ID_SSC0 14 /* Serial Synchronous Controller 0 */
37#define AT91_ID_SSC1 15 /* Serial Synchronous Controller 1 */ 37#define AT91RM9200_ID_SSC1 15 /* Serial Synchronous Controller 1 */
38#define AT91_ID_SSC2 16 /* Serial Synchronous Controller 2 */ 38#define AT91RM9200_ID_SSC2 16 /* Serial Synchronous Controller 2 */
39#define AT91_ID_TC0 17 /* Timer Counter 0 */ 39#define AT91RM9200_ID_TC0 17 /* Timer Counter 0 */
40#define AT91_ID_TC1 18 /* Timer Counter 1 */ 40#define AT91RM9200_ID_TC1 18 /* Timer Counter 1 */
41#define AT91_ID_TC2 19 /* Timer Counter 2 */ 41#define AT91RM9200_ID_TC2 19 /* Timer Counter 2 */
42#define AT91_ID_TC3 20 /* Timer Counter 3 */ 42#define AT91RM9200_ID_TC3 20 /* Timer Counter 3 */
43#define AT91_ID_TC4 21 /* Timer Counter 4 */ 43#define AT91RM9200_ID_TC4 21 /* Timer Counter 4 */
44#define AT91_ID_TC5 22 /* Timer Counter 5 */ 44#define AT91RM9200_ID_TC5 22 /* Timer Counter 5 */
45#define AT91_ID_UHP 23 /* USB Host port */ 45#define AT91RM9200_ID_UHP 23 /* USB Host port */
46#define AT91_ID_EMAC 24 /* Ethernet MAC */ 46#define AT91RM9200_ID_EMAC 24 /* Ethernet MAC */
47#define AT91_ID_IRQ0 25 /* Advanced Interrupt Controller (IRQ0) */ 47#define AT91RM9200_ID_IRQ0 25 /* Advanced Interrupt Controller (IRQ0) */
48#define AT91_ID_IRQ1 26 /* Advanced Interrupt Controller (IRQ1) */ 48#define AT91RM9200_ID_IRQ1 26 /* Advanced Interrupt Controller (IRQ1) */
49#define AT91_ID_IRQ2 27 /* Advanced Interrupt Controller (IRQ2) */ 49#define AT91RM9200_ID_IRQ2 27 /* Advanced Interrupt Controller (IRQ2) */
50#define AT91_ID_IRQ3 28 /* Advanced Interrupt Controller (IRQ3) */ 50#define AT91RM9200_ID_IRQ3 28 /* Advanced Interrupt Controller (IRQ3) */
51#define AT91_ID_IRQ4 29 /* Advanced Interrupt Controller (IRQ4) */ 51#define AT91RM9200_ID_IRQ4 29 /* Advanced Interrupt Controller (IRQ4) */
52#define AT91_ID_IRQ5 30 /* Advanced Interrupt Controller (IRQ5) */ 52#define AT91RM9200_ID_IRQ5 30 /* Advanced Interrupt Controller (IRQ5) */
53#define AT91_ID_IRQ6 31 /* Advanced Interrupt Controller (IRQ6) */ 53#define AT91RM9200_ID_IRQ6 31 /* Advanced Interrupt Controller (IRQ6) */
54 54
55 55
56/* 56/*
57 * Peripheral physical base addresses. 57 * Peripheral physical base addresses.
58 */ 58 */
59#define AT91_BASE_TCB0 0xfffa0000 59#define AT91RM9200_BASE_TCB0 0xfffa0000
60#define AT91_BASE_TC0 0xfffa0000 60#define AT91RM9200_BASE_TC0 0xfffa0000
61#define AT91_BASE_TC1 0xfffa0040 61#define AT91RM9200_BASE_TC1 0xfffa0040
62#define AT91_BASE_TC2 0xfffa0080 62#define AT91RM9200_BASE_TC2 0xfffa0080
63#define AT91_BASE_TCB1 0xfffa4000 63#define AT91RM9200_BASE_TCB1 0xfffa4000
64#define AT91_BASE_TC3 0xfffa4000 64#define AT91RM9200_BASE_TC3 0xfffa4000
65#define AT91_BASE_TC4 0xfffa4040 65#define AT91RM9200_BASE_TC4 0xfffa4040
66#define AT91_BASE_TC5 0xfffa4080 66#define AT91RM9200_BASE_TC5 0xfffa4080
67#define AT91_BASE_UDP 0xfffb0000 67#define AT91RM9200_BASE_UDP 0xfffb0000
68#define AT91_BASE_MCI 0xfffb4000 68#define AT91RM9200_BASE_MCI 0xfffb4000
69#define AT91_BASE_TWI 0xfffb8000 69#define AT91RM9200_BASE_TWI 0xfffb8000
70#define AT91_BASE_EMAC 0xfffbc000 70#define AT91RM9200_BASE_EMAC 0xfffbc000
71#define AT91_BASE_US0 0xfffc0000 71#define AT91RM9200_BASE_US0 0xfffc0000
72#define AT91_BASE_US1 0xfffc4000 72#define AT91RM9200_BASE_US1 0xfffc4000
73#define AT91_BASE_US2 0xfffc8000 73#define AT91RM9200_BASE_US2 0xfffc8000
74#define AT91_BASE_US3 0xfffcc000 74#define AT91RM9200_BASE_US3 0xfffcc000
75#define AT91_BASE_SSC0 0xfffd0000 75#define AT91RM9200_BASE_SSC0 0xfffd0000
76#define AT91_BASE_SSC1 0xfffd4000 76#define AT91RM9200_BASE_SSC1 0xfffd4000
77#define AT91_BASE_SSC2 0xfffd8000 77#define AT91RM9200_BASE_SSC2 0xfffd8000
78#define AT91_BASE_SPI 0xfffe0000 78#define AT91RM9200_BASE_SPI 0xfffe0000
79#define AT91_BASE_SYS 0xfffff000 79#define AT91_BASE_SYS 0xfffff000
80 80
81 81
82/* 82/*
83 * Internal Memory.
84 */
85#define AT91RM9200_ROM_BASE 0x00100000 /* Internal ROM base address */
86#define AT91RM9200_ROM_SIZE SZ_128K /* Internal ROM size (128Kb) */
87
88#define AT91RM9200_SRAM_BASE 0x00200000 /* Internal SRAM base address */
89#define AT91RM9200_SRAM_SIZE SZ_16K /* Internal SRAM size (16Kb) */
90
91#define AT91RM9200_UHP_BASE 0x00300000 /* USB Host controller */
92
93
94#if 0
95/*
83 * PIO pin definitions (peripheral A/B multiplexing). 96 * PIO pin definitions (peripheral A/B multiplexing).
84 */ 97 */
85#define AT91_PA0_MISO (1 << 0) /* A: SPI Master-In Slave-Out */ 98#define AT91_PA0_MISO (1 << 0) /* A: SPI Master-In Slave-Out */
@@ -257,5 +270,6 @@
257#define AT91_PD25_TPK13 (1 << 25) /* B: ETM Trace Packet Port 13 */ 270#define AT91_PD25_TPK13 (1 << 25) /* B: ETM Trace Packet Port 13 */
258#define AT91_PD26_TPK14 (1 << 26) /* B: ETM Trace Packet Port 14 */ 271#define AT91_PD26_TPK14 (1 << 26) /* B: ETM Trace Packet Port 14 */
259#define AT91_PD27_TPK15 (1 << 27) /* B: ETM Trace Packet Port 15 */ 272#define AT91_PD27_TPK15 (1 << 27) /* B: ETM Trace Packet Port 15 */
273#endif
260 274
261#endif 275#endif
diff --git a/include/asm-arm/arch-at91rm9200/at91rm9200_sys.h b/include/asm-arm/arch-at91rm9200/at91rm9200_sys.h
index 0f4c12d5f0cd..73693fea76a2 100644
--- a/include/asm-arm/arch-at91rm9200/at91rm9200_sys.h
+++ b/include/asm-arm/arch-at91rm9200/at91rm9200_sys.h
@@ -80,6 +80,9 @@
80#define AT91_CIDR_NVPTYP (7 << 28) /* Nonvolatile Program Memory Type */ 80#define AT91_CIDR_NVPTYP (7 << 28) /* Nonvolatile Program Memory Type */
81#define AT91_CIDR_EXT (1 << 31) /* Extension Flag */ 81#define AT91_CIDR_EXT (1 << 31) /* Extension Flag */
82 82
83#define AT91_AIC_FFER (AT91_AIC + 0x140) /* Fast Forcing Enable Register [SAM9 only] */
84#define AT91_AIC_FFDR (AT91_AIC + 0x144) /* Fast Forcing Disable Register [SAM9 only] */
85#define AT91_AIC_FFSR (AT91_AIC + 0x148) /* Fast Forcing Status Register [SAM9 only] */
83 86
84/* 87/*
85 * PIO Controllers. 88 * PIO Controllers.
diff --git a/include/asm-arm/arch-at91rm9200/at91rm9200_twi.h b/include/asm-arm/arch-at91rm9200/at91rm9200_twi.h
new file mode 100644
index 000000000000..93547d7482bd
--- /dev/null
+++ b/include/asm-arm/arch-at91rm9200/at91rm9200_twi.h
@@ -0,0 +1,57 @@
1/*
2 * include/asm-arm/arch-at91rm9200/at91rm9200_twi.h
3 *
4 * Copyright (C) 2005 Ivan Kokshaysky
5 * Copyright (C) SAN People
6 *
7 * Two-wire Interface (TWI) registers.
8 * Based on AT91RM9200 datasheet revision E.
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
16#ifndef AT91RM9200_TWI_H
17#define AT91RM9200_TWI_H
18
19#define AT91_TWI_CR 0x00 /* Control Register */
20#define AT91_TWI_START (1 << 0) /* Send a Start Condition */
21#define AT91_TWI_STOP (1 << 1) /* Send a Stop Condition */
22#define AT91_TWI_MSEN (1 << 2) /* Master Transfer Enable */
23#define AT91_TWI_MSDIS (1 << 3) /* Master Transfer Disable */
24#define AT91_TWI_SWRST (1 << 7) /* Software Reset */
25
26#define AT91_TWI_MMR 0x04 /* Master Mode Register */
27#define AT91_TWI_IADRSZ (3 << 8) /* Internal Device Address Size */
28#define AT91_TWI_IADRSZ_NO (0 << 8)
29#define AT91_TWI_IADRSZ_1 (1 << 8)
30#define AT91_TWI_IADRSZ_2 (2 << 8)
31#define AT91_TWI_IADRSZ_3 (3 << 8)
32#define AT91_TWI_MREAD (1 << 12) /* Master Read Direction */
33#define AT91_TWI_DADR (0x7f << 16) /* Device Address */
34
35#define AT91_TWI_IADR 0x0c /* Internal Address Register */
36
37#define AT91_TWI_CWGR 0x10 /* Clock Waveform Generator Register */
38#define AT91_TWI_CLDIV (0xff << 0) /* Clock Low Divisor */
39#define AT91_TWI_CHDIV (0xff << 8) /* Clock High Divisor */
40#define AT91_TWI_CKDIV (7 << 16) /* Clock Divider */
41
42#define AT91_TWI_SR 0x20 /* Status Register */
43#define AT91_TWI_TXCOMP (1 << 0) /* Transmission Complete */
44#define AT91_TWI_RXRDY (1 << 1) /* Receive Holding Register Ready */
45#define AT91_TWI_TXRDY (1 << 2) /* Transmit Holding Register Ready */
46#define AT91_TWI_OVRE (1 << 6) /* Overrun Error */
47#define AT91_TWI_UNRE (1 << 7) /* Underrun Error */
48#define AT91_TWI_NACK (1 << 8) /* Not Acknowledged */
49
50#define AT91_TWI_IER 0x24 /* Interrupt Enable Register */
51#define AT91_TWI_IDR 0x28 /* Interrupt Disable Register */
52#define AT91_TWI_IMR 0x2c /* Interrupt Mask Register */
53#define AT91_TWI_RHR 0x30 /* Receive Holding Register */
54#define AT91_TWI_THR 0x34 /* Transmit Holding Register */
55
56#endif
57
diff --git a/include/asm-arm/arch-at91rm9200/gpio.h b/include/asm-arm/arch-at91rm9200/gpio.h
index dbde1baaf251..a011d27876a2 100644
--- a/include/asm-arm/arch-at91rm9200/gpio.h
+++ b/include/asm-arm/arch-at91rm9200/gpio.h
@@ -17,10 +17,9 @@
17 17
18#define PIN_BASE NR_AIC_IRQS 18#define PIN_BASE NR_AIC_IRQS
19 19
20#define PQFP_GPIO_BANKS 3 /* PQFP package has 3 banks */ 20#define MAX_GPIO_BANKS 4
21#define BGA_GPIO_BANKS 4 /* BGA package has 4 banks */
22 21
23/* these pin numbers double as IRQ numbers, like AT91_ID_* values */ 22/* these pin numbers double as IRQ numbers, like AT91xxx_ID_* values */
24 23
25#define AT91_PIN_PA0 (PIN_BASE + 0x00 + 0) 24#define AT91_PIN_PA0 (PIN_BASE + 0x00 + 0)
26#define AT91_PIN_PA1 (PIN_BASE + 0x00 + 1) 25#define AT91_PIN_PA1 (PIN_BASE + 0x00 + 1)
@@ -180,17 +179,18 @@
180 179
181#ifndef __ASSEMBLY__ 180#ifndef __ASSEMBLY__
182/* setup setup routines, called from board init or driver probe() */ 181/* setup setup routines, called from board init or driver probe() */
183extern int at91_set_A_periph(unsigned pin, int use_pullup); 182extern int __init_or_module at91_set_A_periph(unsigned pin, int use_pullup);
184extern int at91_set_B_periph(unsigned pin, int use_pullup); 183extern int __init_or_module at91_set_B_periph(unsigned pin, int use_pullup);
185extern int at91_set_gpio_input(unsigned pin, int use_pullup); 184extern int __init_or_module at91_set_gpio_input(unsigned pin, int use_pullup);
186extern int at91_set_gpio_output(unsigned pin, int value); 185extern int __init_or_module at91_set_gpio_output(unsigned pin, int value);
187extern int at91_set_deglitch(unsigned pin, int is_on); 186extern int __init_or_module at91_set_deglitch(unsigned pin, int is_on);
188extern int at91_set_multi_drive(unsigned pin, int is_on); 187extern int __init_or_module at91_set_multi_drive(unsigned pin, int is_on);
189 188
190/* callable at any time */ 189/* callable at any time */
191extern int at91_set_gpio_value(unsigned pin, int value); 190extern int at91_set_gpio_value(unsigned pin, int value);
192extern int at91_get_gpio_value(unsigned pin); 191extern int at91_get_gpio_value(unsigned pin);
193 192
193/* callable only from core power-management code */
194extern void at91_gpio_suspend(void); 194extern void at91_gpio_suspend(void);
195extern void at91_gpio_resume(void); 195extern void at91_gpio_resume(void);
196#endif 196#endif
diff --git a/include/asm-arm/arch-at91rm9200/hardware.h b/include/asm-arm/arch-at91rm9200/hardware.h
index 235d39d91107..6551b4d1ff7b 100644
--- a/include/asm-arm/arch-at91rm9200/hardware.h
+++ b/include/asm-arm/arch-at91rm9200/hardware.h
@@ -34,27 +34,14 @@
34 * Virtual to Physical Address mapping for IO devices. 34 * Virtual to Physical Address mapping for IO devices.
35 */ 35 */
36#define AT91_VA_BASE_SYS AT91_IO_P2V(AT91_BASE_SYS) 36#define AT91_VA_BASE_SYS AT91_IO_P2V(AT91_BASE_SYS)
37#define AT91_VA_BASE_SPI AT91_IO_P2V(AT91_BASE_SPI) 37#define AT91_VA_BASE_SPI AT91_IO_P2V(AT91RM9200_BASE_SPI)
38#define AT91_VA_BASE_SSC2 AT91_IO_P2V(AT91_BASE_SSC2) 38#define AT91_VA_BASE_EMAC AT91_IO_P2V(AT91RM9200_BASE_EMAC)
39#define AT91_VA_BASE_SSC1 AT91_IO_P2V(AT91_BASE_SSC1) 39#define AT91_VA_BASE_TWI AT91_IO_P2V(AT91RM9200_BASE_TWI)
40#define AT91_VA_BASE_SSC0 AT91_IO_P2V(AT91_BASE_SSC0) 40#define AT91_VA_BASE_MCI AT91_IO_P2V(AT91RM9200_BASE_MCI)
41#define AT91_VA_BASE_US3 AT91_IO_P2V(AT91_BASE_US3) 41#define AT91_VA_BASE_UDP AT91_IO_P2V(AT91RM9200_BASE_UDP)
42#define AT91_VA_BASE_US2 AT91_IO_P2V(AT91_BASE_US2)
43#define AT91_VA_BASE_US1 AT91_IO_P2V(AT91_BASE_US1)
44#define AT91_VA_BASE_US0 AT91_IO_P2V(AT91_BASE_US0)
45#define AT91_VA_BASE_EMAC AT91_IO_P2V(AT91_BASE_EMAC)
46#define AT91_VA_BASE_TWI AT91_IO_P2V(AT91_BASE_TWI)
47#define AT91_VA_BASE_MCI AT91_IO_P2V(AT91_BASE_MCI)
48#define AT91_VA_BASE_UDP AT91_IO_P2V(AT91_BASE_UDP)
49#define AT91_VA_BASE_TCB1 AT91_IO_P2V(AT91_BASE_TCB1)
50#define AT91_VA_BASE_TCB0 AT91_IO_P2V(AT91_BASE_TCB0)
51
52/* Internal SRAM */
53#define AT91_SRAM_BASE 0x00200000 /* Internal SRAM base address */
54#define AT91_SRAM_SIZE 0x00004000 /* Internal SRAM SIZE (16Kb) */
55 42
56 /* Internal SRAM is mapped below the IO devices */ 43 /* Internal SRAM is mapped below the IO devices */
57#define AT91_SRAM_VIRT_BASE (AT91_IO_VIRT_BASE - AT91_SRAM_SIZE) 44#define AT91_SRAM_VIRT_BASE (AT91_IO_VIRT_BASE - AT91RM9200_SRAM_SIZE)
58 45
59/* Serial ports */ 46/* Serial ports */
60#define AT91_NR_UART 5 /* 4 USART3's and one DBGU port */ 47#define AT91_NR_UART 5 /* 4 USART3's and one DBGU port */
@@ -71,9 +58,6 @@
71/* Compact Flash */ 58/* Compact Flash */
72#define AT91_CF_BASE 0x50000000 /* NCS4-NCS6: Compact Flash physical base address */ 59#define AT91_CF_BASE 0x50000000 /* NCS4-NCS6: Compact Flash physical base address */
73 60
74/* Multi-Master Memory controller */
75#define AT91_UHP_BASE 0x00300000 /* USB Host controller */
76
77/* Clocks */ 61/* Clocks */
78#define AT91_SLOW_CLOCK 32768 /* slow clock */ 62#define AT91_SLOW_CLOCK 32768 /* slow clock */
79 63
diff --git a/include/asm-arm/arch-at91rm9200/irqs.h b/include/asm-arm/arch-at91rm9200/irqs.h
index f63842c2c093..763cb96c418b 100644
--- a/include/asm-arm/arch-at91rm9200/irqs.h
+++ b/include/asm-arm/arch-at91rm9200/irqs.h
@@ -32,7 +32,7 @@
32 32
33 33
34/* 34/*
35 * IRQ interrupt symbols are the AT91_ID_* symbols in at91rm9200.h 35 * IRQ interrupt symbols are the AT91xxx_ID_* symbols
36 * for IRQs handled directly through the AIC, or else the AT91_PIN_* 36 * for IRQs handled directly through the AIC, or else the AT91_PIN_*
37 * symbols in gpio.h for ones handled indirectly as GPIOs. 37 * symbols in gpio.h for ones handled indirectly as GPIOs.
38 * We make provision for 4 banks of GPIO. 38 * We make provision for 4 banks of GPIO.
diff --git a/include/asm-arm/arch-clps711x/time.h b/include/asm-arm/arch-clps711x/time.h
index 9cb27cd4e6ae..0e4a3901d3b3 100644
--- a/include/asm-arm/arch-clps711x/time.h
+++ b/include/asm-arm/arch-clps711x/time.h
@@ -29,7 +29,7 @@ static irqreturn_t
29p720t_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) 29p720t_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
30{ 30{
31 do_leds(); 31 do_leds();
32 do_timer(regs); 32 do_timer(1);
33#ifndef CONFIG_SMP 33#ifndef CONFIG_SMP
34 update_process_times(user_mode(regs)); 34 update_process_times(user_mode(regs));
35#endif 35#endif
diff --git a/include/asm-arm/arch-iop32x/debug-macro.S b/include/asm-arm/arch-iop32x/debug-macro.S
new file mode 100644
index 000000000000..9022b6849e23
--- /dev/null
+++ b/include/asm-arm/arch-iop32x/debug-macro.S
@@ -0,0 +1,20 @@
1/*
2 * include/asm-arm/arch-iop32x/debug-macro.S
3 *
4 * Debugging macro include header
5 *
6 * Copyright (C) 1994-1999 Russell King
7 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14 .macro addruart, rx
15 mov \rx, #0xfe000000 @ physical as well as virtual
16 orr \rx, \rx, #0x00800000 @ location of the UART
17 .endm
18
19#define UART_SHIFT 0
20#include <asm/hardware/debug-8250.S>
diff --git a/include/asm-arm/arch-iop3xx/dma.h b/include/asm-arm/arch-iop32x/dma.h
index 1e808db8af2a..e977a9ef3160 100644
--- a/include/asm-arm/arch-iop3xx/dma.h
+++ b/include/asm-arm/arch-iop32x/dma.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * linux/include/asm-arm/arch-iop3xx/dma.h 2 * include/asm-arm/arch-iop32x/dma.h
3 * 3 *
4 * Copyright (C) 2004 Intel Corp. 4 * Copyright (C) 2004 Intel Corp.
5 * 5 *
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
diff --git a/include/asm-arm/arch-iop32x/entry-macro.S b/include/asm-arm/arch-iop32x/entry-macro.S
new file mode 100644
index 000000000000..1500cbbd2295
--- /dev/null
+++ b/include/asm-arm/arch-iop32x/entry-macro.S
@@ -0,0 +1,21 @@
1/*
2 * include/asm-arm/arch-iop32x/entry-macro.S
3 *
4 * Low-level IRQ helper macros for IOP32x-based platforms
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10#include <asm/arch/iop32x.h>
11
12 .macro disable_fiq
13 .endm
14
15 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
16 ldr \base, =IOP3XX_REG_ADDR(0x07D8)
17 ldr \irqstat, [\base] @ Read IINTSRC
18 cmp \irqstat, #0
19 clzne \irqnr, \irqstat
20 rsbne \irqnr, \irqnr, #31
21 .endm
diff --git a/include/asm-arm/arch-iop32x/glantank.h b/include/asm-arm/arch-iop32x/glantank.h
new file mode 100644
index 000000000000..3b065618dd00
--- /dev/null
+++ b/include/asm-arm/arch-iop32x/glantank.h
@@ -0,0 +1,13 @@
1/*
2 * include/asm/arch-iop32x/glantank.h
3 *
4 * IO-Data GLAN Tank board registers
5 */
6
7#ifndef __GLANTANK_H
8#define __GLANTANK_H
9
10#define GLANTANK_UART 0xfe800000 /* UART */
11
12
13#endif
diff --git a/include/asm-arm/arch-iop32x/hardware.h b/include/asm-arm/arch-iop32x/hardware.h
new file mode 100644
index 000000000000..6556ed5eee31
--- /dev/null
+++ b/include/asm-arm/arch-iop32x/hardware.h
@@ -0,0 +1,44 @@
1/*
2 * include/asm-arm/arch-iop32x/hardware.h
3 */
4
5#ifndef __HARDWARE_H
6#define __HARDWARE_H
7
8#include <asm/types.h>
9
10/*
11 * Note about PCI IO space mappings
12 *
13 * To make IO space accesses efficient, we store virtual addresses in
14 * the IO resources.
15 *
16 * The PCI IO space is located at virtual 0xfe000000 from physical
17 * 0x90000000. The PCI BARs must be programmed with physical addresses,
18 * but when we read them, we convert them to virtual addresses. See
19 * arch/arm/plat-iop/pci.c.
20 */
21#define pcibios_assign_all_busses() 1
22#define PCIBIOS_MIN_IO 0x00000000
23#define PCIBIOS_MIN_MEM 0x00000000
24
25#ifndef __ASSEMBLY__
26void iop32x_init_irq(void);
27#endif
28
29
30/*
31 * Generic chipset bits
32 */
33#include "iop32x.h"
34
35/*
36 * Board specific bits
37 */
38#include "glantank.h"
39#include "iq80321.h"
40#include "iq31244.h"
41#include "n2100.h"
42
43
44#endif
diff --git a/include/asm-arm/arch-iop3xx/io.h b/include/asm-arm/arch-iop32x/io.h
index 36adbdf5055a..12d9ee02cde3 100644
--- a/include/asm-arm/arch-iop3xx/io.h
+++ b/include/asm-arm/arch-iop32x/io.h
@@ -1,21 +1,22 @@
1/* 1/*
2 * linux/include/asm-arm/arch-iop3xx/io.h 2 * include/asm-arm/arch-iop32x/io.h
3 * 3 *
4 * Copyright (C) 2001 MontaVista Software, Inc. 4 * Copyright (C) 2001 MontaVista Software, Inc.
5 * 5 *
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 10
11#ifndef __ASM_ARM_ARCH_IO_H 11#ifndef __IO_H
12#define __ASM_ARM_ARCH_IO_H 12#define __IO_H
13 13
14#include <asm/hardware.h> 14#include <asm/hardware.h>
15 15
16#define IO_SPACE_LIMIT 0xffffffff 16#define IO_SPACE_LIMIT 0xffffffff
17 17
18#define __io(p) ((void __iomem *)(p)) 18#define __io(p) ((void __iomem *)(p))
19#define __mem_pci(a) (a) 19#define __mem_pci(a) (a)
20 20
21
21#endif 22#endif
diff --git a/include/asm-arm/arch-iop32x/iop32x.h b/include/asm-arm/arch-iop32x/iop32x.h
new file mode 100644
index 000000000000..4bbd85f3ed2a
--- /dev/null
+++ b/include/asm-arm/arch-iop32x/iop32x.h
@@ -0,0 +1,28 @@
1/*
2 * include/asm-arm/arch-iop32x/iop32x.h
3 *
4 * Intel IOP32X Chip definitions
5 *
6 * Author: Rory Bolt <rorybolt@pacbell.net>
7 * Copyright (C) 2002 Rory Bolt
8 * Copyright (C) 2004 Intel Corp.
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 version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#ifndef __IOP32X_H
16#define __IOP32X_H
17
18/*
19 * Peripherals that are shared between the iop32x and iop33x but
20 * located at different addresses.
21 */
22#define IOP3XX_GPIO_REG(reg) (IOP3XX_PERIPHERAL_VIRT_BASE + 0x07c0 + (reg))
23#define IOP3XX_TIMER_REG(reg) (IOP3XX_PERIPHERAL_VIRT_BASE + 0x07e0 + (reg))
24
25#include <asm/hardware/iop3xx.h>
26
27
28#endif
diff --git a/include/asm-arm/arch-iop3xx/iq31244.h b/include/asm-arm/arch-iop32x/iq31244.h
index 4177cfa8100f..fff4eafa1f6b 100644
--- a/include/asm-arm/arch-iop3xx/iq31244.h
+++ b/include/asm-arm/arch-iop32x/iq31244.h
@@ -1,15 +1,11 @@
1/* 1/*
2 * linux/include/asm/arch-iop3xx/iq31244.h 2 * include/asm-arm/arch-iop32x/iq31244.h
3 * 3 *
4 * Intel IQ31244 evaluation board registers 4 * Intel IQ31244 evaluation board registers
5 */ 5 */
6 6
7#ifndef _IQ31244_H_ 7#ifndef __IQ31244_H
8#define _IQ31244_H_ 8#define __IQ31244_H
9
10#define IQ31244_FLASHBASE 0xf0000000 /* Flash */
11#define IQ31244_FLASHSIZE 0x00800000
12#define IQ31244_FLASHWIDTH 2
13 9
14#define IQ31244_UART 0xfe800000 /* UART #1 */ 10#define IQ31244_UART 0xfe800000 /* UART #1 */
15#define IQ31244_7SEG_1 0xfe840000 /* 7-Segment MSB */ 11#define IQ31244_7SEG_1 0xfe840000 /* 7-Segment MSB */
@@ -17,8 +13,5 @@
17#define IQ31244_ROTARY_SW 0xfe8d0000 /* Rotary Switch */ 13#define IQ31244_ROTARY_SW 0xfe8d0000 /* Rotary Switch */
18#define IQ31244_BATT_STAT 0xfe8f0000 /* Battery Status */ 14#define IQ31244_BATT_STAT 0xfe8f0000 /* Battery Status */
19 15
20#ifndef __ASSEMBLY__
21extern void iq31244_map_io(void);
22#endif
23 16
24#endif // _IQ31244_H_ 17#endif
diff --git a/include/asm-arm/arch-iop3xx/iq80321.h b/include/asm-arm/arch-iop32x/iq80321.h
index cb8725979ffa..eb69db9b9a06 100644
--- a/include/asm-arm/arch-iop3xx/iq80321.h
+++ b/include/asm-arm/arch-iop32x/iq80321.h
@@ -1,15 +1,11 @@
1/* 1/*
2 * linux/include/asm/arch-iop3xx/iq80321.h 2 * include/asm-arm/arch-iop32x/iq80321.h
3 * 3 *
4 * Intel IQ80321 evaluation board registers 4 * Intel IQ80321 evaluation board registers
5 */ 5 */
6 6
7#ifndef _IQ80321_H_ 7#ifndef __IQ80321_H
8#define _IQ80321_H_ 8#define __IQ80321_H
9
10#define IQ80321_FLASHBASE 0xf0000000 /* Flash */
11#define IQ80321_FLASHSIZE 0x00800000
12#define IQ80321_FLASHWIDTH 1
13 9
14#define IQ80321_UART 0xfe800000 /* UART #1 */ 10#define IQ80321_UART 0xfe800000 /* UART #1 */
15#define IQ80321_7SEG_1 0xfe840000 /* 7-Segment MSB */ 11#define IQ80321_7SEG_1 0xfe840000 /* 7-Segment MSB */
@@ -17,8 +13,5 @@
17#define IQ80321_ROTARY_SW 0xfe8d0000 /* Rotary Switch */ 13#define IQ80321_ROTARY_SW 0xfe8d0000 /* Rotary Switch */
18#define IQ80321_BATT_STAT 0xfe8f0000 /* Battery Status */ 14#define IQ80321_BATT_STAT 0xfe8f0000 /* Battery Status */
19 15
20#ifndef __ASSEMBLY__
21extern void iq80321_map_io(void);
22#endif
23 16
24#endif // _IQ80321_H_ 17#endif
diff --git a/include/asm-arm/arch-iop32x/irqs.h b/include/asm-arm/arch-iop32x/irqs.h
new file mode 100644
index 000000000000..bbaef873afce
--- /dev/null
+++ b/include/asm-arm/arch-iop32x/irqs.h
@@ -0,0 +1,50 @@
1/*
2 * include/asm-arm/arch-iop32x/irqs.h
3 *
4 * Author: Rory Bolt <rorybolt@pacbell.net>
5 * Copyright: (C) 2002 Rory Bolt
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef __IRQS_H
13#define __IRQS_H
14
15/*
16 * IOP80321 chipset interrupts
17 */
18#define IRQ_IOP32X_DMA0_EOT 0
19#define IRQ_IOP32X_DMA0_EOC 1
20#define IRQ_IOP32X_DMA1_EOT 2
21#define IRQ_IOP32X_DMA1_EOC 3
22#define IRQ_IOP32X_AA_EOT 6
23#define IRQ_IOP32X_AA_EOC 7
24#define IRQ_IOP32X_CORE_PMON 8
25#define IRQ_IOP32X_TIMER0 9
26#define IRQ_IOP32X_TIMER1 10
27#define IRQ_IOP32X_I2C_0 11
28#define IRQ_IOP32X_I2C_1 12
29#define IRQ_IOP32X_MESSAGING 13
30#define IRQ_IOP32X_ATU_BIST 14
31#define IRQ_IOP32X_PERFMON 15
32#define IRQ_IOP32X_CORE_PMU 16
33#define IRQ_IOP32X_BIU_ERR 17
34#define IRQ_IOP32X_ATU_ERR 18
35#define IRQ_IOP32X_MCU_ERR 19
36#define IRQ_IOP32X_DMA0_ERR 20
37#define IRQ_IOP32X_DMA1_ERR 21
38#define IRQ_IOP32X_AA_ERR 23
39#define IRQ_IOP32X_MSG_ERR 24
40#define IRQ_IOP32X_SSP 25
41#define IRQ_IOP32X_XINT0 27
42#define IRQ_IOP32X_XINT1 28
43#define IRQ_IOP32X_XINT2 29
44#define IRQ_IOP32X_XINT3 30
45#define IRQ_IOP32X_HPI 31
46
47#define NR_IRQS 32
48
49
50#endif
diff --git a/include/asm-arm/arch-iop32x/memory.h b/include/asm-arm/arch-iop32x/memory.h
new file mode 100644
index 000000000000..764cd3f0d416
--- /dev/null
+++ b/include/asm-arm/arch-iop32x/memory.h
@@ -0,0 +1,26 @@
1/*
2 * include/asm-arm/arch-iop32x/memory.h
3 */
4
5#ifndef __MEMORY_H
6#define __MEMORY_H
7
8#include <asm/hardware.h>
9
10/*
11 * Physical DRAM offset.
12 */
13#define PHYS_OFFSET UL(0xa0000000)
14
15/*
16 * Virtual view <-> PCI DMA view memory address translations
17 * virt_to_bus: Used to translate the virtual address to an
18 * address suitable to be passed to set_dma_addr
19 * bus_to_virt: Used to convert an address for DMA operations
20 * to an address that the kernel can use.
21 */
22#define __virt_to_bus(x) (((__virt_to_phys(x)) & ~(*IOP3XX_IATVR2)) | ((*IOP3XX_IABAR2) & 0xfffffff0))
23#define __bus_to_virt(x) (__phys_to_virt(((x) & ~(*IOP3XX_IALR2)) | ( *IOP3XX_IATVR2)))
24
25
26#endif
diff --git a/include/asm-arm/arch-iop32x/n2100.h b/include/asm-arm/arch-iop32x/n2100.h
new file mode 100644
index 000000000000..fed31a648425
--- /dev/null
+++ b/include/asm-arm/arch-iop32x/n2100.h
@@ -0,0 +1,19 @@
1/*
2 * include/asm/arch-iop32x/n2100.h
3 *
4 * Thecus N2100 board registers
5 */
6
7#ifndef __N2100_H
8#define __N2100_H
9
10#define N2100_UART 0xfe800000 /* UART */
11
12#define N2100_COPY_BUTTON IOP3XX_GPIO_LINE(0)
13#define N2100_PCA9532_RESET IOP3XX_GPIO_LINE(2)
14#define N2100_RESET_BUTTON IOP3XX_GPIO_LINE(3)
15#define N2100_HARDWARE_RESET IOP3XX_GPIO_LINE(4)
16#define N2100_POWER_BUTTON IOP3XX_GPIO_LINE(5)
17
18
19#endif
diff --git a/include/asm-arm/arch-iop32x/system.h b/include/asm-arm/arch-iop32x/system.h
new file mode 100644
index 000000000000..17b7eb7e9c0d
--- /dev/null
+++ b/include/asm-arm/arch-iop32x/system.h
@@ -0,0 +1,33 @@
1/*
2 * include/asm-arm/arch-iop32x/system.h
3 *
4 * Copyright (C) 2001 MontaVista Software, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#include <asm/mach-types.h>
12
13static inline void arch_idle(void)
14{
15 cpu_do_idle();
16}
17
18static inline void arch_reset(char mode)
19{
20 local_irq_disable();
21
22 if (machine_is_n2100()) {
23 gpio_line_set(N2100_HARDWARE_RESET, GPIO_LOW);
24 gpio_line_config(N2100_HARDWARE_RESET, GPIO_OUT);
25 while (1)
26 ;
27 }
28
29 *IOP3XX_PCSR = 0x30;
30
31 /* Jump into ROM at address 0 */
32 cpu_reset(0);
33}
diff --git a/include/asm-arm/arch-iop32x/timex.h b/include/asm-arm/arch-iop32x/timex.h
new file mode 100644
index 000000000000..9934b087311b
--- /dev/null
+++ b/include/asm-arm/arch-iop32x/timex.h
@@ -0,0 +1,9 @@
1/*
2 * include/asm-arm/arch-iop32x/timex.h
3 *
4 * IOP32x architecture timex specifications
5 */
6
7#include <asm/hardware.h>
8
9#define CLOCK_TICK_RATE (100 * HZ)
diff --git a/include/asm-arm/arch-iop32x/uncompress.h b/include/asm-arm/arch-iop32x/uncompress.h
new file mode 100644
index 000000000000..e64f52bf2bce
--- /dev/null
+++ b/include/asm-arm/arch-iop32x/uncompress.h
@@ -0,0 +1,39 @@
1/*
2 * include/asm-arm/arch-iop32x/uncompress.h
3 */
4
5#include <asm/types.h>
6#include <asm/mach-types.h>
7#include <linux/serial_reg.h>
8#include <asm/hardware.h>
9
10static volatile u8 *uart_base;
11
12#define TX_DONE (UART_LSR_TEMT | UART_LSR_THRE)
13
14static inline void putc(char c)
15{
16 while ((uart_base[UART_LSR] & TX_DONE) != TX_DONE)
17 barrier();
18 uart_base[UART_TX] = c;
19}
20
21static inline void flush(void)
22{
23}
24
25static __inline__ void __arch_decomp_setup(unsigned long arch_id)
26{
27 if (machine_is_iq80321())
28 uart_base = (volatile u8 *)IQ80321_UART;
29 else if (machine_is_iq31244())
30 uart_base = (volatile u8 *)IQ31244_UART;
31 else
32 uart_base = (volatile u8 *)0xfe800000;
33}
34
35/*
36 * nothing to do
37 */
38#define arch_decomp_setup() __arch_decomp_setup(arch_id)
39#define arch_decomp_wdog()
diff --git a/include/asm-arm/arch-iop32x/vmalloc.h b/include/asm-arm/arch-iop32x/vmalloc.h
new file mode 100644
index 000000000000..0a70baa19517
--- /dev/null
+++ b/include/asm-arm/arch-iop32x/vmalloc.h
@@ -0,0 +1,5 @@
1/*
2 * include/asm-arm/arch-iop32x/vmalloc.h
3 */
4
5#define VMALLOC_END 0xfe000000
diff --git a/include/asm-arm/arch-iop33x/debug-macro.S b/include/asm-arm/arch-iop33x/debug-macro.S
new file mode 100644
index 000000000000..9e7132ebe6a7
--- /dev/null
+++ b/include/asm-arm/arch-iop33x/debug-macro.S
@@ -0,0 +1,24 @@
1/*
2 * include/asm-arm/arch-iop33x/debug-macro.S
3 *
4 * Debugging macro include header
5 *
6 * Copyright (C) 1994-1999 Russell King
7 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14 .macro addruart, rx
15 mrc p15, 0, \rx, c1, c0
16 tst \rx, #1 @ mmu enabled?
17 moveq \rx, #0xff000000 @ physical
18 movne \rx, #0xfe000000 @ virtual
19 orr \rx, \rx, #0x00ff0000
20 orr \rx, \rx, #0x0000f700
21 .endm
22
23#define UART_SHIFT 2
24#include <asm/hardware/debug-8250.S>
diff --git a/include/asm-arm/arch-iop33x/dma.h b/include/asm-arm/arch-iop33x/dma.h
new file mode 100644
index 000000000000..b7775fdc5ad3
--- /dev/null
+++ b/include/asm-arm/arch-iop33x/dma.h
@@ -0,0 +1,9 @@
1/*
2 * include/asm-arm/arch-iop33x/dma.h
3 *
4 * Copyright (C) 2004 Intel Corp.
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 */
diff --git a/include/asm-arm/arch-iop33x/entry-macro.S b/include/asm-arm/arch-iop33x/entry-macro.S
new file mode 100644
index 000000000000..92b791702e34
--- /dev/null
+++ b/include/asm-arm/arch-iop33x/entry-macro.S
@@ -0,0 +1,22 @@
1/*
2 * include/asm-arm/arch-iop33x/entry-macro.S
3 *
4 * Low-level IRQ helper macros for IOP33x-based platforms
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10#include <asm/arch/iop33x.h>
11
12 .macro disable_fiq
13 .endm
14
15 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
16 ldr \base, =IOP3XX_REG_ADDR(0x07C8)
17 ldr \irqstat, [\base] @ Read IINTVEC
18 cmp \irqstat, #0
19 ldreq \irqstat, [\base] @ erratum 63 workaround
20 adds \irqnr, \irqstat, #1
21 movne \irqnr, \irqstat, lsr #2
22 .endm
diff --git a/include/asm-arm/arch-iop33x/hardware.h b/include/asm-arm/arch-iop33x/hardware.h
new file mode 100644
index 000000000000..0659cf94d040
--- /dev/null
+++ b/include/asm-arm/arch-iop33x/hardware.h
@@ -0,0 +1,46 @@
1/*
2 * include/asm-arm/arch-iop33x/hardware.h
3 */
4
5#ifndef __HARDWARE_H
6#define __HARDWARE_H
7
8#include <asm/types.h>
9
10/*
11 * Note about PCI IO space mappings
12 *
13 * To make IO space accesses efficient, we store virtual addresses in
14 * the IO resources.
15 *
16 * The PCI IO space is located at virtual 0xfe000000 from physical
17 * 0x90000000. The PCI BARs must be programmed with physical addresses,
18 * but when we read them, we convert them to virtual addresses. See
19 * arch/arm/mach-iop3xx/iop3xx-pci.c
20 */
21#define pcibios_assign_all_busses() 1
22#define PCIBIOS_MIN_IO 0x00000000
23#define PCIBIOS_MIN_MEM 0x00000000
24
25#ifndef __ASSEMBLY__
26void iop33x_init_irq(void);
27
28extern struct platform_device iop33x_uart0_device;
29extern struct platform_device iop33x_uart1_device;
30#endif
31
32
33/*
34 * Generic chipset bits
35 *
36 */
37#include "iop33x.h"
38
39/*
40 * Board specific bits
41 */
42#include "iq80331.h"
43#include "iq80332.h"
44
45
46#endif
diff --git a/include/asm-arm/arch-iop33x/io.h b/include/asm-arm/arch-iop33x/io.h
new file mode 100644
index 000000000000..c017402bab96
--- /dev/null
+++ b/include/asm-arm/arch-iop33x/io.h
@@ -0,0 +1,21 @@
1/*
2 * include/asm-arm/arch-iop33x/io.h
3 *
4 * Copyright (C) 2001 MontaVista Software, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __IO_H
12#define __IO_H
13
14#include <asm/hardware.h>
15
16#define IO_SPACE_LIMIT 0xffffffff
17#define __io(p) ((void __iomem *)(p))
18#define __mem_pci(a) (a)
19
20
21#endif
diff --git a/include/asm-arm/arch-iop33x/iop33x.h b/include/asm-arm/arch-iop33x/iop33x.h
new file mode 100644
index 000000000000..7ac6e93db5ff
--- /dev/null
+++ b/include/asm-arm/arch-iop33x/iop33x.h
@@ -0,0 +1,33 @@
1/*
2 * include/asm-arm/arch-iop33x/iop33x.h
3 *
4 * Intel IOP33X Chip definitions
5 *
6 * Author: Dave Jiang (dave.jiang@intel.com)
7 * Copyright (C) 2003, 2004 Intel Corp.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#ifndef __IOP33X_H
15#define __IOP33X_H
16
17/*
18 * Peripherals that are shared between the iop32x and iop33x but
19 * located at different addresses.
20 */
21#define IOP3XX_GPIO_REG(reg) (IOP3XX_PERIPHERAL_VIRT_BASE + 0x1780 + (reg))
22#define IOP3XX_TIMER_REG(reg) (IOP3XX_PERIPHERAL_VIRT_BASE + 0x07d0 + (reg))
23
24#include <asm/hardware/iop3xx.h>
25
26/* UARTs */
27#define IOP33X_UART0_PHYS (IOP3XX_PERIPHERAL_PHYS_BASE + 0x1700)
28#define IOP33X_UART0_VIRT (IOP3XX_PERIPHERAL_VIRT_BASE + 0x1700)
29#define IOP33X_UART1_PHYS (IOP3XX_PERIPHERAL_PHYS_BASE + 0x1740)
30#define IOP33X_UART1_VIRT (IOP3XX_PERIPHERAL_VIRT_BASE + 0x1740)
31
32
33#endif
diff --git a/include/asm-arm/arch-iop3xx/iq80331.h b/include/asm-arm/arch-iop33x/iq80331.h
index 0668e78d483e..79b9302017ea 100644
--- a/include/asm-arm/arch-iop3xx/iq80331.h
+++ b/include/asm-arm/arch-iop33x/iq80331.h
@@ -1,23 +1,16 @@
1/* 1/*
2 * linux/include/asm/arch-iop3xx/iq80331.h 2 * include/asm-arm/arch-iop33x/iq80331.h
3 * 3 *
4 * Intel IQ80331 evaluation board registers 4 * Intel IQ80331 evaluation board registers
5 */ 5 */
6 6
7#ifndef _IQ80331_H_ 7#ifndef __IQ80331_H
8#define _IQ80331_H_ 8#define __IQ80331_H
9
10#define IQ80331_FLASHBASE 0xc0000000 /* Flash */
11#define IQ80331_FLASHSIZE 0x00800000
12#define IQ80331_FLASHWIDTH 1
13 9
14#define IQ80331_7SEG_1 0xce840000 /* 7-Segment MSB */ 10#define IQ80331_7SEG_1 0xce840000 /* 7-Segment MSB */
15#define IQ80331_7SEG_0 0xce850000 /* 7-Segment LSB (WO) */ 11#define IQ80331_7SEG_0 0xce850000 /* 7-Segment LSB (WO) */
16#define IQ80331_ROTARY_SW 0xce8d0000 /* Rotary Switch */ 12#define IQ80331_ROTARY_SW 0xce8d0000 /* Rotary Switch */
17#define IQ80331_BATT_STAT 0xce8f0000 /* Battery Status */ 13#define IQ80331_BATT_STAT 0xce8f0000 /* Battery Status */
18 14
19#ifndef __ASSEMBLY__
20extern void iq80331_map_io(void);
21#endif
22 15
23#endif // _IQ80331_H_ 16#endif
diff --git a/include/asm-arm/arch-iop3xx/iq80332.h b/include/asm-arm/arch-iop33x/iq80332.h
index e5fff1775d1a..053165629492 100644
--- a/include/asm-arm/arch-iop3xx/iq80332.h
+++ b/include/asm-arm/arch-iop33x/iq80332.h
@@ -1,23 +1,16 @@
1/* 1/*
2 * linux/include/asm/arch-iop3xx/iq80332.h 2 * include/asm-arm/arch-iop33x/iq80332.h
3 * 3 *
4 * Intel IQ80332 evaluation board registers 4 * Intel IQ80332 evaluation board registers
5 */ 5 */
6 6
7#ifndef _IQ80332_H_ 7#ifndef __IQ80332_H
8#define _IQ80332_H_ 8#define __IQ80332_H
9
10#define IQ80332_FLASHBASE 0xc0000000 /* Flash */
11#define IQ80332_FLASHSIZE 0x00800000
12#define IQ80332_FLASHWIDTH 1
13 9
14#define IQ80332_7SEG_1 0xce840000 /* 7-Segment MSB */ 10#define IQ80332_7SEG_1 0xce840000 /* 7-Segment MSB */
15#define IQ80332_7SEG_0 0xce850000 /* 7-Segment LSB (WO) */ 11#define IQ80332_7SEG_0 0xce850000 /* 7-Segment LSB (WO) */
16#define IQ80332_ROTARY_SW 0xce8d0000 /* Rotary Switch */ 12#define IQ80332_ROTARY_SW 0xce8d0000 /* Rotary Switch */
17#define IQ80332_BATT_STAT 0xce8f0000 /* Battery Status */ 13#define IQ80332_BATT_STAT 0xce8f0000 /* Battery Status */
18 14
19#ifndef __ASSEMBLY__
20extern void iq80332_map_io(void);
21#endif
22 15
23#endif // _IQ80332_H_ 16#endif
diff --git a/include/asm-arm/arch-iop33x/irqs.h b/include/asm-arm/arch-iop33x/irqs.h
new file mode 100644
index 000000000000..d045f8403396
--- /dev/null
+++ b/include/asm-arm/arch-iop33x/irqs.h
@@ -0,0 +1,60 @@
1/*
2 * include/asm-arm/arch-iop33x/irqs.h
3 *
4 * Author: Dave Jiang (dave.jiang@intel.com)
5 * Copyright: (C) 2003 Intel Corp.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef __IRQS_H
13#define __IRQS_H
14
15/*
16 * IOP80331 chipset interrupts
17 */
18#define IRQ_IOP33X_DMA0_EOT 0
19#define IRQ_IOP33X_DMA0_EOC 1
20#define IRQ_IOP33X_DMA1_EOT 2
21#define IRQ_IOP33X_DMA1_EOC 3
22#define IRQ_IOP33X_AA_EOT 6
23#define IRQ_IOP33X_AA_EOC 7
24#define IRQ_IOP33X_TIMER0 8
25#define IRQ_IOP33X_TIMER1 9
26#define IRQ_IOP33X_I2C_0 10
27#define IRQ_IOP33X_I2C_1 11
28#define IRQ_IOP33X_MSG 12
29#define IRQ_IOP33X_MSGIBQ 13
30#define IRQ_IOP33X_ATU_BIST 14
31#define IRQ_IOP33X_PERFMON 15
32#define IRQ_IOP33X_CORE_PMU 16
33#define IRQ_IOP33X_XINT0 24
34#define IRQ_IOP33X_XINT1 25
35#define IRQ_IOP33X_XINT2 26
36#define IRQ_IOP33X_XINT3 27
37#define IRQ_IOP33X_XINT8 32
38#define IRQ_IOP33X_XINT9 33
39#define IRQ_IOP33X_XINT10 34
40#define IRQ_IOP33X_XINT11 35
41#define IRQ_IOP33X_XINT12 36
42#define IRQ_IOP33X_XINT13 37
43#define IRQ_IOP33X_XINT14 38
44#define IRQ_IOP33X_XINT15 39
45#define IRQ_IOP33X_UART0 51
46#define IRQ_IOP33X_UART1 52
47#define IRQ_IOP33X_PBIE 53
48#define IRQ_IOP33X_ATU_CRW 54
49#define IRQ_IOP33X_ATU_ERR 55
50#define IRQ_IOP33X_MCU_ERR 56
51#define IRQ_IOP33X_DMA0_ERR 57
52#define IRQ_IOP33X_DMA1_ERR 58
53#define IRQ_IOP33X_AA_ERR 60
54#define IRQ_IOP33X_MSG_ERR 62
55#define IRQ_IOP33X_HPI 63
56
57#define NR_IRQS 64
58
59
60#endif
diff --git a/include/asm-arm/arch-iop33x/memory.h b/include/asm-arm/arch-iop33x/memory.h
new file mode 100644
index 000000000000..0d39139b241e
--- /dev/null
+++ b/include/asm-arm/arch-iop33x/memory.h
@@ -0,0 +1,26 @@
1/*
2 * include/asm-arm/arch-iop33x/memory.h
3 */
4
5#ifndef __MEMORY_H
6#define __MEMORY_H
7
8#include <asm/hardware.h>
9
10/*
11 * Physical DRAM offset.
12 */
13#define PHYS_OFFSET UL(0x00000000)
14
15/*
16 * Virtual view <-> PCI DMA view memory address translations
17 * virt_to_bus: Used to translate the virtual address to an
18 * address suitable to be passed to set_dma_addr
19 * bus_to_virt: Used to convert an address for DMA operations
20 * to an address that the kernel can use.
21 */
22#define __virt_to_bus(x) (((__virt_to_phys(x)) & ~(*IOP3XX_IATVR2)) | ((*IOP3XX_IABAR2) & 0xfffffff0))
23#define __bus_to_virt(x) (__phys_to_virt(((x) & ~(*IOP3XX_IALR2)) | ( *IOP3XX_IATVR2)))
24
25
26#endif
diff --git a/include/asm-arm/arch-iop33x/system.h b/include/asm-arm/arch-iop33x/system.h
new file mode 100644
index 000000000000..00dd07ece262
--- /dev/null
+++ b/include/asm-arm/arch-iop33x/system.h
@@ -0,0 +1,22 @@
1/*
2 * include/asm-arm/arch-iop33x/system.h
3 *
4 * Copyright (C) 2001 MontaVista Software, Inc.
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
11static inline void arch_idle(void)
12{
13 cpu_do_idle();
14}
15
16static inline void arch_reset(char mode)
17{
18 *IOP3XX_PCSR = 0x30;
19
20 /* Jump into ROM at address 0 */
21 cpu_reset(0);
22}
diff --git a/include/asm-arm/arch-iop33x/timex.h b/include/asm-arm/arch-iop33x/timex.h
new file mode 100644
index 000000000000..fe3e1e369ff9
--- /dev/null
+++ b/include/asm-arm/arch-iop33x/timex.h
@@ -0,0 +1,9 @@
1/*
2 * include/asm-arm/arch-iop33x/timex.h
3 *
4 * IOP3xx architecture timex specifications
5 */
6
7#include <asm/hardware.h>
8
9#define CLOCK_TICK_RATE (100 * HZ)
diff --git a/include/asm-arm/arch-iop33x/uncompress.h b/include/asm-arm/arch-iop33x/uncompress.h
new file mode 100644
index 000000000000..e17fbc05877b
--- /dev/null
+++ b/include/asm-arm/arch-iop33x/uncompress.h
@@ -0,0 +1,37 @@
1/*
2 * include/asm-arm/arch-iop33x/uncompress.h
3 */
4
5#include <asm/types.h>
6#include <asm/mach-types.h>
7#include <linux/serial_reg.h>
8#include <asm/hardware.h>
9
10static volatile u32 *uart_base;
11
12#define TX_DONE (UART_LSR_TEMT | UART_LSR_THRE)
13
14static inline void putc(char c)
15{
16 while ((uart_base[UART_LSR] & TX_DONE) != TX_DONE)
17 barrier();
18 uart_base[UART_TX] = c;
19}
20
21static inline void flush(void)
22{
23}
24
25static __inline__ void __arch_decomp_setup(unsigned long arch_id)
26{
27 if (machine_is_iq80331() || machine_is_iq80332())
28 uart_base = (volatile u32 *)IOP33X_UART0_PHYS;
29 else
30 uart_base = (volatile u32 *)0xfe800000;
31}
32
33/*
34 * nothing to do
35 */
36#define arch_decomp_setup() __arch_decomp_setup(arch_id)
37#define arch_decomp_wdog()
diff --git a/include/asm-arm/arch-iop33x/vmalloc.h b/include/asm-arm/arch-iop33x/vmalloc.h
new file mode 100644
index 000000000000..66f545a7f4fc
--- /dev/null
+++ b/include/asm-arm/arch-iop33x/vmalloc.h
@@ -0,0 +1,5 @@
1/*
2 * include/asm-arm/arch-iop33x/vmalloc.h
3 */
4
5#define VMALLOC_END 0xfe000000
diff --git a/include/asm-arm/arch-iop3xx/debug-macro.S b/include/asm-arm/arch-iop3xx/debug-macro.S
deleted file mode 100644
index ce007e531994..000000000000
--- a/include/asm-arm/arch-iop3xx/debug-macro.S
+++ /dev/null
@@ -1,35 +0,0 @@
1/* linux/include/asm-arm/arch-iop3xx/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
7 *
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
10 * published by the Free Software Foundation.
11 *
12*/
13
14 .macro addruart,rx
15 mov \rx, #0xfe000000 @ physical
16#if defined(CONFIG_ARCH_IQ80321) || defined(CONFIG_ARCH_IQ31244)
17 orr \rx, \rx, #0x00800000 @ location of the UART
18#elif defined(CONFIG_ARCH_IOP331)
19 mrc p15, 0, \rx, c1, c0
20 tst \rx, #1 @ MMU enabled?
21 moveq \rx, #0x000fe000 @ Physical Base
22 movne \rx, #0
23 orr \rx, \rx, #0xfe000000
24 orr \rx, \rx, #0x00f00000 @ Virtual Base
25 orr \rx, \rx, #0x00001700 @ location of the UART
26#else
27#error Unknown IOP3XX implementation
28#endif
29 .endm
30
31#if !defined(CONFIG_ARCH_IQ80321) || !defined(CONFIG_ARCH_IQ31244) || !defined(CONFIG_ARCH_IQ80331)
32#define FLOW_CONTROL
33#endif
34#define UART_SHIFT 0
35#include <asm/hardware/debug-8250.S>
diff --git a/include/asm-arm/arch-iop3xx/entry-macro.S b/include/asm-arm/arch-iop3xx/entry-macro.S
deleted file mode 100644
index 926668c098a5..000000000000
--- a/include/asm-arm/arch-iop3xx/entry-macro.S
+++ /dev/null
@@ -1,57 +0,0 @@
1/*
2 * include/asm-arm/arch-iop3xx/entry-macro.S
3 *
4 * Low-level IRQ helper macros for IOP3xx-based platforms
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10#include <asm/arch/irqs.h>
11
12#if defined(CONFIG_ARCH_IOP321)
13 .macro disable_fiq
14 .endm
15
16 /*
17 * Note: only deal with normal interrupts, not FIQ
18 */
19 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
20 mov \irqnr, #0
21 mrc p6, 0, \irqstat, c8, c0, 0 @ Read IINTSRC
22 cmp \irqstat, #0
23 beq 1001f
24 clz \irqnr, \irqstat
25 mov \base, #31
26 subs \irqnr,\base,\irqnr
27 add \irqnr,\irqnr,#IRQ_IOP321_DMA0_EOT
281001:
29 .endm
30
31#elif defined(CONFIG_ARCH_IOP331)
32 .macro disable_fiq
33 .endm
34
35 /*
36 * Note: only deal with normal interrupts, not FIQ
37 */
38 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
39 mov \irqnr, #0
40 mrc p6, 0, \irqstat, c4, c0, 0 @ Read IINTSRC0
41 cmp \irqstat, #0
42 bne 1002f
43 mrc p6, 0, \irqstat, c5, c0, 0 @ Read IINTSRC1
44 cmp \irqstat, #0
45 beq 1001f
46 clz \irqnr, \irqstat
47 rsbs \irqnr,\irqnr,#31 @ recommend by RMK
48 add \irqnr,\irqnr,#IRQ_IOP331_XINT8
49 b 1001f
501002: clz \irqnr, \irqstat
51 rsbs \irqnr,\irqnr,#31 @ recommend by RMK
52 add \irqnr,\irqnr,#IRQ_IOP331_DMA0_EOT
531001:
54 .endm
55
56#endif
57
diff --git a/include/asm-arm/arch-iop3xx/hardware.h b/include/asm-arm/arch-iop3xx/hardware.h
deleted file mode 100644
index 3b138171d086..000000000000
--- a/include/asm-arm/arch-iop3xx/hardware.h
+++ /dev/null
@@ -1,57 +0,0 @@
1/*
2 * linux/include/asm-arm/arch-iop3xx/hardware.h
3 */
4#ifndef __ASM_ARCH_HARDWARE_H
5#define __ASM_ARCH_HARDWARE_H
6
7#include <asm/types.h>
8
9/*
10 * Note about PCI IO space mappings
11 *
12 * To make IO space accesses efficient, we store virtual addresses in
13 * the IO resources.
14 *
15 * The PCI IO space is located at virtual 0xfe000000 from physical
16 * 0x90000000. The PCI BARs must be programmed with physical addresses,
17 * but when we read them, we convert them to virtual addresses. See
18 * arch/arm/mach-iop3xx/iop3xx-pci.c
19 */
20
21#define pcibios_assign_all_busses() 1
22
23
24/*
25 * The min PCI I/O and MEM space are dependent on what specific
26 * chipset/platform we are running on, so instead of hardcoding with
27 * #ifdefs, we just fill these in the platform level PCI init code.
28 */
29#ifndef __ASSEMBLY__
30extern unsigned long iop3xx_pcibios_min_io;
31extern unsigned long iop3xx_pcibios_min_mem;
32
33extern unsigned int processor_id;
34#endif
35
36/*
37 * We just set these to zero since they are really bogus anyways
38 */
39#define PCIBIOS_MIN_IO (iop3xx_pcibios_min_io)
40#define PCIBIOS_MIN_MEM (iop3xx_pcibios_min_mem)
41
42/*
43 * Generic chipset bits
44 *
45 */
46#include "iop321.h"
47#include "iop331.h"
48
49/*
50 * Board specific bits
51 */
52#include "iq80321.h"
53#include "iq31244.h"
54#include "iq80331.h"
55#include "iq80332.h"
56
57#endif /* _ASM_ARCH_HARDWARE_H */
diff --git a/include/asm-arm/arch-iop3xx/iop321-irqs.h b/include/asm-arm/arch-iop3xx/iop321-irqs.h
deleted file mode 100644
index 2fcc1654cb9d..000000000000
--- a/include/asm-arm/arch-iop3xx/iop321-irqs.h
+++ /dev/null
@@ -1,100 +0,0 @@
1/*
2 * linux/include/asm-arm/arch-iop3xx/irqs.h
3 *
4 * Author: Rory Bolt <rorybolt@pacbell.net>
5 * Copyright: (C) 2002 Rory Bolt
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 */
12#ifndef _IOP321_IRQS_H_
13#define _IOP321_IRQS_H_
14
15/*
16 * IOP80321 chipset interrupts
17 */
18#define IOP321_IRQ_OFS 0
19#define IOP321_IRQ(x) (IOP321_IRQ_OFS + (x))
20
21/*
22 * On IRQ or FIQ register
23 */
24#define IRQ_IOP321_DMA0_EOT IOP321_IRQ(0)
25#define IRQ_IOP321_DMA0_EOC IOP321_IRQ(1)
26#define IRQ_IOP321_DMA1_EOT IOP321_IRQ(2)
27#define IRQ_IOP321_DMA1_EOC IOP321_IRQ(3)
28#define IRQ_IOP321_RSVD_4 IOP321_IRQ(4)
29#define IRQ_IOP321_RSVD_5 IOP321_IRQ(5)
30#define IRQ_IOP321_AA_EOT IOP321_IRQ(6)
31#define IRQ_IOP321_AA_EOC IOP321_IRQ(7)
32#define IRQ_IOP321_CORE_PMON IOP321_IRQ(8)
33#define IRQ_IOP321_TIMER0 IOP321_IRQ(9)
34#define IRQ_IOP321_TIMER1 IOP321_IRQ(10)
35#define IRQ_IOP321_I2C_0 IOP321_IRQ(11)
36#define IRQ_IOP321_I2C_1 IOP321_IRQ(12)
37#define IRQ_IOP321_MESSAGING IOP321_IRQ(13)
38#define IRQ_IOP321_ATU_BIST IOP321_IRQ(14)
39#define IRQ_IOP321_PERFMON IOP321_IRQ(15)
40#define IRQ_IOP321_CORE_PMU IOP321_IRQ(16)
41#define IRQ_IOP321_BIU_ERR IOP321_IRQ(17)
42#define IRQ_IOP321_ATU_ERR IOP321_IRQ(18)
43#define IRQ_IOP321_MCU_ERR IOP321_IRQ(19)
44#define IRQ_IOP321_DMA0_ERR IOP321_IRQ(20)
45#define IRQ_IOP321_DMA1_ERR IOP321_IRQ(21)
46#define IRQ_IOP321_RSVD_22 IOP321_IRQ(22)
47#define IRQ_IOP321_AA_ERR IOP321_IRQ(23)
48#define IRQ_IOP321_MSG_ERR IOP321_IRQ(24)
49#define IRQ_IOP321_SSP IOP321_IRQ(25)
50#define IRQ_IOP321_RSVD_26 IOP321_IRQ(26)
51#define IRQ_IOP321_XINT0 IOP321_IRQ(27)
52#define IRQ_IOP321_XINT1 IOP321_IRQ(28)
53#define IRQ_IOP321_XINT2 IOP321_IRQ(29)
54#define IRQ_IOP321_XINT3 IOP321_IRQ(30)
55#define IRQ_IOP321_HPI IOP321_IRQ(31)
56
57#define NR_IOP321_IRQS (IOP321_IRQ(31) + 1)
58
59#define NR_IRQS NR_IOP321_IRQS
60
61
62/*
63 * Interrupts available on the IQ80321 board
64 */
65
66/*
67 * On board devices
68 */
69#define IRQ_IQ80321_I82544 IRQ_IOP321_XINT0
70#define IRQ_IQ80321_UART IRQ_IOP321_XINT1
71
72/*
73 * PCI interrupts
74 */
75#define IRQ_IQ80321_INTA IRQ_IOP321_XINT0
76#define IRQ_IQ80321_INTB IRQ_IOP321_XINT1
77#define IRQ_IQ80321_INTC IRQ_IOP321_XINT2
78#define IRQ_IQ80321_INTD IRQ_IOP321_XINT3
79
80/*
81 * Interrupts on the IQ31244 board
82 */
83
84/*
85 * On board devices
86 */
87#define IRQ_IQ31244_UART IRQ_IOP321_XINT1
88#define IRQ_IQ31244_I82546 IRQ_IOP321_XINT0
89#define IRQ_IQ31244_SATA IRQ_IOP321_XINT2
90#define IRQ_IQ31244_PCIX_SLOT IRQ_IOP321_XINT3
91
92/*
93 * PCI interrupts
94 */
95#define IRQ_IQ31244_INTA IRQ_IOP321_XINT0
96#define IRQ_IQ31244_INTB IRQ_IOP321_XINT1
97#define IRQ_IQ31244_INTC IRQ_IOP321_XINT2
98#define IRQ_IQ31244_INTD IRQ_IOP321_XINT3
99
100#endif // _IOP321_IRQ_H_
diff --git a/include/asm-arm/arch-iop3xx/iop321.h b/include/asm-arm/arch-iop3xx/iop321.h
deleted file mode 100644
index f8df778a356f..000000000000
--- a/include/asm-arm/arch-iop3xx/iop321.h
+++ /dev/null
@@ -1,345 +0,0 @@
1/*
2 * linux/include/asm/arch-iop3xx/iop321.h
3 *
4 * Intel IOP321 Chip definitions
5 *
6 * Author: Rory Bolt <rorybolt@pacbell.net>
7 * Copyright (C) 2002 Rory Bolt
8 * Copyright (C) 2004 Intel Corp.
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 version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#ifndef _IOP321_HW_H_
16#define _IOP321_HW_H_
17
18
19/*
20 * This is needed for mixed drivers that need to work on all
21 * IOP3xx variants but behave slightly differently on each.
22 */
23#ifndef __ASSEMBLY__
24#ifdef CONFIG_ARCH_IOP321
25#define iop_is_321() (((processor_id & 0xfffff5e0) == 0x69052420))
26#else
27#define iop_is_321() 0
28#endif
29#endif
30
31/*
32 * IOP321 I/O and Mem space regions for PCI autoconfiguration
33 */
34#define IOP321_PCI_IO_WINDOW_SIZE 0x00010000
35#define IOP321_PCI_LOWER_IO_PA 0x90000000
36#define IOP321_PCI_LOWER_IO_VA 0xfe000000
37#define IOP321_PCI_LOWER_IO_BA (*IOP321_OIOWTVR)
38#define IOP321_PCI_UPPER_IO_PA (IOP321_PCI_LOWER_IO_PA + IOP321_PCI_IO_WINDOW_SIZE - 1)
39#define IOP321_PCI_UPPER_IO_VA (IOP321_PCI_LOWER_IO_VA + IOP321_PCI_IO_WINDOW_SIZE - 1)
40#define IOP321_PCI_UPPER_IO_BA (IOP321_PCI_LOWER_IO_BA + IOP321_PCI_IO_WINDOW_SIZE - 1)
41#define IOP321_PCI_IO_OFFSET (IOP321_PCI_LOWER_IO_VA - IOP321_PCI_LOWER_IO_BA)
42
43/* #define IOP321_PCI_MEM_WINDOW_SIZE (~*IOP321_IALR1 + 1) */
44#define IOP321_PCI_MEM_WINDOW_SIZE 0x04000000 /* 64M outbound window */
45#define IOP321_PCI_LOWER_MEM_PA 0x80000000
46#define IOP321_PCI_LOWER_MEM_BA (*IOP321_OMWTVR0)
47#define IOP321_PCI_UPPER_MEM_PA (IOP321_PCI_LOWER_MEM_PA + IOP321_PCI_MEM_WINDOW_SIZE - 1)
48#define IOP321_PCI_UPPER_MEM_BA (IOP321_PCI_LOWER_MEM_BA + IOP321_PCI_MEM_WINDOW_SIZE - 1)
49#define IOP321_PCI_MEM_OFFSET (IOP321_PCI_LOWER_MEM_PA - IOP321_PCI_LOWER_MEM_BA)
50
51
52/*
53 * IOP321 chipset registers
54 */
55#define IOP321_VIRT_MEM_BASE 0xfeffe000 /* chip virtual mem address*/
56#define IOP321_PHYS_MEM_BASE 0xffffe000 /* chip physical memory address */
57#define IOP321_REG_ADDR(reg) (IOP321_VIRT_MEM_BASE | (reg))
58
59/* Reserved 0x00000000 through 0x000000FF */
60
61/* Address Translation Unit 0x00000100 through 0x000001FF */
62#define IOP321_ATUVID (volatile u16 *)IOP321_REG_ADDR(0x00000100)
63#define IOP321_ATUDID (volatile u16 *)IOP321_REG_ADDR(0x00000102)
64#define IOP321_ATUCMD (volatile u16 *)IOP321_REG_ADDR(0x00000104)
65#define IOP321_ATUSR (volatile u16 *)IOP321_REG_ADDR(0x00000106)
66#define IOP321_ATURID (volatile u8 *)IOP321_REG_ADDR(0x00000108)
67#define IOP321_ATUCCR (volatile u32 *)IOP321_REG_ADDR(0x00000109)
68#define IOP321_ATUCLSR (volatile u8 *)IOP321_REG_ADDR(0x0000010C)
69#define IOP321_ATULT (volatile u8 *)IOP321_REG_ADDR(0x0000010D)
70#define IOP321_ATUHTR (volatile u8 *)IOP321_REG_ADDR(0x0000010E)
71#define IOP321_ATUBIST (volatile u8 *)IOP321_REG_ADDR(0x0000010F)
72#define IOP321_IABAR0 (volatile u32 *)IOP321_REG_ADDR(0x00000110)
73#define IOP321_IAUBAR0 (volatile u32 *)IOP321_REG_ADDR(0x00000114)
74#define IOP321_IABAR1 (volatile u32 *)IOP321_REG_ADDR(0x00000118)
75#define IOP321_IAUBAR1 (volatile u32 *)IOP321_REG_ADDR(0x0000011C)
76#define IOP321_IABAR2 (volatile u32 *)IOP321_REG_ADDR(0x00000120)
77#define IOP321_IAUBAR2 (volatile u32 *)IOP321_REG_ADDR(0x00000124)
78#define IOP321_ASVIR (volatile u16 *)IOP321_REG_ADDR(0x0000012C)
79#define IOP321_ASIR (volatile u16 *)IOP321_REG_ADDR(0x0000012E)
80#define IOP321_ERBAR (volatile u32 *)IOP321_REG_ADDR(0x00000130)
81/* Reserved 0x00000134 through 0x0000013B */
82#define IOP321_ATUILR (volatile u8 *)IOP321_REG_ADDR(0x0000013C)
83#define IOP321_ATUIPR (volatile u8 *)IOP321_REG_ADDR(0x0000013D)
84#define IOP321_ATUMGNT (volatile u8 *)IOP321_REG_ADDR(0x0000013E)
85#define IOP321_ATUMLAT (volatile u8 *)IOP321_REG_ADDR(0x0000013F)
86#define IOP321_IALR0 (volatile u32 *)IOP321_REG_ADDR(0x00000140)
87#define IOP321_IATVR0 (volatile u32 *)IOP321_REG_ADDR(0x00000144)
88#define IOP321_ERLR (volatile u32 *)IOP321_REG_ADDR(0x00000148)
89#define IOP321_ERTVR (volatile u32 *)IOP321_REG_ADDR(0x0000014C)
90#define IOP321_IALR1 (volatile u32 *)IOP321_REG_ADDR(0x00000150)
91#define IOP321_IALR2 (volatile u32 *)IOP321_REG_ADDR(0x00000154)
92#define IOP321_IATVR2 (volatile u32 *)IOP321_REG_ADDR(0x00000158)
93#define IOP321_OIOWTVR (volatile u32 *)IOP321_REG_ADDR(0x0000015C)
94#define IOP321_OMWTVR0 (volatile u32 *)IOP321_REG_ADDR(0x00000160)
95#define IOP321_OUMWTVR0 (volatile u32 *)IOP321_REG_ADDR(0x00000164)
96#define IOP321_OMWTVR1 (volatile u32 *)IOP321_REG_ADDR(0x00000168)
97#define IOP321_OUMWTVR1 (volatile u32 *)IOP321_REG_ADDR(0x0000016C)
98/* Reserved 0x00000170 through 0x00000177*/
99#define IOP321_OUDWTVR (volatile u32 *)IOP321_REG_ADDR(0x00000178)
100/* Reserved 0x0000017C through 0x0000017F*/
101#define IOP321_ATUCR (volatile u32 *)IOP321_REG_ADDR(0x00000180)
102#define IOP321_PCSR (volatile u32 *)IOP321_REG_ADDR(0x00000184)
103#define IOP321_ATUISR (volatile u32 *)IOP321_REG_ADDR(0x00000188)
104#define IOP321_ATUIMR (volatile u32 *)IOP321_REG_ADDR(0x0000018C)
105#define IOP321_IABAR3 (volatile u32 *)IOP321_REG_ADDR(0x00000190)
106#define IOP321_IAUBAR3 (volatile u32 *)IOP321_REG_ADDR(0x00000194)
107#define IOP321_IALR3 (volatile u32 *)IOP321_REG_ADDR(0x00000198)
108#define IOP321_IATVR3 (volatile u32 *)IOP321_REG_ADDR(0x0000019C)
109/* Reserved 0x000001A0 through 0x000001A3*/
110#define IOP321_OCCAR (volatile u32 *)IOP321_REG_ADDR(0x000001A4)
111/* Reserved 0x000001A8 through 0x000001AB*/
112#define IOP321_OCCDR (volatile u32 *)IOP321_REG_ADDR(0x000001AC)
113/* Reserved 0x000001B0 through 0x000001BB*/
114#define IOP321_PDSCR (volatile u32 *)IOP321_REG_ADDR(0x000001BC)
115#define IOP321_PMCAPID (volatile u8 *)IOP321_REG_ADDR(0x000001C0)
116#define IOP321_PMNEXT (volatile u8 *)IOP321_REG_ADDR(0x000001C1)
117#define IOP321_APMCR (volatile u16 *)IOP321_REG_ADDR(0x000001C2)
118#define IOP321_APMCSR (volatile u16 *)IOP321_REG_ADDR(0x000001C4)
119/* Reserved 0x000001C6 through 0x000001DF */
120#define IOP321_PCIXCAPID (volatile u8 *)IOP321_REG_ADDR(0x000001E0)
121#define IOP321_PCIXNEXT (volatile u8 *)IOP321_REG_ADDR(0x000001E1)
122#define IOP321_PCIXCMD (volatile u16 *)IOP321_REG_ADDR(0x000001E2)
123#define IOP321_PCIXSR (volatile u32 *)IOP321_REG_ADDR(0x000001E4)
124#define IOP321_PCIIRSR (volatile u32 *)IOP321_REG_ADDR(0x000001EC)
125
126/* Messaging Unit 0x00000300 through 0x000003FF */
127
128/* Reserved 0x00000300 through 0x0000030c */
129#define IOP321_IMR0 (volatile u32 *)IOP321_REG_ADDR(0x00000310)
130#define IOP321_IMR1 (volatile u32 *)IOP321_REG_ADDR(0x00000314)
131#define IOP321_OMR0 (volatile u32 *)IOP321_REG_ADDR(0x00000318)
132#define IOP321_OMR1 (volatile u32 *)IOP321_REG_ADDR(0x0000031C)
133#define IOP321_IDR (volatile u32 *)IOP321_REG_ADDR(0x00000320)
134#define IOP321_IISR (volatile u32 *)IOP321_REG_ADDR(0x00000324)
135#define IOP321_IIMR (volatile u32 *)IOP321_REG_ADDR(0x00000328)
136#define IOP321_ODR (volatile u32 *)IOP321_REG_ADDR(0x0000032C)
137#define IOP321_OISR (volatile u32 *)IOP321_REG_ADDR(0x00000330)
138#define IOP321_OIMR (volatile u32 *)IOP321_REG_ADDR(0x00000334)
139/* Reserved 0x00000338 through 0x0000034F */
140#define IOP321_MUCR (volatile u32 *)IOP321_REG_ADDR(0x00000350)
141#define IOP321_QBAR (volatile u32 *)IOP321_REG_ADDR(0x00000354)
142/* Reserved 0x00000358 through 0x0000035C */
143#define IOP321_IFHPR (volatile u32 *)IOP321_REG_ADDR(0x00000360)
144#define IOP321_IFTPR (volatile u32 *)IOP321_REG_ADDR(0x00000364)
145#define IOP321_IPHPR (volatile u32 *)IOP321_REG_ADDR(0x00000368)
146#define IOP321_IPTPR (volatile u32 *)IOP321_REG_ADDR(0x0000036C)
147#define IOP321_OFHPR (volatile u32 *)IOP321_REG_ADDR(0x00000370)
148#define IOP321_OFTPR (volatile u32 *)IOP321_REG_ADDR(0x00000374)
149#define IOP321_OPHPR (volatile u32 *)IOP321_REG_ADDR(0x00000378)
150#define IOP321_OPTPR (volatile u32 *)IOP321_REG_ADDR(0x0000037C)
151#define IOP321_IAR (volatile u32 *)IOP321_REG_ADDR(0x00000380)
152
153#define IOP321_IIxR_MASK 0x7f /* masks all */
154#define IOP321_IIxR_IRI 0x40 /* RC Index Register Interrupt */
155#define IOP321_IIxR_OFQF 0x20 /* RC Output Free Q Full (ERROR) */
156#define IOP321_IIxR_ipq 0x10 /* RC Inbound Post Q (post) */
157#define IOP321_IIxR_ERRDI 0x08 /* RO Error Doorbell Interrupt */
158#define IOP321_IIxR_IDI 0x04 /* RO Inbound Doorbell Interrupt */
159#define IOP321_IIxR_IM1 0x02 /* RC Inbound Message 1 Interrupt */
160#define IOP321_IIxR_IM0 0x01 /* RC Inbound Message 0 Interrupt */
161
162/* Reserved 0x00000384 through 0x000003FF */
163
164/* DMA Controller 0x00000400 through 0x000004FF */
165#define IOP321_DMA0_CCR (volatile u32 *)IOP321_REG_ADDR(0x00000400)
166#define IOP321_DMA0_CSR (volatile u32 *)IOP321_REG_ADDR(0x00000404)
167#define IOP321_DMA0_DAR (volatile u32 *)IOP321_REG_ADDR(0x0000040C)
168#define IOP321_DMA0_NDAR (volatile u32 *)IOP321_REG_ADDR(0x00000410)
169#define IOP321_DMA0_PADR (volatile u32 *)IOP321_REG_ADDR(0x00000414)
170#define IOP321_DMA0_PUADR (volatile u32 *)IOP321_REG_ADDR(0x00000418)
171#define IOP321_DMA0_LADR (volatile u32 *)IOP321_REG_ADDR(0X0000041C)
172#define IOP321_DMA0_BCR (volatile u32 *)IOP321_REG_ADDR(0x00000420)
173#define IOP321_DMA0_DCR (volatile u32 *)IOP321_REG_ADDR(0x00000424)
174/* Reserved 0x00000428 through 0x0000043C */
175#define IOP321_DMA1_CCR (volatile u32 *)IOP321_REG_ADDR(0x00000440)
176#define IOP321_DMA1_CSR (volatile u32 *)IOP321_REG_ADDR(0x00000444)
177#define IOP321_DMA1_DAR (volatile u32 *)IOP321_REG_ADDR(0x0000044C)
178#define IOP321_DMA1_NDAR (volatile u32 *)IOP321_REG_ADDR(0x00000450)
179#define IOP321_DMA1_PADR (volatile u32 *)IOP321_REG_ADDR(0x00000454)
180#define IOP321_DMA1_PUADR (volatile u32 *)IOP321_REG_ADDR(0x00000458)
181#define IOP321_DMA1_LADR (volatile u32 *)IOP321_REG_ADDR(0x0000045C)
182#define IOP321_DMA1_BCR (volatile u32 *)IOP321_REG_ADDR(0x00000460)
183#define IOP321_DMA1_DCR (volatile u32 *)IOP321_REG_ADDR(0x00000464)
184/* Reserved 0x00000468 through 0x000004FF */
185
186/* Memory controller 0x00000500 through 0x0005FF */
187
188/* Peripheral bus interface unit 0x00000680 through 0x0006FF */
189#define IOP321_PBCR (volatile u32 *)IOP321_REG_ADDR(0x00000680)
190#define IOP321_PBISR (volatile u32 *)IOP321_REG_ADDR(0x00000684)
191#define IOP321_PBBAR0 (volatile u32 *)IOP321_REG_ADDR(0x00000688)
192#define IOP321_PBLR0 (volatile u32 *)IOP321_REG_ADDR(0x0000068C)
193#define IOP321_PBBAR1 (volatile u32 *)IOP321_REG_ADDR(0x00000690)
194#define IOP321_PBLR1 (volatile u32 *)IOP321_REG_ADDR(0x00000694)
195#define IOP321_PBBAR2 (volatile u32 *)IOP321_REG_ADDR(0x00000698)
196#define IOP321_PBLR2 (volatile u32 *)IOP321_REG_ADDR(0x0000069C)
197#define IOP321_PBBAR3 (volatile u32 *)IOP321_REG_ADDR(0x000006A0)
198#define IOP321_PBLR3 (volatile u32 *)IOP321_REG_ADDR(0x000006A4)
199#define IOP321_PBBAR4 (volatile u32 *)IOP321_REG_ADDR(0x000006A8)
200#define IOP321_PBLR4 (volatile u32 *)IOP321_REG_ADDR(0x000006AC)
201#define IOP321_PBBAR5 (volatile u32 *)IOP321_REG_ADDR(0x000006B0)
202#define IOP321_PBLR5 (volatile u32 *)IOP321_REG_ADDR(0x000006B4)
203#define IOP321_PBDSCR (volatile u32 *)IOP321_REG_ADDR(0x000006B8)
204/* Reserved 0x000006BC */
205#define IOP321_PMBR0 (volatile u32 *)IOP321_REG_ADDR(0x000006C0)
206/* Reserved 0x000006C4 through 0x000006DC */
207#define IOP321_PMBR1 (volatile u32 *)IOP321_REG_ADDR(0x000006E0)
208#define IOP321_PMBR2 (volatile u32 *)IOP321_REG_ADDR(0x000006E4)
209
210#define IOP321_PBCR_EN 0x1
211
212#define IOP321_PBISR_BOOR_ERR 0x1
213
214/* Peripheral performance monitoring unit 0x00000700 through 0x00077F */
215#define IOP321_GTMR (volatile u32 *)IOP321_REG_ADDR(0x00000700)
216#define IOP321_ESR (volatile u32 *)IOP321_REG_ADDR(0x00000704)
217#define IOP321_EMISR (volatile u32 *)IOP321_REG_ADDR(0x00000708)
218/* reserved 0x00000070c */
219#define IOP321_GTSR (volatile u32 *)IOP321_REG_ADDR(0x00000710)
220/* PERC0 DOESN'T EXIST - index from 1! */
221#define IOP321_PERCR0 (volatile u32 *)IOP321_REG_ADDR(0x00000710)
222
223#define IOP321_GTMR_NGCE 0x04 /* (Not) Global Counter Enable */
224
225/* Internal arbitration unit 0x00000780 through 0x0007BF */
226#define IOP321_IACR (volatile u32 *)IOP321_REG_ADDR(0x00000780)
227#define IOP321_MTTR1 (volatile u32 *)IOP321_REG_ADDR(0x00000784)
228#define IOP321_MTTR2 (volatile u32 *)IOP321_REG_ADDR(0x00000788)
229
230/* General Purpose I/O Registers */
231#define IOP321_GPOE (volatile u32 *)IOP321_REG_ADDR(0x000007C4)
232#define IOP321_GPID (volatile u32 *)IOP321_REG_ADDR(0x000007C8)
233#define IOP321_GPOD (volatile u32 *)IOP321_REG_ADDR(0x000007CC)
234
235/* Interrupt Controller */
236#define IOP321_INTCTL (volatile u32 *)IOP321_REG_ADDR(0x000007D0)
237#define IOP321_INTSTR (volatile u32 *)IOP321_REG_ADDR(0x000007D4)
238#define IOP321_IINTSRC (volatile u32 *)IOP321_REG_ADDR(0x000007D8)
239#define IOP321_FINTSRC (volatile u32 *)IOP321_REG_ADDR(0x000007DC)
240
241/* Timers */
242
243#define IOP321_TU_TMR0 (volatile u32 *)IOP321_REG_ADDR(0x000007E0)
244#define IOP321_TU_TMR1 (volatile u32 *)IOP321_REG_ADDR(0x000007E4)
245
246#ifdef CONFIG_ARCH_IQ80321
247#define IOP321_TICK_RATE 200000000 /* 200 MHz clock */
248#elif defined(CONFIG_ARCH_IQ31244)
249#define IOP321_TICK_RATE 198000000 /* 33.000 MHz crystal */
250#endif
251
252#ifdef CONFIG_ARCH_EP80219
253#undef IOP321_TICK_RATE
254#define IOP321_TICK_RATE 200000000 /* 33.333333 Mhz crystal */
255#endif
256
257#define IOP321_TMR_TC 0x01
258#define IOP321_TMR_EN 0x02
259#define IOP321_TMR_RELOAD 0x04
260#define IOP321_TMR_PRIVILEGED 0x09
261
262#define IOP321_TMR_RATIO_1_1 0x00
263#define IOP321_TMR_RATIO_4_1 0x10
264#define IOP321_TMR_RATIO_8_1 0x20
265#define IOP321_TMR_RATIO_16_1 0x30
266
267#define IOP321_TU_TCR0 (volatile u32 *)IOP321_REG_ADDR(0x000007E8)
268#define IOP321_TU_TCR1 (volatile u32 *)IOP321_REG_ADDR(0x000007EC)
269#define IOP321_TU_TRR0 (volatile u32 *)IOP321_REG_ADDR(0x000007F0)
270#define IOP321_TU_TRR1 (volatile u32 *)IOP321_REG_ADDR(0x000007F4)
271#define IOP321_TU_TISR (volatile u32 *)IOP321_REG_ADDR(0x000007F8)
272#define IOP321_TU_WDTCR (volatile u32 *)IOP321_REG_ADDR(0x000007FC)
273
274/* Application accelerator unit 0x00000800 - 0x000008FF */
275#define IOP321_AAU_ACR (volatile u32 *)IOP321_REG_ADDR(0x00000800)
276#define IOP321_AAU_ASR (volatile u32 *)IOP321_REG_ADDR(0x00000804)
277#define IOP321_AAU_ADAR (volatile u32 *)IOP321_REG_ADDR(0x00000808)
278#define IOP321_AAU_ANDAR (volatile u32 *)IOP321_REG_ADDR(0x0000080C)
279#define IOP321_AAU_SAR1 (volatile u32 *)IOP321_REG_ADDR(0x00000810)
280#define IOP321_AAU_SAR2 (volatile u32 *)IOP321_REG_ADDR(0x00000814)
281#define IOP321_AAU_SAR3 (volatile u32 *)IOP321_REG_ADDR(0x00000818)
282#define IOP321_AAU_SAR4 (volatile u32 *)IOP321_REG_ADDR(0x0000081C)
283#define IOP321_AAU_SAR5 (volatile u32 *)IOP321_REG_ADDR(0x0000082C)
284#define IOP321_AAU_SAR6 (volatile u32 *)IOP321_REG_ADDR(0x00000830)
285#define IOP321_AAU_SAR7 (volatile u32 *)IOP321_REG_ADDR(0x00000834)
286#define IOP321_AAU_SAR8 (volatile u32 *)IOP321_REG_ADDR(0x00000838)
287#define IOP321_AAU_SAR9 (volatile u32 *)IOP321_REG_ADDR(0x00000840)
288#define IOP321_AAU_SAR10 (volatile u32 *)IOP321_REG_ADDR(0x00000844)
289#define IOP321_AAU_SAR11 (volatile u32 *)IOP321_REG_ADDR(0x00000848)
290#define IOP321_AAU_SAR12 (volatile u32 *)IOP321_REG_ADDR(0x0000084C)
291#define IOP321_AAU_SAR13 (volatile u32 *)IOP321_REG_ADDR(0x00000850)
292#define IOP321_AAU_SAR14 (volatile u32 *)IOP321_REG_ADDR(0x00000854)
293#define IOP321_AAU_SAR15 (volatile u32 *)IOP321_REG_ADDR(0x00000858)
294#define IOP321_AAU_SAR16 (volatile u32 *)IOP321_REG_ADDR(0x0000085C)
295#define IOP321_AAU_SAR17 (volatile u32 *)IOP321_REG_ADDR(0x00000864)
296#define IOP321_AAU_SAR18 (volatile u32 *)IOP321_REG_ADDR(0x00000868)
297#define IOP321_AAU_SAR19 (volatile u32 *)IOP321_REG_ADDR(0x0000086C)
298#define IOP321_AAU_SAR20 (volatile u32 *)IOP321_REG_ADDR(0x00000870)
299#define IOP321_AAU_SAR21 (volatile u32 *)IOP321_REG_ADDR(0x00000874)
300#define IOP321_AAU_SAR22 (volatile u32 *)IOP321_REG_ADDR(0x00000878)
301#define IOP321_AAU_SAR23 (volatile u32 *)IOP321_REG_ADDR(0x0000087C)
302#define IOP321_AAU_SAR24 (volatile u32 *)IOP321_REG_ADDR(0x00000880)
303#define IOP321_AAU_SAR25 (volatile u32 *)IOP321_REG_ADDR(0x00000888)
304#define IOP321_AAU_SAR26 (volatile u32 *)IOP321_REG_ADDR(0x0000088C)
305#define IOP321_AAU_SAR27 (volatile u32 *)IOP321_REG_ADDR(0x00000890)
306#define IOP321_AAU_SAR28 (volatile u32 *)IOP321_REG_ADDR(0x00000894)
307#define IOP321_AAU_SAR29 (volatile u32 *)IOP321_REG_ADDR(0x00000898)
308#define IOP321_AAU_SAR30 (volatile u32 *)IOP321_REG_ADDR(0x0000089C)
309#define IOP321_AAU_SAR31 (volatile u32 *)IOP321_REG_ADDR(0x000008A0)
310#define IOP321_AAU_SAR32 (volatile u32 *)IOP321_REG_ADDR(0x000008A4)
311#define IOP321_AAU_DAR (volatile u32 *)IOP321_REG_ADDR(0x00000820)
312#define IOP321_AAU_ABCR (volatile u32 *)IOP321_REG_ADDR(0x00000824)
313#define IOP321_AAU_ADCR (volatile u32 *)IOP321_REG_ADDR(0x00000828)
314#define IOP321_AAU_EDCR0 (volatile u32 *)IOP321_REG_ADDR(0x0000083c)
315#define IOP321_AAU_EDCR1 (volatile u32 *)IOP321_REG_ADDR(0x00000860)
316#define IOP321_AAU_EDCR2 (volatile u32 *)IOP321_REG_ADDR(0x00000884)
317
318
319/* SSP serial port unit 0x00001600 - 0x0000167F */
320/* I2C bus interface unit 0x00001680 - 0x000016FF */
321#define IOP321_ICR0 (volatile u32 *)IOP321_REG_ADDR(0x00001680)
322#define IOP321_ISR0 (volatile u32 *)IOP321_REG_ADDR(0x00001684)
323#define IOP321_ISAR0 (volatile u32 *)IOP321_REG_ADDR(0x00001688)
324#define IOP321_IDBR0 (volatile u32 *)IOP321_REG_ADDR(0x0000168C)
325/* Reserved 0x00001690 */
326#define IOP321_IBMR0 (volatile u32 *)IOP321_REG_ADDR(0x00001694)
327/* Reserved 0x00001698 */
328/* Reserved 0x0000169C */
329#define IOP321_ICR1 (volatile u32 *)IOP321_REG_ADDR(0x000016A0)
330#define IOP321_ISR1 (volatile u32 *)IOP321_REG_ADDR(0x000016A4)
331#define IOP321_ISAR1 (volatile u32 *)IOP321_REG_ADDR(0x000016A8)
332#define IOP321_IDBR1 (volatile u32 *)IOP321_REG_ADDR(0x000016AC)
333#define IOP321_IBMR1 (volatile u32 *)IOP321_REG_ADDR(0x000016B4)
334/* Reserved 0x000016B8 through 0x000016FC */
335
336/* for I2C bit defs see drivers/i2c/i2c-iop3xx.h */
337
338
339#ifndef __ASSEMBLY__
340extern void iop321_map_io(void);
341extern void iop321_init_irq(void);
342extern void iop321_time_init(void);
343#endif
344
345#endif // _IOP321_HW_H_
diff --git a/include/asm-arm/arch-iop3xx/iop331-irqs.h b/include/asm-arm/arch-iop3xx/iop331-irqs.h
deleted file mode 100644
index 7135ad7e335e..000000000000
--- a/include/asm-arm/arch-iop3xx/iop331-irqs.h
+++ /dev/null
@@ -1,132 +0,0 @@
1/*
2 * linux/include/asm-arm/arch-iop3xx/irqs.h
3 *
4 * Author: Dave Jiang (dave.jiang@intel.com)
5 * Copyright: (C) 2003 Intel Corp.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 */
12#ifndef _IOP331_IRQS_H_
13#define _IOP331_IRQS_H_
14
15/*
16 * IOP80331 chipset interrupts
17 */
18#define IOP331_IRQ_OFS 0
19#define IOP331_IRQ(x) (IOP331_IRQ_OFS + (x))
20
21/*
22 * On IRQ or FIQ register
23 */
24#define IRQ_IOP331_DMA0_EOT IOP331_IRQ(0)
25#define IRQ_IOP331_DMA0_EOC IOP331_IRQ(1)
26#define IRQ_IOP331_DMA1_EOT IOP331_IRQ(2)
27#define IRQ_IOP331_DMA1_EOC IOP331_IRQ(3)
28#define IRQ_IOP331_RSVD_4 IOP331_IRQ(4)
29#define IRQ_IOP331_RSVD_5 IOP331_IRQ(5)
30#define IRQ_IOP331_AA_EOT IOP331_IRQ(6)
31#define IRQ_IOP331_AA_EOC IOP331_IRQ(7)
32#define IRQ_IOP331_TIMER0 IOP331_IRQ(8)
33#define IRQ_IOP331_TIMER1 IOP331_IRQ(9)
34#define IRQ_IOP331_I2C_0 IOP331_IRQ(10)
35#define IRQ_IOP331_I2C_1 IOP331_IRQ(11)
36#define IRQ_IOP331_MSG IOP331_IRQ(12)
37#define IRQ_IOP331_MSGIBQ IOP331_IRQ(13)
38#define IRQ_IOP331_ATU_BIST IOP331_IRQ(14)
39#define IRQ_IOP331_PERFMON IOP331_IRQ(15)
40#define IRQ_IOP331_CORE_PMU IOP331_IRQ(16)
41#define IRQ_IOP331_RSVD_17 IOP331_IRQ(17)
42#define IRQ_IOP331_RSVD_18 IOP331_IRQ(18)
43#define IRQ_IOP331_RSVD_19 IOP331_IRQ(19)
44#define IRQ_IOP331_RSVD_20 IOP331_IRQ(20)
45#define IRQ_IOP331_RSVD_21 IOP331_IRQ(21)
46#define IRQ_IOP331_RSVD_22 IOP331_IRQ(22)
47#define IRQ_IOP331_RSVD_23 IOP331_IRQ(23)
48#define IRQ_IOP331_XINT0 IOP331_IRQ(24)
49#define IRQ_IOP331_XINT1 IOP331_IRQ(25)
50#define IRQ_IOP331_XINT2 IOP331_IRQ(26)
51#define IRQ_IOP331_XINT3 IOP331_IRQ(27)
52#define IRQ_IOP331_RSVD_28 IOP331_IRQ(28)
53#define IRQ_IOP331_RSVD_29 IOP331_IRQ(29)
54#define IRQ_IOP331_RSVD_30 IOP331_IRQ(30)
55#define IRQ_IOP331_RSVD_31 IOP331_IRQ(31)
56#define IRQ_IOP331_XINT8 IOP331_IRQ(32) // 0
57#define IRQ_IOP331_XINT9 IOP331_IRQ(33) // 1
58#define IRQ_IOP331_XINT10 IOP331_IRQ(34) // 2
59#define IRQ_IOP331_XINT11 IOP331_IRQ(35) // 3
60#define IRQ_IOP331_XINT12 IOP331_IRQ(36) // 4
61#define IRQ_IOP331_XINT13 IOP331_IRQ(37) // 5
62#define IRQ_IOP331_XINT14 IOP331_IRQ(38) // 6
63#define IRQ_IOP331_XINT15 IOP331_IRQ(39) // 7
64#define IRQ_IOP331_RSVD_40 IOP331_IRQ(40) // 8
65#define IRQ_IOP331_RSVD_41 IOP331_IRQ(41) // 9
66#define IRQ_IOP331_RSVD_42 IOP331_IRQ(42) // 10
67#define IRQ_IOP331_RSVD_43 IOP331_IRQ(43) // 11
68#define IRQ_IOP331_RSVD_44 IOP331_IRQ(44) // 12
69#define IRQ_IOP331_RSVD_45 IOP331_IRQ(45) // 13
70#define IRQ_IOP331_RSVD_46 IOP331_IRQ(46) // 14
71#define IRQ_IOP331_RSVD_47 IOP331_IRQ(47) // 15
72#define IRQ_IOP331_RSVD_48 IOP331_IRQ(48) // 16
73#define IRQ_IOP331_RSVD_49 IOP331_IRQ(49) // 17
74#define IRQ_IOP331_RSVD_50 IOP331_IRQ(50) // 18
75#define IRQ_IOP331_UART0 IOP331_IRQ(51) // 19
76#define IRQ_IOP331_UART1 IOP331_IRQ(52) // 20
77#define IRQ_IOP331_PBIE IOP331_IRQ(53) // 21
78#define IRQ_IOP331_ATU_CRW IOP331_IRQ(54) // 22
79#define IRQ_IOP331_ATU_ERR IOP331_IRQ(55) // 23
80#define IRQ_IOP331_MCU_ERR IOP331_IRQ(56) // 24
81#define IRQ_IOP331_DMA0_ERR IOP331_IRQ(57) // 25
82#define IRQ_IOP331_DMA1_ERR IOP331_IRQ(58) // 26
83#define IRQ_IOP331_RSVD_59 IOP331_IRQ(59) // 27
84#define IRQ_IOP331_AA_ERR IOP331_IRQ(60) // 28
85#define IRQ_IOP331_RSVD_61 IOP331_IRQ(61) // 29
86#define IRQ_IOP331_MSG_ERR IOP331_IRQ(62) // 30
87#define IRQ_IOP331_HPI IOP331_IRQ(63) // 31
88
89#define NR_IOP331_IRQS (IOP331_IRQ(63) + 1)
90
91#define NR_IRQS NR_IOP331_IRQS
92
93
94/*
95 * Interrupts available on the IQ80331 board
96 */
97
98/*
99 * On board devices
100 */
101#define IRQ_IQ80331_I82544 IRQ_IOP331_XINT0
102#define IRQ_IQ80331_UART0 IRQ_IOP331_UART0
103#define IRQ_IQ80331_UART1 IRQ_IOP331_UART1
104
105/*
106 * PCI interrupts
107 */
108#define IRQ_IQ80331_INTA IRQ_IOP331_XINT0
109#define IRQ_IQ80331_INTB IRQ_IOP331_XINT1
110#define IRQ_IQ80331_INTC IRQ_IOP331_XINT2
111#define IRQ_IQ80331_INTD IRQ_IOP331_XINT3
112
113/*
114 * Interrupts available on the IQ80332 board
115 */
116
117/*
118 * On board devices
119 */
120#define IRQ_IQ80332_I82544 IRQ_IOP331_XINT0
121#define IRQ_IQ80332_UART0 IRQ_IOP331_UART0
122#define IRQ_IQ80332_UART1 IRQ_IOP331_UART1
123
124/*
125 * PCI interrupts
126 */
127#define IRQ_IQ80332_INTA IRQ_IOP331_XINT0
128#define IRQ_IQ80332_INTB IRQ_IOP331_XINT1
129#define IRQ_IQ80332_INTC IRQ_IOP331_XINT2
130#define IRQ_IQ80332_INTD IRQ_IOP331_XINT3
131
132#endif // _IOP331_IRQ_H_
diff --git a/include/asm-arm/arch-iop3xx/iop331.h b/include/asm-arm/arch-iop3xx/iop331.h
deleted file mode 100644
index fbf0cc11bdd9..000000000000
--- a/include/asm-arm/arch-iop3xx/iop331.h
+++ /dev/null
@@ -1,363 +0,0 @@
1/*
2 * linux/include/asm/arch-iop3xx/iop331.h
3 *
4 * Intel IOP331 Chip definitions
5 *
6 * Author: Dave Jiang (dave.jiang@intel.com)
7 * Copyright (C) 2003, 2004 Intel Corp.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#ifndef _IOP331_HW_H_
15#define _IOP331_HW_H_
16
17
18/*
19 * This is needed for mixed drivers that need to work on all
20 * IOP3xx variants but behave slightly differently on each.
21 */
22#ifndef __ASSEMBLY__
23#ifdef CONFIG_ARCH_IOP331
24/*#define iop_is_331() ((processor_id & 0xffffffb0) == 0x69054090) */
25#define iop_is_331() ((processor_id & 0xffffff30) == 0x69054010)
26#else
27#define iop_is_331() 0
28#endif
29#endif
30
31/*
32 * IOP331 I/O and Mem space regions for PCI autoconfiguration
33 */
34#define IOP331_PCI_IO_WINDOW_SIZE 0x00010000
35#define IOP331_PCI_LOWER_IO_PA 0x90000000
36#define IOP331_PCI_LOWER_IO_VA 0xfe000000
37#define IOP331_PCI_LOWER_IO_BA (*IOP331_OIOWTVR)
38#define IOP331_PCI_UPPER_IO_PA (IOP331_PCI_LOWER_IO_PA + IOP331_PCI_IO_WINDOW_SIZE - 1)
39#define IOP331_PCI_UPPER_IO_VA (IOP331_PCI_LOWER_IO_VA + IOP331_PCI_IO_WINDOW_SIZE - 1)
40#define IOP331_PCI_UPPER_IO_BA (IOP331_PCI_LOWER_IO_BA + IOP331_PCI_IO_WINDOW_SIZE - 1)
41#define IOP331_PCI_IO_OFFSET (IOP331_PCI_LOWER_IO_VA - IOP331_PCI_LOWER_IO_BA)
42
43/* this can be 128M if OMWTVR1 is set */
44#define IOP331_PCI_MEM_WINDOW_SIZE 0x04000000 /* 64M outbound window */
45/* #define IOP331_PCI_MEM_WINDOW_SIZE (~*IOP331_IALR1 + 1) */
46#define IOP331_PCI_LOWER_MEM_PA 0x80000000
47#define IOP331_PCI_LOWER_MEM_BA (*IOP331_OMWTVR0)
48#define IOP331_PCI_UPPER_MEM_PA (IOP331_PCI_LOWER_MEM_PA + IOP331_PCI_MEM_WINDOW_SIZE - 1)
49#define IOP331_PCI_UPPER_MEM_BA (IOP331_PCI_LOWER_MEM_BA + IOP331_PCI_MEM_WINDOW_SIZE - 1)
50#define IOP331_PCI_MEM_OFFSET (IOP331_PCI_LOWER_MEM_PA - IOP331_PCI_LOWER_MEM_BA)
51
52/*
53 * IOP331 chipset registers
54 */
55#define IOP331_VIRT_MEM_BASE 0xfeffe000 /* chip virtual mem address*/
56#define IOP331_PHYS_MEM_BASE 0xffffe000 /* chip physical memory address */
57#define IOP331_REG_ADDR(reg) (IOP331_VIRT_MEM_BASE | (reg))
58
59/* Reserved 0x00000000 through 0x000000FF */
60
61/* Address Translation Unit 0x00000100 through 0x000001FF */
62#define IOP331_ATUVID (volatile u16 *)IOP331_REG_ADDR(0x00000100)
63#define IOP331_ATUDID (volatile u16 *)IOP331_REG_ADDR(0x00000102)
64#define IOP331_ATUCMD (volatile u16 *)IOP331_REG_ADDR(0x00000104)
65#define IOP331_ATUSR (volatile u16 *)IOP331_REG_ADDR(0x00000106)
66#define IOP331_ATURID (volatile u8 *)IOP331_REG_ADDR(0x00000108)
67#define IOP331_ATUCCR (volatile u32 *)IOP331_REG_ADDR(0x00000109)
68#define IOP331_ATUCLSR (volatile u8 *)IOP331_REG_ADDR(0x0000010C)
69#define IOP331_ATULT (volatile u8 *)IOP331_REG_ADDR(0x0000010D)
70#define IOP331_ATUHTR (volatile u8 *)IOP331_REG_ADDR(0x0000010E)
71#define IOP331_ATUBIST (volatile u8 *)IOP331_REG_ADDR(0x0000010F)
72#define IOP331_IABAR0 (volatile u32 *)IOP331_REG_ADDR(0x00000110)
73#define IOP331_IAUBAR0 (volatile u32 *)IOP331_REG_ADDR(0x00000114)
74#define IOP331_IABAR1 (volatile u32 *)IOP331_REG_ADDR(0x00000118)
75#define IOP331_IAUBAR1 (volatile u32 *)IOP331_REG_ADDR(0x0000011C)
76#define IOP331_IABAR2 (volatile u32 *)IOP331_REG_ADDR(0x00000120)
77#define IOP331_IAUBAR2 (volatile u32 *)IOP331_REG_ADDR(0x00000124)
78#define IOP331_ASVIR (volatile u16 *)IOP331_REG_ADDR(0x0000012C)
79#define IOP331_ASIR (volatile u16 *)IOP331_REG_ADDR(0x0000012E)
80#define IOP331_ERBAR (volatile u32 *)IOP331_REG_ADDR(0x00000130)
81#define IOP331_ATU_CAPPTR (volatile u32 *)IOP331_REG_ADDR(0x00000134)
82/* Reserved 0x00000138 through 0x0000013B */
83#define IOP331_ATUILR (volatile u8 *)IOP331_REG_ADDR(0x0000013C)
84#define IOP331_ATUIPR (volatile u8 *)IOP331_REG_ADDR(0x0000013D)
85#define IOP331_ATUMGNT (volatile u8 *)IOP331_REG_ADDR(0x0000013E)
86#define IOP331_ATUMLAT (volatile u8 *)IOP331_REG_ADDR(0x0000013F)
87#define IOP331_IALR0 (volatile u32 *)IOP331_REG_ADDR(0x00000140)
88#define IOP331_IATVR0 (volatile u32 *)IOP331_REG_ADDR(0x00000144)
89#define IOP331_ERLR (volatile u32 *)IOP331_REG_ADDR(0x00000148)
90#define IOP331_ERTVR (volatile u32 *)IOP331_REG_ADDR(0x0000014C)
91#define IOP331_IALR1 (volatile u32 *)IOP331_REG_ADDR(0x00000150)
92#define IOP331_IALR2 (volatile u32 *)IOP331_REG_ADDR(0x00000154)
93#define IOP331_IATVR2 (volatile u32 *)IOP331_REG_ADDR(0x00000158)
94#define IOP331_OIOWTVR (volatile u32 *)IOP331_REG_ADDR(0x0000015C)
95#define IOP331_OMWTVR0 (volatile u32 *)IOP331_REG_ADDR(0x00000160)
96#define IOP331_OUMWTVR0 (volatile u32 *)IOP331_REG_ADDR(0x00000164)
97#define IOP331_OMWTVR1 (volatile u32 *)IOP331_REG_ADDR(0x00000168)
98#define IOP331_OUMWTVR1 (volatile u32 *)IOP331_REG_ADDR(0x0000016C)
99/* Reserved 0x00000170 through 0x00000177*/
100#define IOP331_OUDWTVR (volatile u32 *)IOP331_REG_ADDR(0x00000178)
101/* Reserved 0x0000017C through 0x0000017F*/
102#define IOP331_ATUCR (volatile u32 *)IOP331_REG_ADDR(0x00000180)
103#define IOP331_PCSR (volatile u32 *)IOP331_REG_ADDR(0x00000184)
104#define IOP331_ATUISR (volatile u32 *)IOP331_REG_ADDR(0x00000188)
105#define IOP331_ATUIMR (volatile u32 *)IOP331_REG_ADDR(0x0000018C)
106#define IOP331_IABAR3 (volatile u32 *)IOP331_REG_ADDR(0x00000190)
107#define IOP331_IAUBAR3 (volatile u32 *)IOP331_REG_ADDR(0x00000194)
108#define IOP331_IALR3 (volatile u32 *)IOP331_REG_ADDR(0x00000198)
109#define IOP331_IATVR3 (volatile u32 *)IOP331_REG_ADDR(0x0000019C)
110/* Reserved 0x000001A0 through 0x000001A3*/
111#define IOP331_OCCAR (volatile u32 *)IOP331_REG_ADDR(0x000001A4)
112/* Reserved 0x000001A8 through 0x000001AB*/
113#define IOP331_OCCDR (volatile u32 *)IOP331_REG_ADDR(0x000001AC)
114/* Reserved 0x000001B0 through 0x000001BB*/
115#define IOP331_VPDCAPID (volatile u8 *)IOP331_REG_ADDR(0x000001B8)
116#define IOP331_VPDNXTP (volatile u8 *)IOP331_REG_ADDR(0x000001B9)
117#define IOP331_VPDAR (volatile u16 *)IOP331_REG_ADDR(0x000001BA)
118#define IOP331_VPDDR (volatile u32 *)IOP331_REG_ADDR(0x000001BC)
119#define IOP331_PMCAPID (volatile u8 *)IOP331_REG_ADDR(0x000001C0)
120#define IOP331_PMNEXT (volatile u8 *)IOP331_REG_ADDR(0x000001C1)
121#define IOP331_APMCR (volatile u16 *)IOP331_REG_ADDR(0x000001C2)
122#define IOP331_APMCSR (volatile u16 *)IOP331_REG_ADDR(0x000001C4)
123/* Reserved 0x000001C6 through 0x000001CF */
124#define IOP331_MSICAPID (volatile u8 *)IOP331_REG_ADDR(0x000001D0)
125#define IOP331_MSINXTP (volatile u8 *)IOP331_REG_ADDR(0x000001D1)
126#define IOP331_MSIMCR (volatile u16 *)IOP331_REG_ADDR(0x000001D2)
127#define IOP331_MSIMAR (volatile u32 *)IOP331_REG_ADDR(0x000001D4)
128#define IOP331_MSIMUAR (volatile u32 *)IOP331_REG_ADDR(0x000001D8)
129#define IOP331_MSIMDR (volatile u32 *)IOP331_REG_ADDR(0x000001DC)
130#define IOP331_PCIXCAPID (volatile u8 *)IOP331_REG_ADDR(0x000001E0)
131#define IOP331_PCIXNEXT (volatile u8 *)IOP331_REG_ADDR(0x000001E1)
132#define IOP331_PCIXCMD (volatile u16 *)IOP331_REG_ADDR(0x000001E2)
133#define IOP331_PCIXSR (volatile u32 *)IOP331_REG_ADDR(0x000001E4)
134#define IOP331_PCIIRSR (volatile u32 *)IOP331_REG_ADDR(0x000001EC)
135
136/* Messaging Unit 0x00000300 through 0x000003FF */
137
138/* Reserved 0x00000300 through 0x0000030c */
139#define IOP331_IMR0 (volatile u32 *)IOP331_REG_ADDR(0x00000310)
140#define IOP331_IMR1 (volatile u32 *)IOP331_REG_ADDR(0x00000314)
141#define IOP331_OMR0 (volatile u32 *)IOP331_REG_ADDR(0x00000318)
142#define IOP331_OMR1 (volatile u32 *)IOP331_REG_ADDR(0x0000031C)
143#define IOP331_IDR (volatile u32 *)IOP331_REG_ADDR(0x00000320)
144#define IOP331_IISR (volatile u32 *)IOP331_REG_ADDR(0x00000324)
145#define IOP331_IIMR (volatile u32 *)IOP331_REG_ADDR(0x00000328)
146#define IOP331_ODR (volatile u32 *)IOP331_REG_ADDR(0x0000032C)
147#define IOP331_OISR (volatile u32 *)IOP331_REG_ADDR(0x00000330)
148#define IOP331_OIMR (volatile u32 *)IOP331_REG_ADDR(0x00000334)
149/* Reserved 0x00000338 through 0x0000034F */
150#define IOP331_MUCR (volatile u32 *)IOP331_REG_ADDR(0x00000350)
151#define IOP331_QBAR (volatile u32 *)IOP331_REG_ADDR(0x00000354)
152/* Reserved 0x00000358 through 0x0000035C */
153#define IOP331_IFHPR (volatile u32 *)IOP331_REG_ADDR(0x00000360)
154#define IOP331_IFTPR (volatile u32 *)IOP331_REG_ADDR(0x00000364)
155#define IOP331_IPHPR (volatile u32 *)IOP331_REG_ADDR(0x00000368)
156#define IOP331_IPTPR (volatile u32 *)IOP331_REG_ADDR(0x0000036C)
157#define IOP331_OFHPR (volatile u32 *)IOP331_REG_ADDR(0x00000370)
158#define IOP331_OFTPR (volatile u32 *)IOP331_REG_ADDR(0x00000374)
159#define IOP331_OPHPR (volatile u32 *)IOP331_REG_ADDR(0x00000378)
160#define IOP331_OPTPR (volatile u32 *)IOP331_REG_ADDR(0x0000037C)
161#define IOP331_IAR (volatile u32 *)IOP331_REG_ADDR(0x00000380)
162/* Reserved 0x00000384 through 0x000003FF */
163
164/* DMA Controller 0x00000400 through 0x000004FF */
165#define IOP331_DMA0_CCR (volatile u32 *)IOP331_REG_ADDR(0x00000400)
166#define IOP331_DMA0_CSR (volatile u32 *)IOP331_REG_ADDR(0x00000404)
167#define IOP331_DMA0_DAR (volatile u32 *)IOP331_REG_ADDR(0x0000040C)
168#define IOP331_DMA0_NDAR (volatile u32 *)IOP331_REG_ADDR(0x00000410)
169#define IOP331_DMA0_PADR (volatile u32 *)IOP331_REG_ADDR(0x00000414)
170#define IOP331_DMA0_PUADR (volatile u32 *)IOP331_REG_ADDR(0x00000418)
171#define IOP331_DMA0_LADR (volatile u32 *)IOP331_REG_ADDR(0X0000041C)
172#define IOP331_DMA0_BCR (volatile u32 *)IOP331_REG_ADDR(0x00000420)
173#define IOP331_DMA0_DCR (volatile u32 *)IOP331_REG_ADDR(0x00000424)
174/* Reserved 0x00000428 through 0x0000043C */
175#define IOP331_DMA1_CCR (volatile u32 *)IOP331_REG_ADDR(0x00000440)
176#define IOP331_DMA1_CSR (volatile u32 *)IOP331_REG_ADDR(0x00000444)
177#define IOP331_DMA1_DAR (volatile u32 *)IOP331_REG_ADDR(0x0000044C)
178#define IOP331_DMA1_NDAR (volatile u32 *)IOP331_REG_ADDR(0x00000450)
179#define IOP331_DMA1_PADR (volatile u32 *)IOP331_REG_ADDR(0x00000454)
180#define IOP331_DMA1_PUADR (volatile u32 *)IOP331_REG_ADDR(0x00000458)
181#define IOP331_DMA1_LADR (volatile u32 *)IOP331_REG_ADDR(0x0000045C)
182#define IOP331_DMA1_BCR (volatile u32 *)IOP331_REG_ADDR(0x00000460)
183#define IOP331_DMA1_DCR (volatile u32 *)IOP331_REG_ADDR(0x00000464)
184/* Reserved 0x00000468 through 0x000004FF */
185
186/* Memory controller 0x00000500 through 0x0005FF */
187
188/* Peripheral bus interface unit 0x00000680 through 0x0006FF */
189#define IOP331_PBCR (volatile u32 *)IOP331_REG_ADDR(0x00000680)
190#define IOP331_PBISR (volatile u32 *)IOP331_REG_ADDR(0x00000684)
191#define IOP331_PBBAR0 (volatile u32 *)IOP331_REG_ADDR(0x00000688)
192#define IOP331_PBLR0 (volatile u32 *)IOP331_REG_ADDR(0x0000068C)
193#define IOP331_PBBAR1 (volatile u32 *)IOP331_REG_ADDR(0x00000690)
194#define IOP331_PBLR1 (volatile u32 *)IOP331_REG_ADDR(0x00000694)
195#define IOP331_PBBAR2 (volatile u32 *)IOP331_REG_ADDR(0x00000698)
196#define IOP331_PBLR2 (volatile u32 *)IOP331_REG_ADDR(0x0000069C)
197#define IOP331_PBBAR3 (volatile u32 *)IOP331_REG_ADDR(0x000006A0)
198#define IOP331_PBLR3 (volatile u32 *)IOP331_REG_ADDR(0x000006A4)
199#define IOP331_PBBAR4 (volatile u32 *)IOP331_REG_ADDR(0x000006A8)
200#define IOP331_PBLR4 (volatile u32 *)IOP331_REG_ADDR(0x000006AC)
201#define IOP331_PBBAR5 (volatile u32 *)IOP331_REG_ADDR(0x000006B0)
202#define IOP331_PBLR5 (volatile u32 *)IOP331_REG_ADDR(0x000006B4)
203#define IOP331_PBDSCR (volatile u32 *)IOP331_REG_ADDR(0x000006B8)
204/* Reserved 0x000006BC */
205#define IOP331_PMBR0 (volatile u32 *)IOP331_REG_ADDR(0x000006C0)
206/* Reserved 0x000006C4 through 0x000006DC */
207#define IOP331_PMBR1 (volatile u32 *)IOP331_REG_ADDR(0x000006E0)
208#define IOP331_PMBR2 (volatile u32 *)IOP331_REG_ADDR(0x000006E4)
209
210#define IOP331_PBCR_EN 0x1
211
212#define IOP331_PBISR_BOOR_ERR 0x1
213
214
215
216/* Peripheral performance monitoring unit 0x00000700 through 0x00077F */
217/* Internal arbitration unit 0x00000780 through 0x0007BF */
218
219/* Interrupt Controller */
220#define IOP331_INTCTL0 (volatile u32 *)IOP331_REG_ADDR(0x00000790)
221#define IOP331_INTCTL1 (volatile u32 *)IOP331_REG_ADDR(0x00000794)
222#define IOP331_INTSTR0 (volatile u32 *)IOP331_REG_ADDR(0x00000798)
223#define IOP331_INTSTR1 (volatile u32 *)IOP331_REG_ADDR(0x0000079C)
224#define IOP331_IINTSRC0 (volatile u32 *)IOP331_REG_ADDR(0x000007A0)
225#define IOP331_IINTSRC1 (volatile u32 *)IOP331_REG_ADDR(0x000007A4)
226#define IOP331_FINTSRC0 (volatile u32 *)IOP331_REG_ADDR(0x000007A8)
227#define IOP331_FINTSRC1 (volatile u32 *)IOP331_REG_ADDR(0x000007AC)
228#define IOP331_IPR0 (volatile u32 *)IOP331_REG_ADDR(0x000007B0)
229#define IOP331_IPR1 (volatile u32 *)IOP331_REG_ADDR(0x000007B4)
230#define IOP331_IPR2 (volatile u32 *)IOP331_REG_ADDR(0x000007B8)
231#define IOP331_IPR3 (volatile u32 *)IOP331_REG_ADDR(0x000007BC)
232#define IOP331_INTBASE (volatile u32 *)IOP331_REG_ADDR(0x000007C0)
233#define IOP331_INTSIZE (volatile u32 *)IOP331_REG_ADDR(0x000007C4)
234#define IOP331_IINTVEC (volatile u32 *)IOP331_REG_ADDR(0x000007C8)
235#define IOP331_FINTVEC (volatile u32 *)IOP331_REG_ADDR(0x000007CC)
236
237
238/* Timers */
239
240#define IOP331_TU_TMR0 (volatile u32 *)IOP331_REG_ADDR(0x000007D0)
241#define IOP331_TU_TMR1 (volatile u32 *)IOP331_REG_ADDR(0x000007D4)
242
243#define IOP331_TMR_TC 0x01
244#define IOP331_TMR_EN 0x02
245#define IOP331_TMR_RELOAD 0x04
246#define IOP331_TMR_PRIVILEGED 0x09
247
248#define IOP331_TMR_RATIO_1_1 0x00
249#define IOP331_TMR_RATIO_4_1 0x10
250#define IOP331_TMR_RATIO_8_1 0x20
251#define IOP331_TMR_RATIO_16_1 0x30
252
253#define IOP331_TU_TCR0 (volatile u32 *)IOP331_REG_ADDR(0x000007D8)
254#define IOP331_TU_TCR1 (volatile u32 *)IOP331_REG_ADDR(0x000007DC)
255#define IOP331_TU_TRR0 (volatile u32 *)IOP331_REG_ADDR(0x000007E0)
256#define IOP331_TU_TRR1 (volatile u32 *)IOP331_REG_ADDR(0x000007E4)
257#define IOP331_TU_TISR (volatile u32 *)IOP331_REG_ADDR(0x000007E8)
258#define IOP331_TU_WDTCR (volatile u32 *)IOP331_REG_ADDR(0x000007EC)
259
260#if defined(CONFIG_ARCH_IOP331)
261#define IOP331_TICK_RATE 266000000 /* 266 MHz IB clock */
262#endif
263
264#if defined(CONFIG_IOP331_STEPD) || defined(CONFIG_ARCH_IQ80333)
265#undef IOP331_TICK_RATE
266#define IOP331_TICK_RATE 333000000 /* 333 Mhz IB clock */
267#endif
268
269/* Application accelerator unit 0x00000800 - 0x000008FF */
270#define IOP331_AAU_ACR (volatile u32 *)IOP331_REG_ADDR(0x00000800)
271#define IOP331_AAU_ASR (volatile u32 *)IOP331_REG_ADDR(0x00000804)
272#define IOP331_AAU_ADAR (volatile u32 *)IOP331_REG_ADDR(0x00000808)
273#define IOP331_AAU_ANDAR (volatile u32 *)IOP331_REG_ADDR(0x0000080C)
274#define IOP331_AAU_SAR1 (volatile u32 *)IOP331_REG_ADDR(0x00000810)
275#define IOP331_AAU_SAR2 (volatile u32 *)IOP331_REG_ADDR(0x00000814)
276#define IOP331_AAU_SAR3 (volatile u32 *)IOP331_REG_ADDR(0x00000818)
277#define IOP331_AAU_SAR4 (volatile u32 *)IOP331_REG_ADDR(0x0000081C)
278#define IOP331_AAU_SAR5 (volatile u32 *)IOP331_REG_ADDR(0x0000082C)
279#define IOP331_AAU_SAR6 (volatile u32 *)IOP331_REG_ADDR(0x00000830)
280#define IOP331_AAU_SAR7 (volatile u32 *)IOP331_REG_ADDR(0x00000834)
281#define IOP331_AAU_SAR8 (volatile u32 *)IOP331_REG_ADDR(0x00000838)
282#define IOP331_AAU_SAR9 (volatile u32 *)IOP331_REG_ADDR(0x00000840)
283#define IOP331_AAU_SAR10 (volatile u32 *)IOP331_REG_ADDR(0x00000844)
284#define IOP331_AAU_SAR11 (volatile u32 *)IOP331_REG_ADDR(0x00000848)
285#define IOP331_AAU_SAR12 (volatile u32 *)IOP331_REG_ADDR(0x0000084C)
286#define IOP331_AAU_SAR13 (volatile u32 *)IOP331_REG_ADDR(0x00000850)
287#define IOP331_AAU_SAR14 (volatile u32 *)IOP331_REG_ADDR(0x00000854)
288#define IOP331_AAU_SAR15 (volatile u32 *)IOP331_REG_ADDR(0x00000858)
289#define IOP331_AAU_SAR16 (volatile u32 *)IOP331_REG_ADDR(0x0000085C)
290#define IOP331_AAU_SAR17 (volatile u32 *)IOP331_REG_ADDR(0x00000864)
291#define IOP331_AAU_SAR18 (volatile u32 *)IOP331_REG_ADDR(0x00000868)
292#define IOP331_AAU_SAR19 (volatile u32 *)IOP331_REG_ADDR(0x0000086C)
293#define IOP331_AAU_SAR20 (volatile u32 *)IOP331_REG_ADDR(0x00000870)
294#define IOP331_AAU_SAR21 (volatile u32 *)IOP331_REG_ADDR(0x00000874)
295#define IOP331_AAU_SAR22 (volatile u32 *)IOP331_REG_ADDR(0x00000878)
296#define IOP331_AAU_SAR23 (volatile u32 *)IOP331_REG_ADDR(0x0000087C)
297#define IOP331_AAU_SAR24 (volatile u32 *)IOP331_REG_ADDR(0x00000880)
298#define IOP331_AAU_SAR25 (volatile u32 *)IOP331_REG_ADDR(0x00000888)
299#define IOP331_AAU_SAR26 (volatile u32 *)IOP331_REG_ADDR(0x0000088C)
300#define IOP331_AAU_SAR27 (volatile u32 *)IOP331_REG_ADDR(0x00000890)
301#define IOP331_AAU_SAR28 (volatile u32 *)IOP331_REG_ADDR(0x00000894)
302#define IOP331_AAU_SAR29 (volatile u32 *)IOP331_REG_ADDR(0x00000898)
303#define IOP331_AAU_SAR30 (volatile u32 *)IOP331_REG_ADDR(0x0000089C)
304#define IOP331_AAU_SAR31 (volatile u32 *)IOP331_REG_ADDR(0x000008A0)
305#define IOP331_AAU_SAR32 (volatile u32 *)IOP331_REG_ADDR(0x000008A4)
306#define IOP331_AAU_DAR (volatile u32 *)IOP331_REG_ADDR(0x00000820)
307#define IOP331_AAU_ABCR (volatile u32 *)IOP331_REG_ADDR(0x00000824)
308#define IOP331_AAU_ADCR (volatile u32 *)IOP331_REG_ADDR(0x00000828)
309#define IOP331_AAU_EDCR0 (volatile u32 *)IOP331_REG_ADDR(0x0000083c)
310#define IOP331_AAU_EDCR1 (volatile u32 *)IOP331_REG_ADDR(0x00000860)
311#define IOP331_AAU_EDCR2 (volatile u32 *)IOP331_REG_ADDR(0x00000884)
312
313
314#define IOP331_SPDSCR (volatile u32 *)IOP331_REG_ADDR(0x000015C0)
315#define IOP331_PPDSCR (volatile u32 *)IOP331_REG_ADDR(0x000015C8)
316/* SSP serial port unit 0x00001600 - 0x0000167F */
317
318/* I2C bus interface unit 0x00001680 - 0x000016FF */
319/* for I2C bit defs see drivers/i2c/i2c-iop3xx.h */
320
321#define IOP331_ICR0 (volatile u32 *)IOP331_REG_ADDR(0x00001680)
322#define IOP331_ISR0 (volatile u32 *)IOP331_REG_ADDR(0x00001684)
323#define IOP331_ISAR0 (volatile u32 *)IOP331_REG_ADDR(0x00001688)
324#define IOP331_IDBR0 (volatile u32 *)IOP331_REG_ADDR(0x0000168C)
325/* Reserved 0x00001690 */
326#define IOP331_IBMR0 (volatile u32 *)IOP331_REG_ADDR(0x00001694)
327/* Reserved 0x00001698 */
328/* Reserved 0x0000169C */
329#define IOP331_ICR1 (volatile u32 *)IOP331_REG_ADDR(0x000016A0)
330#define IOP331_ISR1 (volatile u32 *)IOP331_REG_ADDR(0x000016A4)
331#define IOP331_ISAR1 (volatile u32 *)IOP331_REG_ADDR(0x000016A8)
332#define IOP331_IDBR1 (volatile u32 *)IOP331_REG_ADDR(0x000016AC)
333#define IOP331_IBMR1 (volatile u32 *)IOP331_REG_ADDR(0x000016B4)
334/* Reserved 0x000016B8 through 0x000016FF */
335
336/* 0x00001700 through 0x0000172C UART 0 */
337
338/* Reserved 0x00001730 through 0x0000173F */
339
340/* 0x00001740 through 0x0000176C UART 1 */
341
342#define IOP331_UART0_PHYS (IOP331_PHYS_MEM_BASE | 0x00001700) /* UART #1 physical */
343#define IOP331_UART1_PHYS (IOP331_PHYS_MEM_BASE | 0x00001740) /* UART #2 physical */
344#define IOP331_UART0_VIRT (IOP331_VIRT_MEM_BASE | 0x00001700) /* UART #1 virtual addr */
345#define IOP331_UART1_VIRT (IOP331_VIRT_MEM_BASE | 0x00001740) /* UART #2 virtual addr */
346
347/* Reserved 0x00001770 through 0x0000177F */
348
349/* General Purpose I/O Registers */
350#define IOP331_GPOE (volatile u32 *)IOP331_REG_ADDR(0x00001780)
351#define IOP331_GPID (volatile u32 *)IOP331_REG_ADDR(0x00001784)
352#define IOP331_GPOD (volatile u32 *)IOP331_REG_ADDR(0x00001788)
353
354/* Reserved 0x0000178c through 0x000019ff */
355
356
357#ifndef __ASSEMBLY__
358extern void iop331_map_io(void);
359extern void iop331_init_irq(void);
360extern void iop331_time_init(void);
361#endif
362
363#endif // _IOP331_HW_H_
diff --git a/include/asm-arm/arch-iop3xx/irqs.h b/include/asm-arm/arch-iop3xx/irqs.h
deleted file mode 100644
index b2c03f4c269c..000000000000
--- a/include/asm-arm/arch-iop3xx/irqs.h
+++ /dev/null
@@ -1,21 +0,0 @@
1/*
2 * linux/include/asm-arm/arch-iop3xx/irqs.h
3 *
4 * Copyright: (C) 2001-2003 MontaVista Software Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 */
11
12/*
13 * Chipset-specific bits
14 */
15#ifdef CONFIG_ARCH_IOP321
16#include "iop321-irqs.h"
17#endif
18
19#ifdef CONFIG_ARCH_IOP331
20#include "iop331-irqs.h"
21#endif
diff --git a/include/asm-arm/arch-iop3xx/memory.h b/include/asm-arm/arch-iop3xx/memory.h
deleted file mode 100644
index e43ebd984745..000000000000
--- a/include/asm-arm/arch-iop3xx/memory.h
+++ /dev/null
@@ -1,38 +0,0 @@
1/*
2 * linux/include/asm-arm/arch-iop3xx/memory.h
3 */
4
5#ifndef __ASM_ARCH_MEMORY_H
6#define __ASM_ARCH_MEMORY_H
7
8#include <asm/hardware.h>
9
10/*
11 * Physical DRAM offset.
12 */
13#ifndef CONFIG_ARCH_IOP331
14#define PHYS_OFFSET UL(0xa0000000)
15#else
16#define PHYS_OFFSET UL(0x00000000)
17#endif
18
19/*
20 * Virtual view <-> PCI DMA view memory address translations
21 * virt_to_bus: Used to translate the virtual address to an
22 * address suitable to be passed to set_dma_addr
23 * bus_to_virt: Used to convert an address for DMA operations
24 * to an address that the kernel can use.
25 */
26#if defined(CONFIG_ARCH_IOP321)
27
28#define __virt_to_bus(x) (((__virt_to_phys(x)) & ~(*IOP321_IATVR2)) | ((*IOP321_IABAR2) & 0xfffffff0))
29#define __bus_to_virt(x) (__phys_to_virt(((x) & ~(*IOP321_IALR2)) | ( *IOP321_IATVR2)))
30
31#elif defined(CONFIG_ARCH_IOP331)
32
33#define __virt_to_bus(x) (((__virt_to_phys(x)) & ~(*IOP331_IATVR2)) | ((*IOP331_IABAR2) & 0xfffffff0))
34#define __bus_to_virt(x) (__phys_to_virt(((x) & ~(*IOP331_IALR2)) | ( *IOP331_IATVR2)))
35
36#endif
37
38#endif
diff --git a/include/asm-arm/arch-iop3xx/system.h b/include/asm-arm/arch-iop3xx/system.h
deleted file mode 100644
index af6ae8cd36c9..000000000000
--- a/include/asm-arm/arch-iop3xx/system.h
+++ /dev/null
@@ -1,35 +0,0 @@
1/*
2 * linux/include/asm-arm/arch-iop3xx/system.h
3 *
4 * Copyright (C) 2001 MontaVista Software, Inc.
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
11static inline void arch_idle(void)
12{
13 cpu_do_idle();
14}
15
16
17static inline void arch_reset(char mode)
18{
19#ifdef CONFIG_ARCH_IOP321
20 *IOP321_PCSR = 0x30;
21#endif
22
23#ifdef CONFIG_ARCH_IOP331
24 *IOP331_PCSR = 0x30;
25#endif
26
27 if ( 1 && mode == 's') {
28 /* Jump into ROM at address 0 */
29 cpu_reset(0);
30 } else {
31 /* No on-chip reset capability */
32 cpu_reset(0);
33 }
34}
35
diff --git a/include/asm-arm/arch-iop3xx/timex.h b/include/asm-arm/arch-iop3xx/timex.h
deleted file mode 100644
index 14ca8d0f7b29..000000000000
--- a/include/asm-arm/arch-iop3xx/timex.h
+++ /dev/null
@@ -1,20 +0,0 @@
1/*
2 * linux/include/asm-arm/arch-iop3xx/timex.h
3 *
4 * IOP3xx architecture timex specifications
5 */
6#include <asm/hardware.h>
7
8#if defined(CONFIG_ARCH_IQ80321) || defined(CONFIG_ARCH_IQ31244)
9
10#define CLOCK_TICK_RATE IOP321_TICK_RATE
11
12#elif defined(CONFIG_ARCH_IQ80331) || defined(CONFIG_MACH_IQ80332)
13
14#define CLOCK_TICK_RATE IOP331_TICK_RATE
15
16#else
17
18#error "No IOP3xx timex information for this architecture"
19
20#endif
diff --git a/include/asm-arm/arch-iop3xx/uncompress.h b/include/asm-arm/arch-iop3xx/uncompress.h
deleted file mode 100644
index fbdd5af644fe..000000000000
--- a/include/asm-arm/arch-iop3xx/uncompress.h
+++ /dev/null
@@ -1,48 +0,0 @@
1/*
2 * linux/include/asm-arm/arch-iop3xx/uncompress.h
3 */
4#include <asm/types.h>
5#include <asm/mach-types.h>
6#include <linux/serial_reg.h>
7#include <asm/hardware.h>
8
9#ifdef CONFIG_ARCH_IOP321
10#define UTYPE unsigned char *
11#elif defined(CONFIG_ARCH_IOP331)
12#define UTYPE u32 *
13#else
14#error "Missing IOP3xx arch type def"
15#endif
16
17static volatile UTYPE uart_base;
18
19#define TX_DONE (UART_LSR_TEMT|UART_LSR_THRE)
20
21static inline void putc(char c)
22{
23 while ((uart_base[UART_LSR] & TX_DONE) != TX_DONE)
24 barrier();
25 *uart_base = c;
26}
27
28static inline void flush(void)
29{
30}
31
32static __inline__ void __arch_decomp_setup(unsigned long arch_id)
33{
34 if(machine_is_iq80321())
35 uart_base = (volatile UTYPE)IQ80321_UART;
36 else if(machine_is_iq31244())
37 uart_base = (volatile UTYPE)IQ31244_UART;
38 else if(machine_is_iq80331() || machine_is_iq80332())
39 uart_base = (volatile UTYPE)IOP331_UART0_PHYS;
40 else
41 uart_base = (volatile UTYPE)0xfe800000;
42}
43
44/*
45 * nothing to do
46 */
47#define arch_decomp_setup() __arch_decomp_setup(arch_id)
48#define arch_decomp_wdog()
diff --git a/include/asm-arm/arch-iop3xx/vmalloc.h b/include/asm-arm/arch-iop3xx/vmalloc.h
deleted file mode 100644
index 0f2f6847f93c..000000000000
--- a/include/asm-arm/arch-iop3xx/vmalloc.h
+++ /dev/null
@@ -1,16 +0,0 @@
1/*
2 * linux/include/asm-arm/arch-iop3xx/vmalloc.h
3 */
4
5/*
6 * Just any arbitrary offset to the start of the vmalloc VM area: the
7 * current 8MB value just means that there will be a 8MB "hole" after the
8 * physical memory until the kernel virtual memory starts. That means that
9 * any out-of-bounds memory accesses will hopefully be caught.
10 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
11 * area for the same reason. ;)
12 */
13//#define VMALLOC_END (0xe8000000)
14/* increase usable physical RAM to ~992M per RMK */
15#define VMALLOC_END (0xfe000000)
16
diff --git a/include/asm-arm/arch-ixp4xx/platform.h b/include/asm-arm/arch-ixp4xx/platform.h
index 13aee17b0475..8d10a9187693 100644
--- a/include/asm-arm/arch-ixp4xx/platform.h
+++ b/include/asm-arm/arch-ixp4xx/platform.h
@@ -90,6 +90,11 @@ struct ixp4xx_i2c_pins {
90struct sys_timer; 90struct sys_timer;
91 91
92/* 92/*
93 * Frequency of clock used for primary clocksource
94 */
95extern unsigned long ixp4xx_timer_freq;
96
97/*
93 * Functions used by platform-level setup code 98 * Functions used by platform-level setup code
94 */ 99 */
95extern void ixp4xx_map_io(void); 100extern void ixp4xx_map_io(void);
diff --git a/include/asm-arm/arch-l7200/io.h b/include/asm-arm/arch-l7200/io.h
index cd080d8384d9..d744d97c18a5 100644
--- a/include/asm-arm/arch-l7200/io.h
+++ b/include/asm-arm/arch-l7200/io.h
@@ -31,9 +31,9 @@
31static inline unsigned int __arch_getw(unsigned long a) 31static inline unsigned int __arch_getw(unsigned long a)
32{ 32{
33 unsigned int value; 33 unsigned int value;
34 __asm__ __volatile__("ldr%?h %0, [%1, #0] @ getw" 34 __asm__ __volatile__("ldrh %0, [%1, #0] @ getw"
35 : "=&r" (value) 35 : "=&r" (value)
36 : "r" (a)); 36 : "r" (a) : "cc");
37 return value; 37 return value;
38} 38}
39 39
@@ -42,8 +42,8 @@ static inline unsigned int __arch_getw(unsigned long a)
42 42
43static inline void __arch_putw(unsigned int value, unsigned long a) 43static inline void __arch_putw(unsigned int value, unsigned long a)
44{ 44{
45 __asm__ __volatile__("str%?h %0, [%1, #0] @ putw" 45 __asm__ __volatile__("strh %0, [%1, #0] @ putw"
46 : : "r" (value), "r" (a)); 46 : : "r" (value), "r" (a) : "cc");
47} 47}
48 48
49/* 49/*
diff --git a/include/asm-arm/arch-l7200/time.h b/include/asm-arm/arch-l7200/time.h
index 7b98b533e63a..c69cb508735f 100644
--- a/include/asm-arm/arch-l7200/time.h
+++ b/include/asm-arm/arch-l7200/time.h
@@ -45,7 +45,7 @@
45static irqreturn_t 45static irqreturn_t
46timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) 46timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
47{ 47{
48 do_timer(regs); 48 do_timer(1);
49#ifndef CONFIG_SMP 49#ifndef CONFIG_SMP
50 update_process_times(user_mode(regs)); 50 update_process_times(user_mode(regs));
51#endif 51#endif
diff --git a/include/asm-arm/arch-omap/board-ams-delta.h b/include/asm-arm/arch-omap/board-ams-delta.h
index 0070f6d3b75c..9aee15d97145 100644
--- a/include/asm-arm/arch-omap/board-ams-delta.h
+++ b/include/asm-arm/arch-omap/board-ams-delta.h
@@ -50,9 +50,20 @@
50#define AMS_DELTA_LATCH2_NAND_NWE 0x0020 50#define AMS_DELTA_LATCH2_NAND_NWE 0x0020
51#define AMS_DELTA_LATCH2_NAND_ALE 0x0040 51#define AMS_DELTA_LATCH2_NAND_ALE 0x0040
52#define AMS_DELTA_LATCH2_NAND_CLE 0x0080 52#define AMS_DELTA_LATCH2_NAND_CLE 0x0080
53#define AMD_DELTA_LATCH2_KEYBRD_PWR 0x0100
54#define AMD_DELTA_LATCH2_KEYBRD_DATA 0x0200
55#define AMD_DELTA_LATCH2_SCARD_RSTIN 0x0400
56#define AMD_DELTA_LATCH2_SCARD_CMDVCC 0x0800
53#define AMS_DELTA_LATCH2_MODEM_NRESET 0x1000 57#define AMS_DELTA_LATCH2_MODEM_NRESET 0x1000
54#define AMS_DELTA_LATCH2_MODEM_CODEC 0x2000 58#define AMS_DELTA_LATCH2_MODEM_CODEC 0x2000
55 59
60#define AMS_DELTA_GPIO_PIN_KEYBRD_DATA 0
61#define AMS_DELTA_GPIO_PIN_KEYBRD_CLK 1
62#define AMS_DELTA_GPIO_PIN_MODEM_IRQ 2
63#define AMS_DELTA_GPIO_PIN_HOOK_SWITCH 4
64#define AMS_DELTA_GPIO_PIN_SCARD_NOFF 6
65#define AMS_DELTA_GPIO_PIN_SCARD_IO 7
66#define AMS_DELTA_GPIO_PIN_CONFIG 11
56#define AMS_DELTA_GPIO_PIN_NAND_RB 12 67#define AMS_DELTA_GPIO_PIN_NAND_RB 12
57 68
58#ifndef __ASSEMBLY__ 69#ifndef __ASSEMBLY__
diff --git a/include/asm-arm/arch-omap/clock.h b/include/asm-arm/arch-omap/clock.h
index f83003f5287b..fa6881049903 100644
--- a/include/asm-arm/arch-omap/clock.h
+++ b/include/asm-arm/arch-omap/clock.h
@@ -45,6 +45,7 @@ struct clk_functions {
45 struct clk * (*clk_get_parent)(struct clk *clk); 45 struct clk * (*clk_get_parent)(struct clk *clk);
46 void (*clk_allow_idle)(struct clk *clk); 46 void (*clk_allow_idle)(struct clk *clk);
47 void (*clk_deny_idle)(struct clk *clk); 47 void (*clk_deny_idle)(struct clk *clk);
48 void (*clk_disable_unused)(struct clk *clk);
48}; 49};
49 50
50extern unsigned int mpurate; 51extern unsigned int mpurate;
diff --git a/include/asm-arm/arch-omap/dma.h b/include/asm-arm/arch-omap/dma.h
index 1b1b02307e77..d591d0585bba 100644
--- a/include/asm-arm/arch-omap/dma.h
+++ b/include/asm-arm/arch-omap/dma.h
@@ -331,6 +331,12 @@ enum omap_dma_color_mode {
331 OMAP_DMA_TRANSPARENT_COPY 331 OMAP_DMA_TRANSPARENT_COPY
332}; 332};
333 333
334enum omap_dma_write_mode {
335 OMAP_DMA_WRITE_NON_POSTED = 0,
336 OMAP_DMA_WRITE_POSTED,
337 OMAP_DMA_WRITE_LAST_NON_POSTED
338};
339
334struct omap_dma_channel_params { 340struct omap_dma_channel_params {
335 int data_type; /* data type 8,16,32 */ 341 int data_type; /* data type 8,16,32 */
336 int elem_count; /* number of elements in a frame */ 342 int elem_count; /* number of elements in a frame */
@@ -338,13 +344,13 @@ struct omap_dma_channel_params {
338 344
339 int src_port; /* Only on OMAP1 REVISIT: Is this needed? */ 345 int src_port; /* Only on OMAP1 REVISIT: Is this needed? */
340 int src_amode; /* constant , post increment, indexed , double indexed */ 346 int src_amode; /* constant , post increment, indexed , double indexed */
341 int src_start; /* source address : physical */ 347 unsigned long src_start; /* source address : physical */
342 int src_ei; /* source element index */ 348 int src_ei; /* source element index */
343 int src_fi; /* source frame index */ 349 int src_fi; /* source frame index */
344 350
345 int dst_port; /* Only on OMAP1 REVISIT: Is this needed? */ 351 int dst_port; /* Only on OMAP1 REVISIT: Is this needed? */
346 int dst_amode; /* constant , post increment, indexed , double indexed */ 352 int dst_amode; /* constant , post increment, indexed , double indexed */
347 int dst_start; /* source address : physical */ 353 unsigned long dst_start; /* source address : physical */
348 int dst_ei; /* source element index */ 354 int dst_ei; /* source element index */
349 int dst_fi; /* source frame index */ 355 int dst_fi; /* source frame index */
350 356
@@ -356,7 +362,7 @@ struct omap_dma_channel_params {
356}; 362};
357 363
358 364
359extern void omap_set_dma_priority(int dst_port, int priority); 365extern void omap_set_dma_priority(int lch, int dst_port, int priority);
360extern int omap_request_dma(int dev_id, const char *dev_name, 366extern int omap_request_dma(int dev_id, const char *dev_name,
361 void (* callback)(int lch, u16 ch_status, void *data), 367 void (* callback)(int lch, u16 ch_status, void *data),
362 void *data, int *dma_ch); 368 void *data, int *dma_ch);
@@ -371,6 +377,7 @@ extern void omap_set_dma_transfer_params(int lch, int data_type,
371 int dma_trigger, int src_or_dst_synch); 377 int dma_trigger, int src_or_dst_synch);
372extern void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode, 378extern void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode,
373 u32 color); 379 u32 color);
380extern void omap_set_dma_write_mode(int lch, enum omap_dma_write_mode mode);
374 381
375extern void omap_set_dma_src_params(int lch, int src_port, int src_amode, 382extern void omap_set_dma_src_params(int lch, int src_port, int src_amode,
376 unsigned long src_start, 383 unsigned long src_start,
@@ -394,6 +401,9 @@ extern void omap_set_dma_params(int lch,
394extern void omap_dma_link_lch (int lch_head, int lch_queue); 401extern void omap_dma_link_lch (int lch_head, int lch_queue);
395extern void omap_dma_unlink_lch (int lch_head, int lch_queue); 402extern void omap_dma_unlink_lch (int lch_head, int lch_queue);
396 403
404extern int omap_set_dma_callback(int lch,
405 void (* callback)(int lch, u16 ch_status, void *data),
406 void *data);
397extern dma_addr_t omap_get_dma_src_pos(int lch); 407extern dma_addr_t omap_get_dma_src_pos(int lch);
398extern dma_addr_t omap_get_dma_dst_pos(int lch); 408extern dma_addr_t omap_get_dma_dst_pos(int lch);
399extern int omap_get_dma_src_addr_counter(int lch); 409extern int omap_get_dma_src_addr_counter(int lch);
diff --git a/include/asm-arm/arch-omap/dmtimer.h b/include/asm-arm/arch-omap/dmtimer.h
index 7a289ff07404..b5f3a71b899d 100644
--- a/include/asm-arm/arch-omap/dmtimer.h
+++ b/include/asm-arm/arch-omap/dmtimer.h
@@ -52,6 +52,8 @@ int omap_dm_timer_init(void);
52struct omap_dm_timer *omap_dm_timer_request(void); 52struct omap_dm_timer *omap_dm_timer_request(void);
53struct omap_dm_timer *omap_dm_timer_request_specific(int timer_id); 53struct omap_dm_timer *omap_dm_timer_request_specific(int timer_id);
54void omap_dm_timer_free(struct omap_dm_timer *timer); 54void omap_dm_timer_free(struct omap_dm_timer *timer);
55void omap_dm_timer_enable(struct omap_dm_timer *timer);
56void omap_dm_timer_disable(struct omap_dm_timer *timer);
55 57
56int omap_dm_timer_get_irq(struct omap_dm_timer *timer); 58int omap_dm_timer_get_irq(struct omap_dm_timer *timer);
57 59
diff --git a/include/asm-arm/arch-omap/gpmc.h b/include/asm-arm/arch-omap/gpmc.h
index 1a0a5207822d..7c03ef6c14c4 100644
--- a/include/asm-arm/arch-omap/gpmc.h
+++ b/include/asm-arm/arch-omap/gpmc.h
@@ -85,7 +85,7 @@ extern void gpmc_cs_write_reg(int cs, int idx, u32 val);
85extern u32 gpmc_cs_read_reg(int cs, int idx); 85extern u32 gpmc_cs_read_reg(int cs, int idx);
86extern int gpmc_cs_calc_divider(int cs, unsigned int sync_clk); 86extern int gpmc_cs_calc_divider(int cs, unsigned int sync_clk);
87extern int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t); 87extern int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t);
88extern unsigned long gpmc_cs_get_base_addr(int cs); 88extern int gpmc_cs_request(int cs, unsigned long size, unsigned long *base);
89 89extern void gpmc_cs_free(int cs);
90 90
91#endif 91#endif
diff --git a/include/asm-arm/arch-omap/irqs.h b/include/asm-arm/arch-omap/irqs.h
index 2542495d8a43..c5bb05a69b81 100644
--- a/include/asm-arm/arch-omap/irqs.h
+++ b/include/asm-arm/arch-omap/irqs.h
@@ -237,6 +237,7 @@
237#define INT_24XX_SDMA_IRQ1 13 237#define INT_24XX_SDMA_IRQ1 13
238#define INT_24XX_SDMA_IRQ2 14 238#define INT_24XX_SDMA_IRQ2 14
239#define INT_24XX_SDMA_IRQ3 15 239#define INT_24XX_SDMA_IRQ3 15
240#define INT_24XX_CAM_IRQ 24
240#define INT_24XX_DSS_IRQ 25 241#define INT_24XX_DSS_IRQ 25
241#define INT_24XX_GPIO_BANK1 29 242#define INT_24XX_GPIO_BANK1 29
242#define INT_24XX_GPIO_BANK2 30 243#define INT_24XX_GPIO_BANK2 30
@@ -261,6 +262,7 @@
261#define INT_24XX_UART1_IRQ 72 262#define INT_24XX_UART1_IRQ 72
262#define INT_24XX_UART2_IRQ 73 263#define INT_24XX_UART2_IRQ 73
263#define INT_24XX_UART3_IRQ 74 264#define INT_24XX_UART3_IRQ 74
265#define INT_24XX_MMC_IRQ 83
264 266
265/* Max. 128 level 2 IRQs (OMAP1610), 192 GPIOs (OMAP730) and 267/* Max. 128 level 2 IRQs (OMAP1610), 192 GPIOs (OMAP730) and
266 * 16 MPUIO lines */ 268 * 16 MPUIO lines */
diff --git a/include/asm-arm/arch-omap/keypad.h b/include/asm-arm/arch-omap/keypad.h
index 8a023a984acb..b7f83075436e 100644
--- a/include/asm-arm/arch-omap/keypad.h
+++ b/include/asm-arm/arch-omap/keypad.h
@@ -14,7 +14,10 @@ struct omap_kp_platform_data {
14 int rows; 14 int rows;
15 int cols; 15 int cols;
16 int *keymap; 16 int *keymap;
17 unsigned int keymapsize;
17 unsigned int rep:1; 18 unsigned int rep:1;
19 unsigned long delay;
20 unsigned int dbounce:1;
18 /* specific to OMAP242x*/ 21 /* specific to OMAP242x*/
19 unsigned int *row_gpios; 22 unsigned int *row_gpios;
20 unsigned int *col_gpios; 23 unsigned int *col_gpios;
diff --git a/include/asm-arm/arch-omap/mux.h b/include/asm-arm/arch-omap/mux.h
index 679869c5e68f..828cc5c114e1 100644
--- a/include/asm-arm/arch-omap/mux.h
+++ b/include/asm-arm/arch-omap/mux.h
@@ -320,6 +320,17 @@ enum omap1xxx_index {
320 P15_1610_UWIRE_CS3, 320 P15_1610_UWIRE_CS3,
321 N15_1610_UWIRE_CS1, 321 N15_1610_UWIRE_CS1,
322 322
323 /* OMAP-1610 SPI */
324 U19_1610_SPIF_SCK,
325 U18_1610_SPIF_DIN,
326 P20_1610_SPIF_DIN,
327 W21_1610_SPIF_DOUT,
328 R18_1610_SPIF_DOUT,
329 N14_1610_SPIF_CS0,
330 N15_1610_SPIF_CS1,
331 T19_1610_SPIF_CS2,
332 P15_1610_SPIF_CS3,
333
323 /* OMAP-1610 Flash */ 334 /* OMAP-1610 Flash */
324 L3_1610_FLASH_CS2B_OE, 335 L3_1610_FLASH_CS2B_OE,
325 M8_1610_FLASH_CS2B_WE, 336 M8_1610_FLASH_CS2B_WE,
@@ -461,6 +472,20 @@ enum omap24xx_index {
461 K15_24XX_UART3_TX, 472 K15_24XX_UART3_TX,
462 K14_24XX_UART3_RX, 473 K14_24XX_UART3_RX,
463 474
475 /* MMC/SDIO */
476 G19_24XX_MMC_CLKO,
477 H18_24XX_MMC_CMD,
478 F20_24XX_MMC_DAT0,
479 H14_24XX_MMC_DAT1,
480 E19_24XX_MMC_DAT2,
481 D19_24XX_MMC_DAT3,
482 F19_24XX_MMC_DAT_DIR0,
483 E20_24XX_MMC_DAT_DIR1,
484 F18_24XX_MMC_DAT_DIR2,
485 E18_24XX_MMC_DAT_DIR3,
486 G18_24XX_MMC_CMD_DIR,
487 H15_24XX_MMC_CLKI,
488
464 /* Keypad GPIO*/ 489 /* Keypad GPIO*/
465 T19_24XX_KBR0, 490 T19_24XX_KBR0,
466 R19_24XX_KBR1, 491 R19_24XX_KBR1,
diff --git a/include/asm-arm/arch-s3c2410/dma.h b/include/asm-arm/arch-s3c2410/dma.h
index 3661e465b0a5..7ac224836971 100644
--- a/include/asm-arm/arch-s3c2410/dma.h
+++ b/include/asm-arm/arch-s3c2410/dma.h
@@ -23,6 +23,39 @@
23#define MAX_DMA_ADDRESS 0x40000000 23#define MAX_DMA_ADDRESS 0x40000000
24#define MAX_DMA_TRANSFER_SIZE 0x100000 /* Data Unit is half word */ 24#define MAX_DMA_TRANSFER_SIZE 0x100000 /* Data Unit is half word */
25 25
26/* We use `virtual` dma channels to hide the fact we have only a limited
27 * number of DMA channels, and not of all of them (dependant on the device)
28 * can be attached to any DMA source. We therefore let the DMA core handle
29 * the allocation of hardware channels to clients.
30*/
31
32enum dma_ch {
33 DMACH_XD0,
34 DMACH_XD1,
35 DMACH_SDI,
36 DMACH_SPI0,
37 DMACH_SPI1,
38 DMACH_UART0,
39 DMACH_UART1,
40 DMACH_UART2,
41 DMACH_TIMER,
42 DMACH_I2S_IN,
43 DMACH_I2S_OUT,
44 DMACH_PCM_IN,
45 DMACH_PCM_OUT,
46 DMACH_MIC_IN,
47 DMACH_USB_EP1,
48 DMACH_USB_EP2,
49 DMACH_USB_EP3,
50 DMACH_USB_EP4,
51 DMACH_UART0_SRC2, /* s3c2412 second uart sources */
52 DMACH_UART1_SRC2,
53 DMACH_UART2_SRC2,
54 DMACH_MAX, /* the end entry */
55};
56
57#define DMACH_LOW_LEVEL (1<<28) /* use this to specifiy hardware ch no */
58
26/* we have 4 dma channels */ 59/* we have 4 dma channels */
27#define S3C2410_DMA_CHANNELS (4) 60#define S3C2410_DMA_CHANNELS (4)
28 61
@@ -149,6 +182,8 @@ struct s3c2410_dma_stats {
149 unsigned long timeout_failed; 182 unsigned long timeout_failed;
150}; 183};
151 184
185struct s3c2410_dma_map;
186
152/* struct s3c2410_dma_chan 187/* struct s3c2410_dma_chan
153 * 188 *
154 * full state information for each DMA channel 189 * full state information for each DMA channel
@@ -174,6 +209,8 @@ struct s3c2410_dma_chan {
174 unsigned long load_timeout; 209 unsigned long load_timeout;
175 unsigned int flags; /* channel flags */ 210 unsigned int flags; /* channel flags */
176 211
212 struct s3c24xx_dma_map *map; /* channel hw maps */
213
177 /* channel's hardware position and configuration */ 214 /* channel's hardware position and configuration */
178 void __iomem *regs; /* channels registers */ 215 void __iomem *regs; /* channels registers */
179 void __iomem *addr_reg; /* data address register */ 216 void __iomem *addr_reg; /* data address register */
@@ -283,6 +320,7 @@ extern int s3c2410_dma_set_buffdone_fn(dmach_t, s3c2410_dma_cbfn_t rtn);
283#define S3C2410_DMA_DCSRC (0x18) 320#define S3C2410_DMA_DCSRC (0x18)
284#define S3C2410_DMA_DCDST (0x1C) 321#define S3C2410_DMA_DCDST (0x1C)
285#define S3C2410_DMA_DMASKTRIG (0x20) 322#define S3C2410_DMA_DMASKTRIG (0x20)
323#define S3C2412_DMA_DMAREQSEL (0x24)
286 324
287#define S3C2410_DISRCC_INC (1<<0) 325#define S3C2410_DISRCC_INC (1<<0)
288#define S3C2410_DISRCC_APB (1<<1) 326#define S3C2410_DISRCC_APB (1<<1)
@@ -349,4 +387,32 @@ extern int s3c2410_dma_set_buffdone_fn(dmach_t, s3c2410_dma_cbfn_t rtn);
349#define S3C2440_DCON_CH3_PCMOUT (6<<24) 387#define S3C2440_DCON_CH3_PCMOUT (6<<24)
350#endif 388#endif
351 389
390#ifdef CONFIG_CPU_S3C2412
391
392#define S3C2412_DMAREQSEL_SRC(x) ((x)<<1)
393
394#define S3C2412_DMAREQSEL_HW (1)
395
396#define S3C2412_DMAREQSEL_SPI0TX S3C2412_DMAREQSEL_SRC(0)
397#define S3C2412_DMAREQSEL_SPI0RX S3C2412_DMAREQSEL_SRC(1)
398#define S3C2412_DMAREQSEL_SPI1TX S3C2412_DMAREQSEL_SRC(2)
399#define S3C2412_DMAREQSEL_SPI1RX S3C2412_DMAREQSEL_SRC(3)
400#define S3C2412_DMAREQSEL_I2STX S3C2412_DMAREQSEL_SRC(4)
401#define S3C2412_DMAREQSEL_I2SRX S3C2412_DMAREQSEL_SRC(5)
402#define S3C2412_DMAREQSEL_TIMER S3C2412_DMAREQSEL_SRC(9)
403#define S3C2412_DMAREQSEL_SDI S3C2412_DMAREQSEL_SRC(10)
404#define S3C2412_DMAREQSEL_USBEP1 S3C2412_DMAREQSEL_SRC(13)
405#define S3C2412_DMAREQSEL_USBEP2 S3C2412_DMAREQSEL_SRC(14)
406#define S3C2412_DMAREQSEL_USBEP3 S3C2412_DMAREQSEL_SRC(15)
407#define S3C2412_DMAREQSEL_USBEP4 S3C2412_DMAREQSEL_SRC(16)
408#define S3C2412_DMAREQSEL_XDREQ0 S3C2412_DMAREQSEL_SRC(17)
409#define S3C2412_DMAREQSEL_XDREQ1 S3C2412_DMAREQSEL_SRC(18)
410#define S3C2412_DMAREQSEL_UART0_0 S3C2412_DMAREQSEL_SRC(19)
411#define S3C2412_DMAREQSEL_UART0_1 S3C2412_DMAREQSEL_SRC(20)
412#define S3C2412_DMAREQSEL_UART1_0 S3C2412_DMAREQSEL_SRC(21)
413#define S3C2412_DMAREQSEL_UART1_1 S3C2412_DMAREQSEL_SRC(22)
414#define S3C2412_DMAREQSEL_UART2_0 S3C2412_DMAREQSEL_SRC(23)
415#define S3C2412_DMAREQSEL_UART2_1 S3C2412_DMAREQSEL_SRC(24)
416
417#endif
352#endif /* __ASM_ARCH_DMA_H */ 418#endif /* __ASM_ARCH_DMA_H */
diff --git a/include/asm-arm/arch-s3c2410/map.h b/include/asm-arm/arch-s3c2410/map.h
index 27ba0ac3fdd5..7895042d176b 100644
--- a/include/asm-arm/arch-s3c2410/map.h
+++ b/include/asm-arm/arch-s3c2410/map.h
@@ -160,6 +160,11 @@
160#define S3C2440_PA_CAMIF (0x4F000000) 160#define S3C2440_PA_CAMIF (0x4F000000)
161#define S3C2440_SZ_CAMIF SZ_1M 161#define S3C2440_SZ_CAMIF SZ_1M
162 162
163/* AC97 */
164
165#define S3C2440_PA_AC97 (0x5B000000)
166#define S3C2440_SZ_AC97 SZ_1M
167
163/* ISA style IO, for each machine to sort out mappings for, if it 168/* ISA style IO, for each machine to sort out mappings for, if it
164 * implements it. We reserve two 16M regions for ISA. 169 * implements it. We reserve two 16M regions for ISA.
165 */ 170 */
diff --git a/include/asm-arm/arch-s3c2410/osiris-map.h b/include/asm-arm/arch-s3c2410/osiris-map.h
index e2d406218ae5..a14164dfa525 100644
--- a/include/asm-arm/arch-s3c2410/osiris-map.h
+++ b/include/asm-arm/arch-s3c2410/osiris-map.h
@@ -18,22 +18,22 @@
18 18
19/* start peripherals off after the S3C2410 */ 19/* start peripherals off after the S3C2410 */
20 20
21#define OSIRIS_IOADDR(x) (S3C2410_ADDR((x) + 0x05000000)) 21#define OSIRIS_IOADDR(x) (S3C2410_ADDR((x) + 0x04000000))
22 22
23#define OSIRIS_PA_CPLD (S3C2410_CS1 | (3<<25)) 23#define OSIRIS_PA_CPLD (S3C2410_CS1 | (1<<26))
24 24
25/* we put the CPLD registers next, to get them out of the way */ 25/* we put the CPLD registers next, to get them out of the way */
26 26
27#define OSIRIS_VA_CTRL1 OSIRIS_IOADDR(0x00000000) /* 0x01300000 */ 27#define OSIRIS_VA_CTRL1 OSIRIS_IOADDR(0x00000000)
28#define OSIRIS_PA_CTRL1 (OSIRIS_PA_CPLD) 28#define OSIRIS_PA_CTRL1 (OSIRIS_PA_CPLD)
29 29
30#define OSIRIS_VA_CTRL2 OSIRIS_IOADDR(0x00100000) /* 0x01400000 */ 30#define OSIRIS_VA_CTRL2 OSIRIS_IOADDR(0x00100000)
31#define OSIRIS_PA_CTRL2 (OSIRIS_PA_CPLD + (1<<24)) 31#define OSIRIS_PA_CTRL2 (OSIRIS_PA_CPLD + (1<<23))
32 32
33#define OSIRIS_VA_CTRL3 OSIRIS_IOADDR(0x00200000) /* 0x01500000 */ 33#define OSIRIS_VA_CTRL3 OSIRIS_IOADDR(0x00200000)
34#define OSIRIS_PA_CTRL3 (OSIRIS_PA_CPLD + (2<<24)) 34#define OSIRIS_PA_CTRL3 (OSIRIS_PA_CPLD + (2<<23))
35 35
36#define OSIRIS_VA_CTRL4 OSIRIS_IOADDR(0x00300000) /* 0x01600000 */ 36#define OSIRIS_VA_CTRL4 OSIRIS_IOADDR(0x00300000)
37#define OSIRIS_PA_CTRL4 (OSIRIS_PA_CPLD + (3<<24)) 37#define OSIRIS_PA_CTRL4 (OSIRIS_PA_CPLD + (3<<23))
38 38
39#endif /* __ASM_ARCH_OSIRISMAP_H */ 39#endif /* __ASM_ARCH_OSIRISMAP_H */
diff --git a/include/asm-arm/arch-s3c2410/regs-ac97.h b/include/asm-arm/arch-s3c2410/regs-ac97.h
new file mode 100644
index 000000000000..bdd6a4f93d7f
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/regs-ac97.h
@@ -0,0 +1,23 @@
1/* linux/include/asm-arm/arch-s3c2410/regs-ac97.h
2 *
3 * Copyright (c) 2006 Simtec Electronics <linux@simtec.co.uk>
4 * http://www.simtec.co.uk/products/SWLINUX/
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 * S3C2440 AC97 Controller
11*/
12
13#ifndef __ASM_ARCH_REGS_AC97_H
14#define __ASM_ARCH_REGS_AC97_H __FILE__
15
16#define S3C_AC97_GLBCTRL (0x00)
17#define S3C_AC97_GLBSTAT (0x04)
18#define S3C_AC97_CODEC_CMD (0x08)
19#define S3C_AC97_PCM_ADDR (0x10)
20#define S3C_AC97_PCM_DATA (0x18)
21#define S3C_AC97_MIC_DATA (0x1C)
22
23#endif /* __ASM_ARCH_REGS_AC97_H */
diff --git a/include/asm-arm/arch-s3c2410/regs-lcd.h b/include/asm-arm/arch-s3c2410/regs-lcd.h
index b306d6e3135d..6d7881c8cfc8 100644
--- a/include/asm-arm/arch-s3c2410/regs-lcd.h
+++ b/include/asm-arm/arch-s3c2410/regs-lcd.h
@@ -63,6 +63,8 @@
63#define S3C2410_LCDCON3_GET_HBPD(x) ( ((x) >> 19) & 0x7F) 63#define S3C2410_LCDCON3_GET_HBPD(x) ( ((x) >> 19) & 0x7F)
64#define S3C2410_LCDCON3_GET_HFPD(x) ( ((x) >> 0) & 0xFF) 64#define S3C2410_LCDCON3_GET_HFPD(x) ( ((x) >> 0) & 0xFF)
65 65
66/* LDCCON4 changes for STN mode on the S3C2412 */
67
66#define S3C2410_LCDCON4_MVAL(x) ((x) << 8) 68#define S3C2410_LCDCON4_MVAL(x) ((x) << 8)
67#define S3C2410_LCDCON4_HSPW(x) ((x) << 0) 69#define S3C2410_LCDCON4_HSPW(x) ((x) << 0)
68#define S3C2410_LCDCON4_WLH(x) ((x) << 0) 70#define S3C2410_LCDCON4_WLH(x) ((x) << 0)
@@ -113,10 +115,38 @@
113#define S3C2410_LCDINT_FRSYNC (1<<1) 115#define S3C2410_LCDINT_FRSYNC (1<<1)
114#define S3C2410_LCDINT_FICNT (1<<0) 116#define S3C2410_LCDINT_FICNT (1<<0)
115 117
118/* s3c2442 extra stn registers */
119
120#define S3C2442_REDLUT S3C2410_LCDREG(0x20)
121#define S3C2442_GREENLUT S3C2410_LCDREG(0x24)
122#define S3C2442_BLUELUT S3C2410_LCDREG(0x28)
123#define S3C2442_DITHMODE S3C2410_LCDREG(0x20)
124
116#define S3C2410_LPCSEL S3C2410_LCDREG(0x60) 125#define S3C2410_LPCSEL S3C2410_LCDREG(0x60)
117 126
118#define S3C2410_TFTPAL(x) S3C2410_LCDREG((0x400 + (x)*4)) 127#define S3C2410_TFTPAL(x) S3C2410_LCDREG((0x400 + (x)*4))
119 128
129/* S3C2412 registers */
130
131#define S3C2412_TPAL S3C2410_LCDREG(0x20)
132
133#define S3C2412_LCDINTPND S3C2410_LCDREG(0x24)
134#define S3C2412_LCDSRCPND S3C2410_LCDREG(0x28)
135#define S3C2412_LCDINTMSK S3C2410_LCDREG(0x2C)
136
137#define S3C2412_TCONSEL S3C2410_LCDREG(0x30)
138
139#define S3C2412_LCDCON6 S3C2410_LCDREG(0x34)
140#define S3C2412_LCDCON7 S3C2410_LCDREG(0x38)
141#define S3C2412_LCDCON8 S3C2410_LCDREG(0x3C)
142#define S3C2412_LCDCON9 S3C2410_LCDREG(0x40)
143
144#define S3C2412_REDLUT(x) S3C2410_LCDREG(0x44 + ((x)*4))
145#define S3C2412_GREENLUT(x) S3C2410_LCDREG(0x60 + ((x)*4))
146#define S3C2412_BLUELUT(x) S3C2410_LCDREG(0x98 + ((x)*4))
147
148#define S3C2412_FRCPAT(x) S3C2410_LCDREG(0xB4 + ((x)*4))
149
120#endif /* ___ASM_ARCH_REGS_LCD_H */ 150#endif /* ___ASM_ARCH_REGS_LCD_H */
121 151
122 152
diff --git a/include/asm-arm/atomic.h b/include/asm-arm/atomic.h
index 4b0ce3e7de9a..ea88aa6bfc78 100644
--- a/include/asm-arm/atomic.h
+++ b/include/asm-arm/atomic.h
@@ -128,10 +128,10 @@ static inline int atomic_add_return(int i, atomic_t *v)
128 unsigned long flags; 128 unsigned long flags;
129 int val; 129 int val;
130 130
131 local_irq_save(flags); 131 raw_local_irq_save(flags);
132 val = v->counter; 132 val = v->counter;
133 v->counter = val += i; 133 v->counter = val += i;
134 local_irq_restore(flags); 134 raw_local_irq_restore(flags);
135 135
136 return val; 136 return val;
137} 137}
@@ -141,10 +141,10 @@ static inline int atomic_sub_return(int i, atomic_t *v)
141 unsigned long flags; 141 unsigned long flags;
142 int val; 142 int val;
143 143
144 local_irq_save(flags); 144 raw_local_irq_save(flags);
145 val = v->counter; 145 val = v->counter;
146 v->counter = val -= i; 146 v->counter = val -= i;
147 local_irq_restore(flags); 147 raw_local_irq_restore(flags);
148 148
149 return val; 149 return val;
150} 150}
@@ -154,11 +154,11 @@ static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
154 int ret; 154 int ret;
155 unsigned long flags; 155 unsigned long flags;
156 156
157 local_irq_save(flags); 157 raw_local_irq_save(flags);
158 ret = v->counter; 158 ret = v->counter;
159 if (likely(ret == old)) 159 if (likely(ret == old))
160 v->counter = new; 160 v->counter = new;
161 local_irq_restore(flags); 161 raw_local_irq_restore(flags);
162 162
163 return ret; 163 return ret;
164} 164}
@@ -167,9 +167,9 @@ static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr)
167{ 167{
168 unsigned long flags; 168 unsigned long flags;
169 169
170 local_irq_save(flags); 170 raw_local_irq_save(flags);
171 *addr &= ~mask; 171 *addr &= ~mask;
172 local_irq_restore(flags); 172 raw_local_irq_restore(flags);
173} 173}
174 174
175#endif /* __LINUX_ARM_ARCH__ */ 175#endif /* __LINUX_ARM_ARCH__ */
diff --git a/include/asm-arm/bitops.h b/include/asm-arm/bitops.h
index 0ac54b1a8bad..b41831b6432f 100644
--- a/include/asm-arm/bitops.h
+++ b/include/asm-arm/bitops.h
@@ -37,9 +37,9 @@ static inline void ____atomic_set_bit(unsigned int bit, volatile unsigned long *
37 37
38 p += bit >> 5; 38 p += bit >> 5;
39 39
40 local_irq_save(flags); 40 raw_local_irq_save(flags);
41 *p |= mask; 41 *p |= mask;
42 local_irq_restore(flags); 42 raw_local_irq_restore(flags);
43} 43}
44 44
45static inline void ____atomic_clear_bit(unsigned int bit, volatile unsigned long *p) 45static inline void ____atomic_clear_bit(unsigned int bit, volatile unsigned long *p)
@@ -49,9 +49,9 @@ static inline void ____atomic_clear_bit(unsigned int bit, volatile unsigned long
49 49
50 p += bit >> 5; 50 p += bit >> 5;
51 51
52 local_irq_save(flags); 52 raw_local_irq_save(flags);
53 *p &= ~mask; 53 *p &= ~mask;
54 local_irq_restore(flags); 54 raw_local_irq_restore(flags);
55} 55}
56 56
57static inline void ____atomic_change_bit(unsigned int bit, volatile unsigned long *p) 57static inline void ____atomic_change_bit(unsigned int bit, volatile unsigned long *p)
@@ -61,9 +61,9 @@ static inline void ____atomic_change_bit(unsigned int bit, volatile unsigned lon
61 61
62 p += bit >> 5; 62 p += bit >> 5;
63 63
64 local_irq_save(flags); 64 raw_local_irq_save(flags);
65 *p ^= mask; 65 *p ^= mask;
66 local_irq_restore(flags); 66 raw_local_irq_restore(flags);
67} 67}
68 68
69static inline int 69static inline int
@@ -75,10 +75,10 @@ ____atomic_test_and_set_bit(unsigned int bit, volatile unsigned long *p)
75 75
76 p += bit >> 5; 76 p += bit >> 5;
77 77
78 local_irq_save(flags); 78 raw_local_irq_save(flags);
79 res = *p; 79 res = *p;
80 *p = res | mask; 80 *p = res | mask;
81 local_irq_restore(flags); 81 raw_local_irq_restore(flags);
82 82
83 return res & mask; 83 return res & mask;
84} 84}
@@ -92,10 +92,10 @@ ____atomic_test_and_clear_bit(unsigned int bit, volatile unsigned long *p)
92 92
93 p += bit >> 5; 93 p += bit >> 5;
94 94
95 local_irq_save(flags); 95 raw_local_irq_save(flags);
96 res = *p; 96 res = *p;
97 *p = res & ~mask; 97 *p = res & ~mask;
98 local_irq_restore(flags); 98 raw_local_irq_restore(flags);
99 99
100 return res & mask; 100 return res & mask;
101} 101}
@@ -109,10 +109,10 @@ ____atomic_test_and_change_bit(unsigned int bit, volatile unsigned long *p)
109 109
110 p += bit >> 5; 110 p += bit >> 5;
111 111
112 local_irq_save(flags); 112 raw_local_irq_save(flags);
113 res = *p; 113 res = *p;
114 *p = res ^ mask; 114 *p = res ^ mask;
115 local_irq_restore(flags); 115 raw_local_irq_restore(flags);
116 116
117 return res & mask; 117 return res & mask;
118} 118}
diff --git a/include/asm-arm/cacheflush.h b/include/asm-arm/cacheflush.h
index e4a2569c636c..f0845646aacb 100644
--- a/include/asm-arm/cacheflush.h
+++ b/include/asm-arm/cacheflush.h
@@ -25,7 +25,7 @@
25#undef _CACHE 25#undef _CACHE
26#undef MULTI_CACHE 26#undef MULTI_CACHE
27 27
28#if defined(CONFIG_CPU_ARM610) || defined(CONFIG_CPU_ARM710) 28#if defined(CONFIG_CPU_CACHE_V3)
29# ifdef _CACHE 29# ifdef _CACHE
30# define MULTI_CACHE 1 30# define MULTI_CACHE 1
31# else 31# else
@@ -33,7 +33,7 @@
33# endif 33# endif
34#endif 34#endif
35 35
36#if defined(CONFIG_CPU_ARM720T) 36#if defined(CONFIG_CPU_CACHE_V4)
37# ifdef _CACHE 37# ifdef _CACHE
38# define MULTI_CACHE 1 38# define MULTI_CACHE 1
39# else 39# else
@@ -54,7 +54,23 @@
54# endif 54# endif
55#endif 55#endif
56 56
57#if defined(CONFIG_CPU_SA110) || defined(CONFIG_CPU_SA1100) 57#if defined(CONFIG_CPU_ARM940T)
58# ifdef _CACHE
59# define MULTI_CACHE 1
60# else
61# define _CACHE arm940
62# endif
63#endif
64
65#if defined(CONFIG_CPU_ARM946E)
66# ifdef _CACHE
67# define MULTI_CACHE 1
68# else
69# define _CACHE arm946
70# endif
71#endif
72
73#if defined(CONFIG_CPU_CACHE_V4WB)
58# ifdef _CACHE 74# ifdef _CACHE
59# define MULTI_CACHE 1 75# define MULTI_CACHE 1
60# else 76# else
diff --git a/include/asm-arm/flat.h b/include/asm-arm/flat.h
new file mode 100644
index 000000000000..966946478589
--- /dev/null
+++ b/include/asm-arm/flat.h
@@ -0,0 +1,16 @@
1/*
2 * include/asm-arm/flat.h -- uClinux flat-format executables
3 */
4
5#ifndef __ARM_FLAT_H__
6#define __ARM_FLAT_H__
7
8#define flat_stack_align(sp) /* nothing needed */
9#define flat_argvp_envp_on_stack() 1
10#define flat_old_ram_flag(flags) (flags)
11#define flat_reloc_valid(reloc, size) ((reloc) <= (size))
12#define flat_get_addr_from_rp(rp, relval, flags) get_unaligned(rp)
13#define flat_put_addr_at_rp(rp, val, relval) put_unaligned(val,rp)
14#define flat_get_relocate_addr(rel) (rel)
15
16#endif /* __ARM_FLAT_H__ */
diff --git a/include/asm-arm/hardware/iop3xx.h b/include/asm-arm/hardware/iop3xx.h
new file mode 100644
index 000000000000..1018a7486ab7
--- /dev/null
+++ b/include/asm-arm/hardware/iop3xx.h
@@ -0,0 +1,301 @@
1/*
2 * include/asm-arm/hardware/iop3xx.h
3 *
4 * Intel IOP32X and IOP33X register definitions
5 *
6 * Author: Rory Bolt <rorybolt@pacbell.net>
7 * Copyright (C) 2002 Rory Bolt
8 * Copyright (C) 2004 Intel Corp.
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 version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#ifndef __IOP3XX_H
16#define __IOP3XX_H
17
18/*
19 * IOP3XX GPIO handling
20 */
21#define GPIO_IN 0
22#define GPIO_OUT 1
23#define GPIO_LOW 0
24#define GPIO_HIGH 1
25#define IOP3XX_GPIO_LINE(x) (x)
26
27#ifndef __ASSEMBLY__
28extern void gpio_line_config(int line, int direction);
29extern int gpio_line_get(int line);
30extern void gpio_line_set(int line, int value);
31#endif
32
33
34/*
35 * IOP3XX processor registers
36 */
37#define IOP3XX_PERIPHERAL_PHYS_BASE 0xffffe000
38#define IOP3XX_PERIPHERAL_VIRT_BASE 0xfeffe000
39#define IOP3XX_PERIPHERAL_SIZE 0x00002000
40#define IOP3XX_REG_ADDR(reg) (IOP3XX_PERIPHERAL_VIRT_BASE + (reg))
41
42/* Address Translation Unit */
43#define IOP3XX_ATUVID (volatile u16 *)IOP3XX_REG_ADDR(0x0100)
44#define IOP3XX_ATUDID (volatile u16 *)IOP3XX_REG_ADDR(0x0102)
45#define IOP3XX_ATUCMD (volatile u16 *)IOP3XX_REG_ADDR(0x0104)
46#define IOP3XX_ATUSR (volatile u16 *)IOP3XX_REG_ADDR(0x0106)
47#define IOP3XX_ATURID (volatile u8 *)IOP3XX_REG_ADDR(0x0108)
48#define IOP3XX_ATUCCR (volatile u32 *)IOP3XX_REG_ADDR(0x0109)
49#define IOP3XX_ATUCLSR (volatile u8 *)IOP3XX_REG_ADDR(0x010c)
50#define IOP3XX_ATULT (volatile u8 *)IOP3XX_REG_ADDR(0x010d)
51#define IOP3XX_ATUHTR (volatile u8 *)IOP3XX_REG_ADDR(0x010e)
52#define IOP3XX_ATUBIST (volatile u8 *)IOP3XX_REG_ADDR(0x010f)
53#define IOP3XX_IABAR0 (volatile u32 *)IOP3XX_REG_ADDR(0x0110)
54#define IOP3XX_IAUBAR0 (volatile u32 *)IOP3XX_REG_ADDR(0x0114)
55#define IOP3XX_IABAR1 (volatile u32 *)IOP3XX_REG_ADDR(0x0118)
56#define IOP3XX_IAUBAR1 (volatile u32 *)IOP3XX_REG_ADDR(0x011c)
57#define IOP3XX_IABAR2 (volatile u32 *)IOP3XX_REG_ADDR(0x0120)
58#define IOP3XX_IAUBAR2 (volatile u32 *)IOP3XX_REG_ADDR(0x0124)
59#define IOP3XX_ASVIR (volatile u16 *)IOP3XX_REG_ADDR(0x012c)
60#define IOP3XX_ASIR (volatile u16 *)IOP3XX_REG_ADDR(0x012e)
61#define IOP3XX_ERBAR (volatile u32 *)IOP3XX_REG_ADDR(0x0130)
62#define IOP3XX_ATUILR (volatile u8 *)IOP3XX_REG_ADDR(0x013c)
63#define IOP3XX_ATUIPR (volatile u8 *)IOP3XX_REG_ADDR(0x013d)
64#define IOP3XX_ATUMGNT (volatile u8 *)IOP3XX_REG_ADDR(0x013e)
65#define IOP3XX_ATUMLAT (volatile u8 *)IOP3XX_REG_ADDR(0x013f)
66#define IOP3XX_IALR0 (volatile u32 *)IOP3XX_REG_ADDR(0x0140)
67#define IOP3XX_IATVR0 (volatile u32 *)IOP3XX_REG_ADDR(0x0144)
68#define IOP3XX_ERLR (volatile u32 *)IOP3XX_REG_ADDR(0x0148)
69#define IOP3XX_ERTVR (volatile u32 *)IOP3XX_REG_ADDR(0x014c)
70#define IOP3XX_IALR1 (volatile u32 *)IOP3XX_REG_ADDR(0x0150)
71#define IOP3XX_IALR2 (volatile u32 *)IOP3XX_REG_ADDR(0x0154)
72#define IOP3XX_IATVR2 (volatile u32 *)IOP3XX_REG_ADDR(0x0158)
73#define IOP3XX_OIOWTVR (volatile u32 *)IOP3XX_REG_ADDR(0x015c)
74#define IOP3XX_OMWTVR0 (volatile u32 *)IOP3XX_REG_ADDR(0x0160)
75#define IOP3XX_OUMWTVR0 (volatile u32 *)IOP3XX_REG_ADDR(0x0164)
76#define IOP3XX_OMWTVR1 (volatile u32 *)IOP3XX_REG_ADDR(0x0168)
77#define IOP3XX_OUMWTVR1 (volatile u32 *)IOP3XX_REG_ADDR(0x016c)
78#define IOP3XX_OUDWTVR (volatile u32 *)IOP3XX_REG_ADDR(0x0178)
79#define IOP3XX_ATUCR (volatile u32 *)IOP3XX_REG_ADDR(0x0180)
80#define IOP3XX_PCSR (volatile u32 *)IOP3XX_REG_ADDR(0x0184)
81#define IOP3XX_ATUISR (volatile u32 *)IOP3XX_REG_ADDR(0x0188)
82#define IOP3XX_ATUIMR (volatile u32 *)IOP3XX_REG_ADDR(0x018c)
83#define IOP3XX_IABAR3 (volatile u32 *)IOP3XX_REG_ADDR(0x0190)
84#define IOP3XX_IAUBAR3 (volatile u32 *)IOP3XX_REG_ADDR(0x0194)
85#define IOP3XX_IALR3 (volatile u32 *)IOP3XX_REG_ADDR(0x0198)
86#define IOP3XX_IATVR3 (volatile u32 *)IOP3XX_REG_ADDR(0x019c)
87#define IOP3XX_OCCAR (volatile u32 *)IOP3XX_REG_ADDR(0x01a4)
88#define IOP3XX_OCCDR (volatile u32 *)IOP3XX_REG_ADDR(0x01ac)
89#define IOP3XX_PDSCR (volatile u32 *)IOP3XX_REG_ADDR(0x01bc)
90#define IOP3XX_PMCAPID (volatile u8 *)IOP3XX_REG_ADDR(0x01c0)
91#define IOP3XX_PMNEXT (volatile u8 *)IOP3XX_REG_ADDR(0x01c1)
92#define IOP3XX_APMCR (volatile u16 *)IOP3XX_REG_ADDR(0x01c2)
93#define IOP3XX_APMCSR (volatile u16 *)IOP3XX_REG_ADDR(0x01c4)
94#define IOP3XX_PCIXCAPID (volatile u8 *)IOP3XX_REG_ADDR(0x01e0)
95#define IOP3XX_PCIXNEXT (volatile u8 *)IOP3XX_REG_ADDR(0x01e1)
96#define IOP3XX_PCIXCMD (volatile u16 *)IOP3XX_REG_ADDR(0x01e2)
97#define IOP3XX_PCIXSR (volatile u32 *)IOP3XX_REG_ADDR(0x01e4)
98#define IOP3XX_PCIIRSR (volatile u32 *)IOP3XX_REG_ADDR(0x01ec)
99
100/* Messaging Unit */
101#define IOP3XX_IMR0 (volatile u32 *)IOP3XX_REG_ADDR(0x0310)
102#define IOP3XX_IMR1 (volatile u32 *)IOP3XX_REG_ADDR(0x0314)
103#define IOP3XX_OMR0 (volatile u32 *)IOP3XX_REG_ADDR(0x0318)
104#define IOP3XX_OMR1 (volatile u32 *)IOP3XX_REG_ADDR(0x031c)
105#define IOP3XX_IDR (volatile u32 *)IOP3XX_REG_ADDR(0x0320)
106#define IOP3XX_IISR (volatile u32 *)IOP3XX_REG_ADDR(0x0324)
107#define IOP3XX_IIMR (volatile u32 *)IOP3XX_REG_ADDR(0x0328)
108#define IOP3XX_ODR (volatile u32 *)IOP3XX_REG_ADDR(0x032c)
109#define IOP3XX_OISR (volatile u32 *)IOP3XX_REG_ADDR(0x0330)
110#define IOP3XX_OIMR (volatile u32 *)IOP3XX_REG_ADDR(0x0334)
111#define IOP3XX_MUCR (volatile u32 *)IOP3XX_REG_ADDR(0x0350)
112#define IOP3XX_QBAR (volatile u32 *)IOP3XX_REG_ADDR(0x0354)
113#define IOP3XX_IFHPR (volatile u32 *)IOP3XX_REG_ADDR(0x0360)
114#define IOP3XX_IFTPR (volatile u32 *)IOP3XX_REG_ADDR(0x0364)
115#define IOP3XX_IPHPR (volatile u32 *)IOP3XX_REG_ADDR(0x0368)
116#define IOP3XX_IPTPR (volatile u32 *)IOP3XX_REG_ADDR(0x036c)
117#define IOP3XX_OFHPR (volatile u32 *)IOP3XX_REG_ADDR(0x0370)
118#define IOP3XX_OFTPR (volatile u32 *)IOP3XX_REG_ADDR(0x0374)
119#define IOP3XX_OPHPR (volatile u32 *)IOP3XX_REG_ADDR(0x0378)
120#define IOP3XX_OPTPR (volatile u32 *)IOP3XX_REG_ADDR(0x037c)
121#define IOP3XX_IAR (volatile u32 *)IOP3XX_REG_ADDR(0x0380)
122
123/* DMA Controller */
124#define IOP3XX_DMA0_CCR (volatile u32 *)IOP3XX_REG_ADDR(0x0400)
125#define IOP3XX_DMA0_CSR (volatile u32 *)IOP3XX_REG_ADDR(0x0404)
126#define IOP3XX_DMA0_DAR (volatile u32 *)IOP3XX_REG_ADDR(0x040c)
127#define IOP3XX_DMA0_NDAR (volatile u32 *)IOP3XX_REG_ADDR(0x0410)
128#define IOP3XX_DMA0_PADR (volatile u32 *)IOP3XX_REG_ADDR(0x0414)
129#define IOP3XX_DMA0_PUADR (volatile u32 *)IOP3XX_REG_ADDR(0x0418)
130#define IOP3XX_DMA0_LADR (volatile u32 *)IOP3XX_REG_ADDR(0x041c)
131#define IOP3XX_DMA0_BCR (volatile u32 *)IOP3XX_REG_ADDR(0x0420)
132#define IOP3XX_DMA0_DCR (volatile u32 *)IOP3XX_REG_ADDR(0x0424)
133#define IOP3XX_DMA1_CCR (volatile u32 *)IOP3XX_REG_ADDR(0x0440)
134#define IOP3XX_DMA1_CSR (volatile u32 *)IOP3XX_REG_ADDR(0x0444)
135#define IOP3XX_DMA1_DAR (volatile u32 *)IOP3XX_REG_ADDR(0x044c)
136#define IOP3XX_DMA1_NDAR (volatile u32 *)IOP3XX_REG_ADDR(0x0450)
137#define IOP3XX_DMA1_PADR (volatile u32 *)IOP3XX_REG_ADDR(0x0454)
138#define IOP3XX_DMA1_PUADR (volatile u32 *)IOP3XX_REG_ADDR(0x0458)
139#define IOP3XX_DMA1_LADR (volatile u32 *)IOP3XX_REG_ADDR(0x045c)
140#define IOP3XX_DMA1_BCR (volatile u32 *)IOP3XX_REG_ADDR(0x0460)
141#define IOP3XX_DMA1_DCR (volatile u32 *)IOP3XX_REG_ADDR(0x0464)
142
143/* Peripheral bus interface */
144#define IOP3XX_PBCR (volatile u32 *)IOP3XX_REG_ADDR(0x0680)
145#define IOP3XX_PBISR (volatile u32 *)IOP3XX_REG_ADDR(0x0684)
146#define IOP3XX_PBBAR0 (volatile u32 *)IOP3XX_REG_ADDR(0x0688)
147#define IOP3XX_PBLR0 (volatile u32 *)IOP3XX_REG_ADDR(0x068c)
148#define IOP3XX_PBBAR1 (volatile u32 *)IOP3XX_REG_ADDR(0x0690)
149#define IOP3XX_PBLR1 (volatile u32 *)IOP3XX_REG_ADDR(0x0694)
150#define IOP3XX_PBBAR2 (volatile u32 *)IOP3XX_REG_ADDR(0x0698)
151#define IOP3XX_PBLR2 (volatile u32 *)IOP3XX_REG_ADDR(0x069c)
152#define IOP3XX_PBBAR3 (volatile u32 *)IOP3XX_REG_ADDR(0x06a0)
153#define IOP3XX_PBLR3 (volatile u32 *)IOP3XX_REG_ADDR(0x06a4)
154#define IOP3XX_PBBAR4 (volatile u32 *)IOP3XX_REG_ADDR(0x06a8)
155#define IOP3XX_PBLR4 (volatile u32 *)IOP3XX_REG_ADDR(0x06ac)
156#define IOP3XX_PBBAR5 (volatile u32 *)IOP3XX_REG_ADDR(0x06b0)
157#define IOP3XX_PBLR5 (volatile u32 *)IOP3XX_REG_ADDR(0x06b4)
158#define IOP3XX_PMBR0 (volatile u32 *)IOP3XX_REG_ADDR(0x06c0)
159#define IOP3XX_PMBR1 (volatile u32 *)IOP3XX_REG_ADDR(0x06e0)
160#define IOP3XX_PMBR2 (volatile u32 *)IOP3XX_REG_ADDR(0x06e4)
161
162/* Peripheral performance monitoring unit */
163#define IOP3XX_GTMR (volatile u32 *)IOP3XX_REG_ADDR(0x0700)
164#define IOP3XX_ESR (volatile u32 *)IOP3XX_REG_ADDR(0x0704)
165#define IOP3XX_EMISR (volatile u32 *)IOP3XX_REG_ADDR(0x0708)
166#define IOP3XX_GTSR (volatile u32 *)IOP3XX_REG_ADDR(0x0710)
167/* PERCR0 DOESN'T EXIST - index from 1! */
168#define IOP3XX_PERCR0 (volatile u32 *)IOP3XX_REG_ADDR(0x0710)
169
170/* General Purpose I/O */
171#define IOP3XX_GPOE (volatile u32 *)IOP3XX_GPIO_REG(0x0004)
172#define IOP3XX_GPID (volatile u32 *)IOP3XX_GPIO_REG(0x0008)
173#define IOP3XX_GPOD (volatile u32 *)IOP3XX_GPIO_REG(0x000c)
174
175/* Timers */
176#define IOP3XX_TU_TMR0 (volatile u32 *)IOP3XX_TIMER_REG(0x0000)
177#define IOP3XX_TU_TMR1 (volatile u32 *)IOP3XX_TIMER_REG(0x0004)
178#define IOP3XX_TU_TCR0 (volatile u32 *)IOP3XX_TIMER_REG(0x0008)
179#define IOP3XX_TU_TCR1 (volatile u32 *)IOP3XX_TIMER_REG(0x000c)
180#define IOP3XX_TU_TRR0 (volatile u32 *)IOP3XX_TIMER_REG(0x0010)
181#define IOP3XX_TU_TRR1 (volatile u32 *)IOP3XX_TIMER_REG(0x0014)
182#define IOP3XX_TU_TISR (volatile u32 *)IOP3XX_TIMER_REG(0x0018)
183#define IOP3XX_TU_WDTCR (volatile u32 *)IOP3XX_TIMER_REG(0x001c)
184#define IOP3XX_TMR_TC 0x01
185#define IOP3XX_TMR_EN 0x02
186#define IOP3XX_TMR_RELOAD 0x04
187#define IOP3XX_TMR_PRIVILEGED 0x09
188#define IOP3XX_TMR_RATIO_1_1 0x00
189#define IOP3XX_TMR_RATIO_4_1 0x10
190#define IOP3XX_TMR_RATIO_8_1 0x20
191#define IOP3XX_TMR_RATIO_16_1 0x30
192
193/* Application accelerator unit */
194#define IOP3XX_AAU_ACR (volatile u32 *)IOP3XX_REG_ADDR(0x0800)
195#define IOP3XX_AAU_ASR (volatile u32 *)IOP3XX_REG_ADDR(0x0804)
196#define IOP3XX_AAU_ADAR (volatile u32 *)IOP3XX_REG_ADDR(0x0808)
197#define IOP3XX_AAU_ANDAR (volatile u32 *)IOP3XX_REG_ADDR(0x080c)
198#define IOP3XX_AAU_SAR1 (volatile u32 *)IOP3XX_REG_ADDR(0x0810)
199#define IOP3XX_AAU_SAR2 (volatile u32 *)IOP3XX_REG_ADDR(0x0814)
200#define IOP3XX_AAU_SAR3 (volatile u32 *)IOP3XX_REG_ADDR(0x0818)
201#define IOP3XX_AAU_SAR4 (volatile u32 *)IOP3XX_REG_ADDR(0x081c)
202#define IOP3XX_AAU_DAR (volatile u32 *)IOP3XX_REG_ADDR(0x0820)
203#define IOP3XX_AAU_ABCR (volatile u32 *)IOP3XX_REG_ADDR(0x0824)
204#define IOP3XX_AAU_ADCR (volatile u32 *)IOP3XX_REG_ADDR(0x0828)
205#define IOP3XX_AAU_SAR5 (volatile u32 *)IOP3XX_REG_ADDR(0x082c)
206#define IOP3XX_AAU_SAR6 (volatile u32 *)IOP3XX_REG_ADDR(0x0830)
207#define IOP3XX_AAU_SAR7 (volatile u32 *)IOP3XX_REG_ADDR(0x0834)
208#define IOP3XX_AAU_SAR8 (volatile u32 *)IOP3XX_REG_ADDR(0x0838)
209#define IOP3XX_AAU_EDCR0 (volatile u32 *)IOP3XX_REG_ADDR(0x083c)
210#define IOP3XX_AAU_SAR9 (volatile u32 *)IOP3XX_REG_ADDR(0x0840)
211#define IOP3XX_AAU_SAR10 (volatile u32 *)IOP3XX_REG_ADDR(0x0844)
212#define IOP3XX_AAU_SAR11 (volatile u32 *)IOP3XX_REG_ADDR(0x0848)
213#define IOP3XX_AAU_SAR12 (volatile u32 *)IOP3XX_REG_ADDR(0x084c)
214#define IOP3XX_AAU_SAR13 (volatile u32 *)IOP3XX_REG_ADDR(0x0850)
215#define IOP3XX_AAU_SAR14 (volatile u32 *)IOP3XX_REG_ADDR(0x0854)
216#define IOP3XX_AAU_SAR15 (volatile u32 *)IOP3XX_REG_ADDR(0x0858)
217#define IOP3XX_AAU_SAR16 (volatile u32 *)IOP3XX_REG_ADDR(0x085c)
218#define IOP3XX_AAU_EDCR1 (volatile u32 *)IOP3XX_REG_ADDR(0x0860)
219#define IOP3XX_AAU_SAR17 (volatile u32 *)IOP3XX_REG_ADDR(0x0864)
220#define IOP3XX_AAU_SAR18 (volatile u32 *)IOP3XX_REG_ADDR(0x0868)
221#define IOP3XX_AAU_SAR19 (volatile u32 *)IOP3XX_REG_ADDR(0x086c)
222#define IOP3XX_AAU_SAR20 (volatile u32 *)IOP3XX_REG_ADDR(0x0870)
223#define IOP3XX_AAU_SAR21 (volatile u32 *)IOP3XX_REG_ADDR(0x0874)
224#define IOP3XX_AAU_SAR22 (volatile u32 *)IOP3XX_REG_ADDR(0x0878)
225#define IOP3XX_AAU_SAR23 (volatile u32 *)IOP3XX_REG_ADDR(0x087c)
226#define IOP3XX_AAU_SAR24 (volatile u32 *)IOP3XX_REG_ADDR(0x0880)
227#define IOP3XX_AAU_EDCR2 (volatile u32 *)IOP3XX_REG_ADDR(0x0884)
228#define IOP3XX_AAU_SAR25 (volatile u32 *)IOP3XX_REG_ADDR(0x0888)
229#define IOP3XX_AAU_SAR26 (volatile u32 *)IOP3XX_REG_ADDR(0x088c)
230#define IOP3XX_AAU_SAR27 (volatile u32 *)IOP3XX_REG_ADDR(0x0890)
231#define IOP3XX_AAU_SAR28 (volatile u32 *)IOP3XX_REG_ADDR(0x0894)
232#define IOP3XX_AAU_SAR29 (volatile u32 *)IOP3XX_REG_ADDR(0x0898)
233#define IOP3XX_AAU_SAR30 (volatile u32 *)IOP3XX_REG_ADDR(0x089c)
234#define IOP3XX_AAU_SAR31 (volatile u32 *)IOP3XX_REG_ADDR(0x08a0)
235#define IOP3XX_AAU_SAR32 (volatile u32 *)IOP3XX_REG_ADDR(0x08a4)
236
237/* I2C bus interface unit */
238#define IOP3XX_ICR0 (volatile u32 *)IOP3XX_REG_ADDR(0x1680)
239#define IOP3XX_ISR0 (volatile u32 *)IOP3XX_REG_ADDR(0x1684)
240#define IOP3XX_ISAR0 (volatile u32 *)IOP3XX_REG_ADDR(0x1688)
241#define IOP3XX_IDBR0 (volatile u32 *)IOP3XX_REG_ADDR(0x168c)
242#define IOP3XX_IBMR0 (volatile u32 *)IOP3XX_REG_ADDR(0x1694)
243#define IOP3XX_ICR1 (volatile u32 *)IOP3XX_REG_ADDR(0x16a0)
244#define IOP3XX_ISR1 (volatile u32 *)IOP3XX_REG_ADDR(0x16a4)
245#define IOP3XX_ISAR1 (volatile u32 *)IOP3XX_REG_ADDR(0x16a8)
246#define IOP3XX_IDBR1 (volatile u32 *)IOP3XX_REG_ADDR(0x16ac)
247#define IOP3XX_IBMR1 (volatile u32 *)IOP3XX_REG_ADDR(0x16b4)
248
249
250/*
251 * IOP3XX I/O and Mem space regions for PCI autoconfiguration
252 */
253#define IOP3XX_PCI_MEM_WINDOW_SIZE 0x04000000
254#define IOP3XX_PCI_LOWER_MEM_PA 0x80000000
255#define IOP3XX_PCI_LOWER_MEM_BA (*IOP3XX_OMWTVR0)
256
257#define IOP3XX_PCI_IO_WINDOW_SIZE 0x00010000
258#define IOP3XX_PCI_LOWER_IO_PA 0x90000000
259#define IOP3XX_PCI_LOWER_IO_VA 0xfe000000
260#define IOP3XX_PCI_LOWER_IO_BA (*IOP3XX_OIOWTVR)
261
262
263#ifndef __ASSEMBLY__
264void iop3xx_map_io(void);
265void iop3xx_init_time(unsigned long);
266unsigned long iop3xx_gettimeoffset(void);
267
268extern struct platform_device iop3xx_i2c0_device;
269extern struct platform_device iop3xx_i2c1_device;
270
271extern inline void iop3xx_cp6_enable(void)
272{
273 u32 temp;
274
275 asm volatile (
276 "mrc p15, 0, %0, c15, c1, 0\n\t"
277 "orr %0, %0, #(1 << 6)\n\t"
278 "mcr p15, 0, %0, c15, c1, 0\n\t"
279 "mrc p15, 0, %0, c15, c1, 0\n\t"
280 "mov %0, %0\n\t"
281 "sub pc, pc, #4\n\t"
282 : "=r" (temp) );
283}
284
285extern inline void iop3xx_cp6_disable(void)
286{
287 u32 temp;
288
289 asm volatile (
290 "mrc p15, 0, %0, c15, c1, 0\n\t"
291 "bic %0, %0, #(1 << 6)\n\t"
292 "mcr p15, 0, %0, c15, c1, 0\n\t"
293 "mrc p15, 0, %0, c15, c1, 0\n\t"
294 "mov %0, %0\n\t"
295 "sub pc, pc, #4\n\t"
296 : "=r" (temp) );
297}
298#endif
299
300
301#endif
diff --git a/include/asm-arm/hardware/locomo.h b/include/asm-arm/hardware/locomo.h
index 22dfb1737768..adab77780ed3 100644
--- a/include/asm-arm/hardware/locomo.h
+++ b/include/asm-arm/hardware/locomo.h
@@ -54,17 +54,18 @@
54#define LOCOMO_DAC_SDAOEB 0x01 /* SDA pin output data */ 54#define LOCOMO_DAC_SDAOEB 0x01 /* SDA pin output data */
55 55
56/* SPI interface */ 56/* SPI interface */
57#define LOCOMO_SPIMD 0x60 /* SPI mode setting */ 57#define LOCOMO_SPI 0x60
58#define LOCOMO_SPICT 0x64 /* SPI mode control */ 58#define LOCOMO_SPIMD 0x00 /* SPI mode setting */
59#define LOCOMO_SPIST 0x68 /* SPI status */ 59#define LOCOMO_SPICT 0x04 /* SPI mode control */
60#define LOCOMO_SPIIS 0x70 /* SPI interrupt status */ 60#define LOCOMO_SPIST 0x08 /* SPI status */
61#define LOCOMO_SPIWE 0x74 /* SPI interrupt status write enable */ 61#define LOCOMO_SPIIS 0x10 /* SPI interrupt status */
62#define LOCOMO_SPIIE 0x78 /* SPI interrupt enable */ 62#define LOCOMO_SPIWE 0x14 /* SPI interrupt status write enable */
63#define LOCOMO_SPIIR 0x7c /* SPI interrupt request */ 63#define LOCOMO_SPIIE 0x18 /* SPI interrupt enable */
64#define LOCOMO_SPITD 0x80 /* SPI transfer data write */ 64#define LOCOMO_SPIIR 0x1c /* SPI interrupt request */
65#define LOCOMO_SPIRD 0x84 /* SPI receive data read */ 65#define LOCOMO_SPITD 0x20 /* SPI transfer data write */
66#define LOCOMO_SPITS 0x88 /* SPI transfer data shift */ 66#define LOCOMO_SPIRD 0x24 /* SPI receive data read */
67#define LOCOMO_SPIRS 0x8C /* SPI receive data shift */ 67#define LOCOMO_SPITS 0x28 /* SPI transfer data shift */
68#define LOCOMO_SPIRS 0x2C /* SPI receive data shift */
68#define LOCOMO_SPI_TEND (1 << 3) /* Transfer end bit */ 69#define LOCOMO_SPI_TEND (1 << 3) /* Transfer end bit */
69#define LOCOMO_SPI_OVRN (1 << 2) /* Over Run bit */ 70#define LOCOMO_SPI_OVRN (1 << 2) /* Over Run bit */
70#define LOCOMO_SPI_RFW (1 << 1) /* write buffer bit */ 71#define LOCOMO_SPI_RFW (1 << 1) /* write buffer bit */
@@ -161,6 +162,7 @@ extern struct bus_type locomo_bus_type;
161#define LOCOMO_DEVID_AUDIO 3 162#define LOCOMO_DEVID_AUDIO 3
162#define LOCOMO_DEVID_LED 4 163#define LOCOMO_DEVID_LED 4
163#define LOCOMO_DEVID_UART 5 164#define LOCOMO_DEVID_UART 5
165#define LOCOMO_DEVID_SPI 6
164 166
165struct locomo_dev { 167struct locomo_dev {
166 struct device dev; 168 struct device dev;
@@ -197,10 +199,11 @@ int locomo_driver_register(struct locomo_driver *);
197void locomo_driver_unregister(struct locomo_driver *); 199void locomo_driver_unregister(struct locomo_driver *);
198 200
199/* GPIO control functions */ 201/* GPIO control functions */
200void locomo_gpio_set_dir(struct locomo_dev *ldev, unsigned int bits, unsigned int dir); 202void locomo_gpio_set_dir(struct device *dev, unsigned int bits, unsigned int dir);
201unsigned int locomo_gpio_read_level(struct locomo_dev *ldev, unsigned int bits); 203int locomo_gpio_read_level(struct device *dev, unsigned int bits);
202unsigned int locomo_gpio_read_output(struct locomo_dev *ldev, unsigned int bits); 204int locomo_gpio_read_output(struct device *dev, unsigned int bits);
203void locomo_gpio_write(struct locomo_dev *ldev, unsigned int bits, unsigned int set); 205void locomo_gpio_write(struct device *dev, unsigned int bits, unsigned int set);
206
204 207
205/* M62332 control function */ 208/* M62332 control function */
206void locomo_m62332_senddata(struct locomo_dev *ldev, unsigned int dac_data, int channel); 209void locomo_m62332_senddata(struct locomo_dev *ldev, unsigned int dac_data, int channel);
diff --git a/include/asm-arm/hardware/sharpsl_pm.h b/include/asm-arm/hardware/sharpsl_pm.h
index ecf15b83956f..a836e76a14f7 100644
--- a/include/asm-arm/hardware/sharpsl_pm.h
+++ b/include/asm-arm/hardware/sharpsl_pm.h
@@ -25,6 +25,7 @@ struct sharpsl_charger_machinfo {
25 void (*measure_temp)(int); 25 void (*measure_temp)(int);
26 void (*presuspend)(void); 26 void (*presuspend)(void);
27 void (*postsuspend)(void); 27 void (*postsuspend)(void);
28 void (*earlyresume)(void);
28 unsigned long (*read_devdata)(int); 29 unsigned long (*read_devdata)(int);
29#define SHARPSL_BATT_VOLT 1 30#define SHARPSL_BATT_VOLT 1
30#define SHARPSL_BATT_TEMP 2 31#define SHARPSL_BATT_TEMP 2
diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h
index bf7b9dea30f1..8076a85c3675 100644
--- a/include/asm-arm/io.h
+++ b/include/asm-arm/io.h
@@ -280,6 +280,10 @@ extern void pci_iounmap(struct pci_dev *dev, void __iomem *addr);
280#define BIOVEC_MERGEABLE(vec1, vec2) \ 280#define BIOVEC_MERGEABLE(vec1, vec2) \
281 ((bvec_to_phys((vec1)) + (vec1)->bv_len) == bvec_to_phys((vec2))) 281 ((bvec_to_phys((vec1)) + (vec1)->bv_len) == bvec_to_phys((vec2)))
282 282
283#define ARCH_HAS_VALID_PHYS_ADDR_RANGE
284extern int valid_phys_addr_range(unsigned long addr, size_t size);
285extern int valid_mmap_phys_addr_range(unsigned long pfn, size_t size);
286
283/* 287/*
284 * Convert a physical pointer to a virtual kernel pointer for /dev/mem 288 * Convert a physical pointer to a virtual kernel pointer for /dev/mem
285 * access 289 * access
diff --git a/include/asm-arm/irqflags.h b/include/asm-arm/irqflags.h
new file mode 100644
index 000000000000..6d09974e6646
--- /dev/null
+++ b/include/asm-arm/irqflags.h
@@ -0,0 +1,132 @@
1#ifndef __ASM_ARM_IRQFLAGS_H
2#define __ASM_ARM_IRQFLAGS_H
3
4#ifdef __KERNEL__
5
6#include <asm/ptrace.h>
7
8/*
9 * CPU interrupt mask handling.
10 */
11#if __LINUX_ARM_ARCH__ >= 6
12
13#define raw_local_irq_save(x) \
14 ({ \
15 __asm__ __volatile__( \
16 "mrs %0, cpsr @ local_irq_save\n" \
17 "cpsid i" \
18 : "=r" (x) : : "memory", "cc"); \
19 })
20
21#define raw_local_irq_enable() __asm__("cpsie i @ __sti" : : : "memory", "cc")
22#define raw_local_irq_disable() __asm__("cpsid i @ __cli" : : : "memory", "cc")
23#define local_fiq_enable() __asm__("cpsie f @ __stf" : : : "memory", "cc")
24#define local_fiq_disable() __asm__("cpsid f @ __clf" : : : "memory", "cc")
25
26#else
27
28/*
29 * Save the current interrupt enable state & disable IRQs
30 */
31#define raw_local_irq_save(x) \
32 ({ \
33 unsigned long temp; \
34 (void) (&temp == &x); \
35 __asm__ __volatile__( \
36 "mrs %0, cpsr @ local_irq_save\n" \
37" orr %1, %0, #128\n" \
38" msr cpsr_c, %1" \
39 : "=r" (x), "=r" (temp) \
40 : \
41 : "memory", "cc"); \
42 })
43
44/*
45 * Enable IRQs
46 */
47#define raw_local_irq_enable() \
48 ({ \
49 unsigned long temp; \
50 __asm__ __volatile__( \
51 "mrs %0, cpsr @ local_irq_enable\n" \
52" bic %0, %0, #128\n" \
53" msr cpsr_c, %0" \
54 : "=r" (temp) \
55 : \
56 : "memory", "cc"); \
57 })
58
59/*
60 * Disable IRQs
61 */
62#define raw_local_irq_disable() \
63 ({ \
64 unsigned long temp; \
65 __asm__ __volatile__( \
66 "mrs %0, cpsr @ local_irq_disable\n" \
67" orr %0, %0, #128\n" \
68" msr cpsr_c, %0" \
69 : "=r" (temp) \
70 : \
71 : "memory", "cc"); \
72 })
73
74/*
75 * Enable FIQs
76 */
77#define local_fiq_enable() \
78 ({ \
79 unsigned long temp; \
80 __asm__ __volatile__( \
81 "mrs %0, cpsr @ stf\n" \
82" bic %0, %0, #64\n" \
83" msr cpsr_c, %0" \
84 : "=r" (temp) \
85 : \
86 : "memory", "cc"); \
87 })
88
89/*
90 * Disable FIQs
91 */
92#define local_fiq_disable() \
93 ({ \
94 unsigned long temp; \
95 __asm__ __volatile__( \
96 "mrs %0, cpsr @ clf\n" \
97" orr %0, %0, #64\n" \
98" msr cpsr_c, %0" \
99 : "=r" (temp) \
100 : \
101 : "memory", "cc"); \
102 })
103
104#endif
105
106/*
107 * Save the current interrupt enable state.
108 */
109#define raw_local_save_flags(x) \
110 ({ \
111 __asm__ __volatile__( \
112 "mrs %0, cpsr @ local_save_flags" \
113 : "=r" (x) : : "memory", "cc"); \
114 })
115
116/*
117 * restore saved IRQ & FIQ state
118 */
119#define raw_local_irq_restore(x) \
120 __asm__ __volatile__( \
121 "msr cpsr_c, %0 @ local_irq_restore\n" \
122 : \
123 : "r" (x) \
124 : "memory", "cc")
125
126#define raw_irqs_disabled_flags(flags) \
127({ \
128 (int)((flags) & PSR_I_BIT); \
129})
130
131#endif
132#endif
diff --git a/include/asm-arm/mach/pci.h b/include/asm-arm/mach/pci.h
index 923e0ca66200..24621c49a0c7 100644
--- a/include/asm-arm/mach/pci.h
+++ b/include/asm-arm/mach/pci.h
@@ -52,13 +52,9 @@ void pci_common_init(struct hw_pci *);
52/* 52/*
53 * PCI controllers 53 * PCI controllers
54 */ 54 */
55extern int iop321_setup(int nr, struct pci_sys_data *); 55extern int iop3xx_pci_setup(int nr, struct pci_sys_data *);
56extern struct pci_bus *iop321_scan_bus(int nr, struct pci_sys_data *); 56extern struct pci_bus *iop3xx_pci_scan_bus(int nr, struct pci_sys_data *);
57extern void iop321_init(void); 57extern void iop3xx_pci_preinit(void);
58
59extern int iop331_setup(int nr, struct pci_sys_data *);
60extern struct pci_bus *iop331_scan_bus(int nr, struct pci_sys_data *);
61extern void iop331_init(void);
62 58
63extern int dc21285_setup(int nr, struct pci_sys_data *); 59extern int dc21285_setup(int nr, struct pci_sys_data *);
64extern struct pci_bus *dc21285_scan_bus(int nr, struct pci_sys_data *); 60extern struct pci_bus *dc21285_scan_bus(int nr, struct pci_sys_data *);
diff --git a/include/asm-arm/mach/time.h b/include/asm-arm/mach/time.h
index dee0bc336fe8..1eb93f5c0d6c 100644
--- a/include/asm-arm/mach/time.h
+++ b/include/asm-arm/mach/time.h
@@ -38,7 +38,9 @@ struct sys_timer {
38 void (*init)(void); 38 void (*init)(void);
39 void (*suspend)(void); 39 void (*suspend)(void);
40 void (*resume)(void); 40 void (*resume)(void);
41#ifndef CONFIG_GENERIC_TIME
41 unsigned long (*offset)(void); 42 unsigned long (*offset)(void);
43#endif
42 44
43#ifdef CONFIG_NO_IDLE_HZ 45#ifdef CONFIG_NO_IDLE_HZ
44 struct dyn_tick_timer *dyn_tick; 46 struct dyn_tick_timer *dyn_tick;
diff --git a/include/asm-arm/page.h b/include/asm-arm/page.h
index 02bd3ee935b0..7e85db77d99b 100644
--- a/include/asm-arm/page.h
+++ b/include/asm-arm/page.h
@@ -174,9 +174,6 @@ typedef unsigned long pgprot_t;
174 174
175#endif /* STRICT_MM_TYPECHECKS */ 175#endif /* STRICT_MM_TYPECHECKS */
176 176
177/* the upper-most page table pointer */
178extern pmd_t *top_pmd;
179
180#endif /* CONFIG_MMU */ 177#endif /* CONFIG_MMU */
181 178
182#include <asm/memory.h> 179#include <asm/memory.h>
diff --git a/include/asm-arm/pgtable.h b/include/asm-arm/pgtable.h
index 4d10d319fa34..ed8cb5963e99 100644
--- a/include/asm-arm/pgtable.h
+++ b/include/asm-arm/pgtable.h
@@ -136,6 +136,13 @@ extern void __pgd_error(const char *file, int line, unsigned long val);
136#define USER_PTRS_PER_PGD ((TASK_SIZE/PGDIR_SIZE) - FIRST_USER_PGD_NR) 136#define USER_PTRS_PER_PGD ((TASK_SIZE/PGDIR_SIZE) - FIRST_USER_PGD_NR)
137 137
138/* 138/*
139 * section address mask and size definitions.
140 */
141#define SECTION_SHIFT 20
142#define SECTION_SIZE (1UL << SECTION_SHIFT)
143#define SECTION_MASK (~(SECTION_SIZE-1))
144
145/*
139 * ARMv6 supersection address mask and size definitions. 146 * ARMv6 supersection address mask and size definitions.
140 */ 147 */
141#define SUPERSECTION_SHIFT 24 148#define SUPERSECTION_SHIFT 24
diff --git a/include/asm-arm/proc-fns.h b/include/asm-arm/proc-fns.h
index 1bde92cdaebd..ea7e54c319be 100644
--- a/include/asm-arm/proc-fns.h
+++ b/include/asm-arm/proc-fns.h
@@ -33,6 +33,14 @@
33# define CPU_NAME cpu_arm6 33# define CPU_NAME cpu_arm6
34# endif 34# endif
35# endif 35# endif
36# ifdef CONFIG_CPU_ARM7TDMI
37# ifdef CPU_NAME
38# undef MULTI_CPU
39# define MULTI_CPU
40# else
41# define CPU_NAME cpu_arm7tdmi
42# endif
43# endif
36# ifdef CONFIG_CPU_ARM710 44# ifdef CONFIG_CPU_ARM710
37# ifdef CPU_NAME 45# ifdef CPU_NAME
38# undef MULTI_CPU 46# undef MULTI_CPU
@@ -49,6 +57,22 @@
49# define CPU_NAME cpu_arm720 57# define CPU_NAME cpu_arm720
50# endif 58# endif
51# endif 59# endif
60# ifdef CONFIG_CPU_ARM740T
61# ifdef CPU_NAME
62# undef MULTI_CPU
63# define MULTI_CPU
64# else
65# define CPU_NAME cpu_arm740
66# endif
67# endif
68# ifdef CONFIG_CPU_ARM9TDMI
69# ifdef CPU_NAME
70# undef MULTI_CPU
71# define MULTI_CPU
72# else
73# define CPU_NAME cpu_arm9tdmi
74# endif
75# endif
52# ifdef CONFIG_CPU_ARM920T 76# ifdef CONFIG_CPU_ARM920T
53# ifdef CPU_NAME 77# ifdef CPU_NAME
54# undef MULTI_CPU 78# undef MULTI_CPU
@@ -81,6 +105,22 @@
81# define CPU_NAME cpu_arm926 105# define CPU_NAME cpu_arm926
82# endif 106# endif
83# endif 107# endif
108# ifdef CONFIG_CPU_ARM940T
109# ifdef CPU_NAME
110# undef MULTI_CPU
111# define MULTI_CPU
112# else
113# define CPU_NAME cpu_arm940
114# endif
115# endif
116# ifdef CONFIG_CPU_ARM946E
117# ifdef CPU_NAME
118# undef MULTI_CPU
119# define MULTI_CPU
120# else
121# define CPU_NAME cpu_arm946
122# endif
123# endif
84# ifdef CONFIG_CPU_SA110 124# ifdef CONFIG_CPU_SA110
85# ifdef CPU_NAME 125# ifdef CPU_NAME
86# undef MULTI_CPU 126# undef MULTI_CPU
diff --git a/include/asm-arm/setup.h b/include/asm-arm/setup.h
index ea3ed2465233..aa4b5782f0c9 100644
--- a/include/asm-arm/setup.h
+++ b/include/asm-arm/setup.h
@@ -194,13 +194,15 @@ static struct tagtable __tagtable_##fn __tag = { tag, fn }
194# define NR_BANKS 8 194# define NR_BANKS 8
195#endif 195#endif
196 196
197struct membank {
198 unsigned long start;
199 unsigned long size;
200 int node;
201};
202
197struct meminfo { 203struct meminfo {
198 int nr_banks; 204 int nr_banks;
199 struct { 205 struct membank bank[NR_BANKS];
200 unsigned long start;
201 unsigned long size;
202 int node;
203 } bank[NR_BANKS];
204}; 206};
205 207
206/* 208/*
diff --git a/include/asm-arm/spinlock.h b/include/asm-arm/spinlock.h
index 01b7c26a3038..861092fbaa53 100644
--- a/include/asm-arm/spinlock.h
+++ b/include/asm-arm/spinlock.h
@@ -218,4 +218,8 @@ static inline int __raw_read_trylock(raw_rwlock_t *rw)
218/* read_can_lock - would read_trylock() succeed? */ 218/* read_can_lock - would read_trylock() succeed? */
219#define __raw_read_can_lock(x) ((x)->lock < 0x80000000) 219#define __raw_read_can_lock(x) ((x)->lock < 0x80000000)
220 220
221#define _raw_spin_relax(lock) cpu_relax()
222#define _raw_read_relax(lock) cpu_relax()
223#define _raw_write_relax(lock) cpu_relax()
224
221#endif /* __ASM_SPINLOCK_H */ 225#endif /* __ASM_SPINLOCK_H */
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h
index 0947cbf9b69a..f05fbe31576c 100644
--- a/include/asm-arm/system.h
+++ b/include/asm-arm/system.h
@@ -46,6 +46,7 @@
46#define CPUID_TCM 2 46#define CPUID_TCM 2
47#define CPUID_TLBTYPE 3 47#define CPUID_TLBTYPE 3
48 48
49#ifdef CONFIG_CPU_CP15
49#define read_cpuid(reg) \ 50#define read_cpuid(reg) \
50 ({ \ 51 ({ \
51 unsigned int __val; \ 52 unsigned int __val; \
@@ -55,6 +56,9 @@
55 : "cc"); \ 56 : "cc"); \
56 __val; \ 57 __val; \
57 }) 58 })
59#else
60#define read_cpuid(reg) (processor_id)
61#endif
58 62
59/* 63/*
60 * This is used to ensure the compiler did actually allocate the register we 64 * This is used to ensure the compiler did actually allocate the register we
@@ -207,130 +211,7 @@ static inline void sched_cacheflush(void)
207{ 211{
208} 212}
209 213
210/* 214#include <linux/irqflags.h>
211 * CPU interrupt mask handling.
212 */
213#if __LINUX_ARM_ARCH__ >= 6
214
215#define local_irq_save(x) \
216 ({ \
217 __asm__ __volatile__( \
218 "mrs %0, cpsr @ local_irq_save\n" \
219 "cpsid i" \
220 : "=r" (x) : : "memory", "cc"); \
221 })
222
223#define local_irq_enable() __asm__("cpsie i @ __sti" : : : "memory", "cc")
224#define local_irq_disable() __asm__("cpsid i @ __cli" : : : "memory", "cc")
225#define local_fiq_enable() __asm__("cpsie f @ __stf" : : : "memory", "cc")
226#define local_fiq_disable() __asm__("cpsid f @ __clf" : : : "memory", "cc")
227
228#else
229
230/*
231 * Save the current interrupt enable state & disable IRQs
232 */
233#define local_irq_save(x) \
234 ({ \
235 unsigned long temp; \
236 (void) (&temp == &x); \
237 __asm__ __volatile__( \
238 "mrs %0, cpsr @ local_irq_save\n" \
239" orr %1, %0, #128\n" \
240" msr cpsr_c, %1" \
241 : "=r" (x), "=r" (temp) \
242 : \
243 : "memory", "cc"); \
244 })
245
246/*
247 * Enable IRQs
248 */
249#define local_irq_enable() \
250 ({ \
251 unsigned long temp; \
252 __asm__ __volatile__( \
253 "mrs %0, cpsr @ local_irq_enable\n" \
254" bic %0, %0, #128\n" \
255" msr cpsr_c, %0" \
256 : "=r" (temp) \
257 : \
258 : "memory", "cc"); \
259 })
260
261/*
262 * Disable IRQs
263 */
264#define local_irq_disable() \
265 ({ \
266 unsigned long temp; \
267 __asm__ __volatile__( \
268 "mrs %0, cpsr @ local_irq_disable\n" \
269" orr %0, %0, #128\n" \
270" msr cpsr_c, %0" \
271 : "=r" (temp) \
272 : \
273 : "memory", "cc"); \
274 })
275
276/*
277 * Enable FIQs
278 */
279#define local_fiq_enable() \
280 ({ \
281 unsigned long temp; \
282 __asm__ __volatile__( \
283 "mrs %0, cpsr @ stf\n" \
284" bic %0, %0, #64\n" \
285" msr cpsr_c, %0" \
286 : "=r" (temp) \
287 : \
288 : "memory", "cc"); \
289 })
290
291/*
292 * Disable FIQs
293 */
294#define local_fiq_disable() \
295 ({ \
296 unsigned long temp; \
297 __asm__ __volatile__( \
298 "mrs %0, cpsr @ clf\n" \
299" orr %0, %0, #64\n" \
300" msr cpsr_c, %0" \
301 : "=r" (temp) \
302 : \
303 : "memory", "cc"); \
304 })
305
306#endif
307
308/*
309 * Save the current interrupt enable state.
310 */
311#define local_save_flags(x) \
312 ({ \
313 __asm__ __volatile__( \
314 "mrs %0, cpsr @ local_save_flags" \
315 : "=r" (x) : : "memory", "cc"); \
316 })
317
318/*
319 * restore saved IRQ & FIQ state
320 */
321#define local_irq_restore(x) \
322 __asm__ __volatile__( \
323 "msr cpsr_c, %0 @ local_irq_restore\n" \
324 : \
325 : "r" (x) \
326 : "memory", "cc")
327
328#define irqs_disabled() \
329({ \
330 unsigned long flags; \
331 local_save_flags(flags); \
332 (int)(flags & PSR_I_BIT); \
333})
334 215
335#ifdef CONFIG_SMP 216#ifdef CONFIG_SMP
336 217
@@ -405,17 +286,17 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size
405#error SMP is not supported on this platform 286#error SMP is not supported on this platform
406#endif 287#endif
407 case 1: 288 case 1:
408 local_irq_save(flags); 289 raw_local_irq_save(flags);
409 ret = *(volatile unsigned char *)ptr; 290 ret = *(volatile unsigned char *)ptr;
410 *(volatile unsigned char *)ptr = x; 291 *(volatile unsigned char *)ptr = x;
411 local_irq_restore(flags); 292 raw_local_irq_restore(flags);
412 break; 293 break;
413 294
414 case 4: 295 case 4:
415 local_irq_save(flags); 296 raw_local_irq_save(flags);
416 ret = *(volatile unsigned long *)ptr; 297 ret = *(volatile unsigned long *)ptr;
417 *(volatile unsigned long *)ptr = x; 298 *(volatile unsigned long *)ptr = x;
418 local_irq_restore(flags); 299 raw_local_irq_restore(flags);
419 break; 300 break;
420#else 301#else
421 case 1: 302 case 1:
diff --git a/include/asm-arm/timeofday.h b/include/asm-arm/timeofday.h
new file mode 100644
index 000000000000..27254bd5b94f
--- /dev/null
+++ b/include/asm-arm/timeofday.h
@@ -0,0 +1,4 @@
1#ifndef _ASM_ARM_TIMEOFDAY_H
2#define _ASM_ARM_TIMEOFDAY_H
3#include <asm-generic/timeofday.h>
4#endif
diff --git a/include/asm-arm/tlbflush.h b/include/asm-arm/tlbflush.h
index d97fc76189a5..cd10a0b5f8ae 100644
--- a/include/asm-arm/tlbflush.h
+++ b/include/asm-arm/tlbflush.h
@@ -247,16 +247,16 @@ static inline void local_flush_tlb_all(void)
247 const unsigned int __tlb_flag = __cpu_tlb_flags; 247 const unsigned int __tlb_flag = __cpu_tlb_flags;
248 248
249 if (tlb_flag(TLB_WB)) 249 if (tlb_flag(TLB_WB))
250 asm("mcr%? p15, 0, %0, c7, c10, 4" : : "r" (zero)); 250 asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (zero) : "cc");
251 251
252 if (tlb_flag(TLB_V3_FULL)) 252 if (tlb_flag(TLB_V3_FULL))
253 asm("mcr%? p15, 0, %0, c6, c0, 0" : : "r" (zero)); 253 asm("mcr p15, 0, %0, c6, c0, 0" : : "r" (zero) : "cc");
254 if (tlb_flag(TLB_V4_U_FULL | TLB_V6_U_FULL)) 254 if (tlb_flag(TLB_V4_U_FULL | TLB_V6_U_FULL))
255 asm("mcr%? p15, 0, %0, c8, c7, 0" : : "r" (zero)); 255 asm("mcr p15, 0, %0, c8, c7, 0" : : "r" (zero) : "cc");
256 if (tlb_flag(TLB_V4_D_FULL | TLB_V6_D_FULL)) 256 if (tlb_flag(TLB_V4_D_FULL | TLB_V6_D_FULL))
257 asm("mcr%? p15, 0, %0, c8, c6, 0" : : "r" (zero)); 257 asm("mcr p15, 0, %0, c8, c6, 0" : : "r" (zero) : "cc");
258 if (tlb_flag(TLB_V4_I_FULL | TLB_V6_I_FULL)) 258 if (tlb_flag(TLB_V4_I_FULL | TLB_V6_I_FULL))
259 asm("mcr%? p15, 0, %0, c8, c5, 0" : : "r" (zero)); 259 asm("mcr p15, 0, %0, c8, c5, 0" : : "r" (zero) : "cc");
260} 260}
261 261
262static inline void local_flush_tlb_mm(struct mm_struct *mm) 262static inline void local_flush_tlb_mm(struct mm_struct *mm)
@@ -266,25 +266,25 @@ static inline void local_flush_tlb_mm(struct mm_struct *mm)
266 const unsigned int __tlb_flag = __cpu_tlb_flags; 266 const unsigned int __tlb_flag = __cpu_tlb_flags;
267 267
268 if (tlb_flag(TLB_WB)) 268 if (tlb_flag(TLB_WB))
269 asm("mcr%? p15, 0, %0, c7, c10, 4" : : "r" (zero)); 269 asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (zero) : "cc");
270 270
271 if (cpu_isset(smp_processor_id(), mm->cpu_vm_mask)) { 271 if (cpu_isset(smp_processor_id(), mm->cpu_vm_mask)) {
272 if (tlb_flag(TLB_V3_FULL)) 272 if (tlb_flag(TLB_V3_FULL))
273 asm("mcr%? p15, 0, %0, c6, c0, 0" : : "r" (zero)); 273 asm("mcr p15, 0, %0, c6, c0, 0" : : "r" (zero) : "cc");
274 if (tlb_flag(TLB_V4_U_FULL)) 274 if (tlb_flag(TLB_V4_U_FULL))
275 asm("mcr%? p15, 0, %0, c8, c7, 0" : : "r" (zero)); 275 asm("mcr p15, 0, %0, c8, c7, 0" : : "r" (zero) : "cc");
276 if (tlb_flag(TLB_V4_D_FULL)) 276 if (tlb_flag(TLB_V4_D_FULL))
277 asm("mcr%? p15, 0, %0, c8, c6, 0" : : "r" (zero)); 277 asm("mcr p15, 0, %0, c8, c6, 0" : : "r" (zero) : "cc");
278 if (tlb_flag(TLB_V4_I_FULL)) 278 if (tlb_flag(TLB_V4_I_FULL))
279 asm("mcr%? p15, 0, %0, c8, c5, 0" : : "r" (zero)); 279 asm("mcr p15, 0, %0, c8, c5, 0" : : "r" (zero) : "cc");
280 } 280 }
281 281
282 if (tlb_flag(TLB_V6_U_ASID)) 282 if (tlb_flag(TLB_V6_U_ASID))
283 asm("mcr%? p15, 0, %0, c8, c7, 2" : : "r" (asid)); 283 asm("mcr p15, 0, %0, c8, c7, 2" : : "r" (asid) : "cc");
284 if (tlb_flag(TLB_V6_D_ASID)) 284 if (tlb_flag(TLB_V6_D_ASID))
285 asm("mcr%? p15, 0, %0, c8, c6, 2" : : "r" (asid)); 285 asm("mcr p15, 0, %0, c8, c6, 2" : : "r" (asid) : "cc");
286 if (tlb_flag(TLB_V6_I_ASID)) 286 if (tlb_flag(TLB_V6_I_ASID))
287 asm("mcr%? p15, 0, %0, c8, c5, 2" : : "r" (asid)); 287 asm("mcr p15, 0, %0, c8, c5, 2" : : "r" (asid) : "cc");
288} 288}
289 289
290static inline void 290static inline void
@@ -296,27 +296,27 @@ local_flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr)
296 uaddr = (uaddr & PAGE_MASK) | ASID(vma->vm_mm); 296 uaddr = (uaddr & PAGE_MASK) | ASID(vma->vm_mm);
297 297
298 if (tlb_flag(TLB_WB)) 298 if (tlb_flag(TLB_WB))
299 asm("mcr%? p15, 0, %0, c7, c10, 4" : : "r" (zero)); 299 asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (zero));
300 300
301 if (cpu_isset(smp_processor_id(), vma->vm_mm->cpu_vm_mask)) { 301 if (cpu_isset(smp_processor_id(), vma->vm_mm->cpu_vm_mask)) {
302 if (tlb_flag(TLB_V3_PAGE)) 302 if (tlb_flag(TLB_V3_PAGE))
303 asm("mcr%? p15, 0, %0, c6, c0, 0" : : "r" (uaddr)); 303 asm("mcr p15, 0, %0, c6, c0, 0" : : "r" (uaddr) : "cc");
304 if (tlb_flag(TLB_V4_U_PAGE)) 304 if (tlb_flag(TLB_V4_U_PAGE))
305 asm("mcr%? p15, 0, %0, c8, c7, 1" : : "r" (uaddr)); 305 asm("mcr p15, 0, %0, c8, c7, 1" : : "r" (uaddr) : "cc");
306 if (tlb_flag(TLB_V4_D_PAGE)) 306 if (tlb_flag(TLB_V4_D_PAGE))
307 asm("mcr%? p15, 0, %0, c8, c6, 1" : : "r" (uaddr)); 307 asm("mcr p15, 0, %0, c8, c6, 1" : : "r" (uaddr) : "cc");
308 if (tlb_flag(TLB_V4_I_PAGE)) 308 if (tlb_flag(TLB_V4_I_PAGE))
309 asm("mcr%? p15, 0, %0, c8, c5, 1" : : "r" (uaddr)); 309 asm("mcr p15, 0, %0, c8, c5, 1" : : "r" (uaddr) : "cc");
310 if (!tlb_flag(TLB_V4_I_PAGE) && tlb_flag(TLB_V4_I_FULL)) 310 if (!tlb_flag(TLB_V4_I_PAGE) && tlb_flag(TLB_V4_I_FULL))
311 asm("mcr%? p15, 0, %0, c8, c5, 0" : : "r" (zero)); 311 asm("mcr p15, 0, %0, c8, c5, 0" : : "r" (zero) : "cc");
312 } 312 }
313 313
314 if (tlb_flag(TLB_V6_U_PAGE)) 314 if (tlb_flag(TLB_V6_U_PAGE))
315 asm("mcr%? p15, 0, %0, c8, c7, 1" : : "r" (uaddr)); 315 asm("mcr p15, 0, %0, c8, c7, 1" : : "r" (uaddr) : "cc");
316 if (tlb_flag(TLB_V6_D_PAGE)) 316 if (tlb_flag(TLB_V6_D_PAGE))
317 asm("mcr%? p15, 0, %0, c8, c6, 1" : : "r" (uaddr)); 317 asm("mcr p15, 0, %0, c8, c6, 1" : : "r" (uaddr) : "cc");
318 if (tlb_flag(TLB_V6_I_PAGE)) 318 if (tlb_flag(TLB_V6_I_PAGE))
319 asm("mcr%? p15, 0, %0, c8, c5, 1" : : "r" (uaddr)); 319 asm("mcr p15, 0, %0, c8, c5, 1" : : "r" (uaddr) : "cc");
320} 320}
321 321
322static inline void local_flush_tlb_kernel_page(unsigned long kaddr) 322static inline void local_flush_tlb_kernel_page(unsigned long kaddr)
@@ -327,31 +327,31 @@ static inline void local_flush_tlb_kernel_page(unsigned long kaddr)
327 kaddr &= PAGE_MASK; 327 kaddr &= PAGE_MASK;
328 328
329 if (tlb_flag(TLB_WB)) 329 if (tlb_flag(TLB_WB))
330 asm("mcr%? p15, 0, %0, c7, c10, 4" : : "r" (zero)); 330 asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (zero) : "cc");
331 331
332 if (tlb_flag(TLB_V3_PAGE)) 332 if (tlb_flag(TLB_V3_PAGE))
333 asm("mcr%? p15, 0, %0, c6, c0, 0" : : "r" (kaddr)); 333 asm("mcr p15, 0, %0, c6, c0, 0" : : "r" (kaddr) : "cc");
334 if (tlb_flag(TLB_V4_U_PAGE)) 334 if (tlb_flag(TLB_V4_U_PAGE))
335 asm("mcr%? p15, 0, %0, c8, c7, 1" : : "r" (kaddr)); 335 asm("mcr p15, 0, %0, c8, c7, 1" : : "r" (kaddr) : "cc");
336 if (tlb_flag(TLB_V4_D_PAGE)) 336 if (tlb_flag(TLB_V4_D_PAGE))
337 asm("mcr%? p15, 0, %0, c8, c6, 1" : : "r" (kaddr)); 337 asm("mcr p15, 0, %0, c8, c6, 1" : : "r" (kaddr) : "cc");
338 if (tlb_flag(TLB_V4_I_PAGE)) 338 if (tlb_flag(TLB_V4_I_PAGE))
339 asm("mcr%? p15, 0, %0, c8, c5, 1" : : "r" (kaddr)); 339 asm("mcr p15, 0, %0, c8, c5, 1" : : "r" (kaddr) : "cc");
340 if (!tlb_flag(TLB_V4_I_PAGE) && tlb_flag(TLB_V4_I_FULL)) 340 if (!tlb_flag(TLB_V4_I_PAGE) && tlb_flag(TLB_V4_I_FULL))
341 asm("mcr%? p15, 0, %0, c8, c5, 0" : : "r" (zero)); 341 asm("mcr p15, 0, %0, c8, c5, 0" : : "r" (zero) : "cc");
342 342
343 if (tlb_flag(TLB_V6_U_PAGE)) 343 if (tlb_flag(TLB_V6_U_PAGE))
344 asm("mcr%? p15, 0, %0, c8, c7, 1" : : "r" (kaddr)); 344 asm("mcr p15, 0, %0, c8, c7, 1" : : "r" (kaddr) : "cc");
345 if (tlb_flag(TLB_V6_D_PAGE)) 345 if (tlb_flag(TLB_V6_D_PAGE))
346 asm("mcr%? p15, 0, %0, c8, c6, 1" : : "r" (kaddr)); 346 asm("mcr p15, 0, %0, c8, c6, 1" : : "r" (kaddr) : "cc");
347 if (tlb_flag(TLB_V6_I_PAGE)) 347 if (tlb_flag(TLB_V6_I_PAGE))
348 asm("mcr%? p15, 0, %0, c8, c5, 1" : : "r" (kaddr)); 348 asm("mcr p15, 0, %0, c8, c5, 1" : : "r" (kaddr) : "cc");
349 349
350 /* The ARM ARM states that the completion of a TLB maintenance 350 /* The ARM ARM states that the completion of a TLB maintenance
351 * operation is only guaranteed by a DSB instruction 351 * operation is only guaranteed by a DSB instruction
352 */ 352 */
353 if (tlb_flag(TLB_V6_U_PAGE | TLB_V6_D_PAGE | TLB_V6_I_PAGE)) 353 if (tlb_flag(TLB_V6_U_PAGE | TLB_V6_D_PAGE | TLB_V6_I_PAGE))
354 asm("mcr%? p15, 0, %0, c7, c10, 4" : : "r" (zero)); 354 asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (zero) : "cc");
355} 355}
356 356
357/* 357/*
@@ -373,11 +373,11 @@ static inline void flush_pmd_entry(pmd_t *pmd)
373 const unsigned int __tlb_flag = __cpu_tlb_flags; 373 const unsigned int __tlb_flag = __cpu_tlb_flags;
374 374
375 if (tlb_flag(TLB_DCLEAN)) 375 if (tlb_flag(TLB_DCLEAN))
376 asm("mcr%? p15, 0, %0, c7, c10, 1 @ flush_pmd" 376 asm("mcr p15, 0, %0, c7, c10, 1 @ flush_pmd"
377 : : "r" (pmd)); 377 : : "r" (pmd) : "cc");
378 if (tlb_flag(TLB_WB)) 378 if (tlb_flag(TLB_WB))
379 asm("mcr%? p15, 0, %0, c7, c10, 4 @ flush_pmd" 379 asm("mcr p15, 0, %0, c7, c10, 4 @ flush_pmd"
380 : : "r" (zero)); 380 : : "r" (zero) : "cc");
381} 381}
382 382
383static inline void clean_pmd_entry(pmd_t *pmd) 383static inline void clean_pmd_entry(pmd_t *pmd)
@@ -385,8 +385,8 @@ static inline void clean_pmd_entry(pmd_t *pmd)
385 const unsigned int __tlb_flag = __cpu_tlb_flags; 385 const unsigned int __tlb_flag = __cpu_tlb_flags;
386 386
387 if (tlb_flag(TLB_DCLEAN)) 387 if (tlb_flag(TLB_DCLEAN))
388 asm("mcr%? p15, 0, %0, c7, c10, 1 @ flush_pmd" 388 asm("mcr p15, 0, %0, c7, c10, 1 @ flush_pmd"
389 : : "r" (pmd)); 389 : : "r" (pmd) : "cc");
390} 390}
391 391
392#undef tlb_flag 392#undef tlb_flag
diff --git a/include/asm-arm/unaligned.h b/include/asm-arm/unaligned.h
index 1b39c2f322c9..795b9e5b9e6a 100644
--- a/include/asm-arm/unaligned.h
+++ b/include/asm-arm/unaligned.h
@@ -3,7 +3,7 @@
3 3
4#include <asm/types.h> 4#include <asm/types.h>
5 5
6extern int __bug_unaligned_x(void *ptr); 6extern int __bug_unaligned_x(const void *ptr);
7 7
8/* 8/*
9 * What is the most efficient way of loading/storing an unaligned value? 9 * What is the most efficient way of loading/storing an unaligned value?
@@ -51,44 +51,32 @@ extern int __bug_unaligned_x(void *ptr);
51#define __get_unaligned_4_be(__p) \ 51#define __get_unaligned_4_be(__p) \
52 (__p[0] << 24 | __p[1] << 16 | __p[2] << 8 | __p[3]) 52 (__p[0] << 24 | __p[1] << 16 | __p[2] << 8 | __p[3])
53 53
54#define __get_unaligned_le(ptr) \ 54#define __get_unaligned_8_le(__p) \
55 ({ \ 55 ((unsigned long long)__get_unaligned_4_le((__p+4)) << 32 | \
56 __typeof__(*(ptr)) __v; \ 56 __get_unaligned_4_le(__p))
57 __u8 *__p = (__u8 *)(ptr); \ 57
58 switch (sizeof(*(ptr))) { \ 58#define __get_unaligned_8_be(__p) \
59 case 1: __v = *(ptr); break; \ 59 ((unsigned long long)__get_unaligned_4_be(__p) << 32 | \
60 case 2: __v = __get_unaligned_2_le(__p); break; \ 60 __get_unaligned_4_be((__p+4)))
61 case 4: __v = __get_unaligned_4_le(__p); break; \ 61
62 case 8: { \ 62#define __get_unaligned_le(ptr) \
63 unsigned int __v1, __v2; \ 63 ({ \
64 __v2 = __get_unaligned_4_le((__p+4)); \ 64 const __u8 *__p = (const __u8 *)(ptr); \
65 __v1 = __get_unaligned_4_le(__p); \ 65 __builtin_choose_expr(sizeof(*(ptr)) == 1, *__p, \
66 __v = ((unsigned long long)__v2 << 32 | __v1); \ 66 __builtin_choose_expr(sizeof(*(ptr)) == 2, __get_unaligned_2_le(__p), \
67 } \ 67 __builtin_choose_expr(sizeof(*(ptr)) == 4, __get_unaligned_4_le(__p), \
68 break; \ 68 __builtin_choose_expr(sizeof(*(ptr)) == 8, __get_unaligned_8_le(__p), \
69 default: __v = __bug_unaligned_x(__p); break; \ 69 (void)__bug_unaligned_x(__p))))); \
70 } \
71 __v; \
72 }) 70 })
73 71
74#define __get_unaligned_be(ptr) \ 72#define __get_unaligned_be(ptr) \
75 ({ \ 73 ({ \
76 __typeof__(*(ptr)) __v; \ 74 const __u8 *__p = (const __u8 *)(ptr); \
77 __u8 *__p = (__u8 *)(ptr); \ 75 __builtin_choose_expr(sizeof(*(ptr)) == 1, *__p, \
78 switch (sizeof(*(ptr))) { \ 76 __builtin_choose_expr(sizeof(*(ptr)) == 2, __get_unaligned_2_be(__p), \
79 case 1: __v = *(ptr); break; \ 77 __builtin_choose_expr(sizeof(*(ptr)) == 4, __get_unaligned_4_be(__p), \
80 case 2: __v = __get_unaligned_2_be(__p); break; \ 78 __builtin_choose_expr(sizeof(*(ptr)) == 8, __get_unaligned_8_be(__p), \
81 case 4: __v = __get_unaligned_4_be(__p); break; \ 79 (void)__bug_unaligned_x(__p))))); \
82 case 8: { \
83 unsigned int __v1, __v2; \
84 __v2 = __get_unaligned_4_be(__p); \
85 __v1 = __get_unaligned_4_be((__p+4)); \
86 __v = ((unsigned long long)__v2 << 32 | __v1); \
87 } \
88 break; \
89 default: __v = __bug_unaligned_x(__p); break; \
90 } \
91 __v; \
92 }) 80 })
93 81
94 82
diff --git a/include/asm-cris/arch-v32/spinlock.h b/include/asm-cris/arch-v32/spinlock.h
index 52df72a62232..5f43df0a5fb4 100644
--- a/include/asm-cris/arch-v32/spinlock.h
+++ b/include/asm-cris/arch-v32/spinlock.h
@@ -160,4 +160,8 @@ static __inline__ int is_write_locked(rwlock_t *rw)
160 return rw->counter < 0; 160 return rw->counter < 0;
161} 161}
162 162
163#define _raw_spin_relax(lock) cpu_relax()
164#define _raw_read_relax(lock) cpu_relax()
165#define _raw_write_relax(lock) cpu_relax()
166
163#endif /* __ASM_ARCH_SPINLOCK_H */ 167#endif /* __ASM_ARCH_SPINLOCK_H */
diff --git a/include/asm-frv/pgtable.h b/include/asm-frv/pgtable.h
index 2fb3c6f05e03..ba1b37df69d5 100644
--- a/include/asm-frv/pgtable.h
+++ b/include/asm-frv/pgtable.h
@@ -176,8 +176,6 @@ do { \
176} while(0) 176} while(0)
177#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) 177#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
178 178
179#define set_pte_atomic(pteptr, pteval) set_pte((pteptr), (pteval))
180
181/* 179/*
182 * pgd_offset() returns a (pgd_t *) 180 * pgd_offset() returns a (pgd_t *)
183 * pgd_index() is used get the offset into the pgd page's array of pgd_t's; 181 * pgd_index() is used get the offset into the pgd page's array of pgd_t's;
diff --git a/include/asm-frv/timex.h b/include/asm-frv/timex.h
index 2aa562fa067b..a89bddefdacf 100644
--- a/include/asm-frv/timex.h
+++ b/include/asm-frv/timex.h
@@ -6,11 +6,6 @@
6#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ 6#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */
7#define CLOCK_TICK_FACTOR 20 /* Factor of both 1000000 and CLOCK_TICK_RATE */ 7#define CLOCK_TICK_FACTOR 20 /* Factor of both 1000000 and CLOCK_TICK_RATE */
8 8
9#define FINETUNE \
10((((((long)LATCH * HZ - CLOCK_TICK_RATE) << SHIFT_HZ) * \
11 (1000000/CLOCK_TICK_FACTOR) / (CLOCK_TICK_RATE/CLOCK_TICK_FACTOR)) \
12 << (SHIFT_SCALE-SHIFT_HZ)) / HZ)
13
14typedef unsigned long cycles_t; 9typedef unsigned long cycles_t;
15 10
16static inline cycles_t get_cycles(void) 11static inline cycles_t get_cycles(void)
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index 8ceab7bcd8b4..a5250895155e 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -16,12 +16,15 @@
16#endif 16#endif
17 17
18#ifndef HAVE_ARCH_WARN_ON 18#ifndef HAVE_ARCH_WARN_ON
19#define WARN_ON(condition) do { \ 19#define WARN_ON(condition) ({ \
20 if (unlikely((condition)!=0)) { \ 20 typeof(condition) __ret_warn_on = (condition); \
21 printk("BUG: warning at %s:%d/%s()\n", __FILE__, __LINE__, __FUNCTION__); \ 21 if (unlikely(__ret_warn_on)) { \
22 dump_stack(); \ 22 printk("BUG: warning at %s:%d/%s()\n", __FILE__, \
23 } \ 23 __LINE__, __FUNCTION__); \
24} while (0) 24 dump_stack(); \
25 } \
26 unlikely(__ret_warn_on); \
27})
25#endif 28#endif
26 29
27#else /* !CONFIG_BUG */ 30#else /* !CONFIG_BUG */
@@ -34,21 +37,18 @@
34#endif 37#endif
35 38
36#ifndef HAVE_ARCH_WARN_ON 39#ifndef HAVE_ARCH_WARN_ON
37#define WARN_ON(condition) do { if (condition) ; } while(0) 40#define WARN_ON(condition) unlikely((condition))
38#endif 41#endif
39#endif 42#endif
40 43
41#define WARN_ON_ONCE(condition) \ 44#define WARN_ON_ONCE(condition) ({ \
42({ \
43 static int __warn_once = 1; \ 45 static int __warn_once = 1; \
44 int __ret = 0; \ 46 typeof(condition) __ret_warn_once = (condition);\
45 \ 47 \
46 if (unlikely((condition) && __warn_once)) { \ 48 if (likely(__warn_once)) \
47 __warn_once = 0; \ 49 if (WARN_ON(__ret_warn_once)) \
48 WARN_ON(1); \ 50 __warn_once = 0; \
49 __ret = 1; \ 51 unlikely(__ret_warn_once); \
50 } \
51 __ret; \
52}) 52})
53 53
54#ifdef CONFIG_SMP 54#ifdef CONFIG_SMP
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index 349260cd86ed..9d774d07d95b 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -15,19 +15,11 @@
15 * Note: the old pte is known to not be writable, so we don't need to 15 * Note: the old pte is known to not be writable, so we don't need to
16 * worry about dirty bits etc getting lost. 16 * worry about dirty bits etc getting lost.
17 */ 17 */
18#ifndef __HAVE_ARCH_SET_PTE_ATOMIC
19#define ptep_establish(__vma, __address, __ptep, __entry) \ 18#define ptep_establish(__vma, __address, __ptep, __entry) \
20do { \ 19do { \
21 set_pte_at((__vma)->vm_mm, (__address), __ptep, __entry); \ 20 set_pte_at((__vma)->vm_mm, (__address), __ptep, __entry); \
22 flush_tlb_page(__vma, __address); \ 21 flush_tlb_page(__vma, __address); \
23} while (0) 22} while (0)
24#else /* __HAVE_ARCH_SET_PTE_ATOMIC */
25#define ptep_establish(__vma, __address, __ptep, __entry) \
26do { \
27 set_pte_atomic(__ptep, __entry); \
28 flush_tlb_page(__vma, __address); \
29} while (0)
30#endif /* __HAVE_ARCH_SET_PTE_ATOMIC */
31#endif 23#endif
32 24
33#ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS 25#ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
@@ -112,8 +104,13 @@ do { \
112}) 104})
113#endif 105#endif
114 106
115#ifndef __HAVE_ARCH_PTE_CLEAR_FULL 107/*
116#define pte_clear_full(__mm, __address, __ptep, __full) \ 108 * Some architectures may be able to avoid expensive synchronization
109 * primitives when modifications are made to PTE's which are already
110 * not present, or in the process of an address space destruction.
111 */
112#ifndef __HAVE_ARCH_PTE_CLEAR_NOT_PRESENT_FULL
113#define pte_clear_not_present_full(__mm, __address, __ptep, __full) \
117do { \ 114do { \
118 pte_clear((__mm), (__address), (__ptep)); \ 115 pte_clear((__mm), (__address), (__ptep)); \
119} while (0) 116} while (0)
@@ -166,6 +163,26 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addres
166#endif 163#endif
167 164
168/* 165/*
166 * A facility to provide lazy MMU batching. This allows PTE updates and
167 * page invalidations to be delayed until a call to leave lazy MMU mode
168 * is issued. Some architectures may benefit from doing this, and it is
169 * beneficial for both shadow and direct mode hypervisors, which may batch
170 * the PTE updates which happen during this window. Note that using this
171 * interface requires that read hazards be removed from the code. A read
172 * hazard could result in the direct mode hypervisor case, since the actual
173 * write to the page tables may not yet have taken place, so reads though
174 * a raw PTE pointer after it has been modified are not guaranteed to be
175 * up to date. This mode can only be entered and left under the protection of
176 * the page table locks for all page tables which may be modified. In the UP
177 * case, this is required so that preemption is disabled, and in the SMP case,
178 * it must synchronize the delayed page table writes properly on other CPUs.
179 */
180#ifndef __HAVE_ARCH_ENTER_LAZY_MMU_MODE
181#define arch_enter_lazy_mmu_mode() do {} while (0)
182#define arch_leave_lazy_mmu_mode() do {} while (0)
183#endif
184
185/*
169 * When walking page tables, get the address of the next boundary, 186 * When walking page tables, get the address of the next boundary,
170 * or the end address of the range if that comes earlier. Although no 187 * or the end address of the range if that comes earlier. Although no
171 * vma end wraps to 0, rounded up __boundary may wrap to 0 throughout. 188 * vma end wraps to 0, rounded up __boundary may wrap to 0 throughout.
diff --git a/include/asm-h8300/keyboard.h b/include/asm-h8300/keyboard.h
index fbad65e8a5c0..90efbd655390 100644
--- a/include/asm-h8300/keyboard.h
+++ b/include/asm-h8300/keyboard.h
@@ -18,14 +18,6 @@
18#define kbd_enable_irq(x...) do {;} while (0) 18#define kbd_enable_irq(x...) do {;} while (0)
19#define kbd_disable_irq(x...) do {;} while (0) 19#define kbd_disable_irq(x...) do {;} while (0)
20 20
21
22/* needed if MAGIC_SYSRQ is enabled for serial console */
23#ifndef SYSRQ_KEY
24#define SYSRQ_KEY ((unsigned char)(-1))
25#define kbd_sysrq_xlate ((unsigned char *)NULL)
26#endif
27
28
29#endif /* _H8300_KEYBOARD_H */ 21#endif /* _H8300_KEYBOARD_H */
30 22
31 23
diff --git a/include/asm-i386/dma-mapping.h b/include/asm-i386/dma-mapping.h
index 576ae01d71c8..81999a3ebe7c 100644
--- a/include/asm-i386/dma-mapping.h
+++ b/include/asm-i386/dma-mapping.h
@@ -21,7 +21,7 @@ static inline dma_addr_t
21dma_map_single(struct device *dev, void *ptr, size_t size, 21dma_map_single(struct device *dev, void *ptr, size_t size,
22 enum dma_data_direction direction) 22 enum dma_data_direction direction)
23{ 23{
24 BUG_ON(direction == DMA_NONE); 24 BUG_ON(!valid_dma_direction(direction));
25 WARN_ON(size == 0); 25 WARN_ON(size == 0);
26 flush_write_buffers(); 26 flush_write_buffers();
27 return virt_to_phys(ptr); 27 return virt_to_phys(ptr);
@@ -31,7 +31,7 @@ static inline void
31dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, 31dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
32 enum dma_data_direction direction) 32 enum dma_data_direction direction)
33{ 33{
34 BUG_ON(direction == DMA_NONE); 34 BUG_ON(!valid_dma_direction(direction));
35} 35}
36 36
37static inline int 37static inline int
@@ -40,7 +40,7 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
40{ 40{
41 int i; 41 int i;
42 42
43 BUG_ON(direction == DMA_NONE); 43 BUG_ON(!valid_dma_direction(direction));
44 WARN_ON(nents == 0 || sg[0].length == 0); 44 WARN_ON(nents == 0 || sg[0].length == 0);
45 45
46 for (i = 0; i < nents; i++ ) { 46 for (i = 0; i < nents; i++ ) {
@@ -57,7 +57,7 @@ static inline dma_addr_t
57dma_map_page(struct device *dev, struct page *page, unsigned long offset, 57dma_map_page(struct device *dev, struct page *page, unsigned long offset,
58 size_t size, enum dma_data_direction direction) 58 size_t size, enum dma_data_direction direction)
59{ 59{
60 BUG_ON(direction == DMA_NONE); 60 BUG_ON(!valid_dma_direction(direction));
61 return page_to_phys(page) + offset; 61 return page_to_phys(page) + offset;
62} 62}
63 63
@@ -65,7 +65,7 @@ static inline void
65dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, 65dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size,
66 enum dma_data_direction direction) 66 enum dma_data_direction direction)
67{ 67{
68 BUG_ON(direction == DMA_NONE); 68 BUG_ON(!valid_dma_direction(direction));
69} 69}
70 70
71 71
@@ -73,7 +73,7 @@ static inline void
73dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries, 73dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
74 enum dma_data_direction direction) 74 enum dma_data_direction direction)
75{ 75{
76 BUG_ON(direction == DMA_NONE); 76 BUG_ON(!valid_dma_direction(direction));
77} 77}
78 78
79static inline void 79static inline void
diff --git a/include/asm-i386/mach-default/do_timer.h b/include/asm-i386/mach-default/do_timer.h
index 6312c3e79814..4182c347ef85 100644
--- a/include/asm-i386/mach-default/do_timer.h
+++ b/include/asm-i386/mach-default/do_timer.h
@@ -16,7 +16,7 @@
16 16
17static inline void do_timer_interrupt_hook(struct pt_regs *regs) 17static inline void do_timer_interrupt_hook(struct pt_regs *regs)
18{ 18{
19 do_timer(regs); 19 do_timer(1);
20#ifndef CONFIG_SMP 20#ifndef CONFIG_SMP
21 update_process_times(user_mode_vm(regs)); 21 update_process_times(user_mode_vm(regs));
22#endif 22#endif
diff --git a/include/asm-i386/mach-summit/mach_apic.h b/include/asm-i386/mach-summit/mach_apic.h
index a81b05961595..254a0fe01c6a 100644
--- a/include/asm-i386/mach-summit/mach_apic.h
+++ b/include/asm-i386/mach-summit/mach_apic.h
@@ -88,7 +88,7 @@ static inline void clustered_apic_check(void)
88 88
89static inline int apicid_to_node(int logical_apicid) 89static inline int apicid_to_node(int logical_apicid)
90{ 90{
91 return logical_apicid >> 5; /* 2 clusterids per CEC */ 91 return apicid_2_node[logical_apicid];
92} 92}
93 93
94/* Mapping from cpu number to logical apicid */ 94/* Mapping from cpu number to logical apicid */
diff --git a/include/asm-i386/mach-visws/do_timer.h b/include/asm-i386/mach-visws/do_timer.h
index 95568e6ca91c..8db618c5a72b 100644
--- a/include/asm-i386/mach-visws/do_timer.h
+++ b/include/asm-i386/mach-visws/do_timer.h
@@ -9,7 +9,7 @@ static inline void do_timer_interrupt_hook(struct pt_regs *regs)
9 /* Clear the interrupt */ 9 /* Clear the interrupt */
10 co_cpu_write(CO_CPU_STAT,co_cpu_read(CO_CPU_STAT) & ~CO_STAT_TIMEINTR); 10 co_cpu_write(CO_CPU_STAT,co_cpu_read(CO_CPU_STAT) & ~CO_STAT_TIMEINTR);
11 11
12 do_timer(regs); 12 do_timer(1);
13#ifndef CONFIG_SMP 13#ifndef CONFIG_SMP
14 update_process_times(user_mode_vm(regs)); 14 update_process_times(user_mode_vm(regs));
15#endif 15#endif
diff --git a/include/asm-i386/mach-voyager/do_timer.h b/include/asm-i386/mach-voyager/do_timer.h
index eaf518098981..099fe9f5c1b2 100644
--- a/include/asm-i386/mach-voyager/do_timer.h
+++ b/include/asm-i386/mach-voyager/do_timer.h
@@ -3,7 +3,7 @@
3 3
4static inline void do_timer_interrupt_hook(struct pt_regs *regs) 4static inline void do_timer_interrupt_hook(struct pt_regs *regs)
5{ 5{
6 do_timer(regs); 6 do_timer(1);
7#ifndef CONFIG_SMP 7#ifndef CONFIG_SMP
8 update_process_times(user_mode_vm(regs)); 8 update_process_times(user_mode_vm(regs));
9#endif 9#endif
diff --git a/include/asm-i386/nmi.h b/include/asm-i386/nmi.h
index 303bcd4592bb..269d315719ca 100644
--- a/include/asm-i386/nmi.h
+++ b/include/asm-i386/nmi.h
@@ -36,4 +36,10 @@ extern unsigned int nmi_watchdog;
36#define NMI_LOCAL_APIC 2 36#define NMI_LOCAL_APIC 2
37#define NMI_INVALID 3 37#define NMI_INVALID 3
38 38
39struct ctl_table;
40struct file;
41extern int proc_nmi_enabled(struct ctl_table *, int , struct file *,
42 void __user *, size_t *, loff_t *);
43extern int unknown_nmi_panic;
44
39#endif /* ASM_NMI_H */ 45#endif /* ASM_NMI_H */
diff --git a/include/asm-i386/pgtable-2level.h b/include/asm-i386/pgtable-2level.h
index 201c86a6711e..8d8d3b9ecdb0 100644
--- a/include/asm-i386/pgtable-2level.h
+++ b/include/asm-i386/pgtable-2level.h
@@ -16,6 +16,7 @@
16#define set_pte(pteptr, pteval) (*(pteptr) = pteval) 16#define set_pte(pteptr, pteval) (*(pteptr) = pteval)
17#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) 17#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
18#define set_pte_atomic(pteptr, pteval) set_pte(pteptr,pteval) 18#define set_pte_atomic(pteptr, pteval) set_pte(pteptr,pteval)
19#define set_pte_present(mm,addr,ptep,pteval) set_pte_at(mm,addr,ptep,pteval)
19#define set_pmd(pmdptr, pmdval) (*(pmdptr) = (pmdval)) 20#define set_pmd(pmdptr, pmdval) (*(pmdptr) = (pmdval))
20 21
21#define pte_clear(mm,addr,xp) do { set_pte_at(mm, addr, xp, __pte(0)); } while (0) 22#define pte_clear(mm,addr,xp) do { set_pte_at(mm, addr, xp, __pte(0)); } while (0)
diff --git a/include/asm-i386/pgtable-3level.h b/include/asm-i386/pgtable-3level.h
index 0d899173232e..c2d701ea35be 100644
--- a/include/asm-i386/pgtable-3level.h
+++ b/include/asm-i386/pgtable-3level.h
@@ -58,7 +58,21 @@ static inline void set_pte(pte_t *ptep, pte_t pte)
58} 58}
59#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) 59#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
60 60
61#define __HAVE_ARCH_SET_PTE_ATOMIC 61/*
62 * Since this is only called on user PTEs, and the page fault handler
63 * must handle the already racy situation of simultaneous page faults,
64 * we are justified in merely clearing the PTE present bit, followed
65 * by a set. The ordering here is important.
66 */
67static inline void set_pte_present(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pte)
68{
69 ptep->pte_low = 0;
70 smp_wmb();
71 ptep->pte_high = pte.pte_high;
72 smp_wmb();
73 ptep->pte_low = pte.pte_low;
74}
75
62#define set_pte_atomic(pteptr,pteval) \ 76#define set_pte_atomic(pteptr,pteval) \
63 set_64bit((unsigned long long *)(pteptr),pte_val(pteval)) 77 set_64bit((unsigned long long *)(pteptr),pte_val(pteval))
64#define set_pmd(pmdptr,pmdval) \ 78#define set_pmd(pmdptr,pmdval) \
diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h
index 541b3e234335..7d398f493dde 100644
--- a/include/asm-i386/pgtable.h
+++ b/include/asm-i386/pgtable.h
@@ -247,6 +247,23 @@ static inline pte_t pte_mkhuge(pte_t pte) { (pte).pte_low |= _PAGE_PSE; return p
247#endif 247#endif
248 248
249/* 249/*
250 * Rules for using pte_update - it must be called after any PTE update which
251 * has not been done using the set_pte / clear_pte interfaces. It is used by
252 * shadow mode hypervisors to resynchronize the shadow page tables. Kernel PTE
253 * updates should either be sets, clears, or set_pte_atomic for P->P
254 * transitions, which means this hook should only be called for user PTEs.
255 * This hook implies a P->P protection or access change has taken place, which
256 * requires a subsequent TLB flush. The notification can optionally be delayed
257 * until the TLB flush event by using the pte_update_defer form of the
258 * interface, but care must be taken to assure that the flush happens while
259 * still holding the same page table lock so that the shadow and primary pages
260 * do not become out of sync on SMP.
261 */
262#define pte_update(mm, addr, ptep) do { } while (0)
263#define pte_update_defer(mm, addr, ptep) do { } while (0)
264
265
266/*
250 * We only update the dirty/accessed state if we set 267 * We only update the dirty/accessed state if we set
251 * the dirty bit by hand in the kernel, since the hardware 268 * the dirty bit by hand in the kernel, since the hardware
252 * will do the accessed bit for us, and we don't want to 269 * will do the accessed bit for us, and we don't want to
@@ -258,25 +275,54 @@ static inline pte_t pte_mkhuge(pte_t pte) { (pte).pte_low |= _PAGE_PSE; return p
258do { \ 275do { \
259 if (dirty) { \ 276 if (dirty) { \
260 (ptep)->pte_low = (entry).pte_low; \ 277 (ptep)->pte_low = (entry).pte_low; \
278 pte_update_defer((vma)->vm_mm, (addr), (ptep)); \
261 flush_tlb_page(vma, address); \ 279 flush_tlb_page(vma, address); \
262 } \ 280 } \
263} while (0) 281} while (0)
264 282
283/*
284 * We don't actually have these, but we want to advertise them so that
285 * we can encompass the flush here.
286 */
265#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY 287#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
266static inline int ptep_test_and_clear_dirty(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep)
267{
268 if (!pte_dirty(*ptep))
269 return 0;
270 return test_and_clear_bit(_PAGE_BIT_DIRTY, &ptep->pte_low);
271}
272
273#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG 288#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
274static inline int ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) 289
275{ 290/*
276 if (!pte_young(*ptep)) 291 * Rules for using ptep_establish: the pte MUST be a user pte, and
277 return 0; 292 * must be a present->present transition.
278 return test_and_clear_bit(_PAGE_BIT_ACCESSED, &ptep->pte_low); 293 */
279} 294#define __HAVE_ARCH_PTEP_ESTABLISH
295#define ptep_establish(vma, address, ptep, pteval) \
296do { \
297 set_pte_present((vma)->vm_mm, address, ptep, pteval); \
298 flush_tlb_page(vma, address); \
299} while (0)
300
301#define __HAVE_ARCH_PTEP_CLEAR_DIRTY_FLUSH
302#define ptep_clear_flush_dirty(vma, address, ptep) \
303({ \
304 int __dirty; \
305 __dirty = pte_dirty(*(ptep)); \
306 if (__dirty) { \
307 clear_bit(_PAGE_BIT_DIRTY, &(ptep)->pte_low); \
308 pte_update_defer((vma)->vm_mm, (addr), (ptep)); \
309 flush_tlb_page(vma, address); \
310 } \
311 __dirty; \
312})
313
314#define __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH
315#define ptep_clear_flush_young(vma, address, ptep) \
316({ \
317 int __young; \
318 __young = pte_young(*(ptep)); \
319 if (__young) { \
320 clear_bit(_PAGE_BIT_ACCESSED, &(ptep)->pte_low); \
321 pte_update_defer((vma)->vm_mm, (addr), (ptep)); \
322 flush_tlb_page(vma, address); \
323 } \
324 __young; \
325})
280 326
281#define __HAVE_ARCH_PTEP_GET_AND_CLEAR_FULL 327#define __HAVE_ARCH_PTEP_GET_AND_CLEAR_FULL
282static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm, unsigned long addr, pte_t *ptep, int full) 328static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm, unsigned long addr, pte_t *ptep, int full)
@@ -295,6 +341,7 @@ static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm, unsigned long
295static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep) 341static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
296{ 342{
297 clear_bit(_PAGE_BIT_RW, &ptep->pte_low); 343 clear_bit(_PAGE_BIT_RW, &ptep->pte_low);
344 pte_update(mm, addr, ptep);
298} 345}
299 346
300/* 347/*
@@ -426,6 +473,13 @@ extern pte_t *lookup_address(unsigned long address);
426#define pte_unmap_nested(pte) do { } while (0) 473#define pte_unmap_nested(pte) do { } while (0)
427#endif 474#endif
428 475
476/* Clear a kernel PTE and flush it from the TLB */
477#define kpte_clear_flush(ptep, vaddr) \
478do { \
479 pte_clear(&init_mm, vaddr, ptep); \
480 __flush_tlb_one(vaddr); \
481} while (0)
482
429/* 483/*
430 * The i386 doesn't have any external MMU info: the kernel page 484 * The i386 doesn't have any external MMU info: the kernel page
431 * tables contain all the necessary information. 485 * tables contain all the necessary information.
diff --git a/include/asm-i386/smp.h b/include/asm-i386/smp.h
index 32ac8c91d5c5..6aa1206f6e2a 100644
--- a/include/asm-i386/smp.h
+++ b/include/asm-i386/smp.h
@@ -46,6 +46,8 @@ extern u8 x86_cpu_to_apicid[];
46 46
47#define cpu_physical_id(cpu) x86_cpu_to_apicid[cpu] 47#define cpu_physical_id(cpu) x86_cpu_to_apicid[cpu]
48 48
49extern u8 apicid_2_node[];
50
49#ifdef CONFIG_HOTPLUG_CPU 51#ifdef CONFIG_HOTPLUG_CPU
50extern void cpu_exit_clear(void); 52extern void cpu_exit_clear(void);
51extern void cpu_uninit(void); 53extern void cpu_uninit(void);
@@ -82,6 +84,7 @@ static inline int hard_smp_processor_id(void)
82#endif 84#endif
83#endif 85#endif
84 86
87extern int safe_smp_processor_id(void);
85extern int __cpu_disable(void); 88extern int __cpu_disable(void);
86extern void __cpu_die(unsigned int cpu); 89extern void __cpu_die(unsigned int cpu);
87extern unsigned int num_processors; 90extern unsigned int num_processors;
@@ -90,6 +93,7 @@ extern unsigned int num_processors;
90 93
91#else /* CONFIG_SMP */ 94#else /* CONFIG_SMP */
92 95
96#define safe_smp_processor_id() 0
93#define cpu_physical_id(cpu) boot_cpu_physical_apicid 97#define cpu_physical_id(cpu) boot_cpu_physical_apicid
94 98
95#define NO_PROC_ID 0xFF /* No processor magic marker */ 99#define NO_PROC_ID 0xFF /* No processor magic marker */
diff --git a/include/asm-i386/spinlock.h b/include/asm-i386/spinlock.h
index b0b3043f05e1..c18b71fae6b3 100644
--- a/include/asm-i386/spinlock.h
+++ b/include/asm-i386/spinlock.h
@@ -205,4 +205,8 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw)
205 : "+m" (rw->lock) : : "memory"); 205 : "+m" (rw->lock) : : "memory");
206} 206}
207 207
208#define _raw_spin_relax(lock) cpu_relax()
209#define _raw_read_relax(lock) cpu_relax()
210#define _raw_write_relax(lock) cpu_relax()
211
208#endif /* __ASM_SPINLOCK_H */ 212#endif /* __ASM_SPINLOCK_H */
diff --git a/include/asm-ia64/spinlock.h b/include/asm-ia64/spinlock.h
index 9e83210dc312..ff857e31738a 100644
--- a/include/asm-ia64/spinlock.h
+++ b/include/asm-ia64/spinlock.h
@@ -213,4 +213,8 @@ static inline int __raw_read_trylock(raw_rwlock_t *x)
213 return (u32)ia64_cmpxchg4_acq((__u32 *)(x), new.word, old.word) == old.word; 213 return (u32)ia64_cmpxchg4_acq((__u32 *)(x), new.word, old.word) == old.word;
214} 214}
215 215
216#define _raw_spin_relax(lock) cpu_relax()
217#define _raw_read_relax(lock) cpu_relax()
218#define _raw_write_relax(lock) cpu_relax()
219
216#endif /* _ASM_IA64_SPINLOCK_H */ 220#endif /* _ASM_IA64_SPINLOCK_H */
diff --git a/include/asm-m32r/pgtable-2level.h b/include/asm-m32r/pgtable-2level.h
index 6a674e3d37a2..84152760e0b5 100644
--- a/include/asm-m32r/pgtable-2level.h
+++ b/include/asm-m32r/pgtable-2level.h
@@ -44,7 +44,7 @@ static inline int pgd_present(pgd_t pgd) { return 1; }
44 */ 44 */
45#define set_pte(pteptr, pteval) (*(pteptr) = pteval) 45#define set_pte(pteptr, pteval) (*(pteptr) = pteval)
46#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) 46#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
47#define set_pte_atomic(pteptr, pteval) set_pte(pteptr, pteval) 47
48/* 48/*
49 * (pmds are folded into pgds so this doesnt get actually called, 49 * (pmds are folded into pgds so this doesnt get actually called,
50 * but the define is needed for a generic inline function.) 50 * but the define is needed for a generic inline function.)
diff --git a/include/asm-m32r/spinlock.h b/include/asm-m32r/spinlock.h
index f9f90727a4a1..f5cfba81ee10 100644
--- a/include/asm-m32r/spinlock.h
+++ b/include/asm-m32r/spinlock.h
@@ -316,4 +316,8 @@ static inline int __raw_write_trylock(raw_rwlock_t *lock)
316 return 0; 316 return 0;
317} 317}
318 318
319#define _raw_spin_relax(lock) cpu_relax()
320#define _raw_read_relax(lock) cpu_relax()
321#define _raw_write_relax(lock) cpu_relax()
322
319#endif /* _ASM_M32R_SPINLOCK_H */ 323#endif /* _ASM_M32R_SPINLOCK_H */
diff --git a/include/asm-m32r/timex.h b/include/asm-m32r/timex.h
index e89bfd17db51..019441c1d7a0 100644
--- a/include/asm-m32r/timex.h
+++ b/include/asm-m32r/timex.h
@@ -12,9 +12,6 @@
12 12
13#define CLOCK_TICK_RATE (CONFIG_BUS_CLOCK / CONFIG_TIMER_DIVIDE) 13#define CLOCK_TICK_RATE (CONFIG_BUS_CLOCK / CONFIG_TIMER_DIVIDE)
14#define CLOCK_TICK_FACTOR 20 /* Factor of both 1000000 and CLOCK_TICK_RATE */ 14#define CLOCK_TICK_FACTOR 20 /* Factor of both 1000000 and CLOCK_TICK_RATE */
15#define FINETUNE ((((((long)LATCH * HZ - CLOCK_TICK_RATE) << SHIFT_HZ) * \
16 (1000000/CLOCK_TICK_FACTOR) / (CLOCK_TICK_RATE/CLOCK_TICK_FACTOR)) \
17 << (SHIFT_SCALE-SHIFT_HZ)) / HZ)
18 15
19#ifdef __KERNEL__ 16#ifdef __KERNEL__
20/* 17/*
diff --git a/include/asm-mips/spinlock.h b/include/asm-mips/spinlock.h
index 4c1a1b53aeaf..c8d5587467bb 100644
--- a/include/asm-mips/spinlock.h
+++ b/include/asm-mips/spinlock.h
@@ -328,4 +328,8 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw)
328} 328}
329 329
330 330
331#define _raw_spin_relax(lock) cpu_relax()
332#define _raw_read_relax(lock) cpu_relax()
333#define _raw_write_relax(lock) cpu_relax()
334
331#endif /* _ASM_SPINLOCK_H */ 335#endif /* _ASM_SPINLOCK_H */
diff --git a/include/asm-parisc/spinlock.h b/include/asm-parisc/spinlock.h
index a93960e232cf..e1825530365d 100644
--- a/include/asm-parisc/spinlock.h
+++ b/include/asm-parisc/spinlock.h
@@ -152,4 +152,8 @@ static __inline__ int __raw_write_can_lock(raw_rwlock_t *rw)
152 return !rw->counter; 152 return !rw->counter;
153} 153}
154 154
155#define _raw_spin_relax(lock) cpu_relax()
156#define _raw_read_relax(lock) cpu_relax()
157#define _raw_write_relax(lock) cpu_relax()
158
155#endif /* __ASM_SPINLOCK_H */ 159#endif /* __ASM_SPINLOCK_H */
diff --git a/include/asm-powerpc/bug.h b/include/asm-powerpc/bug.h
index f44b529e3298..978b2c7e84ea 100644
--- a/include/asm-powerpc/bug.h
+++ b/include/asm-powerpc/bug.h
@@ -70,9 +70,10 @@ struct bug_entry *find_bug(unsigned long bugaddr);
70 "i" (__FILE__), "i" (__FUNCTION__)); \ 70 "i" (__FILE__), "i" (__FUNCTION__)); \
71} while (0) 71} while (0)
72 72
73#define WARN_ON(x) do { \ 73#define WARN_ON(x) ({ \
74 if (__builtin_constant_p(x)) { \ 74 typeof(x) __ret_warn_on = (x); \
75 if (x) \ 75 if (__builtin_constant_p(__ret_warn_on)) { \
76 if (__ret_warn_on) \
76 __WARN(); \ 77 __WARN(); \
77 } else { \ 78 } else { \
78 __asm__ __volatile__( \ 79 __asm__ __volatile__( \
@@ -80,11 +81,12 @@ struct bug_entry *find_bug(unsigned long bugaddr);
80 ".section __bug_table,\"a\"\n" \ 81 ".section __bug_table,\"a\"\n" \
81 "\t"PPC_LONG" 1b,%1,%2,%3\n" \ 82 "\t"PPC_LONG" 1b,%1,%2,%3\n" \
82 ".previous" \ 83 ".previous" \
83 : : "r" ((long)(x)), \ 84 : : "r" (__ret_warn_on), \
84 "i" (__LINE__ + BUG_WARNING_TRAP), \ 85 "i" (__LINE__ + BUG_WARNING_TRAP), \
85 "i" (__FILE__), "i" (__FUNCTION__)); \ 86 "i" (__FILE__), "i" (__FUNCTION__)); \
86 } \ 87 } \
87} while (0) 88 unlikely(__ret_warn_on); \
89})
88 90
89#define HAVE_ARCH_BUG 91#define HAVE_ARCH_BUG
90#define HAVE_ARCH_BUG_ON 92#define HAVE_ARCH_BUG_ON
diff --git a/include/asm-powerpc/io.h b/include/asm-powerpc/io.h
index 46bae1cf385b..19b2ec1ec665 100644
--- a/include/asm-powerpc/io.h
+++ b/include/asm-powerpc/io.h
@@ -11,6 +11,8 @@
11 11
12/* Check of existence of legacy devices */ 12/* Check of existence of legacy devices */
13extern int check_legacy_ioport(unsigned long base_port); 13extern int check_legacy_ioport(unsigned long base_port);
14#define PARALLEL_BASE 0x378
15#define PNPBIOS_BASE 0xf000 /* only relevant for PReP */
14 16
15#ifndef CONFIG_PPC64 17#ifndef CONFIG_PPC64
16#include <asm-ppc/io.h> 18#include <asm-ppc/io.h>
diff --git a/include/asm-powerpc/spinlock.h b/include/asm-powerpc/spinlock.h
index c31e4382a775..cc4cfceac67c 100644
--- a/include/asm-powerpc/spinlock.h
+++ b/include/asm-powerpc/spinlock.h
@@ -285,5 +285,9 @@ static __inline__ void __raw_write_unlock(raw_rwlock_t *rw)
285 rw->lock = 0; 285 rw->lock = 0;
286} 286}
287 287
288#define _raw_spin_relax(lock) __spin_yield(lock)
289#define _raw_read_relax(lock) __rw_yield(lock)
290#define _raw_write_relax(lock) __rw_yield(lock)
291
288#endif /* __KERNEL__ */ 292#endif /* __KERNEL__ */
289#endif /* __ASM_SPINLOCK_H */ 293#endif /* __ASM_SPINLOCK_H */
diff --git a/include/asm-ppc/spinlock.h b/include/asm-ppc/spinlock.h
index 5c64b75f0295..fccaf5531e57 100644
--- a/include/asm-ppc/spinlock.h
+++ b/include/asm-ppc/spinlock.h
@@ -161,4 +161,8 @@ static __inline__ void __raw_write_unlock(raw_rwlock_t *rw)
161 rw->lock = 0; 161 rw->lock = 0;
162} 162}
163 163
164#define _raw_spin_relax(lock) cpu_relax()
165#define _raw_read_relax(lock) cpu_relax()
166#define _raw_write_relax(lock) cpu_relax()
167
164#endif /* __ASM_SPINLOCK_H */ 168#endif /* __ASM_SPINLOCK_H */
diff --git a/include/asm-s390/appldata.h b/include/asm-s390/appldata.h
index b1770703b706..79283dac8281 100644
--- a/include/asm-s390/appldata.h
+++ b/include/asm-s390/appldata.h
@@ -80,7 +80,7 @@ static inline int appldata_asm(struct appldata_product_id *id,
80 parm_list.product_id_addr = (unsigned long) id; 80 parm_list.product_id_addr = (unsigned long) id;
81 parm_list.buffer_addr = virt_to_phys(buffer); 81 parm_list.buffer_addr = virt_to_phys(buffer);
82 asm volatile( 82 asm volatile(
83 "diag %1,%0,0xdc" 83 " diag %1,%0,0xdc"
84 : "=d" (ry) 84 : "=d" (ry)
85 : "d" (&parm_list), "m" (parm_list), "m" (*id) 85 : "d" (&parm_list), "m" (parm_list), "m" (*id)
86 : "cc"); 86 : "cc");
diff --git a/include/asm-s390/atomic.h b/include/asm-s390/atomic.h
index 399bf02894dd..af20c7462485 100644
--- a/include/asm-s390/atomic.h
+++ b/include/asm-s390/atomic.h
@@ -30,20 +30,43 @@ typedef struct {
30 30
31#ifdef __KERNEL__ 31#ifdef __KERNEL__
32 32
33#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)
34
33#define __CS_LOOP(ptr, op_val, op_string) ({ \ 35#define __CS_LOOP(ptr, op_val, op_string) ({ \
34 typeof(ptr->counter) old_val, new_val; \ 36 typeof(ptr->counter) old_val, new_val; \
35 __asm__ __volatile__(" l %0,0(%3)\n" \ 37 asm volatile( \
36 "0: lr %1,%0\n" \ 38 " l %0,%2\n" \
37 op_string " %1,%4\n" \ 39 "0: lr %1,%0\n" \
38 " cs %0,%1,0(%3)\n" \ 40 op_string " %1,%3\n" \
39 " jl 0b" \ 41 " cs %0,%1,%2\n" \
40 : "=&d" (old_val), "=&d" (new_val), \ 42 " jl 0b" \
41 "=m" (((atomic_t *)(ptr))->counter) \ 43 : "=&d" (old_val), "=&d" (new_val), \
42 : "a" (ptr), "d" (op_val), \ 44 "=Q" (((atomic_t *)(ptr))->counter) \
43 "m" (((atomic_t *)(ptr))->counter) \ 45 : "d" (op_val), "Q" (((atomic_t *)(ptr))->counter) \
44 : "cc", "memory" ); \ 46 : "cc", "memory"); \
45 new_val; \ 47 new_val; \
46}) 48})
49
50#else /* __GNUC__ */
51
52#define __CS_LOOP(ptr, op_val, op_string) ({ \
53 typeof(ptr->counter) old_val, new_val; \
54 asm volatile( \
55 " l %0,0(%3)\n" \
56 "0: lr %1,%0\n" \
57 op_string " %1,%4\n" \
58 " cs %0,%1,0(%3)\n" \
59 " jl 0b" \
60 : "=&d" (old_val), "=&d" (new_val), \
61 "=m" (((atomic_t *)(ptr))->counter) \
62 : "a" (ptr), "d" (op_val), \
63 "m" (((atomic_t *)(ptr))->counter) \
64 : "cc", "memory"); \
65 new_val; \
66})
67
68#endif /* __GNUC__ */
69
47#define atomic_read(v) ((v)->counter) 70#define atomic_read(v) ((v)->counter)
48#define atomic_set(v,i) (((v)->counter) = (i)) 71#define atomic_set(v,i) (((v)->counter) = (i))
49 72
@@ -81,10 +104,19 @@ static __inline__ void atomic_set_mask(unsigned long mask, atomic_t * v)
81 104
82static __inline__ int atomic_cmpxchg(atomic_t *v, int old, int new) 105static __inline__ int atomic_cmpxchg(atomic_t *v, int old, int new)
83{ 106{
84 __asm__ __volatile__(" cs %0,%3,0(%2)\n" 107#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)
85 : "+d" (old), "=m" (v->counter) 108 asm volatile(
86 : "a" (v), "d" (new), "m" (v->counter) 109 " cs %0,%2,%1"
87 : "cc", "memory" ); 110 : "+d" (old), "=Q" (v->counter)
111 : "d" (new), "Q" (v->counter)
112 : "cc", "memory");
113#else /* __GNUC__ */
114 asm volatile(
115 " cs %0,%3,0(%2)"
116 : "+d" (old), "=m" (v->counter)
117 : "a" (v), "d" (new), "m" (v->counter)
118 : "cc", "memory");
119#endif /* __GNUC__ */
88 return old; 120 return old;
89} 121}
90 122
@@ -113,20 +145,43 @@ typedef struct {
113} __attribute__ ((aligned (8))) atomic64_t; 145} __attribute__ ((aligned (8))) atomic64_t;
114#define ATOMIC64_INIT(i) { (i) } 146#define ATOMIC64_INIT(i) { (i) }
115 147
148#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)
149
116#define __CSG_LOOP(ptr, op_val, op_string) ({ \ 150#define __CSG_LOOP(ptr, op_val, op_string) ({ \
117 typeof(ptr->counter) old_val, new_val; \ 151 typeof(ptr->counter) old_val, new_val; \
118 __asm__ __volatile__(" lg %0,0(%3)\n" \ 152 asm volatile( \
119 "0: lgr %1,%0\n" \ 153 " lg %0,%2\n" \
120 op_string " %1,%4\n" \ 154 "0: lgr %1,%0\n" \
121 " csg %0,%1,0(%3)\n" \ 155 op_string " %1,%3\n" \
122 " jl 0b" \ 156 " csg %0,%1,%2\n" \
123 : "=&d" (old_val), "=&d" (new_val), \ 157 " jl 0b" \
124 "=m" (((atomic_t *)(ptr))->counter) \ 158 : "=&d" (old_val), "=&d" (new_val), \
125 : "a" (ptr), "d" (op_val), \ 159 "=Q" (((atomic_t *)(ptr))->counter) \
126 "m" (((atomic_t *)(ptr))->counter) \ 160 : "d" (op_val), "Q" (((atomic_t *)(ptr))->counter) \
127 : "cc", "memory" ); \ 161 : "cc", "memory" ); \
128 new_val; \ 162 new_val; \
129}) 163})
164
165#else /* __GNUC__ */
166
167#define __CSG_LOOP(ptr, op_val, op_string) ({ \
168 typeof(ptr->counter) old_val, new_val; \
169 asm volatile( \
170 " lg %0,0(%3)\n" \
171 "0: lgr %1,%0\n" \
172 op_string " %1,%4\n" \
173 " csg %0,%1,0(%3)\n" \
174 " jl 0b" \
175 : "=&d" (old_val), "=&d" (new_val), \
176 "=m" (((atomic_t *)(ptr))->counter) \
177 : "a" (ptr), "d" (op_val), \
178 "m" (((atomic_t *)(ptr))->counter) \
179 : "cc", "memory" ); \
180 new_val; \
181})
182
183#endif /* __GNUC__ */
184
130#define atomic64_read(v) ((v)->counter) 185#define atomic64_read(v) ((v)->counter)
131#define atomic64_set(v,i) (((v)->counter) = (i)) 186#define atomic64_set(v,i) (((v)->counter) = (i))
132 187
@@ -163,10 +218,19 @@ static __inline__ void atomic64_set_mask(unsigned long mask, atomic64_t * v)
163static __inline__ long long atomic64_cmpxchg(atomic64_t *v, 218static __inline__ long long atomic64_cmpxchg(atomic64_t *v,
164 long long old, long long new) 219 long long old, long long new)
165{ 220{
166 __asm__ __volatile__(" csg %0,%3,0(%2)\n" 221#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)
167 : "+d" (old), "=m" (v->counter) 222 asm volatile(
168 : "a" (v), "d" (new), "m" (v->counter) 223 " csg %0,%2,%1"
169 : "cc", "memory" ); 224 : "+d" (old), "=Q" (v->counter)
225 : "d" (new), "Q" (v->counter)
226 : "cc", "memory");
227#else /* __GNUC__ */
228 asm volatile(
229 " csg %0,%3,0(%2)"
230 : "+d" (old), "=m" (v->counter)
231 : "a" (v), "d" (new), "m" (v->counter)
232 : "cc", "memory");
233#endif /* __GNUC__ */
170 return old; 234 return old;
171} 235}
172 236
diff --git a/include/asm-s390/bitops.h b/include/asm-s390/bitops.h
index 0ddcdba79e4a..f79c9b792af1 100644
--- a/include/asm-s390/bitops.h
+++ b/include/asm-s390/bitops.h
@@ -67,16 +67,35 @@ extern const char _sb_findmap[];
67#define __BITOPS_AND "nr" 67#define __BITOPS_AND "nr"
68#define __BITOPS_XOR "xr" 68#define __BITOPS_XOR "xr"
69 69
70#define __BITOPS_LOOP(__old, __new, __addr, __val, __op_string) \ 70#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)
71 __asm__ __volatile__(" l %0,0(%4)\n" \ 71
72 "0: lr %1,%0\n" \ 72#define __BITOPS_LOOP(__old, __new, __addr, __val, __op_string) \
73 __op_string " %1,%3\n" \ 73 asm volatile( \
74 " cs %0,%1,0(%4)\n" \ 74 " l %0,%2\n" \
75 " jl 0b" \ 75 "0: lr %1,%0\n" \
76 : "=&d" (__old), "=&d" (__new), \ 76 __op_string " %1,%3\n" \
77 "=m" (*(unsigned long *) __addr) \ 77 " cs %0,%1,%2\n" \
78 : "d" (__val), "a" (__addr), \ 78 " jl 0b" \
79 "m" (*(unsigned long *) __addr) : "cc" ); 79 : "=&d" (__old), "=&d" (__new), \
80 "=Q" (*(unsigned long *) __addr) \
81 : "d" (__val), "Q" (*(unsigned long *) __addr) \
82 : "cc");
83
84#else /* __GNUC__ */
85
86#define __BITOPS_LOOP(__old, __new, __addr, __val, __op_string) \
87 asm volatile( \
88 " l %0,0(%4)\n" \
89 "0: lr %1,%0\n" \
90 __op_string " %1,%3\n" \
91 " cs %0,%1,0(%4)\n" \
92 " jl 0b" \
93 : "=&d" (__old), "=&d" (__new), \
94 "=m" (*(unsigned long *) __addr) \
95 : "d" (__val), "a" (__addr), \
96 "m" (*(unsigned long *) __addr) : "cc");
97
98#endif /* __GNUC__ */
80 99
81#else /* __s390x__ */ 100#else /* __s390x__ */
82 101
@@ -86,21 +105,41 @@ extern const char _sb_findmap[];
86#define __BITOPS_AND "ngr" 105#define __BITOPS_AND "ngr"
87#define __BITOPS_XOR "xgr" 106#define __BITOPS_XOR "xgr"
88 107
89#define __BITOPS_LOOP(__old, __new, __addr, __val, __op_string) \ 108#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)
90 __asm__ __volatile__(" lg %0,0(%4)\n" \ 109
91 "0: lgr %1,%0\n" \ 110#define __BITOPS_LOOP(__old, __new, __addr, __val, __op_string) \
92 __op_string " %1,%3\n" \ 111 asm volatile( \
93 " csg %0,%1,0(%4)\n" \ 112 " lg %0,%2\n" \
94 " jl 0b" \ 113 "0: lgr %1,%0\n" \
95 : "=&d" (__old), "=&d" (__new), \ 114 __op_string " %1,%3\n" \
96 "=m" (*(unsigned long *) __addr) \ 115 " csg %0,%1,%2\n" \
97 : "d" (__val), "a" (__addr), \ 116 " jl 0b" \
98 "m" (*(unsigned long *) __addr) : "cc" ); 117 : "=&d" (__old), "=&d" (__new), \
118 "=Q" (*(unsigned long *) __addr) \
119 : "d" (__val), "Q" (*(unsigned long *) __addr) \
120 : "cc");
121
122#else /* __GNUC__ */
123
124#define __BITOPS_LOOP(__old, __new, __addr, __val, __op_string) \
125 asm volatile( \
126 " lg %0,0(%4)\n" \
127 "0: lgr %1,%0\n" \
128 __op_string " %1,%3\n" \
129 " csg %0,%1,0(%4)\n" \
130 " jl 0b" \
131 : "=&d" (__old), "=&d" (__new), \
132 "=m" (*(unsigned long *) __addr) \
133 : "d" (__val), "a" (__addr), \
134 "m" (*(unsigned long *) __addr) : "cc");
135
136
137#endif /* __GNUC__ */
99 138
100#endif /* __s390x__ */ 139#endif /* __s390x__ */
101 140
102#define __BITOPS_WORDS(bits) (((bits)+__BITOPS_WORDSIZE-1)/__BITOPS_WORDSIZE) 141#define __BITOPS_WORDS(bits) (((bits)+__BITOPS_WORDSIZE-1)/__BITOPS_WORDSIZE)
103#define __BITOPS_BARRIER() __asm__ __volatile__ ( "" : : : "memory" ) 142#define __BITOPS_BARRIER() asm volatile("" : : : "memory")
104 143
105#ifdef CONFIG_SMP 144#ifdef CONFIG_SMP
106/* 145/*
@@ -217,10 +256,10 @@ static inline void __set_bit(unsigned long nr, volatile unsigned long *ptr)
217 unsigned long addr; 256 unsigned long addr;
218 257
219 addr = (unsigned long) ptr + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3); 258 addr = (unsigned long) ptr + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3);
220 asm volatile("oc 0(1,%1),0(%2)" 259 asm volatile(
221 : "=m" (*(char *) addr) 260 " oc 0(1,%1),0(%2)"
222 : "a" (addr), "a" (_oi_bitmap + (nr & 7)), 261 : "=m" (*(char *) addr) : "a" (addr),
223 "m" (*(char *) addr) : "cc" ); 262 "a" (_oi_bitmap + (nr & 7)), "m" (*(char *) addr) : "cc" );
224} 263}
225 264
226static inline void 265static inline void
@@ -229,40 +268,7 @@ __constant_set_bit(const unsigned long nr, volatile unsigned long *ptr)
229 unsigned long addr; 268 unsigned long addr;
230 269
231 addr = ((unsigned long) ptr) + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3); 270 addr = ((unsigned long) ptr) + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3);
232 switch (nr&7) { 271 *(unsigned char *) addr |= 1 << (nr & 7);
233 case 0:
234 asm volatile ("oi 0(%1),0x01" : "=m" (*(char *) addr)
235 : "a" (addr), "m" (*(char *) addr) : "cc" );
236 break;
237 case 1:
238 asm volatile ("oi 0(%1),0x02" : "=m" (*(char *) addr)
239 : "a" (addr), "m" (*(char *) addr) : "cc" );
240 break;
241 case 2:
242 asm volatile ("oi 0(%1),0x04" : "=m" (*(char *) addr)
243 : "a" (addr), "m" (*(char *) addr) : "cc" );
244 break;
245 case 3:
246 asm volatile ("oi 0(%1),0x08" : "=m" (*(char *) addr)
247 : "a" (addr), "m" (*(char *) addr) : "cc" );
248 break;
249 case 4:
250 asm volatile ("oi 0(%1),0x10" : "=m" (*(char *) addr)
251 : "a" (addr), "m" (*(char *) addr) : "cc" );
252 break;
253 case 5:
254 asm volatile ("oi 0(%1),0x20" : "=m" (*(char *) addr)
255 : "a" (addr), "m" (*(char *) addr) : "cc" );
256 break;
257 case 6:
258 asm volatile ("oi 0(%1),0x40" : "=m" (*(char *) addr)
259 : "a" (addr), "m" (*(char *) addr) : "cc" );
260 break;
261 case 7:
262 asm volatile ("oi 0(%1),0x80" : "=m" (*(char *) addr)
263 : "a" (addr), "m" (*(char *) addr) : "cc" );
264 break;
265 }
266} 272}
267 273
268#define set_bit_simple(nr,addr) \ 274#define set_bit_simple(nr,addr) \
@@ -279,10 +285,10 @@ __clear_bit(unsigned long nr, volatile unsigned long *ptr)
279 unsigned long addr; 285 unsigned long addr;
280 286
281 addr = (unsigned long) ptr + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3); 287 addr = (unsigned long) ptr + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3);
282 asm volatile("nc 0(1,%1),0(%2)" 288 asm volatile(
283 : "=m" (*(char *) addr) 289 " nc 0(1,%1),0(%2)"
284 : "a" (addr), "a" (_ni_bitmap + (nr & 7)), 290 : "=m" (*(char *) addr) : "a" (addr),
285 "m" (*(char *) addr) : "cc" ); 291 "a" (_ni_bitmap + (nr & 7)), "m" (*(char *) addr) : "cc");
286} 292}
287 293
288static inline void 294static inline void
@@ -291,40 +297,7 @@ __constant_clear_bit(const unsigned long nr, volatile unsigned long *ptr)
291 unsigned long addr; 297 unsigned long addr;
292 298
293 addr = ((unsigned long) ptr) + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3); 299 addr = ((unsigned long) ptr) + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3);
294 switch (nr&7) { 300 *(unsigned char *) addr &= ~(1 << (nr & 7));
295 case 0:
296 asm volatile ("ni 0(%1),0xFE" : "=m" (*(char *) addr)
297 : "a" (addr), "m" (*(char *) addr) : "cc" );
298 break;
299 case 1:
300 asm volatile ("ni 0(%1),0xFD": "=m" (*(char *) addr)
301 : "a" (addr), "m" (*(char *) addr) : "cc" );
302 break;
303 case 2:
304 asm volatile ("ni 0(%1),0xFB" : "=m" (*(char *) addr)
305 : "a" (addr), "m" (*(char *) addr) : "cc" );
306 break;
307 case 3:
308 asm volatile ("ni 0(%1),0xF7" : "=m" (*(char *) addr)
309 : "a" (addr), "m" (*(char *) addr) : "cc" );
310 break;
311 case 4:
312 asm volatile ("ni 0(%1),0xEF" : "=m" (*(char *) addr)
313 : "a" (addr), "m" (*(char *) addr) : "cc" );
314 break;
315 case 5:
316 asm volatile ("ni 0(%1),0xDF" : "=m" (*(char *) addr)
317 : "a" (addr), "m" (*(char *) addr) : "cc" );
318 break;
319 case 6:
320 asm volatile ("ni 0(%1),0xBF" : "=m" (*(char *) addr)
321 : "a" (addr), "m" (*(char *) addr) : "cc" );
322 break;
323 case 7:
324 asm volatile ("ni 0(%1),0x7F" : "=m" (*(char *) addr)
325 : "a" (addr), "m" (*(char *) addr) : "cc" );
326 break;
327 }
328} 301}
329 302
330#define clear_bit_simple(nr,addr) \ 303#define clear_bit_simple(nr,addr) \
@@ -340,10 +313,10 @@ static inline void __change_bit(unsigned long nr, volatile unsigned long *ptr)
340 unsigned long addr; 313 unsigned long addr;
341 314
342 addr = (unsigned long) ptr + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3); 315 addr = (unsigned long) ptr + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3);
343 asm volatile("xc 0(1,%1),0(%2)" 316 asm volatile(
344 : "=m" (*(char *) addr) 317 " xc 0(1,%1),0(%2)"
345 : "a" (addr), "a" (_oi_bitmap + (nr & 7)), 318 : "=m" (*(char *) addr) : "a" (addr),
346 "m" (*(char *) addr) : "cc" ); 319 "a" (_oi_bitmap + (nr & 7)), "m" (*(char *) addr) : "cc" );
347} 320}
348 321
349static inline void 322static inline void
@@ -352,40 +325,7 @@ __constant_change_bit(const unsigned long nr, volatile unsigned long *ptr)
352 unsigned long addr; 325 unsigned long addr;
353 326
354 addr = ((unsigned long) ptr) + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3); 327 addr = ((unsigned long) ptr) + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3);
355 switch (nr&7) { 328 *(unsigned char *) addr ^= 1 << (nr & 7);
356 case 0:
357 asm volatile ("xi 0(%1),0x01" : "=m" (*(char *) addr)
358 : "a" (addr), "m" (*(char *) addr) : "cc" );
359 break;
360 case 1:
361 asm volatile ("xi 0(%1),0x02" : "=m" (*(char *) addr)
362 : "a" (addr), "m" (*(char *) addr) : "cc" );
363 break;
364 case 2:
365 asm volatile ("xi 0(%1),0x04" : "=m" (*(char *) addr)
366 : "a" (addr), "m" (*(char *) addr) : "cc" );
367 break;
368 case 3:
369 asm volatile ("xi 0(%1),0x08" : "=m" (*(char *) addr)
370 : "a" (addr), "m" (*(char *) addr) : "cc" );
371 break;
372 case 4:
373 asm volatile ("xi 0(%1),0x10" : "=m" (*(char *) addr)
374 : "a" (addr), "m" (*(char *) addr) : "cc" );
375 break;
376 case 5:
377 asm volatile ("xi 0(%1),0x20" : "=m" (*(char *) addr)
378 : "a" (addr), "m" (*(char *) addr) : "cc" );
379 break;
380 case 6:
381 asm volatile ("xi 0(%1),0x40" : "=m" (*(char *) addr)
382 : "a" (addr), "m" (*(char *) addr) : "cc" );
383 break;
384 case 7:
385 asm volatile ("xi 0(%1),0x80" : "=m" (*(char *) addr)
386 : "a" (addr), "m" (*(char *) addr) : "cc" );
387 break;
388 }
389} 329}
390 330
391#define change_bit_simple(nr,addr) \ 331#define change_bit_simple(nr,addr) \
@@ -404,10 +344,11 @@ test_and_set_bit_simple(unsigned long nr, volatile unsigned long *ptr)
404 344
405 addr = (unsigned long) ptr + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3); 345 addr = (unsigned long) ptr + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3);
406 ch = *(unsigned char *) addr; 346 ch = *(unsigned char *) addr;
407 asm volatile("oc 0(1,%1),0(%2)" 347 asm volatile(
408 : "=m" (*(char *) addr) 348 " oc 0(1,%1),0(%2)"
409 : "a" (addr), "a" (_oi_bitmap + (nr & 7)), 349 : "=m" (*(char *) addr)
410 "m" (*(char *) addr) : "cc", "memory" ); 350 : "a" (addr), "a" (_oi_bitmap + (nr & 7)),
351 "m" (*(char *) addr) : "cc", "memory");
411 return (ch >> (nr & 7)) & 1; 352 return (ch >> (nr & 7)) & 1;
412} 353}
413#define __test_and_set_bit(X,Y) test_and_set_bit_simple(X,Y) 354#define __test_and_set_bit(X,Y) test_and_set_bit_simple(X,Y)
@@ -423,10 +364,11 @@ test_and_clear_bit_simple(unsigned long nr, volatile unsigned long *ptr)
423 364
424 addr = (unsigned long) ptr + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3); 365 addr = (unsigned long) ptr + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3);
425 ch = *(unsigned char *) addr; 366 ch = *(unsigned char *) addr;
426 asm volatile("nc 0(1,%1),0(%2)" 367 asm volatile(
427 : "=m" (*(char *) addr) 368 " nc 0(1,%1),0(%2)"
428 : "a" (addr), "a" (_ni_bitmap + (nr & 7)), 369 : "=m" (*(char *) addr)
429 "m" (*(char *) addr) : "cc", "memory" ); 370 : "a" (addr), "a" (_ni_bitmap + (nr & 7)),
371 "m" (*(char *) addr) : "cc", "memory");
430 return (ch >> (nr & 7)) & 1; 372 return (ch >> (nr & 7)) & 1;
431} 373}
432#define __test_and_clear_bit(X,Y) test_and_clear_bit_simple(X,Y) 374#define __test_and_clear_bit(X,Y) test_and_clear_bit_simple(X,Y)
@@ -442,10 +384,11 @@ test_and_change_bit_simple(unsigned long nr, volatile unsigned long *ptr)
442 384
443 addr = (unsigned long) ptr + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3); 385 addr = (unsigned long) ptr + ((nr ^ (__BITOPS_WORDSIZE - 8)) >> 3);
444 ch = *(unsigned char *) addr; 386 ch = *(unsigned char *) addr;
445 asm volatile("xc 0(1,%1),0(%2)" 387 asm volatile(
446 : "=m" (*(char *) addr) 388 " xc 0(1,%1),0(%2)"
447 : "a" (addr), "a" (_oi_bitmap + (nr & 7)), 389 : "=m" (*(char *) addr)
448 "m" (*(char *) addr) : "cc", "memory" ); 390 : "a" (addr), "a" (_oi_bitmap + (nr & 7)),
391 "m" (*(char *) addr) : "cc", "memory");
449 return (ch >> (nr & 7)) & 1; 392 return (ch >> (nr & 7)) & 1;
450} 393}
451#define __test_and_change_bit(X,Y) test_and_change_bit_simple(X,Y) 394#define __test_and_change_bit(X,Y) test_and_change_bit_simple(X,Y)
@@ -557,35 +500,36 @@ find_first_zero_bit(const unsigned long * addr, unsigned long size)
557 500
558 if (!size) 501 if (!size)
559 return 0; 502 return 0;
560 __asm__(" lhi %1,-1\n" 503 asm volatile(
561 " lr %2,%3\n" 504 " lhi %1,-1\n"
562 " slr %0,%0\n" 505 " lr %2,%3\n"
563 " ahi %2,31\n" 506 " slr %0,%0\n"
564 " srl %2,5\n" 507 " ahi %2,31\n"
565 "0: c %1,0(%0,%4)\n" 508 " srl %2,5\n"
566 " jne 1f\n" 509 "0: c %1,0(%0,%4)\n"
567 " la %0,4(%0)\n" 510 " jne 1f\n"
568 " brct %2,0b\n" 511 " la %0,4(%0)\n"
569 " lr %0,%3\n" 512 " brct %2,0b\n"
570 " j 4f\n" 513 " lr %0,%3\n"
571 "1: l %2,0(%0,%4)\n" 514 " j 4f\n"
572 " sll %0,3\n" 515 "1: l %2,0(%0,%4)\n"
573 " lhi %1,0xff\n" 516 " sll %0,3\n"
574 " tml %2,0xffff\n" 517 " lhi %1,0xff\n"
575 " jno 2f\n" 518 " tml %2,0xffff\n"
576 " ahi %0,16\n" 519 " jno 2f\n"
577 " srl %2,16\n" 520 " ahi %0,16\n"
578 "2: tml %2,0x00ff\n" 521 " srl %2,16\n"
579 " jno 3f\n" 522 "2: tml %2,0x00ff\n"
580 " ahi %0,8\n" 523 " jno 3f\n"
581 " srl %2,8\n" 524 " ahi %0,8\n"
582 "3: nr %2,%1\n" 525 " srl %2,8\n"
583 " ic %2,0(%2,%5)\n" 526 "3: nr %2,%1\n"
584 " alr %0,%2\n" 527 " ic %2,0(%2,%5)\n"
585 "4:" 528 " alr %0,%2\n"
586 : "=&a" (res), "=&d" (cmp), "=&a" (count) 529 "4:"
587 : "a" (size), "a" (addr), "a" (&_zb_findmap), 530 : "=&a" (res), "=&d" (cmp), "=&a" (count)
588 "m" (*(addrtype *) addr) : "cc" ); 531 : "a" (size), "a" (addr), "a" (&_zb_findmap),
532 "m" (*(addrtype *) addr) : "cc");
589 return (res < size) ? res : size; 533 return (res < size) ? res : size;
590} 534}
591 535
@@ -598,35 +542,36 @@ find_first_bit(const unsigned long * addr, unsigned long size)
598 542
599 if (!size) 543 if (!size)
600 return 0; 544 return 0;
601 __asm__(" slr %1,%1\n" 545 asm volatile(
602 " lr %2,%3\n" 546 " slr %1,%1\n"
603 " slr %0,%0\n" 547 " lr %2,%3\n"
604 " ahi %2,31\n" 548 " slr %0,%0\n"
605 " srl %2,5\n" 549 " ahi %2,31\n"
606 "0: c %1,0(%0,%4)\n" 550 " srl %2,5\n"
607 " jne 1f\n" 551 "0: c %1,0(%0,%4)\n"
608 " la %0,4(%0)\n" 552 " jne 1f\n"
609 " brct %2,0b\n" 553 " la %0,4(%0)\n"
610 " lr %0,%3\n" 554 " brct %2,0b\n"
611 " j 4f\n" 555 " lr %0,%3\n"
612 "1: l %2,0(%0,%4)\n" 556 " j 4f\n"
613 " sll %0,3\n" 557 "1: l %2,0(%0,%4)\n"
614 " lhi %1,0xff\n" 558 " sll %0,3\n"
615 " tml %2,0xffff\n" 559 " lhi %1,0xff\n"
616 " jnz 2f\n" 560 " tml %2,0xffff\n"
617 " ahi %0,16\n" 561 " jnz 2f\n"
618 " srl %2,16\n" 562 " ahi %0,16\n"
619 "2: tml %2,0x00ff\n" 563 " srl %2,16\n"
620 " jnz 3f\n" 564 "2: tml %2,0x00ff\n"
621 " ahi %0,8\n" 565 " jnz 3f\n"
622 " srl %2,8\n" 566 " ahi %0,8\n"
623 "3: nr %2,%1\n" 567 " srl %2,8\n"
624 " ic %2,0(%2,%5)\n" 568 "3: nr %2,%1\n"
625 " alr %0,%2\n" 569 " ic %2,0(%2,%5)\n"
626 "4:" 570 " alr %0,%2\n"
627 : "=&a" (res), "=&d" (cmp), "=&a" (count) 571 "4:"
628 : "a" (size), "a" (addr), "a" (&_sb_findmap), 572 : "=&a" (res), "=&d" (cmp), "=&a" (count)
629 "m" (*(addrtype *) addr) : "cc" ); 573 : "a" (size), "a" (addr), "a" (&_sb_findmap),
574 "m" (*(addrtype *) addr) : "cc");
630 return (res < size) ? res : size; 575 return (res < size) ? res : size;
631} 576}
632 577
@@ -640,39 +585,40 @@ find_first_zero_bit(const unsigned long * addr, unsigned long size)
640 585
641 if (!size) 586 if (!size)
642 return 0; 587 return 0;
643 __asm__(" lghi %1,-1\n" 588 asm volatile(
644 " lgr %2,%3\n" 589 " lghi %1,-1\n"
645 " slgr %0,%0\n" 590 " lgr %2,%3\n"
646 " aghi %2,63\n" 591 " slgr %0,%0\n"
647 " srlg %2,%2,6\n" 592 " aghi %2,63\n"
648 "0: cg %1,0(%0,%4)\n" 593 " srlg %2,%2,6\n"
649 " jne 1f\n" 594 "0: cg %1,0(%0,%4)\n"
650 " la %0,8(%0)\n" 595 " jne 1f\n"
651 " brct %2,0b\n" 596 " la %0,8(%0)\n"
652 " lgr %0,%3\n" 597 " brct %2,0b\n"
653 " j 5f\n" 598 " lgr %0,%3\n"
654 "1: lg %2,0(%0,%4)\n" 599 " j 5f\n"
655 " sllg %0,%0,3\n" 600 "1: lg %2,0(%0,%4)\n"
656 " clr %2,%1\n" 601 " sllg %0,%0,3\n"
657 " jne 2f\n" 602 " clr %2,%1\n"
658 " aghi %0,32\n" 603 " jne 2f\n"
659 " srlg %2,%2,32\n" 604 " aghi %0,32\n"
660 "2: lghi %1,0xff\n" 605 " srlg %2,%2,32\n"
661 " tmll %2,0xffff\n" 606 "2: lghi %1,0xff\n"
662 " jno 3f\n" 607 " tmll %2,0xffff\n"
663 " aghi %0,16\n" 608 " jno 3f\n"
664 " srl %2,16\n" 609 " aghi %0,16\n"
665 "3: tmll %2,0x00ff\n" 610 " srl %2,16\n"
666 " jno 4f\n" 611 "3: tmll %2,0x00ff\n"
667 " aghi %0,8\n" 612 " jno 4f\n"
668 " srl %2,8\n" 613 " aghi %0,8\n"
669 "4: ngr %2,%1\n" 614 " srl %2,8\n"
670 " ic %2,0(%2,%5)\n" 615 "4: ngr %2,%1\n"
671 " algr %0,%2\n" 616 " ic %2,0(%2,%5)\n"
672 "5:" 617 " algr %0,%2\n"
673 : "=&a" (res), "=&d" (cmp), "=&a" (count) 618 "5:"
619 : "=&a" (res), "=&d" (cmp), "=&a" (count)
674 : "a" (size), "a" (addr), "a" (&_zb_findmap), 620 : "a" (size), "a" (addr), "a" (&_zb_findmap),
675 "m" (*(addrtype *) addr) : "cc" ); 621 "m" (*(addrtype *) addr) : "cc");
676 return (res < size) ? res : size; 622 return (res < size) ? res : size;
677} 623}
678 624
@@ -684,39 +630,40 @@ find_first_bit(const unsigned long * addr, unsigned long size)
684 630
685 if (!size) 631 if (!size)
686 return 0; 632 return 0;
687 __asm__(" slgr %1,%1\n" 633 asm volatile(
688 " lgr %2,%3\n" 634 " slgr %1,%1\n"
689 " slgr %0,%0\n" 635 " lgr %2,%3\n"
690 " aghi %2,63\n" 636 " slgr %0,%0\n"
691 " srlg %2,%2,6\n" 637 " aghi %2,63\n"
692 "0: cg %1,0(%0,%4)\n" 638 " srlg %2,%2,6\n"
693 " jne 1f\n" 639 "0: cg %1,0(%0,%4)\n"
694 " aghi %0,8\n" 640 " jne 1f\n"
695 " brct %2,0b\n" 641 " aghi %0,8\n"
696 " lgr %0,%3\n" 642 " brct %2,0b\n"
697 " j 5f\n" 643 " lgr %0,%3\n"
698 "1: lg %2,0(%0,%4)\n" 644 " j 5f\n"
699 " sllg %0,%0,3\n" 645 "1: lg %2,0(%0,%4)\n"
700 " clr %2,%1\n" 646 " sllg %0,%0,3\n"
701 " jne 2f\n" 647 " clr %2,%1\n"
702 " aghi %0,32\n" 648 " jne 2f\n"
703 " srlg %2,%2,32\n" 649 " aghi %0,32\n"
704 "2: lghi %1,0xff\n" 650 " srlg %2,%2,32\n"
705 " tmll %2,0xffff\n" 651 "2: lghi %1,0xff\n"
706 " jnz 3f\n" 652 " tmll %2,0xffff\n"
707 " aghi %0,16\n" 653 " jnz 3f\n"
708 " srl %2,16\n" 654 " aghi %0,16\n"
709 "3: tmll %2,0x00ff\n" 655 " srl %2,16\n"
710 " jnz 4f\n" 656 "3: tmll %2,0x00ff\n"
711 " aghi %0,8\n" 657 " jnz 4f\n"
712 " srl %2,8\n" 658 " aghi %0,8\n"
713 "4: ngr %2,%1\n" 659 " srl %2,8\n"
714 " ic %2,0(%2,%5)\n" 660 "4: ngr %2,%1\n"
715 " algr %0,%2\n" 661 " ic %2,0(%2,%5)\n"
716 "5:" 662 " algr %0,%2\n"
717 : "=&a" (res), "=&d" (cmp), "=&a" (count) 663 "5:"
664 : "=&a" (res), "=&d" (cmp), "=&a" (count)
718 : "a" (size), "a" (addr), "a" (&_sb_findmap), 665 : "a" (size), "a" (addr), "a" (&_sb_findmap),
719 "m" (*(addrtype *) addr) : "cc" ); 666 "m" (*(addrtype *) addr) : "cc");
720 return (res < size) ? res : size; 667 return (res < size) ? res : size;
721} 668}
722 669
@@ -832,36 +779,37 @@ ext2_find_first_zero_bit(void *vaddr, unsigned int size)
832 779
833 if (!size) 780 if (!size)
834 return 0; 781 return 0;
835 __asm__(" lhi %1,-1\n" 782 asm volatile(
836 " lr %2,%3\n" 783 " lhi %1,-1\n"
837 " ahi %2,31\n" 784 " lr %2,%3\n"
838 " srl %2,5\n" 785 " ahi %2,31\n"
839 " slr %0,%0\n" 786 " srl %2,5\n"
840 "0: cl %1,0(%0,%4)\n" 787 " slr %0,%0\n"
841 " jne 1f\n" 788 "0: cl %1,0(%0,%4)\n"
842 " ahi %0,4\n" 789 " jne 1f\n"
843 " brct %2,0b\n" 790 " ahi %0,4\n"
844 " lr %0,%3\n" 791 " brct %2,0b\n"
845 " j 4f\n" 792 " lr %0,%3\n"
846 "1: l %2,0(%0,%4)\n" 793 " j 4f\n"
847 " sll %0,3\n" 794 "1: l %2,0(%0,%4)\n"
848 " ahi %0,24\n" 795 " sll %0,3\n"
849 " lhi %1,0xff\n" 796 " ahi %0,24\n"
850 " tmh %2,0xffff\n" 797 " lhi %1,0xff\n"
851 " jo 2f\n" 798 " tmh %2,0xffff\n"
852 " ahi %0,-16\n" 799 " jo 2f\n"
853 " srl %2,16\n" 800 " ahi %0,-16\n"
854 "2: tml %2,0xff00\n" 801 " srl %2,16\n"
855 " jo 3f\n" 802 "2: tml %2,0xff00\n"
856 " ahi %0,-8\n" 803 " jo 3f\n"
857 " srl %2,8\n" 804 " ahi %0,-8\n"
858 "3: nr %2,%1\n" 805 " srl %2,8\n"
859 " ic %2,0(%2,%5)\n" 806 "3: nr %2,%1\n"
860 " alr %0,%2\n" 807 " ic %2,0(%2,%5)\n"
861 "4:" 808 " alr %0,%2\n"
862 : "=&a" (res), "=&d" (cmp), "=&a" (count) 809 "4:"
863 : "a" (size), "a" (vaddr), "a" (&_zb_findmap), 810 : "=&a" (res), "=&d" (cmp), "=&a" (count)
864 "m" (*(addrtype *) vaddr) : "cc" ); 811 : "a" (size), "a" (vaddr), "a" (&_zb_findmap),
812 "m" (*(addrtype *) vaddr) : "cc");
865 return (res < size) ? res : size; 813 return (res < size) ? res : size;
866} 814}
867 815
@@ -875,39 +823,40 @@ ext2_find_first_zero_bit(void *vaddr, unsigned long size)
875 823
876 if (!size) 824 if (!size)
877 return 0; 825 return 0;
878 __asm__(" lghi %1,-1\n" 826 asm volatile(
879 " lgr %2,%3\n" 827 " lghi %1,-1\n"
880 " aghi %2,63\n" 828 " lgr %2,%3\n"
881 " srlg %2,%2,6\n" 829 " aghi %2,63\n"
882 " slgr %0,%0\n" 830 " srlg %2,%2,6\n"
883 "0: clg %1,0(%0,%4)\n" 831 " slgr %0,%0\n"
884 " jne 1f\n" 832 "0: clg %1,0(%0,%4)\n"
885 " aghi %0,8\n" 833 " jne 1f\n"
886 " brct %2,0b\n" 834 " aghi %0,8\n"
887 " lgr %0,%3\n" 835 " brct %2,0b\n"
888 " j 5f\n" 836 " lgr %0,%3\n"
889 "1: cl %1,0(%0,%4)\n" 837 " j 5f\n"
890 " jne 2f\n" 838 "1: cl %1,0(%0,%4)\n"
891 " aghi %0,4\n" 839 " jne 2f\n"
892 "2: l %2,0(%0,%4)\n" 840 " aghi %0,4\n"
893 " sllg %0,%0,3\n" 841 "2: l %2,0(%0,%4)\n"
894 " aghi %0,24\n" 842 " sllg %0,%0,3\n"
895 " lghi %1,0xff\n" 843 " aghi %0,24\n"
896 " tmlh %2,0xffff\n" 844 " lghi %1,0xff\n"
897 " jo 3f\n" 845 " tmlh %2,0xffff\n"
898 " aghi %0,-16\n" 846 " jo 3f\n"
899 " srl %2,16\n" 847 " aghi %0,-16\n"
900 "3: tmll %2,0xff00\n" 848 " srl %2,16\n"
901 " jo 4f\n" 849 "3: tmll %2,0xff00\n"
902 " aghi %0,-8\n" 850 " jo 4f\n"
903 " srl %2,8\n" 851 " aghi %0,-8\n"
904 "4: ngr %2,%1\n" 852 " srl %2,8\n"
905 " ic %2,0(%2,%5)\n" 853 "4: ngr %2,%1\n"
906 " algr %0,%2\n" 854 " ic %2,0(%2,%5)\n"
907 "5:" 855 " algr %0,%2\n"
908 : "=&a" (res), "=&d" (cmp), "=&a" (count) 856 "5:"
857 : "=&a" (res), "=&d" (cmp), "=&a" (count)
909 : "a" (size), "a" (vaddr), "a" (&_zb_findmap), 858 : "a" (size), "a" (vaddr), "a" (&_zb_findmap),
910 "m" (*(addrtype *) vaddr) : "cc" ); 859 "m" (*(addrtype *) vaddr) : "cc");
911 return (res < size) ? res : size; 860 return (res < size) ? res : size;
912} 861}
913 862
@@ -927,13 +876,16 @@ ext2_find_next_zero_bit(void *vaddr, unsigned long size, unsigned long offset)
927 p = addr + offset / __BITOPS_WORDSIZE; 876 p = addr + offset / __BITOPS_WORDSIZE;
928 if (bit) { 877 if (bit) {
929#ifndef __s390x__ 878#ifndef __s390x__
930 asm(" ic %0,0(%1)\n" 879 asm volatile(
931 " icm %0,2,1(%1)\n" 880 " ic %0,0(%1)\n"
932 " icm %0,4,2(%1)\n" 881 " icm %0,2,1(%1)\n"
933 " icm %0,8,3(%1)" 882 " icm %0,4,2(%1)\n"
934 : "=&a" (word) : "a" (p), "m" (*p) : "cc" ); 883 " icm %0,8,3(%1)"
884 : "=&a" (word) : "a" (p), "m" (*p) : "cc");
935#else 885#else
936 asm(" lrvg %0,%1" : "=a" (word) : "m" (*p) ); 886 asm volatile(
887 " lrvg %0,%1"
888 : "=a" (word) : "m" (*p) );
937#endif 889#endif
938 /* 890 /*
939 * s390 version of ffz returns __BITOPS_WORDSIZE 891 * s390 version of ffz returns __BITOPS_WORDSIZE
diff --git a/include/asm-s390/byteorder.h b/include/asm-s390/byteorder.h
index 2cc35a0e188e..1fe2492baa8d 100644
--- a/include/asm-s390/byteorder.h
+++ b/include/asm-s390/byteorder.h
@@ -14,60 +14,54 @@
14#ifdef __GNUC__ 14#ifdef __GNUC__
15 15
16#ifdef __s390x__ 16#ifdef __s390x__
17static __inline__ __u64 ___arch__swab64p(const __u64 *x) 17static inline __u64 ___arch__swab64p(const __u64 *x)
18{ 18{
19 __u64 result; 19 __u64 result;
20 20
21 __asm__ __volatile__ ( 21 asm volatile("lrvg %0,%1" : "=d" (result) : "m" (*x));
22 " lrvg %0,%1"
23 : "=d" (result) : "m" (*x) );
24 return result; 22 return result;
25} 23}
26 24
27static __inline__ __u64 ___arch__swab64(__u64 x) 25static inline __u64 ___arch__swab64(__u64 x)
28{ 26{
29 __u64 result; 27 __u64 result;
30 28
31 __asm__ __volatile__ ( 29 asm volatile("lrvgr %0,%1" : "=d" (result) : "d" (x));
32 " lrvgr %0,%1"
33 : "=d" (result) : "d" (x) );
34 return result; 30 return result;
35} 31}
36 32
37static __inline__ void ___arch__swab64s(__u64 *x) 33static inline void ___arch__swab64s(__u64 *x)
38{ 34{
39 *x = ___arch__swab64p(x); 35 *x = ___arch__swab64p(x);
40} 36}
41#endif /* __s390x__ */ 37#endif /* __s390x__ */
42 38
43static __inline__ __u32 ___arch__swab32p(const __u32 *x) 39static inline __u32 ___arch__swab32p(const __u32 *x)
44{ 40{
45 __u32 result; 41 __u32 result;
46 42
47 __asm__ __volatile__ ( 43 asm volatile(
48#ifndef __s390x__ 44#ifndef __s390x__
49 " icm %0,8,3(%1)\n" 45 " icm %0,8,3(%1)\n"
50 " icm %0,4,2(%1)\n" 46 " icm %0,4,2(%1)\n"
51 " icm %0,2,1(%1)\n" 47 " icm %0,2,1(%1)\n"
52 " ic %0,0(%1)" 48 " ic %0,0(%1)"
53 : "=&d" (result) : "a" (x), "m" (*x) : "cc" ); 49 : "=&d" (result) : "a" (x), "m" (*x) : "cc");
54#else /* __s390x__ */ 50#else /* __s390x__ */
55 " lrv %0,%1" 51 " lrv %0,%1"
56 : "=d" (result) : "m" (*x) ); 52 : "=d" (result) : "m" (*x));
57#endif /* __s390x__ */ 53#endif /* __s390x__ */
58 return result; 54 return result;
59} 55}
60 56
61static __inline__ __u32 ___arch__swab32(__u32 x) 57static inline __u32 ___arch__swab32(__u32 x)
62{ 58{
63#ifndef __s390x__ 59#ifndef __s390x__
64 return ___arch__swab32p(&x); 60 return ___arch__swab32p(&x);
65#else /* __s390x__ */ 61#else /* __s390x__ */
66 __u32 result; 62 __u32 result;
67 63
68 __asm__ __volatile__ ( 64 asm volatile("lrvr %0,%1" : "=d" (result) : "d" (x));
69 " lrvr %0,%1"
70 : "=d" (result) : "d" (x) );
71 return result; 65 return result;
72#endif /* __s390x__ */ 66#endif /* __s390x__ */
73} 67}
@@ -81,14 +75,14 @@ static __inline__ __u16 ___arch__swab16p(const __u16 *x)
81{ 75{
82 __u16 result; 76 __u16 result;
83 77
84 __asm__ __volatile__ ( 78 asm volatile(
85#ifndef __s390x__ 79#ifndef __s390x__
86 " icm %0,2,1(%1)\n" 80 " icm %0,2,1(%1)\n"
87 " ic %0,0(%1)\n" 81 " ic %0,0(%1)\n"
88 : "=&d" (result) : "a" (x), "m" (*x) : "cc" ); 82 : "=&d" (result) : "a" (x), "m" (*x) : "cc");
89#else /* __s390x__ */ 83#else /* __s390x__ */
90 " lrvh %0,%1" 84 " lrvh %0,%1"
91 : "=d" (result) : "m" (*x) ); 85 : "=d" (result) : "m" (*x));
92#endif /* __s390x__ */ 86#endif /* __s390x__ */
93 return result; 87 return result;
94} 88}
diff --git a/include/asm-s390/checksum.h b/include/asm-s390/checksum.h
index 471f2af2b16a..37c362d89fad 100644
--- a/include/asm-s390/checksum.h
+++ b/include/asm-s390/checksum.h
@@ -30,57 +30,13 @@
30static inline unsigned int 30static inline unsigned int
31csum_partial(const unsigned char * buff, int len, unsigned int sum) 31csum_partial(const unsigned char * buff, int len, unsigned int sum)
32{ 32{
33 /* 33 register unsigned long reg2 asm("2") = (unsigned long) buff;
34 * Experiments with ethernet and slip connections show that buf 34 register unsigned long reg3 asm("3") = (unsigned long) len;
35 * is aligned on either a 2-byte or 4-byte boundary.
36 */
37#ifndef __s390x__
38 register_pair rp;
39
40 rp.subreg.even = (unsigned long) buff;
41 rp.subreg.odd = (unsigned long) len;
42 __asm__ __volatile__ (
43 "0: cksm %0,%1\n" /* do checksum on longs */
44 " jo 0b\n"
45 : "+&d" (sum), "+&a" (rp) : : "cc", "memory" );
46#else /* __s390x__ */
47 __asm__ __volatile__ (
48 " lgr 2,%1\n" /* address in gpr 2 */
49 " lgfr 3,%2\n" /* length in gpr 3 */
50 "0: cksm %0,2\n" /* do checksum on longs */
51 " jo 0b\n"
52 : "+&d" (sum)
53 : "d" (buff), "d" (len)
54 : "cc", "memory", "2", "3" );
55#endif /* __s390x__ */
56 return sum;
57}
58
59/*
60 * csum_partial as an inline function
61 */
62static inline unsigned int
63csum_partial_inline(const unsigned char * buff, int len, unsigned int sum)
64{
65#ifndef __s390x__
66 register_pair rp;
67 35
68 rp.subreg.even = (unsigned long) buff; 36 asm volatile(
69 rp.subreg.odd = (unsigned long) len; 37 "0: cksm %0,%1\n" /* do checksum on longs */
70 __asm__ __volatile__ ( 38 " jo 0b\n"
71 "0: cksm %0,%1\n" /* do checksum on longs */ 39 : "+d" (sum), "+d" (reg2), "+d" (reg3) : : "cc", "memory");
72 " jo 0b\n"
73 : "+&d" (sum), "+&a" (rp) : : "cc", "memory" );
74#else /* __s390x__ */
75 __asm__ __volatile__ (
76 " lgr 2,%1\n" /* address in gpr 2 */
77 " lgfr 3,%2\n" /* length in gpr 3 */
78 "0: cksm %0,2\n" /* do checksum on longs */
79 " jo 0b\n"
80 : "+&d" (sum)
81 : "d" (buff), "d" (len)
82 : "cc", "memory", "2", "3" );
83#endif /* __s390x__ */
84 return sum; 40 return sum;
85} 41}
86 42
@@ -114,7 +70,7 @@ static inline unsigned int
114csum_partial_copy_nocheck (const char *src, char *dst, int len, unsigned int sum) 70csum_partial_copy_nocheck (const char *src, char *dst, int len, unsigned int sum)
115{ 71{
116 memcpy(dst,src,len); 72 memcpy(dst,src,len);
117 return csum_partial_inline(dst, len, sum); 73 return csum_partial(dst, len, sum);
118} 74}
119 75
120/* 76/*
@@ -126,22 +82,22 @@ csum_fold(unsigned int sum)
126#ifndef __s390x__ 82#ifndef __s390x__
127 register_pair rp; 83 register_pair rp;
128 84
129 __asm__ __volatile__ ( 85 asm volatile(
130 " slr %N1,%N1\n" /* %0 = H L */ 86 " slr %N1,%N1\n" /* %0 = H L */
131 " lr %1,%0\n" /* %0 = H L, %1 = H L 0 0 */ 87 " lr %1,%0\n" /* %0 = H L, %1 = H L 0 0 */
132 " srdl %1,16\n" /* %0 = H L, %1 = 0 H L 0 */ 88 " srdl %1,16\n" /* %0 = H L, %1 = 0 H L 0 */
133 " alr %1,%N1\n" /* %0 = H L, %1 = L H L 0 */ 89 " alr %1,%N1\n" /* %0 = H L, %1 = L H L 0 */
134 " alr %0,%1\n" /* %0 = H+L+C L+H */ 90 " alr %0,%1\n" /* %0 = H+L+C L+H */
135 " srl %0,16\n" /* %0 = H+L+C */ 91 " srl %0,16\n" /* %0 = H+L+C */
136 : "+&d" (sum), "=d" (rp) : : "cc" ); 92 : "+&d" (sum), "=d" (rp) : : "cc");
137#else /* __s390x__ */ 93#else /* __s390x__ */
138 __asm__ __volatile__ ( 94 asm volatile(
139 " sr 3,3\n" /* %0 = H*65536 + L */ 95 " sr 3,3\n" /* %0 = H*65536 + L */
140 " lr 2,%0\n" /* %0 = H L, R2/R3 = H L / 0 0 */ 96 " lr 2,%0\n" /* %0 = H L, 2/3 = H L / 0 0 */
141 " srdl 2,16\n" /* %0 = H L, R2/R3 = 0 H / L 0 */ 97 " srdl 2,16\n" /* %0 = H L, 2/3 = 0 H / L 0 */
142 " alr 2,3\n" /* %0 = H L, R2/R3 = L H / L 0 */ 98 " alr 2,3\n" /* %0 = H L, 2/3 = L H / L 0 */
143 " alr %0,2\n" /* %0 = H+L+C L+H */ 99 " alr %0,2\n" /* %0 = H+L+C L+H */
144 " srl %0,16\n" /* %0 = H+L+C */ 100 " srl %0,16\n" /* %0 = H+L+C */
145 : "+&d" (sum) : : "cc", "2", "3"); 101 : "+&d" (sum) : : "cc", "2", "3");
146#endif /* __s390x__ */ 102#endif /* __s390x__ */
147 return ((unsigned short) ~sum); 103 return ((unsigned short) ~sum);
@@ -155,29 +111,7 @@ csum_fold(unsigned int sum)
155static inline unsigned short 111static inline unsigned short
156ip_fast_csum(unsigned char *iph, unsigned int ihl) 112ip_fast_csum(unsigned char *iph, unsigned int ihl)
157{ 113{
158 unsigned long sum; 114 return csum_fold(csum_partial(iph, ihl*4, 0));
159#ifndef __s390x__
160 register_pair rp;
161
162 rp.subreg.even = (unsigned long) iph;
163 rp.subreg.odd = (unsigned long) ihl*4;
164 __asm__ __volatile__ (
165 " sr %0,%0\n" /* set sum to zero */
166 "0: cksm %0,%1\n" /* do checksum on longs */
167 " jo 0b\n"
168 : "=&d" (sum), "+&a" (rp) : : "cc", "memory" );
169#else /* __s390x__ */
170 __asm__ __volatile__ (
171 " slgr %0,%0\n" /* set sum to zero */
172 " lgr 2,%1\n" /* address in gpr 2 */
173 " lgfr 3,%2\n" /* length in gpr 3 */
174 "0: cksm %0,2\n" /* do checksum on ints */
175 " jo 0b\n"
176 : "=&d" (sum)
177 : "d" (iph), "d" (ihl*4)
178 : "cc", "memory", "2", "3" );
179#endif /* __s390x__ */
180 return csum_fold(sum);
181} 115}
182 116
183/* 117/*
@@ -190,47 +124,47 @@ csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr,
190 unsigned int sum) 124 unsigned int sum)
191{ 125{
192#ifndef __s390x__ 126#ifndef __s390x__
193 __asm__ __volatile__ ( 127 asm volatile(
194 " alr %0,%1\n" /* sum += saddr */ 128 " alr %0,%1\n" /* sum += saddr */
195 " brc 12,0f\n" 129 " brc 12,0f\n"
196 " ahi %0,1\n" /* add carry */ 130 " ahi %0,1\n" /* add carry */
197 "0:" 131 "0:"
198 : "+&d" (sum) : "d" (saddr) : "cc" ); 132 : "+&d" (sum) : "d" (saddr) : "cc");
199 __asm__ __volatile__ ( 133 asm volatile(
200 " alr %0,%1\n" /* sum += daddr */ 134 " alr %0,%1\n" /* sum += daddr */
201 " brc 12,1f\n" 135 " brc 12,1f\n"
202 " ahi %0,1\n" /* add carry */ 136 " ahi %0,1\n" /* add carry */
203 "1:" 137 "1:"
204 : "+&d" (sum) : "d" (daddr) : "cc" ); 138 : "+&d" (sum) : "d" (daddr) : "cc");
205 __asm__ __volatile__ ( 139 asm volatile(
206 " alr %0,%1\n" /* sum += (len<<16) + (proto<<8) */ 140 " alr %0,%1\n" /* sum += (len<<16) + (proto<<8) */
207 " brc 12,2f\n" 141 " brc 12,2f\n"
208 " ahi %0,1\n" /* add carry */ 142 " ahi %0,1\n" /* add carry */
209 "2:" 143 "2:"
210 : "+&d" (sum) 144 : "+&d" (sum)
211 : "d" (((unsigned int) len<<16) + (unsigned int) proto) 145 : "d" (((unsigned int) len<<16) + (unsigned int) proto)
212 : "cc" ); 146 : "cc");
213#else /* __s390x__ */ 147#else /* __s390x__ */
214 __asm__ __volatile__ ( 148 asm volatile(
215 " lgfr %0,%0\n" 149 " lgfr %0,%0\n"
216 " algr %0,%1\n" /* sum += saddr */ 150 " algr %0,%1\n" /* sum += saddr */
217 " brc 12,0f\n" 151 " brc 12,0f\n"
218 " aghi %0,1\n" /* add carry */ 152 " aghi %0,1\n" /* add carry */
219 "0: algr %0,%2\n" /* sum += daddr */ 153 "0: algr %0,%2\n" /* sum += daddr */
220 " brc 12,1f\n" 154 " brc 12,1f\n"
221 " aghi %0,1\n" /* add carry */ 155 " aghi %0,1\n" /* add carry */
222 "1: algfr %0,%3\n" /* sum += (len<<16) + proto */ 156 "1: algfr %0,%3\n" /* sum += (len<<16) + proto */
223 " brc 12,2f\n" 157 " brc 12,2f\n"
224 " aghi %0,1\n" /* add carry */ 158 " aghi %0,1\n" /* add carry */
225 "2: srlg 0,%0,32\n" 159 "2: srlg 0,%0,32\n"
226 " alr %0,0\n" /* fold to 32 bits */ 160 " alr %0,0\n" /* fold to 32 bits */
227 " brc 12,3f\n" 161 " brc 12,3f\n"
228 " ahi %0,1\n" /* add carry */ 162 " ahi %0,1\n" /* add carry */
229 "3: llgfr %0,%0" 163 "3: llgfr %0,%0"
230 : "+&d" (sum) 164 : "+&d" (sum)
231 : "d" (saddr), "d" (daddr), 165 : "d" (saddr), "d" (daddr),
232 "d" (((unsigned int) len<<16) + (unsigned int) proto) 166 "d" (((unsigned int) len<<16) + (unsigned int) proto)
233 : "cc", "0" ); 167 : "cc", "0");
234#endif /* __s390x__ */ 168#endif /* __s390x__ */
235 return sum; 169 return sum;
236} 170}
diff --git a/include/asm-s390/div64.h b/include/asm-s390/div64.h
index af098dc3cf59..6cd978cefb28 100644
--- a/include/asm-s390/div64.h
+++ b/include/asm-s390/div64.h
@@ -1,49 +1 @@
1#ifndef __S390_DIV64
2#define __S390_DIV64
3
4#ifndef __s390x__
5
6/* for do_div "base" needs to be smaller than 2^31-1 */
7#define do_div(n, base) ({ \
8 unsigned long long __n = (n); \
9 unsigned long __r; \
10 \
11 asm (" slr 0,0\n" \
12 " l 1,%1\n" \
13 " srdl 0,1\n" \
14 " dr 0,%2\n" \
15 " alr 1,1\n" \
16 " alr 0,0\n" \
17 " lhi 2,1\n" \
18 " n 2,%1\n" \
19 " alr 0,2\n" \
20 " clr 0,%2\n" \
21 " jl 0f\n" \
22 " slr 0,%2\n" \
23 " ahi 1,1\n" \
24 "0: st 1,%1\n" \
25 " l 1,4+%1\n" \
26 " srdl 0,1\n" \
27 " dr 0,%2\n" \
28 " alr 1,1\n" \
29 " alr 0,0\n" \
30 " lhi 2,1\n" \
31 " n 2,4+%1\n" \
32 " alr 0,2\n" \
33 " clr 0,%2\n" \
34 " jl 1f\n" \
35 " slr 0,%2\n" \
36 " ahi 1,1\n" \
37 "1: st 1,4+%1\n" \
38 " lr %0,0" \
39 : "=d" (__r), "=m" (__n) \
40 : "d" (base), "m" (__n) : "0", "1", "2", "cc" ); \
41 (n) = (__n); \
42 __r; \
43})
44
45#else /* __s390x__ */
46#include <asm-generic/div64.h> #include <asm-generic/div64.h>
47#endif /* __s390x__ */
48
49#endif
diff --git a/include/asm-s390/ebcdic.h b/include/asm-s390/ebcdic.h
index 15fd2eda6c90..7f6f641d32f4 100644
--- a/include/asm-s390/ebcdic.h
+++ b/include/asm-s390/ebcdic.h
@@ -26,16 +26,16 @@ codepage_convert(const __u8 *codepage, volatile __u8 * addr, unsigned long nr)
26{ 26{
27 if (nr-- <= 0) 27 if (nr-- <= 0)
28 return; 28 return;
29 __asm__ __volatile__( 29 asm volatile(
30 " bras 1,1f\n" 30 " bras 1,1f\n"
31 " tr 0(1,%0),0(%2)\n" 31 " tr 0(1,%0),0(%2)\n"
32 "0: tr 0(256,%0),0(%2)\n" 32 "0: tr 0(256,%0),0(%2)\n"
33 " la %0,256(%0)\n" 33 " la %0,256(%0)\n"
34 "1: ahi %1,-256\n" 34 "1: ahi %1,-256\n"
35 " jnm 0b\n" 35 " jnm 0b\n"
36 " ex %1,0(1)" 36 " ex %1,0(1)"
37 : "+&a" (addr), "+&a" (nr) 37 : "+&a" (addr), "+&a" (nr)
38 : "a" (codepage) : "cc", "memory", "1" ); 38 : "a" (codepage) : "cc", "memory", "1");
39} 39}
40 40
41#define ASCEBC(addr,nr) codepage_convert(_ascebc, addr, nr) 41#define ASCEBC(addr,nr) codepage_convert(_ascebc, addr, nr)
diff --git a/include/asm-s390/io.h b/include/asm-s390/io.h
index a6cc27e77007..63c78b9399c4 100644
--- a/include/asm-s390/io.h
+++ b/include/asm-s390/io.h
@@ -27,18 +27,16 @@
27static inline unsigned long virt_to_phys(volatile void * address) 27static inline unsigned long virt_to_phys(volatile void * address)
28{ 28{
29 unsigned long real_address; 29 unsigned long real_address;
30 __asm__ ( 30 asm volatile(
31#ifndef __s390x__ 31#ifndef __s390x__
32 " lra %0,0(%1)\n" 32 " lra %0,0(%1)\n"
33 " jz 0f\n"
34 " sr %0,%0\n"
35#else /* __s390x__ */ 33#else /* __s390x__ */
36 " lrag %0,0(%1)\n" 34 " lrag %0,0(%1)\n"
37 " jz 0f\n"
38 " slgr %0,%0\n"
39#endif /* __s390x__ */ 35#endif /* __s390x__ */
36 " jz 0f\n"
37 " la %0,0\n"
40 "0:" 38 "0:"
41 : "=a" (real_address) : "a" (address) : "cc" ); 39 : "=a" (real_address) : "a" (address) : "cc");
42 return real_address; 40 return real_address;
43} 41}
44 42
diff --git a/include/asm-s390/irq.h b/include/asm-s390/irq.h
index bd1a721f7aa2..7da991a858f8 100644
--- a/include/asm-s390/irq.h
+++ b/include/asm-s390/irq.h
@@ -19,8 +19,5 @@ enum interruption_class {
19 NR_IRQS, 19 NR_IRQS,
20}; 20};
21 21
22#define touch_nmi_watchdog() do { } while(0)
23
24#endif /* __KERNEL__ */ 22#endif /* __KERNEL__ */
25#endif 23#endif
26
diff --git a/include/asm-s390/irqflags.h b/include/asm-s390/irqflags.h
index 3b566a5b3cc7..3f26131120b7 100644
--- a/include/asm-s390/irqflags.h
+++ b/include/asm-s390/irqflags.h
@@ -10,43 +10,93 @@
10 10
11#ifdef __KERNEL__ 11#ifdef __KERNEL__
12 12
13#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)
14
15/* store then or system mask. */
16#define __raw_local_irq_stosm(__or) \
17({ \
18 unsigned long __mask; \
19 asm volatile( \
20 " stosm %0,%1" \
21 : "=Q" (__mask) : "i" (__or) : "memory"); \
22 __mask; \
23})
24
25/* store then and system mask. */
26#define __raw_local_irq_stnsm(__and) \
27({ \
28 unsigned long __mask; \
29 asm volatile( \
30 " stnsm %0,%1" \
31 : "=Q" (__mask) : "i" (__and) : "memory"); \
32 __mask; \
33})
34
35/* set system mask. */
36#define __raw_local_irq_ssm(__mask) \
37({ \
38 asm volatile("ssm %0" : : "Q" (__mask) : "memory"); \
39})
40
41#else /* __GNUC__ */
42
43/* store then or system mask. */
44#define __raw_local_irq_stosm(__or) \
45({ \
46 unsigned long __mask; \
47 asm volatile( \
48 " stosm 0(%1),%2" \
49 : "=m" (__mask) \
50 : "a" (&__mask), "i" (__or) : "memory"); \
51 __mask; \
52})
53
54/* store then and system mask. */
55#define __raw_local_irq_stnsm(__and) \
56({ \
57 unsigned long __mask; \
58 asm volatile( \
59 " stnsm 0(%1),%2" \
60 : "=m" (__mask) \
61 : "a" (&__mask), "i" (__and) : "memory"); \
62 __mask; \
63})
64
65/* set system mask. */
66#define __raw_local_irq_ssm(__mask) \
67({ \
68 asm volatile( \
69 " ssm 0(%0)" \
70 : : "a" (&__mask), "m" (__mask) : "memory"); \
71})
72
73#endif /* __GNUC__ */
74
13/* interrupt control.. */ 75/* interrupt control.. */
14#define raw_local_irq_enable() ({ \ 76static inline unsigned long raw_local_irq_enable(void)
15 unsigned long __dummy; \ 77{
16 __asm__ __volatile__ ( \ 78 return __raw_local_irq_stosm(0x03);
17 "stosm 0(%1),0x03" \ 79}
18 : "=m" (__dummy) : "a" (&__dummy) : "memory" ); \
19 })
20
21#define raw_local_irq_disable() ({ \
22 unsigned long __flags; \
23 __asm__ __volatile__ ( \
24 "stnsm 0(%1),0xfc" : "=m" (__flags) : "a" (&__flags) ); \
25 __flags; \
26 })
27
28#define raw_local_save_flags(x) \
29do { \
30 typecheck(unsigned long, x); \
31 __asm__ __volatile__("stosm 0(%1),0" : "=m" (x) : "a" (&x), "m" (x) ); \
32} while (0)
33 80
34#define raw_local_irq_restore(x) \ 81static inline unsigned long raw_local_irq_disable(void)
35do { \ 82{
36 typecheck(unsigned long, x); \ 83 return __raw_local_irq_stnsm(0xfc);
37 __asm__ __volatile__("ssm 0(%0)" : : "a" (&x), "m" (x) : "memory"); \ 84}
85
86#define raw_local_save_flags(x) \
87do { \
88 typecheck(unsigned long, x); \
89 (x) = __raw_local_irq_stosm(0x00); \
38} while (0) 90} while (0)
39 91
40#define raw_irqs_disabled() \ 92static inline void raw_local_irq_restore(unsigned long flags)
41({ \ 93{
42 unsigned long flags; \ 94 __raw_local_irq_ssm(flags);
43 raw_local_save_flags(flags); \ 95}
44 !((flags >> __FLAG_SHIFT) & 3); \
45})
46 96
47static inline int raw_irqs_disabled_flags(unsigned long flags) 97static inline int raw_irqs_disabled_flags(unsigned long flags)
48{ 98{
49 return !((flags >> __FLAG_SHIFT) & 3); 99 return !(flags & (3UL << (BITS_PER_LONG - 8)));
50} 100}
51 101
52/* For spinlocks etc */ 102/* For spinlocks etc */
diff --git a/include/asm-s390/lowcore.h b/include/asm-s390/lowcore.h
index 18695d10dedf..06583ed0bde7 100644
--- a/include/asm-s390/lowcore.h
+++ b/include/asm-s390/lowcore.h
@@ -359,7 +359,7 @@ extern struct _lowcore *lowcore_ptr[];
359 359
360static inline void set_prefix(__u32 address) 360static inline void set_prefix(__u32 address)
361{ 361{
362 __asm__ __volatile__ ("spx %0" : : "m" (address) : "memory" ); 362 asm volatile("spx %0" : : "m" (address) : "memory");
363} 363}
364 364
365#define __PANIC_MAGIC 0xDEADC0DE 365#define __PANIC_MAGIC 0xDEADC0DE
diff --git a/include/asm-s390/page.h b/include/asm-s390/page.h
index b2628dc5c490..796c400f2b79 100644
--- a/include/asm-s390/page.h
+++ b/include/asm-s390/page.h
@@ -22,89 +22,45 @@
22#include <asm/setup.h> 22#include <asm/setup.h>
23#ifndef __ASSEMBLY__ 23#ifndef __ASSEMBLY__
24 24
25#ifndef __s390x__
26
27static inline void clear_page(void *page)
28{
29 register_pair rp;
30
31 rp.subreg.even = (unsigned long) page;
32 rp.subreg.odd = (unsigned long) 4096;
33 asm volatile (" slr 1,1\n"
34 " mvcl %0,0"
35 : "+&a" (rp) : : "memory", "cc", "1" );
36}
37
38static inline void copy_page(void *to, void *from)
39{
40 if (MACHINE_HAS_MVPG)
41 asm volatile (" sr 0,0\n"
42 " mvpg %0,%1"
43 : : "a" ((void *)(to)), "a" ((void *)(from))
44 : "memory", "cc", "0" );
45 else
46 asm volatile (" mvc 0(256,%0),0(%1)\n"
47 " mvc 256(256,%0),256(%1)\n"
48 " mvc 512(256,%0),512(%1)\n"
49 " mvc 768(256,%0),768(%1)\n"
50 " mvc 1024(256,%0),1024(%1)\n"
51 " mvc 1280(256,%0),1280(%1)\n"
52 " mvc 1536(256,%0),1536(%1)\n"
53 " mvc 1792(256,%0),1792(%1)\n"
54 " mvc 2048(256,%0),2048(%1)\n"
55 " mvc 2304(256,%0),2304(%1)\n"
56 " mvc 2560(256,%0),2560(%1)\n"
57 " mvc 2816(256,%0),2816(%1)\n"
58 " mvc 3072(256,%0),3072(%1)\n"
59 " mvc 3328(256,%0),3328(%1)\n"
60 " mvc 3584(256,%0),3584(%1)\n"
61 " mvc 3840(256,%0),3840(%1)\n"
62 : : "a"((void *)(to)),"a"((void *)(from))
63 : "memory" );
64}
65
66#else /* __s390x__ */
67
68static inline void clear_page(void *page) 25static inline void clear_page(void *page)
69{ 26{
70 asm volatile (" lgr 2,%0\n" 27 register unsigned long reg1 asm ("1") = 0;
71 " lghi 3,4096\n" 28 register void *reg2 asm ("2") = page;
72 " slgr 1,1\n" 29 register unsigned long reg3 asm ("3") = 4096;
73 " mvcl 2,0" 30 asm volatile(
74 : : "a" ((void *) (page)) 31 " mvcl 2,0"
75 : "memory", "cc", "1", "2", "3" ); 32 : "+d" (reg2), "+d" (reg3) : "d" (reg1) : "memory", "cc");
76} 33}
77 34
78static inline void copy_page(void *to, void *from) 35static inline void copy_page(void *to, void *from)
79{ 36{
80 if (MACHINE_HAS_MVPG) 37 if (MACHINE_HAS_MVPG) {
81 asm volatile (" sgr 0,0\n" 38 register unsigned long reg0 asm ("0") = 0;
82 " mvpg %0,%1" 39 asm volatile(
83 : : "a" ((void *)(to)), "a" ((void *)(from)) 40 " mvpg %0,%1"
84 : "memory", "cc", "0" ); 41 : : "a" (to), "a" (from), "d" (reg0)
85 else 42 : "memory", "cc");
86 asm volatile (" mvc 0(256,%0),0(%1)\n" 43 } else
87 " mvc 256(256,%0),256(%1)\n" 44 asm volatile(
88 " mvc 512(256,%0),512(%1)\n" 45 " mvc 0(256,%0),0(%1)\n"
89 " mvc 768(256,%0),768(%1)\n" 46 " mvc 256(256,%0),256(%1)\n"
90 " mvc 1024(256,%0),1024(%1)\n" 47 " mvc 512(256,%0),512(%1)\n"
91 " mvc 1280(256,%0),1280(%1)\n" 48 " mvc 768(256,%0),768(%1)\n"
92 " mvc 1536(256,%0),1536(%1)\n" 49 " mvc 1024(256,%0),1024(%1)\n"
93 " mvc 1792(256,%0),1792(%1)\n" 50 " mvc 1280(256,%0),1280(%1)\n"
94 " mvc 2048(256,%0),2048(%1)\n" 51 " mvc 1536(256,%0),1536(%1)\n"
95 " mvc 2304(256,%0),2304(%1)\n" 52 " mvc 1792(256,%0),1792(%1)\n"
96 " mvc 2560(256,%0),2560(%1)\n" 53 " mvc 2048(256,%0),2048(%1)\n"
97 " mvc 2816(256,%0),2816(%1)\n" 54 " mvc 2304(256,%0),2304(%1)\n"
98 " mvc 3072(256,%0),3072(%1)\n" 55 " mvc 2560(256,%0),2560(%1)\n"
99 " mvc 3328(256,%0),3328(%1)\n" 56 " mvc 2816(256,%0),2816(%1)\n"
100 " mvc 3584(256,%0),3584(%1)\n" 57 " mvc 3072(256,%0),3072(%1)\n"
101 " mvc 3840(256,%0),3840(%1)\n" 58 " mvc 3328(256,%0),3328(%1)\n"
102 : : "a"((void *)(to)),"a"((void *)(from)) 59 " mvc 3584(256,%0),3584(%1)\n"
103 : "memory" ); 60 " mvc 3840(256,%0),3840(%1)\n"
61 : : "a" (to), "a" (from) : "memory");
104} 62}
105 63
106#endif /* __s390x__ */
107
108#define clear_user_page(page, vaddr, pg) clear_page(page) 64#define clear_user_page(page, vaddr, pg) clear_page(page)
109#define copy_user_page(to, from, vaddr, pg) copy_page(to, from) 65#define copy_user_page(to, from, vaddr, pg) copy_page(to, from)
110 66
@@ -159,7 +115,7 @@ extern unsigned int default_storage_key;
159static inline void 115static inline void
160page_set_storage_key(unsigned long addr, unsigned int skey) 116page_set_storage_key(unsigned long addr, unsigned int skey)
161{ 117{
162 asm volatile ( "sske %0,%1" : : "d" (skey), "a" (addr) ); 118 asm volatile("sske %0,%1" : : "d" (skey), "a" (addr));
163} 119}
164 120
165static inline unsigned int 121static inline unsigned int
@@ -167,8 +123,7 @@ page_get_storage_key(unsigned long addr)
167{ 123{
168 unsigned int skey; 124 unsigned int skey;
169 125
170 asm volatile ( "iske %0,%1" : "=d" (skey) : "a" (addr), "0" (0) ); 126 asm volatile("iske %0,%1" : "=d" (skey) : "a" (addr), "0" (0));
171
172 return skey; 127 return skey;
173} 128}
174 129
diff --git a/include/asm-s390/pgtable.h b/include/asm-s390/pgtable.h
index e965309fedac..ecdff13b2505 100644
--- a/include/asm-s390/pgtable.h
+++ b/include/asm-s390/pgtable.h
@@ -31,9 +31,9 @@
31 * the S390 page table tree. 31 * the S390 page table tree.
32 */ 32 */
33#ifndef __ASSEMBLY__ 33#ifndef __ASSEMBLY__
34#include <linux/mm_types.h>
34#include <asm/bug.h> 35#include <asm/bug.h>
35#include <asm/processor.h> 36#include <asm/processor.h>
36#include <linux/threads.h>
37 37
38struct vm_area_struct; /* forward declaration (include/linux/mm.h) */ 38struct vm_area_struct; /* forward declaration (include/linux/mm.h) */
39struct mm_struct; 39struct mm_struct;
@@ -554,9 +554,10 @@ static inline void __ptep_ipte(unsigned long address, pte_t *ptep)
554 /* ipte in zarch mode can do the math */ 554 /* ipte in zarch mode can do the math */
555 pte_t *pto = ptep; 555 pte_t *pto = ptep;
556#endif 556#endif
557 asm volatile ("ipte %2,%3" 557 asm volatile(
558 : "=m" (*ptep) : "m" (*ptep), 558 " ipte %2,%3"
559 "a" (pto), "a" (address) ); 559 : "=m" (*ptep) : "m" (*ptep),
560 "a" (pto), "a" (address));
560 } 561 }
561 pte_val(*ptep) = _PAGE_TYPE_EMPTY; 562 pte_val(*ptep) = _PAGE_TYPE_EMPTY;
562} 563}
@@ -596,30 +597,31 @@ ptep_establish(struct vm_area_struct *vma,
596 * should therefore only be called if it is not mapped in any 597 * should therefore only be called if it is not mapped in any
597 * address space. 598 * address space.
598 */ 599 */
599#define page_test_and_clear_dirty(_page) \ 600static inline int page_test_and_clear_dirty(struct page *page)
600({ \ 601{
601 struct page *__page = (_page); \ 602 unsigned long physpage = __pa((page - mem_map) << PAGE_SHIFT);
602 unsigned long __physpage = __pa((__page-mem_map) << PAGE_SHIFT); \ 603 int skey = page_get_storage_key(physpage);
603 int __skey = page_get_storage_key(__physpage); \ 604
604 if (__skey & _PAGE_CHANGED) \ 605 if (skey & _PAGE_CHANGED)
605 page_set_storage_key(__physpage, __skey & ~_PAGE_CHANGED);\ 606 page_set_storage_key(physpage, skey & ~_PAGE_CHANGED);
606 (__skey & _PAGE_CHANGED); \ 607 return skey & _PAGE_CHANGED;
607}) 608}
608 609
609/* 610/*
610 * Test and clear referenced bit in storage key. 611 * Test and clear referenced bit in storage key.
611 */ 612 */
612#define page_test_and_clear_young(page) \ 613static inline int page_test_and_clear_young(struct page *page)
613({ \ 614{
614 struct page *__page = (page); \ 615 unsigned long physpage = __pa((page - mem_map) << PAGE_SHIFT);
615 unsigned long __physpage = __pa((__page-mem_map) << PAGE_SHIFT); \ 616 int ccode;
616 int __ccode; \ 617
617 asm volatile ("rrbe 0,%1\n\t" \ 618 asm volatile (
618 "ipm %0\n\t" \ 619 "rrbe 0,%1\n"
619 "srl %0,28\n\t" \ 620 "ipm %0\n"
620 : "=d" (__ccode) : "a" (__physpage) : "cc" ); \ 621 "srl %0,28\n"
621 (__ccode & 2); \ 622 : "=d" (ccode) : "a" (physpage) : "cc" );
622}) 623 return ccode & 2;
624}
623 625
624/* 626/*
625 * Conversion functions: convert a page and protection to a page entry, 627 * Conversion functions: convert a page and protection to a page entry,
@@ -632,32 +634,28 @@ static inline pte_t mk_pte_phys(unsigned long physpage, pgprot_t pgprot)
632 return __pte; 634 return __pte;
633} 635}
634 636
635#define mk_pte(pg, pgprot) \ 637static inline pte_t mk_pte(struct page *page, pgprot_t pgprot)
636({ \ 638{
637 struct page *__page = (pg); \ 639 unsigned long physpage = __pa((page - mem_map) << PAGE_SHIFT);
638 pgprot_t __pgprot = (pgprot); \
639 unsigned long __physpage = __pa((__page-mem_map) << PAGE_SHIFT); \
640 pte_t __pte = mk_pte_phys(__physpage, __pgprot); \
641 __pte; \
642})
643 640
644#define pfn_pte(pfn, pgprot) \ 641 return mk_pte_phys(physpage, pgprot);
645({ \ 642}
646 pgprot_t __pgprot = (pgprot); \ 643
647 unsigned long __physpage = __pa((pfn) << PAGE_SHIFT); \ 644static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot)
648 pte_t __pte = mk_pte_phys(__physpage, __pgprot); \ 645{
649 __pte; \ 646 unsigned long physpage = __pa((pfn) << PAGE_SHIFT);
650}) 647
648 return mk_pte_phys(physpage, pgprot);
649}
651 650
652#ifdef __s390x__ 651#ifdef __s390x__
653 652
654#define pfn_pmd(pfn, pgprot) \ 653static inline pmd_t pfn_pmd(unsigned long pfn, pgprot_t pgprot)
655({ \ 654{
656 pgprot_t __pgprot = (pgprot); \ 655 unsigned long physpage = __pa((pfn) << PAGE_SHIFT);
657 unsigned long __physpage = __pa((pfn) << PAGE_SHIFT); \ 656
658 pmd_t __pmd = __pmd(__physpage + pgprot_val(__pgprot)); \ 657 return __pmd(physpage + pgprot_val(pgprot));
659 __pmd; \ 658}
660})
661 659
662#endif /* __s390x__ */ 660#endif /* __s390x__ */
663 661
diff --git a/include/asm-s390/processor.h b/include/asm-s390/processor.h
index 578c2209fa76..cbbedc63ba25 100644
--- a/include/asm-s390/processor.h
+++ b/include/asm-s390/processor.h
@@ -13,7 +13,6 @@
13#ifndef __ASM_S390_PROCESSOR_H 13#ifndef __ASM_S390_PROCESSOR_H
14#define __ASM_S390_PROCESSOR_H 14#define __ASM_S390_PROCESSOR_H
15 15
16#include <asm/page.h>
17#include <asm/ptrace.h> 16#include <asm/ptrace.h>
18 17
19#ifdef __KERNEL__ 18#ifdef __KERNEL__
@@ -21,7 +20,7 @@
21 * Default implementation of macro that returns current 20 * Default implementation of macro that returns current
22 * instruction pointer ("program counter"). 21 * instruction pointer ("program counter").
23 */ 22 */
24#define current_text_addr() ({ void *pc; __asm__("basr %0,0":"=a"(pc)); pc; }) 23#define current_text_addr() ({ void *pc; asm("basr %0,0" : "=a" (pc)); pc; })
25 24
26/* 25/*
27 * CPU type and hardware bug flags. Kept separately for each CPU. 26 * CPU type and hardware bug flags. Kept separately for each CPU.
@@ -202,7 +201,7 @@ unsigned long get_wchan(struct task_struct *p);
202static inline void cpu_relax(void) 201static inline void cpu_relax(void)
203{ 202{
204 if (MACHINE_HAS_DIAG44) 203 if (MACHINE_HAS_DIAG44)
205 asm volatile ("diag 0,0,68" : : : "memory"); 204 asm volatile("diag 0,0,68" : : : "memory");
206 else 205 else
207 barrier(); 206 barrier();
208} 207}
@@ -213,9 +212,9 @@ static inline void cpu_relax(void)
213static inline void __load_psw(psw_t psw) 212static inline void __load_psw(psw_t psw)
214{ 213{
215#ifndef __s390x__ 214#ifndef __s390x__
216 asm volatile ("lpsw 0(%0)" : : "a" (&psw), "m" (psw) : "cc" ); 215 asm volatile("lpsw 0(%0)" : : "a" (&psw), "m" (psw) : "cc");
217#else 216#else
218 asm volatile ("lpswe 0(%0)" : : "a" (&psw), "m" (psw) : "cc" ); 217 asm volatile("lpswe 0(%0)" : : "a" (&psw), "m" (psw) : "cc");
219#endif 218#endif
220} 219}
221 220
@@ -232,20 +231,20 @@ static inline void __load_psw_mask (unsigned long mask)
232 psw.mask = mask; 231 psw.mask = mask;
233 232
234#ifndef __s390x__ 233#ifndef __s390x__
235 asm volatile ( 234 asm volatile(
236 " basr %0,0\n" 235 " basr %0,0\n"
237 "0: ahi %0,1f-0b\n" 236 "0: ahi %0,1f-0b\n"
238 " st %0,4(%1)\n" 237 " st %0,4(%1)\n"
239 " lpsw 0(%1)\n" 238 " lpsw 0(%1)\n"
240 "1:" 239 "1:"
241 : "=&d" (addr) : "a" (&psw), "m" (psw) : "memory", "cc" ); 240 : "=&d" (addr) : "a" (&psw), "m" (psw) : "memory", "cc");
242#else /* __s390x__ */ 241#else /* __s390x__ */
243 asm volatile ( 242 asm volatile(
244 " larl %0,1f\n" 243 " larl %0,1f\n"
245 " stg %0,8(%1)\n" 244 " stg %0,8(%1)\n"
246 " lpswe 0(%1)\n" 245 " lpswe 0(%1)\n"
247 "1:" 246 "1:"
248 : "=&d" (addr) : "a" (&psw), "m" (psw) : "memory", "cc" ); 247 : "=&d" (addr) : "a" (&psw), "m" (psw) : "memory", "cc");
249#endif /* __s390x__ */ 248#endif /* __s390x__ */
250} 249}
251 250
@@ -274,56 +273,57 @@ static inline void disabled_wait(unsigned long code)
274 * the processor is dead afterwards 273 * the processor is dead afterwards
275 */ 274 */
276#ifndef __s390x__ 275#ifndef __s390x__
277 asm volatile (" stctl 0,0,0(%2)\n" 276 asm volatile(
278 " ni 0(%2),0xef\n" /* switch off protection */ 277 " stctl 0,0,0(%2)\n"
279 " lctl 0,0,0(%2)\n" 278 " ni 0(%2),0xef\n" /* switch off protection */
280 " stpt 0xd8\n" /* store timer */ 279 " lctl 0,0,0(%2)\n"
281 " stckc 0xe0\n" /* store clock comparator */ 280 " stpt 0xd8\n" /* store timer */
282 " stpx 0x108\n" /* store prefix register */ 281 " stckc 0xe0\n" /* store clock comparator */
283 " stam 0,15,0x120\n" /* store access registers */ 282 " stpx 0x108\n" /* store prefix register */
284 " std 0,0x160\n" /* store f0 */ 283 " stam 0,15,0x120\n" /* store access registers */
285 " std 2,0x168\n" /* store f2 */ 284 " std 0,0x160\n" /* store f0 */
286 " std 4,0x170\n" /* store f4 */ 285 " std 2,0x168\n" /* store f2 */
287 " std 6,0x178\n" /* store f6 */ 286 " std 4,0x170\n" /* store f4 */
288 " stm 0,15,0x180\n" /* store general registers */ 287 " std 6,0x178\n" /* store f6 */
289 " stctl 0,15,0x1c0\n" /* store control registers */ 288 " stm 0,15,0x180\n" /* store general registers */
290 " oi 0x1c0,0x10\n" /* fake protection bit */ 289 " stctl 0,15,0x1c0\n" /* store control registers */
291 " lpsw 0(%1)" 290 " oi 0x1c0,0x10\n" /* fake protection bit */
292 : "=m" (ctl_buf) 291 " lpsw 0(%1)"
293 : "a" (&dw_psw), "a" (&ctl_buf), "m" (dw_psw) : "cc" ); 292 : "=m" (ctl_buf)
293 : "a" (&dw_psw), "a" (&ctl_buf), "m" (dw_psw) : "cc");
294#else /* __s390x__ */ 294#else /* __s390x__ */
295 asm volatile (" stctg 0,0,0(%2)\n" 295 asm volatile(
296 " ni 4(%2),0xef\n" /* switch off protection */ 296 " stctg 0,0,0(%2)\n"
297 " lctlg 0,0,0(%2)\n" 297 " ni 4(%2),0xef\n" /* switch off protection */
298 " lghi 1,0x1000\n" 298 " lctlg 0,0,0(%2)\n"
299 " stpt 0x328(1)\n" /* store timer */ 299 " lghi 1,0x1000\n"
300 " stckc 0x330(1)\n" /* store clock comparator */ 300 " stpt 0x328(1)\n" /* store timer */
301 " stpx 0x318(1)\n" /* store prefix register */ 301 " stckc 0x330(1)\n" /* store clock comparator */
302 " stam 0,15,0x340(1)\n" /* store access registers */ 302 " stpx 0x318(1)\n" /* store prefix register */
303 " stfpc 0x31c(1)\n" /* store fpu control */ 303 " stam 0,15,0x340(1)\n"/* store access registers */
304 " std 0,0x200(1)\n" /* store f0 */ 304 " stfpc 0x31c(1)\n" /* store fpu control */
305 " std 1,0x208(1)\n" /* store f1 */ 305 " std 0,0x200(1)\n" /* store f0 */
306 " std 2,0x210(1)\n" /* store f2 */ 306 " std 1,0x208(1)\n" /* store f1 */
307 " std 3,0x218(1)\n" /* store f3 */ 307 " std 2,0x210(1)\n" /* store f2 */
308 " std 4,0x220(1)\n" /* store f4 */ 308 " std 3,0x218(1)\n" /* store f3 */
309 " std 5,0x228(1)\n" /* store f5 */ 309 " std 4,0x220(1)\n" /* store f4 */
310 " std 6,0x230(1)\n" /* store f6 */ 310 " std 5,0x228(1)\n" /* store f5 */
311 " std 7,0x238(1)\n" /* store f7 */ 311 " std 6,0x230(1)\n" /* store f6 */
312 " std 8,0x240(1)\n" /* store f8 */ 312 " std 7,0x238(1)\n" /* store f7 */
313 " std 9,0x248(1)\n" /* store f9 */ 313 " std 8,0x240(1)\n" /* store f8 */
314 " std 10,0x250(1)\n" /* store f10 */ 314 " std 9,0x248(1)\n" /* store f9 */
315 " std 11,0x258(1)\n" /* store f11 */ 315 " std 10,0x250(1)\n" /* store f10 */
316 " std 12,0x260(1)\n" /* store f12 */ 316 " std 11,0x258(1)\n" /* store f11 */
317 " std 13,0x268(1)\n" /* store f13 */ 317 " std 12,0x260(1)\n" /* store f12 */
318 " std 14,0x270(1)\n" /* store f14 */ 318 " std 13,0x268(1)\n" /* store f13 */
319 " std 15,0x278(1)\n" /* store f15 */ 319 " std 14,0x270(1)\n" /* store f14 */
320 " stmg 0,15,0x280(1)\n" /* store general registers */ 320 " std 15,0x278(1)\n" /* store f15 */
321 " stctg 0,15,0x380(1)\n" /* store control registers */ 321 " stmg 0,15,0x280(1)\n"/* store general registers */
322 " oi 0x384(1),0x10\n" /* fake protection bit */ 322 " stctg 0,15,0x380(1)\n"/* store control registers */
323 " lpswe 0(%1)" 323 " oi 0x384(1),0x10\n"/* fake protection bit */
324 : "=m" (ctl_buf) 324 " lpswe 0(%1)"
325 : "a" (&dw_psw), "a" (&ctl_buf), 325 : "=m" (ctl_buf)
326 "m" (dw_psw) : "cc", "0", "1"); 326 : "a" (&dw_psw), "a" (&ctl_buf), "m" (dw_psw) : "cc", "0");
327#endif /* __s390x__ */ 327#endif /* __s390x__ */
328} 328}
329 329
diff --git a/include/asm-s390/ptrace.h b/include/asm-s390/ptrace.h
index 4d75d77b0f99..8d2bf65b0b64 100644
--- a/include/asm-s390/ptrace.h
+++ b/include/asm-s390/ptrace.h
@@ -479,7 +479,7 @@ extern void show_regs(struct pt_regs * regs);
479static inline void 479static inline void
480psw_set_key(unsigned int key) 480psw_set_key(unsigned int key)
481{ 481{
482 asm volatile ( "spka 0(%0)" : : "d" (key) ); 482 asm volatile("spka 0(%0)" : : "d" (key));
483} 483}
484 484
485#endif /* __ASSEMBLY__ */ 485#endif /* __ASSEMBLY__ */
diff --git a/include/asm-s390/rwsem.h b/include/asm-s390/rwsem.h
index 13ec16965150..90f4eccaa290 100644
--- a/include/asm-s390/rwsem.h
+++ b/include/asm-s390/rwsem.h
@@ -122,23 +122,23 @@ static inline void __down_read(struct rw_semaphore *sem)
122{ 122{
123 signed long old, new; 123 signed long old, new;
124 124
125 __asm__ __volatile__( 125 asm volatile(
126#ifndef __s390x__ 126#ifndef __s390x__
127 " l %0,0(%3)\n" 127 " l %0,0(%3)\n"
128 "0: lr %1,%0\n" 128 "0: lr %1,%0\n"
129 " ahi %1,%5\n" 129 " ahi %1,%5\n"
130 " cs %0,%1,0(%3)\n" 130 " cs %0,%1,0(%3)\n"
131 " jl 0b" 131 " jl 0b"
132#else /* __s390x__ */ 132#else /* __s390x__ */
133 " lg %0,0(%3)\n" 133 " lg %0,0(%3)\n"
134 "0: lgr %1,%0\n" 134 "0: lgr %1,%0\n"
135 " aghi %1,%5\n" 135 " aghi %1,%5\n"
136 " csg %0,%1,0(%3)\n" 136 " csg %0,%1,0(%3)\n"
137 " jl 0b" 137 " jl 0b"
138#endif /* __s390x__ */ 138#endif /* __s390x__ */
139 : "=&d" (old), "=&d" (new), "=m" (sem->count) 139 : "=&d" (old), "=&d" (new), "=m" (sem->count)
140 : "a" (&sem->count), "m" (sem->count), 140 : "a" (&sem->count), "m" (sem->count),
141 "i" (RWSEM_ACTIVE_READ_BIAS) : "cc", "memory" ); 141 "i" (RWSEM_ACTIVE_READ_BIAS) : "cc", "memory");
142 if (old < 0) 142 if (old < 0)
143 rwsem_down_read_failed(sem); 143 rwsem_down_read_failed(sem);
144} 144}
@@ -150,27 +150,27 @@ static inline int __down_read_trylock(struct rw_semaphore *sem)
150{ 150{
151 signed long old, new; 151 signed long old, new;
152 152
153 __asm__ __volatile__( 153 asm volatile(
154#ifndef __s390x__ 154#ifndef __s390x__
155 " l %0,0(%3)\n" 155 " l %0,0(%3)\n"
156 "0: ltr %1,%0\n" 156 "0: ltr %1,%0\n"
157 " jm 1f\n" 157 " jm 1f\n"
158 " ahi %1,%5\n" 158 " ahi %1,%5\n"
159 " cs %0,%1,0(%3)\n" 159 " cs %0,%1,0(%3)\n"
160 " jl 0b\n" 160 " jl 0b\n"
161 "1:" 161 "1:"
162#else /* __s390x__ */ 162#else /* __s390x__ */
163 " lg %0,0(%3)\n" 163 " lg %0,0(%3)\n"
164 "0: ltgr %1,%0\n" 164 "0: ltgr %1,%0\n"
165 " jm 1f\n" 165 " jm 1f\n"
166 " aghi %1,%5\n" 166 " aghi %1,%5\n"
167 " csg %0,%1,0(%3)\n" 167 " csg %0,%1,0(%3)\n"
168 " jl 0b\n" 168 " jl 0b\n"
169 "1:" 169 "1:"
170#endif /* __s390x__ */ 170#endif /* __s390x__ */
171 : "=&d" (old), "=&d" (new), "=m" (sem->count) 171 : "=&d" (old), "=&d" (new), "=m" (sem->count)
172 : "a" (&sem->count), "m" (sem->count), 172 : "a" (&sem->count), "m" (sem->count),
173 "i" (RWSEM_ACTIVE_READ_BIAS) : "cc", "memory" ); 173 "i" (RWSEM_ACTIVE_READ_BIAS) : "cc", "memory");
174 return old >= 0 ? 1 : 0; 174 return old >= 0 ? 1 : 0;
175} 175}
176 176
@@ -182,23 +182,23 @@ static inline void __down_write_nested(struct rw_semaphore *sem, int subclass)
182 signed long old, new, tmp; 182 signed long old, new, tmp;
183 183
184 tmp = RWSEM_ACTIVE_WRITE_BIAS; 184 tmp = RWSEM_ACTIVE_WRITE_BIAS;
185 __asm__ __volatile__( 185 asm volatile(
186#ifndef __s390x__ 186#ifndef __s390x__
187 " l %0,0(%3)\n" 187 " l %0,0(%3)\n"
188 "0: lr %1,%0\n" 188 "0: lr %1,%0\n"
189 " a %1,%5\n" 189 " a %1,%5\n"
190 " cs %0,%1,0(%3)\n" 190 " cs %0,%1,0(%3)\n"
191 " jl 0b" 191 " jl 0b"
192#else /* __s390x__ */ 192#else /* __s390x__ */
193 " lg %0,0(%3)\n" 193 " lg %0,0(%3)\n"
194 "0: lgr %1,%0\n" 194 "0: lgr %1,%0\n"
195 " ag %1,%5\n" 195 " ag %1,%5\n"
196 " csg %0,%1,0(%3)\n" 196 " csg %0,%1,0(%3)\n"
197 " jl 0b" 197 " jl 0b"
198#endif /* __s390x__ */ 198#endif /* __s390x__ */
199 : "=&d" (old), "=&d" (new), "=m" (sem->count) 199 : "=&d" (old), "=&d" (new), "=m" (sem->count)
200 : "a" (&sem->count), "m" (sem->count), "m" (tmp) 200 : "a" (&sem->count), "m" (sem->count), "m" (tmp)
201 : "cc", "memory" ); 201 : "cc", "memory");
202 if (old != 0) 202 if (old != 0)
203 rwsem_down_write_failed(sem); 203 rwsem_down_write_failed(sem);
204} 204}
@@ -215,24 +215,24 @@ static inline int __down_write_trylock(struct rw_semaphore *sem)
215{ 215{
216 signed long old; 216 signed long old;
217 217
218 __asm__ __volatile__( 218 asm volatile(
219#ifndef __s390x__ 219#ifndef __s390x__
220 " l %0,0(%2)\n" 220 " l %0,0(%2)\n"
221 "0: ltr %0,%0\n" 221 "0: ltr %0,%0\n"
222 " jnz 1f\n" 222 " jnz 1f\n"
223 " cs %0,%4,0(%2)\n" 223 " cs %0,%4,0(%2)\n"
224 " jl 0b\n" 224 " jl 0b\n"
225#else /* __s390x__ */ 225#else /* __s390x__ */
226 " lg %0,0(%2)\n" 226 " lg %0,0(%2)\n"
227 "0: ltgr %0,%0\n" 227 "0: ltgr %0,%0\n"
228 " jnz 1f\n" 228 " jnz 1f\n"
229 " csg %0,%4,0(%2)\n" 229 " csg %0,%4,0(%2)\n"
230 " jl 0b\n" 230 " jl 0b\n"
231#endif /* __s390x__ */ 231#endif /* __s390x__ */
232 "1:" 232 "1:"
233 : "=&d" (old), "=m" (sem->count) 233 : "=&d" (old), "=m" (sem->count)
234 : "a" (&sem->count), "m" (sem->count), 234 : "a" (&sem->count), "m" (sem->count),
235 "d" (RWSEM_ACTIVE_WRITE_BIAS) : "cc", "memory" ); 235 "d" (RWSEM_ACTIVE_WRITE_BIAS) : "cc", "memory");
236 return (old == RWSEM_UNLOCKED_VALUE) ? 1 : 0; 236 return (old == RWSEM_UNLOCKED_VALUE) ? 1 : 0;
237} 237}
238 238
@@ -243,24 +243,24 @@ static inline void __up_read(struct rw_semaphore *sem)
243{ 243{
244 signed long old, new; 244 signed long old, new;
245 245
246 __asm__ __volatile__( 246 asm volatile(
247#ifndef __s390x__ 247#ifndef __s390x__
248 " l %0,0(%3)\n" 248 " l %0,0(%3)\n"
249 "0: lr %1,%0\n" 249 "0: lr %1,%0\n"
250 " ahi %1,%5\n" 250 " ahi %1,%5\n"
251 " cs %0,%1,0(%3)\n" 251 " cs %0,%1,0(%3)\n"
252 " jl 0b" 252 " jl 0b"
253#else /* __s390x__ */ 253#else /* __s390x__ */
254 " lg %0,0(%3)\n" 254 " lg %0,0(%3)\n"
255 "0: lgr %1,%0\n" 255 "0: lgr %1,%0\n"
256 " aghi %1,%5\n" 256 " aghi %1,%5\n"
257 " csg %0,%1,0(%3)\n" 257 " csg %0,%1,0(%3)\n"
258 " jl 0b" 258 " jl 0b"
259#endif /* __s390x__ */ 259#endif /* __s390x__ */
260 : "=&d" (old), "=&d" (new), "=m" (sem->count) 260 : "=&d" (old), "=&d" (new), "=m" (sem->count)
261 : "a" (&sem->count), "m" (sem->count), 261 : "a" (&sem->count), "m" (sem->count),
262 "i" (-RWSEM_ACTIVE_READ_BIAS) 262 "i" (-RWSEM_ACTIVE_READ_BIAS)
263 : "cc", "memory" ); 263 : "cc", "memory");
264 if (new < 0) 264 if (new < 0)
265 if ((new & RWSEM_ACTIVE_MASK) == 0) 265 if ((new & RWSEM_ACTIVE_MASK) == 0)
266 rwsem_wake(sem); 266 rwsem_wake(sem);
@@ -274,23 +274,23 @@ static inline void __up_write(struct rw_semaphore *sem)
274 signed long old, new, tmp; 274 signed long old, new, tmp;
275 275
276 tmp = -RWSEM_ACTIVE_WRITE_BIAS; 276 tmp = -RWSEM_ACTIVE_WRITE_BIAS;
277 __asm__ __volatile__( 277 asm volatile(
278#ifndef __s390x__ 278#ifndef __s390x__
279 " l %0,0(%3)\n" 279 " l %0,0(%3)\n"
280 "0: lr %1,%0\n" 280 "0: lr %1,%0\n"
281 " a %1,%5\n" 281 " a %1,%5\n"
282 " cs %0,%1,0(%3)\n" 282 " cs %0,%1,0(%3)\n"
283 " jl 0b" 283 " jl 0b"
284#else /* __s390x__ */ 284#else /* __s390x__ */
285 " lg %0,0(%3)\n" 285 " lg %0,0(%3)\n"
286 "0: lgr %1,%0\n" 286 "0: lgr %1,%0\n"
287 " ag %1,%5\n" 287 " ag %1,%5\n"
288 " csg %0,%1,0(%3)\n" 288 " csg %0,%1,0(%3)\n"
289 " jl 0b" 289 " jl 0b"
290#endif /* __s390x__ */ 290#endif /* __s390x__ */
291 : "=&d" (old), "=&d" (new), "=m" (sem->count) 291 : "=&d" (old), "=&d" (new), "=m" (sem->count)
292 : "a" (&sem->count), "m" (sem->count), "m" (tmp) 292 : "a" (&sem->count), "m" (sem->count), "m" (tmp)
293 : "cc", "memory" ); 293 : "cc", "memory");
294 if (new < 0) 294 if (new < 0)
295 if ((new & RWSEM_ACTIVE_MASK) == 0) 295 if ((new & RWSEM_ACTIVE_MASK) == 0)
296 rwsem_wake(sem); 296 rwsem_wake(sem);
@@ -304,23 +304,23 @@ static inline void __downgrade_write(struct rw_semaphore *sem)
304 signed long old, new, tmp; 304 signed long old, new, tmp;
305 305
306 tmp = -RWSEM_WAITING_BIAS; 306 tmp = -RWSEM_WAITING_BIAS;
307 __asm__ __volatile__( 307 asm volatile(
308#ifndef __s390x__ 308#ifndef __s390x__
309 " l %0,0(%3)\n" 309 " l %0,0(%3)\n"
310 "0: lr %1,%0\n" 310 "0: lr %1,%0\n"
311 " a %1,%5\n" 311 " a %1,%5\n"
312 " cs %0,%1,0(%3)\n" 312 " cs %0,%1,0(%3)\n"
313 " jl 0b" 313 " jl 0b"
314#else /* __s390x__ */ 314#else /* __s390x__ */
315 " lg %0,0(%3)\n" 315 " lg %0,0(%3)\n"
316 "0: lgr %1,%0\n" 316 "0: lgr %1,%0\n"
317 " ag %1,%5\n" 317 " ag %1,%5\n"
318 " csg %0,%1,0(%3)\n" 318 " csg %0,%1,0(%3)\n"
319 " jl 0b" 319 " jl 0b"
320#endif /* __s390x__ */ 320#endif /* __s390x__ */
321 : "=&d" (old), "=&d" (new), "=m" (sem->count) 321 : "=&d" (old), "=&d" (new), "=m" (sem->count)
322 : "a" (&sem->count), "m" (sem->count), "m" (tmp) 322 : "a" (&sem->count), "m" (sem->count), "m" (tmp)
323 : "cc", "memory" ); 323 : "cc", "memory");
324 if (new > 1) 324 if (new > 1)
325 rwsem_downgrade_wake(sem); 325 rwsem_downgrade_wake(sem);
326} 326}
@@ -332,23 +332,23 @@ static inline void rwsem_atomic_add(long delta, struct rw_semaphore *sem)
332{ 332{
333 signed long old, new; 333 signed long old, new;
334 334
335 __asm__ __volatile__( 335 asm volatile(
336#ifndef __s390x__ 336#ifndef __s390x__
337 " l %0,0(%3)\n" 337 " l %0,0(%3)\n"
338 "0: lr %1,%0\n" 338 "0: lr %1,%0\n"
339 " ar %1,%5\n" 339 " ar %1,%5\n"
340 " cs %0,%1,0(%3)\n" 340 " cs %0,%1,0(%3)\n"
341 " jl 0b" 341 " jl 0b"
342#else /* __s390x__ */ 342#else /* __s390x__ */
343 " lg %0,0(%3)\n" 343 " lg %0,0(%3)\n"
344 "0: lgr %1,%0\n" 344 "0: lgr %1,%0\n"
345 " agr %1,%5\n" 345 " agr %1,%5\n"
346 " csg %0,%1,0(%3)\n" 346 " csg %0,%1,0(%3)\n"
347 " jl 0b" 347 " jl 0b"
348#endif /* __s390x__ */ 348#endif /* __s390x__ */
349 : "=&d" (old), "=&d" (new), "=m" (sem->count) 349 : "=&d" (old), "=&d" (new), "=m" (sem->count)
350 : "a" (&sem->count), "m" (sem->count), "d" (delta) 350 : "a" (&sem->count), "m" (sem->count), "d" (delta)
351 : "cc", "memory" ); 351 : "cc", "memory");
352} 352}
353 353
354/* 354/*
@@ -358,23 +358,23 @@ static inline long rwsem_atomic_update(long delta, struct rw_semaphore *sem)
358{ 358{
359 signed long old, new; 359 signed long old, new;
360 360
361 __asm__ __volatile__( 361 asm volatile(
362#ifndef __s390x__ 362#ifndef __s390x__
363 " l %0,0(%3)\n" 363 " l %0,0(%3)\n"
364 "0: lr %1,%0\n" 364 "0: lr %1,%0\n"
365 " ar %1,%5\n" 365 " ar %1,%5\n"
366 " cs %0,%1,0(%3)\n" 366 " cs %0,%1,0(%3)\n"
367 " jl 0b" 367 " jl 0b"
368#else /* __s390x__ */ 368#else /* __s390x__ */
369 " lg %0,0(%3)\n" 369 " lg %0,0(%3)\n"
370 "0: lgr %1,%0\n" 370 "0: lgr %1,%0\n"
371 " agr %1,%5\n" 371 " agr %1,%5\n"
372 " csg %0,%1,0(%3)\n" 372 " csg %0,%1,0(%3)\n"
373 " jl 0b" 373 " jl 0b"
374#endif /* __s390x__ */ 374#endif /* __s390x__ */
375 : "=&d" (old), "=&d" (new), "=m" (sem->count) 375 : "=&d" (old), "=&d" (new), "=m" (sem->count)
376 : "a" (&sem->count), "m" (sem->count), "d" (delta) 376 : "a" (&sem->count), "m" (sem->count), "d" (delta)
377 : "cc", "memory" ); 377 : "cc", "memory");
378 return new; 378 return new;
379} 379}
380 380
diff --git a/include/asm-s390/semaphore.h b/include/asm-s390/semaphore.h
index 32cdc69f39f4..dbce058aefa9 100644
--- a/include/asm-s390/semaphore.h
+++ b/include/asm-s390/semaphore.h
@@ -85,17 +85,17 @@ static inline int down_trylock(struct semaphore * sem)
85 * sem->count.counter = --new_val; 85 * sem->count.counter = --new_val;
86 * In the ppc code this is called atomic_dec_if_positive. 86 * In the ppc code this is called atomic_dec_if_positive.
87 */ 87 */
88 __asm__ __volatile__ ( 88 asm volatile(
89 " l %0,0(%3)\n" 89 " l %0,0(%3)\n"
90 "0: ltr %1,%0\n" 90 "0: ltr %1,%0\n"
91 " jle 1f\n" 91 " jle 1f\n"
92 " ahi %1,-1\n" 92 " ahi %1,-1\n"
93 " cs %0,%1,0(%3)\n" 93 " cs %0,%1,0(%3)\n"
94 " jl 0b\n" 94 " jl 0b\n"
95 "1:" 95 "1:"
96 : "=&d" (old_val), "=&d" (new_val), "=m" (sem->count.counter) 96 : "=&d" (old_val), "=&d" (new_val), "=m" (sem->count.counter)
97 : "a" (&sem->count.counter), "m" (sem->count.counter) 97 : "a" (&sem->count.counter), "m" (sem->count.counter)
98 : "cc", "memory" ); 98 : "cc", "memory");
99 return old_val <= 0; 99 return old_val <= 0;
100} 100}
101 101
diff --git a/include/asm-s390/setup.h b/include/asm-s390/setup.h
index f1959732b6fd..5d72eda8a11b 100644
--- a/include/asm-s390/setup.h
+++ b/include/asm-s390/setup.h
@@ -39,6 +39,7 @@ extern unsigned long machine_flags;
39#define MACHINE_IS_P390 (machine_flags & 4) 39#define MACHINE_IS_P390 (machine_flags & 4)
40#define MACHINE_HAS_MVPG (machine_flags & 16) 40#define MACHINE_HAS_MVPG (machine_flags & 16)
41#define MACHINE_HAS_IDTE (machine_flags & 128) 41#define MACHINE_HAS_IDTE (machine_flags & 128)
42#define MACHINE_HAS_DIAG9C (machine_flags & 256)
42 43
43#ifndef __s390x__ 44#ifndef __s390x__
44#define MACHINE_HAS_IEEE (machine_flags & 2) 45#define MACHINE_HAS_IEEE (machine_flags & 2)
diff --git a/include/asm-s390/sfp-machine.h b/include/asm-s390/sfp-machine.h
index de69dfa46fbb..8ca8c77b2d04 100644
--- a/include/asm-s390/sfp-machine.h
+++ b/include/asm-s390/sfp-machine.h
@@ -76,21 +76,23 @@
76 unsigned int __r2 = (x2) + (y2); \ 76 unsigned int __r2 = (x2) + (y2); \
77 unsigned int __r1 = (x1); \ 77 unsigned int __r1 = (x1); \
78 unsigned int __r0 = (x0); \ 78 unsigned int __r0 = (x0); \
79 __asm__ (" alr %2,%3\n" \ 79 asm volatile( \
80 " brc 12,0f\n" \ 80 " alr %2,%3\n" \
81 " lhi 0,1\n" \ 81 " brc 12,0f\n" \
82 " alr %1,0\n" \ 82 " lhi 0,1\n" \
83 " brc 12,0f\n" \ 83 " alr %1,0\n" \
84 " alr %0,0\n" \ 84 " brc 12,0f\n" \
85 "0:" \ 85 " alr %0,0\n" \
86 : "+&d" (__r2), "+&d" (__r1), "+&d" (__r0) \ 86 "0:" \
87 : "d" (y0), "i" (1) : "cc", "0" ); \ 87 : "+&d" (__r2), "+&d" (__r1), "+&d" (__r0) \
88 __asm__ (" alr %1,%2\n" \ 88 : "d" (y0), "i" (1) : "cc", "0" ); \
89 " brc 12,0f\n" \ 89 asm volatile( \
90 " ahi %0,1\n" \ 90 " alr %1,%2\n" \
91 "0:" \ 91 " brc 12,0f\n" \
92 : "+&d" (__r2), "+&d" (__r1) \ 92 " ahi %0,1\n" \
93 : "d" (y1) : "cc" ); \ 93 "0:" \
94 : "+&d" (__r2), "+&d" (__r1) \
95 : "d" (y1) : "cc"); \
94 (r2) = __r2; \ 96 (r2) = __r2; \
95 (r1) = __r1; \ 97 (r1) = __r1; \
96 (r0) = __r0; \ 98 (r0) = __r0; \
@@ -100,21 +102,23 @@
100 unsigned int __r2 = (x2) - (y2); \ 102 unsigned int __r2 = (x2) - (y2); \
101 unsigned int __r1 = (x1); \ 103 unsigned int __r1 = (x1); \
102 unsigned int __r0 = (x0); \ 104 unsigned int __r0 = (x0); \
103 __asm__ (" slr %2,%3\n" \ 105 asm volatile( \
104 " brc 3,0f\n" \ 106 " slr %2,%3\n" \
105 " lhi 0,1\n" \ 107 " brc 3,0f\n" \
106 " slr %1,0\n" \ 108 " lhi 0,1\n" \
107 " brc 3,0f\n" \ 109 " slr %1,0\n" \
108 " slr %0,0\n" \ 110 " brc 3,0f\n" \
109 "0:" \ 111 " slr %0,0\n" \
110 : "+&d" (__r2), "+&d" (__r1), "+&d" (__r0) \ 112 "0:" \
111 : "d" (y0) : "cc", "0" ); \ 113 : "+&d" (__r2), "+&d" (__r1), "+&d" (__r0) \
112 __asm__ (" slr %1,%2\n" \ 114 : "d" (y0) : "cc", "0"); \
113 " brc 3,0f\n" \ 115 asm volatile( \
114 " ahi %0,-1\n" \ 116 " slr %1,%2\n" \
115 "0:" \ 117 " brc 3,0f\n" \
116 : "+&d" (__r2), "+&d" (__r1) \ 118 " ahi %0,-1\n" \
117 : "d" (y1) : "cc" ); \ 119 "0:" \
120 : "+&d" (__r2), "+&d" (__r1) \
121 : "d" (y1) : "cc"); \
118 (r2) = __r2; \ 122 (r2) = __r2; \
119 (r1) = __r1; \ 123 (r1) = __r1; \
120 (r0) = __r0; \ 124 (r0) = __r0; \
diff --git a/include/asm-s390/sigp.h b/include/asm-s390/sigp.h
index fc56458aff66..e16d56f8dfe1 100644
--- a/include/asm-s390/sigp.h
+++ b/include/asm-s390/sigp.h
@@ -70,16 +70,16 @@ typedef enum
70static inline sigp_ccode 70static inline sigp_ccode
71signal_processor(__u16 cpu_addr, sigp_order_code order_code) 71signal_processor(__u16 cpu_addr, sigp_order_code order_code)
72{ 72{
73 register unsigned long reg1 asm ("1") = 0;
73 sigp_ccode ccode; 74 sigp_ccode ccode;
74 75
75 __asm__ __volatile__( 76 asm volatile(
76 " sr 1,1\n" /* parameter=0 in gpr 1 */ 77 " sigp %1,%2,0(%3)\n"
77 " sigp 1,%1,0(%2)\n" 78 " ipm %0\n"
78 " ipm %0\n" 79 " srl %0,28\n"
79 " srl %0,28\n" 80 : "=d" (ccode)
80 : "=d" (ccode) 81 : "d" (reg1), "d" (__cpu_logical_map[cpu_addr]),
81 : "d" (__cpu_logical_map[cpu_addr]), "a" (order_code) 82 "a" (order_code) : "cc" , "memory");
82 : "cc" , "memory", "1" );
83 return ccode; 83 return ccode;
84} 84}
85 85
@@ -87,20 +87,18 @@ signal_processor(__u16 cpu_addr, sigp_order_code order_code)
87 * Signal processor with parameter 87 * Signal processor with parameter
88 */ 88 */
89static inline sigp_ccode 89static inline sigp_ccode
90signal_processor_p(__u32 parameter, __u16 cpu_addr, 90signal_processor_p(__u32 parameter, __u16 cpu_addr, sigp_order_code order_code)
91 sigp_order_code order_code)
92{ 91{
92 register unsigned int reg1 asm ("1") = parameter;
93 sigp_ccode ccode; 93 sigp_ccode ccode;
94 94
95 __asm__ __volatile__( 95 asm volatile(
96 " lr 1,%1\n" /* parameter in gpr 1 */ 96 " sigp %1,%2,0(%3)\n"
97 " sigp 1,%2,0(%3)\n" 97 " ipm %0\n"
98 " ipm %0\n" 98 " srl %0,28\n"
99 " srl %0,28\n"
100 : "=d" (ccode) 99 : "=d" (ccode)
101 : "d" (parameter), "d" (__cpu_logical_map[cpu_addr]), 100 : "d" (reg1), "d" (__cpu_logical_map[cpu_addr]),
102 "a" (order_code) 101 "a" (order_code) : "cc" , "memory");
103 : "cc" , "memory", "1" );
104 return ccode; 102 return ccode;
105} 103}
106 104
@@ -108,24 +106,21 @@ signal_processor_p(__u32 parameter, __u16 cpu_addr,
108 * Signal processor with parameter and return status 106 * Signal processor with parameter and return status
109 */ 107 */
110static inline sigp_ccode 108static inline sigp_ccode
111signal_processor_ps(__u32 *statusptr, __u32 parameter, 109signal_processor_ps(__u32 *statusptr, __u32 parameter, __u16 cpu_addr,
112 __u16 cpu_addr, sigp_order_code order_code) 110 sigp_order_code order_code)
113{ 111{
112 register unsigned int reg1 asm ("1") = parameter;
114 sigp_ccode ccode; 113 sigp_ccode ccode;
115 114
116 __asm__ __volatile__( 115 asm volatile(
117 " sr 2,2\n" /* clear status */ 116 " sigp %1,%2,0(%3)\n"
118 " lr 3,%2\n" /* parameter in gpr 3 */ 117 " ipm %0\n"
119 " sigp 2,%3,0(%4)\n" 118 " srl %0,28\n"
120 " st 2,%1\n" 119 : "=d" (ccode), "+d" (reg1)
121 " ipm %0\n" 120 : "d" (__cpu_logical_map[cpu_addr]), "a" (order_code)
122 " srl %0,28\n" 121 : "cc" , "memory");
123 : "=d" (ccode), "=m" (*statusptr) 122 *statusptr = reg1;
124 : "d" (parameter), "d" (__cpu_logical_map[cpu_addr]), 123 return ccode;
125 "a" (order_code)
126 : "cc" , "memory", "2" , "3"
127 );
128 return ccode;
129} 124}
130 125
131#endif /* __SIGP__ */ 126#endif /* __SIGP__ */
diff --git a/include/asm-s390/smp.h b/include/asm-s390/smp.h
index 9fb02e9779c9..c3cf030ada4d 100644
--- a/include/asm-s390/smp.h
+++ b/include/asm-s390/smp.h
@@ -56,7 +56,7 @@ static inline __u16 hard_smp_processor_id(void)
56{ 56{
57 __u16 cpu_address; 57 __u16 cpu_address;
58 58
59 __asm__ ("stap %0\n" : "=m" (cpu_address)); 59 asm volatile("stap %0" : "=m" (cpu_address));
60 return cpu_address; 60 return cpu_address;
61} 61}
62 62
diff --git a/include/asm-s390/spinlock.h b/include/asm-s390/spinlock.h
index 273dbecf8ace..6b78af16999b 100644
--- a/include/asm-s390/spinlock.h
+++ b/include/asm-s390/spinlock.h
@@ -11,17 +11,38 @@
11#ifndef __ASM_SPINLOCK_H 11#ifndef __ASM_SPINLOCK_H
12#define __ASM_SPINLOCK_H 12#define __ASM_SPINLOCK_H
13 13
14#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)
15
16#include <linux/smp.h>
17
14static inline int 18static inline int
15_raw_compare_and_swap(volatile unsigned int *lock, 19_raw_compare_and_swap(volatile unsigned int *lock,
16 unsigned int old, unsigned int new) 20 unsigned int old, unsigned int new)
17{ 21{
18 asm volatile ("cs %0,%3,0(%4)" 22 asm volatile(
19 : "=d" (old), "=m" (*lock) 23 " cs %0,%3,%1"
20 : "0" (old), "d" (new), "a" (lock), "m" (*lock) 24 : "=d" (old), "=Q" (*lock)
21 : "cc", "memory" ); 25 : "0" (old), "d" (new), "Q" (*lock)
26 : "cc", "memory" );
22 return old; 27 return old;
23} 28}
24 29
30#else /* __GNUC__ */
31
32static inline int
33_raw_compare_and_swap(volatile unsigned int *lock,
34 unsigned int old, unsigned int new)
35{
36 asm volatile(
37 " cs %0,%3,0(%4)"
38 : "=d" (old), "=m" (*lock)
39 : "0" (old), "d" (new), "a" (lock), "m" (*lock)
40 : "cc", "memory" );
41 return old;
42}
43
44#endif /* __GNUC__ */
45
25/* 46/*
26 * Simple spin lock operations. There are two variants, one clears IRQ's 47 * Simple spin lock operations. There are two variants, one clears IRQ's
27 * on the local processor, one does not. 48 * on the local processor, one does not.
@@ -31,34 +52,46 @@ _raw_compare_and_swap(volatile unsigned int *lock,
31 * (the type definitions are in asm/spinlock_types.h) 52 * (the type definitions are in asm/spinlock_types.h)
32 */ 53 */
33 54
34#define __raw_spin_is_locked(x) ((x)->lock != 0) 55#define __raw_spin_is_locked(x) ((x)->owner_cpu != 0)
35#define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock) 56#define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock)
36#define __raw_spin_unlock_wait(lock) \ 57#define __raw_spin_unlock_wait(lock) \
37 do { while (__raw_spin_is_locked(lock)) cpu_relax(); } while (0) 58 do { while (__raw_spin_is_locked(lock)) \
59 _raw_spin_relax(lock); } while (0)
38 60
39extern void _raw_spin_lock_wait(raw_spinlock_t *lp, unsigned int pc); 61extern void _raw_spin_lock_wait(raw_spinlock_t *, unsigned int pc);
40extern int _raw_spin_trylock_retry(raw_spinlock_t *lp, unsigned int pc); 62extern int _raw_spin_trylock_retry(raw_spinlock_t *, unsigned int pc);
63extern void _raw_spin_relax(raw_spinlock_t *lock);
41 64
42static inline void __raw_spin_lock(raw_spinlock_t *lp) 65static inline void __raw_spin_lock(raw_spinlock_t *lp)
43{ 66{
44 unsigned long pc = 1 | (unsigned long) __builtin_return_address(0); 67 unsigned long pc = 1 | (unsigned long) __builtin_return_address(0);
45 68 int old;
46 if (unlikely(_raw_compare_and_swap(&lp->lock, 0, pc) != 0)) 69
47 _raw_spin_lock_wait(lp, pc); 70 old = _raw_compare_and_swap(&lp->owner_cpu, 0, ~smp_processor_id());
71 if (likely(old == 0)) {
72 lp->owner_pc = pc;
73 return;
74 }
75 _raw_spin_lock_wait(lp, pc);
48} 76}
49 77
50static inline int __raw_spin_trylock(raw_spinlock_t *lp) 78static inline int __raw_spin_trylock(raw_spinlock_t *lp)
51{ 79{
52 unsigned long pc = 1 | (unsigned long) __builtin_return_address(0); 80 unsigned long pc = 1 | (unsigned long) __builtin_return_address(0);
81 int old;
53 82
54 if (likely(_raw_compare_and_swap(&lp->lock, 0, pc) == 0)) 83 old = _raw_compare_and_swap(&lp->owner_cpu, 0, ~smp_processor_id());
84 if (likely(old == 0)) {
85 lp->owner_pc = pc;
55 return 1; 86 return 1;
87 }
56 return _raw_spin_trylock_retry(lp, pc); 88 return _raw_spin_trylock_retry(lp, pc);
57} 89}
58 90
59static inline void __raw_spin_unlock(raw_spinlock_t *lp) 91static inline void __raw_spin_unlock(raw_spinlock_t *lp)
60{ 92{
61 _raw_compare_and_swap(&lp->lock, lp->lock, 0); 93 lp->owner_pc = 0;
94 _raw_compare_and_swap(&lp->owner_cpu, lp->owner_cpu, 0);
62} 95}
63 96
64/* 97/*
@@ -135,4 +168,7 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw)
135 return _raw_write_trylock_retry(rw); 168 return _raw_write_trylock_retry(rw);
136} 169}
137 170
171#define _raw_read_relax(lock) cpu_relax()
172#define _raw_write_relax(lock) cpu_relax()
173
138#endif /* __ASM_SPINLOCK_H */ 174#endif /* __ASM_SPINLOCK_H */
diff --git a/include/asm-s390/spinlock_types.h b/include/asm-s390/spinlock_types.h
index f79a2216204f..b7ac13f7aa37 100644
--- a/include/asm-s390/spinlock_types.h
+++ b/include/asm-s390/spinlock_types.h
@@ -6,16 +6,16 @@
6#endif 6#endif
7 7
8typedef struct { 8typedef struct {
9 volatile unsigned int lock; 9 volatile unsigned int owner_cpu;
10 volatile unsigned int owner_pc;
10} __attribute__ ((aligned (4))) raw_spinlock_t; 11} __attribute__ ((aligned (4))) raw_spinlock_t;
11 12
12#define __RAW_SPIN_LOCK_UNLOCKED { 0 } 13#define __RAW_SPIN_LOCK_UNLOCKED { 0 }
13 14
14typedef struct { 15typedef struct {
15 volatile unsigned int lock; 16 volatile unsigned int lock;
16 volatile unsigned int owner_pc;
17} raw_rwlock_t; 17} raw_rwlock_t;
18 18
19#define __RAW_RW_LOCK_UNLOCKED { 0, 0 } 19#define __RAW_RW_LOCK_UNLOCKED { 0 }
20 20
21#endif 21#endif
diff --git a/include/asm-s390/string.h b/include/asm-s390/string.h
index 23a4c390489f..d074673a6d9b 100644
--- a/include/asm-s390/string.h
+++ b/include/asm-s390/string.h
@@ -60,12 +60,13 @@ static inline void *memchr(const void * s, int c, size_t n)
60 register int r0 asm("0") = (char) c; 60 register int r0 asm("0") = (char) c;
61 const void *ret = s + n; 61 const void *ret = s + n;
62 62
63 asm volatile ("0: srst %0,%1\n" 63 asm volatile(
64 " jo 0b\n" 64 "0: srst %0,%1\n"
65 " jl 1f\n" 65 " jo 0b\n"
66 " la %0,0\n" 66 " jl 1f\n"
67 "1:" 67 " la %0,0\n"
68 : "+a" (ret), "+&a" (s) : "d" (r0) : "cc" ); 68 "1:"
69 : "+a" (ret), "+&a" (s) : "d" (r0) : "cc");
69 return (void *) ret; 70 return (void *) ret;
70} 71}
71 72
@@ -74,9 +75,10 @@ static inline void *memscan(void *s, int c, size_t n)
74 register int r0 asm("0") = (char) c; 75 register int r0 asm("0") = (char) c;
75 const void *ret = s + n; 76 const void *ret = s + n;
76 77
77 asm volatile ("0: srst %0,%1\n" 78 asm volatile(
78 " jo 0b\n" 79 "0: srst %0,%1\n"
79 : "+a" (ret), "+&a" (s) : "d" (r0) : "cc" ); 80 " jo 0b\n"
81 : "+a" (ret), "+&a" (s) : "d" (r0) : "cc");
80 return (void *) ret; 82 return (void *) ret;
81} 83}
82 84
@@ -86,12 +88,13 @@ static inline char *strcat(char *dst, const char *src)
86 unsigned long dummy; 88 unsigned long dummy;
87 char *ret = dst; 89 char *ret = dst;
88 90
89 asm volatile ("0: srst %0,%1\n" 91 asm volatile(
90 " jo 0b\n" 92 "0: srst %0,%1\n"
91 "1: mvst %0,%2\n" 93 " jo 0b\n"
92 " jo 1b" 94 "1: mvst %0,%2\n"
93 : "=&a" (dummy), "+a" (dst), "+a" (src) 95 " jo 1b"
94 : "d" (r0), "0" (0) : "cc", "memory" ); 96 : "=&a" (dummy), "+a" (dst), "+a" (src)
97 : "d" (r0), "0" (0) : "cc", "memory" );
95 return ret; 98 return ret;
96} 99}
97 100
@@ -100,10 +103,11 @@ static inline char *strcpy(char *dst, const char *src)
100 register int r0 asm("0") = 0; 103 register int r0 asm("0") = 0;
101 char *ret = dst; 104 char *ret = dst;
102 105
103 asm volatile ("0: mvst %0,%1\n" 106 asm volatile(
104 " jo 0b" 107 "0: mvst %0,%1\n"
105 : "+&a" (dst), "+&a" (src) : "d" (r0) 108 " jo 0b"
106 : "cc", "memory" ); 109 : "+&a" (dst), "+&a" (src) : "d" (r0)
110 : "cc", "memory");
107 return ret; 111 return ret;
108} 112}
109 113
@@ -112,9 +116,10 @@ static inline size_t strlen(const char *s)
112 register unsigned long r0 asm("0") = 0; 116 register unsigned long r0 asm("0") = 0;
113 const char *tmp = s; 117 const char *tmp = s;
114 118
115 asm volatile ("0: srst %0,%1\n" 119 asm volatile(
116 " jo 0b" 120 "0: srst %0,%1\n"
117 : "+d" (r0), "+a" (tmp) : : "cc" ); 121 " jo 0b"
122 : "+d" (r0), "+a" (tmp) : : "cc");
118 return r0 - (unsigned long) s; 123 return r0 - (unsigned long) s;
119} 124}
120 125
@@ -124,9 +129,10 @@ static inline size_t strnlen(const char * s, size_t n)
124 const char *tmp = s; 129 const char *tmp = s;
125 const char *end = s + n; 130 const char *end = s + n;
126 131
127 asm volatile ("0: srst %0,%1\n" 132 asm volatile(
128 " jo 0b" 133 "0: srst %0,%1\n"
129 : "+a" (end), "+a" (tmp) : "d" (r0) : "cc" ); 134 " jo 0b"
135 : "+a" (end), "+a" (tmp) : "d" (r0) : "cc");
130 return end - s; 136 return end - s;
131} 137}
132 138
diff --git a/include/asm-s390/system.h b/include/asm-s390/system.h
index 16040048cd1b..ccbafe4bf2cb 100644
--- a/include/asm-s390/system.h
+++ b/include/asm-s390/system.h
@@ -23,74 +23,68 @@ struct task_struct;
23 23
24extern struct task_struct *__switch_to(void *, void *); 24extern struct task_struct *__switch_to(void *, void *);
25 25
26#ifdef __s390x__
27#define __FLAG_SHIFT 56
28#else /* ! __s390x__ */
29#define __FLAG_SHIFT 24
30#endif /* ! __s390x__ */
31
32static inline void save_fp_regs(s390_fp_regs *fpregs) 26static inline void save_fp_regs(s390_fp_regs *fpregs)
33{ 27{
34 asm volatile ( 28 asm volatile(
35 " std 0,8(%1)\n" 29 " std 0,8(%1)\n"
36 " std 2,24(%1)\n" 30 " std 2,24(%1)\n"
37 " std 4,40(%1)\n" 31 " std 4,40(%1)\n"
38 " std 6,56(%1)" 32 " std 6,56(%1)"
39 : "=m" (*fpregs) : "a" (fpregs), "m" (*fpregs) : "memory" ); 33 : "=m" (*fpregs) : "a" (fpregs), "m" (*fpregs) : "memory");
40 if (!MACHINE_HAS_IEEE) 34 if (!MACHINE_HAS_IEEE)
41 return; 35 return;
42 asm volatile( 36 asm volatile(
43 " stfpc 0(%1)\n" 37 " stfpc 0(%1)\n"
44 " std 1,16(%1)\n" 38 " std 1,16(%1)\n"
45 " std 3,32(%1)\n" 39 " std 3,32(%1)\n"
46 " std 5,48(%1)\n" 40 " std 5,48(%1)\n"
47 " std 7,64(%1)\n" 41 " std 7,64(%1)\n"
48 " std 8,72(%1)\n" 42 " std 8,72(%1)\n"
49 " std 9,80(%1)\n" 43 " std 9,80(%1)\n"
50 " std 10,88(%1)\n" 44 " std 10,88(%1)\n"
51 " std 11,96(%1)\n" 45 " std 11,96(%1)\n"
52 " std 12,104(%1)\n" 46 " std 12,104(%1)\n"
53 " std 13,112(%1)\n" 47 " std 13,112(%1)\n"
54 " std 14,120(%1)\n" 48 " std 14,120(%1)\n"
55 " std 15,128(%1)\n" 49 " std 15,128(%1)\n"
56 : "=m" (*fpregs) : "a" (fpregs), "m" (*fpregs) : "memory" ); 50 : "=m" (*fpregs) : "a" (fpregs), "m" (*fpregs) : "memory");
57} 51}
58 52
59static inline void restore_fp_regs(s390_fp_regs *fpregs) 53static inline void restore_fp_regs(s390_fp_regs *fpregs)
60{ 54{
61 asm volatile ( 55 asm volatile(
62 " ld 0,8(%0)\n" 56 " ld 0,8(%0)\n"
63 " ld 2,24(%0)\n" 57 " ld 2,24(%0)\n"
64 " ld 4,40(%0)\n" 58 " ld 4,40(%0)\n"
65 " ld 6,56(%0)" 59 " ld 6,56(%0)"
66 : : "a" (fpregs), "m" (*fpregs) ); 60 : : "a" (fpregs), "m" (*fpregs));
67 if (!MACHINE_HAS_IEEE) 61 if (!MACHINE_HAS_IEEE)
68 return; 62 return;
69 asm volatile( 63 asm volatile(
70 " lfpc 0(%0)\n" 64 " lfpc 0(%0)\n"
71 " ld 1,16(%0)\n" 65 " ld 1,16(%0)\n"
72 " ld 3,32(%0)\n" 66 " ld 3,32(%0)\n"
73 " ld 5,48(%0)\n" 67 " ld 5,48(%0)\n"
74 " ld 7,64(%0)\n" 68 " ld 7,64(%0)\n"
75 " ld 8,72(%0)\n" 69 " ld 8,72(%0)\n"
76 " ld 9,80(%0)\n" 70 " ld 9,80(%0)\n"
77 " ld 10,88(%0)\n" 71 " ld 10,88(%0)\n"
78 " ld 11,96(%0)\n" 72 " ld 11,96(%0)\n"
79 " ld 12,104(%0)\n" 73 " ld 12,104(%0)\n"
80 " ld 13,112(%0)\n" 74 " ld 13,112(%0)\n"
81 " ld 14,120(%0)\n" 75 " ld 14,120(%0)\n"
82 " ld 15,128(%0)\n" 76 " ld 15,128(%0)\n"
83 : : "a" (fpregs), "m" (*fpregs) ); 77 : : "a" (fpregs), "m" (*fpregs));
84} 78}
85 79
86static inline void save_access_regs(unsigned int *acrs) 80static inline void save_access_regs(unsigned int *acrs)
87{ 81{
88 asm volatile ("stam 0,15,0(%0)" : : "a" (acrs) : "memory" ); 82 asm volatile("stam 0,15,0(%0)" : : "a" (acrs) : "memory");
89} 83}
90 84
91static inline void restore_access_regs(unsigned int *acrs) 85static inline void restore_access_regs(unsigned int *acrs)
92{ 86{
93 asm volatile ("lam 0,15,0(%0)" : : "a" (acrs) ); 87 asm volatile("lam 0,15,0(%0)" : : "a" (acrs));
94} 88}
95 89
96#define switch_to(prev,next,last) do { \ 90#define switch_to(prev,next,last) do { \
@@ -126,7 +120,7 @@ extern void account_system_vtime(struct task_struct *);
126 account_vtime(prev); \ 120 account_vtime(prev); \
127} while (0) 121} while (0)
128 122
129#define nop() __asm__ __volatile__ ("nop") 123#define nop() asm volatile("nop")
130 124
131#define xchg(ptr,x) \ 125#define xchg(ptr,x) \
132({ \ 126({ \
@@ -147,15 +141,15 @@ static inline unsigned long __xchg(unsigned long x, void * ptr, int size)
147 shift = (3 ^ (addr & 3)) << 3; 141 shift = (3 ^ (addr & 3)) << 3;
148 addr ^= addr & 3; 142 addr ^= addr & 3;
149 asm volatile( 143 asm volatile(
150 " l %0,0(%4)\n" 144 " l %0,0(%4)\n"
151 "0: lr 0,%0\n" 145 "0: lr 0,%0\n"
152 " nr 0,%3\n" 146 " nr 0,%3\n"
153 " or 0,%2\n" 147 " or 0,%2\n"
154 " cs %0,0,0(%4)\n" 148 " cs %0,0,0(%4)\n"
155 " jl 0b\n" 149 " jl 0b\n"
156 : "=&d" (old), "=m" (*(int *) addr) 150 : "=&d" (old), "=m" (*(int *) addr)
157 : "d" (x << shift), "d" (~(255 << shift)), "a" (addr), 151 : "d" (x << shift), "d" (~(255 << shift)), "a" (addr),
158 "m" (*(int *) addr) : "memory", "cc", "0" ); 152 "m" (*(int *) addr) : "memory", "cc", "0");
159 x = old >> shift; 153 x = old >> shift;
160 break; 154 break;
161 case 2: 155 case 2:
@@ -163,36 +157,36 @@ static inline unsigned long __xchg(unsigned long x, void * ptr, int size)
163 shift = (2 ^ (addr & 2)) << 3; 157 shift = (2 ^ (addr & 2)) << 3;
164 addr ^= addr & 2; 158 addr ^= addr & 2;
165 asm volatile( 159 asm volatile(
166 " l %0,0(%4)\n" 160 " l %0,0(%4)\n"
167 "0: lr 0,%0\n" 161 "0: lr 0,%0\n"
168 " nr 0,%3\n" 162 " nr 0,%3\n"
169 " or 0,%2\n" 163 " or 0,%2\n"
170 " cs %0,0,0(%4)\n" 164 " cs %0,0,0(%4)\n"
171 " jl 0b\n" 165 " jl 0b\n"
172 : "=&d" (old), "=m" (*(int *) addr) 166 : "=&d" (old), "=m" (*(int *) addr)
173 : "d" (x << shift), "d" (~(65535 << shift)), "a" (addr), 167 : "d" (x << shift), "d" (~(65535 << shift)), "a" (addr),
174 "m" (*(int *) addr) : "memory", "cc", "0" ); 168 "m" (*(int *) addr) : "memory", "cc", "0");
175 x = old >> shift; 169 x = old >> shift;
176 break; 170 break;
177 case 4: 171 case 4:
178 asm volatile ( 172 asm volatile(
179 " l %0,0(%3)\n" 173 " l %0,0(%3)\n"
180 "0: cs %0,%2,0(%3)\n" 174 "0: cs %0,%2,0(%3)\n"
181 " jl 0b\n" 175 " jl 0b\n"
182 : "=&d" (old), "=m" (*(int *) ptr) 176 : "=&d" (old), "=m" (*(int *) ptr)
183 : "d" (x), "a" (ptr), "m" (*(int *) ptr) 177 : "d" (x), "a" (ptr), "m" (*(int *) ptr)
184 : "memory", "cc" ); 178 : "memory", "cc");
185 x = old; 179 x = old;
186 break; 180 break;
187#ifdef __s390x__ 181#ifdef __s390x__
188 case 8: 182 case 8:
189 asm volatile ( 183 asm volatile(
190 " lg %0,0(%3)\n" 184 " lg %0,0(%3)\n"
191 "0: csg %0,%2,0(%3)\n" 185 "0: csg %0,%2,0(%3)\n"
192 " jl 0b\n" 186 " jl 0b\n"
193 : "=&d" (old), "=m" (*(long *) ptr) 187 : "=&d" (old), "=m" (*(long *) ptr)
194 : "d" (x), "a" (ptr), "m" (*(long *) ptr) 188 : "d" (x), "a" (ptr), "m" (*(long *) ptr)
195 : "memory", "cc" ); 189 : "memory", "cc");
196 x = old; 190 x = old;
197 break; 191 break;
198#endif /* __s390x__ */ 192#endif /* __s390x__ */
@@ -224,55 +218,55 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
224 shift = (3 ^ (addr & 3)) << 3; 218 shift = (3 ^ (addr & 3)) << 3;
225 addr ^= addr & 3; 219 addr ^= addr & 3;
226 asm volatile( 220 asm volatile(
227 " l %0,0(%4)\n" 221 " l %0,0(%4)\n"
228 "0: nr %0,%5\n" 222 "0: nr %0,%5\n"
229 " lr %1,%0\n" 223 " lr %1,%0\n"
230 " or %0,%2\n" 224 " or %0,%2\n"
231 " or %1,%3\n" 225 " or %1,%3\n"
232 " cs %0,%1,0(%4)\n" 226 " cs %0,%1,0(%4)\n"
233 " jnl 1f\n" 227 " jnl 1f\n"
234 " xr %1,%0\n" 228 " xr %1,%0\n"
235 " nr %1,%5\n" 229 " nr %1,%5\n"
236 " jnz 0b\n" 230 " jnz 0b\n"
237 "1:" 231 "1:"
238 : "=&d" (prev), "=&d" (tmp) 232 : "=&d" (prev), "=&d" (tmp)
239 : "d" (old << shift), "d" (new << shift), "a" (ptr), 233 : "d" (old << shift), "d" (new << shift), "a" (ptr),
240 "d" (~(255 << shift)) 234 "d" (~(255 << shift))
241 : "memory", "cc" ); 235 : "memory", "cc");
242 return prev >> shift; 236 return prev >> shift;
243 case 2: 237 case 2:
244 addr = (unsigned long) ptr; 238 addr = (unsigned long) ptr;
245 shift = (2 ^ (addr & 2)) << 3; 239 shift = (2 ^ (addr & 2)) << 3;
246 addr ^= addr & 2; 240 addr ^= addr & 2;
247 asm volatile( 241 asm volatile(
248 " l %0,0(%4)\n" 242 " l %0,0(%4)\n"
249 "0: nr %0,%5\n" 243 "0: nr %0,%5\n"
250 " lr %1,%0\n" 244 " lr %1,%0\n"
251 " or %0,%2\n" 245 " or %0,%2\n"
252 " or %1,%3\n" 246 " or %1,%3\n"
253 " cs %0,%1,0(%4)\n" 247 " cs %0,%1,0(%4)\n"
254 " jnl 1f\n" 248 " jnl 1f\n"
255 " xr %1,%0\n" 249 " xr %1,%0\n"
256 " nr %1,%5\n" 250 " nr %1,%5\n"
257 " jnz 0b\n" 251 " jnz 0b\n"
258 "1:" 252 "1:"
259 : "=&d" (prev), "=&d" (tmp) 253 : "=&d" (prev), "=&d" (tmp)
260 : "d" (old << shift), "d" (new << shift), "a" (ptr), 254 : "d" (old << shift), "d" (new << shift), "a" (ptr),
261 "d" (~(65535 << shift)) 255 "d" (~(65535 << shift))
262 : "memory", "cc" ); 256 : "memory", "cc");
263 return prev >> shift; 257 return prev >> shift;
264 case 4: 258 case 4:
265 asm volatile ( 259 asm volatile(
266 " cs %0,%2,0(%3)\n" 260 " cs %0,%2,0(%3)\n"
267 : "=&d" (prev) : "0" (old), "d" (new), "a" (ptr) 261 : "=&d" (prev) : "0" (old), "d" (new), "a" (ptr)
268 : "memory", "cc" ); 262 : "memory", "cc");
269 return prev; 263 return prev;
270#ifdef __s390x__ 264#ifdef __s390x__
271 case 8: 265 case 8:
272 asm volatile ( 266 asm volatile(
273 " csg %0,%2,0(%3)\n" 267 " csg %0,%2,0(%3)\n"
274 : "=&d" (prev) : "0" (old), "d" (new), "a" (ptr) 268 : "=&d" (prev) : "0" (old), "d" (new), "a" (ptr)
275 : "memory", "cc" ); 269 : "memory", "cc");
276 return prev; 270 return prev;
277#endif /* __s390x__ */ 271#endif /* __s390x__ */
278 } 272 }
@@ -289,8 +283,8 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
289 * all memory ops have completed wrt other CPU's ( see 7-15 POP DJB ). 283 * all memory ops have completed wrt other CPU's ( see 7-15 POP DJB ).
290 */ 284 */
291 285
292#define eieio() __asm__ __volatile__ ( "bcr 15,0" : : : "memory" ) 286#define eieio() asm volatile("bcr 15,0" : : : "memory")
293# define SYNC_OTHER_CORES(x) eieio() 287#define SYNC_OTHER_CORES(x) eieio()
294#define mb() eieio() 288#define mb() eieio()
295#define rmb() eieio() 289#define rmb() eieio()
296#define wmb() eieio() 290#define wmb() eieio()
@@ -307,117 +301,56 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
307 301
308#ifdef __s390x__ 302#ifdef __s390x__
309 303
310#define __ctl_load(array, low, high) ({ \ 304#define __ctl_load(array, low, high) ({ \
311 typedef struct { char _[sizeof(array)]; } addrtype; \ 305 typedef struct { char _[sizeof(array)]; } addrtype; \
312 __asm__ __volatile__ ( \ 306 asm volatile( \
313 " bras 1,0f\n" \ 307 " lctlg %1,%2,0(%0)\n" \
314 " lctlg 0,0,0(%0)\n" \ 308 : : "a" (&array), "i" (low), "i" (high), \
315 "0: ex %1,0(1)" \ 309 "m" (*(addrtype *)(array))); \
316 : : "a" (&array), "a" (((low)<<4)+(high)), \
317 "m" (*(addrtype *)(array)) : "1" ); \
318 }) 310 })
319 311
320#define __ctl_store(array, low, high) ({ \ 312#define __ctl_store(array, low, high) ({ \
321 typedef struct { char _[sizeof(array)]; } addrtype; \ 313 typedef struct { char _[sizeof(array)]; } addrtype; \
322 __asm__ __volatile__ ( \ 314 asm volatile( \
323 " bras 1,0f\n" \ 315 " stctg %2,%3,0(%1)\n" \
324 " stctg 0,0,0(%1)\n" \ 316 : "=m" (*(addrtype *)(array)) \
325 "0: ex %2,0(1)" \ 317 : "a" (&array), "i" (low), "i" (high)); \
326 : "=m" (*(addrtype *)(array)) \
327 : "a" (&array), "a" (((low)<<4)+(high)) : "1" ); \
328 }) 318 })
329 319
330#define __ctl_set_bit(cr, bit) ({ \
331 __u8 __dummy[24]; \
332 __asm__ __volatile__ ( \
333 " bras 1,0f\n" /* skip indirect insns */ \
334 " stctg 0,0,0(%1)\n" \
335 " lctlg 0,0,0(%1)\n" \
336 "0: ex %2,0(1)\n" /* execute stctl */ \
337 " lg 0,0(%1)\n" \
338 " ogr 0,%3\n" /* set the bit */ \
339 " stg 0,0(%1)\n" \
340 "1: ex %2,6(1)" /* execute lctl */ \
341 : "=m" (__dummy) \
342 : "a" ((((unsigned long) &__dummy) + 7) & ~7UL), \
343 "a" (cr*17), "a" (1L<<(bit)) \
344 : "cc", "0", "1" ); \
345 })
346
347#define __ctl_clear_bit(cr, bit) ({ \
348 __u8 __dummy[16]; \
349 __asm__ __volatile__ ( \
350 " bras 1,0f\n" /* skip indirect insns */ \
351 " stctg 0,0,0(%1)\n" \
352 " lctlg 0,0,0(%1)\n" \
353 "0: ex %2,0(1)\n" /* execute stctl */ \
354 " lg 0,0(%1)\n" \
355 " ngr 0,%3\n" /* set the bit */ \
356 " stg 0,0(%1)\n" \
357 "1: ex %2,6(1)" /* execute lctl */ \
358 : "=m" (__dummy) \
359 : "a" ((((unsigned long) &__dummy) + 7) & ~7UL), \
360 "a" (cr*17), "a" (~(1L<<(bit))) \
361 : "cc", "0", "1" ); \
362 })
363
364#else /* __s390x__ */ 320#else /* __s390x__ */
365 321
366#define __ctl_load(array, low, high) ({ \ 322#define __ctl_load(array, low, high) ({ \
367 typedef struct { char _[sizeof(array)]; } addrtype; \ 323 typedef struct { char _[sizeof(array)]; } addrtype; \
368 __asm__ __volatile__ ( \ 324 asm volatile( \
369 " bras 1,0f\n" \ 325 " lctl %1,%2,0(%0)\n" \
370 " lctl 0,0,0(%0)\n" \ 326 : : "a" (&array), "i" (low), "i" (high), \
371 "0: ex %1,0(1)" \ 327 "m" (*(addrtype *)(array))); \
372 : : "a" (&array), "a" (((low)<<4)+(high)), \ 328})
373 "m" (*(addrtype *)(array)) : "1" ); \
374 })
375 329
376#define __ctl_store(array, low, high) ({ \ 330#define __ctl_store(array, low, high) ({ \
377 typedef struct { char _[sizeof(array)]; } addrtype; \ 331 typedef struct { char _[sizeof(array)]; } addrtype; \
378 __asm__ __volatile__ ( \ 332 asm volatile( \
379 " bras 1,0f\n" \ 333 " stctl %2,%3,0(%1)\n" \
380 " stctl 0,0,0(%1)\n" \ 334 : "=m" (*(addrtype *)(array)) \
381 "0: ex %2,0(1)" \ 335 : "a" (&array), "i" (low), "i" (high)); \
382 : "=m" (*(addrtype *)(array)) \
383 : "a" (&array), "a" (((low)<<4)+(high)): "1" ); \
384 }) 336 })
385 337
386#define __ctl_set_bit(cr, bit) ({ \
387 __u8 __dummy[16]; \
388 __asm__ __volatile__ ( \
389 " bras 1,0f\n" /* skip indirect insns */ \
390 " stctl 0,0,0(%1)\n" \
391 " lctl 0,0,0(%1)\n" \
392 "0: ex %2,0(1)\n" /* execute stctl */ \
393 " l 0,0(%1)\n" \
394 " or 0,%3\n" /* set the bit */ \
395 " st 0,0(%1)\n" \
396 "1: ex %2,4(1)" /* execute lctl */ \
397 : "=m" (__dummy) \
398 : "a" ((((unsigned long) &__dummy) + 7) & ~7UL), \
399 "a" (cr*17), "a" (1<<(bit)) \
400 : "cc", "0", "1" ); \
401 })
402
403#define __ctl_clear_bit(cr, bit) ({ \
404 __u8 __dummy[16]; \
405 __asm__ __volatile__ ( \
406 " bras 1,0f\n" /* skip indirect insns */ \
407 " stctl 0,0,0(%1)\n" \
408 " lctl 0,0,0(%1)\n" \
409 "0: ex %2,0(1)\n" /* execute stctl */ \
410 " l 0,0(%1)\n" \
411 " nr 0,%3\n" /* set the bit */ \
412 " st 0,0(%1)\n" \
413 "1: ex %2,4(1)" /* execute lctl */ \
414 : "=m" (__dummy) \
415 : "a" ((((unsigned long) &__dummy) + 7) & ~7UL), \
416 "a" (cr*17), "a" (~(1<<(bit))) \
417 : "cc", "0", "1" ); \
418 })
419#endif /* __s390x__ */ 338#endif /* __s390x__ */
420 339
340#define __ctl_set_bit(cr, bit) ({ \
341 unsigned long __dummy; \
342 __ctl_store(__dummy, cr, cr); \
343 __dummy |= 1UL << (bit); \
344 __ctl_load(__dummy, cr, cr); \
345})
346
347#define __ctl_clear_bit(cr, bit) ({ \
348 unsigned long __dummy; \
349 __ctl_store(__dummy, cr, cr); \
350 __dummy &= ~(1UL << (bit)); \
351 __ctl_load(__dummy, cr, cr); \
352})
353
421#include <linux/irqflags.h> 354#include <linux/irqflags.h>
422 355
423/* 356/*
@@ -427,8 +360,7 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
427static inline void 360static inline void
428__set_psw_mask(unsigned long mask) 361__set_psw_mask(unsigned long mask)
429{ 362{
430 local_save_flags(mask); 363 __load_psw_mask(mask | (__raw_local_irq_stosm(0x00) & ~(-1UL >> 8)));
431 __load_psw_mask(mask);
432} 364}
433 365
434#define local_mcck_enable() __set_psw_mask(PSW_KERNEL_BITS) 366#define local_mcck_enable() __set_psw_mask(PSW_KERNEL_BITS)
diff --git a/include/asm-s390/timex.h b/include/asm-s390/timex.h
index 5d0332a4c2bd..4df4a41029a3 100644
--- a/include/asm-s390/timex.h
+++ b/include/asm-s390/timex.h
@@ -15,20 +15,21 @@
15 15
16typedef unsigned long long cycles_t; 16typedef unsigned long long cycles_t;
17 17
18static inline cycles_t get_cycles(void)
19{
20 cycles_t cycles;
21
22 __asm__ __volatile__ ("stck 0(%1)" : "=m" (cycles) : "a" (&cycles) : "cc");
23 return cycles >> 2;
24}
25
26static inline unsigned long long get_clock (void) 18static inline unsigned long long get_clock (void)
27{ 19{
28 unsigned long long clk; 20 unsigned long long clk;
29 21
30 __asm__ __volatile__ ("stck 0(%1)" : "=m" (clk) : "a" (&clk) : "cc"); 22#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)
23 asm volatile("stck %0" : "=Q" (clk) : : "cc");
24#else /* __GNUC__ */
25 asm volatile("stck 0(%1)" : "=m" (clk) : "a" (&clk) : "cc");
26#endif /* __GNUC__ */
31 return clk; 27 return clk;
32} 28}
33 29
30static inline cycles_t get_cycles(void)
31{
32 return (cycles_t) get_clock() >> 2;
33}
34
34#endif 35#endif
diff --git a/include/asm-s390/tlbflush.h b/include/asm-s390/tlbflush.h
index 73cd85bebfb2..fa4dc916a9bf 100644
--- a/include/asm-s390/tlbflush.h
+++ b/include/asm-s390/tlbflush.h
@@ -25,7 +25,7 @@
25 */ 25 */
26 26
27#define local_flush_tlb() \ 27#define local_flush_tlb() \
28do { __asm__ __volatile__("ptlb": : :"memory"); } while (0) 28do { asm volatile("ptlb": : :"memory"); } while (0)
29 29
30#ifndef CONFIG_SMP 30#ifndef CONFIG_SMP
31 31
@@ -68,24 +68,24 @@ extern void smp_ptlb_all(void);
68 68
69static inline void global_flush_tlb(void) 69static inline void global_flush_tlb(void)
70{ 70{
71 register unsigned long reg2 asm("2");
72 register unsigned long reg3 asm("3");
73 register unsigned long reg4 asm("4");
74 long dummy;
75
71#ifndef __s390x__ 76#ifndef __s390x__
72 if (!MACHINE_HAS_CSP) { 77 if (!MACHINE_HAS_CSP) {
73 smp_ptlb_all(); 78 smp_ptlb_all();
74 return; 79 return;
75 } 80 }
76#endif /* __s390x__ */ 81#endif /* __s390x__ */
77 { 82
78 register unsigned long addr asm("4"); 83 dummy = 0;
79 long dummy; 84 reg2 = reg3 = 0;
80 85 reg4 = ((unsigned long) &dummy) + 1;
81 dummy = 0; 86 asm volatile(
82 addr = ((unsigned long) &dummy) + 1; 87 " csp %0,%2"
83 __asm__ __volatile__ ( 88 : : "d" (reg2), "d" (reg3), "d" (reg4), "m" (dummy) : "cc" );
84 " slr 2,2\n"
85 " slr 3,3\n"
86 " csp 2,%0"
87 : : "a" (addr), "m" (dummy) : "cc", "2", "3" );
88 }
89} 89}
90 90
91/* 91/*
@@ -102,9 +102,9 @@ static inline void __flush_tlb_mm(struct mm_struct * mm)
102 if (unlikely(cpus_empty(mm->cpu_vm_mask))) 102 if (unlikely(cpus_empty(mm->cpu_vm_mask)))
103 return; 103 return;
104 if (MACHINE_HAS_IDTE) { 104 if (MACHINE_HAS_IDTE) {
105 asm volatile (".insn rrf,0xb98e0000,0,%0,%1,0" 105 asm volatile(
106 : : "a" (2048), 106 " .insn rrf,0xb98e0000,0,%0,%1,0"
107 "a" (__pa(mm->pgd)&PAGE_MASK) : "cc" ); 107 : : "a" (2048), "a" (__pa(mm->pgd)&PAGE_MASK) : "cc");
108 return; 108 return;
109 } 109 }
110 preempt_disable(); 110 preempt_disable();
diff --git a/include/asm-s390/uaccess.h b/include/asm-s390/uaccess.h
index e2047b0c9092..72ae4efddb49 100644
--- a/include/asm-s390/uaccess.h
+++ b/include/asm-s390/uaccess.h
@@ -38,25 +38,14 @@
38#define get_ds() (KERNEL_DS) 38#define get_ds() (KERNEL_DS)
39#define get_fs() (current->thread.mm_segment) 39#define get_fs() (current->thread.mm_segment)
40 40
41#ifdef __s390x__
42#define set_fs(x) \ 41#define set_fs(x) \
43({ \ 42({ \
44 unsigned long __pto; \ 43 unsigned long __pto; \
45 current->thread.mm_segment = (x); \ 44 current->thread.mm_segment = (x); \
46 __pto = current->thread.mm_segment.ar4 ? \ 45 __pto = current->thread.mm_segment.ar4 ? \
47 S390_lowcore.user_asce : S390_lowcore.kernel_asce; \ 46 S390_lowcore.user_asce : S390_lowcore.kernel_asce; \
48 asm volatile ("lctlg 7,7,%0" : : "m" (__pto) ); \ 47 __ctl_load(__pto, 7, 7); \
49}) 48})
50#else /* __s390x__ */
51#define set_fs(x) \
52({ \
53 unsigned long __pto; \
54 current->thread.mm_segment = (x); \
55 __pto = current->thread.mm_segment.ar4 ? \
56 S390_lowcore.user_asce : S390_lowcore.kernel_asce; \
57 asm volatile ("lctl 7,7,%0" : : "m" (__pto) ); \
58})
59#endif /* __s390x__ */
60 49
61#define segment_eq(a,b) ((a).ar4 == (b).ar4) 50#define segment_eq(a,b) ((a).ar4 == (b).ar4)
62 51
diff --git a/include/asm-s390/unistd.h b/include/asm-s390/unistd.h
index d49c54cb5505..0361ac5dcde3 100644
--- a/include/asm-s390/unistd.h
+++ b/include/asm-s390/unistd.h
@@ -355,145 +355,145 @@ do { \
355 355
356#define _svc_clobber "1", "cc", "memory" 356#define _svc_clobber "1", "cc", "memory"
357 357
358#define _syscall0(type,name) \ 358#define _syscall0(type,name) \
359type name(void) { \ 359type name(void) { \
360 register long __svcres asm("2"); \ 360 register long __svcres asm("2"); \
361 long __res; \ 361 long __res; \
362 __asm__ __volatile__ ( \ 362 asm volatile( \
363 " .if %1 < 256\n" \ 363 " .if %1 < 256\n" \
364 " svc %b1\n" \ 364 " svc %b1\n" \
365 " .else\n" \ 365 " .else\n" \
366 " la %%r1,%1\n" \ 366 " la %%r1,%1\n" \
367 " svc 0\n" \ 367 " svc 0\n" \
368 " .endif" \ 368 " .endif" \
369 : "=d" (__svcres) \ 369 : "=d" (__svcres) \
370 : "i" (__NR_##name) \ 370 : "i" (__NR_##name) \
371 : _svc_clobber ); \ 371 : _svc_clobber); \
372 __res = __svcres; \ 372 __res = __svcres; \
373 __syscall_return(type,__res); \ 373 __syscall_return(type,__res); \
374} 374}
375 375
376#define _syscall1(type,name,type1,arg1) \ 376#define _syscall1(type,name,type1,arg1) \
377type name(type1 arg1) { \ 377type name(type1 arg1) { \
378 register type1 __arg1 asm("2") = arg1; \ 378 register type1 __arg1 asm("2") = arg1; \
379 register long __svcres asm("2"); \ 379 register long __svcres asm("2"); \
380 long __res; \ 380 long __res; \
381 __asm__ __volatile__ ( \ 381 asm volatile( \
382 " .if %1 < 256\n" \ 382 " .if %1 < 256\n" \
383 " svc %b1\n" \ 383 " svc %b1\n" \
384 " .else\n" \ 384 " .else\n" \
385 " la %%r1,%1\n" \ 385 " la %%r1,%1\n" \
386 " svc 0\n" \ 386 " svc 0\n" \
387 " .endif" \ 387 " .endif" \
388 : "=d" (__svcres) \ 388 : "=d" (__svcres) \
389 : "i" (__NR_##name), \ 389 : "i" (__NR_##name), \
390 "0" (__arg1) \ 390 "0" (__arg1) \
391 : _svc_clobber ); \ 391 : _svc_clobber); \
392 __res = __svcres; \ 392 __res = __svcres; \
393 __syscall_return(type,__res); \ 393 __syscall_return(type,__res); \
394} 394}
395 395
396#define _syscall2(type,name,type1,arg1,type2,arg2) \ 396#define _syscall2(type,name,type1,arg1,type2,arg2) \
397type name(type1 arg1, type2 arg2) { \ 397type name(type1 arg1, type2 arg2) { \
398 register type1 __arg1 asm("2") = arg1; \ 398 register type1 __arg1 asm("2") = arg1; \
399 register type2 __arg2 asm("3") = arg2; \ 399 register type2 __arg2 asm("3") = arg2; \
400 register long __svcres asm("2"); \ 400 register long __svcres asm("2"); \
401 long __res; \ 401 long __res; \
402 __asm__ __volatile__ ( \ 402 asm volatile( \
403 " .if %1 < 256\n" \ 403 " .if %1 < 256\n" \
404 " svc %b1\n" \ 404 " svc %b1\n" \
405 " .else\n" \ 405 " .else\n" \
406 " la %%r1,%1\n" \ 406 " la %%r1,%1\n" \
407 " svc 0\n" \ 407 " svc 0\n" \
408 " .endif" \ 408 " .endif" \
409 : "=d" (__svcres) \ 409 : "=d" (__svcres) \
410 : "i" (__NR_##name), \ 410 : "i" (__NR_##name), \
411 "0" (__arg1), \ 411 "0" (__arg1), \
412 "d" (__arg2) \ 412 "d" (__arg2) \
413 : _svc_clobber ); \ 413 : _svc_clobber ); \
414 __res = __svcres; \ 414 __res = __svcres; \
415 __syscall_return(type,__res); \ 415 __syscall_return(type,__res); \
416} 416}
417 417
418#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3)\ 418#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
419type name(type1 arg1, type2 arg2, type3 arg3) { \ 419type name(type1 arg1, type2 arg2, type3 arg3) { \
420 register type1 __arg1 asm("2") = arg1; \ 420 register type1 __arg1 asm("2") = arg1; \
421 register type2 __arg2 asm("3") = arg2; \ 421 register type2 __arg2 asm("3") = arg2; \
422 register type3 __arg3 asm("4") = arg3; \ 422 register type3 __arg3 asm("4") = arg3; \
423 register long __svcres asm("2"); \ 423 register long __svcres asm("2"); \
424 long __res; \ 424 long __res; \
425 __asm__ __volatile__ ( \ 425 asm volatile( \
426 " .if %1 < 256\n" \ 426 " .if %1 < 256\n" \
427 " svc %b1\n" \ 427 " svc %b1\n" \
428 " .else\n" \ 428 " .else\n" \
429 " la %%r1,%1\n" \ 429 " la %%r1,%1\n" \
430 " svc 0\n" \ 430 " svc 0\n" \
431 " .endif" \ 431 " .endif" \
432 : "=d" (__svcres) \ 432 : "=d" (__svcres) \
433 : "i" (__NR_##name), \ 433 : "i" (__NR_##name), \
434 "0" (__arg1), \ 434 "0" (__arg1), \
435 "d" (__arg2), \ 435 "d" (__arg2), \
436 "d" (__arg3) \ 436 "d" (__arg3) \
437 : _svc_clobber ); \ 437 : _svc_clobber); \
438 __res = __svcres; \ 438 __res = __svcres; \
439 __syscall_return(type,__res); \ 439 __syscall_return(type,__res); \
440} 440}
441 441
442#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,\ 442#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3, \
443 type4,name4) \ 443 type4,name4) \
444type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \ 444type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \
445 register type1 __arg1 asm("2") = arg1; \ 445 register type1 __arg1 asm("2") = arg1; \
446 register type2 __arg2 asm("3") = arg2; \ 446 register type2 __arg2 asm("3") = arg2; \
447 register type3 __arg3 asm("4") = arg3; \ 447 register type3 __arg3 asm("4") = arg3; \
448 register type4 __arg4 asm("5") = arg4; \ 448 register type4 __arg4 asm("5") = arg4; \
449 register long __svcres asm("2"); \ 449 register long __svcres asm("2"); \
450 long __res; \ 450 long __res; \
451 __asm__ __volatile__ ( \ 451 asm volatile( \
452 " .if %1 < 256\n" \ 452 " .if %1 < 256\n" \
453 " svc %b1\n" \ 453 " svc %b1\n" \
454 " .else\n" \ 454 " .else\n" \
455 " la %%r1,%1\n" \ 455 " la %%r1,%1\n" \
456 " svc 0\n" \ 456 " svc 0\n" \
457 " .endif" \ 457 " .endif" \
458 : "=d" (__svcres) \ 458 : "=d" (__svcres) \
459 : "i" (__NR_##name), \ 459 : "i" (__NR_##name), \
460 "0" (__arg1), \ 460 "0" (__arg1), \
461 "d" (__arg2), \ 461 "d" (__arg2), \
462 "d" (__arg3), \ 462 "d" (__arg3), \
463 "d" (__arg4) \ 463 "d" (__arg4) \
464 : _svc_clobber ); \ 464 : _svc_clobber); \
465 __res = __svcres; \ 465 __res = __svcres; \
466 __syscall_return(type,__res); \ 466 __syscall_return(type,__res); \
467} 467}
468 468
469#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,\ 469#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3, \
470 type4,name4,type5,name5) \ 470 type4,name4,type5,name5) \
471type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \ 471type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
472 type5 arg5) { \ 472 type5 arg5) { \
473 register type1 __arg1 asm("2") = arg1; \ 473 register type1 __arg1 asm("2") = arg1; \
474 register type2 __arg2 asm("3") = arg2; \ 474 register type2 __arg2 asm("3") = arg2; \
475 register type3 __arg3 asm("4") = arg3; \ 475 register type3 __arg3 asm("4") = arg3; \
476 register type4 __arg4 asm("5") = arg4; \ 476 register type4 __arg4 asm("5") = arg4; \
477 register type5 __arg5 asm("6") = arg5; \ 477 register type5 __arg5 asm("6") = arg5; \
478 register long __svcres asm("2"); \ 478 register long __svcres asm("2"); \
479 long __res; \ 479 long __res; \
480 __asm__ __volatile__ ( \ 480 asm volatile( \
481 " .if %1 < 256\n" \ 481 " .if %1 < 256\n" \
482 " svc %b1\n" \ 482 " svc %b1\n" \
483 " .else\n" \ 483 " .else\n" \
484 " la %%r1,%1\n" \ 484 " la %%r1,%1\n" \
485 " svc 0\n" \ 485 " svc 0\n" \
486 " .endif" \ 486 " .endif" \
487 : "=d" (__svcres) \ 487 : "=d" (__svcres) \
488 : "i" (__NR_##name), \ 488 : "i" (__NR_##name), \
489 "0" (__arg1), \ 489 "0" (__arg1), \
490 "d" (__arg2), \ 490 "d" (__arg2), \
491 "d" (__arg3), \ 491 "d" (__arg3), \
492 "d" (__arg4), \ 492 "d" (__arg4), \
493 "d" (__arg5) \ 493 "d" (__arg5) \
494 : _svc_clobber ); \ 494 : _svc_clobber); \
495 __res = __svcres; \ 495 __res = __svcres; \
496 __syscall_return(type,__res); \ 496 __syscall_return(type,__res); \
497} 497}
498 498
499#define __ARCH_WANT_IPC_PARSE_VERSION 499#define __ARCH_WANT_IPC_PARSE_VERSION
diff --git a/include/asm-sh/ec3104/keyboard.h b/include/asm-sh/ec3104/keyboard.h
index 0dee7b05b49d..c1253a683197 100644
--- a/include/asm-sh/ec3104/keyboard.h
+++ b/include/asm-sh/ec3104/keyboard.h
@@ -6,8 +6,6 @@ extern char ec3104_kbd_unexpected_up(unsigned char);
6extern void ec3104_kbd_leds(unsigned char); 6extern void ec3104_kbd_leds(unsigned char);
7extern void ec3104_kbd_init_hw(void); 7extern void ec3104_kbd_init_hw(void);
8 8
9#define SYSRQ_KEY 0x54
10
11#define kbd_sysrq_xlate ec3104_kbd_sysrq_xlate 9#define kbd_sysrq_xlate ec3104_kbd_sysrq_xlate
12#define kbd_setkeycode ec3104_kbd_setkeycode 10#define kbd_setkeycode ec3104_kbd_setkeycode
13#define kbd_getkeycode ec3104_kbd_getkeycode 11#define kbd_getkeycode ec3104_kbd_getkeycode
diff --git a/include/asm-sh/mpc1211/keyboard.h b/include/asm-sh/mpc1211/keyboard.h
index 71ef4cf4242d..9020feee7b4c 100644
--- a/include/asm-sh/mpc1211/keyboard.h
+++ b/include/asm-sh/mpc1211/keyboard.h
@@ -24,7 +24,6 @@ extern void pckbd_leds(unsigned char leds);
24extern void pckbd_init_hw(void); 24extern void pckbd_init_hw(void);
25extern int pckbd_pm_resume(struct pm_dev *, pm_request_t, void *); 25extern int pckbd_pm_resume(struct pm_dev *, pm_request_t, void *);
26extern pm_callback pm_kbd_request_override; 26extern pm_callback pm_kbd_request_override;
27extern unsigned char pckbd_sysrq_xlate[128];
28 27
29#define kbd_setkeycode pckbd_setkeycode 28#define kbd_setkeycode pckbd_setkeycode
30#define kbd_getkeycode pckbd_getkeycode 29#define kbd_getkeycode pckbd_getkeycode
@@ -32,9 +31,6 @@ extern unsigned char pckbd_sysrq_xlate[128];
32#define kbd_unexpected_up pckbd_unexpected_up 31#define kbd_unexpected_up pckbd_unexpected_up
33#define kbd_leds pckbd_leds 32#define kbd_leds pckbd_leds
34#define kbd_init_hw pckbd_init_hw 33#define kbd_init_hw pckbd_init_hw
35#define kbd_sysrq_xlate pckbd_sysrq_xlate
36
37#define SYSRQ_KEY 0x54
38 34
39/* resource allocation */ 35/* resource allocation */
40#define kbd_request_region() 36#define kbd_request_region()
diff --git a/include/asm-sh/spinlock.h b/include/asm-sh/spinlock.h
index 846322d4c35d..54458fd24981 100644
--- a/include/asm-sh/spinlock.h
+++ b/include/asm-sh/spinlock.h
@@ -100,4 +100,8 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw)
100 return 0; 100 return 0;
101} 101}
102 102
103#define _raw_spin_relax(lock) cpu_relax()
104#define _raw_read_relax(lock) cpu_relax()
105#define _raw_write_relax(lock) cpu_relax()
106
103#endif /* __ASM_SH_SPINLOCK_H */ 107#endif /* __ASM_SH_SPINLOCK_H */
diff --git a/include/asm-sh64/keyboard.h b/include/asm-sh64/keyboard.h
index 1fab96d792bf..0b01c3beb2f8 100644
--- a/include/asm-sh64/keyboard.h
+++ b/include/asm-sh64/keyboard.h
@@ -30,7 +30,6 @@ extern int pckbd_translate(unsigned char scancode, unsigned char *keycode,
30extern char pckbd_unexpected_up(unsigned char keycode); 30extern char pckbd_unexpected_up(unsigned char keycode);
31extern void pckbd_leds(unsigned char leds); 31extern void pckbd_leds(unsigned char leds);
32extern void pckbd_init_hw(void); 32extern void pckbd_init_hw(void);
33extern unsigned char pckbd_sysrq_xlate[128];
34 33
35#define kbd_setkeycode pckbd_setkeycode 34#define kbd_setkeycode pckbd_setkeycode
36#define kbd_getkeycode pckbd_getkeycode 35#define kbd_getkeycode pckbd_getkeycode
@@ -38,9 +37,6 @@ extern unsigned char pckbd_sysrq_xlate[128];
38#define kbd_unexpected_up pckbd_unexpected_up 37#define kbd_unexpected_up pckbd_unexpected_up
39#define kbd_leds pckbd_leds 38#define kbd_leds pckbd_leds
40#define kbd_init_hw pckbd_init_hw 39#define kbd_init_hw pckbd_init_hw
41#define kbd_sysrq_xlate pckbd_sysrq_xlate
42
43#define SYSRQ_KEY 0x54
44 40
45/* resource allocation */ 41/* resource allocation */
46#define kbd_request_region() 42#define kbd_request_region()
diff --git a/include/asm-sh64/timex.h b/include/asm-sh64/timex.h
index af0b79269661..163e2b62fe27 100644
--- a/include/asm-sh64/timex.h
+++ b/include/asm-sh64/timex.h
@@ -17,9 +17,6 @@
17 17
18#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ 18#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */
19#define CLOCK_TICK_FACTOR 20 /* Factor of both 1000000 and CLOCK_TICK_RATE */ 19#define CLOCK_TICK_FACTOR 20 /* Factor of both 1000000 and CLOCK_TICK_RATE */
20#define FINETUNE ((((((long)LATCH * HZ - CLOCK_TICK_RATE) << SHIFT_HZ) * \
21 (1000000/CLOCK_TICK_FACTOR) / (CLOCK_TICK_RATE/CLOCK_TICK_FACTOR)) \
22 << (SHIFT_SCALE-SHIFT_HZ)) / HZ)
23 20
24typedef unsigned long cycles_t; 21typedef unsigned long cycles_t;
25 22
diff --git a/include/asm-sparc/spinlock.h b/include/asm-sparc/spinlock.h
index 1c75474ba1df..557d08959d2f 100644
--- a/include/asm-sparc/spinlock.h
+++ b/include/asm-sparc/spinlock.h
@@ -154,6 +154,10 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw)
154#define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock) 154#define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock)
155#define __raw_read_trylock(lock) generic__raw_read_trylock(lock) 155#define __raw_read_trylock(lock) generic__raw_read_trylock(lock)
156 156
157#define _raw_spin_relax(lock) cpu_relax()
158#define _raw_read_relax(lock) cpu_relax()
159#define _raw_write_relax(lock) cpu_relax()
160
157#define __raw_read_can_lock(rw) (!((rw)->lock & 0xff)) 161#define __raw_read_can_lock(rw) (!((rw)->lock & 0xff))
158#define __raw_write_can_lock(rw) (!(rw)->lock) 162#define __raw_write_can_lock(rw) (!(rw)->lock)
159 163
diff --git a/include/asm-sparc64/spinlock.h b/include/asm-sparc64/spinlock.h
index bd5ffc76bc7e..0006fe9f8c7a 100644
--- a/include/asm-sparc64/spinlock.h
+++ b/include/asm-sparc64/spinlock.h
@@ -241,6 +241,10 @@ static int inline __write_trylock(raw_rwlock_t *lock)
241#define __raw_read_can_lock(rw) (!((rw)->lock & 0x80000000UL)) 241#define __raw_read_can_lock(rw) (!((rw)->lock & 0x80000000UL))
242#define __raw_write_can_lock(rw) (!(rw)->lock) 242#define __raw_write_can_lock(rw) (!(rw)->lock)
243 243
244#define _raw_spin_relax(lock) cpu_relax()
245#define _raw_read_relax(lock) cpu_relax()
246#define _raw_write_relax(lock) cpu_relax()
247
244#endif /* !(__ASSEMBLY__) */ 248#endif /* !(__ASSEMBLY__) */
245 249
246#endif /* !(__SPARC64_SPINLOCK_H) */ 250#endif /* !(__SPARC64_SPINLOCK_H) */
diff --git a/include/asm-um/pgtable.h b/include/asm-um/pgtable.h
index 4862daf8b906..188f72621776 100644
--- a/include/asm-um/pgtable.h
+++ b/include/asm-um/pgtable.h
@@ -274,12 +274,6 @@ static inline pte_t pte_mkread(pte_t pte)
274 return(pte_mknewprot(pte)); 274 return(pte_mknewprot(pte));
275} 275}
276 276
277static inline pte_t pte_mkexec(pte_t pte)
278{
279 pte_set_bits(pte, _PAGE_USER);
280 return(pte_mknewprot(pte));
281}
282
283static inline pte_t pte_mkdirty(pte_t pte) 277static inline pte_t pte_mkdirty(pte_t pte)
284{ 278{
285 pte_set_bits(pte, _PAGE_DIRTY); 279 pte_set_bits(pte, _PAGE_DIRTY);
diff --git a/include/asm-x86_64/dma-mapping.h b/include/asm-x86_64/dma-mapping.h
index b6da83dcc7a6..10174b110a5c 100644
--- a/include/asm-x86_64/dma-mapping.h
+++ b/include/asm-x86_64/dma-mapping.h
@@ -55,13 +55,6 @@ extern dma_addr_t bad_dma_address;
55extern struct dma_mapping_ops* dma_ops; 55extern struct dma_mapping_ops* dma_ops;
56extern int iommu_merge; 56extern int iommu_merge;
57 57
58static inline int valid_dma_direction(int dma_direction)
59{
60 return ((dma_direction == DMA_BIDIRECTIONAL) ||
61 (dma_direction == DMA_TO_DEVICE) ||
62 (dma_direction == DMA_FROM_DEVICE));
63}
64
65static inline int dma_mapping_error(dma_addr_t dma_addr) 58static inline int dma_mapping_error(dma_addr_t dma_addr)
66{ 59{
67 if (dma_ops->mapping_error) 60 if (dma_ops->mapping_error)
diff --git a/include/asm-x86_64/nmi.h b/include/asm-x86_64/nmi.h
index cbf2669bca71..f367d4014b42 100644
--- a/include/asm-x86_64/nmi.h
+++ b/include/asm-x86_64/nmi.h
@@ -70,4 +70,11 @@ extern unsigned int nmi_watchdog;
70#define NMI_LOCAL_APIC 2 70#define NMI_LOCAL_APIC 2
71#define NMI_INVALID 3 71#define NMI_INVALID 3
72 72
73struct ctl_table;
74struct file;
75extern int proc_nmi_enabled(struct ctl_table *, int , struct file *,
76 void __user *, size_t *, loff_t *);
77
78extern int unknown_nmi_panic;
79
73#endif /* ASM_NMI_H */ 80#endif /* ASM_NMI_H */
diff --git a/include/asm-x86_64/semaphore.h b/include/asm-x86_64/semaphore.h
index 107bd90429e8..1194888536b9 100644
--- a/include/asm-x86_64/semaphore.h
+++ b/include/asm-x86_64/semaphore.h
@@ -132,7 +132,7 @@ static inline int down_interruptible(struct semaphore * sem)
132 "jns 2f\n\t" 132 "jns 2f\n\t"
133 "call __down_failed_interruptible\n" 133 "call __down_failed_interruptible\n"
134 "2:\n" 134 "2:\n"
135 :"=a" (result), "=m" (sem->count) 135 :"=&a" (result), "=m" (sem->count)
136 :"D" (sem) 136 :"D" (sem)
137 :"memory"); 137 :"memory");
138 return result; 138 return result;
@@ -153,7 +153,7 @@ static inline int down_trylock(struct semaphore * sem)
153 "jns 2f\n\t" 153 "jns 2f\n\t"
154 "call __down_failed_trylock\n\t" 154 "call __down_failed_trylock\n\t"
155 "2:\n" 155 "2:\n"
156 :"=a" (result), "=m" (sem->count) 156 :"=&a" (result), "=m" (sem->count)
157 :"D" (sem) 157 :"D" (sem)
158 :"memory","cc"); 158 :"memory","cc");
159 return result; 159 return result;
diff --git a/include/asm-x86_64/spinlock.h b/include/asm-x86_64/spinlock.h
index 3daf5b005905..05ef097ba55b 100644
--- a/include/asm-x86_64/spinlock.h
+++ b/include/asm-x86_64/spinlock.h
@@ -133,4 +133,8 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw)
133 : "=m" (rw->lock) : : "memory"); 133 : "=m" (rw->lock) : : "memory");
134} 134}
135 135
136#define _raw_spin_relax(lock) cpu_relax()
137#define _raw_read_relax(lock) cpu_relax()
138#define _raw_write_relax(lock) cpu_relax()
139
136#endif /* __ASM_SPINLOCK_H */ 140#endif /* __ASM_SPINLOCK_H */
diff --git a/include/asm-x86_64/uaccess.h b/include/asm-x86_64/uaccess.h
index e856570c0689..19f99178fe83 100644
--- a/include/asm-x86_64/uaccess.h
+++ b/include/asm-x86_64/uaccess.h
@@ -361,6 +361,11 @@ __must_check unsigned long clear_user(void __user *mem, unsigned long len);
361__must_check unsigned long __clear_user(void __user *mem, unsigned long len); 361__must_check unsigned long __clear_user(void __user *mem, unsigned long len);
362 362
363__must_check long __copy_from_user_inatomic(void *dst, const void __user *src, unsigned size); 363__must_check long __copy_from_user_inatomic(void *dst, const void __user *src, unsigned size);
364#define __copy_to_user_inatomic copy_user_generic 364
365static __must_check __always_inline int
366__copy_to_user_inatomic(void __user *dst, const void *src, unsigned size)
367{
368 return copy_user_generic((__force void *)dst, src, size);
369}
365 370
366#endif /* __X86_64_UACCESS_H */ 371#endif /* __X86_64_UACCESS_H */
diff --git a/include/asm-x86_64/vsyscall.h b/include/asm-x86_64/vsyscall.h
index 2281e9399b96..fd452fc2c037 100644
--- a/include/asm-x86_64/vsyscall.h
+++ b/include/asm-x86_64/vsyscall.h
@@ -17,7 +17,6 @@ enum vsyscall_num {
17 17
18#define __section_vxtime __attribute__ ((unused, __section__ (".vxtime"), aligned(16))) 18#define __section_vxtime __attribute__ ((unused, __section__ (".vxtime"), aligned(16)))
19#define __section_vgetcpu_mode __attribute__ ((unused, __section__ (".vgetcpu_mode"), aligned(16))) 19#define __section_vgetcpu_mode __attribute__ ((unused, __section__ (".vgetcpu_mode"), aligned(16)))
20#define __section_wall_jiffies __attribute__ ((unused, __section__ (".wall_jiffies"), aligned(16)))
21#define __section_jiffies __attribute__ ((unused, __section__ (".jiffies"), aligned(16))) 20#define __section_jiffies __attribute__ ((unused, __section__ (".jiffies"), aligned(16)))
22#define __section_sys_tz __attribute__ ((unused, __section__ (".sys_tz"), aligned(16))) 21#define __section_sys_tz __attribute__ ((unused, __section__ (".sys_tz"), aligned(16)))
23#define __section_sysctl_vsyscall __attribute__ ((unused, __section__ (".sysctl_vsyscall"), aligned(16))) 22#define __section_sysctl_vsyscall __attribute__ ((unused, __section__ (".sysctl_vsyscall"), aligned(16)))
@@ -48,14 +47,12 @@ extern struct vxtime_data __vxtime;
48extern int __vgetcpu_mode; 47extern int __vgetcpu_mode;
49extern struct timespec __xtime; 48extern struct timespec __xtime;
50extern volatile unsigned long __jiffies; 49extern volatile unsigned long __jiffies;
51extern unsigned long __wall_jiffies;
52extern struct timezone __sys_tz; 50extern struct timezone __sys_tz;
53extern seqlock_t __xtime_lock; 51extern seqlock_t __xtime_lock;
54 52
55/* kernel space (writeable) */ 53/* kernel space (writeable) */
56extern struct vxtime_data vxtime; 54extern struct vxtime_data vxtime;
57extern int vgetcpu_mode; 55extern int vgetcpu_mode;
58extern unsigned long wall_jiffies;
59extern struct timezone sys_tz; 56extern struct timezone sys_tz;
60extern int sysctl_vsyscall; 57extern int sysctl_vsyscall;
61extern seqlock_t xtime_lock; 58extern seqlock_t xtime_lock;
diff --git a/include/asm-xtensa/timex.h b/include/asm-xtensa/timex.h
index d14a3755a12b..c7b705e66655 100644
--- a/include/asm-xtensa/timex.h
+++ b/include/asm-xtensa/timex.h
@@ -31,9 +31,6 @@
31 31
32#define CLOCK_TICK_RATE 1193180 /* (everyone is using this value) */ 32#define CLOCK_TICK_RATE 1193180 /* (everyone is using this value) */
33#define CLOCK_TICK_FACTOR 20 /* Factor of both 10^6 and CLOCK_TICK_RATE */ 33#define CLOCK_TICK_FACTOR 20 /* Factor of both 10^6 and CLOCK_TICK_RATE */
34#define FINETUNE ((((((long)LATCH * HZ - CLOCK_TICK_RATE) << SHIFT_HZ) * \
35 (1000000/CLOCK_TICK_FACTOR) / (CLOCK_TICK_RATE/CLOCK_TICK_FACTOR)) \
36 << (SHIFT_SCALE-SHIFT_HZ)) / HZ)
37 34
38#ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT 35#ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT
39extern unsigned long ccount_per_jiffy; 36extern unsigned long ccount_per_jiffy;
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 4811ca5cdc92..839a97ee1f7c 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -59,6 +59,7 @@ header-y += elf-em.h
59header-y += fadvise.h 59header-y += fadvise.h
60header-y += fd.h 60header-y += fd.h
61header-y += fdreg.h 61header-y += fdreg.h
62header-y += fib_rules.h
62header-y += ftape-header-segment.h 63header-y += ftape-header-segment.h
63header-y += ftape-vendors.h 64header-y += ftape-vendors.h
64header-y += fuse.h 65header-y += fuse.h
@@ -71,6 +72,7 @@ header-y += hysdn_if.h
71header-y += i2c-dev.h 72header-y += i2c-dev.h
72header-y += i8k.h 73header-y += i8k.h
73header-y += icmp.h 74header-y += icmp.h
75header-y += if_addr.h
74header-y += if_arcnet.h 76header-y += if_arcnet.h
75header-y += if_arp.h 77header-y += if_arp.h
76header-y += if_bonding.h 78header-y += if_bonding.h
@@ -80,6 +82,7 @@ header-y += if_fddi.h
80header-y += if.h 82header-y += if.h
81header-y += if_hippi.h 83header-y += if_hippi.h
82header-y += if_infiniband.h 84header-y += if_infiniband.h
85header-y += if_link.h
83header-y += if_packet.h 86header-y += if_packet.h
84header-y += if_plip.h 87header-y += if_plip.h
85header-y += if_ppp.h 88header-y += if_ppp.h
@@ -112,6 +115,7 @@ header-y += mmtimer.h
112header-y += mqueue.h 115header-y += mqueue.h
113header-y += mtio.h 116header-y += mtio.h
114header-y += ncp_no.h 117header-y += ncp_no.h
118header-y += neighbour.h
115header-y += netfilter_arp.h 119header-y += netfilter_arp.h
116header-y += netrom.h 120header-y += netrom.h
117header-y += nfs2.h 121header-y += nfs2.h
diff --git a/include/linux/acct.h b/include/linux/acct.h
index e86bae7324d2..0496d1f09952 100644
--- a/include/linux/acct.h
+++ b/include/linux/acct.h
@@ -124,16 +124,12 @@ extern void acct_auto_close(struct super_block *sb);
124extern void acct_init_pacct(struct pacct_struct *pacct); 124extern void acct_init_pacct(struct pacct_struct *pacct);
125extern void acct_collect(long exitcode, int group_dead); 125extern void acct_collect(long exitcode, int group_dead);
126extern void acct_process(void); 126extern void acct_process(void);
127extern void acct_update_integrals(struct task_struct *tsk);
128extern void acct_clear_integrals(struct task_struct *tsk);
129#else 127#else
130#define acct_auto_close_mnt(x) do { } while (0) 128#define acct_auto_close_mnt(x) do { } while (0)
131#define acct_auto_close(x) do { } while (0) 129#define acct_auto_close(x) do { } while (0)
132#define acct_init_pacct(x) do { } while (0) 130#define acct_init_pacct(x) do { } while (0)
133#define acct_collect(x,y) do { } while (0) 131#define acct_collect(x,y) do { } while (0)
134#define acct_process() do { } while (0) 132#define acct_process() do { } while (0)
135#define acct_update_integrals(x) do { } while (0)
136#define acct_clear_integrals(task) do { } while (0)
137#endif 133#endif
138 134
139/* 135/*
diff --git a/include/linux/aio.h b/include/linux/aio.h
index 00c8efa95cc3..0d71c0041f13 100644
--- a/include/linux/aio.h
+++ b/include/linux/aio.h
@@ -4,8 +4,10 @@
4#include <linux/list.h> 4#include <linux/list.h>
5#include <linux/workqueue.h> 5#include <linux/workqueue.h>
6#include <linux/aio_abi.h> 6#include <linux/aio_abi.h>
7#include <linux/uio.h>
7 8
8#include <asm/atomic.h> 9#include <asm/atomic.h>
10#include <linux/uio.h>
9 11
10#define AIO_MAXSEGS 4 12#define AIO_MAXSEGS 4
11#define AIO_KIOGRP_NR_ATOMIC 8 13#define AIO_KIOGRP_NR_ATOMIC 8
@@ -110,8 +112,10 @@ struct kiocb {
110 char __user *ki_buf; /* remaining iocb->aio_buf */ 112 char __user *ki_buf; /* remaining iocb->aio_buf */
111 size_t ki_left; /* remaining bytes */ 113 size_t ki_left; /* remaining bytes */
112 long ki_retried; /* just for testing */ 114 long ki_retried; /* just for testing */
113 long ki_kicked; /* just for testing */ 115 struct iovec ki_inline_vec; /* inline vector */
114 long ki_queued; /* just for testing */ 116 struct iovec *ki_iovec;
117 unsigned long ki_nr_segs;
118 unsigned long ki_cur_seg;
115 119
116 struct list_head ki_list; /* the aio core uses this 120 struct list_head ki_list; /* the aio core uses this
117 * for cancellation */ 121 * for cancellation */
@@ -213,11 +217,11 @@ int FASTCALL(io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb,
213 struct iocb *iocb)); 217 struct iocb *iocb));
214 218
215#define get_ioctx(kioctx) do { \ 219#define get_ioctx(kioctx) do { \
216 BUG_ON(unlikely(atomic_read(&(kioctx)->users) <= 0)); \ 220 BUG_ON(atomic_read(&(kioctx)->users) <= 0); \
217 atomic_inc(&(kioctx)->users); \ 221 atomic_inc(&(kioctx)->users); \
218} while (0) 222} while (0)
219#define put_ioctx(kioctx) do { \ 223#define put_ioctx(kioctx) do { \
220 BUG_ON(unlikely(atomic_read(&(kioctx)->users) <= 0)); \ 224 BUG_ON(atomic_read(&(kioctx)->users) <= 0); \
221 if (unlikely(atomic_dec_and_test(&(kioctx)->users))) \ 225 if (unlikely(atomic_dec_and_test(&(kioctx)->users))) \
222 __put_ioctx(kioctx); \ 226 __put_ioctx(kioctx); \
223} while (0) 227} while (0)
diff --git a/include/linux/aio_abi.h b/include/linux/aio_abi.h
index 30fdcc89d142..3466b1d0ffd2 100644
--- a/include/linux/aio_abi.h
+++ b/include/linux/aio_abi.h
@@ -41,6 +41,8 @@ enum {
41 * IOCB_CMD_POLL = 5, 41 * IOCB_CMD_POLL = 5,
42 */ 42 */
43 IOCB_CMD_NOOP = 6, 43 IOCB_CMD_NOOP = 6,
44 IOCB_CMD_PREADV = 7,
45 IOCB_CMD_PWRITEV = 8,
44}; 46};
45 47
46/* read() from /dev/aio returns these structures. */ 48/* read() from /dev/aio returns these structures. */
diff --git a/include/linux/atalk.h b/include/linux/atalk.h
index 6ba3aa8a81f4..75b8baca08f3 100644
--- a/include/linux/atalk.h
+++ b/include/linux/atalk.h
@@ -88,15 +88,7 @@ static inline struct atalk_sock *at_sk(struct sock *sk)
88#include <asm/byteorder.h> 88#include <asm/byteorder.h>
89 89
90struct ddpehdr { 90struct ddpehdr {
91#ifdef __LITTLE_ENDIAN_BITFIELD 91 __be16 deh_len_hops; /* lower 10 bits are length, next 4 - hops */
92 __u16 deh_len:10,
93 deh_hops:4,
94 deh_pad:2;
95#else
96 __u16 deh_pad:2,
97 deh_hops:4,
98 deh_len:10;
99#endif
100 __be16 deh_sum; 92 __be16 deh_sum;
101 __be16 deh_dnet; 93 __be16 deh_dnet;
102 __be16 deh_snet; 94 __be16 deh_snet;
@@ -112,36 +104,6 @@ static __inline__ struct ddpehdr *ddp_hdr(struct sk_buff *skb)
112 return (struct ddpehdr *)skb->h.raw; 104 return (struct ddpehdr *)skb->h.raw;
113} 105}
114 106
115/*
116 * Don't drop the struct into the struct above. You'll get some
117 * surprise padding.
118 */
119struct ddpebits {
120#ifdef __LITTLE_ENDIAN_BITFIELD
121 __u16 deh_len:10,
122 deh_hops:4,
123 deh_pad:2;
124#else
125 __u16 deh_pad:2,
126 deh_hops:4,
127 deh_len:10;
128#endif
129};
130
131/* Short form header */
132struct ddpshdr {
133#ifdef __LITTLE_ENDIAN_BITFIELD
134 __u16 dsh_len:10,
135 dsh_pad:6;
136#else
137 __u16 dsh_pad:6,
138 dsh_len:10;
139#endif
140 __u8 dsh_dport;
141 __u8 dsh_sport;
142 /* And netatalk apps expect to stick the type in themselves */
143};
144
145/* AppleTalk AARP headers */ 107/* AppleTalk AARP headers */
146struct elapaarp { 108struct elapaarp {
147 __be16 hw_type; 109 __be16 hw_type;
diff --git a/include/linux/atmlec.h b/include/linux/atmlec.h
index f267f2442766..6f5a1bab8f50 100644
--- a/include/linux/atmlec.h
+++ b/include/linux/atmlec.h
@@ -1,9 +1,7 @@
1/* 1/*
2 * 2 * ATM Lan Emulation Daemon driver interface
3 * ATM Lan Emulation Daemon vs. driver interface
4 *
5 * mkiiskila@yahoo.com
6 * 3 *
4 * Marko Kiiskila <mkiiskila@yahoo.com>
7 */ 5 */
8 6
9#ifndef _ATMLEC_H_ 7#ifndef _ATMLEC_H_
@@ -13,76 +11,87 @@
13#include <linux/atmioc.h> 11#include <linux/atmioc.h>
14#include <linux/atm.h> 12#include <linux/atm.h>
15#include <linux/if_ether.h> 13#include <linux/if_ether.h>
14
16/* ATM lec daemon control socket */ 15/* ATM lec daemon control socket */
17#define ATMLEC_CTRL _IO('a',ATMIOC_LANE) 16#define ATMLEC_CTRL _IO('a', ATMIOC_LANE)
18#define ATMLEC_DATA _IO('a',ATMIOC_LANE+1) 17#define ATMLEC_DATA _IO('a', ATMIOC_LANE+1)
19#define ATMLEC_MCAST _IO('a',ATMIOC_LANE+2) 18#define ATMLEC_MCAST _IO('a', ATMIOC_LANE+2)
20 19
21/* Maximum number of LEC interfaces (tweakable) */ 20/* Maximum number of LEC interfaces (tweakable) */
22#define MAX_LEC_ITF 48 21#define MAX_LEC_ITF 48
23 22
24/* From the total of MAX_LEC_ITF, last NUM_TR_DEVS are reserved for Token Ring. 23/*
24 * From the total of MAX_LEC_ITF, last NUM_TR_DEVS are reserved for Token Ring.
25 * E.g. if MAX_LEC_ITF = 48 and NUM_TR_DEVS = 8, then lec0-lec39 are for 25 * E.g. if MAX_LEC_ITF = 48 and NUM_TR_DEVS = 8, then lec0-lec39 are for
26 * Ethernet ELANs and lec40-lec47 are for Token Ring ELANS. 26 * Ethernet ELANs and lec40-lec47 are for Token Ring ELANS.
27 */ 27 */
28#define NUM_TR_DEVS 8 28#define NUM_TR_DEVS 8
29 29
30typedef enum { 30typedef enum {
31 l_set_mac_addr, l_del_mac_addr, 31 l_set_mac_addr,
32 l_svc_setup, 32 l_del_mac_addr,
33 l_addr_delete, l_topology_change, 33 l_svc_setup,
34 l_flush_complete, l_arp_update, 34 l_addr_delete,
35 l_narp_req, /* LANE2 mandates the use of this */ 35 l_topology_change,
36 l_config, l_flush_tran_id, 36 l_flush_complete,
37 l_set_lecid, l_arp_xmt, 37 l_arp_update,
38 l_rdesc_arp_xmt, 38 l_narp_req, /* LANE2 mandates the use of this */
39 l_associate_req, 39 l_config,
40 l_should_bridge /* should we bridge this MAC? */ 40 l_flush_tran_id,
41 l_set_lecid,
42 l_arp_xmt,
43 l_rdesc_arp_xmt,
44 l_associate_req,
45 l_should_bridge /* should we bridge this MAC? */
41} atmlec_msg_type; 46} atmlec_msg_type;
42 47
43#define ATMLEC_MSG_TYPE_MAX l_should_bridge 48#define ATMLEC_MSG_TYPE_MAX l_should_bridge
44 49
45struct atmlec_config_msg { 50struct atmlec_config_msg {
46 unsigned int maximum_unknown_frame_count; 51 unsigned int maximum_unknown_frame_count;
47 unsigned int max_unknown_frame_time; 52 unsigned int max_unknown_frame_time;
48 unsigned short max_retry_count; 53 unsigned short max_retry_count;
49 unsigned int aging_time; 54 unsigned int aging_time;
50 unsigned int forward_delay_time; 55 unsigned int forward_delay_time;
51 unsigned int arp_response_time; 56 unsigned int arp_response_time;
52 unsigned int flush_timeout; 57 unsigned int flush_timeout;
53 unsigned int path_switching_delay; 58 unsigned int path_switching_delay;
54 unsigned int lane_version; /* LANE2: 1 for LANEv1, 2 for LANEv2 */ 59 unsigned int lane_version; /* LANE2: 1 for LANEv1, 2 for LANEv2 */
55 int mtu; 60 int mtu;
56 int is_proxy; 61 int is_proxy;
57}; 62};
58 63
59struct atmlec_msg { 64struct atmlec_msg {
60 atmlec_msg_type type; 65 atmlec_msg_type type;
61 int sizeoftlvs; /* LANE2: if != 0, tlvs follow */ 66 int sizeoftlvs; /* LANE2: if != 0, tlvs follow */
62 union { 67 union {
63 struct { 68 struct {
64 unsigned char mac_addr[ETH_ALEN]; 69 unsigned char mac_addr[ETH_ALEN];
65 unsigned char atm_addr[ATM_ESA_LEN]; 70 unsigned char atm_addr[ATM_ESA_LEN];
66 unsigned int flag;/* Topology_change flag, 71 unsigned int flag; /*
67 remoteflag, permanent flag, 72 * Topology_change flag,
68 lecid, transaction id */ 73 * remoteflag, permanent flag,
69 unsigned int targetless_le_arp; /* LANE2 */ 74 * lecid, transaction id
70 unsigned int no_source_le_narp; /* LANE2 */ 75 */
71 } normal; 76 unsigned int targetless_le_arp; /* LANE2 */
72 struct atmlec_config_msg config; 77 unsigned int no_source_le_narp; /* LANE2 */
73 struct { 78 } normal;
74 uint16_t lec_id; /* requestor lec_id */ 79 struct atmlec_config_msg config;
75 uint32_t tran_id; /* transaction id */ 80 struct {
76 unsigned char mac_addr[ETH_ALEN]; /* dst mac addr */ 81 uint16_t lec_id; /* requestor lec_id */
77 unsigned char atm_addr[ATM_ESA_LEN]; /* reqestor ATM addr */ 82 uint32_t tran_id; /* transaction id */
78 } proxy; 83 unsigned char mac_addr[ETH_ALEN]; /* dst mac addr */
79 /* For mapping LE_ARP requests to responses. Filled by */ 84 unsigned char atm_addr[ATM_ESA_LEN]; /* reqestor ATM addr */
80 } content; /* zeppelin, returned by kernel. Used only when proxying */ 85 } proxy; /*
86 * For mapping LE_ARP requests to responses. Filled by
87 * zeppelin, returned by kernel. Used only when proxying
88 */
89 } content;
81} __ATM_API_ALIGN; 90} __ATM_API_ALIGN;
82 91
83struct atmlec_ioc { 92struct atmlec_ioc {
84 int dev_num; 93 int dev_num;
85 unsigned char atm_addr[ATM_ESA_LEN]; 94 unsigned char atm_addr[ATM_ESA_LEN];
86 unsigned char receive; /* 1= receive vcc, 0 = send vcc */ 95 unsigned char receive; /* 1= receive vcc, 0 = send vcc */
87}; 96};
88#endif /* _ATMLEC_H_ */ 97#endif /* _ATMLEC_H_ */
diff --git a/include/linux/audit.h b/include/linux/audit.h
index 40a6c26294ae..c3aa09751814 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -95,6 +95,11 @@
95#define AUDIT_MAC_POLICY_LOAD 1403 /* Policy file load */ 95#define AUDIT_MAC_POLICY_LOAD 1403 /* Policy file load */
96#define AUDIT_MAC_STATUS 1404 /* Changed enforcing,permissive,off */ 96#define AUDIT_MAC_STATUS 1404 /* Changed enforcing,permissive,off */
97#define AUDIT_MAC_CONFIG_CHANGE 1405 /* Changes to booleans */ 97#define AUDIT_MAC_CONFIG_CHANGE 1405 /* Changes to booleans */
98#define AUDIT_MAC_UNLBL_ALLOW 1406 /* NetLabel: allow unlabeled traffic */
99#define AUDIT_MAC_CIPSOV4_ADD 1407 /* NetLabel: add CIPSOv4 DOI entry */
100#define AUDIT_MAC_CIPSOV4_DEL 1408 /* NetLabel: del CIPSOv4 DOI entry */
101#define AUDIT_MAC_MAP_ADD 1409 /* NetLabel: add LSM domain mapping */
102#define AUDIT_MAC_MAP_DEL 1410 /* NetLabel: del LSM domain mapping */
98 103
99#define AUDIT_FIRST_KERN_ANOM_MSG 1700 104#define AUDIT_FIRST_KERN_ANOM_MSG 1700
100#define AUDIT_LAST_KERN_ANOM_MSG 1799 105#define AUDIT_LAST_KERN_ANOM_MSG 1799
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 76bdaeab6f62..711c321a7011 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -148,6 +148,7 @@ struct bio {
148#define BIO_RW_BARRIER 2 148#define BIO_RW_BARRIER 2
149#define BIO_RW_FAILFAST 3 149#define BIO_RW_FAILFAST 3
150#define BIO_RW_SYNC 4 150#define BIO_RW_SYNC 4
151#define BIO_RW_META 5
151 152
152/* 153/*
153 * upper 16 bits of bi_rw define the io priority of this bio 154 * upper 16 bits of bi_rw define the io priority of this bio
@@ -178,6 +179,7 @@ struct bio {
178#define bio_sync(bio) ((bio)->bi_rw & (1 << BIO_RW_SYNC)) 179#define bio_sync(bio) ((bio)->bi_rw & (1 << BIO_RW_SYNC))
179#define bio_failfast(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST)) 180#define bio_failfast(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST))
180#define bio_rw_ahead(bio) ((bio)->bi_rw & (1 << BIO_RW_AHEAD)) 181#define bio_rw_ahead(bio) ((bio)->bi_rw & (1 << BIO_RW_AHEAD))
182#define bio_rw_meta(bio) ((bio)->bi_rw & (1 << BIO_RW_META))
181 183
182/* 184/*
183 * will die 185 * will die
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index c773ee545ebd..1d79b8d4ca6d 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1,6 +1,7 @@
1#ifndef _LINUX_BLKDEV_H 1#ifndef _LINUX_BLKDEV_H
2#define _LINUX_BLKDEV_H 2#define _LINUX_BLKDEV_H
3 3
4#include <linux/sched.h>
4#include <linux/major.h> 5#include <linux/major.h>
5#include <linux/genhd.h> 6#include <linux/genhd.h>
6#include <linux/list.h> 7#include <linux/list.h>
@@ -16,6 +17,22 @@
16 17
17#include <asm/scatterlist.h> 18#include <asm/scatterlist.h>
18 19
20#ifdef CONFIG_LBD
21# include <asm/div64.h>
22# define sector_div(a, b) do_div(a, b)
23#else
24# define sector_div(n, b)( \
25{ \
26 int _res; \
27 _res = (n) % (b); \
28 (n) /= (b); \
29 _res; \
30} \
31)
32#endif
33
34#ifdef CONFIG_BLOCK
35
19struct scsi_ioctl_command; 36struct scsi_ioctl_command;
20 37
21struct request_queue; 38struct request_queue;
@@ -90,7 +107,7 @@ struct io_context {
90 atomic_t refcount; 107 atomic_t refcount;
91 struct task_struct *task; 108 struct task_struct *task;
92 109
93 int (*set_ioprio)(struct io_context *, unsigned int); 110 unsigned int ioprio_changed;
94 111
95 /* 112 /*
96 * For request batching 113 * For request batching
@@ -104,8 +121,7 @@ struct io_context {
104 121
105void put_io_context(struct io_context *ioc); 122void put_io_context(struct io_context *ioc);
106void exit_io_context(void); 123void exit_io_context(void);
107struct io_context *current_io_context(gfp_t gfp_flags); 124struct io_context *get_io_context(gfp_t gfp_flags, int node);
108struct io_context *get_io_context(gfp_t gfp_flags);
109void copy_io_context(struct io_context **pdst, struct io_context **psrc); 125void copy_io_context(struct io_context **pdst, struct io_context **psrc);
110void swap_io_context(struct io_context **ioc1, struct io_context **ioc2); 126void swap_io_context(struct io_context **ioc1, struct io_context **ioc2);
111 127
@@ -120,6 +136,90 @@ struct request_list {
120 wait_queue_head_t wait[2]; 136 wait_queue_head_t wait[2];
121}; 137};
122 138
139/*
140 * request command types
141 */
142enum rq_cmd_type_bits {
143 REQ_TYPE_FS = 1, /* fs request */
144 REQ_TYPE_BLOCK_PC, /* scsi command */
145 REQ_TYPE_SENSE, /* sense request */
146 REQ_TYPE_PM_SUSPEND, /* suspend request */
147 REQ_TYPE_PM_RESUME, /* resume request */
148 REQ_TYPE_PM_SHUTDOWN, /* shutdown request */
149 REQ_TYPE_FLUSH, /* flush request */
150 REQ_TYPE_SPECIAL, /* driver defined type */
151 REQ_TYPE_LINUX_BLOCK, /* generic block layer message */
152 /*
153 * for ATA/ATAPI devices. this really doesn't belong here, ide should
154 * use REQ_TYPE_SPECIAL and use rq->cmd[0] with the range of driver
155 * private REQ_LB opcodes to differentiate what type of request this is
156 */
157 REQ_TYPE_ATA_CMD,
158 REQ_TYPE_ATA_TASK,
159 REQ_TYPE_ATA_TASKFILE,
160};
161
162/*
163 * For request of type REQ_TYPE_LINUX_BLOCK, rq->cmd[0] is the opcode being
164 * sent down (similar to how REQ_TYPE_BLOCK_PC means that ->cmd[] holds a
165 * SCSI cdb.
166 *
167 * 0x00 -> 0x3f are driver private, to be used for whatever purpose they need,
168 * typically to differentiate REQ_TYPE_SPECIAL requests.
169 *
170 */
171enum {
172 /*
173 * just examples for now
174 */
175 REQ_LB_OP_EJECT = 0x40, /* eject request */
176 REQ_LB_OP_FLUSH = 0x41, /* flush device */
177};
178
179/*
180 * request type modified bits. first three bits match BIO_RW* bits, important
181 */
182enum rq_flag_bits {
183 __REQ_RW, /* not set, read. set, write */
184 __REQ_FAILFAST, /* no low level driver retries */
185 __REQ_SORTED, /* elevator knows about this request */
186 __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */
187 __REQ_HARDBARRIER, /* may not be passed by drive either */
188 __REQ_FUA, /* forced unit access */
189 __REQ_NOMERGE, /* don't touch this for merging */
190 __REQ_STARTED, /* drive already may have started this one */
191 __REQ_DONTPREP, /* don't call prep for this one */
192 __REQ_QUEUED, /* uses queueing */
193 __REQ_ELVPRIV, /* elevator private data attached */
194 __REQ_FAILED, /* set if the request failed */
195 __REQ_QUIET, /* don't worry about errors */
196 __REQ_PREEMPT, /* set for "ide_preempt" requests */
197 __REQ_ORDERED_COLOR, /* is before or after barrier */
198 __REQ_RW_SYNC, /* request is sync (O_DIRECT) */
199 __REQ_ALLOCED, /* request came from our alloc pool */
200 __REQ_RW_META, /* metadata io request */
201 __REQ_NR_BITS, /* stops here */
202};
203
204#define REQ_RW (1 << __REQ_RW)
205#define REQ_FAILFAST (1 << __REQ_FAILFAST)
206#define REQ_SORTED (1 << __REQ_SORTED)
207#define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER)
208#define REQ_HARDBARRIER (1 << __REQ_HARDBARRIER)
209#define REQ_FUA (1 << __REQ_FUA)
210#define REQ_NOMERGE (1 << __REQ_NOMERGE)
211#define REQ_STARTED (1 << __REQ_STARTED)
212#define REQ_DONTPREP (1 << __REQ_DONTPREP)
213#define REQ_QUEUED (1 << __REQ_QUEUED)
214#define REQ_ELVPRIV (1 << __REQ_ELVPRIV)
215#define REQ_FAILED (1 << __REQ_FAILED)
216#define REQ_QUIET (1 << __REQ_QUIET)
217#define REQ_PREEMPT (1 << __REQ_PREEMPT)
218#define REQ_ORDERED_COLOR (1 << __REQ_ORDERED_COLOR)
219#define REQ_RW_SYNC (1 << __REQ_RW_SYNC)
220#define REQ_ALLOCED (1 << __REQ_ALLOCED)
221#define REQ_RW_META (1 << __REQ_RW_META)
222
123#define BLK_MAX_CDB 16 223#define BLK_MAX_CDB 16
124 224
125/* 225/*
@@ -129,30 +229,46 @@ struct request {
129 struct list_head queuelist; 229 struct list_head queuelist;
130 struct list_head donelist; 230 struct list_head donelist;
131 231
132 unsigned long flags; /* see REQ_ bits below */ 232 request_queue_t *q;
233
234 unsigned int cmd_flags;
235 enum rq_cmd_type_bits cmd_type;
133 236
134 /* Maintain bio traversal state for part by part I/O submission. 237 /* Maintain bio traversal state for part by part I/O submission.
135 * hard_* are block layer internals, no driver should touch them! 238 * hard_* are block layer internals, no driver should touch them!
136 */ 239 */
137 240
138 sector_t sector; /* next sector to submit */ 241 sector_t sector; /* next sector to submit */
242 sector_t hard_sector; /* next sector to complete */
139 unsigned long nr_sectors; /* no. of sectors left to submit */ 243 unsigned long nr_sectors; /* no. of sectors left to submit */
244 unsigned long hard_nr_sectors; /* no. of sectors left to complete */
140 /* no. of sectors left to submit in the current segment */ 245 /* no. of sectors left to submit in the current segment */
141 unsigned int current_nr_sectors; 246 unsigned int current_nr_sectors;
142 247
143 sector_t hard_sector; /* next sector to complete */
144 unsigned long hard_nr_sectors; /* no. of sectors left to complete */
145 /* no. of sectors left to complete in the current segment */ 248 /* no. of sectors left to complete in the current segment */
146 unsigned int hard_cur_sectors; 249 unsigned int hard_cur_sectors;
147 250
148 struct bio *bio; 251 struct bio *bio;
149 struct bio *biotail; 252 struct bio *biotail;
150 253
254 struct hlist_node hash; /* merge hash */
255 /*
256 * The rb_node is only used inside the io scheduler, requests
257 * are pruned when moved to the dispatch queue. So let the
258 * completion_data share space with the rb_node.
259 */
260 union {
261 struct rb_node rb_node; /* sort/lookup */
262 void *completion_data;
263 };
264
265 /*
266 * two pointers are available for the IO schedulers, if they need
267 * more they have to dynamically allocate it.
268 */
151 void *elevator_private; 269 void *elevator_private;
152 void *completion_data; 270 void *elevator_private2;
153 271
154 int rq_status; /* should split this into a few status bits */
155 int errors;
156 struct gendisk *rq_disk; 272 struct gendisk *rq_disk;
157 unsigned long start_time; 273 unsigned long start_time;
158 274
@@ -170,15 +286,13 @@ struct request {
170 286
171 unsigned short ioprio; 287 unsigned short ioprio;
172 288
289 void *special;
290 char *buffer;
291
173 int tag; 292 int tag;
293 int errors;
174 294
175 int ref_count; 295 int ref_count;
176 request_queue_t *q;
177 struct request_list *rl;
178
179 struct completion *waiting;
180 void *special;
181 char *buffer;
182 296
183 /* 297 /*
184 * when request is used as a packet command carrier 298 * when request is used as a packet command carrier
@@ -195,80 +309,14 @@ struct request {
195 int retries; 309 int retries;
196 310
197 /* 311 /*
198 * completion callback. end_io_data should be folded in with waiting 312 * completion callback.
199 */ 313 */
200 rq_end_io_fn *end_io; 314 rq_end_io_fn *end_io;
201 void *end_io_data; 315 void *end_io_data;
202}; 316};
203 317
204/* 318/*
205 * first three bits match BIO_RW* bits, important 319 * State information carried for REQ_TYPE_PM_SUSPEND and REQ_TYPE_PM_RESUME
206 */
207enum rq_flag_bits {
208 __REQ_RW, /* not set, read. set, write */
209 __REQ_FAILFAST, /* no low level driver retries */
210 __REQ_SORTED, /* elevator knows about this request */
211 __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */
212 __REQ_HARDBARRIER, /* may not be passed by drive either */
213 __REQ_FUA, /* forced unit access */
214 __REQ_CMD, /* is a regular fs rw request */
215 __REQ_NOMERGE, /* don't touch this for merging */
216 __REQ_STARTED, /* drive already may have started this one */
217 __REQ_DONTPREP, /* don't call prep for this one */
218 __REQ_QUEUED, /* uses queueing */
219 __REQ_ELVPRIV, /* elevator private data attached */
220 /*
221 * for ATA/ATAPI devices
222 */
223 __REQ_PC, /* packet command (special) */
224 __REQ_BLOCK_PC, /* queued down pc from block layer */
225 __REQ_SENSE, /* sense retrival */
226
227 __REQ_FAILED, /* set if the request failed */
228 __REQ_QUIET, /* don't worry about errors */
229 __REQ_SPECIAL, /* driver suplied command */
230 __REQ_DRIVE_CMD,
231 __REQ_DRIVE_TASK,
232 __REQ_DRIVE_TASKFILE,
233 __REQ_PREEMPT, /* set for "ide_preempt" requests */
234 __REQ_PM_SUSPEND, /* suspend request */
235 __REQ_PM_RESUME, /* resume request */
236 __REQ_PM_SHUTDOWN, /* shutdown request */
237 __REQ_ORDERED_COLOR, /* is before or after barrier */
238 __REQ_RW_SYNC, /* request is sync (O_DIRECT) */
239 __REQ_NR_BITS, /* stops here */
240};
241
242#define REQ_RW (1 << __REQ_RW)
243#define REQ_FAILFAST (1 << __REQ_FAILFAST)
244#define REQ_SORTED (1 << __REQ_SORTED)
245#define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER)
246#define REQ_HARDBARRIER (1 << __REQ_HARDBARRIER)
247#define REQ_FUA (1 << __REQ_FUA)
248#define REQ_CMD (1 << __REQ_CMD)
249#define REQ_NOMERGE (1 << __REQ_NOMERGE)
250#define REQ_STARTED (1 << __REQ_STARTED)
251#define REQ_DONTPREP (1 << __REQ_DONTPREP)
252#define REQ_QUEUED (1 << __REQ_QUEUED)
253#define REQ_ELVPRIV (1 << __REQ_ELVPRIV)
254#define REQ_PC (1 << __REQ_PC)
255#define REQ_BLOCK_PC (1 << __REQ_BLOCK_PC)
256#define REQ_SENSE (1 << __REQ_SENSE)
257#define REQ_FAILED (1 << __REQ_FAILED)
258#define REQ_QUIET (1 << __REQ_QUIET)
259#define REQ_SPECIAL (1 << __REQ_SPECIAL)
260#define REQ_DRIVE_CMD (1 << __REQ_DRIVE_CMD)
261#define REQ_DRIVE_TASK (1 << __REQ_DRIVE_TASK)
262#define REQ_DRIVE_TASKFILE (1 << __REQ_DRIVE_TASKFILE)
263#define REQ_PREEMPT (1 << __REQ_PREEMPT)
264#define REQ_PM_SUSPEND (1 << __REQ_PM_SUSPEND)
265#define REQ_PM_RESUME (1 << __REQ_PM_RESUME)
266#define REQ_PM_SHUTDOWN (1 << __REQ_PM_SHUTDOWN)
267#define REQ_ORDERED_COLOR (1 << __REQ_ORDERED_COLOR)
268#define REQ_RW_SYNC (1 << __REQ_RW_SYNC)
269
270/*
271 * State information carried for REQ_PM_SUSPEND and REQ_PM_RESUME
272 * requests. Some step values could eventually be made generic. 320 * requests. Some step values could eventually be made generic.
273 */ 321 */
274struct request_pm_state 322struct request_pm_state
@@ -417,9 +465,9 @@ struct request_queue
417 unsigned int sg_timeout; 465 unsigned int sg_timeout;
418 unsigned int sg_reserved_size; 466 unsigned int sg_reserved_size;
419 int node; 467 int node;
420 468#ifdef CONFIG_BLK_DEV_IO_TRACE
421 struct blk_trace *blk_trace; 469 struct blk_trace *blk_trace;
422 470#endif
423 /* 471 /*
424 * reserved for flush operations 472 * reserved for flush operations
425 */ 473 */
@@ -432,9 +480,6 @@ struct request_queue
432 struct mutex sysfs_lock; 480 struct mutex sysfs_lock;
433}; 481};
434 482
435#define RQ_INACTIVE (-1)
436#define RQ_ACTIVE 1
437
438#define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */ 483#define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */
439#define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */ 484#define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */
440#define QUEUE_FLAG_STOPPED 2 /* queue is stopped */ 485#define QUEUE_FLAG_STOPPED 2 /* queue is stopped */
@@ -490,25 +535,34 @@ enum {
490#define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) 535#define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags)
491#define blk_queue_flushing(q) ((q)->ordseq) 536#define blk_queue_flushing(q) ((q)->ordseq)
492 537
493#define blk_fs_request(rq) ((rq)->flags & REQ_CMD) 538#define blk_fs_request(rq) ((rq)->cmd_type == REQ_TYPE_FS)
494#define blk_pc_request(rq) ((rq)->flags & REQ_BLOCK_PC) 539#define blk_pc_request(rq) ((rq)->cmd_type == REQ_TYPE_BLOCK_PC)
495#define blk_noretry_request(rq) ((rq)->flags & REQ_FAILFAST) 540#define blk_special_request(rq) ((rq)->cmd_type == REQ_TYPE_SPECIAL)
496#define blk_rq_started(rq) ((rq)->flags & REQ_STARTED) 541#define blk_sense_request(rq) ((rq)->cmd_type == REQ_TYPE_SENSE)
542
543#define blk_noretry_request(rq) ((rq)->cmd_flags & REQ_FAILFAST)
544#define blk_rq_started(rq) ((rq)->cmd_flags & REQ_STARTED)
497 545
498#define blk_account_rq(rq) (blk_rq_started(rq) && blk_fs_request(rq)) 546#define blk_account_rq(rq) (blk_rq_started(rq) && blk_fs_request(rq))
499 547
500#define blk_pm_suspend_request(rq) ((rq)->flags & REQ_PM_SUSPEND) 548#define blk_pm_suspend_request(rq) ((rq)->cmd_type == REQ_TYPE_PM_SUSPEND)
501#define blk_pm_resume_request(rq) ((rq)->flags & REQ_PM_RESUME) 549#define blk_pm_resume_request(rq) ((rq)->cmd_type == REQ_TYPE_PM_RESUME)
502#define blk_pm_request(rq) \ 550#define blk_pm_request(rq) \
503 ((rq)->flags & (REQ_PM_SUSPEND | REQ_PM_RESUME)) 551 (blk_pm_suspend_request(rq) || blk_pm_resume_request(rq))
504 552
505#define blk_sorted_rq(rq) ((rq)->flags & REQ_SORTED) 553#define blk_sorted_rq(rq) ((rq)->cmd_flags & REQ_SORTED)
506#define blk_barrier_rq(rq) ((rq)->flags & REQ_HARDBARRIER) 554#define blk_barrier_rq(rq) ((rq)->cmd_flags & REQ_HARDBARRIER)
507#define blk_fua_rq(rq) ((rq)->flags & REQ_FUA) 555#define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA)
508 556
509#define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist) 557#define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist)
510 558
511#define rq_data_dir(rq) ((rq)->flags & 1) 559#define rq_data_dir(rq) ((rq)->cmd_flags & 1)
560
561/*
562 * We regard a request as sync, if it's a READ or a SYNC write.
563 */
564#define rq_is_sync(rq) (rq_data_dir((rq)) == READ || (rq)->cmd_flags & REQ_RW_SYNC)
565#define rq_is_meta(rq) ((rq)->cmd_flags & REQ_RW_META)
512 566
513static inline int blk_queue_full(struct request_queue *q, int rw) 567static inline int blk_queue_full(struct request_queue *q, int rw)
514{ 568{
@@ -541,13 +595,7 @@ static inline void blk_clear_queue_full(struct request_queue *q, int rw)
541#define RQ_NOMERGE_FLAGS \ 595#define RQ_NOMERGE_FLAGS \
542 (REQ_NOMERGE | REQ_STARTED | REQ_HARDBARRIER | REQ_SOFTBARRIER) 596 (REQ_NOMERGE | REQ_STARTED | REQ_HARDBARRIER | REQ_SOFTBARRIER)
543#define rq_mergeable(rq) \ 597#define rq_mergeable(rq) \
544 (!((rq)->flags & RQ_NOMERGE_FLAGS) && blk_fs_request((rq))) 598 (!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && blk_fs_request((rq)))
545
546/*
547 * noop, requests are automagically marked as active/inactive by I/O
548 * scheduler -- see elv_next_request
549 */
550#define blk_queue_headactive(q, head_active)
551 599
552/* 600/*
553 * q->prep_rq_fn return values 601 * q->prep_rq_fn return values
@@ -586,11 +634,6 @@ static inline void blk_queue_bounce(request_queue_t *q, struct bio **bio)
586 if ((rq->bio)) \ 634 if ((rq->bio)) \
587 for (_bio = (rq)->bio; _bio; _bio = _bio->bi_next) 635 for (_bio = (rq)->bio; _bio; _bio = _bio->bi_next)
588 636
589struct sec_size {
590 unsigned block_size;
591 unsigned block_size_bits;
592};
593
594extern int blk_register_queue(struct gendisk *disk); 637extern int blk_register_queue(struct gendisk *disk);
595extern void blk_unregister_queue(struct gendisk *disk); 638extern void blk_unregister_queue(struct gendisk *disk);
596extern void register_disk(struct gendisk *dev); 639extern void register_disk(struct gendisk *dev);
@@ -612,6 +655,7 @@ extern void blk_stop_queue(request_queue_t *q);
612extern void blk_sync_queue(struct request_queue *q); 655extern void blk_sync_queue(struct request_queue *q);
613extern void __blk_stop_queue(request_queue_t *q); 656extern void __blk_stop_queue(request_queue_t *q);
614extern void blk_run_queue(request_queue_t *); 657extern void blk_run_queue(request_queue_t *);
658extern void blk_start_queueing(request_queue_t *);
615extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *); 659extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *);
616extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned int); 660extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned int);
617extern int blk_rq_unmap_user(struct bio *, unsigned int); 661extern int blk_rq_unmap_user(struct bio *, unsigned int);
@@ -655,16 +699,6 @@ extern void end_that_request_last(struct request *, int);
655extern void end_request(struct request *req, int uptodate); 699extern void end_request(struct request *req, int uptodate);
656extern void blk_complete_request(struct request *); 700extern void blk_complete_request(struct request *);
657 701
658static inline int rq_all_done(struct request *rq, unsigned int nr_bytes)
659{
660 if (blk_fs_request(rq))
661 return (nr_bytes >= (rq->hard_nr_sectors << 9));
662 else if (blk_pc_request(rq))
663 return nr_bytes >= rq->data_len;
664
665 return 0;
666}
667
668/* 702/*
669 * end_that_request_first/chunk() takes an uptodate argument. we account 703 * end_that_request_first/chunk() takes an uptodate argument. we account
670 * any value <= as an io error. 0 means -EIO for compatability reasons, 704 * any value <= as an io error. 0 means -EIO for compatability reasons,
@@ -679,21 +713,6 @@ static inline void blkdev_dequeue_request(struct request *req)
679} 713}
680 714
681/* 715/*
682 * This should be in elevator.h, but that requires pulling in rq and q
683 */
684static inline void elv_dispatch_add_tail(struct request_queue *q,
685 struct request *rq)
686{
687 if (q->last_merge == rq)
688 q->last_merge = NULL;
689 q->nr_sorted--;
690
691 q->end_sector = rq_end_sector(rq);
692 q->boundary_rq = rq;
693 list_add_tail(&rq->queuelist, &q->queue_head);
694}
695
696/*
697 * Access functions for manipulating queue properties 716 * Access functions for manipulating queue properties
698 */ 717 */
699extern request_queue_t *blk_init_queue_node(request_fn_proc *rfn, 718extern request_queue_t *blk_init_queue_node(request_fn_proc *rfn,
@@ -737,7 +756,7 @@ extern void blk_put_queue(request_queue_t *);
737 */ 756 */
738#define blk_queue_tag_depth(q) ((q)->queue_tags->busy) 757#define blk_queue_tag_depth(q) ((q)->queue_tags->busy)
739#define blk_queue_tag_queue(q) ((q)->queue_tags->busy < (q)->queue_tags->max_depth) 758#define blk_queue_tag_queue(q) ((q)->queue_tags->busy < (q)->queue_tags->max_depth)
740#define blk_rq_tagged(rq) ((rq)->flags & REQ_QUEUED) 759#define blk_rq_tagged(rq) ((rq)->cmd_flags & REQ_QUEUED)
741extern int blk_queue_start_tag(request_queue_t *, struct request *); 760extern int blk_queue_start_tag(request_queue_t *, struct request *);
742extern struct request *blk_queue_find_tag(request_queue_t *, int); 761extern struct request *blk_queue_find_tag(request_queue_t *, int);
743extern void blk_queue_end_tag(request_queue_t *, struct request *); 762extern void blk_queue_end_tag(request_queue_t *, struct request *);
@@ -787,14 +806,6 @@ static inline int queue_dma_alignment(request_queue_t *q)
787 return retval; 806 return retval;
788} 807}
789 808
790static inline int bdev_dma_aligment(struct block_device *bdev)
791{
792 return queue_dma_alignment(bdev_get_queue(bdev));
793}
794
795#define blk_finished_io(nsects) do { } while (0)
796#define blk_started_io(nsects) do { } while (0)
797
798/* assumes size > 256 */ 809/* assumes size > 256 */
799static inline unsigned int blksize_bits(unsigned int size) 810static inline unsigned int blksize_bits(unsigned int size)
800{ 811{
@@ -824,24 +835,32 @@ struct work_struct;
824int kblockd_schedule_work(struct work_struct *work); 835int kblockd_schedule_work(struct work_struct *work);
825void kblockd_flush(void); 836void kblockd_flush(void);
826 837
827#ifdef CONFIG_LBD
828# include <asm/div64.h>
829# define sector_div(a, b) do_div(a, b)
830#else
831# define sector_div(n, b)( \
832{ \
833 int _res; \
834 _res = (n) % (b); \
835 (n) /= (b); \
836 _res; \
837} \
838)
839#endif
840
841#define MODULE_ALIAS_BLOCKDEV(major,minor) \ 838#define MODULE_ALIAS_BLOCKDEV(major,minor) \
842 MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor)) 839 MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor))
843#define MODULE_ALIAS_BLOCKDEV_MAJOR(major) \ 840#define MODULE_ALIAS_BLOCKDEV_MAJOR(major) \
844 MODULE_ALIAS("block-major-" __stringify(major) "-*") 841 MODULE_ALIAS("block-major-" __stringify(major) "-*")
845 842
846 843
844#else /* CONFIG_BLOCK */
845/*
846 * stubs for when the block layer is configured out
847 */
848#define buffer_heads_over_limit 0
849
850static inline long blk_congestion_wait(int rw, long timeout)
851{
852 return io_schedule_timeout(timeout);
853}
854
855static inline long nr_blockdev_pages(void)
856{
857 return 0;
858}
859
860static inline void exit_io_context(void)
861{
862}
863
864#endif /* CONFIG_BLOCK */
865
847#endif 866#endif
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
index 7520cc1ff9e2..b99a714fcac6 100644
--- a/include/linux/blktrace_api.h
+++ b/include/linux/blktrace_api.h
@@ -20,6 +20,7 @@ enum blktrace_cat {
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 BLK_TC_AHEAD = 1 << 11, /* readahead */
23 BLK_TC_META = 1 << 12, /* metadata */
23 24
24 BLK_TC_END = 1 << 15, /* only 16-bits, reminder */ 25 BLK_TC_END = 1 << 15, /* only 16-bits, reminder */
25}; 26};
@@ -148,7 +149,7 @@ static inline void blk_add_trace_rq(struct request_queue *q, struct request *rq,
148 u32 what) 149 u32 what)
149{ 150{
150 struct blk_trace *bt = q->blk_trace; 151 struct blk_trace *bt = q->blk_trace;
151 int rw = rq->flags & 0x03; 152 int rw = rq->cmd_flags & 0x03;
152 153
153 if (likely(!bt)) 154 if (likely(!bt))
154 return; 155 return;
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index 737e407d0cd1..131ffd37e716 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -14,6 +14,8 @@
14#include <linux/wait.h> 14#include <linux/wait.h>
15#include <asm/atomic.h> 15#include <asm/atomic.h>
16 16
17#ifdef CONFIG_BLOCK
18
17enum bh_state_bits { 19enum bh_state_bits {
18 BH_Uptodate, /* Contains valid data */ 20 BH_Uptodate, /* Contains valid data */
19 BH_Dirty, /* Is dirty */ 21 BH_Dirty, /* Is dirty */
@@ -190,9 +192,7 @@ extern int buffer_heads_over_limit;
190 * Generic address_space_operations implementations for buffer_head-backed 192 * Generic address_space_operations implementations for buffer_head-backed
191 * address_spaces. 193 * address_spaces.
192 */ 194 */
193int try_to_release_page(struct page * page, gfp_t gfp_mask);
194void block_invalidatepage(struct page *page, unsigned long offset); 195void block_invalidatepage(struct page *page, unsigned long offset);
195void do_invalidatepage(struct page *page, unsigned long offset);
196int block_write_full_page(struct page *page, get_block_t *get_block, 196int block_write_full_page(struct page *page, get_block_t *get_block,
197 struct writeback_control *wbc); 197 struct writeback_control *wbc);
198int block_read_full_page(struct page*, get_block_t*); 198int block_read_full_page(struct page*, get_block_t*);
@@ -302,4 +302,19 @@ static inline void lock_buffer(struct buffer_head *bh)
302 __lock_buffer(bh); 302 __lock_buffer(bh);
303} 303}
304 304
305extern int __set_page_dirty_buffers(struct page *page);
306
307#else /* CONFIG_BLOCK */
308
309static inline void buffer_init(void) {}
310static inline int try_to_free_buffers(struct page *page) { return 1; }
311static inline int sync_blockdev(struct block_device *bdev) { return 0; }
312static inline int inode_has_buffers(struct inode *inode) { return 0; }
313static inline void invalidate_inode_buffers(struct inode *inode) {}
314static inline int remove_inode_buffers(struct inode *inode) { return 1; }
315static inline int sync_mapping_buffers(struct address_space *mapping) { return 0; }
316static inline void invalidate_bdev(struct block_device *bdev, int destroy_dirty_buffers) {}
317
318
319#endif /* CONFIG_BLOCK */
305#endif /* _LINUX_BUFFER_HEAD_H */ 320#endif /* _LINUX_BUFFER_HEAD_H */
diff --git a/include/linux/compat_ioctl.h b/include/linux/compat_ioctl.h
index bea0255196c4..d5b7abc4f409 100644
--- a/include/linux/compat_ioctl.h
+++ b/include/linux/compat_ioctl.h
@@ -90,6 +90,7 @@ COMPATIBLE_IOCTL(FDTWADDLE)
90COMPATIBLE_IOCTL(FDFMTTRK) 90COMPATIBLE_IOCTL(FDFMTTRK)
91COMPATIBLE_IOCTL(FDRAWCMD) 91COMPATIBLE_IOCTL(FDRAWCMD)
92/* 0x12 */ 92/* 0x12 */
93#ifdef CONFIG_BLOCK
93COMPATIBLE_IOCTL(BLKRASET) 94COMPATIBLE_IOCTL(BLKRASET)
94COMPATIBLE_IOCTL(BLKROSET) 95COMPATIBLE_IOCTL(BLKROSET)
95COMPATIBLE_IOCTL(BLKROGET) 96COMPATIBLE_IOCTL(BLKROGET)
@@ -103,6 +104,7 @@ COMPATIBLE_IOCTL(BLKTRACESETUP)
103COMPATIBLE_IOCTL(BLKTRACETEARDOWN) 104COMPATIBLE_IOCTL(BLKTRACETEARDOWN)
104ULONG_IOCTL(BLKRASET) 105ULONG_IOCTL(BLKRASET)
105ULONG_IOCTL(BLKFRASET) 106ULONG_IOCTL(BLKFRASET)
107#endif
106/* RAID */ 108/* RAID */
107COMPATIBLE_IOCTL(RAID_VERSION) 109COMPATIBLE_IOCTL(RAID_VERSION)
108COMPATIBLE_IOCTL(GET_ARRAY_INFO) 110COMPATIBLE_IOCTL(GET_ARRAY_INFO)
@@ -395,12 +397,6 @@ COMPATIBLE_IOCTL(DVD_WRITE_STRUCT)
395COMPATIBLE_IOCTL(DVD_AUTH) 397COMPATIBLE_IOCTL(DVD_AUTH)
396/* pktcdvd */ 398/* pktcdvd */
397COMPATIBLE_IOCTL(PACKET_CTRL_CMD) 399COMPATIBLE_IOCTL(PACKET_CTRL_CMD)
398/* Big L */
399ULONG_IOCTL(LOOP_SET_FD)
400ULONG_IOCTL(LOOP_CHANGE_FD)
401COMPATIBLE_IOCTL(LOOP_CLR_FD)
402COMPATIBLE_IOCTL(LOOP_GET_STATUS64)
403COMPATIBLE_IOCTL(LOOP_SET_STATUS64)
404/* Big A */ 400/* Big A */
405/* sparc only */ 401/* sparc only */
406/* Big Q for sound/OSS */ 402/* Big Q for sound/OSS */
@@ -573,18 +569,6 @@ COMPATIBLE_IOCTL(RAW_SETBIND)
573COMPATIBLE_IOCTL(RAW_GETBIND) 569COMPATIBLE_IOCTL(RAW_GETBIND)
574/* SMB ioctls which do not need any translations */ 570/* SMB ioctls which do not need any translations */
575COMPATIBLE_IOCTL(SMB_IOC_NEWCONN) 571COMPATIBLE_IOCTL(SMB_IOC_NEWCONN)
576/* NCP ioctls which do not need any translations */
577COMPATIBLE_IOCTL(NCP_IOC_CONN_LOGGED_IN)
578COMPATIBLE_IOCTL(NCP_IOC_SIGN_INIT)
579COMPATIBLE_IOCTL(NCP_IOC_SIGN_WANTED)
580COMPATIBLE_IOCTL(NCP_IOC_SET_SIGN_WANTED)
581COMPATIBLE_IOCTL(NCP_IOC_LOCKUNLOCK)
582COMPATIBLE_IOCTL(NCP_IOC_GETROOT)
583COMPATIBLE_IOCTL(NCP_IOC_SETROOT)
584COMPATIBLE_IOCTL(NCP_IOC_GETCHARSETS)
585COMPATIBLE_IOCTL(NCP_IOC_SETCHARSETS)
586COMPATIBLE_IOCTL(NCP_IOC_GETDENTRYTTL)
587COMPATIBLE_IOCTL(NCP_IOC_SETDENTRYTTL)
588/* Little a */ 572/* Little a */
589COMPATIBLE_IOCTL(ATMSIGD_CTRL) 573COMPATIBLE_IOCTL(ATMSIGD_CTRL)
590COMPATIBLE_IOCTL(ATMARPD_CTRL) 574COMPATIBLE_IOCTL(ATMARPD_CTRL)
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 060b96112ec6..538423d4a865 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -10,11 +10,11 @@
10# define __force __attribute__((force)) 10# define __force __attribute__((force))
11# define __nocast __attribute__((nocast)) 11# define __nocast __attribute__((nocast))
12# define __iomem __attribute__((noderef, address_space(2))) 12# define __iomem __attribute__((noderef, address_space(2)))
13# define __acquires(x) __attribute__((context(0,1))) 13# define __acquires(x) __attribute__((context(x,0,1)))
14# define __releases(x) __attribute__((context(1,0))) 14# define __releases(x) __attribute__((context(x,1,0)))
15# define __acquire(x) __context__(1) 15# define __acquire(x) __context__(x,1)
16# define __release(x) __context__(-1) 16# define __release(x) __context__(x,-1)
17# define __cond_lock(x) ((x) ? ({ __context__(1); 1; }) : 0) 17# define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0)
18extern void __chk_user_ptr(void __user *); 18extern void __chk_user_ptr(void __user *);
19extern void __chk_io_ptr(void __iomem *); 19extern void __chk_io_ptr(void __iomem *);
20#else 20#else
@@ -31,7 +31,7 @@ extern void __chk_io_ptr(void __iomem *);
31# define __releases(x) 31# define __releases(x)
32# define __acquire(x) (void)0 32# define __acquire(x) (void)0
33# define __release(x) (void)0 33# define __release(x) (void)0
34# define __cond_lock(x) (x) 34# define __cond_lock(x,c) (c)
35#endif 35#endif
36 36
37#ifdef __KERNEL__ 37#ifdef __KERNEL__
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h
index 9354722a9217..4d8adf663681 100644
--- a/include/linux/cpuset.h
+++ b/include/linux/cpuset.h
@@ -63,6 +63,8 @@ static inline int cpuset_do_slab_mem_spread(void)
63 return current->flags & PF_SPREAD_SLAB; 63 return current->flags & PF_SPREAD_SLAB;
64} 64}
65 65
66extern void cpuset_track_online_nodes(void);
67
66#else /* !CONFIG_CPUSETS */ 68#else /* !CONFIG_CPUSETS */
67 69
68static inline int cpuset_init_early(void) { return 0; } 70static inline int cpuset_init_early(void) { return 0; }
@@ -126,6 +128,8 @@ static inline int cpuset_do_slab_mem_spread(void)
126 return 0; 128 return 0;
127} 129}
128 130
131static inline void cpuset_track_online_nodes(void) {}
132
129#endif /* !CONFIG_CPUSETS */ 133#endif /* !CONFIG_CPUSETS */
130 134
131#endif /* _LINUX_CPUSET_H */ 135#endif /* _LINUX_CPUSET_H */
diff --git a/include/linux/cramfs_fs.h b/include/linux/cramfs_fs.h
index a41f38428c37..1dba681e428d 100644
--- a/include/linux/cramfs_fs.h
+++ b/include/linux/cramfs_fs.h
@@ -87,6 +87,6 @@ struct cramfs_super {
87/* Uncompression interfaces to the underlying zlib */ 87/* Uncompression interfaces to the underlying zlib */
88int cramfs_uncompress_block(void *dst, int dstlen, void *src, int srclen); 88int cramfs_uncompress_block(void *dst, int dstlen, void *src, int srclen);
89int cramfs_uncompress_init(void); 89int cramfs_uncompress_init(void);
90int cramfs_uncompress_exit(void); 90void cramfs_uncompress_exit(void);
91 91
92#endif 92#endif
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 635690cf3e3d..ff203c465fed 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -24,6 +24,13 @@ enum dma_data_direction {
24#define DMA_28BIT_MASK 0x000000000fffffffULL 24#define DMA_28BIT_MASK 0x000000000fffffffULL
25#define DMA_24BIT_MASK 0x0000000000ffffffULL 25#define DMA_24BIT_MASK 0x0000000000ffffffULL
26 26
27static inline int valid_dma_direction(int dma_direction)
28{
29 return ((dma_direction == DMA_BIDIRECTIONAL) ||
30 (dma_direction == DMA_TO_DEVICE) ||
31 (dma_direction == DMA_FROM_DEVICE));
32}
33
27#include <asm/dma-mapping.h> 34#include <asm/dma-mapping.h>
28 35
29/* Backwards compat, remove in 2.7.x */ 36/* Backwards compat, remove in 2.7.x */
diff --git a/include/linux/dmi.h b/include/linux/dmi.h
index b2cd2071d432..38dc403be70b 100644
--- a/include/linux/dmi.h
+++ b/include/linux/dmi.h
@@ -27,7 +27,8 @@ enum dmi_device_type {
27 DMI_DEV_TYPE_ETHERNET, 27 DMI_DEV_TYPE_ETHERNET,
28 DMI_DEV_TYPE_TOKENRING, 28 DMI_DEV_TYPE_TOKENRING,
29 DMI_DEV_TYPE_SOUND, 29 DMI_DEV_TYPE_SOUND,
30 DMI_DEV_TYPE_IPMI = -1 30 DMI_DEV_TYPE_IPMI = -1,
31 DMI_DEV_TYPE_OEM_STRING = -2
31}; 32};
32 33
33struct dmi_header { 34struct dmi_header {
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index 1713ace808bf..b3370ef5164d 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -1,12 +1,16 @@
1#ifndef _LINUX_ELEVATOR_H 1#ifndef _LINUX_ELEVATOR_H
2#define _LINUX_ELEVATOR_H 2#define _LINUX_ELEVATOR_H
3 3
4#include <linux/percpu.h>
5
6#ifdef CONFIG_BLOCK
7
4typedef int (elevator_merge_fn) (request_queue_t *, struct request **, 8typedef int (elevator_merge_fn) (request_queue_t *, struct request **,
5 struct bio *); 9 struct bio *);
6 10
7typedef void (elevator_merge_req_fn) (request_queue_t *, struct request *, struct request *); 11typedef void (elevator_merge_req_fn) (request_queue_t *, struct request *, struct request *);
8 12
9typedef void (elevator_merged_fn) (request_queue_t *, struct request *); 13typedef void (elevator_merged_fn) (request_queue_t *, struct request *, int);
10 14
11typedef int (elevator_dispatch_fn) (request_queue_t *, int); 15typedef int (elevator_dispatch_fn) (request_queue_t *, int);
12 16
@@ -14,9 +18,9 @@ typedef void (elevator_add_req_fn) (request_queue_t *, struct request *);
14typedef int (elevator_queue_empty_fn) (request_queue_t *); 18typedef int (elevator_queue_empty_fn) (request_queue_t *);
15typedef struct request *(elevator_request_list_fn) (request_queue_t *, struct request *); 19typedef struct request *(elevator_request_list_fn) (request_queue_t *, struct request *);
16typedef void (elevator_completed_req_fn) (request_queue_t *, struct request *); 20typedef void (elevator_completed_req_fn) (request_queue_t *, struct request *);
17typedef int (elevator_may_queue_fn) (request_queue_t *, int, struct bio *); 21typedef int (elevator_may_queue_fn) (request_queue_t *, int);
18 22
19typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, struct bio *, gfp_t); 23typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, gfp_t);
20typedef void (elevator_put_req_fn) (request_queue_t *, struct request *); 24typedef void (elevator_put_req_fn) (request_queue_t *, struct request *);
21typedef void (elevator_activate_req_fn) (request_queue_t *, struct request *); 25typedef void (elevator_activate_req_fn) (request_queue_t *, struct request *);
22typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *); 26typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *);
@@ -82,19 +86,21 @@ struct elevator_queue
82 struct kobject kobj; 86 struct kobject kobj;
83 struct elevator_type *elevator_type; 87 struct elevator_type *elevator_type;
84 struct mutex sysfs_lock; 88 struct mutex sysfs_lock;
89 struct hlist_head *hash;
85}; 90};
86 91
87/* 92/*
88 * block elevator interface 93 * block elevator interface
89 */ 94 */
90extern void elv_dispatch_sort(request_queue_t *, struct request *); 95extern void elv_dispatch_sort(request_queue_t *, struct request *);
96extern void elv_dispatch_add_tail(request_queue_t *, struct request *);
91extern void elv_add_request(request_queue_t *, struct request *, int, int); 97extern void elv_add_request(request_queue_t *, struct request *, int, int);
92extern void __elv_add_request(request_queue_t *, struct request *, int, int); 98extern void __elv_add_request(request_queue_t *, struct request *, int, int);
93extern void elv_insert(request_queue_t *, struct request *, int); 99extern void elv_insert(request_queue_t *, struct request *, int);
94extern int elv_merge(request_queue_t *, struct request **, struct bio *); 100extern int elv_merge(request_queue_t *, struct request **, struct bio *);
95extern void elv_merge_requests(request_queue_t *, struct request *, 101extern void elv_merge_requests(request_queue_t *, struct request *,
96 struct request *); 102 struct request *);
97extern void elv_merged_request(request_queue_t *, struct request *); 103extern void elv_merged_request(request_queue_t *, struct request *, int);
98extern void elv_dequeue_request(request_queue_t *, struct request *); 104extern void elv_dequeue_request(request_queue_t *, struct request *);
99extern void elv_requeue_request(request_queue_t *, struct request *); 105extern void elv_requeue_request(request_queue_t *, struct request *);
100extern int elv_queue_empty(request_queue_t *); 106extern int elv_queue_empty(request_queue_t *);
@@ -103,9 +109,9 @@ extern struct request *elv_former_request(request_queue_t *, struct request *);
103extern struct request *elv_latter_request(request_queue_t *, struct request *); 109extern struct request *elv_latter_request(request_queue_t *, struct request *);
104extern int elv_register_queue(request_queue_t *q); 110extern int elv_register_queue(request_queue_t *q);
105extern void elv_unregister_queue(request_queue_t *q); 111extern void elv_unregister_queue(request_queue_t *q);
106extern int elv_may_queue(request_queue_t *, int, struct bio *); 112extern int elv_may_queue(request_queue_t *, int);
107extern void elv_completed_request(request_queue_t *, struct request *); 113extern void elv_completed_request(request_queue_t *, struct request *);
108extern int elv_set_request(request_queue_t *, struct request *, struct bio *, gfp_t); 114extern int elv_set_request(request_queue_t *, struct request *, gfp_t);
109extern void elv_put_request(request_queue_t *, struct request *); 115extern void elv_put_request(request_queue_t *, struct request *);
110 116
111/* 117/*
@@ -125,6 +131,19 @@ extern void elevator_exit(elevator_t *);
125extern int elv_rq_merge_ok(struct request *, struct bio *); 131extern int elv_rq_merge_ok(struct request *, struct bio *);
126 132
127/* 133/*
134 * Helper functions.
135 */
136extern struct request *elv_rb_former_request(request_queue_t *, struct request *);
137extern struct request *elv_rb_latter_request(request_queue_t *, struct request *);
138
139/*
140 * rb support functions.
141 */
142extern struct request *elv_rb_add(struct rb_root *, struct request *);
143extern void elv_rb_del(struct rb_root *, struct request *);
144extern struct request *elv_rb_find(struct rb_root *, sector_t);
145
146/*
128 * Return values from elevator merger 147 * Return values from elevator merger
129 */ 148 */
130#define ELEVATOR_NO_MERGE 0 149#define ELEVATOR_NO_MERGE 0
@@ -149,5 +168,42 @@ enum {
149}; 168};
150 169
151#define rq_end_sector(rq) ((rq)->sector + (rq)->nr_sectors) 170#define rq_end_sector(rq) ((rq)->sector + (rq)->nr_sectors)
171#define rb_entry_rq(node) rb_entry((node), struct request, rb_node)
172
173/*
174 * Hack to reuse the donelist list_head as the fifo time holder while
175 * the request is in the io scheduler. Saves an unsigned long in rq.
176 */
177#define rq_fifo_time(rq) ((unsigned long) (rq)->donelist.next)
178#define rq_set_fifo_time(rq,exp) ((rq)->donelist.next = (void *) (exp))
179#define rq_entry_fifo(ptr) list_entry((ptr), struct request, queuelist)
180#define rq_fifo_clear(rq) do { \
181 list_del_init(&(rq)->queuelist); \
182 INIT_LIST_HEAD(&(rq)->donelist); \
183 } while (0)
152 184
185/*
186 * io context count accounting
187 */
188#define elv_ioc_count_mod(name, __val) \
189 do { \
190 preempt_disable(); \
191 __get_cpu_var(name) += (__val); \
192 preempt_enable(); \
193 } while (0)
194
195#define elv_ioc_count_inc(name) elv_ioc_count_mod(name, 1)
196#define elv_ioc_count_dec(name) elv_ioc_count_mod(name, -1)
197
198#define elv_ioc_count_read(name) \
199({ \
200 unsigned long __val = 0; \
201 int __cpu; \
202 smp_wmb(); \
203 for_each_possible_cpu(__cpu) \
204 __val += per_cpu(name, __cpu); \
205 __val; \
206})
207
208#endif /* CONFIG_BLOCK */
153#endif 209#endif
diff --git a/include/linux/errqueue.h b/include/linux/errqueue.h
index 408118a07763..92f8d4fab32b 100644
--- a/include/linux/errqueue.h
+++ b/include/linux/errqueue.h
@@ -38,7 +38,7 @@ struct sock_exterr_skb
38 } header; 38 } header;
39 struct sock_extended_err ee; 39 struct sock_extended_err ee;
40 u16 addr_offset; 40 u16 addr_offset;
41 u16 port; 41 __be16 port;
42}; 42};
43 43
44#endif 44#endif
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h
index 33a1aa107329..153d755376a4 100644
--- a/include/linux/ext2_fs.h
+++ b/include/linux/ext2_fs.h
@@ -165,41 +165,49 @@ struct ext2_group_desc
165#define EXT2_N_BLOCKS (EXT2_TIND_BLOCK + 1) 165#define EXT2_N_BLOCKS (EXT2_TIND_BLOCK + 1)
166 166
167/* 167/*
168 * Inode flags 168 * Inode flags (GETFLAGS/SETFLAGS)
169 */ 169 */
170#define EXT2_SECRM_FL 0x00000001 /* Secure deletion */ 170#define EXT2_SECRM_FL FS_SECRM_FL /* Secure deletion */
171#define EXT2_UNRM_FL 0x00000002 /* Undelete */ 171#define EXT2_UNRM_FL FS_UNRM_FL /* Undelete */
172#define EXT2_COMPR_FL 0x00000004 /* Compress file */ 172#define EXT2_COMPR_FL FS_COMPR_FL /* Compress file */
173#define EXT2_SYNC_FL 0x00000008 /* Synchronous updates */ 173#define EXT2_SYNC_FL FS_SYNC_FL /* Synchronous updates */
174#define EXT2_IMMUTABLE_FL 0x00000010 /* Immutable file */ 174#define EXT2_IMMUTABLE_FL FS_IMMUTABLE_FL /* Immutable file */
175#define EXT2_APPEND_FL 0x00000020 /* writes to file may only append */ 175#define EXT2_APPEND_FL FS_APPEND_FL /* writes to file may only append */
176#define EXT2_NODUMP_FL 0x00000040 /* do not dump file */ 176#define EXT2_NODUMP_FL FS_NODUMP_FL /* do not dump file */
177#define EXT2_NOATIME_FL 0x00000080 /* do not update atime */ 177#define EXT2_NOATIME_FL FS_NOATIME_FL /* do not update atime */
178/* Reserved for compression usage... */ 178/* Reserved for compression usage... */
179#define EXT2_DIRTY_FL 0x00000100 179#define EXT2_DIRTY_FL FS_DIRTY_FL
180#define EXT2_COMPRBLK_FL 0x00000200 /* One or more compressed clusters */ 180#define EXT2_COMPRBLK_FL FS_COMPRBLK_FL /* One or more compressed clusters */
181#define EXT2_NOCOMP_FL 0x00000400 /* Don't compress */ 181#define EXT2_NOCOMP_FL FS_NOCOMP_FL /* Don't compress */
182#define EXT2_ECOMPR_FL 0x00000800 /* Compression error */ 182#define EXT2_ECOMPR_FL FS_ECOMPR_FL /* Compression error */
183/* End compression flags --- maybe not all used */ 183/* End compression flags --- maybe not all used */
184#define EXT2_BTREE_FL 0x00001000 /* btree format dir */ 184#define EXT2_BTREE_FL FS_BTREE_FL /* btree format dir */
185#define EXT2_INDEX_FL 0x00001000 /* hash-indexed directory */ 185#define EXT2_INDEX_FL FS_INDEX_FL /* hash-indexed directory */
186#define EXT2_IMAGIC_FL 0x00002000 /* AFS directory */ 186#define EXT2_IMAGIC_FL FS_IMAGIC_FL /* AFS directory */
187#define EXT2_JOURNAL_DATA_FL 0x00004000 /* Reserved for ext3 */ 187#define EXT2_JOURNAL_DATA_FL FS_JOURNAL_DATA_FL /* Reserved for ext3 */
188#define EXT2_NOTAIL_FL 0x00008000 /* file tail should not be merged */ 188#define EXT2_NOTAIL_FL FS_NOTAIL_FL /* file tail should not be merged */
189#define EXT2_DIRSYNC_FL 0x00010000 /* dirsync behaviour (directories only) */ 189#define EXT2_DIRSYNC_FL FS_DIRSYNC_FL /* dirsync behaviour (directories only) */
190#define EXT2_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/ 190#define EXT2_TOPDIR_FL FS_TOPDIR_FL /* Top of directory hierarchies*/
191#define EXT2_RESERVED_FL 0x80000000 /* reserved for ext2 lib */ 191#define EXT2_RESERVED_FL FS_RESERVED_FL /* reserved for ext2 lib */
192 192
193#define EXT2_FL_USER_VISIBLE 0x0003DFFF /* User visible flags */ 193#define EXT2_FL_USER_VISIBLE FS_FL_USER_VISIBLE /* User visible flags */
194#define EXT2_FL_USER_MODIFIABLE 0x000380FF /* User modifiable flags */ 194#define EXT2_FL_USER_MODIFIABLE FS_FL_USER_MODIFIABLE /* User modifiable flags */
195 195
196/* 196/*
197 * ioctl commands 197 * ioctl commands
198 */ 198 */
199#define EXT2_IOC_GETFLAGS _IOR('f', 1, long) 199#define EXT2_IOC_GETFLAGS FS_IOC_GETFLAGS
200#define EXT2_IOC_SETFLAGS _IOW('f', 2, long) 200#define EXT2_IOC_SETFLAGS FS_IOC_SETFLAGS
201#define EXT2_IOC_GETVERSION _IOR('v', 1, long) 201#define EXT2_IOC_GETVERSION FS_IOC_GETVERSION
202#define EXT2_IOC_SETVERSION _IOW('v', 2, long) 202#define EXT2_IOC_SETVERSION FS_IOC_SETVERSION
203
204/*
205 * ioctl commands in 32 bit emulation
206 */
207#define EXT2_IOC32_GETFLAGS FS_IOC32_GETFLAGS
208#define EXT2_IOC32_SETFLAGS FS_IOC32_SETFLAGS
209#define EXT2_IOC32_GETVERSION FS_IOC32_GETVERSION
210#define EXT2_IOC32_SETVERSION FS_IOC32_SETVERSION
203 211
204/* 212/*
205 * Structure of an inode on the disk 213 * Structure of an inode on the disk
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index cc08f56750da..11cca1bdc0c7 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -216,14 +216,14 @@ struct ext3_new_group_data {
216/* 216/*
217 * ioctl commands 217 * ioctl commands
218 */ 218 */
219#define EXT3_IOC_GETFLAGS _IOR('f', 1, long) 219#define EXT3_IOC_GETFLAGS FS_IOC_GETFLAGS
220#define EXT3_IOC_SETFLAGS _IOW('f', 2, long) 220#define EXT3_IOC_SETFLAGS FS_IOC_SETFLAGS
221#define EXT3_IOC_GETVERSION _IOR('f', 3, long) 221#define EXT3_IOC_GETVERSION _IOR('f', 3, long)
222#define EXT3_IOC_SETVERSION _IOW('f', 4, long) 222#define EXT3_IOC_SETVERSION _IOW('f', 4, long)
223#define EXT3_IOC_GROUP_EXTEND _IOW('f', 7, unsigned long) 223#define EXT3_IOC_GROUP_EXTEND _IOW('f', 7, unsigned long)
224#define EXT3_IOC_GROUP_ADD _IOW('f', 8,struct ext3_new_group_input) 224#define EXT3_IOC_GROUP_ADD _IOW('f', 8,struct ext3_new_group_input)
225#define EXT3_IOC_GETVERSION_OLD _IOR('v', 1, long) 225#define EXT3_IOC_GETVERSION_OLD FS_IOC_GETVERSION
226#define EXT3_IOC_SETVERSION_OLD _IOW('v', 2, long) 226#define EXT3_IOC_SETVERSION_OLD FS_IOC_SETVERSION
227#ifdef CONFIG_JBD_DEBUG 227#ifdef CONFIG_JBD_DEBUG
228#define EXT3_IOC_WAIT_FOR_READONLY _IOR('f', 99, long) 228#define EXT3_IOC_WAIT_FOR_READONLY _IOR('f', 99, long)
229#endif 229#endif
@@ -231,6 +231,23 @@ struct ext3_new_group_data {
231#define EXT3_IOC_SETRSVSZ _IOW('f', 6, long) 231#define EXT3_IOC_SETRSVSZ _IOW('f', 6, long)
232 232
233/* 233/*
234 * ioctl commands in 32 bit emulation
235 */
236#define EXT3_IOC32_GETFLAGS FS_IOC32_GETFLAGS
237#define EXT3_IOC32_SETFLAGS FS_IOC32_SETFLAGS
238#define EXT3_IOC32_GETVERSION _IOR('f', 3, int)
239#define EXT3_IOC32_SETVERSION _IOW('f', 4, int)
240#define EXT3_IOC32_GETRSVSZ _IOR('f', 5, int)
241#define EXT3_IOC32_SETRSVSZ _IOW('f', 6, int)
242#define EXT3_IOC32_GROUP_EXTEND _IOW('f', 7, unsigned int)
243#ifdef CONFIG_JBD_DEBUG
244#define EXT3_IOC32_WAIT_FOR_READONLY _IOR('f', 99, int)
245#endif
246#define EXT3_IOC32_GETVERSION_OLD FS_IOC32_GETVERSION
247#define EXT3_IOC32_SETVERSION_OLD FS_IOC32_SETVERSION
248
249
250/*
234 * Mount options 251 * Mount options
235 */ 252 */
236struct ext3_mount_options { 253struct ext3_mount_options {
@@ -812,6 +829,7 @@ extern void ext3_set_aops(struct inode *inode);
812/* ioctl.c */ 829/* ioctl.c */
813extern int ext3_ioctl (struct inode *, struct file *, unsigned int, 830extern int ext3_ioctl (struct inode *, struct file *, unsigned int,
814 unsigned long); 831 unsigned long);
832extern long ext3_compat_ioctl (struct file *, unsigned int, unsigned long);
815 833
816/* namei.c */ 834/* namei.c */
817extern int ext3_orphan_add(handle_t *, struct inode *); 835extern int ext3_orphan_add(handle_t *, struct inode *);
diff --git a/include/linux/file.h b/include/linux/file.h
index 9f7c2513866f..74183e6f7f45 100644
--- a/include/linux/file.h
+++ b/include/linux/file.h
@@ -112,5 +112,6 @@ struct task_struct;
112 112
113struct files_struct *get_files_struct(struct task_struct *); 113struct files_struct *get_files_struct(struct task_struct *);
114void FASTCALL(put_files_struct(struct files_struct *fs)); 114void FASTCALL(put_files_struct(struct files_struct *fs));
115void reset_files_struct(struct task_struct *, struct files_struct *);
115 116
116#endif /* __LINUX_FILE_H */ 117#endif /* __LINUX_FILE_H */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 8f74dfbb2edd..2e29a2edaeec 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -79,8 +79,8 @@ extern int dir_notify_enable;
79#define WRITE 1 79#define WRITE 1
80#define READA 2 /* read-ahead - don't block if no resources */ 80#define READA 2 /* read-ahead - don't block if no resources */
81#define SWRITE 3 /* for ll_rw_block() - wait for buffer lock */ 81#define SWRITE 3 /* for ll_rw_block() - wait for buffer lock */
82#define SPECIAL 4 /* For non-blockdevice requests in request queue */
83#define READ_SYNC (READ | (1 << BIO_RW_SYNC)) 82#define READ_SYNC (READ | (1 << BIO_RW_SYNC))
83#define READ_META (READ | (1 << BIO_RW_META))
84#define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC)) 84#define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC))
85#define WRITE_BARRIER ((1 << BIO_RW) | (1 << BIO_RW_BARRIER)) 85#define WRITE_BARRIER ((1 << BIO_RW) | (1 << BIO_RW_BARRIER))
86 86
@@ -217,6 +217,45 @@ extern int dir_notify_enable;
217#define FIBMAP _IO(0x00,1) /* bmap access */ 217#define FIBMAP _IO(0x00,1) /* bmap access */
218#define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */ 218#define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */
219 219
220#define FS_IOC_GETFLAGS _IOR('f', 1, long)
221#define FS_IOC_SETFLAGS _IOW('f', 2, long)
222#define FS_IOC_GETVERSION _IOR('v', 1, long)
223#define FS_IOC_SETVERSION _IOW('v', 2, long)
224#define FS_IOC32_GETFLAGS _IOR('f', 1, int)
225#define FS_IOC32_SETFLAGS _IOW('f', 2, int)
226#define FS_IOC32_GETVERSION _IOR('v', 1, int)
227#define FS_IOC32_SETVERSION _IOW('v', 2, int)
228
229/*
230 * Inode flags (FS_IOC_GETFLAGS / FS_IOC_SETFLAGS)
231 */
232#define FS_SECRM_FL 0x00000001 /* Secure deletion */
233#define FS_UNRM_FL 0x00000002 /* Undelete */
234#define FS_COMPR_FL 0x00000004 /* Compress file */
235#define FS_SYNC_FL 0x00000008 /* Synchronous updates */
236#define FS_IMMUTABLE_FL 0x00000010 /* Immutable file */
237#define FS_APPEND_FL 0x00000020 /* writes to file may only append */
238#define FS_NODUMP_FL 0x00000040 /* do not dump file */
239#define FS_NOATIME_FL 0x00000080 /* do not update atime */
240/* Reserved for compression usage... */
241#define FS_DIRTY_FL 0x00000100
242#define FS_COMPRBLK_FL 0x00000200 /* One or more compressed clusters */
243#define FS_NOCOMP_FL 0x00000400 /* Don't compress */
244#define FS_ECOMPR_FL 0x00000800 /* Compression error */
245/* End compression flags --- maybe not all used */
246#define FS_BTREE_FL 0x00001000 /* btree format dir */
247#define FS_INDEX_FL 0x00001000 /* hash-indexed directory */
248#define FS_IMAGIC_FL 0x00002000 /* AFS directory */
249#define FS_JOURNAL_DATA_FL 0x00004000 /* Reserved for ext3 */
250#define FS_NOTAIL_FL 0x00008000 /* file tail should not be merged */
251#define FS_DIRSYNC_FL 0x00010000 /* dirsync behaviour (directories only) */
252#define FS_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/
253#define FS_RESERVED_FL 0x80000000 /* reserved for ext2 lib */
254
255#define FS_FL_USER_VISIBLE 0x0003DFFF /* User visible flags */
256#define FS_FL_USER_MODIFIABLE 0x000380FF /* User modifiable flags */
257
258
220#define SYNC_FILE_RANGE_WAIT_BEFORE 1 259#define SYNC_FILE_RANGE_WAIT_BEFORE 1
221#define SYNC_FILE_RANGE_WRITE 2 260#define SYNC_FILE_RANGE_WRITE 2
222#define SYNC_FILE_RANGE_WAIT_AFTER 4 261#define SYNC_FILE_RANGE_WAIT_AFTER 4
@@ -553,7 +592,9 @@ struct inode {
553 unsigned int i_flags; 592 unsigned int i_flags;
554 593
555 atomic_t i_writecount; 594 atomic_t i_writecount;
595#ifdef CONFIG_SECURITY
556 void *i_security; 596 void *i_security;
597#endif
557 void *i_private; /* fs or device private pointer */ 598 void *i_private; /* fs or device private pointer */
558#ifdef __NEED_I_SIZE_ORDERED 599#ifdef __NEED_I_SIZE_ORDERED
559 seqcount_t i_size_seqcount; 600 seqcount_t i_size_seqcount;
@@ -645,7 +686,6 @@ struct fown_struct {
645 rwlock_t lock; /* protects pid, uid, euid fields */ 686 rwlock_t lock; /* protects pid, uid, euid fields */
646 int pid; /* pid or -pgrp where SIGIO should be sent */ 687 int pid; /* pid or -pgrp where SIGIO should be sent */
647 uid_t uid, euid; /* uid/euid of process setting the owner */ 688 uid_t uid, euid; /* uid/euid of process setting the owner */
648 void *security;
649 int signum; /* posix.1b rt signal to be delivered on IO */ 689 int signum; /* posix.1b rt signal to be delivered on IO */
650}; 690};
651 691
@@ -688,8 +728,9 @@ struct file {
688 struct file_ra_state f_ra; 728 struct file_ra_state f_ra;
689 729
690 unsigned long f_version; 730 unsigned long f_version;
731#ifdef CONFIG_SECURITY
691 void *f_security; 732 void *f_security;
692 733#endif
693 /* needed for tty driver, and maybe others */ 734 /* needed for tty driver, and maybe others */
694 void *private_data; 735 void *private_data;
695 736
@@ -877,7 +918,9 @@ struct super_block {
877 int s_syncing; 918 int s_syncing;
878 int s_need_sync_fs; 919 int s_need_sync_fs;
879 atomic_t s_active; 920 atomic_t s_active;
921#ifdef CONFIG_SECURITY
880 void *s_security; 922 void *s_security;
923#endif
881 struct xattr_handler **s_xattr; 924 struct xattr_handler **s_xattr;
882 925
883 struct list_head s_inodes; /* all inodes */ 926 struct list_head s_inodes; /* all inodes */
@@ -1054,9 +1097,9 @@ struct file_operations {
1054 struct module *owner; 1097 struct module *owner;
1055 loff_t (*llseek) (struct file *, loff_t, int); 1098 loff_t (*llseek) (struct file *, loff_t, int);
1056 ssize_t (*read) (struct file *, char __user *, size_t, loff_t *); 1099 ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);
1057 ssize_t (*aio_read) (struct kiocb *, char __user *, size_t, loff_t);
1058 ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *); 1100 ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
1059 ssize_t (*aio_write) (struct kiocb *, const char __user *, size_t, loff_t); 1101 ssize_t (*aio_read) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
1102 ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
1060 int (*readdir) (struct file *, void *, filldir_t); 1103 int (*readdir) (struct file *, void *, filldir_t);
1061 unsigned int (*poll) (struct file *, struct poll_table_struct *); 1104 unsigned int (*poll) (struct file *, struct poll_table_struct *);
1062 int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long); 1105 int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long);
@@ -1070,8 +1113,6 @@ struct file_operations {
1070 int (*aio_fsync) (struct kiocb *, int datasync); 1113 int (*aio_fsync) (struct kiocb *, int datasync);
1071 int (*fasync) (int, struct file *, int); 1114 int (*fasync) (int, struct file *, int);
1072 int (*lock) (struct file *, int, struct file_lock *); 1115 int (*lock) (struct file *, int, struct file_lock *);
1073 ssize_t (*readv) (struct file *, const struct iovec *, unsigned long, loff_t *);
1074 ssize_t (*writev) (struct file *, const struct iovec *, unsigned long, loff_t *);
1075 ssize_t (*sendfile) (struct file *, loff_t *, size_t, read_actor_t, void *); 1116 ssize_t (*sendfile) (struct file *, loff_t *, size_t, read_actor_t, void *);
1076 ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int); 1117 ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);
1077 unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); 1118 unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
@@ -1109,6 +1150,11 @@ struct inode_operations {
1109 1150
1110struct seq_file; 1151struct seq_file;
1111 1152
1153ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector,
1154 unsigned long nr_segs, unsigned long fast_segs,
1155 struct iovec *fast_pointer,
1156 struct iovec **ret_pointer);
1157
1112extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *); 1158extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *);
1113extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *); 1159extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *);
1114extern ssize_t vfs_readv(struct file *, const struct iovec __user *, 1160extern ssize_t vfs_readv(struct file *, const struct iovec __user *,
@@ -1143,9 +1189,10 @@ struct super_operations {
1143 1189
1144 int (*show_options)(struct seq_file *, struct vfsmount *); 1190 int (*show_options)(struct seq_file *, struct vfsmount *);
1145 int (*show_stats)(struct seq_file *, struct vfsmount *); 1191 int (*show_stats)(struct seq_file *, struct vfsmount *);
1146 1192#ifdef CONFIG_QUOTA
1147 ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); 1193 ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t);
1148 ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); 1194 ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t);
1195#endif
1149}; 1196};
1150 1197
1151/* Inode state bits. Protected by inode_lock. */ 1198/* Inode state bits. Protected by inode_lock. */
@@ -1172,15 +1219,30 @@ static inline void mark_inode_dirty_sync(struct inode *inode)
1172 __mark_inode_dirty(inode, I_DIRTY_SYNC); 1219 __mark_inode_dirty(inode, I_DIRTY_SYNC);
1173} 1220}
1174 1221
1175static inline void inode_inc_link_count(struct inode *inode) 1222static inline void inc_nlink(struct inode *inode)
1176{ 1223{
1177 inode->i_nlink++; 1224 inode->i_nlink++;
1225}
1226
1227static inline void inode_inc_link_count(struct inode *inode)
1228{
1229 inc_nlink(inode);
1178 mark_inode_dirty(inode); 1230 mark_inode_dirty(inode);
1179} 1231}
1180 1232
1181static inline void inode_dec_link_count(struct inode *inode) 1233static inline void drop_nlink(struct inode *inode)
1182{ 1234{
1183 inode->i_nlink--; 1235 inode->i_nlink--;
1236}
1237
1238static inline void clear_nlink(struct inode *inode)
1239{
1240 inode->i_nlink = 0;
1241}
1242
1243static inline void inode_dec_link_count(struct inode *inode)
1244{
1245 drop_nlink(inode);
1184 mark_inode_dirty(inode); 1246 mark_inode_dirty(inode);
1185} 1247}
1186 1248
@@ -1438,6 +1500,7 @@ extern void __init vfs_caches_init(unsigned long);
1438extern void putname(const char *name); 1500extern void putname(const char *name);
1439#endif 1501#endif
1440 1502
1503#ifdef CONFIG_BLOCK
1441extern int register_blkdev(unsigned int, const char *); 1504extern int register_blkdev(unsigned int, const char *);
1442extern int unregister_blkdev(unsigned int, const char *); 1505extern int unregister_blkdev(unsigned int, const char *);
1443extern struct block_device *bdget(dev_t); 1506extern struct block_device *bdget(dev_t);
@@ -1446,11 +1509,15 @@ extern void bd_forget(struct inode *inode);
1446extern void bdput(struct block_device *); 1509extern void bdput(struct block_device *);
1447extern struct block_device *open_by_devnum(dev_t, unsigned); 1510extern struct block_device *open_by_devnum(dev_t, unsigned);
1448extern struct block_device *open_partition_by_devnum(dev_t, unsigned); 1511extern struct block_device *open_partition_by_devnum(dev_t, unsigned);
1449extern const struct file_operations def_blk_fops;
1450extern const struct address_space_operations def_blk_aops; 1512extern const struct address_space_operations def_blk_aops;
1513#else
1514static inline void bd_forget(struct inode *inode) {}
1515#endif
1516extern const struct file_operations def_blk_fops;
1451extern const struct file_operations def_chr_fops; 1517extern const struct file_operations def_chr_fops;
1452extern const struct file_operations bad_sock_fops; 1518extern const struct file_operations bad_sock_fops;
1453extern const struct file_operations def_fifo_fops; 1519extern const struct file_operations def_fifo_fops;
1520#ifdef CONFIG_BLOCK
1454extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long); 1521extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long);
1455extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long); 1522extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long);
1456extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); 1523extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long);
@@ -1466,6 +1533,7 @@ extern void bd_release_from_disk(struct block_device *, struct gendisk *);
1466#define bd_claim_by_disk(bdev, holder, disk) bd_claim(bdev, holder) 1533#define bd_claim_by_disk(bdev, holder, disk) bd_claim(bdev, holder)
1467#define bd_release_from_disk(bdev, disk) bd_release(bdev) 1534#define bd_release_from_disk(bdev, disk) bd_release(bdev)
1468#endif 1535#endif
1536#endif
1469 1537
1470/* fs/char_dev.c */ 1538/* fs/char_dev.c */
1471#define CHRDEV_MAJOR_HASH_SIZE 255 1539#define CHRDEV_MAJOR_HASH_SIZE 255
@@ -1479,14 +1547,19 @@ extern int chrdev_open(struct inode *, struct file *);
1479extern void chrdev_show(struct seq_file *,off_t); 1547extern void chrdev_show(struct seq_file *,off_t);
1480 1548
1481/* fs/block_dev.c */ 1549/* fs/block_dev.c */
1482#define BLKDEV_MAJOR_HASH_SIZE 255
1483#define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */ 1550#define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */
1551
1552#ifdef CONFIG_BLOCK
1553#define BLKDEV_MAJOR_HASH_SIZE 255
1484extern const char *__bdevname(dev_t, char *buffer); 1554extern const char *__bdevname(dev_t, char *buffer);
1485extern const char *bdevname(struct block_device *bdev, char *buffer); 1555extern const char *bdevname(struct block_device *bdev, char *buffer);
1486extern struct block_device *lookup_bdev(const char *); 1556extern struct block_device *lookup_bdev(const char *);
1487extern struct block_device *open_bdev_excl(const char *, int, void *); 1557extern struct block_device *open_bdev_excl(const char *, int, void *);
1488extern void close_bdev_excl(struct block_device *); 1558extern void close_bdev_excl(struct block_device *);
1489extern void blkdev_show(struct seq_file *,off_t); 1559extern void blkdev_show(struct seq_file *,off_t);
1560#else
1561#define BLKDEV_MAJOR_HASH_SIZE 0
1562#endif
1490 1563
1491extern void init_special_inode(struct inode *, umode_t, dev_t); 1564extern void init_special_inode(struct inode *, umode_t, dev_t);
1492 1565
@@ -1500,6 +1573,7 @@ extern const struct file_operations rdwr_fifo_fops;
1500 1573
1501extern int fs_may_remount_ro(struct super_block *); 1574extern int fs_may_remount_ro(struct super_block *);
1502 1575
1576#ifdef CONFIG_BLOCK
1503/* 1577/*
1504 * return READ, READA, or WRITE 1578 * return READ, READA, or WRITE
1505 */ 1579 */
@@ -1511,9 +1585,10 @@ extern int fs_may_remount_ro(struct super_block *);
1511#define bio_data_dir(bio) ((bio)->bi_rw & 1) 1585#define bio_data_dir(bio) ((bio)->bi_rw & 1)
1512 1586
1513extern int check_disk_change(struct block_device *); 1587extern int check_disk_change(struct block_device *);
1514extern int invalidate_inodes(struct super_block *);
1515extern int __invalidate_device(struct block_device *); 1588extern int __invalidate_device(struct block_device *);
1516extern int invalidate_partition(struct gendisk *, int); 1589extern int invalidate_partition(struct gendisk *, int);
1590#endif
1591extern int invalidate_inodes(struct super_block *);
1517unsigned long invalidate_mapping_pages(struct address_space *mapping, 1592unsigned long invalidate_mapping_pages(struct address_space *mapping,
1518 pgoff_t start, pgoff_t end); 1593 pgoff_t start, pgoff_t end);
1519unsigned long invalidate_inode_pages(struct address_space *mapping); 1594unsigned long invalidate_inode_pages(struct address_space *mapping);
@@ -1541,11 +1616,14 @@ extern int __filemap_fdatawrite_range(struct address_space *mapping,
1541extern long do_fsync(struct file *file, int datasync); 1616extern long do_fsync(struct file *file, int datasync);
1542extern void sync_supers(void); 1617extern void sync_supers(void);
1543extern void sync_filesystems(int wait); 1618extern void sync_filesystems(int wait);
1619extern void __fsync_super(struct super_block *sb);
1544extern void emergency_sync(void); 1620extern void emergency_sync(void);
1545extern void emergency_remount(void); 1621extern void emergency_remount(void);
1546extern int do_remount_sb(struct super_block *sb, int flags, 1622extern int do_remount_sb(struct super_block *sb, int flags,
1547 void *data, int force); 1623 void *data, int force);
1624#ifdef CONFIG_BLOCK
1548extern sector_t bmap(struct inode *, sector_t); 1625extern sector_t bmap(struct inode *, sector_t);
1626#endif
1549extern int notify_change(struct dentry *, struct iattr *); 1627extern int notify_change(struct dentry *, struct iattr *);
1550extern int permission(struct inode *, int, struct nameidata *); 1628extern int permission(struct inode *, int, struct nameidata *);
1551extern int generic_permission(struct inode *, int, 1629extern int generic_permission(struct inode *, int,
@@ -1563,6 +1641,9 @@ static inline void allow_write_access(struct file *file)
1563 atomic_inc(&file->f_dentry->d_inode->i_writecount); 1641 atomic_inc(&file->f_dentry->d_inode->i_writecount);
1564} 1642}
1565extern int do_pipe(int *); 1643extern int do_pipe(int *);
1644extern struct file *create_read_pipe(struct file *f);
1645extern struct file *create_write_pipe(void);
1646extern void free_write_pipe(struct file *);
1566 1647
1567extern int open_namei(int dfd, const char *, int, int, struct nameidata *); 1648extern int open_namei(int dfd, const char *, int, int, struct nameidata *);
1568extern int may_open(struct nameidata *, int, int); 1649extern int may_open(struct nameidata *, int, int);
@@ -1628,9 +1709,11 @@ static inline void insert_inode_hash(struct inode *inode) {
1628extern struct file * get_empty_filp(void); 1709extern struct file * get_empty_filp(void);
1629extern void file_move(struct file *f, struct list_head *list); 1710extern void file_move(struct file *f, struct list_head *list);
1630extern void file_kill(struct file *f); 1711extern void file_kill(struct file *f);
1712#ifdef CONFIG_BLOCK
1631struct bio; 1713struct bio;
1632extern void submit_bio(int, struct bio *); 1714extern void submit_bio(int, struct bio *);
1633extern int bdev_read_only(struct block_device *); 1715extern int bdev_read_only(struct block_device *);
1716#endif
1634extern int set_blocksize(struct block_device *, int); 1717extern int set_blocksize(struct block_device *, int);
1635extern int sb_set_blocksize(struct super_block *, int); 1718extern int sb_set_blocksize(struct super_block *, int);
1636extern int sb_min_blocksize(struct super_block *, int); 1719extern int sb_min_blocksize(struct super_block *, int);
@@ -1639,22 +1722,17 @@ extern int generic_file_mmap(struct file *, struct vm_area_struct *);
1639extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *); 1722extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *);
1640extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); 1723extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size);
1641extern int file_send_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); 1724extern int file_send_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size);
1642extern ssize_t generic_file_read(struct file *, char __user *, size_t, loff_t *);
1643int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk); 1725int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk);
1644extern ssize_t generic_file_write(struct file *, const char __user *, size_t, loff_t *); 1726extern ssize_t generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t);
1645extern ssize_t generic_file_aio_read(struct kiocb *, char __user *, size_t, loff_t); 1727extern ssize_t generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long, loff_t);
1646extern ssize_t __generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t *);
1647extern ssize_t generic_file_aio_write(struct kiocb *, const char __user *, size_t, loff_t);
1648extern ssize_t generic_file_aio_write_nolock(struct kiocb *, const struct iovec *, 1728extern ssize_t generic_file_aio_write_nolock(struct kiocb *, const struct iovec *,
1649 unsigned long, loff_t *); 1729 unsigned long, loff_t);
1650extern ssize_t generic_file_direct_write(struct kiocb *, const struct iovec *, 1730extern ssize_t generic_file_direct_write(struct kiocb *, const struct iovec *,
1651 unsigned long *, loff_t, loff_t *, size_t, size_t); 1731 unsigned long *, loff_t, loff_t *, size_t, size_t);
1652extern ssize_t generic_file_buffered_write(struct kiocb *, const struct iovec *, 1732extern ssize_t generic_file_buffered_write(struct kiocb *, const struct iovec *,
1653 unsigned long, loff_t, loff_t *, size_t, ssize_t); 1733 unsigned long, loff_t, loff_t *, size_t, ssize_t);
1654extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos); 1734extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos);
1655extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos); 1735extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos);
1656ssize_t generic_file_write_nolock(struct file *file, const struct iovec *iov,
1657 unsigned long nr_segs, loff_t *ppos);
1658extern ssize_t generic_file_sendfile(struct file *, loff_t *, size_t, read_actor_t, void *); 1736extern ssize_t generic_file_sendfile(struct file *, loff_t *, size_t, read_actor_t, void *);
1659extern void do_generic_mapping_read(struct address_space *mapping, 1737extern void do_generic_mapping_read(struct address_space *mapping,
1660 struct file_ra_state *, struct file *, 1738 struct file_ra_state *, struct file *,
@@ -1672,10 +1750,6 @@ extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out,
1672 1750
1673extern void 1751extern void
1674file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); 1752file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping);
1675extern ssize_t generic_file_readv(struct file *filp, const struct iovec *iov,
1676 unsigned long nr_segs, loff_t *ppos);
1677ssize_t generic_file_writev(struct file *filp, const struct iovec *iov,
1678 unsigned long nr_segs, loff_t *ppos);
1679extern loff_t no_llseek(struct file *file, loff_t offset, int origin); 1753extern loff_t no_llseek(struct file *file, loff_t offset, int origin);
1680extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin); 1754extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin);
1681extern loff_t remote_llseek(struct file *file, loff_t offset, int origin); 1755extern loff_t remote_llseek(struct file *file, loff_t offset, int origin);
@@ -1711,6 +1785,7 @@ static inline void do_generic_file_read(struct file * filp, loff_t *ppos,
1711 actor); 1785 actor);
1712} 1786}
1713 1787
1788#ifdef CONFIG_BLOCK
1714ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, 1789ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
1715 struct block_device *bdev, const struct iovec *iov, loff_t offset, 1790 struct block_device *bdev, const struct iovec *iov, loff_t offset,
1716 unsigned long nr_segs, get_block_t get_block, dio_iodone_t end_io, 1791 unsigned long nr_segs, get_block_t get_block, dio_iodone_t end_io,
@@ -1748,6 +1823,7 @@ static inline ssize_t blockdev_direct_IO_own_locking(int rw, struct kiocb *iocb,
1748 return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, 1823 return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset,
1749 nr_segs, get_block, end_io, DIO_OWN_LOCKING); 1824 nr_segs, get_block, end_io, DIO_OWN_LOCKING);
1750} 1825}
1826#endif
1751 1827
1752extern const struct file_operations generic_ro_fops; 1828extern const struct file_operations generic_ro_fops;
1753 1829
diff --git a/include/linux/generic_acl.h b/include/linux/generic_acl.h
new file mode 100644
index 000000000000..80764f40be75
--- /dev/null
+++ b/include/linux/generic_acl.h
@@ -0,0 +1,36 @@
1/*
2 * fs/generic_acl.c
3 *
4 * (C) 2005 Andreas Gruenbacher <agruen@suse.de>
5 *
6 * This file is released under the GPL.
7 */
8
9#ifndef GENERIC_ACL_H
10#define GENERIC_ACL_H
11
12#include <linux/posix_acl.h>
13#include <linux/posix_acl_xattr.h>
14
15/**
16 * struct generic_acl_operations - filesystem operations
17 *
18 * Filesystems must make these operations available to the generic
19 * operations.
20 */
21struct generic_acl_operations {
22 struct posix_acl *(*getacl)(struct inode *, int);
23 void (*setacl)(struct inode *, int, struct posix_acl *);
24};
25
26size_t generic_acl_list(struct inode *, struct generic_acl_operations *, int,
27 char *, size_t);
28int generic_acl_get(struct inode *, struct generic_acl_operations *, int,
29 void *, size_t);
30int generic_acl_set(struct inode *, struct generic_acl_operations *, int,
31 const void *, size_t);
32int generic_acl_init(struct inode *, struct inode *,
33 struct generic_acl_operations *);
34int generic_acl_chmod(struct inode *, struct generic_acl_operations *);
35
36#endif
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index e4af57e87c17..41f276fdd185 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -11,6 +11,8 @@
11 11
12#include <linux/types.h> 12#include <linux/types.h>
13 13
14#ifdef CONFIG_BLOCK
15
14enum { 16enum {
15/* These three have identical behaviour; use the second one if DOS FDISK gets 17/* These three have identical behaviour; use the second one if DOS FDISK gets
16 confused about extended/logical partitions starting past cylinder 1023. */ 18 confused about extended/logical partitions starting past cylinder 1023. */
@@ -420,3 +422,5 @@ static inline struct block_device *bdget_disk(struct gendisk *disk, int index)
420#endif 422#endif
421 423
422#endif 424#endif
425
426#endif
diff --git a/include/linux/getcpu.h b/include/linux/getcpu.h
index 031ed3780e45..c7372d7a97be 100644
--- a/include/linux/getcpu.h
+++ b/include/linux/getcpu.h
@@ -1,16 +1,18 @@
1#ifndef _LINUX_GETCPU_H 1#ifndef _LINUX_GETCPU_H
2#define _LINUX_GETCPU_H 1 2#define _LINUX_GETCPU_H 1
3 3
4/* Cache for getcpu() to speed it up. Results might be upto a jiffie 4/* Cache for getcpu() to speed it up. Results might be a short time
5 out of date, but will be faster. 5 out of date, but will be faster.
6
6 User programs should not refer to the contents of this structure. 7 User programs should not refer to the contents of this structure.
7 It is only a cache for vgetcpu(). It might change in future kernels. 8 I repeat they should not refer to it. If they do they will break
9 in future kernels.
10
11 It is only a private cache for vgetcpu(). It will change in future kernels.
8 The user program must store this information per thread (__thread) 12 The user program must store this information per thread (__thread)
9 If you want 100% accurate information pass NULL instead. */ 13 If you want 100% accurate information pass NULL instead. */
10struct getcpu_cache { 14struct getcpu_cache {
11 unsigned long t0; 15 unsigned long blob[128 / sizeof(long)];
12 unsigned long t1;
13 unsigned long res[4];
14}; 16};
15 17
16#endif 18#endif
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 4fc379de6c2f..fca93025ab51 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -138,6 +138,7 @@ extern long hrtimer_nanosleep(struct timespec *rqtp,
138 struct timespec __user *rmtp, 138 struct timespec __user *rmtp,
139 const enum hrtimer_mode mode, 139 const enum hrtimer_mode mode,
140 const clockid_t clockid); 140 const clockid_t clockid);
141extern long hrtimer_nanosleep_restart(struct restart_block *restart_block);
141 142
142extern void hrtimer_init_sleeper(struct hrtimer_sleeper *sl, 143extern void hrtimer_init_sleeper(struct hrtimer_sleeper *sl,
143 struct task_struct *tsk); 144 struct task_struct *tsk);
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h
index 9418519a55d1..0a8f750cbede 100644
--- a/include/linux/i2c-id.h
+++ b/include/linux/i2c-id.h
@@ -193,6 +193,7 @@
193#define I2C_HW_B_RADEON 0x01001e /* radeon framebuffer driver */ 193#define I2C_HW_B_RADEON 0x01001e /* radeon framebuffer driver */
194#define I2C_HW_B_EM28XX 0x01001f /* em28xx video capture cards */ 194#define I2C_HW_B_EM28XX 0x01001f /* em28xx video capture cards */
195#define I2C_HW_B_CX2341X 0x010020 /* Conexant CX2341X MPEG encoder cards */ 195#define I2C_HW_B_CX2341X 0x010020 /* Conexant CX2341X MPEG encoder cards */
196#define I2C_HW_B_INTELFB 0x010021 /* intel framebuffer driver */
196 197
197/* --- PCF 8584 based algorithms */ 198/* --- PCF 8584 based algorithms */
198#define I2C_HW_P_LP 0x020000 /* Parallel port interface */ 199#define I2C_HW_P_LP 0x020000 /* Parallel port interface */
diff --git a/include/linux/icmp.h b/include/linux/icmp.h
index f0b571f1060b..878cfe4e587f 100644
--- a/include/linux/icmp.h
+++ b/include/linux/icmp.h
@@ -68,16 +68,16 @@
68struct icmphdr { 68struct icmphdr {
69 __u8 type; 69 __u8 type;
70 __u8 code; 70 __u8 code;
71 __u16 checksum; 71 __be16 checksum;
72 union { 72 union {
73 struct { 73 struct {
74 __u16 id; 74 __be16 id;
75 __u16 sequence; 75 __be16 sequence;
76 } echo; 76 } echo;
77 __u32 gateway; 77 __be32 gateway;
78 struct { 78 struct {
79 __u16 __unused; 79 __be16 __unused;
80 __u16 mtu; 80 __be16 mtu;
81 } frag; 81 } frag;
82 } un; 82 } un;
83}; 83};
diff --git a/include/linux/if.h b/include/linux/if.h
index 8018c2e22c0c..32bf419351f1 100644
--- a/include/linux/if.h
+++ b/include/linux/if.h
@@ -214,134 +214,4 @@ struct ifconf
214#define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */ 214#define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */
215#define ifc_req ifc_ifcu.ifcu_req /* array of structures */ 215#define ifc_req ifc_ifcu.ifcu_req /* array of structures */
216 216
217/* The struct should be in sync with struct net_device_stats */
218struct rtnl_link_stats
219{
220 __u32 rx_packets; /* total packets received */
221 __u32 tx_packets; /* total packets transmitted */
222 __u32 rx_bytes; /* total bytes received */
223 __u32 tx_bytes; /* total bytes transmitted */
224 __u32 rx_errors; /* bad packets received */
225 __u32 tx_errors; /* packet transmit problems */
226 __u32 rx_dropped; /* no space in linux buffers */
227 __u32 tx_dropped; /* no space available in linux */
228 __u32 multicast; /* multicast packets received */
229 __u32 collisions;
230
231 /* detailed rx_errors: */
232 __u32 rx_length_errors;
233 __u32 rx_over_errors; /* receiver ring buff overflow */
234 __u32 rx_crc_errors; /* recved pkt with crc error */
235 __u32 rx_frame_errors; /* recv'd frame alignment error */
236 __u32 rx_fifo_errors; /* recv'r fifo overrun */
237 __u32 rx_missed_errors; /* receiver missed packet */
238
239 /* detailed tx_errors */
240 __u32 tx_aborted_errors;
241 __u32 tx_carrier_errors;
242 __u32 tx_fifo_errors;
243 __u32 tx_heartbeat_errors;
244 __u32 tx_window_errors;
245
246 /* for cslip etc */
247 __u32 rx_compressed;
248 __u32 tx_compressed;
249};
250
251/* The struct should be in sync with struct ifmap */
252struct rtnl_link_ifmap
253{
254 __u64 mem_start;
255 __u64 mem_end;
256 __u64 base_addr;
257 __u16 irq;
258 __u8 dma;
259 __u8 port;
260};
261
262enum
263{
264 IFLA_UNSPEC,
265 IFLA_ADDRESS,
266 IFLA_BROADCAST,
267 IFLA_IFNAME,
268 IFLA_MTU,
269 IFLA_LINK,
270 IFLA_QDISC,
271 IFLA_STATS,
272 IFLA_COST,
273#define IFLA_COST IFLA_COST
274 IFLA_PRIORITY,
275#define IFLA_PRIORITY IFLA_PRIORITY
276 IFLA_MASTER,
277#define IFLA_MASTER IFLA_MASTER
278 IFLA_WIRELESS, /* Wireless Extension event - see wireless.h */
279#define IFLA_WIRELESS IFLA_WIRELESS
280 IFLA_PROTINFO, /* Protocol specific information for a link */
281#define IFLA_PROTINFO IFLA_PROTINFO
282 IFLA_TXQLEN,
283#define IFLA_TXQLEN IFLA_TXQLEN
284 IFLA_MAP,
285#define IFLA_MAP IFLA_MAP
286 IFLA_WEIGHT,
287#define IFLA_WEIGHT IFLA_WEIGHT
288 IFLA_OPERSTATE,
289 IFLA_LINKMODE,
290 __IFLA_MAX
291};
292
293
294#define IFLA_MAX (__IFLA_MAX - 1)
295
296/* ifi_flags.
297
298 IFF_* flags.
299
300 The only change is:
301 IFF_LOOPBACK, IFF_BROADCAST and IFF_POINTOPOINT are
302 more not changeable by user. They describe link media
303 characteristics and set by device driver.
304
305 Comments:
306 - Combination IFF_BROADCAST|IFF_POINTOPOINT is invalid
307 - If neither of these three flags are set;
308 the interface is NBMA.
309
310 - IFF_MULTICAST does not mean anything special:
311 multicasts can be used on all not-NBMA links.
312 IFF_MULTICAST means that this media uses special encapsulation
313 for multicast frames. Apparently, all IFF_POINTOPOINT and
314 IFF_BROADCAST devices are able to use multicasts too.
315 */
316
317/* IFLA_LINK.
318 For usual devices it is equal ifi_index.
319 If it is a "virtual interface" (f.e. tunnel), ifi_link
320 can point to real physical interface (f.e. for bandwidth calculations),
321 or maybe 0, what means, that real media is unknown (usual
322 for IPIP tunnels, when route to endpoint is allowed to change)
323 */
324
325/* Subtype attributes for IFLA_PROTINFO */
326enum
327{
328 IFLA_INET6_UNSPEC,
329 IFLA_INET6_FLAGS, /* link flags */
330 IFLA_INET6_CONF, /* sysctl parameters */
331 IFLA_INET6_STATS, /* statistics */
332 IFLA_INET6_MCAST, /* MC things. What of them? */
333 IFLA_INET6_CACHEINFO, /* time values and max reasm size */
334 __IFLA_INET6_MAX
335};
336
337#define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1)
338
339struct ifla_cacheinfo
340{
341 __u32 max_reasm_len;
342 __u32 tstamp; /* ipv6InterfaceTable updated timestamp */
343 __u32 reachable_time;
344 __u32 retrans_time;
345};
346
347#endif /* _LINUX_IF_H */ 217#endif /* _LINUX_IF_H */
diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h
index a8b1a2071838..7f5714214ee3 100644
--- a/include/linux/if_arp.h
+++ b/include/linux/if_arp.h
@@ -130,11 +130,11 @@ struct arpreq_old {
130 130
131struct arphdr 131struct arphdr
132{ 132{
133 unsigned short ar_hrd; /* format of hardware address */ 133 __be16 ar_hrd; /* format of hardware address */
134 unsigned short ar_pro; /* format of protocol address */ 134 __be16 ar_pro; /* format of protocol address */
135 unsigned char ar_hln; /* length of hardware address */ 135 unsigned char ar_hln; /* length of hardware address */
136 unsigned char ar_pln; /* length of protocol address */ 136 unsigned char ar_pln; /* length of protocol address */
137 unsigned short ar_op; /* ARP opcode (command) */ 137 __be16 ar_op; /* ARP opcode (command) */
138 138
139#if 0 139#if 0
140 /* 140 /*
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
new file mode 100644
index 000000000000..e963a077e6f5
--- /dev/null
+++ b/include/linux/if_link.h
@@ -0,0 +1,136 @@
1#ifndef _LINUX_IF_LINK_H
2#define _LINUX_IF_LINK_H
3
4#include <linux/netlink.h>
5
6/* The struct should be in sync with struct net_device_stats */
7struct rtnl_link_stats
8{
9 __u32 rx_packets; /* total packets received */
10 __u32 tx_packets; /* total packets transmitted */
11 __u32 rx_bytes; /* total bytes received */
12 __u32 tx_bytes; /* total bytes transmitted */
13 __u32 rx_errors; /* bad packets received */
14 __u32 tx_errors; /* packet transmit problems */
15 __u32 rx_dropped; /* no space in linux buffers */
16 __u32 tx_dropped; /* no space available in linux */
17 __u32 multicast; /* multicast packets received */
18 __u32 collisions;
19
20 /* detailed rx_errors: */
21 __u32 rx_length_errors;
22 __u32 rx_over_errors; /* receiver ring buff overflow */
23 __u32 rx_crc_errors; /* recved pkt with crc error */
24 __u32 rx_frame_errors; /* recv'd frame alignment error */
25 __u32 rx_fifo_errors; /* recv'r fifo overrun */
26 __u32 rx_missed_errors; /* receiver missed packet */
27
28 /* detailed tx_errors */
29 __u32 tx_aborted_errors;
30 __u32 tx_carrier_errors;
31 __u32 tx_fifo_errors;
32 __u32 tx_heartbeat_errors;
33 __u32 tx_window_errors;
34
35 /* for cslip etc */
36 __u32 rx_compressed;
37 __u32 tx_compressed;
38};
39
40/* The struct should be in sync with struct ifmap */
41struct rtnl_link_ifmap
42{
43 __u64 mem_start;
44 __u64 mem_end;
45 __u64 base_addr;
46 __u16 irq;
47 __u8 dma;
48 __u8 port;
49};
50
51enum
52{
53 IFLA_UNSPEC,
54 IFLA_ADDRESS,
55 IFLA_BROADCAST,
56 IFLA_IFNAME,
57 IFLA_MTU,
58 IFLA_LINK,
59 IFLA_QDISC,
60 IFLA_STATS,
61 IFLA_COST,
62#define IFLA_COST IFLA_COST
63 IFLA_PRIORITY,
64#define IFLA_PRIORITY IFLA_PRIORITY
65 IFLA_MASTER,
66#define IFLA_MASTER IFLA_MASTER
67 IFLA_WIRELESS, /* Wireless Extension event - see wireless.h */
68#define IFLA_WIRELESS IFLA_WIRELESS
69 IFLA_PROTINFO, /* Protocol specific information for a link */
70#define IFLA_PROTINFO IFLA_PROTINFO
71 IFLA_TXQLEN,
72#define IFLA_TXQLEN IFLA_TXQLEN
73 IFLA_MAP,
74#define IFLA_MAP IFLA_MAP
75 IFLA_WEIGHT,
76#define IFLA_WEIGHT IFLA_WEIGHT
77 IFLA_OPERSTATE,
78 IFLA_LINKMODE,
79 __IFLA_MAX
80};
81
82
83#define IFLA_MAX (__IFLA_MAX - 1)
84
85/* ifi_flags.
86
87 IFF_* flags.
88
89 The only change is:
90 IFF_LOOPBACK, IFF_BROADCAST and IFF_POINTOPOINT are
91 more not changeable by user. They describe link media
92 characteristics and set by device driver.
93
94 Comments:
95 - Combination IFF_BROADCAST|IFF_POINTOPOINT is invalid
96 - If neither of these three flags are set;
97 the interface is NBMA.
98
99 - IFF_MULTICAST does not mean anything special:
100 multicasts can be used on all not-NBMA links.
101 IFF_MULTICAST means that this media uses special encapsulation
102 for multicast frames. Apparently, all IFF_POINTOPOINT and
103 IFF_BROADCAST devices are able to use multicasts too.
104 */
105
106/* IFLA_LINK.
107 For usual devices it is equal ifi_index.
108 If it is a "virtual interface" (f.e. tunnel), ifi_link
109 can point to real physical interface (f.e. for bandwidth calculations),
110 or maybe 0, what means, that real media is unknown (usual
111 for IPIP tunnels, when route to endpoint is allowed to change)
112 */
113
114/* Subtype attributes for IFLA_PROTINFO */
115enum
116{
117 IFLA_INET6_UNSPEC,
118 IFLA_INET6_FLAGS, /* link flags */
119 IFLA_INET6_CONF, /* sysctl parameters */
120 IFLA_INET6_STATS, /* statistics */
121 IFLA_INET6_MCAST, /* MC things. What of them? */
122 IFLA_INET6_CACHEINFO, /* time values and max reasm size */
123 __IFLA_INET6_MAX
124};
125
126#define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1)
127
128struct ifla_cacheinfo
129{
130 __u32 max_reasm_len;
131 __u32 tstamp; /* ipv6InterfaceTable updated timestamp */
132 __u32 reachable_time;
133 __u32 retrans_time;
134};
135
136#endif /* _LINUX_IF_LINK_H */
diff --git a/include/linux/igmp.h b/include/linux/igmp.h
index 899c3d4776f3..03f43e2893a4 100644
--- a/include/linux/igmp.h
+++ b/include/linux/igmp.h
@@ -30,8 +30,8 @@ struct igmphdr
30{ 30{
31 __u8 type; 31 __u8 type;
32 __u8 code; /* For newer IGMP */ 32 __u8 code; /* For newer IGMP */
33 __u16 csum; 33 __be16 csum;
34 __u32 group; 34 __be32 group;
35}; 35};
36 36
37/* V3 group record types [grec_type] */ 37/* V3 group record types [grec_type] */
@@ -45,25 +45,25 @@ struct igmphdr
45struct igmpv3_grec { 45struct igmpv3_grec {
46 __u8 grec_type; 46 __u8 grec_type;
47 __u8 grec_auxwords; 47 __u8 grec_auxwords;
48 __u16 grec_nsrcs; 48 __be16 grec_nsrcs;
49 __u32 grec_mca; 49 __be32 grec_mca;
50 __u32 grec_src[0]; 50 __be32 grec_src[0];
51}; 51};
52 52
53struct igmpv3_report { 53struct igmpv3_report {
54 __u8 type; 54 __u8 type;
55 __u8 resv1; 55 __u8 resv1;
56 __u16 csum; 56 __be16 csum;
57 __u16 resv2; 57 __be16 resv2;
58 __u16 ngrec; 58 __be16 ngrec;
59 struct igmpv3_grec grec[0]; 59 struct igmpv3_grec grec[0];
60}; 60};
61 61
62struct igmpv3_query { 62struct igmpv3_query {
63 __u8 type; 63 __u8 type;
64 __u8 code; 64 __u8 code;
65 __u16 csum; 65 __be16 csum;
66 __u32 group; 66 __be32 group;
67#if defined(__LITTLE_ENDIAN_BITFIELD) 67#if defined(__LITTLE_ENDIAN_BITFIELD)
68 __u8 qrv:3, 68 __u8 qrv:3,
69 suppress:1, 69 suppress:1,
@@ -76,8 +76,8 @@ struct igmpv3_query {
76#error "Please fix <asm/byteorder.h>" 76#error "Please fix <asm/byteorder.h>"
77#endif 77#endif
78 __u8 qqic; 78 __u8 qqic;
79 __u16 nsrcs; 79 __be16 nsrcs;
80 __u32 srcs[0]; 80 __be32 srcs[0];
81}; 81};
82 82
83#define IGMP_HOST_MEMBERSHIP_QUERY 0x11 /* From RFC1112 */ 83#define IGMP_HOST_MEMBERSHIP_QUERY 0x11 /* From RFC1112 */
@@ -136,11 +136,11 @@ struct ip_sf_socklist
136{ 136{
137 unsigned int sl_max; 137 unsigned int sl_max;
138 unsigned int sl_count; 138 unsigned int sl_count;
139 __u32 sl_addr[0]; 139 __be32 sl_addr[0];
140}; 140};
141 141
142#define IP_SFLSIZE(count) (sizeof(struct ip_sf_socklist) + \ 142#define IP_SFLSIZE(count) (sizeof(struct ip_sf_socklist) + \
143 (count) * sizeof(__u32)) 143 (count) * sizeof(__be32))
144 144
145#define IP_SFBLOCK 10 /* allocate this many at once */ 145#define IP_SFBLOCK 10 /* allocate this many at once */
146 146
@@ -159,7 +159,7 @@ struct ip_mc_socklist
159struct ip_sf_list 159struct ip_sf_list
160{ 160{
161 struct ip_sf_list *sf_next; 161 struct ip_sf_list *sf_next;
162 __u32 sf_inaddr; 162 __be32 sf_inaddr;
163 unsigned long sf_count[2]; /* include/exclude counts */ 163 unsigned long sf_count[2]; /* include/exclude counts */
164 unsigned char sf_gsresp; /* include in g & s response? */ 164 unsigned char sf_gsresp; /* include in g & s response? */
165 unsigned char sf_oldin; /* change state */ 165 unsigned char sf_oldin; /* change state */
@@ -197,7 +197,7 @@ struct ip_mc_list
197#define IGMPV3_QQIC(value) IGMPV3_EXP(0x80, 4, 3, value) 197#define IGMPV3_QQIC(value) IGMPV3_EXP(0x80, 4, 3, value)
198#define IGMPV3_MRC(value) IGMPV3_EXP(0x80, 4, 3, value) 198#define IGMPV3_MRC(value) IGMPV3_EXP(0x80, 4, 3, value)
199 199
200extern int ip_check_mc(struct in_device *dev, u32 mc_addr, u32 src_addr, u16 proto); 200extern int ip_check_mc(struct in_device *dev, __be32 mc_addr, __be32 src_addr, u16 proto);
201extern int igmp_rcv(struct sk_buff *); 201extern int igmp_rcv(struct sk_buff *);
202extern int ip_mc_join_group(struct sock *sk, struct ip_mreqn *imr); 202extern int ip_mc_join_group(struct sock *sk, struct ip_mreqn *imr);
203extern int ip_mc_leave_group(struct sock *sk, struct ip_mreqn *imr); 203extern int ip_mc_leave_group(struct sock *sk, struct ip_mreqn *imr);
@@ -209,13 +209,13 @@ extern int ip_mc_msfget(struct sock *sk, struct ip_msfilter *msf,
209 struct ip_msfilter __user *optval, int __user *optlen); 209 struct ip_msfilter __user *optval, int __user *optlen);
210extern int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf, 210extern int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf,
211 struct group_filter __user *optval, int __user *optlen); 211 struct group_filter __user *optval, int __user *optlen);
212extern int ip_mc_sf_allow(struct sock *sk, u32 local, u32 rmt, int dif); 212extern int ip_mc_sf_allow(struct sock *sk, __be32 local, __be32 rmt, int dif);
213extern void ip_mr_init(void); 213extern void ip_mr_init(void);
214extern void ip_mc_init_dev(struct in_device *); 214extern void ip_mc_init_dev(struct in_device *);
215extern void ip_mc_destroy_dev(struct in_device *); 215extern void ip_mc_destroy_dev(struct in_device *);
216extern void ip_mc_up(struct in_device *); 216extern void ip_mc_up(struct in_device *);
217extern void ip_mc_down(struct in_device *); 217extern void ip_mc_down(struct in_device *);
218extern void ip_mc_dec_group(struct in_device *in_dev, u32 addr); 218extern void ip_mc_dec_group(struct in_device *in_dev, __be32 addr);
219extern void ip_mc_inc_group(struct in_device *in_dev, u32 addr); 219extern void ip_mc_inc_group(struct in_device *in_dev, __be32 addr);
220#endif 220#endif
221#endif 221#endif
diff --git a/include/linux/in.h b/include/linux/in.h
index bcaca8399aed..d79fc75fa7c2 100644
--- a/include/linux/in.h
+++ b/include/linux/in.h
@@ -123,17 +123,17 @@ struct ip_mreqn
123}; 123};
124 124
125struct ip_mreq_source { 125struct ip_mreq_source {
126 __u32 imr_multiaddr; 126 __be32 imr_multiaddr;
127 __u32 imr_interface; 127 __be32 imr_interface;
128 __u32 imr_sourceaddr; 128 __be32 imr_sourceaddr;
129}; 129};
130 130
131struct ip_msfilter { 131struct ip_msfilter {
132 __u32 imsf_multiaddr; 132 __be32 imsf_multiaddr;
133 __u32 imsf_interface; 133 __be32 imsf_interface;
134 __u32 imsf_fmode; 134 __u32 imsf_fmode;
135 __u32 imsf_numsrc; 135 __u32 imsf_numsrc;
136 __u32 imsf_slist[1]; 136 __be32 imsf_slist[1];
137}; 137};
138 138
139#define IP_MSFILTER_SIZE(numsrc) \ 139#define IP_MSFILTER_SIZE(numsrc) \
diff --git a/include/linux/in6.h b/include/linux/in6.h
index d776829b443f..9be6a4756f0b 100644
--- a/include/linux/in6.h
+++ b/include/linux/in6.h
@@ -32,8 +32,8 @@ struct in6_addr
32 union 32 union
33 { 33 {
34 __u8 u6_addr8[16]; 34 __u8 u6_addr8[16];
35 __u16 u6_addr16[8]; 35 __be16 u6_addr16[8];
36 __u32 u6_addr32[4]; 36 __be32 u6_addr32[4];
37 } in6_u; 37 } in6_u;
38#define s6_addr in6_u.u6_addr8 38#define s6_addr in6_u.u6_addr8
39#define s6_addr16 in6_u.u6_addr16 39#define s6_addr16 in6_u.u6_addr16
@@ -53,7 +53,7 @@ extern const struct in6_addr in6addr_loopback;
53 53
54struct sockaddr_in6 { 54struct sockaddr_in6 {
55 unsigned short int sin6_family; /* AF_INET6 */ 55 unsigned short int sin6_family; /* AF_INET6 */
56 __u16 sin6_port; /* Transport layer port # */ 56 __be16 sin6_port; /* Transport layer port # */
57 __u32 sin6_flowinfo; /* IPv6 flow information */ 57 __u32 sin6_flowinfo; /* IPv6 flow information */
58 struct in6_addr sin6_addr; /* IPv6 address */ 58 struct in6_addr sin6_addr; /* IPv6 address */
59 __u32 sin6_scope_id; /* scope id (new in RFC2553) */ 59 __u32 sin6_scope_id; /* scope id (new in RFC2553) */
diff --git a/include/linux/inet_diag.h b/include/linux/inet_diag.h
index a4606e5810e5..6e8bc548635a 100644
--- a/include/linux/inet_diag.h
+++ b/include/linux/inet_diag.h
@@ -9,10 +9,10 @@
9 9
10/* Socket identity */ 10/* Socket identity */
11struct inet_diag_sockid { 11struct inet_diag_sockid {
12 __u16 idiag_sport; 12 __be16 idiag_sport;
13 __u16 idiag_dport; 13 __be16 idiag_dport;
14 __u32 idiag_src[4]; 14 __be32 idiag_src[4];
15 __u32 idiag_dst[4]; 15 __be32 idiag_dst[4];
16 __u32 idiag_if; 16 __u32 idiag_if;
17 __u32 idiag_cookie[2]; 17 __u32 idiag_cookie[2];
18#define INET_DIAG_NOCOOKIE (~0U) 18#define INET_DIAG_NOCOOKIE (~0U)
@@ -67,7 +67,7 @@ struct inet_diag_hostcond {
67 __u8 family; 67 __u8 family;
68 __u8 prefix_len; 68 __u8 prefix_len;
69 int port; 69 int port;
70 __u32 addr[0]; 70 __be32 addr[0];
71}; 71};
72 72
73/* Base info structure. It contains socket identity (addrs/ports/cookie) 73/* Base info structure. It contains socket identity (addrs/ports/cookie)
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index 92297ff24e85..5a0ab04627bc 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -90,11 +90,11 @@ struct in_ifaddr
90 struct in_ifaddr *ifa_next; 90 struct in_ifaddr *ifa_next;
91 struct in_device *ifa_dev; 91 struct in_device *ifa_dev;
92 struct rcu_head rcu_head; 92 struct rcu_head rcu_head;
93 u32 ifa_local; 93 __be32 ifa_local;
94 u32 ifa_address; 94 __be32 ifa_address;
95 u32 ifa_mask; 95 __be32 ifa_mask;
96 u32 ifa_broadcast; 96 __be32 ifa_broadcast;
97 u32 ifa_anycast; 97 __be32 ifa_anycast;
98 unsigned char ifa_scope; 98 unsigned char ifa_scope;
99 unsigned char ifa_flags; 99 unsigned char ifa_flags;
100 unsigned char ifa_prefixlen; 100 unsigned char ifa_prefixlen;
@@ -104,18 +104,18 @@ struct in_ifaddr
104extern int register_inetaddr_notifier(struct notifier_block *nb); 104extern int register_inetaddr_notifier(struct notifier_block *nb);
105extern int unregister_inetaddr_notifier(struct notifier_block *nb); 105extern int unregister_inetaddr_notifier(struct notifier_block *nb);
106 106
107extern struct net_device *ip_dev_find(u32 addr); 107extern struct net_device *ip_dev_find(__be32 addr);
108extern int inet_addr_onlink(struct in_device *in_dev, u32 a, u32 b); 108extern int inet_addr_onlink(struct in_device *in_dev, __be32 a, __be32 b);
109extern int devinet_ioctl(unsigned int cmd, void __user *); 109extern int devinet_ioctl(unsigned int cmd, void __user *);
110extern void devinet_init(void); 110extern void devinet_init(void);
111extern struct in_device *inetdev_init(struct net_device *dev); 111extern struct in_device *inetdev_init(struct net_device *dev);
112extern struct in_device *inetdev_by_index(int); 112extern struct in_device *inetdev_by_index(int);
113extern u32 inet_select_addr(const struct net_device *dev, u32 dst, int scope); 113extern __be32 inet_select_addr(const struct net_device *dev, __be32 dst, int scope);
114extern u32 inet_confirm_addr(const struct net_device *dev, u32 dst, u32 local, int scope); 114extern __be32 inet_confirm_addr(const struct net_device *dev, __be32 dst, __be32 local, int scope);
115extern struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, u32 prefix, u32 mask); 115extern struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, __be32 prefix, __be32 mask);
116extern void inet_forward_change(void); 116extern void inet_forward_change(void);
117 117
118static __inline__ int inet_ifa_match(u32 addr, struct in_ifaddr *ifa) 118static __inline__ int inet_ifa_match(__be32 addr, struct in_ifaddr *ifa)
119{ 119{
120 return !((addr^ifa->ifa_address)&ifa->ifa_mask); 120 return !((addr^ifa->ifa_address)&ifa->ifa_mask);
121} 121}
@@ -183,7 +183,7 @@ static inline void in_dev_put(struct in_device *idev)
183 183
184#endif /* __KERNEL__ */ 184#endif /* __KERNEL__ */
185 185
186static __inline__ __u32 inet_make_mask(int logmask) 186static __inline__ __be32 inet_make_mask(int logmask)
187{ 187{
188 if (logmask) 188 if (logmask)
189 return htonl(~((1<<(32-logmask))-1)); 189 return htonl(~((1<<(32-logmask))-1));
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index d5afee95fd43..1f97e3d92639 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -123,6 +123,14 @@ static inline void disable_irq_nosync_lockdep(unsigned int irq)
123#endif 123#endif
124} 124}
125 125
126static inline void disable_irq_nosync_lockdep_irqsave(unsigned int irq, unsigned long *flags)
127{
128 disable_irq_nosync(irq);
129#ifdef CONFIG_LOCKDEP
130 local_irq_save(*flags);
131#endif
132}
133
126static inline void disable_irq_lockdep(unsigned int irq) 134static inline void disable_irq_lockdep(unsigned int irq)
127{ 135{
128 disable_irq(irq); 136 disable_irq(irq);
@@ -139,6 +147,14 @@ static inline void enable_irq_lockdep(unsigned int irq)
139 enable_irq(irq); 147 enable_irq(irq);
140} 148}
141 149
150static inline void enable_irq_lockdep_irqrestore(unsigned int irq, unsigned long *flags)
151{
152#ifdef CONFIG_LOCKDEP
153 local_irq_restore(*flags);
154#endif
155 enable_irq(irq);
156}
157
142/* IRQ wakeup (PM) control: */ 158/* IRQ wakeup (PM) control: */
143extern int set_irq_wake(unsigned int irq, unsigned int on); 159extern int set_irq_wake(unsigned int irq, unsigned int on);
144 160
diff --git a/include/linux/io.h b/include/linux/io.h
index 420e2fdf26f6..aa3f5af670b5 100644
--- a/include/linux/io.h
+++ b/include/linux/io.h
@@ -19,8 +19,12 @@
19#define _LINUX_IO_H 19#define _LINUX_IO_H
20 20
21#include <asm/io.h> 21#include <asm/io.h>
22#include <asm/page.h>
22 23
23void __iowrite32_copy(void __iomem *to, const void *from, size_t count); 24void __iowrite32_copy(void __iomem *to, const void *from, size_t count);
24void __iowrite64_copy(void __iomem *to, const void *from, size_t count); 25void __iowrite64_copy(void __iomem *to, const void *from, size_t count);
25 26
27int ioremap_page_range(unsigned long addr, unsigned long end,
28 unsigned long phys_addr, pgprot_t prot);
29
26#endif /* _LINUX_IO_H */ 30#endif /* _LINUX_IO_H */
diff --git a/include/linux/ip.h b/include/linux/ip.h
index 2f4600146f83..6b25d36fc54c 100644
--- a/include/linux/ip.h
+++ b/include/linux/ip.h
@@ -96,7 +96,7 @@ struct iphdr {
96 __be16 frag_off; 96 __be16 frag_off;
97 __u8 ttl; 97 __u8 ttl;
98 __u8 protocol; 98 __u8 protocol;
99 __u16 check; 99 __be16 check;
100 __be32 saddr; 100 __be32 saddr;
101 __be32 daddr; 101 __be32 daddr;
102 /*The options start here. */ 102 /*The options start here. */
@@ -105,22 +105,22 @@ struct iphdr {
105struct ip_auth_hdr { 105struct ip_auth_hdr {
106 __u8 nexthdr; 106 __u8 nexthdr;
107 __u8 hdrlen; /* This one is measured in 32 bit units! */ 107 __u8 hdrlen; /* This one is measured in 32 bit units! */
108 __u16 reserved; 108 __be16 reserved;
109 __u32 spi; 109 __be32 spi;
110 __u32 seq_no; /* Sequence number */ 110 __be32 seq_no; /* Sequence number */
111 __u8 auth_data[0]; /* Variable len but >=4. Mind the 64 bit alignment! */ 111 __u8 auth_data[0]; /* Variable len but >=4. Mind the 64 bit alignment! */
112}; 112};
113 113
114struct ip_esp_hdr { 114struct ip_esp_hdr {
115 __u32 spi; 115 __be32 spi;
116 __u32 seq_no; /* Sequence number */ 116 __be32 seq_no; /* Sequence number */
117 __u8 enc_data[0]; /* Variable len but >=8. Mind the 64 bit alignment! */ 117 __u8 enc_data[0]; /* Variable len but >=8. Mind the 64 bit alignment! */
118}; 118};
119 119
120struct ip_comp_hdr { 120struct ip_comp_hdr {
121 __u8 nexthdr; 121 __u8 nexthdr;
122 __u8 flags; 122 __u8 flags;
123 __u16 cpi; 123 __be16 cpi;
124}; 124};
125 125
126#endif /* _LINUX_IP_H */ 126#endif /* _LINUX_IP_H */
diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h
index d09fbeabf1dc..796ca009fd46 100644
--- a/include/linux/ipmi.h
+++ b/include/linux/ipmi.h
@@ -148,6 +148,13 @@ struct ipmi_lan_addr
148#define IPMI_BMC_CHANNEL 0xf 148#define IPMI_BMC_CHANNEL 0xf
149#define IPMI_NUM_CHANNELS 0x10 149#define IPMI_NUM_CHANNELS 0x10
150 150
151/*
152 * Used to signify an "all channel" bitmask. This is more than the
153 * actual number of channels because this is used in userland and
154 * will cover us if the number of channels is extended.
155 */
156#define IPMI_CHAN_ALL (~0)
157
151 158
152/* 159/*
153 * A raw IPMI message without any addressing. This covers both 160 * A raw IPMI message without any addressing. This covers both
@@ -350,18 +357,21 @@ int ipmi_request_supply_msgs(ipmi_user_t user,
350 357
351/* 358/*
352 * When commands come in to the SMS, the user can register to receive 359 * When commands come in to the SMS, the user can register to receive
353 * them. Only one user can be listening on a specific netfn/cmd pair 360 * them. Only one user can be listening on a specific netfn/cmd/chan tuple
354 * at a time, you will get an EBUSY error if the command is already 361 * at a time, you will get an EBUSY error if the command is already
355 * registered. If a command is received that does not have a user 362 * registered. If a command is received that does not have a user
356 * registered, the driver will automatically return the proper 363 * registered, the driver will automatically return the proper
357 * error. 364 * error. Channels are specified as a bitfield, use IPMI_CHAN_ALL to
365 * mean all channels.
358 */ 366 */
359int ipmi_register_for_cmd(ipmi_user_t user, 367int ipmi_register_for_cmd(ipmi_user_t user,
360 unsigned char netfn, 368 unsigned char netfn,
361 unsigned char cmd); 369 unsigned char cmd,
370 unsigned int chans);
362int ipmi_unregister_for_cmd(ipmi_user_t user, 371int ipmi_unregister_for_cmd(ipmi_user_t user,
363 unsigned char netfn, 372 unsigned char netfn,
364 unsigned char cmd); 373 unsigned char cmd,
374 unsigned int chans);
365 375
366/* 376/*
367 * Allow run-to-completion mode to be set for the interface of 377 * Allow run-to-completion mode to be set for the interface of
@@ -571,6 +581,36 @@ struct ipmi_cmdspec
571#define IPMICTL_UNREGISTER_FOR_CMD _IOR(IPMI_IOC_MAGIC, 15, \ 581#define IPMICTL_UNREGISTER_FOR_CMD _IOR(IPMI_IOC_MAGIC, 15, \
572 struct ipmi_cmdspec) 582 struct ipmi_cmdspec)
573 583
584/*
585 * Register to get commands from other entities on specific channels.
586 * This way, you can only listen on specific channels, or have messages
587 * from some channels go to one place and other channels to someplace
588 * else. The chans field is a bitmask, (1 << channel) for each channel.
589 * It may be IPMI_CHAN_ALL for all channels.
590 */
591struct ipmi_cmdspec_chans
592{
593 unsigned int netfn;
594 unsigned int cmd;
595 unsigned int chans;
596};
597
598/*
599 * Register to receive a specific command on specific channels. error values:
600 * - EFAULT - an address supplied was invalid.
601 * - EBUSY - One of the netfn/cmd/chans supplied was already in use.
602 * - ENOMEM - could not allocate memory for the entry.
603 */
604#define IPMICTL_REGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 28, \
605 struct ipmi_cmdspec_chans)
606/*
607 * Unregister some netfn/cmd/chans. error values:
608 * - EFAULT - an address supplied was invalid.
609 * - ENOENT - None of the netfn/cmd/chans were found registered for this user.
610 */
611#define IPMICTL_UNREGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 29, \
612 struct ipmi_cmdspec_chans)
613
574/* 614/*
575 * Set whether this interface receives events. Note that the first 615 * Set whether this interface receives events. Note that the first
576 * user registered for events will get all pending events for the 616 * user registered for events will get all pending events for the
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index caca57df0d7d..4f435c59de06 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -99,22 +99,22 @@ struct ipv6_destopt_hao {
99struct ipv6_auth_hdr { 99struct ipv6_auth_hdr {
100 __u8 nexthdr; 100 __u8 nexthdr;
101 __u8 hdrlen; /* This one is measured in 32 bit units! */ 101 __u8 hdrlen; /* This one is measured in 32 bit units! */
102 __u16 reserved; 102 __be16 reserved;
103 __u32 spi; 103 __be32 spi;
104 __u32 seq_no; /* Sequence number */ 104 __be32 seq_no; /* Sequence number */
105 __u8 auth_data[0]; /* Length variable but >=4. Mind the 64 bit alignment! */ 105 __u8 auth_data[0]; /* Length variable but >=4. Mind the 64 bit alignment! */
106}; 106};
107 107
108struct ipv6_esp_hdr { 108struct ipv6_esp_hdr {
109 __u32 spi; 109 __be32 spi;
110 __u32 seq_no; /* Sequence number */ 110 __be32 seq_no; /* Sequence number */
111 __u8 enc_data[0]; /* Length variable but >=8. Mind the 64 bit alignment! */ 111 __u8 enc_data[0]; /* Length variable but >=8. Mind the 64 bit alignment! */
112}; 112};
113 113
114struct ipv6_comp_hdr { 114struct ipv6_comp_hdr {
115 __u8 nexthdr; 115 __u8 nexthdr;
116 __u8 flags; 116 __u8 flags;
117 __u16 cpi; 117 __be16 cpi;
118}; 118};
119 119
120/* 120/*
@@ -136,7 +136,7 @@ struct ipv6hdr {
136#endif 136#endif
137 __u8 flow_lbl[3]; 137 __u8 flow_lbl[3];
138 138
139 __u16 payload_len; 139 __be16 payload_len;
140 __u8 nexthdr; 140 __u8 nexthdr;
141 __u8 hop_limit; 141 __u8 hop_limit;
142 142
@@ -461,7 +461,7 @@ static inline struct raw6_sock *raw6_sk(const struct sock *sk)
461 461
462#define INET6_MATCH(__sk, __hash, __saddr, __daddr, __ports, __dif)\ 462#define INET6_MATCH(__sk, __hash, __saddr, __daddr, __ports, __dif)\
463 (((__sk)->sk_hash == (__hash)) && \ 463 (((__sk)->sk_hash == (__hash)) && \
464 ((*((__u32 *)&(inet_sk(__sk)->dport))) == (__ports)) && \ 464 ((*((__portpair *)&(inet_sk(__sk)->dport))) == (__ports)) && \
465 ((__sk)->sk_family == AF_INET6) && \ 465 ((__sk)->sk_family == AF_INET6) && \
466 ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \ 466 ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \
467 ipv6_addr_equal(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \ 467 ipv6_addr_equal(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index a6d9daa38c6d..fe89444b1c6f 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -977,7 +977,6 @@ extern void journal_write_revoke_records(journal_t *, transaction_t *);
977extern int journal_set_revoke(journal_t *, unsigned long, tid_t); 977extern int journal_set_revoke(journal_t *, unsigned long, tid_t);
978extern int journal_test_revoke(journal_t *, unsigned long, tid_t); 978extern int journal_test_revoke(journal_t *, unsigned long, tid_t);
979extern void journal_clear_revoke(journal_t *); 979extern void journal_clear_revoke(journal_t *);
980extern void journal_brelse_array(struct buffer_head *b[], int n);
981extern void journal_switch_revoke_table(journal_t *journal); 980extern void journal_switch_revoke_table(journal_t *journal);
982 981
983/* 982/*
diff --git a/include/linux/kmod.h b/include/linux/kmod.h
index 0db22a1ab474..10f505c8431d 100644
--- a/include/linux/kmod.h
+++ b/include/linux/kmod.h
@@ -47,4 +47,8 @@ call_usermodehelper(char *path, char **argv, char **envp, int wait)
47 47
48extern void usermodehelper_init(void); 48extern void usermodehelper_init(void);
49 49
50struct file;
51extern int call_usermodehelper_pipe(char *path, char *argv[], char *envp[],
52 struct file **filp);
53
50#endif /* __LINUX_KMOD_H__ */ 54#endif /* __LINUX_KMOD_H__ */
diff --git a/include/linux/latency.h b/include/linux/latency.h
new file mode 100644
index 000000000000..c08b52bb55b0
--- /dev/null
+++ b/include/linux/latency.h
@@ -0,0 +1,25 @@
1/*
2 * latency.h: Explicit system-wide latency-expectation infrastructure
3 *
4 * (C) Copyright 2006 Intel Corporation
5 * Author: Arjan van de Ven <arjan@linux.intel.com>
6 *
7 */
8
9#ifndef _INCLUDE_GUARD_LATENCY_H_
10#define _INCLUDE_GUARD_LATENCY_H_
11
12#include <linux/notifier.h>
13
14void set_acceptable_latency(char *identifier, int usecs);
15void modify_acceptable_latency(char *identifier, int usecs);
16void remove_acceptable_latency(char *identifier);
17void synchronize_acceptable_latency(void);
18int system_latency_constraint(void);
19
20int register_latency_notifier(struct notifier_block * nb);
21int unregister_latency_notifier(struct notifier_block * nb);
22
23#define INFINITE_LATENCY 1000000
24
25#endif
diff --git a/include/linux/leds.h b/include/linux/leds.h
index dc23c7c639f3..88afceffb7cb 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -12,6 +12,9 @@
12#ifndef __LINUX_LEDS_H_INCLUDED 12#ifndef __LINUX_LEDS_H_INCLUDED
13#define __LINUX_LEDS_H_INCLUDED 13#define __LINUX_LEDS_H_INCLUDED
14 14
15#include <linux/list.h>
16#include <linux/spinlock.h>
17
15struct device; 18struct device;
16struct class_device; 19struct class_device;
17/* 20/*
diff --git a/include/linux/list.h b/include/linux/list.h
index 65a5b5ceda49..a9c90287c0ff 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -39,6 +39,7 @@ static inline void INIT_LIST_HEAD(struct list_head *list)
39 * This is only for internal list manipulation where we know 39 * This is only for internal list manipulation where we know
40 * the prev/next entries already! 40 * the prev/next entries already!
41 */ 41 */
42#ifndef CONFIG_DEBUG_LIST
42static inline void __list_add(struct list_head *new, 43static inline void __list_add(struct list_head *new,
43 struct list_head *prev, 44 struct list_head *prev,
44 struct list_head *next) 45 struct list_head *next)
@@ -48,6 +49,11 @@ static inline void __list_add(struct list_head *new,
48 new->prev = prev; 49 new->prev = prev;
49 prev->next = new; 50 prev->next = new;
50} 51}
52#else
53extern void __list_add(struct list_head *new,
54 struct list_head *prev,
55 struct list_head *next);
56#endif
51 57
52/** 58/**
53 * list_add - add a new entry 59 * list_add - add a new entry
@@ -57,10 +63,15 @@ static inline void __list_add(struct list_head *new,
57 * Insert a new entry after the specified head. 63 * Insert a new entry after the specified head.
58 * This is good for implementing stacks. 64 * This is good for implementing stacks.
59 */ 65 */
66#ifndef CONFIG_DEBUG_LIST
60static inline void list_add(struct list_head *new, struct list_head *head) 67static inline void list_add(struct list_head *new, struct list_head *head)
61{ 68{
62 __list_add(new, head, head->next); 69 __list_add(new, head, head->next);
63} 70}
71#else
72extern void list_add(struct list_head *new, struct list_head *head);
73#endif
74
64 75
65/** 76/**
66 * list_add_tail - add a new entry 77 * list_add_tail - add a new entry
@@ -153,12 +164,16 @@ static inline void __list_del(struct list_head * prev, struct list_head * next)
153 * Note: list_empty on entry does not return true after this, the entry is 164 * Note: list_empty on entry does not return true after this, the entry is
154 * in an undefined state. 165 * in an undefined state.
155 */ 166 */
167#ifndef CONFIG_DEBUG_LIST
156static inline void list_del(struct list_head *entry) 168static inline void list_del(struct list_head *entry)
157{ 169{
158 __list_del(entry->prev, entry->next); 170 __list_del(entry->prev, entry->next);
159 entry->next = LIST_POISON1; 171 entry->next = LIST_POISON1;
160 entry->prev = LIST_POISON2; 172 entry->prev = LIST_POISON2;
161} 173}
174#else
175extern void list_del(struct list_head *entry);
176#endif
162 177
163/** 178/**
164 * list_del_rcu - deletes entry from list without re-initialization 179 * list_del_rcu - deletes entry from list without re-initialization
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index c040a8c969aa..1314ca0f29be 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -8,13 +8,13 @@
8#ifndef __LINUX_LOCKDEP_H 8#ifndef __LINUX_LOCKDEP_H
9#define __LINUX_LOCKDEP_H 9#define __LINUX_LOCKDEP_H
10 10
11#ifdef CONFIG_LOCKDEP
12
11#include <linux/linkage.h> 13#include <linux/linkage.h>
12#include <linux/list.h> 14#include <linux/list.h>
13#include <linux/debug_locks.h> 15#include <linux/debug_locks.h>
14#include <linux/stacktrace.h> 16#include <linux/stacktrace.h>
15 17
16#ifdef CONFIG_LOCKDEP
17
18/* 18/*
19 * Lock-class usage-state bits: 19 * Lock-class usage-state bits:
20 */ 20 */
diff --git a/include/linux/loop.h b/include/linux/loop.h
index e76c7611d6cc..191a595055f0 100644
--- a/include/linux/loop.h
+++ b/include/linux/loop.h
@@ -59,10 +59,9 @@ struct loop_device {
59 struct bio *lo_bio; 59 struct bio *lo_bio;
60 struct bio *lo_biotail; 60 struct bio *lo_biotail;
61 int lo_state; 61 int lo_state;
62 struct completion lo_done;
63 struct completion lo_bh_done;
64 struct mutex lo_ctl_mutex; 62 struct mutex lo_ctl_mutex;
65 int lo_pending; 63 struct task_struct *lo_thread;
64 wait_queue_head_t lo_event;
66 65
67 request_queue_t *lo_queue; 66 request_queue_t *lo_queue;
68}; 67};
diff --git a/include/linux/memory.h b/include/linux/memory.h
index 8f04143ca363..654ef5544878 100644
--- a/include/linux/memory.h
+++ b/include/linux/memory.h
@@ -57,7 +57,7 @@ struct memory_block {
57struct notifier_block; 57struct notifier_block;
58struct mem_section; 58struct mem_section;
59 59
60#ifndef CONFIG_MEMORY_HOTPLUG 60#ifndef CONFIG_MEMORY_HOTPLUG_SPARSE
61static inline int memory_dev_init(void) 61static inline int memory_dev_init(void)
62{ 62{
63 return 0; 63 return 0;
@@ -78,7 +78,7 @@ extern int remove_memory_block(unsigned long, struct mem_section *, int);
78#define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT) 78#define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT)
79 79
80 80
81#endif /* CONFIG_MEMORY_HOTPLUG */ 81#endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */
82 82
83#define hotplug_memory_notifier(fn, pri) { \ 83#define hotplug_memory_notifier(fn, pri) { \
84 static struct notifier_block fn##_mem_nb = \ 84 static struct notifier_block fn##_mem_nb = \
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h
index 218501cfaeb9..7b54666cea8e 100644
--- a/include/linux/memory_hotplug.h
+++ b/include/linux/memory_hotplug.h
@@ -172,5 +172,7 @@ static inline int __remove_pages(struct zone *zone, unsigned long start_pfn,
172extern int add_memory(int nid, u64 start, u64 size); 172extern int add_memory(int nid, u64 start, u64 size);
173extern int arch_add_memory(int nid, u64 start, u64 size); 173extern int arch_add_memory(int nid, u64 start, u64 size);
174extern int remove_memory(u64 start, u64 size); 174extern int remove_memory(u64 start, u64 size);
175extern int sparse_add_one_section(struct zone *zone, unsigned long start_pfn,
176 int nr_pages);
175 177
176#endif /* __LINUX_MEMORY_HOTPLUG_H */ 178#endif /* __LINUX_MEMORY_HOTPLUG_H */
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 7b703b6d4358..b7966ab8cb6a 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -743,7 +743,9 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long
743 int len, int write, int force, struct page **pages, struct vm_area_struct **vmas); 743 int len, int write, int force, struct page **pages, struct vm_area_struct **vmas);
744void print_bad_pte(struct vm_area_struct *, pte_t, unsigned long); 744void print_bad_pte(struct vm_area_struct *, pte_t, unsigned long);
745 745
746int __set_page_dirty_buffers(struct page *page); 746extern int try_to_release_page(struct page * page, gfp_t gfp_mask);
747extern void do_invalidatepage(struct page *page, unsigned long offset);
748
747int __set_page_dirty_nobuffers(struct page *page); 749int __set_page_dirty_nobuffers(struct page *page);
748int redirty_page_for_writepage(struct writeback_control *wbc, 750int redirty_page_for_writepage(struct writeback_control *wbc,
749 struct page *page); 751 struct page *page);
@@ -944,6 +946,8 @@ extern void mem_init(void);
944extern void show_mem(void); 946extern void show_mem(void);
945extern void si_meminfo(struct sysinfo * val); 947extern void si_meminfo(struct sysinfo * val);
946extern void si_meminfo_node(struct sysinfo *val, int nid); 948extern void si_meminfo_node(struct sysinfo *val, int nid);
949extern void zonetable_add(struct zone *zone, int nid, enum zone_type zid,
950 unsigned long pfn, unsigned long size);
947 951
948#ifdef CONFIG_NUMA 952#ifdef CONFIG_NUMA
949extern void setup_per_cpu_pageset(void); 953extern void setup_per_cpu_pageset(void);
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index ba095aebedff..587264a58d56 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -85,6 +85,8 @@ struct mmc_host {
85 unsigned long caps; /* Host capabilities */ 85 unsigned long caps; /* Host capabilities */
86 86
87#define MMC_CAP_4_BIT_DATA (1 << 0) /* Can the host do 4 bit transfers */ 87#define MMC_CAP_4_BIT_DATA (1 << 0) /* Can the host do 4 bit transfers */
88#define MMC_CAP_MULTIWRITE (1 << 1) /* Can accurately report bytes sent to card on error */
89#define MMC_CAP_BYTEBLOCK (1 << 2) /* Can do non-log2 block sizes */
88 90
89 /* host specific block data */ 91 /* host specific block data */
90 unsigned int max_seg_size; /* see blk_queue_max_segment_size */ 92 unsigned int max_seg_size; /* see blk_queue_max_segment_size */
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
index 627e2c08ce41..a3594dfd6963 100644
--- a/include/linux/mmc/mmc.h
+++ b/include/linux/mmc/mmc.h
@@ -68,7 +68,6 @@ struct mmc_command {
68struct mmc_data { 68struct mmc_data {
69 unsigned int timeout_ns; /* data timeout (in ns, max 80ms) */ 69 unsigned int timeout_ns; /* data timeout (in ns, max 80ms) */
70 unsigned int timeout_clks; /* data timeout (in clocks) */ 70 unsigned int timeout_clks; /* data timeout (in clocks) */
71 unsigned int blksz_bits; /* data block size */
72 unsigned int blksz; /* data block size */ 71 unsigned int blksz; /* data block size */
73 unsigned int blocks; /* number of blocks */ 72 unsigned int blocks; /* number of blocks */
74 unsigned int error; /* data error */ 73 unsigned int error; /* data error */
diff --git a/include/linux/module.h b/include/linux/module.h
index d4486cc2e7fe..2c599175c583 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -232,17 +232,17 @@ enum module_state
232}; 232};
233 233
234/* Similar stuff for section attributes. */ 234/* Similar stuff for section attributes. */
235#define MODULE_SECT_NAME_LEN 32
236struct module_sect_attr 235struct module_sect_attr
237{ 236{
238 struct module_attribute mattr; 237 struct module_attribute mattr;
239 char name[MODULE_SECT_NAME_LEN]; 238 char *name;
240 unsigned long address; 239 unsigned long address;
241}; 240};
242 241
243struct module_sect_attrs 242struct module_sect_attrs
244{ 243{
245 struct attribute_group grp; 244 struct attribute_group grp;
245 int nsections;
246 struct module_sect_attr attrs[0]; 246 struct module_sect_attr attrs[0];
247}; 247};
248 248
diff --git a/include/linux/mpage.h b/include/linux/mpage.h
index 3ca880463c47..cc5fb75af78a 100644
--- a/include/linux/mpage.h
+++ b/include/linux/mpage.h
@@ -9,6 +9,7 @@
9 * (And no, it doesn't do the #ifdef __MPAGE_H thing, and it doesn't do 9 * (And no, it doesn't do the #ifdef __MPAGE_H thing, and it doesn't do
10 * nested includes. Get it right in the .c file). 10 * nested includes. Get it right in the .c file).
11 */ 11 */
12#ifdef CONFIG_BLOCK
12 13
13struct writeback_control; 14struct writeback_control;
14typedef int (writepage_t)(struct page *page, struct writeback_control *wbc); 15typedef int (writepage_t)(struct page *page, struct writeback_control *wbc);
@@ -21,8 +22,4 @@ int mpage_writepages(struct address_space *mapping,
21int mpage_writepage(struct page *page, get_block_t *get_block, 22int mpage_writepage(struct page *page, get_block_t *get_block,
22 struct writeback_control *wbc); 23 struct writeback_control *wbc);
23 24
24static inline int 25#endif
25generic_writepages(struct address_space *mapping, struct writeback_control *wbc)
26{
27 return mpage_writepages(mapping, wbc, NULL);
28}
diff --git a/include/linux/mroute.h b/include/linux/mroute.h
index e05d54a90743..7da2cee8e132 100644
--- a/include/linux/mroute.h
+++ b/include/linux/mroute.h
@@ -142,7 +142,7 @@ struct vif_device
142 unsigned long rate_limit; /* Traffic shaping (NI) */ 142 unsigned long rate_limit; /* Traffic shaping (NI) */
143 unsigned char threshold; /* TTL threshold */ 143 unsigned char threshold; /* TTL threshold */
144 unsigned short flags; /* Control flags */ 144 unsigned short flags; /* Control flags */
145 __u32 local,remote; /* Addresses(remote for tunnels)*/ 145 __be32 local,remote; /* Addresses(remote for tunnels)*/
146 int link; /* Physical interface index */ 146 int link; /* Physical interface index */
147}; 147};
148 148
@@ -151,8 +151,8 @@ struct vif_device
151struct mfc_cache 151struct mfc_cache
152{ 152{
153 struct mfc_cache *next; /* Next entry on cache line */ 153 struct mfc_cache *next; /* Next entry on cache line */
154 __u32 mfc_mcastgrp; /* Group the entry belongs to */ 154 __be32 mfc_mcastgrp; /* Group the entry belongs to */
155 __u32 mfc_origin; /* Source of packet */ 155 __be32 mfc_origin; /* Source of packet */
156 vifi_t mfc_parent; /* Source interface */ 156 vifi_t mfc_parent; /* Source interface */
157 int mfc_flags; /* Flags on line */ 157 int mfc_flags; /* Flags on line */
158 158
@@ -179,9 +179,9 @@ struct mfc_cache
179#define MFC_LINES 64 179#define MFC_LINES 64
180 180
181#ifdef __BIG_ENDIAN 181#ifdef __BIG_ENDIAN
182#define MFC_HASH(a,b) ((((a)>>24)^((b)>>26))&(MFC_LINES-1)) 182#define MFC_HASH(a,b) (((((__force u32)(__be32)a)>>24)^(((__force u32)(__be32)b)>>26))&(MFC_LINES-1))
183#else 183#else
184#define MFC_HASH(a,b) (((a)^((b)>>2))&(MFC_LINES-1)) 184#define MFC_HASH(a,b) ((((__force u32)(__be32)a)^(((__force u32)(__be32)b)>>2))&(MFC_LINES-1))
185#endif 185#endif
186 186
187#endif 187#endif
@@ -213,8 +213,8 @@ struct pimreghdr
213{ 213{
214 __u8 type; 214 __u8 type;
215 __u8 reserved; 215 __u8 reserved;
216 __u16 csum; 216 __be16 csum;
217 __u32 flags; 217 __be32 flags;
218}; 218};
219 219
220extern int pim_rcv_v1(struct sk_buff *); 220extern int pim_rcv_v1(struct sk_buff *);
diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h
index bae62d62dc3e..ce6c85815cbd 100644
--- a/include/linux/msdos_fs.h
+++ b/include/linux/msdos_fs.h
@@ -204,6 +204,7 @@ struct fat_mount_options {
204 unicode_xlate:1, /* create escape sequences for unhandled Unicode */ 204 unicode_xlate:1, /* create escape sequences for unhandled Unicode */
205 numtail:1, /* Does first alias have a numeric '~1' type tail? */ 205 numtail:1, /* Does first alias have a numeric '~1' type tail? */
206 atari:1, /* Use Atari GEMDOS variation of MS-DOS fs */ 206 atari:1, /* Use Atari GEMDOS variation of MS-DOS fs */
207 flush:1, /* write things quickly */
207 nocase:1; /* Does this need case conversion? 0=need case conversion*/ 208 nocase:1; /* Does this need case conversion? 0=need case conversion*/
208}; 209};
209 210
@@ -412,6 +413,8 @@ extern int fat_sync_inode(struct inode *inode);
412extern int fat_fill_super(struct super_block *sb, void *data, int silent, 413extern int fat_fill_super(struct super_block *sb, void *data, int silent,
413 struct inode_operations *fs_dir_inode_ops, int isvfat); 414 struct inode_operations *fs_dir_inode_ops, int isvfat);
414 415
416extern int fat_flush_inodes(struct super_block *sb, struct inode *i1,
417 struct inode *i2);
415/* fat/misc.c */ 418/* fat/misc.c */
416extern void fat_fs_panic(struct super_block *s, const char *fmt, ...); 419extern void fat_fs_panic(struct super_block *s, const char *fmt, ...);
417extern void fat_clusters_flush(struct super_block *sb); 420extern void fat_clusters_flush(struct super_block *sb);
diff --git a/include/linux/namei.h b/include/linux/namei.h
index 45511a5918d3..f5f19606effb 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -1,6 +1,7 @@
1#ifndef _LINUX_NAMEI_H 1#ifndef _LINUX_NAMEI_H
2#define _LINUX_NAMEI_H 2#define _LINUX_NAMEI_H
3 3
4#include <linux/dcache.h>
4#include <linux/linkage.h> 5#include <linux/linkage.h>
5 6
6struct vfsmount; 7struct vfsmount;
@@ -54,6 +55,7 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND};
54#define LOOKUP_OPEN (0x0100) 55#define LOOKUP_OPEN (0x0100)
55#define LOOKUP_CREATE (0x0200) 56#define LOOKUP_CREATE (0x0200)
56#define LOOKUP_ACCESS (0x0400) 57#define LOOKUP_ACCESS (0x0400)
58#define LOOKUP_CHDIR (0x0800)
57 59
58extern int FASTCALL(__user_walk(const char __user *, unsigned, struct nameidata *)); 60extern int FASTCALL(__user_walk(const char __user *, unsigned, struct nameidata *));
59extern int FASTCALL(__user_walk_fd(int dfd, const char __user *, unsigned, struct nameidata *)); 61extern int FASTCALL(__user_walk_fd(int dfd, const char __user *, unsigned, struct nameidata *));
diff --git a/include/linux/ncp_fs.h b/include/linux/ncp_fs.h
index 02e352be717e..0ea7f89e613c 100644
--- a/include/linux/ncp_fs.h
+++ b/include/linux/ncp_fs.h
@@ -212,6 +212,7 @@ void ncp_date_unix2dos(int unix_date, __le16 * time, __le16 * date);
212 212
213/* linux/fs/ncpfs/ioctl.c */ 213/* linux/fs/ncpfs/ioctl.c */
214int ncp_ioctl(struct inode *, struct file *, unsigned int, unsigned long); 214int ncp_ioctl(struct inode *, struct file *, unsigned int, unsigned long);
215long ncp_compat_ioctl(struct file *, unsigned int, unsigned long);
215 216
216/* linux/fs/ncpfs/sock.c */ 217/* linux/fs/ncpfs/sock.c */
217int ncp_request2(struct ncp_server *server, int function, 218int ncp_request2(struct ncp_server *server, int function,
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 13d6d4eb8b3a..9264139bd8df 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -187,7 +187,7 @@ struct hh_cache
187{ 187{
188 struct hh_cache *hh_next; /* Next entry */ 188 struct hh_cache *hh_next; /* Next entry */
189 atomic_t hh_refcnt; /* number of users */ 189 atomic_t hh_refcnt; /* number of users */
190 unsigned short hh_type; /* protocol identifier, f.e ETH_P_IP 190 __be16 hh_type; /* protocol identifier, f.e ETH_P_IP
191 * NOTE: For VLANs, this will be the 191 * NOTE: For VLANs, this will be the
192 * encapuslated type. --BLG 192 * encapuslated type. --BLG
193 */ 193 */
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h
index 149e87c9ab13..44e39b61d9e7 100644
--- a/include/linux/netfilter_arp/arp_tables.h
+++ b/include/linux/netfilter_arp/arp_tables.h
@@ -46,11 +46,11 @@ struct arpt_arp {
46 struct arpt_devaddr_info tgt_devaddr; 46 struct arpt_devaddr_info tgt_devaddr;
47 47
48 /* ARP operation code. */ 48 /* ARP operation code. */
49 u_int16_t arpop, arpop_mask; 49 __be16 arpop, arpop_mask;
50 50
51 /* ARP hardware address and protocol address format. */ 51 /* ARP hardware address and protocol address format. */
52 u_int16_t arhrd, arhrd_mask; 52 __be16 arhrd, arhrd_mask;
53 u_int16_t arpro, arpro_mask; 53 __be16 arpro, arpro_mask;
54 54
55 /* The protocol address length is only accepted if it is 4 55 /* The protocol address length is only accepted if it is 4
56 * so there is no use in offering a way to do filtering on it. 56 * so there is no use in offering a way to do filtering on it.
diff --git a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h
index 51dbec1892c8..64e868034c4a 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack.h
@@ -157,7 +157,7 @@ struct ip_conntrack_expect
157 unsigned int flags; 157 unsigned int flags;
158 158
159#ifdef CONFIG_IP_NF_NAT_NEEDED 159#ifdef CONFIG_IP_NF_NAT_NEEDED
160 u_int32_t saved_ip; 160 __be32 saved_ip;
161 /* This is the original per-proto part, used to map the 161 /* This is the original per-proto part, used to map the
162 * expected connection the way the recipient expects. */ 162 * expected connection the way the recipient expects. */
163 union ip_conntrack_manip_proto saved_proto; 163 union ip_conntrack_manip_proto saved_proto;
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_h323.h b/include/linux/netfilter_ipv4/ip_conntrack_h323.h
index 3cbff7379002..943cc6a4871d 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_h323.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack_h323.h
@@ -30,7 +30,7 @@ struct ip_ct_h323_master {
30struct ip_conntrack_expect; 30struct ip_conntrack_expect;
31 31
32extern int get_h225_addr(unsigned char *data, TransportAddress * addr, 32extern int get_h225_addr(unsigned char *data, TransportAddress * addr,
33 u_int32_t * ip, u_int16_t * port); 33 __be32 * ip, u_int16_t * port);
34extern void ip_conntrack_h245_expect(struct ip_conntrack *new, 34extern void ip_conntrack_h245_expect(struct ip_conntrack *new,
35 struct ip_conntrack_expect *this); 35 struct ip_conntrack_expect *this);
36extern void ip_conntrack_q931_expect(struct ip_conntrack *new, 36extern void ip_conntrack_q931_expect(struct ip_conntrack *new,
@@ -38,11 +38,11 @@ extern void ip_conntrack_q931_expect(struct ip_conntrack *new,
38extern int (*set_h245_addr_hook) (struct sk_buff ** pskb, 38extern int (*set_h245_addr_hook) (struct sk_buff ** pskb,
39 unsigned char **data, int dataoff, 39 unsigned char **data, int dataoff,
40 H245_TransportAddress * addr, 40 H245_TransportAddress * addr,
41 u_int32_t ip, u_int16_t port); 41 __be32 ip, u_int16_t port);
42extern int (*set_h225_addr_hook) (struct sk_buff ** pskb, 42extern int (*set_h225_addr_hook) (struct sk_buff ** pskb,
43 unsigned char **data, int dataoff, 43 unsigned char **data, int dataoff,
44 TransportAddress * addr, 44 TransportAddress * addr,
45 u_int32_t ip, u_int16_t port); 45 __be32 ip, u_int16_t port);
46extern int (*set_sig_addr_hook) (struct sk_buff ** pskb, 46extern int (*set_sig_addr_hook) (struct sk_buff ** pskb,
47 struct ip_conntrack * ct, 47 struct ip_conntrack * ct,
48 enum ip_conntrack_info ctinfo, 48 enum ip_conntrack_info ctinfo,
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_tuple.h b/include/linux/netfilter_ipv4/ip_conntrack_tuple.h
index 2fdabdb4c0ef..c228bde74c33 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_tuple.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack_tuple.h
@@ -23,13 +23,13 @@ union ip_conntrack_manip_proto
23 __be16 port; 23 __be16 port;
24 } tcp; 24 } tcp;
25 struct { 25 struct {
26 u_int16_t port; 26 __be16 port;
27 } udp; 27 } udp;
28 struct { 28 struct {
29 u_int16_t id; 29 __be16 id;
30 } icmp; 30 } icmp;
31 struct { 31 struct {
32 u_int16_t port; 32 __be16 port;
33 } sctp; 33 } sctp;
34 struct { 34 struct {
35 __be16 key; /* key is 32bit, pptp only uses 16 */ 35 __be16 key; /* key is 32bit, pptp only uses 16 */
@@ -39,7 +39,7 @@ union ip_conntrack_manip_proto
39/* The manipulable part of the tuple. */ 39/* The manipulable part of the tuple. */
40struct ip_conntrack_manip 40struct ip_conntrack_manip
41{ 41{
42 u_int32_t ip; 42 __be32 ip;
43 union ip_conntrack_manip_proto u; 43 union ip_conntrack_manip_proto u;
44}; 44};
45 45
@@ -50,22 +50,22 @@ struct ip_conntrack_tuple
50 50
51 /* These are the parts of the tuple which are fixed. */ 51 /* These are the parts of the tuple which are fixed. */
52 struct { 52 struct {
53 u_int32_t ip; 53 __be32 ip;
54 union { 54 union {
55 /* Add other protocols here. */ 55 /* Add other protocols here. */
56 u_int16_t all; 56 u_int16_t all;
57 57
58 struct { 58 struct {
59 u_int16_t port; 59 __be16 port;
60 } tcp; 60 } tcp;
61 struct { 61 struct {
62 u_int16_t port; 62 __be16 port;
63 } udp; 63 } udp;
64 struct { 64 struct {
65 u_int8_t type, code; 65 u_int8_t type, code;
66 } icmp; 66 } icmp;
67 struct { 67 struct {
68 u_int16_t port; 68 __be16 port;
69 } sctp; 69 } sctp;
70 struct { 70 struct {
71 __be16 key; /* key is 32bit, 71 __be16 key; /* key is 32bit,
diff --git a/include/linux/netfilter_ipv4/ip_nat.h b/include/linux/netfilter_ipv4/ip_nat.h
index 98f8407e4cb5..bdf553620ca1 100644
--- a/include/linux/netfilter_ipv4/ip_nat.h
+++ b/include/linux/netfilter_ipv4/ip_nat.h
@@ -33,7 +33,7 @@ struct ip_nat_range
33 unsigned int flags; 33 unsigned int flags;
34 34
35 /* Inclusive: network order. */ 35 /* Inclusive: network order. */
36 u_int32_t min_ip, max_ip; 36 __be32 min_ip, max_ip;
37 37
38 /* Inclusive: network order */ 38 /* Inclusive: network order */
39 union ip_conntrack_manip_proto min, max; 39 union ip_conntrack_manip_proto min, max;
diff --git a/include/linux/netfilter_ipv4/ip_queue.h b/include/linux/netfilter_ipv4/ip_queue.h
index aa08d68c4841..a03507f465f8 100644
--- a/include/linux/netfilter_ipv4/ip_queue.h
+++ b/include/linux/netfilter_ipv4/ip_queue.h
@@ -26,7 +26,7 @@ typedef struct ipq_packet_msg {
26 unsigned int hook; /* Netfilter hook we rode in on */ 26 unsigned int hook; /* Netfilter hook we rode in on */
27 char indev_name[IFNAMSIZ]; /* Name of incoming interface */ 27 char indev_name[IFNAMSIZ]; /* Name of incoming interface */
28 char outdev_name[IFNAMSIZ]; /* Name of outgoing interface */ 28 char outdev_name[IFNAMSIZ]; /* Name of outgoing interface */
29 unsigned short hw_protocol; /* Hardware protocol (network order) */ 29 __be16 hw_protocol; /* Hardware protocol (network order) */
30 unsigned short hw_type; /* Hardware type */ 30 unsigned short hw_type; /* Hardware type */
31 unsigned char hw_addrlen; /* Hardware address length */ 31 unsigned char hw_addrlen; /* Hardware address length */
32 unsigned char hw_addr[8]; /* Hardware address */ 32 unsigned char hw_addr[8]; /* Hardware address */
diff --git a/include/linux/netfilter_ipv4/ipt_iprange.h b/include/linux/netfilter_ipv4/ipt_iprange.h
index 3ecb3bd63676..34ab0fb736e2 100644
--- a/include/linux/netfilter_ipv4/ipt_iprange.h
+++ b/include/linux/netfilter_ipv4/ipt_iprange.h
@@ -8,7 +8,7 @@
8 8
9struct ipt_iprange { 9struct ipt_iprange {
10 /* Inclusive: network order. */ 10 /* Inclusive: network order. */
11 u_int32_t min_ip, max_ip; 11 __be32 min_ip, max_ip;
12}; 12};
13 13
14struct ipt_iprange_info 14struct ipt_iprange_info
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 98c9b9f667a5..76ff54846ada 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -367,10 +367,12 @@ extern int nfs3_removexattr (struct dentry *, const char *name);
367 */ 367 */
368extern ssize_t nfs_direct_IO(int, struct kiocb *, const struct iovec *, loff_t, 368extern ssize_t nfs_direct_IO(int, struct kiocb *, const struct iovec *, loff_t,
369 unsigned long); 369 unsigned long);
370extern ssize_t nfs_file_direct_read(struct kiocb *iocb, char __user *buf, 370extern ssize_t nfs_file_direct_read(struct kiocb *iocb,
371 size_t count, loff_t pos); 371 const struct iovec *iov, unsigned long nr_segs,
372extern ssize_t nfs_file_direct_write(struct kiocb *iocb, const char __user *buf, 372 loff_t pos);
373 size_t count, loff_t pos); 373extern ssize_t nfs_file_direct_write(struct kiocb *iocb,
374 const struct iovec *iov, unsigned long nr_segs,
375 loff_t pos);
374 376
375/* 377/*
376 * linux/fs/nfs/dir.c 378 * linux/fs/nfs/dir.c
diff --git a/include/linux/nmi.h b/include/linux/nmi.h
index c8f4d2f627d7..e16904e28c3a 100644
--- a/include/linux/nmi.h
+++ b/include/linux/nmi.h
@@ -4,6 +4,7 @@
4#ifndef LINUX_NMI_H 4#ifndef LINUX_NMI_H
5#define LINUX_NMI_H 5#define LINUX_NMI_H
6 6
7#include <linux/sched.h>
7#include <asm/irq.h> 8#include <asm/irq.h>
8 9
9/** 10/**
@@ -16,7 +17,7 @@
16#ifdef ARCH_HAS_NMI_WATCHDOG 17#ifdef ARCH_HAS_NMI_WATCHDOG
17extern void touch_nmi_watchdog(void); 18extern void touch_nmi_watchdog(void);
18#else 19#else
19# define touch_nmi_watchdog() do { } while(0) 20# define touch_nmi_watchdog() touch_softlockup_watchdog()
20#endif 21#endif
21 22
22#endif 23#endif
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 9d7921dd50f0..4830a3bedfb2 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -128,12 +128,11 @@
128 128
129#define PageUptodate(page) test_bit(PG_uptodate, &(page)->flags) 129#define PageUptodate(page) test_bit(PG_uptodate, &(page)->flags)
130#ifdef CONFIG_S390 130#ifdef CONFIG_S390
131#define SetPageUptodate(_page) \ 131static inline void SetPageUptodate(struct page *page)
132 do { \ 132{
133 struct page *__page = (_page); \ 133 if (!test_and_set_bit(PG_uptodate, &page->flags))
134 if (!test_and_set_bit(PG_uptodate, &__page->flags)) \ 134 page_test_and_clear_dirty(page);
135 page_test_and_clear_dirty(_page); \ 135}
136 } while (0)
137#else 136#else
138#define SetPageUptodate(page) set_bit(PG_uptodate, &(page)->flags) 137#define SetPageUptodate(page) set_bit(PG_uptodate, &(page)->flags)
139#endif 138#endif
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 5c3a4176eb64..4431ce4e1e6f 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -787,12 +787,13 @@ enum pci_fixup_pass {
787void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev); 787void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev);
788 788
789extern int pci_pci_problems; 789extern int pci_pci_problems;
790#define PCIPCI_FAIL 1 790#define PCIPCI_FAIL 1 /* No PCI PCI DMA */
791#define PCIPCI_TRITON 2 791#define PCIPCI_TRITON 2
792#define PCIPCI_NATOMA 4 792#define PCIPCI_NATOMA 4
793#define PCIPCI_VIAETBF 8 793#define PCIPCI_VIAETBF 8
794#define PCIPCI_VSFX 16 794#define PCIPCI_VSFX 16
795#define PCIPCI_ALIMAGIK 32 795#define PCIPCI_ALIMAGIK 32 /* Need low latency setting */
796#define PCIAGP_FAIL 64 /* No PCI to AGP DMA */
796 797
797#endif /* __KERNEL__ */ 798#endif /* __KERNEL__ */
798#endif /* LINUX_PCI_H */ 799#endif /* LINUX_PCI_H */
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index ab032ceafa84..c9ffbc3843d5 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -479,6 +479,7 @@
479 479
480#define PCI_VENDOR_ID_AMD 0x1022 480#define PCI_VENDOR_ID_AMD 0x1022
481#define PCI_DEVICE_ID_AMD_K8_NB 0x1100 481#define PCI_DEVICE_ID_AMD_K8_NB 0x1100
482#define PCI_DEVICE_ID_AMD_K8_NB_MISC 0x1103
482#define PCI_DEVICE_ID_AMD_LANCE 0x2000 483#define PCI_DEVICE_ID_AMD_LANCE 0x2000
483#define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001 484#define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001
484#define PCI_DEVICE_ID_AMD_SCSI 0x2020 485#define PCI_DEVICE_ID_AMD_SCSI 0x2020
@@ -506,6 +507,7 @@
506#define PCI_DEVICE_ID_AMD_8151_0 0x7454 507#define PCI_DEVICE_ID_AMD_8151_0 0x7454
507#define PCI_DEVICE_ID_AMD_8131_BRIDGE 0x7450 508#define PCI_DEVICE_ID_AMD_8131_BRIDGE 0x7450
508#define PCI_DEVICE_ID_AMD_8131_APIC 0x7451 509#define PCI_DEVICE_ID_AMD_8131_APIC 0x7451
510#define PCI_DEVICE_ID_AMD_8132_BRIDGE 0x7458
509#define PCI_DEVICE_ID_AMD_CS5536_ISA 0x2090 511#define PCI_DEVICE_ID_AMD_CS5536_ISA 0x2090
510#define PCI_DEVICE_ID_AMD_CS5536_FLASH 0x2091 512#define PCI_DEVICE_ID_AMD_CS5536_FLASH 0x2091
511#define PCI_DEVICE_ID_AMD_CS5536_AUDIO 0x2093 513#define PCI_DEVICE_ID_AMD_CS5536_AUDIO 0x2093
@@ -1903,6 +1905,7 @@
1903#define PCI_DEVICE_ID_TIGON3_5705_2 0x1654 1905#define PCI_DEVICE_ID_TIGON3_5705_2 0x1654
1904#define PCI_DEVICE_ID_TIGON3_5720 0x1658 1906#define PCI_DEVICE_ID_TIGON3_5720 0x1658
1905#define PCI_DEVICE_ID_TIGON3_5721 0x1659 1907#define PCI_DEVICE_ID_TIGON3_5721 0x1659
1908#define PCI_DEVICE_ID_TIGON3_5722 0x165a
1906#define PCI_DEVICE_ID_TIGON3_5705M 0x165d 1909#define PCI_DEVICE_ID_TIGON3_5705M 0x165d
1907#define PCI_DEVICE_ID_TIGON3_5705M_2 0x165e 1910#define PCI_DEVICE_ID_TIGON3_5705M_2 0x165e
1908#define PCI_DEVICE_ID_TIGON3_5714 0x1668 1911#define PCI_DEVICE_ID_TIGON3_5714 0x1668
@@ -1912,6 +1915,7 @@
1912#define PCI_DEVICE_ID_TIGON3_5705F 0x166e 1915#define PCI_DEVICE_ID_TIGON3_5705F 0x166e
1913#define PCI_DEVICE_ID_TIGON3_5754M 0x1672 1916#define PCI_DEVICE_ID_TIGON3_5754M 0x1672
1914#define PCI_DEVICE_ID_TIGON3_5755M 0x1673 1917#define PCI_DEVICE_ID_TIGON3_5755M 0x1673
1918#define PCI_DEVICE_ID_TIGON3_5756 0x1674
1915#define PCI_DEVICE_ID_TIGON3_5750 0x1676 1919#define PCI_DEVICE_ID_TIGON3_5750 0x1676
1916#define PCI_DEVICE_ID_TIGON3_5751 0x1677 1920#define PCI_DEVICE_ID_TIGON3_5751 0x1677
1917#define PCI_DEVICE_ID_TIGON3_5715 0x1678 1921#define PCI_DEVICE_ID_TIGON3_5715 0x1678
@@ -1941,6 +1945,8 @@
1941#define PCI_DEVICE_ID_TIGON3_5901 0x170d 1945#define PCI_DEVICE_ID_TIGON3_5901 0x170d
1942#define PCI_DEVICE_ID_BCM4401B1 0x170c 1946#define PCI_DEVICE_ID_BCM4401B1 0x170c
1943#define PCI_DEVICE_ID_TIGON3_5901_2 0x170e 1947#define PCI_DEVICE_ID_TIGON3_5901_2 0x170e
1948#define PCI_DEVICE_ID_TIGON3_5906 0x1712
1949#define PCI_DEVICE_ID_TIGON3_5906M 0x1713
1944#define PCI_DEVICE_ID_BCM4401 0x4401 1950#define PCI_DEVICE_ID_BCM4401 0x4401
1945#define PCI_DEVICE_ID_BCM4401B0 0x4402 1951#define PCI_DEVICE_ID_BCM4401B0 0x4402
1946 1952
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index 3835a9642f13..46ec72fa2c84 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -74,7 +74,7 @@ static inline int __percpu_populate_mask(void *__pdata, size_t size, gfp_t gfp,
74 return 0; 74 return 0;
75} 75}
76 76
77static inline void *__percpu_alloc_mask(size_t size, gfp_t gfp, cpumask_t *mask) 77static __always_inline void *__percpu_alloc_mask(size_t size, gfp_t gfp, cpumask_t *mask)
78{ 78{
79 return kzalloc(size, gfp); 79 return kzalloc(size, gfp);
80} 80}
diff --git a/include/linux/posix-timers.h b/include/linux/posix-timers.h
index 95572c434bc9..a7dd38f30ade 100644
--- a/include/linux/posix-timers.h
+++ b/include/linux/posix-timers.h
@@ -72,6 +72,7 @@ struct k_clock {
72 int (*timer_create) (struct k_itimer *timer); 72 int (*timer_create) (struct k_itimer *timer);
73 int (*nsleep) (const clockid_t which_clock, int flags, 73 int (*nsleep) (const clockid_t which_clock, int flags,
74 struct timespec *, struct timespec __user *); 74 struct timespec *, struct timespec __user *);
75 long (*nsleep_restart) (struct restart_block *restart_block);
75 int (*timer_set) (struct k_itimer * timr, int flags, 76 int (*timer_set) (struct k_itimer * timr, int flags,
76 struct itimerspec * new_setting, 77 struct itimerspec * new_setting,
77 struct itimerspec * old_setting); 78 struct itimerspec * old_setting);
@@ -97,6 +98,7 @@ int posix_cpu_clock_set(const clockid_t which_clock, const struct timespec *ts);
97int posix_cpu_timer_create(struct k_itimer *timer); 98int posix_cpu_timer_create(struct k_itimer *timer);
98int posix_cpu_nsleep(const clockid_t which_clock, int flags, 99int posix_cpu_nsleep(const clockid_t which_clock, int flags,
99 struct timespec *rqtp, struct timespec __user *rmtp); 100 struct timespec *rqtp, struct timespec __user *rmtp);
101long posix_cpu_nsleep_restart(struct restart_block *restart_block);
100int posix_cpu_timer_set(struct k_itimer *timer, int flags, 102int posix_cpu_timer_set(struct k_itimer *timer, int flags,
101 struct itimerspec *new, struct itimerspec *old); 103 struct itimerspec *new, struct itimerspec *old);
102int posix_cpu_timer_del(struct k_itimer *timer); 104int posix_cpu_timer_del(struct k_itimer *timer);
@@ -111,4 +113,6 @@ void posix_cpu_timers_exit_group(struct task_struct *task);
111void set_process_cpu_timer(struct task_struct *task, unsigned int clock_idx, 113void set_process_cpu_timer(struct task_struct *task, unsigned int clock_idx,
112 cputime_t *newval, cputime_t *oldval); 114 cputime_t *newval, cputime_t *oldval);
113 115
116long clock_nanosleep_restart(struct restart_block *restart_block);
117
114#endif 118#endif
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index 8b2749a259dc..eeb1976ef7bf 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -16,8 +16,8 @@
16#define PTRACE_KILL 8 16#define PTRACE_KILL 8
17#define PTRACE_SINGLESTEP 9 17#define PTRACE_SINGLESTEP 9
18 18
19#define PTRACE_ATTACH 0x10 19#define PTRACE_ATTACH 16
20#define PTRACE_DETACH 0x11 20#define PTRACE_DETACH 17
21 21
22#define PTRACE_SYSCALL 24 22#define PTRACE_SYSCALL 24
23 23
diff --git a/include/linux/raid/md.h b/include/linux/raid/md.h
index eb3e547c8fee..c588709acbbc 100644
--- a/include/linux/raid/md.h
+++ b/include/linux/raid/md.h
@@ -53,6 +53,8 @@
53#include <linux/raid/md_u.h> 53#include <linux/raid/md_u.h>
54#include <linux/raid/md_k.h> 54#include <linux/raid/md_k.h>
55 55
56#ifdef CONFIG_MD
57
56/* 58/*
57 * Different major versions are not compatible. 59 * Different major versions are not compatible.
58 * Different minor versions are only downward compatible. 60 * Different minor versions are only downward compatible.
@@ -95,5 +97,6 @@ extern void md_new_event(mddev_t *mddev);
95 97
96extern void md_update_sb(mddev_t * mddev); 98extern void md_update_sb(mddev_t * mddev);
97 99
100#endif /* CONFIG_MD */
98#endif 101#endif
99 102
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h
index d28890295852..920b94fe31fa 100644
--- a/include/linux/raid/md_k.h
+++ b/include/linux/raid/md_k.h
@@ -18,6 +18,8 @@
18/* and dm-bio-list.h is not under include/linux because.... ??? */ 18/* and dm-bio-list.h is not under include/linux because.... ??? */
19#include "../../../drivers/md/dm-bio-list.h" 19#include "../../../drivers/md/dm-bio-list.h"
20 20
21#ifdef CONFIG_BLOCK
22
21#define LEVEL_MULTIPATH (-4) 23#define LEVEL_MULTIPATH (-4)
22#define LEVEL_LINEAR (-1) 24#define LEVEL_LINEAR (-1)
23#define LEVEL_FAULTY (-5) 25#define LEVEL_FAULTY (-5)
@@ -362,5 +364,6 @@ static inline void safe_put_page(struct page *p)
362 if (p) put_page(p); 364 if (p) put_page(p);
363} 365}
364 366
367#endif /* CONFIG_BLOCK */
365#endif 368#endif
366 369
diff --git a/include/linux/ramfs.h b/include/linux/ramfs.h
index 00b340ba6612..b160fb18e8d6 100644
--- a/include/linux/ramfs.h
+++ b/include/linux/ramfs.h
@@ -17,5 +17,6 @@ extern int ramfs_nommu_mmap(struct file *file, struct vm_area_struct *vma);
17 17
18extern const struct file_operations ramfs_file_operations; 18extern const struct file_operations ramfs_file_operations;
19extern struct vm_operations_struct generic_file_vm_ops; 19extern struct vm_operations_struct generic_file_vm_ops;
20extern int __init init_rootfs(void);
20 21
21#endif 22#endif
diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h
index 8d5382e62c08..344bc3495ddb 100644
--- a/include/linux/rbtree.h
+++ b/include/linux/rbtree.h
@@ -133,7 +133,7 @@ static inline void rb_set_color(struct rb_node *rb, int color)
133#define rb_entry(ptr, type, member) container_of(ptr, type, member) 133#define rb_entry(ptr, type, member) container_of(ptr, type, member)
134 134
135#define RB_EMPTY_ROOT(root) ((root)->rb_node == NULL) 135#define RB_EMPTY_ROOT(root) ((root)->rb_node == NULL)
136#define RB_EMPTY_NODE(node) (rb_parent(node) != node) 136#define RB_EMPTY_NODE(node) (rb_parent(node) == node)
137#define RB_CLEAR_NODE(node) (rb_set_parent(node, node)) 137#define RB_CLEAR_NODE(node) (rb_set_parent(node, node))
138 138
139extern void rb_insert_color(struct rb_node *, struct rb_root *); 139extern void rb_insert_color(struct rb_node *, struct rb_root *);
diff --git a/include/linux/reiserfs_acl.h b/include/linux/reiserfs_acl.h
index 806ec5b06707..fe00f781a622 100644
--- a/include/linux/reiserfs_acl.h
+++ b/include/linux/reiserfs_acl.h
@@ -56,6 +56,16 @@ extern int reiserfs_xattr_posix_acl_init(void) __init;
56extern int reiserfs_xattr_posix_acl_exit(void); 56extern int reiserfs_xattr_posix_acl_exit(void);
57extern struct reiserfs_xattr_handler posix_acl_default_handler; 57extern struct reiserfs_xattr_handler posix_acl_default_handler;
58extern struct reiserfs_xattr_handler posix_acl_access_handler; 58extern struct reiserfs_xattr_handler posix_acl_access_handler;
59
60static inline void reiserfs_init_acl_access(struct inode *inode)
61{
62 REISERFS_I(inode)->i_acl_access = NULL;
63}
64
65static inline void reiserfs_init_acl_default(struct inode *inode)
66{
67 REISERFS_I(inode)->i_acl_default = NULL;
68}
59#else 69#else
60 70
61#define reiserfs_cache_default_acl(inode) 0 71#define reiserfs_cache_default_acl(inode) 0
@@ -87,4 +97,11 @@ reiserfs_inherit_default_acl(const struct inode *dir, struct dentry *dentry,
87 return 0; 97 return 0;
88} 98}
89 99
100static inline void reiserfs_init_acl_access(struct inode *inode)
101{
102}
103
104static inline void reiserfs_init_acl_default(struct inode *inode)
105{
106}
90#endif 107#endif
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index 28493ffaafe7..7bc6bfb86253 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -807,21 +807,19 @@ struct stat_data_v1 {
807#define set_sd_v1_first_direct_byte(sdp,v) \ 807#define set_sd_v1_first_direct_byte(sdp,v) \
808 ((sdp)->sd_first_direct_byte = cpu_to_le32(v)) 808 ((sdp)->sd_first_direct_byte = cpu_to_le32(v))
809 809
810#include <linux/ext2_fs.h>
811
812/* inode flags stored in sd_attrs (nee sd_reserved) */ 810/* inode flags stored in sd_attrs (nee sd_reserved) */
813 811
814/* we want common flags to have the same values as in ext2, 812/* we want common flags to have the same values as in ext2,
815 so chattr(1) will work without problems */ 813 so chattr(1) will work without problems */
816#define REISERFS_IMMUTABLE_FL EXT2_IMMUTABLE_FL 814#define REISERFS_IMMUTABLE_FL FS_IMMUTABLE_FL
817#define REISERFS_APPEND_FL EXT2_APPEND_FL 815#define REISERFS_APPEND_FL FS_APPEND_FL
818#define REISERFS_SYNC_FL EXT2_SYNC_FL 816#define REISERFS_SYNC_FL FS_SYNC_FL
819#define REISERFS_NOATIME_FL EXT2_NOATIME_FL 817#define REISERFS_NOATIME_FL FS_NOATIME_FL
820#define REISERFS_NODUMP_FL EXT2_NODUMP_FL 818#define REISERFS_NODUMP_FL FS_NODUMP_FL
821#define REISERFS_SECRM_FL EXT2_SECRM_FL 819#define REISERFS_SECRM_FL FS_SECRM_FL
822#define REISERFS_UNRM_FL EXT2_UNRM_FL 820#define REISERFS_UNRM_FL FS_UNRM_FL
823#define REISERFS_COMPR_FL EXT2_COMPR_FL 821#define REISERFS_COMPR_FL FS_COMPR_FL
824#define REISERFS_NOTAIL_FL EXT2_NOTAIL_FL 822#define REISERFS_NOTAIL_FL FS_NOTAIL_FL
825 823
826/* persistent flags that file inherits from the parent directory */ 824/* persistent flags that file inherits from the parent directory */
827#define REISERFS_INHERIT_MASK ( REISERFS_IMMUTABLE_FL | \ 825#define REISERFS_INHERIT_MASK ( REISERFS_IMMUTABLE_FL | \
@@ -2075,6 +2073,10 @@ void reiserfs_init_alloc_options(struct super_block *s);
2075 */ 2073 */
2076__le32 reiserfs_choose_packing(struct inode *dir); 2074__le32 reiserfs_choose_packing(struct inode *dir);
2077 2075
2076int reiserfs_init_bitmap_cache(struct super_block *sb);
2077void reiserfs_free_bitmap_cache(struct super_block *sb);
2078void reiserfs_cache_bitmap_metadata(struct super_block *sb, struct buffer_head *bh, struct reiserfs_bitmap_info *info);
2079struct buffer_head *reiserfs_read_bitmap_block(struct super_block *sb, unsigned int bitmap);
2078int is_reusable(struct super_block *s, b_blocknr_t block, int bit_value); 2080int is_reusable(struct super_block *s, b_blocknr_t block, int bit_value);
2079void reiserfs_free_block(struct reiserfs_transaction_handle *th, struct inode *, 2081void reiserfs_free_block(struct reiserfs_transaction_handle *th, struct inode *,
2080 b_blocknr_t, int for_unformatted); 2082 b_blocknr_t, int for_unformatted);
@@ -2163,15 +2165,24 @@ __u32 r5_hash(const signed char *msg, int len);
2163/* prototypes from ioctl.c */ 2165/* prototypes from ioctl.c */
2164int reiserfs_ioctl(struct inode *inode, struct file *filp, 2166int reiserfs_ioctl(struct inode *inode, struct file *filp,
2165 unsigned int cmd, unsigned long arg); 2167 unsigned int cmd, unsigned long arg);
2168long reiserfs_compat_ioctl(struct file *filp,
2169 unsigned int cmd, unsigned long arg);
2166 2170
2167/* ioctl's command */ 2171/* ioctl's command */
2168#define REISERFS_IOC_UNPACK _IOW(0xCD,1,long) 2172#define REISERFS_IOC_UNPACK _IOW(0xCD,1,long)
2169/* define following flags to be the same as in ext2, so that chattr(1), 2173/* define following flags to be the same as in ext2, so that chattr(1),
2170 lsattr(1) will work with us. */ 2174 lsattr(1) will work with us. */
2171#define REISERFS_IOC_GETFLAGS EXT2_IOC_GETFLAGS 2175#define REISERFS_IOC_GETFLAGS FS_IOC_GETFLAGS
2172#define REISERFS_IOC_SETFLAGS EXT2_IOC_SETFLAGS 2176#define REISERFS_IOC_SETFLAGS FS_IOC_SETFLAGS
2173#define REISERFS_IOC_GETVERSION EXT2_IOC_GETVERSION 2177#define REISERFS_IOC_GETVERSION FS_IOC_GETVERSION
2174#define REISERFS_IOC_SETVERSION EXT2_IOC_SETVERSION 2178#define REISERFS_IOC_SETVERSION FS_IOC_SETVERSION
2179
2180/* the 32 bit compat definitions with int argument */
2181#define REISERFS_IOC32_UNPACK _IOW(0xCD, 1, int)
2182#define REISERFS_IOC32_GETFLAGS FS_IOC32_GETFLAGS
2183#define REISERFS_IOC32_SETFLAGS FS_IOC32_SETFLAGS
2184#define REISERFS_IOC32_GETVERSION FS_IOC32_GETVERSION
2185#define REISERFS_IOC32_SETVERSION FS_IOC32_SETVERSION
2175 2186
2176/* Locking primitives */ 2187/* Locking primitives */
2177/* Right now we are still falling back to (un)lock_kernel, but eventually that 2188/* Right now we are still falling back to (un)lock_kernel, but eventually that
diff --git a/include/linux/reiserfs_fs_i.h b/include/linux/reiserfs_fs_i.h
index 149be8d9a0c9..5b3b297aa2c5 100644
--- a/include/linux/reiserfs_fs_i.h
+++ b/include/linux/reiserfs_fs_i.h
@@ -52,10 +52,13 @@ struct reiserfs_inode_info {
52 ** flushed */ 52 ** flushed */
53 unsigned long i_trans_id; 53 unsigned long i_trans_id;
54 struct reiserfs_journal_list *i_jl; 54 struct reiserfs_journal_list *i_jl;
55 55#ifdef CONFIG_REISERFS_FS_POSIX_ACL
56 struct posix_acl *i_acl_access; 56 struct posix_acl *i_acl_access;
57 struct posix_acl *i_acl_default; 57 struct posix_acl *i_acl_default;
58#endif
59#ifdef CONFIG_REISERFS_FS_XATTR
58 struct rw_semaphore xattr_sem; 60 struct rw_semaphore xattr_sem;
61#endif
59 struct inode vfs_inode; 62 struct inode vfs_inode;
60}; 63};
61 64
diff --git a/include/linux/reiserfs_fs_sb.h b/include/linux/reiserfs_fs_sb.h
index 31b4c0bd4fa0..73e0becec086 100644
--- a/include/linux/reiserfs_fs_sb.h
+++ b/include/linux/reiserfs_fs_sb.h
@@ -267,7 +267,6 @@ struct reiserfs_bitmap_info {
267 // FIXME: Won't work with block sizes > 8K 267 // FIXME: Won't work with block sizes > 8K
268 __u16 first_zero_hint; 268 __u16 first_zero_hint;
269 __u16 free_count; 269 __u16 free_count;
270 struct buffer_head *bh; /* the actual bitmap */
271}; 270};
272 271
273struct proc_dir_entry; 272struct proc_dir_entry;
@@ -414,6 +413,7 @@ struct reiserfs_sb_info {
414/* Definitions of reiserfs on-disk properties: */ 413/* Definitions of reiserfs on-disk properties: */
415#define REISERFS_3_5 0 414#define REISERFS_3_5 0
416#define REISERFS_3_6 1 415#define REISERFS_3_6 1
416#define REISERFS_OLD_FORMAT 2
417 417
418enum reiserfs_mount_options { 418enum reiserfs_mount_options {
419/* Mount options */ 419/* Mount options */
diff --git a/include/linux/reiserfs_xattr.h b/include/linux/reiserfs_xattr.h
index 5e961035c725..966c35851b2e 100644
--- a/include/linux/reiserfs_xattr.h
+++ b/include/linux/reiserfs_xattr.h
@@ -97,6 +97,11 @@ static inline void reiserfs_mark_inode_private(struct inode *inode)
97 inode->i_flags |= S_PRIVATE; 97 inode->i_flags |= S_PRIVATE;
98} 98}
99 99
100static inline void reiserfs_init_xattr_rwsem(struct inode *inode)
101{
102 init_rwsem(&REISERFS_I(inode)->xattr_sem);
103}
104
100#else 105#else
101 106
102#define is_reiserfs_priv_object(inode) 0 107#define is_reiserfs_priv_object(inode) 0
@@ -129,6 +134,9 @@ static inline int reiserfs_xattr_init(struct super_block *sb, int mount_flags)
129 sb->s_flags = (sb->s_flags & ~MS_POSIXACL); /* to be sure */ 134 sb->s_flags = (sb->s_flags & ~MS_POSIXACL); /* to be sure */
130 return 0; 135 return 0;
131}; 136};
137static inline void reiserfs_init_xattr_rwsem(struct inode *inode)
138{
139}
132#endif 140#endif
133 141
134#endif /* __KERNEL__ */ 142#endif /* __KERNEL__ */
diff --git a/include/linux/rtc.h b/include/linux/rtc.h
index 5371e4e74595..b89f09357054 100644
--- a/include/linux/rtc.h
+++ b/include/linux/rtc.h
@@ -141,7 +141,7 @@ struct rtc_device
141 int id; 141 int id;
142 char name[RTC_DEVICE_NAME_SIZE]; 142 char name[RTC_DEVICE_NAME_SIZE];
143 143
144 struct rtc_class_ops *ops; 144 const struct rtc_class_ops *ops;
145 struct mutex ops_lock; 145 struct mutex ops_lock;
146 146
147 struct class_device *rtc_dev; 147 struct class_device *rtc_dev;
@@ -172,7 +172,7 @@ struct rtc_device
172 172
173extern struct rtc_device *rtc_device_register(const char *name, 173extern struct rtc_device *rtc_device_register(const char *name,
174 struct device *dev, 174 struct device *dev,
175 struct rtc_class_ops *ops, 175 const struct rtc_class_ops *ops,
176 struct module *owner); 176 struct module *owner);
177extern void rtc_device_unregister(struct rtc_device *rdev); 177extern void rtc_device_unregister(struct rtc_device *rdev);
178extern int rtc_interface_register(struct class_interface *intf); 178extern int rtc_interface_register(struct class_interface *intf);
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 9c92dc8b9a08..3a18addaed4c 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -2,7 +2,7 @@
2#define __LINUX_RTNETLINK_H 2#define __LINUX_RTNETLINK_H
3 3
4#include <linux/netlink.h> 4#include <linux/netlink.h>
5#include <linux/if.h> 5#include <linux/if_link.h>
6 6
7/**** 7/****
8 * Routing/neighbour discovery messages. 8 * Routing/neighbour discovery messages.
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 9d4aa7f95bc8..7ef899c47c29 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -148,6 +148,7 @@ extern unsigned long weighted_cpuload(const int cpu);
148#define EXIT_DEAD 32 148#define EXIT_DEAD 32
149/* in tsk->state again */ 149/* in tsk->state again */
150#define TASK_NONINTERACTIVE 64 150#define TASK_NONINTERACTIVE 64
151#define TASK_DEAD 128
151 152
152#define __set_task_state(tsk, state_value) \ 153#define __set_task_state(tsk, state_value) \
153 do { (tsk)->state = (state_value); } while (0) 154 do { (tsk)->state = (state_value); } while (0)
@@ -504,8 +505,8 @@ struct signal_struct {
504#define rt_prio(prio) unlikely((prio) < MAX_RT_PRIO) 505#define rt_prio(prio) unlikely((prio) < MAX_RT_PRIO)
505#define rt_task(p) rt_prio((p)->prio) 506#define rt_task(p) rt_prio((p)->prio)
506#define batch_task(p) (unlikely((p)->policy == SCHED_BATCH)) 507#define batch_task(p) (unlikely((p)->policy == SCHED_BATCH))
507#define has_rt_policy(p) \ 508#define is_rt_policy(p) ((p) != SCHED_NORMAL && (p) != SCHED_BATCH)
508 unlikely((p)->policy != SCHED_NORMAL && (p)->policy != SCHED_BATCH) 509#define has_rt_policy(p) unlikely(is_rt_policy((p)->policy))
509 510
510/* 511/*
511 * Some day this will be a full-fledged user tracking system.. 512 * Some day this will be a full-fledged user tracking system..
@@ -709,7 +710,6 @@ extern unsigned int max_cache_size;
709 710
710 711
711struct io_context; /* See blkdev.h */ 712struct io_context; /* See blkdev.h */
712void exit_io_context(void);
713struct cpuset; 713struct cpuset;
714 714
715#define NGROUPS_SMALL 32 715#define NGROUPS_SMALL 32
@@ -784,8 +784,9 @@ struct task_struct {
784 struct prio_array *array; 784 struct prio_array *array;
785 785
786 unsigned short ioprio; 786 unsigned short ioprio;
787#ifdef CONFIG_BLK_DEV_IO_TRACE
787 unsigned int btrace_seq; 788 unsigned int btrace_seq;
788 789#endif
789 unsigned long sleep_avg; 790 unsigned long sleep_avg;
790 unsigned long long timestamp, last_ran; 791 unsigned long long timestamp, last_ran;
791 unsigned long long sched_time; /* sched_clock time spent running */ 792 unsigned long long sched_time; /* sched_clock time spent running */
@@ -886,8 +887,10 @@ struct task_struct {
886 - initialized normally by flush_old_exec */ 887 - initialized normally by flush_old_exec */
887/* file system info */ 888/* file system info */
888 int link_count, total_link_count; 889 int link_count, total_link_count;
890#ifdef CONFIG_SYSVIPC
889/* ipc stuff */ 891/* ipc stuff */
890 struct sysv_sem sysvsem; 892 struct sysv_sem sysvsem;
893#endif
891/* CPU-specific state of this task */ 894/* CPU-specific state of this task */
892 struct thread_struct thread; 895 struct thread_struct thread;
893/* filesystem information */ 896/* filesystem information */
@@ -978,10 +981,10 @@ struct task_struct {
978 wait_queue_t *io_wait; 981 wait_queue_t *io_wait;
979/* i/o counters(bytes read/written, #syscalls */ 982/* i/o counters(bytes read/written, #syscalls */
980 u64 rchar, wchar, syscr, syscw; 983 u64 rchar, wchar, syscr, syscw;
981#if defined(CONFIG_BSD_PROCESS_ACCT) 984#if defined(CONFIG_TASK_XACCT)
982 u64 acct_rss_mem1; /* accumulated rss usage */ 985 u64 acct_rss_mem1; /* accumulated rss usage */
983 u64 acct_vm_mem1; /* accumulated virtual memory usage */ 986 u64 acct_vm_mem1; /* accumulated virtual memory usage */
984 clock_t acct_stimexpd; /* clock_t-converted stime since last update */ 987 cputime_t acct_stimexpd;/* stime since last update */
985#endif 988#endif
986#ifdef CONFIG_NUMA 989#ifdef CONFIG_NUMA
987 struct mempolicy *mempolicy; 990 struct mempolicy *mempolicy;
@@ -1030,6 +1033,16 @@ static inline int pid_alive(struct task_struct *p)
1030 return p->pids[PIDTYPE_PID].pid != NULL; 1033 return p->pids[PIDTYPE_PID].pid != NULL;
1031} 1034}
1032 1035
1036/**
1037 * is_init - check if a task structure is the first user space
1038 * task the kernel created.
1039 * @p: Task structure to be checked.
1040 */
1041static inline int is_init(struct task_struct *tsk)
1042{
1043 return tsk->pid == 1;
1044}
1045
1033extern void free_task(struct task_struct *tsk); 1046extern void free_task(struct task_struct *tsk);
1034#define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0) 1047#define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0)
1035 1048
@@ -1048,7 +1061,6 @@ static inline void put_task_struct(struct task_struct *t)
1048 /* Not implemented yet, only for 486*/ 1061 /* Not implemented yet, only for 486*/
1049#define PF_STARTING 0x00000002 /* being created */ 1062#define PF_STARTING 0x00000002 /* being created */
1050#define PF_EXITING 0x00000004 /* getting shut down */ 1063#define PF_EXITING 0x00000004 /* getting shut down */
1051#define PF_DEAD 0x00000008 /* Dead */
1052#define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */ 1064#define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */
1053#define PF_SUPERPRIV 0x00000100 /* used super-user privileges */ 1065#define PF_SUPERPRIV 0x00000100 /* used super-user privileges */
1054#define PF_DUMPCORE 0x00000200 /* dumped core */ 1066#define PF_DUMPCORE 0x00000200 /* dumped core */
@@ -1193,7 +1205,7 @@ extern void switch_uid(struct user_struct *);
1193 1205
1194#include <asm/current.h> 1206#include <asm/current.h>
1195 1207
1196extern void do_timer(struct pt_regs *); 1208extern void do_timer(unsigned long ticks);
1197 1209
1198extern int FASTCALL(wake_up_state(struct task_struct * tsk, unsigned int state)); 1210extern int FASTCALL(wake_up_state(struct task_struct * tsk, unsigned int state));
1199extern int FASTCALL(wake_up_process(struct task_struct * tsk)); 1211extern int FASTCALL(wake_up_process(struct task_struct * tsk));
diff --git a/include/linux/scx200_gpio.h b/include/linux/scx200_gpio.h
index 90dd069cc145..1a82d30c4b17 100644
--- a/include/linux/scx200_gpio.h
+++ b/include/linux/scx200_gpio.h
@@ -4,6 +4,7 @@ u32 scx200_gpio_configure(unsigned index, u32 set, u32 clear);
4 4
5extern unsigned scx200_gpio_base; 5extern unsigned scx200_gpio_base;
6extern long scx200_gpio_shadow[2]; 6extern long scx200_gpio_shadow[2];
7extern struct nsc_gpio_ops scx200_gpio_ops;
7 8
8#define scx200_gpio_present() (scx200_gpio_base!=0) 9#define scx200_gpio_present() (scx200_gpio_base!=0)
9 10
diff --git a/include/linux/security.h b/include/linux/security.h
index 9f56fb8a4a6c..9b5fea81f55e 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -1595,6 +1595,7 @@ static inline void security_sb_post_pivotroot (struct nameidata *old_nd,
1595 1595
1596static inline int security_inode_alloc (struct inode *inode) 1596static inline int security_inode_alloc (struct inode *inode)
1597{ 1597{
1598 inode->i_security = NULL;
1598 return security_ops->inode_alloc_security (inode); 1599 return security_ops->inode_alloc_security (inode);
1599} 1600}
1600 1601
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h
index c057f0b32318..f3c51899117f 100644
--- a/include/linux/shmem_fs.h
+++ b/include/linux/shmem_fs.h
@@ -19,6 +19,10 @@ struct shmem_inode_info {
19 swp_entry_t i_direct[SHMEM_NR_DIRECT]; /* first blocks */ 19 swp_entry_t i_direct[SHMEM_NR_DIRECT]; /* first blocks */
20 struct list_head swaplist; /* chain of maybes on swap */ 20 struct list_head swaplist; /* chain of maybes on swap */
21 struct inode vfs_inode; 21 struct inode vfs_inode;
22#ifdef CONFIG_TMPFS_POSIX_ACL
23 struct posix_acl *i_acl;
24 struct posix_acl *i_default_acl;
25#endif
22}; 26};
23 27
24struct shmem_sb_info { 28struct shmem_sb_info {
@@ -36,4 +40,24 @@ static inline struct shmem_inode_info *SHMEM_I(struct inode *inode)
36 return container_of(inode, struct shmem_inode_info, vfs_inode); 40 return container_of(inode, struct shmem_inode_info, vfs_inode);
37} 41}
38 42
43#ifdef CONFIG_TMPFS_POSIX_ACL
44int shmem_permission(struct inode *, int, struct nameidata *);
45int shmem_acl_init(struct inode *, struct inode *);
46void shmem_acl_destroy_inode(struct inode *);
47
48extern struct xattr_handler shmem_xattr_acl_access_handler;
49extern struct xattr_handler shmem_xattr_acl_default_handler;
50
51extern struct generic_acl_operations shmem_acl_ops;
52
53#else
54static inline int shmem_acl_init(struct inode *inode, struct inode *dir)
55{
56 return 0;
57}
58static inline void shmem_acl_destroy_inode(struct inode *inode)
59{
60}
61#endif /* CONFIG_TMPFS_POSIX_ACL */
62
39#endif 63#endif
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index 31473db92d3b..b800d2d68b32 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -167,9 +167,9 @@ do { \
167 * regardless of whether CONFIG_SMP or CONFIG_PREEMPT are set. The various 167 * regardless of whether CONFIG_SMP or CONFIG_PREEMPT are set. The various
168 * methods are defined as nops in the case they are not required. 168 * methods are defined as nops in the case they are not required.
169 */ 169 */
170#define spin_trylock(lock) __cond_lock(_spin_trylock(lock)) 170#define spin_trylock(lock) __cond_lock(lock, _spin_trylock(lock))
171#define read_trylock(lock) __cond_lock(_read_trylock(lock)) 171#define read_trylock(lock) __cond_lock(lock, _read_trylock(lock))
172#define write_trylock(lock) __cond_lock(_write_trylock(lock)) 172#define write_trylock(lock) __cond_lock(lock, _write_trylock(lock))
173 173
174#define spin_lock(lock) _spin_lock(lock) 174#define spin_lock(lock) _spin_lock(lock)
175 175
@@ -236,19 +236,19 @@ do { \
236 _write_unlock_irqrestore(lock, flags) 236 _write_unlock_irqrestore(lock, flags)
237#define write_unlock_bh(lock) _write_unlock_bh(lock) 237#define write_unlock_bh(lock) _write_unlock_bh(lock)
238 238
239#define spin_trylock_bh(lock) __cond_lock(_spin_trylock_bh(lock)) 239#define spin_trylock_bh(lock) __cond_lock(lock, _spin_trylock_bh(lock))
240 240
241#define spin_trylock_irq(lock) \ 241#define spin_trylock_irq(lock) \
242({ \ 242({ \
243 local_irq_disable(); \ 243 local_irq_disable(); \
244 _spin_trylock(lock) ? \ 244 spin_trylock(lock) ? \
245 1 : ({ local_irq_enable(); 0; }); \ 245 1 : ({ local_irq_enable(); 0; }); \
246}) 246})
247 247
248#define spin_trylock_irqsave(lock, flags) \ 248#define spin_trylock_irqsave(lock, flags) \
249({ \ 249({ \
250 local_irq_save(flags); \ 250 local_irq_save(flags); \
251 _spin_trylock(lock) ? \ 251 spin_trylock(lock) ? \
252 1 : ({ local_irq_restore(flags); 0; }); \ 252 1 : ({ local_irq_restore(flags); 0; }); \
253}) 253})
254 254
@@ -264,7 +264,7 @@ do { \
264 */ 264 */
265extern int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock); 265extern int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock);
266#define atomic_dec_and_lock(atomic, lock) \ 266#define atomic_dec_and_lock(atomic, lock) \
267 __cond_lock(_atomic_dec_and_lock(atomic, lock)) 267 __cond_lock(lock, _atomic_dec_and_lock(atomic, lock))
268 268
269/** 269/**
270 * spin_can_lock - would spin_trylock() succeed? 270 * spin_can_lock - would spin_trylock() succeed?
diff --git a/include/linux/spinlock_api_smp.h b/include/linux/spinlock_api_smp.h
index b2c4f8299464..8828b8155e9c 100644
--- a/include/linux/spinlock_api_smp.h
+++ b/include/linux/spinlock_api_smp.h
@@ -19,41 +19,41 @@ int in_lock_functions(unsigned long addr);
19 19
20#define assert_spin_locked(x) BUG_ON(!spin_is_locked(x)) 20#define assert_spin_locked(x) BUG_ON(!spin_is_locked(x))
21 21
22void __lockfunc _spin_lock(spinlock_t *lock) __acquires(spinlock_t); 22void __lockfunc _spin_lock(spinlock_t *lock) __acquires(lock);
23void __lockfunc _spin_lock_nested(spinlock_t *lock, int subclass) 23void __lockfunc _spin_lock_nested(spinlock_t *lock, int subclass)
24 __acquires(spinlock_t); 24 __acquires(lock);
25void __lockfunc _read_lock(rwlock_t *lock) __acquires(rwlock_t); 25void __lockfunc _read_lock(rwlock_t *lock) __acquires(lock);
26void __lockfunc _write_lock(rwlock_t *lock) __acquires(rwlock_t); 26void __lockfunc _write_lock(rwlock_t *lock) __acquires(lock);
27void __lockfunc _spin_lock_bh(spinlock_t *lock) __acquires(spinlock_t); 27void __lockfunc _spin_lock_bh(spinlock_t *lock) __acquires(lock);
28void __lockfunc _read_lock_bh(rwlock_t *lock) __acquires(rwlock_t); 28void __lockfunc _read_lock_bh(rwlock_t *lock) __acquires(lock);
29void __lockfunc _write_lock_bh(rwlock_t *lock) __acquires(rwlock_t); 29void __lockfunc _write_lock_bh(rwlock_t *lock) __acquires(lock);
30void __lockfunc _spin_lock_irq(spinlock_t *lock) __acquires(spinlock_t); 30void __lockfunc _spin_lock_irq(spinlock_t *lock) __acquires(lock);
31void __lockfunc _read_lock_irq(rwlock_t *lock) __acquires(rwlock_t); 31void __lockfunc _read_lock_irq(rwlock_t *lock) __acquires(lock);
32void __lockfunc _write_lock_irq(rwlock_t *lock) __acquires(rwlock_t); 32void __lockfunc _write_lock_irq(rwlock_t *lock) __acquires(lock);
33unsigned long __lockfunc _spin_lock_irqsave(spinlock_t *lock) 33unsigned long __lockfunc _spin_lock_irqsave(spinlock_t *lock)
34 __acquires(spinlock_t); 34 __acquires(lock);
35unsigned long __lockfunc _read_lock_irqsave(rwlock_t *lock) 35unsigned long __lockfunc _read_lock_irqsave(rwlock_t *lock)
36 __acquires(rwlock_t); 36 __acquires(lock);
37unsigned long __lockfunc _write_lock_irqsave(rwlock_t *lock) 37unsigned long __lockfunc _write_lock_irqsave(rwlock_t *lock)
38 __acquires(rwlock_t); 38 __acquires(lock);
39int __lockfunc _spin_trylock(spinlock_t *lock); 39int __lockfunc _spin_trylock(spinlock_t *lock);
40int __lockfunc _read_trylock(rwlock_t *lock); 40int __lockfunc _read_trylock(rwlock_t *lock);
41int __lockfunc _write_trylock(rwlock_t *lock); 41int __lockfunc _write_trylock(rwlock_t *lock);
42int __lockfunc _spin_trylock_bh(spinlock_t *lock); 42int __lockfunc _spin_trylock_bh(spinlock_t *lock);
43void __lockfunc _spin_unlock(spinlock_t *lock) __releases(spinlock_t); 43void __lockfunc _spin_unlock(spinlock_t *lock) __releases(lock);
44void __lockfunc _read_unlock(rwlock_t *lock) __releases(rwlock_t); 44void __lockfunc _read_unlock(rwlock_t *lock) __releases(lock);
45void __lockfunc _write_unlock(rwlock_t *lock) __releases(rwlock_t); 45void __lockfunc _write_unlock(rwlock_t *lock) __releases(lock);
46void __lockfunc _spin_unlock_bh(spinlock_t *lock) __releases(spinlock_t); 46void __lockfunc _spin_unlock_bh(spinlock_t *lock) __releases(lock);
47void __lockfunc _read_unlock_bh(rwlock_t *lock) __releases(rwlock_t); 47void __lockfunc _read_unlock_bh(rwlock_t *lock) __releases(lock);
48void __lockfunc _write_unlock_bh(rwlock_t *lock) __releases(rwlock_t); 48void __lockfunc _write_unlock_bh(rwlock_t *lock) __releases(lock);
49void __lockfunc _spin_unlock_irq(spinlock_t *lock) __releases(spinlock_t); 49void __lockfunc _spin_unlock_irq(spinlock_t *lock) __releases(lock);
50void __lockfunc _read_unlock_irq(rwlock_t *lock) __releases(rwlock_t); 50void __lockfunc _read_unlock_irq(rwlock_t *lock) __releases(lock);
51void __lockfunc _write_unlock_irq(rwlock_t *lock) __releases(rwlock_t); 51void __lockfunc _write_unlock_irq(rwlock_t *lock) __releases(lock);
52void __lockfunc _spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags) 52void __lockfunc _spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags)
53 __releases(spinlock_t); 53 __releases(lock);
54void __lockfunc _read_unlock_irqrestore(rwlock_t *lock, unsigned long flags) 54void __lockfunc _read_unlock_irqrestore(rwlock_t *lock, unsigned long flags)
55 __releases(rwlock_t); 55 __releases(lock);
56void __lockfunc _write_unlock_irqrestore(rwlock_t *lock, unsigned long flags) 56void __lockfunc _write_unlock_irqrestore(rwlock_t *lock, unsigned long flags)
57 __releases(rwlock_t); 57 __releases(lock);
58 58
59#endif /* __LINUX_SPINLOCK_API_SMP_H */ 59#endif /* __LINUX_SPINLOCK_API_SMP_H */
diff --git a/include/linux/stddef.h b/include/linux/stddef.h
index ea65dfb60cd8..6a40c76bdcf1 100644
--- a/include/linux/stddef.h
+++ b/include/linux/stddef.h
@@ -11,6 +11,12 @@
11#endif 11#endif
12 12
13#ifdef __KERNEL__ 13#ifdef __KERNEL__
14
15enum {
16 false = 0,
17 true = 1
18};
19
14#undef offsetof 20#undef offsetof
15#ifdef __compiler_offsetof 21#ifdef __compiler_offsetof
16#define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER) 22#define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER)
diff --git a/include/linux/string.h b/include/linux/string.h
index e4c755860316..4f69ef9e6eb5 100644
--- a/include/linux/string.h
+++ b/include/linux/string.h
@@ -99,6 +99,7 @@ extern void * memchr(const void *,int,__kernel_size_t);
99#endif 99#endif
100 100
101extern char *kstrdup(const char *s, gfp_t gfp); 101extern char *kstrdup(const char *s, gfp_t gfp);
102extern void *kmemdup(const void *src, size_t len, gfp_t gfp);
102 103
103#ifdef __cplusplus 104#ifdef __cplusplus
104} 105}
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h
index a6de332e57d4..862c0d8c8381 100644
--- a/include/linux/sunrpc/auth.h
+++ b/include/linux/sunrpc/auth.h
@@ -109,13 +109,13 @@ struct rpc_credops {
109 void (*crdestroy)(struct rpc_cred *); 109 void (*crdestroy)(struct rpc_cred *);
110 110
111 int (*crmatch)(struct auth_cred *, struct rpc_cred *, int); 111 int (*crmatch)(struct auth_cred *, struct rpc_cred *, int);
112 u32 * (*crmarshal)(struct rpc_task *, u32 *); 112 __be32 * (*crmarshal)(struct rpc_task *, __be32 *);
113 int (*crrefresh)(struct rpc_task *); 113 int (*crrefresh)(struct rpc_task *);
114 u32 * (*crvalidate)(struct rpc_task *, u32 *); 114 __be32 * (*crvalidate)(struct rpc_task *, __be32 *);
115 int (*crwrap_req)(struct rpc_task *, kxdrproc_t, 115 int (*crwrap_req)(struct rpc_task *, kxdrproc_t,
116 void *, u32 *, void *); 116 void *, __be32 *, void *);
117 int (*crunwrap_resp)(struct rpc_task *, kxdrproc_t, 117 int (*crunwrap_resp)(struct rpc_task *, kxdrproc_t,
118 void *, u32 *, void *); 118 void *, __be32 *, void *);
119}; 119};
120 120
121extern struct rpc_authops authunix_ops; 121extern struct rpc_authops authunix_ops;
@@ -134,10 +134,10 @@ struct rpc_cred * rpcauth_bindcred(struct rpc_task *);
134void rpcauth_holdcred(struct rpc_task *); 134void rpcauth_holdcred(struct rpc_task *);
135void put_rpccred(struct rpc_cred *); 135void put_rpccred(struct rpc_cred *);
136void rpcauth_unbindcred(struct rpc_task *); 136void rpcauth_unbindcred(struct rpc_task *);
137u32 * rpcauth_marshcred(struct rpc_task *, u32 *); 137__be32 * rpcauth_marshcred(struct rpc_task *, __be32 *);
138u32 * rpcauth_checkverf(struct rpc_task *, u32 *); 138__be32 * rpcauth_checkverf(struct rpc_task *, __be32 *);
139int rpcauth_wrap_req(struct rpc_task *task, kxdrproc_t encode, void *rqstp, u32 *data, void *obj); 139int rpcauth_wrap_req(struct rpc_task *task, kxdrproc_t encode, void *rqstp, __be32 *data, void *obj);
140int rpcauth_unwrap_resp(struct rpc_task *task, kxdrproc_t decode, void *rqstp, u32 *data, void *obj); 140int rpcauth_unwrap_resp(struct rpc_task *task, kxdrproc_t decode, void *rqstp, __be32 *data, void *obj);
141int rpcauth_refreshcred(struct rpc_task *); 141int rpcauth_refreshcred(struct rpc_task *);
142void rpcauth_invalcred(struct rpc_task *); 142void rpcauth_invalcred(struct rpc_task *);
143int rpcauth_uptodatecred(struct rpc_task *); 143int rpcauth_uptodatecred(struct rpc_task *);
diff --git a/include/linux/sunrpc/msg_prot.h b/include/linux/sunrpc/msg_prot.h
index f43f237360ae..d9f5934ac9fe 100644
--- a/include/linux/sunrpc/msg_prot.h
+++ b/include/linux/sunrpc/msg_prot.h
@@ -95,7 +95,7 @@ enum rpc_auth_stat {
95 * 2GB. 95 * 2GB.
96 */ 96 */
97 97
98typedef u32 rpc_fraghdr; 98typedef __be32 rpc_fraghdr;
99 99
100#define RPC_LAST_STREAM_FRAGMENT (1U << 31) 100#define RPC_LAST_STREAM_FRAGMENT (1U << 31)
101#define RPC_FRAGMENT_SIZE_MASK (~RPC_LAST_STREAM_FRAGMENT) 101#define RPC_FRAGMENT_SIZE_MASK (~RPC_LAST_STREAM_FRAGMENT)
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 7b27c09b5604..73140ee5c638 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -78,28 +78,45 @@ struct svc_serv {
78 */ 78 */
79#define RPCSVC_MAXPAGES ((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE + 2) 79#define RPCSVC_MAXPAGES ((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE + 2)
80 80
81static inline u32 svc_getu32(struct kvec *iov) 81static inline u32 svc_getnl(struct kvec *iov)
82{ 82{
83 u32 val, *vp; 83 __be32 val, *vp;
84 vp = iov->iov_base; 84 vp = iov->iov_base;
85 val = *vp++; 85 val = *vp++;
86 iov->iov_base = (void*)vp; 86 iov->iov_base = (void*)vp;
87 iov->iov_len -= sizeof(u32); 87 iov->iov_len -= sizeof(__be32);
88 return ntohl(val);
89}
90
91static inline void svc_putnl(struct kvec *iov, u32 val)
92{
93 __be32 *vp = iov->iov_base + iov->iov_len;
94 *vp = htonl(val);
95 iov->iov_len += sizeof(__be32);
96}
97
98static inline __be32 svc_getu32(struct kvec *iov)
99{
100 __be32 val, *vp;
101 vp = iov->iov_base;
102 val = *vp++;
103 iov->iov_base = (void*)vp;
104 iov->iov_len -= sizeof(__be32);
88 return val; 105 return val;
89} 106}
90 107
91static inline void svc_ungetu32(struct kvec *iov) 108static inline void svc_ungetu32(struct kvec *iov)
92{ 109{
93 u32 *vp = (u32 *)iov->iov_base; 110 __be32 *vp = (__be32 *)iov->iov_base;
94 iov->iov_base = (void *)(vp - 1); 111 iov->iov_base = (void *)(vp - 1);
95 iov->iov_len += sizeof(*vp); 112 iov->iov_len += sizeof(*vp);
96} 113}
97 114
98static inline void svc_putu32(struct kvec *iov, u32 val) 115static inline void svc_putu32(struct kvec *iov, __be32 val)
99{ 116{
100 u32 *vp = iov->iov_base + iov->iov_len; 117 __be32 *vp = iov->iov_base + iov->iov_len;
101 *vp = val; 118 *vp = val;
102 iov->iov_len += sizeof(u32); 119 iov->iov_len += sizeof(__be32);
103} 120}
104 121
105 122
@@ -130,7 +147,7 @@ struct svc_rqst {
130 short rq_arghi; /* pages available in argument page list */ 147 short rq_arghi; /* pages available in argument page list */
131 short rq_resused; /* pages used for result */ 148 short rq_resused; /* pages used for result */
132 149
133 u32 rq_xid; /* transmission id */ 150 __be32 rq_xid; /* transmission id */
134 u32 rq_prog; /* program number */ 151 u32 rq_prog; /* program number */
135 u32 rq_vers; /* program version */ 152 u32 rq_vers; /* program version */
136 u32 rq_proc; /* procedure number */ 153 u32 rq_proc; /* procedure number */
@@ -139,7 +156,7 @@ struct svc_rqst {
139 rq_secure : 1; /* secure port */ 156 rq_secure : 1; /* secure port */
140 157
141 158
142 __u32 rq_daddr; /* dest addr of request - reply from here */ 159 __be32 rq_daddr; /* dest addr of request - reply from here */
143 160
144 void * rq_argp; /* decoded arguments */ 161 void * rq_argp; /* decoded arguments */
145 void * rq_resp; /* xdr'd results */ 162 void * rq_resp; /* xdr'd results */
@@ -169,7 +186,7 @@ struct svc_rqst {
169 * Check buffer bounds after decoding arguments 186 * Check buffer bounds after decoding arguments
170 */ 187 */
171static inline int 188static inline int
172xdr_argsize_check(struct svc_rqst *rqstp, u32 *p) 189xdr_argsize_check(struct svc_rqst *rqstp, __be32 *p)
173{ 190{
174 char *cp = (char *)p; 191 char *cp = (char *)p;
175 struct kvec *vec = &rqstp->rq_arg.head[0]; 192 struct kvec *vec = &rqstp->rq_arg.head[0];
@@ -178,7 +195,7 @@ xdr_argsize_check(struct svc_rqst *rqstp, u32 *p)
178} 195}
179 196
180static inline int 197static inline int
181xdr_ressize_check(struct svc_rqst *rqstp, u32 *p) 198xdr_ressize_check(struct svc_rqst *rqstp, __be32 *p)
182{ 199{
183 struct kvec *vec = &rqstp->rq_res.head[0]; 200 struct kvec *vec = &rqstp->rq_res.head[0];
184 char *cp = (char*)p; 201 char *cp = (char*)p;
@@ -249,10 +266,10 @@ struct svc_deferred_req {
249 u32 prot; /* protocol (UDP or TCP) */ 266 u32 prot; /* protocol (UDP or TCP) */
250 struct sockaddr_in addr; 267 struct sockaddr_in addr;
251 struct svc_sock *svsk; /* where reply must go */ 268 struct svc_sock *svsk; /* where reply must go */
252 u32 daddr; /* where reply must come from */ 269 __be32 daddr; /* where reply must come from */
253 struct cache_deferred_req handle; 270 struct cache_deferred_req handle;
254 int argslen; 271 int argslen;
255 u32 args[0]; 272 __be32 args[0];
256}; 273};
257 274
258/* 275/*
@@ -284,7 +301,7 @@ struct svc_version {
284 * A return value of 0 means drop the request. 301 * A return value of 0 means drop the request.
285 * vs_dispatch == NULL means use default dispatcher. 302 * vs_dispatch == NULL means use default dispatcher.
286 */ 303 */
287 int (*vs_dispatch)(struct svc_rqst *, u32 *); 304 int (*vs_dispatch)(struct svc_rqst *, __be32 *);
288}; 305};
289 306
290/* 307/*
diff --git a/include/linux/sunrpc/svcauth.h b/include/linux/sunrpc/svcauth.h
index 2fe2087edd66..a6601650deeb 100644
--- a/include/linux/sunrpc/svcauth.h
+++ b/include/linux/sunrpc/svcauth.h
@@ -95,7 +95,7 @@ struct auth_ops {
95 char * name; 95 char * name;
96 struct module *owner; 96 struct module *owner;
97 int flavour; 97 int flavour;
98 int (*accept)(struct svc_rqst *rq, u32 *authp); 98 int (*accept)(struct svc_rqst *rq, __be32 *authp);
99 int (*release)(struct svc_rqst *rq); 99 int (*release)(struct svc_rqst *rq);
100 void (*domain_release)(struct auth_domain *); 100 void (*domain_release)(struct auth_domain *);
101 int (*set_client)(struct svc_rqst *rq); 101 int (*set_client)(struct svc_rqst *rq);
@@ -112,7 +112,7 @@ struct auth_ops {
112#define SVC_COMPLETE 9 112#define SVC_COMPLETE 9
113 113
114 114
115extern int svc_authenticate(struct svc_rqst *rqstp, u32 *authp); 115extern int svc_authenticate(struct svc_rqst *rqstp, __be32 *authp);
116extern int svc_authorise(struct svc_rqst *rqstp); 116extern int svc_authorise(struct svc_rqst *rqstp);
117extern int svc_set_client(struct svc_rqst *rqstp); 117extern int svc_set_client(struct svc_rqst *rqstp);
118extern int svc_auth_register(rpc_authflavor_t flavor, struct auth_ops *aops); 118extern int svc_auth_register(rpc_authflavor_t flavor, struct auth_ops *aops);
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h
index e6d3d349506c..953723b09bc6 100644
--- a/include/linux/sunrpc/xdr.h
+++ b/include/linux/sunrpc/xdr.h
@@ -32,7 +32,7 @@ struct xdr_netobj {
32 * side) or svc_rqst pointer (server side). 32 * side) or svc_rqst pointer (server side).
33 * Encode functions always assume there's enough room in the buffer. 33 * Encode functions always assume there's enough room in the buffer.
34 */ 34 */
35typedef int (*kxdrproc_t)(void *rqstp, u32 *data, void *obj); 35typedef int (*kxdrproc_t)(void *rqstp, __be32 *data, void *obj);
36 36
37/* 37/*
38 * Basic structure for transmission/reception of a client XDR message. 38 * Basic structure for transmission/reception of a client XDR message.
@@ -88,19 +88,19 @@ struct xdr_buf {
88/* 88/*
89 * Miscellaneous XDR helper functions 89 * Miscellaneous XDR helper functions
90 */ 90 */
91u32 * xdr_encode_opaque_fixed(u32 *p, const void *ptr, unsigned int len); 91__be32 *xdr_encode_opaque_fixed(__be32 *p, const void *ptr, unsigned int len);
92u32 * xdr_encode_opaque(u32 *p, const void *ptr, unsigned int len); 92__be32 *xdr_encode_opaque(__be32 *p, const void *ptr, unsigned int len);
93u32 * xdr_encode_string(u32 *p, const char *s); 93__be32 *xdr_encode_string(__be32 *p, const char *s);
94u32 * xdr_decode_string_inplace(u32 *p, char **sp, int *lenp, int maxlen); 94__be32 *xdr_decode_string_inplace(__be32 *p, char **sp, int *lenp, int maxlen);
95u32 * xdr_encode_netobj(u32 *p, const struct xdr_netobj *); 95__be32 *xdr_encode_netobj(__be32 *p, const struct xdr_netobj *);
96u32 * xdr_decode_netobj(u32 *p, struct xdr_netobj *); 96__be32 *xdr_decode_netobj(__be32 *p, struct xdr_netobj *);
97 97
98void xdr_encode_pages(struct xdr_buf *, struct page **, unsigned int, 98void xdr_encode_pages(struct xdr_buf *, struct page **, unsigned int,
99 unsigned int); 99 unsigned int);
100void xdr_inline_pages(struct xdr_buf *, unsigned int, 100void xdr_inline_pages(struct xdr_buf *, unsigned int,
101 struct page **, unsigned int, unsigned int); 101 struct page **, unsigned int, unsigned int);
102 102
103static inline u32 *xdr_encode_array(u32 *p, const void *s, unsigned int len) 103static inline __be32 *xdr_encode_array(__be32 *p, const void *s, unsigned int len)
104{ 104{
105 return xdr_encode_opaque(p, s, len); 105 return xdr_encode_opaque(p, s, len);
106} 106}
@@ -108,16 +108,16 @@ static inline u32 *xdr_encode_array(u32 *p, const void *s, unsigned int len)
108/* 108/*
109 * Decode 64bit quantities (NFSv3 support) 109 * Decode 64bit quantities (NFSv3 support)
110 */ 110 */
111static inline u32 * 111static inline __be32 *
112xdr_encode_hyper(u32 *p, __u64 val) 112xdr_encode_hyper(__be32 *p, __u64 val)
113{ 113{
114 *p++ = htonl(val >> 32); 114 *p++ = htonl(val >> 32);
115 *p++ = htonl(val & 0xFFFFFFFF); 115 *p++ = htonl(val & 0xFFFFFFFF);
116 return p; 116 return p;
117} 117}
118 118
119static inline u32 * 119static inline __be32 *
120xdr_decode_hyper(u32 *p, __u64 *valp) 120xdr_decode_hyper(__be32 *p, __u64 *valp)
121{ 121{
122 *valp = ((__u64) ntohl(*p++)) << 32; 122 *valp = ((__u64) ntohl(*p++)) << 32;
123 *valp |= ntohl(*p++); 123 *valp |= ntohl(*p++);
@@ -128,7 +128,7 @@ xdr_decode_hyper(u32 *p, __u64 *valp)
128 * Adjust kvec to reflect end of xdr'ed data (RPC client XDR) 128 * Adjust kvec to reflect end of xdr'ed data (RPC client XDR)
129 */ 129 */
130static inline int 130static inline int
131xdr_adjust_iovec(struct kvec *iov, u32 *p) 131xdr_adjust_iovec(struct kvec *iov, __be32 *p)
132{ 132{
133 return iov->iov_len = ((u8 *) p - (u8 *) iov->iov_base); 133 return iov->iov_len = ((u8 *) p - (u8 *) iov->iov_base);
134} 134}
@@ -180,19 +180,19 @@ extern int xdr_encode_array2(struct xdr_buf *buf, unsigned int base,
180 * Provide some simple tools for XDR buffer overflow-checking etc. 180 * Provide some simple tools for XDR buffer overflow-checking etc.
181 */ 181 */
182struct xdr_stream { 182struct xdr_stream {
183 uint32_t *p; /* start of available buffer */ 183 __be32 *p; /* start of available buffer */
184 struct xdr_buf *buf; /* XDR buffer to read/write */ 184 struct xdr_buf *buf; /* XDR buffer to read/write */
185 185
186 uint32_t *end; /* end of available buffer space */ 186 __be32 *end; /* end of available buffer space */
187 struct kvec *iov; /* pointer to the current kvec */ 187 struct kvec *iov; /* pointer to the current kvec */
188}; 188};
189 189
190extern void xdr_init_encode(struct xdr_stream *xdr, struct xdr_buf *buf, uint32_t *p); 190extern void xdr_init_encode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p);
191extern uint32_t *xdr_reserve_space(struct xdr_stream *xdr, size_t nbytes); 191extern __be32 *xdr_reserve_space(struct xdr_stream *xdr, size_t nbytes);
192extern void xdr_write_pages(struct xdr_stream *xdr, struct page **pages, 192extern void xdr_write_pages(struct xdr_stream *xdr, struct page **pages,
193 unsigned int base, unsigned int len); 193 unsigned int base, unsigned int len);
194extern void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf, uint32_t *p); 194extern void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p);
195extern uint32_t *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes); 195extern __be32 *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes);
196extern void xdr_read_pages(struct xdr_stream *xdr, unsigned int len); 196extern void xdr_read_pages(struct xdr_stream *xdr, unsigned int len);
197extern void xdr_enter_page(struct xdr_stream *xdr, unsigned int len); 197extern void xdr_enter_page(struct xdr_stream *xdr, unsigned int len);
198 198
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index bdeba8538c71..6cf626580752 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -79,7 +79,7 @@ struct rpc_rqst {
79 * This is the private part 79 * This is the private part
80 */ 80 */
81 struct rpc_task * rq_task; /* RPC task data */ 81 struct rpc_task * rq_task; /* RPC task data */
82 __u32 rq_xid; /* request XID */ 82 __be32 rq_xid; /* request XID */
83 int rq_cong; /* has incremented xprt->cong */ 83 int rq_cong; /* has incremented xprt->cong */
84 int rq_received; /* receive completed */ 84 int rq_received; /* receive completed */
85 u32 rq_seqno; /* gss seq no. used on req. */ 85 u32 rq_seqno; /* gss seq no. used on req. */
@@ -171,9 +171,9 @@ struct rpc_xprt {
171 /* 171 /*
172 * State of TCP reply receive stuff 172 * State of TCP reply receive stuff
173 */ 173 */
174 u32 tcp_recm, /* Fragment header */ 174 __be32 tcp_recm, /* Fragment header */
175 tcp_xid, /* Current XID */ 175 tcp_xid; /* Current XID */
176 tcp_reclen, /* fragment length */ 176 u32 tcp_reclen, /* fragment length */
177 tcp_offset; /* fragment offset */ 177 tcp_offset; /* fragment offset */
178 unsigned long tcp_copied, /* copied to request */ 178 unsigned long tcp_copied, /* copied to request */
179 tcp_flags; 179 tcp_flags;
@@ -253,7 +253,7 @@ void xprt_release(struct rpc_task *task);
253struct rpc_xprt * xprt_get(struct rpc_xprt *xprt); 253struct rpc_xprt * xprt_get(struct rpc_xprt *xprt);
254void xprt_put(struct rpc_xprt *xprt); 254void xprt_put(struct rpc_xprt *xprt);
255 255
256static inline u32 *xprt_skip_transport_header(struct rpc_xprt *xprt, u32 *p) 256static inline __be32 *xprt_skip_transport_header(struct rpc_xprt *xprt, __be32 *p)
257{ 257{
258 return p + xprt->tsh_size; 258 return p + xprt->tsh_size;
259} 259}
@@ -268,7 +268,7 @@ void xprt_wait_for_buffer_space(struct rpc_task *task);
268void xprt_write_space(struct rpc_xprt *xprt); 268void xprt_write_space(struct rpc_xprt *xprt);
269void xprt_update_rtt(struct rpc_task *task); 269void xprt_update_rtt(struct rpc_task *task);
270void xprt_adjust_cwnd(struct rpc_task *task, int result); 270void xprt_adjust_cwnd(struct rpc_task *task, int result);
271struct rpc_rqst * xprt_lookup_rqst(struct rpc_xprt *xprt, u32 xid); 271struct rpc_rqst * xprt_lookup_rqst(struct rpc_xprt *xprt, __be32 xid);
272void xprt_complete_rqst(struct rpc_task *task, int copied); 272void xprt_complete_rqst(struct rpc_task *task, int copied);
273void xprt_release_rqst_cong(struct rpc_task *task); 273void xprt_release_rqst_cong(struct rpc_task *task);
274void xprt_disconnect(struct rpc_xprt *xprt); 274void xprt_disconnect(struct rpc_xprt *xprt);
diff --git a/include/linux/synclink.h b/include/linux/synclink.h
index 0577f5284cbc..c8b042667af1 100644
--- a/include/linux/synclink.h
+++ b/include/linux/synclink.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * SyncLink Multiprotocol Serial Adapter Driver 2 * SyncLink Multiprotocol Serial Adapter Driver
3 * 3 *
4 * $Id: synclink.h,v 3.13 2006/05/23 18:25:06 paulkf Exp $ 4 * $Id: synclink.h,v 3.14 2006/07/17 20:15:43 paulkf Exp $
5 * 5 *
6 * Copyright (C) 1998-2000 by Microgate Corporation 6 * Copyright (C) 1998-2000 by Microgate Corporation
7 * 7 *
@@ -124,6 +124,8 @@
124 124
125#define MGSL_MODE_ASYNC 1 125#define MGSL_MODE_ASYNC 1
126#define MGSL_MODE_HDLC 2 126#define MGSL_MODE_HDLC 2
127#define MGSL_MODE_MONOSYNC 3
128#define MGSL_MODE_BISYNC 4
127#define MGSL_MODE_RAW 6 129#define MGSL_MODE_RAW 6
128 130
129#define MGSL_BUS_TYPE_ISA 1 131#define MGSL_BUS_TYPE_ISA 1
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 3f0f716225ec..2d1c3d5c83ac 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -597,6 +597,6 @@ asmlinkage long sys_get_robust_list(int pid,
597 size_t __user *len_ptr); 597 size_t __user *len_ptr);
598asmlinkage long sys_set_robust_list(struct robust_list_head __user *head, 598asmlinkage long sys_set_robust_list(struct robust_list_head __user *head,
599 size_t len); 599 size_t len);
600asmlinkage long sys_getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *cache); 600asmlinkage long sys_getcpu(unsigned __user *cpu, unsigned __user *node, struct getcpu_cache __user *cache);
601 601
602#endif 602#endif
diff --git a/include/linux/sysrq.h b/include/linux/sysrq.h
index 4812ff60561c..e657e523b9bf 100644
--- a/include/linux/sysrq.h
+++ b/include/linux/sysrq.h
@@ -11,6 +11,8 @@
11 * based upon discusions in irc://irc.openprojects.net/#kernelnewbies 11 * based upon discusions in irc://irc.openprojects.net/#kernelnewbies
12 */ 12 */
13 13
14#ifndef _LINUX_SYSRQ_H
15#define _LINUX_SYSRQ_H
14 16
15struct pt_regs; 17struct pt_regs;
16struct tty_struct; 18struct tty_struct;
@@ -57,3 +59,5 @@ static inline int __reterr(void)
57#define unregister_sysrq_key(ig,nore) __reterr() 59#define unregister_sysrq_key(ig,nore) __reterr()
58 60
59#endif 61#endif
62
63#endif /* _LINUX_SYSRQ_H */
diff --git a/include/linux/taskstats.h b/include/linux/taskstats.h
index f1cb6cddd19d..45248806ae9c 100644
--- a/include/linux/taskstats.h
+++ b/include/linux/taskstats.h
@@ -2,6 +2,7 @@
2 * 2 *
3 * Copyright (C) Shailabh Nagar, IBM Corp. 2006 3 * Copyright (C) Shailabh Nagar, IBM Corp. 2006
4 * (C) Balbir Singh, IBM Corp. 2006 4 * (C) Balbir Singh, IBM Corp. 2006
5 * (C) Jay Lan, SGI, 2006
5 * 6 *
6 * This program is free software; you can redistribute it and/or modify it 7 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of version 2.1 of the GNU Lesser General Public License 8 * under the terms of version 2.1 of the GNU Lesser General Public License
@@ -29,16 +30,25 @@
29 * c) add new fields after version comment; maintain 64-bit alignment 30 * c) add new fields after version comment; maintain 64-bit alignment
30 */ 31 */
31 32
32#define TASKSTATS_VERSION 1 33
34#define TASKSTATS_VERSION 2
35#define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN
36 * in linux/sched.h */
33 37
34struct taskstats { 38struct taskstats {
35 39
36 /* Version 1 */ 40 /* The version number of this struct. This field is always set to
41 * TAKSTATS_VERSION, which is defined in <linux/taskstats.h>.
42 * Each time the struct is changed, the value should be incremented.
43 */
37 __u16 version; 44 __u16 version;
38 __u16 padding[3]; /* Userspace should not interpret the padding 45 __u32 ac_exitcode; /* Exit status */
39 * field which can be replaced by useful 46
40 * fields if struct taskstats is extended. 47 /* The accounting flags of a task as defined in <linux/acct.h>
41 */ 48 * Defined values are AFORK, ASU, ACOMPAT, ACORE, and AXSIG.
49 */
50 __u8 ac_flag; /* Record flags */
51 __u8 ac_nice; /* task_nice */
42 52
43 /* Delay accounting fields start 53 /* Delay accounting fields start
44 * 54 *
@@ -88,6 +98,48 @@ struct taskstats {
88 __u64 cpu_run_virtual_total; 98 __u64 cpu_run_virtual_total;
89 /* Delay accounting fields end */ 99 /* Delay accounting fields end */
90 /* version 1 ends here */ 100 /* version 1 ends here */
101
102 /* Basic Accounting Fields start */
103 char ac_comm[TS_COMM_LEN]; /* Command name */
104 __u8 ac_sched; /* Scheduling discipline */
105 __u8 ac_pad[3];
106 __u32 ac_uid; /* User ID */
107 __u32 ac_gid; /* Group ID */
108 __u32 ac_pid; /* Process ID */
109 __u32 ac_ppid; /* Parent process ID */
110 __u32 ac_btime; /* Begin time [sec since 1970] */
111 __u64 ac_etime; /* Elapsed time [usec] */
112 __u64 ac_utime; /* User CPU time [usec] */
113 __u64 ac_stime; /* SYstem CPU time [usec] */
114 __u64 ac_minflt; /* Minor Page Fault Count */
115 __u64 ac_majflt; /* Major Page Fault Count */
116 /* Basic Accounting Fields end */
117
118 /* Extended accounting fields start */
119 /* Accumulated RSS usage in duration of a task, in MBytes-usecs.
120 * The current rss usage is added to this counter every time
121 * a tick is charged to a task's system time. So, at the end we
122 * will have memory usage multiplied by system time. Thus an
123 * average usage per system time unit can be calculated.
124 */
125 __u64 coremem; /* accumulated RSS usage in MB-usec */
126 /* Accumulated virtual memory usage in duration of a task.
127 * Same as acct_rss_mem1 above except that we keep track of VM usage.
128 */
129 __u64 virtmem; /* accumulated VM usage in MB-usec */
130
131 /* High watermark of RSS and virtual memory usage in duration of
132 * a task, in KBytes.
133 */
134 __u64 hiwater_rss; /* High-watermark of RSS usage, in KB */
135 __u64 hiwater_vm; /* High-water VM usage, in KB */
136
137 /* The following four fields are I/O statistics of a task. */
138 __u64 read_char; /* bytes read */
139 __u64 write_char; /* bytes written */
140 __u64 read_syscalls; /* read syscalls */
141 __u64 write_syscalls; /* write syscalls */
142 /* Extended accounting fields end */
91}; 143};
92 144
93 145
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 8ebf497907f8..0e058a2d1c6d 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -21,10 +21,10 @@
21#include <asm/byteorder.h> 21#include <asm/byteorder.h>
22 22
23struct tcphdr { 23struct tcphdr {
24 __u16 source; 24 __be16 source;
25 __u16 dest; 25 __be16 dest;
26 __u32 seq; 26 __be32 seq;
27 __u32 ack_seq; 27 __be32 ack_seq;
28#if defined(__LITTLE_ENDIAN_BITFIELD) 28#if defined(__LITTLE_ENDIAN_BITFIELD)
29 __u16 res1:4, 29 __u16 res1:4,
30 doff:4, 30 doff:4,
@@ -50,9 +50,9 @@ struct tcphdr {
50#else 50#else
51#error "Adjust your <asm/byteorder.h> defines" 51#error "Adjust your <asm/byteorder.h> defines"
52#endif 52#endif
53 __u16 window; 53 __be16 window;
54 __u16 check; 54 __be16 check;
55 __u16 urg_ptr; 55 __be16 urg_ptr;
56}; 56};
57 57
58/* 58/*
@@ -62,7 +62,7 @@ struct tcphdr {
62 */ 62 */
63union tcp_word_hdr { 63union tcp_word_hdr {
64 struct tcphdr hdr; 64 struct tcphdr hdr;
65 __u32 words[5]; 65 __be32 words[5];
66}; 66};
67 67
68#define tcp_flag_word(tp) ( ((union tcp_word_hdr *)(tp))->words [3]) 68#define tcp_flag_word(tp) ( ((union tcp_word_hdr *)(tp))->words [3])
@@ -166,6 +166,11 @@ struct tcp_info
166#include <net/inet_timewait_sock.h> 166#include <net/inet_timewait_sock.h>
167 167
168/* This defines a selective acknowledgement block. */ 168/* This defines a selective acknowledgement block. */
169struct tcp_sack_block_wire {
170 __be32 start_seq;
171 __be32 end_seq;
172};
173
169struct tcp_sack_block { 174struct tcp_sack_block {
170 __u32 start_seq; 175 __u32 start_seq;
171 __u32 end_seq; 176 __u32 end_seq;
@@ -211,7 +216,7 @@ struct tcp_sock {
211 * Header prediction flags 216 * Header prediction flags
212 * 0x5?10 << 16 + snd_wnd in net byte order 217 * 0x5?10 << 16 + snd_wnd in net byte order
213 */ 218 */
214 __u32 pred_flags; 219 __be32 pred_flags;
215 220
216/* 221/*
217 * RFC793 variables by their proper names. This means you can 222 * RFC793 variables by their proper names. This means you can
diff --git a/include/linux/timex.h b/include/linux/timex.h
index d543d3871e38..049dfe4a11f2 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -69,34 +69,28 @@
69 * zero to MAXTC, the PLL will converge in 15 minutes to 16 hours, 69 * zero to MAXTC, the PLL will converge in 15 minutes to 16 hours,
70 * respectively. 70 * respectively.
71 */ 71 */
72#define SHIFT_KG 6 /* phase factor (shift) */ 72#define SHIFT_PLL 4 /* PLL frequency factor (shift) */
73#define SHIFT_KF 16 /* PLL frequency factor (shift) */ 73#define SHIFT_FLL 2 /* FLL frequency factor (shift) */
74#define SHIFT_KH 2 /* FLL frequency factor (shift) */ 74#define MAXTC 10 /* maximum time constant (shift) */
75#define MAXTC 6 /* maximum time constant (shift) */
76 75
77/* 76/*
78 * The SHIFT_SCALE define establishes the decimal point of the time_phase 77 * The SHIFT_UPDATE define establishes the decimal point of the
79 * variable which serves as an extension to the low-order bits of the 78 * time_offset variable which represents the current offset with
80 * system clock variable. The SHIFT_UPDATE define establishes the decimal 79 * respect to standard time.
81 * point of the time_offset variable which represents the current offset
82 * with respect to standard time. The FINENSEC define represents 1 nsec in
83 * scaled units.
84 * 80 *
85 * SHIFT_USEC defines the scaling (shift) of the time_freq and 81 * SHIFT_USEC defines the scaling (shift) of the time_freq and
86 * time_tolerance variables, which represent the current frequency 82 * time_tolerance variables, which represent the current frequency
87 * offset and maximum frequency tolerance. 83 * offset and maximum frequency tolerance.
88 *
89 * FINENSEC is 1 ns in SHIFT_UPDATE units of the time_phase variable.
90 */ 84 */
91#define SHIFT_SCALE 22 /* phase scale (shift) */ 85#define SHIFT_UPDATE (SHIFT_HZ + 1) /* time offset scale (shift) */
92#define SHIFT_UPDATE (SHIFT_KG + MAXTC) /* time offset scale (shift) */
93#define SHIFT_USEC 16 /* frequency offset scale (shift) */ 86#define SHIFT_USEC 16 /* frequency offset scale (shift) */
94#define FINENSEC (1L << (SHIFT_SCALE - 10)) /* ~1 ns in phase units */ 87#define SHIFT_NSEC 12 /* kernel frequency offset scale */
95 88
96#define MAXPHASE 512000L /* max phase error (us) */ 89#define MAXPHASE 512000L /* max phase error (us) */
97#define MAXFREQ (512L << SHIFT_USEC) /* max frequency error (ppm) */ 90#define MAXFREQ (512L << SHIFT_USEC) /* max frequency error (ppm) */
98#define MINSEC 16L /* min interval between updates (s) */ 91#define MAXFREQ_NSEC (512000L << SHIFT_NSEC) /* max frequency error (ppb) */
99#define MAXSEC 1200L /* max interval between updates (s) */ 92#define MINSEC 256 /* min interval between updates (s) */
93#define MAXSEC 2048 /* max interval between updates (s) */
100#define NTP_PHASE_LIMIT (MAXPHASE << 5) /* beyond max. dispersion */ 94#define NTP_PHASE_LIMIT (MAXPHASE << 5) /* beyond max. dispersion */
101 95
102/* 96/*
@@ -204,33 +198,15 @@ extern int tickadj; /* amount of adjustment per tick */
204/* 198/*
205 * phase-lock loop variables 199 * phase-lock loop variables
206 */ 200 */
207extern int time_state; /* clock status */
208extern int time_status; /* clock synchronization status bits */ 201extern int time_status; /* clock synchronization status bits */
209extern long time_offset; /* time adjustment (us) */
210extern long time_constant; /* pll time constant */
211extern long time_tolerance; /* frequency tolerance (ppm) */
212extern long time_precision; /* clock precision (us) */
213extern long time_maxerror; /* maximum error */ 202extern long time_maxerror; /* maximum error */
214extern long time_esterror; /* estimated error */ 203extern long time_esterror; /* estimated error */
215 204
216extern long time_freq; /* frequency offset (scaled ppm) */ 205extern long time_freq; /* frequency offset (scaled ppm) */
217extern long time_reftime; /* time at last adjustment (s) */
218 206
219extern long time_adjust; /* The amount of adjtime left */ 207extern long time_adjust; /* The amount of adjtime left */
220extern long time_next_adjust; /* Value for time_adjust at next tick */
221 208
222/** 209extern void ntp_clear(void);
223 * ntp_clear - Clears the NTP state variables
224 *
225 * Must be called while holding a write on the xtime_lock
226 */
227static inline void ntp_clear(void)
228{
229 time_adjust = 0; /* stop active adjtime() */
230 time_status |= STA_UNSYNC;
231 time_maxerror = NTP_PHASE_LIMIT;
232 time_esterror = NTP_PHASE_LIMIT;
233}
234 210
235/** 211/**
236 * ntp_synced - Returns 1 if the NTP status is not UNSYNC 212 * ntp_synced - Returns 1 if the NTP status is not UNSYNC
@@ -294,11 +270,15 @@ extern void register_time_interpolator(struct time_interpolator *);
294extern void unregister_time_interpolator(struct time_interpolator *); 270extern void unregister_time_interpolator(struct time_interpolator *);
295extern void time_interpolator_reset(void); 271extern void time_interpolator_reset(void);
296extern unsigned long time_interpolator_get_offset(void); 272extern unsigned long time_interpolator_get_offset(void);
273extern void time_interpolator_update(long delta_nsec);
297 274
298#else /* !CONFIG_TIME_INTERPOLATION */ 275#else /* !CONFIG_TIME_INTERPOLATION */
299 276
300static inline void 277static inline void time_interpolator_reset(void)
301time_interpolator_reset(void) 278{
279}
280
281static inline void time_interpolator_update(long delta_nsec)
302{ 282{
303} 283}
304 284
@@ -309,6 +289,8 @@ time_interpolator_reset(void)
309/* Returns how long ticks are at present, in ns / 2^(SHIFT_SCALE-10). */ 289/* Returns how long ticks are at present, in ns / 2^(SHIFT_SCALE-10). */
310extern u64 current_tick_length(void); 290extern u64 current_tick_length(void);
311 291
292extern void second_overflow(void);
293extern void update_ntp_one_tick(void);
312extern int do_adjtimex(struct timex *); 294extern int do_adjtimex(struct timex *);
313 295
314#endif /* KERNEL */ 296#endif /* KERNEL */
diff --git a/include/linux/trdevice.h b/include/linux/trdevice.h
index 99e02ef54c47..bfc84a7aecc5 100644
--- a/include/linux/trdevice.h
+++ b/include/linux/trdevice.h
@@ -28,7 +28,7 @@
28#include <linux/if_tr.h> 28#include <linux/if_tr.h>
29 29
30#ifdef __KERNEL__ 30#ifdef __KERNEL__
31extern unsigned short tr_type_trans(struct sk_buff *skb, struct net_device *dev); 31extern __be16 tr_type_trans(struct sk_buff *skb, struct net_device *dev);
32extern void tr_source_route(struct sk_buff *skb, struct trh_hdr *trh, struct net_device *dev); 32extern void tr_source_route(struct sk_buff *skb, struct trh_hdr *trh, struct net_device *dev);
33extern struct net_device *alloc_trdev(int sizeof_priv); 33extern struct net_device *alloc_trdev(int sizeof_priv);
34 34
diff --git a/include/linux/tsacct_kern.h b/include/linux/tsacct_kern.h
new file mode 100644
index 000000000000..7e50ac795b0b
--- /dev/null
+++ b/include/linux/tsacct_kern.h
@@ -0,0 +1,34 @@
1/*
2 * tsacct_kern.h - kernel header for system accounting over taskstats interface
3 *
4 * Copyright (C) Jay Lan SGI
5 */
6
7#ifndef _LINUX_TSACCT_KERN_H
8#define _LINUX_TSACCT_KERN_H
9
10#include <linux/taskstats.h>
11
12#ifdef CONFIG_TASKSTATS
13extern void bacct_add_tsk(struct taskstats *stats, struct task_struct *tsk);
14#else
15static inline void bacct_add_tsk(struct taskstats *stats, struct task_struct *tsk)
16{}
17#endif /* CONFIG_TASKSTATS */
18
19#ifdef CONFIG_TASK_XACCT
20extern void xacct_add_tsk(struct taskstats *stats, struct task_struct *p);
21extern void acct_update_integrals(struct task_struct *tsk);
22extern void acct_clear_integrals(struct task_struct *tsk);
23#else
24static inline void xacct_add_tsk(struct taskstats *stats, struct task_struct *p)
25{}
26static inline void acct_update_integrals(struct task_struct *tsk)
27{}
28static inline void acct_clear_integrals(struct task_struct *tsk)
29{}
30#endif /* CONFIG_TASK_XACCT */
31
32#endif
33
34
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 04827ca65781..44091c0db0b4 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -174,7 +174,7 @@ struct tty_struct {
174 struct tty_driver *driver; 174 struct tty_driver *driver;
175 int index; 175 int index;
176 struct tty_ldisc ldisc; 176 struct tty_ldisc ldisc;
177 struct semaphore termios_sem; 177 struct mutex termios_mutex;
178 struct termios *termios, *termios_locked; 178 struct termios *termios, *termios_locked;
179 char name[64]; 179 char name[64];
180 int pgrp; 180 int pgrp;
@@ -190,7 +190,6 @@ struct tty_struct {
190 struct tty_struct *link; 190 struct tty_struct *link;
191 struct fasync_struct *fasync; 191 struct fasync_struct *fasync;
192 struct tty_bufhead buf; 192 struct tty_bufhead buf;
193 int max_flip_cnt;
194 int alt_speed; /* For magic substitution of 38400 bps */ 193 int alt_speed; /* For magic substitution of 38400 bps */
195 wait_queue_head_t write_wait; 194 wait_queue_head_t write_wait;
196 wait_queue_head_t read_wait; 195 wait_queue_head_t read_wait;
@@ -308,6 +307,9 @@ extern void tty_ldisc_put(int);
308extern void tty_wakeup(struct tty_struct *tty); 307extern void tty_wakeup(struct tty_struct *tty);
309extern void tty_ldisc_flush(struct tty_struct *tty); 308extern void tty_ldisc_flush(struct tty_struct *tty);
310 309
310extern int tty_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
311 unsigned long arg);
312
311extern struct mutex tty_mutex; 313extern struct mutex tty_mutex;
312 314
313/* n_tty.c */ 315/* n_tty.c */
diff --git a/include/linux/types.h b/include/linux/types.h
index 3f235660a3cd..406d4ae57631 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -33,6 +33,8 @@ typedef __kernel_clockid_t clockid_t;
33typedef __kernel_mqd_t mqd_t; 33typedef __kernel_mqd_t mqd_t;
34 34
35#ifdef __KERNEL__ 35#ifdef __KERNEL__
36typedef _Bool bool;
37
36typedef __kernel_uid32_t uid_t; 38typedef __kernel_uid32_t uid_t;
37typedef __kernel_gid32_t gid_t; 39typedef __kernel_gid32_t gid_t;
38typedef __kernel_uid16_t uid16_t; 40typedef __kernel_uid16_t uid16_t;
diff --git a/include/linux/udp.h b/include/linux/udp.h
index 90223f057d50..014b41d1e308 100644
--- a/include/linux/udp.h
+++ b/include/linux/udp.h
@@ -20,10 +20,10 @@
20#include <linux/types.h> 20#include <linux/types.h>
21 21
22struct udphdr { 22struct udphdr {
23 __u16 source; 23 __be16 source;
24 __u16 dest; 24 __be16 dest;
25 __u16 len; 25 __be16 len;
26 __u16 check; 26 __be16 check;
27}; 27};
28 28
29/* UDP socket options */ 29/* UDP socket options */
diff --git a/include/linux/unwind.h b/include/linux/unwind.h
index ce48e2cd37a2..73e1751d03dd 100644
--- a/include/linux/unwind.h
+++ b/include/linux/unwind.h
@@ -12,8 +12,6 @@
12 * is not much point in implementing the full Dwarf2 unwind API. 12 * is not much point in implementing the full Dwarf2 unwind API.
13 */ 13 */
14 14
15#include <linux/config.h>
16
17struct module; 15struct module;
18 16
19#ifdef CONFIG_STACK_UNWIND 17#ifdef CONFIG_STACK_UNWIND
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 0da15b0b02be..190cc1b78fe2 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -380,10 +380,10 @@ struct usb_device {
380 int maxchild; /* Number of ports if hub */ 380 int maxchild; /* Number of ports if hub */
381 struct usb_device *children[USB_MAXCHILDREN]; 381 struct usb_device *children[USB_MAXCHILDREN];
382 382
383 int pm_usage_cnt; /* usage counter for autosuspend */
383#ifdef CONFIG_PM 384#ifdef CONFIG_PM
384 struct work_struct autosuspend; /* for delayed autosuspends */ 385 struct work_struct autosuspend; /* for delayed autosuspends */
385 struct mutex pm_mutex; /* protects PM operations */ 386 struct mutex pm_mutex; /* protects PM operations */
386 int pm_usage_cnt; /* usage counter for autosuspend */
387 387
388 unsigned auto_pm:1; /* autosuspend/resume in progress */ 388 unsigned auto_pm:1; /* autosuspend/resume in progress */
389 unsigned do_remote_wakeup:1; /* remote wakeup should be enabled */ 389 unsigned do_remote_wakeup:1; /* remote wakeup should be enabled */
diff --git a/include/linux/utime.h b/include/linux/utime.h
index c6bf27b7897e..640be6a1959e 100644
--- a/include/linux/utime.h
+++ b/include/linux/utime.h
@@ -1,6 +1,8 @@
1#ifndef _LINUX_UTIME_H 1#ifndef _LINUX_UTIME_H
2#define _LINUX_UTIME_H 2#define _LINUX_UTIME_H
3 3
4#include <linux/types.h>
5
4struct utimbuf { 6struct utimbuf {
5 time_t actime; 7 time_t actime;
6 time_t modtime; 8 time_t modtime;
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index e3715d774197..44c59da26ed2 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -1135,7 +1135,8 @@ struct v4l2_sliced_vbi_cap
1135 (equals frame lines 313-336 for 625 line video 1135 (equals frame lines 313-336 for 625 line video
1136 standards, 263-286 for 525 line standards) */ 1136 standards, 263-286 for 525 line standards) */
1137 __u16 service_lines[2][24]; 1137 __u16 service_lines[2][24];
1138 __u32 reserved[4]; /* must be 0 */ 1138 enum v4l2_buf_type type;
1139 __u32 reserved[3]; /* must be 0 */
1139}; 1140};
1140 1141
1141struct v4l2_sliced_vbi_data 1142struct v4l2_sliced_vbi_data
@@ -1242,7 +1243,7 @@ struct v4l2_streamparm
1242#define VIDIOC_G_PRIORITY _IOR ('V', 67, enum v4l2_priority) 1243#define VIDIOC_G_PRIORITY _IOR ('V', 67, enum v4l2_priority)
1243#define VIDIOC_S_PRIORITY _IOW ('V', 68, enum v4l2_priority) 1244#define VIDIOC_S_PRIORITY _IOW ('V', 68, enum v4l2_priority)
1244#if 1 1245#if 1
1245#define VIDIOC_G_SLICED_VBI_CAP _IOR ('V', 69, struct v4l2_sliced_vbi_cap) 1246#define VIDIOC_G_SLICED_VBI_CAP _IOWR ('V', 69, struct v4l2_sliced_vbi_cap)
1246#endif 1247#endif
1247#define VIDIOC_LOG_STATUS _IO ('V', 70) 1248#define VIDIOC_LOG_STATUS _IO ('V', 70)
1248#define VIDIOC_G_EXT_CTRLS _IOWR ('V', 71, struct v4l2_ext_controls) 1249#define VIDIOC_G_EXT_CTRLS _IOWR ('V', 71, struct v4l2_ext_controls)
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
index 176c7f797339..c89df55f6e03 100644
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -3,7 +3,6 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/percpu.h> 5#include <linux/percpu.h>
6#include <linux/config.h>
7#include <linux/mmzone.h> 6#include <linux/mmzone.h>
8#include <asm/atomic.h> 7#include <asm/atomic.h>
9 8
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h
index 918a29763aea..1009d3fe1fc2 100644
--- a/include/linux/vt_kern.h
+++ b/include/linux/vt_kern.h
@@ -33,7 +33,8 @@ extern int fg_console, last_console, want_console;
33int vc_allocate(unsigned int console); 33int vc_allocate(unsigned int console);
34int vc_cons_allocated(unsigned int console); 34int vc_cons_allocated(unsigned int console);
35int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines); 35int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines);
36void vc_disallocate(unsigned int console); 36int vc_lock_resize(struct vc_data *vc, unsigned int cols, unsigned int lines);
37void vc_deallocate(unsigned int console);
37void reset_palette(struct vc_data *vc); 38void reset_palette(struct vc_data *vc);
38void do_blank_screen(int entering_gfx); 39void do_blank_screen(int entering_gfx);
39void do_unblank_screen(int leaving_gfx); 40void do_unblank_screen(int leaving_gfx);
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 56a23a0e7f2e..4f4d98addb44 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -111,12 +111,15 @@ balance_dirty_pages_ratelimited(struct address_space *mapping)
111} 111}
112 112
113int pdflush_operation(void (*fn)(unsigned long), unsigned long arg0); 113int pdflush_operation(void (*fn)(unsigned long), unsigned long arg0);
114extern int generic_writepages(struct address_space *mapping,
115 struct writeback_control *wbc);
114int do_writepages(struct address_space *mapping, struct writeback_control *wbc); 116int do_writepages(struct address_space *mapping, struct writeback_control *wbc);
115int sync_page_range(struct inode *inode, struct address_space *mapping, 117int sync_page_range(struct inode *inode, struct address_space *mapping,
116 loff_t pos, loff_t count); 118 loff_t pos, loff_t count);
117int sync_page_range_nolock(struct inode *inode, struct address_space *mapping, 119int sync_page_range_nolock(struct inode *inode, struct address_space *mapping,
118 loff_t pos, loff_t count); 120 loff_t pos, loff_t count);
119void set_page_dirty_balance(struct page *page); 121void set_page_dirty_balance(struct page *page);
122void writeback_set_ratelimit(void);
120 123
121/* pdflush.c */ 124/* pdflush.c */
122extern int nr_pdflush_threads; /* Global so it can be exported to sysctl 125extern int nr_pdflush_threads; /* Global so it can be exported to sysctl
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
index 14ecd19f4cdc..430afd058269 100644
--- a/include/linux/xfrm.h
+++ b/include/linux/xfrm.h
@@ -12,8 +12,8 @@
12 */ 12 */
13typedef union 13typedef union
14{ 14{
15 __u32 a4; 15 __be32 a4;
16 __u32 a6[4]; 16 __be32 a6[4];
17} xfrm_address_t; 17} xfrm_address_t;
18 18
19/* Ident of a specific xfrm_state. It is used on input to lookup 19/* Ident of a specific xfrm_state. It is used on input to lookup
@@ -23,7 +23,7 @@ typedef union
23struct xfrm_id 23struct xfrm_id
24{ 24{
25 xfrm_address_t daddr; 25 xfrm_address_t daddr;
26 __u32 spi; 26 __be32 spi;
27 __u8 proto; 27 __u8 proto;
28}; 28};
29 29
@@ -49,10 +49,10 @@ struct xfrm_selector
49{ 49{
50 xfrm_address_t daddr; 50 xfrm_address_t daddr;
51 xfrm_address_t saddr; 51 xfrm_address_t saddr;
52 __u16 dport; 52 __be16 dport;
53 __u16 dport_mask; 53 __be16 dport_mask;
54 __u16 sport; 54 __be16 sport;
55 __u16 sport_mask; 55 __be16 sport_mask;
56 __u16 family; 56 __u16 family;
57 __u8 prefixlen_d; 57 __u8 prefixlen_d;
58 __u8 prefixlen_s; 58 __u8 prefixlen_s;
@@ -281,7 +281,7 @@ struct xfrm_usersa_info {
281 281
282struct xfrm_usersa_id { 282struct xfrm_usersa_id {
283 xfrm_address_t daddr; 283 xfrm_address_t daddr;
284 __u32 spi; 284 __be32 spi;
285 __u16 family; 285 __u16 family;
286 __u8 proto; 286 __u8 proto;
287}; 287};
diff --git a/include/media/ir-common.h b/include/media/ir-common.h
index 7bab09b0ed45..8f58406533c6 100644
--- a/include/media/ir-common.h
+++ b/include/media/ir-common.h
@@ -90,6 +90,8 @@ extern IR_KEYTAB_TYPE ir_codes_winfast[IR_KEYTAB_SIZE];
90extern IR_KEYTAB_TYPE ir_codes_pinnacle_color[IR_KEYTAB_SIZE]; 90extern IR_KEYTAB_TYPE ir_codes_pinnacle_color[IR_KEYTAB_SIZE];
91extern IR_KEYTAB_TYPE ir_codes_hauppauge_new[IR_KEYTAB_SIZE]; 91extern IR_KEYTAB_TYPE ir_codes_hauppauge_new[IR_KEYTAB_SIZE];
92extern IR_KEYTAB_TYPE ir_codes_npgtech[IR_KEYTAB_SIZE]; 92extern IR_KEYTAB_TYPE ir_codes_npgtech[IR_KEYTAB_SIZE];
93extern IR_KEYTAB_TYPE ir_codes_norwood[IR_KEYTAB_SIZE];
94extern IR_KEYTAB_TYPE ir_codes_proteus_2309[IR_KEYTAB_SIZE];
93 95
94#endif 96#endif
95 97
diff --git a/include/media/tuner-types.h b/include/media/tuner-types.h
index 3c43b95f4c0d..37dad07a8439 100644
--- a/include/media/tuner-types.h
+++ b/include/media/tuner-types.h
@@ -72,6 +72,9 @@ struct tuner_params {
72 unsigned int port2_invert_for_secam_lc:1; 72 unsigned int port2_invert_for_secam_lc:1;
73 /* Some cards require PORT1 to be 1 for mono Radio FM and 0 for stereo. */ 73 /* Some cards require PORT1 to be 1 for mono Radio FM and 0 for stereo. */
74 unsigned int port1_set_for_fm_mono:1; 74 unsigned int port1_set_for_fm_mono:1;
75 /* Select 18% (or according to datasheet 0%) L standard PLL gating,
76 vs the driver default of 36%. */
77 unsigned int default_pll_gating_18:1;
75 /* Default tda9887 TOP value in dB for the low band. Default is 0. 78 /* Default tda9887 TOP value in dB for the low band. Default is 0.
76 Range: -16:+15 */ 79 Range: -16:+15 */
77 signed int default_top_low:5; 80 signed int default_top_low:5;
diff --git a/include/media/tuner.h b/include/media/tuner.h
index 2f7b00b08e88..3116e750132f 100644
--- a/include/media/tuner.h
+++ b/include/media/tuner.h
@@ -144,6 +144,7 @@ extern int tuner_debug;
144#define TDA9887_DEEMPHASIS_50 (2<<16) 144#define TDA9887_DEEMPHASIS_50 (2<<16)
145#define TDA9887_DEEMPHASIS_75 (3<<16) 145#define TDA9887_DEEMPHASIS_75 (3<<16)
146#define TDA9887_AUTOMUTE (1<<18) 146#define TDA9887_AUTOMUTE (1<<18)
147#define TDA9887_GATING_18 (1<<19)
147 148
148#ifdef __KERNEL__ 149#ifdef __KERNEL__
149 150
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h
index 5564db13c0d5..aecc946980a3 100644
--- a/include/media/v4l2-common.h
+++ b/include/media/v4l2-common.h
@@ -121,10 +121,17 @@ enum v4l2_chip_ident {
121 /* general idents: reserved range 0-49 */ 121 /* general idents: reserved range 0-49 */
122 V4L2_IDENT_UNKNOWN = 0, 122 V4L2_IDENT_UNKNOWN = 0,
123 123
124 /* module saa7115: reserved range 100-149 */ 124 /* module saa7110: just ident= 100 */
125 V4L2_IDENT_SAA7110 = 100,
126
127 /* module saa7111: just ident= 101 */
128 V4L2_IDENT_SAA7111 = 101,
129
130 /* module saa7115: reserved range 102-149 */
125 V4L2_IDENT_SAA7113 = 103, 131 V4L2_IDENT_SAA7113 = 103,
126 V4L2_IDENT_SAA7114 = 104, 132 V4L2_IDENT_SAA7114 = 104,
127 V4L2_IDENT_SAA7115 = 105, 133 V4L2_IDENT_SAA7115 = 105,
134 V4L2_IDENT_SAA7118 = 108,
128 135
129 /* module saa7127: reserved range 150-199 */ 136 /* module saa7127: reserved range 150-199 */
130 V4L2_IDENT_SAA7127 = 157, 137 V4L2_IDENT_SAA7127 = 157,
@@ -166,11 +173,12 @@ enum v4l2_chip_ident {
166#define VIDIOC_INT_S_STANDBY _IOW('d', 94, u32) 173#define VIDIOC_INT_S_STANDBY _IOW('d', 94, u32)
167 174
168/* only implemented if CONFIG_VIDEO_ADV_DEBUG is defined */ 175/* only implemented if CONFIG_VIDEO_ADV_DEBUG is defined */
169#define VIDIOC_INT_S_REGISTER _IOR ('d', 100, struct v4l2_register) 176#define VIDIOC_INT_S_REGISTER _IOW ('d', 100, struct v4l2_register)
170#define VIDIOC_INT_G_REGISTER _IOWR('d', 101, struct v4l2_register) 177#define VIDIOC_INT_G_REGISTER _IOWR('d', 101, struct v4l2_register)
171 178
172/* Reset the I2C chip */ 179/* Generic reset command. The argument selects which subsystems to reset.
173#define VIDIOC_INT_RESET _IO ('d', 102) 180 Passing 0 will always reset the whole chip. */
181#define VIDIOC_INT_RESET _IOW ('d', 102, u32)
174 182
175/* Set the frequency (in Hz) of the audio clock output. 183/* Set the frequency (in Hz) of the audio clock output.
176 Used to slave an audio processor to the video decoder, ensuring that audio 184 Used to slave an audio processor to the video decoder, ensuring that audio
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h
index bb495b7f4680..6a11d772700f 100644
--- a/include/media/v4l2-dev.h
+++ b/include/media/v4l2-dev.h
@@ -9,7 +9,8 @@
9#ifndef _V4L2_DEV_H 9#ifndef _V4L2_DEV_H
10#define _V4L2_DEV_H 10#define _V4L2_DEV_H
11 11
12#define OBSOLETE_OWNER 1 /* to be removed soon */ 12#define OBSOLETE_OWNER 1 /* to be removed soon */
13#define OBSOLETE_DEVDATA 1 /* to be removed soon */
13 14
14#include <linux/poll.h> 15#include <linux/poll.h>
15#include <linux/fs.h> 16#include <linux/fs.h>
@@ -338,8 +339,6 @@ extern int video_usercopy(struct inode *inode, struct file *file,
338#ifdef CONFIG_VIDEO_V4L1_COMPAT 339#ifdef CONFIG_VIDEO_V4L1_COMPAT
339#include <linux/mm.h> 340#include <linux/mm.h>
340 341
341extern struct video_device* video_devdata(struct file*);
342
343#define to_video_device(cd) container_of(cd, struct video_device, class_dev) 342#define to_video_device(cd) container_of(cd, struct video_device, class_dev)
344static inline int __must_check 343static inline int __must_check
345video_device_create_file(struct video_device *vfd, 344video_device_create_file(struct video_device *vfd,
@@ -370,9 +369,14 @@ static inline void video_set_drvdata(struct video_device *dev, void *data)
370{ 369{
371 dev->priv = data; 370 dev->priv = data;
372} 371}
372
373#endif 373#endif
374 374
375#ifdef OBSOLETE_DEVDATA /* to be removed soon */
376/* Obsolete stuff - Still needed for radio devices and obsolete drivers */
377extern struct video_device* video_devdata(struct file*);
375extern int video_exclusive_open(struct inode *inode, struct file *file); 378extern int video_exclusive_open(struct inode *inode, struct file *file);
376extern int video_exclusive_release(struct inode *inode, struct file *file); 379extern int video_exclusive_release(struct inode *inode, struct file *file);
380#endif
377 381
378#endif /* _V4L2_DEV_H */ 382#endif /* _V4L2_DEV_H */
diff --git a/include/net/arp.h b/include/net/arp.h
index 643bded9f557..6a3d9a7d302b 100644
--- a/include/net/arp.h
+++ b/include/net/arp.h
@@ -12,15 +12,15 @@ extern struct neigh_table arp_tbl;
12extern void arp_init(void); 12extern void arp_init(void);
13extern int arp_find(unsigned char *haddr, struct sk_buff *skb); 13extern int arp_find(unsigned char *haddr, struct sk_buff *skb);
14extern int arp_ioctl(unsigned int cmd, void __user *arg); 14extern int arp_ioctl(unsigned int cmd, void __user *arg);
15extern void arp_send(int type, int ptype, u32 dest_ip, 15extern void arp_send(int type, int ptype, __be32 dest_ip,
16 struct net_device *dev, u32 src_ip, 16 struct net_device *dev, __be32 src_ip,
17 unsigned char *dest_hw, unsigned char *src_hw, unsigned char *th); 17 unsigned char *dest_hw, unsigned char *src_hw, unsigned char *th);
18extern int arp_bind_neighbour(struct dst_entry *dst); 18extern int arp_bind_neighbour(struct dst_entry *dst);
19extern int arp_mc_map(u32 addr, u8 *haddr, struct net_device *dev, int dir); 19extern int arp_mc_map(u32 addr, u8 *haddr, struct net_device *dev, int dir);
20extern void arp_ifdown(struct net_device *dev); 20extern void arp_ifdown(struct net_device *dev);
21 21
22extern struct sk_buff *arp_create(int type, int ptype, u32 dest_ip, 22extern struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip,
23 struct net_device *dev, u32 src_ip, 23 struct net_device *dev, __be32 src_ip,
24 unsigned char *dest_hw, unsigned char *src_hw, 24 unsigned char *dest_hw, unsigned char *src_hw,
25 unsigned char *target_hw); 25 unsigned char *target_hw);
26extern void arp_xmit(struct sk_buff *skb); 26extern void arp_xmit(struct sk_buff *skb);
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index b2bdb1aa0429..10a3eec191fd 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -44,12 +44,13 @@
44#define HCI_NOTIFY_VOICE_SETTING 3 44#define HCI_NOTIFY_VOICE_SETTING 3
45 45
46/* HCI device types */ 46/* HCI device types */
47#define HCI_VHCI 0 47#define HCI_VIRTUAL 0
48#define HCI_USB 1 48#define HCI_USB 1
49#define HCI_PCCARD 2 49#define HCI_PCCARD 2
50#define HCI_UART 3 50#define HCI_UART 3
51#define HCI_RS232 4 51#define HCI_RS232 4
52#define HCI_PCI 5 52#define HCI_PCI 5
53#define HCI_SDIO 6
53 54
54/* HCI device quirks */ 55/* HCI device quirks */
55enum { 56enum {
@@ -296,6 +297,7 @@ struct hci_cp_host_buffer_size {
296 297
297/* Link Control */ 298/* Link Control */
298#define OGF_LINK_CTL 0x01 299#define OGF_LINK_CTL 0x01
300
299#define OCF_CREATE_CONN 0x0005 301#define OCF_CREATE_CONN 0x0005
300struct hci_cp_create_conn { 302struct hci_cp_create_conn {
301 bdaddr_t bdaddr; 303 bdaddr_t bdaddr;
@@ -306,6 +308,11 @@ struct hci_cp_create_conn {
306 __u8 role_switch; 308 __u8 role_switch;
307} __attribute__ ((packed)); 309} __attribute__ ((packed));
308 310
311#define OCF_CREATE_CONN_CANCEL 0x0008
312struct hci_cp_create_conn_cancel {
313 bdaddr_t bdaddr;
314} __attribute__ ((packed));
315
309#define OCF_ACCEPT_CONN_REQ 0x0009 316#define OCF_ACCEPT_CONN_REQ 0x0009
310struct hci_cp_accept_conn_req { 317struct hci_cp_accept_conn_req {
311 bdaddr_t bdaddr; 318 bdaddr_t bdaddr;
@@ -339,6 +346,8 @@ struct hci_cp_inquiry {
339 346
340#define OCF_INQUIRY_CANCEL 0x0002 347#define OCF_INQUIRY_CANCEL 0x0002
341 348
349#define OCF_EXIT_PERIODIC_INQ 0x0004
350
342#define OCF_LINK_KEY_REPLY 0x000B 351#define OCF_LINK_KEY_REPLY 0x000B
343struct hci_cp_link_key_reply { 352struct hci_cp_link_key_reply {
344 bdaddr_t bdaddr; 353 bdaddr_t bdaddr;
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index d84855fe7336..df22efcfcc0b 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -72,6 +72,9 @@ struct hci_dev {
72 __u8 type; 72 __u8 type;
73 bdaddr_t bdaddr; 73 bdaddr_t bdaddr;
74 __u8 features[8]; 74 __u8 features[8];
75 __u8 hci_ver;
76 __u16 hci_rev;
77 __u16 manufacturer;
75 __u16 voice_setting; 78 __u16 voice_setting;
76 79
77 __u16 pkt_type; 80 __u16 pkt_type;
@@ -165,6 +168,10 @@ struct hci_conn {
165 struct timer_list disc_timer; 168 struct timer_list disc_timer;
166 struct timer_list idle_timer; 169 struct timer_list idle_timer;
167 170
171 struct work_struct work;
172
173 struct device dev;
174
168 struct hci_dev *hdev; 175 struct hci_dev *hdev;
169 void *l2cap_data; 176 void *l2cap_data;
170 void *sco_data; 177 void *sco_data;
@@ -309,10 +316,13 @@ static inline void hci_conn_put(struct hci_conn *conn)
309 if (atomic_dec_and_test(&conn->refcnt)) { 316 if (atomic_dec_and_test(&conn->refcnt)) {
310 unsigned long timeo; 317 unsigned long timeo;
311 if (conn->type == ACL_LINK) { 318 if (conn->type == ACL_LINK) {
312 timeo = msecs_to_jiffies(HCI_DISCONN_TIMEOUT);
313 if (!conn->out)
314 timeo *= 2;
315 del_timer(&conn->idle_timer); 319 del_timer(&conn->idle_timer);
320 if (conn->state == BT_CONNECTED) {
321 timeo = msecs_to_jiffies(HCI_DISCONN_TIMEOUT);
322 if (!conn->out)
323 timeo *= 2;
324 } else
325 timeo = msecs_to_jiffies(10);
316 } else 326 } else
317 timeo = msecs_to_jiffies(10); 327 timeo = msecs_to_jiffies(10);
318 mod_timer(&conn->disc_timer, jiffies + timeo); 328 mod_timer(&conn->disc_timer, jiffies + timeo);
@@ -412,6 +422,8 @@ static inline int hci_recv_frame(struct sk_buff *skb)
412 422
413int hci_register_sysfs(struct hci_dev *hdev); 423int hci_register_sysfs(struct hci_dev *hdev);
414void hci_unregister_sysfs(struct hci_dev *hdev); 424void hci_unregister_sysfs(struct hci_dev *hdev);
425void hci_conn_add_sysfs(struct hci_conn *conn);
426void hci_conn_del_sysfs(struct hci_conn *conn);
415 427
416#define SET_HCIDEV_DEV(hdev, pdev) ((hdev)->parent = (pdev)) 428#define SET_HCIDEV_DEV(hdev, pdev) ((hdev)->parent = (pdev))
417 429
diff --git a/include/net/cipso_ipv4.h b/include/net/cipso_ipv4.h
index 2d72496c2029..718b4d9c891f 100644
--- a/include/net/cipso_ipv4.h
+++ b/include/net/cipso_ipv4.h
@@ -128,7 +128,9 @@ extern int cipso_v4_rbm_strictvalid;
128 128
129#ifdef CONFIG_NETLABEL 129#ifdef CONFIG_NETLABEL
130int cipso_v4_doi_add(struct cipso_v4_doi *doi_def); 130int cipso_v4_doi_add(struct cipso_v4_doi *doi_def);
131int cipso_v4_doi_remove(u32 doi, void (*callback) (struct rcu_head * head)); 131int cipso_v4_doi_remove(u32 doi,
132 struct netlbl_audit *audit_info,
133 void (*callback) (struct rcu_head * head));
132struct cipso_v4_doi *cipso_v4_doi_getdef(u32 doi); 134struct cipso_v4_doi *cipso_v4_doi_getdef(u32 doi);
133int cipso_v4_doi_walk(u32 *skip_cnt, 135int cipso_v4_doi_walk(u32 *skip_cnt,
134 int (*callback) (struct cipso_v4_doi *doi_def, void *arg), 136 int (*callback) (struct cipso_v4_doi *doi_def, void *arg),
@@ -143,6 +145,7 @@ static inline int cipso_v4_doi_add(struct cipso_v4_doi *doi_def)
143} 145}
144 146
145static inline int cipso_v4_doi_remove(u32 doi, 147static inline int cipso_v4_doi_remove(u32 doi,
148 struct netlbl_audit *audit_info,
146 void (*callback) (struct rcu_head * head)) 149 void (*callback) (struct rcu_head * head))
147{ 150{
148 return 0; 151 return 0;
diff --git a/include/net/dst.h b/include/net/dst.h
index a8d825f90305..e156e38e4ac3 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -84,7 +84,7 @@ struct dst_entry
84struct dst_ops 84struct dst_ops
85{ 85{
86 unsigned short family; 86 unsigned short family;
87 unsigned short protocol; 87 __be16 protocol;
88 unsigned gc_thresh; 88 unsigned gc_thresh;
89 89
90 int (*gc)(void); 90 int (*gc)(void);
diff --git a/include/net/flow.h b/include/net/flow.h
index 3ca210ec1379..ddf5f3ca1720 100644
--- a/include/net/flow.h
+++ b/include/net/flow.h
@@ -16,8 +16,8 @@ struct flowi {
16 16
17 union { 17 union {
18 struct { 18 struct {
19 __u32 daddr; 19 __be32 daddr;
20 __u32 saddr; 20 __be32 saddr;
21 __u32 fwmark; 21 __u32 fwmark;
22 __u8 tos; 22 __u8 tos;
23 __u8 scope; 23 __u8 scope;
@@ -56,8 +56,8 @@ struct flowi {
56#define FLOWI_FLAG_MULTIPATHOLDROUTE 0x01 56#define FLOWI_FLAG_MULTIPATHOLDROUTE 0x01
57 union { 57 union {
58 struct { 58 struct {
59 __u16 sport; 59 __be16 sport;
60 __u16 dport; 60 __be16 dport;
61 } ports; 61 } ports;
62 62
63 struct { 63 struct {
@@ -73,7 +73,7 @@ struct flowi {
73 __u8 objname[16]; /* Not zero terminated */ 73 __u8 objname[16]; /* Not zero terminated */
74 } dnports; 74 } dnports;
75 75
76 __u32 spi; 76 __be32 spi;
77 77
78#ifdef CONFIG_IPV6_MIP6 78#ifdef CONFIG_IPV6_MIP6
79 struct { 79 struct {
diff --git a/include/net/genetlink.h b/include/net/genetlink.h
index 4a38d85e4e25..b619314218a6 100644
--- a/include/net/genetlink.h
+++ b/include/net/genetlink.h
@@ -169,4 +169,22 @@ static inline int genlmsg_len(const struct genlmsghdr *gnlh)
169 return (nlh->nlmsg_len - GENL_HDRLEN - NLMSG_HDRLEN); 169 return (nlh->nlmsg_len - GENL_HDRLEN - NLMSG_HDRLEN);
170} 170}
171 171
172/**
173 * genlmsg_msg_size - length of genetlink message not including padding
174 * @payload: length of message payload
175 */
176static inline int genlmsg_msg_size(int payload)
177{
178 return GENL_HDRLEN + payload;
179}
180
181/**
182 * genlmsg_total_size - length of genetlink message including padding
183 * @payload: length of message payload
184 */
185static inline int genlmsg_total_size(int payload)
186{
187 return NLMSG_ALIGN(genlmsg_msg_size(payload));
188}
189
172#endif /* __NET_GENERIC_NETLINK_H */ 190#endif /* __NET_GENERIC_NETLINK_H */
diff --git a/include/net/icmp.h b/include/net/icmp.h
index 05f8ff7d9316..dc09474efcf3 100644
--- a/include/net/icmp.h
+++ b/include/net/icmp.h
@@ -38,7 +38,7 @@ struct dst_entry;
38struct net_proto_family; 38struct net_proto_family;
39struct sk_buff; 39struct sk_buff;
40 40
41extern void icmp_send(struct sk_buff *skb_in, int type, int code, u32 info); 41extern void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info);
42extern int icmp_rcv(struct sk_buff *skb); 42extern int icmp_rcv(struct sk_buff *skb);
43extern int icmp_ioctl(struct sock *sk, int cmd, unsigned long arg); 43extern int icmp_ioctl(struct sock *sk, int cmd, unsigned long arg);
44extern void icmp_init(struct net_proto_family *ops); 44extern void icmp_init(struct net_proto_family *ops);
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h
index de4e83b6da4b..0bcf9f237e1f 100644
--- a/include/net/inet_connection_sock.h
+++ b/include/net/inet_connection_sock.h
@@ -238,9 +238,9 @@ extern struct sock *inet_csk_accept(struct sock *sk, int flags, int *err);
238 238
239extern struct request_sock *inet_csk_search_req(const struct sock *sk, 239extern struct request_sock *inet_csk_search_req(const struct sock *sk,
240 struct request_sock ***prevp, 240 struct request_sock ***prevp,
241 const __u16 rport, 241 const __be16 rport,
242 const __u32 raddr, 242 const __be32 raddr,
243 const __u32 laddr); 243 const __be32 laddr);
244extern int inet_csk_bind_conflict(const struct sock *sk, 244extern int inet_csk_bind_conflict(const struct sock *sk,
245 const struct inet_bind_bucket *tb); 245 const struct inet_bind_bucket *tb);
246extern int inet_csk_get_port(struct inet_hashinfo *hashinfo, 246extern int inet_csk_get_port(struct inet_hashinfo *hashinfo,
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
index b4491c9e2a5a..a9eb2eaf094e 100644
--- a/include/net/inet_hashtables.h
+++ b/include/net/inet_hashtables.h
@@ -272,42 +272,56 @@ static inline int inet_iif(const struct sk_buff *skb)
272} 272}
273 273
274extern struct sock *__inet_lookup_listener(struct inet_hashinfo *hashinfo, 274extern struct sock *__inet_lookup_listener(struct inet_hashinfo *hashinfo,
275 const u32 daddr, 275 const __be32 daddr,
276 const unsigned short hnum, 276 const unsigned short hnum,
277 const int dif); 277 const int dif);
278 278
279static inline struct sock *inet_lookup_listener(struct inet_hashinfo *hashinfo, 279static inline struct sock *inet_lookup_listener(struct inet_hashinfo *hashinfo,
280 u32 daddr, u16 dport, int dif) 280 __be32 daddr, __be16 dport, int dif)
281{ 281{
282 return __inet_lookup_listener(hashinfo, daddr, ntohs(dport), dif); 282 return __inet_lookup_listener(hashinfo, daddr, ntohs(dport), dif);
283} 283}
284 284
285/* Socket demux engine toys. */ 285/* Socket demux engine toys. */
286/* What happens here is ugly; there's a pair of adjacent fields in
287 struct inet_sock; __be16 dport followed by __u16 num. We want to
288 search by pair, so we combine the keys into a single 32bit value
289 and compare with 32bit value read from &...->dport. Let's at least
290 make sure that it's not mixed with anything else...
291 On 64bit targets we combine comparisons with pair of adjacent __be32
292 fields in the same way.
293*/
294typedef __u32 __bitwise __portpair;
286#ifdef __BIG_ENDIAN 295#ifdef __BIG_ENDIAN
287#define INET_COMBINED_PORTS(__sport, __dport) \ 296#define INET_COMBINED_PORTS(__sport, __dport) \
288 (((__u32)(__sport) << 16) | (__u32)(__dport)) 297 ((__force __portpair)(((__force __u32)(__be16)(__sport) << 16) | (__u32)(__dport)))
289#else /* __LITTLE_ENDIAN */ 298#else /* __LITTLE_ENDIAN */
290#define INET_COMBINED_PORTS(__sport, __dport) \ 299#define INET_COMBINED_PORTS(__sport, __dport) \
291 (((__u32)(__dport) << 16) | (__u32)(__sport)) 300 ((__force __portpair)(((__u32)(__dport) << 16) | (__force __u32)(__be16)(__sport)))
292#endif 301#endif
293 302
294#if (BITS_PER_LONG == 64) 303#if (BITS_PER_LONG == 64)
304typedef __u64 __bitwise __addrpair;
295#ifdef __BIG_ENDIAN 305#ifdef __BIG_ENDIAN
296#define INET_ADDR_COOKIE(__name, __saddr, __daddr) \ 306#define INET_ADDR_COOKIE(__name, __saddr, __daddr) \
297 const __u64 __name = (((__u64)(__saddr)) << 32) | ((__u64)(__daddr)); 307 const __addrpair __name = (__force __addrpair) ( \
308 (((__force __u64)(__be32)(__saddr)) << 32) | \
309 ((__force __u64)(__be32)(__daddr)));
298#else /* __LITTLE_ENDIAN */ 310#else /* __LITTLE_ENDIAN */
299#define INET_ADDR_COOKIE(__name, __saddr, __daddr) \ 311#define INET_ADDR_COOKIE(__name, __saddr, __daddr) \
300 const __u64 __name = (((__u64)(__daddr)) << 32) | ((__u64)(__saddr)); 312 const __addrpair __name = (__force __addrpair) ( \
313 (((__force __u64)(__be32)(__daddr)) << 32) | \
314 ((__force __u64)(__be32)(__saddr)));
301#endif /* __BIG_ENDIAN */ 315#endif /* __BIG_ENDIAN */
302#define INET_MATCH(__sk, __hash, __cookie, __saddr, __daddr, __ports, __dif)\ 316#define INET_MATCH(__sk, __hash, __cookie, __saddr, __daddr, __ports, __dif)\
303 (((__sk)->sk_hash == (__hash)) && \ 317 (((__sk)->sk_hash == (__hash)) && \
304 ((*((__u64 *)&(inet_sk(__sk)->daddr))) == (__cookie)) && \ 318 ((*((__addrpair *)&(inet_sk(__sk)->daddr))) == (__cookie)) && \
305 ((*((__u32 *)&(inet_sk(__sk)->dport))) == (__ports)) && \ 319 ((*((__portpair *)&(inet_sk(__sk)->dport))) == (__ports)) && \
306 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) 320 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif))))
307#define INET_TW_MATCH(__sk, __hash, __cookie, __saddr, __daddr, __ports, __dif)\ 321#define INET_TW_MATCH(__sk, __hash, __cookie, __saddr, __daddr, __ports, __dif)\
308 (((__sk)->sk_hash == (__hash)) && \ 322 (((__sk)->sk_hash == (__hash)) && \
309 ((*((__u64 *)&(inet_twsk(__sk)->tw_daddr))) == (__cookie)) && \ 323 ((*((__addrpair *)&(inet_twsk(__sk)->tw_daddr))) == (__cookie)) && \
310 ((*((__u32 *)&(inet_twsk(__sk)->tw_dport))) == (__ports)) && \ 324 ((*((__portpair *)&(inet_twsk(__sk)->tw_dport))) == (__ports)) && \
311 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) 325 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif))))
312#else /* 32-bit arch */ 326#else /* 32-bit arch */
313#define INET_ADDR_COOKIE(__name, __saddr, __daddr) 327#define INET_ADDR_COOKIE(__name, __saddr, __daddr)
@@ -315,13 +329,13 @@ static inline struct sock *inet_lookup_listener(struct inet_hashinfo *hashinfo,
315 (((__sk)->sk_hash == (__hash)) && \ 329 (((__sk)->sk_hash == (__hash)) && \
316 (inet_sk(__sk)->daddr == (__saddr)) && \ 330 (inet_sk(__sk)->daddr == (__saddr)) && \
317 (inet_sk(__sk)->rcv_saddr == (__daddr)) && \ 331 (inet_sk(__sk)->rcv_saddr == (__daddr)) && \
318 ((*((__u32 *)&(inet_sk(__sk)->dport))) == (__ports)) && \ 332 ((*((__portpair *)&(inet_sk(__sk)->dport))) == (__ports)) && \
319 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) 333 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif))))
320#define INET_TW_MATCH(__sk, __hash,__cookie, __saddr, __daddr, __ports, __dif) \ 334#define INET_TW_MATCH(__sk, __hash,__cookie, __saddr, __daddr, __ports, __dif) \
321 (((__sk)->sk_hash == (__hash)) && \ 335 (((__sk)->sk_hash == (__hash)) && \
322 (inet_twsk(__sk)->tw_daddr == (__saddr)) && \ 336 (inet_twsk(__sk)->tw_daddr == (__saddr)) && \
323 (inet_twsk(__sk)->tw_rcv_saddr == (__daddr)) && \ 337 (inet_twsk(__sk)->tw_rcv_saddr == (__daddr)) && \
324 ((*((__u32 *)&(inet_twsk(__sk)->tw_dport))) == (__ports)) && \ 338 ((*((__portpair *)&(inet_twsk(__sk)->tw_dport))) == (__ports)) && \
325 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) 339 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif))))
326#endif /* 64-bit arch */ 340#endif /* 64-bit arch */
327 341
@@ -333,12 +347,12 @@ static inline struct sock *inet_lookup_listener(struct inet_hashinfo *hashinfo,
333 */ 347 */
334static inline struct sock * 348static inline struct sock *
335 __inet_lookup_established(struct inet_hashinfo *hashinfo, 349 __inet_lookup_established(struct inet_hashinfo *hashinfo,
336 const u32 saddr, const u16 sport, 350 const __be32 saddr, const __be16 sport,
337 const u32 daddr, const u16 hnum, 351 const __be32 daddr, const u16 hnum,
338 const int dif) 352 const int dif)
339{ 353{
340 INET_ADDR_COOKIE(acookie, saddr, daddr) 354 INET_ADDR_COOKIE(acookie, saddr, daddr)
341 const __u32 ports = INET_COMBINED_PORTS(sport, hnum); 355 const __portpair ports = INET_COMBINED_PORTS(sport, hnum);
342 struct sock *sk; 356 struct sock *sk;
343 const struct hlist_node *node; 357 const struct hlist_node *node;
344 /* Optimize here for direct hit, only listening connections can 358 /* Optimize here for direct hit, only listening connections can
@@ -370,8 +384,8 @@ hit:
370 384
371static inline struct sock * 385static inline struct sock *
372 inet_lookup_established(struct inet_hashinfo *hashinfo, 386 inet_lookup_established(struct inet_hashinfo *hashinfo,
373 const u32 saddr, const u16 sport, 387 const __be32 saddr, const __be16 sport,
374 const u32 daddr, const u16 dport, 388 const __be32 daddr, const __be16 dport,
375 const int dif) 389 const int dif)
376{ 390{
377 return __inet_lookup_established(hashinfo, saddr, sport, daddr, 391 return __inet_lookup_established(hashinfo, saddr, sport, daddr,
@@ -379,8 +393,8 @@ static inline struct sock *
379} 393}
380 394
381static inline struct sock *__inet_lookup(struct inet_hashinfo *hashinfo, 395static inline struct sock *__inet_lookup(struct inet_hashinfo *hashinfo,
382 const u32 saddr, const u16 sport, 396 const __be32 saddr, const __be16 sport,
383 const u32 daddr, const u16 dport, 397 const __be32 daddr, const __be16 dport,
384 const int dif) 398 const int dif)
385{ 399{
386 u16 hnum = ntohs(dport); 400 u16 hnum = ntohs(dport);
@@ -390,8 +404,8 @@ static inline struct sock *__inet_lookup(struct inet_hashinfo *hashinfo,
390} 404}
391 405
392static inline struct sock *inet_lookup(struct inet_hashinfo *hashinfo, 406static inline struct sock *inet_lookup(struct inet_hashinfo *hashinfo,
393 const u32 saddr, const u16 sport, 407 const __be32 saddr, const __be16 sport,
394 const u32 daddr, const u16 dport, 408 const __be32 daddr, const __be16 dport,
395 const int dif) 409 const int dif)
396{ 410{
397 struct sock *sk; 411 struct sock *sk;
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
index f6242710f2ff..ce6da97bc848 100644
--- a/include/net/inet_sock.h
+++ b/include/net/inet_sock.h
@@ -36,7 +36,7 @@
36 * @ts_needaddr - Need to record addr of outgoing dev 36 * @ts_needaddr - Need to record addr of outgoing dev
37 */ 37 */
38struct ip_options { 38struct ip_options {
39 __u32 faddr; 39 __be32 faddr;
40 unsigned char optlen; 40 unsigned char optlen;
41 unsigned char srr; 41 unsigned char srr;
42 unsigned char rr; 42 unsigned char rr;
@@ -62,9 +62,9 @@ struct inet_request_sock {
62 u16 inet6_rsk_offset; 62 u16 inet6_rsk_offset;
63 /* 2 bytes hole, try to pack */ 63 /* 2 bytes hole, try to pack */
64#endif 64#endif
65 u32 loc_addr; 65 __be32 loc_addr;
66 u32 rmt_addr; 66 __be32 rmt_addr;
67 u16 rmt_port; 67 __be16 rmt_port;
68 u16 snd_wscale : 4, 68 u16 snd_wscale : 4,
69 rcv_wscale : 4, 69 rcv_wscale : 4,
70 tstamp_ok : 1, 70 tstamp_ok : 1,
@@ -110,15 +110,15 @@ struct inet_sock {
110 struct ipv6_pinfo *pinet6; 110 struct ipv6_pinfo *pinet6;
111#endif 111#endif
112 /* Socket demultiplex comparisons on incoming packets. */ 112 /* Socket demultiplex comparisons on incoming packets. */
113 __u32 daddr; 113 __be32 daddr;
114 __u32 rcv_saddr; 114 __be32 rcv_saddr;
115 __u16 dport; 115 __be16 dport;
116 __u16 num; 116 __u16 num;
117 __u32 saddr; 117 __be32 saddr;
118 __s16 uc_ttl; 118 __s16 uc_ttl;
119 __u16 cmsg_flags; 119 __u16 cmsg_flags;
120 struct ip_options *opt; 120 struct ip_options *opt;
121 __u16 sport; 121 __be16 sport;
122 __u16 id; 122 __u16 id;
123 __u8 tos; 123 __u8 tos;
124 __u8 mc_ttl; 124 __u8 mc_ttl;
@@ -129,7 +129,7 @@ struct inet_sock {
129 hdrincl:1, 129 hdrincl:1,
130 mc_loop:1; 130 mc_loop:1;
131 int mc_index; 131 int mc_index;
132 __u32 mc_addr; 132 __be32 mc_addr;
133 struct ip_mc_socklist *mc_list; 133 struct ip_mc_socklist *mc_list;
134 struct { 134 struct {
135 unsigned int flags; 135 unsigned int flags;
@@ -137,7 +137,7 @@ struct inet_sock {
137 struct ip_options *opt; 137 struct ip_options *opt;
138 struct rtable *rt; 138 struct rtable *rt;
139 int length; /* Total length of all frames */ 139 int length; /* Total length of all frames */
140 u32 addr; 140 __be32 addr;
141 struct flowi fl; 141 struct flowi fl;
142 } cork; 142 } cork;
143}; 143};
@@ -167,10 +167,10 @@ static inline void inet_sk_copy_descendant(struct sock *sk_to,
167 167
168extern int inet_sk_rebuild_header(struct sock *sk); 168extern int inet_sk_rebuild_header(struct sock *sk);
169 169
170static inline unsigned int inet_ehashfn(const __u32 laddr, const __u16 lport, 170static inline unsigned int inet_ehashfn(const __be32 laddr, const __u16 lport,
171 const __u32 faddr, const __u16 fport) 171 const __be32 faddr, const __be16 fport)
172{ 172{
173 unsigned int h = (laddr ^ lport) ^ (faddr ^ fport); 173 unsigned int h = ((__force __u32)laddr ^ lport) ^ ((__force __u32)faddr ^ (__force __u32)fport);
174 h ^= h >> 16; 174 h ^= h >> 16;
175 h ^= h >> 8; 175 h ^= h >> 8;
176 return h; 176 return h;
@@ -179,10 +179,10 @@ static inline unsigned int inet_ehashfn(const __u32 laddr, const __u16 lport,
179static inline int inet_sk_ehashfn(const struct sock *sk) 179static inline int inet_sk_ehashfn(const struct sock *sk)
180{ 180{
181 const struct inet_sock *inet = inet_sk(sk); 181 const struct inet_sock *inet = inet_sk(sk);
182 const __u32 laddr = inet->rcv_saddr; 182 const __be32 laddr = inet->rcv_saddr;
183 const __u16 lport = inet->num; 183 const __u16 lport = inet->num;
184 const __u32 faddr = inet->daddr; 184 const __be32 faddr = inet->daddr;
185 const __u16 fport = inet->dport; 185 const __be16 fport = inet->dport;
186 186
187 return inet_ehashfn(laddr, lport, faddr, fport); 187 return inet_ehashfn(laddr, lport, faddr, fport);
188} 188}
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h
index 600cb543550d..6d14c22a00c5 100644
--- a/include/net/inet_timewait_sock.h
+++ b/include/net/inet_timewait_sock.h
@@ -120,10 +120,10 @@ struct inet_timewait_sock {
120 unsigned char tw_rcv_wscale; 120 unsigned char tw_rcv_wscale;
121 /* Socket demultiplex comparisons on incoming packets. */ 121 /* Socket demultiplex comparisons on incoming packets. */
122 /* these five are in inet_sock */ 122 /* these five are in inet_sock */
123 __u16 tw_sport; 123 __be16 tw_sport;
124 __u32 tw_daddr __attribute__((aligned(INET_TIMEWAIT_ADDRCMP_ALIGN_BYTES))); 124 __be32 tw_daddr __attribute__((aligned(INET_TIMEWAIT_ADDRCMP_ALIGN_BYTES)));
125 __u32 tw_rcv_saddr; 125 __be32 tw_rcv_saddr;
126 __u16 tw_dport; 126 __be16 tw_dport;
127 __u16 tw_num; 127 __u16 tw_num;
128 /* And these are ours. */ 128 /* And these are ours. */
129 __u8 tw_ipv6only:1; 129 __u8 tw_ipv6only:1;
@@ -186,7 +186,7 @@ static inline struct inet_timewait_sock *inet_twsk(const struct sock *sk)
186 return (struct inet_timewait_sock *)sk; 186 return (struct inet_timewait_sock *)sk;
187} 187}
188 188
189static inline u32 inet_rcv_saddr(const struct sock *sk) 189static inline __be32 inet_rcv_saddr(const struct sock *sk)
190{ 190{
191 return likely(sk->sk_state != TCP_TIME_WAIT) ? 191 return likely(sk->sk_state != TCP_TIME_WAIT) ?
192 inet_sk(sk)->rcv_saddr : inet_twsk(sk)->tw_rcv_saddr; 192 inet_sk(sk)->rcv_saddr : inet_twsk(sk)->tw_rcv_saddr;
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h
index 0965515f40cf..925573fd2aed 100644
--- a/include/net/inetpeer.h
+++ b/include/net/inetpeer.h
@@ -22,7 +22,7 @@ struct inet_peer
22 unsigned long dtime; /* the time of last use of not 22 unsigned long dtime; /* the time of last use of not
23 * referenced entries */ 23 * referenced entries */
24 atomic_t refcnt; 24 atomic_t refcnt;
25 __u32 v4daddr; /* peer's address */ 25 __be32 v4daddr; /* peer's address */
26 __u16 avl_height; 26 __u16 avl_height;
27 __u16 ip_id_count; /* IP ID for the next packet */ 27 __u16 ip_id_count; /* IP ID for the next packet */
28 atomic_t rid; /* Frag reception counter */ 28 atomic_t rid; /* Frag reception counter */
@@ -33,7 +33,7 @@ struct inet_peer
33void inet_initpeers(void) __init; 33void inet_initpeers(void) __init;
34 34
35/* can be called with or without local BH being disabled */ 35/* can be called with or without local BH being disabled */
36struct inet_peer *inet_getpeer(__u32 daddr, int create); 36struct inet_peer *inet_getpeer(__be32 daddr, int create);
37 37
38extern spinlock_t inet_peer_unused_lock; 38extern spinlock_t inet_peer_unused_lock;
39extern struct inet_peer **inet_peer_unused_tailp; 39extern struct inet_peer **inet_peer_unused_tailp;
diff --git a/include/net/ip.h b/include/net/ip.h
index 98f908400771..b6d95e553401 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -45,7 +45,7 @@ struct inet_skb_parm
45 45
46struct ipcm_cookie 46struct ipcm_cookie
47{ 47{
48 u32 addr; 48 __be32 addr;
49 int oif; 49 int oif;
50 struct ip_options *opt; 50 struct ip_options *opt;
51}; 51};
@@ -86,7 +86,7 @@ extern int igmp_mc_proc_init(void);
86 */ 86 */
87 87
88extern int ip_build_and_send_pkt(struct sk_buff *skb, struct sock *sk, 88extern int ip_build_and_send_pkt(struct sk_buff *skb, struct sock *sk,
89 u32 saddr, u32 daddr, 89 __be32 saddr, __be32 daddr,
90 struct ip_options *opt); 90 struct ip_options *opt);
91extern int ip_rcv(struct sk_buff *skb, struct net_device *dev, 91extern int ip_rcv(struct sk_buff *skb, struct net_device *dev,
92 struct packet_type *pt, struct net_device *orig_dev); 92 struct packet_type *pt, struct net_device *orig_dev);
@@ -335,7 +335,7 @@ extern int ip_net_unreachable(struct sk_buff *skb);
335 * Functions provided by ip_options.c 335 * Functions provided by ip_options.c
336 */ 336 */
337 337
338extern void ip_options_build(struct sk_buff *skb, struct ip_options *opt, u32 daddr, struct rtable *rt, int is_frag); 338extern void ip_options_build(struct sk_buff *skb, struct ip_options *opt, __be32 daddr, struct rtable *rt, int is_frag);
339extern int ip_options_echo(struct ip_options *dopt, struct sk_buff *skb); 339extern int ip_options_echo(struct ip_options *dopt, struct sk_buff *skb);
340extern void ip_options_fragment(struct sk_buff *skb); 340extern void ip_options_fragment(struct sk_buff *skb);
341extern int ip_options_compile(struct ip_options *opt, struct sk_buff *skb); 341extern int ip_options_compile(struct ip_options *opt, struct sk_buff *skb);
@@ -363,8 +363,8 @@ extern int ip_ra_control(struct sock *sk, unsigned char on, void (*destructor)(s
363 363
364extern int ip_recv_error(struct sock *sk, struct msghdr *msg, int len); 364extern int ip_recv_error(struct sock *sk, struct msghdr *msg, int len);
365extern void ip_icmp_error(struct sock *sk, struct sk_buff *skb, int err, 365extern void ip_icmp_error(struct sock *sk, struct sk_buff *skb, int err,
366 u16 port, u32 info, u8 *payload); 366 __be16 port, u32 info, u8 *payload);
367extern void ip_local_error(struct sock *sk, int err, u32 daddr, u16 dport, 367extern void ip_local_error(struct sock *sk, int err, __be32 daddr, __be16 dport,
368 u32 info); 368 u32 info);
369 369
370/* sysctl helpers - any sysctl which holds a value that ends up being 370/* sysctl helpers - any sysctl which holds a value that ends up being
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index fcc159a4ac17..82229146bac7 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
@@ -30,13 +30,13 @@ struct fib_config {
30 u8 fc_type; 30 u8 fc_type;
31 /* 1 byte unused */ 31 /* 1 byte unused */
32 u32 fc_table; 32 u32 fc_table;
33 u32 fc_dst; 33 __be32 fc_dst;
34 u32 fc_src; 34 __be32 fc_src;
35 u32 fc_gw; 35 __be32 fc_gw;
36 int fc_oif; 36 int fc_oif;
37 u32 fc_flags; 37 u32 fc_flags;
38 u32 fc_priority; 38 u32 fc_priority;
39 u32 fc_prefsrc; 39 __be32 fc_prefsrc;
40 struct nlattr *fc_mx; 40 struct nlattr *fc_mx;
41 struct rtnexthop *fc_mp; 41 struct rtnexthop *fc_mp;
42 int fc_mx_len; 42 int fc_mx_len;
@@ -63,7 +63,7 @@ struct fib_nh {
63 __u32 nh_tclassid; 63 __u32 nh_tclassid;
64#endif 64#endif
65 int nh_oif; 65 int nh_oif;
66 u32 nh_gw; 66 __be32 nh_gw;
67}; 67};
68 68
69/* 69/*
@@ -78,7 +78,7 @@ struct fib_info {
78 int fib_dead; 78 int fib_dead;
79 unsigned fib_flags; 79 unsigned fib_flags;
80 int fib_protocol; 80 int fib_protocol;
81 u32 fib_prefsrc; 81 __be32 fib_prefsrc;
82 u32 fib_priority; 82 u32 fib_priority;
83 u32 fib_metrics[RTAX_MAX]; 83 u32 fib_metrics[RTAX_MAX];
84#define fib_mtu fib_metrics[RTAX_MTU-1] 84#define fib_mtu fib_metrics[RTAX_MTU-1]
@@ -107,8 +107,8 @@ struct fib_result {
107 unsigned char type; 107 unsigned char type;
108 unsigned char scope; 108 unsigned char scope;
109#ifdef CONFIG_IP_ROUTE_MULTIPATH_CACHED 109#ifdef CONFIG_IP_ROUTE_MULTIPATH_CACHED
110 __u32 network; 110 __be32 network;
111 __u32 netmask; 111 __be32 netmask;
112#endif 112#endif
113 struct fib_info *fi; 113 struct fib_info *fi;
114#ifdef CONFIG_IP_MULTIPLE_TABLES 114#ifdef CONFIG_IP_MULTIPLE_TABLES
@@ -117,7 +117,7 @@ struct fib_result {
117}; 117};
118 118
119struct fib_result_nl { 119struct fib_result_nl {
120 u32 fl_addr; /* To be looked up*/ 120 __be32 fl_addr; /* To be looked up*/
121 u32 fl_fwmark; 121 u32 fl_fwmark;
122 unsigned char fl_tos; 122 unsigned char fl_tos;
123 unsigned char fl_scope; 123 unsigned char fl_scope;
@@ -222,17 +222,17 @@ extern int inet_rtm_delroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *ar
222extern int inet_rtm_newroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg); 222extern int inet_rtm_newroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg);
223extern int inet_rtm_getroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg); 223extern int inet_rtm_getroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg);
224extern int inet_dump_fib(struct sk_buff *skb, struct netlink_callback *cb); 224extern int inet_dump_fib(struct sk_buff *skb, struct netlink_callback *cb);
225extern int fib_validate_source(u32 src, u32 dst, u8 tos, int oif, 225extern int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif,
226 struct net_device *dev, u32 *spec_dst, u32 *itag); 226 struct net_device *dev, __be32 *spec_dst, u32 *itag);
227extern void fib_select_multipath(const struct flowi *flp, struct fib_result *res); 227extern void fib_select_multipath(const struct flowi *flp, struct fib_result *res);
228 228
229struct rtentry; 229struct rtentry;
230 230
231/* Exported by fib_semantics.c */ 231/* Exported by fib_semantics.c */
232extern int ip_fib_check_default(u32 gw, struct net_device *dev); 232extern int ip_fib_check_default(__be32 gw, struct net_device *dev);
233extern int fib_sync_down(u32 local, struct net_device *dev, int force); 233extern int fib_sync_down(__be32 local, struct net_device *dev, int force);
234extern int fib_sync_up(struct net_device *dev); 234extern int fib_sync_up(struct net_device *dev);
235extern u32 __fib_res_prefsrc(struct fib_result *res); 235extern __be32 __fib_res_prefsrc(struct fib_result *res);
236 236
237/* Exported by fib_hash.c */ 237/* Exported by fib_hash.c */
238extern struct fib_table *fib_hash_init(u32 id); 238extern struct fib_table *fib_hash_init(u32 id);
diff --git a/include/net/ip_mp_alg.h b/include/net/ip_mp_alg.h
index ac747b64734c..beffdd66ad74 100644
--- a/include/net/ip_mp_alg.h
+++ b/include/net/ip_mp_alg.h
@@ -17,7 +17,7 @@ struct ip_mp_alg_ops {
17 void (*mp_alg_select_route)(const struct flowi *flp, 17 void (*mp_alg_select_route)(const struct flowi *flp,
18 struct rtable *rth, struct rtable **rp); 18 struct rtable *rth, struct rtable **rp);
19 void (*mp_alg_flush)(void); 19 void (*mp_alg_flush)(void);
20 void (*mp_alg_set_nhinfo)(__u32 network, __u32 netmask, 20 void (*mp_alg_set_nhinfo)(__be32 network, __be32 netmask,
21 unsigned char prefixlen, 21 unsigned char prefixlen,
22 const struct fib_nh *nh); 22 const struct fib_nh *nh);
23 void (*mp_alg_remove)(struct rtable *rth); 23 void (*mp_alg_remove)(struct rtable *rth);
@@ -59,7 +59,7 @@ static inline void multipath_flush(void)
59} 59}
60 60
61static inline void multipath_set_nhinfo(struct rtable *rth, 61static inline void multipath_set_nhinfo(struct rtable *rth,
62 __u32 network, __u32 netmask, 62 __be32 network, __be32 netmask,
63 unsigned char prefixlen, 63 unsigned char prefixlen,
64 const struct fib_nh *nh) 64 const struct fib_nh *nh)
65{ 65{
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 3b57b159b653..49c717e3b040 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -100,22 +100,22 @@
100struct ip_vs_service_user { 100struct ip_vs_service_user {
101 /* virtual service addresses */ 101 /* virtual service addresses */
102 u_int16_t protocol; 102 u_int16_t protocol;
103 u_int32_t addr; /* virtual ip address */ 103 __be32 addr; /* virtual ip address */
104 u_int16_t port; 104 __be16 port;
105 u_int32_t fwmark; /* firwall mark of service */ 105 u_int32_t fwmark; /* firwall mark of service */
106 106
107 /* virtual service options */ 107 /* virtual service options */
108 char sched_name[IP_VS_SCHEDNAME_MAXLEN]; 108 char sched_name[IP_VS_SCHEDNAME_MAXLEN];
109 unsigned flags; /* virtual service flags */ 109 unsigned flags; /* virtual service flags */
110 unsigned timeout; /* persistent timeout in sec */ 110 unsigned timeout; /* persistent timeout in sec */
111 u_int32_t netmask; /* persistent netmask */ 111 __be32 netmask; /* persistent netmask */
112}; 112};
113 113
114 114
115struct ip_vs_dest_user { 115struct ip_vs_dest_user {
116 /* destination server address */ 116 /* destination server address */
117 u_int32_t addr; 117 __be32 addr;
118 u_int16_t port; 118 __be16 port;
119 119
120 /* real server options */ 120 /* real server options */
121 unsigned conn_flags; /* connection flags */ 121 unsigned conn_flags; /* connection flags */
@@ -163,15 +163,15 @@ struct ip_vs_getinfo {
163struct ip_vs_service_entry { 163struct ip_vs_service_entry {
164 /* which service: user fills in these */ 164 /* which service: user fills in these */
165 u_int16_t protocol; 165 u_int16_t protocol;
166 u_int32_t addr; /* virtual address */ 166 __be32 addr; /* virtual address */
167 u_int16_t port; 167 __be16 port;
168 u_int32_t fwmark; /* firwall mark of service */ 168 u_int32_t fwmark; /* firwall mark of service */
169 169
170 /* service options */ 170 /* service options */
171 char sched_name[IP_VS_SCHEDNAME_MAXLEN]; 171 char sched_name[IP_VS_SCHEDNAME_MAXLEN];
172 unsigned flags; /* virtual service flags */ 172 unsigned flags; /* virtual service flags */
173 unsigned timeout; /* persistent timeout */ 173 unsigned timeout; /* persistent timeout */
174 u_int32_t netmask; /* persistent netmask */ 174 __be32 netmask; /* persistent netmask */
175 175
176 /* number of real servers */ 176 /* number of real servers */
177 unsigned int num_dests; 177 unsigned int num_dests;
@@ -182,8 +182,8 @@ struct ip_vs_service_entry {
182 182
183 183
184struct ip_vs_dest_entry { 184struct ip_vs_dest_entry {
185 u_int32_t addr; /* destination address */ 185 __be32 addr; /* destination address */
186 u_int16_t port; 186 __be16 port;
187 unsigned conn_flags; /* connection flags */ 187 unsigned conn_flags; /* connection flags */
188 int weight; /* destination weight */ 188 int weight; /* destination weight */
189 189
@@ -203,8 +203,8 @@ struct ip_vs_dest_entry {
203struct ip_vs_get_dests { 203struct ip_vs_get_dests {
204 /* which service: user fills in these */ 204 /* which service: user fills in these */
205 u_int16_t protocol; 205 u_int16_t protocol;
206 u_int32_t addr; /* virtual address */ 206 __be32 addr; /* virtual address */
207 u_int16_t port; 207 __be16 port;
208 u_int32_t fwmark; /* firwall mark of service */ 208 u_int32_t fwmark; /* firwall mark of service */
209 209
210 /* number of real servers */ 210 /* number of real servers */
@@ -502,12 +502,12 @@ struct ip_vs_conn {
502 struct list_head c_list; /* hashed list heads */ 502 struct list_head c_list; /* hashed list heads */
503 503
504 /* Protocol, addresses and port numbers */ 504 /* Protocol, addresses and port numbers */
505 __u32 caddr; /* client address */ 505 __be32 caddr; /* client address */
506 __u32 vaddr; /* virtual address */ 506 __be32 vaddr; /* virtual address */
507 __u32 daddr; /* destination address */ 507 __be32 daddr; /* destination address */
508 __u16 cport; 508 __be16 cport;
509 __u16 vport; 509 __be16 vport;
510 __u16 dport; 510 __be16 dport;
511 __u16 protocol; /* Which protocol (TCP/UDP) */ 511 __u16 protocol; /* Which protocol (TCP/UDP) */
512 512
513 /* counter and timer */ 513 /* counter and timer */
@@ -554,12 +554,12 @@ struct ip_vs_service {
554 atomic_t usecnt; /* use counter */ 554 atomic_t usecnt; /* use counter */
555 555
556 __u16 protocol; /* which protocol (TCP/UDP) */ 556 __u16 protocol; /* which protocol (TCP/UDP) */
557 __u32 addr; /* IP address for virtual service */ 557 __be32 addr; /* IP address for virtual service */
558 __u16 port; /* port number for the service */ 558 __be16 port; /* port number for the service */
559 __u32 fwmark; /* firewall mark of the service */ 559 __u32 fwmark; /* firewall mark of the service */
560 unsigned flags; /* service status flags */ 560 unsigned flags; /* service status flags */
561 unsigned timeout; /* persistent timeout in ticks */ 561 unsigned timeout; /* persistent timeout in ticks */
562 __u32 netmask; /* grouping granularity */ 562 __be32 netmask; /* grouping granularity */
563 563
564 struct list_head destinations; /* real server d-linked list */ 564 struct list_head destinations; /* real server d-linked list */
565 __u32 num_dests; /* number of servers */ 565 __u32 num_dests; /* number of servers */
@@ -581,8 +581,8 @@ struct ip_vs_dest {
581 struct list_head n_list; /* for the dests in the service */ 581 struct list_head n_list; /* for the dests in the service */
582 struct list_head d_list; /* for table with all the dests */ 582 struct list_head d_list; /* for table with all the dests */
583 583
584 __u32 addr; /* IP address of the server */ 584 __be32 addr; /* IP address of the server */
585 __u16 port; /* port number of the server */ 585 __be16 port; /* port number of the server */
586 volatile unsigned flags; /* dest status flags */ 586 volatile unsigned flags; /* dest status flags */
587 atomic_t conn_flags; /* flags to copy to conn */ 587 atomic_t conn_flags; /* flags to copy to conn */
588 atomic_t weight; /* server weight */ 588 atomic_t weight; /* server weight */
@@ -605,8 +605,8 @@ struct ip_vs_dest {
605 /* for virtual service */ 605 /* for virtual service */
606 struct ip_vs_service *svc; /* service it belongs to */ 606 struct ip_vs_service *svc; /* service it belongs to */
607 __u16 protocol; /* which protocol (TCP/UDP) */ 607 __u16 protocol; /* which protocol (TCP/UDP) */
608 __u32 vaddr; /* virtual IP address */ 608 __be32 vaddr; /* virtual IP address */
609 __u16 vport; /* virtual port number */ 609 __be16 vport; /* virtual port number */
610 __u32 vfwmark; /* firewall mark of service */ 610 __u32 vfwmark; /* firewall mark of service */
611}; 611};
612 612
@@ -648,7 +648,7 @@ struct ip_vs_app
648 /* members for application incarnations */ 648 /* members for application incarnations */
649 struct list_head p_list; /* member in proto app list */ 649 struct list_head p_list; /* member in proto app list */
650 struct ip_vs_app *app; /* its real application */ 650 struct ip_vs_app *app; /* its real application */
651 __u16 port; /* port number in net order */ 651 __be16 port; /* port number in net order */
652 atomic_t usecnt; /* usage counter */ 652 atomic_t usecnt; /* usage counter */
653 653
654 /* output hook: return false if can't linearize. diff set for TCP. */ 654 /* output hook: return false if can't linearize. diff set for TCP. */
@@ -740,11 +740,11 @@ enum {
740}; 740};
741 741
742extern struct ip_vs_conn *ip_vs_conn_in_get 742extern struct ip_vs_conn *ip_vs_conn_in_get
743(int protocol, __u32 s_addr, __u16 s_port, __u32 d_addr, __u16 d_port); 743(int protocol, __be32 s_addr, __be16 s_port, __be32 d_addr, __be16 d_port);
744extern struct ip_vs_conn *ip_vs_ct_in_get 744extern struct ip_vs_conn *ip_vs_ct_in_get
745(int protocol, __u32 s_addr, __u16 s_port, __u32 d_addr, __u16 d_port); 745(int protocol, __be32 s_addr, __be16 s_port, __be32 d_addr, __be16 d_port);
746extern struct ip_vs_conn *ip_vs_conn_out_get 746extern struct ip_vs_conn *ip_vs_conn_out_get
747(int protocol, __u32 s_addr, __u16 s_port, __u32 d_addr, __u16 d_port); 747(int protocol, __be32 s_addr, __be16 s_port, __be32 d_addr, __be16 d_port);
748 748
749/* put back the conn without restarting its timer */ 749/* put back the conn without restarting its timer */
750static inline void __ip_vs_conn_put(struct ip_vs_conn *cp) 750static inline void __ip_vs_conn_put(struct ip_vs_conn *cp)
@@ -752,11 +752,11 @@ static inline void __ip_vs_conn_put(struct ip_vs_conn *cp)
752 atomic_dec(&cp->refcnt); 752 atomic_dec(&cp->refcnt);
753} 753}
754extern void ip_vs_conn_put(struct ip_vs_conn *cp); 754extern void ip_vs_conn_put(struct ip_vs_conn *cp);
755extern void ip_vs_conn_fill_cport(struct ip_vs_conn *cp, __u16 cport); 755extern void ip_vs_conn_fill_cport(struct ip_vs_conn *cp, __be16 cport);
756 756
757extern struct ip_vs_conn * 757extern struct ip_vs_conn *
758ip_vs_conn_new(int proto, __u32 caddr, __u16 cport, __u32 vaddr, __u16 vport, 758ip_vs_conn_new(int proto, __be32 caddr, __be16 cport, __be32 vaddr, __be16 vport,
759 __u32 daddr, __u16 dport, unsigned flags, 759 __be32 daddr, __be16 dport, unsigned flags,
760 struct ip_vs_dest *dest); 760 struct ip_vs_dest *dest);
761extern void ip_vs_conn_expire_now(struct ip_vs_conn *cp); 761extern void ip_vs_conn_expire_now(struct ip_vs_conn *cp);
762 762
@@ -887,7 +887,7 @@ extern int sysctl_ip_vs_nat_icmp_send;
887extern struct ip_vs_stats ip_vs_stats; 887extern struct ip_vs_stats ip_vs_stats;
888 888
889extern struct ip_vs_service * 889extern struct ip_vs_service *
890ip_vs_service_get(__u32 fwmark, __u16 protocol, __u32 vaddr, __u16 vport); 890ip_vs_service_get(__u32 fwmark, __u16 protocol, __be32 vaddr, __be16 vport);
891 891
892static inline void ip_vs_service_put(struct ip_vs_service *svc) 892static inline void ip_vs_service_put(struct ip_vs_service *svc)
893{ 893{
@@ -895,7 +895,7 @@ static inline void ip_vs_service_put(struct ip_vs_service *svc)
895} 895}
896 896
897extern struct ip_vs_dest * 897extern struct ip_vs_dest *
898ip_vs_lookup_real_service(__u16 protocol, __u32 daddr, __u16 dport); 898ip_vs_lookup_real_service(__u16 protocol, __be32 daddr, __be16 dport);
899extern int ip_vs_use_count_inc(void); 899extern int ip_vs_use_count_inc(void);
900extern void ip_vs_use_count_dec(void); 900extern void ip_vs_use_count_dec(void);
901extern int ip_vs_control_init(void); 901extern int ip_vs_control_init(void);
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 72bf47b2a4e0..8223c4410b4b 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -318,8 +318,8 @@ static inline void ipv6_addr_prefix(struct in6_addr *pfx,
318 318
319#ifndef __HAVE_ARCH_ADDR_SET 319#ifndef __HAVE_ARCH_ADDR_SET
320static inline void ipv6_addr_set(struct in6_addr *addr, 320static inline void ipv6_addr_set(struct in6_addr *addr,
321 __u32 w1, __u32 w2, 321 __be32 w1, __be32 w2,
322 __u32 w3, __u32 w4) 322 __be32 w3, __be32 w4)
323{ 323{
324 addr->s6_addr32[0] = w1; 324 addr->s6_addr32[0] = w1;
325 addr->s6_addr32[1] = w2; 325 addr->s6_addr32[1] = w2;
@@ -337,7 +337,7 @@ static inline int ipv6_addr_equal(const struct in6_addr *a1,
337 a1->s6_addr32[3] == a2->s6_addr32[3]); 337 a1->s6_addr32[3] == a2->s6_addr32[3]);
338} 338}
339 339
340static inline int __ipv6_prefix_equal(const u32 *a1, const u32 *a2, 340static inline int __ipv6_prefix_equal(const __be32 *a1, const __be32 *a2,
341 unsigned int prefixlen) 341 unsigned int prefixlen)
342{ 342{
343 unsigned pdw, pbi; 343 unsigned pdw, pbi;
diff --git a/include/net/irda/irlan_common.h b/include/net/irda/irlan_common.h
index 1c73bdbc3eb3..9592c374b41d 100644
--- a/include/net/irda/irlan_common.h
+++ b/include/net/irda/irlan_common.h
@@ -98,7 +98,15 @@
98#define IRLAN_SHORT 1 98#define IRLAN_SHORT 1
99#define IRLAN_ARRAY 2 99#define IRLAN_ARRAY 2
100 100
101#define IRLAN_MAX_HEADER (TTP_HEADER+LMP_HEADER+LAP_MAX_HEADER) 101/* IrLAN sits on top if IrTTP */
102#define IRLAN_MAX_HEADER (TTP_HEADER+LMP_HEADER)
103/* 1 byte for the command code and 1 byte for the parameter count */
104#define IRLAN_CMD_HEADER 2
105
106#define IRLAN_STRING_PARAMETER_LEN(name, value) (1 + strlen((name)) + 2 \
107 + strlen ((value)))
108#define IRLAN_BYTE_PARAMETER_LEN(name) (1 + strlen((name)) + 2 + 1)
109#define IRLAN_SHORT_PARAMETER_LEN(name) (1 + strlen((name)) + 2 + 2)
102 110
103/* 111/*
104 * IrLAN client 112 * IrLAN client
diff --git a/include/net/irda/irlap_frame.h b/include/net/irda/irlap_frame.h
index 3452ae257c84..9dd54a5002b2 100644
--- a/include/net/irda/irlap_frame.h
+++ b/include/net/irda/irlap_frame.h
@@ -74,6 +74,19 @@ struct discovery_t;
74 74
75#define PF_BIT 0x10 /* Poll/final bit */ 75#define PF_BIT 0x10 /* Poll/final bit */
76 76
77/* Some IrLAP field lengths */
78/*
79 * Only baud rate triplet is 4 bytes (PV can be 2 bytes).
80 * All others params (7) are 3 bytes, so that's 7*3 + 1*4 bytes.
81 */
82#define IRLAP_NEGOCIATION_PARAMS_LEN 25
83#define IRLAP_DISCOVERY_INFO_LEN 32
84
85struct disc_frame {
86 __u8 caddr; /* Connection address */
87 __u8 control;
88} IRDA_PACK;
89
77struct xid_frame { 90struct xid_frame {
78 __u8 caddr; /* Connection address */ 91 __u8 caddr; /* Connection address */
79 __u8 control; 92 __u8 control;
@@ -95,11 +108,25 @@ struct test_frame {
95struct ua_frame { 108struct ua_frame {
96 __u8 caddr; 109 __u8 caddr;
97 __u8 control; 110 __u8 control;
98
99 __u32 saddr; /* Source device address */ 111 __u32 saddr; /* Source device address */
100 __u32 daddr; /* Dest device address */ 112 __u32 daddr; /* Dest device address */
101} IRDA_PACK; 113} IRDA_PACK;
102 114
115struct dm_frame {
116 __u8 caddr; /* Connection address */
117 __u8 control;
118} IRDA_PACK;
119
120struct rd_frame {
121 __u8 caddr; /* Connection address */
122 __u8 control;
123} IRDA_PACK;
124
125struct rr_frame {
126 __u8 caddr; /* Connection address */
127 __u8 control;
128} IRDA_PACK;
129
103struct i_frame { 130struct i_frame {
104 __u8 caddr; 131 __u8 caddr;
105 __u8 control; 132 __u8 control;
diff --git a/include/net/irda/irlmp.h b/include/net/irda/irlmp.h
index 11ecfa58a648..e212b9bc2503 100644
--- a/include/net/irda/irlmp.h
+++ b/include/net/irda/irlmp.h
@@ -48,7 +48,7 @@
48#define DEV_ADDR_ANY 0xffffffff 48#define DEV_ADDR_ANY 0xffffffff
49 49
50#define LMP_HEADER 2 /* Dest LSAP + Source LSAP */ 50#define LMP_HEADER 2 /* Dest LSAP + Source LSAP */
51#define LMP_CONTROL_HEADER 4 51#define LMP_CONTROL_HEADER 4 /* LMP_HEADER + opcode + parameter */
52#define LMP_PID_HEADER 1 /* Used by Ultra */ 52#define LMP_PID_HEADER 1 /* Used by Ultra */
53#define LMP_MAX_HEADER (LMP_CONTROL_HEADER+LAP_MAX_HEADER) 53#define LMP_MAX_HEADER (LMP_CONTROL_HEADER+LAP_MAX_HEADER)
54 54
diff --git a/include/net/netlabel.h b/include/net/netlabel.h
index 6692430063fd..c63a58058e21 100644
--- a/include/net/netlabel.h
+++ b/include/net/netlabel.h
@@ -92,11 +92,17 @@
92 * 92 *
93 */ 93 */
94 94
95/* NetLabel audit information */
96struct netlbl_audit {
97 u32 secid;
98 uid_t loginuid;
99};
100
95/* Domain mapping definition struct */ 101/* Domain mapping definition struct */
96struct netlbl_dom_map; 102struct netlbl_dom_map;
97 103
98/* Domain mapping operations */ 104/* Domain mapping operations */
99int netlbl_domhsh_remove(const char *domain); 105int netlbl_domhsh_remove(const char *domain, struct netlbl_audit *audit_info);
100 106
101/* LSM security attributes */ 107/* LSM security attributes */
102struct netlbl_lsm_cache { 108struct netlbl_lsm_cache {
diff --git a/include/net/netlink.h b/include/net/netlink.h
index 4ab68a7a636a..ce5cba19c393 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -831,6 +831,9 @@ static inline int nla_put_msecs(struct sk_buff *skb, int attrtype,
831#define NLA_PUT_U32(skb, attrtype, value) \ 831#define NLA_PUT_U32(skb, attrtype, value) \
832 NLA_PUT_TYPE(skb, u32, attrtype, value) 832 NLA_PUT_TYPE(skb, u32, attrtype, value)
833 833
834#define NLA_PUT_BE32(skb, attrtype, value) \
835 NLA_PUT_TYPE(skb, __be32, attrtype, value)
836
834#define NLA_PUT_U64(skb, attrtype, value) \ 837#define NLA_PUT_U64(skb, attrtype, value) \
835 NLA_PUT_TYPE(skb, u64, attrtype, value) 838 NLA_PUT_TYPE(skb, u64, attrtype, value)
836 839
@@ -853,6 +856,15 @@ static inline u32 nla_get_u32(struct nlattr *nla)
853} 856}
854 857
855/** 858/**
859 * nla_get_be32 - return payload of __be32 attribute
860 * @nla: __be32 netlink attribute
861 */
862static inline __be32 nla_get_be32(struct nlattr *nla)
863{
864 return *(__be32 *) nla_data(nla);
865}
866
867/**
856 * nla_get_u16 - return payload of u16 attribute 868 * nla_get_u16 - return payload of u16 attribute
857 * @nla: u16 netlink attribute 869 * @nla: u16 netlink attribute
858 */ 870 */
diff --git a/include/net/route.h b/include/net/route.h
index 7f93ac0e0899..486e37aff06c 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -62,18 +62,18 @@ struct rtable
62 __u16 rt_type; 62 __u16 rt_type;
63 __u16 rt_multipath_alg; 63 __u16 rt_multipath_alg;
64 64
65 __u32 rt_dst; /* Path destination */ 65 __be32 rt_dst; /* Path destination */
66 __u32 rt_src; /* Path source */ 66 __be32 rt_src; /* Path source */
67 int rt_iif; 67 int rt_iif;
68 68
69 /* Info on neighbour */ 69 /* Info on neighbour */
70 __u32 rt_gateway; 70 __be32 rt_gateway;
71 71
72 /* Cache lookup keys */ 72 /* Cache lookup keys */
73 struct flowi fl; 73 struct flowi fl;
74 74
75 /* Miscellaneous cached information */ 75 /* Miscellaneous cached information */
76 __u32 rt_spec_dst; /* RFC1122 specific destination */ 76 __be32 rt_spec_dst; /* RFC1122 specific destination */
77 struct inet_peer *peer; /* long-living peer info */ 77 struct inet_peer *peer; /* long-living peer info */
78}; 78};
79 79
@@ -109,18 +109,18 @@ extern struct ip_rt_acct *ip_rt_acct;
109 109
110struct in_device; 110struct in_device;
111extern int ip_rt_init(void); 111extern int ip_rt_init(void);
112extern void ip_rt_redirect(u32 old_gw, u32 dst, u32 new_gw, 112extern void ip_rt_redirect(__be32 old_gw, __be32 dst, __be32 new_gw,
113 u32 src, struct net_device *dev); 113 __be32 src, struct net_device *dev);
114extern void ip_rt_advice(struct rtable **rp, int advice); 114extern void ip_rt_advice(struct rtable **rp, int advice);
115extern void rt_cache_flush(int how); 115extern void rt_cache_flush(int how);
116extern int __ip_route_output_key(struct rtable **, const struct flowi *flp); 116extern int __ip_route_output_key(struct rtable **, const struct flowi *flp);
117extern int ip_route_output_key(struct rtable **, struct flowi *flp); 117extern int ip_route_output_key(struct rtable **, struct flowi *flp);
118extern int ip_route_output_flow(struct rtable **rp, struct flowi *flp, struct sock *sk, int flags); 118extern int ip_route_output_flow(struct rtable **rp, struct flowi *flp, struct sock *sk, int flags);
119extern int ip_route_input(struct sk_buff*, u32 dst, u32 src, u8 tos, struct net_device *devin); 119extern int ip_route_input(struct sk_buff*, __be32 dst, __be32 src, u8 tos, struct net_device *devin);
120extern unsigned short ip_rt_frag_needed(struct iphdr *iph, unsigned short new_mtu); 120extern unsigned short ip_rt_frag_needed(struct iphdr *iph, unsigned short new_mtu);
121extern void ip_rt_send_redirect(struct sk_buff *skb); 121extern void ip_rt_send_redirect(struct sk_buff *skb);
122 122
123extern unsigned inet_addr_type(u32 addr); 123extern unsigned inet_addr_type(__be32 addr);
124extern void ip_rt_multicast_event(struct in_device *); 124extern void ip_rt_multicast_event(struct in_device *);
125extern int ip_rt_ioctl(unsigned int cmd, void __user *arg); 125extern int ip_rt_ioctl(unsigned int cmd, void __user *arg);
126extern void ip_rt_get_source(u8 *src, struct rtable *rt); 126extern void ip_rt_get_source(u8 *src, struct rtable *rt);
@@ -144,9 +144,9 @@ static inline char rt_tos2priority(u8 tos)
144 return ip_tos2prio[IPTOS_TOS(tos)>>1]; 144 return ip_tos2prio[IPTOS_TOS(tos)>>1];
145} 145}
146 146
147static inline int ip_route_connect(struct rtable **rp, u32 dst, 147static inline int ip_route_connect(struct rtable **rp, __be32 dst,
148 u32 src, u32 tos, int oif, u8 protocol, 148 __be32 src, u32 tos, int oif, u8 protocol,
149 u16 sport, u16 dport, struct sock *sk) 149 __be16 sport, __be16 dport, struct sock *sk)
150{ 150{
151 struct flowi fl = { .oif = oif, 151 struct flowi fl = { .oif = oif,
152 .nl_u = { .ip4_u = { .daddr = dst, 152 .nl_u = { .ip4_u = { .daddr = dst,
@@ -172,7 +172,7 @@ static inline int ip_route_connect(struct rtable **rp, u32 dst,
172} 172}
173 173
174static inline int ip_route_newports(struct rtable **rp, u8 protocol, 174static inline int ip_route_newports(struct rtable **rp, u8 protocol,
175 u16 sport, u16 dport, struct sock *sk) 175 __be16 sport, __be16 dport, struct sock *sk)
176{ 176{
177 if (sport != (*rp)->fl.fl_ip_sport || 177 if (sport != (*rp)->fl.fl_ip_sport ||
178 dport != (*rp)->fl.fl_ip_dport) { 178 dport != (*rp)->fl.fl_ip_dport) {
diff --git a/include/net/sock.h b/include/net/sock.h
index edd4d73ce7f5..40bb90ebb2d1 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -665,7 +665,6 @@ struct sock_iocb {
665 struct sock *sk; 665 struct sock *sk;
666 struct scm_cookie *scm; 666 struct scm_cookie *scm;
667 struct msghdr *msg, async_msg; 667 struct msghdr *msg, async_msg;
668 struct iovec async_iov;
669 struct kiocb *kiocb; 668 struct kiocb *kiocb;
670}; 669};
671 670
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 11e0b1d6bd47..1e2a4ddec96e 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -437,8 +437,8 @@ static inline void xfrm_state_hold(struct xfrm_state *x)
437 437
438static __inline__ int addr_match(void *token1, void *token2, int prefixlen) 438static __inline__ int addr_match(void *token1, void *token2, int prefixlen)
439{ 439{
440 __u32 *a1 = token1; 440 __be32 *a1 = token1;
441 __u32 *a2 = token2; 441 __be32 *a2 = token2;
442 int pdw; 442 int pdw;
443 int pbi; 443 int pbi;
444 444
@@ -450,7 +450,7 @@ static __inline__ int addr_match(void *token1, void *token2, int prefixlen)
450 return 0; 450 return 0;
451 451
452 if (pbi) { 452 if (pbi) {
453 __u32 mask; 453 __be32 mask;
454 454
455 mask = htonl((0xffffffff) << (32 - pbi)); 455 mask = htonl((0xffffffff) << (32 - pbi));
456 456
@@ -462,9 +462,9 @@ static __inline__ int addr_match(void *token1, void *token2, int prefixlen)
462} 462}
463 463
464static __inline__ 464static __inline__
465u16 xfrm_flowi_sport(struct flowi *fl) 465__be16 xfrm_flowi_sport(struct flowi *fl)
466{ 466{
467 u16 port; 467 __be16 port;
468 switch(fl->proto) { 468 switch(fl->proto) {
469 case IPPROTO_TCP: 469 case IPPROTO_TCP:
470 case IPPROTO_UDP: 470 case IPPROTO_UDP:
@@ -487,9 +487,9 @@ u16 xfrm_flowi_sport(struct flowi *fl)
487} 487}
488 488
489static __inline__ 489static __inline__
490u16 xfrm_flowi_dport(struct flowi *fl) 490__be16 xfrm_flowi_dport(struct flowi *fl)
491{ 491{
492 u16 port; 492 __be16 port;
493 switch(fl->proto) { 493 switch(fl->proto) {
494 case IPPROTO_TCP: 494 case IPPROTO_TCP:
495 case IPPROTO_UDP: 495 case IPPROTO_UDP:
@@ -912,7 +912,7 @@ extern int xfrm_state_check_expire(struct xfrm_state *x);
912extern void xfrm_state_insert(struct xfrm_state *x); 912extern void xfrm_state_insert(struct xfrm_state *x);
913extern int xfrm_state_add(struct xfrm_state *x); 913extern int xfrm_state_add(struct xfrm_state *x);
914extern int xfrm_state_update(struct xfrm_state *x); 914extern int xfrm_state_update(struct xfrm_state *x);
915extern struct xfrm_state *xfrm_state_lookup(xfrm_address_t *daddr, u32 spi, u8 proto, unsigned short family); 915extern struct xfrm_state *xfrm_state_lookup(xfrm_address_t *daddr, __be32 spi, u8 proto, unsigned short family);
916extern struct xfrm_state *xfrm_state_lookup_byaddr(xfrm_address_t *daddr, xfrm_address_t *saddr, u8 proto, unsigned short family); 916extern struct xfrm_state *xfrm_state_lookup_byaddr(xfrm_address_t *daddr, xfrm_address_t *saddr, u8 proto, unsigned short family);
917#ifdef CONFIG_XFRM_SUB_POLICY 917#ifdef CONFIG_XFRM_SUB_POLICY
918extern int xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, 918extern int xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src,
@@ -935,8 +935,8 @@ static inline int xfrm_state_sort(struct xfrm_state **dst, struct xfrm_state **s
935extern struct xfrm_state *xfrm_find_acq_byseq(u32 seq); 935extern struct xfrm_state *xfrm_find_acq_byseq(u32 seq);
936extern int xfrm_state_delete(struct xfrm_state *x); 936extern int xfrm_state_delete(struct xfrm_state *x);
937extern void xfrm_state_flush(u8 proto); 937extern void xfrm_state_flush(u8 proto);
938extern int xfrm_replay_check(struct xfrm_state *x, u32 seq); 938extern int xfrm_replay_check(struct xfrm_state *x, __be32 seq);
939extern void xfrm_replay_advance(struct xfrm_state *x, u32 seq); 939extern void xfrm_replay_advance(struct xfrm_state *x, __be32 seq);
940extern void xfrm_replay_notify(struct xfrm_state *x, int event); 940extern void xfrm_replay_notify(struct xfrm_state *x, int event);
941extern int xfrm_state_check(struct xfrm_state *x, struct sk_buff *skb); 941extern int xfrm_state_check(struct xfrm_state *x, struct sk_buff *skb);
942extern int xfrm_state_mtu(struct xfrm_state *x, int mtu); 942extern int xfrm_state_mtu(struct xfrm_state *x, int mtu);
@@ -945,7 +945,7 @@ extern int xfrm4_rcv(struct sk_buff *skb);
945extern int xfrm4_output(struct sk_buff *skb); 945extern int xfrm4_output(struct sk_buff *skb);
946extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler); 946extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler);
947extern int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler); 947extern int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler);
948extern int xfrm6_rcv_spi(struct sk_buff *skb, u32 spi); 948extern int xfrm6_rcv_spi(struct sk_buff *skb, __be32 spi);
949extern int xfrm6_rcv(struct sk_buff **pskb); 949extern int xfrm6_rcv(struct sk_buff **pskb);
950extern int xfrm6_input_addr(struct sk_buff *skb, xfrm_address_t *daddr, 950extern int xfrm6_input_addr(struct sk_buff *skb, xfrm_address_t *daddr,
951 xfrm_address_t *saddr, u8 proto); 951 xfrm_address_t *saddr, u8 proto);
@@ -989,7 +989,7 @@ struct xfrm_policy *xfrm_policy_bysel_ctx(u8 type, int dir,
989struct xfrm_policy *xfrm_policy_byid(u8, int dir, u32 id, int delete); 989struct xfrm_policy *xfrm_policy_byid(u8, int dir, u32 id, int delete);
990void xfrm_policy_flush(u8 type); 990void xfrm_policy_flush(u8 type);
991u32 xfrm_get_acqseq(void); 991u32 xfrm_get_acqseq(void);
992void xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi); 992void xfrm_alloc_spi(struct xfrm_state *x, __be32 minspi, __be32 maxspi);
993struct xfrm_state * xfrm_find_acq(u8 mode, u32 reqid, u8 proto, 993struct xfrm_state * xfrm_find_acq(u8 mode, u32 reqid, u8 proto,
994 xfrm_address_t *daddr, xfrm_address_t *saddr, 994 xfrm_address_t *daddr, xfrm_address_t *saddr,
995 int create, unsigned short family); 995 int create, unsigned short family);
@@ -1004,7 +1004,7 @@ extern void km_policy_expired(struct xfrm_policy *pol, int dir, int hard, u32 pi
1004extern int km_report(u8 proto, struct xfrm_selector *sel, xfrm_address_t *addr); 1004extern int km_report(u8 proto, struct xfrm_selector *sel, xfrm_address_t *addr);
1005 1005
1006extern void xfrm_input_init(void); 1006extern void xfrm_input_init(void);
1007extern int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, u32 *spi, u32 *seq); 1007extern int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, __be32 *spi, __be32 *seq);
1008 1008
1009extern void xfrm_probe_algs(void); 1009extern void xfrm_probe_algs(void);
1010extern int xfrm_count_auth_supported(void); 1010extern int xfrm_count_auth_supported(void);
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index 895d212864cd..b401c82036be 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -298,9 +298,9 @@ extern int scsi_execute_async(struct scsi_device *sdev,
298 void (*done)(void *, char *, int, int), 298 void (*done)(void *, char *, int, int),
299 gfp_t gfp); 299 gfp_t gfp);
300 300
301static inline void scsi_device_reprobe(struct scsi_device *sdev) 301static inline int __must_check scsi_device_reprobe(struct scsi_device *sdev)
302{ 302{
303 device_reprobe(&sdev->sdev_gendev); 303 return device_reprobe(&sdev->sdev_gendev);
304} 304}
305 305
306static inline unsigned int sdev_channel(struct scsi_device *sdev) 306static inline unsigned int sdev_channel(struct scsi_device *sdev)
diff --git a/include/scsi/scsi_tcq.h b/include/scsi/scsi_tcq.h
index d04d05adfa9b..c247a28259bc 100644
--- a/include/scsi/scsi_tcq.h
+++ b/include/scsi/scsi_tcq.h
@@ -6,7 +6,6 @@
6#include <scsi/scsi_device.h> 6#include <scsi/scsi_device.h>
7#include <scsi/scsi_host.h> 7#include <scsi/scsi_host.h>
8 8
9
10#define MSG_SIMPLE_TAG 0x20 9#define MSG_SIMPLE_TAG 0x20
11#define MSG_HEAD_TAG 0x21 10#define MSG_HEAD_TAG 0x21
12#define MSG_ORDERED_TAG 0x22 11#define MSG_ORDERED_TAG 0x22
@@ -14,6 +13,7 @@
14#define SCSI_NO_TAG (-1) /* identify no tag in use */ 13#define SCSI_NO_TAG (-1) /* identify no tag in use */
15 14
16 15
16#ifdef CONFIG_BLOCK
17 17
18/** 18/**
19 * scsi_get_tag_type - get the type of tag the device supports 19 * scsi_get_tag_type - get the type of tag the device supports
@@ -100,7 +100,7 @@ static inline int scsi_populate_tag_msg(struct scsi_cmnd *cmd, char *msg)
100 struct scsi_device *sdev = cmd->device; 100 struct scsi_device *sdev = cmd->device;
101 101
102 if (blk_rq_tagged(req)) { 102 if (blk_rq_tagged(req)) {
103 if (sdev->ordered_tags && req->flags & REQ_HARDBARRIER) 103 if (sdev->ordered_tags && req->cmd_flags & REQ_HARDBARRIER)
104 *msg++ = MSG_ORDERED_TAG; 104 *msg++ = MSG_ORDERED_TAG;
105 else 105 else
106 *msg++ = MSG_SIMPLE_TAG; 106 *msg++ = MSG_SIMPLE_TAG;
@@ -144,4 +144,5 @@ static inline int scsi_init_shared_tag_map(struct Scsi_Host *shost, int depth)
144 return shost->bqt ? 0 : -ENOMEM; 144 return shost->bqt ? 0 : -ENOMEM;
145} 145}
146 146
147#endif /* CONFIG_BLOCK */
147#endif /* _SCSI_SCSI_TCQ_H */ 148#endif /* _SCSI_SCSI_TCQ_H */
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 60d40b34efc0..afaf3e88e086 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -347,6 +347,7 @@ struct snd_pcm_substream {
347 int number; 347 int number;
348 char name[32]; /* substream name */ 348 char name[32]; /* substream name */
349 int stream; /* stream (direction) */ 349 int stream; /* stream (direction) */
350 char latency_id[20]; /* latency identifier */
350 size_t buffer_bytes_max; /* limit ring buffer size */ 351 size_t buffer_bytes_max; /* limit ring buffer size */
351 struct snd_dma_buffer dma_buffer; 352 struct snd_dma_buffer dma_buffer;
352 unsigned int dma_buf_id; 353 unsigned int dma_buf_id;