aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-alpha/page.h3
-rw-r--r--include/asm-alpha/ptrace.h2
-rw-r--r--include/asm-arm/arch-davinci/i2c.h21
-rw-r--r--include/asm-arm/arch-imx/imxfb.h1
-rw-r--r--include/asm-arm/arch-ixp23xx/platform.h6
-rw-r--r--include/asm-arm/arch-ns9xxx/clock.h6
-rw-r--r--include/asm-arm/arch-ns9xxx/gpio.h47
-rw-r--r--include/asm-arm/arch-ns9xxx/hardware.h47
-rw-r--r--include/asm-arm/arch-ns9xxx/regs-board-a9m9750dev.h4
-rw-r--r--include/asm-arm/arch-ns9xxx/system.h4
-rw-r--r--include/asm-arm/arch-omap/blizzard.h12
-rw-r--r--include/asm-arm/arch-omap/board-2430sdp.h44
-rw-r--r--include/asm-arm/arch-omap/board-palmte.h34
-rw-r--r--include/asm-arm/arch-omap/board-palmtt.h23
-rw-r--r--include/asm-arm/arch-omap/board-palmz71.h26
-rw-r--r--include/asm-arm/arch-omap/board-sx1.h46
-rw-r--r--include/asm-arm/arch-omap/board.h4
-rw-r--r--include/asm-arm/arch-omap/dma.h1
-rw-r--r--include/asm-arm/arch-omap/eac.h101
-rw-r--r--include/asm-arm/arch-omap/gpmc.h5
-rw-r--r--include/asm-arm/arch-omap/hardware.h20
-rw-r--r--include/asm-arm/arch-omap/io.h10
-rw-r--r--include/asm-arm/arch-omap/menelaus.h20
-rw-r--r--include/asm-arm/arch-omap/mmc.h66
-rw-r--r--include/asm-arm/arch-omap/mux.h23
-rw-r--r--include/asm-arm/arch-omap/omap24xx.h12
-rw-r--r--include/asm-arm/arch-omap/onenand.h21
-rw-r--r--include/asm-arm/arch-pxa/cm-x270.h50
-rw-r--r--include/asm-arm/arch-pxa/dma.h4
-rw-r--r--include/asm-arm/arch-pxa/gpio.h12
-rw-r--r--include/asm-arm/arch-pxa/hardware.h99
-rw-r--r--include/asm-arm/arch-pxa/irqs.h27
-rw-r--r--include/asm-arm/arch-pxa/memory.h10
-rw-r--r--include/asm-arm/arch-pxa/mfp-pxa300.h574
-rw-r--r--include/asm-arm/arch-pxa/mfp-pxa320.h446
-rw-r--r--include/asm-arm/arch-pxa/mfp.h576
-rw-r--r--include/asm-arm/arch-pxa/pxa-regs.h13
-rw-r--r--include/asm-arm/arch-pxa/pxa3xx-regs.h75
-rw-r--r--include/asm-arm/arch-pxa/pxafb.h7
-rw-r--r--include/asm-arm/arch-pxa/timex.h2
-rw-r--r--include/asm-arm/arch-pxa/zylonite.h35
-rw-r--r--include/asm-arm/arch-rpc/uncompress.h72
-rw-r--r--include/asm-arm/arch-s3c2410/fb.h42
-rw-r--r--include/asm-arm/arch-s3c2410/irqs.h7
-rw-r--r--include/asm-arm/arch-s3c2410/regs-gpio.h10
-rw-r--r--include/asm-arm/arch-s3c2410/regs-power.h5
-rw-r--r--include/asm-arm/arch-s3c2410/regs-s3c2412.h2
-rw-r--r--include/asm-arm/arch-sa1100/SA-1101.h4
-rw-r--r--include/asm-arm/dma-mapping.h14
-rw-r--r--include/asm-arm/hardware/it8152.h99
-rw-r--r--include/asm-arm/io.h8
-rw-r--r--include/asm-arm/kexec.h2
-rw-r--r--include/asm-arm/pci.h7
-rw-r--r--include/asm-arm/unistd.h1
-rw-r--r--include/asm-avr32/kdebug.h16
-rw-r--r--include/asm-avr32/kprobes.h2
-rw-r--r--include/asm-blackfin/mach-bf548/bf54x-lq043.h30
-rw-r--r--include/asm-blackfin/mach-bf548/bf54x_keys.h17
-rw-r--r--include/asm-blackfin/mach-bf548/dma.h1
-rw-r--r--include/asm-blackfin/nand.h47
-rw-r--r--include/asm-frv/system.h5
-rw-r--r--include/asm-frv/thread_info.h5
-rw-r--r--include/asm-frv/tlbflush.h3
-rw-r--r--include/asm-generic/libata-portmap.h5
-rw-r--r--include/asm-generic/memory_model.h6
-rw-r--r--include/asm-generic/pgtable.h4
-rw-r--r--include/asm-generic/vmlinux.lds.h3
-rw-r--r--include/asm-ia64/dma-mapping.h1
-rw-r--r--include/asm-ia64/kdebug.h15
-rw-r--r--include/asm-ia64/kprobes.h2
-rw-r--r--include/asm-ia64/mca.h2
-rw-r--r--include/asm-ia64/pgtable.h50
-rw-r--r--include/asm-ia64/sal.h15
-rw-r--r--include/asm-ia64/scatterlist.h2
-rw-r--r--include/asm-ia64/smp.h2
-rw-r--r--include/asm-ia64/topology.h2
-rw-r--r--include/asm-m32r/ptrace.h5
-rw-r--r--include/asm-m32r/thread_info.h5
-rw-r--r--include/asm-m68k/Kbuild1
-rw-r--r--include/asm-m68k/unistd.h3
-rw-r--r--include/asm-m68knommu/system.h3
-rw-r--r--include/asm-mips/fw/cfe/cfe_api.h2
-rw-r--r--include/asm-mips/ip32/ip32_ints.h158
-rw-r--r--include/asm-mips/lasat/lasatint.h9
-rw-r--r--include/asm-mips/mach-au1x00/au1000.h23
-rw-r--r--include/asm-mips/mach-au1x00/prom.h13
-rw-r--r--include/asm-mips/pmc-sierra/msp71xx/war.h28
-rw-r--r--include/asm-mips/ptrace.h4
-rw-r--r--include/asm-mips/xxs1500.h35
-rw-r--r--include/asm-powerpc/dcr-mmio.h6
-rw-r--r--include/asm-powerpc/dcr-native.h6
-rw-r--r--include/asm-powerpc/dma-mapping.h158
-rw-r--r--include/asm-powerpc/io.h4
-rw-r--r--include/asm-powerpc/kdebug.h19
-rw-r--r--include/asm-powerpc/kprobes.h2
-rw-r--r--include/asm-powerpc/of_device.h2
-rw-r--r--include/asm-powerpc/pgtable-ppc64.h8
-rw-r--r--include/asm-powerpc/ps3av.h33
-rw-r--r--include/asm-powerpc/scatterlist.h2
-rw-r--r--include/asm-powerpc/smp.h4
-rw-r--r--include/asm-powerpc/topology.h2
-rw-r--r--include/asm-s390/cache.h2
-rw-r--r--include/asm-s390/ccwdev.h77
-rw-r--r--include/asm-s390/ccwgroup.h32
-rw-r--r--include/asm-s390/cio.h288
-rw-r--r--include/asm-s390/cmb.h73
-rw-r--r--include/asm-s390/kdebug.h15
-rw-r--r--include/asm-s390/kprobes.h2
-rw-r--r--include/asm-s390/page.h3
-rw-r--r--include/asm-s390/pgtable.h13
-rw-r--r--include/asm-s390/s390_ext.h8
-rw-r--r--include/asm-s390/system.h24
-rw-r--r--include/asm-s390/zcrypt.h4
-rw-r--r--include/asm-sh/cacheflush.h33
-rw-r--r--include/asm-sh/cpu-sh3/cache.h4
-rw-r--r--include/asm-sh/cpu-sh3/dma.h13
-rw-r--r--include/asm-sh/cpu-sh3/gpio.h66
-rw-r--r--include/asm-sh/cpu-sh3/mmu_context.h9
-rw-r--r--include/asm-sh/cpu-sh3/timer.h9
-rw-r--r--include/asm-sh/cpu-sh3/ubc.h3
-rw-r--r--include/asm-sh/cpu-sh4/dma.h2
-rw-r--r--include/asm-sh/cpu-sh4/mmu_context.h14
-rw-r--r--include/asm-sh/dma.h5
-rw-r--r--include/asm-sh/dreamcast/maple.h37
-rw-r--r--include/asm-sh/gpio.h19
-rw-r--r--include/asm-sh/hd64461.h1
-rw-r--r--include/asm-sh/heartbeat.h17
-rw-r--r--include/asm-sh/hw_irq.h53
-rw-r--r--include/asm-sh/ilsel.h45
-rw-r--r--include/asm-sh/io.h26
-rw-r--r--include/asm-sh/kdebug.h2
-rw-r--r--include/asm-sh/kgdb.h24
-rw-r--r--include/asm-sh/magicpanelr2.h67
-rw-r--r--include/asm-sh/page.h10
-rw-r--r--include/asm-sh/pgtable.h115
-rw-r--r--include/asm-sh/processor.h11
-rw-r--r--include/asm-sh/r7780rp.h33
-rw-r--r--include/asm-sh/rtc.h6
-rw-r--r--include/asm-sh/rts7751r2d.h65
-rw-r--r--include/asm-sh/sections.h1
-rw-r--r--include/asm-sh/sh03/io.h9
-rw-r--r--include/asm-sh/smp.h34
-rw-r--r--include/asm-sh/snapgear.h12
-rw-r--r--include/asm-sh/spinlock.h181
-rw-r--r--include/asm-sh/spinlock_types.h11
-rw-r--r--include/asm-sh/system.h1
-rw-r--r--include/asm-sh/voyagergx.h39
-rw-r--r--include/asm-sh64/gpio.h8
-rw-r--r--include/asm-sh64/io.h7
-rw-r--r--include/asm-sparc/irqflags.h39
-rw-r--r--include/asm-sparc/scatterlist.h2
-rw-r--r--include/asm-sparc/system.h22
-rw-r--r--include/asm-sparc64/cpudata.h21
-rw-r--r--include/asm-sparc64/irq.h13
-rw-r--r--include/asm-sparc64/kdebug.h18
-rw-r--r--include/asm-sparc64/kprobes.h3
-rw-r--r--include/asm-sparc64/pgtable.h3
-rw-r--r--include/asm-sparc64/scatterlist.h2
-rw-r--r--include/asm-sparc64/smp.h3
-rw-r--r--include/asm-sparc64/topology.h2
-rw-r--r--include/asm-um/a.out.h12
-rw-r--r--include/asm-um/elf-i386.h12
-rw-r--r--include/asm-um/elf-x86_64.h56
-rw-r--r--include/asm-um/ldt.h4
-rw-r--r--include/asm-um/mmu_context.h43
-rw-r--r--include/asm-um/page.h1
-rw-r--r--include/asm-um/pgalloc.h2
-rw-r--r--include/asm-um/pgtable-3level.h2
-rw-r--r--include/asm-um/processor-generic.h48
-rw-r--r--include/asm-um/processor-x86_64.h2
-rw-r--r--include/asm-um/ptrace-generic.h17
-rw-r--r--include/asm-um/ptrace-i386.h42
-rw-r--r--include/asm-um/ptrace-x86_64.h13
-rw-r--r--include/asm-um/smp.h2
-rw-r--r--include/asm-um/tlbflush.h19
-rw-r--r--include/asm-um/uaccess.h2
-rw-r--r--include/asm-x86/8253pit.h5
-rw-r--r--include/asm-x86/8253pit_32.h12
-rw-r--r--include/asm-x86/8253pit_64.h10
-rw-r--r--include/asm-x86/apic_64.h8
-rw-r--r--include/asm-x86/cpufeature_32.h1
-rw-r--r--include/asm-x86/cpufeature_64.h2
-rw-r--r--include/asm-x86/dma-mapping_32.h13
-rw-r--r--include/asm-x86/dma-mapping_64.h3
-rw-r--r--include/asm-x86/geode.h50
-rw-r--r--include/asm-x86/hardirq_32.h1
-rw-r--r--include/asm-x86/hpet.h96
-rw-r--r--include/asm-x86/hpet_32.h90
-rw-r--r--include/asm-x86/hpet_64.h18
-rw-r--r--include/asm-x86/i8253.h20
-rw-r--r--include/asm-x86/i8253_32.h17
-rw-r--r--include/asm-x86/i8253_64.h6
-rw-r--r--include/asm-x86/io_apic_32.h16
-rw-r--r--include/asm-x86/irqflags_32.h13
-rw-r--r--include/asm-x86/irqflags_64.h14
-rw-r--r--include/asm-x86/kdebug_32.h6
-rw-r--r--include/asm-x86/kdebug_64.h6
-rw-r--r--include/asm-x86/kprobes_32.h4
-rw-r--r--include/asm-x86/kprobes_64.h2
-rw-r--r--include/asm-x86/page_64.h1
-rw-r--r--include/asm-x86/pci.h90
-rw-r--r--include/asm-x86/pci_32.h58
-rw-r--r--include/asm-x86/pci_64.h56
-rw-r--r--include/asm-x86/pda.h1
-rw-r--r--include/asm-x86/pgtable_64.h1
-rw-r--r--include/asm-x86/processor-flags.h2
-rw-r--r--include/asm-x86/proto.h7
-rw-r--r--include/asm-x86/scatterlist_32.h2
-rw-r--r--include/asm-x86/scatterlist_64.h2
-rw-r--r--include/asm-x86/smp_32.h4
-rw-r--r--include/asm-x86/smp_64.h11
-rw-r--r--include/asm-x86/system_32.h19
-rw-r--r--include/asm-x86/system_64.h10
-rw-r--r--include/asm-x86/timex.h19
-rw-r--r--include/asm-x86/timex_32.h22
-rw-r--r--include/asm-x86/timex_64.h31
-rw-r--r--include/asm-x86/topology_32.h4
-rw-r--r--include/asm-x86/topology_64.h4
-rw-r--r--include/asm-x86/tsc.h15
-rw-r--r--include/asm-x86/vsyscall.h3
-rw-r--r--include/linux/agpgart.h2
-rw-r--r--include/linux/ata.h116
-rw-r--r--include/linux/bio.h19
-rw-r--r--include/linux/bitops.h6
-rw-r--r--include/linux/blkdev.h22
-rw-r--r--include/linux/blktrace_api.h7
-rw-r--r--include/linux/buffer_head.h26
-rw-r--r--include/linux/clockchips.h10
-rw-r--r--include/linux/connector.h7
-rw-r--r--include/linux/console.h3
-rw-r--r--include/linux/console_struct.h1
-rw-r--r--include/linux/cpufreq.h39
-rw-r--r--include/linux/cpuset.h2
-rw-r--r--include/linux/dca.h47
-rw-r--r--include/linux/debugfs.h27
-rw-r--r--include/linux/device.h17
-rw-r--r--include/linux/dma-mapping.h7
-rw-r--r--include/linux/fb.h3
-rw-r--r--include/linux/fs.h106
-rw-r--r--include/linux/gfp.h62
-rw-r--r--include/linux/gfs2_ondisk.h30
-rw-r--r--include/linux/gpio_keys.h1
-rw-r--r--include/linux/hdlcdrv.h2
-rw-r--r--include/linux/hid.h27
-rw-r--r--include/linux/hidraw.h86
-rw-r--r--include/linux/hugetlb.h1
-rw-r--r--include/linux/hwmon.h4
-rw-r--r--include/linux/i2c-dev.h31
-rw-r--r--include/linux/i2c-id.h1
-rw-r--r--include/linux/i2c.h102
-rw-r--r--include/linux/i2o.h3
-rw-r--r--include/linux/ide.h42
-rw-r--r--include/linux/if_bridge.h2
-rw-r--r--include/linux/inet_lro.h8
-rw-r--r--include/linux/init.h2
-rw-r--r--include/linux/input.h118
-rw-r--r--include/linux/interrupt.h9
-rw-r--r--include/linux/ioport.h3
-rw-r--r--include/linux/isdn.h4
-rw-r--r--include/linux/jbd.h6
-rw-r--r--include/linux/jffs2.h1
-rw-r--r--include/linux/jiffies.h12
-rw-r--r--include/linux/kernel.h15
-rw-r--r--include/linux/kernel_stat.h1
-rw-r--r--include/linux/keyboard.h4
-rw-r--r--include/linux/kobject.h125
-rw-r--r--include/linux/kprobes.h6
-rw-r--r--include/linux/kvm.h128
-rw-r--r--include/linux/libata.h336
-rw-r--r--include/linux/lockdep.h9
-rw-r--r--include/linux/maple.h80
-rw-r--r--include/linux/memory_hotplug.h18
-rw-r--r--include/linux/mempolicy.h7
-rw-r--r--include/linux/mm.h97
-rw-r--r--include/linux/mm_types.h158
-rw-r--r--include/linux/mmzone.h68
-rw-r--r--include/linux/mod_devicetable.h5
-rw-r--r--include/linux/mtd/cfi.h9
-rw-r--r--include/linux/mtd/flashchip.h1
-rw-r--r--include/linux/mtd/map.h10
-rw-r--r--include/linux/mtd/mtd.h7
-rw-r--r--include/linux/mtd/nand.h1
-rw-r--r--include/linux/mtd/onenand.h12
-rw-r--r--include/linux/mtd/onenand_regs.h4
-rw-r--r--include/linux/mutex.h9
-rw-r--r--include/linux/netdevice.h1
-rw-r--r--include/linux/netfilter.h26
-rw-r--r--include/linux/netfilter/nf_conntrack_amanda.h2
-rw-r--r--include/linux/netfilter/nf_conntrack_ftp.h2
-rw-r--r--include/linux/netfilter/nf_conntrack_h323.h18
-rw-r--r--include/linux/netfilter/nf_conntrack_irc.h2
-rw-r--r--include/linux/netfilter/nf_conntrack_pptp.h4
-rw-r--r--include/linux/netfilter/nf_conntrack_sip.h4
-rw-r--r--include/linux/netfilter/nf_conntrack_tftp.h2
-rw-r--r--include/linux/netfilter/x_tables.h2
-rw-r--r--include/linux/netfilter_arp/arp_tables.h2
-rw-r--r--include/linux/netfilter_bridge/ebtables.h4
-rw-r--r--include/linux/netfilter_ipv4.h4
-rw-r--r--include/linux/netfilter_ipv4/ip_tables.h2
-rw-r--r--include/linux/netfilter_ipv6/ip6_tables.h2
-rw-r--r--include/linux/nfs_fs.h78
-rw-r--r--include/linux/nfs_page.h1
-rw-r--r--include/linux/nfs_xdr.h6
-rw-r--r--include/linux/nfsd/export.h11
-rw-r--r--include/linux/nfsd/nfsd.h18
-rw-r--r--include/linux/nfsd/nfsfh.h42
-rw-r--r--include/linux/nfsd/xdr4.h4
-rw-r--r--include/linux/nodemask.h94
-rw-r--r--include/linux/page-isolation.h37
-rw-r--r--include/linux/pageblock-flags.h75
-rw-r--r--include/linux/pagemap.h36
-rw-r--r--include/linux/pci.h7
-rw-r--r--include/linux/pci_ids.h14
-rw-r--r--include/linux/pci_regs.h8
-rw-r--r--include/linux/platform_device.h7
-rw-r--r--include/linux/radix-tree.h40
-rw-r--r--include/linux/rcupdate.h14
-rw-r--r--include/linux/reiserfs_fs_sb.h4
-rw-r--r--include/linux/scatterlist.h84
-rw-r--r--include/linux/sched.h176
-rw-r--r--include/linux/scx200_gpio.h8
-rw-r--r--include/linux/selection.h1
-rw-r--r--include/linux/serial_core.h3
-rw-r--r--include/linux/skbuff.h6
-rw-r--r--include/linux/slab.h4
-rw-r--r--include/linux/slub_def.h71
-rw-r--r--include/linux/sm501-regs.h18
-rw-r--r--include/linux/spi/at73c213.h25
-rw-r--r--include/linux/spi/spi.h12
-rw-r--r--include/linux/stallion.h2
-rw-r--r--include/linux/sunrpc/cache.h10
-rw-r--r--include/linux/sunrpc/clnt.h2
-rw-r--r--include/linux/sunrpc/debug.h5
-rw-r--r--include/linux/sunrpc/msg_prot.h13
-rw-r--r--include/linux/sunrpc/rpc_rdma.h116
-rw-r--r--include/linux/sunrpc/xdr.h5
-rw-r--r--include/linux/sunrpc/xprt.h42
-rw-r--r--include/linux/sunrpc/xprtrdma.h85
-rw-r--r--include/linux/sunrpc/xprtsock.h51
-rw-r--r--include/linux/sysfs.h147
-rw-r--r--include/linux/tcp.h2
-rw-r--r--include/linux/topology.h5
-rw-r--r--include/linux/tty.h1
-rw-r--r--include/linux/usb.h79
-rw-r--r--include/linux/usb/gadget.h (renamed from include/linux/usb_gadget.h)97
-rw-r--r--include/linux/usb/quirks.h7
-rw-r--r--include/linux/usb/serial.h20
-rw-r--r--include/linux/usb_sl811.h26
-rw-r--r--include/linux/video_output.h4
-rw-r--r--include/linux/writeback.h2
-rw-r--r--include/media/videobuf-core.h2
-rw-r--r--include/net/inet_frag.h60
-rw-r--r--include/net/ip.h13
-rw-r--r--include/net/ip_vs.h13
-rw-r--r--include/net/ipv6.h21
-rw-r--r--include/net/netfilter/ipv6/nf_conntrack_ipv6.h5
-rw-r--r--include/net/netfilter/nf_conntrack_core.h10
-rw-r--r--include/net/netfilter/nf_conntrack_helper.h2
-rw-r--r--include/net/netfilter/nf_nat_core.h4
-rw-r--r--include/net/netfilter/nf_nat_helper.h6
-rw-r--r--include/net/netfilter/nf_nat_protocol.h2
-rw-r--r--include/net/netfilter/nf_nat_rule.h2
-rw-r--r--include/net/protocol.h2
-rw-r--r--include/net/xfrm.h2
-rw-r--r--include/pcmcia/ds.h1
-rw-r--r--include/scsi/libsrp.h2
-rw-r--r--include/scsi/scsi.h7
-rw-r--r--include/scsi/scsi_cmnd.h20
-rw-r--r--include/scsi/scsi_dbg.h2
-rw-r--r--include/scsi/scsi_driver.h10
-rw-r--r--include/scsi/scsi_eh.h23
-rw-r--r--include/scsi/scsi_host.h27
-rw-r--r--include/scsi/scsi_tgt.h8
-rw-r--r--include/scsi/scsi_tgt_if.h35
-rw-r--r--include/scsi/scsi_transport.h12
-rw-r--r--include/scsi/scsi_transport_fc.h6
-rw-r--r--include/scsi/scsi_transport_iscsi.h2
-rw-r--r--include/scsi/scsi_transport_srp.h39
-rw-r--r--include/scsi/sd.h14
-rw-r--r--include/sound/ac97_codec.h8
-rw-r--r--include/sound/ad1848.h5
-rw-r--r--include/sound/ainstr_gf1.h2
-rw-r--r--include/sound/ainstr_iw.h2
-rw-r--r--include/sound/ainstr_simple.h2
-rw-r--r--include/sound/ak4114.h2
-rw-r--r--include/sound/ak4117.h2
-rw-r--r--include/sound/ak4531_codec.h2
-rw-r--r--include/sound/ak4xxx-adda.h2
-rw-r--r--include/sound/asequencer.h2
-rw-r--r--include/sound/asound.h3
-rw-r--r--include/sound/asound_fm.h2
-rw-r--r--include/sound/asoundef.h2
-rw-r--r--include/sound/control.h10
-rw-r--r--include/sound/core.h2
-rw-r--r--include/sound/cs4231-regs.h180
-rw-r--r--include/sound/cs4231.h159
-rw-r--r--include/sound/cs46xx.h2
-rw-r--r--include/sound/cs46xx_dsp_scb_types.h2
-rw-r--r--include/sound/cs46xx_dsp_spos.h2
-rw-r--r--include/sound/cs46xx_dsp_task_types.h2
-rw-r--r--include/sound/cs8403.h2
-rw-r--r--include/sound/cs8427.h2
-rw-r--r--include/sound/driver.h2
-rw-r--r--include/sound/emu10k1.h15
-rw-r--r--include/sound/es1688.h2
-rw-r--r--include/sound/gus.h2
-rw-r--r--include/sound/hda_hwdep.h44
-rw-r--r--include/sound/hdspm.h16
-rw-r--r--include/sound/hwdep.h2
-rw-r--r--include/sound/info.h2
-rw-r--r--include/sound/initval.h2
-rw-r--r--include/sound/memalloc.h2
-rw-r--r--include/sound/mixer_oss.h2
-rw-r--r--include/sound/mpu401.h3
-rw-r--r--include/sound/opl3.h2
-rw-r--r--include/sound/pcm-indirect.h2
-rw-r--r--include/sound/pcm.h13
-rw-r--r--include/sound/pcm_oss.h2
-rw-r--r--include/sound/rawmidi.h2
-rw-r--r--include/sound/sb.h2
-rw-r--r--include/sound/seq_instr.h2
-rw-r--r--include/sound/seq_midi_event.h2
-rw-r--r--include/sound/seq_virmidi.h2
-rw-r--r--include/sound/soc.h3
-rw-r--r--include/sound/tea575x-tuner.h2
-rw-r--r--include/sound/timer.h2
-rw-r--r--include/sound/tlv.h2
-rw-r--r--include/sound/version.h4
-rw-r--r--include/sound/ymfpci.h2
-rw-r--r--include/video/Kbuild2
-rw-r--r--include/video/mbxfb.h53
-rw-r--r--include/video/permedia2.h17
-rw-r--r--include/video/pm3fb.h1272
-rw-r--r--include/video/tdfx.h270
-rw-r--r--include/video/uvesafb.h193
435 files changed, 8944 insertions, 3883 deletions
diff --git a/include/asm-alpha/page.h b/include/asm-alpha/page.h
index bae7f05716d4..8cc97bfd3789 100644
--- a/include/asm-alpha/page.h
+++ b/include/asm-alpha/page.h
@@ -3,11 +3,12 @@
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#include <linux/const.h>
6#include <asm/pal.h> 7#include <asm/pal.h>
7 8
8/* PAGE_SHIFT determines the page size */ 9/* PAGE_SHIFT determines the page size */
9#define PAGE_SHIFT 13 10#define PAGE_SHIFT 13
10#define PAGE_SIZE (1UL << PAGE_SHIFT) 11#define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT)
11#define PAGE_MASK (~(PAGE_SIZE-1)) 12#define PAGE_MASK (~(PAGE_SIZE-1))
12 13
13#ifndef __ASSEMBLY__ 14#ifndef __ASSEMBLY__
diff --git a/include/asm-alpha/ptrace.h b/include/asm-alpha/ptrace.h
index 9933b8b3612e..32c7a5cddd59 100644
--- a/include/asm-alpha/ptrace.h
+++ b/include/asm-alpha/ptrace.h
@@ -68,8 +68,6 @@ struct switch_stack {
68 68
69#ifdef __KERNEL__ 69#ifdef __KERNEL__
70 70
71#define __ARCH_SYS_PTRACE 1
72
73#define user_mode(regs) (((regs)->ps & 8) != 0) 71#define user_mode(regs) (((regs)->ps & 8) != 0)
74#define instruction_pointer(regs) ((regs)->pc) 72#define instruction_pointer(regs) ((regs)->pc)
75#define profile_pc(regs) instruction_pointer(regs) 73#define profile_pc(regs) instruction_pointer(regs)
diff --git a/include/asm-arm/arch-davinci/i2c.h b/include/asm-arm/arch-davinci/i2c.h
new file mode 100644
index 000000000000..e2f54168abd1
--- /dev/null
+++ b/include/asm-arm/arch-davinci/i2c.h
@@ -0,0 +1,21 @@
1/*
2 * DaVinci I2C controller platfrom_device info
3 *
4 * Author: Vladimir Barinov, MontaVista Software, Inc. <source@mvista.com>
5 *
6 * 2007 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10*/
11
12#ifndef __ASM_ARCH_I2C_H
13#define __ASM_ARCH_I2C_H
14
15/* All frequencies are expressed in kHz */
16struct davinci_i2c_platform_data {
17 unsigned int bus_freq; /* standard bus frequency */
18 unsigned int bus_delay; /* transaction delay */
19};
20
21#endif /* __ASM_ARCH_I2C_H */
diff --git a/include/asm-arm/arch-imx/imxfb.h b/include/asm-arm/arch-imx/imxfb.h
index 7dbc7bbba65d..3ed9ec8b9f00 100644
--- a/include/asm-arm/arch-imx/imxfb.h
+++ b/include/asm-arm/arch-imx/imxfb.h
@@ -7,6 +7,7 @@ struct imxfb_mach_info {
7 u_short xres; 7 u_short xres;
8 u_short yres; 8 u_short yres;
9 9
10 u_int nonstd;
10 u_char bpp; 11 u_char bpp;
11 u_char hsync_len; 12 u_char hsync_len;
12 u_char left_margin; 13 u_char left_margin;
diff --git a/include/asm-arm/arch-ixp23xx/platform.h b/include/asm-arm/arch-ixp23xx/platform.h
index 56e16d66645a..db8aa304c93d 100644
--- a/include/asm-arm/arch-ixp23xx/platform.h
+++ b/include/asm-arm/arch-ixp23xx/platform.h
@@ -14,17 +14,17 @@
14 14
15#ifndef __ASSEMBLY__ 15#ifndef __ASSEMBLY__
16 16
17extern inline unsigned long ixp2000_reg_read(volatile void *reg) 17static inline unsigned long ixp2000_reg_read(volatile void *reg)
18{ 18{
19 return *((volatile unsigned long *)reg); 19 return *((volatile unsigned long *)reg);
20} 20}
21 21
22extern inline void ixp2000_reg_write(volatile void *reg, unsigned long val) 22static inline void ixp2000_reg_write(volatile void *reg, unsigned long val)
23{ 23{
24 *((volatile unsigned long *)reg) = val; 24 *((volatile unsigned long *)reg) = val;
25} 25}
26 26
27extern inline void ixp2000_reg_wrb(volatile void *reg, unsigned long val) 27static inline void ixp2000_reg_wrb(volatile void *reg, unsigned long val)
28{ 28{
29 *((volatile unsigned long *)reg) = val; 29 *((volatile unsigned long *)reg) = val;
30} 30}
diff --git a/include/asm-arm/arch-ns9xxx/clock.h b/include/asm-arm/arch-ns9xxx/clock.h
index bf30cbdcc2bf..b943d3a92a1d 100644
--- a/include/asm-arm/arch-ns9xxx/clock.h
+++ b/include/asm-arm/arch-ns9xxx/clock.h
@@ -19,7 +19,7 @@
19static inline u32 ns9xxx_systemclock(void) __attribute__((const)); 19static inline u32 ns9xxx_systemclock(void) __attribute__((const));
20static inline u32 ns9xxx_systemclock(void) 20static inline u32 ns9xxx_systemclock(void)
21{ 21{
22 u32 pll = SYS_PLL; 22 u32 pll = __raw_readl(SYS_PLL);
23 23
24 /* 24 /*
25 * The system clock should be a multiple of HZ * TIMERCLOCKSELECT (in 25 * The system clock should be a multiple of HZ * TIMERCLOCKSELECT (in
@@ -46,8 +46,8 @@ static inline u32 ns9xxx_systemclock(void)
46 * 46 *
47 * Fine. 47 * Fine.
48 */ 48 */
49 return CRYSTAL * (REGGET(pll, SYS_PLL, ND) + 1) 49 return CRYSTAL * (REGGETIM(pll, SYS_PLL, ND) + 1)
50 >> REGGET(pll, SYS_PLL, FS); 50 >> REGGETIM(pll, SYS_PLL, FS);
51} 51}
52 52
53static inline u32 ns9xxx_cpuclock(void) __attribute__((const)); 53static inline u32 ns9xxx_cpuclock(void) __attribute__((const));
diff --git a/include/asm-arm/arch-ns9xxx/gpio.h b/include/asm-arm/arch-ns9xxx/gpio.h
new file mode 100644
index 000000000000..adbca08583c0
--- /dev/null
+++ b/include/asm-arm/arch-ns9xxx/gpio.h
@@ -0,0 +1,47 @@
1/*
2 * include/asm-arm/arch-ns9xxx/gpio.h
3 *
4 * Copyright (C) 2007 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10*/
11#ifndef __ASM_ARCH_GPIO_H
12#define __ASM_ARCH_GPIO_H
13
14#include <asm/errno.h>
15
16int gpio_request(unsigned gpio, const char *label);
17
18void gpio_free(unsigned gpio);
19
20int ns9xxx_gpio_configure(unsigned gpio, int inv, int func);
21
22int gpio_direction_input(unsigned gpio);
23
24int gpio_direction_output(unsigned gpio, int value);
25
26int gpio_get_value(unsigned gpio);
27
28void gpio_set_value(unsigned gpio, int value);
29
30/*
31 * ns9xxx can use gpio pins to trigger an irq, but it's not generic
32 * enough to be supported by the gpio_to_irq/irq_to_gpio interface
33 */
34static inline int gpio_to_irq(unsigned gpio)
35{
36 return -EINVAL;
37}
38
39static inline int irq_to_gpio(unsigned irq)
40{
41 return -EINVAL;
42}
43
44/* get the cansleep() stubs */
45#include <asm-generic/gpio.h>
46
47#endif /* ifndef __ASM_ARCH_GPIO_H */
diff --git a/include/asm-arm/arch-ns9xxx/hardware.h b/include/asm-arm/arch-ns9xxx/hardware.h
index 25600554c4fe..0b7b34603f1c 100644
--- a/include/asm-arm/arch-ns9xxx/hardware.h
+++ b/include/asm-arm/arch-ns9xxx/hardware.h
@@ -27,42 +27,53 @@
27#define io_v2p(x) ((((x) & 0x0f000000) << 4) \ 27#define io_v2p(x) ((((x) & 0x0f000000) << 4) \
28 + ((x) & 0x00ffffff)) 28 + ((x) & 0x00ffffff))
29 29
30#define __REGSHIFT(mask) ((mask) & (-(mask)))
31
30#define __REGBIT(bit) ((u32)1 << (bit)) 32#define __REGBIT(bit) ((u32)1 << (bit))
31#define __REGBITS(hbit, lbit) ((((u32)1 << ((hbit) - (lbit) + 1)) - 1) << (lbit)) 33#define __REGBITS(hbit, lbit) ((((u32)1 << ((hbit) - (lbit) + 1)) - 1) << (lbit))
32#define __REGVAL(mask, value) (((value) * ((mask) & (-(mask))) & (mask))) 34#define __REGVAL(mask, value) (((value) * __REGSHIFT(mask)) & (mask))
33 35
34#ifndef __ASSEMBLY__ 36#ifndef __ASSEMBLY__
35 37
36# define __REG(x) (*((volatile u32 *)io_p2v((x)))) 38# define __REG(x) ((void __iomem __force *)io_p2v((x)))
37# define __REG2(x, y) (*((volatile u32 *)io_p2v((x)) + (y))) 39# define __REG2(x, y) ((void __iomem __force *)(io_p2v((x)) + 4 * (y)))
38 40
39# define __REGB(x) (*((volatile u8 *)io_p2v((x)))) 41# define __REGSET(var, field, value) \
40# define __REGB2(x) (*((volatile u8 *)io_p2v((x)) + (y))) 42 ((var) = (((var) & ~((field) & ~(value))) | (value)))
41 43
42# define REGSET(var, reg, field, value) \ 44# define REGSET(var, reg, field, value) \
43 ((var) = (((var) \ 45 __REGSET(var, reg ## _ ## field, reg ## _ ## field ## _ ## value)
44 & ~(reg ## _ ## field & \ 46
45 ~ reg ## _ ## field ## _ ## value)) \ 47# define REGSET_IDX(var, reg, field, idx, value) \
46 | (reg ## _ ## field ## _ ## value))) 48 __REGSET(var, reg ## _ ## field((idx)), reg ## _ ## field ## _ ## value((idx)))
47 49
48# define REGSETIM(var, reg, field, value) \ 50# define REGSETIM(var, reg, field, value) \
49 ((var) = (((var) \ 51 __REGSET(var, reg ## _ ## field, __REGVAL(reg ## _ ## field, (value)))
50 & ~(reg ## _ ## field & \ 52
51 ~(__REGVAL(reg ## _ ## field, value)))) \ 53# define REGSETIM_IDX(var, reg, field, idx, value) \
52 | (__REGVAL(reg ## _ ## field, value)))) 54 __REGSET(var, reg ## _ ## field((idx)), __REGVAL(reg ## _ ## field((idx)), (value)))
55
56# define __REGGET(var, field) \
57 (((var) & (field)))
53 58
54# define REGGET(var, reg, field) \ 59# define REGGET(var, reg, field) \
55 ((var & (reg ## _ ## field)) / \ 60 __REGGET(var, reg ## _ ## field)
56 ((reg ## _ ## field) & (-(reg ## _ ## field)))) 61
62# define REGGET_IDX(var, reg, field, idx) \
63 __REGGET(var, reg ## _ ## field((idx)))
64
65# define REGGETIM(var, reg, field) \
66 __REGGET(var, reg ## _ ## field) / __REGSHIFT(reg ## _ ## field)
67
68# define REGGETIM_IDX(var, reg, field, idx) \
69 __REGGET(var, reg ## _ ## field((idx))) / \
70 __REGSHIFT(reg ## _ ## field((idx)))
57 71
58#else 72#else
59 73
60# define __REG(x) io_p2v(x) 74# define __REG(x) io_p2v(x)
61# define __REG2(x, y) io_p2v((x) + (y)) 75# define __REG2(x, y) io_p2v((x) + (y))
62 76
63# define __REGB(x) __REG((x))
64# define __REGB2(x, y) __REG2((x), (y))
65
66#endif 77#endif
67 78
68#endif /* ifndef __ASM_ARCH_HARDWARE_H */ 79#endif /* ifndef __ASM_ARCH_HARDWARE_H */
diff --git a/include/asm-arm/arch-ns9xxx/regs-board-a9m9750dev.h b/include/asm-arm/arch-ns9xxx/regs-board-a9m9750dev.h
index c3dc532dd20c..afa3a9db3e1d 100644
--- a/include/asm-arm/arch-ns9xxx/regs-board-a9m9750dev.h
+++ b/include/asm-arm/arch-ns9xxx/regs-board-a9m9750dev.h
@@ -18,7 +18,7 @@
18#define FPGA_UARTC_BASE io_p2v(NS9XXX_CSxSTAT_PHYS(0) + 0x10) 18#define FPGA_UARTC_BASE io_p2v(NS9XXX_CSxSTAT_PHYS(0) + 0x10)
19#define FPGA_UARTD_BASE io_p2v(NS9XXX_CSxSTAT_PHYS(0) + 0x18) 19#define FPGA_UARTD_BASE io_p2v(NS9XXX_CSxSTAT_PHYS(0) + 0x18)
20 20
21#define FPGA_IER __REGB(NS9XXX_CSxSTAT_PHYS(0) + 0x50) 21#define FPGA_IER __REG(NS9XXX_CSxSTAT_PHYS(0) + 0x50)
22#define FPGA_ISR __REGB(NS9XXX_CSxSTAT_PHYS(0) + 0x60) 22#define FPGA_ISR __REG(NS9XXX_CSxSTAT_PHYS(0) + 0x60)
23 23
24#endif /* ifndef __ASM_ARCH_REGSBOARDA9M9750_H */ 24#endif /* ifndef __ASM_ARCH_REGSBOARDA9M9750_H */
diff --git a/include/asm-arm/arch-ns9xxx/system.h b/include/asm-arm/arch-ns9xxx/system.h
index e3cd4d31b3f3..c1082bd8977c 100644
--- a/include/asm-arm/arch-ns9xxx/system.h
+++ b/include/asm-arm/arch-ns9xxx/system.h
@@ -24,9 +24,9 @@ static inline void arch_reset(char mode)
24{ 24{
25 u32 reg; 25 u32 reg;
26 26
27 reg = SYS_PLL >> 16; 27 reg = __raw_readl(SYS_PLL) >> 16;
28 REGSET(reg, SYS_PLL, SWC, YES); 28 REGSET(reg, SYS_PLL, SWC, YES);
29 SYS_PLL = reg; 29 __raw_writel(reg, SYS_PLL);
30 30
31 BUG(); 31 BUG();
32} 32}
diff --git a/include/asm-arm/arch-omap/blizzard.h b/include/asm-arm/arch-omap/blizzard.h
new file mode 100644
index 000000000000..8d160f171372
--- /dev/null
+++ b/include/asm-arm/arch-omap/blizzard.h
@@ -0,0 +1,12 @@
1#ifndef _BLIZZARD_H
2#define _BLIZZARD_H
3
4struct blizzard_platform_data {
5 void (*power_up)(struct device *dev);
6 void (*power_down)(struct device *dev);
7 unsigned long (*get_clock_rate)(struct device *dev);
8
9 unsigned te_connected : 1;
10};
11
12#endif
diff --git a/include/asm-arm/arch-omap/board-2430sdp.h b/include/asm-arm/arch-omap/board-2430sdp.h
new file mode 100644
index 000000000000..e9c65ce3cb12
--- /dev/null
+++ b/include/asm-arm/arch-omap/board-2430sdp.h
@@ -0,0 +1,44 @@
1/*
2 * linux/include/asm-arm/arch-omap/board-2430sdp.h
3 *
4 * Hardware definitions for TI OMAP2430 SDP board.
5 *
6 * Based on board-h4.h by Dirk Behme <dirk.behme@de.bosch.com>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 *
13 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
14 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
15 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
16 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
19 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, write to the Free Software Foundation, Inc.,
26 * 675 Mass Ave, Cambridge, MA 02139, USA.
27 */
28
29#ifndef __ASM_ARCH_OMAP_2430SDP_H
30#define __ASM_ARCH_OMAP_2430SDP_H
31
32/* Placeholder for 2430SDP specific defines */
33#define OMAP24XX_ETHR_START 0x08000300
34#define OMAP24XX_ETHR_GPIO_IRQ 149
35#define SDP2430_CS0_BASE 0x04000000
36
37#define TWL4030_IRQNUM INT_24XX_SYS_NIRQ
38
39/* TWL4030 Primary Interrupt Handler (PIH) interrupts */
40#define IH_TWL4030_BASE IH_BOARD_BASE
41#define IH_TWL4030_END (IH_TWL4030_BASE+8)
42#define NR_IRQS (IH_TWL4030_END)
43
44#endif /* __ASM_ARCH_OMAP_2430SDP_H */
diff --git a/include/asm-arm/arch-omap/board-palmte.h b/include/asm-arm/arch-omap/board-palmte.h
new file mode 100644
index 000000000000..cd22035a7160
--- /dev/null
+++ b/include/asm-arm/arch-omap/board-palmte.h
@@ -0,0 +1,34 @@
1/*
2 * linux/include/asm-arm/arch-omap/board-palmte.h
3 *
4 * Hardware definitions for the Palm Tungsten E device.
5 *
6 * Maintainters : http://palmtelinux.sf.net
7 * palmtelinux-developpers@lists.sf.net
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 __OMAP_BOARD_PALMTE_H
15#define __OMAP_BOARD_PALMTE_H
16
17#include <asm/arch/gpio.h>
18
19#define PALMTE_USBDETECT_GPIO 0
20#define PALMTE_USB_OR_DC_GPIO 1
21#define PALMTE_TSC_GPIO 4
22#define PALMTE_PINTDAV_GPIO 6
23#define PALMTE_MMC_WP_GPIO 8
24#define PALMTE_MMC_POWER_GPIO 9
25#define PALMTE_HDQ_GPIO 11
26#define PALMTE_HEADPHONES_GPIO 14
27#define PALMTE_SPEAKER_GPIO 15
28#define PALMTE_DC_GPIO OMAP_MPUIO(2)
29#define PALMTE_MMC_SWITCH_GPIO OMAP_MPUIO(4)
30#define PALMTE_MMC1_GPIO OMAP_MPUIO(6)
31#define PALMTE_MMC2_GPIO OMAP_MPUIO(7)
32#define PALMTE_MMC3_GPIO OMAP_MPUIO(11)
33
34#endif /* __OMAP_BOARD_PALMTE_H */
diff --git a/include/asm-arm/arch-omap/board-palmtt.h b/include/asm-arm/arch-omap/board-palmtt.h
new file mode 100644
index 000000000000..d9590b0ec90e
--- /dev/null
+++ b/include/asm-arm/arch-omap/board-palmtt.h
@@ -0,0 +1,23 @@
1/*
2 * linux/include/asm-arm/arch-omap/board-palmte.h
3 *
4 * Hardware definitions for the Palm Tungsten|T device.
5 *
6 * Maintainters : Marek Vasut <marek.vasut@gmail.com>
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#ifndef __OMAP_BOARD_PALMTT_H
14#define __OMAP_BOARD_PALMTT_H
15
16#define PALMTT_USBDETECT_GPIO 0
17#define PALMTT_CABLE_GPIO 1
18#define PALMTT_LED_GPIO 3
19#define PALMTT_PENIRQ_GPIO 6
20#define PALMTT_MMC_WP_GPIO 8
21#define PALMTT_HDQ_GPIO 11
22
23#endif /* __OMAP_BOARD_PALMTT_H */
diff --git a/include/asm-arm/arch-omap/board-palmz71.h b/include/asm-arm/arch-omap/board-palmz71.h
new file mode 100644
index 000000000000..1252a859787d
--- /dev/null
+++ b/include/asm-arm/arch-omap/board-palmz71.h
@@ -0,0 +1,26 @@
1/*
2 * linux/include/asm-arm/arch-omap/board-palmz71.h
3 *
4 * Hardware definitions for the Palm Zire71 device.
5 *
6 * Maintainters : Marek Vasut <marek.vasut@gmail.com>
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#ifndef __OMAP_BOARD_PALMZ71_H
14#define __OMAP_BOARD_PALMZ71_H
15
16#define PALMZ71_USBDETECT_GPIO 0
17#define PALMZ71_PENIRQ_GPIO 6
18#define PALMZ71_MMC_WP_GPIO 8
19#define PALMZ71_HDQ_GPIO 11
20
21#define PALMZ71_HOTSYNC_GPIO OMAP_MPUIO(1)
22#define PALMZ71_CABLE_GPIO OMAP_MPUIO(2)
23#define PALMZ71_SLIDER_GPIO OMAP_MPUIO(3)
24#define PALMZ71_MMC_IN_GPIO OMAP_MPUIO(4)
25
26#endif /* __OMAP_BOARD_PALMZ71_H */
diff --git a/include/asm-arm/arch-omap/board-sx1.h b/include/asm-arm/arch-omap/board-sx1.h
new file mode 100644
index 000000000000..2bb8dd6e2d14
--- /dev/null
+++ b/include/asm-arm/arch-omap/board-sx1.h
@@ -0,0 +1,46 @@
1/*
2 * Siemens SX1 board definitions
3 *
4 * Copyright: Vovan888 at gmail com
5 *
6 * This package 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 * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
11 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
12 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13 */
14
15#ifndef __ASM_ARCH_SX1_I2C_CHIPS_H
16#define __ASM_ARCH_SX1_I2C_CHIPS_H
17
18#define SOFIA_MAX_LIGHT_VAL 0x2B
19
20#define SOFIA_I2C_ADDR 0x32
21/* Sofia reg 3 bits masks */
22#define SOFIA_POWER1_REG 0x03
23
24#define SOFIA_USB_POWER 0x01
25#define SOFIA_MMC_POWER 0x04
26#define SOFIA_BLUETOOTH_POWER 0x08
27#define SOFIA_MMILIGHT_POWER 0x20
28
29#define SOFIA_POWER2_REG 0x04
30#define SOFIA_BACKLIGHT_REG 0x06
31#define SOFIA_KEYLIGHT_REG 0x07
32#define SOFIA_DIMMING_REG 0x09
33
34
35/* Function Prototypes for SX1 devices control on I2C bus */
36
37int sx1_setbacklight(u8 backlight);
38int sx1_getbacklight(u8 *backlight);
39int sx1_setkeylight(u8 keylight);
40int sx1_getkeylight(u8 *keylight);
41
42int sx1_setmmipower(u8 onoff);
43int sx1_setusbpower(u8 onoff);
44int sx1_setmmcpower(u8 onoff);
45
46#endif /* __ASM_ARCH_SX1_I2C_CHIPS_H */
diff --git a/include/asm-arm/arch-omap/board.h b/include/asm-arm/arch-omap/board.h
index 031672c56377..db44c5d1f1a0 100644
--- a/include/asm-arm/arch-omap/board.h
+++ b/include/asm-arm/arch-omap/board.h
@@ -179,4 +179,8 @@ extern const void *omap_get_var_config(u16 tag, size_t *len);
179extern struct omap_board_config_kernel *omap_board_config; 179extern struct omap_board_config_kernel *omap_board_config;
180extern int omap_board_config_size; 180extern int omap_board_config_size;
181 181
182
183/* for TI reference platforms sharing the same debug card */
184extern int debug_card_init(u32 addr, unsigned gpio);
185
182#endif 186#endif
diff --git a/include/asm-arm/arch-omap/dma.h b/include/asm-arm/arch-omap/dma.h
index f7774192a41e..f33b467fddb7 100644
--- a/include/asm-arm/arch-omap/dma.h
+++ b/include/asm-arm/arch-omap/dma.h
@@ -417,7 +417,6 @@ extern void omap_free_lcd_dma(void);
417extern void omap_setup_lcd_dma(void); 417extern void omap_setup_lcd_dma(void);
418extern void omap_enable_lcd_dma(void); 418extern void omap_enable_lcd_dma(void);
419extern void omap_stop_lcd_dma(void); 419extern void omap_stop_lcd_dma(void);
420extern int omap_lcd_dma_ext_running(void);
421extern void omap_set_lcd_dma_ext_controller(int external); 420extern void omap_set_lcd_dma_ext_controller(int external);
422extern void omap_set_lcd_dma_single_transfer(int single); 421extern void omap_set_lcd_dma_single_transfer(int single);
423extern void omap_set_lcd_dma_b1(unsigned long addr, u16 fb_xres, u16 fb_yres, 422extern void omap_set_lcd_dma_b1(unsigned long addr, u16 fb_xres, u16 fb_yres,
diff --git a/include/asm-arm/arch-omap/eac.h b/include/asm-arm/arch-omap/eac.h
new file mode 100644
index 000000000000..6662cb02bafc
--- /dev/null
+++ b/include/asm-arm/arch-omap/eac.h
@@ -0,0 +1,101 @@
1/*
2 * linux/include/asm-arm/arch-omap2/eac.h
3 *
4 * Defines for Enhanced Audio Controller
5 *
6 * Contact: Jarkko Nikula <jarkko.nikula@nokia.com>
7 *
8 * Copyright (C) 2006 Nokia Corporation
9 * Copyright (C) 2004 Texas Instruments, Inc.
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * version 2 as published by the Free Software Foundation.
14 *
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
23 * 02110-1301 USA
24 *
25 */
26
27#ifndef __ASM_ARM_ARCH_OMAP2_EAC_H
28#define __ASM_ARM_ARCH_OMAP2_EAC_H
29
30#include <asm/arch/io.h>
31#include <asm/arch/hardware.h>
32#include <asm/irq.h>
33
34#include <sound/driver.h>
35#include <sound/core.h>
36
37/* master codec clock source */
38#define EAC_MCLK_EXT_MASK 0x100
39enum eac_mclk_src {
40 EAC_MCLK_INT_11290000, /* internal 96 MHz / 8.5 = 11.29 Mhz */
41 EAC_MCLK_EXT_11289600 = EAC_MCLK_EXT_MASK,
42 EAC_MCLK_EXT_12288000,
43 EAC_MCLK_EXT_2x11289600,
44 EAC_MCLK_EXT_2x12288000,
45};
46
47/* codec port interface mode */
48enum eac_codec_mode {
49 EAC_CODEC_PCM,
50 EAC_CODEC_AC97,
51 EAC_CODEC_I2S_MASTER, /* codec port, I.e. EAC is the master */
52 EAC_CODEC_I2S_SLAVE,
53};
54
55/* configuration structure for I2S mode */
56struct eac_i2s_conf {
57 /* if enabled, then first data slot (left channel) is signaled as
58 * positive level of frame sync EAC.AC_FS */
59 unsigned polarity_changed_mode:1;
60 /* if enabled, then serial data starts one clock cycle after the
61 * of EAC.AC_FS for first audio slot */
62 unsigned sync_delay_enable:1;
63};
64
65/* configuration structure for EAC codec port */
66struct eac_codec {
67 enum eac_mclk_src mclk_src;
68
69 enum eac_codec_mode codec_mode;
70 union {
71 struct eac_i2s_conf i2s;
72 } codec_conf;
73
74 int default_rate; /* audio sampling rate */
75
76 int (* set_power)(void *private_data, int dac, int adc);
77 int (* register_controls)(void *private_data,
78 struct snd_card *card);
79 const char *short_name;
80
81 void *private_data;
82};
83
84/* structure for passing platform dependent data to the EAC driver */
85struct eac_platform_data {
86 int (* init)(struct device *eac_dev);
87 void (* cleanup)(struct device *eac_dev);
88 /* these callbacks are used to configure & control external MCLK
89 * source. NULL if not used */
90 int (* enable_ext_clocks)(struct device *eac_dev);
91 void (* disable_ext_clocks)(struct device *eac_dev);
92};
93
94extern void omap_init_eac(struct eac_platform_data *pdata);
95
96extern int eac_register_codec(struct device *eac_dev, struct eac_codec *codec);
97extern void eac_unregister_codec(struct device *eac_dev);
98
99extern int eac_set_mode(struct device *eac_dev, int play, int rec);
100
101#endif /* __ASM_ARM_ARCH_OMAP2_EAC_H */
diff --git a/include/asm-arm/arch-omap/gpmc.h b/include/asm-arm/arch-omap/gpmc.h
index 995cc83482eb..6a8e07ffc2d0 100644
--- a/include/asm-arm/arch-omap/gpmc.h
+++ b/include/asm-arm/arch-omap/gpmc.h
@@ -23,9 +23,10 @@
23#define GPMC_CS_NAND_DATA 0x24 23#define GPMC_CS_NAND_DATA 0x24
24 24
25#define GPMC_CONFIG1_WRAPBURST_SUPP (1 << 31) 25#define GPMC_CONFIG1_WRAPBURST_SUPP (1 << 31)
26#define GPMC_CONFIG1_READMULTIPLE_SUPP (1 << 20) 26#define GPMC_CONFIG1_READMULTIPLE_SUPP (1 << 30)
27#define GPMC_CONFIG1_READTYPE_ASYNC (0 << 29) 27#define GPMC_CONFIG1_READTYPE_ASYNC (0 << 29)
28#define GPMC_CONFIG1_READTYPE_SYNC (1 << 29) 28#define GPMC_CONFIG1_READTYPE_SYNC (1 << 29)
29#define GPMC_CONFIG1_WRITEMULTIPLE_SUPP (1 << 28)
29#define GPMC_CONFIG1_WRITETYPE_ASYNC (0 << 27) 30#define GPMC_CONFIG1_WRITETYPE_ASYNC (0 << 27)
30#define GPMC_CONFIG1_WRITETYPE_SYNC (1 << 27) 31#define GPMC_CONFIG1_WRITETYPE_SYNC (1 << 27)
31#define GPMC_CONFIG1_CLKACTIVATIONTIME(val) ((val & 3) << 25) 32#define GPMC_CONFIG1_CLKACTIVATIONTIME(val) ((val & 3) << 25)
@@ -80,6 +81,8 @@ struct gpmc_timings {
80}; 81};
81 82
82extern unsigned int gpmc_ns_to_ticks(unsigned int time_ns); 83extern unsigned int gpmc_ns_to_ticks(unsigned int time_ns);
84extern unsigned int gpmc_round_ns_to_ticks(unsigned int time_ns);
85extern unsigned long gpmc_get_fclk_period(void);
83 86
84extern void gpmc_cs_write_reg(int cs, int idx, u32 val); 87extern void gpmc_cs_write_reg(int cs, int idx, u32 val);
85extern u32 gpmc_cs_read_reg(int cs, int idx); 88extern u32 gpmc_cs_read_reg(int cs, int idx);
diff --git a/include/asm-arm/arch-omap/hardware.h b/include/asm-arm/arch-omap/hardware.h
index e225f4f39b34..da572092e255 100644
--- a/include/asm-arm/arch-omap/hardware.h
+++ b/include/asm-arm/arch-omap/hardware.h
@@ -318,6 +318,10 @@
318#include "board-h4.h" 318#include "board-h4.h"
319#endif 319#endif
320 320
321#ifdef CONFIG_MACH_OMAP_2430SDP
322#include "board-2430sdp.h"
323#endif
324
321#ifdef CONFIG_MACH_OMAP_APOLLON 325#ifdef CONFIG_MACH_OMAP_APOLLON
322#include "board-apollon.h" 326#include "board-apollon.h"
323#endif 327#endif
@@ -330,6 +334,22 @@
330#include "board-voiceblue.h" 334#include "board-voiceblue.h"
331#endif 335#endif
332 336
337#ifdef CONFIG_MACH_OMAP_PALMTE
338#include "board-palmte.h"
339#endif
340
341#ifdef CONFIG_MACH_OMAP_PALMZ71
342#include "board-palmz71.h"
343#endif
344
345#ifdef CONFIG_MACH_OMAP_PALMTT
346#include "board-palmtt.h"
347#endif
348
349#ifdef CONFIG_MACH_SX1
350#include "board-sx1.h"
351#endif
352
333#endif /* !__ASSEMBLER__ */ 353#endif /* !__ASSEMBLER__ */
334 354
335#endif /* __ASM_ARCH_OMAP_HARDWARE_H */ 355#endif /* __ASM_ARCH_OMAP_HARDWARE_H */
diff --git a/include/asm-arm/arch-omap/io.h b/include/asm-arm/arch-omap/io.h
index 4aca7e3d7566..289082d07f14 100644
--- a/include/asm-arm/arch-omap/io.h
+++ b/include/asm-arm/arch-omap/io.h
@@ -72,6 +72,16 @@
72#define L4_24XX_PHYS L4_24XX_BASE /* 0x48000000 */ 72#define L4_24XX_PHYS L4_24XX_BASE /* 0x48000000 */
73#define L4_24XX_VIRT 0xd8000000 73#define L4_24XX_VIRT 0xd8000000
74#define L4_24XX_SIZE SZ_1M /* 1MB of 128MB used, want 1MB sect */ 74#define L4_24XX_SIZE SZ_1M /* 1MB of 128MB used, want 1MB sect */
75
76#ifdef CONFIG_ARCH_OMAP2430
77#define L4_WK_243X_PHYS L4_WK_243X_BASE /* 0x49000000 */
78#define L4_WK_243X_VIRT 0xd9000000
79#define L4_WK_243X_SIZE SZ_1M
80#define OMAP243X_GPMC_PHYS OMAP243X_GPMC_BASE /* 0x49000000 */
81#define OMAP243X_GPMC_VIRT 0xFE000000
82#define OMAP243X_GPMC_SIZE SZ_1M
83#endif
84
75#define IO_OFFSET 0x90000000 85#define IO_OFFSET 0x90000000
76#define IO_ADDRESS(pa) ((pa) + IO_OFFSET) /* Works for L3 and L4 */ 86#define IO_ADDRESS(pa) ((pa) + IO_OFFSET) /* Works for L3 and L4 */
77#define io_p2v(pa) ((pa) + IO_OFFSET) /* Works for L3 and L4 */ 87#define io_p2v(pa) ((pa) + IO_OFFSET) /* Works for L3 and L4 */
diff --git a/include/asm-arm/arch-omap/menelaus.h b/include/asm-arm/arch-omap/menelaus.h
index 82d276a6bd95..69ed7ee40179 100644
--- a/include/asm-arm/arch-omap/menelaus.h
+++ b/include/asm-arm/arch-omap/menelaus.h
@@ -7,6 +7,12 @@
7#ifndef __ASM_ARCH_MENELAUS_H 7#ifndef __ASM_ARCH_MENELAUS_H
8#define __ASM_ARCH_MENELAUS_H 8#define __ASM_ARCH_MENELAUS_H
9 9
10struct device;
11
12struct menelaus_platform_data {
13 int (* late_init)(struct device *dev);
14};
15
10extern int menelaus_register_mmc_callback(void (*callback)(void *data, u8 card_mask), 16extern int menelaus_register_mmc_callback(void (*callback)(void *data, u8 card_mask),
11 void *data); 17 void *data);
12extern void menelaus_unregister_mmc_callback(void); 18extern void menelaus_unregister_mmc_callback(void);
@@ -20,6 +26,19 @@ extern int menelaus_set_vaux(unsigned int mV);
20extern int menelaus_set_vdcdc(int dcdc, unsigned int mV); 26extern int menelaus_set_vdcdc(int dcdc, unsigned int mV);
21extern int menelaus_set_slot_sel(int enable); 27extern int menelaus_set_slot_sel(int enable);
22extern int menelaus_get_slot_pin_states(void); 28extern int menelaus_get_slot_pin_states(void);
29extern int menelaus_set_vcore_sw(unsigned int mV);
30extern int menelaus_set_vcore_hw(unsigned int roof_mV, unsigned int floor_mV);
31
32#define EN_VPLL_SLEEP (1 << 7)
33#define EN_VMMC_SLEEP (1 << 6)
34#define EN_VAUX_SLEEP (1 << 5)
35#define EN_VIO_SLEEP (1 << 4)
36#define EN_VMEM_SLEEP (1 << 3)
37#define EN_DC3_SLEEP (1 << 2)
38#define EN_DC2_SLEEP (1 << 1)
39#define EN_VC_SLEEP (1 << 0)
40
41extern int menelaus_set_regulator_sleep(int enable, u32 val);
23 42
24#if defined(CONFIG_ARCH_OMAP24XX) && defined(CONFIG_MENELAUS) 43#if defined(CONFIG_ARCH_OMAP24XX) && defined(CONFIG_MENELAUS)
25#define omap_has_menelaus() 1 44#define omap_has_menelaus() 1
@@ -28,4 +47,3 @@ extern int menelaus_get_slot_pin_states(void);
28#endif 47#endif
29 48
30#endif 49#endif
31
diff --git a/include/asm-arm/arch-omap/mmc.h b/include/asm-arm/arch-omap/mmc.h
new file mode 100644
index 000000000000..b70e37b61242
--- /dev/null
+++ b/include/asm-arm/arch-omap/mmc.h
@@ -0,0 +1,66 @@
1/*
2 * MMC definitions for OMAP2
3 *
4 * Copyright (C) 2006 Nokia Corporation
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 __OMAP2_MMC_H
12#define __OMAP2_MMC_H
13
14#include <linux/types.h>
15#include <linux/device.h>
16#include <linux/mmc/host.h>
17
18#define OMAP_MMC_MAX_SLOTS 2
19
20struct omap_mmc_platform_data {
21 unsigned enabled:1;
22 /* number of slots on board */
23 unsigned nr_slots:2;
24 /* nomux means "standard" muxing is wrong on this board, and that
25 * board-specific code handled it before common init logic.
26 */
27 unsigned nomux:1;
28 /* 4 wire signaling is optional, and is only used for SD/SDIO and
29 * MMCv4 */
30 unsigned wire4:1;
31 /* set if your board has components or wiring that limits the
32 * maximum frequency on the MMC bus */
33 unsigned int max_freq;
34
35 /* switch the bus to a new slot */
36 int (* switch_slot)(struct device *dev, int slot);
37 /* initialize board-specific MMC functionality, can be NULL if
38 * not supported */
39 int (* init)(struct device *dev);
40 void (* cleanup)(struct device *dev);
41
42 struct omap_mmc_slot_data {
43 int (* set_bus_mode)(struct device *dev, int slot, int bus_mode);
44 int (* set_power)(struct device *dev, int slot, int power_on, int vdd);
45 int (* get_ro)(struct device *dev, int slot);
46
47 /* return MMC cover switch state, can be NULL if not supported.
48 *
49 * possible return values:
50 * 0 - open
51 * 1 - closed
52 */
53 int (* get_cover_state)(struct device *dev, int slot);
54
55 const char *name;
56 u32 ocr_mask;
57 } slots[OMAP_MMC_MAX_SLOTS];
58};
59
60extern void omap_set_mmc_info(int host, const struct omap_mmc_platform_data *info);
61
62/* called from board-specific card detection service routine */
63extern void omap_mmc_notify_card_detect(struct device *dev, int slot, int detected);
64extern void omap_mmc_notify_cover_event(struct device *dev, int slot, int is_closed);
65
66#endif
diff --git a/include/asm-arm/arch-omap/mux.h b/include/asm-arm/arch-omap/mux.h
index f1ec2edd4040..b8fff50e6a87 100644
--- a/include/asm-arm/arch-omap/mux.h
+++ b/include/asm-arm/arch-omap/mux.h
@@ -406,6 +406,29 @@ enum omap1xxx_index {
406 V10_1610_CF_IREQ, 406 V10_1610_CF_IREQ,
407 W10_1610_CF_RESET, 407 W10_1610_CF_RESET,
408 W11_1610_CF_CD1, 408 W11_1610_CF_CD1,
409
410 /* parallel camera */
411 J15_1610_CAM_LCLK,
412 J18_1610_CAM_D7,
413 J19_1610_CAM_D6,
414 J14_1610_CAM_D5,
415 K18_1610_CAM_D4,
416 K19_1610_CAM_D3,
417 K15_1610_CAM_D2,
418 K14_1610_CAM_D1,
419 L19_1610_CAM_D0,
420 L18_1610_CAM_VS,
421 L15_1610_CAM_HS,
422 M19_1610_CAM_RSTZ,
423 Y15_1610_CAM_OUTCLK,
424
425 /* serial camera */
426 H19_1610_CAM_EXCLK,
427 Y12_1610_CCP_CLKP,
428 W13_1610_CCP_CLKM,
429 W14_1610_CCP_DATAP,
430 Y14_1610_CCP_DATAM,
431
409}; 432};
410 433
411enum omap24xx_index { 434enum omap24xx_index {
diff --git a/include/asm-arm/arch-omap/omap24xx.h b/include/asm-arm/arch-omap/omap24xx.h
index 708b2fac77f2..14c0f9496579 100644
--- a/include/asm-arm/arch-omap/omap24xx.h
+++ b/include/asm-arm/arch-omap/omap24xx.h
@@ -8,6 +8,7 @@
8 */ 8 */
9 9
10#define L4_24XX_BASE 0x48000000 10#define L4_24XX_BASE 0x48000000
11#define L4_WK_243X_BASE 0x49000000
11#define L3_24XX_BASE 0x68000000 12#define L3_24XX_BASE 0x68000000
12 13
13/* interrupt controller */ 14/* interrupt controller */
@@ -16,9 +17,20 @@
16#define OMAP24XX_IVA_INTC_BASE 0x40000000 17#define OMAP24XX_IVA_INTC_BASE 0x40000000
17#define IRQ_SIR_IRQ 0x0040 18#define IRQ_SIR_IRQ 0x0040
18 19
20#ifdef CONFIG_ARCH_OMAP2420
19#define OMAP24XX_32KSYNCT_BASE (L4_24XX_BASE + 0x4000) 21#define OMAP24XX_32KSYNCT_BASE (L4_24XX_BASE + 0x4000)
20#define OMAP24XX_PRCM_BASE (L4_24XX_BASE + 0x8000) 22#define OMAP24XX_PRCM_BASE (L4_24XX_BASE + 0x8000)
21#define OMAP24XX_SDRC_BASE (L3_24XX_BASE + 0x9000) 23#define OMAP24XX_SDRC_BASE (L3_24XX_BASE + 0x9000)
24#define OMAP242X_CONTROL_STATUS (L4_24XX_BASE + 0x2f8)
25#endif
26
27#ifdef CONFIG_ARCH_OMAP2430
28#define OMAP24XX_32KSYNCT_BASE (L4_WK_243X_BASE + 0x20000)
29#define OMAP24XX_PRCM_BASE (L4_WK_243X_BASE + 0x6000)
30#define OMAP24XX_SDRC_BASE (0x6D000000)
31#define OMAP242X_CONTROL_STATUS (L4_24XX_BASE + 0x2f8)
32#define OMAP243X_GPMC_BASE 0x6E000000
33#endif
22 34
23/* DSP SS */ 35/* DSP SS */
24#define OMAP24XX_DSP_BASE 0x58000000 36#define OMAP24XX_DSP_BASE 0x58000000
diff --git a/include/asm-arm/arch-omap/onenand.h b/include/asm-arm/arch-omap/onenand.h
new file mode 100644
index 000000000000..6c959d0ce470
--- /dev/null
+++ b/include/asm-arm/arch-omap/onenand.h
@@ -0,0 +1,21 @@
1/*
2 * include/asm-arm/arch-omap/onenand.h
3 *
4 * Copyright (C) 2006 Nokia Corporation
5 * Author: Juha Yrjola
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#include <linux/mtd/partitions.h>
13
14struct omap_onenand_platform_data {
15 int cs;
16 int gpio_irq;
17 struct mtd_partition *parts;
18 int nr_parts;
19 int (*onenand_setup)(void __iomem *);
20 int dma_channel;
21};
diff --git a/include/asm-arm/arch-pxa/cm-x270.h b/include/asm-arm/arch-pxa/cm-x270.h
new file mode 100644
index 000000000000..f8fac9e18009
--- /dev/null
+++ b/include/asm-arm/arch-pxa/cm-x270.h
@@ -0,0 +1,50 @@
1/*
2 * linux/include/asm/arch-pxa/cm-x270.h
3 *
4 * Copyright Compulab Ltd., 2003, 2007
5 * Mike Rapoport <mike@compulab.co.il>
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
13/* CM-x270 device physical addresses */
14#define CMX270_CS1_PHYS (PXA_CS1_PHYS)
15#define MARATHON_PHYS (PXA_CS2_PHYS)
16#define CMX270_IDE104_PHYS (PXA_CS3_PHYS)
17#define CMX270_IT8152_PHYS (PXA_CS4_PHYS)
18
19/* Statically mapped regions */
20#define CMX270_VIRT_BASE (0xe8000000)
21#define CMX270_IT8152_VIRT (CMX270_VIRT_BASE)
22#define CMX270_IDE104_VIRT (CMX270_IT8152_VIRT + SZ_64M)
23
24/* GPIO related definitions */
25#define GPIO_IT8152_IRQ (22)
26
27#define IRQ_GPIO_IT8152_IRQ IRQ_GPIO(GPIO_IT8152_IRQ)
28#define PME_IRQ IRQ_GPIO(0)
29#define CMX270_IDE_IRQ IRQ_GPIO(100)
30#define CMX270_GPIRQ1 IRQ_GPIO(101)
31#define CMX270_TOUCHIRQ IRQ_GPIO(96)
32#define CMX270_ETHIRQ IRQ_GPIO(10)
33#define CMX270_GFXIRQ IRQ_GPIO(95)
34#define CMX270_NANDIRQ IRQ_GPIO(89)
35#define CMX270_MMC_IRQ IRQ_GPIO(83)
36
37/* PCMCIA related definitions */
38#define PCC_DETECT(x) (GPLR(84 - (x)) & GPIO_bit(84 - (x)))
39#define PCC_READY(x) (GPLR(82 - (x)) & GPIO_bit(82 - (x)))
40
41#define PCMCIA_S0_CD_VALID IRQ_GPIO(84)
42#define PCMCIA_S0_CD_VALID_EDGE GPIO_BOTH_EDGES
43
44#define PCMCIA_S1_CD_VALID IRQ_GPIO(83)
45#define PCMCIA_S1_CD_VALID_EDGE GPIO_BOTH_EDGES
46
47#define PCMCIA_S0_RDYINT IRQ_GPIO(82)
48#define PCMCIA_S1_RDYINT IRQ_GPIO(81)
49
50#define PCMCIA_RESET_GPIO 53
diff --git a/include/asm-arm/arch-pxa/dma.h b/include/asm-arm/arch-pxa/dma.h
index 3280ee2ddfa5..dbe110ee2666 100644
--- a/include/asm-arm/arch-pxa/dma.h
+++ b/include/asm-arm/arch-pxa/dma.h
@@ -30,6 +30,10 @@ typedef enum {
30 DMA_PRIO_LOW = 2 30 DMA_PRIO_LOW = 2
31} pxa_dma_prio; 31} pxa_dma_prio;
32 32
33#if defined(CONFIG_MACH_ARMCORE) && defined(CONFIG_PCI)
34#define HAVE_ARCH_PCI_SET_DMA_MASK 1
35#endif
36
33/* 37/*
34 * DMA registration 38 * DMA registration
35 */ 39 */
diff --git a/include/asm-arm/arch-pxa/gpio.h b/include/asm-arm/arch-pxa/gpio.h
index 9e99241f3edf..9dbc2dc794f7 100644
--- a/include/asm-arm/arch-pxa/gpio.h
+++ b/include/asm-arm/arch-pxa/gpio.h
@@ -38,16 +38,8 @@ static inline void gpio_free(unsigned gpio)
38 return; 38 return;
39} 39}
40 40
41static inline int gpio_direction_input(unsigned gpio) 41extern int gpio_direction_input(unsigned gpio);
42{ 42extern int gpio_direction_output(unsigned gpio, int value);
43 return pxa_gpio_mode(gpio | GPIO_IN);
44}
45
46static inline int gpio_direction_output(unsigned gpio, int value)
47{
48 return pxa_gpio_mode(gpio | GPIO_OUT |
49 (value ? GPIO_DFLT_HIGH : GPIO_DFLT_LOW));
50}
51 43
52static inline int __gpio_get_value(unsigned gpio) 44static inline int __gpio_get_value(unsigned gpio)
53{ 45{
diff --git a/include/asm-arm/arch-pxa/hardware.h b/include/asm-arm/arch-pxa/hardware.h
index 386121746417..ab2d963e742a 100644
--- a/include/asm-arm/arch-pxa/hardware.h
+++ b/include/asm-arm/arch-pxa/hardware.h
@@ -62,6 +62,7 @@
62 62
63#ifndef __ASSEMBLY__ 63#ifndef __ASSEMBLY__
64 64
65#ifdef CONFIG_PXA25x
65#define __cpu_is_pxa21x(id) \ 66#define __cpu_is_pxa21x(id) \
66 ({ \ 67 ({ \
67 unsigned int _id = (id) >> 4 & 0xf3f; \ 68 unsigned int _id = (id) >> 4 & 0xf3f; \
@@ -73,12 +74,50 @@
73 unsigned int _id = (id) >> 4 & 0xfff; \ 74 unsigned int _id = (id) >> 4 & 0xfff; \
74 _id == 0x2d0 || _id == 0x290; \ 75 _id == 0x2d0 || _id == 0x290; \
75 }) 76 })
77#else
78#define __cpu_is_pxa21x(id) (0)
79#define __cpu_is_pxa25x(id) (0)
80#endif
76 81
82#ifdef CONFIG_PXA27x
77#define __cpu_is_pxa27x(id) \ 83#define __cpu_is_pxa27x(id) \
78 ({ \ 84 ({ \
79 unsigned int _id = (id) >> 4 & 0xfff; \ 85 unsigned int _id = (id) >> 4 & 0xfff; \
80 _id == 0x411; \ 86 _id == 0x411; \
81 }) 87 })
88#else
89#define __cpu_is_pxa27x(id) (0)
90#endif
91
92#ifdef CONFIG_CPU_PXA300
93#define __cpu_is_pxa300(id) \
94 ({ \
95 unsigned int _id = (id) >> 4 & 0xfff; \
96 _id == 0x688; \
97 })
98#else
99#define __cpu_is_pxa300(id) (0)
100#endif
101
102#ifdef CONFIG_CPU_PXA310
103#define __cpu_is_pxa310(id) \
104 ({ \
105 unsigned int _id = (id) >> 4 & 0xfff; \
106 _id == 0x689; \
107 })
108#else
109#define __cpu_is_pxa310(id) (0)
110#endif
111
112#ifdef CONFIG_CPU_PXA320
113#define __cpu_is_pxa320(id) \
114 ({ \
115 unsigned int _id = (id) >> 4 & 0xfff; \
116 _id == 0x603 || _id == 0x682; \
117 })
118#else
119#define __cpu_is_pxa320(id) (0)
120#endif
82 121
83#define cpu_is_pxa21x() \ 122#define cpu_is_pxa21x() \
84 ({ \ 123 ({ \
@@ -98,6 +137,53 @@
98 __cpu_is_pxa27x(id); \ 137 __cpu_is_pxa27x(id); \
99 }) 138 })
100 139
140#define cpu_is_pxa300() \
141 ({ \
142 unsigned int id = read_cpuid(CPUID_ID); \
143 __cpu_is_pxa300(id); \
144 })
145
146#define cpu_is_pxa310() \
147 ({ \
148 unsigned int id = read_cpuid(CPUID_ID); \
149 __cpu_is_pxa310(id); \
150 })
151
152#define cpu_is_pxa320() \
153 ({ \
154 unsigned int id = read_cpuid(CPUID_ID); \
155 __cpu_is_pxa320(id); \
156 })
157
158/*
159 * CPUID Core Generation Bit
160 * <= 0x2 for pxa21x/pxa25x/pxa26x/pxa27x
161 * == 0x3 for pxa300/pxa310/pxa320
162 */
163#define __cpu_is_pxa2xx(id) \
164 ({ \
165 unsigned int _id = (id) >> 13 & 0x7; \
166 _id <= 0x2; \
167 })
168
169#define __cpu_is_pxa3xx(id) \
170 ({ \
171 unsigned int _id = (id) >> 13 & 0x7; \
172 _id == 0x3; \
173 })
174
175#define cpu_is_pxa2xx() \
176 ({ \
177 unsigned int id = read_cpuid(CPUID_ID); \
178 __cpu_is_pxa2xx(id); \
179 })
180
181#define cpu_is_pxa3xx() \
182 ({ \
183 unsigned int id = read_cpuid(CPUID_ID); \
184 __cpu_is_pxa3xx(id); \
185 })
186
101/* 187/*
102 * Handy routine to set GPIO alternate functions 188 * Handy routine to set GPIO alternate functions
103 */ 189 */
@@ -116,14 +202,23 @@ extern void pxa_gpio_set_value(unsigned gpio, int value);
116/* 202/*
117 * Routine to enable or disable CKEN 203 * Routine to enable or disable CKEN
118 */ 204 */
119extern void pxa_set_cken(int clock, int enable); 205static inline void __deprecated pxa_set_cken(int clock, int enable)
206{
207 extern void __pxa_set_cken(int clock, int enable);
208 __pxa_set_cken(clock, enable);
209}
120 210
121/* 211/*
122 * return current memory and LCD clock frequency in units of 10kHz 212 * return current memory and LCD clock frequency in units of 10kHz
123 */ 213 */
124extern unsigned int get_memclk_frequency_10khz(void); 214extern unsigned int get_memclk_frequency_10khz(void);
125extern unsigned int get_lcdclk_frequency_10khz(void);
126 215
127#endif 216#endif
128 217
218#if defined(CONFIG_MACH_ARMCORE) && defined(CONFIG_PCI)
219#define PCIBIOS_MIN_IO 0
220#define PCIBIOS_MIN_MEM 0
221#define pcibios_assign_all_busses() 1
222#endif
223
129#endif /* _ASM_ARCH_HARDWARE_H */ 224#endif /* _ASM_ARCH_HARDWARE_H */
diff --git a/include/asm-arm/arch-pxa/irqs.h b/include/asm-arm/arch-pxa/irqs.h
index a07fe0f928cd..6238dbf7a236 100644
--- a/include/asm-arm/arch-pxa/irqs.h
+++ b/include/asm-arm/arch-pxa/irqs.h
@@ -66,12 +66,6 @@
66#define IRQ_TO_GPIO_2_x(i) ((i) - PXA_GPIO_IRQ_BASE) 66#define IRQ_TO_GPIO_2_x(i) ((i) - PXA_GPIO_IRQ_BASE)
67#define IRQ_TO_GPIO(i) (((i) < IRQ_GPIO(2)) ? ((i) - IRQ_GPIO0) : IRQ_TO_GPIO_2_x(i)) 67#define IRQ_TO_GPIO(i) (((i) < IRQ_GPIO(2)) ? ((i) - IRQ_GPIO0) : IRQ_TO_GPIO_2_x(i))
68 68
69#if defined(CONFIG_PXA25x)
70#define PXA_LAST_GPIO 84
71#elif defined(CONFIG_PXA27x)
72#define PXA_LAST_GPIO 127
73#endif
74
75/* 69/*
76 * The next 16 interrupts are for board specific purposes. Since 70 * The next 16 interrupts are for board specific purposes. Since
77 * the kernel can only run on one machine at a time, we can re-use 71 * the kernel can only run on one machine at a time, we can re-use
@@ -216,3 +210,24 @@
216#define IRQ_LOCOMO_GPIO_BASE (IRQ_BOARD_START + 1) 210#define IRQ_LOCOMO_GPIO_BASE (IRQ_BOARD_START + 1)
217#define IRQ_LOCOMO_LT_BASE (IRQ_BOARD_START + 2) 211#define IRQ_LOCOMO_LT_BASE (IRQ_BOARD_START + 2)
218#define IRQ_LOCOMO_SPI_BASE (IRQ_BOARD_START + 3) 212#define IRQ_LOCOMO_SPI_BASE (IRQ_BOARD_START + 3)
213
214/* ITE8152 irqs */
215/* add IT8152 IRQs beyond BOARD_END */
216#ifdef CONFIG_PCI_HOST_ITE8152
217#define IT8152_IRQ(x) (IRQ_GPIO(IRQ_BOARD_END) + 1 + (x))
218
219/* IRQ-sources in 3 groups - local devices, LPC (serial), and external PCI */
220#define IT8152_LD_IRQ_COUNT 9
221#define IT8152_LP_IRQ_COUNT 16
222#define IT8152_PD_IRQ_COUNT 15
223
224/* Priorities: */
225#define IT8152_PD_IRQ(i) IT8152_IRQ(i)
226#define IT8152_LP_IRQ(i) (IT8152_IRQ(i) + IT8152_PD_IRQ_COUNT)
227#define IT8152_LD_IRQ(i) (IT8152_IRQ(i) + IT8152_PD_IRQ_COUNT + IT8152_LP_IRQ_COUNT)
228
229#define IT8152_LAST_IRQ IT8152_LD_IRQ(IT8152_LD_IRQ_COUNT - 1)
230
231#undef NR_IRQS
232#define NR_IRQS (IT8152_LAST_IRQ+1)
233#endif
diff --git a/include/asm-arm/arch-pxa/memory.h b/include/asm-arm/arch-pxa/memory.h
index e17f9881faf0..bee81d66c184 100644
--- a/include/asm-arm/arch-pxa/memory.h
+++ b/include/asm-arm/arch-pxa/memory.h
@@ -39,4 +39,14 @@
39 */ 39 */
40#define NODE_MEM_SIZE_BITS 26 40#define NODE_MEM_SIZE_BITS 26
41 41
42#if !defined(__ASSEMBLY__) && defined(CONFIG_MACH_ARMCORE) && defined(CONFIG_PCI)
43void cmx270_pci_adjust_zones(int node, unsigned long *size,
44 unsigned long *holes);
45
46#define arch_adjust_zones(node, size, holes) \
47 cmx270_pci_adjust_zones(node, size, holes)
48
49#define ISA_DMA_THRESHOLD (PHYS_OFFSET + SZ_64M - 1)
50#endif
51
42#endif 52#endif
diff --git a/include/asm-arm/arch-pxa/mfp-pxa300.h b/include/asm-arm/arch-pxa/mfp-pxa300.h
new file mode 100644
index 000000000000..7513c7a3402d
--- /dev/null
+++ b/include/asm-arm/arch-pxa/mfp-pxa300.h
@@ -0,0 +1,574 @@
1/*
2 * linux/include/asm-arm/arch-pxa/mfp-pxa300.h
3 *
4 * PXA300/PXA310 specific MFP configuration definitions
5 *
6 * Copyright (C) 2007 Marvell International Ltd.
7 * 2007-08-21: eric miao <eric.y.miao@gmail.com>
8 * initial version
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 __ASM_ARCH_MFP_PXA300_H
16#define __ASM_ARCH_MFP_PXA300_H
17
18#include <asm/arch/mfp.h>
19
20/* GPIO */
21#define GPIO46_GPIO MFP_CFG(GPIO46, AF1)
22#define GPIO49_GPIO MFP_CFG(GPIO49, AF3)
23#define GPIO50_GPIO MFP_CFG(GPIO50, AF2)
24#define GPIO51_GPIO MFP_CFG(GPIO51, AF3)
25#define GPIO52_GPIO MFP_CFG(GPIO52, AF3)
26#define GPIO56_GPIO MFP_CFG(GPIO56, AF0)
27#define GPIO58_GPIO MFP_CFG(GPIO58, AF0)
28#define GPIO59_GPIO MFP_CFG(GPIO59, AF0)
29#define GPIO60_GPIO MFP_CFG(GPIO60, AF0)
30#define GPIO61_GPIO MFP_CFG(GPIO61, AF0)
31#define GPIO62_GPIO MFP_CFG(GPIO62, AF0)
32
33#ifdef CONFIG_CPU_PXA310
34#define GPIO7_2_GPIO MFP_CFG(GPIO7_2, AF0)
35#define GPIO8_2_GPIO MFP_CFG(GPIO8_2, AF0)
36#define GPIO9_2_GPIO MFP_CFG(GPIO9_2, AF0)
37#define GPIO10_2_GPIO MFP_CFG(GPIO10_2, AF0)
38#define GPIO11_2_GPIO MFP_CFG(GPIO11_2, AF0)
39#define GPIO12_2_GPIO MFP_CFG(GPIO12_2, AF0)
40#endif
41
42/* Chip Select */
43#define GPIO2_nCS3 MFP_CFG(GPIO2, AF1)
44
45/* AC97 */
46#define GPIO23_AC97_nACRESET MFP_CFG(GPIO23, AF1)
47#define GPIO24_AC97_SYSCLK MFP_CFG(GPIO24, AF1)
48#define GPIO29_AC97_BITCLK MFP_CFG(GPIO29, AF1)
49#define GPIO25_AC97_SDATA_IN_0 MFP_CFG(GPIO25, AF1)
50#define GPIO26_AC97_SDATA_IN_1 MFP_CFG(GPIO26, AF1)
51#define GPIO17_AC97_SDATA_IN_2 MFP_CFG(GPIO17, AF3)
52#define GPIO21_AC97_SDATA_IN_2 MFP_CFG(GPIO21, AF2)
53#define GPIO18_AC97_SDATA_IN_3 MFP_CFG(GPIO18, AF3)
54#define GPIO22_AC97_SDATA_IN_3 MFP_CFG(GPIO22, AF2)
55#define GPIO27_AC97_SDATA_OUT MFP_CFG(GPIO27, AF1)
56#define GPIO28_AC97_SYNC MFP_CFG(GPIO28, AF1)
57
58/* I2C */
59#define GPIO21_I2C_SCL MFP_CFG_LPM(GPIO21, AF1, PULL_HIGH)
60#define GPIO22_I2C_SDA MFP_CFG_LPM(GPIO22, AF1, PULL_HIGH)
61
62/* QCI */
63#define GPIO39_CI_DD_0 MFP_CFG_DRV(GPIO39, AF1, DS04X)
64#define GPIO40_CI_DD_1 MFP_CFG_DRV(GPIO40, AF1, DS04X)
65#define GPIO41_CI_DD_2 MFP_CFG_DRV(GPIO41, AF1, DS04X)
66#define GPIO42_CI_DD_3 MFP_CFG_DRV(GPIO42, AF1, DS04X)
67#define GPIO43_CI_DD_4 MFP_CFG_DRV(GPIO43, AF1, DS04X)
68#define GPIO44_CI_DD_5 MFP_CFG_DRV(GPIO44, AF1, DS04X)
69#define GPIO45_CI_DD_6 MFP_CFG_DRV(GPIO45, AF1, DS04X)
70#define GPIO46_CI_DD_7 MFP_CFG_DRV(GPIO46, AF0, DS04X)
71#define GPIO47_CI_DD_8 MFP_CFG_DRV(GPIO47, AF1, DS04X)
72#define GPIO48_CI_DD_9 MFP_CFG_DRV(GPIO48, AF1, DS04X)
73#define GPIO52_CI_HSYNC MFP_CFG_DRV(GPIO52, AF0, DS04X)
74#define GPIO51_CI_VSYNC MFP_CFG_DRV(GPIO51, AF0, DS04X)
75#define GPIO49_CI_MCLK MFP_CFG_DRV(GPIO49, AF0, DS04X)
76#define GPIO50_CI_PCLK MFP_CFG_DRV(GPIO50, AF0, DS04X)
77
78/* KEYPAD */
79#define GPIO3_KP_DKIN_6 MFP_CFG_LPM(GPIO3, AF2, FLOAT)
80#define GPIO4_KP_DKIN_7 MFP_CFG_LPM(GPIO4, AF2, FLOAT)
81#define GPIO16_KP_DKIN_6 MFP_CFG_LPM(GPIO16, AF6, FLOAT)
82#define GPIO83_KP_DKIN_2 MFP_CFG_LPM(GPIO83, AF5, FLOAT)
83#define GPIO84_KP_DKIN_1 MFP_CFG_LPM(GPIO84, AF5, FLOAT)
84#define GPIO85_KP_DKIN_0 MFP_CFG_LPM(GPIO85, AF3, FLOAT)
85#define GPIO86_KP_DKIN_1 MFP_CFG_LPM(GPIO86, AF3, FLOAT)
86#define GPIO87_KP_DKIN_2 MFP_CFG_LPM(GPIO87, AF3, FLOAT)
87#define GPIO88_KP_DKIN_3 MFP_CFG_LPM(GPIO88, AF3, FLOAT)
88#define GPIO89_KP_DKIN_3 MFP_CFG_LPM(GPIO89, AF3, FLOAT)
89#define GPIO107_KP_DKIN_0 MFP_CFG_LPM(GPIO107, AF2, FLOAT)
90#define GPIO108_KP_DKIN_1 MFP_CFG_LPM(GPIO108, AF2, FLOAT)
91#define GPIO109_KP_DKIN_2 MFP_CFG_LPM(GPIO109, AF2, FLOAT)
92#define GPIO110_KP_DKIN_3 MFP_CFG_LPM(GPIO110, AF2, FLOAT)
93#define GPIO111_KP_DKIN_4 MFP_CFG_LPM(GPIO111, AF2, FLOAT)
94#define GPIO112_KP_DKIN_5 MFP_CFG_LPM(GPIO112, AF2, FLOAT)
95#define GPIO113_KP_DKIN_6 MFP_CFG_LPM(GPIO113, AF2, FLOAT)
96#define GPIO114_KP_DKIN_7 MFP_CFG_LPM(GPIO114, AF2, FLOAT)
97#define GPIO115_KP_DKIN_0 MFP_CFG_LPM(GPIO115, AF2, FLOAT)
98#define GPIO116_KP_DKIN_1 MFP_CFG_LPM(GPIO116, AF2, FLOAT)
99#define GPIO117_KP_DKIN_2 MFP_CFG_LPM(GPIO117, AF2, FLOAT)
100#define GPIO118_KP_DKIN_3 MFP_CFG_LPM(GPIO118, AF2, FLOAT)
101#define GPIO119_KP_DKIN_4 MFP_CFG_LPM(GPIO119, AF2, FLOAT)
102#define GPIO120_KP_DKIN_5 MFP_CFG_LPM(GPIO120, AF2, FLOAT)
103#define GPIO121_KP_DKIN_6 MFP_CFG_LPM(GPIO121, AF2, FLOAT)
104#define GPIO122_KP_DKIN_5 MFP_CFG_LPM(GPIO122, AF2, FLOAT)
105#define GPIO123_KP_DKIN_4 MFP_CFG_LPM(GPIO123, AF2, FLOAT)
106#define GPIO124_KP_DKIN_3 MFP_CFG_LPM(GPIO124, AF2, FLOAT)
107#define GPIO127_KP_DKIN_0 MFP_CFG_LPM(GPIO127, AF5, FLOAT)
108#define GPIO0_2_KP_DKIN_0 MFP_CFG_LPM(GPIO0_2, AF2, FLOAT)
109#define GPIO1_2_KP_DKIN_1 MFP_CFG_LPM(GPIO1_2, AF2, FLOAT)
110#define GPIO2_2_KP_DKIN_6 MFP_CFG_LPM(GPIO2_2, AF2, FLOAT)
111#define GPIO3_2_KP_DKIN_7 MFP_CFG_LPM(GPIO3_2, AF2, FLOAT)
112#define GPIO4_2_KP_DKIN_1 MFP_CFG_LPM(GPIO4_2, AF2, FLOAT)
113#define GPIO5_2_KP_DKIN_0 MFP_CFG_LPM(GPIO5_2, AF2, FLOAT)
114
115#define GPIO5_KP_MKIN_0 MFP_CFG_LPM(GPIO5, AF2, FLOAT)
116#define GPIO6_KP_MKIN_1 MFP_CFG_LPM(GPIO6, AF2, FLOAT)
117#define GPIO9_KP_MKIN_6 MFP_CFG_LPM(GPIO9, AF3, FLOAT)
118#define GPIO10_KP_MKIN_7 MFP_CFG_LPM(GPIO10, AF3, FLOAT)
119#define GPIO70_KP_MKIN_6 MFP_CFG_LPM(GPIO70, AF3, FLOAT)
120#define GPIO71_KP_MKIN_7 MFP_CFG_LPM(GPIO71, AF3, FLOAT)
121#define GPIO100_KP_MKIN_6 MFP_CFG_LPM(GPIO100, AF7, FLOAT)
122#define GPIO101_KP_MKIN_7 MFP_CFG_LPM(GPIO101, AF7, FLOAT)
123#define GPIO112_KP_MKIN_6 MFP_CFG_LPM(GPIO112, AF4, FLOAT)
124#define GPIO113_KP_MKIN_7 MFP_CFG_LPM(GPIO113, AF4, FLOAT)
125#define GPIO115_KP_MKIN_0 MFP_CFG_LPM(GPIO115, AF1, FLOAT)
126#define GPIO116_KP_MKIN_1 MFP_CFG_LPM(GPIO116, AF1, FLOAT)
127#define GPIO117_KP_MKIN_2 MFP_CFG_LPM(GPIO117, AF1, FLOAT)
128#define GPIO118_KP_MKIN_3 MFP_CFG_LPM(GPIO118, AF1, FLOAT)
129#define GPIO119_KP_MKIN_4 MFP_CFG_LPM(GPIO119, AF1, FLOAT)
130#define GPIO120_KP_MKIN_5 MFP_CFG_LPM(GPIO120, AF1, FLOAT)
131#define GPIO125_KP_MKIN_2 MFP_CFG_LPM(GPIO125, AF2, FLOAT)
132#define GPIO2_2_KP_MKIN_6 MFP_CFG_LPM(GPIO2_2, AF1, FLOAT)
133#define GPIO3_2_KP_MKIN_7 MFP_CFG_LPM(GPIO3_2, AF1, FLOAT)
134
135#define GPIO7_KP_MKOUT_5 MFP_CFG_LPM(GPIO7, AF1, DRIVE_HIGH)
136#define GPIO11_KP_MKOUT_5 MFP_CFG_LPM(GPIO11, AF3, DRIVE_HIGH)
137#define GPIO12_KP_MKOUT_6 MFP_CFG_LPM(GPIO12, AF3, DRIVE_HIGH)
138#define GPIO13_KP_MKOUT_7 MFP_CFG_LPM(GPIO13, AF3, DRIVE_HIGH)
139#define GPIO19_KP_MKOUT_4 MFP_CFG_LPM(GPIO19, AF3, DRIVE_HIGH)
140#define GPIO20_KP_MKOUT_5 MFP_CFG_LPM(GPIO20, AF3, DRIVE_HIGH)
141#define GPIO38_KP_MKOUT_5 MFP_CFG_LPM(GPIO38, AF5, DRIVE_HIGH)
142#define GPIO53_KP_MKOUT_6 MFP_CFG_LPM(GPIO53, AF5, DRIVE_HIGH)
143#define GPIO78_KP_MKOUT_7 MFP_CFG_LPM(GPIO78, AF5, DRIVE_HIGH)
144#define GPIO85_KP_MKOUT_0 MFP_CFG_LPM(GPIO85, AF2, DRIVE_HIGH)
145#define GPIO86_KP_MKOUT_1 MFP_CFG_LPM(GPIO86, AF2, DRIVE_HIGH)
146#define GPIO87_KP_MKOUT_2 MFP_CFG_LPM(GPIO87, AF2, DRIVE_HIGH)
147#define GPIO88_KP_MKOUT_3 MFP_CFG_LPM(GPIO88, AF2, DRIVE_HIGH)
148#define GPIO104_KP_MKOUT_6 MFP_CFG_LPM(GPIO104, AF5, DRIVE_HIGH)
149#define GPIO105_KP_MKOUT_7 MFP_CFG_LPM(GPIO105, AF5, DRIVE_HIGH)
150#define GPIO121_KP_MKOUT_0 MFP_CFG_LPM(GPIO121, AF1, DRIVE_HIGH)
151#define GPIO122_KP_MKOUT_1 MFP_CFG_LPM(GPIO122, AF1, DRIVE_HIGH)
152#define GPIO123_KP_MKOUT_2 MFP_CFG_LPM(GPIO123, AF1, DRIVE_HIGH)
153#define GPIO124_KP_MKOUT_3 MFP_CFG_LPM(GPIO124, AF1, DRIVE_HIGH)
154#define GPIO125_KP_MKOUT_4 MFP_CFG_LPM(GPIO125, AF1, DRIVE_HIGH)
155#define GPIO126_KP_MKOUT_7 MFP_CFG_LPM(GPIO126, AF4, DRIVE_HIGH)
156#define GPIO5_2_KP_MKOUT_6 MFP_CFG_LPM(GPIO5_2, AF1, DRIVE_HIGH)
157#define GPIO4_2_KP_MKOUT_5 MFP_CFG_LPM(GPIO4_2, AF1, DRIVE_HIGH)
158#define GPIO6_2_KP_MKOUT_7 MFP_CFG_LPM(GPIO6_2, AF1, DRIVE_HIGH)
159
160/* LCD */
161#define GPIO54_LCD_LDD_0 MFP_CFG_DRV(GPIO54, AF1, DS01X)
162#define GPIO55_LCD_LDD_1 MFP_CFG_DRV(GPIO55, AF1, DS01X)
163#define GPIO56_LCD_LDD_2 MFP_CFG_DRV(GPIO56, AF1, DS01X)
164#define GPIO57_LCD_LDD_3 MFP_CFG_DRV(GPIO57, AF1, DS01X)
165#define GPIO58_LCD_LDD_4 MFP_CFG_DRV(GPIO58, AF1, DS01X)
166#define GPIO59_LCD_LDD_5 MFP_CFG_DRV(GPIO59, AF1, DS01X)
167#define GPIO60_LCD_LDD_6 MFP_CFG_DRV(GPIO60, AF1, DS01X)
168#define GPIO61_LCD_LDD_7 MFP_CFG_DRV(GPIO61, AF1, DS01X)
169#define GPIO62_LCD_LDD_8 MFP_CFG_DRV(GPIO62, AF1, DS01X)
170#define GPIO63_LCD_LDD_9 MFP_CFG_DRV(GPIO63, AF1, DS01X)
171#define GPIO64_LCD_LDD_10 MFP_CFG_DRV(GPIO64, AF1, DS01X)
172#define GPIO65_LCD_LDD_11 MFP_CFG_DRV(GPIO65, AF1, DS01X)
173#define GPIO66_LCD_LDD_12 MFP_CFG_DRV(GPIO66, AF1, DS01X)
174#define GPIO67_LCD_LDD_13 MFP_CFG_DRV(GPIO67, AF1, DS01X)
175#define GPIO68_LCD_LDD_14 MFP_CFG_DRV(GPIO68, AF1, DS01X)
176#define GPIO69_LCD_LDD_15 MFP_CFG_DRV(GPIO69, AF1, DS01X)
177#define GPIO70_LCD_LDD_16 MFP_CFG_DRV(GPIO70, AF1, DS01X)
178#define GPIO71_LCD_LDD_17 MFP_CFG_DRV(GPIO71, AF1, DS01X)
179#define GPIO62_LCD_CS_N MFP_CFG_DRV(GPIO62, AF2, DS01X)
180#define GPIO72_LCD_FCLK MFP_CFG_DRV(GPIO72, AF1, DS01X)
181#define GPIO73_LCD_LCLK MFP_CFG_DRV(GPIO73, AF1, DS01X)
182#define GPIO74_LCD_PCLK MFP_CFG_DRV(GPIO74, AF1, DS01X)
183#define GPIO75_LCD_BIAS MFP_CFG_DRV(GPIO75, AF1, DS01X)
184#define GPIO76_LCD_VSYNC MFP_CFG_DRV(GPIO76, AF2, DS01X)
185
186#define GPIO15_LCD_CS_N MFP_CFG_DRV(GPIO15, AF2, DS01X)
187#define GPIO127_LCD_CS_N MFP_CFG_DRV(GPIO127, AF1, DS01X)
188#define GPIO63_LCD_VSYNC MFP_CFG_DRV(GPIO63, AF2, DS01X)
189
190/* Mini-LCD */
191#define GPIO72_MLCD_FCLK MFP_CFG_DRV(GPIO72, AF7, DS08X)
192#define GPIO73_MLCD_LCLK MFP_CFG_DRV(GPIO73, AF7, DS08X)
193#define GPIO54_MLCD_LDD_0 MFP_CFG_DRV(GPIO54, AF7, DS08X)
194#define GPIO55_MLCD_LDD_1 MFP_CFG_DRV(GPIO55, AF7, DS08X)
195#define GPIO56_MLCD_LDD_2 MFP_CFG_DRV(GPIO56, AF7, DS08X)
196#define GPIO57_MLCD_LDD_3 MFP_CFG_DRV(GPIO57, AF7, DS08X)
197#define GPIO58_MLCD_LDD_4 MFP_CFG_DRV(GPIO58, AF7, DS08X)
198#define GPIO59_MLCD_LDD_5 MFP_CFG_DRV(GPIO59, AF7, DS08X)
199#define GPIO60_MLCD_LDD_6 MFP_CFG_DRV(GPIO60, AF7, DS08X)
200#define GPIO61_MLCD_LDD_7 MFP_CFG_DRV(GPIO61, AF7, DS08X)
201#define GPIO62_MLCD_LDD_8 MFP_CFG_DRV(GPIO62, AF7, DS08X)
202#define GPIO63_MLCD_LDD_9 MFP_CFG_DRV(GPIO63, AF7, DS08X)
203#define GPIO64_MLCD_LDD_10 MFP_CFG_DRV(GPIO64, AF7, DS08X)
204#define GPIO65_MLCD_LDD_11 MFP_CFG_DRV(GPIO65, AF7, DS08X)
205#define GPIO66_MLCD_LDD_12 MFP_CFG_DRV(GPIO66, AF7, DS08X)
206#define GPIO67_MLCD_LDD_13 MFP_CFG_DRV(GPIO67, AF7, DS08X)
207#define GPIO68_MLCD_LDD_14 MFP_CFG_DRV(GPIO68, AF7, DS08X)
208#define GPIO69_MLCD_LDD_15 MFP_CFG_DRV(GPIO69, AF7, DS08X)
209#define GPIO74_MLCD_PCLK MFP_CFG_DRV(GPIO74, AF7, DS08X)
210#define GPIO75_MLCD_BIAS MFP_CFG_DRV(GPIO75, AF2, DS08X)
211
212/* MMC1 */
213#define GPIO7_MMC1_CLK MFP_CFG_LPM(GPIO7, AF4, DRIVE_HIGH)
214#define GPIO8_MMC1_CMD MFP_CFG_LPM(GPIO8, AF4, DRIVE_HIGH)
215#define GPIO14_MMC1_CMD MFP_CFG_LPM(GPIO14, AF5, DRIVE_HIGH)
216#define GPIO15_MMC1_CMD MFP_CFG_LPM(GPIO15, AF5, DRIVE_HIGH)
217#define GPIO3_MMC1_DAT0 MFP_CFG_LPM(GPIO3, AF4, DRIVE_HIGH)
218#define GPIO4_MMC1_DAT1 MFP_CFG_LPM(GPIO4, AF4, DRIVE_HIGH)
219#define GPIO5_MMC1_DAT2 MFP_CFG_LPM(GPIO5, AF4, DRIVE_HIGH)
220#define GPIO6_MMC1_DAT3 MFP_CFG_LPM(GPIO6, AF4, DRIVE_HIGH)
221
222/* MMC2 */
223#define GPIO9_MMC2_DAT0 MFP_CFG_LPM(GPIO9, AF4, PULL_HIGH)
224#define GPIO10_MMC2_DAT1 MFP_CFG_LPM(GPIO10, AF4, PULL_HIGH)
225#define GPIO11_MMC2_DAT2 MFP_CFG_LPM(GPIO11, AF4, PULL_HIGH)
226#define GPIO12_MMC2_DAT3 MFP_CFG_LPM(GPIO12, AF4, PULL_HIGH)
227#define GPIO13_MMC2_CLK MFP_CFG_LPM(GPIO13, AF4, PULL_HIGH)
228#define GPIO14_MMC2_CMD MFP_CFG_LPM(GPIO14, AF4, PULL_HIGH)
229#define GPIO77_MMC2_DAT0 MFP_CFG_LPM(GPIO77, AF4, PULL_HIGH)
230#define GPIO78_MMC2_DAT1 MFP_CFG_LPM(GPIO78, AF4, PULL_HIGH)
231#define GPIO79_MMC2_DAT2 MFP_CFG_LPM(GPIO79, AF4, PULL_HIGH)
232#define GPIO80_MMC2_DAT3 MFP_CFG_LPM(GPIO80, AF4, PULL_HIGH)
233#define GPIO81_MMC2_CLK MFP_CFG_LPM(GPIO81, AF4, PULL_HIGH)
234#define GPIO82_MMC2_CMD MFP_CFG_LPM(GPIO82, AF4, PULL_HIGH)
235
236/* SSP1 */
237#define GPIO89_SSP1_EXTCLK MFP_CFG(GPIO89, AF1)
238#define GPIO90_SSP1_SYSCLK MFP_CFG(GPIO90, AF1)
239#define GPIO15_SSP1_SCLK MFP_CFG(GPIO15, AF6)
240#define GPIO16_SSP1_FRM MFP_CFG(GPIO16, AF2)
241#define GPIO33_SSP1_SCLK MFP_CFG(GPIO33, AF5)
242#define GPIO34_SSP1_FRM MFP_CFG(GPIO34, AF5)
243#define GPIO85_SSP1_SCLK MFP_CFG(GPIO85, AF1)
244#define GPIO86_SSP1_FRM MFP_CFG(GPIO86, AF1)
245#define GPIO18_SSP1_TXD MFP_CFG(GPIO18, AF7)
246#define GPIO18_SSP1_RXD MFP_CFG(GPIO18, AF2)
247#define GPIO20_SSP1_TXD MFP_CFG(GPIO20, AF2)
248#define GPIO20_SSP1_RXD MFP_CFG(GPIO20, AF7)
249#define GPIO35_SSP1_TXD MFP_CFG(GPIO35, AF5)
250#define GPIO35_SSP1_RXD MFP_CFG(GPIO35, AF4)
251#define GPIO36_SSP1_TXD MFP_CFG(GPIO36, AF5)
252#define GPIO36_SSP1_RXD MFP_CFG(GPIO36, AF6)
253#define GPIO87_SSP1_TXD MFP_CFG(GPIO87, AF1)
254#define GPIO87_SSP1_RXD MFP_CFG(GPIO87, AF6)
255#define GPIO88_SSP1_TXD MFP_CFG(GPIO88, AF6)
256#define GPIO88_SSP1_RXD MFP_CFG(GPIO88, AF1)
257
258/* SSP2 */
259#define GPIO29_SSP2_EXTCLK MFP_CFG(GPIO29, AF2)
260#define GPIO23_SSP2_SCLK MFP_CFG(GPIO23, AF2)
261#define GPIO17_SSP2_FRM MFP_CFG(GPIO17, AF2)
262#define GPIO25_SSP2_SCLK MFP_CFG(GPIO25, AF2)
263#define GPIO26_SSP2_FRM MFP_CFG(GPIO26, AF2)
264#define GPIO33_SSP2_SCLK MFP_CFG(GPIO33, AF6)
265#define GPIO34_SSP2_FRM MFP_CFG(GPIO34, AF6)
266#define GPIO64_SSP2_SCLK MFP_CFG(GPIO64, AF2)
267#define GPIO65_SSP2_FRM MFP_CFG(GPIO65, AF2)
268#define GPIO19_SSP2_TXD MFP_CFG(GPIO19, AF2)
269#define GPIO19_SSP2_RXD MFP_CFG(GPIO19, AF7)
270#define GPIO24_SSP2_TXD MFP_CFG(GPIO24, AF5)
271#define GPIO24_SSP2_RXD MFP_CFG(GPIO24, AF4)
272#define GPIO27_SSP2_TXD MFP_CFG(GPIO27, AF2)
273#define GPIO27_SSP2_RXD MFP_CFG(GPIO27, AF5)
274#define GPIO28_SSP2_TXD MFP_CFG(GPIO28, AF5)
275#define GPIO28_SSP2_RXD MFP_CFG(GPIO28, AF2)
276#define GPIO35_SSP2_TXD MFP_CFG(GPIO35, AF7)
277#define GPIO35_SSP2_RXD MFP_CFG(GPIO35, AF6)
278#define GPIO66_SSP2_TXD MFP_CFG(GPIO66, AF4)
279#define GPIO66_SSP2_RXD MFP_CFG(GPIO66, AF2)
280#define GPIO67_SSP2_TXD MFP_CFG(GPIO67, AF2)
281#define GPIO67_SSP2_RXD MFP_CFG(GPIO67, AF4)
282#define GPIO36_SSP2_TXD MFP_CFG(GPIO36, AF7)
283
284/* SSP3 */
285#define GPIO69_SSP3_FRM MFP_CFG_X(GPIO69, AF2, DS08X, DRIVE_LOW)
286#define GPIO68_SSP3_SCLK MFP_CFG_X(GPIO68, AF2, DS08X, FLOAT)
287#define GPIO92_SSP3_FRM MFP_CFG_X(GPIO92, AF1, DS08X, DRIVE_LOW)
288#define GPIO91_SSP3_SCLK MFP_CFG_X(GPIO91, AF1, DS08X, FLOAT)
289#define GPIO70_SSP3_TXD MFP_CFG_X(GPIO70, AF2, DS08X, DRIVE_LOW)
290#define GPIO70_SSP3_RXD MFP_CFG_X(GPIO70, AF5, DS08X, FLOAT)
291#define GPIO71_SSP3_TXD MFP_CFG_X(GPIO71, AF5, DS08X, DRIVE_LOW)
292#define GPIO71_SSP3_RXD MFP_CFG_X(GPIO71, AF2, DS08X, FLOAT)
293#define GPIO93_SSP3_TXD MFP_CFG_X(GPIO93, AF1, DS08X, DRIVE_LOW)
294#define GPIO93_SSP3_RXD MFP_CFG_X(GPIO93, AF5, DS08X, FLOAT)
295#define GPIO94_SSP3_TXD MFP_CFG_X(GPIO94, AF5, DS08X, DRIVE_LOW)
296#define GPIO94_SSP3_RXD MFP_CFG_X(GPIO94, AF1, DS08X, FLOAT)
297
298/* SSP4 */
299#define GPIO95_SSP4_SCLK MFP_CFG_LPM(GPIO95, AF1, PULL_HIGH)
300#define GPIO96_SSP4_FRM MFP_CFG_LPM(GPIO96, AF1, PULL_HIGH)
301#define GPIO97_SSP4_TXD MFP_CFG_LPM(GPIO97, AF1, PULL_HIGH)
302#define GPIO97_SSP4_RXD MFP_CFG_LPM(GPIO97, AF5, PULL_HIGH)
303#define GPIO98_SSP4_TXD MFP_CFG_LPM(GPIO98, AF5, PULL_HIGH)
304#define GPIO98_SSP4_RXD MFP_CFG_LPM(GPIO98, AF1, PULL_HIGH)
305
306/* UART1 */
307#define GPIO32_UART1_CTS MFP_CFG_LPM(GPIO32, AF2, FLOAT)
308#define GPIO37_UART1_CTS MFP_CFG_LPM(GPIO37, AF4, FLOAT)
309#define GPIO79_UART1_CTS MFP_CFG_LPM(GPIO79, AF1, FLOAT)
310#define GPIO84_UART1_CTS MFP_CFG_LPM(GPIO84, AF3, FLOAT)
311#define GPIO101_UART1_CTS MFP_CFG_LPM(GPIO101, AF1, FLOAT)
312#define GPIO106_UART1_CTS MFP_CFG_LPM(GPIO106, AF6, FLOAT)
313
314#define GPIO32_UART1_RTS MFP_CFG_LPM(GPIO32, AF4, FLOAT)
315#define GPIO37_UART1_RTS MFP_CFG_LPM(GPIO37, AF2, FLOAT)
316#define GPIO79_UART1_RTS MFP_CFG_LPM(GPIO79, AF3, FLOAT)
317#define GPIO84_UART1_RTS MFP_CFG_LPM(GPIO84, AF1, FLOAT)
318#define GPIO101_UART1_RTS MFP_CFG_LPM(GPIO101, AF6, FLOAT)
319#define GPIO106_UART1_RTS MFP_CFG_LPM(GPIO106, AF1, FLOAT)
320
321#define GPIO34_UART1_DSR MFP_CFG_LPM(GPIO34, AF2, FLOAT)
322#define GPIO36_UART1_DSR MFP_CFG_LPM(GPIO36, AF4, FLOAT)
323#define GPIO81_UART1_DSR MFP_CFG_LPM(GPIO81, AF1, FLOAT)
324#define GPIO83_UART1_DSR MFP_CFG_LPM(GPIO83, AF3, FLOAT)
325#define GPIO103_UART1_DSR MFP_CFG_LPM(GPIO103, AF1, FLOAT)
326#define GPIO105_UART1_DSR MFP_CFG_LPM(GPIO105, AF6, FLOAT)
327
328#define GPIO34_UART1_DTR MFP_CFG_LPM(GPIO34, AF4, FLOAT)
329#define GPIO36_UART1_DTR MFP_CFG_LPM(GPIO36, AF2, FLOAT)
330#define GPIO81_UART1_DTR MFP_CFG_LPM(GPIO81, AF3, FLOAT)
331#define GPIO83_UART1_DTR MFP_CFG_LPM(GPIO83, AF1, FLOAT)
332#define GPIO103_UART1_DTR MFP_CFG_LPM(GPIO103, AF6, FLOAT)
333#define GPIO105_UART1_DTR MFP_CFG_LPM(GPIO105, AF1, FLOAT)
334
335#define GPIO35_UART1_RI MFP_CFG_LPM(GPIO35, AF2, FLOAT)
336#define GPIO82_UART1_RI MFP_CFG_LPM(GPIO82, AF1, FLOAT)
337#define GPIO104_UART1_RI MFP_CFG_LPM(GPIO104, AF1, FLOAT)
338
339#define GPIO33_UART1_DCD MFP_CFG_LPM(GPIO33, AF2, FLOAT)
340#define GPIO80_UART1_DCD MFP_CFG_LPM(GPIO80, AF1, FLOAT)
341#define GPIO102_UART1_DCD MFP_CFG_LPM(GPIO102, AF1, FLOAT)
342
343#define GPIO30_UART1_RXD MFP_CFG_LPM(GPIO30, AF2, FLOAT)
344#define GPIO31_UART1_RXD MFP_CFG_LPM(GPIO31, AF4, FLOAT)
345#define GPIO77_UART1_RXD MFP_CFG_LPM(GPIO77, AF1, FLOAT)
346#define GPIO78_UART1_RXD MFP_CFG_LPM(GPIO78, AF3, FLOAT)
347#define GPIO99_UART1_RXD MFP_CFG_LPM(GPIO99, AF1, FLOAT)
348#define GPIO100_UART1_RXD MFP_CFG_LPM(GPIO100, AF6, FLOAT)
349#define GPIO102_UART1_RXD MFP_CFG_LPM(GPIO102, AF6, FLOAT)
350#define GPIO104_UART1_RXD MFP_CFG_LPM(GPIO104, AF4, FLOAT)
351
352#define GPIO30_UART1_TXD MFP_CFG_LPM(GPIO30, AF4, FLOAT)
353#define GPIO31_UART1_TXD MFP_CFG_LPM(GPIO31, AF2, FLOAT)
354#define GPIO77_UART1_TXD MFP_CFG_LPM(GPIO77, AF3, FLOAT)
355#define GPIO78_UART1_TXD MFP_CFG_LPM(GPIO78, AF1, FLOAT)
356#define GPIO99_UART1_TXD MFP_CFG_LPM(GPIO99, AF6, FLOAT)
357#define GPIO100_UART1_TXD MFP_CFG_LPM(GPIO100, AF1, FLOAT)
358#define GPIO102_UART1_TXD MFP_CFG_LPM(GPIO102, AF4, FLOAT)
359
360/* UART2 */
361#define GPIO15_UART2_CTS MFP_CFG_LPM(GPIO15, AF3, FLOAT)
362#define GPIO16_UART2_CTS MFP_CFG_LPM(GPIO16, AF5, FLOAT)
363#define GPIO111_UART2_CTS MFP_CFG_LPM(GPIO111, AF3, FLOAT)
364#define GPIO114_UART2_CTS MFP_CFG_LPM(GPIO114, AF1, FLOAT)
365
366#define GPIO15_UART2_RTS MFP_CFG_LPM(GPIO15, AF4, FLOAT)
367#define GPIO16_UART2_RTS MFP_CFG_LPM(GPIO16, AF4, FLOAT)
368#define GPIO114_UART2_RTS MFP_CFG_LPM(GPIO114, AF3, FLOAT)
369#define GPIO111_UART2_RTS MFP_CFG_LPM(GPIO111, AF1, FLOAT)
370
371#define GPIO18_UART2_RXD MFP_CFG_LPM(GPIO18, AF5, FLOAT)
372#define GPIO19_UART2_RXD MFP_CFG_LPM(GPIO19, AF4, FLOAT)
373#define GPIO112_UART2_RXD MFP_CFG_LPM(GPIO112, AF1, FLOAT)
374#define GPIO113_UART2_RXD MFP_CFG_LPM(GPIO113, AF3, FLOAT)
375
376#define GPIO18_UART2_TXD MFP_CFG_LPM(GPIO18, AF4, FLOAT)
377#define GPIO19_UART2_TXD MFP_CFG_LPM(GPIO19, AF5, FLOAT)
378#define GPIO112_UART2_TXD MFP_CFG_LPM(GPIO112, AF3, FLOAT)
379#define GPIO113_UART2_TXD MFP_CFG_LPM(GPIO113, AF1, FLOAT)
380
381/* UART3 */
382#define GPIO91_UART3_CTS MFP_CFG_LPM(GPIO91, AF2, FLOAT)
383#define GPIO92_UART3_CTS MFP_CFG_LPM(GPIO92, AF4, FLOAT)
384#define GPIO107_UART3_CTS MFP_CFG_LPM(GPIO107, AF1, FLOAT)
385#define GPIO108_UART3_CTS MFP_CFG_LPM(GPIO108, AF3, FLOAT)
386
387#define GPIO91_UART3_RTS MFP_CFG_LPM(GPIO91, AF4, FLOAT)
388#define GPIO92_UART3_RTS MFP_CFG_LPM(GPIO92, AF2, FLOAT)
389#define GPIO107_UART3_RTS MFP_CFG_LPM(GPIO107, AF3, FLOAT)
390#define GPIO108_UART3_RTS MFP_CFG_LPM(GPIO108, AF1, FLOAT)
391
392#define GPIO7_UART3_RXD MFP_CFG_LPM(GPIO7, AF2, FLOAT)
393#define GPIO8_UART3_RXD MFP_CFG_LPM(GPIO8, AF6, FLOAT)
394#define GPIO93_UART3_RXD MFP_CFG_LPM(GPIO93, AF4, FLOAT)
395#define GPIO94_UART3_RXD MFP_CFG_LPM(GPIO94, AF2, FLOAT)
396#define GPIO109_UART3_RXD MFP_CFG_LPM(GPIO109, AF3, FLOAT)
397#define GPIO110_UART3_RXD MFP_CFG_LPM(GPIO110, AF1, FLOAT)
398
399#define GPIO7_UART3_TXD MFP_CFG_LPM(GPIO7, AF6, FLOAT)
400#define GPIO8_UART3_TXD MFP_CFG_LPM(GPIO8, AF2, FLOAT)
401#define GPIO93_UART3_TXD MFP_CFG_LPM(GPIO93, AF2, FLOAT)
402#define GPIO94_UART3_TXD MFP_CFG_LPM(GPIO94, AF4, FLOAT)
403#define GPIO109_UART3_TXD MFP_CFG_LPM(GPIO109, AF1, FLOAT)
404#define GPIO110_UART3_TXD MFP_CFG_LPM(GPIO110, AF3, FLOAT)
405
406/* USB Host */
407#define GPIO0_2_USBH_PEN MFP_CFG(GPIO0_2, AF1)
408#define GPIO1_2_USBH_PWR MFP_CFG(GPIO1_2, AF1)
409
410/* USB P3 */
411#define GPIO77_USB_P3_1 MFP_CFG(GPIO77, AF2)
412#define GPIO78_USB_P3_2 MFP_CFG(GPIO78, AF2)
413#define GPIO79_USB_P3_3 MFP_CFG(GPIO79, AF2)
414#define GPIO80_USB_P3_4 MFP_CFG(GPIO80, AF2)
415#define GPIO81_USB_P3_5 MFP_CFG(GPIO81, AF2)
416#define GPIO82_USB_P3_6 MFP_CFG(GPIO82, AF2)
417
418/* PWM */
419#define GPIO17_PWM0_OUT MFP_CFG(GPIO17, AF1)
420#define GPIO18_PWM1_OUT MFP_CFG(GPIO18, AF1)
421#define GPIO19_PWM2_OUT MFP_CFG(GPIO19, AF1)
422#define GPIO20_PWM3_OUT MFP_CFG(GPIO20, AF1)
423
424/* CIR */
425#define GPIO8_CIR_OUT MFP_CFG(GPIO8, AF5)
426#define GPIO16_CIR_OUT MFP_CFG(GPIO16, AF3)
427
428#define GPIO20_OW_DQ_IN MFP_CFG(GPIO20, AF5)
429#define GPIO126_OW_DQ MFP_CFG(GPIO126, AF2)
430
431#define GPIO0_DF_RDY MFP_CFG(GPIO0, AF1)
432#define GPIO7_CLK_BYPASS_XSC MFP_CFG(GPIO7, AF7)
433#define GPIO17_EXT_SYNC_MVT_0 MFP_CFG(GPIO17, AF6)
434#define GPIO18_EXT_SYNC_MVT_1 MFP_CFG(GPIO18, AF6)
435#define GPIO19_OST_CHOUT_MVT_0 MFP_CFG(GPIO19, AF6)
436#define GPIO20_OST_CHOUT_MVT_1 MFP_CFG(GPIO20, AF6)
437#define GPIO49_48M_CLK MFP_CFG(GPIO49, AF2)
438#define GPIO126_EXT_CLK MFP_CFG(GPIO126, AF3)
439#define GPIO127_CLK_BYPASS_GB MFP_CFG(GPIO127, AF7)
440#define GPIO71_EXT_MATCH_MVT MFP_CFG(GPIO71, AF6)
441
442#define GPIO3_uIO_IN MFP_CFG(GPIO3, AF1)
443
444#define GPIO4_uSIM_CARD_STATE MFP_CFG(GPIO4, AF1)
445#define GPIO5_uSIM_uCLK MFP_CFG(GPIO5, AF1)
446#define GPIO6_uSIM_uRST MFP_CFG(GPIO6, AF1)
447#define GPIO16_uSIM_UVS_0 MFP_CFG(GPIO16, AF1)
448
449#define GPIO9_SCIO MFP_CFG(GPIO9, AF1)
450#define GPIO20_RTC_MVT MFP_CFG(GPIO20, AF4)
451#define GPIO126_RTC_MVT MFP_CFG(GPIO126, AF1)
452
453/*
454 * PXA300 specific MFP configurations
455 */
456#ifdef CONFIG_CPU_PXA300
457#define GPIO99_USB_P2_2 MFP_CFG(GPIO99, AF2)
458#define GPIO99_USB_P2_5 MFP_CFG(GPIO99, AF3)
459#define GPIO99_USB_P2_6 MFP_CFG(GPIO99, AF4)
460#define GPIO100_USB_P2_2 MFP_CFG(GPIO100, AF4)
461#define GPIO100_USB_P2_5 MFP_CFG(GPIO100, AF5)
462#define GPIO101_USB_P2_1 MFP_CFG(GPIO101, AF2)
463#define GPIO102_USB_P2_4 MFP_CFG(GPIO102, AF2)
464#define GPIO104_USB_P2_3 MFP_CFG(GPIO104, AF2)
465#define GPIO105_USB_P2_5 MFP_CFG(GPIO105, AF2)
466#define GPIO100_USB_P2_6 MFP_CFG(GPIO100, AF2)
467#define GPIO106_USB_P2_7 MFP_CFG(GPIO106, AF2)
468#define GPIO103_USB_P2_8 MFP_CFG(GPIO103, AF2)
469
470/* U2D UTMI */
471#define GPIO38_UTM_CLK MFP_CFG(GPIO38, AF1)
472#define GPIO26_U2D_RXERROR MFP_CFG(GPIO26, AF3)
473#define GPIO50_U2D_RXERROR MFP_CFG(GPIO50, AF1)
474#define GPIO89_U2D_RXERROR MFP_CFG(GPIO89, AF5)
475#define GPIO24_UTM_RXVALID MFP_CFG(GPIO24, AF3)
476#define GPIO48_UTM_RXVALID MFP_CFG(GPIO48, AF2)
477#define GPIO87_UTM_RXVALID MFP_CFG(GPIO87, AF5)
478#define GPIO25_UTM_RXACTIVE MFP_CFG(GPIO25, AF3)
479#define GPIO47_UTM_RXACTIVE MFP_CFG(GPIO47, AF2)
480#define GPIO49_UTM_RXACTIVE MFP_CFG(GPIO49, AF1)
481#define GPIO88_UTM_RXACTIVE MFP_CFG(GPIO88, AF5)
482#define GPIO53_UTM_TXREADY MFP_CFG(GPIO53, AF1)
483#define GPIO67_UTM_LINESTATE_0 MFP_CFG(GPIO67, AF3)
484#define GPIO92_UTM_LINESTATE_0 MFP_CFG(GPIO92, AF3)
485#define GPIO104_UTM_LINESTATE_0 MFP_CFG(GPIO104, AF3)
486#define GPIO109_UTM_LINESTATE_0 MFP_CFG(GPIO109, AF4)
487#define GPIO68_UTM_LINESTATE_1 MFP_CFG(GPIO68, AF3)
488#define GPIO93_UTM_LINESTATE_1 MFP_CFG(GPIO93, AF3)
489#define GPIO105_UTM_LINESTATE_1 MFP_CFG(GPIO105, AF3)
490#define GPIO27_U2D_OPMODE_0 MFP_CFG(GPIO27, AF4)
491#define GPIO51_U2D_OPMODE_0 MFP_CFG(GPIO51, AF2)
492#define GPIO90_U2D_OPMODE_0 MFP_CFG(GPIO90, AF7)
493#define GPIO28_U2D_OPMODE_1 MFP_CFG(GPIO28, AF4)
494#define GPIO52_U2D_OPMODE_1 MFP_CFG(GPIO52, AF2)
495#define GPIO106_U2D_OPMODE_1 MFP_CFG(GPIO106, AF3)
496#define GPIO110_U2D_OPMODE_1 MFP_CFG(GPIO110, AF5)
497#define GPIO76_U2D_RESET MFP_CFG(GPIO76, AF1)
498#define GPIO95_U2D_RESET MFP_CFG(GPIO95, AF2)
499#define GPIO100_U2D_RESET MFP_CFG(GPIO100, AF3)
500#define GPIO66_U2D_SUSPEND MFP_CFG(GPIO66, AF3)
501#define GPIO98_U2D_SUSPEND MFP_CFG(GPIO98, AF2)
502#define GPIO103_U2D_SUSPEND MFP_CFG(GPIO103, AF3)
503#define GPIO65_U2D_TERM_SEL MFP_CFG(GPIO65, AF5)
504#define GPIO97_U2D_TERM_SEL MFP_CFG(GPIO97, AF3)
505#define GPIO102_U2D_TERM_SEL MFP_CFG(GPIO102, AF5)
506#define GPIO29_U2D_TXVALID MFP_CFG(GPIO29, AF3)
507#define GPIO52_U2D_TXVALID MFP_CFG(GPIO52, AF4)
508#define GPIO69_U2D_TXVALID MFP_CFG(GPIO69, AF3)
509#define GPIO85_U2D_TXVALID MFP_CFG(GPIO85, AF7)
510#define GPIO64_U2D_XCVR_SEL MFP_CFG(GPIO64, AF5)
511#define GPIO96_U2D_XCVR_SEL MFP_CFG(GPIO96, AF3)
512#define GPIO101_U2D_XCVR_SEL MFP_CFG(GPIO101, AF5)
513#define GPIO30_UTM_PHYDATA_0 MFP_CFG(GPIO30, AF3)
514#define GPIO31_UTM_PHYDATA_1 MFP_CFG(GPIO31, AF3)
515#define GPIO32_UTM_PHYDATA_2 MFP_CFG(GPIO32, AF3)
516#define GPIO33_UTM_PHYDATA_3 MFP_CFG(GPIO33, AF3)
517#define GPIO34_UTM_PHYDATA_4 MFP_CFG(GPIO34, AF3)
518#define GPIO35_UTM_PHYDATA_5 MFP_CFG(GPIO35, AF3)
519#define GPIO36_UTM_PHYDATA_6 MFP_CFG(GPIO36, AF3)
520#define GPIO37_UTM_PHYDATA_7 MFP_CFG(GPIO37, AF3)
521#define GPIO39_UTM_PHYDATA_0 MFP_CFG(GPIO39, AF3)
522#define GPIO40_UTM_PHYDATA_1 MFP_CFG(GPIO40, AF3)
523#define GPIO41_UTM_PHYDATA_2 MFP_CFG(GPIO41, AF3)
524#define GPIO42_UTM_PHYDATA_3 MFP_CFG(GPIO42, AF3)
525#define GPIO43_UTM_PHYDATA_4 MFP_CFG(GPIO43, AF3)
526#define GPIO44_UTM_PHYDATA_5 MFP_CFG(GPIO44, AF3)
527#define GPIO45_UTM_PHYDATA_6 MFP_CFG(GPIO45, AF3)
528#define GPIO46_UTM_PHYDATA_7 MFP_CFG(GPIO46, AF3)
529#endif /* CONFIG_CPU_PXA300 */
530
531/*
532 * PXA310 specific MFP configurations
533 */
534#ifdef CONFIG_CPU_PXA310
535/* USB P2 */
536#define GPIO36_USB_P2_1 MFP_CFG(GPIO36, AF1)
537#define GPIO30_USB_P2_2 MFP_CFG(GPIO30, AF1)
538#define GPIO35_USB_P2_3 MFP_CFG(GPIO35, AF1)
539#define GPIO32_USB_P2_4 MFP_CFG(GPIO32, AF1)
540#define GPIO34_USB_P2_5 MFP_CFG(GPIO34, AF1)
541#define GPIO31_USB_P2_6 MFP_CFG(GPIO31, AF1)
542
543/* MMC1 */
544#define GPIO24_MMC1_CMD MFP_CFG(GPIO24, AF3)
545#define GPIO29_MMC1_DAT0 MFP_CFG(GPIO29, AF3)
546
547/* MMC3 */
548#define GPIO103_MMC3_CLK MFP_CFG(GPIO103, AF2)
549#define GPIO105_MMC3_CMD MFP_CFG(GPIO105, AF2)
550#define GPIO11_2_MMC3_CLK MFP_CFG(GPIO11_2, AF1)
551#define GPIO12_2_MMC3_CMD MFP_CFG(GPIO12_2, AF1)
552#define GPIO7_2_MMC3_DAT0 MFP_CFG(GPIO7_2, AF1)
553#define GPIO8_2_MMC3_DAT1 MFP_CFG(GPIO8_2, AF1)
554#define GPIO9_2_MMC3_DAT2 MFP_CFG(GPIO9_2, AF1)
555#define GPIO10_2_MMC3_DAT3 MFP_CFG(GPIO10_2, AF1)
556
557/* ULPI */
558#define GPIO38_ULPI_CLK MFP_CFG(GPIO38, AF1)
559#define GPIO30_ULPI_DATA_OUT_0 MFP_CFG(GPIO30, AF3)
560#define GPIO31_ULPI_DATA_OUT_1 MFP_CFG(GPIO31, AF3)
561#define GPIO32_ULPI_DATA_OUT_2 MFP_CFG(GPIO32, AF3)
562#define GPIO33_ULPI_DATA_OUT_3 MFP_CFG(GPIO33, AF3)
563#define GPIO34_ULPI_DATA_OUT_4 MFP_CFG(GPIO34, AF3)
564#define GPIO35_ULPI_DATA_OUT_5 MFP_CFG(GPIO35, AF3)
565#define GPIO36_ULPI_DATA_OUT_6 MFP_CFG(GPIO36, AF3)
566#define GPIO37_ULPI_DATA_OUT_7 MFP_CFG(GPIO37, AF3)
567#define GPIO33_ULPI_OTG_INTR MFP_CFG(GPIO33, AF1)
568
569#define ULPI_DIR MFP_CFG_DRV(ULPI_DIR, MFP_AF0, MFP_DS01X)
570#define ULPI_NXT MFP_CFG_DRV(ULPI_NXT, MFP_AF0, MFP_DS01X)
571#define ULPI_STP MFP_CFG_DRV(ULPI_STP, MFP_AF0, MFP_DS01X)
572#endif /* CONFIG_CPU_PXA310 */
573
574#endif /* __ASM_ARCH_MFP_PXA300_H */
diff --git a/include/asm-arm/arch-pxa/mfp-pxa320.h b/include/asm-arm/arch-pxa/mfp-pxa320.h
new file mode 100644
index 000000000000..ae8ba34194cf
--- /dev/null
+++ b/include/asm-arm/arch-pxa/mfp-pxa320.h
@@ -0,0 +1,446 @@
1/*
2 * linux/include/asm-arm/arch-pxa/mfp-pxa320.h
3 *
4 * PXA320 specific MFP configuration definitions
5 *
6 * Copyright (C) 2007 Marvell International Ltd.
7 * 2007-08-21: eric miao <eric.y.miao@gmail.com>
8 * initial version
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 __ASM_ARCH_MFP_PXA320_H
16#define __ASM_ARCH_MFP_PXA320_H
17
18#include <asm/arch/mfp.h>
19
20/* GPIO */
21#define GPIO46_GPIO MFP_CFG(GPIO6, AF0)
22#define GPIO49_GPIO MFP_CFG(GPIO49, AF0)
23#define GPIO50_GPIO MFP_CFG(GPIO50, AF0)
24#define GPIO51_GPIO MFP_CFG(GPIO51, AF0)
25#define GPIO52_GPIO MFP_CFG(GPIO52, AF0)
26
27#define GPIO7_2_GPIO MFP_CFG(GPIO7_2, AF0)
28#define GPIO8_2_GPIO MFP_CFG(GPIO8_2, AF0)
29#define GPIO9_2_GPIO MFP_CFG(GPIO9_2, AF0)
30#define GPIO10_2_GPIO MFP_CFG(GPIO10_2, AF0)
31#define GPIO11_2_GPIO MFP_CFG(GPIO11_2, AF0)
32#define GPIO12_2_GPIO MFP_CFG(GPIO12_2, AF0)
33#define GPIO13_2_GPIO MFP_CFG(GPIO13_2, AF0)
34#define GPIO14_2_GPIO MFP_CFG(GPIO14_2, AF0)
35#define GPIO15_2_GPIO MFP_CFG(GPIO15_2, AF0)
36#define GPIO16_2_GPIO MFP_CFG(GPIO16_2, AF0)
37#define GPIO17_2_GPIO MFP_CFG(GPIO17_2, AF0)
38
39/* Chip Select */
40#define GPIO4_nCS3 MFP_CFG(GPIO4, AF1)
41
42/* AC97 */
43#define GPIO34_AC97_SYSCLK MFP_CFG(GPIO34, AF1)
44#define GPIO39_AC97_BITCLK MFP_CFG(GPIO39, AF1)
45#define GPIO40_AC97_nACRESET MFP_CFG(GPIO40, AF1)
46#define GPIO35_AC97_SDATA_IN_0 MFP_CFG(GPIO35, AF1)
47#define GPIO36_AC97_SDATA_IN_1 MFP_CFG(GPIO36, AF1)
48#define GPIO32_AC97_SDATA_IN_2 MFP_CFG(GPIO32, AF2)
49#define GPIO33_AC97_SDATA_IN_3 MFP_CFG(GPIO33, AF2)
50#define GPIO11_AC97_SDATA_IN_2 MFP_CFG(GPIO11, AF3)
51#define GPIO12_AC97_SDATA_IN_3 MFP_CFG(GPIO12, AF3)
52#define GPIO37_AC97_SDATA_OUT MFP_CFG(GPIO37, AF1)
53#define GPIO38_AC97_SYNC MFP_CFG(GPIO38, AF1)
54
55/* I2C */
56#define GPIO32_I2C_SCL MFP_CFG_LPM(GPIO32, AF1, PULL_HIGH)
57#define GPIO33_I2C_SDA MFP_CFG_LPM(GPIO33, AF1, PULL_HIGH)
58
59/* QCI */
60#define GPIO49_CI_DD_0 MFP_CFG_DRV(GPIO49, AF1, DS04X)
61#define GPIO50_CI_DD_1 MFP_CFG_DRV(GPIO50, AF1, DS04X)
62#define GPIO51_CI_DD_2 MFP_CFG_DRV(GPIO51, AF1, DS04X)
63#define GPIO52_CI_DD_3 MFP_CFG_DRV(GPIO52, AF1, DS04X)
64#define GPIO53_CI_DD_4 MFP_CFG_DRV(GPIO53, AF1, DS04X)
65#define GPIO54_CI_DD_5 MFP_CFG_DRV(GPIO54, AF1, DS04X)
66#define GPIO55_CI_DD_6 MFP_CFG_DRV(GPIO55, AF1, DS04X)
67#define GPIO56_CI_DD_7 MFP_CFG_DRV(GPIO56, AF0, DS04X)
68#define GPIO57_CI_DD_8 MFP_CFG_DRV(GPIO57, AF1, DS04X)
69#define GPIO58_CI_DD_9 MFP_CFG_DRV(GPIO58, AF1, DS04X)
70#define GPIO59_CI_MCLK MFP_CFG_DRV(GPIO59, AF0, DS04X)
71#define GPIO60_CI_PCLK MFP_CFG_DRV(GPIO60, AF0, DS04X)
72#define GPIO61_CI_HSYNC MFP_CFG_DRV(GPIO61, AF0, DS04X)
73#define GPIO62_CI_VSYNC MFP_CFG_DRV(GPIO62, AF0, DS04X)
74
75#define GPIO31_CIR_OUT MFP_CFG(GPIO31, AF5)
76
77#define GPIO0_2_CLK_EXT MFP_CFG(GPIO0_2, AF3)
78#define GPIO0_DRQ MFP_CFG(GPIO0, AF2)
79#define GPIO11_EXT_SYNC0 MFP_CFG(GPIO11, AF5)
80#define GPIO12_EXT_SYNC1 MFP_CFG(GPIO12, AF6)
81#define GPIO0_2_HZ_CLK MFP_CFG(GPIO0_2, AF1)
82#define GPIO14_HZ_CLK MFP_CFG(GPIO14, AF4)
83#define GPIO30_ICP_RXD MFP_CFG(GPIO30, AF1)
84#define GPIO31_ICP_TXD MFP_CFG(GPIO31, AF1)
85
86#define GPIO83_KP_DKIN_0 MFP_CFG_LPM(GPIO83, AF3, FLOAT)
87#define GPIO84_KP_DKIN_1 MFP_CFG_LPM(GPIO84, AF3, FLOAT)
88#define GPIO85_KP_DKIN_2 MFP_CFG_LPM(GPIO85, AF3, FLOAT)
89#define GPIO86_KP_DKIN_3 MFP_CFG_LPM(GPIO86, AF3, FLOAT)
90
91#define GPIO105_KP_DKIN_0 MFP_CFG_LPM(GPIO105, AF2, FLOAT)
92#define GPIO106_KP_DKIN_1 MFP_CFG_LPM(GPIO106, AF2, FLOAT)
93#define GPIO107_KP_DKIN_2 MFP_CFG_LPM(GPIO107, AF2, FLOAT)
94#define GPIO108_KP_DKIN_3 MFP_CFG_LPM(GPIO108, AF2, FLOAT)
95#define GPIO109_KP_DKIN_4 MFP_CFG_LPM(GPIO109, AF2, FLOAT)
96#define GPIO110_KP_DKIN_5 MFP_CFG_LPM(GPIO110, AF2, FLOAT)
97#define GPIO111_KP_DKIN_6 MFP_CFG_LPM(GPIO111, AF2, FLOAT)
98#define GPIO112_KP_DKIN_7 MFP_CFG_LPM(GPIO112, AF2, FLOAT)
99
100#define GPIO113_KP_DKIN_0 MFP_CFG_LPM(GPIO113, AF2, FLOAT)
101#define GPIO114_KP_DKIN_1 MFP_CFG_LPM(GPIO114, AF2, FLOAT)
102#define GPIO115_KP_DKIN_2 MFP_CFG_LPM(GPIO115, AF2, FLOAT)
103#define GPIO116_KP_DKIN_3 MFP_CFG_LPM(GPIO116, AF2, FLOAT)
104#define GPIO117_KP_DKIN_4 MFP_CFG_LPM(GPIO117, AF2, FLOAT)
105#define GPIO118_KP_DKIN_5 MFP_CFG_LPM(GPIO118, AF2, FLOAT)
106#define GPIO119_KP_DKIN_6 MFP_CFG_LPM(GPIO119, AF2, FLOAT)
107#define GPIO120_KP_DKIN_7 MFP_CFG_LPM(GPIO120, AF2, FLOAT)
108
109#define GPIO127_KP_DKIN_0 MFP_CFG_LPM(GPIO127, AF2, FLOAT)
110#define GPIO126_KP_DKIN_1 MFP_CFG_LPM(GPIO126, AF2, FLOAT)
111
112#define GPIO2_2_KP_DKIN_0 MFP_CFG_LPM(GPIO2_2, AF2, FLOAT)
113#define GPIO3_2_KP_DKIN_1 MFP_CFG_LPM(GPIO3_2, AF2, FLOAT)
114#define GPIO125_KP_DKIN_2 MFP_CFG_LPM(GPIO125, AF2, FLOAT)
115#define GPIO124_KP_DKIN_3 MFP_CFG_LPM(GPIO124, AF2, FLOAT)
116#define GPIO123_KP_DKIN_4 MFP_CFG_LPM(GPIO123, AF2, FLOAT)
117#define GPIO122_KP_DKIN_5 MFP_CFG_LPM(GPIO122, AF2, FLOAT)
118#define GPIO121_KP_DKIN_6 MFP_CFG_LPM(GPIO121, AF2, FLOAT)
119#define GPIO4_2_KP_DKIN_7 MFP_CFG_LPM(GPIO4_2, AF2, FLOAT)
120
121#define GPIO113_KP_MKIN_0 MFP_CFG_LPM(GPIO113, AF1, FLOAT)
122#define GPIO114_KP_MKIN_1 MFP_CFG_LPM(GPIO114, AF1, FLOAT)
123#define GPIO115_KP_MKIN_2 MFP_CFG_LPM(GPIO115, AF1, FLOAT)
124#define GPIO116_KP_MKIN_3 MFP_CFG_LPM(GPIO116, AF1, FLOAT)
125#define GPIO117_KP_MKIN_4 MFP_CFG_LPM(GPIO117, AF1, FLOAT)
126#define GPIO118_KP_MKIN_5 MFP_CFG_LPM(GPIO118, AF1, FLOAT)
127#define GPIO119_KP_MKIN_6 MFP_CFG_LPM(GPIO119, AF1, FLOAT)
128#define GPIO120_KP_MKIN_7 MFP_CFG_LPM(GPIO120, AF1, FLOAT)
129
130#define GPIO83_KP_MKOUT_0 MFP_CFG_LPM(GPIO83, AF2, DRIVE_HIGH)
131#define GPIO84_KP_MKOUT_1 MFP_CFG_LPM(GPIO84, AF2, DRIVE_HIGH)
132#define GPIO85_KP_MKOUT_2 MFP_CFG_LPM(GPIO85, AF2, DRIVE_HIGH)
133#define GPIO86_KP_MKOUT_3 MFP_CFG_LPM(GPIO86, AF2, DRIVE_HIGH)
134#define GPIO13_KP_MKOUT_4 MFP_CFG_LPM(GPIO13, AF3, DRIVE_HIGH)
135#define GPIO14_KP_MKOUT_5 MFP_CFG_LPM(GPIO14, AF3, DRIVE_HIGH)
136
137#define GPIO121_KP_MKOUT_0 MFP_CFG_LPM(GPIO121, AF1, DRIVE_HIGH)
138#define GPIO122_KP_MKOUT_1 MFP_CFG_LPM(GPIO122, AF1, DRIVE_HIGH)
139#define GPIO123_KP_MKOUT_2 MFP_CFG_LPM(GPIO123, AF1, DRIVE_HIGH)
140#define GPIO124_KP_MKOUT_3 MFP_CFG_LPM(GPIO124, AF1, DRIVE_HIGH)
141#define GPIO125_KP_MKOUT_4 MFP_CFG_LPM(GPIO125, AF1, DRIVE_HIGH)
142#define GPIO126_KP_MKOUT_5 MFP_CFG_LPM(GPIO126, AF1, DRIVE_HIGH)
143#define GPIO127_KP_MKOUT_6 MFP_CFG_LPM(GPIO127, AF1, DRIVE_HIGH)
144#define GPIO5_2_KP_MKOUT_7 MFP_CFG_LPM(GPIO5_2, AF1, DRIVE_HIGH)
145
146/* LCD */
147#define GPIO6_2_LCD_LDD_0 MFP_CFG_DRV(GPIO6_2, AF1, DS01X)
148#define GPIO7_2_LCD_LDD_1 MFP_CFG_DRV(GPIO7_2, AF1, DS01X)
149#define GPIO8_2_LCD_LDD_2 MFP_CFG_DRV(GPIO8_2, AF1, DS01X)
150#define GPIO9_2_LCD_LDD_3 MFP_CFG_DRV(GPIO9_2, AF1, DS01X)
151#define GPIO10_2_LCD_LDD_4 MFP_CFG_DRV(GPIO10_2, AF1, DS01X)
152#define GPIO11_2_LCD_LDD_5 MFP_CFG_DRV(GPIO11_2, AF1, DS01X)
153#define GPIO12_2_LCD_LDD_6 MFP_CFG_DRV(GPIO12_2, AF1, DS01X)
154#define GPIO13_2_LCD_LDD_7 MFP_CFG_DRV(GPIO13_2, AF1, DS01X)
155#define GPIO63_LCD_LDD_8 MFP_CFG_DRV(GPIO63, AF1, DS01X)
156#define GPIO64_LCD_LDD_9 MFP_CFG_DRV(GPIO64, AF1, DS01X)
157#define GPIO65_LCD_LDD_10 MFP_CFG_DRV(GPIO65, AF1, DS01X)
158#define GPIO66_LCD_LDD_11 MFP_CFG_DRV(GPIO66, AF1, DS01X)
159#define GPIO67_LCD_LDD_12 MFP_CFG_DRV(GPIO67, AF1, DS01X)
160#define GPIO68_LCD_LDD_13 MFP_CFG_DRV(GPIO68, AF1, DS01X)
161#define GPIO69_LCD_LDD_14 MFP_CFG_DRV(GPIO69, AF1, DS01X)
162#define GPIO70_LCD_LDD_15 MFP_CFG_DRV(GPIO70, AF1, DS01X)
163#define GPIO71_LCD_LDD_16 MFP_CFG_DRV(GPIO71, AF1, DS01X)
164#define GPIO72_LCD_LDD_17 MFP_CFG_DRV(GPIO72, AF1, DS01X)
165#define GPIO73_LCD_CS_N MFP_CFG_DRV(GPIO73, AF2, DS01X)
166#define GPIO74_LCD_VSYNC MFP_CFG_DRV(GPIO74, AF2, DS01X)
167#define GPIO14_2_LCD_FCLK MFP_CFG_DRV(GPIO14_2, AF1, DS01X)
168#define GPIO15_2_LCD_LCLK MFP_CFG_DRV(GPIO15_2, AF1, DS01X)
169#define GPIO16_2_LCD_PCLK MFP_CFG_DRV(GPIO16_2, AF1, DS01X)
170#define GPIO17_2_LCD_BIAS MFP_CFG_DRV(GPIO17_2, AF1, DS01X)
171#define GPIO64_LCD_VSYNC MFP_CFG_DRV(GPIO64, AF2, DS01X)
172#define GPIO63_LCD_CS_N MFP_CFG_DRV(GPIO63, AF2, DS01X)
173
174#define GPIO6_2_MLCD_DD_0 MFP_CFG_DRV(GPIO6_2, AF7, DS08X)
175#define GPIO7_2_MLCD_DD_1 MFP_CFG_DRV(GPIO7_2, AF7, DS08X)
176#define GPIO8_2_MLCD_DD_2 MFP_CFG_DRV(GPIO8_2, AF7, DS08X)
177#define GPIO9_2_MLCD_DD_3 MFP_CFG_DRV(GPIO9_2, AF7, DS08X)
178#define GPIO10_2_MLCD_DD_4 MFP_CFG_DRV(GPIO10_2, AF7, DS08X)
179#define GPIO11_2_MLCD_DD_5 MFP_CFG_DRV(GPIO11_2, AF7, DS08X)
180#define GPIO12_2_MLCD_DD_6 MFP_CFG_DRV(GPIO12_2, AF7, DS08X)
181#define GPIO13_2_MLCD_DD_7 MFP_CFG_DRV(GPIO13_2, AF7, DS08X)
182#define GPIO63_MLCD_DD_8 MFP_CFG_DRV(GPIO63, AF7, DS08X)
183#define GPIO64_MLCD_DD_9 MFP_CFG_DRV(GPIO64, AF7, DS08X)
184#define GPIO65_MLCD_DD_10 MFP_CFG_DRV(GPIO65, AF7, DS08X)
185#define GPIO66_MLCD_DD_11 MFP_CFG_DRV(GPIO66, AF7, DS08X)
186#define GPIO67_MLCD_DD_12 MFP_CFG_DRV(GPIO67, AF7, DS08X)
187#define GPIO68_MLCD_DD_13 MFP_CFG_DRV(GPIO68, AF7, DS08X)
188#define GPIO69_MLCD_DD_14 MFP_CFG_DRV(GPIO69, AF7, DS08X)
189#define GPIO70_MLCD_DD_15 MFP_CFG_DRV(GPIO70, AF7, DS08X)
190#define GPIO71_MLCD_DD_16 MFP_CFG_DRV(GPIO71, AF7, DS08X)
191#define GPIO72_MLCD_DD_17 MFP_CFG_DRV(GPIO72, AF7, DS08X)
192#define GPIO73_MLCD_CS MFP_CFG_DRV(GPIO73, AF7, DS08X)
193#define GPIO74_MLCD_VSYNC MFP_CFG_DRV(GPIO74, AF7, DS08X)
194#define GPIO14_2_MLCD_FCLK MFP_CFG_DRV(GPIO14_2, AF7, DS08X)
195#define GPIO15_2_MLCD_LCLK MFP_CFG_DRV(GPIO15_2, AF7, DS08X)
196#define GPIO16_2_MLCD_PCLK MFP_CFG_DRV(GPIO16_2, AF7, DS08X)
197#define GPIO17_2_MLCD_BIAS MFP_CFG_DRV(GPIO17_2, AF7, DS08X)
198
199/* MMC1 */
200#define GPIO9_MMC1_CMD MFP_CFG_LPM(GPIO9, AF4, DRIVE_HIGH)
201#define GPIO22_MMC1_CLK MFP_CFG_LPM(GPIO22, AF4, DRIVE_HIGH)
202#define GPIO23_MMC1_CMD MFP_CFG_LPM(GPIO23, AF4, DRIVE_HIGH)
203#define GPIO30_MMC1_CLK MFP_CFG_LPM(GPIO30, AF4, DRIVE_HIGH)
204#define GPIO31_MMC1_CMD MFP_CFG_LPM(GPIO31, AF4, DRIVE_HIGH)
205#define GPIO5_MMC1_DAT0 MFP_CFG_LPM(GPIO5, AF4, DRIVE_HIGH)
206#define GPIO6_MMC1_DAT1 MFP_CFG_LPM(GPIO6, AF4, DRIVE_HIGH)
207#define GPIO7_MMC1_DAT2 MFP_CFG_LPM(GPIO7, AF4, DRIVE_HIGH)
208#define GPIO8_MMC1_DAT3 MFP_CFG_LPM(GPIO8, AF4, DRIVE_HIGH)
209#define GPIO18_MMC1_DAT0 MFP_CFG_LPM(GPIO18, AF4, DRIVE_HIGH)
210#define GPIO19_MMC1_DAT1 MFP_CFG_LPM(GPIO19, AF4, DRIVE_HIGH)
211#define GPIO20_MMC1_DAT2 MFP_CFG_LPM(GPIO20, AF4, DRIVE_HIGH)
212#define GPIO21_MMC1_DAT3 MFP_CFG_LPM(GPIO21, AF4, DRIVE_HIGH)
213
214#define GPIO28_MMC2_CLK MFP_CFG_LPM(GPIO28, AF4, PULL_HIGH)
215#define GPIO29_MMC2_CMD MFP_CFG_LPM(GPIO29, AF4, PULL_HIGH)
216#define GPIO30_MMC2_CLK MFP_CFG_LPM(GPIO30, AF3, PULL_HIGH)
217#define GPIO31_MMC2_CMD MFP_CFG_LPM(GPIO31, AF3, PULL_HIGH)
218#define GPIO79_MMC2_CLK MFP_CFG_LPM(GPIO79, AF4, PULL_HIGH)
219#define GPIO80_MMC2_CMD MFP_CFG_LPM(GPIO80, AF4, PULL_HIGH)
220
221#define GPIO5_MMC2_DAT0 MFP_CFG_LPM(GPIO5, AF2, PULL_HIGH)
222#define GPIO6_MMC2_DAT1 MFP_CFG_LPM(GPIO6, AF2, PULL_HIGH)
223#define GPIO7_MMC2_DAT2 MFP_CFG_LPM(GPIO7, AF2, PULL_HIGH)
224#define GPIO8_MMC2_DAT3 MFP_CFG_LPM(GPIO8, AF2, PULL_HIGH)
225#define GPIO24_MMC2_DAT0 MFP_CFG_LPM(GPIO24, AF4, PULL_HIGH)
226#define GPIO75_MMC2_DAT0 MFP_CFG_LPM(GPIO75, AF4, PULL_HIGH)
227#define GPIO25_MMC2_DAT1 MFP_CFG_LPM(GPIO25, AF4, PULL_HIGH)
228#define GPIO76_MMC2_DAT1 MFP_CFG_LPM(GPIO76, AF4, PULL_HIGH)
229#define GPIO26_MMC2_DAT2 MFP_CFG_LPM(GPIO26, AF4, PULL_HIGH)
230#define GPIO77_MMC2_DAT2 MFP_CFG_LPM(GPIO77, AF4, PULL_HIGH)
231#define GPIO27_MMC2_DAT3 MFP_CFG_LPM(GPIO27, AF4, PULL_HIGH)
232#define GPIO78_MMC2_DAT3 MFP_CFG_LPM(GPIO78, AF4, PULL_HIGH)
233
234/* 1-Wire */
235#define GPIO14_ONE_WIRE MFP_CFG_LPM(GPIO14, AF5, FLOAT)
236#define GPIO0_2_ONE_WIRE MFP_CFG_LPM(GPIO0_2, AF2, FLOAT)
237
238/* SSP1 */
239#define GPIO87_SSP1_EXTCLK MFP_CFG(GPIO87, AF1)
240#define GPIO88_SSP1_SYSCLK MFP_CFG(GPIO88, AF1)
241#define GPIO83_SSP1_SCLK MFP_CFG(GPIO83, AF1)
242#define GPIO84_SSP1_SFRM MFP_CFG(GPIO84, AF1)
243#define GPIO85_SSP1_RXD MFP_CFG(GPIO85, AF6)
244#define GPIO85_SSP1_TXD MFP_CFG(GPIO85, AF1)
245#define GPIO86_SSP1_RXD MFP_CFG(GPIO86, AF1)
246#define GPIO86_SSP1_TXD MFP_CFG(GPIO86, AF6)
247
248/* SSP2 */
249#define GPIO39_SSP2_EXTCLK MFP_CFG(GPIO39, AF2)
250#define GPIO40_SSP2_SYSCLK MFP_CFG(GPIO40, AF2)
251#define GPIO12_SSP2_SCLK MFP_CFG(GPIO12, AF2)
252#define GPIO35_SSP2_SCLK MFP_CFG(GPIO35, AF2)
253#define GPIO36_SSP2_SFRM MFP_CFG(GPIO36, AF2)
254#define GPIO37_SSP2_RXD MFP_CFG(GPIO37, AF5)
255#define GPIO37_SSP2_TXD MFP_CFG(GPIO37, AF2)
256#define GPIO38_SSP2_RXD MFP_CFG(GPIO38, AF2)
257#define GPIO38_SSP2_TXD MFP_CFG(GPIO38, AF5)
258
259#define GPIO69_SSP3_SCLK MFP_CFG(GPIO69, AF2, DS08X, FLOAT)
260#define GPIO70_SSP3_FRM MFP_CFG(GPIO70, AF2, DS08X, DRIVE_LOW)
261#define GPIO89_SSP3_SCLK MFP_CFG(GPIO89, AF1, DS08X, FLOAT)
262#define GPIO90_SSP3_FRM MFP_CFG(GPIO90, AF1, DS08X, DRIVE_LOW)
263#define GPIO71_SSP3_RXD MFP_CFG_X(GPIO71, AF5, DS08X, FLOAT)
264#define GPIO71_SSP3_TXD MFP_CFG_X(GPIO71, AF2, DS08X, DRIVE_LOW)
265#define GPIO72_SSP3_RXD MFP_CFG_X(GPIO72, AF2, DS08X, FLOAT)
266#define GPIO72_SSP3_TXD MFP_CFG_X(GPIO72, AF5, DS08X, DRIVE_LOW)
267#define GPIO91_SSP3_RXD MFP_CFG_X(GPIO91, AF5, DS08X, FLOAT)
268#define GPIO91_SSP3_TXD MFP_CFG_X(GPIO91, AF1, DS08X, DRIVE_LOW)
269#define GPIO92_SSP3_RXD MFP_CFG_X(GPIO92, AF1, DS08X, FLOAT)
270#define GPIO92_SSP3_TXD MFP_CFG_X(GPIO92, AF5, DS08X, DRIVE_LOW)
271
272#define GPIO93_SSP4_SCLK MFP_CFG_LPM(GPIO93, AF1, PULL_HIGH)
273#define GPIO94_SSP4_FRM MFP_CFG_LPM(GPIO94, AF1, PULL_HIGH)
274#define GPIO94_SSP4_RXD MFP_CFG_LPM(GPIO94, AF5, PULL_HIGH)
275#define GPIO95_SSP4_RXD MFP_CFG_LPM(GPIO95, AF5, PULL_HIGH)
276#define GPIO95_SSP4_TXD MFP_CFG_LPM(GPIO95, AF1, PULL_HIGH)
277#define GPIO96_SSP4_RXD MFP_CFG_LPM(GPIO96, AF1, PULL_HIGH)
278#define GPIO96_SSP4_TXD MFP_CFG_LPM(GPIO96, AF5, PULL_HIGH)
279
280/* UART1 */
281#define GPIO41_UART1_RXD MFP_CFG_LPM(GPIO41, AF2, FLOAT)
282#define GPIO41_UART1_TXD MFP_CFG_LPM(GPIO41, AF4, FLOAT)
283#define GPIO42_UART1_RXD MFP_CFG_LPM(GPIO42, AF4, FLOAT)
284#define GPIO42_UART1_TXD MFP_CFG_LPM(GPIO42, AF2, FLOAT)
285#define GPIO97_UART1_RXD MFP_CFG_LPM(GPIO97, AF1, FLOAT)
286#define GPIO97_UART1_TXD MFP_CFG_LPM(GPIO97, AF6, FLOAT)
287#define GPIO98_UART1_RXD MFP_CFG_LPM(GPIO98, AF6, FLOAT)
288#define GPIO98_UART1_TXD MFP_CFG_LPM(GPIO98, AF1, FLOAT)
289#define GPIO43_UART1_CTS MFP_CFG_LPM(GPIO43, AF2, FLOAT)
290#define GPIO43_UART1_RTS MFP_CFG_LPM(GPIO43, AF4, FLOAT)
291#define GPIO48_UART1_CTS MFP_CFG_LPM(GPIO48, AF4, FLOAT)
292#define GPIO48_UART1_RTS MFP_CFG_LPM(GPIO48, AF2, FLOAT)
293#define GPIO99_UART1_CTS MFP_CFG_LPM(GPIO99, AF1, FLOAT)
294#define GPIO99_UART1_RTS MFP_CFG_LPM(GPIO99, AF6, FLOAT)
295#define GPIO104_UART1_CTS MFP_CFG_LPM(GPIO104, AF6, FLOAT)
296#define GPIO104_UART1_RTS MFP_CFG_LPM(GPIO104, AF1, FLOAT)
297#define GPIO45_UART1_DTR MFP_CFG_LPM(GPIO45, AF4, FLOAT)
298#define GPIO45_UART1_DSR MFP_CFG_LPM(GPIO45, AF2, FLOAT)
299#define GPIO47_UART1_DTR MFP_CFG_LPM(GPIO47, AF2, FLOAT)
300#define GPIO47_UART1_DSR MFP_CFG_LPM(GPIO47, AF4, FLOAT)
301#define GPIO101_UART1_DTR MFP_CFG_LPM(GPIO101, AF6, FLOAT)
302#define GPIO101_UART1_DSR MFP_CFG_LPM(GPIO101, AF1, FLOAT)
303#define GPIO103_UART1_DTR MFP_CFG_LPM(GPIO103, AF1, FLOAT)
304#define GPIO103_UART1_DSR MFP_CFG_LPM(GPIO103, AF6, FLOAT)
305#define GPIO44_UART1_DCD MFP_CFG_LPM(GPIO44, AF2, FLOAT)
306#define GPIO100_UART1_DCD MFP_CFG_LPM(GPIO100, AF1, FLOAT)
307#define GPIO46_UART1_RI MFP_CFG_LPM(GPIO46, AF2, FLOAT)
308#define GPIO102_UART1_RI MFP_CFG_LPM(GPIO102, AF1, FLOAT)
309
310/* UART2 */
311#define GPIO109_UART2_CTS MFP_CFG_LPM(GPIO109, AF3, FLOAT)
312#define GPIO109_UART2_RTS MFP_CFG_LPM(GPIO109, AF1, FLOAT)
313#define GPIO112_UART2_CTS MFP_CFG_LPM(GPIO112, AF1, FLOAT)
314#define GPIO112_UART2_RTS MFP_CFG_LPM(GPIO112, AF3, FLOAT)
315#define GPIO110_UART2_RXD MFP_CFG_LPM(GPIO110, AF1, FLOAT)
316#define GPIO110_UART2_TXD MFP_CFG_LPM(GPIO110, AF3, FLOAT)
317#define GPIO111_UART2_RXD MFP_CFG_LPM(GPIO111, AF3, FLOAT)
318#define GPIO111_UART2_TXD MFP_CFG_LPM(GPIO111, AF1, FLOAT)
319
320/* UART3 */
321#define GPIO89_UART3_CTS MFP_CFG_LPM(GPIO89, AF2, FLOAT)
322#define GPIO89_UART3_RTS MFP_CFG_LPM(GPIO89, AF4, FLOAT)
323#define GPIO90_UART3_CTS MFP_CFG_LPM(GPIO90, AF4, FLOAT)
324#define GPIO90_UART3_RTS MFP_CFG_LPM(GPIO90, AF2, FLOAT)
325#define GPIO105_UART3_CTS MFP_CFG_LPM(GPIO105, AF1, FLOAT)
326#define GPIO105_UART3_RTS MFP_CFG_LPM(GPIO105, AF3, FLOAT)
327#define GPIO106_UART3_CTS MFP_CFG_LPM(GPIO106, AF3, FLOAT)
328#define GPIO106_UART3_RTS MFP_CFG_LPM(GPIO106, AF1, FLOAT)
329#define GPIO30_UART3_RXD MFP_CFG_LPM(GPIO30, AF2, FLOAT)
330#define GPIO30_UART3_TXD MFP_CFG_LPM(GPIO30, AF6, FLOAT)
331#define GPIO31_UART3_RXD MFP_CFG_LPM(GPIO31, AF6, FLOAT)
332#define GPIO31_UART3_TXD MFP_CFG_LPM(GPIO31, AF2, FLOAT)
333#define GPIO91_UART3_RXD MFP_CFG_LPM(GPIO91, AF4, FLOAT)
334#define GPIO91_UART3_TXD MFP_CFG_LPM(GPIO91, AF2, FLOAT)
335#define GPIO92_UART3_RXD MFP_CFG_LPM(GPIO92, AF2, FLOAT)
336#define GPIO92_UART3_TXD MFP_CFG_LPM(GPIO92, AF4, FLOAT)
337#define GPIO107_UART3_RXD MFP_CFG_LPM(GPIO107, AF3, FLOAT)
338#define GPIO107_UART3_TXD MFP_CFG_LPM(GPIO107, AF1, FLOAT)
339#define GPIO108_UART3_RXD MFP_CFG_LPM(GPIO108, AF1, FLOAT)
340#define GPIO108_UART3_TXD MFP_CFG_LPM(GPIO108, AF3, FLOAT)
341
342
343/* USB 2.0 UTMI */
344#define GPIO10_UTM_CLK MFP_CFG(GPIO10, AF1)
345#define GPIO36_U2D_RXERROR MFP_CFG(GPIO36, AF3)
346#define GPIO60_U2D_RXERROR MFP_CFG(GPIO60, AF1)
347#define GPIO87_U2D_RXERROR MFP_CFG(GPIO87, AF5)
348#define GPIO34_UTM_RXVALID MFP_CFG(GPIO34, AF3)
349#define GPIO58_UTM_RXVALID MFP_CFG(GPIO58, AF2)
350#define GPIO85_UTM_RXVALID MFP_CFG(GPIO85, AF5)
351#define GPIO35_UTM_RXACTIVE MFP_CFG(GPIO35, AF3)
352#define GPIO59_UTM_RXACTIVE MFP_CFG(GPIO59, AF1)
353#define GPIO86_UTM_RXACTIVE MFP_CFG(GPIO86, AF5)
354#define GPIO73_UTM_TXREADY MFP_CFG(GPIO73, AF1)
355#define GPIO68_UTM_LINESTATE_0 MFP_CFG(GPIO68, AF3)
356#define GPIO90_UTM_LINESTATE_0 MFP_CFG(GPIO90, AF3)
357#define GPIO102_UTM_LINESTATE_0 MFP_CFG(GPIO102, AF3)
358#define GPIO107_UTM_LINESTATE_0 MFP_CFG(GPIO107, AF4)
359#define GPIO69_UTM_LINESTATE_1 MFP_CFG(GPIO69, AF3)
360#define GPIO91_UTM_LINESTATE_1 MFP_CFG(GPIO91, AF3)
361#define GPIO103_UTM_LINESTATE_1 MFP_CFG(GPIO103, AF3)
362
363#define GPIO41_U2D_PHYDATA_0 MFP_CFG(GPIO41, AF3)
364#define GPIO42_U2D_PHYDATA_1 MFP_CFG(GPIO42, AF3)
365#define GPIO43_U2D_PHYDATA_2 MFP_CFG(GPIO43, AF3)
366#define GPIO44_U2D_PHYDATA_3 MFP_CFG(GPIO44, AF3)
367#define GPIO45_U2D_PHYDATA_4 MFP_CFG(GPIO45, AF3)
368#define GPIO46_U2D_PHYDATA_5 MFP_CFG(GPIO46, AF3)
369#define GPIO47_U2D_PHYDATA_6 MFP_CFG(GPIO47, AF3)
370#define GPIO48_U2D_PHYDATA_7 MFP_CFG(GPIO48, AF3)
371
372#define GPIO49_U2D_PHYDATA_0 MFP_CFG(GPIO49, AF3)
373#define GPIO50_U2D_PHYDATA_1 MFP_CFG(GPIO50, AF3)
374#define GPIO51_U2D_PHYDATA_2 MFP_CFG(GPIO51, AF3)
375#define GPIO52_U2D_PHYDATA_3 MFP_CFG(GPIO52, AF3)
376#define GPIO53_U2D_PHYDATA_4 MFP_CFG(GPIO53, AF3)
377#define GPIO54_U2D_PHYDATA_5 MFP_CFG(GPIO54, AF3)
378#define GPIO55_U2D_PHYDATA_6 MFP_CFG(GPIO55, AF3)
379#define GPIO56_U2D_PHYDATA_7 MFP_CFG(GPIO56, AF3)
380
381#define GPIO37_U2D_OPMODE0 MFP_CFG(GPIO37, AF4)
382#define GPIO61_U2D_OPMODE0 MFP_CFG(GPIO61, AF2)
383#define GPIO88_U2D_OPMODE0 MFP_CFG(GPIO88, AF7)
384
385#define GPIO38_U2D_OPMODE1 MFP_CFG(GPIO38, AF4)
386#define GPIO62_U2D_OPMODE1 MFP_CFG(GPIO62, AF2)
387#define GPIO104_U2D_OPMODE1 MFP_CFG(GPIO104, AF4)
388#define GPIO108_U2D_OPMODE1 MFP_CFG(GPIO108, AF5)
389
390#define GPIO74_U2D_RESET MFP_CFG(GPIO74, AF1)
391#define GPIO93_U2D_RESET MFP_CFG(GPIO93, AF2)
392#define GPIO98_U2D_RESET MFP_CFG(GPIO98, AF3)
393
394#define GPIO67_U2D_SUSPEND MFP_CFG(GPIO67, AF3)
395#define GPIO96_U2D_SUSPEND MFP_CFG(GPIO96, AF2)
396#define GPIO101_U2D_SUSPEND MFP_CFG(GPIO101, AF3)
397
398#define GPIO66_U2D_TERM_SEL MFP_CFG(GPIO66, AF5)
399#define GPIO95_U2D_TERM_SEL MFP_CFG(GPIO95, AF3)
400#define GPIO97_U2D_TERM_SEL MFP_CFG(GPIO97, AF7)
401#define GPIO100_U2D_TERM_SEL MFP_CFG(GPIO100, AF5)
402
403#define GPIO39_U2D_TXVALID MFP_CFG(GPIO39, AF4)
404#define GPIO70_U2D_TXVALID MFP_CFG(GPIO70, AF5)
405#define GPIO83_U2D_TXVALID MFP_CFG(GPIO83, AF7)
406
407#define GPIO65_U2D_XCVR_SEL MFP_CFG(GPIO65, AF5)
408#define GPIO94_U2D_XCVR_SEL MFP_CFG(GPIO94, AF3)
409#define GPIO99_U2D_XCVR_SEL MFP_CFG(GPIO99, AF5)
410
411/* USB Host 1.1 */
412#define GPIO2_2_USBH_PEN MFP_CFG(GPIO2_2, AF1)
413#define GPIO3_2_USBH_PWR MFP_CFG(GPIO3_2, AF1)
414
415/* USB P2 */
416#define GPIO97_USB_P2_2 MFP_CFG(GPIO97, AF2)
417#define GPIO97_USB_P2_6 MFP_CFG(GPIO97, AF4)
418#define GPIO98_USB_P2_2 MFP_CFG(GPIO98, AF4)
419#define GPIO98_USB_P2_6 MFP_CFG(GPIO98, AF2)
420#define GPIO99_USB_P2_1 MFP_CFG(GPIO99, AF2)
421#define GPIO100_USB_P2_4 MFP_CFG(GPIO100, AF2)
422#define GPIO101_USB_P2_8 MFP_CFG(GPIO101, AF2)
423#define GPIO102_USB_P2_3 MFP_CFG(GPIO102, AF2)
424#define GPIO103_USB_P2_5 MFP_CFG(GPIO103, AF2)
425#define GPIO104_USB_P2_7 MFP_CFG(GPIO104, AF2)
426
427/* USB P3 */
428#define GPIO75_USB_P3_1 MFP_CFG(GPIO75, AF2)
429#define GPIO76_USB_P3_2 MFP_CFG(GPIO76, AF2)
430#define GPIO77_USB_P3_3 MFP_CFG(GPIO77, AF2)
431#define GPIO78_USB_P3_4 MFP_CFG(GPIO78, AF2)
432#define GPIO79_USB_P3_5 MFP_CFG(GPIO79, AF2)
433#define GPIO80_USB_P3_6 MFP_CFG(GPIO80, AF2)
434
435#define GPIO13_CHOUT0 MFP_CFG(GPIO13, AF6)
436#define GPIO14_CHOUT1 MFP_CFG(GPIO14, AF6)
437
438#define GPIO2_RDY MFP_CFG(GPIO2, AF1)
439#define GPIO5_NPIOR MFP_CFG(GPIO5, AF3)
440
441#define GPIO11_PWM0_OUT MFP_CFG(GPIO11, AF1)
442#define GPIO12_PWM1_OUT MFP_CFG(GPIO12, AF1)
443#define GPIO13_PWM2_OUT MFP_CFG(GPIO13, AF1)
444#define GPIO14_PWM3_OUT MFP_CFG(GPIO14, AF1)
445
446#endif /* __ASM_ARCH_MFP_PXA320_H */
diff --git a/include/asm-arm/arch-pxa/mfp.h b/include/asm-arm/arch-pxa/mfp.h
new file mode 100644
index 000000000000..60291742ffdd
--- /dev/null
+++ b/include/asm-arm/arch-pxa/mfp.h
@@ -0,0 +1,576 @@
1/*
2 * linux/include/asm-arm/arch-pxa/mfp.h
3 *
4 * Multi-Function Pin Definitions
5 *
6 * Copyright (C) 2007 Marvell International Ltd.
7 *
8 * 2007-8-21: eric miao <eric.y.miao@gmail.com>
9 * initial version
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14 */
15
16#ifndef __ASM_ARCH_MFP_H
17#define __ASM_ARCH_MFP_H
18
19#define MFPR_BASE (0x40e10000)
20#define MFPR_SIZE (PAGE_SIZE)
21
22#define mfp_to_gpio(m) ((m) % 128)
23
24/* list of all the configurable MFP pins */
25enum {
26 MFP_PIN_INVALID = -1,
27
28 MFP_PIN_GPIO0 = 0,
29 MFP_PIN_GPIO1,
30 MFP_PIN_GPIO2,
31 MFP_PIN_GPIO3,
32 MFP_PIN_GPIO4,
33 MFP_PIN_GPIO5,
34 MFP_PIN_GPIO6,
35 MFP_PIN_GPIO7,
36 MFP_PIN_GPIO8,
37 MFP_PIN_GPIO9,
38 MFP_PIN_GPIO10,
39 MFP_PIN_GPIO11,
40 MFP_PIN_GPIO12,
41 MFP_PIN_GPIO13,
42 MFP_PIN_GPIO14,
43 MFP_PIN_GPIO15,
44 MFP_PIN_GPIO16,
45 MFP_PIN_GPIO17,
46 MFP_PIN_GPIO18,
47 MFP_PIN_GPIO19,
48 MFP_PIN_GPIO20,
49 MFP_PIN_GPIO21,
50 MFP_PIN_GPIO22,
51 MFP_PIN_GPIO23,
52 MFP_PIN_GPIO24,
53 MFP_PIN_GPIO25,
54 MFP_PIN_GPIO26,
55 MFP_PIN_GPIO27,
56 MFP_PIN_GPIO28,
57 MFP_PIN_GPIO29,
58 MFP_PIN_GPIO30,
59 MFP_PIN_GPIO31,
60 MFP_PIN_GPIO32,
61 MFP_PIN_GPIO33,
62 MFP_PIN_GPIO34,
63 MFP_PIN_GPIO35,
64 MFP_PIN_GPIO36,
65 MFP_PIN_GPIO37,
66 MFP_PIN_GPIO38,
67 MFP_PIN_GPIO39,
68 MFP_PIN_GPIO40,
69 MFP_PIN_GPIO41,
70 MFP_PIN_GPIO42,
71 MFP_PIN_GPIO43,
72 MFP_PIN_GPIO44,
73 MFP_PIN_GPIO45,
74 MFP_PIN_GPIO46,
75 MFP_PIN_GPIO47,
76 MFP_PIN_GPIO48,
77 MFP_PIN_GPIO49,
78 MFP_PIN_GPIO50,
79 MFP_PIN_GPIO51,
80 MFP_PIN_GPIO52,
81 MFP_PIN_GPIO53,
82 MFP_PIN_GPIO54,
83 MFP_PIN_GPIO55,
84 MFP_PIN_GPIO56,
85 MFP_PIN_GPIO57,
86 MFP_PIN_GPIO58,
87 MFP_PIN_GPIO59,
88 MFP_PIN_GPIO60,
89 MFP_PIN_GPIO61,
90 MFP_PIN_GPIO62,
91 MFP_PIN_GPIO63,
92 MFP_PIN_GPIO64,
93 MFP_PIN_GPIO65,
94 MFP_PIN_GPIO66,
95 MFP_PIN_GPIO67,
96 MFP_PIN_GPIO68,
97 MFP_PIN_GPIO69,
98 MFP_PIN_GPIO70,
99 MFP_PIN_GPIO71,
100 MFP_PIN_GPIO72,
101 MFP_PIN_GPIO73,
102 MFP_PIN_GPIO74,
103 MFP_PIN_GPIO75,
104 MFP_PIN_GPIO76,
105 MFP_PIN_GPIO77,
106 MFP_PIN_GPIO78,
107 MFP_PIN_GPIO79,
108 MFP_PIN_GPIO80,
109 MFP_PIN_GPIO81,
110 MFP_PIN_GPIO82,
111 MFP_PIN_GPIO83,
112 MFP_PIN_GPIO84,
113 MFP_PIN_GPIO85,
114 MFP_PIN_GPIO86,
115 MFP_PIN_GPIO87,
116 MFP_PIN_GPIO88,
117 MFP_PIN_GPIO89,
118 MFP_PIN_GPIO90,
119 MFP_PIN_GPIO91,
120 MFP_PIN_GPIO92,
121 MFP_PIN_GPIO93,
122 MFP_PIN_GPIO94,
123 MFP_PIN_GPIO95,
124 MFP_PIN_GPIO96,
125 MFP_PIN_GPIO97,
126 MFP_PIN_GPIO98,
127 MFP_PIN_GPIO99,
128 MFP_PIN_GPIO100,
129 MFP_PIN_GPIO101,
130 MFP_PIN_GPIO102,
131 MFP_PIN_GPIO103,
132 MFP_PIN_GPIO104,
133 MFP_PIN_GPIO105,
134 MFP_PIN_GPIO106,
135 MFP_PIN_GPIO107,
136 MFP_PIN_GPIO108,
137 MFP_PIN_GPIO109,
138 MFP_PIN_GPIO110,
139 MFP_PIN_GPIO111,
140 MFP_PIN_GPIO112,
141 MFP_PIN_GPIO113,
142 MFP_PIN_GPIO114,
143 MFP_PIN_GPIO115,
144 MFP_PIN_GPIO116,
145 MFP_PIN_GPIO117,
146 MFP_PIN_GPIO118,
147 MFP_PIN_GPIO119,
148 MFP_PIN_GPIO120,
149 MFP_PIN_GPIO121,
150 MFP_PIN_GPIO122,
151 MFP_PIN_GPIO123,
152 MFP_PIN_GPIO124,
153 MFP_PIN_GPIO125,
154 MFP_PIN_GPIO126,
155 MFP_PIN_GPIO127,
156 MFP_PIN_GPIO0_2,
157 MFP_PIN_GPIO1_2,
158 MFP_PIN_GPIO2_2,
159 MFP_PIN_GPIO3_2,
160 MFP_PIN_GPIO4_2,
161 MFP_PIN_GPIO5_2,
162 MFP_PIN_GPIO6_2,
163 MFP_PIN_GPIO7_2,
164 MFP_PIN_GPIO8_2,
165 MFP_PIN_GPIO9_2,
166 MFP_PIN_GPIO10_2,
167 MFP_PIN_GPIO11_2,
168 MFP_PIN_GPIO12_2,
169 MFP_PIN_GPIO13_2,
170 MFP_PIN_GPIO14_2,
171 MFP_PIN_GPIO15_2,
172 MFP_PIN_GPIO16_2,
173 MFP_PIN_GPIO17_2,
174
175 MFP_PIN_ULPI_STP,
176 MFP_PIN_ULPI_NXT,
177 MFP_PIN_ULPI_DIR,
178
179 MFP_PIN_nXCVREN,
180 MFP_PIN_DF_CLE_nOE,
181 MFP_PIN_DF_nADV1_ALE,
182 MFP_PIN_DF_SCLK_E,
183 MFP_PIN_DF_SCLK_S,
184 MFP_PIN_nBE0,
185 MFP_PIN_nBE1,
186 MFP_PIN_DF_nADV2_ALE,
187 MFP_PIN_DF_INT_RnB,
188 MFP_PIN_DF_nCS0,
189 MFP_PIN_DF_nCS1,
190 MFP_PIN_nLUA,
191 MFP_PIN_nLLA,
192 MFP_PIN_DF_nWE,
193 MFP_PIN_DF_ALE_nWE,
194 MFP_PIN_DF_nRE_nOE,
195 MFP_PIN_DF_ADDR0,
196 MFP_PIN_DF_ADDR1,
197 MFP_PIN_DF_ADDR2,
198 MFP_PIN_DF_ADDR3,
199 MFP_PIN_DF_IO0,
200 MFP_PIN_DF_IO1,
201 MFP_PIN_DF_IO2,
202 MFP_PIN_DF_IO3,
203 MFP_PIN_DF_IO4,
204 MFP_PIN_DF_IO5,
205 MFP_PIN_DF_IO6,
206 MFP_PIN_DF_IO7,
207 MFP_PIN_DF_IO8,
208 MFP_PIN_DF_IO9,
209 MFP_PIN_DF_IO10,
210 MFP_PIN_DF_IO11,
211 MFP_PIN_DF_IO12,
212 MFP_PIN_DF_IO13,
213 MFP_PIN_DF_IO14,
214 MFP_PIN_DF_IO15,
215
216 MFP_PIN_MAX,
217};
218
219/*
220 * Table that determines the low power modes outputs, with actual settings
221 * used in parentheses for don't-care values. Except for the float output,
222 * the configured driven and pulled levels match, so if there is a need for
223 * non-LPM pulled output, the same configuration could probably be used.
224 *
225 * Output value sleep_oe_n sleep_data pullup_en pulldown_en pull_sel
226 * (bit 7) (bit 8) (bit 14d) (bit 13d)
227 *
228 * Drive 0 0 0 0 X (1) 0
229 * Drive 1 0 1 X (1) 0 0
230 * Pull hi (1) 1 X(1) 1 0 0
231 * Pull lo (0) 1 X(0) 0 1 0
232 * Z (float) 1 X(0) 0 0 0
233 */
234#define MFP_LPM_DRIVE_LOW 0x8
235#define MFP_LPM_DRIVE_HIGH 0x6
236#define MFP_LPM_PULL_HIGH 0x7
237#define MFP_LPM_PULL_LOW 0x9
238#define MFP_LPM_FLOAT 0x1
239#define MFP_LPM_PULL_NEITHER 0x0
240
241/*
242 * The pullup and pulldown state of the MFP pin is by default determined by
243 * selected alternate function. In case some buggy devices need to override
244 * this default behavior, pxa3xx_mfp_set_pull() can be invoked with one of
245 * the following definition as the parameter.
246 *
247 * Definition pull_sel pullup_en pulldown_en
248 * MFP_PULL_HIGH 1 1 0
249 * MFP_PULL_LOW 1 0 1
250 * MFP_PULL_BOTH 1 1 1
251 * MFP_PULL_NONE 1 0 0
252 * MFP_PULL_DEFAULT 0 X X
253 *
254 * NOTE: pxa3xx_mfp_set_pull() will modify the PULLUP_EN and PULLDOWN_EN
255 * bits, which will cause potential conflicts with the low power mode
256 * setting, device drivers should take care of this
257 */
258#define MFP_PULL_BOTH (0x7u)
259#define MFP_PULL_HIGH (0x6u)
260#define MFP_PULL_LOW (0x5u)
261#define MFP_PULL_NONE (0x4u)
262#define MFP_PULL_DEFAULT (0x0u)
263
264#define MFP_AF0 (0)
265#define MFP_AF1 (1)
266#define MFP_AF2 (2)
267#define MFP_AF3 (3)
268#define MFP_AF4 (4)
269#define MFP_AF5 (5)
270#define MFP_AF6 (6)
271#define MFP_AF7 (7)
272
273#define MFP_DS01X (0)
274#define MFP_DS02X (1)
275#define MFP_DS03X (2)
276#define MFP_DS04X (3)
277#define MFP_DS06X (4)
278#define MFP_DS08X (5)
279#define MFP_DS10X (6)
280#define MFP_DS12X (7)
281
282#define MFP_EDGE_BOTH 0x3
283#define MFP_EDGE_RISE 0x2
284#define MFP_EDGE_FALL 0x1
285#define MFP_EDGE_NONE 0x0
286
287#define MFPR_AF_MASK 0x0007
288#define MFPR_DRV_MASK 0x1c00
289#define MFPR_RDH_MASK 0x0200
290#define MFPR_LPM_MASK 0xe180
291#define MFPR_PULL_MASK 0xe000
292#define MFPR_EDGE_MASK 0x0070
293
294#define MFPR_ALT_OFFSET 0
295#define MFPR_ERE_OFFSET 4
296#define MFPR_EFE_OFFSET 5
297#define MFPR_EC_OFFSET 6
298#define MFPR_SON_OFFSET 7
299#define MFPR_SD_OFFSET 8
300#define MFPR_SS_OFFSET 9
301#define MFPR_DRV_OFFSET 10
302#define MFPR_PD_OFFSET 13
303#define MFPR_PU_OFFSET 14
304#define MFPR_PS_OFFSET 15
305
306#define MFPR(af, drv, rdh, lpm, edge) \
307 (((af) & 0x7) | (((drv) & 0x7) << 10) |\
308 (((rdh) & 0x1) << 9) |\
309 (((lpm) & 0x3) << 7) |\
310 (((lpm) & 0x4) << 12)|\
311 (((lpm) & 0x8) << 10)|\
312 ((!(edge)) << 6) |\
313 (((edge) & 0x1) << 5) |\
314 (((edge) & 0x2) << 3))
315
316/*
317 * a possible MFP configuration is represented by a 32-bit integer
318 * bit 0..15 - MFPR value (16-bit)
319 * bit 16..31 - mfp pin index (used to obtain the MFPR offset)
320 *
321 * to facilitate the definition, the following macros are provided
322 *
323 * MFPR_DEFAULT - default MFPR value, with
324 * alternate function = 0,
325 * drive strength = fast 1mA (MFP_DS01X)
326 * low power mode = default
327 * release dalay hold = false (RDH bit)
328 * edge detection = none
329 *
330 * MFP_CFG - default MFPR value with alternate function
331 * MFP_CFG_DRV - default MFPR value with alternate function and
332 * pin drive strength
333 * MFP_CFG_LPM - default MFPR value with alternate function and
334 * low power mode
335 * MFP_CFG_X - default MFPR value with alternate function,
336 * pin drive strength and low power mode
337 *
338 * use
339 *
340 * MFP_CFG_PIN - to get the MFP pin index
341 * MFP_CFG_VAL - to get the corresponding MFPR value
342 */
343
344typedef uint32_t mfp_cfg_t;
345
346#define MFP_CFG_PIN(mfp_cfg) (((mfp_cfg) >> 16) & 0xffff)
347#define MFP_CFG_VAL(mfp_cfg) ((mfp_cfg) & 0xffff)
348
349#define MFPR_DEFAULT (0x0000)
350
351#define MFP_CFG(pin, af) \
352 ((MFP_PIN_##pin << 16) | MFPR_DEFAULT | (MFP_##af))
353
354#define MFP_CFG_DRV(pin, af, drv) \
355 ((MFP_PIN_##pin << 16) | MFPR_DEFAULT |\
356 ((MFP_##drv) << 10) | (MFP_##af))
357
358#define MFP_CFG_LPM(pin, af, lpm) \
359 ((MFP_PIN_##pin << 16) | MFPR_DEFAULT | (MFP_##af) |\
360 (((MFP_LPM_##lpm) & 0x3) << 7) |\
361 (((MFP_LPM_##lpm) & 0x4) << 12) |\
362 (((MFP_LPM_##lpm) & 0x8) << 10))
363
364#define MFP_CFG_X(pin, af, drv, lpm) \
365 ((MFP_PIN_##pin << 16) | MFPR_DEFAULT |\
366 ((MFP_##drv) << 10) | (MFP_##af) |\
367 (((MFP_LPM_##lpm) & 0x3) << 7) |\
368 (((MFP_LPM_##lpm) & 0x4) << 12) |\
369 (((MFP_LPM_##lpm) & 0x8) << 10))
370
371/* common MFP configurations - processor specific ones defined
372 * in mfp-pxa3xx.h
373 */
374#define GPIO0_GPIO MFP_CFG(GPIO0, AF0)
375#define GPIO1_GPIO MFP_CFG(GPIO1, AF0)
376#define GPIO2_GPIO MFP_CFG(GPIO2, AF0)
377#define GPIO3_GPIO MFP_CFG(GPIO3, AF0)
378#define GPIO4_GPIO MFP_CFG(GPIO4, AF0)
379#define GPIO5_GPIO MFP_CFG(GPIO5, AF0)
380#define GPIO6_GPIO MFP_CFG(GPIO6, AF0)
381#define GPIO7_GPIO MFP_CFG(GPIO7, AF0)
382#define GPIO8_GPIO MFP_CFG(GPIO8, AF0)
383#define GPIO9_GPIO MFP_CFG(GPIO9, AF0)
384#define GPIO10_GPIO MFP_CFG(GPIO10, AF0)
385#define GPIO11_GPIO MFP_CFG(GPIO11, AF0)
386#define GPIO12_GPIO MFP_CFG(GPIO12, AF0)
387#define GPIO13_GPIO MFP_CFG(GPIO13, AF0)
388#define GPIO14_GPIO MFP_CFG(GPIO14, AF0)
389#define GPIO15_GPIO MFP_CFG(GPIO15, AF0)
390#define GPIO16_GPIO MFP_CFG(GPIO16, AF0)
391#define GPIO17_GPIO MFP_CFG(GPIO17, AF0)
392#define GPIO18_GPIO MFP_CFG(GPIO18, AF0)
393#define GPIO19_GPIO MFP_CFG(GPIO19, AF0)
394#define GPIO20_GPIO MFP_CFG(GPIO20, AF0)
395#define GPIO21_GPIO MFP_CFG(GPIO21, AF0)
396#define GPIO22_GPIO MFP_CFG(GPIO22, AF0)
397#define GPIO23_GPIO MFP_CFG(GPIO23, AF0)
398#define GPIO24_GPIO MFP_CFG(GPIO24, AF0)
399#define GPIO25_GPIO MFP_CFG(GPIO25, AF0)
400#define GPIO26_GPIO MFP_CFG(GPIO26, AF0)
401#define GPIO27_GPIO MFP_CFG(GPIO27, AF0)
402#define GPIO28_GPIO MFP_CFG(GPIO28, AF0)
403#define GPIO29_GPIO MFP_CFG(GPIO29, AF0)
404#define GPIO30_GPIO MFP_CFG(GPIO30, AF0)
405#define GPIO31_GPIO MFP_CFG(GPIO31, AF0)
406#define GPIO32_GPIO MFP_CFG(GPIO32, AF0)
407#define GPIO33_GPIO MFP_CFG(GPIO33, AF0)
408#define GPIO34_GPIO MFP_CFG(GPIO34, AF0)
409#define GPIO35_GPIO MFP_CFG(GPIO35, AF0)
410#define GPIO36_GPIO MFP_CFG(GPIO36, AF0)
411#define GPIO37_GPIO MFP_CFG(GPIO37, AF0)
412#define GPIO38_GPIO MFP_CFG(GPIO38, AF0)
413#define GPIO39_GPIO MFP_CFG(GPIO39, AF0)
414#define GPIO40_GPIO MFP_CFG(GPIO40, AF0)
415#define GPIO41_GPIO MFP_CFG(GPIO41, AF0)
416#define GPIO42_GPIO MFP_CFG(GPIO42, AF0)
417#define GPIO43_GPIO MFP_CFG(GPIO43, AF0)
418#define GPIO44_GPIO MFP_CFG(GPIO44, AF0)
419#define GPIO45_GPIO MFP_CFG(GPIO45, AF0)
420
421#define GPIO47_GPIO MFP_CFG(GPIO47, AF0)
422#define GPIO48_GPIO MFP_CFG(GPIO48, AF0)
423
424#define GPIO53_GPIO MFP_CFG(GPIO53, AF0)
425#define GPIO54_GPIO MFP_CFG(GPIO54, AF0)
426#define GPIO55_GPIO MFP_CFG(GPIO55, AF0)
427
428#define GPIO57_GPIO MFP_CFG(GPIO57, AF0)
429
430#define GPIO63_GPIO MFP_CFG(GPIO63, AF0)
431#define GPIO64_GPIO MFP_CFG(GPIO64, AF0)
432#define GPIO65_GPIO MFP_CFG(GPIO65, AF0)
433#define GPIO66_GPIO MFP_CFG(GPIO66, AF0)
434#define GPIO67_GPIO MFP_CFG(GPIO67, AF0)
435#define GPIO68_GPIO MFP_CFG(GPIO68, AF0)
436#define GPIO69_GPIO MFP_CFG(GPIO69, AF0)
437#define GPIO70_GPIO MFP_CFG(GPIO70, AF0)
438#define GPIO71_GPIO MFP_CFG(GPIO71, AF0)
439#define GPIO72_GPIO MFP_CFG(GPIO72, AF0)
440#define GPIO73_GPIO MFP_CFG(GPIO73, AF0)
441#define GPIO74_GPIO MFP_CFG(GPIO74, AF0)
442#define GPIO75_GPIO MFP_CFG(GPIO75, AF0)
443#define GPIO76_GPIO MFP_CFG(GPIO76, AF0)
444#define GPIO77_GPIO MFP_CFG(GPIO77, AF0)
445#define GPIO78_GPIO MFP_CFG(GPIO78, AF0)
446#define GPIO79_GPIO MFP_CFG(GPIO79, AF0)
447#define GPIO80_GPIO MFP_CFG(GPIO80, AF0)
448#define GPIO81_GPIO MFP_CFG(GPIO81, AF0)
449#define GPIO82_GPIO MFP_CFG(GPIO82, AF0)
450#define GPIO83_GPIO MFP_CFG(GPIO83, AF0)
451#define GPIO84_GPIO MFP_CFG(GPIO84, AF0)
452#define GPIO85_GPIO MFP_CFG(GPIO85, AF0)
453#define GPIO86_GPIO MFP_CFG(GPIO86, AF0)
454#define GPIO87_GPIO MFP_CFG(GPIO87, AF0)
455#define GPIO88_GPIO MFP_CFG(GPIO88, AF0)
456#define GPIO89_GPIO MFP_CFG(GPIO89, AF0)
457#define GPIO90_GPIO MFP_CFG(GPIO90, AF0)
458#define GPIO91_GPIO MFP_CFG(GPIO91, AF0)
459#define GPIO92_GPIO MFP_CFG(GPIO92, AF0)
460#define GPIO93_GPIO MFP_CFG(GPIO93, AF0)
461#define GPIO94_GPIO MFP_CFG(GPIO94, AF0)
462#define GPIO95_GPIO MFP_CFG(GPIO95, AF0)
463#define GPIO96_GPIO MFP_CFG(GPIO96, AF0)
464#define GPIO97_GPIO MFP_CFG(GPIO97, AF0)
465#define GPIO98_GPIO MFP_CFG(GPIO98, AF0)
466#define GPIO99_GPIO MFP_CFG(GPIO99, AF0)
467#define GPIO100_GPIO MFP_CFG(GPIO100, AF0)
468#define GPIO101_GPIO MFP_CFG(GPIO101, AF0)
469#define GPIO102_GPIO MFP_CFG(GPIO102, AF0)
470#define GPIO103_GPIO MFP_CFG(GPIO103, AF0)
471#define GPIO104_GPIO MFP_CFG(GPIO104, AF0)
472#define GPIO105_GPIO MFP_CFG(GPIO105, AF0)
473#define GPIO106_GPIO MFP_CFG(GPIO106, AF0)
474#define GPIO107_GPIO MFP_CFG(GPIO107, AF0)
475#define GPIO108_GPIO MFP_CFG(GPIO108, AF0)
476#define GPIO109_GPIO MFP_CFG(GPIO109, AF0)
477#define GPIO110_GPIO MFP_CFG(GPIO110, AF0)
478#define GPIO111_GPIO MFP_CFG(GPIO111, AF0)
479#define GPIO112_GPIO MFP_CFG(GPIO112, AF0)
480#define GPIO113_GPIO MFP_CFG(GPIO113, AF0)
481#define GPIO114_GPIO MFP_CFG(GPIO114, AF0)
482#define GPIO115_GPIO MFP_CFG(GPIO115, AF0)
483#define GPIO116_GPIO MFP_CFG(GPIO116, AF0)
484#define GPIO117_GPIO MFP_CFG(GPIO117, AF0)
485#define GPIO118_GPIO MFP_CFG(GPIO118, AF0)
486#define GPIO119_GPIO MFP_CFG(GPIO119, AF0)
487#define GPIO120_GPIO MFP_CFG(GPIO120, AF0)
488#define GPIO121_GPIO MFP_CFG(GPIO121, AF0)
489#define GPIO122_GPIO MFP_CFG(GPIO122, AF0)
490#define GPIO123_GPIO MFP_CFG(GPIO123, AF0)
491#define GPIO124_GPIO MFP_CFG(GPIO124, AF0)
492#define GPIO125_GPIO MFP_CFG(GPIO125, AF0)
493#define GPIO126_GPIO MFP_CFG(GPIO126, AF0)
494#define GPIO127_GPIO MFP_CFG(GPIO127, AF0)
495
496#define GPIO0_2_GPIO MFP_CFG(GPIO0_2, AF0)
497#define GPIO1_2_GPIO MFP_CFG(GPIO1_2, AF0)
498#define GPIO2_2_GPIO MFP_CFG(GPIO2_2, AF0)
499#define GPIO3_2_GPIO MFP_CFG(GPIO3_2, AF0)
500#define GPIO4_2_GPIO MFP_CFG(GPIO4_2, AF0)
501#define GPIO5_2_GPIO MFP_CFG(GPIO5_2, AF0)
502#define GPIO6_2_GPIO MFP_CFG(GPIO6_2, AF0)
503
504/*
505 * each MFP pin will have a MFPR register, since the offset of the
506 * register varies between processors, the processor specific code
507 * should initialize the pin offsets by pxa3xx_mfp_init_addr()
508 *
509 * pxa3xx_mfp_init_addr - accepts a table of "pxa3xx_mfp_addr_map"
510 * structure, which represents a range of MFP pins from "start" to
511 * "end", with the offset begining at "offset", to define a single
512 * pin, let "end" = -1
513 *
514 * use
515 *
516 * MFP_ADDR_X() to define a range of pins
517 * MFP_ADDR() to define a single pin
518 * MFP_ADDR_END to signal the end of pin offset definitions
519 */
520struct pxa3xx_mfp_addr_map {
521 unsigned int start;
522 unsigned int end;
523 unsigned long offset;
524};
525
526#define MFP_ADDR_X(start, end, offset) \
527 { MFP_PIN_##start, MFP_PIN_##end, offset }
528
529#define MFP_ADDR(pin, offset) \
530 { MFP_PIN_##pin, -1, offset }
531
532#define MFP_ADDR_END { MFP_PIN_INVALID, 0 }
533
534struct pxa3xx_mfp_pin {
535 unsigned long mfpr_off; /* MFPRxx register offset */
536 unsigned long mfpr_val; /* MFPRxx register value */
537};
538
539/*
540 * pxa3xx_mfp_read()/pxa3xx_mfp_write() - for direct read/write access
541 * to the MFPR register
542 */
543unsigned long pxa3xx_mfp_read(int mfp);
544void pxa3xx_mfp_write(int mfp, unsigned long mfpr_val);
545
546/*
547 * pxa3xx_mfp_set_afds - set MFP alternate function and drive strength
548 * pxa3xx_mfp_set_rdh - set MFP release delay hold on/off
549 * pxa3xx_mfp_set_lpm - set MFP low power mode state
550 * pxa3xx_mfp_set_edge - set MFP edge detection in low power mode
551 *
552 * use these functions to override/change the default configuration
553 * done by pxa3xx_mfp_set_config(s)
554 */
555void pxa3xx_mfp_set_afds(int mfp, int af, int ds);
556void pxa3xx_mfp_set_rdh(int mfp, int rdh);
557void pxa3xx_mfp_set_lpm(int mfp, int lpm);
558void pxa3xx_mfp_set_edge(int mfp, int edge);
559
560/*
561 * pxa3xx_mfp_config - configure the MFPR registers
562 *
563 * used by board specific initialization code
564 */
565void pxa3xx_mfp_config(mfp_cfg_t *mfp_cfgs, int num);
566
567/*
568 * pxa3xx_mfp_init_addr() - initialize the mapping between mfp pin
569 * index and MFPR register offset
570 *
571 * used by processor specific code
572 */
573void __init pxa3xx_mfp_init_addr(struct pxa3xx_mfp_addr_map *);
574void __init pxa3xx_init_mfp(void);
575
576#endif /* __ASM_ARCH_MFP_H */
diff --git a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h
index e68b593d69da..bb68b598c436 100644
--- a/include/asm-arm/arch-pxa/pxa-regs.h
+++ b/include/asm-arm/arch-pxa/pxa-regs.h
@@ -1177,7 +1177,7 @@
1177 1177
1178#define GPIO_bit(x) (1 << ((x) & 0x1f)) 1178#define GPIO_bit(x) (1 << ((x) & 0x1f))
1179 1179
1180#ifdef CONFIG_PXA27x 1180#if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
1181 1181
1182/* Interrupt Controller */ 1182/* Interrupt Controller */
1183 1183
@@ -1823,6 +1823,7 @@
1823#define LCCR1 __REG(0x44000004) /* LCD Controller Control Register 1 */ 1823#define LCCR1 __REG(0x44000004) /* LCD Controller Control Register 1 */
1824#define LCCR2 __REG(0x44000008) /* LCD Controller Control Register 2 */ 1824#define LCCR2 __REG(0x44000008) /* LCD Controller Control Register 2 */
1825#define LCCR3 __REG(0x4400000C) /* LCD Controller Control Register 3 */ 1825#define LCCR3 __REG(0x4400000C) /* LCD Controller Control Register 3 */
1826#define LCCR4 __REG(0x44000010) /* LCD Controller Control Register 3 */
1826#define DFBR0 __REG(0x44000020) /* DMA Channel 0 Frame Branch Register */ 1827#define DFBR0 __REG(0x44000020) /* DMA Channel 0 Frame Branch Register */
1827#define DFBR1 __REG(0x44000024) /* DMA Channel 1 Frame Branch Register */ 1828#define DFBR1 __REG(0x44000024) /* DMA Channel 1 Frame Branch Register */
1828#define LCSR __REG(0x44000038) /* LCD Controller Status Register */ 1829#define LCSR __REG(0x44000038) /* LCD Controller Status Register */
@@ -1836,6 +1837,16 @@
1836#define LCCR3_8BPP (3 << 24) 1837#define LCCR3_8BPP (3 << 24)
1837#define LCCR3_16BPP (4 << 24) 1838#define LCCR3_16BPP (4 << 24)
1838 1839
1840#define LCCR3_PDFOR_0 (0 << 30)
1841#define LCCR3_PDFOR_1 (1 << 30)
1842#define LCCR3_PDFOR_2 (2 << 30)
1843#define LCCR3_PDFOR_3 (3 << 30)
1844
1845#define LCCR4_PAL_FOR_0 (0 << 15)
1846#define LCCR4_PAL_FOR_1 (1 << 15)
1847#define LCCR4_PAL_FOR_2 (2 << 15)
1848#define LCCR4_PAL_FOR_MASK (3 << 15)
1849
1839#define FDADR0 __REG(0x44000200) /* DMA Channel 0 Frame Descriptor Address Register */ 1850#define FDADR0 __REG(0x44000200) /* DMA Channel 0 Frame Descriptor Address Register */
1840#define FSADR0 __REG(0x44000204) /* DMA Channel 0 Frame Source Address Register */ 1851#define FSADR0 __REG(0x44000204) /* DMA Channel 0 Frame Source Address Register */
1841#define FIDR0 __REG(0x44000208) /* DMA Channel 0 Frame ID Register */ 1852#define FIDR0 __REG(0x44000208) /* DMA Channel 0 Frame ID Register */
diff --git a/include/asm-arm/arch-pxa/pxa3xx-regs.h b/include/asm-arm/arch-pxa/pxa3xx-regs.h
new file mode 100644
index 000000000000..3900a0ca0bc0
--- /dev/null
+++ b/include/asm-arm/arch-pxa/pxa3xx-regs.h
@@ -0,0 +1,75 @@
1/*
2 * linux/include/asm-arm/arch-pxa/pxa3xx-regs.h
3 *
4 * PXA3xx specific register definitions
5 *
6 * Copyright (C) 2007 Marvell International Ltd.
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#ifndef __ASM_ARCH_PXA3XX_REGS_H
14#define __ASM_ARCH_PXA3XX_REGS_H
15
16/*
17 * Application Subsystem Clock
18 */
19#define ACCR __REG(0x41340000) /* Application Subsystem Clock Configuration Register */
20#define ACSR __REG(0x41340004) /* Application Subsystem Clock Status Register */
21#define AICSR __REG(0x41340008) /* Application Subsystem Interrupt Control/Status Register */
22#define CKENA __REG(0x4134000C) /* A Clock Enable Register */
23#define CKENB __REG(0x41340010) /* B Clock Enable Register */
24#define AC97_DIV __REG(0x41340014) /* AC97 clock divisor value register */
25
26/*
27 * Clock Enable Bit
28 */
29#define CKEN_LCD 1 /* < LCD Clock Enable */
30#define CKEN_USBH 2 /* < USB host clock enable */
31#define CKEN_CAMERA 3 /* < Camera interface clock enable */
32#define CKEN_NAND 4 /* < NAND Flash Controller Clock Enable */
33#define CKEN_USB2 6 /* < USB 2.0 client clock enable. */
34#define CKEN_DMC 8 /* < Dynamic Memory Controller clock enable */
35#define CKEN_SMC 9 /* < Static Memory Controller clock enable */
36#define CKEN_ISC 10 /* < Internal SRAM Controller clock enable */
37#define CKEN_BOOT 11 /* < Boot rom clock enable */
38#define CKEN_MMC1 12 /* < MMC1 Clock enable */
39#define CKEN_MMC2 13 /* < MMC2 clock enable */
40#define CKEN_KEYPAD 14 /* < Keypand Controller Clock Enable */
41#define CKEN_CIR 15 /* < Consumer IR Clock Enable */
42#define CKEN_USIM0 17 /* < USIM[0] Clock Enable */
43#define CKEN_USIM1 18 /* < USIM[1] Clock Enable */
44#define CKEN_TPM 19 /* < TPM clock enable */
45#define CKEN_UDC 20 /* < UDC clock enable */
46#define CKEN_BTUART 21 /* < BTUART clock enable */
47#define CKEN_FFUART 22 /* < FFUART clock enable */
48#define CKEN_STUART 23 /* < STUART clock enable */
49#define CKEN_AC97 24 /* < AC97 clock enable */
50#define CKEN_TOUCH 25 /* < Touch screen Interface Clock Enable */
51#define CKEN_SSP1 26 /* < SSP1 clock enable */
52#define CKEN_SSP2 27 /* < SSP2 clock enable */
53#define CKEN_SSP3 28 /* < SSP3 clock enable */
54#define CKEN_SSP4 29 /* < SSP4 clock enable */
55#define CKEN_MSL0 30 /* < MSL0 clock enable */
56#define CKEN_PWM0 32 /* < PWM[0] clock enable */
57#define CKEN_PWM1 33 /* < PWM[1] clock enable */
58#define CKEN_I2C 36 /* < I2C clock enable */
59#define CKEN_INTC 38 /* < Interrupt controller clock enable */
60#define CKEN_GPIO 39 /* < GPIO clock enable */
61#define CKEN_1WIRE 40 /* < 1-wire clock enable */
62#define CKEN_HSIO2 41 /* < HSIO2 clock enable */
63#define CKEN_MINI_IM 48 /* < Mini-IM */
64#define CKEN_MINI_LCD 49 /* < Mini LCD */
65
66#if defined(CONFIG_CPU_PXA310)
67#define CKEN_MMC3 5 /* < MMC3 Clock Enable */
68#define CKEN_MVED 43 /* < MVED clock enable */
69#endif
70
71/* Note: GCU clock enable bit differs on PXA300/PXA310 and PXA320 */
72#define PXA300_CKEN_GRAPHICS 42 /* Graphics controller clock enable */
73#define PXA320_CKEN_GRAPHICS 7 /* Graphics controller clock enable */
74
75#endif /* __ASM_ARCH_PXA3XX_REGS_H */
diff --git a/include/asm-arm/arch-pxa/pxafb.h b/include/asm-arm/arch-pxa/pxafb.h
index 81c3928d608c..ea2336aa70e4 100644
--- a/include/asm-arm/arch-pxa/pxafb.h
+++ b/include/asm-arm/arch-pxa/pxafb.h
@@ -70,7 +70,12 @@ struct pxafb_mach_info {
70 * LCCR3_HSP, LCCR3_VSP, LCCR0_Pcd(x), LCCR3_Bpp 70 * LCCR3_HSP, LCCR3_VSP, LCCR0_Pcd(x), LCCR3_Bpp
71 */ 71 */
72 u_int lccr3; 72 u_int lccr3;
73 73 /* The following should be defined in LCCR4
74 * LCCR4_PAL_FOR_0 or LCCR4_PAL_FOR_1 or LCCR4_PAL_FOR_2
75 *
76 * All other bits in LCCR4 should be left alone.
77 */
78 u_int lccr4;
74 void (*pxafb_backlight_power)(int); 79 void (*pxafb_backlight_power)(int);
75 void (*pxafb_lcd_power)(int, struct fb_var_screeninfo *); 80 void (*pxafb_lcd_power)(int, struct fb_var_screeninfo *);
76 81
diff --git a/include/asm-arm/arch-pxa/timex.h b/include/asm-arm/arch-pxa/timex.h
index 2473bb51d0a6..8d882f0b6a16 100644
--- a/include/asm-arm/arch-pxa/timex.h
+++ b/include/asm-arm/arch-pxa/timex.h
@@ -21,4 +21,6 @@
21#else 21#else
22#define CLOCK_TICK_RATE 3250000 22#define CLOCK_TICK_RATE 3250000
23#endif 23#endif
24#else
25#define CLOCK_TICK_RATE 3250000
24#endif 26#endif
diff --git a/include/asm-arm/arch-pxa/zylonite.h b/include/asm-arm/arch-pxa/zylonite.h
new file mode 100644
index 000000000000..f58b59162b82
--- /dev/null
+++ b/include/asm-arm/arch-pxa/zylonite.h
@@ -0,0 +1,35 @@
1#ifndef __ASM_ARCH_ZYLONITE_H
2#define __ASM_ARCH_ZYLONITE_H
3
4#define ZYLONITE_ETH_PHYS 0x14000000
5
6/* the following variables are processor specific and initialized
7 * by the corresponding zylonite_pxa3xx_init()
8 */
9extern int gpio_backlight;
10extern int gpio_eth_irq;
11
12extern int lcd_id;
13extern int lcd_orientation;
14
15#ifdef CONFIG_CPU_PXA300
16extern void zylonite_pxa300_init(void);
17#else
18static inline void zylonite_pxa300_init(void)
19{
20 if (cpu_is_pxa300() || cpu_is_pxa310())
21 panic("%s: PXA300/PXA310 not supported\n", __FUNCTION__);
22}
23#endif
24
25#ifdef CONFIG_CPU_PXA320
26extern void zylonite_pxa320_init(void);
27#else
28static inline void zylonite_pxa320_init(void)
29{
30 if (cpu_is_pxa320())
31 panic("%s: PXA320 not supported\n", __FUNCTION__);
32}
33#endif
34
35#endif /* __ASM_ARCH_ZYLONITE_H */
diff --git a/include/asm-arm/arch-rpc/uncompress.h b/include/asm-arm/arch-rpc/uncompress.h
index 06231ede54e5..b8e29efd8c5b 100644
--- a/include/asm-arm/arch-rpc/uncompress.h
+++ b/include/asm-arm/arch-rpc/uncompress.h
@@ -11,9 +11,11 @@
11 11
12#include <asm/hardware.h> 12#include <asm/hardware.h>
13#include <asm/io.h> 13#include <asm/io.h>
14#include <asm/setup.h>
15#include <asm/page.h>
14 16
15int video_num_columns, video_num_lines, video_size_row; 17int video_size_row;
16int white, bytes_per_char_h; 18unsigned char bytes_per_char_h;
17extern unsigned long con_charconvtable[256]; 19extern unsigned long con_charconvtable[256];
18 20
19struct param_struct { 21struct param_struct {
@@ -64,6 +66,13 @@ extern __attribute__((pure)) struct param_struct *params(void);
64#define params (params()) 66#define params (params())
65 67
66#ifndef STANDALONE_DEBUG 68#ifndef STANDALONE_DEBUG
69static unsigned long video_num_cols;
70static unsigned long video_num_rows;
71static unsigned long video_x;
72static unsigned long video_y;
73static unsigned char bytes_per_char_v;
74static int white;
75
67/* 76/*
68 * This does not append a newline 77 * This does not append a newline
69 */ 78 */
@@ -73,27 +82,27 @@ static void putc(int c)
73 int x,y; 82 int x,y;
74 char *ptr; 83 char *ptr;
75 84
76 x = params->video_x; 85 x = video_x;
77 y = params->video_y; 86 y = video_y;
78 87
79 if (c == '\n') { 88 if (c == '\n') {
80 if (++y >= video_num_lines) 89 if (++y >= video_num_rows)
81 y--; 90 y--;
82 } else if (c == '\r') { 91 } else if (c == '\r') {
83 x = 0; 92 x = 0;
84 } else { 93 } else {
85 ptr = VIDMEM + ((y*video_num_columns*params->bytes_per_char_v+x)*bytes_per_char_h); 94 ptr = VIDMEM + ((y*video_num_cols*bytes_per_char_v+x)*bytes_per_char_h);
86 ll_write_char(ptr, c, white); 95 ll_write_char(ptr, c, white);
87 if (++x >= video_num_columns) { 96 if (++x >= video_num_cols) {
88 x = 0; 97 x = 0;
89 if ( ++y >= video_num_lines ) { 98 if ( ++y >= video_num_rows ) {
90 y--; 99 y--;
91 } 100 }
92 } 101 }
93 } 102 }
94 103
95 params->video_x = x; 104 video_x = x;
96 params->video_y = y; 105 video_y = y;
97} 106}
98 107
99static inline void flush(void) 108static inline void flush(void)
@@ -108,11 +117,44 @@ static void error(char *x);
108static void arch_decomp_setup(void) 117static void arch_decomp_setup(void)
109{ 118{
110 int i; 119 int i;
120 struct tag *t = (struct tag *)params;
121 unsigned int nr_pages = 0, page_size = PAGE_SIZE;
122
123 if (t->hdr.tag == ATAG_CORE)
124 {
125 for (; t->hdr.size; t = tag_next(t))
126 {
127 if (t->hdr.tag == ATAG_VIDEOTEXT)
128 {
129 video_num_rows = t->u.videotext.video_lines;
130 video_num_cols = t->u.videotext.video_cols;
131 bytes_per_char_h = t->u.videotext.video_points;
132 bytes_per_char_v = t->u.videotext.video_points;
133 video_x = t->u.videotext.x;
134 video_y = t->u.videotext.y;
135 }
136
137 if (t->hdr.tag == ATAG_MEM)
138 {
139 page_size = PAGE_SIZE;
140 nr_pages += (t->u.mem.size / PAGE_SIZE);
141 }
142 }
143 }
144 else
145 {
146 nr_pages = params->nr_pages;
147 page_size = params->page_size;
148 video_num_rows = params->video_num_rows;
149 video_num_cols = params->video_num_cols;
150 video_x = params->video_x;
151 video_y = params->video_y;
152 bytes_per_char_h = params->bytes_per_char_h;
153 bytes_per_char_v = params->bytes_per_char_v;
154 }
155
156 video_size_row = video_num_cols * bytes_per_char_h;
111 157
112 video_num_lines = params->video_num_rows;
113 video_num_columns = params->video_num_cols;
114 bytes_per_char_h = params->bytes_per_char_h;
115 video_size_row = video_num_columns * bytes_per_char_h;
116 if (bytes_per_char_h == 4) 158 if (bytes_per_char_h == 4)
117 for (i = 0; i < 256; i++) 159 for (i = 0; i < 256; i++)
118 con_charconvtable[i] = 160 con_charconvtable[i] =
@@ -146,7 +188,7 @@ static void arch_decomp_setup(void)
146 white = 7; 188 white = 7;
147 } 189 }
148 190
149 if (params->nr_pages * params->page_size < 4096*1024) error("<4M of mem\n"); 191 if (nr_pages * page_size < 4096*1024) error("<4M of mem\n");
150} 192}
151#endif 193#endif
152 194
diff --git a/include/asm-arm/arch-s3c2410/fb.h b/include/asm-arm/arch-s3c2410/fb.h
index 93a58e7862b0..5d0262601a7e 100644
--- a/include/asm-arm/arch-s3c2410/fb.h
+++ b/include/asm-arm/arch-s3c2410/fb.h
@@ -14,12 +14,6 @@
14 14
15#include <asm/arch/regs-lcd.h> 15#include <asm/arch/regs-lcd.h>
16 16
17struct s3c2410fb_val {
18 unsigned int defval;
19 unsigned int min;
20 unsigned int max;
21};
22
23struct s3c2410fb_hw { 17struct s3c2410fb_hw {
24 unsigned long lcdcon1; 18 unsigned long lcdcon1;
25 unsigned long lcdcon2; 19 unsigned long lcdcon2;
@@ -28,23 +22,37 @@ struct s3c2410fb_hw {
28 unsigned long lcdcon5; 22 unsigned long lcdcon5;
29}; 23};
30 24
31struct s3c2410fb_mach_info { 25/* LCD description */
32 unsigned char fixed_syncs; /* do not update sync/border */ 26struct s3c2410fb_display {
33 27 /* LCD type */
34 /* LCD types */ 28 unsigned type;
35 int type;
36 29
37 /* Screen size */ 30 /* Screen size */
38 int width; 31 unsigned short width;
39 int height; 32 unsigned short height;
40 33
41 /* Screen info */ 34 /* Screen info */
42 struct s3c2410fb_val xres; 35 unsigned short xres;
43 struct s3c2410fb_val yres; 36 unsigned short yres;
44 struct s3c2410fb_val bpp; 37 unsigned short bpp;
38
39 unsigned pixclock; /* pixclock in picoseconds */
40 unsigned short left_margin; /* value in pixels (TFT) or HCLKs (STN) */
41 unsigned short right_margin; /* value in pixels (TFT) or HCLKs (STN) */
42 unsigned short hsync_len; /* value in pixels (TFT) or HCLKs (STN) */
43 unsigned short upper_margin; /* value in lines (TFT) or 0 (STN) */
44 unsigned short lower_margin; /* value in lines (TFT) or 0 (STN) */
45 unsigned short vsync_len; /* value in lines (TFT) or 0 (STN) */
45 46
46 /* lcd configuration registers */ 47 /* lcd configuration registers */
47 struct s3c2410fb_hw regs; 48 unsigned long lcdcon5;
49};
50
51struct s3c2410fb_mach_info {
52
53 struct s3c2410fb_display *displays; /* attached diplays info */
54 unsigned num_displays; /* number of defined displays */
55 unsigned default_display;
48 56
49 /* GPIOs */ 57 /* GPIOs */
50 58
diff --git a/include/asm-arm/arch-s3c2410/irqs.h b/include/asm-arm/arch-s3c2410/irqs.h
index 3b49cd1c345c..996f65488d2d 100644
--- a/include/asm-arm/arch-s3c2410/irqs.h
+++ b/include/asm-arm/arch-s3c2410/irqs.h
@@ -112,6 +112,13 @@
112#define IRQ_TC S3C2410_IRQSUB(9) 112#define IRQ_TC S3C2410_IRQSUB(9)
113#define IRQ_ADC S3C2410_IRQSUB(10) 113#define IRQ_ADC S3C2410_IRQSUB(10)
114 114
115/* extra irqs for s3c2412 */
116
117#define IRQ_S3C2412_CFSDI S3C2410_IRQ(21)
118
119#define IRQ_S3C2412_SDI S3C2410_IRQSUB(13)
120#define IRQ_S3C2412_CF S3C2410_IRQSUB(14)
121
115/* extra irqs for s3c2440 */ 122/* extra irqs for s3c2440 */
116 123
117#define IRQ_S3C2440_CAM_C S3C2410_IRQSUB(11) /* S3C2443 too */ 124#define IRQ_S3C2440_CAM_C S3C2410_IRQSUB(11) /* S3C2443 too */
diff --git a/include/asm-arm/arch-s3c2410/regs-gpio.h b/include/asm-arm/arch-s3c2410/regs-gpio.h
index dea578b8f7f6..b693158b2d3c 100644
--- a/include/asm-arm/arch-s3c2410/regs-gpio.h
+++ b/include/asm-arm/arch-s3c2410/regs-gpio.h
@@ -1140,10 +1140,16 @@
1140 1140
1141/* definitions for each pin bit */ 1141/* definitions for each pin bit */
1142#define S3C2412_SLPCON_LOW(x) ( 0x00 << ((x) * 2)) 1142#define S3C2412_SLPCON_LOW(x) ( 0x00 << ((x) * 2))
1143#define S3C2412_SLPCON_HI(x) ( 0x01 << ((x) * 2)) 1143#define S3C2412_SLPCON_HIGH(x) ( 0x01 << ((x) * 2))
1144#define S3C2412_SLPCON_IN(x) ( 0x02 << ((x) * 2)) 1144#define S3C2412_SLPCON_IN(x) ( 0x02 << ((x) * 2))
1145#define S3C2412_SLPCON_PDWN(x) ( 0x03 << ((x) * 2)) 1145#define S3C2412_SLPCON_PULL(x) ( 0x03 << ((x) * 2))
1146#define S3C2412_SLPCON_EINT(x) ( 0x02 << ((x) * 2)) /* only IRQ pins */
1146#define S3C2412_SLPCON_MASK(x) ( 0x03 << ((x) * 2)) 1147#define S3C2412_SLPCON_MASK(x) ( 0x03 << ((x) * 2))
1147 1148
1149#define S3C2412_SLPCON_ALL_LOW (0x0)
1150#define S3C2412_SLPCON_ALL_HIGH (0x11111111 | 0x44444444)
1151#define S3C2412_SLPCON_ALL_IN (0x22222222 | 0x88888888)
1152#define S3C2412_SLPCON_ALL_PULL (0x33333333)
1153
1148#endif /* __ASM_ARCH_REGS_GPIO_H */ 1154#endif /* __ASM_ARCH_REGS_GPIO_H */
1149 1155
diff --git a/include/asm-arm/arch-s3c2410/regs-power.h b/include/asm-arm/arch-s3c2410/regs-power.h
index 94ff96505b6a..f79987be55e8 100644
--- a/include/asm-arm/arch-s3c2410/regs-power.h
+++ b/include/asm-arm/arch-s3c2410/regs-power.h
@@ -18,6 +18,11 @@
18#define S3C2412_PWRMODECON S3C24XX_PWRREG(0x20) 18#define S3C2412_PWRMODECON S3C24XX_PWRREG(0x20)
19#define S3C2412_PWRCFG S3C24XX_PWRREG(0x24) 19#define S3C2412_PWRCFG S3C24XX_PWRREG(0x24)
20 20
21#define S3C2412_INFORM0 S3C24XX_PWRREG(0x70)
22#define S3C2412_INFORM1 S3C24XX_PWRREG(0x74)
23#define S3C2412_INFORM2 S3C24XX_PWRREG(0x78)
24#define S3C2412_INFORM3 S3C24XX_PWRREG(0x7C)
25
21#define S3C2412_PWRCFG_BATF_IGNORE (0<<0) 26#define S3C2412_PWRCFG_BATF_IGNORE (0<<0)
22#define S3C2412_PWRCFG_BATF_SLEEP (3<<0) 27#define S3C2412_PWRCFG_BATF_SLEEP (3<<0)
23#define S3C2412_PWRCFG_BATF_MASK (3<<0) 28#define S3C2412_PWRCFG_BATF_MASK (3<<0)
diff --git a/include/asm-arm/arch-s3c2410/regs-s3c2412.h b/include/asm-arm/arch-s3c2410/regs-s3c2412.h
index 8ca6a3bc8555..783b18f5bcea 100644
--- a/include/asm-arm/arch-s3c2410/regs-s3c2412.h
+++ b/include/asm-arm/arch-s3c2410/regs-s3c2412.h
@@ -17,5 +17,7 @@
17#define S3C2412_SWRST (S3C24XX_VA_CLKPWR + 0x30) 17#define S3C2412_SWRST (S3C24XX_VA_CLKPWR + 0x30)
18#define S3C2412_SWRST_RESET (0x533C2412) 18#define S3C2412_SWRST_RESET (0x533C2412)
19 19
20/* see regs-power.h for the other registers in the power block. */
21
20#endif /* __ASM_ARCH_REGS_S3C2412_H */ 22#endif /* __ASM_ARCH_REGS_S3C2412_H */
21 23
diff --git a/include/asm-arm/arch-sa1100/SA-1101.h b/include/asm-arm/arch-sa1100/SA-1101.h
index 527d887f1ee3..65ca8c79e6d2 100644
--- a/include/asm-arm/arch-sa1100/SA-1101.h
+++ b/include/asm-arm/arch-sa1100/SA-1101.h
@@ -106,7 +106,7 @@
106#define SMCR_ColAdrBits( x ) /* col. addr bits 8..11 */ \ 106#define SMCR_ColAdrBits( x ) /* col. addr bits 8..11 */ \
107 (( (x) - 8 ) << FShft (SMCR_DCAC)) 107 (( (x) - 8 ) << FShft (SMCR_DCAC))
108#define SMCR_RowAdrBits( x ) /* row addr bits 9..12 */\ 108#define SMCR_RowAdrBits( x ) /* row addr bits 9..12 */\
109 (( (x) - 9 ) << FShft (SMCR_DRAC) 109 (( (x) - 9 ) << FShft (SMCR_DRAC))
110 110
111#define SNPR_VFBstart Fld(12,0) /* Video frame buffer addr */ 111#define SNPR_VFBstart Fld(12,0) /* Video frame buffer addr */
112#define SNPR_VFBsize Fld(11,12) /* Video frame buffer size */ 112#define SNPR_VFBsize Fld(11,12) /* Video frame buffer size */
@@ -394,7 +394,7 @@
394#define VgaStatus (*((volatile Word *) SA1101_p2v (_VgaStatus))) 394#define VgaStatus (*((volatile Word *) SA1101_p2v (_VgaStatus)))
395#define VgaInterruptMask (*((volatile Word *) SA1101_p2v (_VgaInterruptMask))) 395#define VgaInterruptMask (*((volatile Word *) SA1101_p2v (_VgaInterruptMask)))
396#define VgaPalette (*((volatile Word *) SA1101_p2v (_VgaPalette))) 396#define VgaPalette (*((volatile Word *) SA1101_p2v (_VgaPalette)))
397#define DacControl (*((volatile Word *) SA1101_p2v (_DacControl)) 397#define DacControl (*((volatile Word *) SA1101_p2v (_DacControl)))
398#define VgaTest (*((volatile Word *) SA1101_p2v (_VgaTest))) 398#define VgaTest (*((volatile Word *) SA1101_p2v (_VgaTest)))
399 399
400#define VideoControl_VgaEn 0x00000000 400#define VideoControl_VgaEn 0x00000000
diff --git a/include/asm-arm/dma-mapping.h b/include/asm-arm/dma-mapping.h
index c8b5d0db0cf0..678134bf2475 100644
--- a/include/asm-arm/dma-mapping.h
+++ b/include/asm-arm/dma-mapping.h
@@ -17,7 +17,7 @@
17 * platforms with CONFIG_DMABOUNCE. 17 * platforms with CONFIG_DMABOUNCE.
18 * Use the driver DMA support - see dma-mapping.h (dma_sync_*) 18 * Use the driver DMA support - see dma-mapping.h (dma_sync_*)
19 */ 19 */
20extern void consistent_sync(const void *kaddr, size_t size, int rw); 20extern void dma_cache_maint(const void *kaddr, size_t size, int rw);
21 21
22/* 22/*
23 * Return whether the given device DMA address mask can be supported 23 * Return whether the given device DMA address mask can be supported
@@ -165,7 +165,7 @@ dma_map_single(struct device *dev, void *cpu_addr, size_t size,
165 enum dma_data_direction dir) 165 enum dma_data_direction dir)
166{ 166{
167 if (!arch_is_coherent()) 167 if (!arch_is_coherent())
168 consistent_sync(cpu_addr, size, dir); 168 dma_cache_maint(cpu_addr, size, dir);
169 169
170 return virt_to_dma(dev, (unsigned long)cpu_addr); 170 return virt_to_dma(dev, (unsigned long)cpu_addr);
171} 171}
@@ -278,7 +278,7 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
278 virt = page_address(sg->page) + sg->offset; 278 virt = page_address(sg->page) + sg->offset;
279 279
280 if (!arch_is_coherent()) 280 if (!arch_is_coherent())
281 consistent_sync(virt, sg->length, dir); 281 dma_cache_maint(virt, sg->length, dir);
282 } 282 }
283 283
284 return nents; 284 return nents;
@@ -334,7 +334,7 @@ dma_sync_single_for_cpu(struct device *dev, dma_addr_t handle, size_t size,
334 enum dma_data_direction dir) 334 enum dma_data_direction dir)
335{ 335{
336 if (!arch_is_coherent()) 336 if (!arch_is_coherent())
337 consistent_sync((void *)dma_to_virt(dev, handle), size, dir); 337 dma_cache_maint((void *)dma_to_virt(dev, handle), size, dir);
338} 338}
339 339
340static inline void 340static inline void
@@ -342,7 +342,7 @@ dma_sync_single_for_device(struct device *dev, dma_addr_t handle, size_t size,
342 enum dma_data_direction dir) 342 enum dma_data_direction dir)
343{ 343{
344 if (!arch_is_coherent()) 344 if (!arch_is_coherent())
345 consistent_sync((void *)dma_to_virt(dev, handle), size, dir); 345 dma_cache_maint((void *)dma_to_virt(dev, handle), size, dir);
346} 346}
347#else 347#else
348extern void dma_sync_single_for_cpu(struct device*, dma_addr_t, size_t, enum dma_data_direction); 348extern void dma_sync_single_for_cpu(struct device*, dma_addr_t, size_t, enum dma_data_direction);
@@ -373,7 +373,7 @@ dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nents,
373 for (i = 0; i < nents; i++, sg++) { 373 for (i = 0; i < nents; i++, sg++) {
374 char *virt = page_address(sg->page) + sg->offset; 374 char *virt = page_address(sg->page) + sg->offset;
375 if (!arch_is_coherent()) 375 if (!arch_is_coherent())
376 consistent_sync(virt, sg->length, dir); 376 dma_cache_maint(virt, sg->length, dir);
377 } 377 }
378} 378}
379 379
@@ -386,7 +386,7 @@ dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nents,
386 for (i = 0; i < nents; i++, sg++) { 386 for (i = 0; i < nents; i++, sg++) {
387 char *virt = page_address(sg->page) + sg->offset; 387 char *virt = page_address(sg->page) + sg->offset;
388 if (!arch_is_coherent()) 388 if (!arch_is_coherent())
389 consistent_sync(virt, sg->length, dir); 389 dma_cache_maint(virt, sg->length, dir);
390 } 390 }
391} 391}
392#else 392#else
diff --git a/include/asm-arm/hardware/it8152.h b/include/asm-arm/hardware/it8152.h
new file mode 100644
index 000000000000..aaebb61aca48
--- /dev/null
+++ b/include/asm-arm/hardware/it8152.h
@@ -0,0 +1,99 @@
1/*
2 * linux/include/arm/hardware/it8152.h
3 *
4 * Copyright Compulab Ltd., 2006,2007
5 * Mike Rapoport <mike@compulab.co.il>
6 *
7 * ITE 8152 companion chip register definitions
8 */
9
10#ifndef __ASM_HARDWARE_IT8152_H
11#define __ASM_HARDWARE_IT8152_H
12extern unsigned long it8152_base_address;
13
14#define IT8152_IO_BASE (it8152_base_address + 0x03e00000)
15#define IT8152_CFGREG_BASE (it8152_base_address + 0x03f00000)
16
17#define __REG_IT8152(x) (it8152_base_address + (x))
18
19#define IT8152_PCI_CFG_ADDR __REG_IT8152(0x3f00800)
20#define IT8152_PCI_CFG_DATA __REG_IT8152(0x3f00804)
21
22#define IT8152_INTC_LDCNIRR __REG_IT8152(0x3f00300)
23#define IT8152_INTC_LDPNIRR __REG_IT8152(0x3f00304)
24#define IT8152_INTC_LDCNIMR __REG_IT8152(0x3f00308)
25#define IT8152_INTC_LDPNIMR __REG_IT8152(0x3f0030C)
26#define IT8152_INTC_LDNITR __REG_IT8152(0x3f00310)
27#define IT8152_INTC_LDNIAR __REG_IT8152(0x3f00314)
28#define IT8152_INTC_LPCNIRR __REG_IT8152(0x3f00320)
29#define IT8152_INTC_LPPNIRR __REG_IT8152(0x3f00324)
30#define IT8152_INTC_LPCNIMR __REG_IT8152(0x3f00328)
31#define IT8152_INTC_LPPNIMR __REG_IT8152(0x3f0032C)
32#define IT8152_INTC_LPNITR __REG_IT8152(0x3f00330)
33#define IT8152_INTC_LPNIAR __REG_IT8152(0x3f00334)
34#define IT8152_INTC_PDCNIRR __REG_IT8152(0x3f00340)
35#define IT8152_INTC_PDPNIRR __REG_IT8152(0x3f00344)
36#define IT8152_INTC_PDCNIMR __REG_IT8152(0x3f00348)
37#define IT8152_INTC_PDPNIMR __REG_IT8152(0x3f0034C)
38#define IT8152_INTC_PDNITR __REG_IT8152(0x3f00350)
39#define IT8152_INTC_PDNIAR __REG_IT8152(0x3f00354)
40#define IT8152_INTC_INTC_TYPER __REG_IT8152(0x3f003FC)
41
42#define IT8152_GPIO_GPDR __REG_IT8152(0x3f00500)
43
44/*
45 Interrup contoler per register summary:
46 ---------------------------------------
47 LCDNIRR:
48 IT8152_LD_IRQ(8) PCICLK stop
49 IT8152_LD_IRQ(7) MCLK ready
50 IT8152_LD_IRQ(6) s/w
51 IT8152_LD_IRQ(5) UART
52 IT8152_LD_IRQ(4) GPIO
53 IT8152_LD_IRQ(3) TIMER 4
54 IT8152_LD_IRQ(2) TIMER 3
55 IT8152_LD_IRQ(1) TIMER 2
56 IT8152_LD_IRQ(0) TIMER 1
57
58 LPCNIRR:
59 IT8152_LP_IRQ(x) serial IRQ x
60
61 PCIDNIRR:
62 IT8152_PD_IRQ(14) PCISERR
63 IT8152_PD_IRQ(13) CPU/PCI bridge target abort (h2pTADR)
64 IT8152_PD_IRQ(12) CPU/PCI bridge master abort (h2pMADR)
65 IT8152_PD_IRQ(11) PCI INTD
66 IT8152_PD_IRQ(10) PCI INTC
67 IT8152_PD_IRQ(9) PCI INTB
68 IT8152_PD_IRQ(8) PCI INTA
69 IT8152_PD_IRQ(7) serial INTD
70 IT8152_PD_IRQ(6) serial INTC
71 IT8152_PD_IRQ(5) serial INTB
72 IT8152_PD_IRQ(4) serial INTA
73 IT8152_PD_IRQ(3) serial IRQ IOCHK (IOCHKR)
74 IT8152_PD_IRQ(2) chaining DMA (CDMAR)
75 IT8152_PD_IRQ(1) USB (USBR)
76 IT8152_PD_IRQ(0) Audio controller (ACR)
77 */
78/* frequently used interrupts */
79#define IT8152_PCISERR IT8152_PD_IRQ(14)
80#define IT8152_H2PTADR IT8152_PD_IRQ(13)
81#define IT8152_H2PMAR IT8152_PD_IRQ(12)
82#define IT8152_PCI_INTD IT8152_PD_IRQ(11)
83#define IT8152_PCI_INTC IT8152_PD_IRQ(10)
84#define IT8152_PCI_INTB IT8152_PD_IRQ(9)
85#define IT8152_PCI_INTA IT8152_PD_IRQ(8)
86#define IT8152_CDMA_INT IT8152_PD_IRQ(2)
87#define IT8152_USB_INT IT8152_PD_IRQ(1)
88#define IT8152_AUDIO_INT IT8152_PD_IRQ(0)
89
90struct pci_dev;
91struct pci_sys_data;
92
93extern void it8152_irq_demux(unsigned int irq, struct irq_desc *desc);
94extern void it8152_init_irq(void);
95extern int it8152_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin);
96extern int it8152_pci_setup(int nr, struct pci_sys_data *sys);
97extern struct pci_bus *it8152_pci_scan_bus(int nr, struct pci_sys_data *sys);
98
99#endif /* __ASM_HARDWARE_IT8152_H */
diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h
index 1d3caa42a386..eebe56e74d6d 100644
--- a/include/asm-arm/io.h
+++ b/include/asm-arm/io.h
@@ -228,12 +228,12 @@ extern void _memset_io(volatile void __iomem *, int, size_t);
228 */ 228 */
229#ifndef ioread8 229#ifndef ioread8
230#define ioread8(p) ({ unsigned int __v = __raw_readb(p); __v; }) 230#define ioread8(p) ({ unsigned int __v = __raw_readb(p); __v; })
231#define ioread16(p) ({ unsigned int __v = le16_to_cpu(__raw_readw(p)); __v; }) 231#define ioread16(p) ({ unsigned int __v = le16_to_cpu((__force __le16)__raw_readw(p)); __v; })
232#define ioread32(p) ({ unsigned int __v = le32_to_cpu(__raw_readl(p)); __v; }) 232#define ioread32(p) ({ unsigned int __v = le32_to_cpu((__force __le32)__raw_readl(p)); __v; })
233 233
234#define iowrite8(v,p) __raw_writeb(v, p) 234#define iowrite8(v,p) __raw_writeb(v, p)
235#define iowrite16(v,p) __raw_writew(cpu_to_le16(v), p) 235#define iowrite16(v,p) __raw_writew((__force __u16)cpu_to_le16(v), p)
236#define iowrite32(v,p) __raw_writel(cpu_to_le32(v), p) 236#define iowrite32(v,p) __raw_writel((__force __u32)cpu_to_le32(v), p)
237 237
238#define ioread8_rep(p,d,c) __raw_readsb(p,d,c) 238#define ioread8_rep(p,d,c) __raw_readsb(p,d,c)
239#define ioread16_rep(p,d,c) __raw_readsw(p,d,c) 239#define ioread16_rep(p,d,c) __raw_readsw(p,d,c)
diff --git a/include/asm-arm/kexec.h b/include/asm-arm/kexec.h
index b5b030ef633d..46dcc4d0b9bd 100644
--- a/include/asm-arm/kexec.h
+++ b/include/asm-arm/kexec.h
@@ -14,6 +14,8 @@
14 14
15#define KEXEC_ARCH KEXEC_ARCH_ARM 15#define KEXEC_ARCH KEXEC_ARCH_ARM
16 16
17#define KEXEC_BOOT_PARAMS_SIZE 1536
18
17#ifndef __ASSEMBLY__ 19#ifndef __ASSEMBLY__
18 20
19struct kimage; 21struct kimage;
diff --git a/include/asm-arm/pci.h b/include/asm-arm/pci.h
index ed3f898191f4..75feb1574a69 100644
--- a/include/asm-arm/pci.h
+++ b/include/asm-arm/pci.h
@@ -8,10 +8,17 @@
8 8
9#define pcibios_scan_all_fns(a, b) 0 9#define pcibios_scan_all_fns(a, b) 0
10 10
11#ifdef CONFIG_PCI_HOST_ITE8152
12/* ITE bridge requires setting latency timer to avoid early bus access
13 termination by PIC bus mater devices
14*/
15extern void pcibios_set_master(struct pci_dev *dev);
16#else
11static inline void pcibios_set_master(struct pci_dev *dev) 17static inline void pcibios_set_master(struct pci_dev *dev)
12{ 18{
13 /* No special bus mastering setup handling */ 19 /* No special bus mastering setup handling */
14} 20}
21#endif
15 22
16static inline void pcibios_penalize_isa_irq(int irq, int active) 23static inline void pcibios_penalize_isa_irq(int irq, int active)
17{ 24{
diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h
index d327b25c986c..88e868b7aae0 100644
--- a/include/asm-arm/unistd.h
+++ b/include/asm-arm/unistd.h
@@ -378,6 +378,7 @@
378#define __NR_signalfd (__NR_SYSCALL_BASE+349) 378#define __NR_signalfd (__NR_SYSCALL_BASE+349)
379#define __NR_timerfd (__NR_SYSCALL_BASE+350) 379#define __NR_timerfd (__NR_SYSCALL_BASE+350)
380#define __NR_eventfd (__NR_SYSCALL_BASE+351) 380#define __NR_eventfd (__NR_SYSCALL_BASE+351)
381#define __NR_fallocate (__NR_SYSCALL_BASE+352)
381 382
382/* 383/*
383 * The following SWIs are ARM private. 384 * The following SWIs are ARM private.
diff --git a/include/asm-avr32/kdebug.h b/include/asm-avr32/kdebug.h
index 7f54e2b15d13..fd7e99046b2f 100644
--- a/include/asm-avr32/kdebug.h
+++ b/include/asm-avr32/kdebug.h
@@ -1,26 +1,10 @@
1#ifndef __ASM_AVR32_KDEBUG_H 1#ifndef __ASM_AVR32_KDEBUG_H
2#define __ASM_AVR32_KDEBUG_H 2#define __ASM_AVR32_KDEBUG_H
3 3
4#include <linux/notifier.h>
5
6/* Grossly misnamed. */ 4/* Grossly misnamed. */
7enum die_val { 5enum die_val {
8 DIE_BREAKPOINT, 6 DIE_BREAKPOINT,
9 DIE_SSTEP, 7 DIE_SSTEP,
10}; 8};
11 9
12/*
13 * These are only here because kprobes.c wants them to implement a
14 * blatant layering violation. Will hopefully go away soon once all
15 * architectures are updated.
16 */
17static inline int register_page_fault_notifier(struct notifier_block *nb)
18{
19 return 0;
20}
21static inline int unregister_page_fault_notifier(struct notifier_block *nb)
22{
23 return 0;
24}
25
26#endif /* __ASM_AVR32_KDEBUG_H */ 10#endif /* __ASM_AVR32_KDEBUG_H */
diff --git a/include/asm-avr32/kprobes.h b/include/asm-avr32/kprobes.h
index 190a6377c809..996cb656474e 100644
--- a/include/asm-avr32/kprobes.h
+++ b/include/asm-avr32/kprobes.h
@@ -17,7 +17,7 @@ typedef u16 kprobe_opcode_t;
17#define BREAKPOINT_INSTRUCTION 0xd673 /* breakpoint */ 17#define BREAKPOINT_INSTRUCTION 0xd673 /* breakpoint */
18#define MAX_INSN_SIZE 2 18#define MAX_INSN_SIZE 2
19 19
20#define ARCH_INACTIVE_KPROBE_COUNT 1 20#define kretprobe_blacklist_size 0
21 21
22#define arch_remove_kprobe(p) do { } while (0) 22#define arch_remove_kprobe(p) do { } while (0)
23 23
diff --git a/include/asm-blackfin/mach-bf548/bf54x-lq043.h b/include/asm-blackfin/mach-bf548/bf54x-lq043.h
new file mode 100644
index 000000000000..9c7ca62a45eb
--- /dev/null
+++ b/include/asm-blackfin/mach-bf548/bf54x-lq043.h
@@ -0,0 +1,30 @@
1#ifndef BF54X_LQ043_H
2#define BF54X_LQ043_H
3
4struct bfin_bf54xfb_val {
5 unsigned int defval;
6 unsigned int min;
7 unsigned int max;
8};
9
10struct bfin_bf54xfb_mach_info {
11 unsigned char fixed_syncs; /* do not update sync/border */
12
13 /* LCD types */
14 int type;
15
16 /* Screen size */
17 int width;
18 int height;
19
20 /* Screen info */
21 struct bfin_bf54xfb_val xres;
22 struct bfin_bf54xfb_val yres;
23 struct bfin_bf54xfb_val bpp;
24
25 /* GPIOs */
26 unsigned short disp;
27
28};
29
30#endif /* BF54X_LQ043_H */
diff --git a/include/asm-blackfin/mach-bf548/bf54x_keys.h b/include/asm-blackfin/mach-bf548/bf54x_keys.h
new file mode 100644
index 000000000000..1fb4ec77cc25
--- /dev/null
+++ b/include/asm-blackfin/mach-bf548/bf54x_keys.h
@@ -0,0 +1,17 @@
1#ifndef _BFIN_KPAD_H
2#define _BFIN_KPAD_H
3
4struct bfin_kpad_platform_data {
5 int rows;
6 int cols;
7 const unsigned int *keymap;
8 unsigned short keymapsize;
9 unsigned short repeat;
10 u32 debounce_time; /* in ns */
11 u32 coldrive_time; /* in ns */
12 u32 keyup_test_interval; /* in ms */
13};
14
15#define KEYVAL(col, row, val) (((1 << col) << 24) | ((1 << row) << 16) | (val))
16
17#endif
diff --git a/include/asm-blackfin/mach-bf548/dma.h b/include/asm-blackfin/mach-bf548/dma.h
index fcc8b4c34c6a..14cb10cc24ae 100644
--- a/include/asm-blackfin/mach-bf548/dma.h
+++ b/include/asm-blackfin/mach-bf548/dma.h
@@ -55,6 +55,7 @@
55#define CH_SPORT3_RX 20 55#define CH_SPORT3_RX 20
56#define CH_SPORT3_TX 21 56#define CH_SPORT3_TX 21
57#define CH_SDH 22 57#define CH_SDH 22
58#define CH_NFC 22
58#define CH_SPI2 23 59#define CH_SPI2 23
59 60
60#define CH_MEM_STREAM0_DEST 24 61#define CH_MEM_STREAM0_DEST 24
diff --git a/include/asm-blackfin/nand.h b/include/asm-blackfin/nand.h
new file mode 100644
index 000000000000..afbaafa793f1
--- /dev/null
+++ b/include/asm-blackfin/nand.h
@@ -0,0 +1,47 @@
1/* linux/include/asm-blackfin/nand.h
2 *
3 * Copyright (c) 2007 Analog Devices, Inc.
4 * Bryan Wu <bryan.wu@analog.com>
5 *
6 * BF5XX - NAND flash controller platfrom_device info
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/* struct bf5xx_nand_platform
14 *
15 * define a interface between platfrom board specific code and
16 * bf54x NFC driver.
17 *
18 * nr_partitions = number of partitions pointed to be partitoons (or zero)
19 * partitions = mtd partition list
20 */
21
22#define NFC_PG_SIZE_256 0
23#define NFC_PG_SIZE_512 1
24#define NFC_PG_SIZE_OFFSET 9
25
26#define NFC_NWIDTH_8 0
27#define NFC_NWIDTH_16 1
28#define NFC_NWIDTH_OFFSET 8
29
30#define NFC_RDDLY_OFFSET 4
31#define NFC_WRDLY_OFFSET 0
32
33#define NFC_STAT_NBUSY 1
34
35struct bf5xx_nand_platform {
36 /* NAND chip information */
37 unsigned short page_size;
38 unsigned short data_width;
39
40 /* RD/WR strobe delay timing information, all times in SCLK cycles */
41 unsigned short rd_dly;
42 unsigned short wr_dly;
43
44 /* NAND MTD partition information */
45 int nr_partitions;
46 struct mtd_partition *partitions;
47};
diff --git a/include/asm-frv/system.h b/include/asm-frv/system.h
index 6931af525da3..9f5663ba19f8 100644
--- a/include/asm-frv/system.h
+++ b/include/asm-frv/system.h
@@ -253,7 +253,10 @@ extern uint32_t __cmpxchg_32(uint32_t *v, uint32_t test, uint32_t new);
253 __typeof__(*(ptr)) __xg_new = (new); \ 253 __typeof__(*(ptr)) __xg_new = (new); \
254 \ 254 \
255 switch (sizeof(__xg_orig)) { \ 255 switch (sizeof(__xg_orig)) { \
256 case 4: __xg_orig = __cmpxchg_32(__xg_ptr, __xg_test, __xg_new); break; \ 256 case 4: __xg_orig = (__force __typeof__(*ptr)) \
257 __cmpxchg_32((__force uint32_t *)__xg_ptr, \
258 (__force uint32_t)__xg_test, \
259 (__force uint32_t)__xg_new); break; \
257 default: \ 260 default: \
258 __xg_orig = 0; \ 261 __xg_orig = 0; \
259 asm volatile("break"); \ 262 asm volatile("break"); \
diff --git a/include/asm-frv/thread_info.h b/include/asm-frv/thread_info.h
index cc5433e78b52..348b8f1df17e 100644
--- a/include/asm-frv/thread_info.h
+++ b/include/asm-frv/thread_info.h
@@ -88,9 +88,8 @@ register struct thread_info *__current_thread_info asm("gr15");
88 ({ \ 88 ({ \
89 struct thread_info *ret; \ 89 struct thread_info *ret; \
90 \ 90 \
91 ret = kmalloc(THREAD_SIZE, GFP_KERNEL); \ 91 ret = kzalloc(THREAD_SIZE, GFP_KERNEL); \
92 if (ret) \ 92 \
93 memset(ret, 0, THREAD_SIZE); \
94 ret; \ 93 ret; \
95 }) 94 })
96#else 95#else
diff --git a/include/asm-frv/tlbflush.h b/include/asm-frv/tlbflush.h
index da3a3179a85d..8370f97e41ee 100644
--- a/include/asm-frv/tlbflush.h
+++ b/include/asm-frv/tlbflush.h
@@ -57,8 +57,7 @@ do { \
57#define __flush_tlb_global() flush_tlb_all() 57#define __flush_tlb_global() flush_tlb_all()
58#define flush_tlb() flush_tlb_all() 58#define flush_tlb() flush_tlb_all()
59#define flush_tlb_kernel_range(start, end) flush_tlb_all() 59#define flush_tlb_kernel_range(start, end) flush_tlb_all()
60#define flush_tlb_pgtables(mm,start,end) \ 60#define flush_tlb_pgtables(mm,start,end) do { } while(0)
61 asm volatile("movgs %0,scr0 ! movgs %0,scr1" :: "r"(ULONG_MAX) : "memory");
62 61
63#else 62#else
64 63
diff --git a/include/asm-generic/libata-portmap.h b/include/asm-generic/libata-portmap.h
index 62fb3618293d..cf14f2ff40b6 100644
--- a/include/asm-generic/libata-portmap.h
+++ b/include/asm-generic/libata-portmap.h
@@ -1,12 +1,7 @@
1#ifndef __ASM_GENERIC_LIBATA_PORTMAP_H 1#ifndef __ASM_GENERIC_LIBATA_PORTMAP_H
2#define __ASM_GENERIC_LIBATA_PORTMAP_H 2#define __ASM_GENERIC_LIBATA_PORTMAP_H
3 3
4#define ATA_PRIMARY_CMD 0x1F0
5#define ATA_PRIMARY_CTL 0x3F6
6#define ATA_PRIMARY_IRQ(dev) 14 4#define ATA_PRIMARY_IRQ(dev) 14
7
8#define ATA_SECONDARY_CMD 0x170
9#define ATA_SECONDARY_CTL 0x376
10#define ATA_SECONDARY_IRQ(dev) 15 5#define ATA_SECONDARY_IRQ(dev) 15
11 6
12#endif 7#endif
diff --git a/include/asm-generic/memory_model.h b/include/asm-generic/memory_model.h
index 30d8d33491dd..52226e14bd7d 100644
--- a/include/asm-generic/memory_model.h
+++ b/include/asm-generic/memory_model.h
@@ -46,6 +46,12 @@
46 __pgdat->node_start_pfn; \ 46 __pgdat->node_start_pfn; \
47}) 47})
48 48
49#elif defined(CONFIG_SPARSEMEM_VMEMMAP)
50
51/* memmap is virtually contigious. */
52#define __pfn_to_page(pfn) (vmemmap + (pfn))
53#define __page_to_pfn(page) ((page) - vmemmap)
54
49#elif defined(CONFIG_SPARSEMEM) 55#elif defined(CONFIG_SPARSEMEM)
50/* 56/*
51 * Note: section's mem_map is encorded to reflect its start_pfn. 57 * Note: section's mem_map is encorded to reflect its start_pfn.
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index 5f0d797d33fd..44ef329531c3 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -125,10 +125,6 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addres
125#define pgd_offset_gate(mm, addr) pgd_offset(mm, addr) 125#define pgd_offset_gate(mm, addr) pgd_offset(mm, addr)
126#endif 126#endif
127 127
128#ifndef __HAVE_ARCH_LAZY_MMU_PROT_UPDATE
129#define lazy_mmu_prot_update(pte) do { } while (0)
130#endif
131
132#ifndef __HAVE_ARCH_MOVE_PTE 128#ifndef __HAVE_ARCH_MOVE_PTE
133#define move_pte(pte, prot, old_addr, new_addr) (pte) 129#define move_pte(pte, prot, old_addr, new_addr) (pte)
134#endif 130#endif
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 0240e0506a07..5615440027ec 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -153,7 +153,8 @@
153#define TEXT_TEXT \ 153#define TEXT_TEXT \
154 ALIGN_FUNCTION(); \ 154 ALIGN_FUNCTION(); \
155 *(.text) \ 155 *(.text) \
156 *(.text.init.refok) 156 *(.text.init.refok) \
157 *(.exit.text.refok)
157 158
158/* sched.text is aling to function alignment to secure we have same 159/* sched.text is aling to function alignment to secure we have same
159 * address even at second ld pass when generating System.map */ 160 * address even at second ld pass when generating System.map */
diff --git a/include/asm-ia64/dma-mapping.h b/include/asm-ia64/dma-mapping.h
index 6299b51575bb..f1735a22d0ea 100644
--- a/include/asm-ia64/dma-mapping.h
+++ b/include/asm-ia64/dma-mapping.h
@@ -6,6 +6,7 @@
6 * David Mosberger-Tang <davidm@hpl.hp.com> 6 * David Mosberger-Tang <davidm@hpl.hp.com>
7 */ 7 */
8#include <asm/machvec.h> 8#include <asm/machvec.h>
9#include <linux/scatterlist.h>
9 10
10#define dma_alloc_coherent platform_dma_alloc_coherent 11#define dma_alloc_coherent platform_dma_alloc_coherent
11/* coherent mem. is cheap */ 12/* coherent mem. is cheap */
diff --git a/include/asm-ia64/kdebug.h b/include/asm-ia64/kdebug.h
index 320cd8e754ea..35e49407d06c 100644
--- a/include/asm-ia64/kdebug.h
+++ b/include/asm-ia64/kdebug.h
@@ -26,21 +26,6 @@
26 * 2005-Oct Keith Owens <kaos@sgi.com>. Expand notify_die to cover more 26 * 2005-Oct Keith Owens <kaos@sgi.com>. Expand notify_die to cover more
27 * events. 27 * events.
28 */ 28 */
29#include <linux/notifier.h>
30
31/*
32 * These are only here because kprobes.c wants them to implement a
33 * blatant layering violation. Will hopefully go away soon once all
34 * architectures are updated.
35 */
36static inline int register_page_fault_notifier(struct notifier_block *nb)
37{
38 return 0;
39}
40static inline int unregister_page_fault_notifier(struct notifier_block *nb)
41{
42 return 0;
43}
44 29
45enum die_val { 30enum die_val {
46 DIE_BREAK = 1, 31 DIE_BREAK = 1,
diff --git a/include/asm-ia64/kprobes.h b/include/asm-ia64/kprobes.h
index 067d9dea68f9..a93ce9ef07ff 100644
--- a/include/asm-ia64/kprobes.h
+++ b/include/asm-ia64/kprobes.h
@@ -83,7 +83,7 @@ struct kprobe_ctlblk {
83}; 83};
84 84
85#define ARCH_SUPPORTS_KRETPROBES 85#define ARCH_SUPPORTS_KRETPROBES
86#define ARCH_INACTIVE_KPROBE_COUNT 1 86#define kretprobe_blacklist_size 0
87 87
88#define SLOT0_OPCODE_SHIFT (37) 88#define SLOT0_OPCODE_SHIFT (37)
89#define SLOT1_p1_OPCODE_SHIFT (37 - (64-46)) 89#define SLOT1_p1_OPCODE_SHIFT (37 - (64-46))
diff --git a/include/asm-ia64/mca.h b/include/asm-ia64/mca.h
index edd5d01028df..823553bf12e6 100644
--- a/include/asm-ia64/mca.h
+++ b/include/asm-ia64/mca.h
@@ -151,6 +151,8 @@ extern void ia64_mca_cmc_vector_setup(void);
151extern int ia64_reg_MCA_extension(int (*fn)(void *, struct ia64_sal_os_state *)); 151extern int ia64_reg_MCA_extension(int (*fn)(void *, struct ia64_sal_os_state *));
152extern void ia64_unreg_MCA_extension(void); 152extern void ia64_unreg_MCA_extension(void);
153extern u64 ia64_get_rnat(u64 *); 153extern u64 ia64_get_rnat(u64 *);
154extern void ia64_mca_printk(const char * fmt, ...)
155 __attribute__ ((format (printf, 1, 2)));
154 156
155struct ia64_mca_notify_die { 157struct ia64_mca_notify_die {
156 struct ia64_sal_os_state *sos; 158 struct ia64_sal_os_state *sos;
diff --git a/include/asm-ia64/pgtable.h b/include/asm-ia64/pgtable.h
index de6d01e24dd0..0971ec90807e 100644
--- a/include/asm-ia64/pgtable.h
+++ b/include/asm-ia64/pgtable.h
@@ -223,12 +223,6 @@ ia64_phys_addr_valid (unsigned long addr)
223 * page table. 223 * page table.
224 */ 224 */
225 225
226/*
227 * On some architectures, special things need to be done when setting
228 * the PTE in a page table. Nothing special needs to be on IA-64.
229 */
230#define set_pte(ptep, pteval) (*(ptep) = (pteval))
231#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
232 226
233#define VMALLOC_START (RGN_BASE(RGN_GATE) + 0x200000000UL) 227#define VMALLOC_START (RGN_BASE(RGN_GATE) + 0x200000000UL)
234#ifdef CONFIG_VIRTUAL_MEM_MAP 228#ifdef CONFIG_VIRTUAL_MEM_MAP
@@ -236,8 +230,14 @@ ia64_phys_addr_valid (unsigned long addr)
236# define VMALLOC_END vmalloc_end 230# define VMALLOC_END vmalloc_end
237 extern unsigned long vmalloc_end; 231 extern unsigned long vmalloc_end;
238#else 232#else
233#if defined(CONFIG_SPARSEMEM) && defined(CONFIG_SPARSEMEM_VMEMMAP)
234/* SPARSEMEM_VMEMMAP uses half of vmalloc... */
235# define VMALLOC_END (RGN_BASE(RGN_GATE) + (1UL << (4*PAGE_SHIFT - 10)))
236# define vmemmap ((struct page *)VMALLOC_END)
237#else
239# define VMALLOC_END (RGN_BASE(RGN_GATE) + (1UL << (4*PAGE_SHIFT - 9))) 238# define VMALLOC_END (RGN_BASE(RGN_GATE) + (1UL << (4*PAGE_SHIFT - 9)))
240#endif 239#endif
240#endif
241 241
242/* fs/proc/kcore.c */ 242/* fs/proc/kcore.c */
243#define kc_vaddr_to_offset(v) ((v) - RGN_BASE(RGN_GATE)) 243#define kc_vaddr_to_offset(v) ((v) - RGN_BASE(RGN_GATE))
@@ -315,6 +315,36 @@ ia64_phys_addr_valid (unsigned long addr)
315#define pte_mkhuge(pte) (__pte(pte_val(pte))) 315#define pte_mkhuge(pte) (__pte(pte_val(pte)))
316 316
317/* 317/*
318 * Because ia64's Icache and Dcache is not coherent (on a cpu), we need to
319 * sync icache and dcache when we insert *new* executable page.
320 * __ia64_sync_icache_dcache() check Pg_arch_1 bit and flush icache
321 * if necessary.
322 *
323 * set_pte() is also called by the kernel, but we can expect that the kernel
324 * flushes icache explicitly if necessary.
325 */
326#define pte_present_exec_user(pte)\
327 ((pte_val(pte) & (_PAGE_P | _PAGE_PL_MASK | _PAGE_AR_RX)) == \
328 (_PAGE_P | _PAGE_PL_3 | _PAGE_AR_RX))
329
330extern void __ia64_sync_icache_dcache(pte_t pteval);
331static inline void set_pte(pte_t *ptep, pte_t pteval)
332{
333 /* page is present && page is user && page is executable
334 * && (page swapin or new page or page migraton
335 * || copy_on_write with page copying.)
336 */
337 if (pte_present_exec_user(pteval) &&
338 (!pte_present(*ptep) ||
339 pte_pfn(*ptep) != pte_pfn(pteval)))
340 /* load_module() calles flush_icache_range() explicitly*/
341 __ia64_sync_icache_dcache(pteval);
342 *ptep = pteval;
343}
344
345#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
346
347/*
318 * Make page protection values cacheable, uncacheable, or write- 348 * Make page protection values cacheable, uncacheable, or write-
319 * combining. Note that "protection" is really a misnomer here as the 349 * combining. Note that "protection" is really a misnomer here as the
320 * protection value contains the memory attribute bits, dirty bits, and 350 * protection value contains the memory attribute bits, dirty bits, and
@@ -483,12 +513,6 @@ extern struct page *zero_page_memmap_ptr;
483#define HUGETLB_PGDIR_MASK (~(HUGETLB_PGDIR_SIZE-1)) 513#define HUGETLB_PGDIR_MASK (~(HUGETLB_PGDIR_SIZE-1))
484#endif 514#endif
485 515
486/*
487 * IA-64 doesn't have any external MMU info: the page tables contain all the necessary
488 * information. However, we use this routine to take care of any (delayed) i-cache
489 * flushing that may be necessary.
490 */
491extern void lazy_mmu_prot_update (pte_t pte);
492 516
493#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS 517#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
494/* 518/*
@@ -578,7 +602,7 @@ extern void lazy_mmu_prot_update (pte_t pte);
578#define __HAVE_ARCH_PTEP_SET_WRPROTECT 602#define __HAVE_ARCH_PTEP_SET_WRPROTECT
579#define __HAVE_ARCH_PTE_SAME 603#define __HAVE_ARCH_PTE_SAME
580#define __HAVE_ARCH_PGD_OFFSET_GATE 604#define __HAVE_ARCH_PGD_OFFSET_GATE
581#define __HAVE_ARCH_LAZY_MMU_PROT_UPDATE 605
582 606
583#ifndef CONFIG_PGTABLE_4 607#ifndef CONFIG_PGTABLE_4
584#include <asm-generic/pgtable-nopud.h> 608#include <asm-generic/pgtable-nopud.h>
diff --git a/include/asm-ia64/sal.h b/include/asm-ia64/sal.h
index 46cadf5aaac5..1f5412d6f9bb 100644
--- a/include/asm-ia64/sal.h
+++ b/include/asm-ia64/sal.h
@@ -46,25 +46,28 @@
46extern spinlock_t sal_lock; 46extern spinlock_t sal_lock;
47 47
48/* SAL spec _requires_ eight args for each call. */ 48/* SAL spec _requires_ eight args for each call. */
49#define __SAL_CALL(result,a0,a1,a2,a3,a4,a5,a6,a7) \ 49#define __IA64_FW_CALL(entry,result,a0,a1,a2,a3,a4,a5,a6,a7) \
50 result = (*ia64_sal)(a0,a1,a2,a3,a4,a5,a6,a7) 50 result = (*entry)(a0,a1,a2,a3,a4,a5,a6,a7)
51 51
52# define SAL_CALL(result,args...) do { \ 52# define IA64_FW_CALL(entry,result,args...) do { \
53 unsigned long __ia64_sc_flags; \ 53 unsigned long __ia64_sc_flags; \
54 struct ia64_fpreg __ia64_sc_fr[6]; \ 54 struct ia64_fpreg __ia64_sc_fr[6]; \
55 ia64_save_scratch_fpregs(__ia64_sc_fr); \ 55 ia64_save_scratch_fpregs(__ia64_sc_fr); \
56 spin_lock_irqsave(&sal_lock, __ia64_sc_flags); \ 56 spin_lock_irqsave(&sal_lock, __ia64_sc_flags); \
57 __SAL_CALL(result, args); \ 57 __IA64_FW_CALL(entry, result, args); \
58 spin_unlock_irqrestore(&sal_lock, __ia64_sc_flags); \ 58 spin_unlock_irqrestore(&sal_lock, __ia64_sc_flags); \
59 ia64_load_scratch_fpregs(__ia64_sc_fr); \ 59 ia64_load_scratch_fpregs(__ia64_sc_fr); \
60} while (0) 60} while (0)
61 61
62# define SAL_CALL(result,args...) \
63 IA64_FW_CALL(ia64_sal, result, args);
64
62# define SAL_CALL_NOLOCK(result,args...) do { \ 65# define SAL_CALL_NOLOCK(result,args...) do { \
63 unsigned long __ia64_scn_flags; \ 66 unsigned long __ia64_scn_flags; \
64 struct ia64_fpreg __ia64_scn_fr[6]; \ 67 struct ia64_fpreg __ia64_scn_fr[6]; \
65 ia64_save_scratch_fpregs(__ia64_scn_fr); \ 68 ia64_save_scratch_fpregs(__ia64_scn_fr); \
66 local_irq_save(__ia64_scn_flags); \ 69 local_irq_save(__ia64_scn_flags); \
67 __SAL_CALL(result, args); \ 70 __IA64_FW_CALL(ia64_sal, result, args); \
68 local_irq_restore(__ia64_scn_flags); \ 71 local_irq_restore(__ia64_scn_flags); \
69 ia64_load_scratch_fpregs(__ia64_scn_fr); \ 72 ia64_load_scratch_fpregs(__ia64_scn_fr); \
70} while (0) 73} while (0)
@@ -73,7 +76,7 @@ extern spinlock_t sal_lock;
73 struct ia64_fpreg __ia64_scs_fr[6]; \ 76 struct ia64_fpreg __ia64_scs_fr[6]; \
74 ia64_save_scratch_fpregs(__ia64_scs_fr); \ 77 ia64_save_scratch_fpregs(__ia64_scs_fr); \
75 preempt_disable(); \ 78 preempt_disable(); \
76 __SAL_CALL(result, args); \ 79 __IA64_FW_CALL(ia64_sal, result, args); \
77 preempt_enable(); \ 80 preempt_enable(); \
78 ia64_load_scratch_fpregs(__ia64_scs_fr); \ 81 ia64_load_scratch_fpregs(__ia64_scs_fr); \
79} while (0) 82} while (0)
diff --git a/include/asm-ia64/scatterlist.h b/include/asm-ia64/scatterlist.h
index a452ea24205a..7d5234d50312 100644
--- a/include/asm-ia64/scatterlist.h
+++ b/include/asm-ia64/scatterlist.h
@@ -30,4 +30,6 @@ struct scatterlist {
30#define sg_dma_len(sg) ((sg)->dma_length) 30#define sg_dma_len(sg) ((sg)->dma_length)
31#define sg_dma_address(sg) ((sg)->dma_address) 31#define sg_dma_address(sg) ((sg)->dma_address)
32 32
33#define ARCH_HAS_SG_CHAIN
34
33#endif /* _ASM_IA64_SCATTERLIST_H */ 35#endif /* _ASM_IA64_SCATTERLIST_H */
diff --git a/include/asm-ia64/smp.h b/include/asm-ia64/smp.h
index 6314b29e8c4d..1703c9d885bd 100644
--- a/include/asm-ia64/smp.h
+++ b/include/asm-ia64/smp.h
@@ -58,7 +58,7 @@ extern char no_int_routing __devinitdata;
58 58
59extern cpumask_t cpu_online_map; 59extern cpumask_t cpu_online_map;
60extern cpumask_t cpu_core_map[NR_CPUS]; 60extern cpumask_t cpu_core_map[NR_CPUS];
61extern cpumask_t cpu_sibling_map[NR_CPUS]; 61DECLARE_PER_CPU(cpumask_t, cpu_sibling_map);
62extern int smp_num_siblings; 62extern int smp_num_siblings;
63extern int smp_num_cpucores; 63extern int smp_num_cpucores;
64extern void __iomem *ipi_base_addr; 64extern void __iomem *ipi_base_addr;
diff --git a/include/asm-ia64/topology.h b/include/asm-ia64/topology.h
index 233f1caae048..2d67b72b18d0 100644
--- a/include/asm-ia64/topology.h
+++ b/include/asm-ia64/topology.h
@@ -112,7 +112,7 @@ void build_cpu_to_node_map(void);
112#define topology_physical_package_id(cpu) (cpu_data(cpu)->socket_id) 112#define topology_physical_package_id(cpu) (cpu_data(cpu)->socket_id)
113#define topology_core_id(cpu) (cpu_data(cpu)->core_id) 113#define topology_core_id(cpu) (cpu_data(cpu)->core_id)
114#define topology_core_siblings(cpu) (cpu_core_map[cpu]) 114#define topology_core_siblings(cpu) (cpu_core_map[cpu])
115#define topology_thread_siblings(cpu) (cpu_sibling_map[cpu]) 115#define topology_thread_siblings(cpu) (per_cpu(cpu_sibling_map, cpu))
116#define smt_capable() (smp_num_siblings > 1) 116#define smt_capable() (smp_num_siblings > 1)
117#endif 117#endif
118 118
diff --git a/include/asm-m32r/ptrace.h b/include/asm-m32r/ptrace.h
index 632b4ce4269a..a0755b982028 100644
--- a/include/asm-m32r/ptrace.h
+++ b/include/asm-m32r/ptrace.h
@@ -120,7 +120,10 @@ struct pt_regs {
120 120
121#include <asm/m32r.h> /* M32R_PSW_BSM, M32R_PSW_BPM */ 121#include <asm/m32r.h> /* M32R_PSW_BSM, M32R_PSW_BPM */
122 122
123#define __ARCH_SYS_PTRACE 1 123struct task_struct;
124extern void init_debug_traps(struct task_struct *);
125#define arch_ptrace_attach(child) \
126 init_debug_traps(child)
124 127
125#if defined(CONFIG_ISA_M32R2) || defined(CONFIG_CHIP_VDEC2) 128#if defined(CONFIG_ISA_M32R2) || defined(CONFIG_CHIP_VDEC2)
126#define user_mode(regs) ((M32R_PSW_BPM & (regs)->psw) != 0) 129#define user_mode(regs) ((M32R_PSW_BPM & (regs)->psw) != 0)
diff --git a/include/asm-m32r/thread_info.h b/include/asm-m32r/thread_info.h
index b7ccc3e68604..c039820dba7c 100644
--- a/include/asm-m32r/thread_info.h
+++ b/include/asm-m32r/thread_info.h
@@ -100,9 +100,8 @@ static inline struct thread_info *current_thread_info(void)
100 ({ \ 100 ({ \
101 struct thread_info *ret; \ 101 struct thread_info *ret; \
102 \ 102 \
103 ret = kmalloc(THREAD_SIZE, GFP_KERNEL); \ 103 ret = kzalloc(THREAD_SIZE, GFP_KERNEL); \
104 if (ret) \ 104 \
105 memset(ret, 0, THREAD_SIZE); \
106 ret; \ 105 ret; \
107 }) 106 })
108#else 107#else
diff --git a/include/asm-m68k/Kbuild b/include/asm-m68k/Kbuild
index c68e1680da01..1a922fad76f7 100644
--- a/include/asm-m68k/Kbuild
+++ b/include/asm-m68k/Kbuild
@@ -1 +1,2 @@
1include include/asm-generic/Kbuild.asm 1include include/asm-generic/Kbuild.asm
2header-y += cachectl.h
diff --git a/include/asm-m68k/unistd.h b/include/asm-m68k/unistd.h
index a30fe9c64143..87f77b119317 100644
--- a/include/asm-m68k/unistd.h
+++ b/include/asm-m68k/unistd.h
@@ -351,6 +351,9 @@
351#define __ARCH_WANT_SYS_SIGPROCMASK 351#define __ARCH_WANT_SYS_SIGPROCMASK
352#define __ARCH_WANT_SYS_RT_SIGACTION 352#define __ARCH_WANT_SYS_RT_SIGACTION
353 353
354/* whitelist for checksyscalls */
355#define __IGNORE_restart_syscall
356
354/* 357/*
355 * "Conditional" syscalls 358 * "Conditional" syscalls
356 * 359 *
diff --git a/include/asm-m68knommu/system.h b/include/asm-m68knommu/system.h
index 5da43a5d12a3..1bd1142685e1 100644
--- a/include/asm-m68knommu/system.h
+++ b/include/asm-m68knommu/system.h
@@ -253,8 +253,7 @@ cmpxchg(volatile int *p, int old, int new)
253 "); \ 253 "); \
254}) 254})
255#elif defined(CONFIG_NETtel) || defined(CONFIG_eLIA) || \ 255#elif defined(CONFIG_NETtel) || defined(CONFIG_eLIA) || \
256 defined(CONFIG_DISKtel) || defined(CONFIG_SECUREEDGEMP3) || \ 256 defined(CONFIG_SECUREEDGEMP3) || defined(CONFIG_CLEOPATRA)
257 defined(CONFIG_CLEOPATRA)
258#define HARD_RESET_NOW() ({ \ 257#define HARD_RESET_NOW() ({ \
259 asm(" \ 258 asm(" \
260 movew #0x2700, %sr; \ 259 movew #0x2700, %sr; \
diff --git a/include/asm-mips/fw/cfe/cfe_api.h b/include/asm-mips/fw/cfe/cfe_api.h
index 41cf050b6810..1003e7156bfc 100644
--- a/include/asm-mips/fw/cfe/cfe_api.h
+++ b/include/asm-mips/fw/cfe/cfe_api.h
@@ -154,7 +154,7 @@ int64_t cfe_getticks(void);
154#define cfe_readblk(a, b, c, d) __cfe_readblk(a, b, c, d) 154#define cfe_readblk(a, b, c, d) __cfe_readblk(a, b, c, d)
155#define cfe_setenv(a, b) __cfe_setenv(a, b) 155#define cfe_setenv(a, b) __cfe_setenv(a, b)
156#define cfe_write(a, b, c) __cfe_write(a, b, c) 156#define cfe_write(a, b, c) __cfe_write(a, b, c)
157#define cfe_writeblk(a, b, c, d __cfe_writeblk(a, b, c, d) 157#define cfe_writeblk(a, b, c, d) __cfe_writeblk(a, b, c, d)
158#endif /* CFE_API_IMPL_NAMESPACE */ 158#endif /* CFE_API_IMPL_NAMESPACE */
159 159
160int cfe_close(int handle); 160int cfe_close(int handle);
diff --git a/include/asm-mips/ip32/ip32_ints.h b/include/asm-mips/ip32/ip32_ints.h
index c3c280e3d591..042f821899a8 100644
--- a/include/asm-mips/ip32/ip32_ints.h
+++ b/include/asm-mips/ip32/ip32_ints.h
@@ -9,86 +9,104 @@
9#ifndef __ASM_IP32_INTS_H 9#ifndef __ASM_IP32_INTS_H
10#define __ASM_IP32_INTS_H 10#define __ASM_IP32_INTS_H
11 11
12#include <asm/irq.h>
13
12/* 14/*
13 * This list reflects the assignment of interrupt numbers to 15 * This list reflects the assignment of interrupt numbers to
14 * interrupting events. Order is fairly irrelevant to handling 16 * interrupting events. Order is fairly irrelevant to handling
15 * priority. This differs from irix. 17 * priority. This differs from irix.
16 */ 18 */
17 19
18/* CPU */ 20enum ip32_irq_no {
19#define IP32_R4K_TIMER_IRQ 0 21 /*
22 * CPU interrupts are 0 ... 7
23 */
20 24
21/* MACE */ 25 /*
22#define MACE_VID_IN1_IRQ 1 26 * MACE
23#define MACE_VID_IN2_IRQ 2 27 */
24#define MACE_VID_OUT_IRQ 3 28 MACE_VID_IN1_IRQ = MIPS_CPU_IRQ_BASE + 8,
25#define MACE_ETHERNET_IRQ 4 29 MACE_VID_IN2_IRQ,
26/* SUPERIO, MISC, and AUDIO are MACEISA */ 30 MACE_VID_OUT_IRQ,
27#define MACE_PCI_BRIDGE_IRQ 8 31 MACE_ETHERNET_IRQ,
32 /* SUPERIO, MISC, and AUDIO are MACEISA */
33 __MACE_SUPERIO,
34 __MACE_MISC,
35 __MACE_AUDIO,
36 MACE_PCI_BRIDGE_IRQ,
28 37
29/* MACEPCI */ 38 /*
30#define MACEPCI_SCSI0_IRQ 9 39 * MACEPCI
31#define MACEPCI_SCSI1_IRQ 10 40 */
32#define MACEPCI_SLOT0_IRQ 11 41 MACEPCI_SCSI0_IRQ,
33#define MACEPCI_SLOT1_IRQ 12 42 MACEPCI_SCSI1_IRQ,
34#define MACEPCI_SLOT2_IRQ 13 43 MACEPCI_SLOT0_IRQ,
35#define MACEPCI_SHARED0_IRQ 14 44 MACEPCI_SLOT1_IRQ,
36#define MACEPCI_SHARED1_IRQ 15 45 MACEPCI_SLOT2_IRQ,
37#define MACEPCI_SHARED2_IRQ 16 46 MACEPCI_SHARED0_IRQ,
47 MACEPCI_SHARED1_IRQ,
48 MACEPCI_SHARED2_IRQ,
38 49
39/* CRIME */ 50 /*
40#define CRIME_GBE0_IRQ 17 51 * CRIME
41#define CRIME_GBE1_IRQ 18 52 */
42#define CRIME_GBE2_IRQ 19 53 CRIME_GBE0_IRQ,
43#define CRIME_GBE3_IRQ 20 54 CRIME_GBE1_IRQ,
44#define CRIME_CPUERR_IRQ 21 55 CRIME_GBE2_IRQ,
45#define CRIME_MEMERR_IRQ 22 56 CRIME_GBE3_IRQ,
46#define CRIME_RE_EMPTY_E_IRQ 23 57 CRIME_CPUERR_IRQ,
47#define CRIME_RE_FULL_E_IRQ 24 58 CRIME_MEMERR_IRQ,
48#define CRIME_RE_IDLE_E_IRQ 25 59 CRIME_RE_EMPTY_E_IRQ,
49#define CRIME_RE_EMPTY_L_IRQ 26 60 CRIME_RE_FULL_E_IRQ,
50#define CRIME_RE_FULL_L_IRQ 27 61 CRIME_RE_IDLE_E_IRQ,
51#define CRIME_RE_IDLE_L_IRQ 28 62 CRIME_RE_EMPTY_L_IRQ,
52#define CRIME_SOFT0_IRQ 29 63 CRIME_RE_FULL_L_IRQ,
53#define CRIME_SOFT1_IRQ 30 64 CRIME_RE_IDLE_L_IRQ,
54#define CRIME_SOFT2_IRQ 31 65 CRIME_SOFT0_IRQ,
55#define CRIME_SYSCORERR_IRQ CRIME_SOFT2_IRQ 66 CRIME_SOFT1_IRQ,
56#define CRIME_VICE_IRQ 32 67 CRIME_SOFT2_IRQ,
68 CRIME_SYSCORERR_IRQ = CRIME_SOFT2_IRQ,
69 CRIME_VICE_IRQ,
57 70
58/* MACEISA */ 71 /*
59#define MACEISA_AUDIO_SW_IRQ 33 72 * MACEISA
60#define MACEISA_AUDIO_SC_IRQ 34 73 */
61#define MACEISA_AUDIO1_DMAT_IRQ 35 74 MACEISA_AUDIO_SW_IRQ,
62#define MACEISA_AUDIO1_OF_IRQ 36 75 MACEISA_AUDIO_SC_IRQ,
63#define MACEISA_AUDIO2_DMAT_IRQ 37 76 MACEISA_AUDIO1_DMAT_IRQ,
64#define MACEISA_AUDIO2_MERR_IRQ 38 77 MACEISA_AUDIO1_OF_IRQ,
65#define MACEISA_AUDIO3_DMAT_IRQ 39 78 MACEISA_AUDIO2_DMAT_IRQ,
66#define MACEISA_AUDIO3_MERR_IRQ 40 79 MACEISA_AUDIO2_MERR_IRQ,
67#define MACEISA_RTC_IRQ 41 80 MACEISA_AUDIO3_DMAT_IRQ,
68#define MACEISA_KEYB_IRQ 42 81 MACEISA_AUDIO3_MERR_IRQ,
69/* MACEISA_KEYB_POLL is not an IRQ */ 82 MACEISA_RTC_IRQ,
70#define MACEISA_MOUSE_IRQ 44 83 MACEISA_KEYB_IRQ,
71/* MACEISA_MOUSE_POLL is not an IRQ */ 84 /* MACEISA_KEYB_POLL is not an IRQ */
72#define MACEISA_TIMER0_IRQ 46 85 __MACEISA_KEYB_POLL,
73#define MACEISA_TIMER1_IRQ 47 86 MACEISA_MOUSE_IRQ,
74#define MACEISA_TIMER2_IRQ 48 87 /* MACEISA_MOUSE_POLL is not an IRQ */
75#define MACEISA_PARALLEL_IRQ 49 88 __MACEISA_MOUSE_POLL,
76#define MACEISA_PAR_CTXA_IRQ 50 89 MACEISA_TIMER0_IRQ,
77#define MACEISA_PAR_CTXB_IRQ 51 90 MACEISA_TIMER1_IRQ,
78#define MACEISA_PAR_MERR_IRQ 52 91 MACEISA_TIMER2_IRQ,
79#define MACEISA_SERIAL1_IRQ 53 92 MACEISA_PARALLEL_IRQ,
80#define MACEISA_SERIAL1_TDMAT_IRQ 54 93 MACEISA_PAR_CTXA_IRQ,
81#define MACEISA_SERIAL1_TDMAPR_IRQ 55 94 MACEISA_PAR_CTXB_IRQ,
82#define MACEISA_SERIAL1_TDMAME_IRQ 56 95 MACEISA_PAR_MERR_IRQ,
83#define MACEISA_SERIAL1_RDMAT_IRQ 57 96 MACEISA_SERIAL1_IRQ,
84#define MACEISA_SERIAL1_RDMAOR_IRQ 58 97 MACEISA_SERIAL1_TDMAT_IRQ,
85#define MACEISA_SERIAL2_IRQ 59 98 MACEISA_SERIAL1_TDMAPR_IRQ,
86#define MACEISA_SERIAL2_TDMAT_IRQ 60 99 MACEISA_SERIAL1_TDMAME_IRQ,
87#define MACEISA_SERIAL2_TDMAPR_IRQ 61 100 MACEISA_SERIAL1_RDMAT_IRQ,
88#define MACEISA_SERIAL2_TDMAME_IRQ 62 101 MACEISA_SERIAL1_RDMAOR_IRQ,
89#define MACEISA_SERIAL2_RDMAT_IRQ 63 102 MACEISA_SERIAL2_IRQ,
90#define MACEISA_SERIAL2_RDMAOR_IRQ 64 103 MACEISA_SERIAL2_TDMAT_IRQ,
104 MACEISA_SERIAL2_TDMAPR_IRQ,
105 MACEISA_SERIAL2_TDMAME_IRQ,
106 MACEISA_SERIAL2_RDMAT_IRQ,
107 MACEISA_SERIAL2_RDMAOR_IRQ,
91 108
92#define IP32_IRQ_MAX MACEISA_SERIAL2_RDMAOR_IRQ 109 IP32_IRQ_MAX = MACEISA_SERIAL2_RDMAOR_IRQ
110};
93 111
94#endif /* __ASM_IP32_INTS_H */ 112#endif /* __ASM_IP32_INTS_H */
diff --git a/include/asm-mips/lasat/lasatint.h b/include/asm-mips/lasat/lasatint.h
index 065474feeccc..581dc45685a2 100644
--- a/include/asm-mips/lasat/lasatint.h
+++ b/include/asm-mips/lasat/lasatint.h
@@ -1,4 +1,10 @@
1#define LASATINT_END 16 1#ifndef __ASM_LASAT_LASATINT_H
2#define __ASM_LASAT_LASATINT_H
3
4#include <linux/irq.h>
5
6#define LASATINT_BASE MIPS_CPU_IRQ_BASE
7#define LASATINT_END (LASATINT_BASE + 16)
2 8
3/* lasat 100 */ 9/* lasat 100 */
4#define LASAT_INT_STATUS_REG_100 (KSEG1ADDR(0x1c880000)) 10#define LASAT_INT_STATUS_REG_100 (KSEG1ADDR(0x1c880000))
@@ -10,3 +16,4 @@
10#define LASAT_INT_MASK_REG_200 (KSEG1ADDR(0x1104003c)) 16#define LASAT_INT_MASK_REG_200 (KSEG1ADDR(0x1104003c))
11#define LASATINT_MASK_SHIFT_200 16 17#define LASATINT_MASK_SHIFT_200 16
12 18
19#endif /* __ASM_LASAT_LASATINT_H */
diff --git a/include/asm-mips/mach-au1x00/au1000.h b/include/asm-mips/mach-au1x00/au1000.h
index 10f613f23c33..b37baf8cf624 100644
--- a/include/asm-mips/mach-au1x00/au1000.h
+++ b/include/asm-mips/mach-au1x00/au1000.h
@@ -91,23 +91,6 @@ static inline u32 au_readl(unsigned long reg)
91} 91}
92 92
93 93
94static __inline__ int au_ffz(unsigned int x)
95{
96 if ((x = ~x) == 0)
97 return 32;
98 return __ilog2(x & -x);
99}
100
101/*
102 * ffs: find first bit set. This is defined the same way as
103 * the libc and compiler builtin ffs routines, therefore
104 * differs in spirit from the above ffz (man ffs).
105 */
106static __inline__ int au_ffs(int x)
107{
108 return __ilog2(x & -x) + 1;
109}
110
111/* arch/mips/au1000/common/clocks.c */ 94/* arch/mips/au1000/common/clocks.c */
112extern void set_au1x00_speed(unsigned int new_freq); 95extern void set_au1x00_speed(unsigned int new_freq);
113extern unsigned int get_au1x00_speed(void); 96extern unsigned int get_au1x00_speed(void);
@@ -119,16 +102,16 @@ extern unsigned int get_au1x00_lcd_clock(void);
119/* 102/*
120 * Every board describes its IRQ mapping with this table. 103 * Every board describes its IRQ mapping with this table.
121 */ 104 */
122typedef struct au1xxx_irqmap { 105struct au1xxx_irqmap {
123 int im_irq; 106 int im_irq;
124 int im_type; 107 int im_type;
125 int im_request; 108 int im_request;
126} au1xxx_irq_map_t; 109};
127 110
128/* 111/*
129 * init_IRQ looks for a table with this name. 112 * init_IRQ looks for a table with this name.
130 */ 113 */
131extern au1xxx_irq_map_t au1xxx_irq_map[]; 114extern struct au1xxx_irqmap au1xxx_irq_map[];
132 115
133#endif /* !defined (_LANGUAGE_ASSEMBLY) */ 116#endif /* !defined (_LANGUAGE_ASSEMBLY) */
134 117
diff --git a/include/asm-mips/mach-au1x00/prom.h b/include/asm-mips/mach-au1x00/prom.h
new file mode 100644
index 000000000000..e38715577c51
--- /dev/null
+++ b/include/asm-mips/mach-au1x00/prom.h
@@ -0,0 +1,13 @@
1#ifndef __AU1X00_PROM_H
2#define __AU1X00_PROM_H
3
4extern int prom_argc;
5extern char **prom_argv;
6extern char **prom_envp;
7
8extern void prom_init_cmdline(void);
9extern char *prom_getcmdline(void);
10extern char *prom_getenv(char *envname);
11extern int prom_get_ethernet_addr(char *ethernet_addr);
12
13#endif
diff --git a/include/asm-mips/pmc-sierra/msp71xx/war.h b/include/asm-mips/pmc-sierra/msp71xx/war.h
new file mode 100644
index 000000000000..0bf48fc1892b
--- /dev/null
+++ b/include/asm-mips/pmc-sierra/msp71xx/war.h
@@ -0,0 +1,28 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_PMC_SIERRA_WAR_H
9#define __ASM_MIPS_PMC_SIERRA_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define RM9000_CDEX_SMP_WAR 0
21#define ICACHE_REFILLS_WORKAROUND_WAR 0
22#define R10000_LLSC_WAR 0
23#if defined(CONFIG_PMC_MSP7120_EVAL) || defined(CONFIG_PMC_MSP7120_GW) || \
24 defined(CONFIG_PMC_MSP7120_FPGA)
25#define MIPS34K_MISSED_ITLB_WAR 1
26#endif
27
28#endif /* __ASM_MIPS_PMC_SIERRA_WAR_H */
diff --git a/include/asm-mips/ptrace.h b/include/asm-mips/ptrace.h
index 85b44366343a..786f7e3c99bc 100644
--- a/include/asm-mips/ptrace.h
+++ b/include/asm-mips/ptrace.h
@@ -86,9 +86,9 @@ struct pt_regs {
86 86
87extern asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit); 87extern asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit);
88 88
89extern NORET_TYPE void die(const char *, struct pt_regs *) ATTRIB_NORET; 89extern NORET_TYPE void die(const char *, const struct pt_regs *) ATTRIB_NORET;
90 90
91static inline void die_if_kernel(const char *str, struct pt_regs *regs) 91static inline void die_if_kernel(const char *str, const struct pt_regs *regs)
92{ 92{
93 if (unlikely(!user_mode(regs))) 93 if (unlikely(!user_mode(regs)))
94 die(str, regs); 94 die(str, regs);
diff --git a/include/asm-mips/xxs1500.h b/include/asm-mips/xxs1500.h
deleted file mode 100644
index 4d84a90b0f20..000000000000
--- a/include/asm-mips/xxs1500.h
+++ /dev/null
@@ -1,35 +0,0 @@
1/*
2 * MyCable XXS1500 Referrence Board
3 *
4 * Copyright 2003 MontaVista Software Inc.
5 * Author: Pete Popov, MontaVista Software, Inc.
6 * ppopov@mvista.com or source@mvista.com
7 *
8 * ########################################################################
9 *
10 * This program is free software; you can distribute it and/or modify it
11 * under the terms of the GNU General Public License (Version 2) as
12 * published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope it will be useful, but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 * for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
22 *
23 * ########################################################################
24 *
25 *
26 */
27#ifndef __ASM_XXS1500_H
28#define __ASM_XXS1500_H
29
30/* PCMCIA XXS1500 specific defines */
31#define PCMCIA_MAX_SOCK 0
32#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK+1)
33#define PCMCIA_IRQ AU1000_GPIO_4
34
35#endif /* __ASM_XXS1500_ */
diff --git a/include/asm-powerpc/dcr-mmio.h b/include/asm-powerpc/dcr-mmio.h
index 6b82c3ba495a..08532ff1899c 100644
--- a/include/asm-powerpc/dcr-mmio.h
+++ b/include/asm-powerpc/dcr-mmio.h
@@ -33,16 +33,16 @@ typedef struct {
33 33
34extern dcr_host_t dcr_map(struct device_node *dev, unsigned int dcr_n, 34extern dcr_host_t dcr_map(struct device_node *dev, unsigned int dcr_n,
35 unsigned int dcr_c); 35 unsigned int dcr_c);
36extern void dcr_unmap(dcr_host_t host, unsigned int dcr_n, unsigned int dcr_c); 36extern void dcr_unmap(dcr_host_t host, unsigned int dcr_c);
37 37
38static inline u32 dcr_read(dcr_host_t host, unsigned int dcr_n) 38static inline u32 dcr_read(dcr_host_t host, unsigned int dcr_n)
39{ 39{
40 return in_be32(host.token + dcr_n * host.stride); 40 return in_be32(host.token + ((host.base + dcr_n) * host.stride));
41} 41}
42 42
43static inline void dcr_write(dcr_host_t host, unsigned int dcr_n, u32 value) 43static inline void dcr_write(dcr_host_t host, unsigned int dcr_n, u32 value)
44{ 44{
45 out_be32(host.token + dcr_n * host.stride, value); 45 out_be32(host.token + ((host.base + dcr_n) * host.stride), value);
46} 46}
47 47
48extern u64 of_translate_dcr_address(struct device_node *dev, 48extern u64 of_translate_dcr_address(struct device_node *dev,
diff --git a/include/asm-powerpc/dcr-native.h b/include/asm-powerpc/dcr-native.h
index f41058c0f6cb..8dbb1ab0aa04 100644
--- a/include/asm-powerpc/dcr-native.h
+++ b/include/asm-powerpc/dcr-native.h
@@ -29,9 +29,9 @@ typedef struct {
29#define DCR_MAP_OK(host) (1) 29#define DCR_MAP_OK(host) (1)
30 30
31#define dcr_map(dev, dcr_n, dcr_c) ((dcr_host_t){ .base = (dcr_n) }) 31#define dcr_map(dev, dcr_n, dcr_c) ((dcr_host_t){ .base = (dcr_n) })
32#define dcr_unmap(host, dcr_n, dcr_c) do {} while (0) 32#define dcr_unmap(host, dcr_c) do {} while (0)
33#define dcr_read(host, dcr_n) mfdcr(dcr_n) 33#define dcr_read(host, dcr_n) mfdcr(dcr_n + host.base)
34#define dcr_write(host, dcr_n, value) mtdcr(dcr_n, value) 34#define dcr_write(host, dcr_n, value) mtdcr(dcr_n + host.base, value)
35 35
36/* Device Control Registers */ 36/* Device Control Registers */
37void __mtdcr(int reg, unsigned int val); 37void __mtdcr(int reg, unsigned int val);
diff --git a/include/asm-powerpc/dma-mapping.h b/include/asm-powerpc/dma-mapping.h
index d05891608f74..2af321f36aba 100644
--- a/include/asm-powerpc/dma-mapping.h
+++ b/include/asm-powerpc/dma-mapping.h
@@ -6,149 +6,6 @@
6 */ 6 */
7#ifndef _ASM_DMA_MAPPING_H 7#ifndef _ASM_DMA_MAPPING_H
8#define _ASM_DMA_MAPPING_H 8#define _ASM_DMA_MAPPING_H
9#ifdef __KERNEL__
10
11#include <linux/types.h>
12#include <linux/cache.h>
13/* need struct page definitions */
14#include <linux/mm.h>
15#include <asm/scatterlist.h>
16#include <asm/io.h>
17
18#define DMA_ERROR_CODE (~(dma_addr_t)0x0)
19
20#ifdef CONFIG_NOT_COHERENT_CACHE
21/*
22 * DMA-consistent mapping functions for PowerPCs that don't support
23 * cache snooping. These allocate/free a region of uncached mapped
24 * memory space for use with DMA devices. Alternatively, you could
25 * allocate the space "normally" and use the cache management functions
26 * to ensure it is consistent.
27 */
28extern void *__dma_alloc_coherent(size_t size, dma_addr_t *handle, gfp_t gfp);
29extern void __dma_free_coherent(size_t size, void *vaddr);
30extern void __dma_sync(void *vaddr, size_t size, int direction);
31extern void __dma_sync_page(struct page *page, unsigned long offset,
32 size_t size, int direction);
33
34#else /* ! CONFIG_NOT_COHERENT_CACHE */
35/*
36 * Cache coherent cores.
37 */
38
39#define __dma_alloc_coherent(gfp, size, handle) NULL
40#define __dma_free_coherent(size, addr) ((void)0)
41#define __dma_sync(addr, size, rw) ((void)0)
42#define __dma_sync_page(pg, off, sz, rw) ((void)0)
43
44#endif /* ! CONFIG_NOT_COHERENT_CACHE */
45
46#ifdef CONFIG_PPC64
47/*
48 * DMA operations are abstracted for G5 vs. i/pSeries, PCI vs. VIO
49 */
50struct dma_mapping_ops {
51 void * (*alloc_coherent)(struct device *dev, size_t size,
52 dma_addr_t *dma_handle, gfp_t flag);
53 void (*free_coherent)(struct device *dev, size_t size,
54 void *vaddr, dma_addr_t dma_handle);
55 dma_addr_t (*map_single)(struct device *dev, void *ptr,
56 size_t size, enum dma_data_direction direction);
57 void (*unmap_single)(struct device *dev, dma_addr_t dma_addr,
58 size_t size, enum dma_data_direction direction);
59 int (*map_sg)(struct device *dev, struct scatterlist *sg,
60 int nents, enum dma_data_direction direction);
61 void (*unmap_sg)(struct device *dev, struct scatterlist *sg,
62 int nents, enum dma_data_direction direction);
63 int (*dma_supported)(struct device *dev, u64 mask);
64 int (*set_dma_mask)(struct device *dev, u64 dma_mask);
65};
66
67static inline struct dma_mapping_ops *get_dma_ops(struct device *dev)
68{
69 /* We don't handle the NULL dev case for ISA for now. We could
70 * do it via an out of line call but it is not needed for now. The
71 * only ISA DMA device we support is the floppy and we have a hack
72 * in the floppy driver directly to get a device for us.
73 */
74 if (unlikely(dev == NULL || dev->archdata.dma_ops == NULL))
75 return NULL;
76 return dev->archdata.dma_ops;
77}
78
79static inline int dma_supported(struct device *dev, u64 mask)
80{
81 struct dma_mapping_ops *dma_ops = get_dma_ops(dev);
82
83 if (unlikely(dma_ops == NULL))
84 return 0;
85 if (dma_ops->dma_supported == NULL)
86 return 1;
87 return dma_ops->dma_supported(dev, mask);
88}
89
90static inline int dma_set_mask(struct device *dev, u64 dma_mask)
91{
92 struct dma_mapping_ops *dma_ops = get_dma_ops(dev);
93
94 if (unlikely(dma_ops == NULL))
95 return -EIO;
96 if (dma_ops->set_dma_mask != NULL)
97 return dma_ops->set_dma_mask(dev, dma_mask);
98 if (!dev->dma_mask || !dma_supported(dev, dma_mask))
99 return -EIO;
100 *dev->dma_mask = dma_mask;
101 return 0;
102}
103
104static inline void *dma_alloc_coherent(struct device *dev, size_t size,
105 dma_addr_t *dma_handle, gfp_t flag)
106{
107 struct dma_mapping_ops *dma_ops = get_dma_ops(dev);
108
109 BUG_ON(!dma_ops);
110 return dma_ops->alloc_coherent(dev, size, dma_handle, flag);
111}
112
113static inline void dma_free_coherent(struct device *dev, size_t size,
114 void *cpu_addr, dma_addr_t dma_handle)
115{
116 struct dma_mapping_ops *dma_ops = get_dma_ops(dev);
117
118 BUG_ON(!dma_ops);
119 dma_ops->free_coherent(dev, size, cpu_addr, dma_handle);
120}
121
122static inline dma_addr_t dma_map_single(struct device *dev, void *cpu_addr,
123 size_t size,
124 enum dma_data_direction direction)
125{
126 struct dma_mapping_ops *dma_ops = get_dma_ops(dev);
127
128 BUG_ON(!dma_ops);
129 return dma_ops->map_single(dev, cpu_addr, size, direction);
130}
131
132static inline void dma_unmap_single(struct device *dev, dma_addr_t dma_addr,
133 size_t size,
134 enum dma_data_direction direction)
135{
136 struct dma_mapping_ops *dma_ops = get_dma_ops(dev);
137
138 BUG_ON(!dma_ops);
139 dma_ops->unmap_single(dev, dma_addr, size, direction);
140}
141
142static inline dma_addr_t dma_map_page(struct device *dev, struct page *page,
143 unsigned long offset, size_t size,
144 enum dma_data_direction direction)
145{
146 struct dma_mapping_ops *dma_ops = get_dma_ops(dev);
147
148 BUG_ON(!dma_ops);
149 return dma_ops->map_single(dev, page_address(page) + offset, size,
150 direction);
151}
152 9
153static inline void dma_unmap_page(struct device *dev, dma_addr_t dma_address, 10static inline void dma_unmap_page(struct device *dev, dma_addr_t dma_address,
154 size_t size, 11 size_t size,
@@ -276,14 +133,15 @@ static inline void dma_unmap_page(struct device *dev, dma_addr_t dma_address,
276} 133}
277 134
278static inline int 135static inline int
279dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, 136dma_map_sg(struct device *dev, struct scatterlist *sgl, int nents,
280 enum dma_data_direction direction) 137 enum dma_data_direction direction)
281{ 138{
139 struct scatterlist *sg;
282 int i; 140 int i;
283 141
284 BUG_ON(direction == DMA_NONE); 142 BUG_ON(direction == DMA_NONE);
285 143
286 for (i = 0; i < nents; i++, sg++) { 144 for_each_sg(sgl, sg, nents, i) {
287 BUG_ON(!sg->page); 145 BUG_ON(!sg->page);
288 __dma_sync_page(sg->page, sg->offset, sg->length, direction); 146 __dma_sync_page(sg->page, sg->offset, sg->length, direction);
289 sg->dma_address = page_to_bus(sg->page) + sg->offset; 147 sg->dma_address = page_to_bus(sg->page) + sg->offset;
@@ -318,26 +176,28 @@ static inline void dma_sync_single_for_device(struct device *dev,
318} 176}
319 177
320static inline void dma_sync_sg_for_cpu(struct device *dev, 178static inline void dma_sync_sg_for_cpu(struct device *dev,
321 struct scatterlist *sg, int nents, 179 struct scatterlist *sgl, int nents,
322 enum dma_data_direction direction) 180 enum dma_data_direction direction)
323{ 181{
182 struct scatterlist *sg;
324 int i; 183 int i;
325 184
326 BUG_ON(direction == DMA_NONE); 185 BUG_ON(direction == DMA_NONE);
327 186
328 for (i = 0; i < nents; i++, sg++) 187 for_each_sg(sgl, sg, nents, i)
329 __dma_sync_page(sg->page, sg->offset, sg->length, direction); 188 __dma_sync_page(sg->page, sg->offset, sg->length, direction);
330} 189}
331 190
332static inline void dma_sync_sg_for_device(struct device *dev, 191static inline void dma_sync_sg_for_device(struct device *dev,
333 struct scatterlist *sg, int nents, 192 struct scatterlist *sgl, int nents,
334 enum dma_data_direction direction) 193 enum dma_data_direction direction)
335{ 194{
195 struct scatterlist *sg;
336 int i; 196 int i;
337 197
338 BUG_ON(direction == DMA_NONE); 198 BUG_ON(direction == DMA_NONE);
339 199
340 for (i = 0; i < nents; i++, sg++) 200 for_each_sg(sgl, sg, nents, i)
341 __dma_sync_page(sg->page, sg->offset, sg->length, direction); 201 __dma_sync_page(sg->page, sg->offset, sg->length, direction);
342} 202}
343 203
diff --git a/include/asm-powerpc/io.h b/include/asm-powerpc/io.h
index affba7052fb6..0d0589ef8ea6 100644
--- a/include/asm-powerpc/io.h
+++ b/include/asm-powerpc/io.h
@@ -138,12 +138,12 @@ DEF_MMIO_IN_BE(in_be64, 64, ld);
138/* There is no asm instructions for 64 bits reverse loads and stores */ 138/* There is no asm instructions for 64 bits reverse loads and stores */
139static inline u64 in_le64(const volatile u64 __iomem *addr) 139static inline u64 in_le64(const volatile u64 __iomem *addr)
140{ 140{
141 return le64_to_cpu(in_be64(addr)); 141 return swab64(in_be64(addr));
142} 142}
143 143
144static inline void out_le64(volatile u64 __iomem *addr, u64 val) 144static inline void out_le64(volatile u64 __iomem *addr, u64 val)
145{ 145{
146 out_be64(addr, cpu_to_le64(val)); 146 out_be64(addr, swab64(val));
147} 147}
148#endif /* __powerpc64__ */ 148#endif /* __powerpc64__ */
149 149
diff --git a/include/asm-powerpc/kdebug.h b/include/asm-powerpc/kdebug.h
index 295f0162c608..ae6d206728af 100644
--- a/include/asm-powerpc/kdebug.h
+++ b/include/asm-powerpc/kdebug.h
@@ -2,25 +2,6 @@
2#define _ASM_POWERPC_KDEBUG_H 2#define _ASM_POWERPC_KDEBUG_H
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5/* nearly identical to x86_64/i386 code */
6
7#include <linux/notifier.h>
8
9/*
10 * These are only here because kprobes.c wants them to implement a
11 * blatant layering violation. Will hopefully go away soon once all
12 * architectures are updated.
13 */
14static inline int register_page_fault_notifier(struct notifier_block *nb)
15{
16 return 0;
17}
18static inline int unregister_page_fault_notifier(struct notifier_block *nb)
19{
20 return 0;
21}
22extern struct atomic_notifier_head powerpc_die_chain;
23
24/* Grossly misnamed. */ 5/* Grossly misnamed. */
25enum die_val { 6enum die_val {
26 DIE_OOPS = 1, 7 DIE_OOPS = 1,
diff --git a/include/asm-powerpc/kprobes.h b/include/asm-powerpc/kprobes.h
index 8b08b447d6f3..afabad230dbb 100644
--- a/include/asm-powerpc/kprobes.h
+++ b/include/asm-powerpc/kprobes.h
@@ -81,8 +81,8 @@ typedef unsigned int kprobe_opcode_t;
81#endif 81#endif
82 82
83#define ARCH_SUPPORTS_KRETPROBES 83#define ARCH_SUPPORTS_KRETPROBES
84#define ARCH_INACTIVE_KPROBE_COUNT 1
85#define flush_insn_slot(p) do { } while (0) 84#define flush_insn_slot(p) do { } while (0)
85#define kretprobe_blacklist_size 0
86 86
87void kretprobe_trampoline(void); 87void kretprobe_trampoline(void);
88extern void arch_remove_kprobe(struct kprobe *p); 88extern void arch_remove_kprobe(struct kprobe *p);
diff --git a/include/asm-powerpc/of_device.h b/include/asm-powerpc/of_device.h
index ec2a8a2c737c..93262f2546ad 100644
--- a/include/asm-powerpc/of_device.h
+++ b/include/asm-powerpc/of_device.h
@@ -20,7 +20,7 @@ struct of_device
20extern ssize_t of_device_get_modalias(struct of_device *ofdev, 20extern ssize_t of_device_get_modalias(struct of_device *ofdev,
21 char *str, ssize_t len); 21 char *str, ssize_t len);
22extern int of_device_uevent(struct device *dev, 22extern int of_device_uevent(struct device *dev,
23 char **envp, int num_envp, char *buffer, int buffer_size); 23 struct kobj_uevent_env *env);
24 24
25/* This is just here during the transition */ 25/* This is just here during the transition */
26#include <linux/of_device.h> 26#include <linux/of_device.h>
diff --git a/include/asm-powerpc/pgtable-ppc64.h b/include/asm-powerpc/pgtable-ppc64.h
index 300f9a199bf2..dd4c26dc57d2 100644
--- a/include/asm-powerpc/pgtable-ppc64.h
+++ b/include/asm-powerpc/pgtable-ppc64.h
@@ -68,6 +68,14 @@
68#define USER_REGION_ID (0UL) 68#define USER_REGION_ID (0UL)
69 69
70/* 70/*
71 * Defines the address of the vmemap area, in the top 16th of the
72 * kernel region.
73 */
74#define VMEMMAP_BASE (ASM_CONST(CONFIG_KERNEL_START) + \
75 (0xfUL << (REGION_SHIFT - 4)))
76#define vmemmap ((struct page *)VMEMMAP_BASE)
77
78/*
71 * Common bits in a linux-style PTE. These match the bits in the 79 * Common bits in a linux-style PTE. These match the bits in the
72 * (hardware-defined) PowerPC PTE as closely as possible. Additional 80 * (hardware-defined) PowerPC PTE as closely as possible. Additional
73 * bits may be defined in pgtable-*.h 81 * bits may be defined in pgtable-*.h
diff --git a/include/asm-powerpc/ps3av.h b/include/asm-powerpc/ps3av.h
index 7df4250802de..967930b82ed3 100644
--- a/include/asm-powerpc/ps3av.h
+++ b/include/asm-powerpc/ps3av.h
@@ -283,7 +283,7 @@
283#define PS3AV_CMD_VIDEO_CS_YUV422 0x0002 283#define PS3AV_CMD_VIDEO_CS_YUV422 0x0002
284#define PS3AV_CMD_VIDEO_CS_YUV444 0x0003 284#define PS3AV_CMD_VIDEO_CS_YUV444 0x0003
285 285
286/* for automode */ 286/* for broadcast automode */
287#define PS3AV_RESBIT_720x480P 0x0003 /* 0x0001 | 0x0002 */ 287#define PS3AV_RESBIT_720x480P 0x0003 /* 0x0001 | 0x0002 */
288#define PS3AV_RESBIT_720x576P 0x0003 /* 0x0001 | 0x0002 */ 288#define PS3AV_RESBIT_720x576P 0x0003 /* 0x0001 | 0x0002 */
289#define PS3AV_RESBIT_1280x720P 0x0004 289#define PS3AV_RESBIT_1280x720P 0x0004
@@ -298,13 +298,22 @@
298 | PS3AV_RESBIT_1920x1080I \ 298 | PS3AV_RESBIT_1920x1080I \
299 | PS3AV_RESBIT_1920x1080P) 299 | PS3AV_RESBIT_1920x1080P)
300 300
301/* for VESA automode */
302#define PS3AV_RESBIT_VGA 0x0001
303#define PS3AV_RESBIT_WXGA 0x0002
304#define PS3AV_RESBIT_SXGA 0x0004
305#define PS3AV_RESBIT_WUXGA 0x0008
306#define PS3AV_RES_MASK_VESA (PS3AV_RESBIT_WXGA |\
307 PS3AV_RESBIT_SXGA |\
308 PS3AV_RESBIT_WUXGA)
309
301#define PS3AV_MONITOR_TYPE_HDMI 1 /* HDMI */ 310#define PS3AV_MONITOR_TYPE_HDMI 1 /* HDMI */
302#define PS3AV_MONITOR_TYPE_DVI 2 /* DVI */ 311#define PS3AV_MONITOR_TYPE_DVI 2 /* DVI */
303#define PS3AV_DEFAULT_HDMI_VID_REG_60 PS3AV_CMD_VIDEO_VID_480P 312
304#define PS3AV_DEFAULT_AVMULTI_VID_REG_60 PS3AV_CMD_VIDEO_VID_480I 313#define PS3AV_DEFAULT_HDMI_MODE_ID_REG_60 2 /* 480p */
305#define PS3AV_DEFAULT_HDMI_VID_REG_50 PS3AV_CMD_VIDEO_VID_576P 314#define PS3AV_DEFAULT_AVMULTI_MODE_ID_REG_60 1 /* 480i */
306#define PS3AV_DEFAULT_AVMULTI_VID_REG_50 PS3AV_CMD_VIDEO_VID_576I 315#define PS3AV_DEFAULT_HDMI_MODE_ID_REG_50 7 /* 576p */
307#define PS3AV_DEFAULT_DVI_VID PS3AV_CMD_VIDEO_VID_480P 316#define PS3AV_DEFAULT_AVMULTI_MODE_ID_REG_50 6 /* 576i */
308 317
309#define PS3AV_REGION_60 0x01 318#define PS3AV_REGION_60 0x01
310#define PS3AV_REGION_50 0x02 319#define PS3AV_REGION_50 0x02
@@ -697,20 +706,12 @@ extern int ps3av_cmd_audio_mute(int, u32 *, u32);
697extern int ps3av_cmd_audio_active(int, u32); 706extern int ps3av_cmd_audio_active(int, u32);
698extern int ps3av_cmd_avb_param(struct ps3av_pkt_avb_param *, u32); 707extern int ps3av_cmd_avb_param(struct ps3av_pkt_avb_param *, u32);
699extern int ps3av_cmd_av_get_hw_conf(struct ps3av_pkt_av_get_hw_conf *); 708extern int ps3av_cmd_av_get_hw_conf(struct ps3av_pkt_av_get_hw_conf *);
700#ifdef PS3AV_DEBUG
701extern void ps3av_cmd_av_hw_conf_dump(const struct ps3av_pkt_av_get_hw_conf *);
702extern void ps3av_cmd_av_monitor_info_dump(const struct ps3av_pkt_av_get_monitor_info *);
703#else
704static inline void ps3av_cmd_av_hw_conf_dump(const struct ps3av_pkt_av_get_hw_conf *hw_conf) {}
705static inline void ps3av_cmd_av_monitor_info_dump(const struct ps3av_pkt_av_get_monitor_info *monitor_info) {}
706#endif
707extern int ps3av_cmd_video_get_monitor_info(struct ps3av_pkt_av_get_monitor_info *, 709extern int ps3av_cmd_video_get_monitor_info(struct ps3av_pkt_av_get_monitor_info *,
708 u32); 710 u32);
709 711
710extern int ps3av_set_video_mode(u32, int); 712extern int ps3av_set_video_mode(u32);
711extern int ps3av_set_audio_mode(u32, u32, u32, u32, u32); 713extern int ps3av_set_audio_mode(u32, u32, u32, u32, u32);
712extern int ps3av_get_auto_mode(int); 714extern int ps3av_get_auto_mode(void);
713extern int ps3av_set_mode(u32, int);
714extern int ps3av_get_mode(void); 715extern int ps3av_get_mode(void);
715extern int ps3av_get_scanmode(int); 716extern int ps3av_get_scanmode(int);
716extern int ps3av_get_refresh_rate(int); 717extern int ps3av_get_refresh_rate(int);
diff --git a/include/asm-powerpc/scatterlist.h b/include/asm-powerpc/scatterlist.h
index 8c992d1491d4..b075f619c3b7 100644
--- a/include/asm-powerpc/scatterlist.h
+++ b/include/asm-powerpc/scatterlist.h
@@ -41,5 +41,7 @@ struct scatterlist {
41#define ISA_DMA_THRESHOLD (~0UL) 41#define ISA_DMA_THRESHOLD (~0UL)
42#endif 42#endif
43 43
44#define ARCH_HAS_SG_CHAIN
45
44#endif /* __KERNEL__ */ 46#endif /* __KERNEL__ */
45#endif /* _ASM_POWERPC_SCATTERLIST_H */ 47#endif /* _ASM_POWERPC_SCATTERLIST_H */
diff --git a/include/asm-powerpc/smp.h b/include/asm-powerpc/smp.h
index 19102bfc14ca..505f35bacaa9 100644
--- a/include/asm-powerpc/smp.h
+++ b/include/asm-powerpc/smp.h
@@ -26,6 +26,7 @@
26#ifdef CONFIG_PPC64 26#ifdef CONFIG_PPC64
27#include <asm/paca.h> 27#include <asm/paca.h>
28#endif 28#endif
29#include <asm/percpu.h>
29 30
30extern int boot_cpuid; 31extern int boot_cpuid;
31 32
@@ -58,7 +59,7 @@ extern int smp_hw_index[];
58 (smp_hw_index[(cpu)] = (phys)) 59 (smp_hw_index[(cpu)] = (phys))
59#endif 60#endif
60 61
61extern cpumask_t cpu_sibling_map[NR_CPUS]; 62DECLARE_PER_CPU(cpumask_t, cpu_sibling_map);
62 63
63/* Since OpenPIC has only 4 IPIs, we use slightly different message numbers. 64/* Since OpenPIC has only 4 IPIs, we use slightly different message numbers.
64 * 65 *
@@ -77,6 +78,7 @@ void smp_init_pSeries(void);
77void smp_init_cell(void); 78void smp_init_cell(void);
78void smp_init_celleb(void); 79void smp_init_celleb(void);
79void smp_setup_cpu_maps(void); 80void smp_setup_cpu_maps(void);
81void smp_setup_cpu_sibling_map(void);
80 82
81extern int __cpu_disable(void); 83extern int __cpu_disable(void);
82extern void __cpu_die(unsigned int cpu); 84extern void __cpu_die(unsigned int cpu);
diff --git a/include/asm-powerpc/topology.h b/include/asm-powerpc/topology.h
index 0ad21a849b5f..ca23b681ad05 100644
--- a/include/asm-powerpc/topology.h
+++ b/include/asm-powerpc/topology.h
@@ -108,7 +108,7 @@ static inline void sysfs_remove_device_from_node(struct sys_device *dev,
108#ifdef CONFIG_PPC64 108#ifdef CONFIG_PPC64
109#include <asm/smp.h> 109#include <asm/smp.h>
110 110
111#define topology_thread_siblings(cpu) (cpu_sibling_map[cpu]) 111#define topology_thread_siblings(cpu) (per_cpu(cpu_sibling_map, cpu))
112#endif 112#endif
113#endif 113#endif
114 114
diff --git a/include/asm-s390/cache.h b/include/asm-s390/cache.h
index cdf431b061bb..9b866816863c 100644
--- a/include/asm-s390/cache.h
+++ b/include/asm-s390/cache.h
@@ -14,8 +14,6 @@
14#define L1_CACHE_BYTES 256 14#define L1_CACHE_BYTES 256
15#define L1_CACHE_SHIFT 8 15#define L1_CACHE_SHIFT 8
16 16
17#define ARCH_KMALLOC_MINALIGN 8
18
19#define __read_mostly __attribute__((__section__(".data.read_mostly"))) 17#define __read_mostly __attribute__((__section__(".data.read_mostly")))
20 18
21#endif 19#endif
diff --git a/include/asm-s390/ccwdev.h b/include/asm-s390/ccwdev.h
index 1aeda27d5a8b..066aa70518ce 100644
--- a/include/asm-s390/ccwdev.h
+++ b/include/asm-s390/ccwdev.h
@@ -67,36 +67,55 @@ ccw_device_id_match(const struct ccw_device_id *array,
67 return NULL; 67 return NULL;
68} 68}
69 69
70/* The struct ccw device is our replacement for the globally accessible 70/**
71 * ioinfo array. ioinfo will mutate into a subchannel device later. 71 * struct ccw_device - channel attached device
72 * @ccwlock: pointer to device lock
73 * @id: id of this device
74 * @drv: ccw driver for this device
75 * @dev: embedded device structure
76 * @online: online status of device
77 * @handler: interrupt handler
72 * 78 *
73 * Reference: Documentation/s390/driver-model.txt */ 79 * @handler is a member of the device rather than the driver since a driver
80 * can have different interrupt handlers for different ccw devices
81 * (multi-subchannel drivers).
82 */
74struct ccw_device { 83struct ccw_device {
75 spinlock_t *ccwlock; 84 spinlock_t *ccwlock;
85/* private: */
76 struct ccw_device_private *private; /* cio private information */ 86 struct ccw_device_private *private; /* cio private information */
77 struct ccw_device_id id; /* id of this device, driver_info is 87/* public: */
78 set by ccw_find_driver */ 88 struct ccw_device_id id;
79 struct ccw_driver *drv; /* */ 89 struct ccw_driver *drv;
80 struct device dev; /* */ 90 struct device dev;
81 int online; 91 int online;
82 /* This is sick, but a driver can have different interrupt handlers
83 for different ccw_devices (multi-subchannel drivers)... */
84 void (*handler) (struct ccw_device *, unsigned long, struct irb *); 92 void (*handler) (struct ccw_device *, unsigned long, struct irb *);
85}; 93};
86 94
87 95
88/* Each ccw driver registers with the ccw root bus */ 96/**
97 * struct ccw driver - device driver for channel attached devices
98 * @owner: owning module
99 * @ids: ids supported by this driver
100 * @probe: function called on probe
101 * @remove: function called on remove
102 * @set_online: called when setting device online
103 * @set_offline: called when setting device offline
104 * @notify: notify driver of device state changes
105 * @shutdown: called at device shutdown
106 * @driver: embedded device driver structure
107 * @name: device driver name
108 */
89struct ccw_driver { 109struct ccw_driver {
90 struct module *owner; /* for automatic MOD_INC_USE_COUNT */ 110 struct module *owner;
91 struct ccw_device_id *ids; /* probe driver with these devs */ 111 struct ccw_device_id *ids;
92 int (*probe) (struct ccw_device *); /* ask driver to probe dev */ 112 int (*probe) (struct ccw_device *);
93 void (*remove) (struct ccw_device *); 113 void (*remove) (struct ccw_device *);
94 /* device is no longer available */
95 int (*set_online) (struct ccw_device *); 114 int (*set_online) (struct ccw_device *);
96 int (*set_offline) (struct ccw_device *); 115 int (*set_offline) (struct ccw_device *);
97 int (*notify) (struct ccw_device *, int); 116 int (*notify) (struct ccw_device *, int);
98 struct device_driver driver; /* higher level structure, don't init 117 void (*shutdown) (struct ccw_device *);
99 this from your driver */ 118 struct device_driver driver;
100 char *name; 119 char *name;
101}; 120};
102 121
@@ -124,36 +143,10 @@ extern void ccw_device_clear_options(struct ccw_device *, unsigned long);
124/* Allow forced onlining of boxed devices. */ 143/* Allow forced onlining of boxed devices. */
125#define CCWDEV_ALLOW_FORCE 0x0008 144#define CCWDEV_ALLOW_FORCE 0x0008
126 145
127/*
128 * ccw_device_start()
129 *
130 * Start a S/390 channel program. When the interrupt arrives, the
131 * IRQ handler is called, either immediately, delayed (dev-end missing,
132 * or sense required) or never (no IRQ handler registered).
133 * Depending on the action taken, ccw_device_start() returns:
134 * 0 - Success
135 * -EBUSY - Device busy, or status pending
136 * -ENODEV - Device not operational
137 * -EINVAL - Device invalid for operation
138 */
139extern int ccw_device_start(struct ccw_device *, struct ccw1 *, 146extern int ccw_device_start(struct ccw_device *, struct ccw1 *,
140 unsigned long, __u8, unsigned long); 147 unsigned long, __u8, unsigned long);
141/*
142 * ccw_device_start_timeout()
143 *
144 * This function notifies the device driver if the channel program has not
145 * completed during the specified time. If a timeout occurs, the channel
146 * program is terminated via xsch(), hsch() or csch().
147 */
148extern int ccw_device_start_timeout(struct ccw_device *, struct ccw1 *, 148extern int ccw_device_start_timeout(struct ccw_device *, struct ccw1 *,
149 unsigned long, __u8, unsigned long, int); 149 unsigned long, __u8, unsigned long, int);
150/*
151 * ccw_device_start_key()
152 * ccw_device_start_key_timeout()
153 *
154 * Same as ccw_device_start() and ccw_device_start_timeout(), except a
155 * storage key != default key can be provided for the I/O.
156 */
157extern int ccw_device_start_key(struct ccw_device *, struct ccw1 *, 150extern int ccw_device_start_key(struct ccw_device *, struct ccw1 *,
158 unsigned long, __u8, __u8, unsigned long); 151 unsigned long, __u8, __u8, unsigned long);
159extern int ccw_device_start_timeout_key(struct ccw_device *, struct ccw1 *, 152extern int ccw_device_start_timeout_key(struct ccw_device *, struct ccw1 *,
diff --git a/include/asm-s390/ccwgroup.h b/include/asm-s390/ccwgroup.h
index 925b3ddfa141..7109c7cab87e 100644
--- a/include/asm-s390/ccwgroup.h
+++ b/include/asm-s390/ccwgroup.h
@@ -4,19 +4,41 @@
4struct ccw_device; 4struct ccw_device;
5struct ccw_driver; 5struct ccw_driver;
6 6
7/**
8 * struct ccwgroup_device - ccw group device
9 * @creator_id: unique number of the driver
10 * @state: online/offline state
11 * @count: number of attached slave devices
12 * @dev: embedded device structure
13 * @cdev: variable number of slave devices, allocated as needed
14 */
7struct ccwgroup_device { 15struct ccwgroup_device {
8 unsigned long creator_id; /* unique number of the driver */ 16 unsigned long creator_id;
9 enum { 17 enum {
10 CCWGROUP_OFFLINE, 18 CCWGROUP_OFFLINE,
11 CCWGROUP_ONLINE, 19 CCWGROUP_ONLINE,
12 } state; 20 } state;
21/* private: */
13 atomic_t onoff; 22 atomic_t onoff;
14 struct mutex reg_mutex; 23 struct mutex reg_mutex;
15 unsigned int count; /* number of attached slave devices */ 24/* public: */
16 struct device dev; /* master device */ 25 unsigned int count;
17 struct ccw_device *cdev[0]; /* variable number, allocate as needed */ 26 struct device dev;
27 struct ccw_device *cdev[0];
18}; 28};
19 29
30/**
31 * struct ccwgroup_driver - driver for ccw group devices
32 * @owner: driver owner
33 * @name: driver name
34 * @max_slaves: maximum number of slave devices
35 * @driver_id: unique id
36 * @probe: function called on probe
37 * @remove: function called on remove
38 * @set_online: function called when device is set online
39 * @set_offline: function called when device is set offline
40 * @driver: embedded driver structure
41 */
20struct ccwgroup_driver { 42struct ccwgroup_driver {
21 struct module *owner; 43 struct module *owner;
22 char *name; 44 char *name;
@@ -28,7 +50,7 @@ struct ccwgroup_driver {
28 int (*set_online) (struct ccwgroup_device *); 50 int (*set_online) (struct ccwgroup_device *);
29 int (*set_offline) (struct ccwgroup_device *); 51 int (*set_offline) (struct ccwgroup_device *);
30 52
31 struct device_driver driver; /* this driver */ 53 struct device_driver driver;
32}; 54};
33 55
34extern int ccwgroup_driver_register (struct ccwgroup_driver *cdriver); 56extern int ccwgroup_driver_register (struct ccwgroup_driver *cdriver);
diff --git a/include/asm-s390/cio.h b/include/asm-s390/cio.h
index 1982fb344164..2f08c16e44ad 100644
--- a/include/asm-s390/cio.h
+++ b/include/asm-s390/cio.h
@@ -15,30 +15,50 @@
15#define LPM_ANYPATH 0xff 15#define LPM_ANYPATH 0xff
16#define __MAX_CSSID 0 16#define __MAX_CSSID 0
17 17
18/* 18/**
19 * subchannel status word 19 * struct scsw - subchannel status word
20 * @key: subchannel key
21 * @sctl: suspend control
22 * @eswf: esw format
23 * @cc: deferred condition code
24 * @fmt: format
25 * @pfch: prefetch
26 * @isic: initial-status interruption control
27 * @alcc: adress-limit checking control
28 * @ssi: supress-suspended interruption
29 * @zcc: zero condition code
30 * @ectl: extended control
31 * @pno: path not operational
32 * @res: reserved
33 * @fctl: function control
34 * @actl: activity control
35 * @stctl: status control
36 * @cpa: channel program address
37 * @dstat: device status
38 * @cstat: subchannel status
39 * @count: residual count
20 */ 40 */
21struct scsw { 41struct scsw {
22 __u32 key : 4; /* subchannel key */ 42 __u32 key : 4;
23 __u32 sctl : 1; /* suspend control */ 43 __u32 sctl : 1;
24 __u32 eswf : 1; /* ESW format */ 44 __u32 eswf : 1;
25 __u32 cc : 2; /* deferred condition code */ 45 __u32 cc : 2;
26 __u32 fmt : 1; /* format */ 46 __u32 fmt : 1;
27 __u32 pfch : 1; /* prefetch */ 47 __u32 pfch : 1;
28 __u32 isic : 1; /* initial-status interruption control */ 48 __u32 isic : 1;
29 __u32 alcc : 1; /* address-limit checking control */ 49 __u32 alcc : 1;
30 __u32 ssi : 1; /* supress-suspended interruption */ 50 __u32 ssi : 1;
31 __u32 zcc : 1; /* zero condition code */ 51 __u32 zcc : 1;
32 __u32 ectl : 1; /* extended control */ 52 __u32 ectl : 1;
33 __u32 pno : 1; /* path not operational */ 53 __u32 pno : 1;
34 __u32 res : 1; /* reserved */ 54 __u32 res : 1;
35 __u32 fctl : 3; /* function control */ 55 __u32 fctl : 3;
36 __u32 actl : 7; /* activity control */ 56 __u32 actl : 7;
37 __u32 stctl : 5; /* status control */ 57 __u32 stctl : 5;
38 __u32 cpa; /* channel program address */ 58 __u32 cpa;
39 __u32 dstat : 8; /* device status */ 59 __u32 dstat : 8;
40 __u32 cstat : 8; /* subchannel status */ 60 __u32 cstat : 8;
41 __u32 count : 16; /* residual count */ 61 __u32 count : 16;
42} __attribute__ ((packed)); 62} __attribute__ ((packed));
43 63
44#define SCSW_FCTL_CLEAR_FUNC 0x1 64#define SCSW_FCTL_CLEAR_FUNC 0x1
@@ -110,11 +130,22 @@ struct scsw {
110#define SNS2_ENV_DATA_PRESENT 0x10 130#define SNS2_ENV_DATA_PRESENT 0x10
111#define SNS2_INPRECISE_END 0x04 131#define SNS2_INPRECISE_END 0x04
112 132
133/**
134 * struct ccw1 - channel command word
135 * @cmd_code: command code
136 * @flags: flags, like IDA adressing, etc.
137 * @count: byte count
138 * @cda: data address
139 *
140 * The ccw is the basic structure to build channel programs that perform
141 * operations with the device or the control unit. Only Format-1 channel
142 * command words are supported.
143 */
113struct ccw1 { 144struct ccw1 {
114 __u8 cmd_code; /* command code */ 145 __u8 cmd_code;
115 __u8 flags; /* flags, like IDA addressing, etc. */ 146 __u8 flags;
116 __u16 count; /* byte count */ 147 __u16 count;
117 __u32 cda; /* data address */ 148 __u32 cda;
118} __attribute__ ((packed,aligned(8))); 149} __attribute__ ((packed,aligned(8)));
119 150
120#define CCW_FLAG_DC 0x80 151#define CCW_FLAG_DC 0x80
@@ -140,102 +171,162 @@ struct ccw1 {
140 171
141#define SENSE_MAX_COUNT 0x20 172#define SENSE_MAX_COUNT 0x20
142 173
174/**
175 * struct erw - extended report word
176 * @res0: reserved
177 * @auth: authorization check
178 * @pvrf: path-verification-required flag
179 * @cpt: channel-path timeout
180 * @fsavf: failing storage address validity flag
181 * @cons: concurrent sense
182 * @scavf: secondary ccw address validity flag
183 * @fsaf: failing storage address format
184 * @scnt: sense count, if @cons == %1
185 * @res16: reserved
186 */
143struct erw { 187struct erw {
144 __u32 res0 : 3; /* reserved */ 188 __u32 res0 : 3;
145 __u32 auth : 1; /* Authorization check */ 189 __u32 auth : 1;
146 __u32 pvrf : 1; /* path-verification-required flag */ 190 __u32 pvrf : 1;
147 __u32 cpt : 1; /* channel-path timeout */ 191 __u32 cpt : 1;
148 __u32 fsavf : 1; /* Failing storage address validity flag */ 192 __u32 fsavf : 1;
149 __u32 cons : 1; /* concurrent-sense */ 193 __u32 cons : 1;
150 __u32 scavf : 1; /* Secondary ccw address validity flag */ 194 __u32 scavf : 1;
151 __u32 fsaf : 1; /* Failing storage address format */ 195 __u32 fsaf : 1;
152 __u32 scnt : 6; /* sense count if cons == 1 */ 196 __u32 scnt : 6;
153 __u32 res16 : 16; /* reserved */ 197 __u32 res16 : 16;
154} __attribute__ ((packed)); 198} __attribute__ ((packed));
155 199
156/* 200/**
157 * subchannel logout area 201 * struct sublog - subchannel logout area
202 * @res0: reserved
203 * @esf: extended status flags
204 * @lpum: last path used mask
205 * @arep: ancillary report
206 * @fvf: field-validity flags
207 * @sacc: storage access code
208 * @termc: termination code
209 * @devsc: device-status check
210 * @serr: secondary error
211 * @ioerr: i/o-error alert
212 * @seqc: sequence code
158 */ 213 */
159struct sublog { 214struct sublog {
160 __u32 res0 : 1; /* reserved */ 215 __u32 res0 : 1;
161 __u32 esf : 7; /* extended status flags */ 216 __u32 esf : 7;
162 __u32 lpum : 8; /* last path used mask */ 217 __u32 lpum : 8;
163 __u32 arep : 1; /* ancillary report */ 218 __u32 arep : 1;
164 __u32 fvf : 5; /* field-validity flags */ 219 __u32 fvf : 5;
165 __u32 sacc : 2; /* storage access code */ 220 __u32 sacc : 2;
166 __u32 termc : 2; /* termination code */ 221 __u32 termc : 2;
167 __u32 devsc : 1; /* device-status check */ 222 __u32 devsc : 1;
168 __u32 serr : 1; /* secondary error */ 223 __u32 serr : 1;
169 __u32 ioerr : 1; /* i/o-error alert */ 224 __u32 ioerr : 1;
170 __u32 seqc : 3; /* sequence code */ 225 __u32 seqc : 3;
171} __attribute__ ((packed)); 226} __attribute__ ((packed));
172 227
173/* 228/**
174 * Format 0 Extended Status Word (ESW) 229 * struct esw0 - Format 0 Extended Status Word (ESW)
230 * @sublog: subchannel logout
231 * @erw: extended report word
232 * @faddr: failing storage address
233 * @saddr: secondary ccw address
175 */ 234 */
176struct esw0 { 235struct esw0 {
177 struct sublog sublog; /* subchannel logout */ 236 struct sublog sublog;
178 struct erw erw; /* extended report word */ 237 struct erw erw;
179 __u32 faddr[2]; /* failing storage address */ 238 __u32 faddr[2];
180 __u32 saddr; /* secondary ccw address */ 239 __u32 saddr;
181} __attribute__ ((packed)); 240} __attribute__ ((packed));
182 241
183/* 242/**
184 * Format 1 Extended Status Word (ESW) 243 * struct esw1 - Format 1 Extended Status Word (ESW)
244 * @zero0: reserved zeros
245 * @lpum: last path used mask
246 * @zero16: reserved zeros
247 * @erw: extended report word
248 * @zeros: three fullwords of zeros
185 */ 249 */
186struct esw1 { 250struct esw1 {
187 __u8 zero0; /* reserved zeros */ 251 __u8 zero0;
188 __u8 lpum; /* last path used mask */ 252 __u8 lpum;
189 __u16 zero16; /* reserved zeros */ 253 __u16 zero16;
190 struct erw erw; /* extended report word */ 254 struct erw erw;
191 __u32 zeros[3]; /* 2 fullwords of zeros */ 255 __u32 zeros[3];
192} __attribute__ ((packed)); 256} __attribute__ ((packed));
193 257
194/* 258/**
195 * Format 2 Extended Status Word (ESW) 259 * struct esw2 - Format 2 Extended Status Word (ESW)
260 * @zero0: reserved zeros
261 * @lpum: last path used mask
262 * @dcti: device-connect-time interval
263 * @erw: extended report word
264 * @zeros: three fullwords of zeros
196 */ 265 */
197struct esw2 { 266struct esw2 {
198 __u8 zero0; /* reserved zeros */ 267 __u8 zero0;
199 __u8 lpum; /* last path used mask */ 268 __u8 lpum;
200 __u16 dcti; /* device-connect-time interval */ 269 __u16 dcti;
201 struct erw erw; /* extended report word */ 270 struct erw erw;
202 __u32 zeros[3]; /* 2 fullwords of zeros */ 271 __u32 zeros[3];
203} __attribute__ ((packed)); 272} __attribute__ ((packed));
204 273
205/* 274/**
206 * Format 3 Extended Status Word (ESW) 275 * struct esw3 - Format 3 Extended Status Word (ESW)
276 * @zero0: reserved zeros
277 * @lpum: last path used mask
278 * @res: reserved
279 * @erw: extended report word
280 * @zeros: three fullwords of zeros
207 */ 281 */
208struct esw3 { 282struct esw3 {
209 __u8 zero0; /* reserved zeros */ 283 __u8 zero0;
210 __u8 lpum; /* last path used mask */ 284 __u8 lpum;
211 __u16 res; /* reserved */ 285 __u16 res;
212 struct erw erw; /* extended report word */ 286 struct erw erw;
213 __u32 zeros[3]; /* 2 fullwords of zeros */ 287 __u32 zeros[3];
214} __attribute__ ((packed)); 288} __attribute__ ((packed));
215 289
216/* 290/**
217 * interruption response block 291 * struct irb - interruption response block
292 * @scsw: subchannel status word
293 * @esw: extened status word, 4 formats
294 * @ecw: extended control word
295 *
296 * The irb that is handed to the device driver when an interrupt occurs. For
297 * solicited interrupts, the common I/O layer already performs checks whether
298 * a field is valid; a field not being valid is always passed as %0.
299 * If a unit check occured, @ecw may contain sense data; this is retrieved
300 * by the common I/O layer itself if the device doesn't support concurrent
301 * sense (so that the device driver never needs to perform basic sene itself).
302 * For unsolicited interrupts, the irb is passed as-is (expect for sense data,
303 * if applicable).
218 */ 304 */
219struct irb { 305struct irb {
220 struct scsw scsw; /* subchannel status word */ 306 struct scsw scsw;
221 union { /* extended status word, 4 formats */ 307 union {
222 struct esw0 esw0; 308 struct esw0 esw0;
223 struct esw1 esw1; 309 struct esw1 esw1;
224 struct esw2 esw2; 310 struct esw2 esw2;
225 struct esw3 esw3; 311 struct esw3 esw3;
226 } esw; 312 } esw;
227 __u8 ecw[32]; /* extended control word */ 313 __u8 ecw[32];
228} __attribute__ ((packed,aligned(4))); 314} __attribute__ ((packed,aligned(4)));
229 315
230/* 316/**
231 * command information word (CIW) layout 317 * struct ciw - command information word (CIW) layout
318 * @et: entry type
319 * @reserved: reserved bits
320 * @ct: command type
321 * @cmd: command code
322 * @count: command count
232 */ 323 */
233struct ciw { 324struct ciw {
234 __u32 et : 2; /* entry type */ 325 __u32 et : 2;
235 __u32 reserved : 2; /* reserved */ 326 __u32 reserved : 2;
236 __u32 ct : 4; /* command type */ 327 __u32 ct : 4;
237 __u32 cmd : 8; /* command */ 328 __u32 cmd : 8;
238 __u32 count : 16; /* coun */ 329 __u32 count : 16;
239} __attribute__ ((packed)); 330} __attribute__ ((packed));
240 331
241#define CIW_TYPE_RCD 0x0 /* read configuration data */ 332#define CIW_TYPE_RCD 0x0 /* read configuration data */
@@ -258,11 +349,32 @@ struct ciw {
258/* Sick revalidation of device. */ 349/* Sick revalidation of device. */
259#define CIO_REVALIDATE 0x0008 350#define CIO_REVALIDATE 0x0008
260 351
352/**
353 * struct ccw_dev_id - unique identifier for ccw devices
354 * @ssid: subchannel set id
355 * @devno: device number
356 *
357 * This structure is not directly based on any hardware structure. The
358 * hardware identifies a device by its device number and its subchannel,
359 * which is in turn identified by its id. In order to get a unique identifier
360 * for ccw devices across subchannel sets, @struct ccw_dev_id has been
361 * introduced.
362 */
261struct ccw_dev_id { 363struct ccw_dev_id {
262 u8 ssid; 364 u8 ssid;
263 u16 devno; 365 u16 devno;
264}; 366};
265 367
368/**
369 * ccw_device_id_is_equal() - compare two ccw_dev_ids
370 * @dev_id1: a ccw_dev_id
371 * @dev_id2: another ccw_dev_id
372 * Returns:
373 * %1 if the two structures are equal field-by-field,
374 * %0 if not.
375 * Context:
376 * any
377 */
266static inline int ccw_dev_id_is_equal(struct ccw_dev_id *dev_id1, 378static inline int ccw_dev_id_is_equal(struct ccw_dev_id *dev_id1,
267 struct ccw_dev_id *dev_id2) 379 struct ccw_dev_id *dev_id2)
268{ 380{
diff --git a/include/asm-s390/cmb.h b/include/asm-s390/cmb.h
index 021e7c3223ec..50196857d27a 100644
--- a/include/asm-s390/cmb.h
+++ b/include/asm-s390/cmb.h
@@ -1,29 +1,29 @@
1#ifndef S390_CMB_H 1#ifndef S390_CMB_H
2#define S390_CMB_H 2#define S390_CMB_H
3/** 3/**
4 * struct cmbdata -- channel measurement block data for user space 4 * struct cmbdata - channel measurement block data for user space
5 * @size: size of the stored data
6 * @elapsed_time: time since last sampling
7 * @ssch_rsch_count: number of ssch and rsch
8 * @sample_count: number of samples
9 * @device_connect_time: time of device connect
10 * @function_pending_time: time of function pending
11 * @device_disconnect_time: time of device disconnect
12 * @control_unit_queuing_time: time of control unit queuing
13 * @device_active_only_time: time of device active only
14 * @device_busy_time: time of device busy (ext. format)
15 * @initial_command_response_time: initial command response time (ext. format)
5 * 16 *
6 * @size: size of the stored data 17 * All values are stored as 64 bit for simplicity, especially
7 * @ssch_rsch_count: XXX
8 * @sample_count:
9 * @device_connect_time:
10 * @function_pending_time:
11 * @device_disconnect_time:
12 * @control_unit_queuing_time:
13 * @device_active_only_time:
14 * @device_busy_time:
15 * @initial_command_response_time:
16 *
17 * all values are stored as 64 bit for simplicity, especially
18 * in 32 bit emulation mode. All time values are normalized to 18 * in 32 bit emulation mode. All time values are normalized to
19 * nanoseconds. 19 * nanoseconds.
20 * Currently, two formats are known, which differ by the size of 20 * Currently, two formats are known, which differ by the size of
21 * this structure, i.e. the last two members are only set when 21 * this structure, i.e. the last two members are only set when
22 * the extended channel measurement facility (first shipped in 22 * the extended channel measurement facility (first shipped in
23 * z990 machines) is activated. 23 * z990 machines) is activated.
24 * Potentially, more fields could be added, which results in a 24 * Potentially, more fields could be added, which would result in a
25 * new ioctl number. 25 * new ioctl number.
26 **/ 26 */
27struct cmbdata { 27struct cmbdata {
28 __u64 size; 28 __u64 size;
29 __u64 elapsed_time; 29 __u64 elapsed_time;
@@ -41,53 +41,18 @@ struct cmbdata {
41}; 41};
42 42
43/* enable channel measurement */ 43/* enable channel measurement */
44#define BIODASDCMFENABLE _IO(DASD_IOCTL_LETTER,32) 44#define BIODASDCMFENABLE _IO(DASD_IOCTL_LETTER, 32)
45/* enable channel measurement */ 45/* enable channel measurement */
46#define BIODASDCMFDISABLE _IO(DASD_IOCTL_LETTER,33) 46#define BIODASDCMFDISABLE _IO(DASD_IOCTL_LETTER, 33)
47/* read channel measurement data */ 47/* read channel measurement data */
48#define BIODASDREADALLCMB _IOWR(DASD_IOCTL_LETTER,33,struct cmbdata) 48#define BIODASDREADALLCMB _IOWR(DASD_IOCTL_LETTER, 33, struct cmbdata)
49 49
50#ifdef __KERNEL__ 50#ifdef __KERNEL__
51struct ccw_device; 51struct ccw_device;
52/**
53 * enable_cmf() - switch on the channel measurement for a specific device
54 * @cdev: The ccw device to be enabled
55 * returns 0 for success or a negative error value.
56 *
57 * Context:
58 * non-atomic
59 **/
60extern int enable_cmf(struct ccw_device *cdev); 52extern int enable_cmf(struct ccw_device *cdev);
61
62/**
63 * disable_cmf() - switch off the channel measurement for a specific device
64 * @cdev: The ccw device to be disabled
65 * returns 0 for success or a negative error value.
66 *
67 * Context:
68 * non-atomic
69 **/
70extern int disable_cmf(struct ccw_device *cdev); 53extern int disable_cmf(struct ccw_device *cdev);
71
72/**
73 * cmf_read() - read one value from the current channel measurement block
74 * @cmf: the channel to be read
75 * @index: the name of the value that is read
76 *
77 * Context:
78 * any
79 **/
80
81extern u64 cmf_read(struct ccw_device *cdev, int index); 54extern u64 cmf_read(struct ccw_device *cdev, int index);
82/** 55extern int cmf_readall(struct ccw_device *cdev, struct cmbdata *data);
83 * cmf_readall() - read one value from the current channel measurement block
84 * @cmf: the channel to be read
85 * @data: a pointer to a data block that will be filled
86 *
87 * Context:
88 * any
89 **/
90extern int cmf_readall(struct ccw_device *cdev, struct cmbdata*data);
91 56
92#endif /* __KERNEL__ */ 57#endif /* __KERNEL__ */
93#endif /* S390_CMB_H */ 58#endif /* S390_CMB_H */
diff --git a/include/asm-s390/kdebug.h b/include/asm-s390/kdebug.h
index 04418af08f85..40db27cd6e60 100644
--- a/include/asm-s390/kdebug.h
+++ b/include/asm-s390/kdebug.h
@@ -4,24 +4,9 @@
4/* 4/*
5 * Feb 2006 Ported to s390 <grundym@us.ibm.com> 5 * Feb 2006 Ported to s390 <grundym@us.ibm.com>
6 */ 6 */
7#include <linux/notifier.h>
8 7
9struct pt_regs; 8struct pt_regs;
10 9
11/*
12 * These are only here because kprobes.c wants them to implement a
13 * blatant layering violation. Will hopefully go away soon once all
14 * architectures are updated.
15 */
16static inline int register_page_fault_notifier(struct notifier_block *nb)
17{
18 return 0;
19}
20static inline int unregister_page_fault_notifier(struct notifier_block *nb)
21{
22 return 0;
23}
24
25enum die_val { 10enum die_val {
26 DIE_OOPS = 1, 11 DIE_OOPS = 1,
27 DIE_BPT, 12 DIE_BPT,
diff --git a/include/asm-s390/kprobes.h b/include/asm-s390/kprobes.h
index 340ba10446ea..948db3d0d05c 100644
--- a/include/asm-s390/kprobes.h
+++ b/include/asm-s390/kprobes.h
@@ -47,7 +47,7 @@ typedef u16 kprobe_opcode_t;
47 : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR))) 47 : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR)))
48 48
49#define ARCH_SUPPORTS_KRETPROBES 49#define ARCH_SUPPORTS_KRETPROBES
50#define ARCH_INACTIVE_KPROBE_COUNT 0 50#define kretprobe_blacklist_size 0
51 51
52#define KPROBE_SWAP_INST 0x10 52#define KPROBE_SWAP_INST 0x10
53 53
diff --git a/include/asm-s390/page.h b/include/asm-s390/page.h
index f326451ed6ec..ceec3826a67c 100644
--- a/include/asm-s390/page.h
+++ b/include/asm-s390/page.h
@@ -9,11 +9,12 @@
9#ifndef _S390_PAGE_H 9#ifndef _S390_PAGE_H
10#define _S390_PAGE_H 10#define _S390_PAGE_H
11 11
12#include <linux/const.h>
12#include <asm/types.h> 13#include <asm/types.h>
13 14
14/* PAGE_SHIFT determines the page size */ 15/* PAGE_SHIFT determines the page size */
15#define PAGE_SHIFT 12 16#define PAGE_SHIFT 12
16#define PAGE_SIZE (1UL << PAGE_SHIFT) 17#define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT)
17#define PAGE_MASK (~(PAGE_SIZE-1)) 18#define PAGE_MASK (~(PAGE_SIZE-1))
18#define PAGE_DEFAULT_ACC 0 19#define PAGE_DEFAULT_ACC 0
19#define PAGE_DEFAULT_KEY (PAGE_DEFAULT_ACC << 4) 20#define PAGE_DEFAULT_KEY (PAGE_DEFAULT_ACC << 4)
diff --git a/include/asm-s390/pgtable.h b/include/asm-s390/pgtable.h
index 3208dc6c412c..39bb5192dc31 100644
--- a/include/asm-s390/pgtable.h
+++ b/include/asm-s390/pgtable.h
@@ -107,11 +107,18 @@ extern char empty_zero_page[PAGE_SIZE];
107 * any out-of-bounds memory accesses will hopefully be caught. 107 * any out-of-bounds memory accesses will hopefully be caught.
108 * The vmalloc() routines leaves a hole of 4kB between each vmalloced 108 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
109 * area for the same reason. ;) 109 * area for the same reason. ;)
110 * vmalloc area starts at 4GB to prevent syscall table entry exchanging
111 * from modules.
110 */ 112 */
111extern unsigned long vmalloc_end; 113extern unsigned long vmalloc_end;
112#define VMALLOC_OFFSET (8*1024*1024) 114
113#define VMALLOC_START (((unsigned long) high_memory + VMALLOC_OFFSET) \ 115#ifdef CONFIG_64BIT
114 & ~(VMALLOC_OFFSET-1)) 116#define VMALLOC_ADDR (max(0x100000000UL, (unsigned long) high_memory))
117#else
118#define VMALLOC_ADDR ((unsigned long) high_memory)
119#endif
120#define VMALLOC_OFFSET (8*1024*1024)
121#define VMALLOC_START ((VMALLOC_ADDR + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
115#define VMALLOC_END vmalloc_end 122#define VMALLOC_END vmalloc_end
116 123
117/* 124/*
diff --git a/include/asm-s390/s390_ext.h b/include/asm-s390/s390_ext.h
index 1e72362cad78..2afc060266a2 100644
--- a/include/asm-s390/s390_ext.h
+++ b/include/asm-s390/s390_ext.h
@@ -5,7 +5,7 @@
5 * include/asm-s390/s390_ext.h 5 * include/asm-s390/s390_ext.h
6 * 6 *
7 * S390 version 7 * S390 version
8 * Copyright (C) 1999,2000 IBM Deutschland Entwicklung GmbH, IBM Corporation 8 * Copyright IBM Corp. 1999,2007
9 * Author(s): Holger Smolinski (Holger.Smolinski@de.ibm.com), 9 * Author(s): Holger Smolinski (Holger.Smolinski@de.ibm.com),
10 * Martin Schwidefsky (schwidefsky@de.ibm.com) 10 * Martin Schwidefsky (schwidefsky@de.ibm.com)
11 */ 11 */
@@ -14,15 +14,11 @@
14 14
15typedef void (*ext_int_handler_t)(__u16 code); 15typedef void (*ext_int_handler_t)(__u16 code);
16 16
17/*
18 * Warning: if you change ext_int_info_t you have to change the
19 * external interrupt handler in entry.S too.
20 */
21typedef struct ext_int_info_t { 17typedef struct ext_int_info_t {
22 struct ext_int_info_t *next; 18 struct ext_int_info_t *next;
23 ext_int_handler_t handler; 19 ext_int_handler_t handler;
24 __u16 code; 20 __u16 code;
25} __attribute__ ((packed)) ext_int_info_t; 21} ext_int_info_t;
26 22
27extern ext_int_info_t *ext_int_hash[]; 23extern ext_int_info_t *ext_int_hash[];
28 24
diff --git a/include/asm-s390/system.h b/include/asm-s390/system.h
index 64a3cd05cae1..d866d3385556 100644
--- a/include/asm-s390/system.h
+++ b/include/asm-s390/system.h
@@ -130,6 +130,8 @@ extern void pfault_fini(void);
130 __ret; \ 130 __ret; \
131}) 131})
132 132
133extern void __xchg_called_with_bad_pointer(void);
134
133static inline unsigned long __xchg(unsigned long x, void * ptr, int size) 135static inline unsigned long __xchg(unsigned long x, void * ptr, int size)
134{ 136{
135 unsigned long addr, old; 137 unsigned long addr, old;
@@ -150,8 +152,7 @@ static inline unsigned long __xchg(unsigned long x, void * ptr, int size)
150 : "=&d" (old), "=m" (*(int *) addr) 152 : "=&d" (old), "=m" (*(int *) addr)
151 : "d" (x << shift), "d" (~(255 << shift)), "a" (addr), 153 : "d" (x << shift), "d" (~(255 << shift)), "a" (addr),
152 "m" (*(int *) addr) : "memory", "cc", "0"); 154 "m" (*(int *) addr) : "memory", "cc", "0");
153 x = old >> shift; 155 return old >> shift;
154 break;
155 case 2: 156 case 2:
156 addr = (unsigned long) ptr; 157 addr = (unsigned long) ptr;
157 shift = (2 ^ (addr & 2)) << 3; 158 shift = (2 ^ (addr & 2)) << 3;
@@ -166,8 +167,7 @@ static inline unsigned long __xchg(unsigned long x, void * ptr, int size)
166 : "=&d" (old), "=m" (*(int *) addr) 167 : "=&d" (old), "=m" (*(int *) addr)
167 : "d" (x << shift), "d" (~(65535 << shift)), "a" (addr), 168 : "d" (x << shift), "d" (~(65535 << shift)), "a" (addr),
168 "m" (*(int *) addr) : "memory", "cc", "0"); 169 "m" (*(int *) addr) : "memory", "cc", "0");
169 x = old >> shift; 170 return old >> shift;
170 break;
171 case 4: 171 case 4:
172 asm volatile( 172 asm volatile(
173 " l %0,0(%3)\n" 173 " l %0,0(%3)\n"
@@ -176,8 +176,7 @@ static inline unsigned long __xchg(unsigned long x, void * ptr, int size)
176 : "=&d" (old), "=m" (*(int *) ptr) 176 : "=&d" (old), "=m" (*(int *) ptr)
177 : "d" (x), "a" (ptr), "m" (*(int *) ptr) 177 : "d" (x), "a" (ptr), "m" (*(int *) ptr)
178 : "memory", "cc"); 178 : "memory", "cc");
179 x = old; 179 return old;
180 break;
181#ifdef __s390x__ 180#ifdef __s390x__
182 case 8: 181 case 8:
183 asm volatile( 182 asm volatile(
@@ -187,11 +186,11 @@ static inline unsigned long __xchg(unsigned long x, void * ptr, int size)
187 : "=&d" (old), "=m" (*(long *) ptr) 186 : "=&d" (old), "=m" (*(long *) ptr)
188 : "d" (x), "a" (ptr), "m" (*(long *) ptr) 187 : "d" (x), "a" (ptr), "m" (*(long *) ptr)
189 : "memory", "cc"); 188 : "memory", "cc");
190 x = old; 189 return old;
191 break;
192#endif /* __s390x__ */ 190#endif /* __s390x__ */
193 } 191 }
194 return x; 192 __xchg_called_with_bad_pointer();
193 return x;
195} 194}
196 195
197/* 196/*
@@ -206,6 +205,8 @@ static inline unsigned long __xchg(unsigned long x, void * ptr, int size)
206 ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\ 205 ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\
207 (unsigned long)(n),sizeof(*(ptr)))) 206 (unsigned long)(n),sizeof(*(ptr))))
208 207
208extern void __cmpxchg_called_with_bad_pointer(void);
209
209static inline unsigned long 210static inline unsigned long
210__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) 211__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
211{ 212{
@@ -270,7 +271,8 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
270 return prev; 271 return prev;
271#endif /* __s390x__ */ 272#endif /* __s390x__ */
272 } 273 }
273 return old; 274 __cmpxchg_called_with_bad_pointer();
275 return old;
274} 276}
275 277
276/* 278/*
diff --git a/include/asm-s390/zcrypt.h b/include/asm-s390/zcrypt.h
index b90e55888a55..a5dada617751 100644
--- a/include/asm-s390/zcrypt.h
+++ b/include/asm-s390/zcrypt.h
@@ -91,7 +91,7 @@ struct ica_rsa_modexpo_crt {
91 * VUD block 91 * VUD block
92 * key block 92 * key block
93 */ 93 */
94struct ica_CPRBX { 94struct CPRBX {
95 unsigned short cprb_len; /* CPRB length 220 */ 95 unsigned short cprb_len; /* CPRB length 220 */
96 unsigned char cprb_ver_id; /* CPRB version id. 0x02 */ 96 unsigned char cprb_ver_id; /* CPRB version id. 0x02 */
97 unsigned char pad_000[3]; /* Alignment pad bytes */ 97 unsigned char pad_000[3]; /* Alignment pad bytes */
@@ -130,7 +130,7 @@ struct ica_CPRBX {
130 unsigned char cntrl_domain[4];/* Control domain */ 130 unsigned char cntrl_domain[4];/* Control domain */
131 unsigned char S390enf_mask[4];/* S/390 enforcement mask */ 131 unsigned char S390enf_mask[4];/* S/390 enforcement mask */
132 unsigned char pad_004[36]; /* reserved */ 132 unsigned char pad_004[36]; /* reserved */
133}; 133} __attribute__((packed));
134 134
135/** 135/**
136 * xcRB 136 * xcRB
diff --git a/include/asm-sh/cacheflush.h b/include/asm-sh/cacheflush.h
index 07f62ec9ff0c..aa558da08471 100644
--- a/include/asm-sh/cacheflush.h
+++ b/include/asm-sh/cacheflush.h
@@ -1,16 +1,47 @@
1#ifndef __ASM_SH_CACHEFLUSH_H 1#ifndef __ASM_SH_CACHEFLUSH_H
2#define __ASM_SH_CACHEFLUSH_H 2#define __ASM_SH_CACHEFLUSH_H
3
3#ifdef __KERNEL__ 4#ifdef __KERNEL__
4 5
5#include <linux/mm.h> 6#ifdef CONFIG_CACHE_OFF
7/*
8 * Nothing to do when the cache is disabled, initial flush and explicit
9 * disabling is handled at CPU init time.
10 *
11 * See arch/sh/kernel/cpu/init.c:cache_init().
12 */
13#define p3_cache_init() do { } while (0)
14#define flush_cache_all() do { } while (0)
15#define flush_cache_mm(mm) do { } while (0)
16#define flush_cache_dup_mm(mm) do { } while (0)
17#define flush_cache_range(vma, start, end) do { } while (0)
18#define flush_cache_page(vma, vmaddr, pfn) do { } while (0)
19#define flush_dcache_page(page) do { } while (0)
20#define flush_icache_range(start, end) do { } while (0)
21#define flush_icache_page(vma,pg) do { } while (0)
22#define flush_dcache_mmap_lock(mapping) do { } while (0)
23#define flush_dcache_mmap_unlock(mapping) do { } while (0)
24#define flush_cache_sigtramp(vaddr) do { } while (0)
25#define flush_icache_user_range(vma,pg,adr,len) do { } while (0)
26#define __flush_wback_region(start, size) do { (void)(start); } while (0)
27#define __flush_purge_region(start, size) do { (void)(start); } while (0)
28#define __flush_invalidate_region(start, size) do { (void)(start); } while (0)
29#else
6#include <asm/cpu/cacheflush.h> 30#include <asm/cpu/cacheflush.h>
7 31
32/*
33 * Consistent DMA requires that the __flush_xxx() primitives must be set
34 * for any of the enabled non-coherent caches (most of the UP CPUs),
35 * regardless of PIPT or VIPT cache configurations.
36 */
37
8/* Flush (write-back only) a region (smaller than a page) */ 38/* Flush (write-back only) a region (smaller than a page) */
9extern void __flush_wback_region(void *start, int size); 39extern void __flush_wback_region(void *start, int size);
10/* Flush (write-back & invalidate) a region (smaller than a page) */ 40/* Flush (write-back & invalidate) a region (smaller than a page) */
11extern void __flush_purge_region(void *start, int size); 41extern void __flush_purge_region(void *start, int size);
12/* Flush (invalidate only) a region (smaller than a page) */ 42/* Flush (invalidate only) a region (smaller than a page) */
13extern void __flush_invalidate_region(void *start, int size); 43extern void __flush_invalidate_region(void *start, int size);
44#endif
14 45
15#define flush_cache_vmap(start, end) flush_cache_all() 46#define flush_cache_vmap(start, end) flush_cache_all()
16#define flush_cache_vunmap(start, end) flush_cache_all() 47#define flush_cache_vunmap(start, end) flush_cache_all()
diff --git a/include/asm-sh/cpu-sh3/cache.h b/include/asm-sh/cpu-sh3/cache.h
index ffe08d2813f9..255016fc91f0 100644
--- a/include/asm-sh/cpu-sh3/cache.h
+++ b/include/asm-sh/cpu-sh3/cache.h
@@ -26,7 +26,9 @@
26#define CCR_CACHE_ENABLE CCR_CACHE_CE 26#define CCR_CACHE_ENABLE CCR_CACHE_CE
27#define CCR_CACHE_INVALIDATE CCR_CACHE_CF 27#define CCR_CACHE_INVALIDATE CCR_CACHE_CF
28 28
29#if defined(CONFIG_CPU_SUBTYPE_SH7705) || defined(CONFIG_CPU_SUBTYPE_SH7710) 29#if defined(CONFIG_CPU_SUBTYPE_SH7705) || \
30 defined(CONFIG_CPU_SUBTYPE_SH7710) || \
31 defined(CONFIG_CPU_SUBTYPE_SH7720)
30#define CCR3 0xa40000b4 32#define CCR3 0xa40000b4
31#define CCR_CACHE_16KB 0x00010000 33#define CCR_CACHE_16KB 0x00010000
32#define CCR_CACHE_32KB 0x00020000 34#define CCR_CACHE_32KB 0x00020000
diff --git a/include/asm-sh/cpu-sh3/dma.h b/include/asm-sh/cpu-sh3/dma.h
index 3a66dc458023..54bfece328c2 100644
--- a/include/asm-sh/cpu-sh3/dma.h
+++ b/include/asm-sh/cpu-sh3/dma.h
@@ -1,7 +1,20 @@
1#ifndef __ASM_CPU_SH3_DMA_H 1#ifndef __ASM_CPU_SH3_DMA_H
2#define __ASM_CPU_SH3_DMA_H 2#define __ASM_CPU_SH3_DMA_H
3 3
4
5#if defined(CONFIG_CPU_SUBTYPE_SH7720) || defined(CONFIG_CPU_SUBTYPE_SH7709)
6#define SH_DMAC_BASE 0xa4010020
7
8#define DMTE0_IRQ 48
9#define DMTE1_IRQ 49
10#define DMTE2_IRQ 50
11#define DMTE3_IRQ 51
12#define DMTE4_IRQ 76
13#define DMTE5_IRQ 77
14
15#else
4#define SH_DMAC_BASE 0xa4000020 16#define SH_DMAC_BASE 0xa4000020
17#endif
5 18
6/* Definitions for the SuperH DMAC */ 19/* Definitions for the SuperH DMAC */
7#define TM_BURST 0x00000020 20#define TM_BURST 0x00000020
diff --git a/include/asm-sh/cpu-sh3/gpio.h b/include/asm-sh/cpu-sh3/gpio.h
new file mode 100644
index 000000000000..48770c1c7bdf
--- /dev/null
+++ b/include/asm-sh/cpu-sh3/gpio.h
@@ -0,0 +1,66 @@
1/*
2 * include/asm-sh/cpu-sh3/gpio.h
3 *
4 * Copyright (C) 2007 Markus Brunner, Mark Jonas
5 *
6 * Addresses for the Pin Function Controller
7 *
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive
10 * for more details.
11 */
12#ifndef _CPU_SH3_GPIO_H
13#define _CPU_SH3_GPIO_H
14
15#if defined(CONFIG_CPU_SUBTYPE_SH7720)
16
17/* Control registers */
18#define PORT_PACR 0xA4050100UL
19#define PORT_PBCR 0xA4050102UL
20#define PORT_PCCR 0xA4050104UL
21#define PORT_PDCR 0xA4050106UL
22#define PORT_PECR 0xA4050108UL
23#define PORT_PFCR 0xA405010AUL
24#define PORT_PGCR 0xA405010CUL
25#define PORT_PHCR 0xA405010EUL
26#define PORT_PJCR 0xA4050110UL
27#define PORT_PKCR 0xA4050112UL
28#define PORT_PLCR 0xA4050114UL
29#define PORT_PMCR 0xA4050116UL
30#define PORT_PPCR 0xA4050118UL
31#define PORT_PRCR 0xA405011AUL
32#define PORT_PSCR 0xA405011CUL
33#define PORT_PTCR 0xA405011EUL
34#define PORT_PUCR 0xA4050120UL
35#define PORT_PVCR 0xA4050122UL
36
37/* Data registers */
38#define PORT_PADR 0xA4050140UL
39/* Address of PORT_PBDR is wrong in the datasheet, see errata 2005-09-21 */
40#define PORT_PBDR 0xA4050142UL
41#define PORT_PCDR 0xA4050144UL
42#define PORT_PDDR 0xA4050146UL
43#define PORT_PEDR 0xA4050148UL
44#define PORT_PFDR 0xA405014AUL
45#define PORT_PGDR 0xA405014CUL
46#define PORT_PHDR 0xA405014EUL
47#define PORT_PJDR 0xA4050150UL
48#define PORT_PKDR 0xA4050152UL
49#define PORT_PLDR 0xA4050154UL
50#define PORT_PMDR 0xA4050156UL
51#define PORT_PPDR 0xA4050158UL
52#define PORT_PRDR 0xA405015AUL
53#define PORT_PSDR 0xA405015CUL
54#define PORT_PTDR 0xA405015EUL
55#define PORT_PUDR 0xA4050160UL
56#define PORT_PVDR 0xA4050162UL
57
58/* Pin Select Registers */
59#define PORT_PSELA 0xA4050124UL
60#define PORT_PSELB 0xA4050126UL
61#define PORT_PSELC 0xA4050128UL
62#define PORT_PSELD 0xA405012AUL
63
64#endif
65
66#endif
diff --git a/include/asm-sh/cpu-sh3/mmu_context.h b/include/asm-sh/cpu-sh3/mmu_context.h
index b20786d42d09..16c2d63b7e39 100644
--- a/include/asm-sh/cpu-sh3/mmu_context.h
+++ b/include/asm-sh/cpu-sh3/mmu_context.h
@@ -27,12 +27,13 @@
27#define TRA 0xffffffd0 27#define TRA 0xffffffd0
28#define EXPEVT 0xffffffd4 28#define EXPEVT 0xffffffd4
29 29
30#if defined(CONFIG_CPU_SUBTYPE_SH7707) || \ 30#if defined(CONFIG_CPU_SUBTYPE_SH7705) || \
31 defined(CONFIG_CPU_SUBTYPE_SH7709) || \
32 defined(CONFIG_CPU_SUBTYPE_SH7706) || \ 31 defined(CONFIG_CPU_SUBTYPE_SH7706) || \
33 defined(CONFIG_CPU_SUBTYPE_SH7705) || \ 32 defined(CONFIG_CPU_SUBTYPE_SH7707) || \
33 defined(CONFIG_CPU_SUBTYPE_SH7709) || \
34 defined(CONFIG_CPU_SUBTYPE_SH7710) || \
34 defined(CONFIG_CPU_SUBTYPE_SH7712) || \ 35 defined(CONFIG_CPU_SUBTYPE_SH7712) || \
35 defined(CONFIG_CPU_SUBTYPE_SH7710) 36 defined(CONFIG_CPU_SUBTYPE_SH7720)
36#define INTEVT 0xa4000000 /* INTEVTE2(0xa4000000) */ 37#define INTEVT 0xa4000000 /* INTEVTE2(0xa4000000) */
37#else 38#else
38#define INTEVT 0xffffffd8 39#define INTEVT 0xffffffd8
diff --git a/include/asm-sh/cpu-sh3/timer.h b/include/asm-sh/cpu-sh3/timer.h
index b6c2020a2ad3..3880ce047fe0 100644
--- a/include/asm-sh/cpu-sh3/timer.h
+++ b/include/asm-sh/cpu-sh3/timer.h
@@ -23,11 +23,13 @@
23 * --------------------------------------------------------------------------- 23 * ---------------------------------------------------------------------------
24 */ 24 */
25 25
26#if !defined(CONFIG_CPU_SUBTYPE_SH7727) 26#if !defined(CONFIG_CPU_SUBTYPE_SH7720) && \
27 !defined(CONFIG_CPU_SUBTYPE_SH7727)
27#define TMU_TOCR 0xfffffe90 /* Byte access */ 28#define TMU_TOCR 0xfffffe90 /* Byte access */
28#endif 29#endif
29 30
30#if defined(CONFIG_CPU_SUBTYPE_SH7710) 31#if defined(CONFIG_CPU_SUBTYPE_SH7710) || \
32 defined(CONFIG_CPU_SUBTYPE_SH7720)
31#define TMU_012_TSTR 0xa412fe92 /* Byte access */ 33#define TMU_012_TSTR 0xa412fe92 /* Byte access */
32 34
33#define TMU0_TCOR 0xa412fe94 /* Long access */ 35#define TMU0_TCOR 0xa412fe94 /* Long access */
@@ -56,7 +58,8 @@
56#define TMU2_TCOR 0xfffffeac /* Long access */ 58#define TMU2_TCOR 0xfffffeac /* Long access */
57#define TMU2_TCNT 0xfffffeb0 /* Long access */ 59#define TMU2_TCNT 0xfffffeb0 /* Long access */
58#define TMU2_TCR 0xfffffeb4 /* Word access */ 60#define TMU2_TCR 0xfffffeb4 /* Word access */
59#if !defined(CONFIG_CPU_SUBTYPE_SH7727) 61#if !defined(CONFIG_CPU_SUBTYPE_SH7720) && \
62 !defined(CONFIG_CPU_SUBTYPE_SH7727)
60#define TMU2_TCPR2 0xfffffeb8 /* Long access */ 63#define TMU2_TCPR2 0xfffffeb8 /* Long access */
61#endif 64#endif
62#endif 65#endif
diff --git a/include/asm-sh/cpu-sh3/ubc.h b/include/asm-sh/cpu-sh3/ubc.h
index 9d308cbe9b29..18467c574534 100644
--- a/include/asm-sh/cpu-sh3/ubc.h
+++ b/include/asm-sh/cpu-sh3/ubc.h
@@ -11,7 +11,8 @@
11#ifndef __ASM_CPU_SH3_UBC_H 11#ifndef __ASM_CPU_SH3_UBC_H
12#define __ASM_CPU_SH3_UBC_H 12#define __ASM_CPU_SH3_UBC_H
13 13
14#if defined(CONFIG_CPU_SUBTYPE_SH7710) 14#if defined(CONFIG_CPU_SUBTYPE_SH7710) || \
15 defined(CONFIG_CPU_SUBTYPE_SH7720)
15#define UBC_BARA 0xa4ffffb0 16#define UBC_BARA 0xa4ffffb0
16#define UBC_BAMRA 0xa4ffffb4 17#define UBC_BAMRA 0xa4ffffb4
17#define UBC_BBRA 0xa4ffffb8 18#define UBC_BBRA 0xa4ffffb8
diff --git a/include/asm-sh/cpu-sh4/dma.h b/include/asm-sh/cpu-sh4/dma.h
index 36e26a964765..aaf71b018c28 100644
--- a/include/asm-sh/cpu-sh4/dma.h
+++ b/include/asm-sh/cpu-sh4/dma.h
@@ -31,7 +31,7 @@
31#define TS_32 0x00000030 31#define TS_32 0x00000030
32#define TS_64 0x00000000 32#define TS_64 0x00000000
33 33
34#define CHCR_TS_MASK 0x30 34#define CHCR_TS_MASK 0x70
35#define CHCR_TS_SHIFT 4 35#define CHCR_TS_SHIFT 4
36 36
37#define DMAOR_COD 0x00000008 37#define DMAOR_COD 0x00000008
diff --git a/include/asm-sh/cpu-sh4/mmu_context.h b/include/asm-sh/cpu-sh4/mmu_context.h
index ff4c5fbbfaf0..979acddc0f8e 100644
--- a/include/asm-sh/cpu-sh4/mmu_context.h
+++ b/include/asm-sh/cpu-sh4/mmu_context.h
@@ -22,13 +22,21 @@
22#define MMU_UTLB_ADDRESS_ARRAY 0xF6000000 22#define MMU_UTLB_ADDRESS_ARRAY 0xF6000000
23#define MMU_PAGE_ASSOC_BIT 0x80 23#define MMU_PAGE_ASSOC_BIT 0x80
24 24
25#define MMU_NTLB_ENTRIES 64 /* for 7750 */ 25#ifdef CONFIG_X2TLB
26#define MMUCR_ME (1 << 7)
27#else
28#define MMUCR_ME (0)
29#endif
30
26#ifdef CONFIG_SH_STORE_QUEUES 31#ifdef CONFIG_SH_STORE_QUEUES
27#define MMU_CONTROL_INIT 0x05 /* SQMD=0, SV=0, TI=1, AT=1 */ 32#define MMUCR_SQMD (1 << 9)
28#else 33#else
29#define MMU_CONTROL_INIT 0x205 /* SQMD=1, SV=0, TI=1, AT=1 */ 34#define MMUCR_SQMD (0)
30#endif 35#endif
31 36
37#define MMU_NTLB_ENTRIES 64
38#define MMU_CONTROL_INIT (0x05|MMUCR_SQMD|MMUCR_ME)
39
32#define MMU_ITLB_DATA_ARRAY 0xF3000000 40#define MMU_ITLB_DATA_ARRAY 0xF3000000
33#define MMU_UTLB_DATA_ARRAY 0xF7000000 41#define MMU_UTLB_DATA_ARRAY 0xF7000000
34 42
diff --git a/include/asm-sh/dma.h b/include/asm-sh/dma.h
index 4c75b70b6414..a65b02fd186e 100644
--- a/include/asm-sh/dma.h
+++ b/include/asm-sh/dma.h
@@ -152,14 +152,9 @@ extern struct dma_info *get_dma_info_by_name(const char *dmac_name);
152extern int dma_extend(unsigned int chan, unsigned long op, void *param); 152extern int dma_extend(unsigned int chan, unsigned long op, void *param);
153extern int register_chan_caps(const char *dmac, struct dma_chan_caps *capslist); 153extern int register_chan_caps(const char *dmac, struct dma_chan_caps *capslist);
154 154
155#ifdef CONFIG_SYSFS
156/* arch/sh/drivers/dma/dma-sysfs.c */ 155/* arch/sh/drivers/dma/dma-sysfs.c */
157extern int dma_create_sysfs_files(struct dma_channel *, struct dma_info *); 156extern int dma_create_sysfs_files(struct dma_channel *, struct dma_info *);
158extern void dma_remove_sysfs_files(struct dma_channel *, struct dma_info *); 157extern void dma_remove_sysfs_files(struct dma_channel *, struct dma_info *);
159#else
160#define dma_create_sysfs_file(channel, info) do { } while (0)
161#define dma_remove_sysfs_file(channel, info) do { } while (0)
162#endif
163 158
164#ifdef CONFIG_PCI 159#ifdef CONFIG_PCI
165extern int isa_dma_bridge_buggy; 160extern int isa_dma_bridge_buggy;
diff --git a/include/asm-sh/dreamcast/maple.h b/include/asm-sh/dreamcast/maple.h
new file mode 100644
index 000000000000..51f6a87f1f11
--- /dev/null
+++ b/include/asm-sh/dreamcast/maple.h
@@ -0,0 +1,37 @@
1#ifndef __ASM_MAPLE_H
2#define __ASM_MAPLE_H
3
4#define MAPLE_PORTS 4
5#define MAPLE_PNP_INTERVAL HZ
6#define MAPLE_MAXPACKETS 8
7#define MAPLE_DMA_ORDER 14
8#define MAPLE_DMA_SIZE (1 << MAPLE_DMA_ORDER)
9#define MAPLE_DMA_PAGES ((MAPLE_DMA_ORDER > PAGE_SHIFT) ? \
10 MAPLE_DMA_ORDER - PAGE_SHIFT : 0)
11
12/* Maple Bus registers */
13#define MAPLE_BASE 0xa05f6c00
14#define MAPLE_DMAADDR (MAPLE_BASE+0x04)
15#define MAPLE_TRIGTYPE (MAPLE_BASE+0x10)
16#define MAPLE_ENABLE (MAPLE_BASE+0x14)
17#define MAPLE_STATE (MAPLE_BASE+0x18)
18#define MAPLE_SPEED (MAPLE_BASE+0x80)
19#define MAPLE_RESET (MAPLE_BASE+0x8c)
20
21#define MAPLE_MAGIC 0x6155404f
22#define MAPLE_2MBPS 0
23#define MAPLE_TIMEOUT(n) ((n)<<15)
24
25/* Function codes */
26#define MAPLE_FUNC_CONTROLLER 0x001
27#define MAPLE_FUNC_MEMCARD 0x002
28#define MAPLE_FUNC_LCD 0x004
29#define MAPLE_FUNC_CLOCK 0x008
30#define MAPLE_FUNC_MICROPHONE 0x010
31#define MAPLE_FUNC_ARGUN 0x020
32#define MAPLE_FUNC_KEYBOARD 0x040
33#define MAPLE_FUNC_LIGHTGUN 0x080
34#define MAPLE_FUNC_PURUPURU 0x100
35#define MAPLE_FUNC_MOUSE 0x200
36
37#endif /* __ASM_MAPLE_H */
diff --git a/include/asm-sh/gpio.h b/include/asm-sh/gpio.h
new file mode 100644
index 000000000000..9bb27e0f11a4
--- /dev/null
+++ b/include/asm-sh/gpio.h
@@ -0,0 +1,19 @@
1/*
2 * include/asm-sh/gpio.h
3 *
4 * Copyright (C) 2007 Markus Brunner, Mark Jonas
5 *
6 * Addresses for the Pin Function Controller
7 *
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive
10 * for more details.
11 */
12#ifndef __ASM_SH_GPIO_H
13#define __ASM_SH_GPIO_H
14
15#if defined(CONFIG_CPU_SH3)
16#include <asm/cpu/gpio.h>
17#endif
18
19#endif /* __ASM_SH_GPIO_H */
diff --git a/include/asm-sh/hd64461.h b/include/asm-sh/hd64461.h
index 4dd8592ca014..342ca55a266a 100644
--- a/include/asm-sh/hd64461.h
+++ b/include/asm-sh/hd64461.h
@@ -226,6 +226,7 @@
226#define HD64461_NIMR (CONFIG_HD64461_IOBASE + 0x5002) 226#define HD64461_NIMR (CONFIG_HD64461_IOBASE + 0x5002)
227 227
228#define HD64461_IRQBASE OFFCHIP_IRQ_BASE 228#define HD64461_IRQBASE OFFCHIP_IRQ_BASE
229#define OFFCHIP_IRQ_BASE 64
229#define HD64461_IRQ_NUM 16 230#define HD64461_IRQ_NUM 16
230 231
231#define HD64461_IRQ_UART (HD64461_IRQBASE+5) 232#define HD64461_IRQ_UART (HD64461_IRQBASE+5)
diff --git a/include/asm-sh/heartbeat.h b/include/asm-sh/heartbeat.h
new file mode 100644
index 000000000000..724a43ed245e
--- /dev/null
+++ b/include/asm-sh/heartbeat.h
@@ -0,0 +1,17 @@
1#ifndef __ASM_SH_HEARTBEAT_H
2#define __ASM_SH_HEARTBEAT_H
3
4#include <linux/timer.h>
5
6#define HEARTBEAT_INVERTED (1 << 0)
7
8struct heartbeat_data {
9 void __iomem *base;
10 unsigned char *bit_pos;
11 unsigned int nr_bits;
12 struct timer_list timer;
13 unsigned int regsize;
14 unsigned long flags;
15};
16
17#endif /* __ASM_SH_HEARTBEAT_H */
diff --git a/include/asm-sh/hw_irq.h b/include/asm-sh/hw_irq.h
index 20d42959f52a..cb0b6c9f7020 100644
--- a/include/asm-sh/hw_irq.h
+++ b/include/asm-sh/hw_irq.h
@@ -6,24 +6,6 @@
6 6
7extern atomic_t irq_err_count; 7extern atomic_t irq_err_count;
8 8
9struct intc2_data {
10 unsigned short irq;
11 unsigned char ipr_offset, ipr_shift;
12 unsigned char msk_offset, msk_shift;
13 unsigned char priority;
14};
15
16struct intc2_desc {
17 unsigned long prio_base;
18 unsigned long msk_base;
19 unsigned long mskclr_base;
20 struct intc2_data *intc2_data;
21 unsigned int nr_irqs;
22 struct irq_chip chip;
23};
24
25void register_intc2_controller(struct intc2_desc *);
26
27struct ipr_data { 9struct ipr_data {
28 unsigned char irq; 10 unsigned char irq;
29 unsigned char ipr_idx; /* Index for the IPR registered */ 11 unsigned char ipr_idx; /* Index for the IPR registered */
@@ -41,11 +23,6 @@ struct ipr_desc {
41 23
42void register_ipr_controller(struct ipr_desc *); 24void register_ipr_controller(struct ipr_desc *);
43 25
44/*
45 * Enable individual interrupt mode for external IPR IRQs.
46 */
47void __init ipr_irq_enable_irlm(void);
48
49typedef unsigned char intc_enum; 26typedef unsigned char intc_enum;
50 27
51struct intc_vect { 28struct intc_vect {
@@ -54,6 +31,7 @@ struct intc_vect {
54}; 31};
55 32
56#define INTC_VECT(enum_id, vect) { enum_id, vect } 33#define INTC_VECT(enum_id, vect) { enum_id, vect }
34#define INTC_IRQ(enum_id, irq) INTC_VECT(enum_id, irq2evt(irq))
57 35
58struct intc_prio { 36struct intc_prio {
59 intc_enum enum_id; 37 intc_enum enum_id;
@@ -64,19 +42,25 @@ struct intc_prio {
64 42
65struct intc_group { 43struct intc_group {
66 intc_enum enum_id; 44 intc_enum enum_id;
67 intc_enum *enum_ids; 45 intc_enum enum_ids[32];
68}; 46};
69 47
70#define INTC_GROUP(enum_id, ids...) { enum_id, (intc_enum []) { ids, 0 } } 48#define INTC_GROUP(enum_id, ids...) { enum_id, { ids } }
71 49
72struct intc_mask_reg { 50struct intc_mask_reg {
73 unsigned long set_reg, clr_reg, reg_width; 51 unsigned long set_reg, clr_reg, reg_width;
74 intc_enum enum_ids[32]; 52 intc_enum enum_ids[32];
53#ifdef CONFIG_SMP
54 unsigned long smp;
55#endif
75}; 56};
76 57
77struct intc_prio_reg { 58struct intc_prio_reg {
78 unsigned long reg, reg_width, field_width; 59 unsigned long set_reg, clr_reg, reg_width, field_width;
79 intc_enum enum_ids[16]; 60 intc_enum enum_ids[16];
61#ifdef CONFIG_SMP
62 unsigned long smp;
63#endif
80}; 64};
81 65
82struct intc_sense_reg { 66struct intc_sense_reg {
@@ -84,6 +68,12 @@ struct intc_sense_reg {
84 intc_enum enum_ids[16]; 68 intc_enum enum_ids[16];
85}; 69};
86 70
71#ifdef CONFIG_SMP
72#define INTC_SMP(stride, nr) .smp = (stride) | ((nr) << 8)
73#else
74#define INTC_SMP(stride, nr)
75#endif
76
87struct intc_desc { 77struct intc_desc {
88 struct intc_vect *vectors; 78 struct intc_vect *vectors;
89 unsigned int nr_vectors; 79 unsigned int nr_vectors;
@@ -97,25 +87,28 @@ struct intc_desc {
97 unsigned int nr_prio_regs; 87 unsigned int nr_prio_regs;
98 struct intc_sense_reg *sense_regs; 88 struct intc_sense_reg *sense_regs;
99 unsigned int nr_sense_regs; 89 unsigned int nr_sense_regs;
100 struct irq_chip chip; 90 char *name;
101}; 91};
102 92
103#define _INTC_ARRAY(a) a, sizeof(a)/sizeof(*a) 93#define _INTC_ARRAY(a) a, sizeof(a)/sizeof(*a)
104#define DECLARE_INTC_DESC(symbol, chipname, vectors, groups, \ 94#define DECLARE_INTC_DESC(symbol, chipname, vectors, groups, \
105 priorities, mask_regs, prio_regs, sense_regs) \ 95 priorities, mask_regs, prio_regs, sense_regs) \
106struct intc_desc symbol = { \ 96struct intc_desc symbol __initdata = { \
107 _INTC_ARRAY(vectors), _INTC_ARRAY(groups), \ 97 _INTC_ARRAY(vectors), _INTC_ARRAY(groups), \
108 _INTC_ARRAY(priorities), \ 98 _INTC_ARRAY(priorities), \
109 _INTC_ARRAY(mask_regs), _INTC_ARRAY(prio_regs), \ 99 _INTC_ARRAY(mask_regs), _INTC_ARRAY(prio_regs), \
110 _INTC_ARRAY(sense_regs), \ 100 _INTC_ARRAY(sense_regs), \
111 .chip.name = chipname, \ 101 chipname, \
112} 102}
113 103
114void __init register_intc_controller(struct intc_desc *desc); 104void __init register_intc_controller(struct intc_desc *desc);
105int intc_set_priority(unsigned int irq, unsigned int prio);
115 106
116void __init plat_irq_setup(void); 107void __init plat_irq_setup(void);
117 108
118enum { IRQ_MODE_IRQ, IRQ_MODE_IRL7654, IRQ_MODE_IRL3210 }; 109enum { IRQ_MODE_IRQ, IRQ_MODE_IRQ7654, IRQ_MODE_IRQ3210,
110 IRQ_MODE_IRL7654_MASK, IRQ_MODE_IRL3210_MASK,
111 IRQ_MODE_IRL7654, IRQ_MODE_IRL3210 };
119void __init plat_irq_setup_pins(int mode); 112void __init plat_irq_setup_pins(int mode);
120 113
121#endif /* __ASM_SH_HW_IRQ_H */ 114#endif /* __ASM_SH_HW_IRQ_H */
diff --git a/include/asm-sh/ilsel.h b/include/asm-sh/ilsel.h
new file mode 100644
index 000000000000..e3d304b280f6
--- /dev/null
+++ b/include/asm-sh/ilsel.h
@@ -0,0 +1,45 @@
1#ifndef __ASM_SH_ILSEL_H
2#define __ASM_SH_ILSEL_H
3
4typedef enum {
5 ILSEL_NONE,
6 ILSEL_LAN,
7 ILSEL_USBH_I,
8 ILSEL_USBH_S,
9 ILSEL_USBH_V,
10 ILSEL_RTC,
11 ILSEL_USBP_I,
12 ILSEL_USBP_S,
13 ILSEL_USBP_V,
14 ILSEL_KEY,
15
16 /*
17 * ILSEL Aliases - corner cases for interleaved level tables.
18 *
19 * Someone thought this was a good idea and less hassle than
20 * demuxing a shared vector, really.
21 */
22
23 /* ILSEL0 and 2 */
24 ILSEL_FPGA0,
25 ILSEL_FPGA1,
26 ILSEL_EX1,
27 ILSEL_EX2,
28 ILSEL_EX3,
29 ILSEL_EX4,
30
31 /* ILSEL1 and 3 */
32 ILSEL_FPGA2 = ILSEL_FPGA0,
33 ILSEL_FPGA3 = ILSEL_FPGA1,
34 ILSEL_EX5 = ILSEL_EX1,
35 ILSEL_EX6 = ILSEL_EX2,
36 ILSEL_EX7 = ILSEL_EX3,
37 ILSEL_EX8 = ILSEL_EX4,
38} ilsel_source_t;
39
40/* arch/sh/boards/renesas/x3proto/ilsel.c */
41int ilsel_enable(ilsel_source_t set);
42int ilsel_enable_fixed(ilsel_source_t set, unsigned int level);
43void ilsel_disable(unsigned int irq);
44
45#endif /* __ASM_SH_ILSEL_H */
diff --git a/include/asm-sh/io.h b/include/asm-sh/io.h
index e6a1877dcb20..1a336cdc75fe 100644
--- a/include/asm-sh/io.h
+++ b/include/asm-sh/io.h
@@ -135,6 +135,32 @@ void __raw_readsl(unsigned long addr, void *data, int longlen);
135# define writel(v,a) ({ __raw_writel((v),(a)); mb(); }) 135# define writel(v,a) ({ __raw_writel((v),(a)); mb(); })
136#endif 136#endif
137 137
138#define __BUILD_MEMORY_STRING(bwlq, type) \
139 \
140static inline void writes##bwlq(volatile void __iomem *mem, \
141 const void *addr, unsigned int count) \
142{ \
143 const volatile type *__addr = addr; \
144 \
145 while (count--) { \
146 __raw_write##bwlq(*__addr, mem); \
147 __addr++; \
148 } \
149} \
150 \
151static inline void reads##bwlq(volatile void __iomem *mem, void *addr, \
152 unsigned int count) \
153{ \
154 volatile type *__addr = addr; \
155 \
156 while (count--) { \
157 *__addr = __raw_read##bwlq(mem); \
158 __addr++; \
159 } \
160}
161
162__BUILD_MEMORY_STRING(b, u8)
163__BUILD_MEMORY_STRING(w, u16)
138#define writesl __raw_writesl 164#define writesl __raw_writesl
139#define readsl __raw_readsl 165#define readsl __raw_readsl
140 166
diff --git a/include/asm-sh/kdebug.h b/include/asm-sh/kdebug.h
index 382cfc7deb73..49cd69051a88 100644
--- a/include/asm-sh/kdebug.h
+++ b/include/asm-sh/kdebug.h
@@ -1,8 +1,6 @@
1#ifndef __ASM_SH_KDEBUG_H 1#ifndef __ASM_SH_KDEBUG_H
2#define __ASM_SH_KDEBUG_H 2#define __ASM_SH_KDEBUG_H
3 3
4#include <linux/notifier.h>
5
6/* Grossly misnamed. */ 4/* Grossly misnamed. */
7enum die_val { 5enum die_val {
8 DIE_TRAP, 6 DIE_TRAP,
diff --git a/include/asm-sh/kgdb.h b/include/asm-sh/kgdb.h
index 74bd0953e5ce..4bc8cb187d11 100644
--- a/include/asm-sh/kgdb.h
+++ b/include/asm-sh/kgdb.h
@@ -17,9 +17,6 @@
17#define __KGDB_H 17#define __KGDB_H
18 18
19#include <asm/ptrace.h> 19#include <asm/ptrace.h>
20#include <asm/cacheflush.h>
21
22struct console;
23 20
24/* Same as pt_regs but has vbr in place of syscall_nr */ 21/* Same as pt_regs but has vbr in place of syscall_nr */
25struct kgdb_regs { 22struct kgdb_regs {
@@ -35,10 +32,7 @@ struct kgdb_regs {
35 32
36/* State info */ 33/* State info */
37extern char kgdb_in_gdb_mode; 34extern char kgdb_in_gdb_mode;
38extern int kgdb_done_init;
39extern int kgdb_enabled;
40extern int kgdb_nofault; /* Ignore bus errors (in gdb mem access) */ 35extern int kgdb_nofault; /* Ignore bus errors (in gdb mem access) */
41extern int kgdb_halt; /* Execute initial breakpoint at startup */
42extern char in_nmi; /* Debounce flag to prevent NMI reentry*/ 36extern char in_nmi; /* Debounce flag to prevent NMI reentry*/
43 37
44/* SCI */ 38/* SCI */
@@ -59,6 +53,7 @@ extern kgdb_debug_hook_t *kgdb_debug_hook;
59extern kgdb_bus_error_hook_t *kgdb_bus_err_hook; 53extern kgdb_bus_error_hook_t *kgdb_bus_err_hook;
60 54
61/* Console */ 55/* Console */
56struct console;
62void kgdb_console_write(struct console *co, const char *s, unsigned count); 57void kgdb_console_write(struct console *co, const char *s, unsigned count);
63extern int kgdb_console_setup(struct console *, char *); 58extern int kgdb_console_setup(struct console *, char *);
64 59
@@ -69,22 +64,7 @@ extern void longjmp(jmp_buf __jmpb, int __retval);
69extern int setjmp(jmp_buf __jmpb); 64extern int setjmp(jmp_buf __jmpb);
70 65
71/* Forced breakpoint */ 66/* Forced breakpoint */
72#define breakpoint() \ 67#define breakpoint() __asm__ __volatile__("trapa #0x3c")
73do { \
74 if (kgdb_enabled) \
75 __asm__ __volatile__("trapa #0x3c"); \
76} while (0)
77
78/* KGDB should be able to flush all kernel text space */
79#if defined(CONFIG_CPU_SH4)
80#define kgdb_flush_icache_range(start, end) \
81{ \
82 __flush_purge_region((void*)(start), (int)(end) - (int)(start));\
83 flush_icache_range((start), (end)); \
84}
85#else
86#define kgdb_flush_icache_range(start, end) do { } while (0)
87#endif
88 68
89/* Taken from sh-stub.c of GDB 4.18 */ 69/* Taken from sh-stub.c of GDB 4.18 */
90static const char hexchars[] = "0123456789abcdef"; 70static const char hexchars[] = "0123456789abcdef";
diff --git a/include/asm-sh/magicpanelr2.h b/include/asm-sh/magicpanelr2.h
new file mode 100644
index 000000000000..c644a77ee357
--- /dev/null
+++ b/include/asm-sh/magicpanelr2.h
@@ -0,0 +1,67 @@
1/*
2 * include/asm-sh/magicpanelr2.h
3 *
4 * Copyright (C) 2007 Markus Brunner, Mark Jonas
5 *
6 * I/O addresses and bitmasks for Magic Panel Release 2 board
7 *
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive
10 * for more details.
11 */
12
13#ifndef __ASM_SH_MAGICPANELR2_H
14#define __ASM_SH_MAGICPANELR2_H
15
16#include <asm/gpio.h>
17
18#define __IO_PREFIX mpr2
19#include <asm/io_generic.h>
20
21
22#define SETBITS_OUTB(mask, reg) ctrl_outb(ctrl_inb(reg) | mask, reg)
23#define SETBITS_OUTW(mask, reg) ctrl_outw(ctrl_inw(reg) | mask, reg)
24#define SETBITS_OUTL(mask, reg) ctrl_outl(ctrl_inl(reg) | mask, reg)
25#define CLRBITS_OUTB(mask, reg) ctrl_outb(ctrl_inb(reg) & ~mask, reg)
26#define CLRBITS_OUTW(mask, reg) ctrl_outw(ctrl_inw(reg) & ~mask, reg)
27#define CLRBITS_OUTL(mask, reg) ctrl_outl(ctrl_inl(reg) & ~mask, reg)
28
29
30#define PA_LED PORT_PADR /* LED */
31
32
33/* BSC */
34#define CMNCR 0xA4FD0000UL
35#define CS0BCR 0xA4FD0004UL
36#define CS2BCR 0xA4FD0008UL
37#define CS3BCR 0xA4FD000CUL
38#define CS4BCR 0xA4FD0010UL
39#define CS5ABCR 0xA4FD0014UL
40#define CS5BBCR 0xA4FD0018UL
41#define CS6ABCR 0xA4FD001CUL
42#define CS6BBCR 0xA4FD0020UL
43#define CS0WCR 0xA4FD0024UL
44#define CS2WCR 0xA4FD0028UL
45#define CS3WCR 0xA4FD002CUL
46#define CS4WCR 0xA4FD0030UL
47#define CS5AWCR 0xA4FD0034UL
48#define CS5BWCR 0xA4FD0038UL
49#define CS6AWCR 0xA4FD003CUL
50#define CS6BWCR 0xA4FD0040UL
51
52
53/* usb */
54
55#define PORT_UTRCTL 0xA405012CUL
56#define PORT_UCLKCR_W 0xA40A0008UL
57
58#define INTC_ICR0 0xA414FEE0UL
59#define INTC_ICR1 0xA4140010UL
60#define INTC_ICR2 0xA4140012UL
61
62/* MTD */
63
64#define MPR2_MTD_BOOTLOADER_SIZE 0x00060000UL
65#define MPR2_MTD_KERNEL_SIZE 0x00200000UL
66
67#endif /* __ASM_SH_MAGICPANELR2_H */
diff --git a/include/asm-sh/page.h b/include/asm-sh/page.h
index 6bc9bba10105..cb3d46c59eab 100644
--- a/include/asm-sh/page.h
+++ b/include/asm-sh/page.h
@@ -70,14 +70,14 @@ extern void clear_page_nommu(void *to);
70extern void copy_page_nommu(void *to, void *from); 70extern void copy_page_nommu(void *to, void *from);
71#endif 71#endif
72 72
73#if defined(CONFIG_MMU) && (defined(CONFIG_CPU_SH4) || \ 73#if !defined(CONFIG_CACHE_OFF) && defined(CONFIG_MMU) && \
74 defined(CONFIG_SH7705_CACHE_32KB)) 74 (defined(CONFIG_CPU_SH4) || defined(CONFIG_SH7705_CACHE_32KB))
75struct page; 75struct page;
76extern void clear_user_page(void *to, unsigned long address, struct page *pg); 76extern void clear_user_page(void *to, unsigned long address, struct page *pg);
77extern void copy_user_page(void *to, void *from, unsigned long address, struct page *pg); 77extern void copy_user_page(void *to, void *from, unsigned long address, struct page *pg);
78extern void __clear_user_page(void *to, void *orig_to); 78extern void __clear_user_page(void *to, void *orig_to);
79extern void __copy_user_page(void *to, void *from, void *orig_to); 79extern void __copy_user_page(void *to, void *from, void *orig_to);
80#elif defined(CONFIG_CPU_SH2) || defined(CONFIG_CPU_SH3) || !defined(CONFIG_MMU) 80#else
81#define clear_user_page(page, vaddr, pg) clear_page(page) 81#define clear_user_page(page, vaddr, pg) clear_page(page)
82#define copy_user_page(to, from, vaddr, pg) copy_page(to, from) 82#define copy_user_page(to, from, vaddr, pg) copy_page(to, from)
83#endif 83#endif
@@ -88,6 +88,7 @@ extern void __copy_user_page(void *to, void *from, void *orig_to);
88#ifdef CONFIG_X2TLB 88#ifdef CONFIG_X2TLB
89typedef struct { unsigned long pte_low, pte_high; } pte_t; 89typedef struct { unsigned long pte_low, pte_high; } pte_t;
90typedef struct { unsigned long long pgprot; } pgprot_t; 90typedef struct { unsigned long long pgprot; } pgprot_t;
91typedef struct { unsigned long long pgd; } pgd_t;
91#define pte_val(x) \ 92#define pte_val(x) \
92 ((x).pte_low | ((unsigned long long)(x).pte_high << 32)) 93 ((x).pte_low | ((unsigned long long)(x).pte_high << 32))
93#define __pte(x) \ 94#define __pte(x) \
@@ -95,12 +96,11 @@ typedef struct { unsigned long long pgprot; } pgprot_t;
95#else 96#else
96typedef struct { unsigned long pte_low; } pte_t; 97typedef struct { unsigned long pte_low; } pte_t;
97typedef struct { unsigned long pgprot; } pgprot_t; 98typedef struct { unsigned long pgprot; } pgprot_t;
99typedef struct { unsigned long pgd; } pgd_t;
98#define pte_val(x) ((x).pte_low) 100#define pte_val(x) ((x).pte_low)
99#define __pte(x) ((pte_t) { (x) } ) 101#define __pte(x) ((pte_t) { (x) } )
100#endif 102#endif
101 103
102typedef struct { unsigned long pgd; } pgd_t;
103
104#define pgd_val(x) ((x).pgd) 104#define pgd_val(x) ((x).pgd)
105#define pgprot_val(x) ((x).pgprot) 105#define pgprot_val(x) ((x).pgprot)
106 106
diff --git a/include/asm-sh/pgtable.h b/include/asm-sh/pgtable.h
index e3fae12c0e49..cf0dd2b648c2 100644
--- a/include/asm-sh/pgtable.h
+++ b/include/asm-sh/pgtable.h
@@ -42,13 +42,12 @@ extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)];
42 42
43/* PGD bits */ 43/* PGD bits */
44#define PGDIR_SHIFT (PTE_SHIFT + PTE_BITS) 44#define PGDIR_SHIFT (PTE_SHIFT + PTE_BITS)
45#define PGDIR_BITS (32 - PGDIR_SHIFT)
46#define PGDIR_SIZE (1UL << PGDIR_SHIFT) 45#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
47#define PGDIR_MASK (~(PGDIR_SIZE-1)) 46#define PGDIR_MASK (~(PGDIR_SIZE-1))
48 47
49/* Entries per level */ 48/* Entries per level */
50#define PTRS_PER_PTE (PAGE_SIZE / (1 << PTE_MAGNITUDE)) 49#define PTRS_PER_PTE (PAGE_SIZE / (1 << PTE_MAGNITUDE))
51#define PTRS_PER_PGD (PAGE_SIZE / 4) 50#define PTRS_PER_PGD (PAGE_SIZE / sizeof(pgd_t))
52 51
53#define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE) 52#define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE)
54#define FIRST_USER_ADDRESS 0 53#define FIRST_USER_ADDRESS 0
@@ -100,17 +99,18 @@ extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)];
100#define _PAGE_HW_SHARED 0x002 /* SH-bit : shared among processes */ 99#define _PAGE_HW_SHARED 0x002 /* SH-bit : shared among processes */
101#define _PAGE_DIRTY 0x004 /* D-bit : page changed */ 100#define _PAGE_DIRTY 0x004 /* D-bit : page changed */
102#define _PAGE_CACHABLE 0x008 /* C-bit : cachable */ 101#define _PAGE_CACHABLE 0x008 /* C-bit : cachable */
103#ifndef CONFIG_X2TLB 102#define _PAGE_SZ0 0x010 /* SZ0-bit : Size of page */
104# define _PAGE_SZ0 0x010 /* SZ0-bit : Size of page */ 103#define _PAGE_RW 0x020 /* PR0-bit : write access allowed */
105# define _PAGE_RW 0x020 /* PR0-bit : write access allowed */ 104#define _PAGE_USER 0x040 /* PR1-bit : user space access allowed*/
106# define _PAGE_USER 0x040 /* PR1-bit : user space access allowed*/ 105#define _PAGE_SZ1 0x080 /* SZ1-bit : Size of page (on SH-4) */
107# define _PAGE_SZ1 0x080 /* SZ1-bit : Size of page (on SH-4) */
108#endif
109#define _PAGE_PRESENT 0x100 /* V-bit : page is valid */ 106#define _PAGE_PRESENT 0x100 /* V-bit : page is valid */
110#define _PAGE_PROTNONE 0x200 /* software: if not present */ 107#define _PAGE_PROTNONE 0x200 /* software: if not present */
111#define _PAGE_ACCESSED 0x400 /* software: page referenced */ 108#define _PAGE_ACCESSED 0x400 /* software: page referenced */
112#define _PAGE_FILE _PAGE_WT /* software: pagecache or swap? */ 109#define _PAGE_FILE _PAGE_WT /* software: pagecache or swap? */
113 110
111#define _PAGE_SZ_MASK (_PAGE_SZ0 | _PAGE_SZ1)
112#define _PAGE_PR_MASK (_PAGE_RW | _PAGE_USER)
113
114/* Extended mode bits */ 114/* Extended mode bits */
115#define _PAGE_EXT_ESZ0 0x0010 /* ESZ0-bit: Size of page */ 115#define _PAGE_EXT_ESZ0 0x0010 /* ESZ0-bit: Size of page */
116#define _PAGE_EXT_ESZ1 0x0020 /* ESZ1-bit: Size of page */ 116#define _PAGE_EXT_ESZ1 0x0020 /* ESZ1-bit: Size of page */
@@ -126,11 +126,7 @@ extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)];
126#define _PAGE_EXT_KERN_READ 0x2000 /* EPR5-bit: Kernel space readable */ 126#define _PAGE_EXT_KERN_READ 0x2000 /* EPR5-bit: Kernel space readable */
127 127
128/* Wrapper for extended mode pgprot twiddling */ 128/* Wrapper for extended mode pgprot twiddling */
129#ifdef CONFIG_X2TLB 129#define _PAGE_EXT(x) ((unsigned long long)(x) << 32)
130# define _PAGE_EXT(x) ((unsigned long long)(x) << 32)
131#else
132# define _PAGE_EXT(x) (0)
133#endif
134 130
135/* software: moves to PTEA.TC (Timing Control) */ 131/* software: moves to PTEA.TC (Timing Control) */
136#define _PAGE_PCC_AREA5 0x00000000 /* use BSC registers for area5 */ 132#define _PAGE_PCC_AREA5 0x00000000 /* use BSC registers for area5 */
@@ -146,10 +142,14 @@ extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)];
146#define _PAGE_PCC_ATR16 0x60000001 /* Attribute Memory space, 6 bit bus */ 142#define _PAGE_PCC_ATR16 0x60000001 /* Attribute Memory space, 6 bit bus */
147 143
148/* Mask which drops unused bits from the PTEL value */ 144/* Mask which drops unused bits from the PTEL value */
149#ifdef CONFIG_CPU_SH3 145#if defined(CONFIG_CPU_SH3)
150#define _PAGE_CLEAR_FLAGS (_PAGE_PROTNONE | _PAGE_ACCESSED| \ 146#define _PAGE_CLEAR_FLAGS (_PAGE_PROTNONE | _PAGE_ACCESSED| \
151 _PAGE_FILE | _PAGE_SZ1 | \ 147 _PAGE_FILE | _PAGE_SZ1 | \
152 _PAGE_HW_SHARED) 148 _PAGE_HW_SHARED)
149#elif defined(CONFIG_X2TLB)
150/* Get rid of the legacy PR/SZ bits when using extended mode */
151#define _PAGE_CLEAR_FLAGS (_PAGE_PROTNONE | _PAGE_ACCESSED | \
152 _PAGE_FILE | _PAGE_PR_MASK | _PAGE_SZ_MASK)
153#else 153#else
154#define _PAGE_CLEAR_FLAGS (_PAGE_PROTNONE | _PAGE_ACCESSED | _PAGE_FILE) 154#define _PAGE_CLEAR_FLAGS (_PAGE_PROTNONE | _PAGE_ACCESSED | _PAGE_FILE)
155#endif 155#endif
@@ -212,27 +212,36 @@ extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)];
212 212
213#define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED | \ 213#define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED | \
214 _PAGE_CACHABLE | _PAGE_FLAGS_HARD | \ 214 _PAGE_CACHABLE | _PAGE_FLAGS_HARD | \
215 _PAGE_EXT(_PAGE_EXT_USER_READ | \ 215 _PAGE_EXT(_PAGE_EXT_KERN_READ | \
216 _PAGE_EXT_KERN_WRITE | \
217 _PAGE_EXT_USER_READ | \
216 _PAGE_EXT_USER_WRITE)) 218 _PAGE_EXT_USER_WRITE))
217 219
218#define PAGE_EXECREAD __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED | \ 220#define PAGE_EXECREAD __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED | \
219 _PAGE_CACHABLE | _PAGE_FLAGS_HARD | \ 221 _PAGE_CACHABLE | _PAGE_FLAGS_HARD | \
220 _PAGE_EXT(_PAGE_EXT_USER_EXEC | \ 222 _PAGE_EXT(_PAGE_EXT_KERN_EXEC | \
223 _PAGE_EXT_KERN_READ | \
224 _PAGE_EXT_USER_EXEC | \
221 _PAGE_EXT_USER_READ)) 225 _PAGE_EXT_USER_READ))
222 226
223#define PAGE_COPY PAGE_EXECREAD 227#define PAGE_COPY PAGE_EXECREAD
224 228
225#define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED | \ 229#define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED | \
226 _PAGE_CACHABLE | _PAGE_FLAGS_HARD | \ 230 _PAGE_CACHABLE | _PAGE_FLAGS_HARD | \
227 _PAGE_EXT(_PAGE_EXT_USER_READ)) 231 _PAGE_EXT(_PAGE_EXT_KERN_READ | \
232 _PAGE_EXT_USER_READ))
228 233
229#define PAGE_WRITEONLY __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED | \ 234#define PAGE_WRITEONLY __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED | \
230 _PAGE_CACHABLE | _PAGE_FLAGS_HARD | \ 235 _PAGE_CACHABLE | _PAGE_FLAGS_HARD | \
231 _PAGE_EXT(_PAGE_EXT_USER_WRITE)) 236 _PAGE_EXT(_PAGE_EXT_KERN_WRITE | \
237 _PAGE_EXT_USER_WRITE))
232 238
233#define PAGE_RWX __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED | \ 239#define PAGE_RWX __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED | \
234 _PAGE_CACHABLE | _PAGE_FLAGS_HARD | \ 240 _PAGE_CACHABLE | _PAGE_FLAGS_HARD | \
235 _PAGE_EXT(_PAGE_EXT_USER_WRITE | \ 241 _PAGE_EXT(_PAGE_EXT_KERN_WRITE | \
242 _PAGE_EXT_KERN_READ | \
243 _PAGE_EXT_KERN_EXEC | \
244 _PAGE_EXT_USER_WRITE | \
236 _PAGE_EXT_USER_READ | \ 245 _PAGE_EXT_USER_READ | \
237 _PAGE_EXT_USER_EXEC)) 246 _PAGE_EXT_USER_EXEC))
238 247
@@ -373,11 +382,15 @@ static inline void set_pte(pte_t *ptep, pte_t pte)
373#define set_pmd(pmdptr, pmdval) (*(pmdptr) = pmdval) 382#define set_pmd(pmdptr, pmdval) (*(pmdptr) = pmdval)
374 383
375#define pte_pfn(x) ((unsigned long)(((x).pte_low >> PAGE_SHIFT))) 384#define pte_pfn(x) ((unsigned long)(((x).pte_low >> PAGE_SHIFT)))
376#define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
377#define pfn_pmd(pfn, prot) __pmd(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
378 385
379#define pte_none(x) (!pte_val(x)) 386#define pfn_pte(pfn, prot) \
380#define pte_present(x) (pte_val(x) & (_PAGE_PRESENT | _PAGE_PROTNONE)) 387 __pte(((unsigned long long)(pfn) << PAGE_SHIFT) | pgprot_val(prot))
388#define pfn_pmd(pfn, prot) \
389 __pmd(((unsigned long long)(pfn) << PAGE_SHIFT) | pgprot_val(prot))
390
391#define pte_none(x) (!pte_val(x))
392#define pte_present(x) ((x).pte_low & (_PAGE_PRESENT | _PAGE_PROTNONE))
393
381#define pte_clear(mm,addr,xp) do { set_pte_at(mm, addr, xp, __pte(0)); } while (0) 394#define pte_clear(mm,addr,xp) do { set_pte_at(mm, addr, xp, __pte(0)); } while (0)
382 395
383#define pmd_none(x) (!pmd_val(x)) 396#define pmd_none(x) (!pmd_val(x))
@@ -392,15 +405,15 @@ static inline void set_pte(pte_t *ptep, pte_t pte)
392 * The following only work if pte_present() is true. 405 * The following only work if pte_present() is true.
393 * Undefined behaviour if not.. 406 * Undefined behaviour if not..
394 */ 407 */
395#define pte_not_present(pte) (!(pte_val(pte) & _PAGE_PRESENT)) 408#define pte_not_present(pte) (!((pte).pte_low & _PAGE_PRESENT))
396#define pte_dirty(pte) (pte_val(pte) & _PAGE_DIRTY) 409#define pte_dirty(pte) ((pte).pte_low & _PAGE_DIRTY)
397#define pte_young(pte) (pte_val(pte) & _PAGE_ACCESSED) 410#define pte_young(pte) ((pte).pte_low & _PAGE_ACCESSED)
398#define pte_file(pte) (pte_val(pte) & _PAGE_FILE) 411#define pte_file(pte) ((pte).pte_low & _PAGE_FILE)
399 412
400#ifdef CONFIG_X2TLB 413#ifdef CONFIG_X2TLB
401#define pte_write(pte) ((pte).pte_high & _PAGE_EXT_USER_WRITE) 414#define pte_write(pte) ((pte).pte_high & _PAGE_EXT_USER_WRITE)
402#else 415#else
403#define pte_write(pte) (pte_val(pte) & _PAGE_RW) 416#define pte_write(pte) ((pte).pte_low & _PAGE_RW)
404#endif 417#endif
405 418
406#define PTE_BIT_FUNC(h,fn,op) \ 419#define PTE_BIT_FUNC(h,fn,op) \
@@ -429,17 +442,10 @@ PTE_BIT_FUNC(low, mkyoung, |= _PAGE_ACCESSED);
429/* 442/*
430 * Macro and implementation to make a page protection as uncachable. 443 * Macro and implementation to make a page protection as uncachable.
431 */ 444 */
432#define pgprot_noncached pgprot_noncached 445#define pgprot_writecombine(prot) \
446 __pgprot(pgprot_val(prot) & ~_PAGE_CACHABLE)
433 447
434static inline pgprot_t pgprot_noncached(pgprot_t _prot) 448#define pgprot_noncached pgprot_writecombine
435{
436 unsigned long prot = pgprot_val(_prot);
437
438 prot &= ~_PAGE_CACHABLE;
439 return __pgprot(prot);
440}
441
442#define pgprot_writecombine(prot) __pgprot(pgprot_val(prot) & ~_PAGE_CACHABLE)
443 449
444/* 450/*
445 * Conversion functions: convert a page and protection to a page entry, 451 * Conversion functions: convert a page and protection to a page entry,
@@ -451,28 +457,33 @@ static inline pgprot_t pgprot_noncached(pgprot_t _prot)
451 457
452static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) 458static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
453{ 459{
454 set_pte(&pte, __pte((pte_val(pte) & _PAGE_CHG_MASK) | 460 pte.pte_low &= _PAGE_CHG_MASK;
455 pgprot_val(newprot))); 461 pte.pte_low |= pgprot_val(newprot);
462
463#ifdef CONFIG_X2TLB
464 pte.pte_high |= pgprot_val(newprot) >> 32;
465#endif
466
456 return pte; 467 return pte;
457} 468}
458 469
459#define pmd_page_vaddr(pmd) pmd_val(pmd) 470#define pmd_page_vaddr(pmd) ((unsigned long)pmd_val(pmd))
460#define pmd_page(pmd) (virt_to_page(pmd_val(pmd))) 471#define pmd_page(pmd) (virt_to_page(pmd_val(pmd)))
461 472
462/* to find an entry in a page-table-directory. */ 473/* to find an entry in a page-table-directory. */
463#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) 474#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
464#define pgd_offset(mm, address) ((mm)->pgd+pgd_index(address)) 475#define pgd_offset(mm, address) ((mm)->pgd+pgd_index(address))
465 476
466/* to find an entry in a kernel page-table-directory */ 477/* to find an entry in a kernel page-table-directory */
467#define pgd_offset_k(address) pgd_offset(&init_mm, address) 478#define pgd_offset_k(address) pgd_offset(&init_mm, address)
468 479
469/* Find an entry in the third-level page table.. */ 480/* Find an entry in the third-level page table.. */
470#define pte_index(address) \ 481#define pte_index(address) ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
471 ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
472#define pte_offset_kernel(dir, address) \ 482#define pte_offset_kernel(dir, address) \
473 ((pte_t *) pmd_page_vaddr(*(dir)) + pte_index(address)) 483 ((pte_t *) pmd_page_vaddr(*(dir)) + pte_index(address))
474#define pte_offset_map(dir, address) pte_offset_kernel(dir, address) 484#define pte_offset_map(dir, address) pte_offset_kernel(dir, address)
475#define pte_offset_map_nested(dir, address) pte_offset_kernel(dir, address) 485#define pte_offset_map_nested(dir, address) pte_offset_kernel(dir, address)
486
476#define pte_unmap(pte) do { } while (0) 487#define pte_unmap(pte) do { } while (0)
477#define pte_unmap_nested(pte) do { } while (0) 488#define pte_unmap_nested(pte) do { } while (0)
478 489
@@ -480,13 +491,14 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
480#define pte_ERROR(e) \ 491#define pte_ERROR(e) \
481 printk("%s:%d: bad pte %p(%08lx%08lx).\n", __FILE__, __LINE__, \ 492 printk("%s:%d: bad pte %p(%08lx%08lx).\n", __FILE__, __LINE__, \
482 &(e), (e).pte_high, (e).pte_low) 493 &(e), (e).pte_high, (e).pte_low)
494#define pgd_ERROR(e) \
495 printk("%s:%d: bad pgd %016llx.\n", __FILE__, __LINE__, pgd_val(e))
483#else 496#else
484#define pte_ERROR(e) \ 497#define pte_ERROR(e) \
485 printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e)) 498 printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e))
486#endif
487
488#define pgd_ERROR(e) \ 499#define pgd_ERROR(e) \
489 printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e)) 500 printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))
501#endif
490 502
491struct vm_area_struct; 503struct vm_area_struct;
492extern void update_mmu_cache(struct vm_area_struct * vma, 504extern void update_mmu_cache(struct vm_area_struct * vma,
@@ -563,7 +575,8 @@ struct mm_struct;
563extern unsigned int kobjsize(const void *objp); 575extern unsigned int kobjsize(const void *objp);
564#endif /* !CONFIG_MMU */ 576#endif /* !CONFIG_MMU */
565 577
566#if defined(CONFIG_CPU_SH4) || defined(CONFIG_SH7705_CACHE_32KB) 578#if !defined(CONFIG_CACHE_OFF) && (defined(CONFIG_CPU_SH4) || \
579 defined(CONFIG_SH7705_CACHE_32KB))
567#define __HAVE_ARCH_PTEP_GET_AND_CLEAR 580#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
568extern pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep); 581extern pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep);
569#endif 582#endif
diff --git a/include/asm-sh/processor.h b/include/asm-sh/processor.h
index 26d52174f4b4..4f2922a1979c 100644
--- a/include/asm-sh/processor.h
+++ b/include/asm-sh/processor.h
@@ -45,7 +45,7 @@ enum cpu_type {
45 CPU_SH7705, CPU_SH7706, CPU_SH7707, 45 CPU_SH7705, CPU_SH7706, CPU_SH7707,
46 CPU_SH7708, CPU_SH7708S, CPU_SH7708R, 46 CPU_SH7708, CPU_SH7708S, CPU_SH7708R,
47 CPU_SH7709, CPU_SH7709A, CPU_SH7710, CPU_SH7712, 47 CPU_SH7709, CPU_SH7709A, CPU_SH7710, CPU_SH7712,
48 CPU_SH7729, 48 CPU_SH7720, CPU_SH7729,
49 49
50 /* SH-4 types */ 50 /* SH-4 types */
51 CPU_SH7750, CPU_SH7750S, CPU_SH7750R, CPU_SH7751, CPU_SH7751R, 51 CPU_SH7750, CPU_SH7750S, CPU_SH7750R, CPU_SH7751, CPU_SH7751R,
@@ -73,15 +73,10 @@ struct sh_cpuinfo {
73 unsigned long flags; 73 unsigned long flags;
74} __attribute__ ((aligned(SMP_CACHE_BYTES))); 74} __attribute__ ((aligned(SMP_CACHE_BYTES)));
75 75
76extern struct sh_cpuinfo boot_cpu_data;
77
78#ifdef CONFIG_SMP
79extern struct sh_cpuinfo cpu_data[]; 76extern struct sh_cpuinfo cpu_data[];
77#define boot_cpu_data cpu_data[0]
80#define current_cpu_data cpu_data[smp_processor_id()] 78#define current_cpu_data cpu_data[smp_processor_id()]
81#else 79#define raw_current_cpu_data cpu_data[raw_smp_processor_id()]
82#define cpu_data (&boot_cpu_data)
83#define current_cpu_data boot_cpu_data
84#endif
85 80
86/* 81/*
87 * User space process size: 2GB. 82 * User space process size: 2GB.
diff --git a/include/asm-sh/r7780rp.h b/include/asm-sh/r7780rp.h
index 4083b5949928..de37f933aa42 100644
--- a/include/asm-sh/r7780rp.h
+++ b/include/asm-sh/r7780rp.h
@@ -65,24 +65,6 @@
65#define PA_PMR (PA_BCR+0x0900) /* */ 65#define PA_PMR (PA_BCR+0x0900) /* */
66 66
67#define IRLCNTR1 (PA_BCR + 0) /* Interrupt Control Register1 */ 67#define IRLCNTR1 (PA_BCR + 0) /* Interrupt Control Register1 */
68
69#define IRQ_PCISLOT1 65 /* PCI Slot #1 IRQ */
70#define IRQ_PCISLOT2 66 /* PCI Slot #2 IRQ */
71#define IRQ_PCISLOT3 67 /* PCI Slot #3 IRQ */
72#define IRQ_PCISLOT4 68 /* PCI Slot #4 IRQ */
73#define IRQ_TP 2 /* Touch Panel IRQ */
74#define IRQ_SCI1 3 /* SCI1 IRQ */
75#define IRQ_SCI0 4 /* SCI0 IRQ */
76#define IRQ_2SERIAL 5 /* Serial IRQ */
77#define IRQ_RTC 6 /* RTC A / B IRQ */
78#define IRQ_EXTENTION6 7 /* EXT6n IRQ */
79#define IRQ_EXTENTION5 8 /* EXT5n IRQ */
80#define IRQ_EXTENTION4 9 /* EXT4n IRQ */
81#define IRQ_EXTENTION2 10 /* EXT2n IRQ */
82#define IRQ_EXTENTION1 11 /* EXT1n IRQ */
83#define IRQ_ONETH 13 /* On board Ethernet IRQ */
84#define IRQ_PSW 14 /* Push Switch IRQ */
85
86#define IVDR_CK_ON 8 /* iVDR Clock ON */ 68#define IVDR_CK_ON 8 /* iVDR Clock ON */
87 69
88#elif defined(CONFIG_SH_R7780RP) 70#elif defined(CONFIG_SH_R7780RP)
@@ -203,11 +185,24 @@
203#define PA_MMSR (PA_BCR+0x0400) 185#define PA_MMSR (PA_BCR+0x0400)
204 186
205#define IVDR_CK_ON 4 /* iVDR Clock ON */ 187#define IVDR_CK_ON 4 /* iVDR Clock ON */
188#endif
206 189
190#define HL_FPGA_IRQ_BASE 200
191#define HL_NR_IRL 15
192
193#define IRQ_AX88796 (HL_FPGA_IRQ_BASE + 0)
194#define IRQ_CF (HL_FPGA_IRQ_BASE + 1)
195#ifndef IRQ_PSW
196#define IRQ_PSW (HL_FPGA_IRQ_BASE + 2)
207#endif 197#endif
198#define IRQ_EXT1 (HL_FPGA_IRQ_BASE + 3)
199#define IRQ_EXT4 (HL_FPGA_IRQ_BASE + 4)
208 200
209void make_r7780rp_irq(unsigned int irq); 201void make_r7780rp_irq(unsigned int irq);
210void highlander_init_irq(void); 202
203unsigned char *highlander_init_irq_r7780mp(void);
204unsigned char *highlander_init_irq_r7780rp(void);
205unsigned char *highlander_init_irq_r7785rp(void);
211 206
212#define __IO_PREFIX r7780rp 207#define __IO_PREFIX r7780rp
213#include <asm/io_generic.h> 208#include <asm/io_generic.h>
diff --git a/include/asm-sh/rtc.h b/include/asm-sh/rtc.h
index 91aacc96151b..858da99d37e0 100644
--- a/include/asm-sh/rtc.h
+++ b/include/asm-sh/rtc.h
@@ -5,4 +5,10 @@ extern void (*board_time_init)(void);
5extern void (*rtc_sh_get_time)(struct timespec *); 5extern void (*rtc_sh_get_time)(struct timespec *);
6extern int (*rtc_sh_set_time)(const time_t); 6extern int (*rtc_sh_set_time)(const time_t);
7 7
8#define RTC_CAP_4_DIGIT_YEAR (1 << 0)
9
10struct sh_rtc_platform_info {
11 unsigned long capabilities;
12};
13
8#endif /* _ASM_RTC_H */ 14#endif /* _ASM_RTC_H */
diff --git a/include/asm-sh/rts7751r2d.h b/include/asm-sh/rts7751r2d.h
index 5d7800aa31b5..83b9c111f171 100644
--- a/include/asm-sh/rts7751r2d.h
+++ b/include/asm-sh/rts7751r2d.h
@@ -9,7 +9,7 @@
9 * Renesas Technology Sales RTS7751R2D support 9 * Renesas Technology Sales RTS7751R2D support
10 */ 10 */
11 11
12/* Box specific addresses. */ 12/* Board specific addresses. */
13 13
14#define PA_BCR 0xa4000000 /* FPGA */ 14#define PA_BCR 0xa4000000 /* FPGA */
15#define PA_IRLMON 0xa4000002 /* Interrupt Status control */ 15#define PA_IRLMON 0xa4000002 /* Interrupt Status control */
@@ -20,19 +20,19 @@
20#define PA_RTCCE 0xa400000c /* RTC(9701) Enable control */ 20#define PA_RTCCE 0xa400000c /* RTC(9701) Enable control */
21#define PA_PCICD 0xa400000e /* PCI Extention detect control */ 21#define PA_PCICD 0xa400000e /* PCI Extention detect control */
22#define PA_VOYAGERRTS 0xa4000020 /* VOYAGER Reset control */ 22#define PA_VOYAGERRTS 0xa4000020 /* VOYAGER Reset control */
23#if defined(CONFIG_RTS7751R2D_REV11) 23
24#define PA_AXRST 0xa4000022 /* AX_LAN Reset control */ 24#define PA_R2D1_AXRST 0xa4000022 /* AX_LAN Reset control */
25#define PA_CFRST 0xa4000024 /* CF Reset control */ 25#define PA_R2D1_CFRST 0xa4000024 /* CF Reset control */
26#define PA_ADMRTS 0xa4000026 /* SD Reset control */ 26#define PA_R2D1_ADMRTS 0xa4000026 /* SD Reset control */
27#define PA_EXTRST 0xa4000028 /* Extention Reset control */ 27#define PA_R2D1_EXTRST 0xa4000028 /* Extention Reset control */
28#define PA_CFCDINTCLR 0xa400002a /* CF Insert Interrupt clear */ 28#define PA_R2D1_CFCDINTCLR 0xa400002a /* CF Insert Interrupt clear */
29#else 29
30#define PA_CFRST 0xa4000022 /* CF Reset control */ 30#define PA_R2DPLUS_CFRST 0xa4000022 /* CF Reset control */
31#define PA_ADMRTS 0xa4000024 /* SD Reset control */ 31#define PA_R2DPLUS_ADMRTS 0xa4000024 /* SD Reset control */
32#define PA_EXTRST 0xa4000026 /* Extention Reset control */ 32#define PA_R2DPLUS_EXTRST 0xa4000026 /* Extention Reset control */
33#define PA_CFCDINTCLR 0xa4000028 /* CF Insert Interrupt clear */ 33#define PA_R2DPLUS_CFCDINTCLR 0xa4000028 /* CF Insert Interrupt clear */
34#define PA_KEYCTLCLR 0xa400002a /* Key Interrupt clear */ 34#define PA_R2DPLUS_KEYCTLCLR 0xa400002a /* Key Interrupt clear */
35#endif 35
36#define PA_POWOFF 0xa4000030 /* Board Power OFF control */ 36#define PA_POWOFF 0xa4000030 /* Board Power OFF control */
37#define PA_VERREG 0xa4000032 /* FPGA Version Register */ 37#define PA_VERREG 0xa4000032 /* FPGA Version Register */
38#define PA_INPORT 0xa4000034 /* KEY Input Port control */ 38#define PA_INPORT 0xa4000034 /* KEY Input Port control */
@@ -46,27 +46,22 @@
46 46
47#define IRLCNTR1 (PA_BCR + 0) /* Interrupt Control Register1 */ 47#define IRLCNTR1 (PA_BCR + 0) /* Interrupt Control Register1 */
48 48
49#if defined(CONFIG_RTS7751R2D_REV11) 49#define R2D_FPGA_IRQ_BASE 100
50#define IRQ_PCIETH 0 /* PCI Ethernet IRQ */ 50
51#define IRQ_CFCARD 1 /* CF Card IRQ */ 51#define IRQ_VOYAGER (R2D_FPGA_IRQ_BASE + 0)
52#define IRQ_CFINST 2 /* CF Card Insert IRQ */ 52#define IRQ_EXT (R2D_FPGA_IRQ_BASE + 1)
53#define IRQ_PCMCIA 3 /* PCMCIA IRQ */ 53#define IRQ_TP (R2D_FPGA_IRQ_BASE + 2)
54#define IRQ_VOYAGER 4 /* VOYAGER IRQ */ 54#define IRQ_RTC_T (R2D_FPGA_IRQ_BASE + 3)
55#define IRQ_ONETH 5 /* On board Ethernet IRQ */ 55#define IRQ_RTC_A (R2D_FPGA_IRQ_BASE + 4)
56#else 56#define IRQ_SDCARD (R2D_FPGA_IRQ_BASE + 5)
57#define IRQ_KEYIN 0 /* Key Input IRQ */ 57#define IRQ_CF_CD (R2D_FPGA_IRQ_BASE + 6)
58#define IRQ_PCIETH 1 /* PCI Ethernet IRQ */ 58#define IRQ_CF_IDE (R2D_FPGA_IRQ_BASE + 7)
59#define IRQ_CFCARD 2 /* CF Card IRQ */ 59#define IRQ_AX88796 (R2D_FPGA_IRQ_BASE + 8)
60#define IRQ_CFINST 3 /* CF Card Insert IRQ */ 60#define IRQ_KEY (R2D_FPGA_IRQ_BASE + 9)
61#define IRQ_PCMCIA 4 /* PCMCIA IRQ */ 61#define IRQ_PCI_INTA (R2D_FPGA_IRQ_BASE + 10)
62#define IRQ_VOYAGER 5 /* VOYAGER IRQ */ 62#define IRQ_PCI_INTB (R2D_FPGA_IRQ_BASE + 11)
63#endif 63#define IRQ_PCI_INTC (R2D_FPGA_IRQ_BASE + 12)
64#define IRQ_RTCALM 6 /* RTC Alarm IRQ */ 64#define IRQ_PCI_INTD (R2D_FPGA_IRQ_BASE + 13)
65#define IRQ_RTCTIME 7 /* RTC Timer IRQ */
66#define IRQ_SDCARD 8 /* SD Card IRQ */
67#define IRQ_PCISLOT1 9 /* PCI Slot #1 IRQ */
68#define IRQ_PCISLOT2 10 /* PCI Slot #2 IRQ */
69#define IRQ_EXTENTION 11 /* EXTn IRQ */
70 65
71/* arch/sh/boards/renesas/rts7751r2d/irq.c */ 66/* arch/sh/boards/renesas/rts7751r2d/irq.c */
72void init_rts7751r2d_IRQ(void); 67void init_rts7751r2d_IRQ(void);
diff --git a/include/asm-sh/sections.h b/include/asm-sh/sections.h
index 2a696b8ee4f5..bd9cbc967c2a 100644
--- a/include/asm-sh/sections.h
+++ b/include/asm-sh/sections.h
@@ -4,6 +4,7 @@
4#include <asm-generic/sections.h> 4#include <asm-generic/sections.h>
5 5
6extern long __machvec_start, __machvec_end; 6extern long __machvec_start, __machvec_end;
7extern char _ebss[];
7 8
8#endif /* __ASM_SH_SECTIONS_H */ 9#endif /* __ASM_SH_SECTIONS_H */
9 10
diff --git a/include/asm-sh/sh03/io.h b/include/asm-sh/sh03/io.h
index 4ff1eb900301..c39c785bba94 100644
--- a/include/asm-sh/sh03/io.h
+++ b/include/asm-sh/sh03/io.h
@@ -11,22 +11,13 @@
11 11
12#include <linux/time.h> 12#include <linux/time.h>
13 13
14#define INTC_IPRD 0xffd00010UL
15
16#define IRL0_IRQ 2 14#define IRL0_IRQ 2
17#define IRL0_IPR_POS 3
18#define IRL0_PRIORITY 13 15#define IRL0_PRIORITY 13
19
20#define IRL1_IRQ 5 16#define IRL1_IRQ 5
21#define IRL1_IPR_POS 2
22#define IRL1_PRIORITY 10 17#define IRL1_PRIORITY 10
23
24#define IRL2_IRQ 8 18#define IRL2_IRQ 8
25#define IRL2_IPR_POS 1
26#define IRL2_PRIORITY 7 19#define IRL2_PRIORITY 7
27
28#define IRL3_IRQ 11 20#define IRL3_IRQ 11
29#define IRL3_IPR_POS 0
30#define IRL3_PRIORITY 4 21#define IRL3_PRIORITY 4
31 22
32void heartbeat_sh03(void); 23void heartbeat_sh03(void);
diff --git a/include/asm-sh/smp.h b/include/asm-sh/smp.h
index b99ca786c0c1..9c8d34b07ebf 100644
--- a/include/asm-sh/smp.h
+++ b/include/asm-sh/smp.h
@@ -1,12 +1,3 @@
1/*
2 * include/asm-sh/smp.h
3 *
4 * Copyright (C) 2002, 2003 Paul Mundt
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive for
8 * more details.
9 */
10#ifndef __ASM_SH_SMP_H 1#ifndef __ASM_SH_SMP_H
11#define __ASM_SH_SMP_H 2#define __ASM_SH_SMP_H
12 3
@@ -20,6 +11,15 @@
20#include <asm/current.h> 11#include <asm/current.h>
21 12
22#define raw_smp_processor_id() (current_thread_info()->cpu) 13#define raw_smp_processor_id() (current_thread_info()->cpu)
14#define hard_smp_processor_id() plat_smp_processor_id()
15
16/* Map from cpu id to sequential logical cpu number. */
17extern int __cpu_number_map[NR_CPUS];
18#define cpu_number_map(cpu) __cpu_number_map[cpu]
19
20/* The reverse map from sequential logical cpu number to cpu id. */
21extern int __cpu_logical_map[NR_CPUS];
22#define cpu_logical_map(cpu) __cpu_logical_map[cpu]
23 23
24/* I've no idea what the real meaning of this is */ 24/* I've no idea what the real meaning of this is */
25#define PROC_CHANGE_PENALTY 20 25#define PROC_CHANGE_PENALTY 20
@@ -35,10 +35,22 @@ struct smp_fn_call_struct {
35 35
36extern struct smp_fn_call_struct smp_fn_call; 36extern struct smp_fn_call_struct smp_fn_call;
37 37
38#define SMP_MSG_RESCHEDULE 0x0001 38#define SMP_MSG_FUNCTION 0
39#define SMP_MSG_RESCHEDULE 1
40#define SMP_MSG_NR 2
39 41
40#endif /* CONFIG_SMP */ 42void plat_smp_setup(void);
43void plat_prepare_cpus(unsigned int max_cpus);
44int plat_smp_processor_id(void);
45void plat_start_cpu(unsigned int cpu, unsigned long entry_point);
46void plat_send_ipi(unsigned int cpu, unsigned int message);
47int plat_register_ipi_handler(unsigned int message,
48 void (*handler)(void *), void *arg);
49
50#else
41 51
42#define hard_smp_processor_id() (0) 52#define hard_smp_processor_id() (0)
43 53
54#endif /* CONFIG_SMP */
55
44#endif /* __ASM_SH_SMP_H */ 56#endif /* __ASM_SH_SMP_H */
diff --git a/include/asm-sh/snapgear.h b/include/asm-sh/snapgear.h
index 3554e3a74e99..042d95f51c4d 100644
--- a/include/asm-sh/snapgear.h
+++ b/include/asm-sh/snapgear.h
@@ -19,20 +19,16 @@
19 * is the interrupt :-) 19 * is the interrupt :-)
20 */ 20 */
21 21
22#define IRL0_IRQ 2 22#define IRL0_IRQ 2
23#define IRL0_IPR_POS 3
24#define IRL0_PRIORITY 13 23#define IRL0_PRIORITY 13
25 24
26#define IRL1_IRQ 5 25#define IRL1_IRQ 5
27#define IRL1_IPR_POS 2
28#define IRL1_PRIORITY 10 26#define IRL1_PRIORITY 10
29 27
30#define IRL2_IRQ 8 28#define IRL2_IRQ 8
31#define IRL2_IPR_POS 1
32#define IRL2_PRIORITY 7 29#define IRL2_PRIORITY 7
33 30
34#define IRL3_IRQ 11 31#define IRL3_IRQ 11
35#define IRL3_IPR_POS 0
36#define IRL3_PRIORITY 4 32#define IRL3_PRIORITY 4
37#endif 33#endif
38 34
diff --git a/include/asm-sh/spinlock.h b/include/asm-sh/spinlock.h
index 92f6e2008b2e..e793181d64da 100644
--- a/include/asm-sh/spinlock.h
+++ b/include/asm-sh/spinlock.h
@@ -2,6 +2,7 @@
2 * include/asm-sh/spinlock.h 2 * include/asm-sh/spinlock.h
3 * 3 *
4 * Copyright (C) 2002, 2003 Paul Mundt 4 * Copyright (C) 2002, 2003 Paul Mundt
5 * Copyright (C) 2006, 2007 Akio Idehara
5 * 6 *
6 * This file is subject to the terms and conditions of the GNU General Public 7 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive 8 * License. See the file "COPYING" in the main directory of this archive
@@ -10,17 +11,22 @@
10#ifndef __ASM_SH_SPINLOCK_H 11#ifndef __ASM_SH_SPINLOCK_H
11#define __ASM_SH_SPINLOCK_H 12#define __ASM_SH_SPINLOCK_H
12 13
13#include <asm/atomic.h> 14/*
14#include <asm/spinlock_types.h> 15 * The only locking implemented here uses SH-4A opcodes. For others,
16 * split this out as per atomic-*.h.
17 */
18#ifndef CONFIG_CPU_SH4A
19#error "Need movli.l/movco.l for spinlocks"
20#endif
15 21
16/* 22/*
17 * Your basic SMP spinlocks, allowing only a single CPU anywhere 23 * Your basic SMP spinlocks, allowing only a single CPU anywhere
18 */ 24 */
19 25
20#define __raw_spin_is_locked(x) ((x)->lock != 0) 26#define __raw_spin_is_locked(x) ((x)->lock <= 0)
21#define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock) 27#define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock)
22#define __raw_spin_unlock_wait(x) \ 28#define __raw_spin_unlock_wait(x) \
23 do { cpu_relax(); } while (__raw_spin_is_locked(x)) 29 do { cpu_relax(); } while ((x)->lock)
24 30
25/* 31/*
26 * Simple spin lock operations. There are two variants, one clears IRQ's 32 * Simple spin lock operations. There are two variants, one clears IRQ's
@@ -30,12 +36,19 @@
30 */ 36 */
31static inline void __raw_spin_lock(raw_spinlock_t *lock) 37static inline void __raw_spin_lock(raw_spinlock_t *lock)
32{ 38{
39 unsigned long tmp;
40 unsigned long oldval;
41
33 __asm__ __volatile__ ( 42 __asm__ __volatile__ (
34 "1:\n\t" 43 "1: \n\t"
35 "tas.b @%0\n\t" 44 "movli.l @%2, %0 ! __raw_spin_lock \n\t"
36 "bf/s 1b\n\t" 45 "mov %0, %1 \n\t"
37 "nop\n\t" 46 "mov #0, %0 \n\t"
38 : "=r" (lock->lock) 47 "movco.l %0, @%2 \n\t"
48 "bf 1b \n\t"
49 "cmp/pl %1 \n\t"
50 "bf 1b \n\t"
51 : "=&z" (tmp), "=&r" (oldval)
39 : "r" (&lock->lock) 52 : "r" (&lock->lock)
40 : "t", "memory" 53 : "t", "memory"
41 ); 54 );
@@ -43,12 +56,36 @@ static inline void __raw_spin_lock(raw_spinlock_t *lock)
43 56
44static inline void __raw_spin_unlock(raw_spinlock_t *lock) 57static inline void __raw_spin_unlock(raw_spinlock_t *lock)
45{ 58{
46 //assert_spin_locked(lock); 59 unsigned long tmp;
47 60
48 lock->lock = 0; 61 __asm__ __volatile__ (
62 "mov #1, %0 ! __raw_spin_unlock \n\t"
63 "mov.l %0, @%1 \n\t"
64 : "=&z" (tmp)
65 : "r" (&lock->lock)
66 : "t", "memory"
67 );
49} 68}
50 69
51#define __raw_spin_trylock(x) (!test_and_set_bit(0, &(x)->lock)) 70static inline int __raw_spin_trylock(raw_spinlock_t *lock)
71{
72 unsigned long tmp, oldval;
73
74 __asm__ __volatile__ (
75 "1: \n\t"
76 "movli.l @%2, %0 ! __raw_spin_trylock \n\t"
77 "mov %0, %1 \n\t"
78 "mov #0, %0 \n\t"
79 "movco.l %0, @%2 \n\t"
80 "bf 1b \n\t"
81 "synco \n\t"
82 : "=&z" (tmp), "=&r" (oldval)
83 : "r" (&lock->lock)
84 : "t", "memory"
85 );
86
87 return oldval;
88}
52 89
53/* 90/*
54 * Read-write spinlocks, allowing multiple readers but only one writer. 91 * Read-write spinlocks, allowing multiple readers but only one writer.
@@ -59,58 +96,124 @@ static inline void __raw_spin_unlock(raw_spinlock_t *lock)
59 * read-locks. 96 * read-locks.
60 */ 97 */
61 98
99/**
100 * read_can_lock - would read_trylock() succeed?
101 * @lock: the rwlock in question.
102 */
103#define __raw_read_can_lock(x) ((x)->lock > 0)
104
105/**
106 * write_can_lock - would write_trylock() succeed?
107 * @lock: the rwlock in question.
108 */
109#define __raw_write_can_lock(x) ((x)->lock == RW_LOCK_BIAS)
110
62static inline void __raw_read_lock(raw_rwlock_t *rw) 111static inline void __raw_read_lock(raw_rwlock_t *rw)
63{ 112{
64 __raw_spin_lock(&rw->lock); 113 unsigned long tmp;
65
66 atomic_inc(&rw->counter);
67 114
68 __raw_spin_unlock(&rw->lock); 115 __asm__ __volatile__ (
116 "1: \n\t"
117 "movli.l @%1, %0 ! __raw_read_lock \n\t"
118 "cmp/pl %0 \n\t"
119 "bf 1b \n\t"
120 "add #-1, %0 \n\t"
121 "movco.l %0, @%1 \n\t"
122 "bf 1b \n\t"
123 : "=&z" (tmp)
124 : "r" (&rw->lock)
125 : "t", "memory"
126 );
69} 127}
70 128
71static inline void __raw_read_unlock(raw_rwlock_t *rw) 129static inline void __raw_read_unlock(raw_rwlock_t *rw)
72{ 130{
73 __raw_spin_lock(&rw->lock); 131 unsigned long tmp;
74
75 atomic_dec(&rw->counter);
76 132
77 __raw_spin_unlock(&rw->lock); 133 __asm__ __volatile__ (
134 "1: \n\t"
135 "movli.l @%1, %0 ! __raw_read_unlock \n\t"
136 "add #1, %0 \n\t"
137 "movco.l %0, @%1 \n\t"
138 "bf 1b \n\t"
139 : "=&z" (tmp)
140 : "r" (&rw->lock)
141 : "t", "memory"
142 );
78} 143}
79 144
80static inline void __raw_write_lock(raw_rwlock_t *rw) 145static inline void __raw_write_lock(raw_rwlock_t *rw)
81{ 146{
82 __raw_spin_lock(&rw->lock); 147 unsigned long tmp;
83 atomic_set(&rw->counter, -1); 148
149 __asm__ __volatile__ (
150 "1: \n\t"
151 "movli.l @%1, %0 ! __raw_write_lock \n\t"
152 "cmp/hs %2, %0 \n\t"
153 "bf 1b \n\t"
154 "sub %2, %0 \n\t"
155 "movco.l %0, @%1 \n\t"
156 "bf 1b \n\t"
157 : "=&z" (tmp)
158 : "r" (&rw->lock), "r" (RW_LOCK_BIAS)
159 : "t", "memory"
160 );
84} 161}
85 162
86static inline void __raw_write_unlock(raw_rwlock_t *rw) 163static inline void __raw_write_unlock(raw_rwlock_t *rw)
87{ 164{
88 atomic_set(&rw->counter, 0); 165 __asm__ __volatile__ (
89 __raw_spin_unlock(&rw->lock); 166 "mov.l %1, @%0 ! __raw_write_unlock \n\t"
167 :
168 : "r" (&rw->lock), "r" (RW_LOCK_BIAS)
169 : "t", "memory"
170 );
90} 171}
91 172
92static inline int __raw_write_can_lock(raw_rwlock_t *rw) 173static inline int __raw_read_trylock(raw_rwlock_t *rw)
93{ 174{
94 return (atomic_read(&rw->counter) == RW_LOCK_BIAS); 175 unsigned long tmp, oldval;
95}
96 176
97static inline int __raw_read_trylock(raw_rwlock_t *lock) 177 __asm__ __volatile__ (
98{ 178 "1: \n\t"
99 atomic_t *count = (atomic_t*)lock; 179 "movli.l @%2, %0 ! __raw_read_trylock \n\t"
100 if (atomic_dec_return(count) >= 0) 180 "mov %0, %1 \n\t"
101 return 1; 181 "cmp/pl %0 \n\t"
102 atomic_inc(count); 182 "bf 2f \n\t"
103 return 0; 183 "add #-1, %0 \n\t"
184 "movco.l %0, @%2 \n\t"
185 "bf 1b \n\t"
186 "2: \n\t"
187 "synco \n\t"
188 : "=&z" (tmp), "=&r" (oldval)
189 : "r" (&rw->lock)
190 : "t", "memory"
191 );
192
193 return (oldval > 0);
104} 194}
105 195
106static inline int __raw_write_trylock(raw_rwlock_t *rw) 196static inline int __raw_write_trylock(raw_rwlock_t *rw)
107{ 197{
108 if (atomic_sub_and_test(RW_LOCK_BIAS, &rw->counter)) 198 unsigned long tmp, oldval;
109 return 1; 199
110 200 __asm__ __volatile__ (
111 atomic_add(RW_LOCK_BIAS, &rw->counter); 201 "1: \n\t"
202 "movli.l @%2, %0 ! __raw_write_trylock \n\t"
203 "mov %0, %1 \n\t"
204 "cmp/hs %3, %0 \n\t"
205 "bf 2f \n\t"
206 "sub %3, %0 \n\t"
207 "2: \n\t"
208 "movco.l %0, @%2 \n\t"
209 "bf 1b \n\t"
210 "synco \n\t"
211 : "=&z" (tmp), "=&r" (oldval)
212 : "r" (&rw->lock), "r" (RW_LOCK_BIAS)
213 : "t", "memory"
214 );
112 215
113 return 0; 216 return (oldval > (RW_LOCK_BIAS - 1));
114} 217}
115 218
116#define _raw_spin_relax(lock) cpu_relax() 219#define _raw_spin_relax(lock) cpu_relax()
diff --git a/include/asm-sh/spinlock_types.h b/include/asm-sh/spinlock_types.h
index 5c58134f2c4e..b4d244e7b60c 100644
--- a/include/asm-sh/spinlock_types.h
+++ b/include/asm-sh/spinlock_types.h
@@ -6,19 +6,16 @@
6#endif 6#endif
7 7
8typedef struct { 8typedef struct {
9 volatile unsigned long lock; 9 volatile unsigned int lock;
10} raw_spinlock_t; 10} raw_spinlock_t;
11 11
12#define __RAW_SPIN_LOCK_UNLOCKED { 1 } 12#define __RAW_SPIN_LOCK_UNLOCKED { 1 }
13
14#include <asm/atomic.h>
15 13
16typedef struct { 14typedef struct {
17 raw_spinlock_t lock; 15 volatile unsigned int lock;
18 atomic_t counter;
19} raw_rwlock_t; 16} raw_rwlock_t;
20 17
21#define RW_LOCK_BIAS 0x01000000 18#define RW_LOCK_BIAS 0x01000000
22#define __RAW_RW_LOCK_UNLOCKED { { 0 }, { RW_LOCK_BIAS } } 19#define __RAW_RW_LOCK_UNLOCKED { RW_LOCK_BIAS }
23 20
24#endif 21#endif
diff --git a/include/asm-sh/system.h b/include/asm-sh/system.h
index 245042537205..9d849e6df268 100644
--- a/include/asm-sh/system.h
+++ b/include/asm-sh/system.h
@@ -266,6 +266,7 @@ void disable_hlt(void);
266void enable_hlt(void); 266void enable_hlt(void);
267 267
268void default_idle(void); 268void default_idle(void);
269void per_cpu_trap_init(void);
269 270
270asmlinkage void break_point_trap(void); 271asmlinkage void break_point_trap(void);
271asmlinkage void debug_trap_handler(unsigned long r4, unsigned long r5, 272asmlinkage void debug_trap_handler(unsigned long r4, unsigned long r5,
diff --git a/include/asm-sh/voyagergx.h b/include/asm-sh/voyagergx.h
index 64c936b22715..d825596562df 100644
--- a/include/asm-sh/voyagergx.h
+++ b/include/asm-sh/voyagergx.h
@@ -27,13 +27,35 @@
27#define VOYAGER_UART_BASE (0x30000 + VOYAGER_BASE) 27#define VOYAGER_UART_BASE (0x30000 + VOYAGER_BASE)
28#define VOYAGER_AC97_BASE (0xa0000 + VOYAGER_BASE) 28#define VOYAGER_AC97_BASE (0xa0000 + VOYAGER_BASE)
29 29
30#define VOYAGER_IRQ_NUM 32 30#define VOYAGER_IRQ_NUM 26
31#define VOYAGER_IRQ_BASE 50 31#define VOYAGER_IRQ_BASE 200
32#define VOYAGER_USBH_IRQ VOYAGER_IRQ_BASE + 6 32
33#define VOYAGER_8051_IRQ VOYAGER_IRQ_BASE + 10 33#define IRQ_SM501_UP (VOYAGER_IRQ_BASE + 0)
34#define VOYAGER_UART0_IRQ VOYAGER_IRQ_BASE + 12 34#define IRQ_SM501_G54 (VOYAGER_IRQ_BASE + 1)
35#define VOYAGER_UART1_IRQ VOYAGER_IRQ_BASE + 13 35#define IRQ_SM501_G53 (VOYAGER_IRQ_BASE + 2)
36#define VOYAGER_AC97_IRQ VOYAGER_IRQ_BASE + 17 36#define IRQ_SM501_G52 (VOYAGER_IRQ_BASE + 3)
37#define IRQ_SM501_G51 (VOYAGER_IRQ_BASE + 4)
38#define IRQ_SM501_G50 (VOYAGER_IRQ_BASE + 5)
39#define IRQ_SM501_G49 (VOYAGER_IRQ_BASE + 6)
40#define IRQ_SM501_G48 (VOYAGER_IRQ_BASE + 7)
41#define IRQ_SM501_I2C (VOYAGER_IRQ_BASE + 8)
42#define IRQ_SM501_PW (VOYAGER_IRQ_BASE + 9)
43#define IRQ_SM501_DMA (VOYAGER_IRQ_BASE + 10)
44#define IRQ_SM501_PCI (VOYAGER_IRQ_BASE + 11)
45#define IRQ_SM501_I2S (VOYAGER_IRQ_BASE + 12)
46#define IRQ_SM501_AC (VOYAGER_IRQ_BASE + 13)
47#define IRQ_SM501_US (VOYAGER_IRQ_BASE + 14)
48#define IRQ_SM501_U1 (VOYAGER_IRQ_BASE + 15)
49#define IRQ_SM501_U0 (VOYAGER_IRQ_BASE + 16)
50#define IRQ_SM501_CV (VOYAGER_IRQ_BASE + 17)
51#define IRQ_SM501_MC (VOYAGER_IRQ_BASE + 18)
52#define IRQ_SM501_S1 (VOYAGER_IRQ_BASE + 19)
53#define IRQ_SM501_S0 (VOYAGER_IRQ_BASE + 20)
54#define IRQ_SM501_UH (VOYAGER_IRQ_BASE + 21)
55#define IRQ_SM501_2D (VOYAGER_IRQ_BASE + 22)
56#define IRQ_SM501_ZD (VOYAGER_IRQ_BASE + 23)
57#define IRQ_SM501_PV (VOYAGER_IRQ_BASE + 24)
58#define IRQ_SM501_CI (VOYAGER_IRQ_BASE + 25)
37 59
38/* ----- MISC controle register ------------------------------ */ 60/* ----- MISC controle register ------------------------------ */
39#define MISC_CTRL (0x000004 + VOYAGER_BASE) 61#define MISC_CTRL (0x000004 + VOYAGER_BASE)
@@ -313,4 +335,7 @@
313void *voyagergx_consistent_alloc(struct device *, size_t, dma_addr_t *, gfp_t); 335void *voyagergx_consistent_alloc(struct device *, size_t, dma_addr_t *, gfp_t);
314int voyagergx_consistent_free(struct device *, size_t, void *, dma_addr_t); 336int voyagergx_consistent_free(struct device *, size_t, void *, dma_addr_t);
315 337
338/* arch/sh/cchips/voyagergx/irq.c */
339void setup_voyagergx_irq(void);
340
316#endif /* _VOYAGER_GX_REG_H */ 341#endif /* _VOYAGER_GX_REG_H */
diff --git a/include/asm-sh64/gpio.h b/include/asm-sh64/gpio.h
new file mode 100644
index 000000000000..6bc5a13d8415
--- /dev/null
+++ b/include/asm-sh64/gpio.h
@@ -0,0 +1,8 @@
1#ifndef __ASM_SH64_GPIO_H
2#define __ASM_SH64_GPIO_H
3
4/*
5 * This is just a stub, so that every arch using sh-sci has a gpio.h
6 */
7
8#endif /* __ASM_SH64_GPIO_H */
diff --git a/include/asm-sh64/io.h b/include/asm-sh64/io.h
index 1f37b6931922..3de3ad99f457 100644
--- a/include/asm-sh64/io.h
+++ b/include/asm-sh64/io.h
@@ -119,6 +119,13 @@ void insw(unsigned long port, void *addr, unsigned long count);
119void outsl(unsigned long port, const void *addr, unsigned long count); 119void outsl(unsigned long port, const void *addr, unsigned long count);
120void insl(unsigned long port, void *addr, unsigned long count); 120void insl(unsigned long port, void *addr, unsigned long count);
121 121
122#define inb_p(addr) inb(addr)
123#define inw_p(addr) inw(addr)
124#define inl_p(addr) inl(addr)
125#define outb_p(x,addr) outb(x,addr)
126#define outw_p(x,addr) outw(x,addr)
127#define outl_p(x,addr) outl(x,addr)
128
122#define __raw_readb readb 129#define __raw_readb readb
123#define __raw_readw readw 130#define __raw_readw readw
124#define __raw_readl readl 131#define __raw_readl readl
diff --git a/include/asm-sparc/irqflags.h b/include/asm-sparc/irqflags.h
new file mode 100644
index 000000000000..db398fb32826
--- /dev/null
+++ b/include/asm-sparc/irqflags.h
@@ -0,0 +1,39 @@
1/*
2 * include/asm-sparc/irqflags.h
3 *
4 * IRQ flags handling
5 *
6 * This file gets included from lowlevel asm headers too, to provide
7 * wrapped versions of the local_irq_*() APIs, based on the
8 * raw_local_irq_*() functions from the lowlevel headers.
9 */
10#ifndef _ASM_IRQFLAGS_H
11#define _ASM_IRQFLAGS_H
12
13#ifndef __ASSEMBLY__
14
15extern void raw_local_irq_restore(unsigned long);
16extern unsigned long __raw_local_irq_save(void);
17extern void raw_local_irq_enable(void);
18
19static inline unsigned long getipl(void)
20{
21 unsigned long retval;
22
23 __asm__ __volatile__("rd %%psr, %0" : "=r" (retval));
24 return retval;
25}
26
27#define raw_local_save_flags(flags) ((flags) = getipl())
28#define raw_local_irq_save(flags) ((flags) = __raw_local_irq_save())
29#define raw_local_irq_disable() ((void) __raw_local_irq_save())
30#define raw_irqs_disabled() ((getipl() & PSR_PIL) != 0)
31
32static inline int raw_irqs_disabled_flags(unsigned long flags)
33{
34 return ((flags & PSR_PIL) != 0);
35}
36
37#endif /* (__ASSEMBLY__) */
38
39#endif /* !(_ASM_IRQFLAGS_H) */
diff --git a/include/asm-sparc/scatterlist.h b/include/asm-sparc/scatterlist.h
index a4fcf9ac9649..4055af90ad7e 100644
--- a/include/asm-sparc/scatterlist.h
+++ b/include/asm-sparc/scatterlist.h
@@ -19,4 +19,6 @@ struct scatterlist {
19 19
20#define ISA_DMA_THRESHOLD (~0UL) 20#define ISA_DMA_THRESHOLD (~0UL)
21 21
22#define ARCH_HAS_SG_CHAIN
23
22#endif /* !(_SPARC_SCATTERLIST_H) */ 24#endif /* !(_SPARC_SCATTERLIST_H) */
diff --git a/include/asm-sparc/system.h b/include/asm-sparc/system.h
index d1a2572e3f55..8c259de02614 100644
--- a/include/asm-sparc/system.h
+++ b/include/asm-sparc/system.h
@@ -15,6 +15,8 @@
15 15
16#ifndef __ASSEMBLY__ 16#ifndef __ASSEMBLY__
17 17
18#include <linux/irqflags.h>
19
18/* 20/*
19 * Sparc (general) CPU types 21 * Sparc (general) CPU types
20 */ 22 */
@@ -164,26 +166,6 @@ extern void fpsave(unsigned long *fpregs, unsigned long *fsr,
164 "o0", "o1", "o2", "o3", "o7"); \ 166 "o0", "o1", "o2", "o3", "o7"); \
165 } while(0) 167 } while(0)
166 168
167/*
168 * Changing the IRQ level on the Sparc.
169 */
170extern void local_irq_restore(unsigned long);
171extern unsigned long __local_irq_save(void);
172extern void local_irq_enable(void);
173
174static inline unsigned long getipl(void)
175{
176 unsigned long retval;
177
178 __asm__ __volatile__("rd %%psr, %0" : "=r" (retval));
179 return retval;
180}
181
182#define local_save_flags(flags) ((flags) = getipl())
183#define local_irq_save(flags) ((flags) = __local_irq_save())
184#define local_irq_disable() ((void) __local_irq_save())
185#define irqs_disabled() ((getipl() & PSR_PIL) != 0)
186
187/* XXX Change this if we ever use a PSO mode kernel. */ 169/* XXX Change this if we ever use a PSO mode kernel. */
188#define mb() __asm__ __volatile__ ("" : : : "memory") 170#define mb() __asm__ __volatile__ ("" : : : "memory")
189#define rmb() mb() 171#define rmb() mb()
diff --git a/include/asm-sparc64/cpudata.h b/include/asm-sparc64/cpudata.h
index 98a6e609163e..542421460a12 100644
--- a/include/asm-sparc64/cpudata.h
+++ b/include/asm-sparc64/cpudata.h
@@ -75,12 +75,11 @@ struct trap_per_cpu {
75 unsigned long tsb_huge_temp; 75 unsigned long tsb_huge_temp;
76 76
77/* Dcache line 8: IRQ work list, and keep trap_block a power-of-2 in size. */ 77/* Dcache line 8: IRQ work list, and keep trap_block a power-of-2 in size. */
78 unsigned int irq_worklist; 78 unsigned long irq_worklist_pa;
79 unsigned int cpu_mondo_qmask; 79 unsigned int cpu_mondo_qmask;
80 unsigned int dev_mondo_qmask; 80 unsigned int dev_mondo_qmask;
81 unsigned int resum_qmask; 81 unsigned int resum_qmask;
82 unsigned int nonresum_qmask; 82 unsigned int nonresum_qmask;
83 unsigned int __pad2[1];
84 void *hdesc; 83 void *hdesc;
85} __attribute__((aligned(64))); 84} __attribute__((aligned(64)));
86extern struct trap_per_cpu trap_block[NR_CPUS]; 85extern struct trap_per_cpu trap_block[NR_CPUS];
@@ -128,11 +127,11 @@ extern struct sun4v_2insn_patch_entry __sun4v_2insn_patch,
128#define TRAP_PER_CPU_CPU_LIST_PA 0xc8 127#define TRAP_PER_CPU_CPU_LIST_PA 0xc8
129#define TRAP_PER_CPU_TSB_HUGE 0xd0 128#define TRAP_PER_CPU_TSB_HUGE 0xd0
130#define TRAP_PER_CPU_TSB_HUGE_TEMP 0xd8 129#define TRAP_PER_CPU_TSB_HUGE_TEMP 0xd8
131#define TRAP_PER_CPU_IRQ_WORKLIST 0xe0 130#define TRAP_PER_CPU_IRQ_WORKLIST_PA 0xe0
132#define TRAP_PER_CPU_CPU_MONDO_QMASK 0xe4 131#define TRAP_PER_CPU_CPU_MONDO_QMASK 0xe8
133#define TRAP_PER_CPU_DEV_MONDO_QMASK 0xe8 132#define TRAP_PER_CPU_DEV_MONDO_QMASK 0xec
134#define TRAP_PER_CPU_RESUM_QMASK 0xec 133#define TRAP_PER_CPU_RESUM_QMASK 0xf0
135#define TRAP_PER_CPU_NONRESUM_QMASK 0xf0 134#define TRAP_PER_CPU_NONRESUM_QMASK 0xf4
136 135
137#define TRAP_BLOCK_SZ_SHIFT 8 136#define TRAP_BLOCK_SZ_SHIFT 8
138 137
@@ -184,9 +183,9 @@ extern struct sun4v_2insn_patch_entry __sun4v_2insn_patch,
184 ldx [DEST + TRAP_PER_CPU_PGD_PADDR], DEST; 183 ldx [DEST + TRAP_PER_CPU_PGD_PADDR], DEST;
185 184
186/* Clobbers TMP, loads local processor's IRQ work area into DEST. */ 185/* Clobbers TMP, loads local processor's IRQ work area into DEST. */
187#define TRAP_LOAD_IRQ_WORK(DEST, TMP) \ 186#define TRAP_LOAD_IRQ_WORK_PA(DEST, TMP) \
188 TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \ 187 TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \
189 add DEST, TRAP_PER_CPU_IRQ_WORKLIST, DEST; 188 add DEST, TRAP_PER_CPU_IRQ_WORKLIST_PA, DEST;
190 189
191/* Clobbers TMP, loads DEST with current thread info pointer. */ 190/* Clobbers TMP, loads DEST with current thread info pointer. */
192#define TRAP_LOAD_THREAD_REG(DEST, TMP) \ 191#define TRAP_LOAD_THREAD_REG(DEST, TMP) \
@@ -223,9 +222,9 @@ extern struct sun4v_2insn_patch_entry __sun4v_2insn_patch,
223 ldx [DEST + TRAP_PER_CPU_PGD_PADDR], DEST; 222 ldx [DEST + TRAP_PER_CPU_PGD_PADDR], DEST;
224 223
225/* Clobbers TMP, loads local processor's IRQ work area into DEST. */ 224/* Clobbers TMP, loads local processor's IRQ work area into DEST. */
226#define TRAP_LOAD_IRQ_WORK(DEST, TMP) \ 225#define TRAP_LOAD_IRQ_WORK_PA(DEST, TMP) \
227 TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \ 226 TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \
228 add DEST, TRAP_PER_CPU_IRQ_WORKLIST, DEST; 227 add DEST, TRAP_PER_CPU_IRQ_WORKLIST_PA, DEST;
229 228
230#define TRAP_LOAD_THREAD_REG(DEST, TMP) \ 229#define TRAP_LOAD_THREAD_REG(DEST, TMP) \
231 TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \ 230 TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \
diff --git a/include/asm-sparc64/irq.h b/include/asm-sparc64/irq.h
index c00ad152771b..182dba05c702 100644
--- a/include/asm-sparc64/irq.h
+++ b/include/asm-sparc64/irq.h
@@ -51,10 +51,19 @@ extern unsigned int sun4v_build_msi(u32 devhandle, unsigned int *virt_irq_p,
51 unsigned int msi_devino_start, 51 unsigned int msi_devino_start,
52 unsigned int msi_devino_end); 52 unsigned int msi_devino_end);
53extern void sun4v_destroy_msi(unsigned int virt_irq); 53extern void sun4v_destroy_msi(unsigned int virt_irq);
54extern unsigned int sun4u_build_msi(u32 portid, unsigned int *virt_irq_p,
55 unsigned int msi_devino_start,
56 unsigned int msi_devino_end,
57 unsigned long imap_base,
58 unsigned long iclr_base);
59extern void sun4u_destroy_msi(unsigned int virt_irq);
54extern unsigned int sbus_build_irq(void *sbus, unsigned int ino); 60extern unsigned int sbus_build_irq(void *sbus, unsigned int ino);
55 61
56extern void sparc64_set_msi(unsigned int virt_irq, u32 msi); 62extern unsigned char virt_irq_alloc(unsigned int dev_handle,
57extern u32 sparc64_get_msi(unsigned int virt_irq); 63 unsigned int dev_ino);
64#ifdef CONFIG_PCI_MSI
65extern void virt_irq_free(unsigned int virt_irq);
66#endif
58 67
59extern void fixup_irqs(void); 68extern void fixup_irqs(void);
60 69
diff --git a/include/asm-sparc64/kdebug.h b/include/asm-sparc64/kdebug.h
index 9974c7b0aebc..f905b773235a 100644
--- a/include/asm-sparc64/kdebug.h
+++ b/include/asm-sparc64/kdebug.h
@@ -1,26 +1,8 @@
1#ifndef _SPARC64_KDEBUG_H 1#ifndef _SPARC64_KDEBUG_H
2#define _SPARC64_KDEBUG_H 2#define _SPARC64_KDEBUG_H
3 3
4/* Nearly identical to x86_64/i386 code. */
5
6#include <linux/notifier.h>
7
8struct pt_regs; 4struct pt_regs;
9 5
10/*
11 * These are only here because kprobes.c wants them to implement a
12 * blatant layering violation. Will hopefully go away soon once all
13 * architectures are updated.
14 */
15static inline int register_page_fault_notifier(struct notifier_block *nb)
16{
17 return 0;
18}
19static inline int unregister_page_fault_notifier(struct notifier_block *nb)
20{
21 return 0;
22}
23
24extern void bad_trap(struct pt_regs *, long); 6extern void bad_trap(struct pt_regs *, long);
25 7
26/* Grossly misnamed. */ 8/* Grossly misnamed. */
diff --git a/include/asm-sparc64/kprobes.h b/include/asm-sparc64/kprobes.h
index 7f6774dca5f4..5020eaf67c29 100644
--- a/include/asm-sparc64/kprobes.h
+++ b/include/asm-sparc64/kprobes.h
@@ -10,8 +10,9 @@ typedef u32 kprobe_opcode_t;
10#define BREAKPOINT_INSTRUCTION_2 0x91d02071 /* ta 0x71 */ 10#define BREAKPOINT_INSTRUCTION_2 0x91d02071 /* ta 0x71 */
11#define MAX_INSN_SIZE 2 11#define MAX_INSN_SIZE 2
12 12
13#define kretprobe_blacklist_size 0
14
13#define arch_remove_kprobe(p) do {} while (0) 15#define arch_remove_kprobe(p) do {} while (0)
14#define ARCH_INACTIVE_KPROBE_COUNT 0
15 16
16#define flush_insn_slot(p) \ 17#define flush_insn_slot(p) \
17do { flushi(&(p)->ainsn.insn[0]); \ 18do { flushi(&(p)->ainsn.insn[0]); \
diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h
index 0393380d754a..3167ccff64f8 100644
--- a/include/asm-sparc64/pgtable.h
+++ b/include/asm-sparc64/pgtable.h
@@ -42,6 +42,9 @@
42#define HI_OBP_ADDRESS _AC(0x0000000100000000,UL) 42#define HI_OBP_ADDRESS _AC(0x0000000100000000,UL)
43#define VMALLOC_START _AC(0x0000000100000000,UL) 43#define VMALLOC_START _AC(0x0000000100000000,UL)
44#define VMALLOC_END _AC(0x0000000200000000,UL) 44#define VMALLOC_END _AC(0x0000000200000000,UL)
45#define VMEMMAP_BASE _AC(0x0000000200000000,UL)
46
47#define vmemmap ((struct page *)VMEMMAP_BASE)
45 48
46/* XXX All of this needs to be rethought so we can take advantage 49/* XXX All of this needs to be rethought so we can take advantage
47 * XXX cheetah's full 64-bit virtual address space, ie. no more hole 50 * XXX cheetah's full 64-bit virtual address space, ie. no more hole
diff --git a/include/asm-sparc64/scatterlist.h b/include/asm-sparc64/scatterlist.h
index 048fdb40e81d..703c5bbe6c8c 100644
--- a/include/asm-sparc64/scatterlist.h
+++ b/include/asm-sparc64/scatterlist.h
@@ -20,4 +20,6 @@ struct scatterlist {
20 20
21#define ISA_DMA_THRESHOLD (~0UL) 21#define ISA_DMA_THRESHOLD (~0UL)
22 22
23#define ARCH_HAS_SG_CHAIN
24
23#endif /* !(_SPARC64_SCATTERLIST_H) */ 25#endif /* !(_SPARC64_SCATTERLIST_H) */
diff --git a/include/asm-sparc64/smp.h b/include/asm-sparc64/smp.h
index e8a96a31761b..42c09949526c 100644
--- a/include/asm-sparc64/smp.h
+++ b/include/asm-sparc64/smp.h
@@ -28,8 +28,9 @@
28 28
29#include <asm/bitops.h> 29#include <asm/bitops.h>
30#include <asm/atomic.h> 30#include <asm/atomic.h>
31#include <asm/percpu.h>
31 32
32extern cpumask_t cpu_sibling_map[NR_CPUS]; 33DECLARE_PER_CPU(cpumask_t, cpu_sibling_map);
33extern cpumask_t cpu_core_map[NR_CPUS]; 34extern cpumask_t cpu_core_map[NR_CPUS];
34extern int sparc64_multi_core; 35extern int sparc64_multi_core;
35 36
diff --git a/include/asm-sparc64/topology.h b/include/asm-sparc64/topology.h
index 290ac75f385b..c6b557034f68 100644
--- a/include/asm-sparc64/topology.h
+++ b/include/asm-sparc64/topology.h
@@ -5,7 +5,7 @@
5#define topology_physical_package_id(cpu) (cpu_data(cpu).proc_id) 5#define topology_physical_package_id(cpu) (cpu_data(cpu).proc_id)
6#define topology_core_id(cpu) (cpu_data(cpu).core_id) 6#define topology_core_id(cpu) (cpu_data(cpu).core_id)
7#define topology_core_siblings(cpu) (cpu_core_map[cpu]) 7#define topology_core_siblings(cpu) (cpu_core_map[cpu])
8#define topology_thread_siblings(cpu) (cpu_sibling_map[cpu]) 8#define topology_thread_siblings(cpu) (per_cpu(cpu_sibling_map, cpu))
9#define mc_capable() (sparc64_multi_core) 9#define mc_capable() (sparc64_multi_core)
10#define smt_capable() (sparc64_multi_core) 10#define smt_capable() (sparc64_multi_core)
11#endif /* CONFIG_SMP */ 11#endif /* CONFIG_SMP */
diff --git a/include/asm-um/a.out.h b/include/asm-um/a.out.h
index 78bc9eed26b2..9281dd8eb334 100644
--- a/include/asm-um/a.out.h
+++ b/include/asm-um/a.out.h
@@ -1,8 +1,12 @@
1/*
2 * Copyright (C) 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3 * Licensed under the GPL
4 */
5
1#ifndef __UM_A_OUT_H 6#ifndef __UM_A_OUT_H
2#define __UM_A_OUT_H 7#define __UM_A_OUT_H
3 8
4#include "asm/arch/a.out.h" 9#include "asm/arch/a.out.h"
5#include "choose-mode.h"
6 10
7#undef STACK_TOP 11#undef STACK_TOP
8#undef STACK_TOP_MAX 12#undef STACK_TOP_MAX
@@ -13,10 +17,8 @@ extern unsigned long host_task_size;
13 17
14#define STACK_ROOM (stacksizelim) 18#define STACK_ROOM (stacksizelim)
15 19
16extern int honeypot; 20#define STACK_TOP task_size
17#define STACK_TOP \
18 CHOOSE_MODE((honeypot ? host_task_size : task_size), task_size)
19 21
20#define STACK_TOP_MAX STACK_TOP 22#define STACK_TOP_MAX STACK_TOP
21 23
22#endif 24#endif
diff --git a/include/asm-um/elf-i386.h b/include/asm-um/elf-i386.h
index 9bab712dc5c0..ca94a136dfe8 100644
--- a/include/asm-um/elf-i386.h
+++ b/include/asm-um/elf-i386.h
@@ -5,7 +5,8 @@
5#ifndef __UM_ELF_I386_H 5#ifndef __UM_ELF_I386_H
6#define __UM_ELF_I386_H 6#define __UM_ELF_I386_H
7 7
8#include <asm/user.h> 8#include <linux/sched.h>
9#include "skas.h"
9 10
10#define R_386_NONE 0 11#define R_386_NONE 0
11#define R_386_32 1 12#define R_386_32 1
@@ -75,6 +76,15 @@ typedef struct user_i387_struct elf_fpregset_t;
75 pr_reg[16] = PT_REGS_SS(regs); \ 76 pr_reg[16] = PT_REGS_SS(regs); \
76} while(0); 77} while(0);
77 78
79static inline int elf_core_copy_fpregs(struct task_struct *t,
80 elf_fpregset_t *fpu)
81{
82 int cpu = ((struct thread_info *) t->stack)->cpu;
83 return save_fp_registers(userspace_pid[cpu], (unsigned long *) fpu);
84}
85
86#define ELF_CORE_COPY_FPREGS(t, fpu) elf_core_copy_fpregs(t, fpu)
87
78extern long elf_aux_hwcap; 88extern long elf_aux_hwcap;
79#define ELF_HWCAP (elf_aux_hwcap) 89#define ELF_HWCAP (elf_aux_hwcap)
80 90
diff --git a/include/asm-um/elf-x86_64.h b/include/asm-um/elf-x86_64.h
index 857471c49dac..3c9d543eb61e 100644
--- a/include/asm-um/elf-x86_64.h
+++ b/include/asm-um/elf-x86_64.h
@@ -1,5 +1,6 @@
1/* 1/*
2 * Copyright 2003 PathScale, Inc. 2 * Copyright 2003 PathScale, Inc.
3 * Copyright (C) 2003 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3 * 4 *
4 * Licensed under the GPL 5 * Licensed under the GPL
5 */ 6 */
@@ -36,7 +37,7 @@ typedef unsigned long elf_greg_t;
36#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t)) 37#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t))
37typedef elf_greg_t elf_gregset_t[ELF_NGREG]; 38typedef elf_greg_t elf_gregset_t[ELF_NGREG];
38 39
39typedef struct { } elf_fpregset_t; 40typedef struct user_i387_struct elf_fpregset_t;
40 41
41/* 42/*
42 * This is used to ensure we don't load something for the wrong architecture. 43 * This is used to ensure we don't load something for the wrong architecture.
@@ -67,27 +68,27 @@ typedef struct { } elf_fpregset_t;
67} while (0) 68} while (0)
68 69
69#define ELF_CORE_COPY_REGS(pr_reg, regs) \ 70#define ELF_CORE_COPY_REGS(pr_reg, regs) \
70 (pr_reg)[0] = (regs)->regs.skas.regs[0]; \ 71 (pr_reg)[0] = (regs)->regs.gp[0]; \
71 (pr_reg)[1] = (regs)->regs.skas.regs[1]; \ 72 (pr_reg)[1] = (regs)->regs.gp[1]; \
72 (pr_reg)[2] = (regs)->regs.skas.regs[2]; \ 73 (pr_reg)[2] = (regs)->regs.gp[2]; \
73 (pr_reg)[3] = (regs)->regs.skas.regs[3]; \ 74 (pr_reg)[3] = (regs)->regs.gp[3]; \
74 (pr_reg)[4] = (regs)->regs.skas.regs[4]; \ 75 (pr_reg)[4] = (regs)->regs.gp[4]; \
75 (pr_reg)[5] = (regs)->regs.skas.regs[5]; \ 76 (pr_reg)[5] = (regs)->regs.gp[5]; \
76 (pr_reg)[6] = (regs)->regs.skas.regs[6]; \ 77 (pr_reg)[6] = (regs)->regs.gp[6]; \
77 (pr_reg)[7] = (regs)->regs.skas.regs[7]; \ 78 (pr_reg)[7] = (regs)->regs.gp[7]; \
78 (pr_reg)[8] = (regs)->regs.skas.regs[8]; \ 79 (pr_reg)[8] = (regs)->regs.gp[8]; \
79 (pr_reg)[9] = (regs)->regs.skas.regs[9]; \ 80 (pr_reg)[9] = (regs)->regs.gp[9]; \
80 (pr_reg)[10] = (regs)->regs.skas.regs[10]; \ 81 (pr_reg)[10] = (regs)->regs.gp[10]; \
81 (pr_reg)[11] = (regs)->regs.skas.regs[11]; \ 82 (pr_reg)[11] = (regs)->regs.gp[11]; \
82 (pr_reg)[12] = (regs)->regs.skas.regs[12]; \ 83 (pr_reg)[12] = (regs)->regs.gp[12]; \
83 (pr_reg)[13] = (regs)->regs.skas.regs[13]; \ 84 (pr_reg)[13] = (regs)->regs.gp[13]; \
84 (pr_reg)[14] = (regs)->regs.skas.regs[14]; \ 85 (pr_reg)[14] = (regs)->regs.gp[14]; \
85 (pr_reg)[15] = (regs)->regs.skas.regs[15]; \ 86 (pr_reg)[15] = (regs)->regs.gp[15]; \
86 (pr_reg)[16] = (regs)->regs.skas.regs[16]; \ 87 (pr_reg)[16] = (regs)->regs.gp[16]; \
87 (pr_reg)[17] = (regs)->regs.skas.regs[17]; \ 88 (pr_reg)[17] = (regs)->regs.gp[17]; \
88 (pr_reg)[18] = (regs)->regs.skas.regs[18]; \ 89 (pr_reg)[18] = (regs)->regs.gp[18]; \
89 (pr_reg)[19] = (regs)->regs.skas.regs[19]; \ 90 (pr_reg)[19] = (regs)->regs.gp[19]; \
90 (pr_reg)[20] = (regs)->regs.skas.regs[20]; \ 91 (pr_reg)[20] = (regs)->regs.gp[20]; \
91 (pr_reg)[21] = current->thread.arch.fs; \ 92 (pr_reg)[21] = current->thread.arch.fs; \
92 (pr_reg)[22] = 0; \ 93 (pr_reg)[22] = 0; \
93 (pr_reg)[23] = 0; \ 94 (pr_reg)[23] = 0; \
@@ -122,14 +123,3 @@ extern long elf_aux_hwcap;
122#define SET_PERSONALITY(ex, ibcs2) do ; while(0) 123#define SET_PERSONALITY(ex, ibcs2) do ; while(0)
123 124
124#endif 125#endif
125
126/*
127 * Overrides for Emacs so that we follow Linus's tabbing style.
128 * Emacs will notice this stuff at the end of the file and automatically
129 * adjust the settings for this buffer only. This must remain at the end
130 * of the file.
131 * ---------------------------------------------------------------------------
132 * Local variables:
133 * c-file-style: "linux"
134 * End:
135 */
diff --git a/include/asm-um/ldt.h b/include/asm-um/ldt.h
index 96f82a456ce6..b2553f3e87eb 100644
--- a/include/asm-um/ldt.h
+++ b/include/asm-um/ldt.h
@@ -11,11 +11,7 @@
11#include "asm/semaphore.h" 11#include "asm/semaphore.h"
12#include "asm/host_ldt.h" 12#include "asm/host_ldt.h"
13 13
14struct mmu_context_skas;
15extern void ldt_host_info(void); 14extern void ldt_host_info(void);
16extern long init_new_ldt(struct mmu_context_skas * to_mm,
17 struct mmu_context_skas * from_mm);
18extern void free_ldt(struct mmu_context_skas * mm);
19 15
20#define LDT_PAGES_MAX \ 16#define LDT_PAGES_MAX \
21 ((LDT_ENTRIES * LDT_ENTRY_SIZE)/PAGE_SIZE) 17 ((LDT_ENTRIES * LDT_ENTRY_SIZE)/PAGE_SIZE)
diff --git a/include/asm-um/mmu_context.h b/include/asm-um/mmu_context.h
index 9aa4b44e8cc1..5f3b863aef9a 100644
--- a/include/asm-um/mmu_context.h
+++ b/include/asm-um/mmu_context.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) 2 * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
5 5
@@ -9,7 +9,6 @@
9#include <asm-generic/mm_hooks.h> 9#include <asm-generic/mm_hooks.h>
10 10
11#include "linux/sched.h" 11#include "linux/sched.h"
12#include "choose-mode.h"
13#include "um_mmu.h" 12#include "um_mmu.h"
14 13
15#define get_mmu_context(task) do ; while(0) 14#define get_mmu_context(task) do ; while(0)
@@ -30,8 +29,7 @@ static inline void activate_mm(struct mm_struct *old, struct mm_struct *new)
30 * possible. 29 * possible.
31 */ 30 */
32 if (old != new && (current->flags & PF_BORROWED_MM)) 31 if (old != new && (current->flags & PF_BORROWED_MM))
33 CHOOSE_MODE(force_flush_all(), 32 __switch_mm(&new->context.id);
34 switch_mm_skas(&new->context.skas.id));
35} 33}
36 34
37static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, 35static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
@@ -43,8 +41,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
43 cpu_clear(cpu, prev->cpu_vm_mask); 41 cpu_clear(cpu, prev->cpu_vm_mask);
44 cpu_set(cpu, next->cpu_vm_mask); 42 cpu_set(cpu, next->cpu_vm_mask);
45 if(next != &init_mm) 43 if(next != &init_mm)
46 CHOOSE_MODE((void) 0, 44 __switch_mm(&next->context.id);
47 switch_mm_skas(&next->context.skas.id));
48 } 45 }
49} 46}
50 47
@@ -53,38 +50,8 @@ static inline void enter_lazy_tlb(struct mm_struct *mm,
53{ 50{
54} 51}
55 52
56extern int init_new_context_skas(struct task_struct *task, 53extern int init_new_context(struct task_struct *task, struct mm_struct *mm);
57 struct mm_struct *mm);
58 54
59static inline int init_new_context_tt(struct task_struct *task, 55extern void destroy_context(struct mm_struct *mm);
60 struct mm_struct *mm)
61{
62 return(0);
63}
64
65static inline int init_new_context(struct task_struct *task,
66 struct mm_struct *mm)
67{
68 return(CHOOSE_MODE_PROC(init_new_context_tt, init_new_context_skas,
69 task, mm));
70}
71
72extern void destroy_context_skas(struct mm_struct *mm);
73
74static inline void destroy_context(struct mm_struct *mm)
75{
76 CHOOSE_MODE((void) 0, destroy_context_skas(mm));
77}
78 56
79#endif 57#endif
80
81/*
82 * Overrides for Emacs so that we follow Linus's tabbing style.
83 * Emacs will notice this stuff at the end of the file and automatically
84 * adjust the settings for this buffer only. This must remain at the end
85 * of the file.
86 * ---------------------------------------------------------------------------
87 * Local variables:
88 * c-file-style: "linux"
89 * End:
90 */
diff --git a/include/asm-um/page.h b/include/asm-um/page.h
index 8e310d81e5b4..4b424c75fca5 100644
--- a/include/asm-um/page.h
+++ b/include/asm-um/page.h
@@ -9,6 +9,7 @@
9 9
10struct page; 10struct page;
11 11
12#include <linux/types.h>
12#include <asm/vm-flags.h> 13#include <asm/vm-flags.h>
13 14
14/* PAGE_SHIFT determines the page size */ 15/* PAGE_SHIFT determines the page size */
diff --git a/include/asm-um/pgalloc.h b/include/asm-um/pgalloc.h
index 34ab268ef40e..14904876e8fb 100644
--- a/include/asm-um/pgalloc.h
+++ b/include/asm-um/pgalloc.h
@@ -42,7 +42,7 @@ static inline void pte_free(struct page *pte)
42 42
43#ifdef CONFIG_3_LEVEL_PGTABLES 43#ifdef CONFIG_3_LEVEL_PGTABLES
44 44
45extern __inline__ void pmd_free(pmd_t *pmd) 45static inline void pmd_free(pmd_t *pmd)
46{ 46{
47 free_page((unsigned long)pmd); 47 free_page((unsigned long)pmd);
48} 48}
diff --git a/include/asm-um/pgtable-3level.h b/include/asm-um/pgtable-3level.h
index ca0c2a92a112..aa82b88db805 100644
--- a/include/asm-um/pgtable-3level.h
+++ b/include/asm-um/pgtable-3level.h
@@ -69,7 +69,7 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
69 return pmd; 69 return pmd;
70} 70}
71 71
72extern inline void pud_clear (pud_t *pud) 72static inline void pud_clear (pud_t *pud)
73{ 73{
74 set_pud(pud, __pud(0)); 74 set_pud(pud, __pud(0));
75} 75}
diff --git a/include/asm-um/processor-generic.h b/include/asm-um/processor-generic.h
index d99bbddffdb9..78c0599cc80c 100644
--- a/include/asm-um/processor-generic.h
+++ b/include/asm-um/processor-generic.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) 2 * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
5 5
@@ -11,44 +11,32 @@ struct pt_regs;
11struct task_struct; 11struct task_struct;
12 12
13#include "asm/ptrace.h" 13#include "asm/ptrace.h"
14#include "choose-mode.h"
15#include "registers.h" 14#include "registers.h"
16#include "sysdep/archsetjmp.h" 15#include "sysdep/archsetjmp.h"
17 16
18struct mm_struct; 17struct mm_struct;
19 18
20struct thread_struct { 19struct thread_struct {
21 /* This flag is set to 1 before calling do_fork (and analyzed in 20 struct task_struct *saved_task;
21 /*
22 * This flag is set to 1 before calling do_fork (and analyzed in
22 * copy_thread) to mark that we are begin called from userspace (fork / 23 * copy_thread) to mark that we are begin called from userspace (fork /
23 * vfork / clone), and reset to 0 after. It is left to 0 when called 24 * vfork / clone), and reset to 0 after. It is left to 0 when called
24 * from kernelspace (i.e. kernel_thread() or fork_idle(), as of 2.6.11). */ 25 * from kernelspace (i.e. kernel_thread() or fork_idle(),
25 struct task_struct *saved_task; 26 * as of 2.6.11).
27 */
26 int forking; 28 int forking;
27 int nsyscalls; 29 int nsyscalls;
28 struct pt_regs regs; 30 struct pt_regs regs;
29 int singlestep_syscall; 31 int singlestep_syscall;
30 void *fault_addr; 32 void *fault_addr;
31 void *fault_catcher; 33 jmp_buf *fault_catcher;
32 struct task_struct *prev_sched; 34 struct task_struct *prev_sched;
33 unsigned long temp_stack; 35 unsigned long temp_stack;
34 void *exec_buf; 36 jmp_buf *exec_buf;
35 struct arch_thread arch; 37 struct arch_thread arch;
36 union { 38 jmp_buf switch_buf;
37#ifdef CONFIG_MODE_TT 39 int mm_count;
38 struct {
39 int extern_pid;
40 int tracing;
41 int switch_pipe[2];
42 int vm_seq;
43 } tt;
44#endif
45#ifdef CONFIG_MODE_SKAS
46 struct {
47 jmp_buf switch_buf;
48 int mm_count;
49 } skas;
50#endif
51 } mode;
52 struct { 40 struct {
53 int op; 41 int op;
54 union { 42 union {
@@ -71,7 +59,7 @@ struct thread_struct {
71{ \ 59{ \
72 .forking = 0, \ 60 .forking = 0, \
73 .nsyscalls = 0, \ 61 .nsyscalls = 0, \
74 .regs = EMPTY_REGS, \ 62 .regs = EMPTY_REGS, \
75 .fault_addr = NULL, \ 63 .fault_addr = NULL, \
76 .prev_sched = NULL, \ 64 .prev_sched = NULL, \
77 .temp_stack = 0, \ 65 .temp_stack = 0, \
@@ -86,7 +74,10 @@ typedef struct {
86 74
87extern struct task_struct *alloc_task_struct(void); 75extern struct task_struct *alloc_task_struct(void);
88 76
89extern void release_thread(struct task_struct *); 77static inline void release_thread(struct task_struct *task)
78{
79}
80
90extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); 81extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
91 82
92static inline void prepare_to_copy(struct task_struct *tsk) 83static inline void prepare_to_copy(struct task_struct *tsk)
@@ -136,12 +127,7 @@ extern struct cpuinfo_um cpu_data[];
136#endif 127#endif
137 128
138 129
139#ifdef CONFIG_MODE_SKAS 130#define KSTK_REG(tsk, reg) get_thread_reg(reg, &tsk->thread.switch_buf)
140#define KSTK_REG(tsk, reg) \
141 get_thread_reg(reg, &tsk->thread.mode.skas.switch_buf)
142#else
143#define KSTK_REG(tsk, reg) (0xbadbabe)
144#endif
145#define get_wchan(p) (0) 131#define get_wchan(p) (0)
146 132
147#endif 133#endif
diff --git a/include/asm-um/processor-x86_64.h b/include/asm-um/processor-x86_64.h
index 31c2d4d685bd..d946bf2d334a 100644
--- a/include/asm-um/processor-x86_64.h
+++ b/include/asm-um/processor-x86_64.h
@@ -18,7 +18,7 @@ struct arch_thread {
18}; 18};
19 19
20/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */ 20/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
21extern inline void rep_nop(void) 21static inline void rep_nop(void)
22{ 22{
23 __asm__ __volatile__("rep;nop": : :"memory"); 23 __asm__ __volatile__("rep;nop": : :"memory");
24} 24}
diff --git a/include/asm-um/ptrace-generic.h b/include/asm-um/ptrace-generic.h
index 99c87c5ce994..6aefcd32fc61 100644
--- a/include/asm-um/ptrace-generic.h
+++ b/include/asm-um/ptrace-generic.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) 2 * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
5 5
@@ -9,10 +9,11 @@
9#ifndef __ASSEMBLY__ 9#ifndef __ASSEMBLY__
10 10
11#include "asm/arch/ptrace-abi.h" 11#include "asm/arch/ptrace-abi.h"
12#include <asm/user.h>
12#include "sysdep/ptrace.h" 13#include "sysdep/ptrace.h"
13 14
14struct pt_regs { 15struct pt_regs {
15 union uml_pt_regs regs; 16 struct uml_pt_regs regs;
16}; 17};
17 18
18#define EMPTY_REGS { .regs = EMPTY_UML_PT_REGS } 19#define EMPTY_REGS { .regs = EMPTY_UML_PT_REGS }
@@ -35,16 +36,18 @@ struct pt_regs {
35 36
36struct task_struct; 37struct task_struct;
37 38
39extern long subarch_ptrace(struct task_struct *child, long request, long addr,
40 long data);
38extern unsigned long getreg(struct task_struct *child, int regno); 41extern unsigned long getreg(struct task_struct *child, int regno);
39extern int putreg(struct task_struct *child, int regno, unsigned long value); 42extern int putreg(struct task_struct *child, int regno, unsigned long value);
40extern int get_fpregs(unsigned long buf, struct task_struct *child); 43extern int get_fpregs(struct user_i387_struct __user *buf,
41extern int set_fpregs(unsigned long buf, struct task_struct *child); 44 struct task_struct *child);
42extern int get_fpxregs(unsigned long buf, struct task_struct *child); 45extern int set_fpregs(struct user_i387_struct __user *buf,
43extern int set_fpxregs(unsigned long buf, struct task_struct *tsk); 46 struct task_struct *child);
44 47
45extern void show_regs(struct pt_regs *regs); 48extern void show_regs(struct pt_regs *regs);
46 49
47extern void send_sigtrap(struct task_struct *tsk, union uml_pt_regs *regs, 50extern void send_sigtrap(struct task_struct *tsk, struct uml_pt_regs *regs,
48 int error_code); 51 int error_code);
49 52
50extern int arch_copy_tls(struct task_struct *new); 53extern int arch_copy_tls(struct task_struct *new);
diff --git a/include/asm-um/ptrace-i386.h b/include/asm-um/ptrace-i386.h
index 6e2528bb0083..b2d24c5ea2c3 100644
--- a/include/asm-um/ptrace-i386.h
+++ b/include/asm-um/ptrace-i386.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) 2 * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
5 5
@@ -9,10 +9,9 @@
9#define HOST_AUDIT_ARCH AUDIT_ARCH_I386 9#define HOST_AUDIT_ARCH AUDIT_ARCH_I386
10 10
11#include "linux/compiler.h" 11#include "linux/compiler.h"
12#include "sysdep/ptrace.h"
13#include "asm/ptrace-generic.h" 12#include "asm/ptrace-generic.h"
14#include "asm/host_ldt.h" 13#include <asm/user.h>
15#include "choose-mode.h" 14#include "sysdep/ptrace.h"
16 15
17#define PT_REGS_EAX(r) UPT_EAX(&(r)->regs) 16#define PT_REGS_EAX(r) UPT_EAX(&(r)->regs)
18#define PT_REGS_EBX(r) UPT_EBX(&(r)->regs) 17#define PT_REGS_EBX(r) UPT_EBX(&(r)->regs)
@@ -41,34 +40,21 @@
41 40
42#define user_mode(r) UPT_IS_USER(&(r)->regs) 41#define user_mode(r) UPT_IS_USER(&(r)->regs)
43 42
43/*
44 * Forward declaration to avoid including sysdep/tls.h, which causes a
45 * circular include, and compilation failures.
46 */
47struct user_desc;
48
49extern int get_fpxregs(struct user_fxsr_struct __user *buf,
50 struct task_struct *child);
51extern int set_fpxregs(struct user_fxsr_struct __user *buf,
52 struct task_struct *tsk);
53
44extern int ptrace_get_thread_area(struct task_struct *child, int idx, 54extern int ptrace_get_thread_area(struct task_struct *child, int idx,
45 struct user_desc __user *user_desc); 55 struct user_desc __user *user_desc);
46 56
47extern int ptrace_set_thread_area(struct task_struct *child, int idx, 57extern int ptrace_set_thread_area(struct task_struct *child, int idx,
48 struct user_desc __user *user_desc); 58 struct user_desc __user *user_desc);
49 59
50extern int do_set_thread_area_skas(struct user_desc *info);
51extern int do_get_thread_area_skas(struct user_desc *info);
52
53extern int do_set_thread_area_tt(struct user_desc *info);
54extern int do_get_thread_area_tt(struct user_desc *info);
55
56extern int arch_switch_tls_skas(struct task_struct *from, struct task_struct *to);
57extern int arch_switch_tls_tt(struct task_struct *from, struct task_struct *to);
58
59extern void arch_switch_to_tt(struct task_struct *from, struct task_struct *to);
60extern void arch_switch_to_skas(struct task_struct *from, struct task_struct *to);
61
62static inline int do_get_thread_area(struct user_desc *info)
63{
64 return CHOOSE_MODE_PROC(do_get_thread_area_tt, do_get_thread_area_skas, info);
65}
66
67static inline int do_set_thread_area(struct user_desc *info)
68{
69 return CHOOSE_MODE_PROC(do_set_thread_area_tt, do_set_thread_area_skas, info);
70}
71
72struct task_struct;
73
74#endif 60#endif
diff --git a/include/asm-um/ptrace-x86_64.h b/include/asm-um/ptrace-x86_64.h
index bf61d17de3f7..4c475350dcf0 100644
--- a/include/asm-um/ptrace-x86_64.h
+++ b/include/asm-um/ptrace-x86_64.h
@@ -76,15 +76,6 @@ static inline int ptrace_set_thread_area(struct task_struct *child, int idx,
76 return -ENOSYS; 76 return -ENOSYS;
77} 77}
78 78
79static inline void arch_switch_to_tt(struct task_struct *from, 79extern long arch_prctl(struct task_struct *task, int code,
80 struct task_struct *to) 80 unsigned long __user *addr);
81{
82}
83
84extern void arch_switch_to_skas(struct task_struct *from,
85 struct task_struct *to);
86
87extern long arch_prctl_skas(struct task_struct *task, int code,
88 unsigned long __user *addr);
89
90#endif 81#endif
diff --git a/include/asm-um/smp.h b/include/asm-um/smp.h
index 84f8cf29324e..f27a96313174 100644
--- a/include/asm-um/smp.h
+++ b/include/asm-um/smp.h
@@ -18,7 +18,7 @@ extern int hard_smp_processor_id(void);
18extern int ncpus; 18extern int ncpus;
19 19
20 20
21extern inline void smp_cpus_done(unsigned int maxcpus) 21static inline void smp_cpus_done(unsigned int maxcpus)
22{ 22{
23} 23}
24 24
diff --git a/include/asm-um/tlbflush.h b/include/asm-um/tlbflush.h
index e78c28c1f350..9d647c55350b 100644
--- a/include/asm-um/tlbflush.h
+++ b/include/asm-um/tlbflush.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) 2 * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
5 5
@@ -7,7 +7,6 @@
7#define __UM_TLBFLUSH_H 7#define __UM_TLBFLUSH_H
8 8
9#include <linux/mm.h> 9#include <linux/mm.h>
10#include "choose-mode.h"
11 10
12/* 11/*
13 * TLB flushing: 12 * TLB flushing:
@@ -25,19 +24,7 @@ extern void flush_tlb_all(void);
25extern void flush_tlb_mm(struct mm_struct *mm); 24extern void flush_tlb_mm(struct mm_struct *mm);
26extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, 25extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
27 unsigned long end); 26 unsigned long end);
28extern void flush_tlb_page_skas(struct vm_area_struct *vma, 27extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long address);
29 unsigned long address);
30
31static inline void flush_tlb_page(struct vm_area_struct *vma,
32 unsigned long address)
33{
34 address &= PAGE_MASK;
35
36 CHOOSE_MODE(flush_tlb_range(vma, address, address + PAGE_SIZE),
37 flush_tlb_page_skas(vma, address));
38}
39
40extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr);
41extern void flush_tlb_kernel_vm(void); 28extern void flush_tlb_kernel_vm(void);
42extern void flush_tlb_kernel_range(unsigned long start, unsigned long end); 29extern void flush_tlb_kernel_range(unsigned long start, unsigned long end);
43extern void __flush_tlb_one(unsigned long addr); 30extern void __flush_tlb_one(unsigned long addr);
diff --git a/include/asm-um/uaccess.h b/include/asm-um/uaccess.h
index 16c734af9193..077032d4fc47 100644
--- a/include/asm-um/uaccess.h
+++ b/include/asm-um/uaccess.h
@@ -80,7 +80,7 @@
80 __put_user(x, private_ptr) : -EFAULT); \ 80 __put_user(x, private_ptr) : -EFAULT); \
81}) 81})
82 82
83#define strlen_user(str) strnlen_user(str, ~0UL >> 1) 83#define strlen_user(str) strnlen_user(str, ~0U >> 1)
84 84
85struct exception_table_entry 85struct exception_table_entry
86{ 86{
diff --git a/include/asm-x86/8253pit.h b/include/asm-x86/8253pit.h
deleted file mode 100644
index d3c2b38a6618..000000000000
--- a/include/asm-x86/8253pit.h
+++ /dev/null
@@ -1,5 +0,0 @@
1#ifdef CONFIG_X86_32
2# include "8253pit_32.h"
3#else
4# include "8253pit_64.h"
5#endif
diff --git a/include/asm-x86/8253pit_32.h b/include/asm-x86/8253pit_32.h
deleted file mode 100644
index 96c7c3592daf..000000000000
--- a/include/asm-x86/8253pit_32.h
+++ /dev/null
@@ -1,12 +0,0 @@
1/*
2 * 8253/8254 Programmable Interval Timer
3 */
4
5#ifndef _8253PIT_H
6#define _8253PIT_H
7
8#include <asm/timex.h>
9
10#define PIT_TICK_RATE CLOCK_TICK_RATE
11
12#endif
diff --git a/include/asm-x86/8253pit_64.h b/include/asm-x86/8253pit_64.h
deleted file mode 100644
index 285f78488ccb..000000000000
--- a/include/asm-x86/8253pit_64.h
+++ /dev/null
@@ -1,10 +0,0 @@
1/*
2 * 8253/8254 Programmable Interval Timer
3 */
4
5#ifndef _8253PIT_H
6#define _8253PIT_H
7
8#define PIT_TICK_RATE 1193182UL
9
10#endif
diff --git a/include/asm-x86/apic_64.h b/include/asm-x86/apic_64.h
index 85125ef3c414..3c8f21eef0be 100644
--- a/include/asm-x86/apic_64.h
+++ b/include/asm-x86/apic_64.h
@@ -19,7 +19,7 @@
19extern int apic_verbosity; 19extern int apic_verbosity;
20extern int apic_runs_main_timer; 20extern int apic_runs_main_timer;
21extern int ioapic_force; 21extern int ioapic_force;
22extern int apic_mapped; 22extern int disable_apic_timer;
23 23
24/* 24/*
25 * Define the default level of output to be very little 25 * Define the default level of output to be very little
@@ -79,8 +79,6 @@ extern void smp_local_timer_interrupt (void);
79extern void setup_boot_APIC_clock (void); 79extern void setup_boot_APIC_clock (void);
80extern void setup_secondary_APIC_clock (void); 80extern void setup_secondary_APIC_clock (void);
81extern int APIC_init_uniprocessor (void); 81extern int APIC_init_uniprocessor (void);
82extern void disable_APIC_timer(void);
83extern void enable_APIC_timer(void);
84extern void setup_apic_routing(void); 82extern void setup_apic_routing(void);
85 83
86extern void setup_APIC_extended_lvt(unsigned char lvt_off, unsigned char vector, 84extern void setup_APIC_extended_lvt(unsigned char lvt_off, unsigned char vector,
@@ -95,10 +93,6 @@ extern int apic_is_clustered_box(void);
95#define K8_APIC_EXT_INT_MSG_EXT 0x7 93#define K8_APIC_EXT_INT_MSG_EXT 0x7
96#define K8_APIC_EXT_LVT_ENTRY_THRESHOLD 0 94#define K8_APIC_EXT_LVT_ENTRY_THRESHOLD 0
97 95
98void smp_send_timer_broadcast_ipi(void);
99void switch_APIC_timer_to_ipi(void *cpumask);
100void switch_ipi_to_APIC_timer(void *cpumask);
101
102#define ARCH_APICTIMER_STOPS_ON_C3 1 96#define ARCH_APICTIMER_STOPS_ON_C3 1
103 97
104extern unsigned boot_cpu_id; 98extern unsigned boot_cpu_id;
diff --git a/include/asm-x86/cpufeature_32.h b/include/asm-x86/cpufeature_32.h
index 7b3aa28ebc6e..f17e688dfb05 100644
--- a/include/asm-x86/cpufeature_32.h
+++ b/include/asm-x86/cpufeature_32.h
@@ -92,6 +92,7 @@
92#define X86_FEATURE_CID (4*32+10) /* Context ID */ 92#define X86_FEATURE_CID (4*32+10) /* Context ID */
93#define X86_FEATURE_CX16 (4*32+13) /* CMPXCHG16B */ 93#define X86_FEATURE_CX16 (4*32+13) /* CMPXCHG16B */
94#define X86_FEATURE_XTPR (4*32+14) /* Send Task Priority Messages */ 94#define X86_FEATURE_XTPR (4*32+14) /* Send Task Priority Messages */
95#define X86_FEATURE_DCA (4*32+18) /* Direct Cache Access */
95 96
96/* VIA/Cyrix/Centaur-defined CPU features, CPUID level 0xC0000001, word 5 */ 97/* VIA/Cyrix/Centaur-defined CPU features, CPUID level 0xC0000001, word 5 */
97#define X86_FEATURE_XSTORE (5*32+ 2) /* on-CPU RNG present (xstore insn) */ 98#define X86_FEATURE_XSTORE (5*32+ 2) /* on-CPU RNG present (xstore insn) */
diff --git a/include/asm-x86/cpufeature_64.h b/include/asm-x86/cpufeature_64.h
index 2983501e8b3e..e18496b7b850 100644
--- a/include/asm-x86/cpufeature_64.h
+++ b/include/asm-x86/cpufeature_64.h
@@ -7,7 +7,7 @@
7#ifndef __ASM_X8664_CPUFEATURE_H 7#ifndef __ASM_X8664_CPUFEATURE_H
8#define __ASM_X8664_CPUFEATURE_H 8#define __ASM_X8664_CPUFEATURE_H
9 9
10#include <asm/cpufeature_32.h> 10#include "cpufeature_32.h"
11 11
12#undef cpu_has_vme 12#undef cpu_has_vme
13#define cpu_has_vme 0 13#define cpu_has_vme 0
diff --git a/include/asm-x86/dma-mapping_32.h b/include/asm-x86/dma-mapping_32.h
index f1d72d177f68..6a2d26cb5da6 100644
--- a/include/asm-x86/dma-mapping_32.h
+++ b/include/asm-x86/dma-mapping_32.h
@@ -2,10 +2,10 @@
2#define _ASM_I386_DMA_MAPPING_H 2#define _ASM_I386_DMA_MAPPING_H
3 3
4#include <linux/mm.h> 4#include <linux/mm.h>
5#include <linux/scatterlist.h>
5 6
6#include <asm/cache.h> 7#include <asm/cache.h>
7#include <asm/io.h> 8#include <asm/io.h>
8#include <asm/scatterlist.h>
9#include <asm/bug.h> 9#include <asm/bug.h>
10 10
11#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) 11#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
@@ -35,18 +35,19 @@ dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
35} 35}
36 36
37static inline int 37static inline int
38dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, 38dma_map_sg(struct device *dev, struct scatterlist *sglist, int nents,
39 enum dma_data_direction direction) 39 enum dma_data_direction direction)
40{ 40{
41 struct scatterlist *sg;
41 int i; 42 int i;
42 43
43 BUG_ON(!valid_dma_direction(direction)); 44 BUG_ON(!valid_dma_direction(direction));
44 WARN_ON(nents == 0 || sg[0].length == 0); 45 WARN_ON(nents == 0 || sglist[0].length == 0);
45 46
46 for (i = 0; i < nents; i++ ) { 47 for_each_sg(sglist, sg, nents, i) {
47 BUG_ON(!sg[i].page); 48 BUG_ON(!sg->page);
48 49
49 sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset; 50 sg->dma_address = page_to_phys(sg->page) + sg->offset;
50 } 51 }
51 52
52 flush_write_buffers(); 53 flush_write_buffers();
diff --git a/include/asm-x86/dma-mapping_64.h b/include/asm-x86/dma-mapping_64.h
index 6897e2a436e5..ecd0f6125ba3 100644
--- a/include/asm-x86/dma-mapping_64.h
+++ b/include/asm-x86/dma-mapping_64.h
@@ -6,8 +6,7 @@
6 * documentation. 6 * documentation.
7 */ 7 */
8 8
9 9#include <linux/scatterlist.h>
10#include <asm/scatterlist.h>
11#include <asm/io.h> 10#include <asm/io.h>
12#include <asm/swiotlb.h> 11#include <asm/swiotlb.h>
13 12
diff --git a/include/asm-x86/geode.h b/include/asm-x86/geode.h
index 6da4bbbea3dc..d94898831bac 100644
--- a/include/asm-x86/geode.h
+++ b/include/asm-x86/geode.h
@@ -156,4 +156,54 @@ static inline int is_geode(void)
156 return (is_geode_gx() || is_geode_lx()); 156 return (is_geode_gx() || is_geode_lx());
157} 157}
158 158
159/* MFGPTs */
160
161#define MFGPT_MAX_TIMERS 8
162#define MFGPT_TIMER_ANY -1
163
164#define MFGPT_DOMAIN_WORKING 1
165#define MFGPT_DOMAIN_STANDBY 2
166#define MFGPT_DOMAIN_ANY (MFGPT_DOMAIN_WORKING | MFGPT_DOMAIN_STANDBY)
167
168#define MFGPT_CMP1 0
169#define MFGPT_CMP2 1
170
171#define MFGPT_EVENT_IRQ 0
172#define MFGPT_EVENT_NMI 1
173#define MFGPT_EVENT_RESET 3
174
175#define MFGPT_REG_CMP1 0
176#define MFGPT_REG_CMP2 2
177#define MFGPT_REG_COUNTER 4
178#define MFGPT_REG_SETUP 6
179
180#define MFGPT_SETUP_CNTEN (1 << 15)
181#define MFGPT_SETUP_CMP2 (1 << 14)
182#define MFGPT_SETUP_CMP1 (1 << 13)
183#define MFGPT_SETUP_SETUP (1 << 12)
184#define MFGPT_SETUP_STOPEN (1 << 11)
185#define MFGPT_SETUP_EXTEN (1 << 10)
186#define MFGPT_SETUP_REVEN (1 << 5)
187#define MFGPT_SETUP_CLKSEL (1 << 4)
188
189static inline void geode_mfgpt_write(int timer, u16 reg, u16 value)
190{
191 u32 base = geode_get_dev_base(GEODE_DEV_MFGPT);
192 outw(value, base + reg + (timer * 8));
193}
194
195static inline u16 geode_mfgpt_read(int timer, u16 reg)
196{
197 u32 base = geode_get_dev_base(GEODE_DEV_MFGPT);
198 return inw(base + reg + (timer * 8));
199}
200
201extern int __init geode_mfgpt_detect(void);
202extern int geode_mfgpt_toggle_event(int timer, int cmp, int event, int enable);
203extern int geode_mfgpt_set_irq(int timer, int cmp, int irq, int enable);
204extern int geode_mfgpt_alloc_timer(int timer, int domain, struct module *owner);
205
206#define geode_mfgpt_setup_irq(t, c, i) geode_mfgpt_set_irq((t), (c), (i), 1)
207#define geode_mfgpt_release_irq(t, c, i) geode_mfgpt_set_irq((t), (c), (i), 0)
208
159#endif 209#endif
diff --git a/include/asm-x86/hardirq_32.h b/include/asm-x86/hardirq_32.h
index 0e358dc405f8..34649585bb59 100644
--- a/include/asm-x86/hardirq_32.h
+++ b/include/asm-x86/hardirq_32.h
@@ -9,6 +9,7 @@ typedef struct {
9 unsigned long idle_timestamp; 9 unsigned long idle_timestamp;
10 unsigned int __nmi_count; /* arch dependent */ 10 unsigned int __nmi_count; /* arch dependent */
11 unsigned int apic_timer_irqs; /* arch dependent */ 11 unsigned int apic_timer_irqs; /* arch dependent */
12 unsigned int irq0_irqs;
12} ____cacheline_aligned irq_cpustat_t; 13} ____cacheline_aligned irq_cpustat_t;
13 14
14DECLARE_PER_CPU(irq_cpustat_t, irq_stat); 15DECLARE_PER_CPU(irq_cpustat_t, irq_stat);
diff --git a/include/asm-x86/hpet.h b/include/asm-x86/hpet.h
index 9eff48601254..d4ab6db050b6 100644
--- a/include/asm-x86/hpet.h
+++ b/include/asm-x86/hpet.h
@@ -1,5 +1,93 @@
1#ifdef CONFIG_X86_32 1#ifndef ASM_X86_HPET_H
2# include "hpet_32.h" 2#define ASM_X86_HPET_H
3
4#ifdef CONFIG_HPET_TIMER
5
6/*
7 * Documentation on HPET can be found at:
8 * http://www.intel.com/ial/home/sp/pcmmspec.htm
9 * ftp://download.intel.com/ial/home/sp/mmts098.pdf
10 */
11
12#define HPET_MMAP_SIZE 1024
13
14#define HPET_ID 0x000
15#define HPET_PERIOD 0x004
16#define HPET_CFG 0x010
17#define HPET_STATUS 0x020
18#define HPET_COUNTER 0x0f0
19#define HPET_T0_CFG 0x100
20#define HPET_T0_CMP 0x108
21#define HPET_T0_ROUTE 0x110
22#define HPET_T1_CFG 0x120
23#define HPET_T1_CMP 0x128
24#define HPET_T1_ROUTE 0x130
25#define HPET_T2_CFG 0x140
26#define HPET_T2_CMP 0x148
27#define HPET_T2_ROUTE 0x150
28
29#define HPET_ID_REV 0x000000ff
30#define HPET_ID_NUMBER 0x00001f00
31#define HPET_ID_64BIT 0x00002000
32#define HPET_ID_LEGSUP 0x00008000
33#define HPET_ID_VENDOR 0xffff0000
34#define HPET_ID_NUMBER_SHIFT 8
35#define HPET_ID_VENDOR_SHIFT 16
36
37#define HPET_ID_VENDOR_8086 0x8086
38
39#define HPET_CFG_ENABLE 0x001
40#define HPET_CFG_LEGACY 0x002
41#define HPET_LEGACY_8254 2
42#define HPET_LEGACY_RTC 8
43
44#define HPET_TN_LEVEL 0x0002
45#define HPET_TN_ENABLE 0x0004
46#define HPET_TN_PERIODIC 0x0008
47#define HPET_TN_PERIODIC_CAP 0x0010
48#define HPET_TN_64BIT_CAP 0x0020
49#define HPET_TN_SETVAL 0x0040
50#define HPET_TN_32BIT 0x0100
51#define HPET_TN_ROUTE 0x3e00
52#define HPET_TN_FSB 0x4000
53#define HPET_TN_FSB_CAP 0x8000
54#define HPET_TN_ROUTE_SHIFT 9
55
56/* Max HPET Period is 10^8 femto sec as in HPET spec */
57#define HPET_MAX_PERIOD 100000000UL
58/*
59 * Min HPET period is 10^5 femto sec just for safety. If it is less than this,
60 * then 32 bit HPET counter wrapsaround in less than 0.5 sec.
61 */
62#define HPET_MIN_PERIOD 100000UL
63
64/* hpet memory map physical address */
65extern unsigned long hpet_address;
66extern unsigned long force_hpet_address;
67extern int is_hpet_enabled(void);
68extern int hpet_enable(void);
69extern unsigned long hpet_readl(unsigned long a);
70extern void force_hpet_resume(void);
71
72#ifdef CONFIG_HPET_EMULATE_RTC
73
74#include <linux/interrupt.h>
75
76extern int hpet_mask_rtc_irq_bit(unsigned long bit_mask);
77extern int hpet_set_rtc_irq_bit(unsigned long bit_mask);
78extern int hpet_set_alarm_time(unsigned char hrs, unsigned char min,
79 unsigned char sec);
80extern int hpet_set_periodic_freq(unsigned long freq);
81extern int hpet_rtc_dropped_irq(void);
82extern int hpet_rtc_timer_init(void);
83extern irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id);
84
85#endif /* CONFIG_HPET_EMULATE_RTC */
86
3#else 87#else
4# include "hpet_64.h" 88
5#endif 89static inline int hpet_enable(void) { return 0; }
90static inline unsigned long hpet_readl(unsigned long a) { return 0; }
91
92#endif /* CONFIG_HPET_TIMER */
93#endif /* ASM_X86_HPET_H */
diff --git a/include/asm-x86/hpet_32.h b/include/asm-x86/hpet_32.h
deleted file mode 100644
index c82dc7ed96b3..000000000000
--- a/include/asm-x86/hpet_32.h
+++ /dev/null
@@ -1,90 +0,0 @@
1
2#ifndef _I386_HPET_H
3#define _I386_HPET_H
4
5#ifdef CONFIG_HPET_TIMER
6
7/*
8 * Documentation on HPET can be found at:
9 * http://www.intel.com/ial/home/sp/pcmmspec.htm
10 * ftp://download.intel.com/ial/home/sp/mmts098.pdf
11 */
12
13#define HPET_MMAP_SIZE 1024
14
15#define HPET_ID 0x000
16#define HPET_PERIOD 0x004
17#define HPET_CFG 0x010
18#define HPET_STATUS 0x020
19#define HPET_COUNTER 0x0f0
20#define HPET_T0_CFG 0x100
21#define HPET_T0_CMP 0x108
22#define HPET_T0_ROUTE 0x110
23#define HPET_T1_CFG 0x120
24#define HPET_T1_CMP 0x128
25#define HPET_T1_ROUTE 0x130
26#define HPET_T2_CFG 0x140
27#define HPET_T2_CMP 0x148
28#define HPET_T2_ROUTE 0x150
29
30#define HPET_ID_REV 0x000000ff
31#define HPET_ID_NUMBER 0x00001f00
32#define HPET_ID_64BIT 0x00002000
33#define HPET_ID_LEGSUP 0x00008000
34#define HPET_ID_VENDOR 0xffff0000
35#define HPET_ID_NUMBER_SHIFT 8
36#define HPET_ID_VENDOR_SHIFT 16
37
38#define HPET_ID_VENDOR_8086 0x8086
39
40#define HPET_CFG_ENABLE 0x001
41#define HPET_CFG_LEGACY 0x002
42#define HPET_LEGACY_8254 2
43#define HPET_LEGACY_RTC 8
44
45#define HPET_TN_LEVEL 0x0002
46#define HPET_TN_ENABLE 0x0004
47#define HPET_TN_PERIODIC 0x0008
48#define HPET_TN_PERIODIC_CAP 0x0010
49#define HPET_TN_64BIT_CAP 0x0020
50#define HPET_TN_SETVAL 0x0040
51#define HPET_TN_32BIT 0x0100
52#define HPET_TN_ROUTE 0x3e00
53#define HPET_TN_FSB 0x4000
54#define HPET_TN_FSB_CAP 0x8000
55#define HPET_TN_ROUTE_SHIFT 9
56
57/* Max HPET Period is 10^8 femto sec as in HPET spec */
58#define HPET_MAX_PERIOD 100000000UL
59/*
60 * Min HPET period is 10^5 femto sec just for safety. If it is less than this,
61 * then 32 bit HPET counter wrapsaround in less than 0.5 sec.
62 */
63#define HPET_MIN_PERIOD 100000UL
64
65/* hpet memory map physical address */
66extern unsigned long hpet_address;
67extern int is_hpet_enabled(void);
68extern int hpet_enable(void);
69
70#ifdef CONFIG_HPET_EMULATE_RTC
71
72#include <linux/interrupt.h>
73
74extern int hpet_mask_rtc_irq_bit(unsigned long bit_mask);
75extern int hpet_set_rtc_irq_bit(unsigned long bit_mask);
76extern int hpet_set_alarm_time(unsigned char hrs, unsigned char min,
77 unsigned char sec);
78extern int hpet_set_periodic_freq(unsigned long freq);
79extern int hpet_rtc_dropped_irq(void);
80extern int hpet_rtc_timer_init(void);
81extern irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id);
82
83#endif /* CONFIG_HPET_EMULATE_RTC */
84
85#else
86
87static inline int hpet_enable(void) { return 0; }
88
89#endif /* CONFIG_HPET_TIMER */
90#endif /* _I386_HPET_H */
diff --git a/include/asm-x86/hpet_64.h b/include/asm-x86/hpet_64.h
deleted file mode 100644
index fd4decac93a8..000000000000
--- a/include/asm-x86/hpet_64.h
+++ /dev/null
@@ -1,18 +0,0 @@
1#ifndef _ASM_X8664_HPET_H
2#define _ASM_X8664_HPET_H 1
3
4#include <asm/hpet_32.h>
5
6#define HPET_TICK_RATE (HZ * 100000UL)
7
8extern int hpet_rtc_timer_init(void);
9extern int hpet_arch_init(void);
10extern int hpet_timer_stop_set_go(unsigned long tick);
11extern int hpet_reenable(void);
12extern unsigned int hpet_calibrate_tsc(void);
13
14extern int hpet_use_timer;
15extern unsigned long hpet_period;
16extern unsigned long hpet_tick;
17
18#endif
diff --git a/include/asm-x86/i8253.h b/include/asm-x86/i8253.h
index b2a4f995a33f..747548ec5d1d 100644
--- a/include/asm-x86/i8253.h
+++ b/include/asm-x86/i8253.h
@@ -1,5 +1,15 @@
1#ifdef CONFIG_X86_32 1#ifndef __ASM_I8253_H__
2# include "i8253_32.h" 2#define __ASM_I8253_H__
3#else 3
4# include "i8253_64.h" 4/* i8253A PIT registers */
5#endif 5#define PIT_MODE 0x43
6#define PIT_CH0 0x40
7#define PIT_CH2 0x42
8
9extern spinlock_t i8253_lock;
10
11extern struct clock_event_device *global_clock_event;
12
13extern void setup_pit_timer(void);
14
15#endif /* __ASM_I8253_H__ */
diff --git a/include/asm-x86/i8253_32.h b/include/asm-x86/i8253_32.h
deleted file mode 100644
index 7577d058d86e..000000000000
--- a/include/asm-x86/i8253_32.h
+++ /dev/null
@@ -1,17 +0,0 @@
1#ifndef __ASM_I8253_H__
2#define __ASM_I8253_H__
3
4#include <linux/clockchips.h>
5
6/* i8253A PIT registers */
7#define PIT_MODE 0x43
8#define PIT_CH0 0x40
9#define PIT_CH2 0x42
10
11extern spinlock_t i8253_lock;
12
13extern struct clock_event_device *global_clock_event;
14
15extern void setup_pit_timer(void);
16
17#endif /* __ASM_I8253_H__ */
diff --git a/include/asm-x86/i8253_64.h b/include/asm-x86/i8253_64.h
deleted file mode 100644
index 015d8df07690..000000000000
--- a/include/asm-x86/i8253_64.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef __ASM_I8253_H__
2#define __ASM_I8253_H__
3
4extern spinlock_t i8253_lock;
5
6#endif /* __ASM_I8253_H__ */
diff --git a/include/asm-x86/io_apic_32.h b/include/asm-x86/io_apic_32.h
index dbe734ddf2af..3f087883ea48 100644
--- a/include/asm-x86/io_apic_32.h
+++ b/include/asm-x86/io_apic_32.h
@@ -11,8 +11,6 @@
11 * Copyright (C) 1997, 1998, 1999, 2000 Ingo Molnar 11 * Copyright (C) 1997, 1998, 1999, 2000 Ingo Molnar
12 */ 12 */
13 13
14#ifdef CONFIG_X86_IO_APIC
15
16/* 14/*
17 * The structure of the IO-APIC: 15 * The structure of the IO-APIC:
18 */ 16 */
@@ -55,12 +53,6 @@ union IO_APIC_reg_03 {
55 } __attribute__ ((packed)) bits; 53 } __attribute__ ((packed)) bits;
56}; 54};
57 55
58/*
59 * # of IO-APICs and # of IRQ routing registers
60 */
61extern int nr_ioapics;
62extern int nr_ioapic_registers[MAX_IO_APICS];
63
64enum ioapic_irq_destination_types { 56enum ioapic_irq_destination_types {
65 dest_Fixed = 0, 57 dest_Fixed = 0,
66 dest_LowestPrio = 1, 58 dest_LowestPrio = 1,
@@ -100,6 +92,14 @@ struct IO_APIC_route_entry {
100 92
101} __attribute__ ((packed)); 93} __attribute__ ((packed));
102 94
95#ifdef CONFIG_X86_IO_APIC
96
97/*
98 * # of IO-APICs and # of IRQ routing registers
99 */
100extern int nr_ioapics;
101extern int nr_ioapic_registers[MAX_IO_APICS];
102
103/* 103/*
104 * MP-BIOS irq configuration table structures: 104 * MP-BIOS irq configuration table structures:
105 */ 105 */
diff --git a/include/asm-x86/irqflags_32.h b/include/asm-x86/irqflags_32.h
index eff8585cb741..d058b04e0083 100644
--- a/include/asm-x86/irqflags_32.h
+++ b/include/asm-x86/irqflags_32.h
@@ -160,4 +160,17 @@ static inline int raw_irqs_disabled(void)
160# define TRACE_IRQS_OFF 160# define TRACE_IRQS_OFF
161#endif 161#endif
162 162
163#ifdef CONFIG_DEBUG_LOCK_ALLOC
164# define LOCKDEP_SYS_EXIT \
165 pushl %eax; \
166 pushl %ecx; \
167 pushl %edx; \
168 call lockdep_sys_exit; \
169 popl %edx; \
170 popl %ecx; \
171 popl %eax;
172#else
173# define LOCKDEP_SYS_EXIT
174#endif
175
163#endif 176#endif
diff --git a/include/asm-x86/irqflags_64.h b/include/asm-x86/irqflags_64.h
index 86e70fe23659..5341ea1f815a 100644
--- a/include/asm-x86/irqflags_64.h
+++ b/include/asm-x86/irqflags_64.h
@@ -137,6 +137,20 @@ static inline void halt(void)
137# define TRACE_IRQS_ON 137# define TRACE_IRQS_ON
138# define TRACE_IRQS_OFF 138# define TRACE_IRQS_OFF
139# endif 139# endif
140# ifdef CONFIG_DEBUG_LOCK_ALLOC
141# define LOCKDEP_SYS_EXIT call lockdep_sys_exit_thunk
142# define LOCKDEP_SYS_EXIT_IRQ \
143 TRACE_IRQS_ON; \
144 sti; \
145 SAVE_REST; \
146 LOCKDEP_SYS_EXIT; \
147 RESTORE_REST; \
148 cli; \
149 TRACE_IRQS_OFF;
150# else
151# define LOCKDEP_SYS_EXIT
152# define LOCKDEP_SYS_EXIT_IRQ
153# endif
140#endif 154#endif
141 155
142#endif 156#endif
diff --git a/include/asm-x86/kdebug_32.h b/include/asm-x86/kdebug_32.h
index a185b5f73e7f..181d437eef4b 100644
--- a/include/asm-x86/kdebug_32.h
+++ b/include/asm-x86/kdebug_32.h
@@ -5,14 +5,9 @@
5 * Aug-05 2004 Ported by Prasanna S Panchamukhi <prasanna@in.ibm.com> 5 * Aug-05 2004 Ported by Prasanna S Panchamukhi <prasanna@in.ibm.com>
6 * from x86_64 architecture. 6 * from x86_64 architecture.
7 */ 7 */
8#include <linux/notifier.h>
9 8
10struct pt_regs; 9struct pt_regs;
11 10
12extern int register_page_fault_notifier(struct notifier_block *);
13extern int unregister_page_fault_notifier(struct notifier_block *);
14
15
16/* Grossly misnamed. */ 11/* Grossly misnamed. */
17enum die_val { 12enum die_val {
18 DIE_OOPS = 1, 13 DIE_OOPS = 1,
@@ -27,7 +22,6 @@ enum die_val {
27 DIE_GPF, 22 DIE_GPF,
28 DIE_CALL, 23 DIE_CALL,
29 DIE_NMI_IPI, 24 DIE_NMI_IPI,
30 DIE_PAGE_FAULT,
31}; 25};
32 26
33#endif 27#endif
diff --git a/include/asm-x86/kdebug_64.h b/include/asm-x86/kdebug_64.h
index d7e2bcf49e4f..df413e05375e 100644
--- a/include/asm-x86/kdebug_64.h
+++ b/include/asm-x86/kdebug_64.h
@@ -1,13 +1,10 @@
1#ifndef _X86_64_KDEBUG_H 1#ifndef _X86_64_KDEBUG_H
2#define _X86_64_KDEBUG_H 1 2#define _X86_64_KDEBUG_H 1
3 3
4#include <linux/notifier.h> 4#include <linux/compiler.h>
5 5
6struct pt_regs; 6struct pt_regs;
7 7
8extern int register_page_fault_notifier(struct notifier_block *);
9extern int unregister_page_fault_notifier(struct notifier_block *);
10
11/* Grossly misnamed. */ 8/* Grossly misnamed. */
12enum die_val { 9enum die_val {
13 DIE_OOPS = 1, 10 DIE_OOPS = 1,
@@ -22,7 +19,6 @@ enum die_val {
22 DIE_GPF, 19 DIE_GPF,
23 DIE_CALL, 20 DIE_CALL,
24 DIE_NMI_IPI, 21 DIE_NMI_IPI,
25 DIE_PAGE_FAULT,
26}; 22};
27 23
28extern void printk_address(unsigned long address); 24extern void printk_address(unsigned long address);
diff --git a/include/asm-x86/kprobes_32.h b/include/asm-x86/kprobes_32.h
index 06f7303c30ca..b772d5b38685 100644
--- a/include/asm-x86/kprobes_32.h
+++ b/include/asm-x86/kprobes_32.h
@@ -43,9 +43,10 @@ typedef u8 kprobe_opcode_t;
43 : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR))) 43 : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR)))
44 44
45#define ARCH_SUPPORTS_KRETPROBES 45#define ARCH_SUPPORTS_KRETPROBES
46#define ARCH_INACTIVE_KPROBE_COUNT 0
47#define flush_insn_slot(p) do { } while (0) 46#define flush_insn_slot(p) do { } while (0)
48 47
48extern const int kretprobe_blacklist_size;
49
49void arch_remove_kprobe(struct kprobe *p); 50void arch_remove_kprobe(struct kprobe *p);
50void kretprobe_trampoline(void); 51void kretprobe_trampoline(void);
51 52
@@ -89,4 +90,5 @@ static inline void restore_interrupts(struct pt_regs *regs)
89 90
90extern int kprobe_exceptions_notify(struct notifier_block *self, 91extern int kprobe_exceptions_notify(struct notifier_block *self,
91 unsigned long val, void *data); 92 unsigned long val, void *data);
93extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
92#endif /* _ASM_KPROBES_H */ 94#endif /* _ASM_KPROBES_H */
diff --git a/include/asm-x86/kprobes_64.h b/include/asm-x86/kprobes_64.h
index 7db825403e01..53f4d8507354 100644
--- a/include/asm-x86/kprobes_64.h
+++ b/include/asm-x86/kprobes_64.h
@@ -42,7 +42,7 @@ typedef u8 kprobe_opcode_t;
42 : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR))) 42 : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR)))
43 43
44#define ARCH_SUPPORTS_KRETPROBES 44#define ARCH_SUPPORTS_KRETPROBES
45#define ARCH_INACTIVE_KPROBE_COUNT 1 45extern const int kretprobe_blacklist_size;
46 46
47void kretprobe_trampoline(void); 47void kretprobe_trampoline(void);
48extern void arch_remove_kprobe(struct kprobe *p); 48extern void arch_remove_kprobe(struct kprobe *p);
diff --git a/include/asm-x86/page_64.h b/include/asm-x86/page_64.h
index 88adf1afb0a2..c3b52bcb171e 100644
--- a/include/asm-x86/page_64.h
+++ b/include/asm-x86/page_64.h
@@ -134,6 +134,7 @@ extern unsigned long __phys_addr(unsigned long);
134 VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) 134 VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
135 135
136#define __HAVE_ARCH_GATE_AREA 1 136#define __HAVE_ARCH_GATE_AREA 1
137#define vmemmap ((struct page *)VMEMMAP_START)
137 138
138#include <asm-generic/memory_model.h> 139#include <asm-generic/memory_model.h>
139#include <asm-generic/page.h> 140#include <asm-generic/page.h>
diff --git a/include/asm-x86/pci.h b/include/asm-x86/pci.h
index a8cac8c2cde7..e88361966347 100644
--- a/include/asm-x86/pci.h
+++ b/include/asm-x86/pci.h
@@ -1,5 +1,95 @@
1#ifndef __x86_PCI_H
2#define __x86_PCI_H
3
4#include <linux/mm.h> /* for struct page */
5#include <linux/types.h>
6#include <linux/slab.h>
7#include <linux/string.h>
8#include <asm/scatterlist.h>
9#include <asm/io.h>
10
11
12#ifdef __KERNEL__
13
14struct pci_sysdata {
15 int domain; /* PCI domain */
16 int node; /* NUMA node */
17#ifdef CONFIG_X86_64
18 void* iommu; /* IOMMU private data */
19#endif
20};
21
22/* scan a bus after allocating a pci_sysdata for it */
23extern struct pci_bus *pci_scan_bus_with_sysdata(int busno);
24
25static inline int pci_domain_nr(struct pci_bus *bus)
26{
27 struct pci_sysdata *sd = bus->sysdata;
28 return sd->domain;
29}
30
31static inline int pci_proc_domain(struct pci_bus *bus)
32{
33 return pci_domain_nr(bus);
34}
35
36
37/* Can be used to override the logic in pci_scan_bus for skipping
38 already-configured bus numbers - to be used for buggy BIOSes
39 or architectures with incomplete PCI setup by the loader */
40
41#ifdef CONFIG_PCI
42extern unsigned int pcibios_assign_all_busses(void);
43#else
44#define pcibios_assign_all_busses() 0
45#endif
46#define pcibios_scan_all_fns(a, b) 0
47
48extern unsigned long pci_mem_start;
49#define PCIBIOS_MIN_IO 0x1000
50#define PCIBIOS_MIN_MEM (pci_mem_start)
51
52#define PCIBIOS_MIN_CARDBUS_IO 0x4000
53
54void pcibios_config_init(void);
55struct pci_bus * pcibios_scan_root(int bus);
56
57void pcibios_set_master(struct pci_dev *dev);
58void pcibios_penalize_isa_irq(int irq, int active);
59struct irq_routing_table *pcibios_get_irq_routing_table(void);
60int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq);
61
62
63#define HAVE_PCI_MMAP
64extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
65 enum pci_mmap_state mmap_state, int write_combine);
66
67
68#ifdef CONFIG_PCI
69static inline void pci_dma_burst_advice(struct pci_dev *pdev,
70 enum pci_dma_burst_strategy *strat,
71 unsigned long *strategy_parameter)
72{
73 *strat = PCI_DMA_BURST_INFINITY;
74 *strategy_parameter = ~0UL;
75}
76#endif
77
78
79#endif /* __KERNEL__ */
80
1#ifdef CONFIG_X86_32 81#ifdef CONFIG_X86_32
2# include "pci_32.h" 82# include "pci_32.h"
3#else 83#else
4# include "pci_64.h" 84# include "pci_64.h"
5#endif 85#endif
86
87/* implement the pci_ DMA API in terms of the generic device dma_ one */
88#include <asm-generic/pci-dma-compat.h>
89
90/* generic pci stuff */
91#include <asm-generic/pci.h>
92
93
94
95#endif
diff --git a/include/asm-x86/pci_32.h b/include/asm-x86/pci_32.h
index 4fcacc711385..8c4c3a0368e2 100644
--- a/include/asm-x86/pci_32.h
+++ b/include/asm-x86/pci_32.h
@@ -4,50 +4,11 @@
4 4
5#ifdef __KERNEL__ 5#ifdef __KERNEL__
6 6
7struct pci_sysdata {
8 int node; /* NUMA node */
9};
10
11/* scan a bus after allocating a pci_sysdata for it */
12extern struct pci_bus *pci_scan_bus_with_sysdata(int busno);
13
14#include <linux/mm.h> /* for struct page */
15
16/* Can be used to override the logic in pci_scan_bus for skipping
17 already-configured bus numbers - to be used for buggy BIOSes
18 or architectures with incomplete PCI setup by the loader */
19
20#ifdef CONFIG_PCI
21extern unsigned int pcibios_assign_all_busses(void);
22#else
23#define pcibios_assign_all_busses() 0
24#endif
25#define pcibios_scan_all_fns(a, b) 0
26
27extern unsigned long pci_mem_start;
28#define PCIBIOS_MIN_IO 0x1000
29#define PCIBIOS_MIN_MEM (pci_mem_start)
30
31#define PCIBIOS_MIN_CARDBUS_IO 0x4000
32
33void pcibios_config_init(void);
34struct pci_bus * pcibios_scan_root(int bus);
35
36void pcibios_set_master(struct pci_dev *dev);
37void pcibios_penalize_isa_irq(int irq, int active);
38struct irq_routing_table *pcibios_get_irq_routing_table(void);
39int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq);
40 7
41/* Dynamic DMA mapping stuff. 8/* Dynamic DMA mapping stuff.
42 * i386 has everything mapped statically. 9 * i386 has everything mapped statically.
43 */ 10 */
44 11
45#include <linux/types.h>
46#include <linux/slab.h>
47#include <asm/scatterlist.h>
48#include <linux/string.h>
49#include <asm/io.h>
50
51struct pci_dev; 12struct pci_dev;
52 13
53/* The PCI address space does equal the physical memory 14/* The PCI address space does equal the physical memory
@@ -64,27 +25,8 @@ struct pci_dev;
64#define pci_unmap_len(PTR, LEN_NAME) (0) 25#define pci_unmap_len(PTR, LEN_NAME) (0)
65#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0) 26#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
66 27
67#define HAVE_PCI_MMAP
68extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
69 enum pci_mmap_state mmap_state, int write_combine);
70
71
72#ifdef CONFIG_PCI
73static inline void pci_dma_burst_advice(struct pci_dev *pdev,
74 enum pci_dma_burst_strategy *strat,
75 unsigned long *strategy_parameter)
76{
77 *strat = PCI_DMA_BURST_INFINITY;
78 *strategy_parameter = ~0UL;
79}
80#endif
81 28
82#endif /* __KERNEL__ */ 29#endif /* __KERNEL__ */
83 30
84/* implement the pci_ DMA API in terms of the generic device dma_ one */
85#include <asm-generic/pci-dma-compat.h>
86
87/* generic pci stuff */
88#include <asm-generic/pci.h>
89 31
90#endif /* __i386_PCI_H */ 32#endif /* __i386_PCI_H */
diff --git a/include/asm-x86/pci_64.h b/include/asm-x86/pci_64.h
index 5da8cb0c0599..9baa46d9f594 100644
--- a/include/asm-x86/pci_64.h
+++ b/include/asm-x86/pci_64.h
@@ -1,16 +1,9 @@
1#ifndef __x8664_PCI_H 1#ifndef __x8664_PCI_H
2#define __x8664_PCI_H 2#define __x8664_PCI_H
3 3
4#include <asm/io.h>
5 4
6#ifdef __KERNEL__ 5#ifdef __KERNEL__
7 6
8struct pci_sysdata {
9 int node; /* NUMA node */
10 void* iommu; /* IOMMU private data */
11};
12
13extern struct pci_bus *pci_scan_bus_with_sysdata(int busno);
14 7
15#ifdef CONFIG_CALGARY_IOMMU 8#ifdef CONFIG_CALGARY_IOMMU
16static inline void* pci_iommu(struct pci_bus *bus) 9static inline void* pci_iommu(struct pci_bus *bus)
@@ -26,40 +19,11 @@ static inline void set_pci_iommu(struct pci_bus *bus, void *val)
26} 19}
27#endif /* CONFIG_CALGARY_IOMMU */ 20#endif /* CONFIG_CALGARY_IOMMU */
28 21
29#include <linux/mm.h> /* for struct page */
30
31/* Can be used to override the logic in pci_scan_bus for skipping
32 already-configured bus numbers - to be used for buggy BIOSes
33 or architectures with incomplete PCI setup by the loader */
34
35#ifdef CONFIG_PCI
36extern unsigned int pcibios_assign_all_busses(void);
37#else
38#define pcibios_assign_all_busses() 0
39#endif
40#define pcibios_scan_all_fns(a, b) 0
41
42extern unsigned long pci_mem_start;
43#define PCIBIOS_MIN_IO 0x1000
44#define PCIBIOS_MIN_MEM (pci_mem_start)
45
46#define PCIBIOS_MIN_CARDBUS_IO 0x4000
47 22
48void pcibios_config_init(void);
49struct pci_bus * pcibios_scan_root(int bus);
50extern int (*pci_config_read)(int seg, int bus, int dev, int fn, int reg, int len, u32 *value); 23extern int (*pci_config_read)(int seg, int bus, int dev, int fn, int reg, int len, u32 *value);
51extern int (*pci_config_write)(int seg, int bus, int dev, int fn, int reg, int len, u32 value); 24extern int (*pci_config_write)(int seg, int bus, int dev, int fn, int reg, int len, u32 value);
52 25
53void pcibios_set_master(struct pci_dev *dev);
54void pcibios_penalize_isa_irq(int irq, int active);
55struct irq_routing_table *pcibios_get_irq_routing_table(void);
56int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq);
57 26
58#include <linux/types.h>
59#include <linux/slab.h>
60#include <asm/scatterlist.h>
61#include <linux/string.h>
62#include <asm/page.h>
63 27
64extern void pci_iommu_alloc(void); 28extern void pci_iommu_alloc(void);
65extern int iommu_setup(char *opt); 29extern int iommu_setup(char *opt);
@@ -100,27 +64,7 @@ extern int iommu_setup(char *opt);
100 64
101#endif 65#endif
102 66
103#include <asm-generic/pci-dma-compat.h>
104
105#ifdef CONFIG_PCI
106static inline void pci_dma_burst_advice(struct pci_dev *pdev,
107 enum pci_dma_burst_strategy *strat,
108 unsigned long *strategy_parameter)
109{
110 *strat = PCI_DMA_BURST_INFINITY;
111 *strategy_parameter = ~0UL;
112}
113#endif
114
115#define HAVE_PCI_MMAP
116extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
117 enum pci_mmap_state mmap_state, int write_combine);
118
119#endif /* __KERNEL__ */ 67#endif /* __KERNEL__ */
120 68
121/* generic pci stuff */
122#ifdef CONFIG_PCI
123#include <asm-generic/pci.h>
124#endif
125 69
126#endif /* __x8664_PCI_H */ 70#endif /* __x8664_PCI_H */
diff --git a/include/asm-x86/pda.h b/include/asm-x86/pda.h
index 5642634843c4..fb49f80eb94f 100644
--- a/include/asm-x86/pda.h
+++ b/include/asm-x86/pda.h
@@ -29,6 +29,7 @@ struct x8664_pda {
29 short isidle; 29 short isidle;
30 struct mm_struct *active_mm; 30 struct mm_struct *active_mm;
31 unsigned apic_timer_irqs; 31 unsigned apic_timer_irqs;
32 unsigned irq0_irqs;
32} ____cacheline_aligned_in_smp; 33} ____cacheline_aligned_in_smp;
33 34
34extern struct x8664_pda *_cpu_pda[]; 35extern struct x8664_pda *_cpu_pda[];
diff --git a/include/asm-x86/pgtable_64.h b/include/asm-x86/pgtable_64.h
index 57dd6b3107ea..a79f5355e3b0 100644
--- a/include/asm-x86/pgtable_64.h
+++ b/include/asm-x86/pgtable_64.h
@@ -137,6 +137,7 @@ static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm, unsigned long
137#define MAXMEM _AC(0x3fffffffffff, UL) 137#define MAXMEM _AC(0x3fffffffffff, UL)
138#define VMALLOC_START _AC(0xffffc20000000000, UL) 138#define VMALLOC_START _AC(0xffffc20000000000, UL)
139#define VMALLOC_END _AC(0xffffe1ffffffffff, UL) 139#define VMALLOC_END _AC(0xffffe1ffffffffff, UL)
140#define VMEMMAP_START _AC(0xffffe20000000000, UL)
140#define MODULES_VADDR _AC(0xffffffff88000000, UL) 141#define MODULES_VADDR _AC(0xffffffff88000000, UL)
141#define MODULES_END _AC(0xfffffffffff00000, UL) 142#define MODULES_END _AC(0xfffffffffff00000, UL)
142#define MODULES_LEN (MODULES_END - MODULES_VADDR) 143#define MODULES_LEN (MODULES_END - MODULES_VADDR)
diff --git a/include/asm-x86/processor-flags.h b/include/asm-x86/processor-flags.h
index 5404e90edd57..199cab107d85 100644
--- a/include/asm-x86/processor-flags.h
+++ b/include/asm-x86/processor-flags.h
@@ -63,7 +63,7 @@
63/* 63/*
64 * x86-64 Task Priority Register, CR8 64 * x86-64 Task Priority Register, CR8
65 */ 65 */
66#define X86_CR8_TPR 0x00000007 /* task priority register */ 66#define X86_CR8_TPR 0x0000000F /* task priority register */
67 67
68/* 68/*
69 * AMD and Transmeta use MSRs for configuration; see <asm/msr-index.h> 69 * AMD and Transmeta use MSRs for configuration; see <asm/msr-index.h>
diff --git a/include/asm-x86/proto.h b/include/asm-x86/proto.h
index 31f20ad65876..c44a3a93b5a4 100644
--- a/include/asm-x86/proto.h
+++ b/include/asm-x86/proto.h
@@ -51,9 +51,6 @@ extern void reserve_bootmem_generic(unsigned long phys, unsigned len);
51 51
52extern void load_gs_index(unsigned gs); 52extern void load_gs_index(unsigned gs);
53 53
54extern void stop_timer_interrupt(void);
55extern void main_timer_handler(void);
56
57extern unsigned long end_pfn_map; 54extern unsigned long end_pfn_map;
58 55
59extern void show_trace(struct task_struct *, struct pt_regs *, unsigned long * rsp); 56extern void show_trace(struct task_struct *, struct pt_regs *, unsigned long * rsp);
@@ -90,14 +87,10 @@ extern int timer_over_8254;
90 87
91extern int gsi_irq_sharing(int gsi); 88extern int gsi_irq_sharing(int gsi);
92 89
93extern void smp_local_timer_interrupt(void);
94
95extern int force_mwait; 90extern int force_mwait;
96 91
97long do_arch_prctl(struct task_struct *task, int code, unsigned long addr); 92long do_arch_prctl(struct task_struct *task, int code, unsigned long addr);
98 93
99void i8254_timer_resume(void);
100
101#define round_up(x,y) (((x) + (y) - 1) & ~((y)-1)) 94#define round_up(x,y) (((x) + (y) - 1) & ~((y)-1))
102#define round_down(x,y) ((x) & ~((y)-1)) 95#define round_down(x,y) ((x) & ~((y)-1))
103 96
diff --git a/include/asm-x86/scatterlist_32.h b/include/asm-x86/scatterlist_32.h
index d7e45a8f1aae..bd5164aa8f63 100644
--- a/include/asm-x86/scatterlist_32.h
+++ b/include/asm-x86/scatterlist_32.h
@@ -10,6 +10,8 @@ struct scatterlist {
10 unsigned int length; 10 unsigned int length;
11}; 11};
12 12
13#define ARCH_HAS_SG_CHAIN
14
13/* These macros should be used after a pci_map_sg call has been done 15/* These macros should be used after a pci_map_sg call has been done
14 * to get bus addresses of each of the SG entries and their lengths. 16 * to get bus addresses of each of the SG entries and their lengths.
15 * You should only work with the number of sg entries pci_map_sg 17 * You should only work with the number of sg entries pci_map_sg
diff --git a/include/asm-x86/scatterlist_64.h b/include/asm-x86/scatterlist_64.h
index eaf7ada27e14..ef3986ba4b79 100644
--- a/include/asm-x86/scatterlist_64.h
+++ b/include/asm-x86/scatterlist_64.h
@@ -11,6 +11,8 @@ struct scatterlist {
11 unsigned int dma_length; 11 unsigned int dma_length;
12}; 12};
13 13
14#define ARCH_HAS_SG_CHAIN
15
14#define ISA_DMA_THRESHOLD (0x00ffffff) 16#define ISA_DMA_THRESHOLD (0x00ffffff)
15 17
16/* These macros should be used after a pci_map_sg call has been done 18/* These macros should be used after a pci_map_sg call has been done
diff --git a/include/asm-x86/smp_32.h b/include/asm-x86/smp_32.h
index 1f73bde165b1..955dd7c8538f 100644
--- a/include/asm-x86/smp_32.h
+++ b/include/asm-x86/smp_32.h
@@ -30,8 +30,8 @@
30extern void smp_alloc_memory(void); 30extern void smp_alloc_memory(void);
31extern int pic_mode; 31extern int pic_mode;
32extern int smp_num_siblings; 32extern int smp_num_siblings;
33extern cpumask_t cpu_sibling_map[]; 33DECLARE_PER_CPU(cpumask_t, cpu_sibling_map);
34extern cpumask_t cpu_core_map[]; 34DECLARE_PER_CPU(cpumask_t, cpu_core_map);
35 35
36extern void (*mtrr_hook) (void); 36extern void (*mtrr_hook) (void);
37extern void zap_low_mappings (void); 37extern void zap_low_mappings (void);
diff --git a/include/asm-x86/smp_64.h b/include/asm-x86/smp_64.h
index 3f303d2365ed..f5bcee1c0927 100644
--- a/include/asm-x86/smp_64.h
+++ b/include/asm-x86/smp_64.h
@@ -38,8 +38,15 @@ extern void unlock_ipi_call_lock(void);
38extern int smp_num_siblings; 38extern int smp_num_siblings;
39extern void smp_send_reschedule(int cpu); 39extern void smp_send_reschedule(int cpu);
40 40
41extern cpumask_t cpu_sibling_map[NR_CPUS]; 41/*
42extern cpumask_t cpu_core_map[NR_CPUS]; 42 * cpu_sibling_map and cpu_core_map now live
43 * in the per cpu area
44 *
45 * extern cpumask_t cpu_sibling_map[NR_CPUS];
46 * extern cpumask_t cpu_core_map[NR_CPUS];
47 */
48DECLARE_PER_CPU(cpumask_t, cpu_sibling_map);
49DECLARE_PER_CPU(cpumask_t, cpu_core_map);
43extern u8 cpu_llc_id[NR_CPUS]; 50extern u8 cpu_llc_id[NR_CPUS];
44 51
45#define SMP_TRAMPOLINE_BASE 0x6000 52#define SMP_TRAMPOLINE_BASE 0x6000
diff --git a/include/asm-x86/system_32.h b/include/asm-x86/system_32.h
index d69ba937e092..e7e5d426fef5 100644
--- a/include/asm-x86/system_32.h
+++ b/include/asm-x86/system_32.h
@@ -216,6 +216,7 @@ static inline unsigned long get_limit(unsigned long segment)
216 216
217#define mb() alternative("lock; addl $0,0(%%esp)", "mfence", X86_FEATURE_XMM2) 217#define mb() alternative("lock; addl $0,0(%%esp)", "mfence", X86_FEATURE_XMM2)
218#define rmb() alternative("lock; addl $0,0(%%esp)", "lfence", X86_FEATURE_XMM2) 218#define rmb() alternative("lock; addl $0,0(%%esp)", "lfence", X86_FEATURE_XMM2)
219#define wmb() alternative("lock; addl $0,0(%%esp)", "sfence", X86_FEATURE_XMM)
219 220
220/** 221/**
221 * read_barrier_depends - Flush all pending reads that subsequents reads 222 * read_barrier_depends - Flush all pending reads that subsequents reads
@@ -271,18 +272,18 @@ static inline unsigned long get_limit(unsigned long segment)
271 272
272#define read_barrier_depends() do { } while(0) 273#define read_barrier_depends() do { } while(0)
273 274
275#ifdef CONFIG_SMP
276#define smp_mb() mb()
277#ifdef CONFIG_X86_PPRO_FENCE
278# define smp_rmb() rmb()
279#else
280# define smp_rmb() barrier()
281#endif
274#ifdef CONFIG_X86_OOSTORE 282#ifdef CONFIG_X86_OOSTORE
275/* Actually there are no OOO store capable CPUs for now that do SSE, 283# define smp_wmb() wmb()
276 but make it already an possibility. */
277#define wmb() alternative("lock; addl $0,0(%%esp)", "sfence", X86_FEATURE_XMM)
278#else 284#else
279#define wmb() __asm__ __volatile__ ("": : :"memory") 285# define smp_wmb() barrier()
280#endif 286#endif
281
282#ifdef CONFIG_SMP
283#define smp_mb() mb()
284#define smp_rmb() rmb()
285#define smp_wmb() wmb()
286#define smp_read_barrier_depends() read_barrier_depends() 287#define smp_read_barrier_depends() read_barrier_depends()
287#define set_mb(var, value) do { (void) xchg(&var, value); } while (0) 288#define set_mb(var, value) do { (void) xchg(&var, value); } while (0)
288#else 289#else
diff --git a/include/asm-x86/system_64.h b/include/asm-x86/system_64.h
index 02175aa1d16a..5022aecc333d 100644
--- a/include/asm-x86/system_64.h
+++ b/include/asm-x86/system_64.h
@@ -141,8 +141,8 @@ static inline void write_cr8(unsigned long val)
141 141
142#ifdef CONFIG_SMP 142#ifdef CONFIG_SMP
143#define smp_mb() mb() 143#define smp_mb() mb()
144#define smp_rmb() rmb() 144#define smp_rmb() barrier()
145#define smp_wmb() wmb() 145#define smp_wmb() barrier()
146#define smp_read_barrier_depends() do {} while(0) 146#define smp_read_barrier_depends() do {} while(0)
147#else 147#else
148#define smp_mb() barrier() 148#define smp_mb() barrier()
@@ -159,12 +159,8 @@ static inline void write_cr8(unsigned long val)
159 */ 159 */
160#define mb() asm volatile("mfence":::"memory") 160#define mb() asm volatile("mfence":::"memory")
161#define rmb() asm volatile("lfence":::"memory") 161#define rmb() asm volatile("lfence":::"memory")
162
163#ifdef CONFIG_UNORDERED_IO
164#define wmb() asm volatile("sfence" ::: "memory") 162#define wmb() asm volatile("sfence" ::: "memory")
165#else 163
166#define wmb() asm volatile("" ::: "memory")
167#endif
168#define read_barrier_depends() do {} while(0) 164#define read_barrier_depends() do {} while(0)
169#define set_mb(var, value) do { (void) xchg(&var, value); } while (0) 165#define set_mb(var, value) do { (void) xchg(&var, value); } while (0)
170 166
diff --git a/include/asm-x86/timex.h b/include/asm-x86/timex.h
index d01c18cfccef..39a21ab030f0 100644
--- a/include/asm-x86/timex.h
+++ b/include/asm-x86/timex.h
@@ -1,5 +1,18 @@
1#ifdef CONFIG_X86_32 1/* x86 architecture timex specifications */
2# include "timex_32.h" 2#ifndef _ASM_X86_TIMEX_H
3#define _ASM_X86_TIMEX_H
4
5#include <asm/processor.h>
6#include <asm/tsc.h>
7
8#ifdef CONFIG_X86_ELAN
9# define PIT_TICK_RATE 1189200 /* AMD Elan has different frequency! */
3#else 10#else
4# include "timex_64.h" 11# define PIT_TICK_RATE 1193182 /* Underlying HZ */
12#endif
13#define CLOCK_TICK_RATE PIT_TICK_RATE
14
15extern int read_current_timer(unsigned long *timer_value);
16#define ARCH_HAS_READ_CURRENT_TIMER 1
17
5#endif 18#endif
diff --git a/include/asm-x86/timex_32.h b/include/asm-x86/timex_32.h
deleted file mode 100644
index 3666044409f0..000000000000
--- a/include/asm-x86/timex_32.h
+++ /dev/null
@@ -1,22 +0,0 @@
1/*
2 * linux/include/asm-i386/timex.h
3 *
4 * i386 architecture timex specifications
5 */
6#ifndef _ASMi386_TIMEX_H
7#define _ASMi386_TIMEX_H
8
9#include <asm/processor.h>
10#include <asm/tsc.h>
11
12#ifdef CONFIG_X86_ELAN
13# define CLOCK_TICK_RATE 1189200 /* AMD Elan has different frequency! */
14#else
15# define CLOCK_TICK_RATE 1193182 /* Underlying HZ */
16#endif
17
18
19extern int read_current_timer(unsigned long *timer_value);
20#define ARCH_HAS_READ_CURRENT_TIMER 1
21
22#endif
diff --git a/include/asm-x86/timex_64.h b/include/asm-x86/timex_64.h
deleted file mode 100644
index 6ed21f44d308..000000000000
--- a/include/asm-x86/timex_64.h
+++ /dev/null
@@ -1,31 +0,0 @@
1/*
2 * linux/include/asm-x86_64/timex.h
3 *
4 * x86-64 architecture timex specifications
5 */
6#ifndef _ASMx8664_TIMEX_H
7#define _ASMx8664_TIMEX_H
8
9#include <asm/8253pit.h>
10#include <asm/msr.h>
11#include <asm/vsyscall.h>
12#include <asm/system.h>
13#include <asm/processor.h>
14#include <asm/tsc.h>
15#include <linux/compiler.h>
16
17#define CLOCK_TICK_RATE PIT_TICK_RATE /* Underlying HZ */
18
19extern int read_current_timer(unsigned long *timer_value);
20#define ARCH_HAS_READ_CURRENT_TIMER 1
21
22#define USEC_PER_TICK (USEC_PER_SEC / HZ)
23#define NSEC_PER_TICK (NSEC_PER_SEC / HZ)
24#define FSEC_PER_TICK (FSEC_PER_SEC / HZ)
25
26#define NS_SCALE 10 /* 2^10, carefully chosen */
27#define US_SCALE 32 /* 2^32, arbitralrily chosen */
28
29extern void mark_tsc_unstable(char *msg);
30extern void set_cyc2ns_scale(unsigned long khz);
31#endif
diff --git a/include/asm-x86/topology_32.h b/include/asm-x86/topology_32.h
index 19b2dafd0c81..ae1074603c4b 100644
--- a/include/asm-x86/topology_32.h
+++ b/include/asm-x86/topology_32.h
@@ -30,8 +30,8 @@
30#ifdef CONFIG_X86_HT 30#ifdef CONFIG_X86_HT
31#define topology_physical_package_id(cpu) (cpu_data[cpu].phys_proc_id) 31#define topology_physical_package_id(cpu) (cpu_data[cpu].phys_proc_id)
32#define topology_core_id(cpu) (cpu_data[cpu].cpu_core_id) 32#define topology_core_id(cpu) (cpu_data[cpu].cpu_core_id)
33#define topology_core_siblings(cpu) (cpu_core_map[cpu]) 33#define topology_core_siblings(cpu) (per_cpu(cpu_core_map, cpu))
34#define topology_thread_siblings(cpu) (cpu_sibling_map[cpu]) 34#define topology_thread_siblings(cpu) (per_cpu(cpu_sibling_map, cpu))
35#endif 35#endif
36 36
37#ifdef CONFIG_NUMA 37#ifdef CONFIG_NUMA
diff --git a/include/asm-x86/topology_64.h b/include/asm-x86/topology_64.h
index 36e52fba7960..848c17f92226 100644
--- a/include/asm-x86/topology_64.h
+++ b/include/asm-x86/topology_64.h
@@ -58,8 +58,8 @@ extern int __node_distance(int, int);
58#ifdef CONFIG_SMP 58#ifdef CONFIG_SMP
59#define topology_physical_package_id(cpu) (cpu_data[cpu].phys_proc_id) 59#define topology_physical_package_id(cpu) (cpu_data[cpu].phys_proc_id)
60#define topology_core_id(cpu) (cpu_data[cpu].cpu_core_id) 60#define topology_core_id(cpu) (cpu_data[cpu].cpu_core_id)
61#define topology_core_siblings(cpu) (cpu_core_map[cpu]) 61#define topology_core_siblings(cpu) (per_cpu(cpu_core_map, cpu))
62#define topology_thread_siblings(cpu) (cpu_sibling_map[cpu]) 62#define topology_thread_siblings(cpu) (per_cpu(cpu_sibling_map, cpu))
63#define mc_capable() (boot_cpu_data.x86_max_cores > 1) 63#define mc_capable() (boot_cpu_data.x86_max_cores > 1)
64#define smt_capable() (smp_num_siblings > 1) 64#define smt_capable() (smp_num_siblings > 1)
65#endif 65#endif
diff --git a/include/asm-x86/tsc.h b/include/asm-x86/tsc.h
index a4d806610b7f..6baab30dc2c8 100644
--- a/include/asm-x86/tsc.h
+++ b/include/asm-x86/tsc.h
@@ -1,13 +1,14 @@
1/* 1/*
2 * linux/include/asm-i386/tsc.h 2 * x86 TSC related functions
3 *
4 * i386 TSC related functions
5 */ 3 */
6#ifndef _ASM_i386_TSC_H 4#ifndef _ASM_X86_TSC_H
7#define _ASM_i386_TSC_H 5#define _ASM_X86_TSC_H
8 6
9#include <asm/processor.h> 7#include <asm/processor.h>
10 8
9#define NS_SCALE 10 /* 2^10, carefully chosen */
10#define US_SCALE 32 /* 2^32, arbitralrily chosen */
11
11/* 12/*
12 * Standard way to access the cycle counter. 13 * Standard way to access the cycle counter.
13 */ 14 */
@@ -72,4 +73,8 @@ int check_tsc_unstable(void);
72extern void check_tsc_sync_source(int cpu); 73extern void check_tsc_sync_source(int cpu);
73extern void check_tsc_sync_target(void); 74extern void check_tsc_sync_target(void);
74 75
76#ifdef CONFIG_X86_64
77extern void tsc_calibrate(void);
78#endif
79
75#endif 80#endif
diff --git a/include/asm-x86/vsyscall.h b/include/asm-x86/vsyscall.h
index 3b8ceb4af2cf..f01c49f5d108 100644
--- a/include/asm-x86/vsyscall.h
+++ b/include/asm-x86/vsyscall.h
@@ -29,9 +29,6 @@ enum vsyscall_num {
29#define VGETCPU_RDTSCP 1 29#define VGETCPU_RDTSCP 1
30#define VGETCPU_LSL 2 30#define VGETCPU_LSL 2
31 31
32#define hpet_readl(a) readl((const void __iomem *)fix_to_virt(FIX_HPET_BASE) + a)
33#define hpet_writel(d,a) writel(d, (void __iomem *)fix_to_virt(FIX_HPET_BASE) + a)
34
35extern int __vgetcpu_mode; 32extern int __vgetcpu_mode;
36extern volatile unsigned long __jiffies; 33extern volatile unsigned long __jiffies;
37 34
diff --git a/include/linux/agpgart.h b/include/linux/agpgart.h
index bfb8ec791b7b..09fbf7e5a6cb 100644
--- a/include/linux/agpgart.h
+++ b/include/linux/agpgart.h
@@ -197,7 +197,7 @@ struct agp_file_private {
197 struct agp_file_private *next; 197 struct agp_file_private *next;
198 struct agp_file_private *prev; 198 struct agp_file_private *prev;
199 pid_t my_pid; 199 pid_t my_pid;
200 long access_flags; /* long req'd for set_bit --RR */ 200 unsigned long access_flags; /* long req'd for set_bit --RR */
201}; 201};
202 202
203struct agp_front_data { 203struct agp_front_data {
diff --git a/include/linux/ata.h b/include/linux/ata.h
index c043c1ccf1c5..a4f373f8b798 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -230,6 +230,12 @@ enum {
230 230
231 SETFEATURES_SPINUP = 0x07, /* Spin-up drive */ 231 SETFEATURES_SPINUP = 0x07, /* Spin-up drive */
232 232
233 SETFEATURES_SATA_ENABLE = 0x10, /* Enable use of SATA feature */
234 SETFEATURES_SATA_DISABLE = 0x90, /* Disable use of SATA feature */
235
236 /* SETFEATURE Sector counts for SATA features */
237 SATA_AN = 0x05, /* Asynchronous Notification */
238
233 /* ATAPI stuff */ 239 /* ATAPI stuff */
234 ATAPI_PKT_DMA = (1 << 0), 240 ATAPI_PKT_DMA = (1 << 0),
235 ATAPI_DMADIR = (1 << 2), /* ATAPI data dir: 241 ATAPI_DMADIR = (1 << 2), /* ATAPI data dir:
@@ -281,6 +287,15 @@ enum {
281 SERR_PROTOCOL = (1 << 10), /* protocol violation */ 287 SERR_PROTOCOL = (1 << 10), /* protocol violation */
282 SERR_INTERNAL = (1 << 11), /* host internal error */ 288 SERR_INTERNAL = (1 << 11), /* host internal error */
283 SERR_PHYRDY_CHG = (1 << 16), /* PHY RDY changed */ 289 SERR_PHYRDY_CHG = (1 << 16), /* PHY RDY changed */
290 SERR_PHY_INT_ERR = (1 << 17), /* PHY internal error */
291 SERR_COMM_WAKE = (1 << 18), /* Comm wake */
292 SERR_10B_8B_ERR = (1 << 19), /* 10b to 8b decode error */
293 SERR_DISPARITY = (1 << 20), /* Disparity */
294 SERR_CRC = (1 << 21), /* CRC error */
295 SERR_HANDSHAKE = (1 << 22), /* Handshake error */
296 SERR_LINK_SEQ_ERR = (1 << 23), /* Link sequence error */
297 SERR_TRANS_ST_ERROR = (1 << 24), /* Transport state trans. error */
298 SERR_UNRECOG_FIS = (1 << 25), /* Unrecognized FIS */
284 SERR_DEV_XCHG = (1 << 26), /* device exchanged */ 299 SERR_DEV_XCHG = (1 << 26), /* device exchanged */
285 300
286 /* struct ata_taskfile flags */ 301 /* struct ata_taskfile flags */
@@ -341,24 +356,17 @@ struct ata_taskfile {
341}; 356};
342 357
343#define ata_id_is_ata(id) (((id)[0] & (1 << 15)) == 0) 358#define ata_id_is_ata(id) (((id)[0] & (1 << 15)) == 0)
344#define ata_id_rahead_enabled(id) ((id)[85] & (1 << 6))
345#define ata_id_wcache_enabled(id) ((id)[85] & (1 << 5))
346#define ata_id_hpa_enabled(id) ((id)[85] & (1 << 10))
347#define ata_id_has_fua(id) ((id)[84] & (1 << 6))
348#define ata_id_has_flush(id) ((id)[83] & (1 << 12))
349#define ata_id_has_flush_ext(id) ((id)[83] & (1 << 13))
350#define ata_id_has_lba48(id) ((id)[83] & (1 << 10))
351#define ata_id_has_hpa(id) ((id)[82] & (1 << 10))
352#define ata_id_has_wcache(id) ((id)[82] & (1 << 5))
353#define ata_id_has_pm(id) ((id)[82] & (1 << 3))
354#define ata_id_has_lba(id) ((id)[49] & (1 << 9)) 359#define ata_id_has_lba(id) ((id)[49] & (1 << 9))
355#define ata_id_has_dma(id) ((id)[49] & (1 << 8)) 360#define ata_id_has_dma(id) ((id)[49] & (1 << 8))
356#define ata_id_has_ncq(id) ((id)[76] & (1 << 8)) 361#define ata_id_has_ncq(id) ((id)[76] & (1 << 8))
357#define ata_id_queue_depth(id) (((id)[75] & 0x1f) + 1) 362#define ata_id_queue_depth(id) (((id)[75] & 0x1f) + 1)
358#define ata_id_removeable(id) ((id)[0] & (1 << 7)) 363#define ata_id_removeable(id) ((id)[0] & (1 << 7))
359#define ata_id_has_dword_io(id) ((id)[50] & (1 << 0)) 364#define ata_id_has_dword_io(id) ((id)[48] & (1 << 0))
365#define ata_id_has_atapi_AN(id) \
366 ( (((id)[76] != 0x0000) && ((id)[76] != 0xffff)) && \
367 ((id)[78] & (1 << 5)) )
360#define ata_id_iordy_disable(id) ((id)[49] & (1 << 10)) 368#define ata_id_iordy_disable(id) ((id)[49] & (1 << 10))
361#define ata_id_has_iordy(id) ((id)[49] & (1 << 9)) 369#define ata_id_has_iordy(id) ((id)[49] & (1 << 11))
362#define ata_id_u32(id,n) \ 370#define ata_id_u32(id,n) \
363 (((u32) (id)[(n) + 1] << 16) | ((u32) (id)[(n)])) 371 (((u32) (id)[(n) + 1] << 16) | ((u32) (id)[(n)]))
364#define ata_id_u64(id,n) \ 372#define ata_id_u64(id,n) \
@@ -369,6 +377,90 @@ struct ata_taskfile {
369 377
370#define ata_id_cdb_intr(id) (((id)[0] & 0x60) == 0x20) 378#define ata_id_cdb_intr(id) (((id)[0] & 0x60) == 0x20)
371 379
380static inline int ata_id_has_fua(const u16 *id)
381{
382 if ((id[84] & 0xC000) != 0x4000)
383 return 0;
384 return id[84] & (1 << 6);
385}
386
387static inline int ata_id_has_flush(const u16 *id)
388{
389 if ((id[83] & 0xC000) != 0x4000)
390 return 0;
391 return id[83] & (1 << 12);
392}
393
394static inline int ata_id_has_flush_ext(const u16 *id)
395{
396 if ((id[83] & 0xC000) != 0x4000)
397 return 0;
398 return id[83] & (1 << 13);
399}
400
401static inline int ata_id_has_lba48(const u16 *id)
402{
403 if ((id[83] & 0xC000) != 0x4000)
404 return 0;
405 return id[83] & (1 << 10);
406}
407
408static inline int ata_id_hpa_enabled(const u16 *id)
409{
410 /* Yes children, word 83 valid bits cover word 82 data */
411 if ((id[83] & 0xC000) != 0x4000)
412 return 0;
413 /* And 87 covers 85-87 */
414 if ((id[87] & 0xC000) != 0x4000)
415 return 0;
416 /* Check command sets enabled as well as supported */
417 if ((id[85] & ( 1 << 10)) == 0)
418 return 0;
419 return id[82] & (1 << 10);
420}
421
422static inline int ata_id_has_wcache(const u16 *id)
423{
424 /* Yes children, word 83 valid bits cover word 82 data */
425 if ((id[83] & 0xC000) != 0x4000)
426 return 0;
427 return id[82] & (1 << 5);
428}
429
430static inline int ata_id_has_pm(const u16 *id)
431{
432 if ((id[83] & 0xC000) != 0x4000)
433 return 0;
434 return id[82] & (1 << 3);
435}
436
437static inline int ata_id_rahead_enabled(const u16 *id)
438{
439 if ((id[87] & 0xC000) != 0x4000)
440 return 0;
441 return id[85] & (1 << 6);
442}
443
444static inline int ata_id_wcache_enabled(const u16 *id)
445{
446 if ((id[87] & 0xC000) != 0x4000)
447 return 0;
448 return id[85] & (1 << 5);
449}
450
451/**
452 * ata_id_major_version - get ATA level of drive
453 * @id: Identify data
454 *
455 * Caveats:
456 * ATA-1 considers identify optional
457 * ATA-2 introduces mandatory identify
458 * ATA-3 introduces word 80 and accurate reporting
459 *
460 * The practical impact of this is that ata_id_major_version cannot
461 * reliably report on drives below ATA3.
462 */
463
372static inline unsigned int ata_id_major_version(const u16 *id) 464static inline unsigned int ata_id_major_version(const u16 *id)
373{ 465{
374 unsigned int mver; 466 unsigned int mver;
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 089a8bc55dd4..4da441337d6e 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -176,13 +176,28 @@ struct bio {
176#define bio_offset(bio) bio_iovec((bio))->bv_offset 176#define bio_offset(bio) bio_iovec((bio))->bv_offset
177#define bio_segments(bio) ((bio)->bi_vcnt - (bio)->bi_idx) 177#define bio_segments(bio) ((bio)->bi_vcnt - (bio)->bi_idx)
178#define bio_sectors(bio) ((bio)->bi_size >> 9) 178#define bio_sectors(bio) ((bio)->bi_size >> 9)
179#define bio_cur_sectors(bio) (bio_iovec(bio)->bv_len >> 9)
180#define bio_data(bio) (page_address(bio_page((bio))) + bio_offset((bio)))
181#define bio_barrier(bio) ((bio)->bi_rw & (1 << BIO_RW_BARRIER)) 179#define bio_barrier(bio) ((bio)->bi_rw & (1 << BIO_RW_BARRIER))
182#define bio_sync(bio) ((bio)->bi_rw & (1 << BIO_RW_SYNC)) 180#define bio_sync(bio) ((bio)->bi_rw & (1 << BIO_RW_SYNC))
183#define bio_failfast(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST)) 181#define bio_failfast(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST))
184#define bio_rw_ahead(bio) ((bio)->bi_rw & (1 << BIO_RW_AHEAD)) 182#define bio_rw_ahead(bio) ((bio)->bi_rw & (1 << BIO_RW_AHEAD))
185#define bio_rw_meta(bio) ((bio)->bi_rw & (1 << BIO_RW_META)) 183#define bio_rw_meta(bio) ((bio)->bi_rw & (1 << BIO_RW_META))
184#define bio_empty_barrier(bio) (bio_barrier(bio) && !(bio)->bi_size)
185
186static inline unsigned int bio_cur_sectors(struct bio *bio)
187{
188 if (bio->bi_vcnt)
189 return bio_iovec(bio)->bv_len >> 9;
190
191 return 0;
192}
193
194static inline void *bio_data(struct bio *bio)
195{
196 if (bio->bi_vcnt)
197 return page_address(bio_page(bio)) + bio_offset(bio);
198
199 return NULL;
200}
186 201
187/* 202/*
188 * will die 203 * will die
diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index 638165f571da..b9fb8ee3308b 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -8,6 +8,12 @@
8 */ 8 */
9#include <asm/bitops.h> 9#include <asm/bitops.h>
10 10
11#define for_each_bit(bit, addr, size) \
12 for ((bit) = find_first_bit((addr), (size)); \
13 (bit) < (size); \
14 (bit) = find_next_bit((addr), (size), (bit) + 1))
15
16
11static __inline__ int get_bitmask_order(unsigned int count) 17static __inline__ int get_bitmask_order(unsigned int count)
12{ 18{
13 int order; 19 int order;
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 95be0ac57e76..bbf906a0b419 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -20,20 +20,6 @@
20 20
21#include <asm/scatterlist.h> 21#include <asm/scatterlist.h>
22 22
23#ifdef CONFIG_LBD
24# include <asm/div64.h>
25# define sector_div(a, b) do_div(a, b)
26#else
27# define sector_div(n, b)( \
28{ \
29 int _res; \
30 _res = (n) % (b); \
31 (n) /= (b); \
32 _res; \
33} \
34)
35#endif
36
37struct scsi_ioctl_command; 23struct scsi_ioctl_command;
38 24
39struct request_queue; 25struct request_queue;
@@ -344,7 +330,6 @@ typedef void (unplug_fn) (struct request_queue *);
344 330
345struct bio_vec; 331struct bio_vec;
346typedef int (merge_bvec_fn) (struct request_queue *, struct bio *, struct bio_vec *); 332typedef int (merge_bvec_fn) (struct request_queue *, struct bio *, struct bio_vec *);
347typedef int (issue_flush_fn) (struct request_queue *, struct gendisk *, sector_t *);
348typedef void (prepare_flush_fn) (struct request_queue *, struct request *); 333typedef void (prepare_flush_fn) (struct request_queue *, struct request *);
349typedef void (softirq_done_fn)(struct request *); 334typedef void (softirq_done_fn)(struct request *);
350 335
@@ -382,7 +367,6 @@ struct request_queue
382 prep_rq_fn *prep_rq_fn; 367 prep_rq_fn *prep_rq_fn;
383 unplug_fn *unplug_fn; 368 unplug_fn *unplug_fn;
384 merge_bvec_fn *merge_bvec_fn; 369 merge_bvec_fn *merge_bvec_fn;
385 issue_flush_fn *issue_flush_fn;
386 prepare_flush_fn *prepare_flush_fn; 370 prepare_flush_fn *prepare_flush_fn;
387 softirq_done_fn *softirq_done_fn; 371 softirq_done_fn *softirq_done_fn;
388 372
@@ -554,6 +538,7 @@ enum {
554#define blk_barrier_rq(rq) ((rq)->cmd_flags & REQ_HARDBARRIER) 538#define blk_barrier_rq(rq) ((rq)->cmd_flags & REQ_HARDBARRIER)
555#define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA) 539#define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA)
556#define blk_bidi_rq(rq) ((rq)->next_rq != NULL) 540#define blk_bidi_rq(rq) ((rq)->next_rq != NULL)
541#define blk_empty_barrier(rq) (blk_barrier_rq(rq) && blk_fs_request(rq) && !(rq)->hard_nr_sectors)
557 542
558#define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist) 543#define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist)
559 544
@@ -743,7 +728,9 @@ static inline void blk_run_address_space(struct address_space *mapping)
743extern int end_that_request_first(struct request *, int, int); 728extern int end_that_request_first(struct request *, int, int);
744extern int end_that_request_chunk(struct request *, int, int); 729extern int end_that_request_chunk(struct request *, int, int);
745extern void end_that_request_last(struct request *, int); 730extern void end_that_request_last(struct request *, int);
746extern void end_request(struct request *req, int uptodate); 731extern void end_request(struct request *, int);
732extern void end_queued_request(struct request *, int);
733extern void end_dequeued_request(struct request *, int);
747extern void blk_complete_request(struct request *); 734extern void blk_complete_request(struct request *);
748 735
749/* 736/*
@@ -781,7 +768,6 @@ extern void blk_queue_dma_alignment(struct request_queue *, int);
781extern void blk_queue_softirq_done(struct request_queue *, softirq_done_fn *); 768extern void blk_queue_softirq_done(struct request_queue *, softirq_done_fn *);
782extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); 769extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev);
783extern int blk_queue_ordered(struct request_queue *, unsigned, prepare_flush_fn *); 770extern int blk_queue_ordered(struct request_queue *, unsigned, prepare_flush_fn *);
784extern void blk_queue_issue_flush_fn(struct request_queue *, issue_flush_fn *);
785extern int blk_do_ordered(struct request_queue *, struct request **); 771extern int blk_do_ordered(struct request_queue *, struct request **);
786extern unsigned blk_ordered_cur_seq(struct request_queue *); 772extern unsigned blk_ordered_cur_seq(struct request_queue *);
787extern unsigned blk_ordered_req_seq(struct request *); 773extern unsigned blk_ordered_req_seq(struct request *);
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
index 2e105a12fe29..7e11d23ac36a 100644
--- a/include/linux/blktrace_api.h
+++ b/include/linux/blktrace_api.h
@@ -290,12 +290,7 @@ static inline void blk_add_trace_remap(struct request_queue *q, struct bio *bio,
290#define blk_add_trace_generic(q, rq, rw, what) do { } while (0) 290#define blk_add_trace_generic(q, rq, rw, what) do { } while (0)
291#define blk_add_trace_pdu_int(q, what, bio, pdu) do { } while (0) 291#define blk_add_trace_pdu_int(q, what, bio, pdu) do { } while (0)
292#define blk_add_trace_remap(q, bio, dev, f, t) do {} while (0) 292#define blk_add_trace_remap(q, bio, dev, f, t) do {} while (0)
293static inline int do_blk_trace_setup(struct request_queue *q, 293#define do_blk_trace_setup(q, bdev, buts) (-ENOTTY)
294 struct block_device *bdev,
295 struct blk_user_trace_setup *buts)
296{
297 return 0;
298}
299#endif /* CONFIG_BLK_DEV_IO_TRACE */ 294#endif /* CONFIG_BLK_DEV_IO_TRACE */
300#endif /* __KERNEL__ */ 295#endif /* __KERNEL__ */
301#endif 296#endif
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index 35cadad84b14..da0d83fbadc0 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -203,10 +203,20 @@ void block_invalidatepage(struct page *page, unsigned long offset);
203int block_write_full_page(struct page *page, get_block_t *get_block, 203int block_write_full_page(struct page *page, get_block_t *get_block,
204 struct writeback_control *wbc); 204 struct writeback_control *wbc);
205int block_read_full_page(struct page*, get_block_t*); 205int block_read_full_page(struct page*, get_block_t*);
206int block_write_begin(struct file *, struct address_space *,
207 loff_t, unsigned, unsigned,
208 struct page **, void **, get_block_t*);
209int block_write_end(struct file *, struct address_space *,
210 loff_t, unsigned, unsigned,
211 struct page *, void *);
212int generic_write_end(struct file *, struct address_space *,
213 loff_t, unsigned, unsigned,
214 struct page *, void *);
215void page_zero_new_buffers(struct page *page, unsigned from, unsigned to);
206int block_prepare_write(struct page*, unsigned, unsigned, get_block_t*); 216int block_prepare_write(struct page*, unsigned, unsigned, get_block_t*);
207int cont_prepare_write(struct page*, unsigned, unsigned, get_block_t*, 217int cont_write_begin(struct file *, struct address_space *, loff_t,
208 loff_t *); 218 unsigned, unsigned, struct page **, void **,
209int generic_cont_expand(struct inode *inode, loff_t size); 219 get_block_t *, loff_t *);
210int generic_cont_expand_simple(struct inode *inode, loff_t size); 220int generic_cont_expand_simple(struct inode *inode, loff_t size);
211int block_commit_write(struct page *page, unsigned from, unsigned to); 221int block_commit_write(struct page *page, unsigned from, unsigned to);
212int block_page_mkwrite(struct vm_area_struct *vma, struct page *page, 222int block_page_mkwrite(struct vm_area_struct *vma, struct page *page,
@@ -216,9 +226,13 @@ sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *);
216int generic_commit_write(struct file *, struct page *, unsigned, unsigned); 226int generic_commit_write(struct file *, struct page *, unsigned, unsigned);
217int block_truncate_page(struct address_space *, loff_t, get_block_t *); 227int block_truncate_page(struct address_space *, loff_t, get_block_t *);
218int file_fsync(struct file *, struct dentry *, int); 228int file_fsync(struct file *, struct dentry *, int);
219int nobh_prepare_write(struct page*, unsigned, unsigned, get_block_t*); 229int nobh_write_begin(struct file *, struct address_space *,
220int nobh_commit_write(struct file *, struct page *, unsigned, unsigned); 230 loff_t, unsigned, unsigned,
221int nobh_truncate_page(struct address_space *, loff_t); 231 struct page **, void **, get_block_t*);
232int nobh_write_end(struct file *, struct address_space *,
233 loff_t, unsigned, unsigned,
234 struct page *, void *);
235int nobh_truncate_page(struct address_space *, loff_t, get_block_t *);
222int nobh_writepage(struct page *page, get_block_t *get_block, 236int nobh_writepage(struct page *page, get_block_t *get_block,
223 struct writeback_control *wbc); 237 struct writeback_control *wbc);
224 238
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
index def5a659b8a5..c33b0dc28e4d 100644
--- a/include/linux/clockchips.h
+++ b/include/linux/clockchips.h
@@ -8,7 +8,7 @@
8#ifndef _LINUX_CLOCKCHIPS_H 8#ifndef _LINUX_CLOCKCHIPS_H
9#define _LINUX_CLOCKCHIPS_H 9#define _LINUX_CLOCKCHIPS_H
10 10
11#ifdef CONFIG_GENERIC_CLOCKEVENTS 11#ifdef CONFIG_GENERIC_CLOCKEVENTS_BUILD
12 12
13#include <linux/clocksource.h> 13#include <linux/clocksource.h>
14#include <linux/cpumask.h> 14#include <linux/cpumask.h>
@@ -31,6 +31,7 @@ enum clock_event_nofitiers {
31 CLOCK_EVT_NOTIFY_ADD, 31 CLOCK_EVT_NOTIFY_ADD,
32 CLOCK_EVT_NOTIFY_BROADCAST_ON, 32 CLOCK_EVT_NOTIFY_BROADCAST_ON,
33 CLOCK_EVT_NOTIFY_BROADCAST_OFF, 33 CLOCK_EVT_NOTIFY_BROADCAST_OFF,
34 CLOCK_EVT_NOTIFY_BROADCAST_FORCE,
34 CLOCK_EVT_NOTIFY_BROADCAST_ENTER, 35 CLOCK_EVT_NOTIFY_BROADCAST_ENTER,
35 CLOCK_EVT_NOTIFY_BROADCAST_EXIT, 36 CLOCK_EVT_NOTIFY_BROADCAST_EXIT,
36 CLOCK_EVT_NOTIFY_SUSPEND, 37 CLOCK_EVT_NOTIFY_SUSPEND,
@@ -126,11 +127,14 @@ extern int clockevents_register_notifier(struct notifier_block *nb);
126extern int clockevents_program_event(struct clock_event_device *dev, 127extern int clockevents_program_event(struct clock_event_device *dev,
127 ktime_t expires, ktime_t now); 128 ktime_t expires, ktime_t now);
128 129
130#ifdef CONFIG_GENERIC_CLOCKEVENTS
129extern void clockevents_notify(unsigned long reason, void *arg); 131extern void clockevents_notify(unsigned long reason, void *arg);
130
131#else 132#else
133# define clockevents_notify(reason, arg) do { } while (0)
134#endif
135
136#else /* CONFIG_GENERIC_CLOCKEVENTS_BUILD */
132 137
133static inline void clockevents_resume_events(void) { }
134#define clockevents_notify(reason, arg) do { } while (0) 138#define clockevents_notify(reason, arg) do { } while (0)
135 139
136#endif 140#endif
diff --git a/include/linux/connector.h b/include/linux/connector.h
index b62f823e90cf..13fc4541bf23 100644
--- a/include/linux/connector.h
+++ b/include/linux/connector.h
@@ -36,14 +36,15 @@
36#define CN_VAL_CIFS 0x1 36#define CN_VAL_CIFS 0x1
37#define CN_W1_IDX 0x3 /* w1 communication */ 37#define CN_W1_IDX 0x3 /* w1 communication */
38#define CN_W1_VAL 0x1 38#define CN_W1_VAL 0x1
39#define CN_IDX_V86D 0x4
40#define CN_VAL_V86D_UVESAFB 0x1
39 41
40 42#define CN_NETLINK_USERS 5
41#define CN_NETLINK_USERS 4
42 43
43/* 44/*
44 * Maximum connector's message size. 45 * Maximum connector's message size.
45 */ 46 */
46#define CONNECTOR_MAX_MSG_SIZE 1024 47#define CONNECTOR_MAX_MSG_SIZE 16384
47 48
48/* 49/*
49 * idx and val are unique identifiers which 50 * idx and val are unique identifiers which
diff --git a/include/linux/console.h b/include/linux/console.h
index 56a7bcda49cb..0a4542ddb73d 100644
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -45,7 +45,8 @@ struct consw {
45 int (*con_font_get)(struct vc_data *, struct console_font *); 45 int (*con_font_get)(struct vc_data *, struct console_font *);
46 int (*con_font_default)(struct vc_data *, struct console_font *, char *); 46 int (*con_font_default)(struct vc_data *, struct console_font *, char *);
47 int (*con_font_copy)(struct vc_data *, int); 47 int (*con_font_copy)(struct vc_data *, int);
48 int (*con_resize)(struct vc_data *, unsigned int, unsigned int); 48 int (*con_resize)(struct vc_data *, unsigned int, unsigned int,
49 unsigned int);
49 int (*con_set_palette)(struct vc_data *, unsigned char *); 50 int (*con_set_palette)(struct vc_data *, unsigned char *);
50 int (*con_scrolldelta)(struct vc_data *, int); 51 int (*con_scrolldelta)(struct vc_data *, int);
51 int (*con_set_origin)(struct vc_data *); 52 int (*con_set_origin)(struct vc_data *);
diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h
index dc77fed7b285..d71f7c0f931b 100644
--- a/include/linux/console_struct.h
+++ b/include/linux/console_struct.h
@@ -100,6 +100,7 @@ struct vc_data {
100 unsigned char vc_G1_charset; 100 unsigned char vc_G1_charset;
101 unsigned char vc_saved_G0; 101 unsigned char vc_saved_G0;
102 unsigned char vc_saved_G1; 102 unsigned char vc_saved_G1;
103 unsigned int vc_resize_user; /* resize request from user */
103 unsigned int vc_bell_pitch; /* Console bell pitch */ 104 unsigned int vc_bell_pitch; /* Console bell pitch */
104 unsigned int vc_bell_duration; /* Console bell duration */ 105 unsigned int vc_bell_duration; /* Console bell duration */
105 struct vc_data **vc_display_fg; /* [!] Ptr to var holding fg console for this display */ 106 struct vc_data **vc_display_fg; /* [!] Ptr to var holding fg console for this display */
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 3ec6e7ff5fbd..23932d7741a9 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -32,12 +32,24 @@
32 * CPUFREQ NOTIFIER INTERFACE * 32 * CPUFREQ NOTIFIER INTERFACE *
33 *********************************************************************/ 33 *********************************************************************/
34 34
35int cpufreq_register_notifier(struct notifier_block *nb, unsigned int list);
36int cpufreq_unregister_notifier(struct notifier_block *nb, unsigned int list);
37
38#define CPUFREQ_TRANSITION_NOTIFIER (0) 35#define CPUFREQ_TRANSITION_NOTIFIER (0)
39#define CPUFREQ_POLICY_NOTIFIER (1) 36#define CPUFREQ_POLICY_NOTIFIER (1)
40 37
38#ifdef CONFIG_CPU_FREQ
39int cpufreq_register_notifier(struct notifier_block *nb, unsigned int list);
40int cpufreq_unregister_notifier(struct notifier_block *nb, unsigned int list);
41#else /* CONFIG_CPU_FREQ */
42static inline int cpufreq_register_notifier(struct notifier_block *nb,
43 unsigned int list)
44{
45 return 0;
46}
47static inline int cpufreq_unregister_notifier(struct notifier_block *nb,
48 unsigned int list)
49{
50 return 0;
51}
52#endif /* CONFIG_CPU_FREQ */
41 53
42/* if (cpufreq_driver->target) exists, the ->governor decides what frequency 54/* if (cpufreq_driver->target) exists, the ->governor decides what frequency
43 * within the limits is used. If (cpufreq_driver->setpolicy> exists, these 55 * within the limits is used. If (cpufreq_driver->setpolicy> exists, these
@@ -155,6 +167,9 @@ struct cpufreq_governor {
155 char name[CPUFREQ_NAME_LEN]; 167 char name[CPUFREQ_NAME_LEN];
156 int (*governor) (struct cpufreq_policy *policy, 168 int (*governor) (struct cpufreq_policy *policy,
157 unsigned int event); 169 unsigned int event);
170 unsigned int max_transition_latency; /* HW must be able to switch to
171 next freq faster than this value in nano secs or we
172 will fallback to performance governor */
158 struct list_head governor_list; 173 struct list_head governor_list;
159 struct module *owner; 174 struct module *owner;
160}; 175};
@@ -279,12 +294,24 @@ static inline unsigned int cpufreq_quick_get(unsigned int cpu)
279 *********************************************************************/ 294 *********************************************************************/
280 295
281 296
282#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE 297/*
298 Performance governor is fallback governor if any other gov failed to
299 auto load due latency restrictions
300*/
301#ifdef CONFIG_CPU_FREQ_GOV_PERFORMANCE
283extern struct cpufreq_governor cpufreq_gov_performance; 302extern struct cpufreq_governor cpufreq_gov_performance;
284#define CPUFREQ_DEFAULT_GOVERNOR &cpufreq_gov_performance 303#endif
304#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE
305#define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_performance)
285#elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE) 306#elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE)
286extern struct cpufreq_governor cpufreq_gov_userspace; 307extern struct cpufreq_governor cpufreq_gov_userspace;
287#define CPUFREQ_DEFAULT_GOVERNOR &cpufreq_gov_userspace 308#define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_userspace)
309#elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND)
310extern struct cpufreq_governor cpufreq_gov_ondemand;
311#define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_ondemand)
312#elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE)
313extern struct cpufreq_governor cpufreq_gov_conservative;
314#define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_conservative)
288#endif 315#endif
289 316
290 317
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h
index 826b15e914e2..9e633ea103ce 100644
--- a/include/linux/cpuset.h
+++ b/include/linux/cpuset.h
@@ -93,7 +93,7 @@ static inline nodemask_t cpuset_mems_allowed(struct task_struct *p)
93 return node_possible_map; 93 return node_possible_map;
94} 94}
95 95
96#define cpuset_current_mems_allowed (node_online_map) 96#define cpuset_current_mems_allowed (node_states[N_HIGH_MEMORY])
97static inline void cpuset_init_current_mems_allowed(void) {} 97static inline void cpuset_init_current_mems_allowed(void) {}
98static inline void cpuset_update_task_memory_state(void) {} 98static inline void cpuset_update_task_memory_state(void) {}
99#define cpuset_nodes_subset_current_mems_allowed(nodes) (1) 99#define cpuset_nodes_subset_current_mems_allowed(nodes) (1)
diff --git a/include/linux/dca.h b/include/linux/dca.h
new file mode 100644
index 000000000000..83eaecc6f8ab
--- /dev/null
+++ b/include/linux/dca.h
@@ -0,0 +1,47 @@
1#ifndef DCA_H
2#define DCA_H
3/* DCA Provider API */
4
5/* DCA Notifier Interface */
6void dca_register_notify(struct notifier_block *nb);
7void dca_unregister_notify(struct notifier_block *nb);
8
9#define DCA_PROVIDER_ADD 0x0001
10#define DCA_PROVIDER_REMOVE 0x0002
11
12struct dca_provider {
13 struct dca_ops *ops;
14 struct class_device *cd;
15 int id;
16};
17
18struct dca_ops {
19 int (*add_requester) (struct dca_provider *, struct device *);
20 int (*remove_requester) (struct dca_provider *, struct device *);
21 u8 (*get_tag) (struct dca_provider *, int cpu);
22};
23
24struct dca_provider *alloc_dca_provider(struct dca_ops *ops, int priv_size);
25void free_dca_provider(struct dca_provider *dca);
26int register_dca_provider(struct dca_provider *dca, struct device *dev);
27void unregister_dca_provider(struct dca_provider *dca);
28
29static inline void *dca_priv(struct dca_provider *dca)
30{
31 return (void *)dca + sizeof(struct dca_provider);
32}
33
34/* Requester API */
35int dca_add_requester(struct device *dev);
36int dca_remove_requester(struct device *dev);
37u8 dca_get_tag(int cpu);
38
39/* internal stuff */
40int __init dca_sysfs_init(void);
41void __exit dca_sysfs_exit(void);
42int dca_sysfs_add_provider(struct dca_provider *dca, struct device *dev);
43void dca_sysfs_remove_provider(struct dca_provider *dca);
44int dca_sysfs_add_req(struct dca_provider *dca, struct device *dev, int slot);
45void dca_sysfs_remove_req(struct dca_provider *dca, int slot);
46
47#endif /* DCA_H */
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h
index 104e51e20e14..f592d6de3b97 100644
--- a/include/linux/debugfs.h
+++ b/include/linux/debugfs.h
@@ -49,6 +49,12 @@ struct dentry *debugfs_create_u32(const char *name, mode_t mode,
49 struct dentry *parent, u32 *value); 49 struct dentry *parent, u32 *value);
50struct dentry *debugfs_create_u64(const char *name, mode_t mode, 50struct dentry *debugfs_create_u64(const char *name, mode_t mode,
51 struct dentry *parent, u64 *value); 51 struct dentry *parent, u64 *value);
52struct dentry *debugfs_create_x8(const char *name, mode_t mode,
53 struct dentry *parent, u8 *value);
54struct dentry *debugfs_create_x16(const char *name, mode_t mode,
55 struct dentry *parent, u16 *value);
56struct dentry *debugfs_create_x32(const char *name, mode_t mode,
57 struct dentry *parent, u32 *value);
52struct dentry *debugfs_create_bool(const char *name, mode_t mode, 58struct dentry *debugfs_create_bool(const char *name, mode_t mode,
53 struct dentry *parent, u32 *value); 59 struct dentry *parent, u32 *value);
54 60
@@ -122,6 +128,27 @@ static inline struct dentry *debugfs_create_u64(const char *name, mode_t mode,
122 return ERR_PTR(-ENODEV); 128 return ERR_PTR(-ENODEV);
123} 129}
124 130
131static inline struct dentry *debugfs_create_x8(const char *name, mode_t mode,
132 struct dentry *parent,
133 u8 *value)
134{
135 return ERR_PTR(-ENODEV);
136}
137
138static inline struct dentry *debugfs_create_x16(const char *name, mode_t mode,
139 struct dentry *parent,
140 u16 *value)
141{
142 return ERR_PTR(-ENODEV);
143}
144
145static inline struct dentry *debugfs_create_x32(const char *name, mode_t mode,
146 struct dentry *parent,
147 u32 *value)
148{
149 return ERR_PTR(-ENODEV);
150}
151
125static inline struct dentry *debugfs_create_bool(const char *name, mode_t mode, 152static inline struct dentry *debugfs_create_bool(const char *name, mode_t mode,
126 struct dentry *parent, 153 struct dentry *parent,
127 u32 *value) 154 u32 *value)
diff --git a/include/linux/device.h b/include/linux/device.h
index 3a38d1f70cb7..2e15822fe409 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -64,12 +64,9 @@ struct bus_type {
64 struct bus_attribute * bus_attrs; 64 struct bus_attribute * bus_attrs;
65 struct device_attribute * dev_attrs; 65 struct device_attribute * dev_attrs;
66 struct driver_attribute * drv_attrs; 66 struct driver_attribute * drv_attrs;
67 struct bus_attribute drivers_autoprobe_attr;
68 struct bus_attribute drivers_probe_attr;
69 67
70 int (*match)(struct device * dev, struct device_driver * drv); 68 int (*match)(struct device * dev, struct device_driver * drv);
71 int (*uevent)(struct device *dev, char **envp, 69 int (*uevent)(struct device *dev, struct kobj_uevent_env *env);
72 int num_envp, char *buffer, int buffer_size);
73 int (*probe)(struct device * dev); 70 int (*probe)(struct device * dev);
74 int (*remove)(struct device * dev); 71 int (*remove)(struct device * dev);
75 void (*shutdown)(struct device * dev); 72 void (*shutdown)(struct device * dev);
@@ -189,10 +186,8 @@ struct class {
189 struct class_device_attribute * class_dev_attrs; 186 struct class_device_attribute * class_dev_attrs;
190 struct device_attribute * dev_attrs; 187 struct device_attribute * dev_attrs;
191 188
192 int (*uevent)(struct class_device *dev, char **envp, 189 int (*uevent)(struct class_device *dev, struct kobj_uevent_env *env);
193 int num_envp, char *buffer, int buffer_size); 190 int (*dev_uevent)(struct device *dev, struct kobj_uevent_env *env);
194 int (*dev_uevent)(struct device *dev, char **envp, int num_envp,
195 char *buffer, int buffer_size);
196 191
197 void (*release)(struct class_device *dev); 192 void (*release)(struct class_device *dev);
198 void (*class_release)(struct class *class); 193 void (*class_release)(struct class *class);
@@ -268,8 +263,7 @@ struct class_device {
268 struct attribute_group ** groups; /* optional groups */ 263 struct attribute_group ** groups; /* optional groups */
269 264
270 void (*release)(struct class_device *dev); 265 void (*release)(struct class_device *dev);
271 int (*uevent)(struct class_device *dev, char **envp, 266 int (*uevent)(struct class_device *dev, struct kobj_uevent_env *env);
272 int num_envp, char *buffer, int buffer_size);
273 char class_id[BUS_ID_SIZE]; /* unique to this class */ 267 char class_id[BUS_ID_SIZE]; /* unique to this class */
274}; 268};
275 269
@@ -337,8 +331,7 @@ extern void class_device_destroy(struct class *cls, dev_t devt);
337struct device_type { 331struct device_type {
338 const char *name; 332 const char *name;
339 struct attribute_group **groups; 333 struct attribute_group **groups;
340 int (*uevent)(struct device *dev, char **envp, int num_envp, 334 int (*uevent)(struct device *dev, struct kobj_uevent_env *env);
341 char *buffer, int buffer_size);
342 void (*release)(struct device *dev); 335 void (*release)(struct device *dev);
343 int (*suspend)(struct device * dev, pm_message_t state); 336 int (*suspend)(struct device * dev, pm_message_t state);
344 int (*resume)(struct device * dev); 337 int (*resume)(struct device * dev);
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 2dc21cbeb304..0ebfafbd338c 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -24,6 +24,8 @@ 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
27#define DMA_MASK_NONE 0x0ULL
28
27static inline int valid_dma_direction(int dma_direction) 29static inline int valid_dma_direction(int dma_direction)
28{ 30{
29 return ((dma_direction == DMA_BIDIRECTIONAL) || 31 return ((dma_direction == DMA_BIDIRECTIONAL) ||
@@ -31,6 +33,11 @@ static inline int valid_dma_direction(int dma_direction)
31 (dma_direction == DMA_FROM_DEVICE)); 33 (dma_direction == DMA_FROM_DEVICE));
32} 34}
33 35
36static inline int is_device_dma_capable(struct device *dev)
37{
38 return dev->dma_mask != NULL && *dev->dma_mask != DMA_MASK_NONE;
39}
40
34#ifdef CONFIG_HAS_DMA 41#ifdef CONFIG_HAS_DMA
35#include <asm/dma-mapping.h> 42#include <asm/dma-mapping.h>
36#else 43#else
diff --git a/include/linux/fb.h b/include/linux/fb.h
index cec54106aa87..58c57a33e5dd 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -180,6 +180,7 @@ struct fb_bitfield {
180}; 180};
181 181
182#define FB_NONSTD_HAM 1 /* Hold-And-Modify (HAM) */ 182#define FB_NONSTD_HAM 1 /* Hold-And-Modify (HAM) */
183#define FB_NONSTD_REV_PIX_IN_B 2 /* order of pixels in each byte is reversed */
183 184
184#define FB_ACTIVATE_NOW 0 /* set values immediately (or vbl)*/ 185#define FB_ACTIVATE_NOW 0 /* set values immediately (or vbl)*/
185#define FB_ACTIVATE_NXTOPEN 1 /* activate on next open */ 186#define FB_ACTIVATE_NXTOPEN 1 /* activate on next open */
@@ -206,6 +207,7 @@ struct fb_bitfield {
206#define FB_VMODE_NONINTERLACED 0 /* non interlaced */ 207#define FB_VMODE_NONINTERLACED 0 /* non interlaced */
207#define FB_VMODE_INTERLACED 1 /* interlaced */ 208#define FB_VMODE_INTERLACED 1 /* interlaced */
208#define FB_VMODE_DOUBLE 2 /* double scan */ 209#define FB_VMODE_DOUBLE 2 /* double scan */
210#define FB_VMODE_ODD_FLD_FIRST 4 /* interlaced: top line first */
209#define FB_VMODE_MASK 255 211#define FB_VMODE_MASK 255
210 212
211#define FB_VMODE_YWRAP 256 /* ywrap instead of panning */ 213#define FB_VMODE_YWRAP 256 /* ywrap instead of panning */
@@ -1054,6 +1056,7 @@ struct fb_videomode {
1054 u32 flag; 1056 u32 flag;
1055}; 1057};
1056 1058
1059extern const char *fb_mode_option;
1057extern const struct fb_videomode vesa_modes[]; 1060extern const struct fb_videomode vesa_modes[];
1058 1061
1059struct fb_modelist { 1062struct fb_modelist {
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 16421f662a7a..f70d52c46617 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -381,7 +381,7 @@ struct iattr {
381 * trying again. The aop will be taking reasonable 381 * trying again. The aop will be taking reasonable
382 * precautions not to livelock. If the caller held a page 382 * precautions not to livelock. If the caller held a page
383 * reference, it should drop it before retrying. Returned 383 * reference, it should drop it before retrying. Returned
384 * by readpage(), prepare_write(), and commit_write(). 384 * by readpage().
385 * 385 *
386 * address_space_operation functions return these large constants to indicate 386 * address_space_operation functions return these large constants to indicate
387 * special semantics to the caller. These are much larger than the bytes in a 387 * special semantics to the caller. These are much larger than the bytes in a
@@ -394,6 +394,9 @@ enum positive_aop_returns {
394 AOP_TRUNCATED_PAGE = 0x80001, 394 AOP_TRUNCATED_PAGE = 0x80001,
395}; 395};
396 396
397#define AOP_FLAG_UNINTERRUPTIBLE 0x0001 /* will not do a short write */
398#define AOP_FLAG_CONT_EXPAND 0x0002 /* called from cont_expand */
399
397/* 400/*
398 * oh the beauties of C type declarations. 401 * oh the beauties of C type declarations.
399 */ 402 */
@@ -401,6 +404,39 @@ struct page;
401struct address_space; 404struct address_space;
402struct writeback_control; 405struct writeback_control;
403 406
407struct iov_iter {
408 const struct iovec *iov;
409 unsigned long nr_segs;
410 size_t iov_offset;
411 size_t count;
412};
413
414size_t iov_iter_copy_from_user_atomic(struct page *page,
415 struct iov_iter *i, unsigned long offset, size_t bytes);
416size_t iov_iter_copy_from_user(struct page *page,
417 struct iov_iter *i, unsigned long offset, size_t bytes);
418void iov_iter_advance(struct iov_iter *i, size_t bytes);
419int iov_iter_fault_in_readable(struct iov_iter *i, size_t bytes);
420size_t iov_iter_single_seg_count(struct iov_iter *i);
421
422static inline void iov_iter_init(struct iov_iter *i,
423 const struct iovec *iov, unsigned long nr_segs,
424 size_t count, size_t written)
425{
426 i->iov = iov;
427 i->nr_segs = nr_segs;
428 i->iov_offset = 0;
429 i->count = count + written;
430
431 iov_iter_advance(i, written);
432}
433
434static inline size_t iov_iter_count(struct iov_iter *i)
435{
436 return i->count;
437}
438
439
404struct address_space_operations { 440struct address_space_operations {
405 int (*writepage)(struct page *page, struct writeback_control *wbc); 441 int (*writepage)(struct page *page, struct writeback_control *wbc);
406 int (*readpage)(struct file *, struct page *); 442 int (*readpage)(struct file *, struct page *);
@@ -421,6 +457,14 @@ struct address_space_operations {
421 */ 457 */
422 int (*prepare_write)(struct file *, struct page *, unsigned, unsigned); 458 int (*prepare_write)(struct file *, struct page *, unsigned, unsigned);
423 int (*commit_write)(struct file *, struct page *, unsigned, unsigned); 459 int (*commit_write)(struct file *, struct page *, unsigned, unsigned);
460
461 int (*write_begin)(struct file *, struct address_space *mapping,
462 loff_t pos, unsigned len, unsigned flags,
463 struct page **pagep, void **fsdata);
464 int (*write_end)(struct file *, struct address_space *mapping,
465 loff_t pos, unsigned len, unsigned copied,
466 struct page *page, void *fsdata);
467
424 /* Unfortunately this kludge is needed for FIBMAP. Don't use it */ 468 /* Unfortunately this kludge is needed for FIBMAP. Don't use it */
425 sector_t (*bmap)(struct address_space *, sector_t); 469 sector_t (*bmap)(struct address_space *, sector_t);
426 void (*invalidatepage) (struct page *, unsigned long); 470 void (*invalidatepage) (struct page *, unsigned long);
@@ -435,6 +479,18 @@ struct address_space_operations {
435 int (*launder_page) (struct page *); 479 int (*launder_page) (struct page *);
436}; 480};
437 481
482/*
483 * pagecache_write_begin/pagecache_write_end must be used by general code
484 * to write into the pagecache.
485 */
486int pagecache_write_begin(struct file *, struct address_space *mapping,
487 loff_t pos, unsigned len, unsigned flags,
488 struct page **pagep, void **fsdata);
489
490int pagecache_write_end(struct file *, struct address_space *mapping,
491 loff_t pos, unsigned len, unsigned copied,
492 struct page *page, void *fsdata);
493
438struct backing_dev_info; 494struct backing_dev_info;
439struct address_space { 495struct address_space {
440 struct inode *host; /* owner: inode, block_device */ 496 struct inode *host; /* owner: inode, block_device */
@@ -697,16 +753,14 @@ struct fown_struct {
697 * Track a single file's readahead state 753 * Track a single file's readahead state
698 */ 754 */
699struct file_ra_state { 755struct file_ra_state {
700 pgoff_t start; /* where readahead started */ 756 pgoff_t start; /* where readahead started */
701 unsigned long size; /* # of readahead pages */ 757 unsigned int size; /* # of readahead pages */
702 unsigned long async_size; /* do asynchronous readahead when 758 unsigned int async_size; /* do asynchronous readahead when
703 there are only # of pages ahead */ 759 there are only # of pages ahead */
704 760
705 unsigned long ra_pages; /* Maximum readahead window */ 761 unsigned int ra_pages; /* Maximum readahead window */
706 unsigned long mmap_hit; /* Cache hit stat for mmap accesses */ 762 int mmap_miss; /* Cache miss stat for mmap accesses */
707 unsigned long mmap_miss; /* Cache miss stat for mmap accesses */ 763 loff_t prev_pos; /* Cache last read() position */
708 unsigned long prev_index; /* Cache last read() position */
709 unsigned int prev_offset; /* Offset where last read() ended in a page */
710}; 764};
711 765
712/* 766/*
@@ -883,6 +937,7 @@ extern int vfs_setlease(struct file *, long, struct file_lock **);
883extern int lease_modify(struct file_lock **, int); 937extern int lease_modify(struct file_lock **, int);
884extern int lock_may_read(struct inode *, loff_t start, unsigned long count); 938extern int lock_may_read(struct inode *, loff_t start, unsigned long count);
885extern int lock_may_write(struct inode *, loff_t start, unsigned long count); 939extern int lock_may_write(struct inode *, loff_t start, unsigned long count);
940extern struct seq_operations locks_seq_operations;
886 941
887struct fasync_struct { 942struct fasync_struct {
888 int magic; 943 int magic;
@@ -1302,8 +1357,14 @@ struct file_system_type {
1302 struct module *owner; 1357 struct module *owner;
1303 struct file_system_type * next; 1358 struct file_system_type * next;
1304 struct list_head fs_supers; 1359 struct list_head fs_supers;
1360
1305 struct lock_class_key s_lock_key; 1361 struct lock_class_key s_lock_key;
1306 struct lock_class_key s_umount_key; 1362 struct lock_class_key s_umount_key;
1363
1364 struct lock_class_key i_lock_key;
1365 struct lock_class_key i_mutex_key;
1366 struct lock_class_key i_mutex_dir_key;
1367 struct lock_class_key i_alloc_sem_key;
1307}; 1368};
1308 1369
1309extern int get_sb_bdev(struct file_system_type *fs_type, 1370extern int get_sb_bdev(struct file_system_type *fs_type,
@@ -1369,12 +1430,25 @@ extern int locks_mandatory_area(int, struct inode *, struct file *, loff_t, size
1369 * Candidates for mandatory locking have the setgid bit set 1430 * Candidates for mandatory locking have the setgid bit set
1370 * but no group execute bit - an otherwise meaningless combination. 1431 * but no group execute bit - an otherwise meaningless combination.
1371 */ 1432 */
1372#define MANDATORY_LOCK(inode) \ 1433
1373 (IS_MANDLOCK(inode) && ((inode)->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID) 1434static inline int __mandatory_lock(struct inode *ino)
1435{
1436 return (ino->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID;
1437}
1438
1439/*
1440 * ... and these candidates should be on MS_MANDLOCK mounted fs,
1441 * otherwise these will be advisory locks
1442 */
1443
1444static inline int mandatory_lock(struct inode *ino)
1445{
1446 return IS_MANDLOCK(ino) && __mandatory_lock(ino);
1447}
1374 1448
1375static inline int locks_verify_locked(struct inode *inode) 1449static inline int locks_verify_locked(struct inode *inode)
1376{ 1450{
1377 if (MANDATORY_LOCK(inode)) 1451 if (mandatory_lock(inode))
1378 return locks_mandatory_locked(inode); 1452 return locks_mandatory_locked(inode);
1379 return 0; 1453 return 0;
1380} 1454}
@@ -1385,7 +1459,7 @@ static inline int locks_verify_truncate(struct inode *inode,
1385 struct file *filp, 1459 struct file *filp,
1386 loff_t size) 1460 loff_t size)
1387{ 1461{
1388 if (inode->i_flock && MANDATORY_LOCK(inode)) 1462 if (inode->i_flock && mandatory_lock(inode))
1389 return locks_mandatory_area( 1463 return locks_mandatory_area(
1390 FLOCK_VERIFY_WRITE, inode, filp, 1464 FLOCK_VERIFY_WRITE, inode, filp,
1391 size < inode->i_size ? size : inode->i_size, 1465 size < inode->i_size ? size : inode->i_size,
@@ -1815,6 +1889,12 @@ extern int simple_prepare_write(struct file *file, struct page *page,
1815 unsigned offset, unsigned to); 1889 unsigned offset, unsigned to);
1816extern int simple_commit_write(struct file *file, struct page *page, 1890extern int simple_commit_write(struct file *file, struct page *page,
1817 unsigned offset, unsigned to); 1891 unsigned offset, unsigned to);
1892extern int simple_write_begin(struct file *file, struct address_space *mapping,
1893 loff_t pos, unsigned len, unsigned flags,
1894 struct page **pagep, void **fsdata);
1895extern int simple_write_end(struct file *file, struct address_space *mapping,
1896 loff_t pos, unsigned len, unsigned copied,
1897 struct page *page, void *fsdata);
1818 1898
1819extern struct dentry *simple_lookup(struct inode *, struct dentry *, struct nameidata *); 1899extern struct dentry *simple_lookup(struct inode *, struct dentry *, struct nameidata *);
1820extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *); 1900extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *);
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index bc68dd9a6d41..7e93a9ae7064 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -48,18 +48,12 @@ struct vm_area_struct;
48#define __GFP_NOMEMALLOC ((__force gfp_t)0x10000u) /* Don't use emergency reserves */ 48#define __GFP_NOMEMALLOC ((__force gfp_t)0x10000u) /* Don't use emergency reserves */
49#define __GFP_HARDWALL ((__force gfp_t)0x20000u) /* Enforce hardwall cpuset memory allocs */ 49#define __GFP_HARDWALL ((__force gfp_t)0x20000u) /* Enforce hardwall cpuset memory allocs */
50#define __GFP_THISNODE ((__force gfp_t)0x40000u)/* No fallback, no policies */ 50#define __GFP_THISNODE ((__force gfp_t)0x40000u)/* No fallback, no policies */
51#define __GFP_MOVABLE ((__force gfp_t)0x80000u) /* Page is movable */ 51#define __GFP_RECLAIMABLE ((__force gfp_t)0x80000u) /* Page is reclaimable */
52#define __GFP_MOVABLE ((__force gfp_t)0x100000u) /* Page is movable */
52 53
53#define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */ 54#define __GFP_BITS_SHIFT 21 /* Room for 21 __GFP_FOO bits */
54#define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1)) 55#define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1))
55 56
56/* if you forget to add the bitmask here kernel will crash, period */
57#define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \
58 __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \
59 __GFP_NOFAIL|__GFP_NORETRY|__GFP_COMP| \
60 __GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_THISNODE| \
61 __GFP_MOVABLE)
62
63/* This equals 0, but use constants in case they ever change */ 57/* This equals 0, but use constants in case they ever change */
64#define GFP_NOWAIT (GFP_ATOMIC & ~__GFP_HIGH) 58#define GFP_NOWAIT (GFP_ATOMIC & ~__GFP_HIGH)
65/* GFP_ATOMIC means both !wait (__GFP_WAIT not set) and use emergency pool */ 59/* GFP_ATOMIC means both !wait (__GFP_WAIT not set) and use emergency pool */
@@ -67,6 +61,8 @@ struct vm_area_struct;
67#define GFP_NOIO (__GFP_WAIT) 61#define GFP_NOIO (__GFP_WAIT)
68#define GFP_NOFS (__GFP_WAIT | __GFP_IO) 62#define GFP_NOFS (__GFP_WAIT | __GFP_IO)
69#define GFP_KERNEL (__GFP_WAIT | __GFP_IO | __GFP_FS) 63#define GFP_KERNEL (__GFP_WAIT | __GFP_IO | __GFP_FS)
64#define GFP_TEMPORARY (__GFP_WAIT | __GFP_IO | __GFP_FS | \
65 __GFP_RECLAIMABLE)
70#define GFP_USER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL) 66#define GFP_USER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL)
71#define GFP_HIGHUSER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL | \ 67#define GFP_HIGHUSER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL | \
72 __GFP_HIGHMEM) 68 __GFP_HIGHMEM)
@@ -86,6 +82,19 @@ struct vm_area_struct;
86#define GFP_THISNODE ((__force gfp_t)0) 82#define GFP_THISNODE ((__force gfp_t)0)
87#endif 83#endif
88 84
85/* This mask makes up all the page movable related flags */
86#define GFP_MOVABLE_MASK (__GFP_RECLAIMABLE|__GFP_MOVABLE)
87
88/* Control page allocator reclaim behavior */
89#define GFP_RECLAIM_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS|\
90 __GFP_NOWARN|__GFP_REPEAT|__GFP_NOFAIL|\
91 __GFP_NORETRY|__GFP_NOMEMALLOC)
92
93/* Control allocation constraints */
94#define GFP_CONSTRAINT_MASK (__GFP_HARDWALL|__GFP_THISNODE)
95
96/* Do not use these with a slab allocator */
97#define GFP_SLAB_BUG_MASK (__GFP_DMA32|__GFP_HIGHMEM|~__GFP_BITS_MASK)
89 98
90/* Flag - indicates that the buffer will be suitable for DMA. Ignored on some 99/* Flag - indicates that the buffer will be suitable for DMA. Ignored on some
91 platforms, used as appropriate on others */ 100 platforms, used as appropriate on others */
@@ -95,25 +104,50 @@ struct vm_area_struct;
95/* 4GB DMA on some platforms */ 104/* 4GB DMA on some platforms */
96#define GFP_DMA32 __GFP_DMA32 105#define GFP_DMA32 __GFP_DMA32
97 106
107/* Convert GFP flags to their corresponding migrate type */
108static inline int allocflags_to_migratetype(gfp_t gfp_flags)
109{
110 WARN_ON((gfp_flags & GFP_MOVABLE_MASK) == GFP_MOVABLE_MASK);
111
112 if (unlikely(page_group_by_mobility_disabled))
113 return MIGRATE_UNMOVABLE;
114
115 /* Group based on mobility */
116 return (((gfp_flags & __GFP_MOVABLE) != 0) << 1) |
117 ((gfp_flags & __GFP_RECLAIMABLE) != 0);
118}
98 119
99static inline enum zone_type gfp_zone(gfp_t flags) 120static inline enum zone_type gfp_zone(gfp_t flags)
100{ 121{
122 int base = 0;
123
124#ifdef CONFIG_NUMA
125 if (flags & __GFP_THISNODE)
126 base = MAX_NR_ZONES;
127#endif
128
101#ifdef CONFIG_ZONE_DMA 129#ifdef CONFIG_ZONE_DMA
102 if (flags & __GFP_DMA) 130 if (flags & __GFP_DMA)
103 return ZONE_DMA; 131 return base + ZONE_DMA;
104#endif 132#endif
105#ifdef CONFIG_ZONE_DMA32 133#ifdef CONFIG_ZONE_DMA32
106 if (flags & __GFP_DMA32) 134 if (flags & __GFP_DMA32)
107 return ZONE_DMA32; 135 return base + ZONE_DMA32;
108#endif 136#endif
109 if ((flags & (__GFP_HIGHMEM | __GFP_MOVABLE)) == 137 if ((flags & (__GFP_HIGHMEM | __GFP_MOVABLE)) ==
110 (__GFP_HIGHMEM | __GFP_MOVABLE)) 138 (__GFP_HIGHMEM | __GFP_MOVABLE))
111 return ZONE_MOVABLE; 139 return base + ZONE_MOVABLE;
112#ifdef CONFIG_HIGHMEM 140#ifdef CONFIG_HIGHMEM
113 if (flags & __GFP_HIGHMEM) 141 if (flags & __GFP_HIGHMEM)
114 return ZONE_HIGHMEM; 142 return base + ZONE_HIGHMEM;
115#endif 143#endif
116 return ZONE_NORMAL; 144 return base + ZONE_NORMAL;
145}
146
147static inline gfp_t set_migrateflags(gfp_t gfp, gfp_t migrate_flags)
148{
149 BUG_ON((gfp & GFP_MOVABLE_MASK) == GFP_MOVABLE_MASK);
150 return (gfp & ~(GFP_MOVABLE_MASK)) | migrate_flags;
117} 151}
118 152
119/* 153/*
diff --git a/include/linux/gfs2_ondisk.h b/include/linux/gfs2_ondisk.h
index a44a6a078f0a..c3c19f926e6f 100644
--- a/include/linux/gfs2_ondisk.h
+++ b/include/linux/gfs2_ondisk.h
@@ -170,6 +170,33 @@ struct gfs2_rgrp {
170}; 170};
171 171
172/* 172/*
173 * quota linked list: user quotas and group quotas form two separate
174 * singly linked lists. ll_next stores uids or gids of next quotas in the
175 * linked list.
176
177Given the uid/gid, how to calculate the quota file offsets for the corresponding
178gfs2_quota structures on disk:
179
180for user quotas, given uid,
181offset = uid * sizeof(struct gfs2_quota);
182
183for group quotas, given gid,
184offset = (gid * sizeof(struct gfs2_quota)) + sizeof(struct gfs2_quota);
185
186
187 uid:0 gid:0 uid:12 gid:12 uid:17 gid:17 uid:5142 gid:5142
188+-------+-------+ +-------+-------+ +-------+- - - -+ +- - - -+-------+
189| valid | valid | :: | valid | valid | :: | valid | inval | :: | inval | valid |
190+-------+-------+ +-------+-------+ +-------+- - - -+ +- - - -+-------+
191next:12 next:12 next:17 next:5142 next:NULL next:NULL
192 | | | | |<-- user quota list |
193 \______|___________/ \______|___________/ group quota list -->|
194 | | |
195 \__________________/ \_______________________________________/
196
197*/
198
199/*
173 * quota structure 200 * quota structure
174 */ 201 */
175 202
@@ -177,7 +204,8 @@ struct gfs2_quota {
177 __be64 qu_limit; 204 __be64 qu_limit;
178 __be64 qu_warn; 205 __be64 qu_warn;
179 __be64 qu_value; 206 __be64 qu_value;
180 __u8 qu_reserved[64]; 207 __be32 qu_ll_next; /* location of next quota in list */
208 __u8 qu_reserved[60];
181}; 209};
182 210
183/* 211/*
diff --git a/include/linux/gpio_keys.h b/include/linux/gpio_keys.h
index 265d17830a0f..c6d3a9de5634 100644
--- a/include/linux/gpio_keys.h
+++ b/include/linux/gpio_keys.h
@@ -8,6 +8,7 @@ struct gpio_keys_button {
8 int active_low; 8 int active_low;
9 char *desc; 9 char *desc;
10 int type; /* input event type (EV_KEY, EV_SW) */ 10 int type; /* input event type (EV_KEY, EV_SW) */
11 int wakeup; /* configure the button as a wake-up source */
11}; 12};
12 13
13struct gpio_keys_platform_data { 14struct gpio_keys_platform_data {
diff --git a/include/linux/hdlcdrv.h b/include/linux/hdlcdrv.h
index 4f6ee3b267fa..bf6302f6b5f8 100644
--- a/include/linux/hdlcdrv.h
+++ b/include/linux/hdlcdrv.h
@@ -200,7 +200,7 @@ struct hdlcdrv_state {
200 200
201 struct hdlcdrv_hdlcrx { 201 struct hdlcdrv_hdlcrx {
202 struct hdlcdrv_hdlcbuffer hbuf; 202 struct hdlcdrv_hdlcbuffer hbuf;
203 long in_hdlc_rx; 203 unsigned long in_hdlc_rx;
204 /* 0 = sync hunt, != 0 receiving */ 204 /* 0 = sync hunt, != 0 receiving */
205 int rx_state; 205 int rx_state;
206 unsigned int bitstream; 206 unsigned int bitstream;
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 898103b401f1..edb8024d744b 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -29,13 +29,6 @@
29 * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic 29 * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
30 */ 30 */
31 31
32#include <linux/types.h>
33#include <linux/slab.h>
34#include <linux/list.h>
35#include <linux/timer.h>
36#include <linux/workqueue.h>
37#include <linux/input.h>
38
39/* 32/*
40 * USB HID (Human Interface Device) interface class code 33 * USB HID (Human Interface Device) interface class code
41 */ 34 */
@@ -69,6 +62,17 @@
69#define HID_DT_REPORT (USB_TYPE_CLASS | 0x02) 62#define HID_DT_REPORT (USB_TYPE_CLASS | 0x02)
70#define HID_DT_PHYSICAL (USB_TYPE_CLASS | 0x03) 63#define HID_DT_PHYSICAL (USB_TYPE_CLASS | 0x03)
71 64
65#define HID_MAX_DESCRIPTOR_SIZE 4096
66
67#ifdef __KERNEL__
68
69#include <linux/types.h>
70#include <linux/slab.h>
71#include <linux/list.h>
72#include <linux/timer.h>
73#include <linux/workqueue.h>
74#include <linux/input.h>
75
72/* 76/*
73 * We parse each description item into this structure. Short items data 77 * We parse each description item into this structure. Short items data
74 * values are expanded to 32-bit signed int, long items contain a pointer 78 * values are expanded to 32-bit signed int, long items contain a pointer
@@ -276,6 +280,7 @@ struct hid_item {
276#define HID_QUIRK_HIDINPUT 0x00200000 280#define HID_QUIRK_HIDINPUT 0x00200000
277#define HID_QUIRK_LOGITECH_IGNORE_DOUBLED_WHEEL 0x00400000 281#define HID_QUIRK_LOGITECH_IGNORE_DOUBLED_WHEEL 0x00400000
278#define HID_QUIRK_LOGITECH_EXPANDED_KEYMAP 0x00800000 282#define HID_QUIRK_LOGITECH_EXPANDED_KEYMAP 0x00800000
283#define HID_QUIRK_IGNORE_HIDINPUT 0x01000000
279 284
280/* 285/*
281 * Separate quirks for runtime report descriptor fixup 286 * Separate quirks for runtime report descriptor fixup
@@ -285,6 +290,7 @@ struct hid_item {
285#define HID_QUIRK_RDESC_LOGITECH 0x00000002 290#define HID_QUIRK_RDESC_LOGITECH 0x00000002
286#define HID_QUIRK_RDESC_SWAPPED_MIN_MAX 0x00000004 291#define HID_QUIRK_RDESC_SWAPPED_MIN_MAX 0x00000004
287#define HID_QUIRK_RDESC_PETALYNX 0x00000008 292#define HID_QUIRK_RDESC_PETALYNX 0x00000008
293#define HID_QUIRK_RDESC_MACBOOK_JIS 0x00000010
288 294
289/* 295/*
290 * This is the global environment of the parser. This information is 296 * This is the global environment of the parser. This information is
@@ -309,7 +315,6 @@ struct hid_global {
309 * This is the local environment. It is persistent up the next main-item. 315 * This is the local environment. It is persistent up the next main-item.
310 */ 316 */
311 317
312#define HID_MAX_DESCRIPTOR_SIZE 4096
313#define HID_MAX_USAGES 8192 318#define HID_MAX_USAGES 8192
314#define HID_DEFAULT_NUM_COLLECTIONS 16 319#define HID_DEFAULT_NUM_COLLECTIONS 16
315 320
@@ -403,6 +408,7 @@ struct hid_control_fifo {
403 408
404#define HID_CLAIMED_INPUT 1 409#define HID_CLAIMED_INPUT 1
405#define HID_CLAIMED_HIDDEV 2 410#define HID_CLAIMED_HIDDEV 2
411#define HID_CLAIMED_HIDRAW 4
406 412
407#define HID_CTRL_RUNNING 1 413#define HID_CTRL_RUNNING 1
408#define HID_OUT_RUNNING 2 414#define HID_OUT_RUNNING 2
@@ -438,6 +444,7 @@ struct hid_device { /* device report descriptor */
438 444
439 struct list_head inputs; /* The list of inputs */ 445 struct list_head inputs; /* The list of inputs */
440 void *hiddev; /* The hiddev structure */ 446 void *hiddev; /* The hiddev structure */
447 void *hidraw;
441 int minor; /* Hiddev minor number */ 448 int minor; /* Hiddev minor number */
442 449
443 wait_queue_head_t wait; /* For sleeping */ 450 wait_queue_head_t wait; /* For sleeping */
@@ -458,6 +465,9 @@ struct hid_device { /* device report descriptor */
458 void (*hiddev_hid_event) (struct hid_device *, struct hid_field *field, 465 void (*hiddev_hid_event) (struct hid_device *, struct hid_field *field,
459 struct hid_usage *, __s32); 466 struct hid_usage *, __s32);
460 void (*hiddev_report_event) (struct hid_device *, struct hid_report *); 467 void (*hiddev_report_event) (struct hid_device *, struct hid_report *);
468
469 /* handler for raw output data, used by hidraw */
470 int (*hid_output_raw_report) (struct hid_device *, __u8 *, size_t);
461#ifdef CONFIG_USB_HIDINPUT_POWERBOOK 471#ifdef CONFIG_USB_HIDINPUT_POWERBOOK
462 unsigned long pb_pressed_fn[NBITS(KEY_MAX)]; 472 unsigned long pb_pressed_fn[NBITS(KEY_MAX)];
463 unsigned long pb_pressed_numlock[NBITS(KEY_MAX)]; 473 unsigned long pb_pressed_numlock[NBITS(KEY_MAX)];
@@ -553,4 +563,5 @@ static inline int hid_ff_init(struct hid_device *hid) { return -1; }
553#define err_hid(format, arg...) printk(KERN_ERR "%s: " format "\n" , \ 563#define err_hid(format, arg...) printk(KERN_ERR "%s: " format "\n" , \
554 __FILE__ , ## arg) 564 __FILE__ , ## arg)
555#endif 565#endif
566#endif
556 567
diff --git a/include/linux/hidraw.h b/include/linux/hidraw.h
new file mode 100644
index 000000000000..0536f299f7ff
--- /dev/null
+++ b/include/linux/hidraw.h
@@ -0,0 +1,86 @@
1#ifndef _HIDRAW_H
2#define _HIDRAW_H
3
4/*
5 * Copyright (c) 2007 Jiri Kosina
6 */
7
8/*
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms and conditions of the GNU General Public License,
11 * version 2, as published by the Free Software Foundation.
12 *
13 * You should have received a copy of the GNU General Public License along with
14 * this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
16 */
17
18#include <linux/hid.h>
19
20struct hidraw_report_descriptor {
21 __u32 size;
22 __u8 value[HID_MAX_DESCRIPTOR_SIZE];
23};
24
25struct hidraw_devinfo {
26 __u32 bustype;
27 __s16 vendor;
28 __s16 product;
29};
30
31/* ioctl interface */
32#define HIDIOCGRDESCSIZE _IOR('H', 0x01, int)
33#define HIDIOCGRDESC _IOR('H', 0x02, struct hidraw_report_descriptor)
34#define HIDIOCGRAWINFO _IOR('H', 0x03, struct hidraw_devinfo)
35
36#define HIDRAW_FIRST_MINOR 0
37#define HIDRAW_MAX_DEVICES 64
38/* number of reports to buffer */
39#define HIDRAW_BUFFER_SIZE 64
40
41
42/* kernel-only API declarations */
43#ifdef __KERNEL__
44
45struct hidraw {
46 unsigned int minor;
47 int exist;
48 int open;
49 wait_queue_head_t wait;
50 struct hid_device *hid;
51 struct device *dev;
52 struct list_head list;
53};
54
55struct hidraw_report {
56 __u8 *value;
57 int len;
58};
59
60struct hidraw_list {
61 struct hidraw_report buffer[HIDRAW_BUFFER_SIZE];
62 int head;
63 int tail;
64 struct fasync_struct *fasync;
65 struct hidraw *hidraw;
66 struct list_head node;
67 struct mutex read_mutex;
68};
69
70#ifdef CONFIG_HIDRAW
71int hidraw_init(void);
72void hidraw_exit(void);
73void hidraw_report_event(struct hid_device *, u8 *, int);
74int hidraw_connect(struct hid_device *);
75void hidraw_disconnect(struct hid_device *);
76#else
77static inline int hidraw_init(void) { return 0; }
78static inline void hidraw_exit(void) { }
79static inline void hidraw_report_event(struct hid_device *hid, u8 *data, int len) { }
80static inline int hidraw_connect(struct hid_device *hid) { return -1; }
81static inline void hidraw_disconnect(struct hid_device *hid) { }
82#endif
83
84#endif
85
86#endif
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 3a19b032c0eb..ea0f50bfbe03 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -33,6 +33,7 @@ void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed);
33 33
34extern unsigned long max_huge_pages; 34extern unsigned long max_huge_pages;
35extern unsigned long hugepages_treat_as_movable; 35extern unsigned long hugepages_treat_as_movable;
36extern int hugetlb_dynamic_pool;
36extern const unsigned long hugetlb_zero, hugetlb_infinity; 37extern const unsigned long hugetlb_zero, hugetlb_infinity;
37extern int sysctl_hugetlb_shm_group; 38extern int sysctl_hugetlb_shm_group;
38 39
diff --git a/include/linux/hwmon.h b/include/linux/hwmon.h
index 0efd994c37f1..6b6ee702b007 100644
--- a/include/linux/hwmon.h
+++ b/include/linux/hwmon.h
@@ -16,9 +16,9 @@
16 16
17#include <linux/device.h> 17#include <linux/device.h>
18 18
19struct class_device *hwmon_device_register(struct device *dev); 19struct device *hwmon_device_register(struct device *dev);
20 20
21void hwmon_device_unregister(struct class_device *cdev); 21void hwmon_device_unregister(struct device *dev);
22 22
23/* Scale user input to sensible values */ 23/* Scale user input to sensible values */
24static inline int SENSORS_LIMIT(long value, long low, long high) 24static inline int SENSORS_LIMIT(long value, long low, long high)
diff --git a/include/linux/i2c-dev.h b/include/linux/i2c-dev.h
index 81c229a0fbca..311315b56b61 100644
--- a/include/linux/i2c-dev.h
+++ b/include/linux/i2c-dev.h
@@ -25,8 +25,31 @@
25#include <linux/types.h> 25#include <linux/types.h>
26#include <linux/compiler.h> 26#include <linux/compiler.h>
27 27
28/* Some IOCTL commands are defined in <linux/i2c.h> */ 28/* /dev/i2c-X ioctl commands. The ioctl's parameter is always an
29/* Note: 10-bit addresses are NOT supported! */ 29 * unsigned long, except for:
30 * - I2C_FUNCS, takes pointer to an unsigned long
31 * - I2C_RDWR, takes pointer to struct i2c_rdwr_ioctl_data
32 * - I2C_SMBUS, takes pointer to struct i2c_smbus_ioctl_data
33 */
34#define I2C_RETRIES 0x0701 /* number of times a device address should
35 be polled when not acknowledging */
36#define I2C_TIMEOUT 0x0702 /* set timeout in jiffies - call with int */
37
38/* NOTE: Slave address is 7 or 10 bits, but 10-bit addresses
39 * are NOT supported! (due to code brokenness)
40 */
41#define I2C_SLAVE 0x0703 /* Use this slave address */
42#define I2C_SLAVE_FORCE 0x0706 /* Use this slave address, even if it
43 is already in use by a driver! */
44#define I2C_TENBIT 0x0704 /* 0 for 7 bit addrs, != 0 for 10 bit */
45
46#define I2C_FUNCS 0x0705 /* Get the adapter functionality mask */
47
48#define I2C_RDWR 0x0707 /* Combined R/W transfer (one STOP only) */
49
50#define I2C_PEC 0x0708 /* != 0 to use PEC with SMBus */
51#define I2C_SMBUS 0x0720 /* SMBus transfer */
52
30 53
31/* This is the structure as used in the I2C_SMBUS ioctl call */ 54/* This is the structure as used in the I2C_SMBUS ioctl call */
32struct i2c_smbus_ioctl_data { 55struct i2c_smbus_ioctl_data {
@@ -44,4 +67,8 @@ struct i2c_rdwr_ioctl_data {
44 67
45#define I2C_RDRW_IOCTL_MAX_MSGS 42 68#define I2C_RDRW_IOCTL_MAX_MSGS 42
46 69
70#ifdef __KERNEL__
71#define I2C_MAJOR 89 /* Device major number */
72#endif
73
47#endif /* _LINUX_I2C_DEV_H */ 74#endif /* _LINUX_I2C_DEV_H */
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h
index a271b67a8e2d..88c81403eb3f 100644
--- a/include/linux/i2c-id.h
+++ b/include/linux/i2c-id.h
@@ -120,6 +120,7 @@
120#define I2C_DRIVERID_WM8753 91 /* Wolfson WM8753 audio codec */ 120#define I2C_DRIVERID_WM8753 91 /* Wolfson WM8753 audio codec */
121#define I2C_DRIVERID_LM4857 92 /* LM4857 Audio Amplifier */ 121#define I2C_DRIVERID_LM4857 92 /* LM4857 Audio Amplifier */
122#define I2C_DRIVERID_VP27SMPX 93 /* Panasonic VP27s tuner internal MPX */ 122#define I2C_DRIVERID_VP27SMPX 93 /* Panasonic VP27s tuner internal MPX */
123#define I2C_DRIVERID_CS4270 94 /* Cirrus Logic 4270 audio codec */
123 124
124#define I2C_DRIVERID_I2CDEV 900 125#define I2C_DRIVERID_I2CDEV 900
125#define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */ 126#define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 2a32f2fd940d..8033e6b33271 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -35,8 +35,6 @@
35#include <linux/sched.h> /* for completion */ 35#include <linux/sched.h> /* for completion */
36#include <linux/mutex.h> 36#include <linux/mutex.h>
37 37
38extern struct bus_type i2c_bus_type;
39
40/* --- General options ------------------------------------------------ */ 38/* --- General options ------------------------------------------------ */
41 39
42struct i2c_msg; 40struct i2c_msg;
@@ -292,9 +290,6 @@ struct i2c_algorithm {
292 unsigned short flags, char read_write, 290 unsigned short flags, char read_write,
293 u8 command, int size, union i2c_smbus_data * data); 291 u8 command, int size, union i2c_smbus_data * data);
294 292
295 /* --- ioctl like call to set div. parameters. */
296 int (*algo_control)(struct i2c_adapter *, unsigned int, unsigned long);
297
298 /* To determine what the adapter supports */ 293 /* To determine what the adapter supports */
299 u32 (*functionality) (struct i2c_adapter *); 294 u32 (*functionality) (struct i2c_adapter *);
300}; 295};
@@ -342,9 +337,10 @@ static inline void i2c_set_adapdata (struct i2c_adapter *dev, void *data)
342} 337}
343 338
344/*flags for the client struct: */ 339/*flags for the client struct: */
345#define I2C_CLIENT_PEC 0x04 /* Use Packet Error Checking */ 340#define I2C_CLIENT_PEC 0x04 /* Use Packet Error Checking */
346#define I2C_CLIENT_TEN 0x10 /* we have a ten bit chip address */ 341#define I2C_CLIENT_TEN 0x10 /* we have a ten bit chip address */
347 /* Must equal I2C_M_TEN below */ 342 /* Must equal I2C_M_TEN below */
343#define I2C_CLIENT_WAKE 0x80 /* for board_info; true iff can wake */
348 344
349/* i2c adapter classes (bitmask) */ 345/* i2c adapter classes (bitmask) */
350#define I2C_CLASS_HWMON (1<<0) /* lm_sensors, ... */ 346#define I2C_CLASS_HWMON (1<<0) /* lm_sensors, ... */
@@ -417,10 +413,6 @@ extern int i2c_probe(struct i2c_adapter *adapter,
417 struct i2c_client_address_data *address_data, 413 struct i2c_client_address_data *address_data,
418 int (*found_proc) (struct i2c_adapter *, int, int)); 414 int (*found_proc) (struct i2c_adapter *, int, int));
419 415
420/* An ioctl like call to set div. parameters of the adapter.
421 */
422extern int i2c_control(struct i2c_client *,unsigned int, unsigned long);
423
424extern struct i2c_adapter* i2c_get_adapter(int id); 416extern struct i2c_adapter* i2c_get_adapter(int id);
425extern void i2c_put_adapter(struct i2c_adapter *adap); 417extern void i2c_put_adapter(struct i2c_adapter *adap);
426 418
@@ -444,19 +436,52 @@ static inline int i2c_adapter_id(struct i2c_adapter *adap)
444} 436}
445#endif /* __KERNEL__ */ 437#endif /* __KERNEL__ */
446 438
447/* 439/**
448 * I2C Message - used for pure i2c transaction, also from /dev interface 440 * struct i2c_msg - an I2C transaction segment beginning with START
441 * @addr: Slave address, either seven or ten bits. When this is a ten
442 * bit address, I2C_M_TEN must be set in @flags and the adapter
443 * must support I2C_FUNC_10BIT_ADDR.
444 * @flags: I2C_M_RD is handled by all adapters. No other flags may be
445 * provided unless the adapter exported the relevant I2C_FUNC_*
446 * flags through i2c_check_functionality().
447 * @len: Number of data bytes in @buf being read from or written to the
448 * I2C slave address. For read transactions where I2C_M_RECV_LEN
449 * is set, the caller guarantees that this buffer can hold up to
450 * 32 bytes in addition to the initial length byte sent by the
451 * slave (plus, if used, the SMBus PEC); and this value will be
452 * incremented by the number of block data bytes received.
453 * @buf: The buffer into which data is read, or from which it's written.
454 *
455 * An i2c_msg is the low level representation of one segment of an I2C
456 * transaction. It is visible to drivers in the @i2c_transfer() procedure,
457 * to userspace from i2c-dev, and to I2C adapter drivers through the
458 * @i2c_adapter.@master_xfer() method.
459 *
460 * Except when I2C "protocol mangling" is used, all I2C adapters implement
461 * the standard rules for I2C transactions. Each transaction begins with a
462 * START. That is followed by the slave address, and a bit encoding read
463 * versus write. Then follow all the data bytes, possibly including a byte
464 * with SMBus PEC. The transfer terminates with a NAK, or when all those
465 * bytes have been transferred and ACKed. If this is the last message in a
466 * group, it is followed by a STOP. Otherwise it is followed by the next
467 * @i2c_msg transaction segment, beginning with a (repeated) START.
468 *
469 * Alternatively, when the adapter supports I2C_FUNC_PROTOCOL_MANGLING then
470 * passing certain @flags may have changed those standard protocol behaviors.
471 * Those flags are only for use with broken/nonconforming slaves, and with
472 * adapters which are known to support the specific mangling options they
473 * need (one or more of IGNORE_NAK, NO_RD_ACK, NOSTART, and REV_DIR_ADDR).
449 */ 474 */
450struct i2c_msg { 475struct i2c_msg {
451 __u16 addr; /* slave address */ 476 __u16 addr; /* slave address */
452 __u16 flags; 477 __u16 flags;
453#define I2C_M_TEN 0x10 /* we have a ten bit chip address */ 478#define I2C_M_TEN 0x0010 /* this is a ten bit chip address */
454#define I2C_M_RD 0x01 479#define I2C_M_RD 0x0001 /* read data, from slave to master */
455#define I2C_M_NOSTART 0x4000 480#define I2C_M_NOSTART 0x4000 /* if I2C_FUNC_PROTOCOL_MANGLING */
456#define I2C_M_REV_DIR_ADDR 0x2000 481#define I2C_M_REV_DIR_ADDR 0x2000 /* if I2C_FUNC_PROTOCOL_MANGLING */
457#define I2C_M_IGNORE_NAK 0x1000 482#define I2C_M_IGNORE_NAK 0x1000 /* if I2C_FUNC_PROTOCOL_MANGLING */
458#define I2C_M_NO_RD_ACK 0x0800 483#define I2C_M_NO_RD_ACK 0x0800 /* if I2C_FUNC_PROTOCOL_MANGLING */
459#define I2C_M_RECV_LEN 0x0400 /* length will be first received byte */ 484#define I2C_M_RECV_LEN 0x0400 /* length will be first received byte */
460 __u16 len; /* msg length */ 485 __u16 len; /* msg length */
461 __u8 *buf; /* pointer to msg data */ 486 __u8 *buf; /* pointer to msg data */
462}; 487};
@@ -466,7 +491,7 @@ struct i2c_msg {
466#define I2C_FUNC_I2C 0x00000001 491#define I2C_FUNC_I2C 0x00000001
467#define I2C_FUNC_10BIT_ADDR 0x00000002 492#define I2C_FUNC_10BIT_ADDR 0x00000002
468#define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_{REV_DIR_ADDR,NOSTART,..} */ 493#define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_{REV_DIR_ADDR,NOSTART,..} */
469#define I2C_FUNC_SMBUS_HWPEC_CALC 0x00000008 /* SMBus 2.0 */ 494#define I2C_FUNC_SMBUS_PEC 0x00000008
470#define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 /* SMBus 2.0 */ 495#define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 /* SMBus 2.0 */
471#define I2C_FUNC_SMBUS_QUICK 0x00010000 496#define I2C_FUNC_SMBUS_QUICK 0x00010000
472#define I2C_FUNC_SMBUS_READ_BYTE 0x00020000 497#define I2C_FUNC_SMBUS_READ_BYTE 0x00020000
@@ -502,7 +527,8 @@ struct i2c_msg {
502 I2C_FUNC_SMBUS_WORD_DATA | \ 527 I2C_FUNC_SMBUS_WORD_DATA | \
503 I2C_FUNC_SMBUS_PROC_CALL | \ 528 I2C_FUNC_SMBUS_PROC_CALL | \
504 I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | \ 529 I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | \
505 I2C_FUNC_SMBUS_I2C_BLOCK) 530 I2C_FUNC_SMBUS_I2C_BLOCK | \
531 I2C_FUNC_SMBUS_PEC)
506 532
507/* 533/*
508 * Data for SMBus Messages 534 * Data for SMBus Messages
@@ -532,38 +558,8 @@ union i2c_smbus_data {
532#define I2C_SMBUS_I2C_BLOCK_DATA 8 558#define I2C_SMBUS_I2C_BLOCK_DATA 8
533 559
534 560
535/* ----- commands for the ioctl like i2c_command call:
536 * note that additional calls are defined in the algorithm and hw
537 * dependent layers - these can be listed here, or see the
538 * corresponding header files.
539 */
540 /* -> bit-adapter specific ioctls */
541#define I2C_RETRIES 0x0701 /* number of times a device address */
542 /* should be polled when not */
543 /* acknowledging */
544#define I2C_TIMEOUT 0x0702 /* set timeout - call with int */
545
546
547/* this is for i2c-dev.c */
548#define I2C_SLAVE 0x0703 /* Change slave address */
549 /* Attn.: Slave address is 7 or 10 bits */
550#define I2C_SLAVE_FORCE 0x0706 /* Change slave address */
551 /* Attn.: Slave address is 7 or 10 bits */
552 /* This changes the address, even if it */
553 /* is already taken! */
554#define I2C_TENBIT 0x0704 /* 0 for 7 bit addrs, != 0 for 10 bit */
555
556#define I2C_FUNCS 0x0705 /* Get the adapter functionality */
557#define I2C_RDWR 0x0707 /* Combined R/W transfer (one stop only)*/
558#define I2C_PEC 0x0708 /* != 0 for SMBus PEC */
559
560#define I2C_SMBUS 0x0720 /* SMBus-level access */
561
562/* ----- I2C-DEV: char device interface stuff ------------------------- */
563#ifdef __KERNEL__ 561#ifdef __KERNEL__
564 562
565#define I2C_MAJOR 89 /* Device major number */
566
567/* These defines are used for probing i2c client addresses */ 563/* These defines are used for probing i2c client addresses */
568/* The length of the option lists */ 564/* The length of the option lists */
569#define I2C_CLIENT_MAX_OPTS 48 565#define I2C_CLIENT_MAX_OPTS 48
diff --git a/include/linux/i2o.h b/include/linux/i2o.h
index 9752307d16ba..7da5b98d90e6 100644
--- a/include/linux/i2o.h
+++ b/include/linux/i2o.h
@@ -32,6 +32,7 @@
32#include <linux/workqueue.h> /* work_struct */ 32#include <linux/workqueue.h> /* work_struct */
33#include <linux/mempool.h> 33#include <linux/mempool.h>
34#include <linux/mutex.h> 34#include <linux/mutex.h>
35#include <linux/scatterlist.h>
35 36
36#include <asm/io.h> 37#include <asm/io.h>
37#include <asm/semaphore.h> /* Needed for MUTEX init macros */ 38#include <asm/semaphore.h> /* Needed for MUTEX init macros */
@@ -837,7 +838,7 @@ static inline int i2o_dma_map_sg(struct i2o_controller *c,
837 if ((sizeof(dma_addr_t) > 4) && c->pae_support) 838 if ((sizeof(dma_addr_t) > 4) && c->pae_support)
838 *mptr++ = cpu_to_le32(i2o_dma_high(sg_dma_address(sg))); 839 *mptr++ = cpu_to_le32(i2o_dma_high(sg_dma_address(sg)));
839#endif 840#endif
840 sg++; 841 sg = sg_next(sg);
841 } 842 }
842 *sg_ptr = mptr; 843 *sg_ptr = mptr;
843 844
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 85d448b4abec..30a1931466a6 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -681,7 +681,7 @@ typedef struct hwif_s {
681 u8 straight8; /* Alan's straight 8 check */ 681 u8 straight8; /* Alan's straight 8 check */
682 u8 bus_state; /* power state of the IDE bus */ 682 u8 bus_state; /* power state of the IDE bus */
683 683
684 u8 host_flags; 684 u16 host_flags;
685 685
686 u8 pio_mask; 686 u8 pio_mask;
687 687
@@ -702,10 +702,10 @@ typedef struct hwif_s {
702#if 0 702#if 0
703 ide_hwif_ops_t *hwifops; 703 ide_hwif_ops_t *hwifops;
704#else 704#else
705 /* routine to set PIO mode for drives */ 705 /* routine to program host for PIO mode */
706 void (*set_pio_mode)(ide_drive_t *, const u8); 706 void (*set_pio_mode)(ide_drive_t *, const u8);
707 /* routine to retune DMA modes for drives */ 707 /* routine to program host for DMA mode */
708 int (*speedproc)(ide_drive_t *, const u8); 708 void (*set_dma_mode)(ide_drive_t *, const u8);
709 /* tweaks hardware to select drive */ 709 /* tweaks hardware to select drive */
710 void (*selectproc)(ide_drive_t *); 710 void (*selectproc)(ide_drive_t *);
711 /* chipset polling based on hba specifics */ 711 /* chipset polling based on hba specifics */
@@ -772,7 +772,7 @@ typedef struct hwif_s {
772 772
773 unsigned int nsect; 773 unsigned int nsect;
774 unsigned int nleft; 774 unsigned int nleft;
775 unsigned int cursg; 775 struct scatterlist *cursg;
776 unsigned int cursg_ofs; 776 unsigned int cursg_ofs;
777 777
778 int rqsize; /* max sectors per request */ 778 int rqsize; /* max sectors per request */
@@ -1079,16 +1079,7 @@ extern void ide_fix_driveid(struct hd_driveid *);
1079 */ 1079 */
1080extern void ide_fixstring(u8 *, const int, const int); 1080extern void ide_fixstring(u8 *, const int, const int);
1081 1081
1082/* 1082int ide_wait_stat(ide_startstop_t *, ide_drive_t *, u8, u8, unsigned long);
1083 * This routine busy-waits for the drive status to be not "busy".
1084 * It then checks the status for all of the "good" bits and none
1085 * of the "bad" bits, and if all is okay it returns 0. All other
1086 * cases return 1 after doing "*startstop = ide_error()", and the
1087 * caller should return the updated value of "startstop" in this case.
1088 * "startstop" is unchanged when the function returns 0;
1089 * (startstop, drive, good, bad, timeout)
1090 */
1091extern int ide_wait_stat(ide_startstop_t *, ide_drive_t *, u8, u8, unsigned long);
1092 1083
1093/* 1084/*
1094 * Start a reset operation for an IDE interface. 1085 * Start a reset operation for an IDE interface.
@@ -1102,11 +1093,6 @@ extern ide_startstop_t ide_do_reset (ide_drive_t *);
1102extern void ide_init_drive_cmd (struct request *rq); 1093extern void ide_init_drive_cmd (struct request *rq);
1103 1094
1104/* 1095/*
1105 * this function returns error location sector offset in case of a write error
1106 */
1107extern u64 ide_get_error_location(ide_drive_t *, char *);
1108
1109/*
1110 * "action" parameter type for ide_do_drive_cmd() below. 1096 * "action" parameter type for ide_do_drive_cmd() below.
1111 */ 1097 */
1112typedef enum { 1098typedef enum {
@@ -1162,7 +1148,6 @@ extern void SELECT_MASK(ide_drive_t *, int);
1162extern void QUIRK_LIST(ide_drive_t *); 1148extern void QUIRK_LIST(ide_drive_t *);
1163 1149
1164extern int drive_is_ready(ide_drive_t *); 1150extern int drive_is_ready(ide_drive_t *);
1165extern int wait_for_ready(ide_drive_t *, int /* timeout */);
1166 1151
1167/* 1152/*
1168 * taskfile io for disks for now...and builds request from ide_ioctl 1153 * taskfile io for disks for now...and builds request from ide_ioctl
@@ -1262,6 +1247,15 @@ enum {
1262 IDE_HFLAG_ABUSE_FAST_DEVSEL = (1 << 5), 1247 IDE_HFLAG_ABUSE_FAST_DEVSEL = (1 << 5),
1263 /* use 100-102 and 200-202 PIO values to set DMA modes */ 1248 /* use 100-102 and 200-202 PIO values to set DMA modes */
1264 IDE_HFLAG_ABUSE_DMA_MODES = (1 << 6), 1249 IDE_HFLAG_ABUSE_DMA_MODES = (1 << 6),
1250 /*
1251 * keep DMA setting when programming PIO mode, may be used only
1252 * for hosts which have separate PIO and DMA timings (ie. PMAC)
1253 */
1254 IDE_HFLAG_SET_PIO_MODE_KEEP_DMA = (1 << 7),
1255 /* program host for the transfer mode after programming device */
1256 IDE_HFLAG_POST_SET_MODE = (1 << 8),
1257 /* don't program host/device for the transfer mode ("smart" hosts) */
1258 IDE_HFLAG_NO_SET_MODE = (1 << 9),
1265}; 1259};
1266 1260
1267typedef struct ide_pci_device_s { 1261typedef struct ide_pci_device_s {
@@ -1278,7 +1272,7 @@ typedef struct ide_pci_device_s {
1278 u8 bootable; 1272 u8 bootable;
1279 unsigned int extra; 1273 unsigned int extra;
1280 struct ide_pci_device_s *next; 1274 struct ide_pci_device_s *next;
1281 u8 host_flags; 1275 u16 host_flags;
1282 u8 pio_mask; 1276 u8 pio_mask;
1283 u8 udma_mask; 1277 u8 udma_mask;
1284} ide_pci_device_t; 1278} ide_pci_device_t;
@@ -1301,7 +1295,6 @@ int ide_in_drive_list(struct hd_driveid *, const struct drive_list_entry *);
1301 1295
1302#ifdef CONFIG_BLK_DEV_IDEDMA 1296#ifdef CONFIG_BLK_DEV_IDEDMA
1303int __ide_dma_bad_drive(ide_drive_t *); 1297int __ide_dma_bad_drive(ide_drive_t *);
1304int __ide_dma_good_drive(ide_drive_t *);
1305 1298
1306u8 ide_find_dma_mode(ide_drive_t *, u8); 1299u8 ide_find_dma_mode(ide_drive_t *, u8);
1307 1300
@@ -1420,6 +1413,9 @@ unsigned int ide_pio_cycle_time(ide_drive_t *, u8);
1420u8 ide_get_best_pio_mode(ide_drive_t *, u8, u8); 1413u8 ide_get_best_pio_mode(ide_drive_t *, u8, u8);
1421extern const ide_pio_timings_t ide_pio_timings[6]; 1414extern const ide_pio_timings_t ide_pio_timings[6];
1422 1415
1416int ide_set_pio_mode(ide_drive_t *, u8);
1417int ide_set_dma_mode(ide_drive_t *, u8);
1418
1423void ide_set_pio(ide_drive_t *, u8); 1419void ide_set_pio(ide_drive_t *, u8);
1424 1420
1425static inline void ide_set_max_pio(ide_drive_t *drive) 1421static inline void ide_set_max_pio(ide_drive_t *drive)
diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h
index 99e3a1a00099..58e43e566457 100644
--- a/include/linux/if_bridge.h
+++ b/include/linux/if_bridge.h
@@ -107,7 +107,7 @@ struct __fdb_entry
107extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __user *)); 107extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __user *));
108extern struct sk_buff *(*br_handle_frame_hook)(struct net_bridge_port *p, 108extern struct sk_buff *(*br_handle_frame_hook)(struct net_bridge_port *p,
109 struct sk_buff *skb); 109 struct sk_buff *skb);
110extern int (*br_should_route_hook)(struct sk_buff **pskb); 110extern int (*br_should_route_hook)(struct sk_buff *skb);
111 111
112#endif 112#endif
113 113
diff --git a/include/linux/inet_lro.h b/include/linux/inet_lro.h
index e1fc1d16d3cd..1246d46abbc0 100644
--- a/include/linux/inet_lro.h
+++ b/include/linux/inet_lro.h
@@ -52,14 +52,14 @@ struct net_lro_desc {
52 struct tcphdr *tcph; 52 struct tcphdr *tcph;
53 struct vlan_group *vgrp; 53 struct vlan_group *vgrp;
54 __wsum data_csum; 54 __wsum data_csum;
55 u32 tcp_rcv_tsecr; 55 __be32 tcp_rcv_tsecr;
56 u32 tcp_rcv_tsval; 56 __be32 tcp_rcv_tsval;
57 u32 tcp_ack; 57 __be32 tcp_ack;
58 u32 tcp_next_seq; 58 u32 tcp_next_seq;
59 u32 skb_tot_frags_len; 59 u32 skb_tot_frags_len;
60 u16 ip_tot_len; 60 u16 ip_tot_len;
61 u16 tcp_saw_tstamp; /* timestamps enabled */ 61 u16 tcp_saw_tstamp; /* timestamps enabled */
62 u16 tcp_window; 62 __be16 tcp_window;
63 u16 vlan_tag; 63 u16 vlan_tag;
64 int pkt_aggr_cnt; /* counts aggregated packets */ 64 int pkt_aggr_cnt; /* counts aggregated packets */
65 int vlan_packet; 65 int vlan_packet;
diff --git a/include/linux/init.h b/include/linux/init.h
index f8d9d0b5cffc..9b7a2ba8237e 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -67,8 +67,10 @@
67 67
68/* For assembly routines */ 68/* For assembly routines */
69#define __INIT .section ".init.text","ax" 69#define __INIT .section ".init.text","ax"
70#define __INIT_REFOK .section ".text.init.refok","ax"
70#define __FINIT .previous 71#define __FINIT .previous
71#define __INITDATA .section ".init.data","aw" 72#define __INITDATA .section ".init.data","aw"
73#define __INITDATA_REFOK .section ".data.init.refok","aw"
72 74
73#ifndef __ASSEMBLY__ 75#ifndef __ASSEMBLY__
74/* 76/*
diff --git a/include/linux/input.h b/include/linux/input.h
index 6eb3aead7f1d..f30da6fc08e3 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -523,6 +523,8 @@ struct input_absinfo {
523#define KEY_ADDRESSBOOK 0x1ad /* AL Contacts/Address Book */ 523#define KEY_ADDRESSBOOK 0x1ad /* AL Contacts/Address Book */
524#define KEY_MESSENGER 0x1ae /* AL Instant Messaging */ 524#define KEY_MESSENGER 0x1ae /* AL Instant Messaging */
525#define KEY_DISPLAYTOGGLE 0x1af /* Turn display (LCD) on and off */ 525#define KEY_DISPLAYTOGGLE 0x1af /* Turn display (LCD) on and off */
526#define KEY_SPELLCHECK 0x1b0 /* AL Spell Check */
527#define KEY_LOGOFF 0x1b1 /* AL Logoff */
526 528
527#define KEY_DEL_EOL 0x1c0 529#define KEY_DEL_EOL 0x1c0
528#define KEY_DEL_EOS 0x1c1 530#define KEY_DEL_EOS 0x1c1
@@ -854,7 +856,7 @@ struct ff_rumble_effect {
854 * defining effect parameters 856 * defining effect parameters
855 * 857 *
856 * This structure is sent through ioctl from the application to the driver. 858 * This structure is sent through ioctl from the application to the driver.
857 * To create a new effect aplication should set its @id to -1; the kernel 859 * To create a new effect application should set its @id to -1; the kernel
858 * will return assigned @id which can later be used to update or delete 860 * will return assigned @id which can later be used to update or delete
859 * this effect. 861 * this effect.
860 * 862 *
@@ -934,9 +936,82 @@ struct ff_effect {
934#define BIT(x) (1UL<<((x)%BITS_PER_LONG)) 936#define BIT(x) (1UL<<((x)%BITS_PER_LONG))
935#define LONG(x) ((x)/BITS_PER_LONG) 937#define LONG(x) ((x)/BITS_PER_LONG)
936 938
939/**
940 * struct input_dev - represents an input device
941 * @name: name of the device
942 * @phys: physical path to the device in the system hierarchy
943 * @uniq: unique identification code for the device (if device has it)
944 * @id: id of the device (struct input_id)
945 * @evbit: bitmap of types of events supported by the device (EV_KEY,
946 * EV_REL, etc.)
947 * @keybit: bitmap of keys/buttons this device has
948 * @relbit: bitmap of relative axes for the device
949 * @absbit: bitmap of absolute axes for the device
950 * @mscbit: bitmap of miscellaneous events supported by the device
951 * @ledbit: bitmap of leds present on the device
952 * @sndbit: bitmap of sound effects supported by the device
953 * @ffbit: bitmap of force feedback effects supported by the device
954 * @swbit: bitmap of switches present on the device
955 * @keycodemax: size of keycode table
956 * @keycodesize: size of elements in keycode table
957 * @keycode: map of scancodes to keycodes for this device
958 * @setkeycode: optional method to alter current keymap, used to implement
959 * sparse keymaps. If not supplied default mechanism will be used
960 * @getkeycode: optional method to retrieve current keymap. If not supplied
961 * default mechanism will be used
962 * @ff: force feedback structure associated with the device if device
963 * supports force feedback effects
964 * @repeat_key: stores key code of the last key pressed; used to implement
965 * software autorepeat
966 * @timer: timer for software autorepeat
967 * @sync: set to 1 when there were no new events since last EV_SYNC
968 * @abs: current values for reports from absolute axes
969 * @rep: current values for autorepeat parameters (delay, rate)
970 * @key: reflects current state of device's keys/buttons
971 * @led: reflects current state of device's LEDs
972 * @snd: reflects current state of sound effects
973 * @sw: reflects current state of device's switches
974 * @absmax: maximum values for events coming from absolute axes
975 * @absmin: minimum values for events coming from absolute axes
976 * @absfuzz: describes noisiness for axes
977 * @absflat: size of the center flat position (used by joydev)
978 * @open: this method is called when the very first user calls
979 * input_open_device(). The driver must prepare the device
980 * to start generating events (start polling thread,
981 * request an IRQ, submit URB, etc.)
982 * @close: this method is called when the very last user calls
983 * input_close_device().
984 * @flush: purges the device. Most commonly used to get rid of force
985 * feedback effects loaded into the device when disconnecting
986 * from it
987 * @event: event handler for events sent _to_ the device, like EV_LED
988 * or EV_SND. The device is expected to carry out the requested
989 * action (turn on a LED, play sound, etc.) The call is protected
990 * by @event_lock and must not sleep
991 * @grab: input handle that currently has the device grabbed (via
992 * EVIOCGRAB ioctl). When a handle grabs a device it becomes sole
993 * recipient for all input events coming from the device
994 * @event_lock: this spinlock is is taken when input core receives
995 * and processes a new event for the device (in input_event()).
996 * Code that accesses and/or modifies parameters of a device
997 * (such as keymap or absmin, absmax, absfuzz, etc.) after device
998 * has been registered with input core must take this lock.
999 * @mutex: serializes calls to open(), close() and flush() methods
1000 * @users: stores number of users (input handlers) that opened this
1001 * device. It is used by input_open_device() and input_close_device()
1002 * to make sure that dev->open() is only called when the first
1003 * user opens device and dev->close() is called when the very
1004 * last user closes the device
1005 * @going_away: marks devices that are in a middle of unregistering and
1006 * causes input_open_device*() fail with -ENODEV.
1007 * @dev: driver model's view of this device
1008 * @h_list: list of input handles associated with the device. When
1009 * accessing the list dev->mutex must be held
1010 * @node: used to place the device onto input_dev_list
1011 */
937struct input_dev { 1012struct input_dev {
938 1013
939 void *private; 1014 void *private; /* do not use */
940 1015
941 const char *name; 1016 const char *name;
942 const char *phys; 1017 const char *phys;
@@ -964,8 +1039,6 @@ struct input_dev {
964 unsigned int repeat_key; 1039 unsigned int repeat_key;
965 struct timer_list timer; 1040 struct timer_list timer;
966 1041
967 int state;
968
969 int sync; 1042 int sync;
970 1043
971 int abs[ABS_MAX + 1]; 1044 int abs[ABS_MAX + 1];
@@ -988,8 +1061,11 @@ struct input_dev {
988 1061
989 struct input_handle *grab; 1062 struct input_handle *grab;
990 1063
991 struct mutex mutex; /* serializes open and close operations */ 1064 spinlock_t event_lock;
1065 struct mutex mutex;
1066
992 unsigned int users; 1067 unsigned int users;
1068 int going_away;
993 1069
994 struct device dev; 1070 struct device dev;
995 union { /* temporarily so while we switching to struct device */ 1071 union { /* temporarily so while we switching to struct device */
@@ -1055,7 +1131,9 @@ struct input_handle;
1055/** 1131/**
1056 * struct input_handler - implements one of interfaces for input devices 1132 * struct input_handler - implements one of interfaces for input devices
1057 * @private: driver-specific data 1133 * @private: driver-specific data
1058 * @event: event handler 1134 * @event: event handler. This method is being called by input core with
1135 * interrupts disabled and dev->event_lock spinlock held and so
1136 * it may not sleep
1059 * @connect: called when attaching a handler to an input device 1137 * @connect: called when attaching a handler to an input device
1060 * @disconnect: disconnects a handler from input device 1138 * @disconnect: disconnects a handler from input device
1061 * @start: starts handler for given handle. This function is called by 1139 * @start: starts handler for given handle. This function is called by
@@ -1067,10 +1145,18 @@ struct input_handle;
1067 * @name: name of the handler, to be shown in /proc/bus/input/handlers 1145 * @name: name of the handler, to be shown in /proc/bus/input/handlers
1068 * @id_table: pointer to a table of input_device_ids this driver can 1146 * @id_table: pointer to a table of input_device_ids this driver can
1069 * handle 1147 * handle
1070 * @blacklist: prointer to a table of input_device_ids this driver should 1148 * @blacklist: pointer to a table of input_device_ids this driver should
1071 * ignore even if they match @id_table 1149 * ignore even if they match @id_table
1072 * @h_list: list of input handles associated with the handler 1150 * @h_list: list of input handles associated with the handler
1073 * @node: for placing the driver onto input_handler_list 1151 * @node: for placing the driver onto input_handler_list
1152 *
1153 * Input handlers attach to input devices and create input handles. There
1154 * are likely several handlers attached to any given input device at the
1155 * same time. All of them will get their copy of input event generated by
1156 * the device.
1157 *
1158 * Note that input core serializes calls to connect() and disconnect()
1159 * methods.
1074 */ 1160 */
1075struct input_handler { 1161struct input_handler {
1076 1162
@@ -1092,6 +1178,18 @@ struct input_handler {
1092 struct list_head node; 1178 struct list_head node;
1093}; 1179};
1094 1180
1181/**
1182 * struct input_handle - links input device with an input handler
1183 * @private: handler-specific data
1184 * @open: counter showing whether the handle is 'open', i.e. should deliver
1185 * events from its device
1186 * @name: name given to the handle by handler that created it
1187 * @dev: input device the handle is attached to
1188 * @handler: handler that works with the device through this handle
1189 * @d_node: used to put the handle on device's list of attached handles
1190 * @h_node: used to put the handle on handler's list of handles from which
1191 * it gets events
1192 */
1095struct input_handle { 1193struct input_handle {
1096 1194
1097 void *private; 1195 void *private;
@@ -1134,10 +1232,10 @@ static inline void input_set_drvdata(struct input_dev *dev, void *data)
1134 dev->private = data; 1232 dev->private = data;
1135} 1233}
1136 1234
1137int input_register_device(struct input_dev *); 1235int __must_check input_register_device(struct input_dev *);
1138void input_unregister_device(struct input_dev *); 1236void input_unregister_device(struct input_dev *);
1139 1237
1140int input_register_handler(struct input_handler *); 1238int __must_check input_register_handler(struct input_handler *);
1141void input_unregister_handler(struct input_handler *); 1239void input_unregister_handler(struct input_handler *);
1142 1240
1143int input_register_handle(struct input_handle *); 1241int input_register_handle(struct input_handle *);
@@ -1214,7 +1312,7 @@ extern struct class input_class;
1214 * @max_effects: maximum number of effects supported by device 1312 * @max_effects: maximum number of effects supported by device
1215 * @effects: pointer to an array of effects currently loaded into device 1313 * @effects: pointer to an array of effects currently loaded into device
1216 * @effect_owners: array of effect owners; when file handle owning 1314 * @effect_owners: array of effect owners; when file handle owning
1217 * an effect gets closed the effcet is automatically erased 1315 * an effect gets closed the effect is automatically erased
1218 * 1316 *
1219 * Every force-feedback device must implement upload() and playback() 1317 * Every force-feedback device must implement upload() and playback()
1220 * methods; erase() is optional. set_gain() and set_autocenter() need 1318 * methods; erase() is optional. set_gain() and set_autocenter() need
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 5523f19d88d2..8e5f289052a2 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -205,6 +205,15 @@ static inline int disable_irq_wake(unsigned int irq)
205 enable_irq(irq) 205 enable_irq(irq)
206# endif 206# endif
207 207
208static inline int enable_irq_wake(unsigned int irq)
209{
210 return 0;
211}
212
213static inline int disable_irq_wake(unsigned int irq)
214{
215 return 0;
216}
208#endif /* CONFIG_GENERIC_HARDIRQS */ 217#endif /* CONFIG_GENERIC_HARDIRQS */
209 218
210#ifndef __ARCH_SET_SOFTIRQ_PENDING 219#ifndef __ARCH_SET_SOFTIRQ_PENDING
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 71ea92319241..6187a8567bc7 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -110,9 +110,6 @@ extern int allocate_resource(struct resource *root, struct resource *new,
110int adjust_resource(struct resource *res, resource_size_t start, 110int adjust_resource(struct resource *res, resource_size_t start,
111 resource_size_t size); 111 resource_size_t size);
112 112
113/* get registered SYSTEM_RAM resources in specified area */
114extern int find_next_system_ram(struct resource *res);
115
116/* Convenience shorthand with allocation */ 113/* Convenience shorthand with allocation */
117#define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name)) 114#define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name))
118#define request_mem_region(start,n,name) __request_region(&iomem_resource, (start), (n), (name)) 115#define request_mem_region(start,n,name) __request_region(&iomem_resource, (start), (n), (name))
diff --git a/include/linux/isdn.h b/include/linux/isdn.h
index ad09506554a3..d0ecc8eebfbf 100644
--- a/include/linux/isdn.h
+++ b/include/linux/isdn.h
@@ -167,6 +167,7 @@ typedef struct {
167#include <linux/etherdevice.h> 167#include <linux/etherdevice.h>
168#include <linux/skbuff.h> 168#include <linux/skbuff.h>
169#include <linux/tcp.h> 169#include <linux/tcp.h>
170#include <linux/mutex.h>
170 171
171#define ISDN_TTY_MAJOR 43 172#define ISDN_TTY_MAJOR 43
172#define ISDN_TTYAUX_MAJOR 44 173#define ISDN_TTYAUX_MAJOR 44
@@ -286,7 +287,6 @@ typedef struct {
286/* Local interface-data */ 287/* Local interface-data */
287typedef struct isdn_net_local_s { 288typedef struct isdn_net_local_s {
288 ulong magic; 289 ulong magic;
289 char name[10]; /* Name of device */
290 struct net_device_stats stats; /* Ethernet Statistics */ 290 struct net_device_stats stats; /* Ethernet Statistics */
291 int isdn_device; /* Index to isdn-device */ 291 int isdn_device; /* Index to isdn-device */
292 int isdn_channel; /* Index to isdn-channel */ 292 int isdn_channel; /* Index to isdn-channel */
@@ -617,7 +617,7 @@ typedef struct isdn_devt {
617 int v110emu[ISDN_MAX_CHANNELS]; /* V.110 emulator-mode 0=none */ 617 int v110emu[ISDN_MAX_CHANNELS]; /* V.110 emulator-mode 0=none */
618 atomic_t v110use[ISDN_MAX_CHANNELS]; /* Usage-Semaphore for stream */ 618 atomic_t v110use[ISDN_MAX_CHANNELS]; /* Usage-Semaphore for stream */
619 isdn_v110_stream *v110[ISDN_MAX_CHANNELS]; /* V.110 private data */ 619 isdn_v110_stream *v110[ISDN_MAX_CHANNELS]; /* V.110 private data */
620 struct semaphore sem; /* serialize list access*/ 620 struct mutex mtx; /* serialize list access*/
621 unsigned long global_features; 621 unsigned long global_features;
622} isdn_dev; 622} isdn_dev;
623 623
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index 452737551260..72f522372924 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -30,6 +30,7 @@
30#include <linux/bit_spinlock.h> 30#include <linux/bit_spinlock.h>
31#include <linux/mutex.h> 31#include <linux/mutex.h>
32#include <linux/timer.h> 32#include <linux/timer.h>
33#include <linux/lockdep.h>
33 34
34#include <asm/semaphore.h> 35#include <asm/semaphore.h>
35#endif 36#endif
@@ -371,6 +372,7 @@ struct jbd_revoke_table_s;
371 * @h_sync: flag for sync-on-close 372 * @h_sync: flag for sync-on-close
372 * @h_jdata: flag to force data journaling 373 * @h_jdata: flag to force data journaling
373 * @h_aborted: flag indicating fatal error on handle 374 * @h_aborted: flag indicating fatal error on handle
375 * @h_lockdep_map: lockdep info for debugging lock problems
374 **/ 376 **/
375 377
376/* Docbook can't yet cope with the bit fields, but will leave the documentation 378/* Docbook can't yet cope with the bit fields, but will leave the documentation
@@ -396,6 +398,10 @@ struct handle_s
396 unsigned int h_sync: 1; /* sync-on-close */ 398 unsigned int h_sync: 1; /* sync-on-close */
397 unsigned int h_jdata: 1; /* force data journaling */ 399 unsigned int h_jdata: 1; /* force data journaling */
398 unsigned int h_aborted: 1; /* fatal error on handle */ 400 unsigned int h_aborted: 1; /* fatal error on handle */
401
402#ifdef CONFIG_DEBUG_LOCK_ALLOC
403 struct lockdep_map h_lockdep_map;
404#endif
399}; 405};
400 406
401 407
diff --git a/include/linux/jffs2.h b/include/linux/jffs2.h
index 840631fa5ff1..6b563cae23df 100644
--- a/include/linux/jffs2.h
+++ b/include/linux/jffs2.h
@@ -46,6 +46,7 @@
46#define JFFS2_COMPR_COPY 0x04 46#define JFFS2_COMPR_COPY 0x04
47#define JFFS2_COMPR_DYNRUBIN 0x05 47#define JFFS2_COMPR_DYNRUBIN 0x05
48#define JFFS2_COMPR_ZLIB 0x06 48#define JFFS2_COMPR_ZLIB 0x06
49#define JFFS2_COMPR_LZO 0x07
49/* Compatibility flags. */ 50/* Compatibility flags. */
50#define JFFS2_COMPAT_MASK 0xc000 /* What do to if an unknown nodetype is found */ 51#define JFFS2_COMPAT_MASK 0xc000 /* What do to if an unknown nodetype is found */
51#define JFFS2_NODE_ACCURATE 0x2000 52#define JFFS2_NODE_ACCURATE 0x2000
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h
index c080f61fb024..8b080024bbc1 100644
--- a/include/linux/jiffies.h
+++ b/include/linux/jiffies.h
@@ -36,8 +36,6 @@
36/* LATCH is used in the interval timer and ftape setup. */ 36/* LATCH is used in the interval timer and ftape setup. */
37#define LATCH ((CLOCK_TICK_RATE + HZ/2) / HZ) /* For divider */ 37#define LATCH ((CLOCK_TICK_RATE + HZ/2) / HZ) /* For divider */
38 38
39#define LATCH_HPET ((HPET_TICK_RATE + HZ/2) / HZ)
40
41/* Suppose we want to devide two numbers NOM and DEN: NOM/DEN, the we can 39/* Suppose we want to devide two numbers NOM and DEN: NOM/DEN, the we can
42 * improve accuracy by shifting LSH bits, hence calculating: 40 * improve accuracy by shifting LSH bits, hence calculating:
43 * (NOM << LSH) / DEN 41 * (NOM << LSH) / DEN
@@ -53,13 +51,9 @@
53/* HZ is the requested value. ACTHZ is actual HZ ("<< 8" is for accuracy) */ 51/* HZ is the requested value. ACTHZ is actual HZ ("<< 8" is for accuracy) */
54#define ACTHZ (SH_DIV (CLOCK_TICK_RATE, LATCH, 8)) 52#define ACTHZ (SH_DIV (CLOCK_TICK_RATE, LATCH, 8))
55 53
56#define ACTHZ_HPET (SH_DIV (HPET_TICK_RATE, LATCH_HPET, 8))
57
58/* TICK_NSEC is the time between ticks in nsec assuming real ACTHZ */ 54/* TICK_NSEC is the time between ticks in nsec assuming real ACTHZ */
59#define TICK_NSEC (SH_DIV (1000000UL * 1000, ACTHZ, 8)) 55#define TICK_NSEC (SH_DIV (1000000UL * 1000, ACTHZ, 8))
60 56
61#define TICK_NSEC_HPET (SH_DIV(1000000UL * 1000, ACTHZ_HPET, 8))
62
63/* TICK_USEC is the time between ticks in usec assuming fake USER_HZ */ 57/* TICK_USEC is the time between ticks in usec assuming fake USER_HZ */
64#define TICK_USEC ((1000000UL + USER_HZ/2) / USER_HZ) 58#define TICK_USEC ((1000000UL + USER_HZ/2) / USER_HZ)
65 59
@@ -115,6 +109,10 @@ static inline u64 get_jiffies_64(void)
115 ((long)(a) - (long)(b) >= 0)) 109 ((long)(a) - (long)(b) >= 0))
116#define time_before_eq(a,b) time_after_eq(b,a) 110#define time_before_eq(a,b) time_after_eq(b,a)
117 111
112#define time_in_range(a,b,c) \
113 (time_after_eq(a,b) && \
114 time_before_eq(a,c))
115
118/* Same as above, but does so with platform independent 64bit types. 116/* Same as above, but does so with platform independent 64bit types.
119 * These must be used when utilizing jiffies_64 (i.e. return value of 117 * These must be used when utilizing jiffies_64 (i.e. return value of
120 * get_jiffies_64() */ 118 * get_jiffies_64() */
@@ -150,6 +148,8 @@ static inline u64 get_jiffies_64(void)
150 */ 148 */
151#define MAX_JIFFY_OFFSET ((LONG_MAX >> 1)-1) 149#define MAX_JIFFY_OFFSET ((LONG_MAX >> 1)-1)
152 150
151extern unsigned long preset_lpj;
152
153/* 153/*
154 * We want to do realistic conversions of time so we need to use the same 154 * We want to do realistic conversions of time so we need to use the same
155 * values the update wall clock code uses as the jiffies size. This value 155 * values the update wall clock code uses as the jiffies size. This value
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 47160fe378c9..5fdbc814c2eb 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -35,6 +35,7 @@ extern const char linux_proc_banner[];
35#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1) 35#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1)
36#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask)) 36#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
37#define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a))) 37#define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a)))
38#define IS_ALIGNED(x,a) (((x) % ((typeof(x))(a))) == 0)
38 39
39#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) 40#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
40 41
@@ -42,6 +43,20 @@ extern const char linux_proc_banner[];
42#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) 43#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
43#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) 44#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
44 45
46#ifdef CONFIG_LBD
47# include <asm/div64.h>
48# define sector_div(a, b) do_div(a, b)
49#else
50# define sector_div(n, b)( \
51{ \
52 int _res; \
53 _res = (n) % (b); \
54 (n) /= (b); \
55 _res; \
56} \
57)
58#endif
59
45/** 60/**
46 * upper_32_bits - return bits 32-63 of a number 61 * upper_32_bits - return bits 32-63 of a number
47 * @n: the number we're accessing 62 * @n: the number we're accessing
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h
index 43e895f1cabe..12bf44f083f5 100644
--- a/include/linux/kernel_stat.h
+++ b/include/linux/kernel_stat.h
@@ -23,6 +23,7 @@ struct cpu_usage_stat {
23 cputime64_t idle; 23 cputime64_t idle;
24 cputime64_t iowait; 24 cputime64_t iowait;
25 cputime64_t steal; 25 cputime64_t steal;
26 cputime64_t guest;
26}; 27};
27 28
28struct kernel_stat { 29struct kernel_stat {
diff --git a/include/linux/keyboard.h b/include/linux/keyboard.h
index 7ddbc30aa8e7..33b5c2e325b9 100644
--- a/include/linux/keyboard.h
+++ b/include/linux/keyboard.h
@@ -416,6 +416,7 @@ extern unsigned short plain_map[NR_KEYS];
416#define K_SHIFTRLOCK K(KT_LOCK,KG_SHIFTR) 416#define K_SHIFTRLOCK K(KT_LOCK,KG_SHIFTR)
417#define K_CTRLLLOCK K(KT_LOCK,KG_CTRLL) 417#define K_CTRLLLOCK K(KT_LOCK,KG_CTRLL)
418#define K_CTRLRLOCK K(KT_LOCK,KG_CTRLR) 418#define K_CTRLRLOCK K(KT_LOCK,KG_CTRLR)
419#define K_CAPSSHIFTLOCK K(KT_LOCK,KG_CAPSSHIFT)
419 420
420#define K_SHIFT_SLOCK K(KT_SLOCK,KG_SHIFT) 421#define K_SHIFT_SLOCK K(KT_SLOCK,KG_SHIFT)
421#define K_CTRL_SLOCK K(KT_SLOCK,KG_CTRL) 422#define K_CTRL_SLOCK K(KT_SLOCK,KG_CTRL)
@@ -425,8 +426,9 @@ extern unsigned short plain_map[NR_KEYS];
425#define K_SHIFTR_SLOCK K(KT_SLOCK,KG_SHIFTR) 426#define K_SHIFTR_SLOCK K(KT_SLOCK,KG_SHIFTR)
426#define K_CTRLL_SLOCK K(KT_SLOCK,KG_CTRLL) 427#define K_CTRLL_SLOCK K(KT_SLOCK,KG_CTRLL)
427#define K_CTRLR_SLOCK K(KT_SLOCK,KG_CTRLR) 428#define K_CTRLR_SLOCK K(KT_SLOCK,KG_CTRLR)
429#define K_CAPSSHIFT_SLOCK K(KT_SLOCK,KG_CAPSSHIFT)
428 430
429#define NR_LOCK 8 431#define NR_LOCK 9
430 432
431#define K_BRL_BLANK K(KT_BRL, 0) 433#define K_BRL_BLANK K(KT_BRL, 0)
432#define K_BRL_DOT1 K(KT_BRL, 1) 434#define K_BRL_DOT1 K(KT_BRL, 1)
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 949706c33622..4a0d27f475d7 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -1,8 +1,10 @@
1/* 1/*
2 * kobject.h - generic kernel object infrastructure. 2 * kobject.h - generic kernel object infrastructure.
3 * 3 *
4 * Copyright (c) 2002-2003 Patrick Mochel 4 * Copyright (c) 2002-2003 Patrick Mochel
5 * Copyright (c) 2002-2003 Open Source Development Labs 5 * Copyright (c) 2002-2003 Open Source Development Labs
6 * Copyright (c) 2006-2007 Greg Kroah-Hartman <greg@kroah.com>
7 * Copyright (c) 2006-2007 Novell Inc.
6 * 8 *
7 * This file is released under the GPLv2. 9 * This file is released under the GPLv2.
8 * 10 *
@@ -29,6 +31,8 @@
29 31
30#define KOBJ_NAME_LEN 20 32#define KOBJ_NAME_LEN 20
31#define UEVENT_HELPER_PATH_LEN 256 33#define UEVENT_HELPER_PATH_LEN 256
34#define UEVENT_NUM_ENVP 32 /* number of env pointers */
35#define UEVENT_BUFFER_SIZE 2048 /* buffer for the variables */
32 36
33/* path to the userspace helper executed on an event */ 37/* path to the userspace helper executed on an event */
34extern char uevent_helper[]; 38extern char uevent_helper[];
@@ -56,19 +60,14 @@ enum kobject_action {
56 KOBJ_MAX 60 KOBJ_MAX
57}; 61};
58 62
59/* The list of strings defining the valid kobject actions as specified above */
60extern const char *kobject_actions[];
61
62struct kobject { 63struct kobject {
63 const char * k_name; 64 const char * k_name;
64 char name[KOBJ_NAME_LEN];
65 struct kref kref; 65 struct kref kref;
66 struct list_head entry; 66 struct list_head entry;
67 struct kobject * parent; 67 struct kobject * parent;
68 struct kset * kset; 68 struct kset * kset;
69 struct kobj_type * ktype; 69 struct kobj_type * ktype;
70 struct sysfs_dirent * sd; 70 struct sysfs_dirent * sd;
71 wait_queue_head_t poll;
72}; 71};
73 72
74extern int kobject_set_name(struct kobject *, const char *, ...) 73extern int kobject_set_name(struct kobject *, const char *, ...)
@@ -83,14 +82,9 @@ extern void kobject_init(struct kobject *);
83extern void kobject_cleanup(struct kobject *); 82extern void kobject_cleanup(struct kobject *);
84 83
85extern int __must_check kobject_add(struct kobject *); 84extern int __must_check kobject_add(struct kobject *);
86extern int __must_check kobject_shadow_add(struct kobject *kobj,
87 struct sysfs_dirent *shadow_parent);
88extern void kobject_del(struct kobject *); 85extern void kobject_del(struct kobject *);
89 86
90extern int __must_check kobject_rename(struct kobject *, const char *new_name); 87extern int __must_check kobject_rename(struct kobject *, const char *new_name);
91extern int __must_check kobject_shadow_rename(struct kobject *kobj,
92 struct sysfs_dirent *new_parent,
93 const char *new_name);
94extern int __must_check kobject_move(struct kobject *, struct kobject *); 88extern int __must_check kobject_move(struct kobject *, struct kobject *);
95 89
96extern int __must_check kobject_register(struct kobject *); 90extern int __must_check kobject_register(struct kobject *);
@@ -111,36 +105,44 @@ struct kobj_type {
111 struct attribute ** default_attrs; 105 struct attribute ** default_attrs;
112}; 106};
113 107
108struct kobj_uevent_env {
109 char *envp[UEVENT_NUM_ENVP];
110 int envp_idx;
111 char buf[UEVENT_BUFFER_SIZE];
112 int buflen;
113};
114
114struct kset_uevent_ops { 115struct kset_uevent_ops {
115 int (*filter)(struct kset *kset, struct kobject *kobj); 116 int (*filter)(struct kset *kset, struct kobject *kobj);
116 const char *(*name)(struct kset *kset, struct kobject *kobj); 117 const char *(*name)(struct kset *kset, struct kobject *kobj);
117 int (*uevent)(struct kset *kset, struct kobject *kobj, char **envp, 118 int (*uevent)(struct kset *kset, struct kobject *kobj,
118 int num_envp, char *buffer, int buffer_size); 119 struct kobj_uevent_env *env);
119}; 120};
120 121
121/* 122/**
122 * struct kset - a set of kobjects of a specific type, belonging 123 * struct kset - a set of kobjects of a specific type, belonging to a specific subsystem.
123 * to a specific subsystem.
124 *
125 * All kobjects of a kset should be embedded in an identical
126 * type. This type may have a descriptor, which the kset points
127 * to. This allows there to exist sets of objects of the same
128 * type in different subsystems.
129 * 124 *
130 * A subsystem does not have to be a list of only one type 125 * A kset defines a group of kobjects. They can be individually
131 * of object; multiple ksets can belong to one subsystem. All 126 * different "types" but overall these kobjects all want to be grouped
132 * ksets of a subsystem share the subsystem's lock. 127 * together and operated on in the same manner. ksets are used to
128 * define the attribute callbacks and other common events that happen to
129 * a kobject.
133 * 130 *
134 * Each kset can support specific event variables; it can 131 * @ktype: the struct kobj_type for this specific kset
135 * supress the event generation or add subsystem specific 132 * @list: the list of all kobjects for this kset
136 * variables carried with the event. 133 * @list_lock: a lock for iterating over the kobjects
134 * @kobj: the embedded kobject for this kset (recursion, isn't it fun...)
135 * @uevent_ops: the set of uevent operations for this kset. These are
136 * called whenever a kobject has something happen to it so that the kset
137 * can add new environment variables, or filter out the uevents if so
138 * desired.
137 */ 139 */
138struct kset { 140struct kset {
139 struct kobj_type * ktype; 141 struct kobj_type *ktype;
140 struct list_head list; 142 struct list_head list;
141 spinlock_t list_lock; 143 spinlock_t list_lock;
142 struct kobject kobj; 144 struct kobject kobj;
143 struct kset_uevent_ops * uevent_ops; 145 struct kset_uevent_ops *uevent_ops;
144}; 146};
145 147
146 148
@@ -179,18 +181,18 @@ extern struct kobject * kset_find_obj(struct kset *, const char *);
179 * Use this when initializing an embedded kset with no other 181 * Use this when initializing an embedded kset with no other
180 * fields to initialize. 182 * fields to initialize.
181 */ 183 */
182#define set_kset_name(str) .kset = { .kobj = { .name = str } } 184#define set_kset_name(str) .kset = { .kobj = { .k_name = str } }
183 185
184 186
185#define decl_subsys(_name,_type,_uevent_ops) \ 187#define decl_subsys(_name,_type,_uevent_ops) \
186struct kset _name##_subsys = { \ 188struct kset _name##_subsys = { \
187 .kobj = { .name = __stringify(_name) }, \ 189 .kobj = { .k_name = __stringify(_name) }, \
188 .ktype = _type, \ 190 .ktype = _type, \
189 .uevent_ops =_uevent_ops, \ 191 .uevent_ops =_uevent_ops, \
190} 192}
191#define decl_subsys_name(_varname,_name,_type,_uevent_ops) \ 193#define decl_subsys_name(_varname,_name,_type,_uevent_ops) \
192struct kset _varname##_subsys = { \ 194struct kset _varname##_subsys = { \
193 .kobj = { .name = __stringify(_name) }, \ 195 .kobj = { .k_name = __stringify(_name) }, \
194 .ktype = _type, \ 196 .ktype = _type, \
195 .uevent_ops =_uevent_ops, \ 197 .uevent_ops =_uevent_ops, \
196} 198}
@@ -218,49 +220,9 @@ extern struct kset hypervisor_subsys;
218#define kobj_set_kset_s(obj,subsys) \ 220#define kobj_set_kset_s(obj,subsys) \
219 (obj)->kobj.kset = &(subsys) 221 (obj)->kobj.kset = &(subsys)
220 222
221/**
222 * kset_set_kset_s(obj,subsys) - set kset for embedded kset.
223 * @obj: ptr to some object type.
224 * @subsys: a subsystem object (not a ptr).
225 *
226 * Can be used for any object type with an embedded ->kset.
227 * Sets the kset of @obj's embedded kobject (via its embedded
228 * kset) to @subsys.kset. This makes @obj a member of that
229 * kset.
230 */
231
232#define kset_set_kset_s(obj,subsys) \
233 (obj)->kset.kobj.kset = &(subsys)
234
235/**
236 * subsys_set_kset(obj,subsys) - set kset for subsystem
237 * @obj: ptr to some object type.
238 * @_subsys: a subsystem object (not a ptr).
239 *
240 * Can be used for any object type with an embedded ->subsys.
241 * Sets the kset of @obj's kobject to @subsys.kset. This makes
242 * the object a member of that kset.
243 */
244
245#define subsys_set_kset(obj,_subsys) \
246 (obj)->subsys.kobj.kset = &(_subsys)
247
248extern void subsystem_init(struct kset *);
249extern int __must_check subsystem_register(struct kset *); 223extern int __must_check subsystem_register(struct kset *);
250extern void subsystem_unregister(struct kset *); 224extern void subsystem_unregister(struct kset *);
251 225
252static inline struct kset *subsys_get(struct kset *s)
253{
254 if (s)
255 return kset_get(s);
256 return NULL;
257}
258
259static inline void subsys_put(struct kset *s)
260{
261 kset_put(s);
262}
263
264struct subsys_attribute { 226struct subsys_attribute {
265 struct attribute attr; 227 struct attribute attr;
266 ssize_t (*show)(struct kset *, char *); 228 ssize_t (*show)(struct kset *, char *);
@@ -275,10 +237,11 @@ int kobject_uevent(struct kobject *kobj, enum kobject_action action);
275int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, 237int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
276 char *envp[]); 238 char *envp[]);
277 239
278int add_uevent_var(char **envp, int num_envp, int *cur_index, 240int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...)
279 char *buffer, int buffer_size, int *cur_len, 241 __attribute__((format (printf, 2, 3)));
280 const char *format, ...) 242
281 __attribute__((format (printf, 7, 8))); 243int kobject_action_type(const char *buf, size_t count,
244 enum kobject_action *type);
282#else 245#else
283static inline int kobject_uevent(struct kobject *kobj, enum kobject_action action) 246static inline int kobject_uevent(struct kobject *kobj, enum kobject_action action)
284{ return 0; } 247{ return 0; }
@@ -287,10 +250,12 @@ static inline int kobject_uevent_env(struct kobject *kobj,
287 char *envp[]) 250 char *envp[])
288{ return 0; } 251{ return 0; }
289 252
290static inline int add_uevent_var(char **envp, int num_envp, int *cur_index, 253static inline int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...)
291 char *buffer, int buffer_size, int *cur_len,
292 const char *format, ...)
293{ return 0; } 254{ return 0; }
255
256static inline int kobject_action_type(const char *buf, size_t count,
257 enum kobject_action *type)
258{ return -EINVAL; }
294#endif 259#endif
295 260
296#endif /* __KERNEL__ */ 261#endif /* __KERNEL__ */
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index 51464d12a4e5..81891581e89b 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -166,6 +166,12 @@ struct kretprobe_instance {
166 struct task_struct *task; 166 struct task_struct *task;
167}; 167};
168 168
169struct kretprobe_blackpoint {
170 const char *name;
171 void *addr;
172};
173extern struct kretprobe_blackpoint kretprobe_blacklist[];
174
169static inline void kretprobe_assert(struct kretprobe_instance *ri, 175static inline void kretprobe_assert(struct kretprobe_instance *ri,
170 unsigned long orig_ret_address, unsigned long trampoline_address) 176 unsigned long orig_ret_address, unsigned long trampoline_address)
171{ 177{
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index e6edca81ab84..057a7f34ee36 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -4,8 +4,7 @@
4/* 4/*
5 * Userspace interface for /dev/kvm - kernel based virtual machine 5 * Userspace interface for /dev/kvm - kernel based virtual machine
6 * 6 *
7 * Note: this interface is considered experimental and may change without 7 * Note: you must update KVM_API_VERSION if you change this interface.
8 * notice.
9 */ 8 */
10 9
11#include <asm/types.h> 10#include <asm/types.h>
@@ -13,14 +12,8 @@
13 12
14#define KVM_API_VERSION 12 13#define KVM_API_VERSION 12
15 14
16/* 15/* Architectural interrupt line count. */
17 * Architectural interrupt line count, and the size of the bitmap needed
18 * to hold them.
19 */
20#define KVM_NR_INTERRUPTS 256 16#define KVM_NR_INTERRUPTS 256
21#define KVM_IRQ_BITMAP_SIZE_BYTES ((KVM_NR_INTERRUPTS + 7) / 8)
22#define KVM_IRQ_BITMAP_SIZE(type) (KVM_IRQ_BITMAP_SIZE_BYTES / sizeof(type))
23
24 17
25/* for KVM_CREATE_MEMORY_REGION */ 18/* for KVM_CREATE_MEMORY_REGION */
26struct kvm_memory_region { 19struct kvm_memory_region {
@@ -41,20 +34,89 @@ struct kvm_memory_alias {
41 __u64 target_phys_addr; 34 __u64 target_phys_addr;
42}; 35};
43 36
44enum kvm_exit_reason { 37/* for KVM_IRQ_LINE */
45 KVM_EXIT_UNKNOWN = 0, 38struct kvm_irq_level {
46 KVM_EXIT_EXCEPTION = 1, 39 /*
47 KVM_EXIT_IO = 2, 40 * ACPI gsi notion of irq.
48 KVM_EXIT_HYPERCALL = 3, 41 * For IA-64 (APIC model) IOAPIC0: irq 0-23; IOAPIC1: irq 24-47..
49 KVM_EXIT_DEBUG = 4, 42 * For X86 (standard AT mode) PIC0/1: irq 0-15. IOAPIC0: 0-23..
50 KVM_EXIT_HLT = 5, 43 */
51 KVM_EXIT_MMIO = 6, 44 __u32 irq;
52 KVM_EXIT_IRQ_WINDOW_OPEN = 7, 45 __u32 level;
53 KVM_EXIT_SHUTDOWN = 8, 46};
54 KVM_EXIT_FAIL_ENTRY = 9, 47
55 KVM_EXIT_INTR = 10, 48/* for KVM_GET_IRQCHIP and KVM_SET_IRQCHIP */
49struct kvm_pic_state {
50 __u8 last_irr; /* edge detection */
51 __u8 irr; /* interrupt request register */
52 __u8 imr; /* interrupt mask register */
53 __u8 isr; /* interrupt service register */
54 __u8 priority_add; /* highest irq priority */
55 __u8 irq_base;
56 __u8 read_reg_select;
57 __u8 poll;
58 __u8 special_mask;
59 __u8 init_state;
60 __u8 auto_eoi;
61 __u8 rotate_on_auto_eoi;
62 __u8 special_fully_nested_mode;
63 __u8 init4; /* true if 4 byte init */
64 __u8 elcr; /* PIIX edge/trigger selection */
65 __u8 elcr_mask;
66};
67
68#define KVM_IOAPIC_NUM_PINS 24
69struct kvm_ioapic_state {
70 __u64 base_address;
71 __u32 ioregsel;
72 __u32 id;
73 __u32 irr;
74 __u32 pad;
75 union {
76 __u64 bits;
77 struct {
78 __u8 vector;
79 __u8 delivery_mode:3;
80 __u8 dest_mode:1;
81 __u8 delivery_status:1;
82 __u8 polarity:1;
83 __u8 remote_irr:1;
84 __u8 trig_mode:1;
85 __u8 mask:1;
86 __u8 reserve:7;
87 __u8 reserved[4];
88 __u8 dest_id;
89 } fields;
90 } redirtbl[KVM_IOAPIC_NUM_PINS];
56}; 91};
57 92
93#define KVM_IRQCHIP_PIC_MASTER 0
94#define KVM_IRQCHIP_PIC_SLAVE 1
95#define KVM_IRQCHIP_IOAPIC 2
96
97struct kvm_irqchip {
98 __u32 chip_id;
99 __u32 pad;
100 union {
101 char dummy[512]; /* reserving space */
102 struct kvm_pic_state pic;
103 struct kvm_ioapic_state ioapic;
104 } chip;
105};
106
107#define KVM_EXIT_UNKNOWN 0
108#define KVM_EXIT_EXCEPTION 1
109#define KVM_EXIT_IO 2
110#define KVM_EXIT_HYPERCALL 3
111#define KVM_EXIT_DEBUG 4
112#define KVM_EXIT_HLT 5
113#define KVM_EXIT_MMIO 6
114#define KVM_EXIT_IRQ_WINDOW_OPEN 7
115#define KVM_EXIT_SHUTDOWN 8
116#define KVM_EXIT_FAIL_ENTRY 9
117#define KVM_EXIT_INTR 10
118#define KVM_EXIT_SET_TPR 11
119
58/* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */ 120/* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */
59struct kvm_run { 121struct kvm_run {
60 /* in */ 122 /* in */
@@ -106,11 +168,14 @@ struct kvm_run {
106 } mmio; 168 } mmio;
107 /* KVM_EXIT_HYPERCALL */ 169 /* KVM_EXIT_HYPERCALL */
108 struct { 170 struct {
171 __u64 nr;
109 __u64 args[6]; 172 __u64 args[6];
110 __u64 ret; 173 __u64 ret;
111 __u32 longmode; 174 __u32 longmode;
112 __u32 pad; 175 __u32 pad;
113 } hypercall; 176 } hypercall;
177 /* Fix the size of the union. */
178 char padding[256];
114 }; 179 };
115}; 180};
116 181
@@ -139,6 +204,12 @@ struct kvm_fpu {
139 __u32 pad2; 204 __u32 pad2;
140}; 205};
141 206
207/* for KVM_GET_LAPIC and KVM_SET_LAPIC */
208#define KVM_APIC_REG_SIZE 0x400
209struct kvm_lapic_state {
210 char regs[KVM_APIC_REG_SIZE];
211};
212
142struct kvm_segment { 213struct kvm_segment {
143 __u64 base; 214 __u64 base;
144 __u32 limit; 215 __u32 limit;
@@ -164,7 +235,7 @@ struct kvm_sregs {
164 __u64 cr0, cr2, cr3, cr4, cr8; 235 __u64 cr0, cr2, cr3, cr4, cr8;
165 __u64 efer; 236 __u64 efer;
166 __u64 apic_base; 237 __u64 apic_base;
167 __u64 interrupt_bitmap[KVM_IRQ_BITMAP_SIZE(__u64)]; 238 __u64 interrupt_bitmap[(KVM_NR_INTERRUPTS + 63) / 64];
168}; 239};
169 240
170struct kvm_msr_entry { 241struct kvm_msr_entry {
@@ -272,6 +343,12 @@ struct kvm_signal_mask {
272#define KVM_GET_VCPU_MMAP_SIZE _IO(KVMIO, 0x04) /* in bytes */ 343#define KVM_GET_VCPU_MMAP_SIZE _IO(KVMIO, 0x04) /* in bytes */
273 344
274/* 345/*
346 * Extension capability list.
347 */
348#define KVM_CAP_IRQCHIP 0
349#define KVM_CAP_HLT 1
350
351/*
275 * ioctls for VM fds 352 * ioctls for VM fds
276 */ 353 */
277#define KVM_SET_MEMORY_REGION _IOW(KVMIO, 0x40, struct kvm_memory_region) 354#define KVM_SET_MEMORY_REGION _IOW(KVMIO, 0x40, struct kvm_memory_region)
@@ -282,6 +359,11 @@ struct kvm_signal_mask {
282#define KVM_CREATE_VCPU _IO(KVMIO, 0x41) 359#define KVM_CREATE_VCPU _IO(KVMIO, 0x41)
283#define KVM_GET_DIRTY_LOG _IOW(KVMIO, 0x42, struct kvm_dirty_log) 360#define KVM_GET_DIRTY_LOG _IOW(KVMIO, 0x42, struct kvm_dirty_log)
284#define KVM_SET_MEMORY_ALIAS _IOW(KVMIO, 0x43, struct kvm_memory_alias) 361#define KVM_SET_MEMORY_ALIAS _IOW(KVMIO, 0x43, struct kvm_memory_alias)
362/* Device model IOC */
363#define KVM_CREATE_IRQCHIP _IO(KVMIO, 0x60)
364#define KVM_IRQ_LINE _IOW(KVMIO, 0x61, struct kvm_irq_level)
365#define KVM_GET_IRQCHIP _IOWR(KVMIO, 0x62, struct kvm_irqchip)
366#define KVM_SET_IRQCHIP _IOR(KVMIO, 0x63, struct kvm_irqchip)
285 367
286/* 368/*
287 * ioctls for vcpu fds 369 * ioctls for vcpu fds
@@ -300,5 +382,7 @@ struct kvm_signal_mask {
300#define KVM_SET_SIGNAL_MASK _IOW(KVMIO, 0x8b, struct kvm_signal_mask) 382#define KVM_SET_SIGNAL_MASK _IOW(KVMIO, 0x8b, struct kvm_signal_mask)
301#define KVM_GET_FPU _IOR(KVMIO, 0x8c, struct kvm_fpu) 383#define KVM_GET_FPU _IOR(KVMIO, 0x8c, struct kvm_fpu)
302#define KVM_SET_FPU _IOW(KVMIO, 0x8d, struct kvm_fpu) 384#define KVM_SET_FPU _IOW(KVMIO, 0x8d, struct kvm_fpu)
385#define KVM_GET_LAPIC _IOR(KVMIO, 0x8e, struct kvm_lapic_state)
386#define KVM_SET_LAPIC _IOW(KVMIO, 0x8f, struct kvm_lapic_state)
303 387
304#endif 388#endif
diff --git a/include/linux/libata.h b/include/linux/libata.h
index a67bb9075e9b..377e6d4d9be3 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -28,9 +28,8 @@
28 28
29#include <linux/delay.h> 29#include <linux/delay.h>
30#include <linux/interrupt.h> 30#include <linux/interrupt.h>
31#include <linux/pci.h>
32#include <linux/dma-mapping.h> 31#include <linux/dma-mapping.h>
33#include <asm/scatterlist.h> 32#include <linux/scatterlist.h>
34#include <linux/io.h> 33#include <linux/io.h>
35#include <linux/ata.h> 34#include <linux/ata.h>
36#include <linux/workqueue.h> 35#include <linux/workqueue.h>
@@ -107,12 +106,6 @@ static inline u32 ata_msg_init(int dval, int default_msg_enable_bits)
107/* defines only for the constants which don't work well as enums */ 106/* defines only for the constants which don't work well as enums */
108#define ATA_TAG_POISON 0xfafbfcfdU 107#define ATA_TAG_POISON 0xfafbfcfdU
109 108
110/* move to PCI layer? */
111static inline struct device *pci_dev_to_dev(struct pci_dev *pdev)
112{
113 return &pdev->dev;
114}
115
116enum { 109enum {
117 /* various global constants */ 110 /* various global constants */
118 LIBATA_MAX_PRD = ATA_MAX_PRD / 2, 111 LIBATA_MAX_PRD = ATA_MAX_PRD / 2,
@@ -139,11 +132,12 @@ enum {
139 ATA_DFLAG_FLUSH_EXT = (1 << 4), /* do FLUSH_EXT instead of FLUSH */ 132 ATA_DFLAG_FLUSH_EXT = (1 << 4), /* do FLUSH_EXT instead of FLUSH */
140 ATA_DFLAG_ACPI_PENDING = (1 << 5), /* ACPI resume action pending */ 133 ATA_DFLAG_ACPI_PENDING = (1 << 5), /* ACPI resume action pending */
141 ATA_DFLAG_ACPI_FAILED = (1 << 6), /* ACPI on devcfg has failed */ 134 ATA_DFLAG_ACPI_FAILED = (1 << 6), /* ACPI on devcfg has failed */
142 ATA_DFLAG_CFG_MASK = (1 << 8) - 1, 135 ATA_DFLAG_AN = (1 << 7), /* AN configured */
136 ATA_DFLAG_CFG_MASK = (1 << 12) - 1,
143 137
144 ATA_DFLAG_PIO = (1 << 8), /* device limited to PIO mode */ 138 ATA_DFLAG_PIO = (1 << 12), /* device limited to PIO mode */
145 ATA_DFLAG_NCQ_OFF = (1 << 9), /* device limited to non-NCQ mode */ 139 ATA_DFLAG_NCQ_OFF = (1 << 13), /* device limited to non-NCQ mode */
146 ATA_DFLAG_SPUNDOWN = (1 << 10), /* XXX: for spindown_compat */ 140 ATA_DFLAG_SPUNDOWN = (1 << 14), /* XXX: for spindown_compat */
147 ATA_DFLAG_INIT_MASK = (1 << 16) - 1, 141 ATA_DFLAG_INIT_MASK = (1 << 16) - 1,
148 142
149 ATA_DFLAG_DETACH = (1 << 16), 143 ATA_DFLAG_DETACH = (1 << 16),
@@ -154,7 +148,22 @@ enum {
154 ATA_DEV_ATA_UNSUP = 2, /* ATA device (unsupported) */ 148 ATA_DEV_ATA_UNSUP = 2, /* ATA device (unsupported) */
155 ATA_DEV_ATAPI = 3, /* ATAPI device */ 149 ATA_DEV_ATAPI = 3, /* ATAPI device */
156 ATA_DEV_ATAPI_UNSUP = 4, /* ATAPI device (unsupported) */ 150 ATA_DEV_ATAPI_UNSUP = 4, /* ATAPI device (unsupported) */
157 ATA_DEV_NONE = 5, /* no device */ 151 ATA_DEV_PMP = 5, /* SATA port multiplier */
152 ATA_DEV_PMP_UNSUP = 6, /* SATA port multiplier (unsupported) */
153 ATA_DEV_SEMB = 7, /* SEMB */
154 ATA_DEV_SEMB_UNSUP = 8, /* SEMB (unsupported) */
155 ATA_DEV_NONE = 9, /* no device */
156
157 /* struct ata_link flags */
158 ATA_LFLAG_HRST_TO_RESUME = (1 << 0), /* hardreset to resume link */
159 ATA_LFLAG_SKIP_D2H_BSY = (1 << 1), /* can't wait for the first D2H
160 * Register FIS clearing BSY */
161 ATA_LFLAG_NO_SRST = (1 << 2), /* avoid softreset */
162 ATA_LFLAG_ASSUME_ATA = (1 << 3), /* assume ATA class */
163 ATA_LFLAG_ASSUME_SEMB = (1 << 4), /* assume SEMB class */
164 ATA_LFLAG_ASSUME_CLASS = ATA_LFLAG_ASSUME_ATA | ATA_LFLAG_ASSUME_SEMB,
165 ATA_LFLAG_NO_RETRY = (1 << 5), /* don't retry this link */
166 ATA_LFLAG_DISABLED = (1 << 6), /* link is disabled */
158 167
159 /* struct ata_port flags */ 168 /* struct ata_port flags */
160 ATA_FLAG_SLAVE_POSS = (1 << 0), /* host supports slave dev */ 169 ATA_FLAG_SLAVE_POSS = (1 << 0), /* host supports slave dev */
@@ -170,13 +179,12 @@ enum {
170 ATA_FLAG_PIO_POLLING = (1 << 9), /* use polling PIO if LLD 179 ATA_FLAG_PIO_POLLING = (1 << 9), /* use polling PIO if LLD
171 * doesn't handle PIO interrupts */ 180 * doesn't handle PIO interrupts */
172 ATA_FLAG_NCQ = (1 << 10), /* host supports NCQ */ 181 ATA_FLAG_NCQ = (1 << 10), /* host supports NCQ */
173 ATA_FLAG_HRST_TO_RESUME = (1 << 11), /* hardreset to resume phy */
174 ATA_FLAG_SKIP_D2H_BSY = (1 << 12), /* can't wait for the first D2H
175 * Register FIS clearing BSY */
176 ATA_FLAG_DEBUGMSG = (1 << 13), 182 ATA_FLAG_DEBUGMSG = (1 << 13),
177 ATA_FLAG_IGN_SIMPLEX = (1 << 15), /* ignore SIMPLEX */ 183 ATA_FLAG_IGN_SIMPLEX = (1 << 15), /* ignore SIMPLEX */
178 ATA_FLAG_NO_IORDY = (1 << 16), /* controller lacks iordy */ 184 ATA_FLAG_NO_IORDY = (1 << 16), /* controller lacks iordy */
179 ATA_FLAG_ACPI_SATA = (1 << 17), /* need native SATA ACPI layout */ 185 ATA_FLAG_ACPI_SATA = (1 << 17), /* need native SATA ACPI layout */
186 ATA_FLAG_AN = (1 << 18), /* controller supports AN */
187 ATA_FLAG_PMP = (1 << 19), /* controller supports PMP */
180 188
181 /* The following flag belongs to ap->pflags but is kept in 189 /* The following flag belongs to ap->pflags but is kept in
182 * ap->flags because it's referenced in many LLDs and will be 190 * ap->flags because it's referenced in many LLDs and will be
@@ -195,6 +203,7 @@ enum {
195 ATA_PFLAG_UNLOADING = (1 << 5), /* module is unloading */ 203 ATA_PFLAG_UNLOADING = (1 << 5), /* module is unloading */
196 ATA_PFLAG_SCSI_HOTPLUG = (1 << 6), /* SCSI hotplug scheduled */ 204 ATA_PFLAG_SCSI_HOTPLUG = (1 << 6), /* SCSI hotplug scheduled */
197 ATA_PFLAG_INITIALIZING = (1 << 7), /* being initialized, don't touch */ 205 ATA_PFLAG_INITIALIZING = (1 << 7), /* being initialized, don't touch */
206 ATA_PFLAG_RESETTING = (1 << 8), /* reset in progress */
198 207
199 ATA_PFLAG_SUSPENDED = (1 << 17), /* port is suspended (power) */ 208 ATA_PFLAG_SUSPENDED = (1 << 17), /* port is suspended (power) */
200 ATA_PFLAG_PM_PENDING = (1 << 18), /* PM operation pending */ 209 ATA_PFLAG_PM_PENDING = (1 << 18), /* PM operation pending */
@@ -207,6 +216,7 @@ enum {
207 ATA_QCFLAG_DMAMAP = ATA_QCFLAG_SG | ATA_QCFLAG_SINGLE, 216 ATA_QCFLAG_DMAMAP = ATA_QCFLAG_SG | ATA_QCFLAG_SINGLE,
208 ATA_QCFLAG_IO = (1 << 3), /* standard IO command */ 217 ATA_QCFLAG_IO = (1 << 3), /* standard IO command */
209 ATA_QCFLAG_RESULT_TF = (1 << 4), /* result TF requested */ 218 ATA_QCFLAG_RESULT_TF = (1 << 4), /* result TF requested */
219 ATA_QCFLAG_CLEAR_EXCL = (1 << 5), /* clear excl_link on completion */
210 220
211 ATA_QCFLAG_FAILED = (1 << 16), /* cmd failed and is owned by EH */ 221 ATA_QCFLAG_FAILED = (1 << 16), /* cmd failed and is owned by EH */
212 ATA_QCFLAG_SENSE_VALID = (1 << 17), /* sense data valid */ 222 ATA_QCFLAG_SENSE_VALID = (1 << 17), /* sense data valid */
@@ -263,6 +273,10 @@ enum {
263 /* ering size */ 273 /* ering size */
264 ATA_ERING_SIZE = 32, 274 ATA_ERING_SIZE = 32,
265 275
276 /* return values for ->qc_defer */
277 ATA_DEFER_LINK = 1,
278 ATA_DEFER_PORT = 2,
279
266 /* desc_len for ata_eh_info and context */ 280 /* desc_len for ata_eh_info and context */
267 ATA_EH_DESC_LEN = 80, 281 ATA_EH_DESC_LEN = 80,
268 282
@@ -270,6 +284,7 @@ enum {
270 ATA_EH_REVALIDATE = (1 << 0), 284 ATA_EH_REVALIDATE = (1 << 0),
271 ATA_EH_SOFTRESET = (1 << 1), 285 ATA_EH_SOFTRESET = (1 << 1),
272 ATA_EH_HARDRESET = (1 << 2), 286 ATA_EH_HARDRESET = (1 << 2),
287 ATA_EH_ENABLE_LINK = (1 << 3),
273 288
274 ATA_EH_RESET_MASK = ATA_EH_SOFTRESET | ATA_EH_HARDRESET, 289 ATA_EH_RESET_MASK = ATA_EH_SOFTRESET | ATA_EH_HARDRESET,
275 ATA_EH_PERDEV_MASK = ATA_EH_REVALIDATE, 290 ATA_EH_PERDEV_MASK = ATA_EH_REVALIDATE,
@@ -289,12 +304,16 @@ enum {
289 ATA_EHI_DID_RESET = ATA_EHI_DID_SOFTRESET | ATA_EHI_DID_HARDRESET, 304 ATA_EHI_DID_RESET = ATA_EHI_DID_SOFTRESET | ATA_EHI_DID_HARDRESET,
290 ATA_EHI_RESET_MODIFIER_MASK = ATA_EHI_RESUME_LINK, 305 ATA_EHI_RESET_MODIFIER_MASK = ATA_EHI_RESUME_LINK,
291 306
292 /* max repeat if error condition is still set after ->error_handler */ 307 /* max tries if error condition is still set after ->error_handler */
293 ATA_EH_MAX_REPEAT = 5, 308 ATA_EH_MAX_TRIES = 5,
294 309
295 /* how hard are we gonna try to probe/recover devices */ 310 /* how hard are we gonna try to probe/recover devices */
296 ATA_PROBE_MAX_TRIES = 3, 311 ATA_PROBE_MAX_TRIES = 3,
297 ATA_EH_DEV_TRIES = 3, 312 ATA_EH_DEV_TRIES = 3,
313 ATA_EH_PMP_TRIES = 5,
314 ATA_EH_PMP_LINK_TRIES = 3,
315
316 SATA_PMP_SCR_TIMEOUT = 250,
298 317
299 /* Horkage types. May be set by libata or controller on drives 318 /* Horkage types. May be set by libata or controller on drives
300 (some horkage may be drive/controller pair dependant */ 319 (some horkage may be drive/controller pair dependant */
@@ -304,6 +323,14 @@ enum {
304 ATA_HORKAGE_NONCQ = (1 << 2), /* Don't use NCQ */ 323 ATA_HORKAGE_NONCQ = (1 << 2), /* Don't use NCQ */
305 ATA_HORKAGE_MAX_SEC_128 = (1 << 3), /* Limit max sects to 128 */ 324 ATA_HORKAGE_MAX_SEC_128 = (1 << 3), /* Limit max sects to 128 */
306 ATA_HORKAGE_BROKEN_HPA = (1 << 4), /* Broken HPA */ 325 ATA_HORKAGE_BROKEN_HPA = (1 << 4), /* Broken HPA */
326 ATA_HORKAGE_SKIP_PM = (1 << 5), /* Skip PM operations */
327 ATA_HORKAGE_HPA_SIZE = (1 << 6), /* native size off by one */
328
329 /* DMA mask for user DMA control: User visible values; DO NOT
330 renumber */
331 ATA_DMA_MASK_ATA = (1 << 0), /* DMA on ATA Disk */
332 ATA_DMA_MASK_ATAPI = (1 << 1), /* DMA on ATAPI */
333 ATA_DMA_MASK_CFA = (1 << 2), /* DMA on CF Card */
307}; 334};
308 335
309enum hsm_task_states { 336enum hsm_task_states {
@@ -333,14 +360,15 @@ enum ata_completion_errors {
333struct scsi_device; 360struct scsi_device;
334struct ata_port_operations; 361struct ata_port_operations;
335struct ata_port; 362struct ata_port;
363struct ata_link;
336struct ata_queued_cmd; 364struct ata_queued_cmd;
337 365
338/* typedefs */ 366/* typedefs */
339typedef void (*ata_qc_cb_t) (struct ata_queued_cmd *qc); 367typedef void (*ata_qc_cb_t) (struct ata_queued_cmd *qc);
340typedef int (*ata_prereset_fn_t)(struct ata_port *ap, unsigned long deadline); 368typedef int (*ata_prereset_fn_t)(struct ata_link *link, unsigned long deadline);
341typedef int (*ata_reset_fn_t)(struct ata_port *ap, unsigned int *classes, 369typedef int (*ata_reset_fn_t)(struct ata_link *link, unsigned int *classes,
342 unsigned long deadline); 370 unsigned long deadline);
343typedef void (*ata_postreset_fn_t)(struct ata_port *ap, unsigned int *classes); 371typedef void (*ata_postreset_fn_t)(struct ata_link *link, unsigned int *classes);
344 372
345struct ata_ioports { 373struct ata_ioports {
346 void __iomem *cmd_addr; 374 void __iomem *cmd_addr;
@@ -363,8 +391,6 @@ struct ata_ioports {
363struct ata_host { 391struct ata_host {
364 spinlock_t lock; 392 spinlock_t lock;
365 struct device *dev; 393 struct device *dev;
366 unsigned long irq;
367 unsigned long irq2;
368 void __iomem * const *iomap; 394 void __iomem * const *iomap;
369 unsigned int n_ports; 395 unsigned int n_ports;
370 void *private_data; 396 void *private_data;
@@ -390,6 +416,7 @@ struct ata_queued_cmd {
390 unsigned long flags; /* ATA_QCFLAG_xxx */ 416 unsigned long flags; /* ATA_QCFLAG_xxx */
391 unsigned int tag; 417 unsigned int tag;
392 unsigned int n_elem; 418 unsigned int n_elem;
419 unsigned int n_iter;
393 unsigned int orig_n_elem; 420 unsigned int orig_n_elem;
394 421
395 int dma_dir; 422 int dma_dir;
@@ -400,7 +427,7 @@ struct ata_queued_cmd {
400 unsigned int nbytes; 427 unsigned int nbytes;
401 unsigned int curbytes; 428 unsigned int curbytes;
402 429
403 unsigned int cursg; 430 struct scatterlist *cursg;
404 unsigned int cursg_ofs; 431 unsigned int cursg_ofs;
405 432
406 struct scatterlist sgent; 433 struct scatterlist sgent;
@@ -436,7 +463,7 @@ struct ata_ering {
436}; 463};
437 464
438struct ata_device { 465struct ata_device {
439 struct ata_port *ap; 466 struct ata_link *link;
440 unsigned int devno; /* 0 or 1 */ 467 unsigned int devno; /* 0 or 1 */
441 unsigned long flags; /* ATA_DFLAG_xxx */ 468 unsigned long flags; /* ATA_DFLAG_xxx */
442 unsigned int horkage; /* List of broken features */ 469 unsigned int horkage; /* List of broken features */
@@ -447,7 +474,12 @@ struct ata_device {
447 /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */ 474 /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */
448 u64 n_sectors; /* size of device, if ATA */ 475 u64 n_sectors; /* size of device, if ATA */
449 unsigned int class; /* ATA_DEV_xxx */ 476 unsigned int class; /* ATA_DEV_xxx */
450 u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */ 477
478 union {
479 u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */
480 u32 gscr[SATA_PMP_GSCR_DWORDS]; /* PMP GSCR block */
481 };
482
451 u8 pio_mode; 483 u8 pio_mode;
452 u8 dma_mode; 484 u8 dma_mode;
453 u8 xfer_mode; 485 u8 xfer_mode;
@@ -510,6 +542,27 @@ struct ata_acpi_gtm {
510 u32 flags; 542 u32 flags;
511} __packed; 543} __packed;
512 544
545struct ata_link {
546 struct ata_port *ap;
547 int pmp; /* port multiplier port # */
548
549 unsigned int active_tag; /* active tag on this link */
550 u32 sactive; /* active NCQ commands */
551
552 unsigned int flags; /* ATA_LFLAG_xxx */
553
554 unsigned int hw_sata_spd_limit;
555 unsigned int sata_spd_limit;
556 unsigned int sata_spd; /* current SATA PHY speed */
557
558 /* record runtime error info, protected by host_set lock */
559 struct ata_eh_info eh_info;
560 /* EH context */
561 struct ata_eh_context eh_context;
562
563 struct ata_device device[ATA_MAX_DEVICES];
564};
565
513struct ata_port { 566struct ata_port {
514 struct Scsi_Host *scsi_host; /* our co-allocated scsi host */ 567 struct Scsi_Host *scsi_host; /* our co-allocated scsi host */
515 const struct ata_port_operations *ops; 568 const struct ata_port_operations *ops;
@@ -533,23 +586,17 @@ struct ata_port {
533 unsigned int mwdma_mask; 586 unsigned int mwdma_mask;
534 unsigned int udma_mask; 587 unsigned int udma_mask;
535 unsigned int cbl; /* cable type; ATA_CBL_xxx */ 588 unsigned int cbl; /* cable type; ATA_CBL_xxx */
536 unsigned int hw_sata_spd_limit;
537 unsigned int sata_spd_limit; /* SATA PHY speed limit */
538 unsigned int sata_spd; /* current SATA PHY speed */
539
540 /* record runtime error info, protected by host lock */
541 struct ata_eh_info eh_info;
542 /* EH context owned by EH */
543 struct ata_eh_context eh_context;
544
545 struct ata_device device[ATA_MAX_DEVICES];
546 589
547 struct ata_queued_cmd qcmd[ATA_MAX_QUEUE]; 590 struct ata_queued_cmd qcmd[ATA_MAX_QUEUE];
548 unsigned long qc_allocated; 591 unsigned long qc_allocated;
549 unsigned int qc_active; 592 unsigned int qc_active;
593 int nr_active_links; /* #links with active qcs */
594
595 struct ata_link link; /* host default link */
550 596
551 unsigned int active_tag; 597 int nr_pmp_links; /* nr of available PMP links */
552 u32 sactive; 598 struct ata_link *pmp_link; /* array of PMP links */
599 struct ata_link *excl_link; /* for PMP qc exclusion */
553 600
554 struct ata_port_stats stats; 601 struct ata_port_stats stats;
555 struct ata_host *host; 602 struct ata_host *host;
@@ -565,6 +612,7 @@ struct ata_port {
565 u32 msg_enable; 612 u32 msg_enable;
566 struct list_head eh_done_q; 613 struct list_head eh_done_q;
567 wait_queue_head_t eh_wait_q; 614 wait_queue_head_t eh_wait_q;
615 int eh_tries;
568 616
569 pm_message_t pm_mesg; 617 pm_message_t pm_mesg;
570 int *pm_result; 618 int *pm_result;
@@ -582,8 +630,6 @@ struct ata_port {
582}; 630};
583 631
584struct ata_port_operations { 632struct ata_port_operations {
585 void (*port_disable) (struct ata_port *);
586
587 void (*dev_config) (struct ata_device *); 633 void (*dev_config) (struct ata_device *);
588 634
589 void (*set_piomode) (struct ata_port *, struct ata_device *); 635 void (*set_piomode) (struct ata_port *, struct ata_device *);
@@ -599,7 +645,7 @@ struct ata_port_operations {
599 void (*dev_select)(struct ata_port *ap, unsigned int device); 645 void (*dev_select)(struct ata_port *ap, unsigned int device);
600 646
601 void (*phy_reset) (struct ata_port *ap); /* obsolete */ 647 void (*phy_reset) (struct ata_port *ap); /* obsolete */
602 int (*set_mode) (struct ata_port *ap, struct ata_device **r_failed_dev); 648 int (*set_mode) (struct ata_link *link, struct ata_device **r_failed_dev);
603 649
604 int (*cable_detect) (struct ata_port *ap); 650 int (*cable_detect) (struct ata_port *ap);
605 651
@@ -610,9 +656,14 @@ struct ata_port_operations {
610 656
611 void (*data_xfer) (struct ata_device *, unsigned char *, unsigned int, int); 657 void (*data_xfer) (struct ata_device *, unsigned char *, unsigned int, int);
612 658
659 int (*qc_defer) (struct ata_queued_cmd *qc);
613 void (*qc_prep) (struct ata_queued_cmd *qc); 660 void (*qc_prep) (struct ata_queued_cmd *qc);
614 unsigned int (*qc_issue) (struct ata_queued_cmd *qc); 661 unsigned int (*qc_issue) (struct ata_queued_cmd *qc);
615 662
663 /* port multiplier */
664 void (*pmp_attach) (struct ata_port *ap);
665 void (*pmp_detach) (struct ata_port *ap);
666
616 /* Error handlers. ->error_handler overrides ->eng_timeout and 667 /* Error handlers. ->error_handler overrides ->eng_timeout and
617 * indicates that new-style EH is in place. 668 * indicates that new-style EH is in place.
618 */ 669 */
@@ -626,7 +677,6 @@ struct ata_port_operations {
626 irq_handler_t irq_handler; 677 irq_handler_t irq_handler;
627 void (*irq_clear) (struct ata_port *); 678 void (*irq_clear) (struct ata_port *);
628 u8 (*irq_on) (struct ata_port *); 679 u8 (*irq_on) (struct ata_port *);
629 u8 (*irq_ack) (struct ata_port *ap, unsigned int chk_drq);
630 680
631 int (*scr_read) (struct ata_port *ap, unsigned int sc_reg, u32 *val); 681 int (*scr_read) (struct ata_port *ap, unsigned int sc_reg, u32 *val);
632 int (*scr_write) (struct ata_port *ap, unsigned int sc_reg, u32 val); 682 int (*scr_write) (struct ata_port *ap, unsigned int sc_reg, u32 val);
@@ -646,6 +696,7 @@ struct ata_port_operations {
646struct ata_port_info { 696struct ata_port_info {
647 struct scsi_host_template *sht; 697 struct scsi_host_template *sht;
648 unsigned long flags; 698 unsigned long flags;
699 unsigned long link_flags;
649 unsigned long pio_mask; 700 unsigned long pio_mask;
650 unsigned long mwdma_mask; 701 unsigned long mwdma_mask;
651 unsigned long udma_mask; 702 unsigned long udma_mask;
@@ -689,38 +740,27 @@ static inline int ata_port_is_dummy(struct ata_port *ap)
689 return ap->ops == &ata_dummy_port_ops; 740 return ap->ops == &ata_dummy_port_ops;
690} 741}
691 742
692extern void sata_print_link_status(struct ata_port *ap); 743extern void sata_print_link_status(struct ata_link *link);
693extern void ata_port_probe(struct ata_port *); 744extern void ata_port_probe(struct ata_port *);
694extern void __sata_phy_reset(struct ata_port *ap); 745extern void __sata_phy_reset(struct ata_port *ap);
695extern void sata_phy_reset(struct ata_port *ap); 746extern void sata_phy_reset(struct ata_port *ap);
696extern void ata_bus_reset(struct ata_port *ap); 747extern void ata_bus_reset(struct ata_port *ap);
697extern int sata_set_spd(struct ata_port *ap); 748extern int sata_set_spd(struct ata_link *link);
698extern int sata_phy_debounce(struct ata_port *ap, const unsigned long *param, 749extern int sata_link_debounce(struct ata_link *link,
699 unsigned long deadline); 750 const unsigned long *params, unsigned long deadline);
700extern int sata_phy_resume(struct ata_port *ap, const unsigned long *param, 751extern int sata_link_resume(struct ata_link *link, const unsigned long *params,
701 unsigned long deadline); 752 unsigned long deadline);
702extern int ata_std_prereset(struct ata_port *ap, unsigned long deadline); 753extern int ata_std_prereset(struct ata_link *link, unsigned long deadline);
703extern int ata_std_softreset(struct ata_port *ap, unsigned int *classes, 754extern int ata_std_softreset(struct ata_link *link, unsigned int *classes,
704 unsigned long deadline); 755 unsigned long deadline);
705extern int sata_port_hardreset(struct ata_port *ap, const unsigned long *timing, 756extern int sata_link_hardreset(struct ata_link *link,
706 unsigned long deadline); 757 const unsigned long *timing, unsigned long deadline);
707extern int sata_std_hardreset(struct ata_port *ap, unsigned int *class, 758extern int sata_std_hardreset(struct ata_link *link, unsigned int *class,
708 unsigned long deadline); 759 unsigned long deadline);
709extern void ata_std_postreset(struct ata_port *ap, unsigned int *classes); 760extern void ata_std_postreset(struct ata_link *link, unsigned int *classes);
710extern void ata_port_disable(struct ata_port *); 761extern void ata_port_disable(struct ata_port *);
711extern void ata_std_ports(struct ata_ioports *ioaddr); 762extern void ata_std_ports(struct ata_ioports *ioaddr);
712#ifdef CONFIG_PCI 763
713extern int ata_pci_init_one (struct pci_dev *pdev,
714 const struct ata_port_info * const * ppi);
715extern void ata_pci_remove_one (struct pci_dev *pdev);
716#ifdef CONFIG_PM
717extern void ata_pci_device_do_suspend(struct pci_dev *pdev, pm_message_t mesg);
718extern int __must_check ata_pci_device_do_resume(struct pci_dev *pdev);
719extern int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg);
720extern int ata_pci_device_resume(struct pci_dev *pdev);
721#endif
722extern int ata_pci_clear_simplex(struct pci_dev *pdev);
723#endif /* CONFIG_PCI */
724extern struct ata_host *ata_host_alloc(struct device *dev, int max_ports); 764extern struct ata_host *ata_host_alloc(struct device *dev, int max_ports);
725extern struct ata_host *ata_host_alloc_pinfo(struct device *dev, 765extern struct ata_host *ata_host_alloc_pinfo(struct device *dev,
726 const struct ata_port_info * const * ppi, int n_ports); 766 const struct ata_port_info * const * ppi, int n_ports);
@@ -746,12 +786,12 @@ extern int ata_sas_slave_configure(struct scsi_device *, struct ata_port *);
746extern int ata_sas_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *), 786extern int ata_sas_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *),
747 struct ata_port *ap); 787 struct ata_port *ap);
748extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc); 788extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc);
749extern int sata_scr_valid(struct ata_port *ap); 789extern int sata_scr_valid(struct ata_link *link);
750extern int sata_scr_read(struct ata_port *ap, int reg, u32 *val); 790extern int sata_scr_read(struct ata_link *link, int reg, u32 *val);
751extern int sata_scr_write(struct ata_port *ap, int reg, u32 val); 791extern int sata_scr_write(struct ata_link *link, int reg, u32 val);
752extern int sata_scr_write_flush(struct ata_port *ap, int reg, u32 val); 792extern int sata_scr_write_flush(struct ata_link *link, int reg, u32 val);
753extern int ata_port_online(struct ata_port *ap); 793extern int ata_link_online(struct ata_link *link);
754extern int ata_port_offline(struct ata_port *ap); 794extern int ata_link_offline(struct ata_link *link);
755#ifdef CONFIG_PM 795#ifdef CONFIG_PM
756extern int ata_host_suspend(struct ata_host *host, pm_message_t mesg); 796extern int ata_host_suspend(struct ata_host *host, pm_message_t mesg);
757extern void ata_host_resume(struct ata_host *host); 797extern void ata_host_resume(struct ata_host *host);
@@ -765,7 +805,8 @@ extern void ata_port_queue_task(struct ata_port *ap, work_func_t fn,
765extern u32 ata_wait_register(void __iomem *reg, u32 mask, u32 val, 805extern u32 ata_wait_register(void __iomem *reg, u32 mask, u32 val,
766 unsigned long interval_msec, 806 unsigned long interval_msec,
767 unsigned long timeout_msec); 807 unsigned long timeout_msec);
768extern unsigned int ata_dev_try_classify(struct ata_port *, unsigned int, u8 *); 808extern unsigned int ata_dev_try_classify(struct ata_device *dev, int present,
809 u8 *r_err);
769 810
770/* 811/*
771 * Default driver ops implementations 812 * Default driver ops implementations
@@ -787,6 +828,7 @@ extern void ata_data_xfer(struct ata_device *adev, unsigned char *buf,
787 unsigned int buflen, int write_data); 828 unsigned int buflen, int write_data);
788extern void ata_data_xfer_noirq(struct ata_device *adev, unsigned char *buf, 829extern void ata_data_xfer_noirq(struct ata_device *adev, unsigned char *buf,
789 unsigned int buflen, int write_data); 830 unsigned int buflen, int write_data);
831extern int ata_std_qc_defer(struct ata_queued_cmd *qc);
790extern void ata_dumb_qc_prep(struct ata_queued_cmd *qc); 832extern void ata_dumb_qc_prep(struct ata_queued_cmd *qc);
791extern void ata_qc_prep(struct ata_queued_cmd *qc); 833extern void ata_qc_prep(struct ata_queued_cmd *qc);
792extern void ata_noop_qc_prep(struct ata_queued_cmd *qc); 834extern void ata_noop_qc_prep(struct ata_queued_cmd *qc);
@@ -830,11 +872,8 @@ extern void ata_scsi_slave_destroy(struct scsi_device *sdev);
830extern int ata_scsi_change_queue_depth(struct scsi_device *sdev, 872extern int ata_scsi_change_queue_depth(struct scsi_device *sdev,
831 int queue_depth); 873 int queue_depth);
832extern struct ata_device *ata_dev_pair(struct ata_device *adev); 874extern struct ata_device *ata_dev_pair(struct ata_device *adev);
833extern int ata_do_set_mode(struct ata_port *ap, struct ata_device **r_failed_dev); 875extern int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev);
834extern u8 ata_irq_on(struct ata_port *ap); 876extern u8 ata_irq_on(struct ata_port *ap);
835extern u8 ata_dummy_irq_on(struct ata_port *ap);
836extern u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq);
837extern u8 ata_dummy_irq_ack(struct ata_port *ap, unsigned int chk_drq);
838 877
839extern int ata_cable_40wire(struct ata_port *ap); 878extern int ata_cable_40wire(struct ata_port *ap);
840extern int ata_cable_80wire(struct ata_port *ap); 879extern int ata_cable_80wire(struct ata_port *ap);
@@ -869,8 +908,29 @@ enum {
869 ATA_TIMING_CYCLE | ATA_TIMING_UDMA, 908 ATA_TIMING_CYCLE | ATA_TIMING_UDMA,
870}; 909};
871 910
911/* libata-acpi.c */
912#ifdef CONFIG_ATA_ACPI
913extern int ata_acpi_cbl_80wire(struct ata_port *ap);
914int ata_acpi_stm(const struct ata_port *ap, struct ata_acpi_gtm *stm);
915int ata_acpi_gtm(const struct ata_port *ap, struct ata_acpi_gtm *stm);
916#else
917static inline int ata_acpi_cbl_80wire(struct ata_port *ap) { return 0; }
918#endif
872 919
873#ifdef CONFIG_PCI 920#ifdef CONFIG_PCI
921struct pci_dev;
922
923extern int ata_pci_init_one (struct pci_dev *pdev,
924 const struct ata_port_info * const * ppi);
925extern void ata_pci_remove_one (struct pci_dev *pdev);
926#ifdef CONFIG_PM
927extern void ata_pci_device_do_suspend(struct pci_dev *pdev, pm_message_t mesg);
928extern int __must_check ata_pci_device_do_resume(struct pci_dev *pdev);
929extern int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg);
930extern int ata_pci_device_resume(struct pci_dev *pdev);
931#endif
932extern int ata_pci_clear_simplex(struct pci_dev *pdev);
933
874struct pci_bits { 934struct pci_bits {
875 unsigned int reg; /* PCI config register to read */ 935 unsigned int reg; /* PCI config register to read */
876 unsigned int width; /* 1 (8 bit), 2 (16 bit), 4 (32 bit) */ 936 unsigned int width; /* 1 (8 bit), 2 (16 bit), 4 (32 bit) */
@@ -888,13 +948,29 @@ extern unsigned long ata_pci_default_filter(struct ata_device *, unsigned long);
888#endif /* CONFIG_PCI */ 948#endif /* CONFIG_PCI */
889 949
890/* 950/*
951 * PMP
952 */
953extern int sata_pmp_qc_defer_cmd_switch(struct ata_queued_cmd *qc);
954extern int sata_pmp_std_prereset(struct ata_link *link, unsigned long deadline);
955extern int sata_pmp_std_hardreset(struct ata_link *link, unsigned int *class,
956 unsigned long deadline);
957extern void sata_pmp_std_postreset(struct ata_link *link, unsigned int *class);
958extern void sata_pmp_do_eh(struct ata_port *ap,
959 ata_prereset_fn_t prereset, ata_reset_fn_t softreset,
960 ata_reset_fn_t hardreset, ata_postreset_fn_t postreset,
961 ata_prereset_fn_t pmp_prereset, ata_reset_fn_t pmp_softreset,
962 ata_reset_fn_t pmp_hardreset, ata_postreset_fn_t pmp_postreset);
963
964/*
891 * EH 965 * EH
892 */ 966 */
893extern void ata_eng_timeout(struct ata_port *ap); 967extern void ata_eng_timeout(struct ata_port *ap);
894 968
895extern void ata_port_schedule_eh(struct ata_port *ap); 969extern void ata_port_schedule_eh(struct ata_port *ap);
970extern int ata_link_abort(struct ata_link *link);
896extern int ata_port_abort(struct ata_port *ap); 971extern int ata_port_abort(struct ata_port *ap);
897extern int ata_port_freeze(struct ata_port *ap); 972extern int ata_port_freeze(struct ata_port *ap);
973extern int sata_async_notification(struct ata_port *ap);
898 974
899extern void ata_eh_freeze_port(struct ata_port *ap); 975extern void ata_eh_freeze_port(struct ata_port *ap);
900extern void ata_eh_thaw_port(struct ata_port *ap); 976extern void ata_eh_thaw_port(struct ata_port *ap);
@@ -912,14 +988,25 @@ extern void ata_do_eh(struct ata_port *ap, ata_prereset_fn_t prereset,
912#define ata_port_printk(ap, lv, fmt, args...) \ 988#define ata_port_printk(ap, lv, fmt, args...) \
913 printk(lv"ata%u: "fmt, (ap)->print_id , ##args) 989 printk(lv"ata%u: "fmt, (ap)->print_id , ##args)
914 990
991#define ata_link_printk(link, lv, fmt, args...) do { \
992 if ((link)->ap->nr_pmp_links) \
993 printk(lv"ata%u.%02u: "fmt, (link)->ap->print_id, \
994 (link)->pmp , ##args); \
995 else \
996 printk(lv"ata%u: "fmt, (link)->ap->print_id , ##args); \
997 } while(0)
998
915#define ata_dev_printk(dev, lv, fmt, args...) \ 999#define ata_dev_printk(dev, lv, fmt, args...) \
916 printk(lv"ata%u.%02u: "fmt, (dev)->ap->print_id, (dev)->devno , ##args) 1000 printk(lv"ata%u.%02u: "fmt, (dev)->link->ap->print_id, \
1001 (dev)->link->pmp + (dev)->devno , ##args)
917 1002
918/* 1003/*
919 * ata_eh_info helpers 1004 * ata_eh_info helpers
920 */ 1005 */
921extern void __ata_ehi_push_desc(struct ata_eh_info *ehi, const char *fmt, ...); 1006extern void __ata_ehi_push_desc(struct ata_eh_info *ehi, const char *fmt, ...)
922extern void ata_ehi_push_desc(struct ata_eh_info *ehi, const char *fmt, ...); 1007 __attribute__ ((format (printf, 2, 3)));
1008extern void ata_ehi_push_desc(struct ata_eh_info *ehi, const char *fmt, ...)
1009 __attribute__ ((format (printf, 2, 3)));
923extern void ata_ehi_clear_desc(struct ata_eh_info *ehi); 1010extern void ata_ehi_clear_desc(struct ata_eh_info *ehi);
924 1011
925static inline void ata_ehi_schedule_probe(struct ata_eh_info *ehi) 1012static inline void ata_ehi_schedule_probe(struct ata_eh_info *ehi)
@@ -933,10 +1020,21 @@ static inline void ata_ehi_hotplugged(struct ata_eh_info *ehi)
933{ 1020{
934 ata_ehi_schedule_probe(ehi); 1021 ata_ehi_schedule_probe(ehi);
935 ehi->flags |= ATA_EHI_HOTPLUGGED; 1022 ehi->flags |= ATA_EHI_HOTPLUGGED;
1023 ehi->action |= ATA_EH_ENABLE_LINK;
936 ehi->err_mask |= AC_ERR_ATA_BUS; 1024 ehi->err_mask |= AC_ERR_ATA_BUS;
937} 1025}
938 1026
939/* 1027/*
1028 * port description helpers
1029 */
1030extern void ata_port_desc(struct ata_port *ap, const char *fmt, ...)
1031 __attribute__ ((format (printf, 2, 3)));
1032#ifdef CONFIG_PCI
1033extern void ata_port_pbar_desc(struct ata_port *ap, int bar, ssize_t offset,
1034 const char *name);
1035#endif
1036
1037/*
940 * qc helpers 1038 * qc helpers
941 */ 1039 */
942static inline int 1040static inline int
@@ -946,7 +1044,7 @@ ata_sg_is_last(struct scatterlist *sg, struct ata_queued_cmd *qc)
946 return 1; 1044 return 1;
947 if (qc->pad_len) 1045 if (qc->pad_len)
948 return 0; 1046 return 0;
949 if (((sg - qc->__sg) + 1) == qc->n_elem) 1047 if (qc->n_iter == qc->n_elem)
950 return 1; 1048 return 1;
951 return 0; 1049 return 0;
952} 1050}
@@ -954,6 +1052,7 @@ ata_sg_is_last(struct scatterlist *sg, struct ata_queued_cmd *qc)
954static inline struct scatterlist * 1052static inline struct scatterlist *
955ata_qc_first_sg(struct ata_queued_cmd *qc) 1053ata_qc_first_sg(struct ata_queued_cmd *qc)
956{ 1054{
1055 qc->n_iter = 0;
957 if (qc->n_elem) 1056 if (qc->n_elem)
958 return qc->__sg; 1057 return qc->__sg;
959 if (qc->pad_len) 1058 if (qc->pad_len)
@@ -966,8 +1065,8 @@ ata_qc_next_sg(struct scatterlist *sg, struct ata_queued_cmd *qc)
966{ 1065{
967 if (sg == &qc->pad_sgent) 1066 if (sg == &qc->pad_sgent)
968 return NULL; 1067 return NULL;
969 if (++sg - qc->__sg < qc->n_elem) 1068 if (++qc->n_iter < qc->n_elem)
970 return sg; 1069 return sg_next(sg);
971 if (qc->pad_len) 1070 if (qc->pad_len)
972 return &qc->pad_sgent; 1071 return &qc->pad_sgent;
973 return NULL; 1072 return NULL;
@@ -991,12 +1090,14 @@ static inline unsigned int ata_tag_internal(unsigned int tag)
991 */ 1090 */
992static inline unsigned int ata_class_enabled(unsigned int class) 1091static inline unsigned int ata_class_enabled(unsigned int class)
993{ 1092{
994 return class == ATA_DEV_ATA || class == ATA_DEV_ATAPI; 1093 return class == ATA_DEV_ATA || class == ATA_DEV_ATAPI ||
1094 class == ATA_DEV_PMP || class == ATA_DEV_SEMB;
995} 1095}
996 1096
997static inline unsigned int ata_class_disabled(unsigned int class) 1097static inline unsigned int ata_class_disabled(unsigned int class)
998{ 1098{
999 return class == ATA_DEV_ATA_UNSUP || class == ATA_DEV_ATAPI_UNSUP; 1099 return class == ATA_DEV_ATA_UNSUP || class == ATA_DEV_ATAPI_UNSUP ||
1100 class == ATA_DEV_PMP_UNSUP || class == ATA_DEV_SEMB_UNSUP;
1000} 1101}
1001 1102
1002static inline unsigned int ata_class_absent(unsigned int class) 1103static inline unsigned int ata_class_absent(unsigned int class)
@@ -1020,15 +1121,62 @@ static inline unsigned int ata_dev_absent(const struct ata_device *dev)
1020} 1121}
1021 1122
1022/* 1123/*
1023 * port helpers 1124 * link helpers
1024 */ 1125 */
1025static inline int ata_port_max_devices(const struct ata_port *ap) 1126static inline int ata_is_host_link(const struct ata_link *link)
1127{
1128 return link == &link->ap->link;
1129}
1130
1131static inline int ata_link_max_devices(const struct ata_link *link)
1026{ 1132{
1027 if (ap->flags & ATA_FLAG_SLAVE_POSS) 1133 if (ata_is_host_link(link) && link->ap->flags & ATA_FLAG_SLAVE_POSS)
1028 return 2; 1134 return 2;
1029 return 1; 1135 return 1;
1030} 1136}
1031 1137
1138static inline int ata_link_active(struct ata_link *link)
1139{
1140 return ata_tag_valid(link->active_tag) || link->sactive;
1141}
1142
1143static inline struct ata_link *ata_port_first_link(struct ata_port *ap)
1144{
1145 if (ap->nr_pmp_links)
1146 return ap->pmp_link;
1147 return &ap->link;
1148}
1149
1150static inline struct ata_link *ata_port_next_link(struct ata_link *link)
1151{
1152 struct ata_port *ap = link->ap;
1153
1154 if (link == &ap->link) {
1155 if (!ap->nr_pmp_links)
1156 return NULL;
1157 return ap->pmp_link;
1158 }
1159
1160 if (++link - ap->pmp_link < ap->nr_pmp_links)
1161 return link;
1162 return NULL;
1163}
1164
1165#define __ata_port_for_each_link(lk, ap) \
1166 for ((lk) = &(ap)->link; (lk); (lk) = ata_port_next_link(lk))
1167
1168#define ata_port_for_each_link(link, ap) \
1169 for ((link) = ata_port_first_link(ap); (link); \
1170 (link) = ata_port_next_link(link))
1171
1172#define ata_link_for_each_dev(dev, link) \
1173 for ((dev) = (link)->device; \
1174 (dev) < (link)->device + ata_link_max_devices(link) || ((dev) = NULL); \
1175 (dev)++)
1176
1177#define ata_link_for_each_dev_reverse(dev, link) \
1178 for ((dev) = (link)->device + ata_link_max_devices(link) - 1; \
1179 (dev) >= (link)->device || ((dev) = NULL); (dev)--)
1032 1180
1033static inline u8 ata_chk_status(struct ata_port *ap) 1181static inline u8 ata_chk_status(struct ata_port *ap)
1034{ 1182{
@@ -1110,9 +1258,11 @@ static inline u8 ata_wait_idle(struct ata_port *ap)
1110{ 1258{
1111 u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000); 1259 u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000);
1112 1260
1261#ifdef ATA_DEBUG
1113 if (status != 0xff && (status & (ATA_BUSY | ATA_DRQ))) 1262 if (status != 0xff && (status & (ATA_BUSY | ATA_DRQ)))
1114 DPRINTK("ATA: abnormal status 0x%X on port 0x%p\n", 1263 ata_port_printk(ap, KERN_DEBUG, "abnormal Status 0x%X\n",
1115 status, ap->ioaddr.status_addr); 1264 status);
1265#endif
1116 1266
1117 return status; 1267 return status;
1118} 1268}
@@ -1149,7 +1299,7 @@ static inline void ata_tf_init(struct ata_device *dev, struct ata_taskfile *tf)
1149{ 1299{
1150 memset(tf, 0, sizeof(*tf)); 1300 memset(tf, 0, sizeof(*tf));
1151 1301
1152 tf->ctl = dev->ap->ctl; 1302 tf->ctl = dev->link->ap->ctl;
1153 if (dev->devno == 0) 1303 if (dev->devno == 0)
1154 tf->device = ATA_DEVICE_OBS; 1304 tf->device = ATA_DEVICE_OBS;
1155 else 1305 else
@@ -1161,9 +1311,11 @@ static inline void ata_qc_reinit(struct ata_queued_cmd *qc)
1161 qc->dma_dir = DMA_NONE; 1311 qc->dma_dir = DMA_NONE;
1162 qc->__sg = NULL; 1312 qc->__sg = NULL;
1163 qc->flags = 0; 1313 qc->flags = 0;
1164 qc->cursg = qc->cursg_ofs = 0; 1314 qc->cursg = NULL;
1315 qc->cursg_ofs = 0;
1165 qc->nbytes = qc->curbytes = 0; 1316 qc->nbytes = qc->curbytes = 0;
1166 qc->n_elem = 0; 1317 qc->n_elem = 0;
1318 qc->n_iter = 0;
1167 qc->err_mask = 0; 1319 qc->err_mask = 0;
1168 qc->pad_len = 0; 1320 qc->pad_len = 0;
1169 qc->sect_size = ATA_SECT_SIZE; 1321 qc->sect_size = ATA_SECT_SIZE;
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index 0e843bf65877..f6279f68a827 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -238,6 +238,7 @@ extern void lockdep_info(void);
238extern void lockdep_reset(void); 238extern void lockdep_reset(void);
239extern void lockdep_reset_lock(struct lockdep_map *lock); 239extern void lockdep_reset_lock(struct lockdep_map *lock);
240extern void lockdep_free_key_range(void *start, unsigned long size); 240extern void lockdep_free_key_range(void *start, unsigned long size);
241extern void lockdep_sys_exit(void);
241 242
242extern void lockdep_off(void); 243extern void lockdep_off(void);
243extern void lockdep_on(void); 244extern void lockdep_on(void);
@@ -252,6 +253,13 @@ extern void lockdep_init_map(struct lockdep_map *lock, const char *name,
252 struct lock_class_key *key, int subclass); 253 struct lock_class_key *key, int subclass);
253 254
254/* 255/*
256 * To initialize a lockdep_map statically use this macro.
257 * Note that _name must not be NULL.
258 */
259#define STATIC_LOCKDEP_MAP_INIT(_name, _key) \
260 { .name = (_name), .key = (void *)(_key), }
261
262/*
255 * Reinitialize a lock key - for cases where there is special locking or 263 * Reinitialize a lock key - for cases where there is special locking or
256 * special initialization of locks so that the validator gets the scope 264 * special initialization of locks so that the validator gets the scope
257 * of dependencies wrong: they are either too broad (they need a class-split) 265 * of dependencies wrong: they are either too broad (they need a class-split)
@@ -317,6 +325,7 @@ static inline void lockdep_on(void)
317# define INIT_LOCKDEP 325# define INIT_LOCKDEP
318# define lockdep_reset() do { debug_locks = 1; } while (0) 326# define lockdep_reset() do { debug_locks = 1; } while (0)
319# define lockdep_free_key_range(start, size) do { } while (0) 327# define lockdep_free_key_range(start, size) do { } while (0)
328# define lockdep_sys_exit() do { } while (0)
320/* 329/*
321 * The class key takes no space if lockdep is disabled: 330 * The class key takes no space if lockdep is disabled:
322 */ 331 */
diff --git a/include/linux/maple.h b/include/linux/maple.h
new file mode 100644
index 000000000000..bad9a7b319de
--- /dev/null
+++ b/include/linux/maple.h
@@ -0,0 +1,80 @@
1#ifndef __LINUX_MAPLE_H
2#define __LINUX_MAPLE_H
3
4#include <linux/device.h>
5
6extern struct bus_type maple_bus_type;
7
8/* Maple Bus command and response codes */
9enum maple_code {
10 MAPLE_RESPONSE_FILEERR = -5,
11 MAPLE_RESPONSE_AGAIN = -4, /* request should be retransmitted */
12 MAPLE_RESPONSE_BADCMD = -3,
13 MAPLE_RESPONSE_BADFUNC = -2,
14 MAPLE_RESPONSE_NONE = -1, /* unit didn't respond at all */
15 MAPLE_COMMAND_DEVINFO = 1,
16 MAPLE_COMMAND_ALLINFO = 2,
17 MAPLE_COMMAND_RESET = 3,
18 MAPLE_COMMAND_KILL = 4,
19 MAPLE_RESPONSE_DEVINFO = 5,
20 MAPLE_RESPONSE_ALLINFO = 6,
21 MAPLE_RESPONSE_OK = 7,
22 MAPLE_RESPONSE_DATATRF = 8,
23 MAPLE_COMMAND_GETCOND = 9,
24 MAPLE_COMMAND_GETMINFO = 10,
25 MAPLE_COMMAND_BREAD = 11,
26 MAPLE_COMMAND_BWRITE = 12,
27 MAPLE_COMMAND_SETCOND = 14
28};
29
30struct mapleq {
31 struct list_head list;
32 struct maple_device *dev;
33 void *sendbuf, *recvbuf, *recvbufdcsp;
34 unsigned char length;
35 enum maple_code command;
36};
37
38struct maple_devinfo {
39 unsigned long function;
40 unsigned long function_data[3];
41 unsigned char area_code;
42 unsigned char connector_directon;
43 char product_name[31];
44 char product_licence[61];
45 unsigned short standby_power;
46 unsigned short max_power;
47};
48
49struct maple_device {
50 struct maple_driver *driver;
51 struct mapleq *mq;
52 void *private_data;
53 void (*callback) (struct mapleq * mq);
54 unsigned long when, interval, function;
55 struct maple_devinfo devinfo;
56 unsigned char port, unit;
57 char product_name[32];
58 char product_licence[64];
59 int registered;
60 struct device dev;
61};
62
63struct maple_driver {
64 unsigned long function;
65 int (*connect) (struct maple_device * dev);
66 void (*disconnect) (struct maple_device * dev);
67 struct device_driver drv;
68};
69
70void maple_getcond_callback(struct maple_device *dev,
71 void (*callback) (struct mapleq * mq),
72 unsigned long interval,
73 unsigned long function);
74int maple_driver_register(struct device_driver *drv);
75void maple_add_packet(struct mapleq *mq);
76
77#define to_maple_dev(n) container_of(n, struct maple_device, dev)
78#define to_maple_driver(n) container_of(n, struct maple_driver, drv)
79
80#endif /* __LINUX_MAPLE_H */
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h
index 7b54666cea8e..8fee7a45736b 100644
--- a/include/linux/memory_hotplug.h
+++ b/include/linux/memory_hotplug.h
@@ -3,7 +3,6 @@
3 3
4#include <linux/mmzone.h> 4#include <linux/mmzone.h>
5#include <linux/spinlock.h> 5#include <linux/spinlock.h>
6#include <linux/mmzone.h>
7#include <linux/notifier.h> 6#include <linux/notifier.h>
8 7
9struct page; 8struct page;
@@ -59,11 +58,21 @@ extern int add_one_highpage(struct page *page, int pfn, int bad_ppro);
59extern void online_page(struct page *page); 58extern void online_page(struct page *page);
60/* VM interface that may be used by firmware interface */ 59/* VM interface that may be used by firmware interface */
61extern int online_pages(unsigned long, unsigned long); 60extern int online_pages(unsigned long, unsigned long);
61extern void __offline_isolated_pages(unsigned long, unsigned long);
62extern int offline_pages(unsigned long, unsigned long, unsigned long);
62 63
63/* reasonably generic interface to expand the physical pages in a zone */ 64/* reasonably generic interface to expand the physical pages in a zone */
64extern int __add_pages(struct zone *zone, unsigned long start_pfn, 65extern int __add_pages(struct zone *zone, unsigned long start_pfn,
65 unsigned long nr_pages); 66 unsigned long nr_pages);
66 67
68/*
69 * Walk thorugh all memory which is registered as resource.
70 * arg is (start_pfn, nr_pages, private_arg_pointer)
71 */
72extern int walk_memory_resource(unsigned long start_pfn,
73 unsigned long nr_pages, void *arg,
74 int (*func)(unsigned long, unsigned long, void *));
75
67#ifdef CONFIG_NUMA 76#ifdef CONFIG_NUMA
68extern int memory_add_physaddr_to_nid(u64 start); 77extern int memory_add_physaddr_to_nid(u64 start);
69#else 78#else
@@ -161,13 +170,6 @@ static inline int mhp_notimplemented(const char *func)
161} 170}
162 171
163#endif /* ! CONFIG_MEMORY_HOTPLUG */ 172#endif /* ! CONFIG_MEMORY_HOTPLUG */
164static inline int __remove_pages(struct zone *zone, unsigned long start_pfn,
165 unsigned long nr_pages)
166{
167 printk(KERN_WARNING "%s() called, not yet supported\n", __FUNCTION__);
168 dump_stack();
169 return -ENOSYS;
170}
171 173
172extern int add_memory(int nid, u64 start, u64 size); 174extern int add_memory(int nid, u64 start, u64 size);
173extern int arch_add_memory(int nid, u64 start, u64 size); 175extern int arch_add_memory(int nid, u64 start, u64 size);
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
index a020eb2d4e2a..38c04d61ee06 100644
--- a/include/linux/mempolicy.h
+++ b/include/linux/mempolicy.h
@@ -19,6 +19,7 @@
19/* Flags for get_mem_policy */ 19/* Flags for get_mem_policy */
20#define MPOL_F_NODE (1<<0) /* return next IL mode instead of node mask */ 20#define MPOL_F_NODE (1<<0) /* return next IL mode instead of node mask */
21#define MPOL_F_ADDR (1<<1) /* look up vma using address */ 21#define MPOL_F_ADDR (1<<1) /* look up vma using address */
22#define MPOL_F_MEMS_ALLOWED (1<<2) /* return allowed memories */
22 23
23/* Flags for mbind */ 24/* Flags for mbind */
24#define MPOL_MF_STRICT (1<<0) /* Verify existing pages in the mapping */ 25#define MPOL_MF_STRICT (1<<0) /* Verify existing pages in the mapping */
@@ -143,7 +144,6 @@ struct mempolicy *mpol_shared_policy_lookup(struct shared_policy *sp,
143 144
144extern void numa_default_policy(void); 145extern void numa_default_policy(void);
145extern void numa_policy_init(void); 146extern void numa_policy_init(void);
146extern void mpol_rebind_policy(struct mempolicy *pol, const nodemask_t *new);
147extern void mpol_rebind_task(struct task_struct *tsk, 147extern void mpol_rebind_task(struct task_struct *tsk,
148 const nodemask_t *new); 148 const nodemask_t *new);
149extern void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new); 149extern void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new);
@@ -235,11 +235,6 @@ static inline void numa_default_policy(void)
235{ 235{
236} 236}
237 237
238static inline void mpol_rebind_policy(struct mempolicy *pol,
239 const nodemask_t *new)
240{
241}
242
243static inline void mpol_rebind_task(struct task_struct *tsk, 238static inline void mpol_rebind_task(struct task_struct *tsk,
244 const nodemask_t *new) 239 const nodemask_t *new)
245{ 240{
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 1692dd6cb915..7e87e1b1662e 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -50,69 +50,6 @@ extern int sysctl_legacy_va_layout;
50 * mmap() functions). 50 * mmap() functions).
51 */ 51 */
52 52
53/*
54 * This struct defines a memory VMM memory area. There is one of these
55 * per VM-area/task. A VM area is any part of the process virtual memory
56 * space that has a special rule for the page-fault handlers (ie a shared
57 * library, the executable area etc).
58 */
59struct vm_area_struct {
60 struct mm_struct * vm_mm; /* The address space we belong to. */
61 unsigned long vm_start; /* Our start address within vm_mm. */
62 unsigned long vm_end; /* The first byte after our end address
63 within vm_mm. */
64
65 /* linked list of VM areas per task, sorted by address */
66 struct vm_area_struct *vm_next;
67
68 pgprot_t vm_page_prot; /* Access permissions of this VMA. */
69 unsigned long vm_flags; /* Flags, listed below. */
70
71 struct rb_node vm_rb;
72
73 /*
74 * For areas with an address space and backing store,
75 * linkage into the address_space->i_mmap prio tree, or
76 * linkage to the list of like vmas hanging off its node, or
77 * linkage of vma in the address_space->i_mmap_nonlinear list.
78 */
79 union {
80 struct {
81 struct list_head list;
82 void *parent; /* aligns with prio_tree_node parent */
83 struct vm_area_struct *head;
84 } vm_set;
85
86 struct raw_prio_tree_node prio_tree_node;
87 } shared;
88
89 /*
90 * A file's MAP_PRIVATE vma can be in both i_mmap tree and anon_vma
91 * list, after a COW of one of the file pages. A MAP_SHARED vma
92 * can only be in the i_mmap tree. An anonymous MAP_PRIVATE, stack
93 * or brk vma (with NULL file) can only be in an anon_vma list.
94 */
95 struct list_head anon_vma_node; /* Serialized by anon_vma->lock */
96 struct anon_vma *anon_vma; /* Serialized by page_table_lock */
97
98 /* Function pointers to deal with this struct. */
99 struct vm_operations_struct * vm_ops;
100
101 /* Information about our backing store: */
102 unsigned long vm_pgoff; /* Offset (within vm_file) in PAGE_SIZE
103 units, *not* PAGE_CACHE_SIZE */
104 struct file * vm_file; /* File we map to (can be NULL). */
105 void * vm_private_data; /* was vm_pte (shared mem) */
106 unsigned long vm_truncate_count;/* truncate_count or restart_addr */
107
108#ifndef CONFIG_MMU
109 atomic_t vm_usage; /* refcount (VMAs shared if !MMU) */
110#endif
111#ifdef CONFIG_NUMA
112 struct mempolicy *vm_policy; /* NUMA policy for the VMA */
113#endif
114};
115
116extern struct kmem_cache *vm_area_cachep; 53extern struct kmem_cache *vm_area_cachep;
117 54
118/* 55/*
@@ -631,10 +568,6 @@ static inline struct address_space *page_mapping(struct page *page)
631 VM_BUG_ON(PageSlab(page)); 568 VM_BUG_ON(PageSlab(page));
632 if (unlikely(PageSwapCache(page))) 569 if (unlikely(PageSwapCache(page)))
633 mapping = &swapper_space; 570 mapping = &swapper_space;
634#ifdef CONFIG_SLUB
635 else if (unlikely(PageSlab(page)))
636 mapping = NULL;
637#endif
638 else if (unlikely((unsigned long)mapping & PAGE_MAPPING_ANON)) 571 else if (unlikely((unsigned long)mapping & PAGE_MAPPING_ANON))
639 mapping = NULL; 572 mapping = NULL;
640 return mapping; 573 return mapping;
@@ -715,9 +648,6 @@ static inline int page_mapped(struct page *page)
715extern void show_free_areas(void); 648extern void show_free_areas(void);
716 649
717#ifdef CONFIG_SHMEM 650#ifdef CONFIG_SHMEM
718int shmem_set_policy(struct vm_area_struct *vma, struct mempolicy *new);
719struct mempolicy *shmem_get_policy(struct vm_area_struct *vma,
720 unsigned long addr);
721int shmem_lock(struct file *file, int lock, struct user_struct *user); 651int shmem_lock(struct file *file, int lock, struct user_struct *user);
722#else 652#else
723static inline int shmem_lock(struct file *file, int lock, 653static inline int shmem_lock(struct file *file, int lock,
@@ -725,18 +655,6 @@ static inline int shmem_lock(struct file *file, int lock,
725{ 655{
726 return 0; 656 return 0;
727} 657}
728
729static inline int shmem_set_policy(struct vm_area_struct *vma,
730 struct mempolicy *new)
731{
732 return 0;
733}
734
735static inline struct mempolicy *shmem_get_policy(struct vm_area_struct *vma,
736 unsigned long addr)
737{
738 return NULL;
739}
740#endif 658#endif
741struct file *shmem_file_setup(char *name, loff_t size, unsigned long flags); 659struct file *shmem_file_setup(char *name, loff_t size, unsigned long flags);
742 660
@@ -779,8 +697,6 @@ void free_pgtables(struct mmu_gather **tlb, struct vm_area_struct *start_vma,
779 unsigned long floor, unsigned long ceiling); 697 unsigned long floor, unsigned long ceiling);
780int copy_page_range(struct mm_struct *dst, struct mm_struct *src, 698int copy_page_range(struct mm_struct *dst, struct mm_struct *src,
781 struct vm_area_struct *vma); 699 struct vm_area_struct *vma);
782int zeromap_page_range(struct vm_area_struct *vma, unsigned long from,
783 unsigned long size, pgprot_t prot);
784void unmap_mapping_range(struct address_space *mapping, 700void unmap_mapping_range(struct address_space *mapping,
785 loff_t const holebegin, loff_t const holelen, int even_cows); 701 loff_t const holebegin, loff_t const holelen, int even_cows);
786 702
@@ -1106,8 +1022,6 @@ int write_one_page(struct page *page, int wait);
1106/* readahead.c */ 1022/* readahead.c */
1107#define VM_MAX_READAHEAD 128 /* kbytes */ 1023#define VM_MAX_READAHEAD 128 /* kbytes */
1108#define VM_MIN_READAHEAD 16 /* kbytes (includes current page) */ 1024#define VM_MIN_READAHEAD 16 /* kbytes (includes current page) */
1109#define VM_MAX_CACHE_HIT 256 /* max pages in a row in cache before
1110 * turning readahead off */
1111 1025
1112int do_page_cache_readahead(struct address_space *mapping, struct file *filp, 1026int do_page_cache_readahead(struct address_space *mapping, struct file *filp,
1113 pgoff_t offset, unsigned long nr_to_read); 1027 pgoff_t offset, unsigned long nr_to_read);
@@ -1218,5 +1132,16 @@ extern int randomize_va_space;
1218 1132
1219const char * arch_vma_name(struct vm_area_struct *vma); 1133const char * arch_vma_name(struct vm_area_struct *vma);
1220 1134
1135struct page *sparse_mem_map_populate(unsigned long pnum, int nid);
1136pgd_t *vmemmap_pgd_populate(unsigned long addr, int node);
1137pud_t *vmemmap_pud_populate(pgd_t *pgd, unsigned long addr, int node);
1138pmd_t *vmemmap_pmd_populate(pud_t *pud, unsigned long addr, int node);
1139pte_t *vmemmap_pte_populate(pmd_t *pmd, unsigned long addr, int node);
1140void *vmemmap_alloc_block(unsigned long size, int node);
1141void vmemmap_verify(pte_t *, int, unsigned long, unsigned long);
1142int vmemmap_populate_basepages(struct page *start_page,
1143 unsigned long pages, int node);
1144int vmemmap_populate(struct page *start_page, unsigned long pages, int node);
1145
1221#endif /* __KERNEL__ */ 1146#endif /* __KERNEL__ */
1222#endif /* _LINUX_MM_H */ 1147#endif /* _LINUX_MM_H */
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index d5bb1796e12b..877667918452 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -1,13 +1,26 @@
1#ifndef _LINUX_MM_TYPES_H 1#ifndef _LINUX_MM_TYPES_H
2#define _LINUX_MM_TYPES_H 2#define _LINUX_MM_TYPES_H
3 3
4#include <linux/auxvec.h> /* For AT_VECTOR_SIZE */
4#include <linux/types.h> 5#include <linux/types.h>
5#include <linux/threads.h> 6#include <linux/threads.h>
6#include <linux/list.h> 7#include <linux/list.h>
7#include <linux/spinlock.h> 8#include <linux/spinlock.h>
9#include <linux/prio_tree.h>
10#include <linux/rbtree.h>
11#include <linux/rwsem.h>
12#include <linux/completion.h>
13#include <asm/page.h>
14#include <asm/mmu.h>
8 15
9struct address_space; 16struct address_space;
10 17
18#if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS
19typedef atomic_long_t mm_counter_t;
20#else /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */
21typedef unsigned long mm_counter_t;
22#endif /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */
23
11/* 24/*
12 * Each physical page in the system has a struct page associated with 25 * Each physical page in the system has a struct page associated with
13 * it to keep track of whatever it is we are using the page for at the 26 * it to keep track of whatever it is we are using the page for at the
@@ -24,10 +37,7 @@ struct page {
24 * to show when page is mapped 37 * to show when page is mapped
25 * & limit reverse map searches. 38 * & limit reverse map searches.
26 */ 39 */
27 struct { /* SLUB uses */ 40 unsigned int inuse; /* SLUB: Nr of objects */
28 short unsigned int inuse;
29 short unsigned int offset;
30 };
31 }; 41 };
32 union { 42 union {
33 struct { 43 struct {
@@ -49,13 +59,8 @@ struct page {
49#if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS 59#if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS
50 spinlock_t ptl; 60 spinlock_t ptl;
51#endif 61#endif
52 struct { /* SLUB uses */ 62 struct kmem_cache *slab; /* SLUB: Pointer to slab */
53 void **lockless_freelist; 63 struct page *first_page; /* Compound tail pages */
54 struct kmem_cache *slab; /* Pointer to slab */
55 };
56 struct {
57 struct page *first_page; /* Compound pages */
58 };
59 }; 64 };
60 union { 65 union {
61 pgoff_t index; /* Our offset within mapping. */ 66 pgoff_t index; /* Our offset within mapping. */
@@ -80,4 +85,135 @@ struct page {
80#endif /* WANT_PAGE_VIRTUAL */ 85#endif /* WANT_PAGE_VIRTUAL */
81}; 86};
82 87
88/*
89 * This struct defines a memory VMM memory area. There is one of these
90 * per VM-area/task. A VM area is any part of the process virtual memory
91 * space that has a special rule for the page-fault handlers (ie a shared
92 * library, the executable area etc).
93 */
94struct vm_area_struct {
95 struct mm_struct * vm_mm; /* The address space we belong to. */
96 unsigned long vm_start; /* Our start address within vm_mm. */
97 unsigned long vm_end; /* The first byte after our end address
98 within vm_mm. */
99
100 /* linked list of VM areas per task, sorted by address */
101 struct vm_area_struct *vm_next;
102
103 pgprot_t vm_page_prot; /* Access permissions of this VMA. */
104 unsigned long vm_flags; /* Flags, listed below. */
105
106 struct rb_node vm_rb;
107
108 /*
109 * For areas with an address space and backing store,
110 * linkage into the address_space->i_mmap prio tree, or
111 * linkage to the list of like vmas hanging off its node, or
112 * linkage of vma in the address_space->i_mmap_nonlinear list.
113 */
114 union {
115 struct {
116 struct list_head list;
117 void *parent; /* aligns with prio_tree_node parent */
118 struct vm_area_struct *head;
119 } vm_set;
120
121 struct raw_prio_tree_node prio_tree_node;
122 } shared;
123
124 /*
125 * A file's MAP_PRIVATE vma can be in both i_mmap tree and anon_vma
126 * list, after a COW of one of the file pages. A MAP_SHARED vma
127 * can only be in the i_mmap tree. An anonymous MAP_PRIVATE, stack
128 * or brk vma (with NULL file) can only be in an anon_vma list.
129 */
130 struct list_head anon_vma_node; /* Serialized by anon_vma->lock */
131 struct anon_vma *anon_vma; /* Serialized by page_table_lock */
132
133 /* Function pointers to deal with this struct. */
134 struct vm_operations_struct * vm_ops;
135
136 /* Information about our backing store: */
137 unsigned long vm_pgoff; /* Offset (within vm_file) in PAGE_SIZE
138 units, *not* PAGE_CACHE_SIZE */
139 struct file * vm_file; /* File we map to (can be NULL). */
140 void * vm_private_data; /* was vm_pte (shared mem) */
141 unsigned long vm_truncate_count;/* truncate_count or restart_addr */
142
143#ifndef CONFIG_MMU
144 atomic_t vm_usage; /* refcount (VMAs shared if !MMU) */
145#endif
146#ifdef CONFIG_NUMA
147 struct mempolicy *vm_policy; /* NUMA policy for the VMA */
148#endif
149};
150
151struct mm_struct {
152 struct vm_area_struct * mmap; /* list of VMAs */
153 struct rb_root mm_rb;
154 struct vm_area_struct * mmap_cache; /* last find_vma result */
155 unsigned long (*get_unmapped_area) (struct file *filp,
156 unsigned long addr, unsigned long len,
157 unsigned long pgoff, unsigned long flags);
158 void (*unmap_area) (struct mm_struct *mm, unsigned long addr);
159 unsigned long mmap_base; /* base of mmap area */
160 unsigned long task_size; /* size of task vm space */
161 unsigned long cached_hole_size; /* if non-zero, the largest hole below free_area_cache */
162 unsigned long free_area_cache; /* first hole of size cached_hole_size or larger */
163 pgd_t * pgd;
164 atomic_t mm_users; /* How many users with user space? */
165 atomic_t mm_count; /* How many references to "struct mm_struct" (users count as 1) */
166 int map_count; /* number of VMAs */
167 struct rw_semaphore mmap_sem;
168 spinlock_t page_table_lock; /* Protects page tables and some counters */
169
170 struct list_head mmlist; /* List of maybe swapped mm's. These are globally strung
171 * together off init_mm.mmlist, and are protected
172 * by mmlist_lock
173 */
174
175 /* Special counters, in some configurations protected by the
176 * page_table_lock, in other configurations by being atomic.
177 */
178 mm_counter_t _file_rss;
179 mm_counter_t _anon_rss;
180
181 unsigned long hiwater_rss; /* High-watermark of RSS usage */
182 unsigned long hiwater_vm; /* High-water virtual memory usage */
183
184 unsigned long total_vm, locked_vm, shared_vm, exec_vm;
185 unsigned long stack_vm, reserved_vm, def_flags, nr_ptes;
186 unsigned long start_code, end_code, start_data, end_data;
187 unsigned long start_brk, brk, start_stack;
188 unsigned long arg_start, arg_end, env_start, env_end;
189
190 unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */
191
192 cpumask_t cpu_vm_mask;
193
194 /* Architecture-specific MM context */
195 mm_context_t context;
196
197 /* Swap token stuff */
198 /*
199 * Last value of global fault stamp as seen by this process.
200 * In other words, this value gives an indication of how long
201 * it has been since this task got the token.
202 * Look at mm/thrash.c
203 */
204 unsigned int faultstamp;
205 unsigned int token_priority;
206 unsigned int last_interval;
207
208 unsigned long flags; /* Must use atomic bitops to access the bits */
209
210 /* coredumping support */
211 int core_waiters;
212 struct completion *core_startup_done, core_done;
213
214 /* aio bits */
215 rwlock_t ioctx_list_lock;
216 struct kioctx *ioctx_list;
217};
218
83#endif /* _LINUX_MM_TYPES_H */ 219#endif /* _LINUX_MM_TYPES_H */
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 4e5627379b09..f4bfe824834f 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -13,6 +13,7 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/seqlock.h> 14#include <linux/seqlock.h>
15#include <linux/nodemask.h> 15#include <linux/nodemask.h>
16#include <linux/pageblock-flags.h>
16#include <asm/atomic.h> 17#include <asm/atomic.h>
17#include <asm/page.h> 18#include <asm/page.h>
18 19
@@ -32,8 +33,29 @@
32 */ 33 */
33#define PAGE_ALLOC_COSTLY_ORDER 3 34#define PAGE_ALLOC_COSTLY_ORDER 3
34 35
36#define MIGRATE_UNMOVABLE 0
37#define MIGRATE_RECLAIMABLE 1
38#define MIGRATE_MOVABLE 2
39#define MIGRATE_RESERVE 3
40#define MIGRATE_ISOLATE 4 /* can't allocate from here */
41#define MIGRATE_TYPES 5
42
43#define for_each_migratetype_order(order, type) \
44 for (order = 0; order < MAX_ORDER; order++) \
45 for (type = 0; type < MIGRATE_TYPES; type++)
46
47extern int page_group_by_mobility_disabled;
48
49static inline int get_pageblock_migratetype(struct page *page)
50{
51 if (unlikely(page_group_by_mobility_disabled))
52 return MIGRATE_UNMOVABLE;
53
54 return get_pageblock_flags_group(page, PB_migrate, PB_migrate_end);
55}
56
35struct free_area { 57struct free_area {
36 struct list_head free_list; 58 struct list_head free_list[MIGRATE_TYPES];
37 unsigned long nr_free; 59 unsigned long nr_free;
38}; 60};
39 61
@@ -222,6 +244,14 @@ struct zone {
222#endif 244#endif
223 struct free_area free_area[MAX_ORDER]; 245 struct free_area free_area[MAX_ORDER];
224 246
247#ifndef CONFIG_SPARSEMEM
248 /*
249 * Flags for a pageblock_nr_pages block. See pageblock-flags.h.
250 * In SPARSEMEM, this map is stored in struct mem_section
251 */
252 unsigned long *pageblock_flags;
253#endif /* CONFIG_SPARSEMEM */
254
225 255
226 ZONE_PADDING(_pad1_) 256 ZONE_PADDING(_pad1_)
227 257
@@ -324,6 +354,17 @@ struct zone {
324#define MAX_ZONES_PER_ZONELIST (MAX_NUMNODES * MAX_NR_ZONES) 354#define MAX_ZONES_PER_ZONELIST (MAX_NUMNODES * MAX_NR_ZONES)
325 355
326#ifdef CONFIG_NUMA 356#ifdef CONFIG_NUMA
357
358/*
359 * The NUMA zonelists are doubled becausse we need zonelists that restrict the
360 * allocations to a single node for GFP_THISNODE.
361 *
362 * [0 .. MAX_NR_ZONES -1] : Zonelists with fallback
363 * [MAZ_NR_ZONES ... MAZ_ZONELISTS -1] : No fallback (GFP_THISNODE)
364 */
365#define MAX_ZONELISTS (2 * MAX_NR_ZONES)
366
367
327/* 368/*
328 * We cache key information from each zonelist for smaller cache 369 * We cache key information from each zonelist for smaller cache
329 * footprint when scanning for free pages in get_page_from_freelist(). 370 * footprint when scanning for free pages in get_page_from_freelist().
@@ -389,6 +430,7 @@ struct zonelist_cache {
389 unsigned long last_full_zap; /* when last zap'd (jiffies) */ 430 unsigned long last_full_zap; /* when last zap'd (jiffies) */
390}; 431};
391#else 432#else
433#define MAX_ZONELISTS MAX_NR_ZONES
392struct zonelist_cache; 434struct zonelist_cache;
393#endif 435#endif
394 436
@@ -455,7 +497,7 @@ extern struct page *mem_map;
455struct bootmem_data; 497struct bootmem_data;
456typedef struct pglist_data { 498typedef struct pglist_data {
457 struct zone node_zones[MAX_NR_ZONES]; 499 struct zone node_zones[MAX_NR_ZONES];
458 struct zonelist node_zonelists[MAX_NR_ZONES]; 500 struct zonelist node_zonelists[MAX_ZONELISTS];
459 int nr_zones; 501 int nr_zones;
460#ifdef CONFIG_FLAT_NODE_MEM_MAP 502#ifdef CONFIG_FLAT_NODE_MEM_MAP
461 struct page *node_mem_map; 503 struct page *node_mem_map;
@@ -708,6 +750,9 @@ extern struct zone *next_zone(struct zone *zone);
708#define PAGES_PER_SECTION (1UL << PFN_SECTION_SHIFT) 750#define PAGES_PER_SECTION (1UL << PFN_SECTION_SHIFT)
709#define PAGE_SECTION_MASK (~(PAGES_PER_SECTION-1)) 751#define PAGE_SECTION_MASK (~(PAGES_PER_SECTION-1))
710 752
753#define SECTION_BLOCKFLAGS_BITS \
754 ((1UL << (PFN_SECTION_SHIFT - pageblock_order)) * NR_PAGEBLOCK_BITS)
755
711#if (MAX_ORDER - 1 + PAGE_SHIFT) > SECTION_SIZE_BITS 756#if (MAX_ORDER - 1 + PAGE_SHIFT) > SECTION_SIZE_BITS
712#error Allocator MAX_ORDER exceeds SECTION_SIZE 757#error Allocator MAX_ORDER exceeds SECTION_SIZE
713#endif 758#endif
@@ -727,6 +772,9 @@ struct mem_section {
727 * before using it wrong. 772 * before using it wrong.
728 */ 773 */
729 unsigned long section_mem_map; 774 unsigned long section_mem_map;
775
776 /* See declaration of similar field in struct zone */
777 unsigned long *pageblock_flags;
730}; 778};
731 779
732#ifdef CONFIG_SPARSEMEM_EXTREME 780#ifdef CONFIG_SPARSEMEM_EXTREME
@@ -771,12 +819,17 @@ static inline struct page *__section_mem_map_addr(struct mem_section *section)
771 return (struct page *)map; 819 return (struct page *)map;
772} 820}
773 821
774static inline int valid_section(struct mem_section *section) 822static inline int present_section(struct mem_section *section)
775{ 823{
776 return (section && (section->section_mem_map & SECTION_MARKED_PRESENT)); 824 return (section && (section->section_mem_map & SECTION_MARKED_PRESENT));
777} 825}
778 826
779static inline int section_has_mem_map(struct mem_section *section) 827static inline int present_section_nr(unsigned long nr)
828{
829 return present_section(__nr_to_section(nr));
830}
831
832static inline int valid_section(struct mem_section *section)
780{ 833{
781 return (section && (section->section_mem_map & SECTION_HAS_MEM_MAP)); 834 return (section && (section->section_mem_map & SECTION_HAS_MEM_MAP));
782} 835}
@@ -798,6 +851,13 @@ static inline int pfn_valid(unsigned long pfn)
798 return valid_section(__nr_to_section(pfn_to_section_nr(pfn))); 851 return valid_section(__nr_to_section(pfn_to_section_nr(pfn)));
799} 852}
800 853
854static inline int pfn_present(unsigned long pfn)
855{
856 if (pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS)
857 return 0;
858 return present_section(__nr_to_section(pfn_to_section_nr(pfn)));
859}
860
801/* 861/*
802 * These are _only_ used during initialisation, therefore they 862 * These are _only_ used during initialisation, therefore they
803 * can use __initdata ... They could have names to indicate 863 * can use __initdata ... They could have names to indicate
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 74523d999f7a..522b0dd836cf 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -262,11 +262,6 @@ struct pcmcia_device_id {
262#define PCMCIA_DEV_ID_MATCH_FAKE_CIS 0x0200 262#define PCMCIA_DEV_ID_MATCH_FAKE_CIS 0x0200
263#define PCMCIA_DEV_ID_MATCH_ANONYMOUS 0x0400 263#define PCMCIA_DEV_ID_MATCH_ANONYMOUS 0x0400
264 264
265/* I2C */
266struct i2c_device_id {
267 __u16 id;
268};
269
270/* Input */ 265/* Input */
271#define INPUT_DEVICE_ID_EV_MAX 0x1f 266#define INPUT_DEVICE_ID_EV_MAX 0x1f
272#define INPUT_DEVICE_ID_KEY_MIN_INTERESTING 0x71 267#define INPUT_DEVICE_ID_KEY_MIN_INTERESTING 0x71
diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h
index 123948b14547..e17c5343cf51 100644
--- a/include/linux/mtd/cfi.h
+++ b/include/linux/mtd/cfi.h
@@ -57,6 +57,15 @@
57#define cfi_interleave_is_8(cfi) (0) 57#define cfi_interleave_is_8(cfi) (0)
58#endif 58#endif
59 59
60#ifndef cfi_interleave
61#warning No CONFIG_MTD_CFI_Ix selected. No NOR chip support can work.
62static inline int cfi_interleave(void *cfi)
63{
64 BUG();
65 return 0;
66}
67#endif
68
60static inline int cfi_interleave_supported(int i) 69static inline int cfi_interleave_supported(int i)
61{ 70{
62 switch (i) { 71 switch (i) {
diff --git a/include/linux/mtd/flashchip.h b/include/linux/mtd/flashchip.h
index a293a3b78e05..39e7d2a1be9a 100644
--- a/include/linux/mtd/flashchip.h
+++ b/include/linux/mtd/flashchip.h
@@ -40,6 +40,7 @@ typedef enum {
40 FL_POINT, 40 FL_POINT,
41 FL_XIP_WHILE_ERASING, 41 FL_XIP_WHILE_ERASING,
42 FL_XIP_WHILE_WRITING, 42 FL_XIP_WHILE_WRITING,
43 FL_SHUTDOWN,
43 FL_UNKNOWN 44 FL_UNKNOWN
44} flstate_t; 45} flstate_t;
45 46
diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h
index 81f3a314dd76..a9fae032ba81 100644
--- a/include/linux/mtd/map.h
+++ b/include/linux/mtd/map.h
@@ -125,7 +125,15 @@
125#endif 125#endif
126 126
127#ifndef map_bankwidth 127#ifndef map_bankwidth
128#error "No bus width supported. What's the point?" 128#warning "No CONFIG_MTD_MAP_BANK_WIDTH_xx selected. No NOR chip support can work"
129static inline int map_bankwidth(void *map)
130{
131 BUG();
132 return 0;
133}
134#define map_bankwidth_is_large(map) (0)
135#define map_words(map) (0)
136#define MAX_MAP_BANKWIDTH 1
129#endif 137#endif
130 138
131static inline int map_bankwidth_supported(int w) 139static inline int map_bankwidth_supported(int w)
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index fd64ccfbce02..783fc983417c 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -133,6 +133,13 @@ struct mtd_info {
133 int numeraseregions; 133 int numeraseregions;
134 struct mtd_erase_region_info *eraseregions; 134 struct mtd_erase_region_info *eraseregions;
135 135
136 /*
137 * Erase is an asynchronous operation. Device drivers are supposed
138 * to call instr->callback() whenever the operation completes, even
139 * if it completes with a failure.
140 * Callers are supposed to pass a callback function and wait for it
141 * to be called before writing to the block.
142 */
136 int (*erase) (struct mtd_info *mtd, struct erase_info *instr); 143 int (*erase) (struct mtd_info *mtd, struct erase_info *instr);
137 144
138 /* This stuff for eXecute-In-Place */ 145 /* This stuff for eXecute-In-Place */
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index d2365c8dcacc..c42bc7f533a5 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -432,6 +432,7 @@ struct nand_chip {
432#define NAND_MFR_STMICRO 0x20 432#define NAND_MFR_STMICRO 0x20
433#define NAND_MFR_HYNIX 0xad 433#define NAND_MFR_HYNIX 0xad
434#define NAND_MFR_MICRON 0x2c 434#define NAND_MFR_MICRON 0x2c
435#define NAND_MFR_AMD 0x01
435 436
436/** 437/**
437 * struct nand_flash_dev - NAND Flash Device ID Structure 438 * struct nand_flash_dev - NAND Flash Device ID Structure
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h
index a56d24ada505..fd0a260e070b 100644
--- a/include/linux/mtd/onenand.h
+++ b/include/linux/mtd/onenand.h
@@ -60,6 +60,7 @@ struct onenand_bufferram {
60 * @erase_shift: [INTERN] number of address bits in a block 60 * @erase_shift: [INTERN] number of address bits in a block
61 * @page_shift: [INTERN] number of address bits in a page 61 * @page_shift: [INTERN] number of address bits in a page
62 * @page_mask: [INTERN] a page per block mask 62 * @page_mask: [INTERN] a page per block mask
63 * @writesize: [INTERN] a real page size
63 * @bufferram_index: [INTERN] BufferRAM index 64 * @bufferram_index: [INTERN] BufferRAM index
64 * @bufferram: [INTERN] BufferRAM info 65 * @bufferram: [INTERN] BufferRAM info
65 * @readw: [REPLACEABLE] hardware specific function for read short 66 * @readw: [REPLACEABLE] hardware specific function for read short
@@ -100,6 +101,7 @@ struct onenand_chip {
100 unsigned int erase_shift; 101 unsigned int erase_shift;
101 unsigned int page_shift; 102 unsigned int page_shift;
102 unsigned int page_mask; 103 unsigned int page_mask;
104 unsigned int writesize;
103 105
104 unsigned int bufferram_index; 106 unsigned int bufferram_index;
105 struct onenand_bufferram bufferram[MAX_BUFFERRAM]; 107 struct onenand_bufferram bufferram[MAX_BUFFERRAM];
@@ -140,6 +142,8 @@ struct onenand_chip {
140#define ONENAND_NEXT_BUFFERRAM(this) (this->bufferram_index ^ 1) 142#define ONENAND_NEXT_BUFFERRAM(this) (this->bufferram_index ^ 1)
141#define ONENAND_SET_NEXT_BUFFERRAM(this) (this->bufferram_index ^= 1) 143#define ONENAND_SET_NEXT_BUFFERRAM(this) (this->bufferram_index ^= 1)
142#define ONENAND_SET_PREV_BUFFERRAM(this) (this->bufferram_index ^= 1) 144#define ONENAND_SET_PREV_BUFFERRAM(this) (this->bufferram_index ^= 1)
145#define ONENAND_SET_BUFFERRAM0(this) (this->bufferram_index = 0)
146#define ONENAND_SET_BUFFERRAM1(this) (this->bufferram_index = 1)
143 147
144#define ONENAND_GET_SYS_CFG1(this) \ 148#define ONENAND_GET_SYS_CFG1(this) \
145 (this->read_word(this->base + ONENAND_REG_SYS_CFG1)) 149 (this->read_word(this->base + ONENAND_REG_SYS_CFG1))
@@ -149,6 +153,13 @@ struct onenand_chip {
149#define ONENAND_IS_DDP(this) \ 153#define ONENAND_IS_DDP(this) \
150 (this->device_id & ONENAND_DEVICE_IS_DDP) 154 (this->device_id & ONENAND_DEVICE_IS_DDP)
151 155
156#ifdef CONFIG_MTD_ONENAND_2X_PROGRAM
157#define ONENAND_IS_2PLANE(this) \
158 (this->options & ONENAND_HAS_2PLANE)
159#else
160#define ONENAND_IS_2PLANE(this) (0)
161#endif
162
152/* Check byte access in OneNAND */ 163/* Check byte access in OneNAND */
153#define ONENAND_CHECK_BYTE_ACCESS(addr) (addr & 0x1) 164#define ONENAND_CHECK_BYTE_ACCESS(addr) (addr & 0x1)
154 165
@@ -157,6 +168,7 @@ struct onenand_chip {
157 */ 168 */
158#define ONENAND_HAS_CONT_LOCK (0x0001) 169#define ONENAND_HAS_CONT_LOCK (0x0001)
159#define ONENAND_HAS_UNLOCK_ALL (0x0002) 170#define ONENAND_HAS_UNLOCK_ALL (0x0002)
171#define ONENAND_HAS_2PLANE (0x0004)
160#define ONENAND_PAGEBUF_ALLOC (0x1000) 172#define ONENAND_PAGEBUF_ALLOC (0x1000)
161#define ONENAND_OOBBUF_ALLOC (0x2000) 173#define ONENAND_OOBBUF_ALLOC (0x2000)
162 174
diff --git a/include/linux/mtd/onenand_regs.h b/include/linux/mtd/onenand_regs.h
index af94719890e7..c46161f4eee3 100644
--- a/include/linux/mtd/onenand_regs.h
+++ b/include/linux/mtd/onenand_regs.h
@@ -74,6 +74,8 @@
74 74
75#define ONENAND_DEVICE_DENSITY_512Mb (0x002) 75#define ONENAND_DEVICE_DENSITY_512Mb (0x002)
76#define ONENAND_DEVICE_DENSITY_1Gb (0x003) 76#define ONENAND_DEVICE_DENSITY_1Gb (0x003)
77#define ONENAND_DEVICE_DENSITY_2Gb (0x004)
78#define ONENAND_DEVICE_DENSITY_4Gb (0x005)
77 79
78/* 80/*
79 * Version ID Register F002h (R) 81 * Version ID Register F002h (R)
@@ -111,6 +113,8 @@
111#define ONENAND_CMD_READOOB (0x13) 113#define ONENAND_CMD_READOOB (0x13)
112#define ONENAND_CMD_PROG (0x80) 114#define ONENAND_CMD_PROG (0x80)
113#define ONENAND_CMD_PROGOOB (0x1A) 115#define ONENAND_CMD_PROGOOB (0x1A)
116#define ONENAND_CMD_2X_PROG (0x7D)
117#define ONENAND_CMD_2X_CACHE_PROG (0x7F)
114#define ONENAND_CMD_UNLOCK (0x23) 118#define ONENAND_CMD_UNLOCK (0x23)
115#define ONENAND_CMD_LOCK (0x2A) 119#define ONENAND_CMD_LOCK (0x2A)
116#define ONENAND_CMD_LOCK_TIGHT (0x2C) 120#define ONENAND_CMD_LOCK_TIGHT (0x2C)
diff --git a/include/linux/mutex.h b/include/linux/mutex.h
index 0d50ea3df689..6a735c72f23f 100644
--- a/include/linux/mutex.h
+++ b/include/linux/mutex.h
@@ -120,14 +120,17 @@ static inline int fastcall mutex_is_locked(struct mutex *lock)
120 * See kernel/mutex.c for detailed documentation of these APIs. 120 * See kernel/mutex.c for detailed documentation of these APIs.
121 * Also see Documentation/mutex-design.txt. 121 * Also see Documentation/mutex-design.txt.
122 */ 122 */
123extern void fastcall mutex_lock(struct mutex *lock);
124extern int __must_check fastcall mutex_lock_interruptible(struct mutex *lock);
125
126#ifdef CONFIG_DEBUG_LOCK_ALLOC 123#ifdef CONFIG_DEBUG_LOCK_ALLOC
127extern void mutex_lock_nested(struct mutex *lock, unsigned int subclass); 124extern void mutex_lock_nested(struct mutex *lock, unsigned int subclass);
128extern int __must_check mutex_lock_interruptible_nested(struct mutex *lock, 125extern int __must_check mutex_lock_interruptible_nested(struct mutex *lock,
129 unsigned int subclass); 126 unsigned int subclass);
127
128#define mutex_lock(lock) mutex_lock_nested(lock, 0)
129#define mutex_lock_interruptible(lock) mutex_lock_interruptible_nested(lock, 0)
130#else 130#else
131extern void fastcall mutex_lock(struct mutex *lock);
132extern int __must_check fastcall mutex_lock_interruptible(struct mutex *lock);
133
131# define mutex_lock_nested(lock, subclass) mutex_lock(lock) 134# define mutex_lock_nested(lock, subclass) mutex_lock(lock)
132# define mutex_lock_interruptible_nested(lock, subclass) mutex_lock_interruptible(lock) 135# define mutex_lock_interruptible_nested(lock, subclass) mutex_lock_interruptible(lock)
133#endif 136#endif
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 5a11f889e56a..39dd83b183a9 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1294,6 +1294,7 @@ static inline void netif_rx_complete(struct net_device *dev,
1294/** 1294/**
1295 * netif_tx_lock - grab network device transmit lock 1295 * netif_tx_lock - grab network device transmit lock
1296 * @dev: network device 1296 * @dev: network device
1297 * @cpu: cpu number of lock owner
1297 * 1298 *
1298 * Get network device transmit lock 1299 * Get network device transmit lock
1299 */ 1300 */
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index 1dd075eda595..16adac688af5 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -51,7 +51,7 @@ struct sk_buff;
51struct net_device; 51struct net_device;
52 52
53typedef unsigned int nf_hookfn(unsigned int hooknum, 53typedef unsigned int nf_hookfn(unsigned int hooknum,
54 struct sk_buff **skb, 54 struct sk_buff *skb,
55 const struct net_device *in, 55 const struct net_device *in,
56 const struct net_device *out, 56 const struct net_device *out,
57 int (*okfn)(struct sk_buff *)); 57 int (*okfn)(struct sk_buff *));
@@ -183,7 +183,7 @@ void nf_log_packet(int pf,
183 struct nf_loginfo *li, 183 struct nf_loginfo *li,
184 const char *fmt, ...); 184 const char *fmt, ...);
185 185
186int nf_hook_slow(int pf, unsigned int hook, struct sk_buff **pskb, 186int nf_hook_slow(int pf, unsigned int hook, struct sk_buff *skb,
187 struct net_device *indev, struct net_device *outdev, 187 struct net_device *indev, struct net_device *outdev,
188 int (*okfn)(struct sk_buff *), int thresh); 188 int (*okfn)(struct sk_buff *), int thresh);
189 189
@@ -195,7 +195,7 @@ int nf_hook_slow(int pf, unsigned int hook, struct sk_buff **pskb,
195 * value indicates the packet has been consumed by the hook. 195 * value indicates the packet has been consumed by the hook.
196 */ 196 */
197static inline int nf_hook_thresh(int pf, unsigned int hook, 197static inline int nf_hook_thresh(int pf, unsigned int hook,
198 struct sk_buff **pskb, 198 struct sk_buff *skb,
199 struct net_device *indev, 199 struct net_device *indev,
200 struct net_device *outdev, 200 struct net_device *outdev,
201 int (*okfn)(struct sk_buff *), int thresh, 201 int (*okfn)(struct sk_buff *), int thresh,
@@ -207,14 +207,14 @@ static inline int nf_hook_thresh(int pf, unsigned int hook,
207 if (list_empty(&nf_hooks[pf][hook])) 207 if (list_empty(&nf_hooks[pf][hook]))
208 return 1; 208 return 1;
209#endif 209#endif
210 return nf_hook_slow(pf, hook, pskb, indev, outdev, okfn, thresh); 210 return nf_hook_slow(pf, hook, skb, indev, outdev, okfn, thresh);
211} 211}
212 212
213static inline int nf_hook(int pf, unsigned int hook, struct sk_buff **pskb, 213static inline int nf_hook(int pf, unsigned int hook, struct sk_buff *skb,
214 struct net_device *indev, struct net_device *outdev, 214 struct net_device *indev, struct net_device *outdev,
215 int (*okfn)(struct sk_buff *)) 215 int (*okfn)(struct sk_buff *))
216{ 216{
217 return nf_hook_thresh(pf, hook, pskb, indev, outdev, okfn, INT_MIN, 1); 217 return nf_hook_thresh(pf, hook, skb, indev, outdev, okfn, INT_MIN, 1);
218} 218}
219 219
220/* Activate hook; either okfn or kfree_skb called, unless a hook 220/* Activate hook; either okfn or kfree_skb called, unless a hook
@@ -241,13 +241,13 @@ static inline int nf_hook(int pf, unsigned int hook, struct sk_buff **pskb,
241 241
242#define NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, thresh) \ 242#define NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, thresh) \
243({int __ret; \ 243({int __ret; \
244if ((__ret=nf_hook_thresh(pf, hook, &(skb), indev, outdev, okfn, thresh, 1)) == 1)\ 244if ((__ret=nf_hook_thresh(pf, hook, (skb), indev, outdev, okfn, thresh, 1)) == 1)\
245 __ret = (okfn)(skb); \ 245 __ret = (okfn)(skb); \
246__ret;}) 246__ret;})
247 247
248#define NF_HOOK_COND(pf, hook, skb, indev, outdev, okfn, cond) \ 248#define NF_HOOK_COND(pf, hook, skb, indev, outdev, okfn, cond) \
249({int __ret; \ 249({int __ret; \
250if ((__ret=nf_hook_thresh(pf, hook, &(skb), indev, outdev, okfn, INT_MIN, cond)) == 1)\ 250if ((__ret=nf_hook_thresh(pf, hook, (skb), indev, outdev, okfn, INT_MIN, cond)) == 1)\
251 __ret = (okfn)(skb); \ 251 __ret = (okfn)(skb); \
252__ret;}) 252__ret;})
253 253
@@ -287,7 +287,7 @@ extern void nf_invalidate_cache(int pf);
287/* Call this before modifying an existing packet: ensures it is 287/* Call this before modifying an existing packet: ensures it is
288 modifiable and linear to the point you care about (writable_len). 288 modifiable and linear to the point you care about (writable_len).
289 Returns true or false. */ 289 Returns true or false. */
290extern int skb_make_writable(struct sk_buff **pskb, unsigned int writable_len); 290extern int skb_make_writable(struct sk_buff *skb, unsigned int writable_len);
291 291
292static inline void nf_csum_replace4(__sum16 *sum, __be32 from, __be32 to) 292static inline void nf_csum_replace4(__sum16 *sum, __be32 from, __be32 to)
293{ 293{
@@ -317,7 +317,7 @@ struct nf_afinfo {
317 unsigned int dataoff, u_int8_t protocol); 317 unsigned int dataoff, u_int8_t protocol);
318 void (*saveroute)(const struct sk_buff *skb, 318 void (*saveroute)(const struct sk_buff *skb,
319 struct nf_info *info); 319 struct nf_info *info);
320 int (*reroute)(struct sk_buff **skb, 320 int (*reroute)(struct sk_buff *skb,
321 const struct nf_info *info); 321 const struct nf_info *info);
322 int route_key_size; 322 int route_key_size;
323}; 323};
@@ -371,15 +371,15 @@ extern struct proc_dir_entry *proc_net_netfilter;
371#define NF_HOOK(pf, hook, skb, indev, outdev, okfn) (okfn)(skb) 371#define NF_HOOK(pf, hook, skb, indev, outdev, okfn) (okfn)(skb)
372#define NF_HOOK_COND(pf, hook, skb, indev, outdev, okfn, cond) (okfn)(skb) 372#define NF_HOOK_COND(pf, hook, skb, indev, outdev, okfn, cond) (okfn)(skb)
373static inline int nf_hook_thresh(int pf, unsigned int hook, 373static inline int nf_hook_thresh(int pf, unsigned int hook,
374 struct sk_buff **pskb, 374 struct sk_buff *skb,
375 struct net_device *indev, 375 struct net_device *indev,
376 struct net_device *outdev, 376 struct net_device *outdev,
377 int (*okfn)(struct sk_buff *), int thresh, 377 int (*okfn)(struct sk_buff *), int thresh,
378 int cond) 378 int cond)
379{ 379{
380 return okfn(*pskb); 380 return okfn(skb);
381} 381}
382static inline int nf_hook(int pf, unsigned int hook, struct sk_buff **pskb, 382static inline int nf_hook(int pf, unsigned int hook, struct sk_buff *skb,
383 struct net_device *indev, struct net_device *outdev, 383 struct net_device *indev, struct net_device *outdev,
384 int (*okfn)(struct sk_buff *)) 384 int (*okfn)(struct sk_buff *))
385{ 385{
diff --git a/include/linux/netfilter/nf_conntrack_amanda.h b/include/linux/netfilter/nf_conntrack_amanda.h
index 26c223544ae8..0bb5a6976bf3 100644
--- a/include/linux/netfilter/nf_conntrack_amanda.h
+++ b/include/linux/netfilter/nf_conntrack_amanda.h
@@ -2,7 +2,7 @@
2#define _NF_CONNTRACK_AMANDA_H 2#define _NF_CONNTRACK_AMANDA_H
3/* AMANDA tracking. */ 3/* AMANDA tracking. */
4 4
5extern unsigned int (*nf_nat_amanda_hook)(struct sk_buff **pskb, 5extern unsigned int (*nf_nat_amanda_hook)(struct sk_buff *skb,
6 enum ip_conntrack_info ctinfo, 6 enum ip_conntrack_info ctinfo,
7 unsigned int matchoff, 7 unsigned int matchoff,
8 unsigned int matchlen, 8 unsigned int matchlen,
diff --git a/include/linux/netfilter/nf_conntrack_ftp.h b/include/linux/netfilter/nf_conntrack_ftp.h
index b7c360ffd0d0..47727d7546ea 100644
--- a/include/linux/netfilter/nf_conntrack_ftp.h
+++ b/include/linux/netfilter/nf_conntrack_ftp.h
@@ -32,7 +32,7 @@ struct nf_conntrack_expect;
32 32
33/* For NAT to hook in when we find a packet which describes what other 33/* For NAT to hook in when we find a packet which describes what other
34 * connection we should expect. */ 34 * connection we should expect. */
35extern unsigned int (*nf_nat_ftp_hook)(struct sk_buff **pskb, 35extern unsigned int (*nf_nat_ftp_hook)(struct sk_buff *skb,
36 enum ip_conntrack_info ctinfo, 36 enum ip_conntrack_info ctinfo,
37 enum nf_ct_ftp_type type, 37 enum nf_ct_ftp_type type,
38 unsigned int matchoff, 38 unsigned int matchoff,
diff --git a/include/linux/netfilter/nf_conntrack_h323.h b/include/linux/netfilter/nf_conntrack_h323.h
index 08e2f4977c2e..aabd24ac7631 100644
--- a/include/linux/netfilter/nf_conntrack_h323.h
+++ b/include/linux/netfilter/nf_conntrack_h323.h
@@ -36,27 +36,27 @@ extern void nf_conntrack_h245_expect(struct nf_conn *new,
36 struct nf_conntrack_expect *this); 36 struct nf_conntrack_expect *this);
37extern void nf_conntrack_q931_expect(struct nf_conn *new, 37extern void nf_conntrack_q931_expect(struct nf_conn *new,
38 struct nf_conntrack_expect *this); 38 struct nf_conntrack_expect *this);
39extern int (*set_h245_addr_hook) (struct sk_buff **pskb, 39extern int (*set_h245_addr_hook) (struct sk_buff *skb,
40 unsigned char **data, int dataoff, 40 unsigned char **data, int dataoff,
41 H245_TransportAddress *taddr, 41 H245_TransportAddress *taddr,
42 union nf_conntrack_address *addr, 42 union nf_conntrack_address *addr,
43 __be16 port); 43 __be16 port);
44extern int (*set_h225_addr_hook) (struct sk_buff **pskb, 44extern int (*set_h225_addr_hook) (struct sk_buff *skb,
45 unsigned char **data, int dataoff, 45 unsigned char **data, int dataoff,
46 TransportAddress *taddr, 46 TransportAddress *taddr,
47 union nf_conntrack_address *addr, 47 union nf_conntrack_address *addr,
48 __be16 port); 48 __be16 port);
49extern int (*set_sig_addr_hook) (struct sk_buff **pskb, 49extern int (*set_sig_addr_hook) (struct sk_buff *skb,
50 struct nf_conn *ct, 50 struct nf_conn *ct,
51 enum ip_conntrack_info ctinfo, 51 enum ip_conntrack_info ctinfo,
52 unsigned char **data, 52 unsigned char **data,
53 TransportAddress *taddr, int count); 53 TransportAddress *taddr, int count);
54extern int (*set_ras_addr_hook) (struct sk_buff **pskb, 54extern int (*set_ras_addr_hook) (struct sk_buff *skb,
55 struct nf_conn *ct, 55 struct nf_conn *ct,
56 enum ip_conntrack_info ctinfo, 56 enum ip_conntrack_info ctinfo,
57 unsigned char **data, 57 unsigned char **data,
58 TransportAddress *taddr, int count); 58 TransportAddress *taddr, int count);
59extern int (*nat_rtp_rtcp_hook) (struct sk_buff **pskb, 59extern int (*nat_rtp_rtcp_hook) (struct sk_buff *skb,
60 struct nf_conn *ct, 60 struct nf_conn *ct,
61 enum ip_conntrack_info ctinfo, 61 enum ip_conntrack_info ctinfo,
62 unsigned char **data, int dataoff, 62 unsigned char **data, int dataoff,
@@ -64,24 +64,24 @@ extern int (*nat_rtp_rtcp_hook) (struct sk_buff **pskb,
64 __be16 port, __be16 rtp_port, 64 __be16 port, __be16 rtp_port,
65 struct nf_conntrack_expect *rtp_exp, 65 struct nf_conntrack_expect *rtp_exp,
66 struct nf_conntrack_expect *rtcp_exp); 66 struct nf_conntrack_expect *rtcp_exp);
67extern int (*nat_t120_hook) (struct sk_buff **pskb, struct nf_conn *ct, 67extern int (*nat_t120_hook) (struct sk_buff *skb, struct nf_conn *ct,
68 enum ip_conntrack_info ctinfo, 68 enum ip_conntrack_info ctinfo,
69 unsigned char **data, int dataoff, 69 unsigned char **data, int dataoff,
70 H245_TransportAddress *taddr, __be16 port, 70 H245_TransportAddress *taddr, __be16 port,
71 struct nf_conntrack_expect *exp); 71 struct nf_conntrack_expect *exp);
72extern int (*nat_h245_hook) (struct sk_buff **pskb, struct nf_conn *ct, 72extern int (*nat_h245_hook) (struct sk_buff *skb, struct nf_conn *ct,
73 enum ip_conntrack_info ctinfo, 73 enum ip_conntrack_info ctinfo,
74 unsigned char **data, int dataoff, 74 unsigned char **data, int dataoff,
75 TransportAddress *taddr, __be16 port, 75 TransportAddress *taddr, __be16 port,
76 struct nf_conntrack_expect *exp); 76 struct nf_conntrack_expect *exp);
77extern int (*nat_callforwarding_hook) (struct sk_buff **pskb, 77extern int (*nat_callforwarding_hook) (struct sk_buff *skb,
78 struct nf_conn *ct, 78 struct nf_conn *ct,
79 enum ip_conntrack_info ctinfo, 79 enum ip_conntrack_info ctinfo,
80 unsigned char **data, int dataoff, 80 unsigned char **data, int dataoff,
81 TransportAddress *taddr, 81 TransportAddress *taddr,
82 __be16 port, 82 __be16 port,
83 struct nf_conntrack_expect *exp); 83 struct nf_conntrack_expect *exp);
84extern int (*nat_q931_hook) (struct sk_buff **pskb, struct nf_conn *ct, 84extern int (*nat_q931_hook) (struct sk_buff *skb, struct nf_conn *ct,
85 enum ip_conntrack_info ctinfo, 85 enum ip_conntrack_info ctinfo,
86 unsigned char **data, TransportAddress *taddr, 86 unsigned char **data, TransportAddress *taddr,
87 int idx, __be16 port, 87 int idx, __be16 port,
diff --git a/include/linux/netfilter/nf_conntrack_irc.h b/include/linux/netfilter/nf_conntrack_irc.h
index 2ab6b8255911..36282bf71b63 100644
--- a/include/linux/netfilter/nf_conntrack_irc.h
+++ b/include/linux/netfilter/nf_conntrack_irc.h
@@ -5,7 +5,7 @@
5 5
6#define IRC_PORT 6667 6#define IRC_PORT 6667
7 7
8extern unsigned int (*nf_nat_irc_hook)(struct sk_buff **pskb, 8extern unsigned int (*nf_nat_irc_hook)(struct sk_buff *skb,
9 enum ip_conntrack_info ctinfo, 9 enum ip_conntrack_info ctinfo,
10 unsigned int matchoff, 10 unsigned int matchoff,
11 unsigned int matchlen, 11 unsigned int matchlen,
diff --git a/include/linux/netfilter/nf_conntrack_pptp.h b/include/linux/netfilter/nf_conntrack_pptp.h
index c93061f33144..23435496d24a 100644
--- a/include/linux/netfilter/nf_conntrack_pptp.h
+++ b/include/linux/netfilter/nf_conntrack_pptp.h
@@ -301,13 +301,13 @@ struct nf_conn;
301struct nf_conntrack_expect; 301struct nf_conntrack_expect;
302 302
303extern int 303extern int
304(*nf_nat_pptp_hook_outbound)(struct sk_buff **pskb, 304(*nf_nat_pptp_hook_outbound)(struct sk_buff *skb,
305 struct nf_conn *ct, enum ip_conntrack_info ctinfo, 305 struct nf_conn *ct, enum ip_conntrack_info ctinfo,
306 struct PptpControlHeader *ctlh, 306 struct PptpControlHeader *ctlh,
307 union pptp_ctrl_union *pptpReq); 307 union pptp_ctrl_union *pptpReq);
308 308
309extern int 309extern int
310(*nf_nat_pptp_hook_inbound)(struct sk_buff **pskb, 310(*nf_nat_pptp_hook_inbound)(struct sk_buff *skb,
311 struct nf_conn *ct, enum ip_conntrack_info ctinfo, 311 struct nf_conn *ct, enum ip_conntrack_info ctinfo,
312 struct PptpControlHeader *ctlh, 312 struct PptpControlHeader *ctlh,
313 union pptp_ctrl_union *pptpReq); 313 union pptp_ctrl_union *pptpReq);
diff --git a/include/linux/netfilter/nf_conntrack_sip.h b/include/linux/netfilter/nf_conntrack_sip.h
index bb7f2041db74..9fff19779bd5 100644
--- a/include/linux/netfilter/nf_conntrack_sip.h
+++ b/include/linux/netfilter/nf_conntrack_sip.h
@@ -21,11 +21,11 @@ enum sip_header_pos {
21 POS_SDP_HEADER, 21 POS_SDP_HEADER,
22}; 22};
23 23
24extern unsigned int (*nf_nat_sip_hook)(struct sk_buff **pskb, 24extern unsigned int (*nf_nat_sip_hook)(struct sk_buff *skb,
25 enum ip_conntrack_info ctinfo, 25 enum ip_conntrack_info ctinfo,
26 struct nf_conn *ct, 26 struct nf_conn *ct,
27 const char **dptr); 27 const char **dptr);
28extern unsigned int (*nf_nat_sdp_hook)(struct sk_buff **pskb, 28extern unsigned int (*nf_nat_sdp_hook)(struct sk_buff *skb,
29 enum ip_conntrack_info ctinfo, 29 enum ip_conntrack_info ctinfo,
30 struct nf_conntrack_expect *exp, 30 struct nf_conntrack_expect *exp,
31 const char *dptr); 31 const char *dptr);
diff --git a/include/linux/netfilter/nf_conntrack_tftp.h b/include/linux/netfilter/nf_conntrack_tftp.h
index 0d79b7ae051f..c78d38fdb050 100644
--- a/include/linux/netfilter/nf_conntrack_tftp.h
+++ b/include/linux/netfilter/nf_conntrack_tftp.h
@@ -13,7 +13,7 @@ struct tftphdr {
13#define TFTP_OPCODE_ACK 4 13#define TFTP_OPCODE_ACK 4
14#define TFTP_OPCODE_ERROR 5 14#define TFTP_OPCODE_ERROR 5
15 15
16extern unsigned int (*nf_nat_tftp_hook)(struct sk_buff **pskb, 16extern unsigned int (*nf_nat_tftp_hook)(struct sk_buff *skb,
17 enum ip_conntrack_info ctinfo, 17 enum ip_conntrack_info ctinfo,
18 struct nf_conntrack_expect *exp); 18 struct nf_conntrack_expect *exp);
19 19
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index 64f425a855bb..03e6ce979eaa 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -191,7 +191,7 @@ struct xt_target
191 /* Returns verdict. Argument order changed since 2.6.9, as this 191 /* Returns verdict. Argument order changed since 2.6.9, as this
192 must now handle non-linear skbs, using skb_copy_bits and 192 must now handle non-linear skbs, using skb_copy_bits and
193 skb_ip_make_writable. */ 193 skb_ip_make_writable. */
194 unsigned int (*target)(struct sk_buff **pskb, 194 unsigned int (*target)(struct sk_buff *skb,
195 const struct net_device *in, 195 const struct net_device *in,
196 const struct net_device *out, 196 const struct net_device *out,
197 unsigned int hooknum, 197 unsigned int hooknum,
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h
index 584cd1b18f12..2fc73fa8e37f 100644
--- a/include/linux/netfilter_arp/arp_tables.h
+++ b/include/linux/netfilter_arp/arp_tables.h
@@ -287,7 +287,7 @@ struct arpt_error
287extern int arpt_register_table(struct arpt_table *table, 287extern int arpt_register_table(struct arpt_table *table,
288 const struct arpt_replace *repl); 288 const struct arpt_replace *repl);
289extern void arpt_unregister_table(struct arpt_table *table); 289extern void arpt_unregister_table(struct arpt_table *table);
290extern unsigned int arpt_do_table(struct sk_buff **pskb, 290extern unsigned int arpt_do_table(struct sk_buff *skb,
291 unsigned int hook, 291 unsigned int hook,
292 const struct net_device *in, 292 const struct net_device *in,
293 const struct net_device *out, 293 const struct net_device *out,
diff --git a/include/linux/netfilter_bridge/ebtables.h b/include/linux/netfilter_bridge/ebtables.h
index 94e0a7dc0cb2..892f5b7771c7 100644
--- a/include/linux/netfilter_bridge/ebtables.h
+++ b/include/linux/netfilter_bridge/ebtables.h
@@ -237,7 +237,7 @@ struct ebt_target
237 struct list_head list; 237 struct list_head list;
238 const char name[EBT_FUNCTION_MAXNAMELEN]; 238 const char name[EBT_FUNCTION_MAXNAMELEN];
239 /* returns one of the standard verdicts */ 239 /* returns one of the standard verdicts */
240 int (*target)(struct sk_buff **pskb, unsigned int hooknr, 240 int (*target)(struct sk_buff *skb, unsigned int hooknr,
241 const struct net_device *in, const struct net_device *out, 241 const struct net_device *in, const struct net_device *out,
242 const void *targetdata, unsigned int datalen); 242 const void *targetdata, unsigned int datalen);
243 /* 0 == let it in */ 243 /* 0 == let it in */
@@ -294,7 +294,7 @@ extern int ebt_register_watcher(struct ebt_watcher *watcher);
294extern void ebt_unregister_watcher(struct ebt_watcher *watcher); 294extern void ebt_unregister_watcher(struct ebt_watcher *watcher);
295extern int ebt_register_target(struct ebt_target *target); 295extern int ebt_register_target(struct ebt_target *target);
296extern void ebt_unregister_target(struct ebt_target *target); 296extern void ebt_unregister_target(struct ebt_target *target);
297extern unsigned int ebt_do_table(unsigned int hook, struct sk_buff **pskb, 297extern unsigned int ebt_do_table(unsigned int hook, struct sk_buff *skb,
298 const struct net_device *in, const struct net_device *out, 298 const struct net_device *in, const struct net_device *out,
299 struct ebt_table *table); 299 struct ebt_table *table);
300 300
diff --git a/include/linux/netfilter_ipv4.h b/include/linux/netfilter_ipv4.h
index ceae87a4c891..1a63adf5c4c1 100644
--- a/include/linux/netfilter_ipv4.h
+++ b/include/linux/netfilter_ipv4.h
@@ -75,8 +75,8 @@ enum nf_ip_hook_priorities {
75#define SO_ORIGINAL_DST 80 75#define SO_ORIGINAL_DST 80
76 76
77#ifdef __KERNEL__ 77#ifdef __KERNEL__
78extern int ip_route_me_harder(struct sk_buff **pskb, unsigned addr_type); 78extern int ip_route_me_harder(struct sk_buff *skb, unsigned addr_type);
79extern int ip_xfrm_me_harder(struct sk_buff **pskb); 79extern int ip_xfrm_me_harder(struct sk_buff *skb);
80extern __sum16 nf_ip_checksum(struct sk_buff *skb, unsigned int hook, 80extern __sum16 nf_ip_checksum(struct sk_buff *skb, unsigned int hook,
81 unsigned int dataoff, u_int8_t protocol); 81 unsigned int dataoff, u_int8_t protocol);
82#endif /*__KERNEL__*/ 82#endif /*__KERNEL__*/
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h
index e992cd6b28f5..d79ed69cbc1f 100644
--- a/include/linux/netfilter_ipv4/ip_tables.h
+++ b/include/linux/netfilter_ipv4/ip_tables.h
@@ -337,7 +337,7 @@ struct ipt_error
337 .target.errorname = "ERROR", \ 337 .target.errorname = "ERROR", \
338} 338}
339 339
340extern unsigned int ipt_do_table(struct sk_buff **pskb, 340extern unsigned int ipt_do_table(struct sk_buff *skb,
341 unsigned int hook, 341 unsigned int hook,
342 const struct net_device *in, 342 const struct net_device *in,
343 const struct net_device *out, 343 const struct net_device *out,
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h
index 9a720f05888f..7dc481ce7cba 100644
--- a/include/linux/netfilter_ipv6/ip6_tables.h
+++ b/include/linux/netfilter_ipv6/ip6_tables.h
@@ -336,7 +336,7 @@ extern void ip6t_init(void) __init;
336extern int ip6t_register_table(struct xt_table *table, 336extern int ip6t_register_table(struct xt_table *table,
337 const struct ip6t_replace *repl); 337 const struct ip6t_replace *repl);
338extern void ip6t_unregister_table(struct xt_table *table); 338extern void ip6t_unregister_table(struct xt_table *table);
339extern unsigned int ip6t_do_table(struct sk_buff **pskb, 339extern unsigned int ip6t_do_table(struct sk_buff *skb,
340 unsigned int hook, 340 unsigned int hook,
341 const struct net_device *in, 341 const struct net_device *in,
342 const struct net_device *out, 342 const struct net_device *out,
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 7250eeadd7b5..c5164c257f71 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -47,10 +47,8 @@
47#include <linux/nfs3.h> 47#include <linux/nfs3.h>
48#include <linux/nfs4.h> 48#include <linux/nfs4.h>
49#include <linux/nfs_xdr.h> 49#include <linux/nfs_xdr.h>
50
51#include <linux/nfs_fs_sb.h> 50#include <linux/nfs_fs_sb.h>
52 51
53#include <linux/rwsem.h>
54#include <linux/mempool.h> 52#include <linux/mempool.h>
55 53
56/* 54/*
@@ -77,6 +75,9 @@ struct nfs_open_context {
77 struct nfs4_state *state; 75 struct nfs4_state *state;
78 fl_owner_t lockowner; 76 fl_owner_t lockowner;
79 int mode; 77 int mode;
78
79 unsigned long flags;
80#define NFS_CONTEXT_ERROR_WRITE (0)
80 int error; 81 int error;
81 82
82 struct list_head list; 83 struct list_head list;
@@ -133,11 +134,6 @@ struct nfs_inode {
133 * server. 134 * server.
134 */ 135 */
135 unsigned long cache_change_attribute; 136 unsigned long cache_change_attribute;
136 /*
137 * Counter indicating the number of outstanding requests that
138 * will cause a file data update.
139 */
140 atomic_t data_updates;
141 137
142 struct rb_root access_cache; 138 struct rb_root access_cache;
143 struct list_head access_cache_entry_lru; 139 struct list_head access_cache_entry_lru;
@@ -205,27 +201,18 @@ static inline struct nfs_inode *NFS_I(struct inode *inode)
205#define NFS_CLIENT(inode) (NFS_SERVER(inode)->client) 201#define NFS_CLIENT(inode) (NFS_SERVER(inode)->client)
206#define NFS_PROTO(inode) (NFS_SERVER(inode)->nfs_client->rpc_ops) 202#define NFS_PROTO(inode) (NFS_SERVER(inode)->nfs_client->rpc_ops)
207#define NFS_COOKIEVERF(inode) (NFS_I(inode)->cookieverf) 203#define NFS_COOKIEVERF(inode) (NFS_I(inode)->cookieverf)
208#define NFS_READTIME(inode) (NFS_I(inode)->read_cache_jiffies)
209#define NFS_CHANGE_ATTR(inode) (NFS_I(inode)->change_attr)
210#define NFS_ATTRTIMEO(inode) (NFS_I(inode)->attrtimeo)
211#define NFS_MINATTRTIMEO(inode) \ 204#define NFS_MINATTRTIMEO(inode) \
212 (S_ISDIR(inode->i_mode)? NFS_SERVER(inode)->acdirmin \ 205 (S_ISDIR(inode->i_mode)? NFS_SERVER(inode)->acdirmin \
213 : NFS_SERVER(inode)->acregmin) 206 : NFS_SERVER(inode)->acregmin)
214#define NFS_MAXATTRTIMEO(inode) \ 207#define NFS_MAXATTRTIMEO(inode) \
215 (S_ISDIR(inode->i_mode)? NFS_SERVER(inode)->acdirmax \ 208 (S_ISDIR(inode->i_mode)? NFS_SERVER(inode)->acdirmax \
216 : NFS_SERVER(inode)->acregmax) 209 : NFS_SERVER(inode)->acregmax)
217#define NFS_ATTRTIMEO_UPDATE(inode) (NFS_I(inode)->attrtimeo_timestamp)
218 210
219#define NFS_FLAGS(inode) (NFS_I(inode)->flags) 211#define NFS_FLAGS(inode) (NFS_I(inode)->flags)
220#define NFS_STALE(inode) (test_bit(NFS_INO_STALE, &NFS_FLAGS(inode))) 212#define NFS_STALE(inode) (test_bit(NFS_INO_STALE, &NFS_FLAGS(inode)))
221 213
222#define NFS_FILEID(inode) (NFS_I(inode)->fileid) 214#define NFS_FILEID(inode) (NFS_I(inode)->fileid)
223 215
224static inline int nfs_caches_unstable(struct inode *inode)
225{
226 return atomic_read(&NFS_I(inode)->data_updates) != 0;
227}
228
229static inline void nfs_mark_for_revalidate(struct inode *inode) 216static inline void nfs_mark_for_revalidate(struct inode *inode)
230{ 217{
231 struct nfs_inode *nfsi = NFS_I(inode); 218 struct nfs_inode *nfsi = NFS_I(inode);
@@ -237,12 +224,6 @@ static inline void nfs_mark_for_revalidate(struct inode *inode)
237 spin_unlock(&inode->i_lock); 224 spin_unlock(&inode->i_lock);
238} 225}
239 226
240static inline void NFS_CACHEINV(struct inode *inode)
241{
242 if (!nfs_caches_unstable(inode))
243 nfs_mark_for_revalidate(inode);
244}
245
246static inline int nfs_server_capable(struct inode *inode, int cap) 227static inline int nfs_server_capable(struct inode *inode, int cap)
247{ 228{
248 return NFS_SERVER(inode)->caps & cap; 229 return NFS_SERVER(inode)->caps & cap;
@@ -253,28 +234,33 @@ static inline int NFS_USE_READDIRPLUS(struct inode *inode)
253 return test_bit(NFS_INO_ADVISE_RDPLUS, &NFS_FLAGS(inode)); 234 return test_bit(NFS_INO_ADVISE_RDPLUS, &NFS_FLAGS(inode));
254} 235}
255 236
237static inline void nfs_set_verifier(struct dentry * dentry, unsigned long verf)
238{
239 dentry->d_time = verf;
240}
241
256/** 242/**
257 * nfs_save_change_attribute - Returns the inode attribute change cookie 243 * nfs_save_change_attribute - Returns the inode attribute change cookie
258 * @inode - pointer to inode 244 * @dir - pointer to parent directory inode
259 * The "change attribute" is updated every time we finish an operation 245 * The "change attribute" is updated every time we finish an operation
260 * that will result in a metadata change on the server. 246 * that will result in a metadata change on the server.
261 */ 247 */
262static inline long nfs_save_change_attribute(struct inode *inode) 248static inline unsigned long nfs_save_change_attribute(struct inode *dir)
263{ 249{
264 return NFS_I(inode)->cache_change_attribute; 250 return NFS_I(dir)->cache_change_attribute;
265} 251}
266 252
267/** 253/**
268 * nfs_verify_change_attribute - Detects NFS inode cache updates 254 * nfs_verify_change_attribute - Detects NFS remote directory changes
269 * @inode - pointer to inode 255 * @dir - pointer to parent directory inode
270 * @chattr - previously saved change attribute 256 * @chattr - previously saved change attribute
271 * Return "false" if metadata has been updated (or is in the process of 257 * Return "false" if the verifiers doesn't match the change attribute.
272 * being updated) since the change attribute was saved. 258 * This would usually indicate that the directory contents have changed on
259 * the server, and that any dentries need revalidating.
273 */ 260 */
274static inline int nfs_verify_change_attribute(struct inode *inode, unsigned long chattr) 261static inline int nfs_verify_change_attribute(struct inode *dir, unsigned long chattr)
275{ 262{
276 return !nfs_caches_unstable(inode) 263 return chattr == NFS_I(dir)->cache_change_attribute;
277 && time_after_eq(chattr, NFS_I(inode)->cache_change_attribute);
278} 264}
279 265
280/* 266/*
@@ -283,15 +269,14 @@ static inline int nfs_verify_change_attribute(struct inode *inode, unsigned long
283extern int nfs_sync_mapping(struct address_space *mapping); 269extern int nfs_sync_mapping(struct address_space *mapping);
284extern void nfs_zap_mapping(struct inode *inode, struct address_space *mapping); 270extern void nfs_zap_mapping(struct inode *inode, struct address_space *mapping);
285extern void nfs_zap_caches(struct inode *); 271extern void nfs_zap_caches(struct inode *);
272extern void nfs_invalidate_atime(struct inode *);
286extern struct inode *nfs_fhget(struct super_block *, struct nfs_fh *, 273extern struct inode *nfs_fhget(struct super_block *, struct nfs_fh *,
287 struct nfs_fattr *); 274 struct nfs_fattr *);
288extern int nfs_refresh_inode(struct inode *, struct nfs_fattr *); 275extern int nfs_refresh_inode(struct inode *, struct nfs_fattr *);
289extern int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr); 276extern int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr);
277extern int nfs_post_op_update_inode_force_wcc(struct inode *inode, struct nfs_fattr *fattr);
290extern int nfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); 278extern int nfs_getattr(struct vfsmount *, struct dentry *, struct kstat *);
291extern int nfs_permission(struct inode *, int, struct nameidata *); 279extern int nfs_permission(struct inode *, int, struct nameidata *);
292extern int nfs_access_get_cached(struct inode *, struct rpc_cred *, struct nfs_access_entry *);
293extern void nfs_access_add_cache(struct inode *, struct nfs_access_entry *);
294extern void nfs_access_zap_cache(struct inode *inode);
295extern int nfs_open(struct inode *, struct file *); 280extern int nfs_open(struct inode *, struct file *);
296extern int nfs_release(struct inode *, struct file *); 281extern int nfs_release(struct inode *, struct file *);
297extern int nfs_attribute_timeout(struct inode *inode); 282extern int nfs_attribute_timeout(struct inode *inode);
@@ -301,13 +286,10 @@ extern int nfs_revalidate_mapping(struct inode *inode, struct address_space *map
301extern int nfs_revalidate_mapping_nolock(struct inode *inode, struct address_space *mapping); 286extern int nfs_revalidate_mapping_nolock(struct inode *inode, struct address_space *mapping);
302extern int nfs_setattr(struct dentry *, struct iattr *); 287extern int nfs_setattr(struct dentry *, struct iattr *);
303extern void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr); 288extern void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr);
304extern void nfs_begin_attr_update(struct inode *);
305extern void nfs_end_attr_update(struct inode *);
306extern void nfs_begin_data_update(struct inode *);
307extern void nfs_end_data_update(struct inode *);
308extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx); 289extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx);
309extern void put_nfs_open_context(struct nfs_open_context *ctx); 290extern void put_nfs_open_context(struct nfs_open_context *ctx);
310extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, int mode); 291extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, int mode);
292extern u64 nfs_compat_user_ino64(u64 fileid);
311 293
312/* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ 294/* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */
313extern __be32 root_nfs_parse_addr(char *name); /*__init*/ 295extern __be32 root_nfs_parse_addr(char *name); /*__init*/
@@ -328,14 +310,15 @@ extern const struct inode_operations nfs3_file_inode_operations;
328extern const struct file_operations nfs_file_operations; 310extern const struct file_operations nfs_file_operations;
329extern const struct address_space_operations nfs_file_aops; 311extern const struct address_space_operations nfs_file_aops;
330 312
331static inline struct rpc_cred *nfs_file_cred(struct file *file) 313static inline struct nfs_open_context *nfs_file_open_context(struct file *filp)
332{ 314{
333 if (file != NULL) { 315 return filp->private_data;
334 struct nfs_open_context *ctx; 316}
335 317
336 ctx = (struct nfs_open_context*)file->private_data; 318static inline struct rpc_cred *nfs_file_cred(struct file *file)
337 return ctx->cred; 319{
338 } 320 if (file != NULL)
321 return nfs_file_open_context(file)->cred;
339 return NULL; 322 return NULL;
340} 323}
341 324
@@ -378,6 +361,8 @@ extern const struct file_operations nfs_dir_operations;
378extern struct dentry_operations nfs_dentry_operations; 361extern struct dentry_operations nfs_dentry_operations;
379 362
380extern int nfs_instantiate(struct dentry *dentry, struct nfs_fh *fh, struct nfs_fattr *fattr); 363extern int nfs_instantiate(struct dentry *dentry, struct nfs_fh *fh, struct nfs_fattr *fattr);
364extern int nfs_may_open(struct inode *inode, struct rpc_cred *cred, int openflags);
365extern void nfs_access_zap_cache(struct inode *inode);
381 366
382/* 367/*
383 * linux/fs/nfs/symlink.c 368 * linux/fs/nfs/symlink.c
@@ -420,15 +405,14 @@ extern int nfs_flush_incompatible(struct file *file, struct page *page);
420extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned int); 405extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned int);
421extern int nfs_writeback_done(struct rpc_task *, struct nfs_write_data *); 406extern int nfs_writeback_done(struct rpc_task *, struct nfs_write_data *);
422extern void nfs_writedata_release(void *); 407extern void nfs_writedata_release(void *);
423extern int nfs_set_page_dirty(struct page *);
424 408
425/* 409/*
426 * Try to write back everything synchronously (but check the 410 * Try to write back everything synchronously (but check the
427 * return value!) 411 * return value!)
428 */ 412 */
429extern long nfs_sync_mapping_wait(struct address_space *, struct writeback_control *, int); 413extern long nfs_sync_mapping_wait(struct address_space *, struct writeback_control *, int);
430extern int nfs_sync_mapping_range(struct address_space *, loff_t, loff_t, int);
431extern int nfs_wb_all(struct inode *inode); 414extern int nfs_wb_all(struct inode *inode);
415extern int nfs_wb_nocommit(struct inode *inode);
432extern int nfs_wb_page(struct inode *inode, struct page* page); 416extern int nfs_wb_page(struct inode *inode, struct page* page);
433extern int nfs_wb_page_priority(struct inode *inode, struct page* page, int how); 417extern int nfs_wb_page_priority(struct inode *inode, struct page* page, int how);
434extern int nfs_wb_page_cancel(struct inode *inode, struct page* page); 418extern int nfs_wb_page_cancel(struct inode *inode, struct page* page);
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index 78e60798d10e..30dbcc185e69 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -30,7 +30,6 @@
30#define PG_BUSY 0 30#define PG_BUSY 0
31#define PG_NEED_COMMIT 1 31#define PG_NEED_COMMIT 1
32#define PG_NEED_RESCHED 2 32#define PG_NEED_RESCHED 2
33#define PG_NEED_FLUSH 3
34 33
35struct nfs_inode; 34struct nfs_inode;
36struct nfs_page { 35struct nfs_page {
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index cf74a4db84a5..daab252f2e5c 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -62,7 +62,8 @@ struct nfs_fattr {
62#define NFS_ATTR_FATTR 0x0002 /* post-op attributes */ 62#define NFS_ATTR_FATTR 0x0002 /* post-op attributes */
63#define NFS_ATTR_FATTR_V3 0x0004 /* NFSv3 attributes */ 63#define NFS_ATTR_FATTR_V3 0x0004 /* NFSv3 attributes */
64#define NFS_ATTR_FATTR_V4 0x0008 /* NFSv4 change attribute */ 64#define NFS_ATTR_FATTR_V4 0x0008 /* NFSv4 change attribute */
65#define NFS_ATTR_FATTR_V4_REFERRAL 0x0010 /* NFSv4 referral */ 65#define NFS_ATTR_WCC_V4 0x0010 /* pre-op change attribute */
66#define NFS_ATTR_FATTR_V4_REFERRAL 0x0020 /* NFSv4 referral */
66 67
67/* 68/*
68 * Info on the file system 69 * Info on the file system
@@ -538,10 +539,13 @@ typedef u64 clientid4;
538 539
539struct nfs4_accessargs { 540struct nfs4_accessargs {
540 const struct nfs_fh * fh; 541 const struct nfs_fh * fh;
542 const u32 * bitmask;
541 u32 access; 543 u32 access;
542}; 544};
543 545
544struct nfs4_accessres { 546struct nfs4_accessres {
547 const struct nfs_server * server;
548 struct nfs_fattr * fattr;
545 u32 supported; 549 u32 supported;
546 u32 access; 550 u32 access;
547}; 551};
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h
index 5cd192469096..bcb7abafbca9 100644
--- a/include/linux/nfsd/export.h
+++ b/include/linux/nfsd/export.h
@@ -127,17 +127,9 @@ void nfsd_export_shutdown(void);
127void nfsd_export_flush(void); 127void nfsd_export_flush(void);
128void exp_readlock(void); 128void exp_readlock(void);
129void exp_readunlock(void); 129void exp_readunlock(void);
130struct svc_export * exp_get_by_name(struct auth_domain *clp,
131 struct vfsmount *mnt,
132 struct dentry *dentry,
133 struct cache_req *reqp);
134struct svc_export * rqst_exp_get_by_name(struct svc_rqst *, 130struct svc_export * rqst_exp_get_by_name(struct svc_rqst *,
135 struct vfsmount *, 131 struct vfsmount *,
136 struct dentry *); 132 struct dentry *);
137struct svc_export * exp_parent(struct auth_domain *clp,
138 struct vfsmount *mnt,
139 struct dentry *dentry,
140 struct cache_req *reqp);
141struct svc_export * rqst_exp_parent(struct svc_rqst *, 133struct svc_export * rqst_exp_parent(struct svc_rqst *,
142 struct vfsmount *mnt, 134 struct vfsmount *mnt,
143 struct dentry *dentry); 135 struct dentry *dentry);
@@ -157,9 +149,6 @@ static inline void exp_get(struct svc_export *exp)
157{ 149{
158 cache_get(&exp->h); 150 cache_get(&exp->h);
159} 151}
160extern struct svc_export *
161exp_find(struct auth_domain *clp, int fsid_type, u32 *fsidv,
162 struct cache_req *reqp);
163struct svc_export * rqst_exp_find(struct svc_rqst *, int, u32 *); 152struct svc_export * rqst_exp_find(struct svc_rqst *, int, u32 *);
164 153
165#endif /* __KERNEL__ */ 154#endif /* __KERNEL__ */
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h
index e452256d3f72..604a0d786bc6 100644
--- a/include/linux/nfsd/nfsd.h
+++ b/include/linux/nfsd/nfsd.h
@@ -153,19 +153,21 @@ extern int nfsd_max_blksize;
153 */ 153 */
154#ifdef CONFIG_NFSD_V4 154#ifdef CONFIG_NFSD_V4
155extern unsigned int max_delegations; 155extern unsigned int max_delegations;
156void nfs4_state_init(void); 156int nfs4_state_init(void);
157int nfs4_state_start(void); 157void nfsd4_free_slabs(void);
158void nfs4_state_start(void);
158void nfs4_state_shutdown(void); 159void nfs4_state_shutdown(void);
159time_t nfs4_lease_time(void); 160time_t nfs4_lease_time(void);
160void nfs4_reset_lease(time_t leasetime); 161void nfs4_reset_lease(time_t leasetime);
161int nfs4_reset_recoverydir(char *recdir); 162int nfs4_reset_recoverydir(char *recdir);
162#else 163#else
163static inline void nfs4_state_init(void){}; 164static inline int nfs4_state_init(void) { return 0; }
164static inline int nfs4_state_start(void){return 0;} 165static inline void nfsd4_free_slabs(void) { }
165static inline void nfs4_state_shutdown(void){} 166static inline void nfs4_state_start(void) { }
166static inline time_t nfs4_lease_time(void){return 0;} 167static inline void nfs4_state_shutdown(void) { }
167static inline void nfs4_reset_lease(time_t leasetime){} 168static inline time_t nfs4_lease_time(void) { return 0; }
168static inline int nfs4_reset_recoverydir(char *recdir) {return 0;} 169static inline void nfs4_reset_lease(time_t leasetime) { }
170static inline int nfs4_reset_recoverydir(char *recdir) { return 0; }
169#endif 171#endif
170 172
171/* 173/*
diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h
index 11e568ee0eeb..d1941cb965e9 100644
--- a/include/linux/nfsd/nfsfh.h
+++ b/include/linux/nfsd/nfsfh.h
@@ -150,17 +150,7 @@ typedef struct svc_fh {
150 struct timespec fh_pre_ctime; /* ctime before oper */ 150 struct timespec fh_pre_ctime; /* ctime before oper */
151 151
152 /* Post-op attributes saved in fh_unlock */ 152 /* Post-op attributes saved in fh_unlock */
153 umode_t fh_post_mode; /* i_mode */ 153 struct kstat fh_post_attr; /* full attrs after operation */
154 nlink_t fh_post_nlink; /* i_nlink */
155 uid_t fh_post_uid; /* i_uid */
156 gid_t fh_post_gid; /* i_gid */
157 __u64 fh_post_size; /* i_size */
158 unsigned long fh_post_blocks; /* i_blocks */
159 unsigned long fh_post_blksize;/* i_blksize */
160 __be32 fh_post_rdev[2];/* i_rdev */
161 struct timespec fh_post_atime; /* i_atime */
162 struct timespec fh_post_mtime; /* i_mtime */
163 struct timespec fh_post_ctime; /* i_ctime */
164#endif /* CONFIG_NFSD_V3 */ 154#endif /* CONFIG_NFSD_V3 */
165 155
166} svc_fh; 156} svc_fh;
@@ -297,36 +287,12 @@ fill_pre_wcc(struct svc_fh *fhp)
297 if (!fhp->fh_pre_saved) { 287 if (!fhp->fh_pre_saved) {
298 fhp->fh_pre_mtime = inode->i_mtime; 288 fhp->fh_pre_mtime = inode->i_mtime;
299 fhp->fh_pre_ctime = inode->i_ctime; 289 fhp->fh_pre_ctime = inode->i_ctime;
300 fhp->fh_pre_size = inode->i_size; 290 fhp->fh_pre_size = inode->i_size;
301 fhp->fh_pre_saved = 1; 291 fhp->fh_pre_saved = 1;
302 } 292 }
303} 293}
304 294
305/* 295extern void fill_post_wcc(struct svc_fh *);
306 * Fill in the post_op attr for the wcc data
307 */
308static inline void
309fill_post_wcc(struct svc_fh *fhp)
310{
311 struct inode *inode = fhp->fh_dentry->d_inode;
312
313 if (fhp->fh_post_saved)
314 printk("nfsd: inode locked twice during operation.\n");
315
316 fhp->fh_post_mode = inode->i_mode;
317 fhp->fh_post_nlink = inode->i_nlink;
318 fhp->fh_post_uid = inode->i_uid;
319 fhp->fh_post_gid = inode->i_gid;
320 fhp->fh_post_size = inode->i_size;
321 fhp->fh_post_blksize = BLOCK_SIZE;
322 fhp->fh_post_blocks = inode->i_blocks;
323 fhp->fh_post_rdev[0] = htonl((u32)imajor(inode));
324 fhp->fh_post_rdev[1] = htonl((u32)iminor(inode));
325 fhp->fh_post_atime = inode->i_atime;
326 fhp->fh_post_mtime = inode->i_mtime;
327 fhp->fh_post_ctime = inode->i_ctime;
328 fhp->fh_post_saved = 1;
329}
330#else 296#else
331#define fill_pre_wcc(ignored) 297#define fill_pre_wcc(ignored)
332#define fill_post_wcc(notused) 298#define fill_post_wcc(notused)
diff --git a/include/linux/nfsd/xdr4.h b/include/linux/nfsd/xdr4.h
index 1b653267133a..b0ddfb41c790 100644
--- a/include/linux/nfsd/xdr4.h
+++ b/include/linux/nfsd/xdr4.h
@@ -428,8 +428,8 @@ set_change_info(struct nfsd4_change_info *cinfo, struct svc_fh *fhp)
428 cinfo->atomic = 1; 428 cinfo->atomic = 1;
429 cinfo->before_ctime_sec = fhp->fh_pre_ctime.tv_sec; 429 cinfo->before_ctime_sec = fhp->fh_pre_ctime.tv_sec;
430 cinfo->before_ctime_nsec = fhp->fh_pre_ctime.tv_nsec; 430 cinfo->before_ctime_nsec = fhp->fh_pre_ctime.tv_nsec;
431 cinfo->after_ctime_sec = fhp->fh_post_ctime.tv_sec; 431 cinfo->after_ctime_sec = fhp->fh_post_attr.ctime.tv_sec;
432 cinfo->after_ctime_nsec = fhp->fh_post_ctime.tv_nsec; 432 cinfo->after_ctime_nsec = fhp->fh_post_attr.ctime.tv_nsec;
433} 433}
434 434
435int nfs4svc_encode_voidres(struct svc_rqst *, __be32 *, void *); 435int nfs4svc_encode_voidres(struct svc_rqst *, __be32 *, void *);
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h
index 52c54a5720f3..905e18f4b412 100644
--- a/include/linux/nodemask.h
+++ b/include/linux/nodemask.h
@@ -338,31 +338,88 @@ static inline void __nodes_remap(nodemask_t *dstp, const nodemask_t *srcp,
338#endif /* MAX_NUMNODES */ 338#endif /* MAX_NUMNODES */
339 339
340/* 340/*
341 * Bitmasks that are kept for all the nodes.
342 */
343enum node_states {
344 N_POSSIBLE, /* The node could become online at some point */
345 N_ONLINE, /* The node is online */
346 N_NORMAL_MEMORY, /* The node has regular memory */
347#ifdef CONFIG_HIGHMEM
348 N_HIGH_MEMORY, /* The node has regular or high memory */
349#else
350 N_HIGH_MEMORY = N_NORMAL_MEMORY,
351#endif
352 N_CPU, /* The node has one or more cpus */
353 NR_NODE_STATES
354};
355
356/*
341 * The following particular system nodemasks and operations 357 * The following particular system nodemasks and operations
342 * on them manage all possible and online nodes. 358 * on them manage all possible and online nodes.
343 */ 359 */
344 360
345extern nodemask_t node_online_map; 361extern nodemask_t node_states[NR_NODE_STATES];
346extern nodemask_t node_possible_map;
347 362
348#if MAX_NUMNODES > 1 363#if MAX_NUMNODES > 1
349#define num_online_nodes() nodes_weight(node_online_map) 364static inline int node_state(int node, enum node_states state)
350#define num_possible_nodes() nodes_weight(node_possible_map) 365{
351#define node_online(node) node_isset((node), node_online_map) 366 return node_isset(node, node_states[state]);
352#define node_possible(node) node_isset((node), node_possible_map) 367}
353#define first_online_node first_node(node_online_map) 368
354#define next_online_node(nid) next_node((nid), node_online_map) 369static inline void node_set_state(int node, enum node_states state)
370{
371 __node_set(node, &node_states[state]);
372}
373
374static inline void node_clear_state(int node, enum node_states state)
375{
376 __node_clear(node, &node_states[state]);
377}
378
379static inline int num_node_state(enum node_states state)
380{
381 return nodes_weight(node_states[state]);
382}
383
384#define for_each_node_state(__node, __state) \
385 for_each_node_mask((__node), node_states[__state])
386
387#define first_online_node first_node(node_states[N_ONLINE])
388#define next_online_node(nid) next_node((nid), node_states[N_ONLINE])
389
355extern int nr_node_ids; 390extern int nr_node_ids;
356#else 391#else
357#define num_online_nodes() 1 392
358#define num_possible_nodes() 1 393static inline int node_state(int node, enum node_states state)
359#define node_online(node) ((node) == 0) 394{
360#define node_possible(node) ((node) == 0) 395 return node == 0;
396}
397
398static inline void node_set_state(int node, enum node_states state)
399{
400}
401
402static inline void node_clear_state(int node, enum node_states state)
403{
404}
405
406static inline int num_node_state(enum node_states state)
407{
408 return 1;
409}
410
411#define for_each_node_state(node, __state) \
412 for ( (node) = 0; (node) == 0; (node) = 1)
413
361#define first_online_node 0 414#define first_online_node 0
362#define next_online_node(nid) (MAX_NUMNODES) 415#define next_online_node(nid) (MAX_NUMNODES)
363#define nr_node_ids 1 416#define nr_node_ids 1
417
364#endif 418#endif
365 419
420#define node_online_map node_states[N_ONLINE]
421#define node_possible_map node_states[N_POSSIBLE]
422
366#define any_online_node(mask) \ 423#define any_online_node(mask) \
367({ \ 424({ \
368 int node; \ 425 int node; \
@@ -372,10 +429,15 @@ extern int nr_node_ids;
372 node; \ 429 node; \
373}) 430})
374 431
375#define node_set_online(node) set_bit((node), node_online_map.bits) 432#define num_online_nodes() num_node_state(N_ONLINE)
376#define node_set_offline(node) clear_bit((node), node_online_map.bits) 433#define num_possible_nodes() num_node_state(N_POSSIBLE)
434#define node_online(node) node_state((node), N_ONLINE)
435#define node_possible(node) node_state((node), N_POSSIBLE)
436
437#define node_set_online(node) node_set_state((node), N_ONLINE)
438#define node_set_offline(node) node_clear_state((node), N_ONLINE)
377 439
378#define for_each_node(node) for_each_node_mask((node), node_possible_map) 440#define for_each_node(node) for_each_node_state(node, N_POSSIBLE)
379#define for_each_online_node(node) for_each_node_mask((node), node_online_map) 441#define for_each_online_node(node) for_each_node_state(node, N_ONLINE)
380 442
381#endif /* __LINUX_NODEMASK_H */ 443#endif /* __LINUX_NODEMASK_H */
diff --git a/include/linux/page-isolation.h b/include/linux/page-isolation.h
new file mode 100644
index 000000000000..051c1b1ede4e
--- /dev/null
+++ b/include/linux/page-isolation.h
@@ -0,0 +1,37 @@
1#ifndef __LINUX_PAGEISOLATION_H
2#define __LINUX_PAGEISOLATION_H
3
4/*
5 * Changes migrate type in [start_pfn, end_pfn) to be MIGRATE_ISOLATE.
6 * If specified range includes migrate types other than MOVABLE,
7 * this will fail with -EBUSY.
8 *
9 * For isolating all pages in the range finally, the caller have to
10 * free all pages in the range. test_page_isolated() can be used for
11 * test it.
12 */
13extern int
14start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn);
15
16/*
17 * Changes MIGRATE_ISOLATE to MIGRATE_MOVABLE.
18 * target range is [start_pfn, end_pfn)
19 */
20extern int
21undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn);
22
23/*
24 * test all pages in [start_pfn, end_pfn)are isolated or not.
25 */
26extern int
27test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn);
28
29/*
30 * Internal funcs.Changes pageblock's migrate type.
31 * Please use make_pagetype_isolated()/make_pagetype_movable().
32 */
33extern int set_migratetype_isolate(struct page *page);
34extern void unset_migratetype_isolate(struct page *page);
35
36
37#endif
diff --git a/include/linux/pageblock-flags.h b/include/linux/pageblock-flags.h
new file mode 100644
index 000000000000..e875905f7b12
--- /dev/null
+++ b/include/linux/pageblock-flags.h
@@ -0,0 +1,75 @@
1/*
2 * Macros for manipulating and testing flags related to a
3 * pageblock_nr_pages number of pages.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation version 2 of the License
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 *
18 * Copyright (C) IBM Corporation, 2006
19 *
20 * Original author, Mel Gorman
21 * Major cleanups and reduction of bit operations, Andy Whitcroft
22 */
23#ifndef PAGEBLOCK_FLAGS_H
24#define PAGEBLOCK_FLAGS_H
25
26#include <linux/types.h>
27
28/* Macro to aid the definition of ranges of bits */
29#define PB_range(name, required_bits) \
30 name, name ## _end = (name + required_bits) - 1
31
32/* Bit indices that affect a whole block of pages */
33enum pageblock_bits {
34 PB_range(PB_migrate, 3), /* 3 bits required for migrate types */
35 NR_PAGEBLOCK_BITS
36};
37
38#ifdef CONFIG_HUGETLB_PAGE
39
40#ifdef CONFIG_HUGETLB_PAGE_SIZE_VARIABLE
41
42/* Huge page sizes are variable */
43extern int pageblock_order;
44
45#else /* CONFIG_HUGETLB_PAGE_SIZE_VARIABLE */
46
47/* Huge pages are a constant size */
48#define pageblock_order HUGETLB_PAGE_ORDER
49
50#endif /* CONFIG_HUGETLB_PAGE_SIZE_VARIABLE */
51
52#else /* CONFIG_HUGETLB_PAGE */
53
54/* If huge pages are not used, group by MAX_ORDER_NR_PAGES */
55#define pageblock_order (MAX_ORDER-1)
56
57#endif /* CONFIG_HUGETLB_PAGE */
58
59#define pageblock_nr_pages (1UL << pageblock_order)
60
61/* Forward declaration */
62struct page;
63
64/* Declarations for getting and setting flags. See mm/page_alloc.c */
65unsigned long get_pageblock_flags_group(struct page *page,
66 int start_bitidx, int end_bitidx);
67void set_pageblock_flags_group(struct page *page, unsigned long flags,
68 int start_bitidx, int end_bitidx);
69
70#define get_pageblock_flags(page) \
71 get_pageblock_flags_group(page, 0, NR_PAGEBLOCK_BITS-1)
72#define set_pageblock_flags(page) \
73 set_pageblock_flags_group(page, 0, NR_PAGEBLOCK_BITS-1)
74
75#endif /* PAGEBLOCK_FLAGS_H */
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 8a83537d6978..db8a410ae9e1 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -84,11 +84,11 @@ static inline struct page *page_cache_alloc_cold(struct address_space *x)
84typedef int filler_t(void *, struct page *); 84typedef int filler_t(void *, struct page *);
85 85
86extern struct page * find_get_page(struct address_space *mapping, 86extern struct page * find_get_page(struct address_space *mapping,
87 unsigned long index); 87 pgoff_t index);
88extern struct page * find_lock_page(struct address_space *mapping, 88extern struct page * find_lock_page(struct address_space *mapping,
89 unsigned long index); 89 pgoff_t index);
90extern struct page * find_or_create_page(struct address_space *mapping, 90extern struct page * find_or_create_page(struct address_space *mapping,
91 unsigned long index, gfp_t gfp_mask); 91 pgoff_t index, gfp_t gfp_mask);
92unsigned find_get_pages(struct address_space *mapping, pgoff_t start, 92unsigned find_get_pages(struct address_space *mapping, pgoff_t start,
93 unsigned int nr_pages, struct page **pages); 93 unsigned int nr_pages, struct page **pages);
94unsigned find_get_pages_contig(struct address_space *mapping, pgoff_t start, 94unsigned find_get_pages_contig(struct address_space *mapping, pgoff_t start,
@@ -96,44 +96,47 @@ unsigned find_get_pages_contig(struct address_space *mapping, pgoff_t start,
96unsigned find_get_pages_tag(struct address_space *mapping, pgoff_t *index, 96unsigned find_get_pages_tag(struct address_space *mapping, pgoff_t *index,
97 int tag, unsigned int nr_pages, struct page **pages); 97 int tag, unsigned int nr_pages, struct page **pages);
98 98
99struct page *__grab_cache_page(struct address_space *mapping, pgoff_t index);
100
99/* 101/*
100 * Returns locked page at given index in given cache, creating it if needed. 102 * Returns locked page at given index in given cache, creating it if needed.
101 */ 103 */
102static inline struct page *grab_cache_page(struct address_space *mapping, unsigned long index) 104static inline struct page *grab_cache_page(struct address_space *mapping,
105 pgoff_t index)
103{ 106{
104 return find_or_create_page(mapping, index, mapping_gfp_mask(mapping)); 107 return find_or_create_page(mapping, index, mapping_gfp_mask(mapping));
105} 108}
106 109
107extern struct page * grab_cache_page_nowait(struct address_space *mapping, 110extern struct page * grab_cache_page_nowait(struct address_space *mapping,
108 unsigned long index); 111 pgoff_t index);
109extern struct page * read_cache_page_async(struct address_space *mapping, 112extern struct page * read_cache_page_async(struct address_space *mapping,
110 unsigned long index, filler_t *filler, 113 pgoff_t index, filler_t *filler,
111 void *data); 114 void *data);
112extern struct page * read_cache_page(struct address_space *mapping, 115extern struct page * read_cache_page(struct address_space *mapping,
113 unsigned long index, filler_t *filler, 116 pgoff_t index, filler_t *filler,
114 void *data); 117 void *data);
115extern int read_cache_pages(struct address_space *mapping, 118extern int read_cache_pages(struct address_space *mapping,
116 struct list_head *pages, filler_t *filler, void *data); 119 struct list_head *pages, filler_t *filler, void *data);
117 120
118static inline struct page *read_mapping_page_async( 121static inline struct page *read_mapping_page_async(
119 struct address_space *mapping, 122 struct address_space *mapping,
120 unsigned long index, void *data) 123 pgoff_t index, void *data)
121{ 124{
122 filler_t *filler = (filler_t *)mapping->a_ops->readpage; 125 filler_t *filler = (filler_t *)mapping->a_ops->readpage;
123 return read_cache_page_async(mapping, index, filler, data); 126 return read_cache_page_async(mapping, index, filler, data);
124} 127}
125 128
126static inline struct page *read_mapping_page(struct address_space *mapping, 129static inline struct page *read_mapping_page(struct address_space *mapping,
127 unsigned long index, void *data) 130 pgoff_t index, void *data)
128{ 131{
129 filler_t *filler = (filler_t *)mapping->a_ops->readpage; 132 filler_t *filler = (filler_t *)mapping->a_ops->readpage;
130 return read_cache_page(mapping, index, filler, data); 133 return read_cache_page(mapping, index, filler, data);
131} 134}
132 135
133int add_to_page_cache(struct page *page, struct address_space *mapping, 136int add_to_page_cache(struct page *page, struct address_space *mapping,
134 unsigned long index, gfp_t gfp_mask); 137 pgoff_t index, gfp_t gfp_mask);
135int add_to_page_cache_lru(struct page *page, struct address_space *mapping, 138int add_to_page_cache_lru(struct page *page, struct address_space *mapping,
136 unsigned long index, gfp_t gfp_mask); 139 pgoff_t index, gfp_t gfp_mask);
137extern void remove_from_page_cache(struct page *page); 140extern void remove_from_page_cache(struct page *page);
138extern void __remove_from_page_cache(struct page *page); 141extern void __remove_from_page_cache(struct page *page);
139 142
@@ -218,6 +221,9 @@ static inline int fault_in_pages_writeable(char __user *uaddr, int size)
218{ 221{
219 int ret; 222 int ret;
220 223
224 if (unlikely(size == 0))
225 return 0;
226
221 /* 227 /*
222 * Writing zeroes into userspace here is OK, because we know that if 228 * Writing zeroes into userspace here is OK, because we know that if
223 * the zero gets there, we'll be overwriting it. 229 * the zero gets there, we'll be overwriting it.
@@ -237,19 +243,23 @@ static inline int fault_in_pages_writeable(char __user *uaddr, int size)
237 return ret; 243 return ret;
238} 244}
239 245
240static inline void fault_in_pages_readable(const char __user *uaddr, int size) 246static inline int fault_in_pages_readable(const char __user *uaddr, int size)
241{ 247{
242 volatile char c; 248 volatile char c;
243 int ret; 249 int ret;
244 250
251 if (unlikely(size == 0))
252 return 0;
253
245 ret = __get_user(c, uaddr); 254 ret = __get_user(c, uaddr);
246 if (ret == 0) { 255 if (ret == 0) {
247 const char __user *end = uaddr + size - 1; 256 const char __user *end = uaddr + size - 1;
248 257
249 if (((unsigned long)uaddr & PAGE_MASK) != 258 if (((unsigned long)uaddr & PAGE_MASK) !=
250 ((unsigned long)end & PAGE_MASK)) 259 ((unsigned long)end & PAGE_MASK))
251 __get_user(c, end); 260 ret = __get_user(c, end);
252 } 261 }
262 return ret;
253} 263}
254 264
255#endif /* _LINUX_PAGEMAP_H */ 265#endif /* _LINUX_PAGEMAP_H */
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 038a0dc7273a..768b93359f90 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -685,13 +685,16 @@ extern void pci_unblock_user_cfg_access(struct pci_dev *dev);
685 * a PCI domain is defined to be a set of PCI busses which share 685 * a PCI domain is defined to be a set of PCI busses which share
686 * configuration space. 686 * configuration space.
687 */ 687 */
688#ifndef CONFIG_PCI_DOMAINS 688#ifdef CONFIG_PCI_DOMAINS
689extern int pci_domains_supported;
690#else
691enum { pci_domains_supported = 0 };
689static inline int pci_domain_nr(struct pci_bus *bus) { return 0; } 692static inline int pci_domain_nr(struct pci_bus *bus) { return 0; }
690static inline int pci_proc_domain(struct pci_bus *bus) 693static inline int pci_proc_domain(struct pci_bus *bus)
691{ 694{
692 return 0; 695 return 0;
693} 696}
694#endif 697#endif /* CONFIG_PCI_DOMAINS */
695 698
696#else /* CONFIG_PCI is not enabled */ 699#else /* CONFIG_PCI is not enabled */
697 700
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 3948708c42ca..df948b44edad 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -829,6 +829,9 @@
829#define PCI_DEVICE_ID_UMC_UM8886BF 0x673a 829#define PCI_DEVICE_ID_UMC_UM8886BF 0x673a
830#define PCI_DEVICE_ID_UMC_UM8886A 0x886a 830#define PCI_DEVICE_ID_UMC_UM8886A 0x886a
831 831
832#define PCI_VENDOR_ID_PICOPOWER 0x1066
833#define PCI_DEVICE_ID_PICOPOWER_PT86C523 0x0002
834#define PCI_DEVICE_ID_PICOPOWER_PT86C523BBP 0x8002
832 835
833#define PCI_VENDOR_ID_MYLEX 0x1069 836#define PCI_VENDOR_ID_MYLEX 0x1069
834#define PCI_DEVICE_ID_MYLEX_DAC960_P 0x0001 837#define PCI_DEVICE_ID_MYLEX_DAC960_P 0x0001
@@ -1464,6 +1467,8 @@
1464#define PCI_DEVICE_ID_TOSHIBA_TC86C001_MISC 0x0108 1467#define PCI_DEVICE_ID_TOSHIBA_TC86C001_MISC 0x0108
1465#define PCI_DEVICE_ID_TOSHIBA_SPIDER_NET 0x01b3 1468#define PCI_DEVICE_ID_TOSHIBA_SPIDER_NET 0x01b3
1466 1469
1470#define PCI_VENDOR_ID_ATTO 0x117c
1471
1467#define PCI_VENDOR_ID_RICOH 0x1180 1472#define PCI_VENDOR_ID_RICOH 0x1180
1468#define PCI_DEVICE_ID_RICOH_RL5C465 0x0465 1473#define PCI_DEVICE_ID_RICOH_RL5C465 0x0465
1469#define PCI_DEVICE_ID_RICOH_RL5C466 0x0466 1474#define PCI_DEVICE_ID_RICOH_RL5C466 0x0466
@@ -1631,6 +1636,7 @@
1631#define PCI_DEVICE_ID_ITE_8211 0x8211 1636#define PCI_DEVICE_ID_ITE_8211 0x8211
1632#define PCI_DEVICE_ID_ITE_8212 0x8212 1637#define PCI_DEVICE_ID_ITE_8212 0x8212
1633#define PCI_DEVICE_ID_ITE_8213 0x8213 1638#define PCI_DEVICE_ID_ITE_8213 0x8213
1639#define PCI_DEVICE_ID_ITE_8152 0x8152
1634#define PCI_DEVICE_ID_ITE_8872 0x8872 1640#define PCI_DEVICE_ID_ITE_8872 0x8872
1635#define PCI_DEVICE_ID_ITE_IT8330G_0 0xe886 1641#define PCI_DEVICE_ID_ITE_IT8330G_0 0xe886
1636 1642
@@ -1989,6 +1995,8 @@
1989#define PCI_VENDOR_ID_TOPIC 0x151f 1995#define PCI_VENDOR_ID_TOPIC 0x151f
1990#define PCI_DEVICE_ID_TOPIC_TP560 0x0000 1996#define PCI_DEVICE_ID_TOPIC_TP560 0x0000
1991 1997
1998#define PCI_VENDOR_ID_MAINPINE 0x1522
1999#define PCI_DEVICE_ID_MAINPINE_PBRIDGE 0x0100
1992#define PCI_VENDOR_ID_ENE 0x1524 2000#define PCI_VENDOR_ID_ENE 0x1524
1993#define PCI_DEVICE_ID_ENE_CB712_SD 0x0550 2001#define PCI_DEVICE_ID_ENE_CB712_SD 0x0550
1994#define PCI_DEVICE_ID_ENE_CB712_SD_2 0x0551 2002#define PCI_DEVICE_ID_ENE_CB712_SD_2 0x0551
@@ -2072,6 +2080,9 @@
2072#define PCI_DEVICE_ID_ARECA_1130 0x1130 2080#define PCI_DEVICE_ID_ARECA_1130 0x1130
2073#define PCI_DEVICE_ID_ARECA_1160 0x1160 2081#define PCI_DEVICE_ID_ARECA_1160 0x1160
2074#define PCI_DEVICE_ID_ARECA_1170 0x1170 2082#define PCI_DEVICE_ID_ARECA_1170 0x1170
2083#define PCI_DEVICE_ID_ARECA_1200 0x1200
2084#define PCI_DEVICE_ID_ARECA_1201 0x1201
2085#define PCI_DEVICE_ID_ARECA_1202 0x1202
2075#define PCI_DEVICE_ID_ARECA_1210 0x1210 2086#define PCI_DEVICE_ID_ARECA_1210 0x1210
2076#define PCI_DEVICE_ID_ARECA_1220 0x1220 2087#define PCI_DEVICE_ID_ARECA_1220 0x1220
2077#define PCI_DEVICE_ID_ARECA_1230 0x1230 2088#define PCI_DEVICE_ID_ARECA_1230 0x1230
@@ -2242,6 +2253,7 @@
2242#define PCI_DEVICE_ID_INTEL_82801EB_5 0x24d5 2253#define PCI_DEVICE_ID_INTEL_82801EB_5 0x24d5
2243#define PCI_DEVICE_ID_INTEL_82801EB_6 0x24d6 2254#define PCI_DEVICE_ID_INTEL_82801EB_6 0x24d6
2244#define PCI_DEVICE_ID_INTEL_82801EB_11 0x24db 2255#define PCI_DEVICE_ID_INTEL_82801EB_11 0x24db
2256#define PCI_DEVICE_ID_INTEL_82801EB_12 0x24dc
2245#define PCI_DEVICE_ID_INTEL_82801EB_13 0x24dd 2257#define PCI_DEVICE_ID_INTEL_82801EB_13 0x24dd
2246#define PCI_DEVICE_ID_INTEL_ESB_1 0x25a1 2258#define PCI_DEVICE_ID_INTEL_ESB_1 0x25a1
2247#define PCI_DEVICE_ID_INTEL_ESB_2 0x25a2 2259#define PCI_DEVICE_ID_INTEL_ESB_2 0x25a2
@@ -2314,6 +2326,8 @@
2314#define PCI_DEVICE_ID_INTEL_MCH_PC 0x3599 2326#define PCI_DEVICE_ID_INTEL_MCH_PC 0x3599
2315#define PCI_DEVICE_ID_INTEL_MCH_PC1 0x359a 2327#define PCI_DEVICE_ID_INTEL_MCH_PC1 0x359a
2316#define PCI_DEVICE_ID_INTEL_E7525_MCH 0x359e 2328#define PCI_DEVICE_ID_INTEL_E7525_MCH 0x359e
2329#define PCI_DEVICE_ID_INTEL_IOAT_CNB 0x360b
2330#define PCI_DEVICE_ID_INTEL_IOAT_SCNB 0x65ff
2317#define PCI_DEVICE_ID_INTEL_TOLAPAI_0 0x5031 2331#define PCI_DEVICE_ID_INTEL_TOLAPAI_0 0x5031
2318#define PCI_DEVICE_ID_INTEL_TOLAPAI_1 0x5032 2332#define PCI_DEVICE_ID_INTEL_TOLAPAI_1 0x5032
2319#define PCI_DEVICE_ID_INTEL_82371SB_0 0x7000 2333#define PCI_DEVICE_ID_INTEL_82371SB_0 0x7000
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h
index 423d592c55d5..c1914a8b94a9 100644
--- a/include/linux/pci_regs.h
+++ b/include/linux/pci_regs.h
@@ -147,7 +147,7 @@
147#define PCI_BRIDGE_CONTROL 0x3e 147#define PCI_BRIDGE_CONTROL 0x3e
148#define PCI_BRIDGE_CTL_PARITY 0x01 /* Enable parity detection on secondary interface */ 148#define PCI_BRIDGE_CTL_PARITY 0x01 /* Enable parity detection on secondary interface */
149#define PCI_BRIDGE_CTL_SERR 0x02 /* The same for SERR forwarding */ 149#define PCI_BRIDGE_CTL_SERR 0x02 /* The same for SERR forwarding */
150#define PCI_BRIDGE_CTL_NO_ISA 0x04 /* Disable bridging of ISA ports */ 150#define PCI_BRIDGE_CTL_ISA 0x04 /* Enable ISA mode */
151#define PCI_BRIDGE_CTL_VGA 0x08 /* Forward VGA addresses */ 151#define PCI_BRIDGE_CTL_VGA 0x08 /* Forward VGA addresses */
152#define PCI_BRIDGE_CTL_MASTER_ABORT 0x20 /* Report master aborts */ 152#define PCI_BRIDGE_CTL_MASTER_ABORT 0x20 /* Report master aborts */
153#define PCI_BRIDGE_CTL_BUS_RESET 0x40 /* Secondary bus reset */ 153#define PCI_BRIDGE_CTL_BUS_RESET 0x40 /* Secondary bus reset */
@@ -202,8 +202,12 @@
202#define PCI_CAP_ID_CHSWP 0x06 /* CompactPCI HotSwap */ 202#define PCI_CAP_ID_CHSWP 0x06 /* CompactPCI HotSwap */
203#define PCI_CAP_ID_PCIX 0x07 /* PCI-X */ 203#define PCI_CAP_ID_PCIX 0x07 /* PCI-X */
204#define PCI_CAP_ID_HT 0x08 /* HyperTransport */ 204#define PCI_CAP_ID_HT 0x08 /* HyperTransport */
205#define PCI_CAP_ID_VNDR 0x09 /* Vendor specific capability */ 205#define PCI_CAP_ID_VNDR 0x09 /* Vendor specific */
206#define PCI_CAP_ID_DBG 0x0A /* Debug port */
207#define PCI_CAP_ID_CCRC 0x0B /* CompactPCI Central Resource Control */
206#define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */ 208#define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */
209#define PCI_CAP_ID_SSVID 0x0D /* Bridge subsystem vendor/device ID */
210#define PCI_CAP_ID_AGP3 0x0E /* AGP Target PCI-PCI bridge */
207#define PCI_CAP_ID_EXP 0x10 /* PCI Express */ 211#define PCI_CAP_ID_EXP 0x10 /* PCI Express */
208#define PCI_CAP_ID_MSIX 0x11 /* MSI-X */ 212#define PCI_CAP_ID_MSIX 0x11 /* MSI-X */
209#define PCI_CAP_LIST_NEXT 1 /* Next capability in the list */ 213#define PCI_CAP_LIST_NEXT 1 /* Next capability in the list */
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 8bbd459eafdc..e80804316cdb 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -15,7 +15,7 @@
15 15
16struct platform_device { 16struct platform_device {
17 const char * name; 17 const char * name;
18 u32 id; 18 int id;
19 struct device dev; 19 struct device dev;
20 u32 num_resources; 20 u32 num_resources;
21 struct resource * resource; 21 struct resource * resource;
@@ -35,9 +35,10 @@ extern struct resource *platform_get_resource_byname(struct platform_device *, u
35extern int platform_get_irq_byname(struct platform_device *, char *); 35extern int platform_get_irq_byname(struct platform_device *, char *);
36extern int platform_add_devices(struct platform_device **, int); 36extern int platform_add_devices(struct platform_device **, int);
37 37
38extern struct platform_device *platform_device_register_simple(char *, unsigned int, struct resource *, unsigned int); 38extern struct platform_device *platform_device_register_simple(char *, int id,
39 struct resource *, unsigned int);
39 40
40extern struct platform_device *platform_device_alloc(const char *name, unsigned int id); 41extern struct platform_device *platform_device_alloc(const char *name, int id);
41extern int platform_device_add_resources(struct platform_device *pdev, struct resource *res, unsigned int num); 42extern int platform_device_add_resources(struct platform_device *pdev, struct resource *res, unsigned int num);
42extern int platform_device_add_data(struct platform_device *pdev, const void *data, size_t size); 43extern int platform_device_add_data(struct platform_device *pdev, const void *data, size_t size);
43extern int platform_device_add(struct platform_device *pdev); 44extern int platform_device_add(struct platform_device *pdev);
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h
index f9e77d2ee320..b6116b4445c7 100644
--- a/include/linux/radix-tree.h
+++ b/include/linux/radix-tree.h
@@ -26,28 +26,31 @@
26#include <linux/rcupdate.h> 26#include <linux/rcupdate.h>
27 27
28/* 28/*
29 * A direct pointer (root->rnode pointing directly to a data item, 29 * An indirect pointer (root->rnode pointing to a radix_tree_node, rather
30 * rather than another radix_tree_node) is signalled by the low bit 30 * than a data item) is signalled by the low bit set in the root->rnode
31 * set in the root->rnode pointer. 31 * pointer.
32 * 32 *
33 * In this case root->height is also NULL, but the direct pointer tests are 33 * In this case root->height is > 0, but the indirect pointer tests are
34 * needed for RCU lookups when root->height is unreliable. 34 * needed for RCU lookups (because root->height is unreliable). The only
35 * time callers need worry about this is when doing a lookup_slot under
36 * RCU.
35 */ 37 */
36#define RADIX_TREE_DIRECT_PTR 1 38#define RADIX_TREE_INDIRECT_PTR 1
39#define RADIX_TREE_RETRY ((void *)-1UL)
37 40
38static inline void *radix_tree_ptr_to_direct(void *ptr) 41static inline void *radix_tree_ptr_to_indirect(void *ptr)
39{ 42{
40 return (void *)((unsigned long)ptr | RADIX_TREE_DIRECT_PTR); 43 return (void *)((unsigned long)ptr | RADIX_TREE_INDIRECT_PTR);
41} 44}
42 45
43static inline void *radix_tree_direct_to_ptr(void *ptr) 46static inline void *radix_tree_indirect_to_ptr(void *ptr)
44{ 47{
45 return (void *)((unsigned long)ptr & ~RADIX_TREE_DIRECT_PTR); 48 return (void *)((unsigned long)ptr & ~RADIX_TREE_INDIRECT_PTR);
46} 49}
47 50
48static inline int radix_tree_is_direct_ptr(void *ptr) 51static inline int radix_tree_is_indirect_ptr(void *ptr)
49{ 52{
50 return (int)((unsigned long)ptr & RADIX_TREE_DIRECT_PTR); 53 return (int)((unsigned long)ptr & RADIX_TREE_INDIRECT_PTR);
51} 54}
52 55
53/*** radix-tree API starts here ***/ 56/*** radix-tree API starts here ***/
@@ -130,7 +133,10 @@ do { \
130 */ 133 */
131static inline void *radix_tree_deref_slot(void **pslot) 134static inline void *radix_tree_deref_slot(void **pslot)
132{ 135{
133 return radix_tree_direct_to_ptr(*pslot); 136 void *ret = *pslot;
137 if (unlikely(radix_tree_is_indirect_ptr(ret)))
138 ret = RADIX_TREE_RETRY;
139 return ret;
134} 140}
135/** 141/**
136 * radix_tree_replace_slot - replace item in a slot 142 * radix_tree_replace_slot - replace item in a slot
@@ -142,10 +148,8 @@ static inline void *radix_tree_deref_slot(void **pslot)
142 */ 148 */
143static inline void radix_tree_replace_slot(void **pslot, void *item) 149static inline void radix_tree_replace_slot(void **pslot, void *item)
144{ 150{
145 BUG_ON(radix_tree_is_direct_ptr(item)); 151 BUG_ON(radix_tree_is_indirect_ptr(item));
146 rcu_assign_pointer(*pslot, 152 rcu_assign_pointer(*pslot, item);
147 (void *)((unsigned long)item |
148 ((unsigned long)*pslot & RADIX_TREE_DIRECT_PTR)));
149} 153}
150 154
151int radix_tree_insert(struct radix_tree_root *, unsigned long, void *); 155int radix_tree_insert(struct radix_tree_root *, unsigned long, void *);
@@ -155,6 +159,8 @@ void *radix_tree_delete(struct radix_tree_root *, unsigned long);
155unsigned int 159unsigned int
156radix_tree_gang_lookup(struct radix_tree_root *root, void **results, 160radix_tree_gang_lookup(struct radix_tree_root *root, void **results,
157 unsigned long first_index, unsigned int max_items); 161 unsigned long first_index, unsigned int max_items);
162unsigned long radix_tree_next_hole(struct radix_tree_root *root,
163 unsigned long index, unsigned long max_scan);
158int radix_tree_preload(gfp_t gfp_mask); 164int radix_tree_preload(gfp_t gfp_mask);
159void radix_tree_init(void); 165void radix_tree_init(void);
160void *radix_tree_tag_set(struct radix_tree_root *root, 166void *radix_tree_tag_set(struct radix_tree_root *root,
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index fe17d7d750c2..76c1a530edc5 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -41,6 +41,7 @@
41#include <linux/percpu.h> 41#include <linux/percpu.h>
42#include <linux/cpumask.h> 42#include <linux/cpumask.h>
43#include <linux/seqlock.h> 43#include <linux/seqlock.h>
44#include <linux/lockdep.h>
44 45
45/** 46/**
46 * struct rcu_head - callback structure for use with RCU 47 * struct rcu_head - callback structure for use with RCU
@@ -133,6 +134,15 @@ static inline void rcu_bh_qsctr_inc(int cpu)
133extern int rcu_pending(int cpu); 134extern int rcu_pending(int cpu);
134extern int rcu_needs_cpu(int cpu); 135extern int rcu_needs_cpu(int cpu);
135 136
137#ifdef CONFIG_DEBUG_LOCK_ALLOC
138extern struct lockdep_map rcu_lock_map;
139# define rcu_read_acquire() lock_acquire(&rcu_lock_map, 0, 0, 2, 1, _THIS_IP_)
140# define rcu_read_release() lock_release(&rcu_lock_map, 1, _THIS_IP_)
141#else
142# define rcu_read_acquire() do { } while (0)
143# define rcu_read_release() do { } while (0)
144#endif
145
136/** 146/**
137 * rcu_read_lock - mark the beginning of an RCU read-side critical section. 147 * rcu_read_lock - mark the beginning of an RCU read-side critical section.
138 * 148 *
@@ -166,6 +176,7 @@ extern int rcu_needs_cpu(int cpu);
166 do { \ 176 do { \
167 preempt_disable(); \ 177 preempt_disable(); \
168 __acquire(RCU); \ 178 __acquire(RCU); \
179 rcu_read_acquire(); \
169 } while(0) 180 } while(0)
170 181
171/** 182/**
@@ -175,6 +186,7 @@ extern int rcu_needs_cpu(int cpu);
175 */ 186 */
176#define rcu_read_unlock() \ 187#define rcu_read_unlock() \
177 do { \ 188 do { \
189 rcu_read_release(); \
178 __release(RCU); \ 190 __release(RCU); \
179 preempt_enable(); \ 191 preempt_enable(); \
180 } while(0) 192 } while(0)
@@ -204,6 +216,7 @@ extern int rcu_needs_cpu(int cpu);
204 do { \ 216 do { \
205 local_bh_disable(); \ 217 local_bh_disable(); \
206 __acquire(RCU_BH); \ 218 __acquire(RCU_BH); \
219 rcu_read_acquire(); \
207 } while(0) 220 } while(0)
208 221
209/* 222/*
@@ -213,6 +226,7 @@ extern int rcu_needs_cpu(int cpu);
213 */ 226 */
214#define rcu_read_unlock_bh() \ 227#define rcu_read_unlock_bh() \
215 do { \ 228 do { \
229 rcu_read_release(); \
216 __release(RCU_BH); \ 230 __release(RCU_BH); \
217 local_bh_enable(); \ 231 local_bh_enable(); \
218 } while(0) 232 } while(0)
diff --git a/include/linux/reiserfs_fs_sb.h b/include/linux/reiserfs_fs_sb.h
index 1e5488ede037..ff9e9234f8ba 100644
--- a/include/linux/reiserfs_fs_sb.h
+++ b/include/linux/reiserfs_fs_sb.h
@@ -120,7 +120,7 @@ struct reiserfs_journal_cnode {
120 struct buffer_head *bh; /* real buffer head */ 120 struct buffer_head *bh; /* real buffer head */
121 struct super_block *sb; /* dev of real buffer head */ 121 struct super_block *sb; /* dev of real buffer head */
122 __u32 blocknr; /* block number of real buffer head, == 0 when buffer on disk */ 122 __u32 blocknr; /* block number of real buffer head, == 0 when buffer on disk */
123 long state; 123 unsigned long state;
124 struct reiserfs_journal_list *jlist; /* journal list this cnode lives in */ 124 struct reiserfs_journal_list *jlist; /* journal list this cnode lives in */
125 struct reiserfs_journal_cnode *next; /* next in transaction list */ 125 struct reiserfs_journal_cnode *next; /* next in transaction list */
126 struct reiserfs_journal_cnode *prev; /* prev in transaction list */ 126 struct reiserfs_journal_cnode *prev; /* prev in transaction list */
@@ -181,7 +181,7 @@ struct reiserfs_journal {
181 struct block_device *j_dev_bd; 181 struct block_device *j_dev_bd;
182 int j_1st_reserved_block; /* first block on s_dev of reserved area journal */ 182 int j_1st_reserved_block; /* first block on s_dev of reserved area journal */
183 183
184 long j_state; 184 unsigned long j_state;
185 unsigned long j_trans_id; 185 unsigned long j_trans_id;
186 unsigned long j_mount_id; 186 unsigned long j_mount_id;
187 unsigned long j_start; /* start of current waiting commit (index into j_ap_blocks) */ 187 unsigned long j_start; /* start of current waiting commit (index into j_ap_blocks) */
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index 4efbd9c445f5..2dc7464cce52 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -20,4 +20,88 @@ static inline void sg_init_one(struct scatterlist *sg, const void *buf,
20 sg_set_buf(sg, buf, buflen); 20 sg_set_buf(sg, buf, buflen);
21} 21}
22 22
23/*
24 * We overload the LSB of the page pointer to indicate whether it's
25 * a valid sg entry, or whether it points to the start of a new scatterlist.
26 * Those low bits are there for everyone! (thanks mason :-)
27 */
28#define sg_is_chain(sg) ((unsigned long) (sg)->page & 0x01)
29#define sg_chain_ptr(sg) \
30 ((struct scatterlist *) ((unsigned long) (sg)->page & ~0x01))
31
32/**
33 * sg_next - return the next scatterlist entry in a list
34 * @sg: The current sg entry
35 *
36 * Usually the next entry will be @sg@ + 1, but if this sg element is part
37 * of a chained scatterlist, it could jump to the start of a new
38 * scatterlist array.
39 *
40 * Note that the caller must ensure that there are further entries after
41 * the current entry, this function will NOT return NULL for an end-of-list.
42 *
43 */
44static inline struct scatterlist *sg_next(struct scatterlist *sg)
45{
46 sg++;
47
48 if (unlikely(sg_is_chain(sg)))
49 sg = sg_chain_ptr(sg);
50
51 return sg;
52}
53
54/*
55 * Loop over each sg element, following the pointer to a new list if necessary
56 */
57#define for_each_sg(sglist, sg, nr, __i) \
58 for (__i = 0, sg = (sglist); __i < (nr); __i++, sg = sg_next(sg))
59
60/**
61 * sg_last - return the last scatterlist entry in a list
62 * @sgl: First entry in the scatterlist
63 * @nents: Number of entries in the scatterlist
64 *
65 * Should only be used casually, it (currently) scan the entire list
66 * to get the last entry.
67 *
68 * Note that the @sgl@ pointer passed in need not be the first one,
69 * the important bit is that @nents@ denotes the number of entries that
70 * exist from @sgl@.
71 *
72 */
73static inline struct scatterlist *sg_last(struct scatterlist *sgl,
74 unsigned int nents)
75{
76#ifndef ARCH_HAS_SG_CHAIN
77 struct scatterlist *ret = &sgl[nents - 1];
78#else
79 struct scatterlist *sg, *ret = NULL;
80 int i;
81
82 for_each_sg(sgl, sg, nents, i)
83 ret = sg;
84
85#endif
86 return ret;
87}
88
89/**
90 * sg_chain - Chain two sglists together
91 * @prv: First scatterlist
92 * @prv_nents: Number of entries in prv
93 * @sgl: Second scatterlist
94 *
95 * Links @prv@ and @sgl@ together, to form a longer scatterlist.
96 *
97 */
98static inline void sg_chain(struct scatterlist *prv, unsigned int prv_nents,
99 struct scatterlist *sgl)
100{
101#ifndef ARCH_HAS_SG_CHAIN
102 BUG();
103#endif
104 prv[prv_nents - 1].page = (struct page *) ((unsigned long) sgl | 0x01);
105}
106
23#endif /* _LINUX_SCATTERLIST_H */ 107#endif /* _LINUX_SCATTERLIST_H */
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 833f7dc2b8de..592e3a55f818 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1,8 +1,6 @@
1#ifndef _LINUX_SCHED_H 1#ifndef _LINUX_SCHED_H
2#define _LINUX_SCHED_H 2#define _LINUX_SCHED_H
3 3
4#include <linux/auxvec.h> /* For AT_VECTOR_SIZE */
5
6/* 4/*
7 * cloning flags: 5 * cloning flags:
8 */ 6 */
@@ -58,12 +56,12 @@ struct sched_param {
58#include <linux/cpumask.h> 56#include <linux/cpumask.h>
59#include <linux/errno.h> 57#include <linux/errno.h>
60#include <linux/nodemask.h> 58#include <linux/nodemask.h>
59#include <linux/mm_types.h>
61 60
62#include <asm/system.h> 61#include <asm/system.h>
63#include <asm/semaphore.h> 62#include <asm/semaphore.h>
64#include <asm/page.h> 63#include <asm/page.h>
65#include <asm/ptrace.h> 64#include <asm/ptrace.h>
66#include <asm/mmu.h>
67#include <asm/cputime.h> 65#include <asm/cputime.h>
68 66
69#include <linux/smp.h> 67#include <linux/smp.h>
@@ -87,6 +85,7 @@ struct sched_param {
87#include <linux/timer.h> 85#include <linux/timer.h>
88#include <linux/hrtimer.h> 86#include <linux/hrtimer.h>
89#include <linux/task_io_accounting.h> 87#include <linux/task_io_accounting.h>
88#include <linux/kobject.h>
90 89
91#include <asm/processor.h> 90#include <asm/processor.h>
92 91
@@ -136,6 +135,7 @@ extern unsigned long weighted_cpuload(const int cpu);
136 135
137struct seq_file; 136struct seq_file;
138struct cfs_rq; 137struct cfs_rq;
138struct task_group;
139#ifdef CONFIG_SCHED_DEBUG 139#ifdef CONFIG_SCHED_DEBUG
140extern void proc_sched_show_task(struct task_struct *p, struct seq_file *m); 140extern void proc_sched_show_task(struct task_struct *p, struct seq_file *m);
141extern void proc_sched_set_task(struct task_struct *p); 141extern void proc_sched_set_task(struct task_struct *p);
@@ -174,8 +174,7 @@ print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
174#define EXIT_ZOMBIE 16 174#define EXIT_ZOMBIE 16
175#define EXIT_DEAD 32 175#define EXIT_DEAD 32
176/* in tsk->state again */ 176/* in tsk->state again */
177#define TASK_NONINTERACTIVE 64 177#define TASK_DEAD 64
178#define TASK_DEAD 128
179 178
180#define __set_task_state(tsk, state_value) \ 179#define __set_task_state(tsk, state_value) \
181 do { (tsk)->state = (state_value); } while (0) 180 do { (tsk)->state = (state_value); } while (0)
@@ -318,7 +317,6 @@ extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long);
318#define add_mm_counter(mm, member, value) atomic_long_add(value, &(mm)->_##member) 317#define add_mm_counter(mm, member, value) atomic_long_add(value, &(mm)->_##member)
319#define inc_mm_counter(mm, member) atomic_long_inc(&(mm)->_##member) 318#define inc_mm_counter(mm, member) atomic_long_inc(&(mm)->_##member)
320#define dec_mm_counter(mm, member) atomic_long_dec(&(mm)->_##member) 319#define dec_mm_counter(mm, member) atomic_long_dec(&(mm)->_##member)
321typedef atomic_long_t mm_counter_t;
322 320
323#else /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */ 321#else /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */
324/* 322/*
@@ -330,7 +328,6 @@ typedef atomic_long_t mm_counter_t;
330#define add_mm_counter(mm, member, value) (mm)->_##member += (value) 328#define add_mm_counter(mm, member, value) (mm)->_##member += (value)
331#define inc_mm_counter(mm, member) (mm)->_##member++ 329#define inc_mm_counter(mm, member) (mm)->_##member++
332#define dec_mm_counter(mm, member) (mm)->_##member-- 330#define dec_mm_counter(mm, member) (mm)->_##member--
333typedef unsigned long mm_counter_t;
334 331
335#endif /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */ 332#endif /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */
336 333
@@ -367,74 +364,6 @@ extern int get_dumpable(struct mm_struct *mm);
367#define MMF_DUMP_FILTER_DEFAULT \ 364#define MMF_DUMP_FILTER_DEFAULT \
368 ((1 << MMF_DUMP_ANON_PRIVATE) | (1 << MMF_DUMP_ANON_SHARED)) 365 ((1 << MMF_DUMP_ANON_PRIVATE) | (1 << MMF_DUMP_ANON_SHARED))
369 366
370struct mm_struct {
371 struct vm_area_struct * mmap; /* list of VMAs */
372 struct rb_root mm_rb;
373 struct vm_area_struct * mmap_cache; /* last find_vma result */
374 unsigned long (*get_unmapped_area) (struct file *filp,
375 unsigned long addr, unsigned long len,
376 unsigned long pgoff, unsigned long flags);
377 void (*unmap_area) (struct mm_struct *mm, unsigned long addr);
378 unsigned long mmap_base; /* base of mmap area */
379 unsigned long task_size; /* size of task vm space */
380 unsigned long cached_hole_size; /* if non-zero, the largest hole below free_area_cache */
381 unsigned long free_area_cache; /* first hole of size cached_hole_size or larger */
382 pgd_t * pgd;
383 atomic_t mm_users; /* How many users with user space? */
384 atomic_t mm_count; /* How many references to "struct mm_struct" (users count as 1) */
385 int map_count; /* number of VMAs */
386 struct rw_semaphore mmap_sem;
387 spinlock_t page_table_lock; /* Protects page tables and some counters */
388
389 struct list_head mmlist; /* List of maybe swapped mm's. These are globally strung
390 * together off init_mm.mmlist, and are protected
391 * by mmlist_lock
392 */
393
394 /* Special counters, in some configurations protected by the
395 * page_table_lock, in other configurations by being atomic.
396 */
397 mm_counter_t _file_rss;
398 mm_counter_t _anon_rss;
399
400 unsigned long hiwater_rss; /* High-watermark of RSS usage */
401 unsigned long hiwater_vm; /* High-water virtual memory usage */
402
403 unsigned long total_vm, locked_vm, shared_vm, exec_vm;
404 unsigned long stack_vm, reserved_vm, def_flags, nr_ptes;
405 unsigned long start_code, end_code, start_data, end_data;
406 unsigned long start_brk, brk, start_stack;
407 unsigned long arg_start, arg_end, env_start, env_end;
408
409 unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */
410
411 cpumask_t cpu_vm_mask;
412
413 /* Architecture-specific MM context */
414 mm_context_t context;
415
416 /* Swap token stuff */
417 /*
418 * Last value of global fault stamp as seen by this process.
419 * In other words, this value gives an indication of how long
420 * it has been since this task got the token.
421 * Look at mm/thrash.c
422 */
423 unsigned int faultstamp;
424 unsigned int token_priority;
425 unsigned int last_interval;
426
427 unsigned long flags; /* Must use atomic bitops to access the bits */
428
429 /* coredumping support */
430 int core_waiters;
431 struct completion *core_startup_done, core_done;
432
433 /* aio bits */
434 rwlock_t ioctx_list_lock;
435 struct kioctx *ioctx_list;
436};
437
438struct sighand_struct { 367struct sighand_struct {
439 atomic_t count; 368 atomic_t count;
440 struct k_sigaction action[_NSIG]; 369 struct k_sigaction action[_NSIG];
@@ -516,6 +445,8 @@ struct signal_struct {
516 * in __exit_signal, except for the group leader. 445 * in __exit_signal, except for the group leader.
517 */ 446 */
518 cputime_t utime, stime, cutime, cstime; 447 cputime_t utime, stime, cutime, cstime;
448 cputime_t gtime;
449 cputime_t cgtime;
519 unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; 450 unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw;
520 unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt; 451 unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt;
521 unsigned long inblock, oublock, cinblock, coublock; 452 unsigned long inblock, oublock, cinblock, coublock;
@@ -596,8 +527,21 @@ struct user_struct {
596 /* Hash table maintenance information */ 527 /* Hash table maintenance information */
597 struct hlist_node uidhash_node; 528 struct hlist_node uidhash_node;
598 uid_t uid; 529 uid_t uid;
530
531#ifdef CONFIG_FAIR_USER_SCHED
532 struct task_group *tg;
533 struct kset kset;
534 struct subsys_attribute user_attr;
535 struct work_struct work;
536#endif
599}; 537};
600 538
539#ifdef CONFIG_FAIR_USER_SCHED
540extern int uids_kobject_init(void);
541#else
542static inline int uids_kobject_init(void) { return 0; }
543#endif
544
601extern struct user_struct *find_user(uid_t); 545extern struct user_struct *find_user(uid_t);
602 546
603extern struct user_struct root_user; 547extern struct user_struct root_user;
@@ -609,13 +553,17 @@ struct reclaim_state;
609#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) 553#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT)
610struct sched_info { 554struct sched_info {
611 /* cumulative counters */ 555 /* cumulative counters */
612 unsigned long pcnt; /* # of times run on this cpu */ 556 unsigned long pcount; /* # of times run on this cpu */
613 unsigned long long cpu_time, /* time spent on the cpu */ 557 unsigned long long cpu_time, /* time spent on the cpu */
614 run_delay; /* time spent waiting on a runqueue */ 558 run_delay; /* time spent waiting on a runqueue */
615 559
616 /* timestamps */ 560 /* timestamps */
617 unsigned long long last_arrival,/* when we last ran on a cpu */ 561 unsigned long long last_arrival,/* when we last ran on a cpu */
618 last_queued; /* when we were last queued to run */ 562 last_queued; /* when we were last queued to run */
563#ifdef CONFIG_SCHEDSTATS
564 /* BKL stats */
565 unsigned long bkl_count;
566#endif
619}; 567};
620#endif /* defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) */ 568#endif /* defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) */
621 569
@@ -750,7 +698,7 @@ struct sched_domain {
750 698
751#ifdef CONFIG_SCHEDSTATS 699#ifdef CONFIG_SCHEDSTATS
752 /* load_balance() stats */ 700 /* load_balance() stats */
753 unsigned long lb_cnt[CPU_MAX_IDLE_TYPES]; 701 unsigned long lb_count[CPU_MAX_IDLE_TYPES];
754 unsigned long lb_failed[CPU_MAX_IDLE_TYPES]; 702 unsigned long lb_failed[CPU_MAX_IDLE_TYPES];
755 unsigned long lb_balanced[CPU_MAX_IDLE_TYPES]; 703 unsigned long lb_balanced[CPU_MAX_IDLE_TYPES];
756 unsigned long lb_imbalance[CPU_MAX_IDLE_TYPES]; 704 unsigned long lb_imbalance[CPU_MAX_IDLE_TYPES];
@@ -760,17 +708,17 @@ struct sched_domain {
760 unsigned long lb_nobusyq[CPU_MAX_IDLE_TYPES]; 708 unsigned long lb_nobusyq[CPU_MAX_IDLE_TYPES];
761 709
762 /* Active load balancing */ 710 /* Active load balancing */
763 unsigned long alb_cnt; 711 unsigned long alb_count;
764 unsigned long alb_failed; 712 unsigned long alb_failed;
765 unsigned long alb_pushed; 713 unsigned long alb_pushed;
766 714
767 /* SD_BALANCE_EXEC stats */ 715 /* SD_BALANCE_EXEC stats */
768 unsigned long sbe_cnt; 716 unsigned long sbe_count;
769 unsigned long sbe_balanced; 717 unsigned long sbe_balanced;
770 unsigned long sbe_pushed; 718 unsigned long sbe_pushed;
771 719
772 /* SD_BALANCE_FORK stats */ 720 /* SD_BALANCE_FORK stats */
773 unsigned long sbf_cnt; 721 unsigned long sbf_count;
774 unsigned long sbf_balanced; 722 unsigned long sbf_balanced;
775 unsigned long sbf_pushed; 723 unsigned long sbf_pushed;
776 724
@@ -781,9 +729,6 @@ struct sched_domain {
781#endif 729#endif
782}; 730};
783 731
784extern int partition_sched_domains(cpumask_t *partition1,
785 cpumask_t *partition2);
786
787#endif /* CONFIG_SMP */ 732#endif /* CONFIG_SMP */
788 733
789/* 734/*
@@ -854,11 +799,11 @@ struct rq;
854struct sched_domain; 799struct sched_domain;
855 800
856struct sched_class { 801struct sched_class {
857 struct sched_class *next; 802 const struct sched_class *next;
858 803
859 void (*enqueue_task) (struct rq *rq, struct task_struct *p, int wakeup); 804 void (*enqueue_task) (struct rq *rq, struct task_struct *p, int wakeup);
860 void (*dequeue_task) (struct rq *rq, struct task_struct *p, int sleep); 805 void (*dequeue_task) (struct rq *rq, struct task_struct *p, int sleep);
861 void (*yield_task) (struct rq *rq, struct task_struct *p); 806 void (*yield_task) (struct rq *rq);
862 807
863 void (*check_preempt_curr) (struct rq *rq, struct task_struct *p); 808 void (*check_preempt_curr) (struct rq *rq, struct task_struct *p);
864 809
@@ -888,31 +833,22 @@ struct load_weight {
888 * 4 se->block_start 833 * 4 se->block_start
889 * 4 se->run_node 834 * 4 se->run_node
890 * 4 se->sleep_start 835 * 4 se->sleep_start
891 * 4 se->sleep_start_fair
892 * 6 se->load.weight 836 * 6 se->load.weight
893 * 7 se->delta_fair
894 * 15 se->wait_runtime
895 */ 837 */
896struct sched_entity { 838struct sched_entity {
897 long wait_runtime;
898 unsigned long delta_fair_run;
899 unsigned long delta_fair_sleep;
900 unsigned long delta_exec;
901 s64 fair_key;
902 struct load_weight load; /* for load-balancing */ 839 struct load_weight load; /* for load-balancing */
903 struct rb_node run_node; 840 struct rb_node run_node;
904 unsigned int on_rq; 841 unsigned int on_rq;
842 int peer_preempt;
905 843
906 u64 exec_start; 844 u64 exec_start;
907 u64 sum_exec_runtime; 845 u64 sum_exec_runtime;
846 u64 vruntime;
908 u64 prev_sum_exec_runtime; 847 u64 prev_sum_exec_runtime;
909 u64 wait_start_fair;
910 u64 sleep_start_fair;
911 848
912#ifdef CONFIG_SCHEDSTATS 849#ifdef CONFIG_SCHEDSTATS
913 u64 wait_start; 850 u64 wait_start;
914 u64 wait_max; 851 u64 wait_max;
915 s64 sum_wait_runtime;
916 852
917 u64 sleep_start; 853 u64 sleep_start;
918 u64 sleep_max; 854 u64 sleep_max;
@@ -921,9 +857,25 @@ struct sched_entity {
921 u64 block_start; 857 u64 block_start;
922 u64 block_max; 858 u64 block_max;
923 u64 exec_max; 859 u64 exec_max;
924 860 u64 slice_max;
925 unsigned long wait_runtime_overruns; 861
926 unsigned long wait_runtime_underruns; 862 u64 nr_migrations;
863 u64 nr_migrations_cold;
864 u64 nr_failed_migrations_affine;
865 u64 nr_failed_migrations_running;
866 u64 nr_failed_migrations_hot;
867 u64 nr_forced_migrations;
868 u64 nr_forced2_migrations;
869
870 u64 nr_wakeups;
871 u64 nr_wakeups_sync;
872 u64 nr_wakeups_migrate;
873 u64 nr_wakeups_local;
874 u64 nr_wakeups_remote;
875 u64 nr_wakeups_affine;
876 u64 nr_wakeups_affine_attempts;
877 u64 nr_wakeups_passive;
878 u64 nr_wakeups_idle;
927#endif 879#endif
928 880
929#ifdef CONFIG_FAIR_GROUP_SCHED 881#ifdef CONFIG_FAIR_GROUP_SCHED
@@ -952,7 +904,7 @@ struct task_struct {
952 904
953 int prio, static_prio, normal_prio; 905 int prio, static_prio, normal_prio;
954 struct list_head run_list; 906 struct list_head run_list;
955 struct sched_class *sched_class; 907 const struct sched_class *sched_class;
956 struct sched_entity se; 908 struct sched_entity se;
957 909
958#ifdef CONFIG_PREEMPT_NOTIFIERS 910#ifdef CONFIG_PREEMPT_NOTIFIERS
@@ -1023,6 +975,7 @@ struct task_struct {
1023 975
1024 unsigned int rt_priority; 976 unsigned int rt_priority;
1025 cputime_t utime, stime; 977 cputime_t utime, stime;
978 cputime_t gtime;
1026 unsigned long nvcsw, nivcsw; /* context switch counts */ 979 unsigned long nvcsw, nivcsw; /* context switch counts */
1027 struct timespec start_time; /* monotonic time */ 980 struct timespec start_time; /* monotonic time */
1028 struct timespec real_start_time; /* boot based time */ 981 struct timespec real_start_time; /* boot based time */
@@ -1314,6 +1267,7 @@ static inline void put_task_struct(struct task_struct *t)
1314#define PF_STARTING 0x00000002 /* being created */ 1267#define PF_STARTING 0x00000002 /* being created */
1315#define PF_EXITING 0x00000004 /* getting shut down */ 1268#define PF_EXITING 0x00000004 /* getting shut down */
1316#define PF_EXITPIDONE 0x00000008 /* pi exit done on shut down */ 1269#define PF_EXITPIDONE 0x00000008 /* pi exit done on shut down */
1270#define PF_VCPU 0x00000010 /* I'm a virtual CPU */
1317#define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */ 1271#define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */
1318#define PF_SUPERPRIV 0x00000100 /* used super-user privileges */ 1272#define PF_SUPERPRIV 0x00000100 /* used super-user privileges */
1319#define PF_DUMPCORE 0x00000200 /* dumped core */ 1273#define PF_DUMPCORE 0x00000200 /* dumped core */
@@ -1401,15 +1355,17 @@ static inline void idle_task_exit(void) {}
1401 1355
1402extern void sched_idle_next(void); 1356extern void sched_idle_next(void);
1403 1357
1358#ifdef CONFIG_SCHED_DEBUG
1404extern unsigned int sysctl_sched_latency; 1359extern unsigned int sysctl_sched_latency;
1405extern unsigned int sysctl_sched_min_granularity; 1360extern unsigned int sysctl_sched_nr_latency;
1406extern unsigned int sysctl_sched_wakeup_granularity; 1361extern unsigned int sysctl_sched_wakeup_granularity;
1407extern unsigned int sysctl_sched_batch_wakeup_granularity; 1362extern unsigned int sysctl_sched_batch_wakeup_granularity;
1408extern unsigned int sysctl_sched_stat_granularity;
1409extern unsigned int sysctl_sched_runtime_limit;
1410extern unsigned int sysctl_sched_compat_yield;
1411extern unsigned int sysctl_sched_child_runs_first; 1363extern unsigned int sysctl_sched_child_runs_first;
1412extern unsigned int sysctl_sched_features; 1364extern unsigned int sysctl_sched_features;
1365extern unsigned int sysctl_sched_migration_cost;
1366#endif
1367
1368extern unsigned int sysctl_sched_compat_yield;
1413 1369
1414#ifdef CONFIG_RT_MUTEXES 1370#ifdef CONFIG_RT_MUTEXES
1415extern int rt_mutex_getprio(struct task_struct *p); 1371extern int rt_mutex_getprio(struct task_struct *p);
@@ -1843,6 +1799,18 @@ extern int sched_mc_power_savings, sched_smt_power_savings;
1843 1799
1844extern void normalize_rt_tasks(void); 1800extern void normalize_rt_tasks(void);
1845 1801
1802#ifdef CONFIG_FAIR_GROUP_SCHED
1803
1804extern struct task_group init_task_group;
1805
1806extern struct task_group *sched_create_group(void);
1807extern void sched_destroy_group(struct task_group *tg);
1808extern void sched_move_task(struct task_struct *tsk);
1809extern int sched_group_set_shares(struct task_group *tg, unsigned long shares);
1810extern unsigned long sched_group_shares(struct task_group *tg);
1811
1812#endif
1813
1846#ifdef CONFIG_TASK_XACCT 1814#ifdef CONFIG_TASK_XACCT
1847static inline void add_rchar(struct task_struct *tsk, ssize_t amt) 1815static inline void add_rchar(struct task_struct *tsk, ssize_t amt)
1848{ 1816{
diff --git a/include/linux/scx200_gpio.h b/include/linux/scx200_gpio.h
index d2b058130eb1..ece4e553e9ac 100644
--- a/include/linux/scx200_gpio.h
+++ b/include/linux/scx200_gpio.h
@@ -1,7 +1,7 @@
1u32 scx200_gpio_configure(unsigned index, u32 set, u32 clear); 1u32 scx200_gpio_configure(unsigned index, u32 set, u32 clear);
2 2
3extern unsigned scx200_gpio_base; 3extern unsigned scx200_gpio_base;
4extern long scx200_gpio_shadow[2]; 4extern unsigned long scx200_gpio_shadow[2];
5extern struct nsc_gpio_ops scx200_gpio_ops; 5extern struct nsc_gpio_ops scx200_gpio_ops;
6 6
7#define scx200_gpio_present() (scx200_gpio_base!=0) 7#define scx200_gpio_present() (scx200_gpio_base!=0)
@@ -9,7 +9,7 @@ extern struct nsc_gpio_ops scx200_gpio_ops;
9/* Definitions to make sure I do the same thing in all functions */ 9/* Definitions to make sure I do the same thing in all functions */
10#define __SCx200_GPIO_BANK unsigned bank = index>>5 10#define __SCx200_GPIO_BANK unsigned bank = index>>5
11#define __SCx200_GPIO_IOADDR unsigned short ioaddr = scx200_gpio_base+0x10*bank 11#define __SCx200_GPIO_IOADDR unsigned short ioaddr = scx200_gpio_base+0x10*bank
12#define __SCx200_GPIO_SHADOW long *shadow = scx200_gpio_shadow+bank 12#define __SCx200_GPIO_SHADOW unsigned long *shadow = scx200_gpio_shadow+bank
13#define __SCx200_GPIO_INDEX index &= 31 13#define __SCx200_GPIO_INDEX index &= 31
14 14
15#define __SCx200_GPIO_OUT __asm__ __volatile__("outsl":"=mS" (shadow):"d" (ioaddr), "0" (shadow)) 15#define __SCx200_GPIO_OUT __asm__ __volatile__("outsl":"=mS" (shadow):"d" (ioaddr), "0" (shadow))
@@ -42,7 +42,7 @@ static inline void scx200_gpio_set_high(unsigned index) {
42 __SCx200_GPIO_IOADDR; 42 __SCx200_GPIO_IOADDR;
43 __SCx200_GPIO_SHADOW; 43 __SCx200_GPIO_SHADOW;
44 __SCx200_GPIO_INDEX; 44 __SCx200_GPIO_INDEX;
45 set_bit(index, shadow); 45 set_bit(index, shadow); /* __set_bit()? */
46 __SCx200_GPIO_OUT; 46 __SCx200_GPIO_OUT;
47} 47}
48 48
@@ -53,7 +53,7 @@ static inline void scx200_gpio_set_low(unsigned index) {
53 __SCx200_GPIO_IOADDR; 53 __SCx200_GPIO_IOADDR;
54 __SCx200_GPIO_SHADOW; 54 __SCx200_GPIO_SHADOW;
55 __SCx200_GPIO_INDEX; 55 __SCx200_GPIO_INDEX;
56 clear_bit(index, shadow); 56 clear_bit(index, shadow); /* __clear_bit()? */
57 __SCx200_GPIO_OUT; 57 __SCx200_GPIO_OUT;
58} 58}
59 59
diff --git a/include/linux/selection.h b/include/linux/selection.h
index f9457861937c..8cdaa1151d2e 100644
--- a/include/linux/selection.h
+++ b/include/linux/selection.h
@@ -13,6 +13,7 @@
13struct tty_struct; 13struct tty_struct;
14 14
15extern struct vc_data *sel_cons; 15extern struct vc_data *sel_cons;
16struct tty_struct;
16 17
17extern void clear_selection(void); 18extern void clear_selection(void);
18extern int set_selection(const struct tiocl_selection __user *sel, struct tty_struct *tty); 19extern int set_selection(const struct tiocl_selection __user *sel, struct tty_struct *tty);
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 09d17b06bf02..4db77249281c 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -291,7 +291,8 @@ struct uart_port {
291 resource_size_t mapbase; /* for ioremap */ 291 resource_size_t mapbase; /* for ioremap */
292 struct device *dev; /* parent device */ 292 struct device *dev; /* parent device */
293 unsigned char hub6; /* this should be in the 8250 driver */ 293 unsigned char hub6; /* this should be in the 8250 driver */
294 unsigned char unused[3]; 294 unsigned char suspended;
295 unsigned char unused[2];
295 void *private_data; /* generic platform data pointer */ 296 void *private_data; /* generic platform data pointer */
296}; 297};
297 298
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index a656cecd373c..f93f22b3d2ff 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -357,6 +357,7 @@ static inline struct sk_buff *alloc_skb_fclone(unsigned int size,
357} 357}
358 358
359extern void kfree_skbmem(struct sk_buff *skb); 359extern void kfree_skbmem(struct sk_buff *skb);
360extern struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src);
360extern struct sk_buff *skb_clone(struct sk_buff *skb, 361extern struct sk_buff *skb_clone(struct sk_buff *skb,
361 gfp_t priority); 362 gfp_t priority);
362extern struct sk_buff *skb_copy(const struct sk_buff *skb, 363extern struct sk_buff *skb_copy(const struct sk_buff *skb,
@@ -1781,6 +1782,11 @@ static inline int skb_is_gso(const struct sk_buff *skb)
1781 return skb_shinfo(skb)->gso_size; 1782 return skb_shinfo(skb)->gso_size;
1782} 1783}
1783 1784
1785static inline int skb_is_gso_v6(const struct sk_buff *skb)
1786{
1787 return skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6;
1788}
1789
1784static inline void skb_forward_csum(struct sk_buff *skb) 1790static inline void skb_forward_csum(struct sk_buff *skb)
1785{ 1791{
1786 /* Unfortunately we don't support this one. Any brave souls? */ 1792 /* Unfortunately we don't support this one. Any brave souls? */
diff --git a/include/linux/slab.h b/include/linux/slab.h
index d859354b9e51..3a5bad3ad126 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -24,12 +24,14 @@
24#define SLAB_HWCACHE_ALIGN 0x00002000UL /* Align objs on cache lines */ 24#define SLAB_HWCACHE_ALIGN 0x00002000UL /* Align objs on cache lines */
25#define SLAB_CACHE_DMA 0x00004000UL /* Use GFP_DMA memory */ 25#define SLAB_CACHE_DMA 0x00004000UL /* Use GFP_DMA memory */
26#define SLAB_STORE_USER 0x00010000UL /* DEBUG: Store the last owner for bug hunting */ 26#define SLAB_STORE_USER 0x00010000UL /* DEBUG: Store the last owner for bug hunting */
27#define SLAB_RECLAIM_ACCOUNT 0x00020000UL /* Objects are reclaimable */
28#define SLAB_PANIC 0x00040000UL /* Panic if kmem_cache_create() fails */ 27#define SLAB_PANIC 0x00040000UL /* Panic if kmem_cache_create() fails */
29#define SLAB_DESTROY_BY_RCU 0x00080000UL /* Defer freeing slabs to RCU */ 28#define SLAB_DESTROY_BY_RCU 0x00080000UL /* Defer freeing slabs to RCU */
30#define SLAB_MEM_SPREAD 0x00100000UL /* Spread some memory over cpuset */ 29#define SLAB_MEM_SPREAD 0x00100000UL /* Spread some memory over cpuset */
31#define SLAB_TRACE 0x00200000UL /* Trace allocations and frees */ 30#define SLAB_TRACE 0x00200000UL /* Trace allocations and frees */
32 31
32/* The following flags affect the page allocator grouping pages by mobility */
33#define SLAB_RECLAIM_ACCOUNT 0x00020000UL /* Objects are reclaimable */
34#define SLAB_TEMPORARY SLAB_RECLAIM_ACCOUNT /* Objects are short-lived */
33/* 35/*
34 * ZERO_SIZE_PTR will be returned for zero sized kmalloc requests. 36 * ZERO_SIZE_PTR will be returned for zero sized kmalloc requests.
35 * 37 *
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index 74962077f632..d65159d1d4f5 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -11,6 +11,14 @@
11#include <linux/workqueue.h> 11#include <linux/workqueue.h>
12#include <linux/kobject.h> 12#include <linux/kobject.h>
13 13
14struct kmem_cache_cpu {
15 void **freelist;
16 struct page *page;
17 int node;
18 unsigned int offset;
19 unsigned int objsize;
20};
21
14struct kmem_cache_node { 22struct kmem_cache_node {
15 spinlock_t list_lock; /* Protect partial list and nr_partial */ 23 spinlock_t list_lock; /* Protect partial list and nr_partial */
16 unsigned long nr_partial; 24 unsigned long nr_partial;
@@ -54,7 +62,11 @@ struct kmem_cache {
54 int defrag_ratio; 62 int defrag_ratio;
55 struct kmem_cache_node *node[MAX_NUMNODES]; 63 struct kmem_cache_node *node[MAX_NUMNODES];
56#endif 64#endif
57 struct page *cpu_slab[NR_CPUS]; 65#ifdef CONFIG_SMP
66 struct kmem_cache_cpu *cpu_slab[NR_CPUS];
67#else
68 struct kmem_cache_cpu cpu_slab;
69#endif
58}; 70};
59 71
60/* 72/*
@@ -72,7 +84,7 @@ struct kmem_cache {
72 * We keep the general caches in an array of slab caches that are used for 84 * We keep the general caches in an array of slab caches that are used for
73 * 2^x bytes of allocations. 85 * 2^x bytes of allocations.
74 */ 86 */
75extern struct kmem_cache kmalloc_caches[KMALLOC_SHIFT_HIGH + 1]; 87extern struct kmem_cache kmalloc_caches[PAGE_SHIFT];
76 88
77/* 89/*
78 * Sorry that the following has to be that ugly but some versions of GCC 90 * Sorry that the following has to be that ugly but some versions of GCC
@@ -83,9 +95,6 @@ static __always_inline int kmalloc_index(size_t size)
83 if (!size) 95 if (!size)
84 return 0; 96 return 0;
85 97
86 if (size > KMALLOC_MAX_SIZE)
87 return -1;
88
89 if (size <= KMALLOC_MIN_SIZE) 98 if (size <= KMALLOC_MIN_SIZE)
90 return KMALLOC_SHIFT_LOW; 99 return KMALLOC_SHIFT_LOW;
91 100
@@ -102,6 +111,10 @@ static __always_inline int kmalloc_index(size_t size)
102 if (size <= 512) return 9; 111 if (size <= 512) return 9;
103 if (size <= 1024) return 10; 112 if (size <= 1024) return 10;
104 if (size <= 2 * 1024) return 11; 113 if (size <= 2 * 1024) return 11;
114/*
115 * The following is only needed to support architectures with a larger page
116 * size than 4k.
117 */
105 if (size <= 4 * 1024) return 12; 118 if (size <= 4 * 1024) return 12;
106 if (size <= 8 * 1024) return 13; 119 if (size <= 8 * 1024) return 13;
107 if (size <= 16 * 1024) return 14; 120 if (size <= 16 * 1024) return 14;
@@ -109,13 +122,9 @@ static __always_inline int kmalloc_index(size_t size)
109 if (size <= 64 * 1024) return 16; 122 if (size <= 64 * 1024) return 16;
110 if (size <= 128 * 1024) return 17; 123 if (size <= 128 * 1024) return 17;
111 if (size <= 256 * 1024) return 18; 124 if (size <= 256 * 1024) return 18;
112 if (size <= 512 * 1024) return 19; 125 if (size <= 512 * 1024) return 19;
113 if (size <= 1024 * 1024) return 20; 126 if (size <= 1024 * 1024) return 20;
114 if (size <= 2 * 1024 * 1024) return 21; 127 if (size <= 2 * 1024 * 1024) return 21;
115 if (size <= 4 * 1024 * 1024) return 22;
116 if (size <= 8 * 1024 * 1024) return 23;
117 if (size <= 16 * 1024 * 1024) return 24;
118 if (size <= 32 * 1024 * 1024) return 25;
119 return -1; 128 return -1;
120 129
121/* 130/*
@@ -140,19 +149,6 @@ static __always_inline struct kmem_cache *kmalloc_slab(size_t size)
140 if (index == 0) 149 if (index == 0)
141 return NULL; 150 return NULL;
142 151
143 /*
144 * This function only gets expanded if __builtin_constant_p(size), so
145 * testing it here shouldn't be needed. But some versions of gcc need
146 * help.
147 */
148 if (__builtin_constant_p(size) && index < 0) {
149 /*
150 * Generate a link failure. Would be great if we could
151 * do something to stop the compile here.
152 */
153 extern void __kmalloc_size_too_large(void);
154 __kmalloc_size_too_large();
155 }
156 return &kmalloc_caches[index]; 152 return &kmalloc_caches[index];
157} 153}
158 154
@@ -168,15 +164,21 @@ void *__kmalloc(size_t size, gfp_t flags);
168 164
169static __always_inline void *kmalloc(size_t size, gfp_t flags) 165static __always_inline void *kmalloc(size_t size, gfp_t flags)
170{ 166{
171 if (__builtin_constant_p(size) && !(flags & SLUB_DMA)) { 167 if (__builtin_constant_p(size)) {
172 struct kmem_cache *s = kmalloc_slab(size); 168 if (size > PAGE_SIZE / 2)
169 return (void *)__get_free_pages(flags | __GFP_COMP,
170 get_order(size));
173 171
174 if (!s) 172 if (!(flags & SLUB_DMA)) {
175 return ZERO_SIZE_PTR; 173 struct kmem_cache *s = kmalloc_slab(size);
176 174
177 return kmem_cache_alloc(s, flags); 175 if (!s)
178 } else 176 return ZERO_SIZE_PTR;
179 return __kmalloc(size, flags); 177
178 return kmem_cache_alloc(s, flags);
179 }
180 }
181 return __kmalloc(size, flags);
180} 182}
181 183
182#ifdef CONFIG_NUMA 184#ifdef CONFIG_NUMA
@@ -185,15 +187,16 @@ void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node);
185 187
186static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node) 188static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node)
187{ 189{
188 if (__builtin_constant_p(size) && !(flags & SLUB_DMA)) { 190 if (__builtin_constant_p(size) &&
189 struct kmem_cache *s = kmalloc_slab(size); 191 size <= PAGE_SIZE / 2 && !(flags & SLUB_DMA)) {
192 struct kmem_cache *s = kmalloc_slab(size);
190 193
191 if (!s) 194 if (!s)
192 return ZERO_SIZE_PTR; 195 return ZERO_SIZE_PTR;
193 196
194 return kmem_cache_alloc_node(s, flags, node); 197 return kmem_cache_alloc_node(s, flags, node);
195 } else 198 }
196 return __kmalloc_node(size, flags, node); 199 return __kmalloc_node(size, flags, node);
197} 200}
198#endif 201#endif
199 202
diff --git a/include/linux/sm501-regs.h b/include/linux/sm501-regs.h
index 014e73b31fc0..df7620dd8f31 100644
--- a/include/linux/sm501-regs.h
+++ b/include/linux/sm501-regs.h
@@ -15,6 +15,24 @@
15 15
16/* config 1 */ 16/* config 1 */
17#define SM501_SYSTEM_CONTROL (0x000000) 17#define SM501_SYSTEM_CONTROL (0x000000)
18
19#define SM501_SYSCTRL_PANEL_TRISTATE (1<<0)
20#define SM501_SYSCTRL_MEM_TRISTATE (1<<1)
21#define SM501_SYSCTRL_CRT_TRISTATE (1<<2)
22
23#define SM501_SYSCTRL_PCI_SLAVE_BURST_MASK (3<<4)
24#define SM501_SYSCTRL_PCI_SLAVE_BURST_1 (0<<4)
25#define SM501_SYSCTRL_PCI_SLAVE_BURST_2 (1<<4)
26#define SM501_SYSCTRL_PCI_SLAVE_BURST_4 (2<<4)
27#define SM501_SYSCTRL_PCI_SLAVE_BURST_8 (3<<4)
28
29#define SM501_SYSCTRL_PCI_CLOCK_RUN_EN (1<<6)
30#define SM501_SYSCTRL_PCI_RETRY_DISABLE (1<<7)
31#define SM501_SYSCTRL_PCI_SUBSYS_LOCK (1<<11)
32#define SM501_SYSCTRL_PCI_BURST_READ_EN (1<<15)
33
34/* miscellaneous control */
35
18#define SM501_MISC_CONTROL (0x000004) 36#define SM501_MISC_CONTROL (0x000004)
19 37
20#define SM501_MISC_BUS_SH (0x0) 38#define SM501_MISC_BUS_SH (0x0)
diff --git a/include/linux/spi/at73c213.h b/include/linux/spi/at73c213.h
new file mode 100644
index 000000000000..0f20a70e5eb4
--- /dev/null
+++ b/include/linux/spi/at73c213.h
@@ -0,0 +1,25 @@
1/*
2 * Board-specific data used to set up AT73c213 audio DAC driver.
3 */
4
5#ifndef __LINUX_SPI_AT73C213_H
6#define __LINUX_SPI_AT73C213_H
7
8/**
9 * at73c213_board_info - how the external DAC is wired to the device.
10 *
11 * @ssc_id: SSC platform_driver id the DAC shall use to stream the audio.
12 * @dac_clk: the external clock used to provide master clock to the DAC.
13 * @shortname: a short discription for the DAC, seen by userspace tools.
14 *
15 * This struct contains the configuration of the hardware connection to the
16 * external DAC. The DAC needs a master clock and a I2S audio stream. It also
17 * provides a name which is used to identify it in userspace tools.
18 */
19struct at73c213_board_info {
20 int ssc_id;
21 struct clk *dac_clk;
22 char shortname[32];
23};
24
25#endif /* __LINUX_SPI_AT73C213_H */
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index 002a3cddbdd5..387e428f1cdf 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -195,7 +195,7 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)
195 195
196/** 196/**
197 * struct spi_master - interface to SPI master controller 197 * struct spi_master - interface to SPI master controller
198 * @cdev: class interface to this driver 198 * @dev: device interface to this driver
199 * @bus_num: board-specific (and often SOC-specific) identifier for a 199 * @bus_num: board-specific (and often SOC-specific) identifier for a
200 * given SPI controller. 200 * given SPI controller.
201 * @num_chipselect: chipselects are used to distinguish individual 201 * @num_chipselect: chipselects are used to distinguish individual
@@ -222,7 +222,7 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)
222 * message's completion function when the transaction completes. 222 * message's completion function when the transaction completes.
223 */ 223 */
224struct spi_master { 224struct spi_master {
225 struct class_device cdev; 225 struct device dev;
226 226
227 /* other than negative (== assign one dynamically), bus_num is fully 227 /* other than negative (== assign one dynamically), bus_num is fully
228 * board-specific. usually that simplifies to being SOC-specific. 228 * board-specific. usually that simplifies to being SOC-specific.
@@ -268,17 +268,17 @@ struct spi_master {
268 268
269static inline void *spi_master_get_devdata(struct spi_master *master) 269static inline void *spi_master_get_devdata(struct spi_master *master)
270{ 270{
271 return class_get_devdata(&master->cdev); 271 return dev_get_drvdata(&master->dev);
272} 272}
273 273
274static inline void spi_master_set_devdata(struct spi_master *master, void *data) 274static inline void spi_master_set_devdata(struct spi_master *master, void *data)
275{ 275{
276 class_set_devdata(&master->cdev, data); 276 dev_set_drvdata(&master->dev, data);
277} 277}
278 278
279static inline struct spi_master *spi_master_get(struct spi_master *master) 279static inline struct spi_master *spi_master_get(struct spi_master *master)
280{ 280{
281 if (!master || !class_device_get(&master->cdev)) 281 if (!master || !get_device(&master->dev))
282 return NULL; 282 return NULL;
283 return master; 283 return master;
284} 284}
@@ -286,7 +286,7 @@ static inline struct spi_master *spi_master_get(struct spi_master *master)
286static inline void spi_master_put(struct spi_master *master) 286static inline void spi_master_put(struct spi_master *master)
287{ 287{
288 if (master) 288 if (master)
289 class_device_put(&master->cdev); 289 put_device(&master->dev);
290} 290}
291 291
292 292
diff --git a/include/linux/stallion.h b/include/linux/stallion.h
index 4a0a329beafb..94b4a10b912f 100644
--- a/include/linux/stallion.h
+++ b/include/linux/stallion.h
@@ -75,7 +75,7 @@ struct stlport {
75 int ioaddr; 75 int ioaddr;
76 int uartaddr; 76 int uartaddr;
77 unsigned int pagenr; 77 unsigned int pagenr;
78 long istate; 78 unsigned long istate;
79 int flags; 79 int flags;
80 int baud_base; 80 int baud_base;
81 int custom_divisor; 81 int custom_divisor;
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h
index 3699dff7db8f..bd7a6b0a87af 100644
--- a/include/linux/sunrpc/cache.h
+++ b/include/linux/sunrpc/cache.h
@@ -136,16 +136,6 @@ sunrpc_cache_update(struct cache_detail *detail,
136 struct cache_head *new, struct cache_head *old, int hash); 136 struct cache_head *new, struct cache_head *old, int hash);
137 137
138 138
139#define cache_for_each(pos, detail, index, member) \
140 for (({read_lock(&(detail)->hash_lock); index = (detail)->hash_size;}) ; \
141 ({if (index==0)read_unlock(&(detail)->hash_lock); index--;}); \
142 ) \
143 for (pos = container_of((detail)->hash_table[index], typeof(*pos), member); \
144 &pos->member; \
145 pos = container_of(pos->member.next, typeof(*pos), member))
146
147
148
149extern void cache_clean_deferred(void *owner); 139extern void cache_clean_deferred(void *owner);
150 140
151static inline struct cache_head *cache_get(struct cache_head *h) 141static inline struct cache_head *cache_get(struct cache_head *h)
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index c0d9d14983b3..d9d5c5ad826c 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -117,7 +117,7 @@ struct rpc_create_args {
117 117
118struct rpc_clnt *rpc_create(struct rpc_create_args *args); 118struct rpc_clnt *rpc_create(struct rpc_create_args *args);
119struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, 119struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *,
120 struct rpc_program *, int); 120 struct rpc_program *, u32);
121struct rpc_clnt *rpc_clone_client(struct rpc_clnt *); 121struct rpc_clnt *rpc_clone_client(struct rpc_clnt *);
122void rpc_shutdown_client(struct rpc_clnt *); 122void rpc_shutdown_client(struct rpc_clnt *);
123void rpc_release_client(struct rpc_clnt *); 123void rpc_release_client(struct rpc_clnt *);
diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h
index 3912cf16361e..3347c72b848a 100644
--- a/include/linux/sunrpc/debug.h
+++ b/include/linux/sunrpc/debug.h
@@ -88,6 +88,11 @@ enum {
88 CTL_SLOTTABLE_TCP, 88 CTL_SLOTTABLE_TCP,
89 CTL_MIN_RESVPORT, 89 CTL_MIN_RESVPORT,
90 CTL_MAX_RESVPORT, 90 CTL_MAX_RESVPORT,
91 CTL_SLOTTABLE_RDMA,
92 CTL_RDMA_MAXINLINEREAD,
93 CTL_RDMA_MAXINLINEWRITE,
94 CTL_RDMA_WRITEPADDING,
95 CTL_RDMA_MEMREG,
91}; 96};
92 97
93#endif /* _LINUX_SUNRPC_DEBUG_H_ */ 98#endif /* _LINUX_SUNRPC_DEBUG_H_ */
diff --git a/include/linux/sunrpc/msg_prot.h b/include/linux/sunrpc/msg_prot.h
index 784d4c3ef651..c4beb5775111 100644
--- a/include/linux/sunrpc/msg_prot.h
+++ b/include/linux/sunrpc/msg_prot.h
@@ -138,6 +138,19 @@ typedef __be32 rpc_fraghdr;
138#define RPC_MAX_HEADER_WITH_AUTH \ 138#define RPC_MAX_HEADER_WITH_AUTH \
139 (RPC_CALLHDRSIZE + 2*(2+RPC_MAX_AUTH_SIZE/4)) 139 (RPC_CALLHDRSIZE + 2*(2+RPC_MAX_AUTH_SIZE/4))
140 140
141/*
142 * RFC1833/RFC3530 rpcbind (v3+) well-known netid's.
143 */
144#define RPCBIND_NETID_UDP "udp"
145#define RPCBIND_NETID_TCP "tcp"
146#define RPCBIND_NETID_UDP6 "udp6"
147#define RPCBIND_NETID_TCP6 "tcp6"
148
149/*
150 * Note that RFC 1833 does not put any size restrictions on the
151 * netid string, but all currently defined netid's fit in 4 bytes.
152 */
153#define RPCBIND_MAXNETIDLEN (4u)
141 154
142#endif /* __KERNEL__ */ 155#endif /* __KERNEL__ */
143#endif /* _LINUX_SUNRPC_MSGPROT_H_ */ 156#endif /* _LINUX_SUNRPC_MSGPROT_H_ */
diff --git a/include/linux/sunrpc/rpc_rdma.h b/include/linux/sunrpc/rpc_rdma.h
new file mode 100644
index 000000000000..0013a0d8dc6b
--- /dev/null
+++ b/include/linux/sunrpc/rpc_rdma.h
@@ -0,0 +1,116 @@
1/*
2 * Copyright (c) 2003-2007 Network Appliance, Inc. All rights reserved.
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the BSD-type
8 * license below:
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 *
14 * Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 *
17 * Redistributions in binary form must reproduce the above
18 * copyright notice, this list of conditions and the following
19 * disclaimer in the documentation and/or other materials provided
20 * with the distribution.
21 *
22 * Neither the name of the Network Appliance, Inc. nor the names of
23 * its contributors may be used to endorse or promote products
24 * derived from this software without specific prior written
25 * permission.
26 *
27 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
30 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
31 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
32 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
33 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
34 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
35 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
36 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
37 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 */
39
40#ifndef _LINUX_SUNRPC_RPC_RDMA_H
41#define _LINUX_SUNRPC_RPC_RDMA_H
42
43struct rpcrdma_segment {
44 uint32_t rs_handle; /* Registered memory handle */
45 uint32_t rs_length; /* Length of the chunk in bytes */
46 uint64_t rs_offset; /* Chunk virtual address or offset */
47};
48
49/*
50 * read chunk(s), encoded as a linked list.
51 */
52struct rpcrdma_read_chunk {
53 uint32_t rc_discrim; /* 1 indicates presence */
54 uint32_t rc_position; /* Position in XDR stream */
55 struct rpcrdma_segment rc_target;
56};
57
58/*
59 * write chunk, and reply chunk.
60 */
61struct rpcrdma_write_chunk {
62 struct rpcrdma_segment wc_target;
63};
64
65/*
66 * write chunk(s), encoded as a counted array.
67 */
68struct rpcrdma_write_array {
69 uint32_t wc_discrim; /* 1 indicates presence */
70 uint32_t wc_nchunks; /* Array count */
71 struct rpcrdma_write_chunk wc_array[0];
72};
73
74struct rpcrdma_msg {
75 uint32_t rm_xid; /* Mirrors the RPC header xid */
76 uint32_t rm_vers; /* Version of this protocol */
77 uint32_t rm_credit; /* Buffers requested/granted */
78 uint32_t rm_type; /* Type of message (enum rpcrdma_proc) */
79 union {
80
81 struct { /* no chunks */
82 uint32_t rm_empty[3]; /* 3 empty chunk lists */
83 } rm_nochunks;
84
85 struct { /* no chunks and padded */
86 uint32_t rm_align; /* Padding alignment */
87 uint32_t rm_thresh; /* Padding threshold */
88 uint32_t rm_pempty[3]; /* 3 empty chunk lists */
89 } rm_padded;
90
91 uint32_t rm_chunks[0]; /* read, write and reply chunks */
92
93 } rm_body;
94};
95
96#define RPCRDMA_HDRLEN_MIN 28
97
98enum rpcrdma_errcode {
99 ERR_VERS = 1,
100 ERR_CHUNK = 2
101};
102
103struct rpcrdma_err_vers {
104 uint32_t rdma_vers_low; /* Version range supported by peer */
105 uint32_t rdma_vers_high;
106};
107
108enum rpcrdma_proc {
109 RDMA_MSG = 0, /* An RPC call or reply msg */
110 RDMA_NOMSG = 1, /* An RPC call or reply msg - separate body */
111 RDMA_MSGP = 2, /* An RPC call or reply msg with padding */
112 RDMA_DONE = 3, /* Client signals reply completion */
113 RDMA_ERROR = 4 /* An RPC RDMA encoding error */
114};
115
116#endif /* _LINUX_SUNRPC_RPC_RDMA_H */
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h
index c6b53d181bfa..0751c9464d0f 100644
--- a/include/linux/sunrpc/xdr.h
+++ b/include/linux/sunrpc/xdr.h
@@ -70,7 +70,10 @@ struct xdr_buf {
70 70
71 struct page ** pages; /* Array of contiguous pages */ 71 struct page ** pages; /* Array of contiguous pages */
72 unsigned int page_base, /* Start of page data */ 72 unsigned int page_base, /* Start of page data */
73 page_len; /* Length of page data */ 73 page_len, /* Length of page data */
74 flags; /* Flags for data disposition */
75#define XDRBUF_READ 0x01 /* target of file read */
76#define XDRBUF_WRITE 0x02 /* source of file write */
74 77
75 unsigned int buflen, /* Total length of storage buffer */ 78 unsigned int buflen, /* Total length of storage buffer */
76 len; /* Length of XDR encoded message */ 79 len; /* Length of XDR encoded message */
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index d11cedd14f0f..30b17b3bc1a9 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -19,25 +19,11 @@
19 19
20#ifdef __KERNEL__ 20#ifdef __KERNEL__
21 21
22extern unsigned int xprt_udp_slot_table_entries;
23extern unsigned int xprt_tcp_slot_table_entries;
24
25#define RPC_MIN_SLOT_TABLE (2U) 22#define RPC_MIN_SLOT_TABLE (2U)
26#define RPC_DEF_SLOT_TABLE (16U) 23#define RPC_DEF_SLOT_TABLE (16U)
27#define RPC_MAX_SLOT_TABLE (128U) 24#define RPC_MAX_SLOT_TABLE (128U)
28 25
29/* 26/*
30 * Parameters for choosing a free port
31 */
32extern unsigned int xprt_min_resvport;
33extern unsigned int xprt_max_resvport;
34
35#define RPC_MIN_RESVPORT (1U)
36#define RPC_MAX_RESVPORT (65535U)
37#define RPC_DEF_MIN_RESVPORT (665U)
38#define RPC_DEF_MAX_RESVPORT (1023U)
39
40/*
41 * This describes a timeout strategy 27 * This describes a timeout strategy
42 */ 28 */
43struct rpc_timeout { 29struct rpc_timeout {
@@ -53,6 +39,10 @@ enum rpc_display_format_t {
53 RPC_DISPLAY_PORT, 39 RPC_DISPLAY_PORT,
54 RPC_DISPLAY_PROTO, 40 RPC_DISPLAY_PROTO,
55 RPC_DISPLAY_ALL, 41 RPC_DISPLAY_ALL,
42 RPC_DISPLAY_HEX_ADDR,
43 RPC_DISPLAY_HEX_PORT,
44 RPC_DISPLAY_UNIVERSAL_ADDR,
45 RPC_DISPLAY_NETID,
56 RPC_DISPLAY_MAX, 46 RPC_DISPLAY_MAX,
57}; 47};
58 48
@@ -196,14 +186,22 @@ struct rpc_xprt {
196 char * address_strings[RPC_DISPLAY_MAX]; 186 char * address_strings[RPC_DISPLAY_MAX];
197}; 187};
198 188
199struct rpc_xprtsock_create { 189struct xprt_create {
200 int proto; /* IPPROTO_UDP or IPPROTO_TCP */ 190 int ident; /* XPRT_TRANSPORT identifier */
201 struct sockaddr * srcaddr; /* optional local address */ 191 struct sockaddr * srcaddr; /* optional local address */
202 struct sockaddr * dstaddr; /* remote peer address */ 192 struct sockaddr * dstaddr; /* remote peer address */
203 size_t addrlen; 193 size_t addrlen;
204 struct rpc_timeout * timeout; /* optional timeout parameters */ 194 struct rpc_timeout * timeout; /* optional timeout parameters */
205}; 195};
206 196
197struct xprt_class {
198 struct list_head list;
199 int ident; /* XPRT_TRANSPORT identifier */
200 struct rpc_xprt * (*setup)(struct xprt_create *);
201 struct module *owner;
202 char name[32];
203};
204
207/* 205/*
208 * Transport operations used by ULPs 206 * Transport operations used by ULPs
209 */ 207 */
@@ -212,7 +210,7 @@ void xprt_set_timeout(struct rpc_timeout *to, unsigned int retr, unsigned long
212/* 210/*
213 * Generic internal transport functions 211 * Generic internal transport functions
214 */ 212 */
215struct rpc_xprt * xprt_create_transport(struct rpc_xprtsock_create *args); 213struct rpc_xprt *xprt_create_transport(struct xprt_create *args);
216void xprt_connect(struct rpc_task *task); 214void xprt_connect(struct rpc_task *task);
217void xprt_reserve(struct rpc_task *task); 215void xprt_reserve(struct rpc_task *task);
218int xprt_reserve_xprt(struct rpc_task *task); 216int xprt_reserve_xprt(struct rpc_task *task);
@@ -235,6 +233,8 @@ static inline __be32 *xprt_skip_transport_header(struct rpc_xprt *xprt, __be32 *
235/* 233/*
236 * Transport switch helper functions 234 * Transport switch helper functions
237 */ 235 */
236int xprt_register_transport(struct xprt_class *type);
237int xprt_unregister_transport(struct xprt_class *type);
238void xprt_set_retrans_timeout_def(struct rpc_task *task); 238void xprt_set_retrans_timeout_def(struct rpc_task *task);
239void xprt_set_retrans_timeout_rtt(struct rpc_task *task); 239void xprt_set_retrans_timeout_rtt(struct rpc_task *task);
240void xprt_wake_pending_tasks(struct rpc_xprt *xprt, int status); 240void xprt_wake_pending_tasks(struct rpc_xprt *xprt, int status);
@@ -248,14 +248,6 @@ void xprt_release_rqst_cong(struct rpc_task *task);
248void xprt_disconnect(struct rpc_xprt *xprt); 248void xprt_disconnect(struct rpc_xprt *xprt);
249 249
250/* 250/*
251 * Socket transport setup operations
252 */
253struct rpc_xprt * xs_setup_udp(struct rpc_xprtsock_create *args);
254struct rpc_xprt * xs_setup_tcp(struct rpc_xprtsock_create *args);
255int init_socket_xprt(void);
256void cleanup_socket_xprt(void);
257
258/*
259 * Reserved bit positions in xprt->state 251 * Reserved bit positions in xprt->state
260 */ 252 */
261#define XPRT_LOCKED (0) 253#define XPRT_LOCKED (0)
diff --git a/include/linux/sunrpc/xprtrdma.h b/include/linux/sunrpc/xprtrdma.h
new file mode 100644
index 000000000000..4de56b1d372b
--- /dev/null
+++ b/include/linux/sunrpc/xprtrdma.h
@@ -0,0 +1,85 @@
1/*
2 * Copyright (c) 2003-2007 Network Appliance, Inc. All rights reserved.
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the BSD-type
8 * license below:
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 *
14 * Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 *
17 * Redistributions in binary form must reproduce the above
18 * copyright notice, this list of conditions and the following
19 * disclaimer in the documentation and/or other materials provided
20 * with the distribution.
21 *
22 * Neither the name of the Network Appliance, Inc. nor the names of
23 * its contributors may be used to endorse or promote products
24 * derived from this software without specific prior written
25 * permission.
26 *
27 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
30 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
31 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
32 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
33 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
34 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
35 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
36 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
37 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 */
39
40#ifndef _LINUX_SUNRPC_XPRTRDMA_H
41#define _LINUX_SUNRPC_XPRTRDMA_H
42
43/*
44 * RPC transport identifier for RDMA
45 */
46#define XPRT_TRANSPORT_RDMA 256
47
48/*
49 * rpcbind (v3+) RDMA netid.
50 */
51#define RPCBIND_NETID_RDMA "rdma"
52
53/*
54 * Constants. Max RPC/NFS header is big enough to account for
55 * additional marshaling buffers passed down by Linux client.
56 *
57 * RDMA header is currently fixed max size, and is big enough for a
58 * fully-chunked NFS message (read chunks are the largest). Note only
59 * a single chunk type per message is supported currently.
60 */
61#define RPCRDMA_MIN_SLOT_TABLE (2U)
62#define RPCRDMA_DEF_SLOT_TABLE (32U)
63#define RPCRDMA_MAX_SLOT_TABLE (256U)
64
65#define RPCRDMA_DEF_INLINE (1024) /* default inline max */
66
67#define RPCRDMA_INLINE_PAD_THRESH (512)/* payload threshold to pad (bytes) */
68
69#define RDMA_RESOLVE_TIMEOUT (5*HZ) /* TBD 5 seconds */
70#define RDMA_CONNECT_RETRY_MAX (2) /* retries if no listener backlog */
71
72/* memory registration strategies */
73#define RPCRDMA_PERSISTENT_REGISTRATION (1)
74
75enum rpcrdma_memreg {
76 RPCRDMA_BOUNCEBUFFERS = 0,
77 RPCRDMA_REGISTER,
78 RPCRDMA_MEMWINDOWS,
79 RPCRDMA_MEMWINDOWS_ASYNC,
80 RPCRDMA_MTHCAFMR,
81 RPCRDMA_ALLPHYSICAL,
82 RPCRDMA_LAST
83};
84
85#endif /* _LINUX_SUNRPC_XPRTRDMA_H */
diff --git a/include/linux/sunrpc/xprtsock.h b/include/linux/sunrpc/xprtsock.h
new file mode 100644
index 000000000000..2c6c2c2783d8
--- /dev/null
+++ b/include/linux/sunrpc/xprtsock.h
@@ -0,0 +1,51 @@
1/*
2 * linux/include/linux/sunrpc/xprtsock.h
3 *
4 * Declarations for the RPC transport socket provider.
5 */
6
7#ifndef _LINUX_SUNRPC_XPRTSOCK_H
8#define _LINUX_SUNRPC_XPRTSOCK_H
9
10#ifdef __KERNEL__
11
12/*
13 * Socket transport setup operations
14 */
15struct rpc_xprt *xs_setup_udp(struct xprt_create *args);
16struct rpc_xprt *xs_setup_tcp(struct xprt_create *args);
17
18int init_socket_xprt(void);
19void cleanup_socket_xprt(void);
20
21/*
22 * RPC transport identifiers for UDP, TCP
23 *
24 * To preserve compatibility with the historical use of raw IP protocol
25 * id's for transport selection, these are specified with the previous
26 * values. No such restriction exists for new transports, except that
27 * they may not collide with these values (17 and 6, respectively).
28 */
29#define XPRT_TRANSPORT_UDP IPPROTO_UDP
30#define XPRT_TRANSPORT_TCP IPPROTO_TCP
31
32/*
33 * RPC slot table sizes for UDP, TCP transports
34 */
35extern unsigned int xprt_udp_slot_table_entries;
36extern unsigned int xprt_tcp_slot_table_entries;
37
38/*
39 * Parameters for choosing a free port
40 */
41extern unsigned int xprt_min_resvport;
42extern unsigned int xprt_max_resvport;
43
44#define RPC_MIN_RESVPORT (1U)
45#define RPC_MAX_RESVPORT (65535U)
46#define RPC_DEF_MIN_RESVPORT (665U)
47#define RPC_DEF_MAX_RESVPORT (1023U)
48
49#endif /* __KERNEL__ */
50
51#endif /* _LINUX_SUNRPC_XPRTSOCK_H */
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index be8228e50a27..149ab62329e2 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -3,6 +3,8 @@
3 * 3 *
4 * Copyright (c) 2001,2002 Patrick Mochel 4 * Copyright (c) 2001,2002 Patrick Mochel
5 * Copyright (c) 2004 Silicon Graphics, Inc. 5 * Copyright (c) 2004 Silicon Graphics, Inc.
6 * Copyright (c) 2007 SUSE Linux Products GmbH
7 * Copyright (c) 2007 Tejun Heo <teheo@suse.de>
6 * 8 *
7 * Please see Documentation/filesystems/sysfs.txt for more information. 9 * Please see Documentation/filesystems/sysfs.txt for more information.
8 */ 10 */
@@ -17,23 +19,20 @@
17 19
18struct kobject; 20struct kobject;
19struct module; 21struct module;
20struct nameidata;
21struct dentry;
22struct sysfs_dirent;
23 22
24/* FIXME 23/* FIXME
25 * The *owner field is no longer used, but leave around 24 * The *owner field is no longer used, but leave around
26 * until the tree gets cleaned up fully. 25 * until the tree gets cleaned up fully.
27 */ 26 */
28struct attribute { 27struct attribute {
29 const char * name; 28 const char *name;
30 struct module * owner; 29 struct module *owner;
31 mode_t mode; 30 mode_t mode;
32}; 31};
33 32
34struct attribute_group { 33struct attribute_group {
35 const char * name; 34 const char *name;
36 struct attribute ** attrs; 35 struct attribute **attrs;
37}; 36};
38 37
39 38
@@ -77,72 +76,41 @@ struct sysfs_ops {
77 ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t); 76 ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t);
78}; 77};
79 78
80#define SYSFS_TYPE_MASK 0x00ff
81#define SYSFS_ROOT 0x0001
82#define SYSFS_DIR 0x0002
83#define SYSFS_KOBJ_ATTR 0x0004
84#define SYSFS_KOBJ_BIN_ATTR 0x0008
85#define SYSFS_KOBJ_LINK 0x0020
86#define SYSFS_COPY_NAME (SYSFS_DIR | SYSFS_KOBJ_LINK)
87
88#define SYSFS_FLAG_MASK ~SYSFS_TYPE_MASK
89#define SYSFS_FLAG_REMOVED 0x0100
90
91#ifdef CONFIG_SYSFS 79#ifdef CONFIG_SYSFS
92 80
93extern int sysfs_schedule_callback(struct kobject *kobj, 81int sysfs_schedule_callback(struct kobject *kobj, void (*func)(void *),
94 void (*func)(void *), void *data, struct module *owner); 82 void *data, struct module *owner);
95
96extern int __must_check
97sysfs_create_dir(struct kobject *kobj, struct sysfs_dirent *shadow_parent_sd);
98
99extern void
100sysfs_remove_dir(struct kobject *);
101
102extern int __must_check
103sysfs_rename_dir(struct kobject *kobj, struct sysfs_dirent *new_parent_sd,
104 const char *new_name);
105
106extern int __must_check
107sysfs_move_dir(struct kobject *, struct kobject *);
108
109extern int __must_check
110sysfs_create_file(struct kobject *, const struct attribute *);
111 83
112extern int __must_check 84int __must_check sysfs_create_dir(struct kobject *kobj);
113sysfs_update_file(struct kobject *, const struct attribute *); 85void sysfs_remove_dir(struct kobject *kobj);
86int __must_check sysfs_rename_dir(struct kobject *kobj, const char *new_name);
87int __must_check sysfs_move_dir(struct kobject *kobj,
88 struct kobject *new_parent_kobj);
114 89
115extern int __must_check 90int __must_check sysfs_create_file(struct kobject *kobj,
116sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, mode_t mode); 91 const struct attribute *attr);
117 92int __must_check sysfs_chmod_file(struct kobject *kobj, struct attribute *attr,
118extern void 93 mode_t mode);
119sysfs_remove_file(struct kobject *, const struct attribute *); 94void sysfs_remove_file(struct kobject *kobj, const struct attribute *attr);
120
121extern int __must_check
122sysfs_create_link(struct kobject * kobj, struct kobject * target, const char * name);
123
124extern void
125sysfs_remove_link(struct kobject *, const char * name);
126 95
127int __must_check sysfs_create_bin_file(struct kobject *kobj, 96int __must_check sysfs_create_bin_file(struct kobject *kobj,
128 struct bin_attribute *attr); 97 struct bin_attribute *attr);
129void sysfs_remove_bin_file(struct kobject *kobj, struct bin_attribute *attr); 98void sysfs_remove_bin_file(struct kobject *kobj, struct bin_attribute *attr);
130 99
131int __must_check sysfs_create_group(struct kobject *, 100int __must_check sysfs_create_link(struct kobject *kobj, struct kobject *target,
132 const struct attribute_group *); 101 const char *name);
133void sysfs_remove_group(struct kobject *, const struct attribute_group *); 102void sysfs_remove_link(struct kobject *kobj, const char *name);
103
104int __must_check sysfs_create_group(struct kobject *kobj,
105 const struct attribute_group *grp);
106void sysfs_remove_group(struct kobject *kobj,
107 const struct attribute_group *grp);
134int sysfs_add_file_to_group(struct kobject *kobj, 108int sysfs_add_file_to_group(struct kobject *kobj,
135 const struct attribute *attr, const char *group); 109 const struct attribute *attr, const char *group);
136void sysfs_remove_file_from_group(struct kobject *kobj, 110void sysfs_remove_file_from_group(struct kobject *kobj,
137 const struct attribute *attr, const char *group); 111 const struct attribute *attr, const char *group);
138
139void sysfs_notify(struct kobject * k, char *dir, char *attr);
140
141 112
142extern int sysfs_make_shadowed_dir(struct kobject *kobj, 113void sysfs_notify(struct kobject *kobj, char *dir, char *attr);
143 void * (*follow_link)(struct dentry *, struct nameidata *));
144extern struct sysfs_dirent *sysfs_create_shadow_dir(struct kobject *kobj);
145extern void sysfs_remove_shadow_dir(struct sysfs_dirent *shadow_sd);
146 114
147extern int __must_check sysfs_init(void); 115extern int __must_check sysfs_init(void);
148 116
@@ -154,75 +122,76 @@ static inline int sysfs_schedule_callback(struct kobject *kobj,
154 return -ENOSYS; 122 return -ENOSYS;
155} 123}
156 124
157static inline int sysfs_create_dir(struct kobject *kobj, 125static inline int sysfs_create_dir(struct kobject *kobj)
158 struct sysfs_dirent *shadow_parent_sd)
159{ 126{
160 return 0; 127 return 0;
161} 128}
162 129
163static inline void sysfs_remove_dir(struct kobject * k) 130static inline void sysfs_remove_dir(struct kobject *kobj)
164{ 131{
165 ; 132 ;
166} 133}
167 134
168static inline int sysfs_rename_dir(struct kobject *kobj, 135static inline int sysfs_rename_dir(struct kobject *kobj, const char *new_name)
169 struct sysfs_dirent *new_parent_sd,
170 const char *new_name)
171{ 136{
172 return 0; 137 return 0;
173} 138}
174 139
175static inline int sysfs_move_dir(struct kobject * k, struct kobject * new_parent) 140static inline int sysfs_move_dir(struct kobject *kobj,
141 struct kobject *new_parent_kobj)
176{ 142{
177 return 0; 143 return 0;
178} 144}
179 145
180static inline int sysfs_create_file(struct kobject * k, const struct attribute * a) 146static inline int sysfs_create_file(struct kobject *kobj,
147 const struct attribute *attr)
181{ 148{
182 return 0; 149 return 0;
183} 150}
184 151
185static inline int sysfs_update_file(struct kobject * k, const struct attribute * a) 152static inline int sysfs_chmod_file(struct kobject *kobj,
186{ 153 struct attribute *attr, mode_t mode)
187 return 0;
188}
189static inline int sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, mode_t mode)
190{ 154{
191 return 0; 155 return 0;
192} 156}
193 157
194static inline void sysfs_remove_file(struct kobject * k, const struct attribute * a) 158static inline void sysfs_remove_file(struct kobject *kobj,
159 const struct attribute *attr)
195{ 160{
196 ; 161 ;
197} 162}
198 163
199static inline int sysfs_create_link(struct kobject * k, struct kobject * t, const char * n) 164static inline int sysfs_create_bin_file(struct kobject *kobj,
165 struct bin_attribute *attr)
200{ 166{
201 return 0; 167 return 0;
202} 168}
203 169
204static inline void sysfs_remove_link(struct kobject * k, const char * name) 170static inline int sysfs_remove_bin_file(struct kobject *kobj,
171 struct bin_attribute *attr)
205{ 172{
206 ; 173 return 0;
207} 174}
208 175
209 176static inline int sysfs_create_link(struct kobject *kobj,
210static inline int sysfs_create_bin_file(struct kobject * k, struct bin_attribute * a) 177 struct kobject *target, const char *name)
211{ 178{
212 return 0; 179 return 0;
213} 180}
214 181
215static inline int sysfs_remove_bin_file(struct kobject * k, struct bin_attribute * a) 182static inline void sysfs_remove_link(struct kobject *kobj, const char *name)
216{ 183{
217 return 0; 184 ;
218} 185}
219 186
220static inline int sysfs_create_group(struct kobject * k, const struct attribute_group *g) 187static inline int sysfs_create_group(struct kobject *kobj,
188 const struct attribute_group *grp)
221{ 189{
222 return 0; 190 return 0;
223} 191}
224 192
225static inline void sysfs_remove_group(struct kobject * k, const struct attribute_group * g) 193static inline void sysfs_remove_group(struct kobject *kobj,
194 const struct attribute_group *grp)
226{ 195{
227 ; 196 ;
228} 197}
@@ -238,14 +207,8 @@ static inline void sysfs_remove_file_from_group(struct kobject *kobj,
238{ 207{
239} 208}
240 209
241static inline void sysfs_notify(struct kobject * k, char *dir, char *attr) 210static inline void sysfs_notify(struct kobject *kobj, char *dir, char *attr)
242{
243}
244
245static inline int sysfs_make_shadowed_dir(struct kobject *kobj,
246 void * (*follow_link)(struct dentry *, struct nameidata *))
247{ 211{
248 return 0;
249} 212}
250 213
251static inline int __must_check sysfs_init(void) 214static inline int __must_check sysfs_init(void)
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index c5b94c1a5ee2..bac17c59b24e 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -315,7 +315,7 @@ struct tcp_sock {
315 */ 315 */
316 u32 snd_ssthresh; /* Slow start size threshold */ 316 u32 snd_ssthresh; /* Slow start size threshold */
317 u32 snd_cwnd; /* Sending congestion window */ 317 u32 snd_cwnd; /* Sending congestion window */
318 u16 snd_cwnd_cnt; /* Linear increase counter */ 318 u32 snd_cwnd_cnt; /* Linear increase counter */
319 u32 snd_cwnd_clamp; /* Do not allow snd_cwnd to grow above this */ 319 u32 snd_cwnd_clamp; /* Do not allow snd_cwnd to grow above this */
320 u32 snd_cwnd_used; 320 u32 snd_cwnd_used;
321 u32 snd_cwnd_stamp; 321 u32 snd_cwnd_stamp;
diff --git a/include/linux/topology.h b/include/linux/topology.h
index 525d437b1253..47729f18bfdf 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -159,15 +159,14 @@
159 .imbalance_pct = 125, \ 159 .imbalance_pct = 125, \
160 .cache_nice_tries = 1, \ 160 .cache_nice_tries = 1, \
161 .busy_idx = 2, \ 161 .busy_idx = 2, \
162 .idle_idx = 0, \ 162 .idle_idx = 1, \
163 .newidle_idx = 0, \ 163 .newidle_idx = 2, \
164 .wake_idx = 1, \ 164 .wake_idx = 1, \
165 .forkexec_idx = 1, \ 165 .forkexec_idx = 1, \
166 .flags = SD_LOAD_BALANCE \ 166 .flags = SD_LOAD_BALANCE \
167 | SD_BALANCE_NEWIDLE \ 167 | SD_BALANCE_NEWIDLE \
168 | SD_BALANCE_EXEC \ 168 | SD_BALANCE_EXEC \
169 | SD_WAKE_AFFINE \ 169 | SD_WAKE_AFFINE \
170 | SD_WAKE_IDLE \
171 | BALANCE_FOR_PKG_POWER,\ 170 | BALANCE_FOR_PKG_POWER,\
172 .last_balance = jiffies, \ 171 .last_balance = jiffies, \
173 .balance_interval = 1, \ 172 .balance_interval = 1, \
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 6570719eafdf..60478f6e5dc6 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -21,7 +21,6 @@
21 * (Note: the *_driver.minor_start values 1, 64, 128, 192 are 21 * (Note: the *_driver.minor_start values 1, 64, 128, 192 are
22 * hardcoded at present.) 22 * hardcoded at present.)
23 */ 23 */
24#define NR_PTYS CONFIG_LEGACY_PTY_COUNT /* Number of legacy ptys */
25#define NR_UNIX98_PTY_DEFAULT 4096 /* Default maximum for Unix98 ptys */ 24#define NR_UNIX98_PTY_DEFAULT 4096 /* Default maximum for Unix98 ptys */
26#define NR_UNIX98_PTY_MAX (1 << MINORBITS) /* Absolute limit */ 25#define NR_UNIX98_PTY_MAX (1 << MINORBITS) /* Absolute limit */
27#define NR_LDISCS 17 26#define NR_LDISCS 17
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 4f33a58fa9d1..c5c8f169d3cf 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -52,6 +52,7 @@ struct ep_device;
52 * @ep_dev: ep_device for sysfs info 52 * @ep_dev: ep_device for sysfs info
53 * @extra: descriptors following this endpoint in the configuration 53 * @extra: descriptors following this endpoint in the configuration
54 * @extralen: how many bytes of "extra" are valid 54 * @extralen: how many bytes of "extra" are valid
55 * @enabled: URBs may be submitted to this endpoint
55 * 56 *
56 * USB requests are always queued to a given endpoint, identified by a 57 * USB requests are always queued to a given endpoint, identified by a
57 * descriptor within an active interface in a given USB configuration. 58 * descriptor within an active interface in a given USB configuration.
@@ -64,6 +65,7 @@ struct usb_host_endpoint {
64 65
65 unsigned char *extra; /* Extra descriptors */ 66 unsigned char *extra; /* Extra descriptors */
66 int extralen; 67 int extralen;
68 int enabled;
67}; 69};
68 70
69/* host-side wrapper for one interface setting's parsed descriptors */ 71/* host-side wrapper for one interface setting's parsed descriptors */
@@ -344,6 +346,11 @@ struct usb_tt;
344 * 346 *
345 * Usbcore drivers should not set usbdev->state directly. Instead use 347 * Usbcore drivers should not set usbdev->state directly. Instead use
346 * usb_set_device_state(). 348 * usb_set_device_state().
349 *
350 * @authorized: (user space) policy determines if we authorize this
351 * device to be used or not. By default, wired USB
352 * devices are authorized. WUSB devices are not, until we
353 * authorize them from user space. FIXME -- complete doc
347 */ 354 */
348struct usb_device { 355struct usb_device {
349 int devnum; /* Address on USB bus */ 356 int devnum; /* Address on USB bus */
@@ -376,8 +383,11 @@ struct usb_device {
376 u8 portnum; /* Parent port number (origin 1) */ 383 u8 portnum; /* Parent port number (origin 1) */
377 u8 level; /* Number of USB hub ancestors */ 384 u8 level; /* Number of USB hub ancestors */
378 385
386 unsigned can_submit:1; /* URBs may be submitted */
379 unsigned discon_suspended:1; /* Disconnected while suspended */ 387 unsigned discon_suspended:1; /* Disconnected while suspended */
380 unsigned have_langid:1; /* whether string_langid is valid */ 388 unsigned have_langid:1; /* whether string_langid is valid */
389 unsigned authorized:1; /* Policy has determined we can use it */
390 unsigned wusb:1; /* Device is Wireless USB */
381 int string_langid; /* language ID for strings */ 391 int string_langid; /* language ID for strings */
382 392
383 /* static strings from the device */ 393 /* static strings from the device */
@@ -405,6 +415,7 @@ struct usb_device {
405 415
406 int pm_usage_cnt; /* usage counter for autosuspend */ 416 int pm_usage_cnt; /* usage counter for autosuspend */
407 u32 quirks; /* quirks of the whole device */ 417 u32 quirks; /* quirks of the whole device */
418 atomic_t urbnum; /* number of URBs submitted for the whole device */
408 419
409#ifdef CONFIG_PM 420#ifdef CONFIG_PM
410 struct delayed_work autosuspend; /* for delayed autosuspends */ 421 struct delayed_work autosuspend; /* for delayed autosuspends */
@@ -419,6 +430,7 @@ struct usb_device {
419 unsigned persist_enabled:1; /* USB_PERSIST enabled for this dev */ 430 unsigned persist_enabled:1; /* USB_PERSIST enabled for this dev */
420 unsigned autosuspend_disabled:1; /* autosuspend and autoresume */ 431 unsigned autosuspend_disabled:1; /* autosuspend and autoresume */
421 unsigned autoresume_disabled:1; /* disabled by the user */ 432 unsigned autoresume_disabled:1; /* disabled by the user */
433 unsigned skip_sys_resume:1; /* skip the next system resume */
422#endif 434#endif
423}; 435};
424#define to_usb_device(d) container_of(d, struct usb_device, dev) 436#define to_usb_device(d) container_of(d, struct usb_device, dev)
@@ -555,6 +567,29 @@ static inline int usb_make_path (struct usb_device *dev, char *buf,
555/*-------------------------------------------------------------------------*/ 567/*-------------------------------------------------------------------------*/
556 568
557/** 569/**
570 * usb_endpoint_num - get the endpoint's number
571 * @epd: endpoint to be checked
572 *
573 * Returns @epd's number: 0 to 15.
574 */
575static inline int usb_endpoint_num(const struct usb_endpoint_descriptor *epd)
576{
577 return epd->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
578}
579
580/**
581 * usb_endpoint_type - get the endpoint's transfer type
582 * @epd: endpoint to be checked
583 *
584 * Returns one of USB_ENDPOINT_XFER_{CONTROL, ISOC, BULK, INT} according
585 * to @epd's transfer type.
586 */
587static inline int usb_endpoint_type(const struct usb_endpoint_descriptor *epd)
588{
589 return epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK;
590}
591
592/**
558 * usb_endpoint_dir_in - check if the endpoint has IN direction 593 * usb_endpoint_dir_in - check if the endpoint has IN direction
559 * @epd: endpoint to be checked 594 * @epd: endpoint to be checked
560 * 595 *
@@ -996,6 +1031,8 @@ extern int usb_disabled(void);
996 1031
997/* 1032/*
998 * urb->transfer_flags: 1033 * urb->transfer_flags:
1034 *
1035 * Note: URB_DIR_IN/OUT is automatically set in usb_submit_urb().
999 */ 1036 */
1000#define URB_SHORT_NOT_OK 0x0001 /* report short reads as errors */ 1037#define URB_SHORT_NOT_OK 0x0001 /* report short reads as errors */
1001#define URB_ISO_ASAP 0x0002 /* iso-only, urb->start_frame 1038#define URB_ISO_ASAP 0x0002 /* iso-only, urb->start_frame
@@ -1008,6 +1045,10 @@ extern int usb_disabled(void);
1008 * needed */ 1045 * needed */
1009#define URB_FREE_BUFFER 0x0100 /* Free transfer buffer with the URB */ 1046#define URB_FREE_BUFFER 0x0100 /* Free transfer buffer with the URB */
1010 1047
1048#define URB_DIR_IN 0x0200 /* Transfer from device to host */
1049#define URB_DIR_OUT 0
1050#define URB_DIR_MASK URB_DIR_IN
1051
1011struct usb_iso_packet_descriptor { 1052struct usb_iso_packet_descriptor {
1012 unsigned int offset; 1053 unsigned int offset;
1013 unsigned int length; /* expected length */ 1054 unsigned int length; /* expected length */
@@ -1037,6 +1078,8 @@ typedef void (*usb_complete_t)(struct urb *);
1037 * @urb_list: For use by current owner of the URB. 1078 * @urb_list: For use by current owner of the URB.
1038 * @anchor_list: membership in the list of an anchor 1079 * @anchor_list: membership in the list of an anchor
1039 * @anchor: to anchor URBs to a common mooring 1080 * @anchor: to anchor URBs to a common mooring
1081 * @ep: Points to the endpoint's data structure. Will eventually
1082 * replace @pipe.
1040 * @pipe: Holds endpoint number, direction, type, and more. 1083 * @pipe: Holds endpoint number, direction, type, and more.
1041 * Create these values with the eight macros available; 1084 * Create these values with the eight macros available;
1042 * usb_{snd,rcv}TYPEpipe(dev,endpoint), where the TYPE is "ctrl" 1085 * usb_{snd,rcv}TYPEpipe(dev,endpoint), where the TYPE is "ctrl"
@@ -1201,10 +1244,10 @@ struct urb
1201{ 1244{
1202 /* private: usb core and host controller only fields in the urb */ 1245 /* private: usb core and host controller only fields in the urb */
1203 struct kref kref; /* reference count of the URB */ 1246 struct kref kref; /* reference count of the URB */
1204 spinlock_t lock; /* lock for the URB */
1205 void *hcpriv; /* private data for host controller */ 1247 void *hcpriv; /* private data for host controller */
1206 atomic_t use_count; /* concurrent submissions counter */ 1248 atomic_t use_count; /* concurrent submissions counter */
1207 u8 reject; /* submissions will fail */ 1249 u8 reject; /* submissions will fail */
1250 int unlinked; /* unlink error code */
1208 1251
1209 /* public: documented fields in the urb that can be used by drivers */ 1252 /* public: documented fields in the urb that can be used by drivers */
1210 struct list_head urb_list; /* list head for use by the urb's 1253 struct list_head urb_list; /* list head for use by the urb's
@@ -1212,6 +1255,7 @@ struct urb
1212 struct list_head anchor_list; /* the URB may be anchored by the driver */ 1255 struct list_head anchor_list; /* the URB may be anchored by the driver */
1213 struct usb_anchor *anchor; 1256 struct usb_anchor *anchor;
1214 struct usb_device *dev; /* (in) pointer to associated device */ 1257 struct usb_device *dev; /* (in) pointer to associated device */
1258 struct usb_host_endpoint *ep; /* (internal) pointer to endpoint struct */
1215 unsigned int pipe; /* (in) pipe information */ 1259 unsigned int pipe; /* (in) pipe information */
1216 int status; /* (return) non-ISO status */ 1260 int status; /* (return) non-ISO status */
1217 unsigned int transfer_flags; /* (in) URB_SHORT_NOT_OK | ...*/ 1261 unsigned int transfer_flags; /* (in) URB_SHORT_NOT_OK | ...*/
@@ -1257,7 +1301,6 @@ static inline void usb_fill_control_urb (struct urb *urb,
1257 usb_complete_t complete_fn, 1301 usb_complete_t complete_fn,
1258 void *context) 1302 void *context)
1259{ 1303{
1260 spin_lock_init(&urb->lock);
1261 urb->dev = dev; 1304 urb->dev = dev;
1262 urb->pipe = pipe; 1305 urb->pipe = pipe;
1263 urb->setup_packet = setup_packet; 1306 urb->setup_packet = setup_packet;
@@ -1288,7 +1331,6 @@ static inline void usb_fill_bulk_urb (struct urb *urb,
1288 usb_complete_t complete_fn, 1331 usb_complete_t complete_fn,
1289 void *context) 1332 void *context)
1290{ 1333{
1291 spin_lock_init(&urb->lock);
1292 urb->dev = dev; 1334 urb->dev = dev;
1293 urb->pipe = pipe; 1335 urb->pipe = pipe;
1294 urb->transfer_buffer = transfer_buffer; 1336 urb->transfer_buffer = transfer_buffer;
@@ -1324,7 +1366,6 @@ static inline void usb_fill_int_urb (struct urb *urb,
1324 void *context, 1366 void *context,
1325 int interval) 1367 int interval)
1326{ 1368{
1327 spin_lock_init(&urb->lock);
1328 urb->dev = dev; 1369 urb->dev = dev;
1329 urb->pipe = pipe; 1370 urb->pipe = pipe;
1330 urb->transfer_buffer = transfer_buffer; 1371 urb->transfer_buffer = transfer_buffer;
@@ -1352,6 +1393,30 @@ extern void usb_unanchor_urb(struct urb *urb);
1352extern int usb_wait_anchor_empty_timeout(struct usb_anchor *anchor, 1393extern int usb_wait_anchor_empty_timeout(struct usb_anchor *anchor,
1353 unsigned int timeout); 1394 unsigned int timeout);
1354 1395
1396/**
1397 * usb_urb_dir_in - check if an URB describes an IN transfer
1398 * @urb: URB to be checked
1399 *
1400 * Returns 1 if @urb describes an IN transfer (device-to-host),
1401 * otherwise 0.
1402 */
1403static inline int usb_urb_dir_in(struct urb *urb)
1404{
1405 return (urb->transfer_flags & URB_DIR_MASK) == URB_DIR_IN;
1406}
1407
1408/**
1409 * usb_urb_dir_out - check if an URB describes an OUT transfer
1410 * @urb: URB to be checked
1411 *
1412 * Returns 1 if @urb describes an OUT transfer (host-to-device),
1413 * otherwise 0.
1414 */
1415static inline int usb_urb_dir_out(struct urb *urb)
1416{
1417 return (urb->transfer_flags & URB_DIR_MASK) == URB_DIR_OUT;
1418}
1419
1355void *usb_buffer_alloc (struct usb_device *dev, size_t size, 1420void *usb_buffer_alloc (struct usb_device *dev, size_t size,
1356 gfp_t mem_flags, dma_addr_t *dma); 1421 gfp_t mem_flags, dma_addr_t *dma);
1357void usb_buffer_free (struct usb_device *dev, size_t size, 1422void usb_buffer_free (struct usb_device *dev, size_t size,
@@ -1364,13 +1429,13 @@ void usb_buffer_unmap (struct urb *urb);
1364#endif 1429#endif
1365 1430
1366struct scatterlist; 1431struct scatterlist;
1367int usb_buffer_map_sg(const struct usb_device *dev, unsigned pipe, 1432int usb_buffer_map_sg(const struct usb_device *dev, int is_in,
1368 struct scatterlist *sg, int nents); 1433 struct scatterlist *sg, int nents);
1369#if 0 1434#if 0
1370void usb_buffer_dmasync_sg(const struct usb_device *dev, unsigned pipe, 1435void usb_buffer_dmasync_sg(const struct usb_device *dev, int is_in,
1371 struct scatterlist *sg, int n_hw_ents); 1436 struct scatterlist *sg, int n_hw_ents);
1372#endif 1437#endif
1373void usb_buffer_unmap_sg(const struct usb_device *dev, unsigned pipe, 1438void usb_buffer_unmap_sg(const struct usb_device *dev, int is_in,
1374 struct scatterlist *sg, int n_hw_ents); 1439 struct scatterlist *sg, int n_hw_ents);
1375 1440
1376/*-------------------------------------------------------------------* 1441/*-------------------------------------------------------------------*
diff --git a/include/linux/usb_gadget.h b/include/linux/usb/gadget.h
index 4f59b2aa8a9e..c1527c2ef3cb 100644
--- a/include/linux/usb_gadget.h
+++ b/include/linux/usb/gadget.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * <linux/usb_gadget.h> 2 * <linux/usb/gadget.h>
3 * 3 *
4 * We call the USB code inside a Linux-based peripheral device a "gadget" 4 * We call the USB code inside a Linux-based peripheral device a "gadget"
5 * driver, except for the hardware-specific bus glue. One USB host can 5 * driver, except for the hardware-specific bus glue. One USB host can
@@ -22,10 +22,10 @@ struct usb_ep;
22/** 22/**
23 * struct usb_request - describes one i/o request 23 * struct usb_request - describes one i/o request
24 * @buf: Buffer used for data. Always provide this; some controllers 24 * @buf: Buffer used for data. Always provide this; some controllers
25 * only use PIO, or don't use DMA for some endpoints. 25 * only use PIO, or don't use DMA for some endpoints.
26 * @dma: DMA address corresponding to 'buf'. If you don't set this 26 * @dma: DMA address corresponding to 'buf'. If you don't set this
27 * field, and the usb controller needs one, it is responsible 27 * field, and the usb controller needs one, it is responsible
28 * for mapping and unmapping the buffer. 28 * for mapping and unmapping the buffer.
29 * @length: Length of that data 29 * @length: Length of that data
30 * @no_interrupt: If true, hints that no completion irq is needed. 30 * @no_interrupt: If true, hints that no completion irq is needed.
31 * Helpful sometimes with deep request queues that are handled 31 * Helpful sometimes with deep request queues that are handled
@@ -45,16 +45,16 @@ struct usb_ep;
45 * @context: For use by the completion callback 45 * @context: For use by the completion callback
46 * @list: For use by the gadget driver. 46 * @list: For use by the gadget driver.
47 * @status: Reports completion code, zero or a negative errno. 47 * @status: Reports completion code, zero or a negative errno.
48 * Normally, faults block the transfer queue from advancing until 48 * Normally, faults block the transfer queue from advancing until
49 * the completion callback returns. 49 * the completion callback returns.
50 * Code "-ESHUTDOWN" indicates completion caused by device disconnect, 50 * Code "-ESHUTDOWN" indicates completion caused by device disconnect,
51 * or when the driver disabled the endpoint. 51 * or when the driver disabled the endpoint.
52 * @actual: Reports bytes transferred to/from the buffer. For reads (OUT 52 * @actual: Reports bytes transferred to/from the buffer. For reads (OUT
53 * transfers) this may be less than the requested length. If the 53 * transfers) this may be less than the requested length. If the
54 * short_not_ok flag is set, short reads are treated as errors 54 * short_not_ok flag is set, short reads are treated as errors
55 * even when status otherwise indicates successful completion. 55 * even when status otherwise indicates successful completion.
56 * Note that for writes (IN transfers) some data bytes may still 56 * Note that for writes (IN transfers) some data bytes may still
57 * reside in a device-side FIFO when the request is reported as 57 * reside in a device-side FIFO when the request is reported as
58 * complete. 58 * complete.
59 * 59 *
60 * These are allocated/freed through the endpoint they're used with. The 60 * These are allocated/freed through the endpoint they're used with. The
@@ -128,7 +128,7 @@ struct usb_ep_ops {
128 * value can sometimes be reduced (hardware allowing), according to 128 * value can sometimes be reduced (hardware allowing), according to
129 * the endpoint descriptor used to configure the endpoint. 129 * the endpoint descriptor used to configure the endpoint.
130 * @driver_data:for use by the gadget driver. all other fields are 130 * @driver_data:for use by the gadget driver. all other fields are
131 * read-only to gadget drivers. 131 * read-only to gadget drivers.
132 * 132 *
133 * the bus controller driver lists all the general purpose endpoints in 133 * the bus controller driver lists all the general purpose endpoints in
134 * gadget->ep_list. the control endpoint (gadget->ep0) is not in that list, 134 * gadget->ep_list. the control endpoint (gadget->ep0) is not in that list,
@@ -148,10 +148,10 @@ struct usb_ep {
148/** 148/**
149 * usb_ep_enable - configure endpoint, making it usable 149 * usb_ep_enable - configure endpoint, making it usable
150 * @ep:the endpoint being configured. may not be the endpoint named "ep0". 150 * @ep:the endpoint being configured. may not be the endpoint named "ep0".
151 * drivers discover endpoints through the ep_list of a usb_gadget. 151 * drivers discover endpoints through the ep_list of a usb_gadget.
152 * @desc:descriptor for desired behavior. caller guarantees this pointer 152 * @desc:descriptor for desired behavior. caller guarantees this pointer
153 * remains valid until the endpoint is disabled; the data byte order 153 * remains valid until the endpoint is disabled; the data byte order
154 * is little-endian (usb-standard). 154 * is little-endian (usb-standard).
155 * 155 *
156 * when configurations are set, or when interface settings change, the driver 156 * when configurations are set, or when interface settings change, the driver
157 * will enable or disable the relevant endpoints. while it is enabled, an 157 * will enable or disable the relevant endpoints. while it is enabled, an
@@ -232,7 +232,7 @@ usb_ep_free_request (struct usb_ep *ep, struct usb_request *req)
232 * @ep:the endpoint associated with the request 232 * @ep:the endpoint associated with the request
233 * @req:the request being submitted 233 * @req:the request being submitted
234 * @gfp_flags: GFP_* flags to use in case the lower level driver couldn't 234 * @gfp_flags: GFP_* flags to use in case the lower level driver couldn't
235 * pre-allocate all necessary memory with the request. 235 * pre-allocate all necessary memory with the request.
236 * 236 *
237 * This tells the device controller to perform the specified request through 237 * This tells the device controller to perform the specified request through
238 * that endpoint (reading or writing a buffer). When the request completes, 238 * that endpoint (reading or writing a buffer). When the request completes,
@@ -415,7 +415,7 @@ struct usb_gadget_ops {
415 * struct usb_gadget - represents a usb slave device 415 * struct usb_gadget - represents a usb slave device
416 * @ops: Function pointers used to access hardware-specific operations. 416 * @ops: Function pointers used to access hardware-specific operations.
417 * @ep0: Endpoint zero, used when reading or writing responses to 417 * @ep0: Endpoint zero, used when reading or writing responses to
418 * driver setup() requests 418 * driver setup() requests
419 * @ep_list: List of other endpoints supported by the device. 419 * @ep_list: List of other endpoints supported by the device.
420 * @speed: Speed of current connection to USB host. 420 * @speed: Speed of current connection to USB host.
421 * @is_dualspeed: True if the controller supports both high and full speed 421 * @is_dualspeed: True if the controller supports both high and full speed
@@ -432,7 +432,7 @@ struct usb_gadget_ops {
432 * @b_hnp_enable: OTG device feature flag, indicating that the A-Host 432 * @b_hnp_enable: OTG device feature flag, indicating that the A-Host
433 * enabled HNP support. 433 * enabled HNP support.
434 * @name: Identifies the controller hardware type. Used in diagnostics 434 * @name: Identifies the controller hardware type. Used in diagnostics
435 * and sometimes configuration. 435 * and sometimes configuration.
436 * @dev: Driver model state for this abstract device. 436 * @dev: Driver model state for this abstract device.
437 * 437 *
438 * Gadgets have a mostly-portable "gadget driver" implementing device 438 * Gadgets have a mostly-portable "gadget driver" implementing device
@@ -480,6 +480,39 @@ static inline void *get_gadget_data (struct usb_gadget *gadget)
480 480
481 481
482/** 482/**
483 * gadget_is_dualspeed - return true iff the hardware handles high speed
484 * @g: controller that might support both high and full speeds
485 */
486static inline int gadget_is_dualspeed(struct usb_gadget *g)
487{
488#ifdef CONFIG_USB_GADGET_DUALSPEED
489 /* runtime test would check "g->is_dualspeed" ... that might be
490 * useful to work around hardware bugs, but is mostly pointless
491 */
492 return 1;
493#else
494 return 0;
495#endif
496}
497
498/**
499 * gadget_is_otg - return true iff the hardware is OTG-ready
500 * @g: controller that might have a Mini-AB connector
501 *
502 * This is a runtime test, since kernels with a USB-OTG stack sometimes
503 * run on boards which only have a Mini-B (or Mini-A) connector.
504 */
505static inline int gadget_is_otg(struct usb_gadget *g)
506{
507#ifdef CONFIG_USB_OTG
508 return g->is_otg;
509#else
510 return 0;
511#endif
512}
513
514
515/**
483 * usb_gadget_frame_number - returns the current frame number 516 * usb_gadget_frame_number - returns the current frame number
484 * @gadget: controller that reports the frame number 517 * @gadget: controller that reports the frame number
485 * 518 *
@@ -655,23 +688,23 @@ usb_gadget_disconnect (struct usb_gadget *gadget)
655 * @function: String describing the gadget's function 688 * @function: String describing the gadget's function
656 * @speed: Highest speed the driver handles. 689 * @speed: Highest speed the driver handles.
657 * @bind: Invoked when the driver is bound to a gadget, usually 690 * @bind: Invoked when the driver is bound to a gadget, usually
658 * after registering the driver. 691 * after registering the driver.
659 * At that point, ep0 is fully initialized, and ep_list holds 692 * At that point, ep0 is fully initialized, and ep_list holds
660 * the currently-available endpoints. 693 * the currently-available endpoints.
661 * Called in a context that permits sleeping. 694 * Called in a context that permits sleeping.
662 * @setup: Invoked for ep0 control requests that aren't handled by 695 * @setup: Invoked for ep0 control requests that aren't handled by
663 * the hardware level driver. Most calls must be handled by 696 * the hardware level driver. Most calls must be handled by
664 * the gadget driver, including descriptor and configuration 697 * the gadget driver, including descriptor and configuration
665 * management. The 16 bit members of the setup data are in 698 * management. The 16 bit members of the setup data are in
666 * USB byte order. Called in_interrupt; this may not sleep. Driver 699 * USB byte order. Called in_interrupt; this may not sleep. Driver
667 * queues a response to ep0, or returns negative to stall. 700 * queues a response to ep0, or returns negative to stall.
668 * @disconnect: Invoked after all transfers have been stopped, 701 * @disconnect: Invoked after all transfers have been stopped,
669 * when the host is disconnected. May be called in_interrupt; this 702 * when the host is disconnected. May be called in_interrupt; this
670 * may not sleep. Some devices can't detect disconnect, so this might 703 * may not sleep. Some devices can't detect disconnect, so this might
671 * not be called except as part of controller shutdown. 704 * not be called except as part of controller shutdown.
672 * @unbind: Invoked when the driver is unbound from a gadget, 705 * @unbind: Invoked when the driver is unbound from a gadget,
673 * usually from rmmod (after a disconnect is reported). 706 * usually from rmmod (after a disconnect is reported).
674 * Called in a context that permits sleeping. 707 * Called in a context that permits sleeping.
675 * @suspend: Invoked on USB suspend. May be called in_interrupt. 708 * @suspend: Invoked on USB suspend. May be called in_interrupt.
676 * @resume: Invoked on USB resume. May be called in_interrupt. 709 * @resume: Invoked on USB resume. May be called in_interrupt.
677 * @driver: Driver model state for this driver. 710 * @driver: Driver model state for this driver.
diff --git a/include/linux/usb/quirks.h b/include/linux/usb/quirks.h
index 8da374caf582..2692ec9389ca 100644
--- a/include/linux/usb/quirks.h
+++ b/include/linux/usb/quirks.h
@@ -4,11 +4,8 @@
4 * belong here. 4 * belong here.
5 */ 5 */
6 6
7/* device must not be autosuspended */
8#define USB_QUIRK_NO_AUTOSUSPEND 0x00000001
9
10/* string descriptors must not be fetched using a 255-byte read */ 7/* string descriptors must not be fetched using a 255-byte read */
11#define USB_QUIRK_STRING_FETCH_255 0x00000002 8#define USB_QUIRK_STRING_FETCH_255 0x00000001
12 9
13/* device can't resume correctly so reset it instead */ 10/* device can't resume correctly so reset it instead */
14#define USB_QUIRK_RESET_RESUME 0x00000004 11#define USB_QUIRK_RESET_RESUME 0x00000002
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
index e8b8928232c8..488ce128885c 100644
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@ -141,7 +141,7 @@ struct usb_serial {
141}; 141};
142#define to_usb_serial(d) container_of(d, struct usb_serial, kref) 142#define to_usb_serial(d) container_of(d, struct usb_serial, kref)
143 143
144#define NUM_DONT_CARE (-1) 144#define NUM_DONT_CARE 99
145 145
146/* get and set the serial private data pointer helper functions */ 146/* get and set the serial private data pointer helper functions */
147static inline void *usb_get_serial_data (struct usb_serial *serial) 147static inline void *usb_get_serial_data (struct usb_serial *serial)
@@ -160,12 +160,18 @@ static inline void usb_set_serial_data (struct usb_serial *serial, void *data)
160 * in the syslog messages when a device is inserted or removed. 160 * in the syslog messages when a device is inserted or removed.
161 * @id_table: pointer to a list of usb_device_id structures that define all 161 * @id_table: pointer to a list of usb_device_id structures that define all
162 * of the devices this structure can support. 162 * of the devices this structure can support.
163 * @num_interrupt_in: the number of interrupt in endpoints this device will 163 * @num_interrupt_in: If a device doesn't have this many interrupt-in
164 * have. 164 * endpoints, it won't be sent to the driver's attach() method.
165 * @num_interrupt_out: the number of interrupt out endpoints this device will 165 * (But it might still be sent to the probe() method.)
166 * have. 166 * @num_interrupt_out: If a device doesn't have this many interrupt-out
167 * @num_bulk_in: the number of bulk in endpoints this device will have. 167 * endpoints, it won't be sent to the driver's attach() method.
168 * @num_bulk_out: the number of bulk out endpoints this device will have. 168 * (But it might still be sent to the probe() method.)
169 * @num_bulk_in: If a device doesn't have this many bulk-in
170 * endpoints, it won't be sent to the driver's attach() method.
171 * (But it might still be sent to the probe() method.)
172 * @num_bulk_out: If a device doesn't have this many bulk-out
173 * endpoints, it won't be sent to the driver's attach() method.
174 * (But it might still be sent to the probe() method.)
169 * @num_ports: the number of different ports this device will have. 175 * @num_ports: the number of different ports this device will have.
170 * @calc_num_ports: pointer to a function to determine how many ports this 176 * @calc_num_ports: pointer to a function to determine how many ports this
171 * device has dynamically. It will be called after the probe() 177 * device has dynamically. It will be called after the probe()
diff --git a/include/linux/usb_sl811.h b/include/linux/usb_sl811.h
deleted file mode 100644
index 4f2d012d7309..000000000000
--- a/include/linux/usb_sl811.h
+++ /dev/null
@@ -1,26 +0,0 @@
1
2/*
3 * board initialization should put one of these into dev->platform_data
4 * and place the sl811hs onto platform_bus named "sl811-hcd".
5 */
6
7struct sl811_platform_data {
8 unsigned can_wakeup:1;
9
10 /* given port_power, msec/2 after power on till power good */
11 u8 potpg;
12
13 /* mA/2 power supplied on this port (max = default = 250) */
14 u8 power;
15
16 /* sl811 relies on an external source of VBUS current */
17 void (*port_power)(struct device *dev, int is_on);
18
19 /* pulse sl811 nRST (probably with a GPIO) */
20 void (*reset)(struct device *dev);
21
22 // some boards need something like these:
23 // int (*check_overcurrent)(struct device *dev);
24 // void (*clock_enable)(struct device *dev, int is_on);
25};
26
diff --git a/include/linux/video_output.h b/include/linux/video_output.h
index e63e0c03ee0d..2fb46bc9340d 100644
--- a/include/linux/video_output.h
+++ b/include/linux/video_output.h
@@ -31,9 +31,9 @@ struct output_properties {
31struct output_device { 31struct output_device {
32 int request_state; 32 int request_state;
33 struct output_properties *props; 33 struct output_properties *props;
34 struct class_device class_dev; 34 struct device dev;
35}; 35};
36#define to_output_device(obj) container_of(obj, struct output_device, class_dev) 36#define to_output_device(obj) container_of(obj, struct output_device, dev)
37struct output_device *video_output_register(const char *name, 37struct output_device *video_output_register(const char *name,
38 struct device *dev, 38 struct device *dev,
39 void *devdata, 39 void *devdata,
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index c7c3337c3a88..d1321a81c9c4 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -62,8 +62,6 @@ struct writeback_control {
62 unsigned for_reclaim:1; /* Invoked from the page allocator */ 62 unsigned for_reclaim:1; /* Invoked from the page allocator */
63 unsigned for_writepages:1; /* This is a writepages() call */ 63 unsigned for_writepages:1; /* This is a writepages() call */
64 unsigned range_cyclic:1; /* range_start is cyclic */ 64 unsigned range_cyclic:1; /* range_start is cyclic */
65
66 void *fs_private; /* For use by ->writepages() */
67}; 65};
68 66
69/* 67/*
diff --git a/include/media/videobuf-core.h b/include/media/videobuf-core.h
index 9fa09fb800a1..0fa5d5912555 100644
--- a/include/media/videobuf-core.h
+++ b/include/media/videobuf-core.h
@@ -133,7 +133,7 @@ struct videobuf_qtype_ops {
133 enum v4l2_memory memory); 133 enum v4l2_memory memory);
134 int (*sync) (struct videobuf_queue* q, 134 int (*sync) (struct videobuf_queue* q,
135 struct videobuf_buffer *buf); 135 struct videobuf_buffer *buf);
136 int (*copy_to_user) (struct videobuf_queue *q, 136 int (*video_copy_to_user)(struct videobuf_queue *q,
137 char __user *data, 137 char __user *data,
138 size_t count, 138 size_t count,
139 int nonblocking); 139 int nonblocking);
diff --git a/include/net/inet_frag.h b/include/net/inet_frag.h
new file mode 100644
index 000000000000..911c2cd02941
--- /dev/null
+++ b/include/net/inet_frag.h
@@ -0,0 +1,60 @@
1#ifndef __NET_FRAG_H__
2#define __NET_FRAG_H__
3
4struct inet_frag_queue {
5 struct hlist_node list;
6 struct list_head lru_list; /* lru list member */
7 spinlock_t lock;
8 atomic_t refcnt;
9 struct timer_list timer; /* when will this queue expire? */
10 struct sk_buff *fragments; /* list of received fragments */
11 ktime_t stamp;
12 int len; /* total length of orig datagram */
13 int meat;
14 __u8 last_in; /* first/last segment arrived? */
15
16#define COMPLETE 4
17#define FIRST_IN 2
18#define LAST_IN 1
19};
20
21#define INETFRAGS_HASHSZ 64
22
23struct inet_frags_ctl {
24 int high_thresh;
25 int low_thresh;
26 int timeout;
27 int secret_interval;
28};
29
30struct inet_frags {
31 struct list_head lru_list;
32 struct hlist_head hash[INETFRAGS_HASHSZ];
33 rwlock_t lock;
34 u32 rnd;
35 int nqueues;
36 int qsize;
37 atomic_t mem;
38 struct timer_list secret_timer;
39 struct inet_frags_ctl *ctl;
40
41 unsigned int (*hashfn)(struct inet_frag_queue *);
42 void (*destructor)(struct inet_frag_queue *);
43 void (*skb_free)(struct sk_buff *);
44};
45
46void inet_frags_init(struct inet_frags *);
47void inet_frags_fini(struct inet_frags *);
48
49void inet_frag_kill(struct inet_frag_queue *q, struct inet_frags *f);
50void inet_frag_destroy(struct inet_frag_queue *q,
51 struct inet_frags *f, int *work);
52int inet_frag_evictor(struct inet_frags *f);
53
54static inline void inet_frag_put(struct inet_frag_queue *q, struct inet_frags *f)
55{
56 if (atomic_dec_and_test(&q->refcnt))
57 inet_frag_destroy(q, f, NULL);
58}
59
60#endif
diff --git a/include/net/ip.h b/include/net/ip.h
index 3af3ed9d320b..840dd91b513b 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -160,6 +160,7 @@ DECLARE_SNMP_STAT(struct ipstats_mib, ip_statistics);
160#define IP_INC_STATS(field) SNMP_INC_STATS(ip_statistics, field) 160#define IP_INC_STATS(field) SNMP_INC_STATS(ip_statistics, field)
161#define IP_INC_STATS_BH(field) SNMP_INC_STATS_BH(ip_statistics, field) 161#define IP_INC_STATS_BH(field) SNMP_INC_STATS_BH(ip_statistics, field)
162#define IP_INC_STATS_USER(field) SNMP_INC_STATS_USER(ip_statistics, field) 162#define IP_INC_STATS_USER(field) SNMP_INC_STATS_USER(ip_statistics, field)
163#define IP_ADD_STATS_BH(field, val) SNMP_ADD_STATS_BH(ip_statistics, field, val)
163DECLARE_SNMP_STAT(struct linux_mib, net_statistics); 164DECLARE_SNMP_STAT(struct linux_mib, net_statistics);
164#define NET_INC_STATS(field) SNMP_INC_STATS(net_statistics, field) 165#define NET_INC_STATS(field) SNMP_INC_STATS(net_statistics, field)
165#define NET_INC_STATS_BH(field) SNMP_INC_STATS_BH(net_statistics, field) 166#define NET_INC_STATS_BH(field) SNMP_INC_STATS_BH(net_statistics, field)
@@ -177,10 +178,8 @@ extern int sysctl_ip_default_ttl;
177extern int sysctl_ip_nonlocal_bind; 178extern int sysctl_ip_nonlocal_bind;
178 179
179/* From ip_fragment.c */ 180/* From ip_fragment.c */
180extern int sysctl_ipfrag_high_thresh; 181struct inet_frags_ctl;
181extern int sysctl_ipfrag_low_thresh; 182extern struct inet_frags_ctl ip4_frags_ctl;
182extern int sysctl_ipfrag_time;
183extern int sysctl_ipfrag_secret_interval;
184extern int sysctl_ipfrag_max_dist; 183extern int sysctl_ipfrag_max_dist;
185 184
186/* From inetpeer.c */ 185/* From inetpeer.c */
@@ -332,9 +331,9 @@ enum ip_defrag_users
332 IP_DEFRAG_VS_FWD 331 IP_DEFRAG_VS_FWD
333}; 332};
334 333
335struct sk_buff *ip_defrag(struct sk_buff *skb, u32 user); 334int ip_defrag(struct sk_buff *skb, u32 user);
336extern int ip_frag_nqueues; 335int ip_frag_mem(void);
337extern atomic_t ip_frag_mem; 336int ip_frag_nqueues(void);
338 337
339/* 338/*
340 * Functions provided by ip_forward.c 339 * Functions provided by ip_forward.c
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 672564e5a81d..41870564df8e 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -464,10 +464,10 @@ struct ip_vs_protocol {
464 unsigned int proto_off, 464 unsigned int proto_off,
465 int inverse); 465 int inverse);
466 466
467 int (*snat_handler)(struct sk_buff **pskb, 467 int (*snat_handler)(struct sk_buff *skb,
468 struct ip_vs_protocol *pp, struct ip_vs_conn *cp); 468 struct ip_vs_protocol *pp, struct ip_vs_conn *cp);
469 469
470 int (*dnat_handler)(struct sk_buff **pskb, 470 int (*dnat_handler)(struct sk_buff *skb,
471 struct ip_vs_protocol *pp, struct ip_vs_conn *cp); 471 struct ip_vs_protocol *pp, struct ip_vs_conn *cp);
472 472
473 int (*csum_check)(struct sk_buff *skb, struct ip_vs_protocol *pp); 473 int (*csum_check)(struct sk_buff *skb, struct ip_vs_protocol *pp);
@@ -654,11 +654,11 @@ struct ip_vs_app
654 654
655 /* output hook: return false if can't linearize. diff set for TCP. */ 655 /* output hook: return false if can't linearize. diff set for TCP. */
656 int (*pkt_out)(struct ip_vs_app *, struct ip_vs_conn *, 656 int (*pkt_out)(struct ip_vs_app *, struct ip_vs_conn *,
657 struct sk_buff **, int *diff); 657 struct sk_buff *, int *diff);
658 658
659 /* input hook: return false if can't linearize. diff set for TCP. */ 659 /* input hook: return false if can't linearize. diff set for TCP. */
660 int (*pkt_in)(struct ip_vs_app *, struct ip_vs_conn *, 660 int (*pkt_in)(struct ip_vs_app *, struct ip_vs_conn *,
661 struct sk_buff **, int *diff); 661 struct sk_buff *, int *diff);
662 662
663 /* ip_vs_app initializer */ 663 /* ip_vs_app initializer */
664 int (*init_conn)(struct ip_vs_app *, struct ip_vs_conn *); 664 int (*init_conn)(struct ip_vs_app *, struct ip_vs_conn *);
@@ -832,8 +832,8 @@ register_ip_vs_app_inc(struct ip_vs_app *app, __u16 proto, __u16 port);
832extern int ip_vs_app_inc_get(struct ip_vs_app *inc); 832extern int ip_vs_app_inc_get(struct ip_vs_app *inc);
833extern void ip_vs_app_inc_put(struct ip_vs_app *inc); 833extern void ip_vs_app_inc_put(struct ip_vs_app *inc);
834 834
835extern int ip_vs_app_pkt_out(struct ip_vs_conn *, struct sk_buff **pskb); 835extern int ip_vs_app_pkt_out(struct ip_vs_conn *, struct sk_buff *skb);
836extern int ip_vs_app_pkt_in(struct ip_vs_conn *, struct sk_buff **pskb); 836extern int ip_vs_app_pkt_in(struct ip_vs_conn *, struct sk_buff *skb);
837extern int ip_vs_skb_replace(struct sk_buff *skb, gfp_t pri, 837extern int ip_vs_skb_replace(struct sk_buff *skb, gfp_t pri,
838 char *o_buf, int o_len, char *n_buf, int n_len); 838 char *o_buf, int o_len, char *n_buf, int n_len);
839extern int ip_vs_app_init(void); 839extern int ip_vs_app_init(void);
@@ -984,7 +984,6 @@ static inline char ip_vs_fwd_tag(struct ip_vs_conn *cp)
984 return fwd; 984 return fwd;
985} 985}
986 986
987extern int ip_vs_make_skb_writable(struct sk_buff **pskb, int len);
988extern void ip_vs_nat_icmp(struct sk_buff *skb, struct ip_vs_protocol *pp, 987extern void ip_vs_nat_icmp(struct sk_buff *skb, struct ip_vs_protocol *pp,
989 struct ip_vs_conn *cp, int dir); 988 struct ip_vs_conn *cp, int dir);
990 989
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 31b3f1b45a2b..cc796cbc1b26 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -120,12 +120,21 @@ extern int sysctl_mld_max_msf;
120 SNMP_INC_STATS##modifier(statname##_statistics, (field)); \ 120 SNMP_INC_STATS##modifier(statname##_statistics, (field)); \
121}) 121})
122 122
123#define _DEVADD(statname, modifier, idev, field, val) \
124({ \
125 struct inet6_dev *_idev = (idev); \
126 if (likely(_idev != NULL)) \
127 SNMP_ADD_STATS##modifier((_idev)->stats.statname, (field), (val)); \
128 SNMP_ADD_STATS##modifier(statname##_statistics, (field), (val));\
129})
130
123/* MIBs */ 131/* MIBs */
124DECLARE_SNMP_STAT(struct ipstats_mib, ipv6_statistics); 132DECLARE_SNMP_STAT(struct ipstats_mib, ipv6_statistics);
125 133
126#define IP6_INC_STATS(idev,field) _DEVINC(ipv6, , idev, field) 134#define IP6_INC_STATS(idev,field) _DEVINC(ipv6, , idev, field)
127#define IP6_INC_STATS_BH(idev,field) _DEVINC(ipv6, _BH, idev, field) 135#define IP6_INC_STATS_BH(idev,field) _DEVINC(ipv6, _BH, idev, field)
128#define IP6_INC_STATS_USER(idev,field) _DEVINC(ipv6, _USER, idev, field) 136#define IP6_INC_STATS_USER(idev,field) _DEVINC(ipv6, _USER, idev, field)
137#define IP6_ADD_STATS_BH(idev,field,val) _DEVADD(ipv6, _BH, idev, field, val)
129 138
130DECLARE_SNMP_STAT(struct icmpv6_mib, icmpv6_statistics); 139DECLARE_SNMP_STAT(struct icmpv6_mib, icmpv6_statistics);
131DECLARE_SNMP_STAT(struct icmpv6msg_mib, icmpv6msg_statistics); 140DECLARE_SNMP_STAT(struct icmpv6msg_mib, icmpv6msg_statistics);
@@ -240,7 +249,7 @@ extern int ip6_ra_control(struct sock *sk, int sel,
240 void (*destructor)(struct sock *)); 249 void (*destructor)(struct sock *));
241 250
242 251
243extern int ipv6_parse_hopopts(struct sk_buff **skbp); 252extern int ipv6_parse_hopopts(struct sk_buff *skb);
244 253
245extern struct ipv6_txoptions * ipv6_dup_options(struct sock *sk, struct ipv6_txoptions *opt); 254extern struct ipv6_txoptions * ipv6_dup_options(struct sock *sk, struct ipv6_txoptions *opt);
246extern struct ipv6_txoptions * ipv6_renew_options(struct sock *sk, struct ipv6_txoptions *opt, 255extern struct ipv6_txoptions * ipv6_renew_options(struct sock *sk, struct ipv6_txoptions *opt,
@@ -252,8 +261,8 @@ struct ipv6_txoptions *ipv6_fixup_options(struct ipv6_txoptions *opt_space,
252 261
253extern int ipv6_opt_accepted(struct sock *sk, struct sk_buff *skb); 262extern int ipv6_opt_accepted(struct sock *sk, struct sk_buff *skb);
254 263
255extern int ip6_frag_nqueues; 264int ip6_frag_nqueues(void);
256extern atomic_t ip6_frag_mem; 265int ip6_frag_mem(void);
257 266
258#define IPV6_FRAG_TIMEOUT (60*HZ) /* 60 seconds */ 267#define IPV6_FRAG_TIMEOUT (60*HZ) /* 60 seconds */
259 268
@@ -565,10 +574,8 @@ extern int inet6_hash_connect(struct inet_timewait_death_row *death_row,
565/* 574/*
566 * reassembly.c 575 * reassembly.c
567 */ 576 */
568extern int sysctl_ip6frag_high_thresh; 577struct inet_frags_ctl;
569extern int sysctl_ip6frag_low_thresh; 578extern struct inet_frags_ctl ip6_frags_ctl;
570extern int sysctl_ip6frag_time;
571extern int sysctl_ip6frag_secret_interval;
572 579
573extern const struct proto_ops inet6_stream_ops; 580extern const struct proto_ops inet6_stream_ops;
574extern const struct proto_ops inet6_dgram_ops; 581extern const struct proto_ops inet6_dgram_ops;
diff --git a/include/net/netfilter/ipv6/nf_conntrack_ipv6.h b/include/net/netfilter/ipv6/nf_conntrack_ipv6.h
index 070d12cb4634..f703533fb4db 100644
--- a/include/net/netfilter/ipv6/nf_conntrack_ipv6.h
+++ b/include/net/netfilter/ipv6/nf_conntrack_ipv6.h
@@ -15,8 +15,7 @@ extern void nf_ct_frag6_output(unsigned int hooknum, struct sk_buff *skb,
15 struct net_device *out, 15 struct net_device *out,
16 int (*okfn)(struct sk_buff *)); 16 int (*okfn)(struct sk_buff *));
17 17
18extern unsigned int nf_ct_frag6_timeout; 18struct inet_frags_ctl;
19extern unsigned int nf_ct_frag6_low_thresh; 19extern struct inet_frags_ctl nf_frags_ctl;
20extern unsigned int nf_ct_frag6_high_thresh;
21 20
22#endif /* _NF_CONNTRACK_IPV6_H*/ 21#endif /* _NF_CONNTRACK_IPV6_H*/
diff --git a/include/net/netfilter/nf_conntrack_core.h b/include/net/netfilter/nf_conntrack_core.h
index 4056f5f08da1..a532e7b5ed6a 100644
--- a/include/net/netfilter/nf_conntrack_core.h
+++ b/include/net/netfilter/nf_conntrack_core.h
@@ -22,7 +22,7 @@
22 of connection tracking. */ 22 of connection tracking. */
23extern unsigned int nf_conntrack_in(int pf, 23extern unsigned int nf_conntrack_in(int pf,
24 unsigned int hooknum, 24 unsigned int hooknum,
25 struct sk_buff **pskb); 25 struct sk_buff *skb);
26 26
27extern int nf_conntrack_init(void); 27extern int nf_conntrack_init(void);
28extern void nf_conntrack_cleanup(void); 28extern void nf_conntrack_cleanup(void);
@@ -60,17 +60,17 @@ nf_ct_invert_tuple(struct nf_conntrack_tuple *inverse,
60extern struct nf_conntrack_tuple_hash * 60extern struct nf_conntrack_tuple_hash *
61nf_conntrack_find_get(const struct nf_conntrack_tuple *tuple); 61nf_conntrack_find_get(const struct nf_conntrack_tuple *tuple);
62 62
63extern int __nf_conntrack_confirm(struct sk_buff **pskb); 63extern int __nf_conntrack_confirm(struct sk_buff *skb);
64 64
65/* Confirm a connection: returns NF_DROP if packet must be dropped. */ 65/* Confirm a connection: returns NF_DROP if packet must be dropped. */
66static inline int nf_conntrack_confirm(struct sk_buff **pskb) 66static inline int nf_conntrack_confirm(struct sk_buff *skb)
67{ 67{
68 struct nf_conn *ct = (struct nf_conn *)(*pskb)->nfct; 68 struct nf_conn *ct = (struct nf_conn *)skb->nfct;
69 int ret = NF_ACCEPT; 69 int ret = NF_ACCEPT;
70 70
71 if (ct) { 71 if (ct) {
72 if (!nf_ct_is_confirmed(ct) && !nf_ct_is_dying(ct)) 72 if (!nf_ct_is_confirmed(ct) && !nf_ct_is_dying(ct))
73 ret = __nf_conntrack_confirm(pskb); 73 ret = __nf_conntrack_confirm(skb);
74 nf_ct_deliver_cached_events(ct); 74 nf_ct_deliver_cached_events(ct);
75 } 75 }
76 return ret; 76 return ret;
diff --git a/include/net/netfilter/nf_conntrack_helper.h b/include/net/netfilter/nf_conntrack_helper.h
index 0dcc4c828ce9..d7b2d5483a71 100644
--- a/include/net/netfilter/nf_conntrack_helper.h
+++ b/include/net/netfilter/nf_conntrack_helper.h
@@ -29,7 +29,7 @@ struct nf_conntrack_helper
29 29
30 /* Function to call when data passes; return verdict, or -1 to 30 /* Function to call when data passes; return verdict, or -1 to
31 invalidate. */ 31 invalidate. */
32 int (*help)(struct sk_buff **pskb, 32 int (*help)(struct sk_buff *skb,
33 unsigned int protoff, 33 unsigned int protoff,
34 struct nf_conn *ct, 34 struct nf_conn *ct,
35 enum ip_conntrack_info conntrackinfo); 35 enum ip_conntrack_info conntrackinfo);
diff --git a/include/net/netfilter/nf_nat_core.h b/include/net/netfilter/nf_nat_core.h
index c3cd127ba4bb..f29eeb9777e0 100644
--- a/include/net/netfilter/nf_nat_core.h
+++ b/include/net/netfilter/nf_nat_core.h
@@ -10,12 +10,12 @@
10extern unsigned int nf_nat_packet(struct nf_conn *ct, 10extern unsigned int nf_nat_packet(struct nf_conn *ct,
11 enum ip_conntrack_info ctinfo, 11 enum ip_conntrack_info ctinfo,
12 unsigned int hooknum, 12 unsigned int hooknum,
13 struct sk_buff **pskb); 13 struct sk_buff *skb);
14 14
15extern int nf_nat_icmp_reply_translation(struct nf_conn *ct, 15extern int nf_nat_icmp_reply_translation(struct nf_conn *ct,
16 enum ip_conntrack_info ctinfo, 16 enum ip_conntrack_info ctinfo,
17 unsigned int hooknum, 17 unsigned int hooknum,
18 struct sk_buff **pskb); 18 struct sk_buff *skb);
19 19
20static inline int nf_nat_initialized(struct nf_conn *ct, 20static inline int nf_nat_initialized(struct nf_conn *ct,
21 enum nf_nat_manip_type manip) 21 enum nf_nat_manip_type manip)
diff --git a/include/net/netfilter/nf_nat_helper.h b/include/net/netfilter/nf_nat_helper.h
index ec98ecf95fc8..58dd22687949 100644
--- a/include/net/netfilter/nf_nat_helper.h
+++ b/include/net/netfilter/nf_nat_helper.h
@@ -7,21 +7,21 @@
7struct sk_buff; 7struct sk_buff;
8 8
9/* These return true or false. */ 9/* These return true or false. */
10extern int nf_nat_mangle_tcp_packet(struct sk_buff **skb, 10extern int nf_nat_mangle_tcp_packet(struct sk_buff *skb,
11 struct nf_conn *ct, 11 struct nf_conn *ct,
12 enum ip_conntrack_info ctinfo, 12 enum ip_conntrack_info ctinfo,
13 unsigned int match_offset, 13 unsigned int match_offset,
14 unsigned int match_len, 14 unsigned int match_len,
15 const char *rep_buffer, 15 const char *rep_buffer,
16 unsigned int rep_len); 16 unsigned int rep_len);
17extern int nf_nat_mangle_udp_packet(struct sk_buff **skb, 17extern int nf_nat_mangle_udp_packet(struct sk_buff *skb,
18 struct nf_conn *ct, 18 struct nf_conn *ct,
19 enum ip_conntrack_info ctinfo, 19 enum ip_conntrack_info ctinfo,
20 unsigned int match_offset, 20 unsigned int match_offset,
21 unsigned int match_len, 21 unsigned int match_len,
22 const char *rep_buffer, 22 const char *rep_buffer,
23 unsigned int rep_len); 23 unsigned int rep_len);
24extern int nf_nat_seq_adjust(struct sk_buff **pskb, 24extern int nf_nat_seq_adjust(struct sk_buff *skb,
25 struct nf_conn *ct, 25 struct nf_conn *ct,
26 enum ip_conntrack_info ctinfo); 26 enum ip_conntrack_info ctinfo);
27 27
diff --git a/include/net/netfilter/nf_nat_protocol.h b/include/net/netfilter/nf_nat_protocol.h
index 14c7b2d7263c..04578bfe23e1 100644
--- a/include/net/netfilter/nf_nat_protocol.h
+++ b/include/net/netfilter/nf_nat_protocol.h
@@ -18,7 +18,7 @@ struct nf_nat_protocol
18 18
19 /* Translate a packet to the target according to manip type. 19 /* Translate a packet to the target according to manip type.
20 Return true if succeeded. */ 20 Return true if succeeded. */
21 int (*manip_pkt)(struct sk_buff **pskb, 21 int (*manip_pkt)(struct sk_buff *skb,
22 unsigned int iphdroff, 22 unsigned int iphdroff,
23 const struct nf_conntrack_tuple *tuple, 23 const struct nf_conntrack_tuple *tuple,
24 enum nf_nat_manip_type maniptype); 24 enum nf_nat_manip_type maniptype);
diff --git a/include/net/netfilter/nf_nat_rule.h b/include/net/netfilter/nf_nat_rule.h
index f9743187d57f..75d1825031d7 100644
--- a/include/net/netfilter/nf_nat_rule.h
+++ b/include/net/netfilter/nf_nat_rule.h
@@ -6,7 +6,7 @@
6 6
7extern int nf_nat_rule_init(void) __init; 7extern int nf_nat_rule_init(void) __init;
8extern void nf_nat_rule_cleanup(void); 8extern void nf_nat_rule_cleanup(void);
9extern int nf_nat_rule_find(struct sk_buff **pskb, 9extern int nf_nat_rule_find(struct sk_buff *skb,
10 unsigned int hooknum, 10 unsigned int hooknum,
11 const struct net_device *in, 11 const struct net_device *in,
12 const struct net_device *out, 12 const struct net_device *out,
diff --git a/include/net/protocol.h b/include/net/protocol.h
index 105bf12b0c79..1166ffb4b3ec 100644
--- a/include/net/protocol.h
+++ b/include/net/protocol.h
@@ -45,7 +45,7 @@ struct net_protocol {
45#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) 45#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
46struct inet6_protocol 46struct inet6_protocol
47{ 47{
48 int (*handler)(struct sk_buff **skb); 48 int (*handler)(struct sk_buff *skb);
49 49
50 void (*err_handler)(struct sk_buff *skb, 50 void (*err_handler)(struct sk_buff *skb,
51 struct inet6_skb_parm *opt, 51 struct inet6_skb_parm *opt,
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 77be396ca633..0e844845f3f4 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1051,7 +1051,7 @@ extern int xfrm4_output(struct sk_buff *skb);
1051extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler, unsigned short family); 1051extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler, unsigned short family);
1052extern int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler, unsigned short family); 1052extern int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler, unsigned short family);
1053extern int xfrm6_rcv_spi(struct sk_buff *skb, __be32 spi); 1053extern int xfrm6_rcv_spi(struct sk_buff *skb, __be32 spi);
1054extern int xfrm6_rcv(struct sk_buff **pskb); 1054extern int xfrm6_rcv(struct sk_buff *skb);
1055extern int xfrm6_input_addr(struct sk_buff *skb, xfrm_address_t *daddr, 1055extern int xfrm6_input_addr(struct sk_buff *skb, xfrm_address_t *daddr,
1056 xfrm_address_t *saddr, u8 proto); 1056 xfrm_address_t *saddr, u8 proto);
1057extern int xfrm6_tunnel_register(struct xfrm6_tunnel *handler, unsigned short family); 1057extern int xfrm6_tunnel_register(struct xfrm6_tunnel *handler, unsigned short family);
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
index 90ef552c42dd..f047a1fd64f8 100644
--- a/include/pcmcia/ds.h
+++ b/include/pcmcia/ds.h
@@ -184,6 +184,7 @@ struct pcmcia_device {
184 184
185 char * prod_id[4]; 185 char * prod_id[4];
186 186
187 u64 dma_mask;
187 struct device dev; 188 struct device dev;
188 189
189#ifdef CONFIG_PCMCIA_IOCTL 190#ifdef CONFIG_PCMCIA_IOCTL
diff --git a/include/scsi/libsrp.h b/include/scsi/libsrp.h
index d143171896ae..ba615e4c1d7c 100644
--- a/include/scsi/libsrp.h
+++ b/include/scsi/libsrp.h
@@ -59,7 +59,7 @@ extern void srp_target_free(struct srp_target *);
59extern struct iu_entry *srp_iu_get(struct srp_target *); 59extern struct iu_entry *srp_iu_get(struct srp_target *);
60extern void srp_iu_put(struct iu_entry *); 60extern void srp_iu_put(struct iu_entry *);
61 61
62extern int srp_cmd_queue(struct Scsi_Host *, struct srp_cmd *, void *, u64); 62extern int srp_cmd_queue(struct Scsi_Host *, struct srp_cmd *, void *, u64, u64);
63extern int srp_transfer_data(struct scsi_cmnd *, struct srp_cmd *, 63extern int srp_transfer_data(struct scsi_cmnd *, struct srp_cmd *,
64 srp_rdma_t, int, int); 64 srp_rdma_t, int, int);
65 65
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
index 9f8f80ab0c8b..702fcfeb37f1 100644
--- a/include/scsi/scsi.h
+++ b/include/scsi/scsi.h
@@ -11,13 +11,6 @@
11#include <linux/types.h> 11#include <linux/types.h>
12 12
13/* 13/*
14 * The maximum sg list length SCSI can cope with
15 * (currently must be a power of 2 between 32 and 256)
16 */
17#define SCSI_MAX_PHYS_SEGMENTS MAX_PHYS_SEGMENTS
18
19
20/*
21 * SCSI command lengths 14 * SCSI command lengths
22 */ 15 */
23 16
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
index 53e170586c26..3f47e522a1ec 100644
--- a/include/scsi/scsi_cmnd.h
+++ b/include/scsi/scsi_cmnd.h
@@ -5,6 +5,7 @@
5#include <linux/list.h> 5#include <linux/list.h>
6#include <linux/types.h> 6#include <linux/types.h>
7#include <linux/timer.h> 7#include <linux/timer.h>
8#include <linux/scatterlist.h>
8 9
9struct request; 10struct request;
10struct scatterlist; 11struct scatterlist;
@@ -33,20 +34,17 @@ struct scsi_cmnd {
33 struct list_head list; /* scsi_cmnd participates in queue lists */ 34 struct list_head list; /* scsi_cmnd participates in queue lists */
34 struct list_head eh_entry; /* entry for the host eh_cmd_q */ 35 struct list_head eh_entry; /* entry for the host eh_cmd_q */
35 int eh_eflags; /* Used by error handlr */ 36 int eh_eflags; /* Used by error handlr */
36 void (*done) (struct scsi_cmnd *); /* Mid-level done function */
37 37
38 /* 38 /*
39 * A SCSI Command is assigned a nonzero serial_number before passed 39 * A SCSI Command is assigned a nonzero serial_number before passed
40 * to the driver's queue command function. The serial_number is 40 * to the driver's queue command function. The serial_number is
41 * cleared when scsi_done is entered indicating that the command 41 * cleared when scsi_done is entered indicating that the command
42 * has been completed. It currently doesn't have much use other 42 * has been completed. It is a bug for LLDDs to use this number
43 * than printk's. Some lldd's use this number for other purposes. 43 * for purposes other than printk (and even that is only useful
44 * It's almost certain that such usages are either incorrect or 44 * for debugging).
45 * meaningless. Please kill all usages other than printk's. Also,
46 * as this number is always identical to ->pid, please convert
47 * printk's to use ->pid, so that we can kill this field.
48 */ 45 */
49 unsigned long serial_number; 46 unsigned long serial_number;
47
50 /* 48 /*
51 * This is set to jiffies as it was when the command was first 49 * This is set to jiffies as it was when the command was first
52 * allocated. It is used to time how long the command has 50 * allocated. It is used to time how long the command has
@@ -71,7 +69,7 @@ struct scsi_cmnd {
71 69
72 /* These elements define the operation we ultimately want to perform */ 70 /* These elements define the operation we ultimately want to perform */
73 unsigned short use_sg; /* Number of pieces of scatter-gather */ 71 unsigned short use_sg; /* Number of pieces of scatter-gather */
74 unsigned short sglist_len; /* size of malloc'd scatter-gather list */ 72 unsigned short __use_sg;
75 73
76 unsigned underflow; /* Return error if less than 74 unsigned underflow; /* Return error if less than
77 this amount is transferred */ 75 this amount is transferred */
@@ -116,7 +114,6 @@ struct scsi_cmnd {
116 int result; /* Status code from lower level driver */ 114 int result; /* Status code from lower level driver */
117 115
118 unsigned char tag; /* SCSI-II queued command tag */ 116 unsigned char tag; /* SCSI-II queued command tag */
119 unsigned long pid; /* Process ID, starts at 0. Unique per host. */
120}; 117};
121 118
122extern struct scsi_cmnd *scsi_get_command(struct scsi_device *, gfp_t); 119extern struct scsi_cmnd *scsi_get_command(struct scsi_device *, gfp_t);
@@ -124,7 +121,6 @@ extern struct scsi_cmnd *__scsi_get_command(struct Scsi_Host *, gfp_t);
124extern void scsi_put_command(struct scsi_cmnd *); 121extern void scsi_put_command(struct scsi_cmnd *);
125extern void __scsi_put_command(struct Scsi_Host *, struct scsi_cmnd *, 122extern void __scsi_put_command(struct Scsi_Host *, struct scsi_cmnd *,
126 struct device *); 123 struct device *);
127extern void scsi_io_completion(struct scsi_cmnd *, unsigned int);
128extern void scsi_finish_command(struct scsi_cmnd *cmd); 124extern void scsi_finish_command(struct scsi_cmnd *cmd);
129extern void scsi_req_abort_cmd(struct scsi_cmnd *cmd); 125extern void scsi_req_abort_cmd(struct scsi_cmnd *cmd);
130 126
@@ -133,7 +129,7 @@ extern void *scsi_kmap_atomic_sg(struct scatterlist *sg, int sg_count,
133extern void scsi_kunmap_atomic_sg(void *virt); 129extern void scsi_kunmap_atomic_sg(void *virt);
134 130
135extern struct scatterlist *scsi_alloc_sgtable(struct scsi_cmnd *, gfp_t); 131extern struct scatterlist *scsi_alloc_sgtable(struct scsi_cmnd *, gfp_t);
136extern void scsi_free_sgtable(struct scatterlist *, int); 132extern void scsi_free_sgtable(struct scsi_cmnd *);
137 133
138extern int scsi_dma_map(struct scsi_cmnd *cmd); 134extern int scsi_dma_map(struct scsi_cmnd *cmd);
139extern void scsi_dma_unmap(struct scsi_cmnd *cmd); 135extern void scsi_dma_unmap(struct scsi_cmnd *cmd);
@@ -153,6 +149,6 @@ static inline int scsi_get_resid(struct scsi_cmnd *cmd)
153} 149}
154 150
155#define scsi_for_each_sg(cmd, sg, nseg, __i) \ 151#define scsi_for_each_sg(cmd, sg, nseg, __i) \
156 for (__i = 0, sg = scsi_sglist(cmd); __i < (nseg); __i++, (sg)++) 152 for_each_sg(scsi_sglist(cmd), sg, nseg, __i)
157 153
158#endif /* _SCSI_SCSI_CMND_H */ 154#endif /* _SCSI_SCSI_CMND_H */
diff --git a/include/scsi/scsi_dbg.h b/include/scsi/scsi_dbg.h
index 5a43a4cd96c6..e89844cc2cd3 100644
--- a/include/scsi/scsi_dbg.h
+++ b/include/scsi/scsi_dbg.h
@@ -9,6 +9,8 @@ extern void __scsi_print_command(unsigned char *);
9extern void scsi_show_extd_sense(unsigned char, unsigned char); 9extern void scsi_show_extd_sense(unsigned char, unsigned char);
10extern void scsi_show_sense_hdr(struct scsi_sense_hdr *); 10extern void scsi_show_sense_hdr(struct scsi_sense_hdr *);
11extern void scsi_print_sense_hdr(const char *, struct scsi_sense_hdr *); 11extern void scsi_print_sense_hdr(const char *, struct scsi_sense_hdr *);
12extern void scsi_cmd_print_sense_hdr(struct scsi_cmnd *, const char *,
13 struct scsi_sense_hdr *);
12extern void scsi_print_sense(char *, struct scsi_cmnd *); 14extern void scsi_print_sense(char *, struct scsi_cmnd *);
13extern void __scsi_print_sense(const char *name, 15extern void __scsi_print_sense(const char *name,
14 const unsigned char *sense_buffer, 16 const unsigned char *sense_buffer,
diff --git a/include/scsi/scsi_driver.h b/include/scsi/scsi_driver.h
index 3465f31a21c4..1f5ca7f62116 100644
--- a/include/scsi/scsi_driver.h
+++ b/include/scsi/scsi_driver.h
@@ -5,14 +5,17 @@
5 5
6struct module; 6struct module;
7struct scsi_cmnd; 7struct scsi_cmnd;
8struct scsi_device;
9struct request;
10struct request_queue;
8 11
9 12
10struct scsi_driver { 13struct scsi_driver {
11 struct module *owner; 14 struct module *owner;
12 struct device_driver gendrv; 15 struct device_driver gendrv;
13 16
14 int (*init_command)(struct scsi_cmnd *);
15 void (*rescan)(struct device *); 17 void (*rescan)(struct device *);
18 int (*done)(struct scsi_cmnd *);
16}; 19};
17#define to_scsi_driver(drv) \ 20#define to_scsi_driver(drv) \
18 container_of((drv), struct scsi_driver, gendrv) 21 container_of((drv), struct scsi_driver, gendrv)
@@ -25,4 +28,9 @@ extern int scsi_register_interface(struct class_interface *);
25#define scsi_unregister_interface(intf) \ 28#define scsi_unregister_interface(intf) \
26 class_interface_unregister(intf) 29 class_interface_unregister(intf)
27 30
31int scsi_setup_blk_pc_cmnd(struct scsi_device *sdev, struct request *req);
32int scsi_setup_fs_cmnd(struct scsi_device *sdev, struct request *req);
33int scsi_prep_state_check(struct scsi_device *sdev, struct request *req);
34int scsi_prep_return(struct request_queue *q, struct request *req, int ret);
35
28#endif /* _SCSI_SCSI_DRIVER_H */ 36#endif /* _SCSI_SCSI_DRIVER_H */
diff --git a/include/scsi/scsi_eh.h b/include/scsi/scsi_eh.h
index c5c0f6762a01..44224ba4dd90 100644
--- a/include/scsi/scsi_eh.h
+++ b/include/scsi/scsi_eh.h
@@ -1,7 +1,7 @@
1#ifndef _SCSI_SCSI_EH_H 1#ifndef _SCSI_SCSI_EH_H
2#define _SCSI_SCSI_EH_H 2#define _SCSI_SCSI_EH_H
3 3
4struct scsi_cmnd; 4#include <scsi/scsi_cmnd.h>
5struct scsi_device; 5struct scsi_device;
6struct Scsi_Host; 6struct Scsi_Host;
7 7
@@ -65,4 +65,25 @@ extern int scsi_get_sense_info_fld(const u8 * sense_buffer, int sb_len,
65 65
66extern int scsi_reset_provider(struct scsi_device *, int); 66extern int scsi_reset_provider(struct scsi_device *, int);
67 67
68struct scsi_eh_save {
69 int result;
70 enum dma_data_direction data_direction;
71 unsigned char cmd_len;
72 unsigned char cmnd[MAX_COMMAND_SIZE];
73
74 void *buffer;
75 unsigned bufflen;
76 unsigned short use_sg;
77 int resid;
78
79 struct scatterlist sense_sgl;
80};
81
82extern void scsi_eh_prep_cmnd(struct scsi_cmnd *scmd,
83 struct scsi_eh_save *ses, unsigned char *cmnd,
84 int cmnd_size, unsigned sense_bytes);
85
86extern void scsi_eh_restore_cmnd(struct scsi_cmnd* scmd,
87 struct scsi_eh_save *ses);
88
68#endif /* _SCSI_SCSI_EH_H */ 89#endif /* _SCSI_SCSI_EH_H */
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index 3b8a6a85c2f8..0fd4746ee39d 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -32,10 +32,16 @@ struct blk_queue_tags;
32#define SG_NONE 0 32#define SG_NONE 0
33#define SG_ALL 0xff 33#define SG_ALL 0xff
34 34
35#define MODE_UNKNOWN 0x00
36#define MODE_INITIATOR 0x01
37#define MODE_TARGET 0x02
35 38
36#define DISABLE_CLUSTERING 0 39#define DISABLE_CLUSTERING 0
37#define ENABLE_CLUSTERING 1 40#define ENABLE_CLUSTERING 1
38 41
42#define DISABLE_SG_CHAINING 0
43#define ENABLE_SG_CHAINING 1
44
39enum scsi_eh_timer_return { 45enum scsi_eh_timer_return {
40 EH_NOT_HANDLED, 46 EH_NOT_HANDLED,
41 EH_HANDLED, 47 EH_HANDLED,
@@ -145,9 +151,6 @@ struct scsi_host_template {
145 int (* transfer_response)(struct scsi_cmnd *, 151 int (* transfer_response)(struct scsi_cmnd *,
146 void (*done)(struct scsi_cmnd *)); 152 void (*done)(struct scsi_cmnd *));
147 153
148 /* Used as callback for the completion of task management request. */
149 int (* tsk_mgmt_response)(u64 mid, int result);
150
151 /* 154 /*
152 * This is an error handling strategy routine. You don't need to 155 * This is an error handling strategy routine. You don't need to
153 * define one of these if you don't want to - there is a default 156 * define one of these if you don't want to - there is a default
@@ -408,6 +411,11 @@ struct scsi_host_template {
408 unsigned char present; 411 unsigned char present;
409 412
410 /* 413 /*
414 * This specifies the mode that a LLD supports.
415 */
416 unsigned supported_mode:2;
417
418 /*
411 * true if this host adapter uses unchecked DMA onto an ISA bus. 419 * true if this host adapter uses unchecked DMA onto an ISA bus.
412 */ 420 */
413 unsigned unchecked_isa_dma:1; 421 unsigned unchecked_isa_dma:1;
@@ -438,6 +446,15 @@ struct scsi_host_template {
438 unsigned ordered_tag:1; 446 unsigned ordered_tag:1;
439 447
440 /* 448 /*
449 * true if the low-level driver can support sg chaining. this
450 * will be removed eventually when all the drivers are
451 * converted to support sg chaining.
452 *
453 * Status: OBSOLETE
454 */
455 unsigned use_sg_chaining:1;
456
457 /*
441 * Countdown for host blocking with no commands outstanding 458 * Countdown for host blocking with no commands outstanding
442 */ 459 */
443 unsigned int max_host_blocked; 460 unsigned int max_host_blocked;
@@ -575,11 +592,13 @@ struct Scsi_Host {
575 * Used to assign serial numbers to the cmds. 592 * Used to assign serial numbers to the cmds.
576 * Protected by the host lock. 593 * Protected by the host lock.
577 */ 594 */
578 unsigned long cmd_serial_number, cmd_pid; 595 unsigned long cmd_serial_number;
579 596
597 unsigned active_mode:2;
580 unsigned unchecked_isa_dma:1; 598 unsigned unchecked_isa_dma:1;
581 unsigned use_clustering:1; 599 unsigned use_clustering:1;
582 unsigned use_blk_tcq:1; 600 unsigned use_blk_tcq:1;
601 unsigned use_sg_chaining:1;
583 602
584 /* 603 /*
585 * Host has requested that no further requests come through for the 604 * Host has requested that no further requests come through for the
diff --git a/include/scsi/scsi_tgt.h b/include/scsi/scsi_tgt.h
index 4f4427937af2..d0fefb96158f 100644
--- a/include/scsi/scsi_tgt.h
+++ b/include/scsi/scsi_tgt.h
@@ -11,9 +11,11 @@ struct scsi_lun;
11extern struct Scsi_Host *scsi_tgt_cmd_to_host(struct scsi_cmnd *); 11extern struct Scsi_Host *scsi_tgt_cmd_to_host(struct scsi_cmnd *);
12extern int scsi_tgt_alloc_queue(struct Scsi_Host *); 12extern int scsi_tgt_alloc_queue(struct Scsi_Host *);
13extern void scsi_tgt_free_queue(struct Scsi_Host *); 13extern void scsi_tgt_free_queue(struct Scsi_Host *);
14extern int scsi_tgt_queue_command(struct scsi_cmnd *, struct scsi_lun *, u64); 14extern int scsi_tgt_queue_command(struct scsi_cmnd *, u64, struct scsi_lun *, u64);
15extern int scsi_tgt_tsk_mgmt_request(struct Scsi_Host *, int, u64, struct scsi_lun *, 15extern int scsi_tgt_tsk_mgmt_request(struct Scsi_Host *, u64, int, u64,
16 void *); 16 struct scsi_lun *, void *);
17extern struct scsi_cmnd *scsi_host_get_command(struct Scsi_Host *, 17extern struct scsi_cmnd *scsi_host_get_command(struct Scsi_Host *,
18 enum dma_data_direction, gfp_t); 18 enum dma_data_direction, gfp_t);
19extern void scsi_host_put_command(struct Scsi_Host *, struct scsi_cmnd *); 19extern void scsi_host_put_command(struct Scsi_Host *, struct scsi_cmnd *);
20extern int scsi_tgt_it_nexus_create(struct Scsi_Host *, u64, char *);
21extern int scsi_tgt_it_nexus_destroy(struct Scsi_Host *, u64);
diff --git a/include/scsi/scsi_tgt_if.h b/include/scsi/scsi_tgt_if.h
index 4cf9dff29a2f..f2ee7c238a45 100644
--- a/include/scsi/scsi_tgt_if.h
+++ b/include/scsi/scsi_tgt_if.h
@@ -23,13 +23,15 @@
23#define __SCSI_TARGET_IF_H 23#define __SCSI_TARGET_IF_H
24 24
25/* user -> kernel */ 25/* user -> kernel */
26#define TGT_UEVENT_CMD_RSP 0x0001 26#define TGT_UEVENT_CMD_RSP 0x0001
27#define TGT_UEVENT_TSK_MGMT_RSP 0x0002 27#define TGT_UEVENT_IT_NEXUS_RSP 0x0002
28#define TGT_UEVENT_TSK_MGMT_RSP 0x0003
28 29
29/* kernel -> user */ 30/* kernel -> user */
30#define TGT_KEVENT_CMD_REQ 0x1001 31#define TGT_KEVENT_CMD_REQ 0x1001
31#define TGT_KEVENT_CMD_DONE 0x1002 32#define TGT_KEVENT_CMD_DONE 0x1002
32#define TGT_KEVENT_TSK_MGMT_REQ 0x1003 33#define TGT_KEVENT_IT_NEXUS_REQ 0x1003
34#define TGT_KEVENT_TSK_MGMT_REQ 0x1004
33 35
34struct tgt_event_hdr { 36struct tgt_event_hdr {
35 uint16_t version; 37 uint16_t version;
@@ -46,6 +48,7 @@ struct tgt_event {
46 struct { 48 struct {
47 int host_no; 49 int host_no;
48 int result; 50 int result;
51 aligned_u64 itn_id;
49 aligned_u64 tag; 52 aligned_u64 tag;
50 aligned_u64 uaddr; 53 aligned_u64 uaddr;
51 aligned_u64 sense_uaddr; 54 aligned_u64 sense_uaddr;
@@ -55,15 +58,22 @@ struct tgt_event {
55 } cmd_rsp; 58 } cmd_rsp;
56 struct { 59 struct {
57 int host_no; 60 int host_no;
58 aligned_u64 mid;
59 int result; 61 int result;
62 aligned_u64 itn_id;
63 aligned_u64 mid;
60 } tsk_mgmt_rsp; 64 } tsk_mgmt_rsp;
61 65 struct {
66 __s32 host_no;
67 __s32 result;
68 aligned_u64 itn_id;
69 __u32 function;
70 } it_nexus_rsp;
62 71
63 /* kernel -> user */ 72 /* kernel -> user */
64 struct { 73 struct {
65 int host_no; 74 int host_no;
66 uint32_t data_len; 75 uint32_t data_len;
76 aligned_u64 itn_id;
67 uint8_t scb[16]; 77 uint8_t scb[16];
68 uint8_t lun[8]; 78 uint8_t lun[8];
69 int attribute; 79 int attribute;
@@ -71,16 +81,25 @@ struct tgt_event {
71 } cmd_req; 81 } cmd_req;
72 struct { 82 struct {
73 int host_no; 83 int host_no;
74 aligned_u64 tag;
75 int result; 84 int result;
85 aligned_u64 itn_id;
86 aligned_u64 tag;
76 } cmd_done; 87 } cmd_done;
77 struct { 88 struct {
78 int host_no; 89 int host_no;
79 int function; 90 int function;
91 aligned_u64 itn_id;
80 aligned_u64 tag; 92 aligned_u64 tag;
81 uint8_t lun[8]; 93 uint8_t lun[8];
82 aligned_u64 mid; 94 aligned_u64 mid;
83 } tsk_mgmt_req; 95 } tsk_mgmt_req;
96 struct {
97 __s32 host_no;
98 __u32 function;
99 aligned_u64 itn_id;
100 __u32 max_cmds;
101 __u8 initiator_id[16];
102 } it_nexus_req;
84 } p; 103 } p;
85} __attribute__ ((aligned (sizeof(uint64_t)))); 104} __attribute__ ((aligned (sizeof(uint64_t))));
86 105
diff --git a/include/scsi/scsi_transport.h b/include/scsi/scsi_transport.h
index 3c18baa65a72..0dfef752f0e2 100644
--- a/include/scsi/scsi_transport.h
+++ b/include/scsi/scsi_transport.h
@@ -65,6 +65,18 @@ struct scsi_transport_template {
65 * EH_NOT_HANDLED Begin normal error recovery 65 * EH_NOT_HANDLED Begin normal error recovery
66 */ 66 */
67 enum scsi_eh_timer_return (* eh_timed_out)(struct scsi_cmnd *); 67 enum scsi_eh_timer_return (* eh_timed_out)(struct scsi_cmnd *);
68
69 /*
70 * Used as callback for the completion of i_t_nexus request
71 * for target drivers.
72 */
73 int (* it_nexus_response)(struct Scsi_Host *, u64, int);
74
75 /*
76 * Used as callback for the completion of task management
77 * request for target drivers.
78 */
79 int (* tsk_mgmt_response)(struct Scsi_Host *, u64, u64, int);
68}; 80};
69 81
70#define transport_class_to_shost(tc) \ 82#define transport_class_to_shost(tc) \
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h
index a0d80bcaa93d..e466d886e192 100644
--- a/include/scsi/scsi_transport_fc.h
+++ b/include/scsi/scsi_transport_fc.h
@@ -589,6 +589,10 @@ struct fc_function_template {
589 int (*vport_disable)(struct fc_vport *, bool); 589 int (*vport_disable)(struct fc_vport *, bool);
590 int (*vport_delete)(struct fc_vport *); 590 int (*vport_delete)(struct fc_vport *);
591 591
592 /* target-mode drivers' functions */
593 int (* tsk_mgmt_response)(struct Scsi_Host *, u64, u64, int);
594 int (* it_nexus_response)(struct Scsi_Host *, u64, int);
595
592 /* allocation lengths for host-specific data */ 596 /* allocation lengths for host-specific data */
593 u32 dd_fcrport_size; 597 u32 dd_fcrport_size;
594 u32 dd_fcvport_size; 598 u32 dd_fcvport_size;
@@ -632,6 +636,8 @@ struct fc_function_template {
632 unsigned long show_host_fabric_name:1; 636 unsigned long show_host_fabric_name:1;
633 unsigned long show_host_symbolic_name:1; 637 unsigned long show_host_symbolic_name:1;
634 unsigned long show_host_system_hostname:1; 638 unsigned long show_host_system_hostname:1;
639
640 unsigned long disable_target_scan:1;
635}; 641};
636 642
637 643
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h
index 706c0cd36c14..7ff6199cbd55 100644
--- a/include/scsi/scsi_transport_iscsi.h
+++ b/include/scsi/scsi_transport_iscsi.h
@@ -24,6 +24,8 @@
24#define SCSI_TRANSPORT_ISCSI_H 24#define SCSI_TRANSPORT_ISCSI_H
25 25
26#include <linux/device.h> 26#include <linux/device.h>
27#include <linux/list.h>
28#include <linux/mutex.h>
27#include <scsi/iscsi_if.h> 29#include <scsi/iscsi_if.h>
28 30
29struct scsi_transport_template; 31struct scsi_transport_template;
diff --git a/include/scsi/scsi_transport_srp.h b/include/scsi/scsi_transport_srp.h
new file mode 100644
index 000000000000..9c60ca1c08c5
--- /dev/null
+++ b/include/scsi/scsi_transport_srp.h
@@ -0,0 +1,39 @@
1#ifndef SCSI_TRANSPORT_SRP_H
2#define SCSI_TRANSPORT_SRP_H
3
4#include <linux/transport_class.h>
5#include <linux/types.h>
6#include <linux/mutex.h>
7
8#define SRP_RPORT_ROLE_INITIATOR 0
9#define SRP_RPORT_ROLE_TARGET 1
10
11struct srp_rport_identifiers {
12 u8 port_id[16];
13 u8 roles;
14};
15
16struct srp_rport {
17 struct device dev;
18
19 u8 port_id[16];
20 u8 roles;
21};
22
23struct srp_function_template {
24 /* for target drivers */
25 int (* tsk_mgmt_response)(struct Scsi_Host *, u64, u64, int);
26 int (* it_nexus_response)(struct Scsi_Host *, u64, int);
27};
28
29extern struct scsi_transport_template *
30srp_attach_transport(struct srp_function_template *);
31extern void srp_release_transport(struct scsi_transport_template *);
32
33extern struct srp_rport *srp_rport_add(struct Scsi_Host *,
34 struct srp_rport_identifiers *);
35extern void srp_rport_del(struct srp_rport *);
36
37extern void srp_remove_host(struct Scsi_Host *);
38
39#endif
diff --git a/include/scsi/sd.h b/include/scsi/sd.h
index ce02ad1f5185..f7513313ef0d 100644
--- a/include/scsi/sd.h
+++ b/include/scsi/sd.h
@@ -47,20 +47,6 @@ struct scsi_disk {
47}; 47};
48#define to_scsi_disk(obj) container_of(obj,struct scsi_disk,cdev) 48#define to_scsi_disk(obj) container_of(obj,struct scsi_disk,cdev)
49 49
50static int sd_revalidate_disk(struct gendisk *disk);
51static void sd_rw_intr(struct scsi_cmnd * SCpnt);
52static int sd_probe(struct device *);
53static int sd_remove(struct device *);
54static void sd_shutdown(struct device *dev);
55static int sd_suspend(struct device *dev, pm_message_t state);
56static int sd_resume(struct device *dev);
57static void sd_rescan(struct device *);
58static int sd_init_command(struct scsi_cmnd *);
59static void sd_read_capacity(struct scsi_disk *sdkp, unsigned char *buffer);
60static void scsi_disk_release(struct class_device *cdev);
61static void sd_print_sense_hdr(struct scsi_disk *, struct scsi_sense_hdr *);
62static void sd_print_result(struct scsi_disk *, int);
63
64#define sd_printk(prefix, sdsk, fmt, a...) \ 50#define sd_printk(prefix, sdsk, fmt, a...) \
65 (sdsk)->disk ? \ 51 (sdsk)->disk ? \
66 sdev_printk(prefix, (sdsk)->device, "[%s] " fmt, \ 52 sdev_printk(prefix, (sdsk)->device, "[%s] " fmt, \
diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h
index 246ac23534bd..01480581f825 100644
--- a/include/sound/ac97_codec.h
+++ b/include/sound/ac97_codec.h
@@ -2,7 +2,7 @@
2#define __SOUND_AC97_CODEC_H 2#define __SOUND_AC97_CODEC_H
3 3
4/* 4/*
5 * Copyright (c) by Jaroslav Kysela <perex@suse.cz> 5 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
6 * Universal interface for Audio Codec '97 6 * Universal interface for Audio Codec '97
7 * 7 *
8 * For more details look to AC '97 component specification revision 2.1 8 * For more details look to AC '97 component specification revision 2.1
@@ -345,9 +345,9 @@
345#define AC97_ALC650_GPIO_STATUS 0x78 345#define AC97_ALC650_GPIO_STATUS 0x78
346#define AC97_ALC650_CLOCK 0x7a 346#define AC97_ALC650_CLOCK 0x7a
347 347
348/* specific - Yamaha YMF753 */ 348/* specific - Yamaha YMF7x3 */
349#define AC97_YMF753_DIT_CTRL2 0x66 /* DIT Control 2 */ 349#define AC97_YMF7X3_DIT_CTRL 0x66 /* DIT Control (YMF743) / 2 (YMF753) */
350#define AC97_YMF753_3D_MODE_SEL 0x68 /* 3D Mode Select */ 350#define AC97_YMF7X3_3D_MODE_SEL 0x68 /* 3D Mode Select */
351 351
352/* specific - C-Media */ 352/* specific - C-Media */
353#define AC97_CM9738_VENDOR_CTRL 0x5a 353#define AC97_CM9738_VENDOR_CTRL 0x5a
diff --git a/include/sound/ad1848.h b/include/sound/ad1848.h
index b2c3f00a9b35..d04f9e78c7c1 100644
--- a/include/sound/ad1848.h
+++ b/include/sound/ad1848.h
@@ -2,7 +2,7 @@
2#define __SOUND_AD1848_H 2#define __SOUND_AD1848_H
3 3
4/* 4/*
5 * Copyright (c) by Jaroslav Kysela <perex@suse.cz> 5 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
6 * Definitions for AD1847/AD1848/CS4248 chips 6 * Definitions for AD1847/AD1848/CS4248 chips
7 * 7 *
8 * 8 *
@@ -27,7 +27,7 @@
27 27
28/* IO ports */ 28/* IO ports */
29 29
30#define AD1848P( codec, x ) ( (chip) -> port + c_d_c_AD1848##x ) 30#define AD1848P( chip, x ) ( (chip) -> port + c_d_c_AD1848##x )
31 31
32#define c_d_c_AD1848REGSEL 0 32#define c_d_c_AD1848REGSEL 0
33#define c_d_c_AD1848REG 1 33#define c_d_c_AD1848REG 1
@@ -154,7 +154,6 @@ struct snd_ad1848 {
154#endif 154#endif
155 155
156 spinlock_t reg_lock; 156 spinlock_t reg_lock;
157 struct mutex open_mutex;
158}; 157};
159 158
160/* exported functions */ 159/* exported functions */
diff --git a/include/sound/ainstr_gf1.h b/include/sound/ainstr_gf1.h
index 47726fe0f46d..b62b665c69c6 100644
--- a/include/sound/ainstr_gf1.h
+++ b/include/sound/ainstr_gf1.h
@@ -2,7 +2,7 @@
2 * Advanced Linux Sound Architecture 2 * Advanced Linux Sound Architecture
3 * 3 *
4 * GF1 (GUS) Patch Instrument Format 4 * GF1 (GUS) Patch Instrument Format
5 * Copyright (c) 1994-99 by Jaroslav Kysela <perex@suse.cz> 5 * Copyright (c) 1994-99 by Jaroslav Kysela <perex@perex.cz>
6 * 6 *
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
diff --git a/include/sound/ainstr_iw.h b/include/sound/ainstr_iw.h
index 251feaf1b388..11bd25082600 100644
--- a/include/sound/ainstr_iw.h
+++ b/include/sound/ainstr_iw.h
@@ -2,7 +2,7 @@
2 * Advanced Linux Sound Architecture 2 * Advanced Linux Sound Architecture
3 * 3 *
4 * InterWave FFFF Instrument Format 4 * InterWave FFFF Instrument Format
5 * Copyright (c) 1994-99 by Jaroslav Kysela <perex@suse.cz> 5 * Copyright (c) 1994-99 by Jaroslav Kysela <perex@perex.cz>
6 * 6 *
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
diff --git a/include/sound/ainstr_simple.h b/include/sound/ainstr_simple.h
index 5eead12e58ae..da08e7287557 100644
--- a/include/sound/ainstr_simple.h
+++ b/include/sound/ainstr_simple.h
@@ -2,7 +2,7 @@
2 * Advanced Linux Sound Architecture 2 * Advanced Linux Sound Architecture
3 * 3 *
4 * Simple (MOD player) Instrument Format 4 * Simple (MOD player) Instrument Format
5 * Copyright (c) 1994-99 by Jaroslav Kysela <perex@suse.cz> 5 * Copyright (c) 1994-99 by Jaroslav Kysela <perex@perex.cz>
6 * 6 *
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
diff --git a/include/sound/ak4114.h b/include/sound/ak4114.h
index d647dae912b9..4e80d3fe7381 100644
--- a/include/sound/ak4114.h
+++ b/include/sound/ak4114.h
@@ -3,7 +3,7 @@
3 3
4/* 4/*
5 * Routines for Asahi Kasei AK4114 5 * Routines for Asahi Kasei AK4114
6 * Copyright (c) by Jaroslav Kysela <perex@suse.cz>, 6 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>,
7 * 7 *
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
diff --git a/include/sound/ak4117.h b/include/sound/ak4117.h
index d650d52e3d29..1e8178171baf 100644
--- a/include/sound/ak4117.h
+++ b/include/sound/ak4117.h
@@ -3,7 +3,7 @@
3 3
4/* 4/*
5 * Routines for Asahi Kasei AK4117 5 * Routines for Asahi Kasei AK4117
6 * Copyright (c) by Jaroslav Kysela <perex@suse.cz>, 6 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>,
7 * 7 *
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
diff --git a/include/sound/ak4531_codec.h b/include/sound/ak4531_codec.h
index fb30faab43a8..575296cf7987 100644
--- a/include/sound/ak4531_codec.h
+++ b/include/sound/ak4531_codec.h
@@ -2,7 +2,7 @@
2#define __SOUND_AK4531_CODEC_H 2#define __SOUND_AK4531_CODEC_H
3 3
4/* 4/*
5 * Copyright (c) by Jaroslav Kysela <perex@suse.cz> 5 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
6 * Universal interface for Audio Codec '97 6 * Universal interface for Audio Codec '97
7 * 7 *
8 * For more details look to AC '97 component specification revision 2.1 8 * For more details look to AC '97 component specification revision 2.1
diff --git a/include/sound/ak4xxx-adda.h b/include/sound/ak4xxx-adda.h
index fd0a6c46f497..891cf1aea8b1 100644
--- a/include/sound/ak4xxx-adda.h
+++ b/include/sound/ak4xxx-adda.h
@@ -5,7 +5,7 @@
5 * ALSA driver for AK4524 / AK4528 / AK4529 / AK4355 / AK4381 5 * ALSA driver for AK4524 / AK4528 / AK4529 / AK4355 / AK4381
6 * AD and DA converters 6 * AD and DA converters
7 * 7 *
8 * Copyright (c) 2000 Jaroslav Kysela <perex@suse.cz> 8 * Copyright (c) 2000 Jaroslav Kysela <perex@perex.cz>
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by 11 * it under the terms of the GNU General Public License as published by
diff --git a/include/sound/asequencer.h b/include/sound/asequencer.h
index 3f2f4042a20d..64daccbe8b29 100644
--- a/include/sound/asequencer.h
+++ b/include/sound/asequencer.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * Main header file for the ALSA sequencer 2 * Main header file for the ALSA sequencer
3 * Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@coil.demon.nl> 3 * Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@coil.demon.nl>
4 * (c) 1998-1999 by Jaroslav Kysela <perex@suse.cz> 4 * (c) 1998-1999 by Jaroslav Kysela <perex@perex.cz>
5 * 5 *
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
diff --git a/include/sound/asound.h b/include/sound/asound.h
index c1621c650a9a..af9d11d315e9 100644
--- a/include/sound/asound.h
+++ b/include/sound/asound.h
@@ -1,6 +1,6 @@
1/* 1/*
2 * Advanced Linux Sound Architecture - ALSA - Driver 2 * Advanced Linux Sound Architecture - ALSA - Driver
3 * Copyright (c) 1994-2003 by Jaroslav Kysela <perex@suse.cz>, 3 * Copyright (c) 1994-2003 by Jaroslav Kysela <perex@perex.cz>,
4 * Abramo Bagnara <abramo@alsa-project.org> 4 * Abramo Bagnara <abramo@alsa-project.org>
5 * 5 *
6 * 6 *
@@ -92,6 +92,7 @@ enum {
92 SNDRV_HWDEP_IFACE_USX2Y_PCM, /* Tascam US122, US224 & US428 rawusb pcm */ 92 SNDRV_HWDEP_IFACE_USX2Y_PCM, /* Tascam US122, US224 & US428 rawusb pcm */
93 SNDRV_HWDEP_IFACE_PCXHR, /* Digigram PCXHR */ 93 SNDRV_HWDEP_IFACE_PCXHR, /* Digigram PCXHR */
94 SNDRV_HWDEP_IFACE_SB_RC, /* SB Extigy/Audigy2NX remote control */ 94 SNDRV_HWDEP_IFACE_SB_RC, /* SB Extigy/Audigy2NX remote control */
95 SNDRV_HWDEP_IFACE_HDA, /* HD-audio */
95 96
96 /* Don't forget to change the following: */ 97 /* Don't forget to change the following: */
97 SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_SB_RC 98 SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_SB_RC
diff --git a/include/sound/asound_fm.h b/include/sound/asound_fm.h
index 956fdc23c595..8fbcab7cc73b 100644
--- a/include/sound/asound_fm.h
+++ b/include/sound/asound_fm.h
@@ -5,7 +5,7 @@
5 * Advanced Linux Sound Architecture - ALSA 5 * Advanced Linux Sound Architecture - ALSA
6 * 6 *
7 * Interface file between ALSA driver & user space 7 * Interface file between ALSA driver & user space
8 * Copyright (c) 1994-98 by Jaroslav Kysela <perex@suse.cz>, 8 * Copyright (c) 1994-98 by Jaroslav Kysela <perex@perex.cz>,
9 * 4Front Technologies 9 * 4Front Technologies
10 * 10 *
11 * Direct FM control 11 * Direct FM control
diff --git a/include/sound/asoundef.h b/include/sound/asoundef.h
index 58c9ef3d1825..024ce62f7d16 100644
--- a/include/sound/asoundef.h
+++ b/include/sound/asoundef.h
@@ -3,7 +3,7 @@
3 3
4/* 4/*
5 * Advanced Linux Sound Architecture - ALSA - Driver 5 * Advanced Linux Sound Architecture - ALSA - Driver
6 * Copyright (c) 1994-2000 by Jaroslav Kysela <perex@suse.cz> 6 * Copyright (c) 1994-2000 by Jaroslav Kysela <perex@perex.cz>
7 * 7 *
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
diff --git a/include/sound/control.h b/include/sound/control.h
index 72e759f619b1..e79baa63912f 100644
--- a/include/sound/control.h
+++ b/include/sound/control.h
@@ -3,7 +3,7 @@
3 3
4/* 4/*
5 * Header file for control interface 5 * Header file for control interface
6 * Copyright (c) by Jaroslav Kysela <perex@suse.cz> 6 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
7 * 7 *
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
@@ -161,4 +161,12 @@ static inline struct snd_ctl_elem_id *snd_ctl_build_ioff(struct snd_ctl_elem_id
161 return dst_id; 161 return dst_id;
162} 162}
163 163
164/*
165 * Frequently used control callbacks
166 */
167int snd_ctl_boolean_mono_info(struct snd_kcontrol *kcontrol,
168 struct snd_ctl_elem_info *uinfo);
169int snd_ctl_boolean_stereo_info(struct snd_kcontrol *kcontrol,
170 struct snd_ctl_elem_info *uinfo);
171
164#endif /* __SOUND_CONTROL_H */ 172#endif /* __SOUND_CONTROL_H */
diff --git a/include/sound/core.h b/include/sound/core.h
index 4b9e609975ab..6954836487ed 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -3,7 +3,7 @@
3 3
4/* 4/*
5 * Main header file for the ALSA driver 5 * Main header file for the ALSA driver
6 * Copyright (c) 1994-2001 by Jaroslav Kysela <perex@suse.cz> 6 * Copyright (c) 1994-2001 by Jaroslav Kysela <perex@perex.cz>
7 * 7 *
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
diff --git a/include/sound/cs4231-regs.h b/include/sound/cs4231-regs.h
new file mode 100644
index 000000000000..f1490265c9b8
--- /dev/null
+++ b/include/sound/cs4231-regs.h
@@ -0,0 +1,180 @@
1#ifndef __SOUND_CS4231_REGS_H
2#define __SOUND_CS4231_REGS_H
3
4/*
5 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
6 * Definitions for CS4231 & InterWave chips & compatible chips registers
7 *
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 *
23 */
24
25/* IO ports */
26
27#define CS4231P(x) (c_d_c_CS4231##x)
28
29#define c_d_c_CS4231REGSEL 0
30#define c_d_c_CS4231REG 1
31#define c_d_c_CS4231STATUS 2
32#define c_d_c_CS4231PIO 3
33
34/* codec registers */
35
36#define CS4231_LEFT_INPUT 0x00 /* left input control */
37#define CS4231_RIGHT_INPUT 0x01 /* right input control */
38#define CS4231_AUX1_LEFT_INPUT 0x02 /* left AUX1 input control */
39#define CS4231_AUX1_RIGHT_INPUT 0x03 /* right AUX1 input control */
40#define CS4231_AUX2_LEFT_INPUT 0x04 /* left AUX2 input control */
41#define CS4231_AUX2_RIGHT_INPUT 0x05 /* right AUX2 input control */
42#define CS4231_LEFT_OUTPUT 0x06 /* left output control register */
43#define CS4231_RIGHT_OUTPUT 0x07 /* right output control register */
44#define CS4231_PLAYBK_FORMAT 0x08 /* clock and data format - playback - bits 7-0 MCE */
45#define CS4231_IFACE_CTRL 0x09 /* interface control - bits 7-2 MCE */
46#define CS4231_PIN_CTRL 0x0a /* pin control */
47#define CS4231_TEST_INIT 0x0b /* test and initialization */
48#define CS4231_MISC_INFO 0x0c /* miscellaneaous information */
49#define CS4231_LOOPBACK 0x0d /* loopback control */
50#define CS4231_PLY_UPR_CNT 0x0e /* playback upper base count */
51#define CS4231_PLY_LWR_CNT 0x0f /* playback lower base count */
52#define CS4231_ALT_FEATURE_1 0x10 /* alternate #1 feature enable */
53#define AD1845_AF1_MIC_LEFT 0x10 /* alternate #1 feature + MIC left */
54#define CS4231_ALT_FEATURE_2 0x11 /* alternate #2 feature enable */
55#define AD1845_AF2_MIC_RIGHT 0x11 /* alternate #2 feature + MIC right */
56#define CS4231_LEFT_LINE_IN 0x12 /* left line input control */
57#define CS4231_RIGHT_LINE_IN 0x13 /* right line input control */
58#define CS4231_TIMER_LOW 0x14 /* timer low byte */
59#define CS4231_TIMER_HIGH 0x15 /* timer high byte */
60#define CS4231_LEFT_MIC_INPUT 0x16 /* left MIC input control register (InterWave only) */
61#define AD1845_UPR_FREQ_SEL 0x16 /* upper byte of frequency select */
62#define CS4231_RIGHT_MIC_INPUT 0x17 /* right MIC input control register (InterWave only) */
63#define AD1845_LWR_FREQ_SEL 0x17 /* lower byte of frequency select */
64#define CS4236_EXT_REG 0x17 /* extended register access */
65#define CS4231_IRQ_STATUS 0x18 /* irq status register */
66#define CS4231_LINE_LEFT_OUTPUT 0x19 /* left line output control register (InterWave only) */
67#define CS4231_VERSION 0x19 /* CS4231(A) - version values */
68#define CS4231_MONO_CTRL 0x1a /* mono input/output control */
69#define CS4231_LINE_RIGHT_OUTPUT 0x1b /* right line output control register (InterWave only) */
70#define AD1845_PWR_DOWN 0x1b /* power down control */
71#define CS4235_LEFT_MASTER 0x1b /* left master output control */
72#define CS4231_REC_FORMAT 0x1c /* clock and data format - record - bits 7-0 MCE */
73#define CS4231_PLY_VAR_FREQ 0x1d /* playback variable frequency */
74#define AD1845_CLOCK 0x1d /* crystal clock select and total power down */
75#define CS4235_RIGHT_MASTER 0x1d /* right master output control */
76#define CS4231_REC_UPR_CNT 0x1e /* record upper count */
77#define CS4231_REC_LWR_CNT 0x1f /* record lower count */
78
79/* definitions for codec register select port - CODECP( REGSEL ) */
80
81#define CS4231_INIT 0x80 /* CODEC is initializing */
82#define CS4231_MCE 0x40 /* mode change enable */
83#define CS4231_TRD 0x20 /* transfer request disable */
84
85/* definitions for codec status register - CODECP( STATUS ) */
86
87#define CS4231_GLOBALIRQ 0x01 /* IRQ is active */
88
89/* definitions for codec irq status */
90
91#define CS4231_PLAYBACK_IRQ 0x10
92#define CS4231_RECORD_IRQ 0x20
93#define CS4231_TIMER_IRQ 0x40
94#define CS4231_ALL_IRQS 0x70
95#define CS4231_REC_UNDERRUN 0x08
96#define CS4231_REC_OVERRUN 0x04
97#define CS4231_PLY_OVERRUN 0x02
98#define CS4231_PLY_UNDERRUN 0x01
99
100/* definitions for CS4231_LEFT_INPUT and CS4231_RIGHT_INPUT registers */
101
102#define CS4231_ENABLE_MIC_GAIN 0x20
103
104#define CS4231_MIXS_LINE 0x00
105#define CS4231_MIXS_AUX1 0x40
106#define CS4231_MIXS_MIC 0x80
107#define CS4231_MIXS_ALL 0xc0
108
109/* definitions for clock and data format register - CS4231_PLAYBK_FORMAT */
110
111#define CS4231_LINEAR_8 0x00 /* 8-bit unsigned data */
112#define CS4231_ALAW_8 0x60 /* 8-bit A-law companded */
113#define CS4231_ULAW_8 0x20 /* 8-bit U-law companded */
114#define CS4231_LINEAR_16 0x40 /* 16-bit twos complement data - little endian */
115#define CS4231_LINEAR_16_BIG 0xc0 /* 16-bit twos complement data - big endian */
116#define CS4231_ADPCM_16 0xa0 /* 16-bit ADPCM */
117#define CS4231_STEREO 0x10 /* stereo mode */
118/* bits 3-1 define frequency divisor */
119#define CS4231_XTAL1 0x00 /* 24.576 crystal */
120#define CS4231_XTAL2 0x01 /* 16.9344 crystal */
121
122/* definitions for interface control register - CS4231_IFACE_CTRL */
123
124#define CS4231_RECORD_PIO 0x80 /* record PIO enable */
125#define CS4231_PLAYBACK_PIO 0x40 /* playback PIO enable */
126#define CS4231_CALIB_MODE 0x18 /* calibration mode bits */
127#define CS4231_AUTOCALIB 0x08 /* auto calibrate */
128#define CS4231_SINGLE_DMA 0x04 /* use single DMA channel */
129#define CS4231_RECORD_ENABLE 0x02 /* record enable */
130#define CS4231_PLAYBACK_ENABLE 0x01 /* playback enable */
131
132/* definitions for pin control register - CS4231_PIN_CTRL */
133
134#define CS4231_IRQ_ENABLE 0x02 /* enable IRQ */
135#define CS4231_XCTL1 0x40 /* external control #1 */
136#define CS4231_XCTL0 0x80 /* external control #0 */
137
138/* definitions for test and init register - CS4231_TEST_INIT */
139
140#define CS4231_CALIB_IN_PROGRESS 0x20 /* auto calibrate in progress */
141#define CS4231_DMA_REQUEST 0x10 /* DMA request in progress */
142
143/* definitions for misc control register - CS4231_MISC_INFO */
144
145#define CS4231_MODE2 0x40 /* MODE 2 */
146#define CS4231_IW_MODE3 0x6c /* MODE 3 - InterWave enhanced mode */
147#define CS4231_4236_MODE3 0xe0 /* MODE 3 - CS4236+ enhanced mode */
148
149/* definitions for alternate feature 1 register - CS4231_ALT_FEATURE_1 */
150
151#define CS4231_DACZ 0x01 /* zero DAC when underrun */
152#define CS4231_TIMER_ENABLE 0x40 /* codec timer enable */
153#define CS4231_OLB 0x80 /* output level bit */
154
155/* definitions for Extended Registers - CS4236+ */
156
157#define CS4236_REG(i23val) (((i23val << 2) & 0x10) | ((i23val >> 4) & 0x0f))
158#define CS4236_I23VAL(reg) ((((reg)&0xf) << 4) | (((reg)&0x10) >> 2) | 0x8)
159
160#define CS4236_LEFT_LINE 0x08 /* left LINE alternate volume */
161#define CS4236_RIGHT_LINE 0x18 /* right LINE alternate volume */
162#define CS4236_LEFT_MIC 0x28 /* left MIC volume */
163#define CS4236_RIGHT_MIC 0x38 /* right MIC volume */
164#define CS4236_LEFT_MIX_CTRL 0x48 /* synthesis and left input mixer control */
165#define CS4236_RIGHT_MIX_CTRL 0x58 /* right input mixer control */
166#define CS4236_LEFT_FM 0x68 /* left FM volume */
167#define CS4236_RIGHT_FM 0x78 /* right FM volume */
168#define CS4236_LEFT_DSP 0x88 /* left DSP serial port volume */
169#define CS4236_RIGHT_DSP 0x98 /* right DSP serial port volume */
170#define CS4236_RIGHT_LOOPBACK 0xa8 /* right loopback monitor volume */
171#define CS4236_DAC_MUTE 0xb8 /* DAC mute and IFSE enable */
172#define CS4236_ADC_RATE 0xc8 /* indenpendent ADC sample frequency */
173#define CS4236_DAC_RATE 0xd8 /* indenpendent DAC sample frequency */
174#define CS4236_LEFT_MASTER 0xe8 /* left master digital audio volume */
175#define CS4236_RIGHT_MASTER 0xf8 /* right master digital audio volume */
176#define CS4236_LEFT_WAVE 0x0c /* left wavetable serial port volume */
177#define CS4236_RIGHT_WAVE 0x1c /* right wavetable serial port volume */
178#define CS4236_VERSION 0x9c /* chip version and ID */
179
180#endif /* __SOUND_CS4231_REGS_H */
diff --git a/include/sound/cs4231.h b/include/sound/cs4231.h
index ab51ce1ba9a5..66055d702aa3 100644
--- a/include/sound/cs4231.h
+++ b/include/sound/cs4231.h
@@ -2,7 +2,7 @@
2#define __SOUND_CS4231_H 2#define __SOUND_CS4231_H
3 3
4/* 4/*
5 * Copyright (c) by Jaroslav Kysela <perex@suse.cz> 5 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
6 * Definitions for CS4231 & InterWave chips & compatible chips 6 * Definitions for CS4231 & InterWave chips & compatible chips
7 * 7 *
8 * 8 *
@@ -26,160 +26,7 @@
26#include "pcm.h" 26#include "pcm.h"
27#include "timer.h" 27#include "timer.h"
28 28
29/* IO ports */ 29#include "cs4231-regs.h"
30
31#define CS4231P(x) (c_d_c_CS4231##x)
32
33#define c_d_c_CS4231REGSEL 0
34#define c_d_c_CS4231REG 1
35#define c_d_c_CS4231STATUS 2
36#define c_d_c_CS4231PIO 3
37
38/* codec registers */
39
40#define CS4231_LEFT_INPUT 0x00 /* left input control */
41#define CS4231_RIGHT_INPUT 0x01 /* right input control */
42#define CS4231_AUX1_LEFT_INPUT 0x02 /* left AUX1 input control */
43#define CS4231_AUX1_RIGHT_INPUT 0x03 /* right AUX1 input control */
44#define CS4231_AUX2_LEFT_INPUT 0x04 /* left AUX2 input control */
45#define CS4231_AUX2_RIGHT_INPUT 0x05 /* right AUX2 input control */
46#define CS4231_LEFT_OUTPUT 0x06 /* left output control register */
47#define CS4231_RIGHT_OUTPUT 0x07 /* right output control register */
48#define CS4231_PLAYBK_FORMAT 0x08 /* clock and data format - playback - bits 7-0 MCE */
49#define CS4231_IFACE_CTRL 0x09 /* interface control - bits 7-2 MCE */
50#define CS4231_PIN_CTRL 0x0a /* pin control */
51#define CS4231_TEST_INIT 0x0b /* test and initialization */
52#define CS4231_MISC_INFO 0x0c /* miscellaneaous information */
53#define CS4231_LOOPBACK 0x0d /* loopback control */
54#define CS4231_PLY_UPR_CNT 0x0e /* playback upper base count */
55#define CS4231_PLY_LWR_CNT 0x0f /* playback lower base count */
56#define CS4231_ALT_FEATURE_1 0x10 /* alternate #1 feature enable */
57#define AD1845_AF1_MIC_LEFT 0x10 /* alternate #1 feature + MIC left */
58#define CS4231_ALT_FEATURE_2 0x11 /* alternate #2 feature enable */
59#define AD1845_AF2_MIC_RIGHT 0x11 /* alternate #2 feature + MIC right */
60#define CS4231_LEFT_LINE_IN 0x12 /* left line input control */
61#define CS4231_RIGHT_LINE_IN 0x13 /* right line input control */
62#define CS4231_TIMER_LOW 0x14 /* timer low byte */
63#define CS4231_TIMER_HIGH 0x15 /* timer high byte */
64#define CS4231_LEFT_MIC_INPUT 0x16 /* left MIC input control register (InterWave only) */
65#define AD1845_UPR_FREQ_SEL 0x16 /* upper byte of frequency select */
66#define CS4231_RIGHT_MIC_INPUT 0x17 /* right MIC input control register (InterWave only) */
67#define AD1845_LWR_FREQ_SEL 0x17 /* lower byte of frequency select */
68#define CS4236_EXT_REG 0x17 /* extended register access */
69#define CS4231_IRQ_STATUS 0x18 /* irq status register */
70#define CS4231_LINE_LEFT_OUTPUT 0x19 /* left line output control register (InterWave only) */
71#define CS4231_VERSION 0x19 /* CS4231(A) - version values */
72#define CS4231_MONO_CTRL 0x1a /* mono input/output control */
73#define CS4231_LINE_RIGHT_OUTPUT 0x1b /* right line output control register (InterWave only) */
74#define AD1845_PWR_DOWN 0x1b /* power down control */
75#define CS4235_LEFT_MASTER 0x1b /* left master output control */
76#define CS4231_REC_FORMAT 0x1c /* clock and data format - record - bits 7-0 MCE */
77#define CS4231_PLY_VAR_FREQ 0x1d /* playback variable frequency */
78#define AD1845_CLOCK 0x1d /* crystal clock select and total power down */
79#define CS4235_RIGHT_MASTER 0x1d /* right master output control */
80#define CS4231_REC_UPR_CNT 0x1e /* record upper count */
81#define CS4231_REC_LWR_CNT 0x1f /* record lower count */
82
83/* definitions for codec register select port - CODECP( REGSEL ) */
84
85#define CS4231_INIT 0x80 /* CODEC is initializing */
86#define CS4231_MCE 0x40 /* mode change enable */
87#define CS4231_TRD 0x20 /* transfer request disable */
88
89/* definitions for codec status register - CODECP( STATUS ) */
90
91#define CS4231_GLOBALIRQ 0x01 /* IRQ is active */
92
93/* definitions for codec irq status */
94
95#define CS4231_PLAYBACK_IRQ 0x10
96#define CS4231_RECORD_IRQ 0x20
97#define CS4231_TIMER_IRQ 0x40
98#define CS4231_ALL_IRQS 0x70
99#define CS4231_REC_UNDERRUN 0x08
100#define CS4231_REC_OVERRUN 0x04
101#define CS4231_PLY_OVERRUN 0x02
102#define CS4231_PLY_UNDERRUN 0x01
103
104/* definitions for CS4231_LEFT_INPUT and CS4231_RIGHT_INPUT registers */
105
106#define CS4231_ENABLE_MIC_GAIN 0x20
107
108#define CS4231_MIXS_LINE 0x00
109#define CS4231_MIXS_AUX1 0x40
110#define CS4231_MIXS_MIC 0x80
111#define CS4231_MIXS_ALL 0xc0
112
113/* definitions for clock and data format register - CS4231_PLAYBK_FORMAT */
114
115#define CS4231_LINEAR_8 0x00 /* 8-bit unsigned data */
116#define CS4231_ALAW_8 0x60 /* 8-bit A-law companded */
117#define CS4231_ULAW_8 0x20 /* 8-bit U-law companded */
118#define CS4231_LINEAR_16 0x40 /* 16-bit twos complement data - little endian */
119#define CS4231_LINEAR_16_BIG 0xc0 /* 16-bit twos complement data - big endian */
120#define CS4231_ADPCM_16 0xa0 /* 16-bit ADPCM */
121#define CS4231_STEREO 0x10 /* stereo mode */
122/* bits 3-1 define frequency divisor */
123#define CS4231_XTAL1 0x00 /* 24.576 crystal */
124#define CS4231_XTAL2 0x01 /* 16.9344 crystal */
125
126/* definitions for interface control register - CS4231_IFACE_CTRL */
127
128#define CS4231_RECORD_PIO 0x80 /* record PIO enable */
129#define CS4231_PLAYBACK_PIO 0x40 /* playback PIO enable */
130#define CS4231_CALIB_MODE 0x18 /* calibration mode bits */
131#define CS4231_AUTOCALIB 0x08 /* auto calibrate */
132#define CS4231_SINGLE_DMA 0x04 /* use single DMA channel */
133#define CS4231_RECORD_ENABLE 0x02 /* record enable */
134#define CS4231_PLAYBACK_ENABLE 0x01 /* playback enable */
135
136/* definitions for pin control register - CS4231_PIN_CTRL */
137
138#define CS4231_IRQ_ENABLE 0x02 /* enable IRQ */
139#define CS4231_XCTL1 0x40 /* external control #1 */
140#define CS4231_XCTL0 0x80 /* external control #0 */
141
142/* definitions for test and init register - CS4231_TEST_INIT */
143
144#define CS4231_CALIB_IN_PROGRESS 0x20 /* auto calibrate in progress */
145#define CS4231_DMA_REQUEST 0x10 /* DMA request in progress */
146
147/* definitions for misc control register - CS4231_MISC_INFO */
148
149#define CS4231_MODE2 0x40 /* MODE 2 */
150#define CS4231_IW_MODE3 0x6c /* MODE 3 - InterWave enhanced mode */
151#define CS4231_4236_MODE3 0xe0 /* MODE 3 - CS4236+ enhanced mode */
152
153/* definitions for alternate feature 1 register - CS4231_ALT_FEATURE_1 */
154
155#define CS4231_DACZ 0x01 /* zero DAC when underrun */
156#define CS4231_TIMER_ENABLE 0x40 /* codec timer enable */
157#define CS4231_OLB 0x80 /* output level bit */
158
159/* definitions for Extended Registers - CS4236+ */
160
161#define CS4236_REG(i23val) (((i23val << 2) & 0x10) | ((i23val >> 4) & 0x0f))
162#define CS4236_I23VAL(reg) ((((reg)&0xf) << 4) | (((reg)&0x10) >> 2) | 0x8)
163
164#define CS4236_LEFT_LINE 0x08 /* left LINE alternate volume */
165#define CS4236_RIGHT_LINE 0x18 /* right LINE alternate volume */
166#define CS4236_LEFT_MIC 0x28 /* left MIC volume */
167#define CS4236_RIGHT_MIC 0x38 /* right MIC volume */
168#define CS4236_LEFT_MIX_CTRL 0x48 /* synthesis and left input mixer control */
169#define CS4236_RIGHT_MIX_CTRL 0x58 /* right input mixer control */
170#define CS4236_LEFT_FM 0x68 /* left FM volume */
171#define CS4236_RIGHT_FM 0x78 /* right FM volume */
172#define CS4236_LEFT_DSP 0x88 /* left DSP serial port volume */
173#define CS4236_RIGHT_DSP 0x98 /* right DSP serial port volume */
174#define CS4236_RIGHT_LOOPBACK 0xa8 /* right loopback monitor volume */
175#define CS4236_DAC_MUTE 0xb8 /* DAC mute and IFSE enable */
176#define CS4236_ADC_RATE 0xc8 /* indenpendent ADC sample frequency */
177#define CS4236_DAC_RATE 0xd8 /* indenpendent DAC sample frequency */
178#define CS4236_LEFT_MASTER 0xe8 /* left master digital audio volume */
179#define CS4236_RIGHT_MASTER 0xf8 /* right master digital audio volume */
180#define CS4236_LEFT_WAVE 0x0c /* left wavetable serial port volume */
181#define CS4236_RIGHT_WAVE 0x1c /* right wavetable serial port volume */
182#define CS4236_VERSION 0x9c /* chip version and ID */
183 30
184/* defines for codec.mode */ 31/* defines for codec.mode */
185 32
@@ -210,7 +57,7 @@
210#define CS4231_HW_CS4239 0x0404 /* CS4239 - Crystal Clear (tm) stereo enhancement */ 57#define CS4231_HW_CS4239 0x0404 /* CS4239 - Crystal Clear (tm) stereo enhancement */
211/* compatible, but clones */ 58/* compatible, but clones */
212#define CS4231_HW_INTERWAVE 0x1000 /* InterWave chip */ 59#define CS4231_HW_INTERWAVE 0x1000 /* InterWave chip */
213#define CS4231_HW_OPL3SA2 0x1001 /* OPL3-SA2 chip */ 60#define CS4231_HW_OPL3SA2 0x1101 /* OPL3-SA2 chip, similar to cs4231 */
214 61
215/* defines for codec.hwshare */ 62/* defines for codec.hwshare */
216#define CS4231_HWSHARE_IRQ (1<<0) 63#define CS4231_HWSHARE_IRQ (1<<0)
diff --git a/include/sound/cs46xx.h b/include/sound/cs46xx.h
index 353910ce9755..6b40ee60f4c5 100644
--- a/include/sound/cs46xx.h
+++ b/include/sound/cs46xx.h
@@ -2,7 +2,7 @@
2#define __SOUND_CS46XX_H 2#define __SOUND_CS46XX_H
3 3
4/* 4/*
5 * Copyright (c) by Jaroslav Kysela <perex@suse.cz>, 5 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>,
6 * Cirrus Logic, Inc. 6 * Cirrus Logic, Inc.
7 * Definitions for Cirrus Logic CS46xx chips 7 * Definitions for Cirrus Logic CS46xx chips
8 * 8 *
diff --git a/include/sound/cs46xx_dsp_scb_types.h b/include/sound/cs46xx_dsp_scb_types.h
index 9cb6c7d09567..080857ad0ca2 100644
--- a/include/sound/cs46xx_dsp_scb_types.h
+++ b/include/sound/cs46xx_dsp_scb_types.h
@@ -1,6 +1,6 @@
1/* 1/*
2 * The driver for the Cirrus Logic's Sound Fusion CS46XX based soundcards 2 * The driver for the Cirrus Logic's Sound Fusion CS46XX based soundcards
3 * Copyright (c) by Jaroslav Kysela <perex@suse.cz> 3 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
4 * 4 *
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
diff --git a/include/sound/cs46xx_dsp_spos.h b/include/sound/cs46xx_dsp_spos.h
index d9da9e59cf37..7c44667e79a6 100644
--- a/include/sound/cs46xx_dsp_spos.h
+++ b/include/sound/cs46xx_dsp_spos.h
@@ -1,6 +1,6 @@
1/* 1/*
2 * The driver for the Cirrus Logic's Sound Fusion CS46XX based soundcards 2 * The driver for the Cirrus Logic's Sound Fusion CS46XX based soundcards
3 * Copyright (c) by Jaroslav Kysela <perex@suse.cz> 3 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
4 * 4 *
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
diff --git a/include/sound/cs46xx_dsp_task_types.h b/include/sound/cs46xx_dsp_task_types.h
index b3076c487de6..5cf920bfda27 100644
--- a/include/sound/cs46xx_dsp_task_types.h
+++ b/include/sound/cs46xx_dsp_task_types.h
@@ -1,6 +1,6 @@
1/* 1/*
2 * The driver for the Cirrus Logic's Sound Fusion CS46XX based soundcards 2 * The driver for the Cirrus Logic's Sound Fusion CS46XX based soundcards
3 * Copyright (c) by Jaroslav Kysela <perex@suse.cz> 3 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
4 * 4 *
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
diff --git a/include/sound/cs8403.h b/include/sound/cs8403.h
index c6c3f9f0da78..3a8c174a4209 100644
--- a/include/sound/cs8403.h
+++ b/include/sound/cs8403.h
@@ -3,7 +3,7 @@
3 3
4/* 4/*
5 * Routines for Cirrus Logic CS8403/CS8404A IEC958 (S/PDIF) Transmitter 5 * Routines for Cirrus Logic CS8403/CS8404A IEC958 (S/PDIF) Transmitter
6 * Copyright (c) by Jaroslav Kysela <perex@suse.cz>, 6 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>,
7 * Takashi Iwai <tiwai@suse.de> 7 * Takashi Iwai <tiwai@suse.de>
8 * 8 *
9 * 9 *
diff --git a/include/sound/cs8427.h b/include/sound/cs8427.h
index 97fd9acf8028..f862cfff5f6a 100644
--- a/include/sound/cs8427.h
+++ b/include/sound/cs8427.h
@@ -3,7 +3,7 @@
3 3
4/* 4/*
5 * Routines for Cirrus Logic CS8427 5 * Routines for Cirrus Logic CS8427
6 * Copyright (c) by Jaroslav Kysela <perex@suse.cz>, 6 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>,
7 * 7 *
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
diff --git a/include/sound/driver.h b/include/sound/driver.h
index 3c522e59a33c..5ccb6c5feecb 100644
--- a/include/sound/driver.h
+++ b/include/sound/driver.h
@@ -3,7 +3,7 @@
3 3
4/* 4/*
5 * Main header file for the ALSA driver 5 * Main header file for the ALSA driver
6 * Copyright (c) 1994-2000 by Jaroslav Kysela <perex@suse.cz> 6 * Copyright (c) 1994-2000 by Jaroslav Kysela <perex@perex.cz>
7 * 7 *
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h
index 529d0a564367..441aa06dcd6f 100644
--- a/include/sound/emu10k1.h
+++ b/include/sound/emu10k1.h
@@ -2,7 +2,7 @@
2#define __SOUND_EMU10K1_H 2#define __SOUND_EMU10K1_H
3 3
4/* 4/*
5 * Copyright (c) by Jaroslav Kysela <perex@suse.cz>, 5 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>,
6 * Creative Labs, Inc. 6 * Creative Labs, Inc.
7 * Definitions for EMU10K1 (SB Live!) chips 7 * Definitions for EMU10K1 (SB Live!) chips
8 * 8 *
@@ -1408,8 +1408,6 @@ struct snd_emu10k1_fx8010 {
1408 struct snd_emu10k1_fx8010_irq *irq_handlers; 1408 struct snd_emu10k1_fx8010_irq *irq_handlers;
1409}; 1409};
1410 1410
1411#define emu10k1_gpr_ctl(n) list_entry(n, struct snd_emu10k1_fx8010_ctl, list)
1412
1413struct snd_emu10k1_midi { 1411struct snd_emu10k1_midi {
1414 struct snd_emu10k1 *emu; 1412 struct snd_emu10k1 *emu;
1415 struct snd_rawmidi *rmidi; 1413 struct snd_rawmidi *rmidi;
@@ -1456,6 +1454,9 @@ struct snd_emu1010 {
1456 unsigned int adc_pads; /* bit mask */ 1454 unsigned int adc_pads; /* bit mask */
1457 unsigned int dac_pads; /* bit mask */ 1455 unsigned int dac_pads; /* bit mask */
1458 unsigned int internal_clock; /* 44100 or 48000 */ 1456 unsigned int internal_clock; /* 44100 or 48000 */
1457 unsigned int optical_in; /* 0:SPDIF, 1:ADAT */
1458 unsigned int optical_out; /* 0:SPDIF, 1:ADAT */
1459 struct task_struct *firmware_thread;
1459}; 1460};
1460 1461
1461struct snd_emu10k1 { 1462struct snd_emu10k1 {
@@ -1599,9 +1600,9 @@ unsigned int snd_emu10k1_ptr20_read(struct snd_emu10k1 * emu, unsigned int reg,
1599void snd_emu10k1_ptr20_write(struct snd_emu10k1 *emu, unsigned int reg, unsigned int chn, unsigned int data); 1600void snd_emu10k1_ptr20_write(struct snd_emu10k1 *emu, unsigned int reg, unsigned int chn, unsigned int data);
1600int snd_emu10k1_spi_write(struct snd_emu10k1 * emu, unsigned int data); 1601int snd_emu10k1_spi_write(struct snd_emu10k1 * emu, unsigned int data);
1601int snd_emu10k1_i2c_write(struct snd_emu10k1 *emu, u32 reg, u32 value); 1602int snd_emu10k1_i2c_write(struct snd_emu10k1 *emu, u32 reg, u32 value);
1602int snd_emu1010_fpga_write(struct snd_emu10k1 * emu, int reg, int value); 1603int snd_emu1010_fpga_write(struct snd_emu10k1 * emu, u32 reg, u32 value);
1603int snd_emu1010_fpga_read(struct snd_emu10k1 * emu, int reg, int *value); 1604int snd_emu1010_fpga_read(struct snd_emu10k1 * emu, u32 reg, u32 *value);
1604int snd_emu1010_fpga_link_dst_src_write(struct snd_emu10k1 * emu, int dst, int src); 1605int snd_emu1010_fpga_link_dst_src_write(struct snd_emu10k1 * emu, u32 dst, u32 src);
1605unsigned int snd_emu10k1_efx_read(struct snd_emu10k1 *emu, unsigned int pc); 1606unsigned int snd_emu10k1_efx_read(struct snd_emu10k1 *emu, unsigned int pc);
1606void snd_emu10k1_intr_enable(struct snd_emu10k1 *emu, unsigned int intrenb); 1607void snd_emu10k1_intr_enable(struct snd_emu10k1 *emu, unsigned int intrenb);
1607void snd_emu10k1_intr_disable(struct snd_emu10k1 *emu, unsigned int intrenb); 1608void snd_emu10k1_intr_disable(struct snd_emu10k1 *emu, unsigned int intrenb);
@@ -1746,6 +1747,8 @@ int snd_emu10k1_fx8010_unregister_irq_handler(struct snd_emu10k1 *emu,
1746#define A_FXBUS2(x) (0x80 + (x)) /* x = 0x00 - 0x1f extra outs used for EFX capture -> A_FXWC2 */ 1747#define A_FXBUS2(x) (0x80 + (x)) /* x = 0x00 - 0x1f extra outs used for EFX capture -> A_FXWC2 */
1747#define A_EMU32OUTH(x) (0xa0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_10 - _1F" - ??? */ 1748#define A_EMU32OUTH(x) (0xa0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_10 - _1F" - ??? */
1748#define A_EMU32OUTL(x) (0xb0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_1 - _F" - ??? */ 1749#define A_EMU32OUTL(x) (0xb0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_1 - _F" - ??? */
1750#define A3_EMU32IN(x) (0x160 + (x)) /* x = 0x00 - 0x3f "EMU32_IN_00 - _3F" - Only when .device = 0x0008 */
1751#define A3_EMU32OUT(x) (0x1E0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_00 - _3F" - Only when .device = 0x0008 */
1749#define A_GPR(x) (A_FXGPREGBASE + (x)) 1752#define A_GPR(x) (A_FXGPREGBASE + (x))
1750 1753
1751/* cc_reg constants */ 1754/* cc_reg constants */
diff --git a/include/sound/es1688.h b/include/sound/es1688.h
index fc1c47dae3da..10fcf1465810 100644
--- a/include/sound/es1688.h
+++ b/include/sound/es1688.h
@@ -3,7 +3,7 @@
3 3
4/* 4/*
5 * Header file for ES488/ES1688 5 * Header file for ES488/ES1688
6 * Copyright (c) by Jaroslav Kysela <perex@suse.cz> 6 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
7 * 7 *
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
diff --git a/include/sound/gus.h b/include/sound/gus.h
index c49ea57db8cc..e5433d8b78bc 100644
--- a/include/sound/gus.h
+++ b/include/sound/gus.h
@@ -3,7 +3,7 @@
3 3
4/* 4/*
5 * Global structures used for GUS part of ALSA driver 5 * Global structures used for GUS part of ALSA driver
6 * Copyright (c) by Jaroslav Kysela <perex@suse.cz> 6 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
7 * 7 *
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
diff --git a/include/sound/hda_hwdep.h b/include/sound/hda_hwdep.h
new file mode 100644
index 000000000000..1c0034e87f22
--- /dev/null
+++ b/include/sound/hda_hwdep.h
@@ -0,0 +1,44 @@
1/*
2 * HWDEP Interface for HD-audio codec
3 *
4 * Copyright (c) 2007 Takashi Iwai <tiwai@suse.de>
5 *
6 * This driver is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This driver is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#ifndef __SOUND_HDA_HWDEP_H
22#define __SOUND_HDA_HWDEP_H
23
24#define HDA_HWDEP_VERSION ((1 << 16) | (0 << 8) | (0 << 0)) /* 1.0.0 */
25
26/* verb */
27#define HDA_REG_NID_SHIFT 24
28#define HDA_REG_VERB_SHIFT 8
29#define HDA_REG_VAL_SHIFT 0
30#define HDA_VERB(nid,verb,param) ((nid)<<24 | (verb)<<8 | (param))
31
32struct hda_verb_ioctl {
33 u32 verb; /* HDA_VERB() */
34 u32 res; /* response */
35};
36
37/*
38 * ioctls
39 */
40#define HDA_IOCTL_PVERSION _IOR('H', 0x10, int)
41#define HDA_IOCTL_VERB_WRITE _IOWR('H', 0x11, struct hda_verb_ioctl)
42#define HDA_IOCTL_GET_WCAP _IOWR('H', 0x12, struct hda_verb_ioctl)
43
44#endif
diff --git a/include/sound/hdspm.h b/include/sound/hdspm.h
index c3c854d99c28..81990b2bcc98 100644
--- a/include/sound/hdspm.h
+++ b/include/sound/hdspm.h
@@ -1,4 +1,4 @@
1#ifndef __SOUND_HDSPM_H /* -*- linux-c -*- */ 1#ifndef __SOUND_HDSPM_H
2#define __SOUND_HDSPM_H 2#define __SOUND_HDSPM_H
3/* 3/*
4 * Copyright (C) 2003 Winfried Ritsch (IEM) 4 * Copyright (C) 2003 Winfried Ritsch (IEM)
@@ -61,7 +61,8 @@ struct hdspm_peak_rms_ioctl {
61}; 61};
62 62
63/* use indirect access due to the limit of ioctl bit size */ 63/* use indirect access due to the limit of ioctl bit size */
64#define SNDRV_HDSPM_IOCTL_GET_PEAK_RMS _IOR('H', 0x40, struct hdspm_peak_rms_ioctl) 64#define SNDRV_HDSPM_IOCTL_GET_PEAK_RMS \
65 _IOR('H', 0x40, struct hdspm_peak_rms_ioctl)
65 66
66/* ------------ CONFIG block IOCTL ---------------------- */ 67/* ------------ CONFIG block IOCTL ---------------------- */
67 68
@@ -79,7 +80,8 @@ struct hdspm_config_info {
79 unsigned int analog_out; 80 unsigned int analog_out;
80}; 81};
81 82
82#define SNDRV_HDSPM_IOCTL_GET_CONFIG_INFO _IOR('H', 0x41, struct hdspm_config_info) 83#define SNDRV_HDSPM_IOCTL_GET_CONFIG_INFO \
84 _IOR('H', 0x41, struct hdspm_config_info)
83 85
84 86
85/* get Soundcard Version */ 87/* get Soundcard Version */
@@ -93,10 +95,14 @@ struct hdspm_version {
93 95
94/* ------------- get Matrix Mixer IOCTL --------------- */ 96/* ------------- get Matrix Mixer IOCTL --------------- */
95 97
96/* MADI mixer: 64inputs+64playback in 64outputs = 8192 => *4Byte = 32768 Bytes */ 98/* MADI mixer: 64inputs+64playback in 64outputs = 8192 => *4Byte =
99 * 32768 Bytes
100 */
97 101
98/* organisation is 64 channelfader in a continous memory block */ 102/* organisation is 64 channelfader in a continous memory block */
99/* equivalent to hardware definition, maybe for future feature of mmap of them */ 103/* equivalent to hardware definition, maybe for future feature of mmap of
104 * them
105 */
100/* each of 64 outputs has 64 infader and 64 outfader: 106/* each of 64 outputs has 64 infader and 64 outfader:
101 Ins to Outs mixer[out].in[in], Outstreams to Outs mixer[out].pb[pb] */ 107 Ins to Outs mixer[out].in[in], Outstreams to Outs mixer[out].pb[pb] */
102 108
diff --git a/include/sound/hwdep.h b/include/sound/hwdep.h
index 94c387b5d724..d9eea013c753 100644
--- a/include/sound/hwdep.h
+++ b/include/sound/hwdep.h
@@ -3,7 +3,7 @@
3 3
4/* 4/*
5 * Hardware dependent layer 5 * Hardware dependent layer
6 * Copyright (c) by Jaroslav Kysela <perex@suse.cz> 6 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
7 * 7 *
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
diff --git a/include/sound/info.h b/include/sound/info.h
index 97ffc4fb9969..fecbb1ffd540 100644
--- a/include/sound/info.h
+++ b/include/sound/info.h
@@ -3,7 +3,7 @@
3 3
4/* 4/*
5 * Header file for info interface 5 * Header file for info interface
6 * Copyright (c) by Jaroslav Kysela <perex@suse.cz> 6 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
7 * 7 *
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
diff --git a/include/sound/initval.h b/include/sound/initval.h
index e85b90750a59..1daa6dff8297 100644
--- a/include/sound/initval.h
+++ b/include/sound/initval.h
@@ -3,7 +3,7 @@
3 3
4/* 4/*
5 * Init values for soundcard modules 5 * Init values for soundcard modules
6 * Copyright (c) by Jaroslav Kysela <perex@suse.cz> 6 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
diff --git a/include/sound/memalloc.h b/include/sound/memalloc.h
index 83489c3abbaf..ae2921d9ddcc 100644
--- a/include/sound/memalloc.h
+++ b/include/sound/memalloc.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) by Jaroslav Kysela <perex@suse.cz> 2 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
3 * Takashi Iwai <tiwai@suse.de> 3 * Takashi Iwai <tiwai@suse.de>
4 * 4 *
5 * Generic memory allocators 5 * Generic memory allocators
diff --git a/include/sound/mixer_oss.h b/include/sound/mixer_oss.h
index 197b9e3d612b..51fbcb4a277a 100644
--- a/include/sound/mixer_oss.h
+++ b/include/sound/mixer_oss.h
@@ -3,7 +3,7 @@
3 3
4/* 4/*
5 * OSS MIXER API 5 * OSS MIXER API
6 * Copyright (c) by Jaroslav Kysela <perex@suse.cz> 6 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
7 * 7 *
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
diff --git a/include/sound/mpu401.h b/include/sound/mpu401.h
index d5c1396c4c9e..d45218b44dfe 100644
--- a/include/sound/mpu401.h
+++ b/include/sound/mpu401.h
@@ -3,7 +3,7 @@
3 3
4/* 4/*
5 * Header file for MPU-401 and compatible cards 5 * Header file for MPU-401 and compatible cards
6 * Copyright (c) by Jaroslav Kysela <perex@suse.cz> 6 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
7 * 7 *
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
@@ -50,7 +50,6 @@
50#define MPU401_INFO_INTEGRATED (1 << 2) /* integrated h/w port */ 50#define MPU401_INFO_INTEGRATED (1 << 2) /* integrated h/w port */
51#define MPU401_INFO_MMIO (1 << 3) /* MMIO access */ 51#define MPU401_INFO_MMIO (1 << 3) /* MMIO access */
52#define MPU401_INFO_TX_IRQ (1 << 4) /* independent TX irq */ 52#define MPU401_INFO_TX_IRQ (1 << 4) /* independent TX irq */
53#define MPU401_INFO_UART_ONLY (1 << 5) /* No ENTER_UART cmd needed */
54 53
55#define MPU401_MODE_BIT_INPUT 0 54#define MPU401_MODE_BIT_INPUT 0
56#define MPU401_MODE_BIT_OUTPUT 1 55#define MPU401_MODE_BIT_OUTPUT 1
diff --git a/include/sound/opl3.h b/include/sound/opl3.h
index 82fdb0930720..1d14b3f82393 100644
--- a/include/sound/opl3.h
+++ b/include/sound/opl3.h
@@ -4,7 +4,7 @@
4/* 4/*
5 * Definitions of the OPL-3 registers. 5 * Definitions of the OPL-3 registers.
6 * 6 *
7 * Copyright (c) by Jaroslav Kysela <perex@suse.cz>, 7 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>,
8 * Hannu Savolainen 1993-1996 8 * Hannu Savolainen 1993-1996
9 * 9 *
10 * 10 *
diff --git a/include/sound/pcm-indirect.h b/include/sound/pcm-indirect.h
index 7003d7702e26..1df7acaaa535 100644
--- a/include/sound/pcm-indirect.h
+++ b/include/sound/pcm-indirect.h
@@ -2,7 +2,7 @@
2 * Helper functions for indirect PCM data transfer 2 * Helper functions for indirect PCM data transfer
3 * 3 *
4 * Copyright (c) by Takashi Iwai <tiwai@suse.de> 4 * Copyright (c) by Takashi Iwai <tiwai@suse.de>
5 * Jaroslav Kysela <perex@suse.cz> 5 * Jaroslav Kysela <perex@perex.cz>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 73334e0f823f..5e9cc460075e 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -3,7 +3,7 @@
3 3
4/* 4/*
5 * Digital Audio (PCM) abstract layer 5 * Digital Audio (PCM) abstract layer
6 * Copyright (c) by Jaroslav Kysela <perex@suse.cz> 6 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
7 * Abramo Bagnara <abramo@alsa-project.org> 7 * Abramo Bagnara <abramo@alsa-project.org>
8 * 8 *
9 * 9 *
@@ -301,8 +301,8 @@ struct snd_pcm_runtime {
301 union snd_pcm_sync_id sync; /* hardware synchronization ID */ 301 union snd_pcm_sync_id sync; /* hardware synchronization ID */
302 302
303 /* -- mmap -- */ 303 /* -- mmap -- */
304 volatile struct snd_pcm_mmap_status *status; 304 struct snd_pcm_mmap_status *status;
305 volatile struct snd_pcm_mmap_control *control; 305 struct snd_pcm_mmap_control *control;
306 306
307 /* -- locking / scheduling -- */ 307 /* -- locking / scheduling -- */
308 wait_queue_head_t sleep; 308 wait_queue_head_t sleep;
@@ -791,13 +791,13 @@ static inline struct snd_interval *hw_param_interval(struct snd_pcm_hw_params *p
791static inline const struct snd_mask *hw_param_mask_c(const struct snd_pcm_hw_params *params, 791static inline const struct snd_mask *hw_param_mask_c(const struct snd_pcm_hw_params *params,
792 snd_pcm_hw_param_t var) 792 snd_pcm_hw_param_t var)
793{ 793{
794 return (const struct snd_mask *)hw_param_mask((struct snd_pcm_hw_params*) params, var); 794 return &params->masks[var - SNDRV_PCM_HW_PARAM_FIRST_MASK];
795} 795}
796 796
797static inline const struct snd_interval *hw_param_interval_c(const struct snd_pcm_hw_params *params, 797static inline const struct snd_interval *hw_param_interval_c(const struct snd_pcm_hw_params *params,
798 snd_pcm_hw_param_t var) 798 snd_pcm_hw_param_t var)
799{ 799{
800 return (const struct snd_interval *)hw_param_interval((struct snd_pcm_hw_params*) params, var); 800 return &params->intervals[var - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL];
801} 801}
802 802
803#define params_access(p) snd_mask_min(hw_param_mask((p), SNDRV_PCM_HW_PARAM_ACCESS)) 803#define params_access(p) snd_mask_min(hw_param_mask((p), SNDRV_PCM_HW_PARAM_ACCESS))
@@ -922,7 +922,10 @@ snd_pcm_sframes_t snd_pcm_lib_writev(struct snd_pcm_substream *substream,
922snd_pcm_sframes_t snd_pcm_lib_readv(struct snd_pcm_substream *substream, 922snd_pcm_sframes_t snd_pcm_lib_readv(struct snd_pcm_substream *substream,
923 void __user **bufs, snd_pcm_uframes_t frames); 923 void __user **bufs, snd_pcm_uframes_t frames);
924 924
925extern const struct snd_pcm_hw_constraint_list snd_pcm_known_rates;
926
925int snd_pcm_limit_hw_rates(struct snd_pcm_runtime *runtime); 927int snd_pcm_limit_hw_rates(struct snd_pcm_runtime *runtime);
928unsigned int snd_pcm_rate_to_rate_bit(unsigned int rate);
926 929
927static inline void snd_pcm_set_runtime_buffer(struct snd_pcm_substream *substream, 930static inline void snd_pcm_set_runtime_buffer(struct snd_pcm_substream *substream,
928 struct snd_dma_buffer *bufp) 931 struct snd_dma_buffer *bufp)
diff --git a/include/sound/pcm_oss.h b/include/sound/pcm_oss.h
index 1cd4f64cdf31..cc4e226f35fd 100644
--- a/include/sound/pcm_oss.h
+++ b/include/sound/pcm_oss.h
@@ -3,7 +3,7 @@
3 3
4/* 4/*
5 * Digital Audio (PCM) - OSS compatibility abstract layer 5 * Digital Audio (PCM) - OSS compatibility abstract layer
6 * Copyright (c) by Jaroslav Kysela <perex@suse.cz> 6 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
7 * 7 *
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
diff --git a/include/sound/rawmidi.h b/include/sound/rawmidi.h
index 7dbcd10fa215..b550a416d075 100644
--- a/include/sound/rawmidi.h
+++ b/include/sound/rawmidi.h
@@ -3,7 +3,7 @@
3 3
4/* 4/*
5 * Abstract layer for MIDI v1.0 stream 5 * Abstract layer for MIDI v1.0 stream
6 * Copyright (c) by Jaroslav Kysela <perex@suse.cz> 6 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
7 * 7 *
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
diff --git a/include/sound/sb.h b/include/sound/sb.h
index 3ad854b397d2..d0c9ed3546c8 100644
--- a/include/sound/sb.h
+++ b/include/sound/sb.h
@@ -3,7 +3,7 @@
3 3
4/* 4/*
5 * Header file for SoundBlaster cards 5 * Header file for SoundBlaster cards
6 * Copyright (c) by Jaroslav Kysela <perex@suse.cz> 6 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
7 * 7 *
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
diff --git a/include/sound/seq_instr.h b/include/sound/seq_instr.h
index f2db03bfd74e..93b0c51df5b0 100644
--- a/include/sound/seq_instr.h
+++ b/include/sound/seq_instr.h
@@ -3,7 +3,7 @@
3 3
4/* 4/*
5 * Main kernel header file for the ALSA sequencer 5 * Main kernel header file for the ALSA sequencer
6 * Copyright (c) 1999 by Jaroslav Kysela <perex@suse.cz> 6 * Copyright (c) 1999 by Jaroslav Kysela <perex@perex.cz>
7 * 7 *
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
diff --git a/include/sound/seq_midi_event.h b/include/sound/seq_midi_event.h
index dd789e7cdb20..5efab8b29c57 100644
--- a/include/sound/seq_midi_event.h
+++ b/include/sound/seq_midi_event.h
@@ -5,7 +5,7 @@
5 * MIDI byte <-> sequencer event coder 5 * MIDI byte <-> sequencer event coder
6 * 6 *
7 * Copyright (C) 1998,99 Takashi Iwai <tiwai@suse.de>, 7 * Copyright (C) 1998,99 Takashi Iwai <tiwai@suse.de>,
8 * Jaroslav Kysela <perex@suse.cz> 8 * Jaroslav Kysela <perex@perex.cz>
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by 11 * it under the terms of the GNU General Public License as published by
diff --git a/include/sound/seq_virmidi.h b/include/sound/seq_virmidi.h
index 8d5aea76d7c3..d888433a3096 100644
--- a/include/sound/seq_virmidi.h
+++ b/include/sound/seq_virmidi.h
@@ -4,7 +4,7 @@
4/* 4/*
5 * Virtual Raw MIDI client on Sequencer 5 * Virtual Raw MIDI client on Sequencer
6 * Copyright (c) 2000 by Takashi Iwai <tiwai@suse.de>, 6 * Copyright (c) 2000 by Takashi Iwai <tiwai@suse.de>,
7 * Jaroslav Kysela <perex@suse.cz> 7 * Jaroslav Kysela <perex@perex.cz>
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by 10 * it under the terms of the GNU General Public License as published by
diff --git a/include/sound/soc.h b/include/sound/soc.h
index db6edba8ef08..f47ef1f75f18 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -201,8 +201,7 @@ int snd_soc_info_volsw(struct snd_kcontrol *kcontrol,
201 struct snd_ctl_elem_info *uinfo); 201 struct snd_ctl_elem_info *uinfo);
202int snd_soc_info_volsw_ext(struct snd_kcontrol *kcontrol, 202int snd_soc_info_volsw_ext(struct snd_kcontrol *kcontrol,
203 struct snd_ctl_elem_info *uinfo); 203 struct snd_ctl_elem_info *uinfo);
204int snd_soc_info_bool_ext(struct snd_kcontrol *kcontrol, 204#define snd_soc_info_bool_ext snd_ctl_boolean_mono
205 struct snd_ctl_elem_info *uinfo);
206int snd_soc_get_volsw(struct snd_kcontrol *kcontrol, 205int snd_soc_get_volsw(struct snd_kcontrol *kcontrol,
207 struct snd_ctl_elem_value *ucontrol); 206 struct snd_ctl_elem_value *ucontrol);
208int snd_soc_put_volsw(struct snd_kcontrol *kcontrol, 207int snd_soc_put_volsw(struct snd_kcontrol *kcontrol,
diff --git a/include/sound/tea575x-tuner.h b/include/sound/tea575x-tuner.h
index b5067d3c2387..e8eeb3a1ed29 100644
--- a/include/sound/tea575x-tuner.h
+++ b/include/sound/tea575x-tuner.h
@@ -4,7 +4,7 @@
4/* 4/*
5 * ALSA driver for TEA5757/5759 Philips AM/FM tuner chips 5 * ALSA driver for TEA5757/5759 Philips AM/FM tuner chips
6 * 6 *
7 * Copyright (c) 2004 Jaroslav Kysela <perex@suse.cz> 7 * Copyright (c) 2004 Jaroslav Kysela <perex@perex.cz>
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by 10 * it under the terms of the GNU General Public License as published by
diff --git a/include/sound/timer.h b/include/sound/timer.h
index d42c083db1da..7990469a44ce 100644
--- a/include/sound/timer.h
+++ b/include/sound/timer.h
@@ -3,7 +3,7 @@
3 3
4/* 4/*
5 * Timer abstract layer 5 * Timer abstract layer
6 * Copyright (c) by Jaroslav Kysela <perex@suse.cz>, 6 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>,
7 * Abramo Bagnara <abramo@alsa-project.org> 7 * Abramo Bagnara <abramo@alsa-project.org>
8 * 8 *
9 * 9 *
diff --git a/include/sound/tlv.h b/include/sound/tlv.h
index d93a96b91875..d136ea2181ed 100644
--- a/include/sound/tlv.h
+++ b/include/sound/tlv.h
@@ -3,7 +3,7 @@
3 3
4/* 4/*
5 * Advanced Linux Sound Architecture - ALSA - Driver 5 * Advanced Linux Sound Architecture - ALSA - Driver
6 * Copyright (c) 2006 by Jaroslav Kysela <perex@suse.cz> 6 * Copyright (c) 2006 by Jaroslav Kysela <perex@perex.cz>
7 * 7 *
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
diff --git a/include/sound/version.h b/include/sound/version.h
index 6bbcfefd2c38..8d4a8dd89237 100644
--- a/include/sound/version.h
+++ b/include/sound/version.h
@@ -1,3 +1,3 @@
1/* include/version.h. Generated by alsa/ksync script. */ 1/* include/version.h. Generated by alsa/ksync script. */
2#define CONFIG_SND_VERSION "1.0.14" 2#define CONFIG_SND_VERSION "1.0.15"
3#define CONFIG_SND_DATE " (Fri Jul 20 09:12:58 2007 UTC)" 3#define CONFIG_SND_DATE " (Tue Oct 16 14:57:44 2007 UTC)"
diff --git a/include/sound/ymfpci.h b/include/sound/ymfpci.h
index 203d2b45b788..05ead6698434 100644
--- a/include/sound/ymfpci.h
+++ b/include/sound/ymfpci.h
@@ -2,7 +2,7 @@
2#define __SOUND_YMFPCI_H 2#define __SOUND_YMFPCI_H
3 3
4/* 4/*
5 * Copyright (c) by Jaroslav Kysela <perex@suse.cz> 5 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
6 * Definitions for Yahama YMF724/740/744/754 chips 6 * Definitions for Yahama YMF724/740/744/754 chips
7 * 7 *
8 * 8 *
diff --git a/include/video/Kbuild b/include/video/Kbuild
index a14f9c045b8c..53a6c7310e61 100644
--- a/include/video/Kbuild
+++ b/include/video/Kbuild
@@ -1 +1 @@
unifdef-y += sisfb.h unifdef-y += sisfb.h uvesafb.h
diff --git a/include/video/mbxfb.h b/include/video/mbxfb.h
index 20b9002712ef..ea18961fc5e7 100644
--- a/include/video/mbxfb.h
+++ b/include/video/mbxfb.h
@@ -29,18 +29,18 @@ struct mbxfb_platform_data {
29}; 29};
30 30
31/* planar */ 31/* planar */
32#define MBXFB_FMT_YUV12 0 32#define MBXFB_FMT_YUV16 0
33#define MBXFB_FMT_YUV12 1
33 34
34/* packed */ 35/* packed */
35#define MBXFB_FMT_UY0VY1 1 36#define MBXFB_FMT_UY0VY1 2
36#define MBXFB_FMT_VY0UY1 2 37#define MBXFB_FMT_VY0UY1 3
37#define MBXFB_FMT_Y0UY1V 3 38#define MBXFB_FMT_Y0UY1V 4
38#define MBXFB_FMT_Y0VY1U 4 39#define MBXFB_FMT_Y0VY1U 5
39struct mbxfb_overlaySetup { 40struct mbxfb_overlaySetup {
40 __u32 enable; 41 __u32 enable;
41 __u32 x, y; 42 __u32 x, y;
42 __u32 width, height; 43 __u32 width, height;
43 __u32 alpha;
44 __u32 fmt; 44 __u32 fmt;
45 __u32 mem_offset; 45 __u32 mem_offset;
46 __u32 scaled_width; 46 __u32 scaled_width;
@@ -54,6 +54,45 @@ struct mbxfb_overlaySetup {
54 __u16 UV_stride; 54 __u16 UV_stride;
55}; 55};
56 56
57#define MBXFB_IOCX_OVERLAY _IOWR(0xF4, 0x00,struct mbxfb_overlaySetup) 57#define MBXFB_ALPHABLEND_NONE 0
58#define MBXFB_ALPHABLEND_GLOBAL 1
59#define MBXFB_ALPHABLEND_PIXEL 2
60
61#define MBXFB_COLORKEY_DISABLED 0
62#define MBXFB_COLORKEY_PREVIOUS 1
63#define MBXFB_COLORKEY_CURRENT 2
64struct mbxfb_alphaCtl {
65 __u8 overlay_blend_mode;
66 __u8 overlay_colorkey_mode;
67 __u8 overlay_global_alpha;
68 __u32 overlay_colorkey;
69 __u32 overlay_colorkey_mask;
70
71 __u8 graphics_blend_mode;
72 __u8 graphics_colorkey_mode;
73 __u8 graphics_global_alpha;
74 __u32 graphics_colorkey;
75 __u32 graphics_colorkey_mask;
76};
77
78#define MBXFB_PLANE_GRAPHICS 0
79#define MBXFB_PLANE_VIDEO 1
80struct mbxfb_planeorder {
81 __u8 bottom;
82 __u8 top;
83};
84
85struct mbxfb_reg {
86 __u32 addr; /* offset from 0x03fe 0000 */
87 __u32 val; /* value */
88 __u32 mask; /* which bits to touch (for write) */
89};
90
91#define MBXFB_IOCX_OVERLAY _IOWR(0xF4, 0x00,struct mbxfb_overlaySetup)
92#define MBXFB_IOCG_ALPHA _IOR(0xF4, 0x01,struct mbxfb_alphaCtl)
93#define MBXFB_IOCS_ALPHA _IOW(0xF4, 0x02,struct mbxfb_alphaCtl)
94#define MBXFB_IOCS_PLANEORDER _IOR(0xF4, 0x03,struct mbxfb_planeorder)
95#define MBXFB_IOCS_REG _IOW(0xF4, 0x04,struct mbxfb_reg)
96#define MBXFB_IOCX_REG _IOWR(0xF4, 0x05,struct mbxfb_reg)
58 97
59#endif /* __MBX_FB_H */ 98#endif /* __MBX_FB_H */
diff --git a/include/video/permedia2.h b/include/video/permedia2.h
index 9e49c9571ec3..9ce9adbfda2b 100644
--- a/include/video/permedia2.h
+++ b/include/video/permedia2.h
@@ -58,7 +58,14 @@
58#define PM2R_RD_PALETTE_DATA 0x4008 58#define PM2R_RD_PALETTE_DATA 0x4008
59#define PM2R_RD_PIXEL_MASK 0x4010 59#define PM2R_RD_PIXEL_MASK 0x4010
60#define PM2R_RD_PALETTE_READ_ADDRESS 0x4018 60#define PM2R_RD_PALETTE_READ_ADDRESS 0x4018
61#define PM2R_RD_CURSOR_COLOR_ADDRESS 0x4020
62#define PM2R_RD_CURSOR_COLOR_DATA 0x4028
61#define PM2R_RD_INDEXED_DATA 0x4050 63#define PM2R_RD_INDEXED_DATA 0x4050
64#define PM2R_RD_CURSOR_DATA 0x4058
65#define PM2R_RD_CURSOR_X_LSB 0x4060
66#define PM2R_RD_CURSOR_X_MSB 0x4068
67#define PM2R_RD_CURSOR_Y_LSB 0x4070
68#define PM2R_RD_CURSOR_Y_MSB 0x4078
62 69
63#define PM2R_START_X_DOM 0x8000 70#define PM2R_START_X_DOM 0x8000
64#define PM2R_D_X_DOM 0x8008 71#define PM2R_D_X_DOM 0x8008
@@ -68,11 +75,14 @@
68#define PM2R_D_Y 0x8028 75#define PM2R_D_Y 0x8028
69#define PM2R_COUNT 0x8030 76#define PM2R_COUNT 0x8030
70#define PM2R_RENDER 0x8038 77#define PM2R_RENDER 0x8038
78#define PM2R_BIT_MASK_PATTERN 0x8068
71#define PM2R_RASTERIZER_MODE 0x80a0 79#define PM2R_RASTERIZER_MODE 0x80a0
72#define PM2R_RECTANGLE_ORIGIN 0x80d0 80#define PM2R_RECTANGLE_ORIGIN 0x80d0
73#define PM2R_RECTANGLE_SIZE 0x80d8 81#define PM2R_RECTANGLE_SIZE 0x80d8
74#define PM2R_PACKED_DATA_LIMITS 0x8150 82#define PM2R_PACKED_DATA_LIMITS 0x8150
75#define PM2R_SCISSOR_MODE 0x8180 83#define PM2R_SCISSOR_MODE 0x8180
84#define PM2R_SCISSOR_MIN_XY 0x8188
85#define PM2R_SCISSOR_MAX_XY 0x8190
76#define PM2R_SCREEN_SIZE 0x8198 86#define PM2R_SCREEN_SIZE 0x8198
77#define PM2R_AREA_STIPPLE_MODE 0x81a0 87#define PM2R_AREA_STIPPLE_MODE 0x81a0
78#define PM2R_WINDOW_ORIGIN 0x81c8 88#define PM2R_WINDOW_ORIGIN 0x81c8
@@ -83,7 +93,9 @@
83#define PM2R_TEXEL_LUT_MODE 0x8678 93#define PM2R_TEXEL_LUT_MODE 0x8678
84#define PM2R_TEXTURE_COLOR_MODE 0x8680 94#define PM2R_TEXTURE_COLOR_MODE 0x8680
85#define PM2R_FOG_MODE 0x8690 95#define PM2R_FOG_MODE 0x8690
96#define PM2R_TEXEL0 0x8760
86#define PM2R_COLOR_DDA_MODE 0x87e0 97#define PM2R_COLOR_DDA_MODE 0x87e0
98#define PM2R_CONSTANT_COLOR 0x87e8
87#define PM2R_ALPHA_BLEND_MODE 0x8810 99#define PM2R_ALPHA_BLEND_MODE 0x8810
88#define PM2R_DITHER_MODE 0x8818 100#define PM2R_DITHER_MODE 0x8818
89#define PM2R_FB_SOFT_WRITE_MASK 0x8820 101#define PM2R_FB_SOFT_WRITE_MASK 0x8820
@@ -148,6 +160,7 @@
148#define PM2VI_RD_CURSOR_Y_HIGH 0x00A 160#define PM2VI_RD_CURSOR_Y_HIGH 0x00A
149#define PM2VI_RD_CURSOR_X_HOT 0x00B 161#define PM2VI_RD_CURSOR_X_HOT 0x00B
150#define PM2VI_RD_CURSOR_Y_HOT 0x00C 162#define PM2VI_RD_CURSOR_Y_HOT 0x00C
163#define PM2VI_RD_OVERLAY_KEY 0x00D
151#define PM2VI_RD_CLK0_PRESCALE 0x201 164#define PM2VI_RD_CLK0_PRESCALE 0x201
152#define PM2VI_RD_CLK0_FEEDBACK 0x202 165#define PM2VI_RD_CLK0_FEEDBACK 0x202
153#define PM2VI_RD_CLK0_POSTSCALE 0x203 166#define PM2VI_RD_CLK0_POSTSCALE 0x203
@@ -169,6 +182,8 @@
169#define PM2F_RENDER_TRAPEZOID (1L<<6) 182#define PM2F_RENDER_TRAPEZOID (1L<<6)
170#define PM2F_RENDER_POINT (2L<<6) 183#define PM2F_RENDER_POINT (2L<<6)
171#define PM2F_RENDER_RECTANGLE (3L<<6) 184#define PM2F_RENDER_RECTANGLE (3L<<6)
185#define PM2F_RENDER_SYNC_ON_BIT_MASK (1L<<11)
186#define PM2F_RENDER_TEXTURE_ENABLE (1L<<13)
172#define PM2F_SYNCHRONIZATION (1L<<10) 187#define PM2F_SYNCHRONIZATION (1L<<10)
173#define PM2F_PLL_LOCKED 0x10 188#define PM2F_PLL_LOCKED 0x10
174#define PM2F_BEING_RESET (1L<<31) 189#define PM2F_BEING_RESET (1L<<31)
@@ -224,6 +239,8 @@
224#define PM2F_APERTURE_STANDARD 0 239#define PM2F_APERTURE_STANDARD 0
225#define PM2F_APERTURE_BYTESWAP 1 240#define PM2F_APERTURE_BYTESWAP 1
226#define PM2F_APERTURE_HALFWORDSWAP 2 241#define PM2F_APERTURE_HALFWORDSWAP 2
242#define PM2F_CURSORMODE_CURSOR_ENABLE (1 << 0)
243#define PM2F_CURSORMODE_TYPE_X (1 << 4)
227 244
228typedef enum { 245typedef enum {
229 PM2_TYPE_PERMEDIA2, 246 PM2_TYPE_PERMEDIA2,
diff --git a/include/video/pm3fb.h b/include/video/pm3fb.h
index d52e45a1e9b8..2b85134fe96f 100644
--- a/include/video/pm3fb.h
+++ b/include/video/pm3fb.h
@@ -1,6 +1,6 @@
1/* 1/*
2 * linux/drivers/video/pm3fb.h -- 3DLabs Permedia3 frame buffer device 2 * linux/drivers/video/pm3fb.h -- 3DLabs Permedia3 frame buffer device
3 * 3 *
4 * Copyright (C) 2001 Romain Dolbeau <dolbeau@irisa.fr> 4 * Copyright (C) 2001 Romain Dolbeau <dolbeau@irisa.fr>
5 * Copyright (C) 2001 Sven Luther, <luther@dpt-info.u-strasbg.fr> 5 * Copyright (C) 2001 Sven Luther, <luther@dpt-info.u-strasbg.fr>
6 * 6 *
@@ -51,37 +51,36 @@
51* GLINT Permedia3 Region 0 Bypass Controls * 51* GLINT Permedia3 Region 0 Bypass Controls *
52***********************************************/ 52***********************************************/
53#define PM3ByAperture1Mode 0x0300 53#define PM3ByAperture1Mode 0x0300
54 #define PM3ByApertureMode_BYTESWAP_ABCD (0<<0) 54 #define PM3ByApertureMode_BYTESWAP_ABCD (0 << 0)
55 #define PM3ByApertureMode_BYTESWAP_BADC (1<<0) 55 #define PM3ByApertureMode_BYTESWAP_BADC (1 << 0)
56 #define PM3ByApertureMode_BYTESWAP_CDAB (2<<0) 56 #define PM3ByApertureMode_BYTESWAP_CDAB (2 << 0)
57 #define PM3ByApertureMode_BYTESWAP_DCBA (3<<0) 57 #define PM3ByApertureMode_BYTESWAP_DCBA (3 << 0)
58 #define PM3ByApertureMode_PATCH_DISABLE (0<<2) 58 #define PM3ByApertureMode_PATCH_ENABLE (1 << 2)
59 #define PM3ByApertureMode_PATCH_ENABLE (1<<2) 59 #define PM3ByApertureMode_FORMAT_RAW (0 << 3)
60 #define PM3ByApertureMode_FORMAT_RAW (0<<3) 60 #define PM3ByApertureMode_FORMAT_YUYV (1 << 3)
61 #define PM3ByApertureMode_FORMAT_YUYV (1<<3) 61 #define PM3ByApertureMode_FORMAT_UYVY (2 << 3)
62 #define PM3ByApertureMode_FORMAT_UYVY (2<<3) 62 #define PM3ByApertureMode_PIXELSIZE_8BIT (0 << 5)
63 #define PM3ByApertureMode_PIXELSIZE_8BIT (0<<5) 63 #define PM3ByApertureMode_PIXELSIZE_16BIT (1 << 5)
64 #define PM3ByApertureMode_PIXELSIZE_16BIT (1<<5) 64 #define PM3ByApertureMode_PIXELSIZE_32BIT (2 << 5)
65 #define PM3ByApertureMode_PIXELSIZE_32BIT (2<<5) 65 #define PM3ByApertureMode_PIXELSIZE_MASK (3 << 5)
66 #define PM3ByApertureMode_PIXELSIZE_MASK (3<<5) 66 #define PM3ByApertureMode_EFFECTIVE_STRIDE_1024 (0 << 7)
67 #define PM3ByApertureMode_EFFECTIVE_STRIDE_1024 (0<<7) 67 #define PM3ByApertureMode_EFFECTIVE_STRIDE_2048 (1 << 7)
68 #define PM3ByApertureMode_EFFECTIVE_STRIDE_2048 (1<<7) 68 #define PM3ByApertureMode_EFFECTIVE_STRIDE_4096 (2 << 7)
69 #define PM3ByApertureMode_EFFECTIVE_STRIDE_4096 (2<<7) 69 #define PM3ByApertureMode_EFFECTIVE_STRIDE_8192 (3 << 7)
70 #define PM3ByApertureMode_EFFECTIVE_STRIDE_8192 (3<<7) 70 #define PM3ByApertureMode_PATCH_OFFSET_X(off) (((off) & 0x7f) << 9)
71 #define PM3ByApertureMode_PATCH_OFFSET_X(off) (((off)&7f)<<9) 71 #define PM3ByApertureMode_PATCH_OFFSET_Y(off) (((off) & 0x7f) << 16)
72 #define PM3ByApertureMode_PATCH_OFFSET_Y(off) (((off)&7f)<<16) 72 #define PM3ByApertureMode_FRAMEBUFFER (0 << 21)
73 #define PM3ByApertureMode_FRAMEBUFFER (0<<21) 73 #define PM3ByApertureMode_LOCALBUFFER (1 << 21)
74 #define PM3ByApertureMode_LOCALBUFFER (1<<21) 74 #define PM3ByApertureMode_DOUBLE_WRITE_OFF (0 << 22)
75 #define PM3ByApertureMode_DOUBLE_WRITE_OFF (0<<22) 75 #define PM3ByApertureMode_DOUBLE_WRITE_1MB (1 << 22)
76 #define PM3ByApertureMode_DOUBLE_WRITE_1MB (1<<22) 76 #define PM3ByApertureMode_DOUBLE_WRITE_2MB (2 << 22)
77 #define PM3ByApertureMode_DOUBLE_WRITE_2MB (2<<22) 77 #define PM3ByApertureMode_DOUBLE_WRITE_4MB (3 << 22)
78 #define PM3ByApertureMode_DOUBLE_WRITE_4MB (3<<22) 78 #define PM3ByApertureMode_DOUBLE_WRITE_8MB (4 << 22)
79 #define PM3ByApertureMode_DOUBLE_WRITE_8MB (4<<22) 79 #define PM3ByApertureMode_DOUBLE_WRITE_16MB (5 << 22)
80 #define PM3ByApertureMode_DOUBLE_WRITE_16MB (5<<22) 80 #define PM3ByApertureMode_DOUBLE_WRITE_32MB (6 << 22)
81 #define PM3ByApertureMode_DOUBLE_WRITE_32MB (6<<22)
82 81
83#define PM3ByAperture2Mode 0x0328 82#define PM3ByAperture2Mode 0x0328
84 83
85/********************************************** 84/**********************************************
86* GLINT Permedia3 Memory Control (0x1000) * 85* GLINT Permedia3 Memory Control (0x1000) *
87***********************************************/ 86***********************************************/
@@ -89,7 +88,7 @@
89#define PM3MemBypassWriteMask 0x1008 88#define PM3MemBypassWriteMask 0x1008
90#define PM3MemScratch 0x1010 89#define PM3MemScratch 0x1010
91#define PM3LocalMemCaps 0x1018 90#define PM3LocalMemCaps 0x1018
92 #define PM3LocalMemCaps_NoWriteMask (1 << 28) 91 #define PM3LocalMemCaps_NoWriteMask (1 << 28)
93#define PM3LocalMemTimings 0x1020 92#define PM3LocalMemTimings 0x1020
94#define PM3LocalMemControl 0x1028 93#define PM3LocalMemControl 0x1028
95#define PM3LocalMemRefresh 0x1030 94#define PM3LocalMemRefresh 0x1030
@@ -112,45 +111,41 @@
112#define PM3VsStart 0x3048 111#define PM3VsStart 0x3048
113#define PM3VsEnd 0x3050 112#define PM3VsEnd 0x3050
114#define PM3VideoControl 0x3058 113#define PM3VideoControl 0x3058
115 #define PM3VideoControl_DISABLE (0<<0) 114 #define PM3VideoControl_ENABLE (1 << 0)
116 #define PM3VideoControl_ENABLE (1<<0) 115 #define PM3VideoControl_BLANK_ACTIVE_HIGH (0 << 1)
117 #define PM3VideoControl_BLANK_ACTIVE_HIGH (0<<1) 116 #define PM3VideoControl_BLANK_ACTIVE_LOW (1 << 1)
118 #define PM3VideoControl_BLANK_ACTIVE_LOW (1<<1) 117 #define PM3VideoControl_LINE_DOUBLE_OFF (0 << 2)
119 #define PM3VideoControl_LINE_DOUBLE_OFF (0<<2) 118 #define PM3VideoControl_LINE_DOUBLE_ON (1 << 2)
120 #define PM3VideoControl_LINE_DOUBLE_ON (1<<2) 119 #define PM3VideoControl_HSYNC_FORCE_HIGH (0 << 3)
121 #define PM3VideoControl_HSYNC_FORCE_HIGH (0<<3) 120 #define PM3VideoControl_HSYNC_ACTIVE_HIGH (1 << 3)
122 #define PM3VideoControl_HSYNC_ACTIVE_HIGH (1<<3) 121 #define PM3VideoControl_HSYNC_FORCE_LOW (2 << 3)
123 #define PM3VideoControl_HSYNC_FORCE_LOW (2<<3) 122 #define PM3VideoControl_HSYNC_ACTIVE_LOW (3 << 3)
124 #define PM3VideoControl_HSYNC_ACTIVE_LOW (3<<3) 123 #define PM3VideoControl_HSYNC_MASK (3 << 3)
125 #define PM3VideoControl_HSYNC_MASK (3<<3) 124 #define PM3VideoControl_VSYNC_FORCE_HIGH (0 << 5)
126 #define PM3VideoControl_VSYNC_FORCE_HIGH (0<<5) 125 #define PM3VideoControl_VSYNC_ACTIVE_HIGH (1 << 5)
127 #define PM3VideoControl_VSYNC_ACTIVE_HIGH (1<<5) 126 #define PM3VideoControl_VSYNC_FORCE_LOW (2 << 5)
128 #define PM3VideoControl_VSYNC_FORCE_LOW (2<<5) 127 #define PM3VideoControl_VSYNC_ACTIVE_LOW (3 << 5)
129 #define PM3VideoControl_VSYNC_ACTIVE_LOW (3<<5) 128 #define PM3VideoControl_VSYNC_MASK (3 << 5)
130 #define PM3VideoControl_VSYNC_MASK (3<<5) 129 #define PM3VideoControl_BYTE_DOUBLE_OFF (0 << 7)
131 #define PM3VideoControl_BYTE_DOUBLE_OFF (0<<7) 130 #define PM3VideoControl_BYTE_DOUBLE_ON (1 << 7)
132 #define PM3VideoControl_BYTE_DOUBLE_ON (1<<7) 131 #define PM3VideoControl_BUFFER_SWAP_SYNCON_FRAMEBLANK (0 << 9)
133 #define PM3VideoControl_BUFFER_SWAP_SYNCON_FRAMEBLANK (0<<9) 132 #define PM3VideoControl_BUFFER_SWAP_FREE_RUNNING (1 << 9)
134 #define PM3VideoControl_BUFFER_SWAP_FREE_RUNNING (1<<9) 133 #define PM3VideoControl_BUFFER_SWAP_LIMITETO_FRAMERATE (2 << 9)
135 #define PM3VideoControl_BUFFER_SWAP_LIMITETO_FRAMERATE (2<<9) 134 #define PM3VideoControl_STEREO_ENABLE (1 << 11)
136 #define PM3VideoControl_STEREO_DISABLE (0<<11) 135 #define PM3VideoControl_RIGHT_EYE_ACTIVE_HIGH (0 << 12)
137 #define PM3VideoControl_STEREO_ENABLE (1<<11) 136 #define PM3VideoControl_RIGHT_EYE_ACTIVE_LOW (1 << 12)
138 #define PM3VideoControl_RIGHT_EYE_ACTIVE_HIGH (0<<12) 137 #define PM3VideoControl_VIDEO_EXT_LOW (0 << 14)
139 #define PM3VideoControl_RIGHT_EYE_ACTIVE_LOW (1<<12) 138 #define PM3VideoControl_VIDEO_EXT_HIGH (1 << 14)
140 #define PM3VideoControl_VIDEO_EXT_LOW (0<<14) 139 #define PM3VideoControl_SYNC_MODE_INDEPENDENT (0 << 16)
141 #define PM3VideoControl_VIDEO_EXT_HIGH (1<<14) 140 #define PM3VideoControl_SYNC_MODE_SYNCTO_VSA (1 << 16)
142 #define PM3VideoControl_SYNC_MODE_INDEPENDENT (0<<16) 141 #define PM3VideoControl_SYNC_MODE_SYNCTO_VSB (2 << 16)
143 #define PM3VideoControl_SYNC_MODE_SYNCTO_VSA (1<<16) 142 #define PM3VideoControl_PATCH_ENABLE (1 << 18)
144 #define PM3VideoControl_SYNC_MODE_SYNCTO_VSB (2<<16) 143 #define PM3VideoControl_PIXELSIZE_8BIT (0 << 19)
145 #define PM3VideoControl_PATCH_DISABLE (0<<18) 144 #define PM3VideoControl_PIXELSIZE_16BIT (1 << 19)
146 #define PM3VideoControl_PATCH_ENABLE (1<<18) 145 #define PM3VideoControl_PIXELSIZE_32BIT (2 << 19)
147 #define PM3VideoControl_PIXELSIZE_8BIT (0<<19) 146 #define PM3VideoControl_DISPLAY_ENABLE (1 << 21)
148 #define PM3VideoControl_PIXELSIZE_16BIT (1<<19) 147 #define PM3VideoControl_PATCH_OFFSET_X(off) (((off) & 0x3f) << 22)
149 #define PM3VideoControl_PIXELSIZE_32BIT (2<<19) 148 #define PM3VideoControl_PATCH_OFFSET_Y(off) (((off) & 0x3f) << 28)
150 #define PM3VideoControl_DISPLAY_DISABLE (0<<21)
151 #define PM3VideoControl_DISPLAY_ENABLE (1<<21)
152 #define PM3VideoControl_PATCH_OFFSET_X(off) (((off)&0x3f)<<22)
153 #define PM3VideoControl_PATCH_OFFSET_Y(off) (((off)&0x3f)<<28)
154#define PM3InterruptLine 0x3060 149#define PM3InterruptLine 0x3060
155#define PM3DisplayData 0x3068 150#define PM3DisplayData 0x3068
156#define PM3VerticalLineCount 0x3070 151#define PM3VerticalLineCount 0x3070
@@ -159,80 +154,93 @@
159#define PM3MiscControl 0x3088 154#define PM3MiscControl 0x3088
160 155
161#define PM3VideoOverlayUpdate 0x3100 156#define PM3VideoOverlayUpdate 0x3100
162 #define PM3VideoOverlayUpdate_DISABLE (0<<0) 157 #define PM3VideoOverlayUpdate_ENABLE (1 << 0)
163 #define PM3VideoOverlayUpdate_ENABLE (1<<0)
164#define PM3VideoOverlayMode 0x3108 158#define PM3VideoOverlayMode 0x3108
165 #define PM3VideoOverlayMode_DISABLE (0<<0) 159 #define PM3VideoOverlayMode_ENABLE (1 << 0)
166 #define PM3VideoOverlayMode_ENABLE (1<<0) 160 #define PM3VideoOverlayMode_BUFFERSYNC_MANUAL (0 << 1)
167 #define PM3VideoOverlayMode_BUFFERSYNC_MANUAL (0<<1) 161 #define PM3VideoOverlayMode_BUFFERSYNC_VIDEOSTREAMA (1 << 1)
168 #define PM3VideoOverlayMode_BUFFERSYNC_VIDEOSTREAMA (1<<1) 162 #define PM3VideoOverlayMode_BUFFERSYNC_VIDEOSTREAMB (2 << 1)
169 #define PM3VideoOverlayMode_BUFFERSYNC_VIDEOSTREAMB (2<<1) 163 #define PM3VideoOverlayMode_FIELDPOLARITY_NORMAL (0 << 4)
170 #define PM3VideoOverlayMode_FIELDPOLARITY_NORMAL (0<<4) 164 #define PM3VideoOverlayMode_FIELDPOLARITY_INVERT (1 << 4)
171 #define PM3VideoOverlayMode_FIELDPOLARITY_INVERT (1<<4) 165 #define PM3VideoOverlayMode_PIXELSIZE_8BIT (0 << 5)
172 #define PM3VideoOverlayMode_PIXELSIZE_8BIT (0<<5) 166 #define PM3VideoOverlayMode_PIXELSIZE_16BIT (1 << 5)
173 #define PM3VideoOverlayMode_PIXELSIZE_16BIT (1<<5) 167 #define PM3VideoOverlayMode_PIXELSIZE_32BIT (2 << 5)
174 #define PM3VideoOverlayMode_PIXELSIZE_32BIT (2<<5) 168 #define PM3VideoOverlayMode_COLORFORMAT_RGB8888 \
175 #define PM3VideoOverlayMode_COLORFORMAT_RGB8888 ((0<<7)|(1<<12)|(2<<5)) 169 ((0 << 7)|(1 << 12)|(2 << 5))
176 #define PM3VideoOverlayMode_COLORFORMAT_RGB4444 ((1<<7)|(1<<12)|(1<<5)) 170 #define PM3VideoOverlayMode_COLORFORMAT_RGB4444 \
177 #define PM3VideoOverlayMode_COLORFORMAT_RGB5551 ((2<<7)|(1<<12)|(1<<5)) 171 ((1 << 7)|(1 << 12)|(1 << 5))
178 #define PM3VideoOverlayMode_COLORFORMAT_RGB565 ((3<<7)|(1<<12)|(1<<5)) 172 #define PM3VideoOverlayMode_COLORFORMAT_RGB5551 \
179 #define PM3VideoOverlayMode_COLORFORMAT_RGB332 ((4<<7)|(1<<12)|(0<<5)) 173 ((2 << 7)|(1 << 12)|(1 << 5))
180 #define PM3VideoOverlayMode_COLORFORMAT_BGR8888 ((0<<7)|(2<<5)) 174 #define PM3VideoOverlayMode_COLORFORMAT_RGB565 \
181 #define PM3VideoOverlayMode_COLORFORMAT_BGR4444 ((1<<7)|(1<<5)) 175 ((3 << 7)|(1 << 12)|(1 << 5))
182 #define PM3VideoOverlayMode_COLORFORMAT_BGR5551 ((2<<7)|(1<<5)) 176 #define PM3VideoOverlayMode_COLORFORMAT_RGB332 \
183 #define PM3VideoOverlayMode_COLORFORMAT_BGR565 ((3<<7)|(1<<5)) 177 ((4 << 7)|(1 << 12)|(0 << 5))
184 #define PM3VideoOverlayMode_COLORFORMAT_BGR332 ((4<<7)|(0<<5)) 178 #define PM3VideoOverlayMode_COLORFORMAT_BGR8888 \
185 #define PM3VideoOverlayMode_COLORFORMAT_CI8 ((5<<7)|(1<<12)|(0<<5)) 179 ((0 << 7)|(2 << 5))
186 #define PM3VideoOverlayMode_COLORFORMAT_VUY444 ((2<<10)|(1<<12)|(2<<5)) 180 #define PM3VideoOverlayMode_COLORFORMAT_BGR4444 \
187 #define PM3VideoOverlayMode_COLORFORMAT_YUV444 ((2<<10)|(2<<5)) 181 ((1 << 7)|(1 << 5))
188 #define PM3VideoOverlayMode_COLORFORMAT_VUY422 ((1<<10)|(1<<12)|(1<<5)) 182 #define PM3VideoOverlayMode_COLORFORMAT_BGR5551 \
189 #define PM3VideoOverlayMode_COLORFORMAT_YUV422 ((1<<10)|(1<<5)) 183 ((2 << 7)|(1 << 5))
190 #define PM3VideoOverlayMode_COLORORDER_BGR (0<<12) 184 #define PM3VideoOverlayMode_COLORFORMAT_BGR565 \
191 #define PM3VideoOverlayMode_COLORORDER_RGB (1<<12) 185 ((3 << 7)|(1 << 5))
192 #define PM3VideoOverlayMode_LINEARCOLOREXT_OFF (0<<13) 186 #define PM3VideoOverlayMode_COLORFORMAT_BGR332 \
193 #define PM3VideoOverlayMode_LINEARCOLOREXT_ON (1<<13) 187 ((4 << 7)|(0 << 5))
194 #define PM3VideoOverlayMode_FILTER_MASK (3<<14) 188 #define PM3VideoOverlayMode_COLORFORMAT_CI8 \
195 #define PM3VideoOverlayMode_FILTER_OFF (0<<14) 189 ((5 << 7)|(1 << 12)|(0 << 5))
196 #define PM3VideoOverlayMode_FILTER_FULL (1<<14) 190 #define PM3VideoOverlayMode_COLORFORMAT_VUY444 \
197 #define PM3VideoOverlayMode_FILTER_PARTIAL (2<<14) 191 ((2 << 10)|(1 << 12)|(2 << 5))
198 #define PM3VideoOverlayMode_DEINTERLACE_OFF (0<<16) 192 #define PM3VideoOverlayMode_COLORFORMAT_YUV444 \
199 #define PM3VideoOverlayMode_DEINTERLACE_BOB (1<<16) 193 ((2 << 10)|(2 << 5))
200 #define PM3VideoOverlayMode_PATCHMODE_OFF (0<<18) 194 #define PM3VideoOverlayMode_COLORFORMAT_VUY422 \
201 #define PM3VideoOverlayMode_PATCHMODE_ON (1<<18) 195 ((1 << 10)|(1 << 12)|(1 << 5))
202 #define PM3VideoOverlayMode_FLIP_VIDEO (0<<20) 196 #define PM3VideoOverlayMode_COLORFORMAT_YUV422 \
203 #define PM3VideoOverlayMode_FLIP_VIDEOSTREAMA (1<<20) 197 ((1 << 10)|(1 << 5))
204 #define PM3VideoOverlayMode_FLIP_VIDEOSTREAMB (2<<20) 198 #define PM3VideoOverlayMode_COLORORDER_BGR (0 << 12)
205 #define PM3VideoOverlayMode_MIRROR_MASK (3<<23) 199 #define PM3VideoOverlayMode_COLORORDER_RGB (1 << 12)
206 #define PM3VideoOverlayMode_MIRRORX_OFF (0<<23) 200 #define PM3VideoOverlayMode_LINEARCOLOREXT_OFF (0 << 13)
207 #define PM3VideoOverlayMode_MIRRORX_ON (1<<23) 201 #define PM3VideoOverlayMode_LINEARCOLOREXT_ON (1 << 13)
208 #define PM3VideoOverlayMode_MIRRORY_OFF (0<<24) 202 #define PM3VideoOverlayMode_FILTER_MASK (3 << 14)
209 #define PM3VideoOverlayMode_MIRRORY_ON (1<<24) 203 #define PM3VideoOverlayMode_FILTER_OFF (0 << 14)
204 #define PM3VideoOverlayMode_FILTER_FULL (1 << 14)
205 #define PM3VideoOverlayMode_FILTER_PARTIAL (2 << 14)
206 #define PM3VideoOverlayMode_DEINTERLACE_OFF (0 << 16)
207 #define PM3VideoOverlayMode_DEINTERLACE_BOB (1 << 16)
208 #define PM3VideoOverlayMode_PATCHMODE_OFF (0 << 18)
209 #define PM3VideoOverlayMode_PATCHMODE_ON (1 << 18)
210 #define PM3VideoOverlayMode_FLIP_VIDEO (0 << 20)
211 #define PM3VideoOverlayMode_FLIP_VIDEOSTREAMA (1 << 20)
212 #define PM3VideoOverlayMode_FLIP_VIDEOSTREAMB (2 << 20)
213 #define PM3VideoOverlayMode_MIRROR_MASK (3 << 23)
214 #define PM3VideoOverlayMode_MIRRORX_OFF (0 << 23)
215 #define PM3VideoOverlayMode_MIRRORX_ON (1 << 23)
216 #define PM3VideoOverlayMode_MIRRORY_OFF (0 << 24)
217 #define PM3VideoOverlayMode_MIRRORY_ON (1 << 24)
210#define PM3VideoOverlayFifoControl 0x3110 218#define PM3VideoOverlayFifoControl 0x3110
211#define PM3VideoOverlayIndex 0x3118 219#define PM3VideoOverlayIndex 0x3118
212#define PM3VideoOverlayBase0 0x3120 220#define PM3VideoOverlayBase0 0x3120
213#define PM3VideoOverlayBase1 0x3128 221#define PM3VideoOverlayBase1 0x3128
214#define PM3VideoOverlayBase2 0x3130 222#define PM3VideoOverlayBase2 0x3130
215#define PM3VideoOverlayStride 0x3138 223#define PM3VideoOverlayStride 0x3138
216 #define PM3VideoOverlayStride_STRIDE(s) (((s)&0xfff)<<0) 224 #define PM3VideoOverlayStride_STRIDE(s) (((s) & 0xfff) << 0)
217#define PM3VideoOverlayWidth 0x3140 225#define PM3VideoOverlayWidth 0x3140
218 #define PM3VideoOverlayWidth_WIDTH(w) (((w)&0xfff)<<0) 226 #define PM3VideoOverlayWidth_WIDTH(w) (((w) & 0xfff) << 0)
219#define PM3VideoOverlayHeight 0x3148 227#define PM3VideoOverlayHeight 0x3148
220 #define PM3VideoOverlayHeight_HEIGHT(h) (((h)&0xfff)<<0) 228 #define PM3VideoOverlayHeight_HEIGHT(h) (((h) & 0xfff) << 0)
221#define PM3VideoOverlayOrigin 0x3150 229#define PM3VideoOverlayOrigin 0x3150
222 #define PM3VideoOverlayOrigin_XORIGIN(x) (((x)&0xfff)<<0) 230 #define PM3VideoOverlayOrigin_XORIGIN(x) (((x) & 0xfff) << 0)
223 #define PM3VideoOverlayOrigin_YORIGIN(y) (((y)&0xfff)<<16) 231 #define PM3VideoOverlayOrigin_YORIGIN(y) (((y) & 0xfff) << 16)
224#define PM3VideoOverlayShrinkXDelta 0x3158 232#define PM3VideoOverlayShrinkXDelta 0x3158
225 #define PM3VideoOverlayShrinkXDelta_NONE (1<<16) 233 #define PM3VideoOverlayShrinkXDelta_NONE (1 << 16)
226 #define PM3VideoOverlayShrinkXDelta_DELTA(s,d) \ 234 #define PM3VideoOverlayShrinkXDelta_DELTA(s,d) \
227 ((((s)<<16)/(d))&0x0ffffff0) 235 ((((s) << 16)/(d)) & 0x0ffffff0)
228#define PM3VideoOverlayZoomXDelta 0x3160 236#define PM3VideoOverlayZoomXDelta 0x3160
229 #define PM3VideoOverlayZoomXDelta_NONE (1<<16) 237 #define PM3VideoOverlayZoomXDelta_NONE (1 << 16)
230 #define PM3VideoOverlayZoomXDelta_DELTA(s,d) \ 238 #define PM3VideoOverlayZoomXDelta_DELTA(s,d) \
231 ((((s)<<16)/(d))&0x0001fff0) 239 ((((s) << 16)/(d)) & 0x0001fff0)
232#define PM3VideoOverlayYDelta 0x3168 240#define PM3VideoOverlayYDelta 0x3168
233 #define PM3VideoOverlayYDelta_NONE (1<<16) 241 #define PM3VideoOverlayYDelta_NONE (1 << 16)
234 #define PM3VideoOverlayYDelta_DELTA(s,d) \ 242 #define PM3VideoOverlayYDelta_DELTA(s,d) \
235 ((((s)<<16)/(d))&0x0ffffff0) 243 ((((s) << 16)/(d)) & 0x0ffffff0)
236#define PM3VideoOverlayFieldOffset 0x3170 244#define PM3VideoOverlayFieldOffset 0x3170
237#define PM3VideoOverlayStatus 0x3178 245#define PM3VideoOverlayStatus 0x3178
238 246
@@ -249,102 +257,82 @@
249#define PM3RD_IndexHigh 0x4028 257#define PM3RD_IndexHigh 0x4028
250#define PM3RD_IndexedData 0x4030 258#define PM3RD_IndexedData 0x4030
251#define PM3RD_IndexControl 0x4038 259#define PM3RD_IndexControl 0x4038
252 #define PM3RD_IndexControl_AUTOINCREMENT_ENABLE (1<<0) 260 #define PM3RD_IndexControl_AUTOINCREMENT_ENABLE (1 << 0)
253 #define PM3RD_IndexControl_AUTOINCREMENT_DISABLE (0<<0)
254 261
255/* Indirect Registers */ 262/* Indirect Registers */
256#define PM3RD_MiscControl 0x000 263#define PM3RD_MiscControl 0x000
257 #define PM3RD_MiscControl_HIGHCOLOR_RES_DISABLE (0<<0) 264 #define PM3RD_MiscControl_HIGHCOLOR_RES_ENABLE (1 << 0)
258 #define PM3RD_MiscControl_HIGHCOLOR_RES_ENABLE (1<<0) 265 #define PM3RD_MiscControl_PIXELDOUBLE_ENABLE (1 << 1)
259 #define PM3RD_MiscControl_PIXELDOUBLE_DISABLE (0<<1) 266 #define PM3RD_MiscControl_LASTREAD_ADDR_ENABLE (1 << 2)
260 #define PM3RD_MiscControl_PIXELDOUBLE_ENABLE (1<<1) 267 #define PM3RD_MiscControl_DIRECTCOLOR_ENABLE (1 << 3)
261 #define PM3RD_MiscControl_LASTREAD_ADDR_DISABLE (0<<2) 268 #define PM3RD_MiscControl_OVERLAY_ENABLE (1 << 4)
262 #define PM3RD_MiscControl_LASTREAD_ADDR_ENABLE (1<<2) 269 #define PM3RD_MiscControl_PIXELDOUBLE_BUFFER_ENABLE (1 << 5)
263 #define PM3RD_MiscControl_DIRECTCOLOR_DISABLE (0<<3) 270 #define PM3RD_MiscControl_VSB_OUTPUT_ENABLE (1 << 6)
264 #define PM3RD_MiscControl_DIRECTCOLOR_ENABLE (1<<3) 271 #define PM3RD_MiscControl_STEREODOUBLE_BUFFER_ENABLE (1 << 7)
265 #define PM3RD_MiscControl_OVERLAY_DISABLE (0<<4)
266 #define PM3RD_MiscControl_OVERLAY_ENABLE (1<<4)
267 #define PM3RD_MiscControl_PIXELDOUBLE_BUFFER_DISABLE (0<<5)
268 #define PM3RD_MiscControl_PIXELDOUBLE_BUFFER_ENABLE (1<<5)
269 #define PM3RD_MiscControl_VSB_OUTPUT_DISABLE (0<<6)
270 #define PM3RD_MiscControl_VSB_OUTPUT_ENABLE (1<<6)
271 #define PM3RD_MiscControl_STEREODOUBLE_BUFFER_DISABLE (0<<7)
272 #define PM3RD_MiscControl_STEREODOUBLE_BUFFER_ENABLE (1<<7)
273#define PM3RD_SyncControl 0x001 272#define PM3RD_SyncControl 0x001
274 #define PM3RD_SyncControl_HSYNC_ACTIVE_LOW (0<<0) 273 #define PM3RD_SyncControl_HSYNC_ACTIVE_LOW (0 << 0)
275 #define PM3RD_SyncControl_HSYNC_ACTIVE_HIGH (1<<0) 274 #define PM3RD_SyncControl_HSYNC_ACTIVE_HIGH (1 << 0)
276 #define PM3RD_SyncControl_HSYNC_FORCE_ACTIVE (3<<0) 275 #define PM3RD_SyncControl_HSYNC_FORCE_ACTIVE (3 << 0)
277 #define PM3RD_SyncControl_HSYNC_FORCE_INACTIVE (4<<0) 276 #define PM3RD_SyncControl_HSYNC_FORCE_INACTIVE (4 << 0)
278 #define PM3RD_SyncControl_HSYNC_TRI_STATE (2<<0) 277 #define PM3RD_SyncControl_HSYNC_TRI_STATE (2 << 0)
279 #define PM3RD_SyncControl_VSYNC_ACTIVE_LOW (0<<3) 278 #define PM3RD_SyncControl_VSYNC_ACTIVE_LOW (0 << 3)
280 #define PM3RD_SyncControl_VSYNC_ACTIVE_HIGH (1<<3) 279 #define PM3RD_SyncControl_VSYNC_ACTIVE_HIGH (1 << 3)
281 #define PM3RD_SyncControl_VSYNC_TRI_STATE (2<<3) 280 #define PM3RD_SyncControl_VSYNC_TRI_STATE (2 << 3)
282 #define PM3RD_SyncControl_VSYNC_FORCE_ACTIVE (3<<3) 281 #define PM3RD_SyncControl_VSYNC_FORCE_ACTIVE (3 << 3)
283 #define PM3RD_SyncControl_VSYNC_FORCE_INACTIVE (4<<3) 282 #define PM3RD_SyncControl_VSYNC_FORCE_INACTIVE (4 << 3)
284 #define PM3RD_SyncControl_HSYNC_OVERRIDE_SETBY_HSYNC (0<<6) 283 #define PM3RD_SyncControl_HSYNC_OVERRIDE_SETBY_HSYNC (0 << 6)
285 #define PM3RD_SyncControl_HSYNC_OVERRIDE_FORCE_HIGH (1<<6) 284 #define PM3RD_SyncControl_HSYNC_OVERRIDE_FORCE_HIGH (1 << 6)
286 #define PM3RD_SyncControl_VSYNC_OVERRIDE_SETBY_VSYNC (0<<7) 285 #define PM3RD_SyncControl_VSYNC_OVERRIDE_SETBY_VSYNC (0 << 7)
287 #define PM3RD_SyncControl_VSYNC_OVERRIDE_FORCE_HIGH (1<<7) 286 #define PM3RD_SyncControl_VSYNC_OVERRIDE_FORCE_HIGH (1 << 7)
288#define PM3RD_DACControl 0x002 287#define PM3RD_DACControl 0x002
289 #define PM3RD_DACControl_DAC_POWER_ON (0<<0) 288 #define PM3RD_DACControl_DAC_POWER_ON (0 << 0)
290 #define PM3RD_DACControl_DAC_POWER_OFF (1<<0) 289 #define PM3RD_DACControl_DAC_POWER_OFF (1 << 0)
291 #define PM3RD_DACControl_SYNC_ON_GREEN_DISABLE (0<<3) 290 #define PM3RD_DACControl_SYNC_ON_GREEN_ENABLE (1 << 3)
292 #define PM3RD_DACControl_SYNC_ON_GREEN_ENABLE (1<<3) 291 #define PM3RD_DACControl_BLANK_RED_DAC_ENABLE (1 << 4)
293 #define PM3RD_DACControl_BLANK_RED_DAC_DISABLE (0<<4) 292 #define PM3RD_DACControl_BLANK_GREEN_DAC_ENABLE (1 << 5)
294 #define PM3RD_DACControl_BLANK_RED_DAC_ENABLE (1<<4) 293 #define PM3RD_DACControl_BLANK_BLUE_DAC_ENABLE (1 << 6)
295 #define PM3RD_DACControl_BLANK_GREEN_DAC_DISABLE (0<<5) 294 #define PM3RD_DACControl_BLANK_PEDESTAL_ENABLE (1 << 7)
296 #define PM3RD_DACControl_BLANK_GREEN_DAC_ENABLE (1<<5)
297 #define PM3RD_DACControl_BLANK_BLUE_DAC_DISABLE (0<<6)
298 #define PM3RD_DACControl_BLANK_BLUE_DAC_ENABLE (1<<6)
299 #define PM3RD_DACControl_BLANK_PEDESTAL_DISABLE (0<<7)
300 #define PM3RD_DACControl_BLANK_PEDESTAL_ENABLE (1<<7)
301#define PM3RD_PixelSize 0x003 295#define PM3RD_PixelSize 0x003
302 #define PM3RD_PixelSize_24_BIT_PIXELS (4<<0) 296 #define PM3RD_PixelSize_24_BIT_PIXELS (4 << 0)
303 #define PM3RD_PixelSize_32_BIT_PIXELS (2<<0) 297 #define PM3RD_PixelSize_32_BIT_PIXELS (2 << 0)
304 #define PM3RD_PixelSize_16_BIT_PIXELS (1<<0) 298 #define PM3RD_PixelSize_16_BIT_PIXELS (1 << 0)
305 #define PM3RD_PixelSize_8_BIT_PIXELS (0<<0) 299 #define PM3RD_PixelSize_8_BIT_PIXELS (0 << 0)
306#define PM3RD_ColorFormat 0x004 300#define PM3RD_ColorFormat 0x004
307 #define PM3RD_ColorFormat_LINEAR_COLOR_EXT_ENABLE (1<<6) 301 #define PM3RD_ColorFormat_LINEAR_COLOR_EXT_ENABLE (1 << 6)
308 #define PM3RD_ColorFormat_LINEAR_COLOR_EXT_DISABLE (0<<6) 302 #define PM3RD_ColorFormat_COLOR_ORDER_BLUE_LOW (1 << 5)
309 #define PM3RD_ColorFormat_COLOR_ORDER_BLUE_LOW (1<<5) 303 #define PM3RD_ColorFormat_COLOR_ORDER_RED_LOW (0 << 5)
310 #define PM3RD_ColorFormat_COLOR_ORDER_RED_LOW (0<<5) 304 #define PM3RD_ColorFormat_COLOR_FORMAT_MASK (0x1f << 0)
311 #define PM3RD_ColorFormat_COLOR_FORMAT_MASK (0x1f<<0) 305 #define PM3RD_ColorFormat_8888_COLOR (0 << 0)
312 #define PM3RD_ColorFormat_8888_COLOR (0<<0) 306 #define PM3RD_ColorFormat_5551_FRONT_COLOR (1 << 0)
313 #define PM3RD_ColorFormat_5551_FRONT_COLOR (1<<0) 307 #define PM3RD_ColorFormat_4444_COLOR (2 << 0)
314 #define PM3RD_ColorFormat_4444_COLOR (2<<0) 308 #define PM3RD_ColorFormat_332_FRONT_COLOR (5 << 0)
315 #define PM3RD_ColorFormat_332_FRONT_COLOR (5<<0) 309 #define PM3RD_ColorFormat_332_BACK_COLOR (6 << 0)
316 #define PM3RD_ColorFormat_332_BACK_COLOR (6<<0) 310 #define PM3RD_ColorFormat_2321_FRONT_COLOR (9 << 0)
317 #define PM3RD_ColorFormat_2321_FRONT_COLOR (9<<0) 311 #define PM3RD_ColorFormat_2321_BACK_COLOR (10 << 0)
318 #define PM3RD_ColorFormat_2321_BACK_COLOR (10<<0) 312 #define PM3RD_ColorFormat_232_FRONTOFF_COLOR (11 << 0)
319 #define PM3RD_ColorFormat_232_FRONTOFF_COLOR (11<<0) 313 #define PM3RD_ColorFormat_232_BACKOFF_COLOR (12 << 0)
320 #define PM3RD_ColorFormat_232_BACKOFF_COLOR (12<<0) 314 #define PM3RD_ColorFormat_5551_BACK_COLOR (13 << 0)
321 #define PM3RD_ColorFormat_5551_BACK_COLOR (13<<0) 315 #define PM3RD_ColorFormat_CI8_COLOR (14 << 0)
322 #define PM3RD_ColorFormat_CI8_COLOR (14<<0) 316 #define PM3RD_ColorFormat_565_FRONT_COLOR (16 << 0)
323 #define PM3RD_ColorFormat_565_FRONT_COLOR (16<<0) 317 #define PM3RD_ColorFormat_565_BACK_COLOR (17 << 0)
324 #define PM3RD_ColorFormat_565_BACK_COLOR (17<<0)
325#define PM3RD_CursorMode 0x005 318#define PM3RD_CursorMode 0x005
326 #define PM3RD_CursorMode_CURSOR_DISABLE (0<<0) 319 #define PM3RD_CursorMode_CURSOR_ENABLE (1 << 0)
327 #define PM3RD_CursorMode_CURSOR_ENABLE (1<<0) 320 #define PM3RD_CursorMode_FORMAT_64x64_2BPE_P0123 (0 << 2)
328 #define PM3RD_CursorMode_FORMAT_64x64_2BPE_P0123 (0<<2) 321 #define PM3RD_CursorMode_FORMAT_32x32_2BPE_P0 (1 << 2)
329 #define PM3RD_CursorMode_FORMAT_32x32_2BPE_P0 (1<<2) 322 #define PM3RD_CursorMode_FORMAT_32x32_2BPE_P1 (2 << 2)
330 #define PM3RD_CursorMode_FORMAT_32x32_2BPE_P1 (2<<2) 323 #define PM3RD_CursorMode_FORMAT_32x32_2BPE_P2 (3 << 2)
331 #define PM3RD_CursorMode_FORMAT_32x32_2BPE_P2 (3<<2) 324 #define PM3RD_CursorMode_FORMAT_32x32_2BPE_P3 (4 << 2)
332 #define PM3RD_CursorMode_FORMAT_32x32_2BPE_P3 (4<<2) 325 #define PM3RD_CursorMode_FORMAT_32x32_4BPE_P01 (5 << 2)
333 #define PM3RD_CursorMode_FORMAT_32x32_4BPE_P01 (5<<2) 326 #define PM3RD_CursorMode_FORMAT_32x32_4BPE_P23 (6 << 2)
334 #define PM3RD_CursorMode_FORMAT_32x32_4BPE_P23 (6<<2) 327 #define PM3RD_CursorMode_TYPE_MS (0 << 4)
335 #define PM3RD_CursorMode_TYPE_MS (0<<4) 328 #define PM3RD_CursorMode_TYPE_X (1 << 4)
336 #define PM3RD_CursorMode_TYPE_X (1<<4) 329 #define PM3RD_CursorMode_REVERSE_PIXEL_ORDER_ENABLE (1 << 6)
337 #define PM3RD_CursorMode_REVERSE_PIXEL_ORDER_DISABLE (0<<6) 330 #define PM3RD_CursorMode_REVERSE_PIXEL_ORDER_3_COLOR (2 << 6)
338 #define PM3RD_CursorMode_REVERSE_PIXEL_ORDER_ENABLE (1<<6) 331 #define PM3RD_CursorMode_REVERSE_PIXEL_ORDER_15_COLOR (3 << 6)
339 #define PM3RD_CursorMode_REVERSE_PIXEL_ORDER_3_COLOR (2<<6)
340 #define PM3RD_CursorMode_REVERSE_PIXEL_ORDER_15_COLOR (3<<6)
341#define PM3RD_CursorControl 0x006 332#define PM3RD_CursorControl 0x006
342 #define PM3RD_CursorControl_DOUBLE_X_DISABLED (0<<0) 333 #define PM3RD_CursorControl_DOUBLE_X_ENABLED (1 << 0)
343 #define PM3RD_CursorControl_DOUBLE_X_ENABLED (1<<0) 334 #define PM3RD_CursorControl_DOUBLE_Y_ENABLED (1 << 1)
344 #define PM3RD_CursorControl_DOUBLE_Y_DISABLED (0<<1) 335 #define PM3RD_CursorControl_READBACK_POS_ENABLED (1 << 2)
345 #define PM3RD_CursorControl_DOUBLE_Y_ENABLED (1<<1)
346 #define PM3RD_CursorControl_READBACK_POS_DISABLED (0<<2)
347 #define PM3RD_CursorControl_READBACK_POS_ENABLED (1<<2)
348 336
349#define PM3RD_CursorXLow 0x007 337#define PM3RD_CursorXLow 0x007
350#define PM3RD_CursorXHigh 0x008 338#define PM3RD_CursorXHigh 0x008
@@ -354,17 +342,13 @@
354#define PM3RD_CursorHotSpotY 0x00c 342#define PM3RD_CursorHotSpotY 0x00c
355#define PM3RD_OverlayKey 0x00d 343#define PM3RD_OverlayKey 0x00d
356#define PM3RD_Pan 0x00e 344#define PM3RD_Pan 0x00e
357 #define PM3RD_Pan_DISABLE (0<<0) 345 #define PM3RD_Pan_ENABLE (1 << 0)
358 #define PM3RD_Pan_ENABLE (1<<0) 346 #define PM3RD_Pan_GATE_ENABLE (1 << 1)
359 #define PM3RD_Pan_GATE_DISABLE (0<<1)
360 #define PM3RD_Pan_GATE_ENABLE (1<<1)
361#define PM3RD_Sense 0x00f 347#define PM3RD_Sense 0x00f
362 348
363#define PM3RD_CheckControl 0x018 349#define PM3RD_CheckControl 0x018
364 #define PM3RD_CheckControl_PIXEL_DISABLED (0<<0) 350 #define PM3RD_CheckControl_PIXEL_ENABLED (1 << 0)
365 #define PM3RD_CheckControl_PIXEL_ENABLED (1<<0) 351 #define PM3RD_CheckControl_LUT_ENABLED (1 << 1)
366 #define PM3RD_CheckControl_LUT_DISABLED (0<<1)
367 #define PM3RD_CheckControl_LUT_ENABLED (1<<1)
368#define PM3RD_CheckPixelRed 0x019 352#define PM3RD_CheckPixelRed 0x019
369#define PM3RD_CheckPixelGreen 0x01a 353#define PM3RD_CheckPixelGreen 0x01a
370#define PM3RD_CheckPixelBlue 0x01b 354#define PM3RD_CheckPixelBlue 0x01b
@@ -374,19 +358,17 @@
374#define PM3RD_Scratch 0x01f 358#define PM3RD_Scratch 0x01f
375 359
376#define PM3RD_VideoOverlayControl 0x020 360#define PM3RD_VideoOverlayControl 0x020
377 #define PM3RD_VideoOverlayControl_DISABLE (0<<0) 361 #define PM3RD_VideoOverlayControl_ENABLE (1 << 0)
378 #define PM3RD_VideoOverlayControl_ENABLE (1<<0) 362 #define PM3RD_VideoOverlayControl_MODE_MASK (3 << 1)
379 #define PM3RD_VideoOverlayControl_MODE_MASK (3<<1) 363 #define PM3RD_VideoOverlayControl_MODE_MAINKEY (0 << 1)
380 #define PM3RD_VideoOverlayControl_MODE_MAINKEY (0<<1) 364 #define PM3RD_VideoOverlayControl_MODE_OVERLAYKEY (1 << 1)
381 #define PM3RD_VideoOverlayControl_MODE_OVERLAYKEY (1<<1) 365 #define PM3RD_VideoOverlayControl_MODE_ALWAYS (2 << 1)
382 #define PM3RD_VideoOverlayControl_MODE_ALWAYS (2<<1) 366 #define PM3RD_VideoOverlayControl_MODE_BLEND (3 << 1)
383 #define PM3RD_VideoOverlayControl_MODE_BLEND (3<<1) 367 #define PM3RD_VideoOverlayControl_DIRECTCOLOR_ENABLED (1 << 3)
384 #define PM3RD_VideoOverlayControl_DIRECTCOLOR_DISABLED (0<<3) 368 #define PM3RD_VideoOverlayControl_BLENDSRC_MAIN (0 << 4)
385 #define PM3RD_VideoOverlayControl_DIRECTCOLOR_ENABLED (1<<3) 369 #define PM3RD_VideoOverlayControl_BLENDSRC_REGISTER (1 << 4)
386 #define PM3RD_VideoOverlayControl_BLENDSRC_MAIN (0<<4) 370 #define PM3RD_VideoOverlayControl_KEY_COLOR (0 << 5)
387 #define PM3RD_VideoOverlayControl_BLENDSRC_REGISTER (1<<4) 371 #define PM3RD_VideoOverlayControl_KEY_ALPHA (1 << 5)
388 #define PM3RD_VideoOverlayControl_KEY_COLOR (0<<5)
389 #define PM3RD_VideoOverlayControl_KEY_ALPHA (1<<5)
390#define PM3RD_VideoOverlayXStartLow 0x021 372#define PM3RD_VideoOverlayXStartLow 0x021
391#define PM3RD_VideoOverlayXStartHigh 0x022 373#define PM3RD_VideoOverlayXStartHigh 0x022
392#define PM3RD_VideoOverlayYStartLow 0x023 374#define PM3RD_VideoOverlayYStartLow 0x023
@@ -399,10 +381,10 @@
399#define PM3RD_VideoOverlayKeyG 0x02a 381#define PM3RD_VideoOverlayKeyG 0x02a
400#define PM3RD_VideoOverlayKeyB 0x02b 382#define PM3RD_VideoOverlayKeyB 0x02b
401#define PM3RD_VideoOverlayBlend 0x02c 383#define PM3RD_VideoOverlayBlend 0x02c
402 #define PM3RD_VideoOverlayBlend_FACTOR_0_PERCENT (0<<6) 384 #define PM3RD_VideoOverlayBlend_FACTOR_0_PERCENT (0 << 6)
403 #define PM3RD_VideoOverlayBlend_FACTOR_25_PERCENT (1<<6) 385 #define PM3RD_VideoOverlayBlend_FACTOR_25_PERCENT (1 << 6)
404 #define PM3RD_VideoOverlayBlend_FACTOR_75_PERCENT (2<<6) 386 #define PM3RD_VideoOverlayBlend_FACTOR_75_PERCENT (2 << 6)
405 #define PM3RD_VideoOverlayBlend_FACTOR_100_PERCENT (3<<6) 387 #define PM3RD_VideoOverlayBlend_FACTOR_100_PERCENT (3 << 6)
406 388
407#define PM3RD_DClkSetup1 0x1f0 389#define PM3RD_DClkSetup1 0x1f0
408#define PM3RD_DClkSetup2 0x1f1 390#define PM3RD_DClkSetup2 0x1f1
@@ -410,21 +392,20 @@
410#define PM3RD_KClkSetup2 0x1f3 392#define PM3RD_KClkSetup2 0x1f3
411 393
412#define PM3RD_DClkControl 0x200 394#define PM3RD_DClkControl 0x200
413 #define PM3RD_DClkControl_SOURCE_PLL (0<<4) 395 #define PM3RD_DClkControl_SOURCE_PLL (0 << 4)
414 #define PM3RD_DClkControl_SOURCE_VSA (1<<4) 396 #define PM3RD_DClkControl_SOURCE_VSA (1 << 4)
415 #define PM3RD_DClkControl_SOURCE_VSB (2<<4) 397 #define PM3RD_DClkControl_SOURCE_VSB (2 << 4)
416 #define PM3RD_DClkControl_SOURCE_EXT (3<<4) 398 #define PM3RD_DClkControl_SOURCE_EXT (3 << 4)
417 #define PM3RD_DClkControl_STATE_RUN (2<<2) 399 #define PM3RD_DClkControl_STATE_RUN (2 << 2)
418 #define PM3RD_DClkControl_STATE_HIGH (1<<2) 400 #define PM3RD_DClkControl_STATE_HIGH (1 << 2)
419 #define PM3RD_DClkControl_STATE_LOW (0<<2) 401 #define PM3RD_DClkControl_STATE_LOW (0 << 2)
420 #define PM3RD_DClkControl_LOCKED (1<<1) 402 #define PM3RD_DClkControl_LOCKED (1 << 1)
421 #define PM3RD_DClkControl_NOT_LOCKED (0<<1) 403 #define PM3RD_DClkControl_NOT_LOCKED (0 << 1)
422 #define PM3RD_DClkControl_ENABLE (1<<0) 404 #define PM3RD_DClkControl_ENABLE (1 << 0)
423 #define PM3RD_DClkControl_DISABLE (0<<0)
424#define PM3RD_DClk0PreScale 0x201 405#define PM3RD_DClk0PreScale 0x201
425#define PM3RD_DClk0FeedbackScale 0x202 406#define PM3RD_DClk0FeedbackScale 0x202
426#define PM3RD_DClk0PostScale 0x203 407#define PM3RD_DClk0PostScale 0x203
427 #define PM3_REF_CLOCK 14318 408 #define PM3_REF_CLOCK 14318
428#define PM3RD_DClk1PreScale 0x204 409#define PM3RD_DClk1PreScale 0x204
429#define PM3RD_DClk1FeedbackScale 0x205 410#define PM3RD_DClk1FeedbackScale 0x205
430#define PM3RD_DClk1PostScale 0x206 411#define PM3RD_DClk1PostScale 0x206
@@ -435,59 +416,56 @@
435#define PM3RD_DClk3FeedbackScale 0x20b 416#define PM3RD_DClk3FeedbackScale 0x20b
436#define PM3RD_DClk3PostScale 0x20c 417#define PM3RD_DClk3PostScale 0x20c
437#define PM3RD_KClkControl 0x20d 418#define PM3RD_KClkControl 0x20d
438 #define PM3RD_KClkControl_DISABLE (0<<0) 419 #define PM3RD_KClkControl_ENABLE (1 << 0)
439 #define PM3RD_KClkControl_ENABLE (1<<0) 420 #define PM3RD_KClkControl_NOT_LOCKED (0 << 1)
440 #define PM3RD_KClkControl_NOT_LOCKED (0<<1) 421 #define PM3RD_KClkControl_LOCKED (1 << 1)
441 #define PM3RD_KClkControl_LOCKED (1<<1) 422 #define PM3RD_KClkControl_STATE_LOW (0 << 2)
442 #define PM3RD_KClkControl_STATE_LOW (0<<2) 423 #define PM3RD_KClkControl_STATE_HIGH (1 << 2)
443 #define PM3RD_KClkControl_STATE_HIGH (1<<2) 424 #define PM3RD_KClkControl_STATE_RUN (2 << 2)
444 #define PM3RD_KClkControl_STATE_RUN (2<<2) 425 #define PM3RD_KClkControl_STATE_LOW_POWER (3 << 2)
445 #define PM3RD_KClkControl_STATE_LOW_POWER (3<<2) 426 #define PM3RD_KClkControl_SOURCE_PCLK (0 << 4)
446 #define PM3RD_KClkControl_SOURCE_PCLK (0<<4) 427 #define PM3RD_KClkControl_SOURCE_HALF_PCLK (1 << 4)
447 #define PM3RD_KClkControl_SOURCE_HALF_PCLK (1<<4) 428 #define PM3RD_KClkControl_SOURCE_PLL (2 << 4)
448 #define PM3RD_KClkControl_SOURCE_PLL (2<<4)
449#define PM3RD_KClkPreScale 0x20e 429#define PM3RD_KClkPreScale 0x20e
450#define PM3RD_KClkFeedbackScale 0x20f 430#define PM3RD_KClkFeedbackScale 0x20f
451#define PM3RD_KClkPostScale 0x210 431#define PM3RD_KClkPostScale 0x210
452#define PM3RD_MClkControl 0x211 432#define PM3RD_MClkControl 0x211
453 #define PM3RD_MClkControl_DISABLE (0<<0) 433 #define PM3RD_MClkControl_ENABLE (1 << 0)
454 #define PM3RD_MClkControl_ENABLE (1<<0) 434 #define PM3RD_MClkControl_NOT_LOCKED (0 << 1)
455 #define PM3RD_MClkControl_NOT_LOCKED (0<<1) 435 #define PM3RD_MClkControl_LOCKED (1 << 1)
456 #define PM3RD_MClkControl_LOCKED (1<<1) 436 #define PM3RD_MClkControl_STATE_LOW (0 << 2)
457 #define PM3RD_MClkControl_STATE_LOW (0<<2) 437 #define PM3RD_MClkControl_STATE_HIGH (1 << 2)
458 #define PM3RD_MClkControl_STATE_HIGH (1<<2) 438 #define PM3RD_MClkControl_STATE_RUN (2 << 2)
459 #define PM3RD_MClkControl_STATE_RUN (2<<2) 439 #define PM3RD_MClkControl_STATE_LOW_POWER (3 << 2)
460 #define PM3RD_MClkControl_STATE_LOW_POWER (3<<2) 440 #define PM3RD_MClkControl_SOURCE_PCLK (0 << 4)
461 #define PM3RD_MClkControl_SOURCE_PCLK (0<<4) 441 #define PM3RD_MClkControl_SOURCE_HALF_PCLK (1 << 4)
462 #define PM3RD_MClkControl_SOURCE_HALF_PCLK (1<<4) 442 #define PM3RD_MClkControl_SOURCE_HALF_EXT (3 << 4)
463 #define PM3RD_MClkControl_SOURCE_HALF_EXT (3<<4) 443 #define PM3RD_MClkControl_SOURCE_EXT (4 << 4)
464 #define PM3RD_MClkControl_SOURCE_EXT (4<<4) 444 #define PM3RD_MClkControl_SOURCE_HALF_KCLK (5 << 4)
465 #define PM3RD_MClkControl_SOURCE_HALF_KCLK (5<<4) 445 #define PM3RD_MClkControl_SOURCE_KCLK (6 << 4)
466 #define PM3RD_MClkControl_SOURCE_KCLK (6<<4)
467#define PM3RD_MClkPreScale 0x212 446#define PM3RD_MClkPreScale 0x212
468#define PM3RD_MClkFeedbackScale 0x213 447#define PM3RD_MClkFeedbackScale 0x213
469#define PM3RD_MClkPostScale 0x214 448#define PM3RD_MClkPostScale 0x214
470#define PM3RD_SClkControl 0x215 449#define PM3RD_SClkControl 0x215
471 #define PM3RD_SClkControl_DISABLE (0<<0) 450 #define PM3RD_SClkControl_ENABLE (1 << 0)
472 #define PM3RD_SClkControl_ENABLE (1<<0) 451 #define PM3RD_SClkControl_NOT_LOCKED (0 << 1)
473 #define PM3RD_SClkControl_NOT_LOCKED (0<<1) 452 #define PM3RD_SClkControl_LOCKED (1 << 1)
474 #define PM3RD_SClkControl_LOCKED (1<<1) 453 #define PM3RD_SClkControl_STATE_LOW (0 << 2)
475 #define PM3RD_SClkControl_STATE_LOW (0<<2) 454 #define PM3RD_SClkControl_STATE_HIGH (1 << 2)
476 #define PM3RD_SClkControl_STATE_HIGH (1<<2) 455 #define PM3RD_SClkControl_STATE_RUN (2 << 2)
477 #define PM3RD_SClkControl_STATE_RUN (2<<2) 456 #define PM3RD_SClkControl_STATE_LOW_POWER (3 << 2)
478 #define PM3RD_SClkControl_STATE_LOW_POWER (3<<2) 457 #define PM3RD_SClkControl_SOURCE_PCLK (0 << 4)
479 #define PM3RD_SClkControl_SOURCE_PCLK (0<<4) 458 #define PM3RD_SClkControl_SOURCE_HALF_PCLK (1 << 4)
480 #define PM3RD_SClkControl_SOURCE_HALF_PCLK (1<<4) 459 #define PM3RD_SClkControl_SOURCE_HALF_EXT (3 << 4)
481 #define PM3RD_SClkControl_SOURCE_HALF_EXT (3<<4) 460 #define PM3RD_SClkControl_SOURCE_EXT (4 << 4)
482 #define PM3RD_SClkControl_SOURCE_EXT (4<<4) 461 #define PM3RD_SClkControl_SOURCE_HALF_KCLK (5 << 4)
483 #define PM3RD_SClkControl_SOURCE_HALF_KCLK (5<<4) 462 #define PM3RD_SClkControl_SOURCE_KCLK (6 << 4)
484 #define PM3RD_SClkControl_SOURCE_KCLK (6<<4)
485#define PM3RD_SClkPreScale 0x216 463#define PM3RD_SClkPreScale 0x216
486#define PM3RD_SClkFeedbackScale 0x217 464#define PM3RD_SClkFeedbackScale 0x217
487#define PM3RD_SClkPostScale 0x218 465#define PM3RD_SClkPostScale 0x218
488 466
489#define PM3RD_CursorPalette(p) (0x303+(p)) 467#define PM3RD_CursorPalette(p) (0x303 + (p))
490#define PM3RD_CursorPattern(p) (0x400+(p)) 468#define PM3RD_CursorPattern(p) (0x400 + (p))
491/****************************************************** 469/******************************************************
492* GLINT Permedia3 Video Streaming Registers (0x5000) * 470* GLINT Permedia3 Video Streaming Registers (0x5000) *
493*******************************************************/ 471*******************************************************/
@@ -521,10 +499,10 @@
521#define PM3ColorDDAModeOr 0xabe8 499#define PM3ColorDDAModeOr 0xabe8
522#define PM3CommandInterrupt 0xa990 500#define PM3CommandInterrupt 0xa990
523#define PM3ConstantColorDDA 0xafb0 501#define PM3ConstantColorDDA 0xafb0
524 #define PM3ConstantColorDDA_R(r) ((r)&0xff) 502 #define PM3ConstantColorDDA_R(r) ((r) & 0xff)
525 #define PM3ConstantColorDDA_G(g) (((g)&0xff)<<8) 503 #define PM3ConstantColorDDA_G(g) (((g) & 0xff) << 8)
526 #define PM3ConstantColorDDA_B(b) (((b)&0xff)<<16) 504 #define PM3ConstantColorDDA_B(b) (((b) & 0xff) << 16)
527 #define PM3ConstantColorDDA_A(a) (((a)&0xff)<<24) 505 #define PM3ConstantColorDDA_A(a) (((a) & 0xff) << 24)
528#define PM3ContextData 0x8dd0 506#define PM3ContextData 0x8dd0
529#define PM3ContextDump 0x8dc0 507#define PM3ContextDump 0x8dc0
530#define PM3ContextRestore 0x8dc8 508#define PM3ContextRestore 0x8dc8
@@ -568,59 +546,59 @@
568#define PM3FBDestReadBufferOffset1 0xaea8 546#define PM3FBDestReadBufferOffset1 0xaea8
569#define PM3FBDestReadBufferOffset2 0xaeb0 547#define PM3FBDestReadBufferOffset2 0xaeb0
570#define PM3FBDestReadBufferOffset3 0xaeb8 548#define PM3FBDestReadBufferOffset3 0xaeb8
571 #define PM3FBDestReadBufferOffset_XOffset(x) ((x)&0xffff) 549 #define PM3FBDestReadBufferOffset_XOffset(x) ((x) & 0xffff)
572 #define PM3FBDestReadBufferOffset_YOffset(y) (((y)&0xffff)<<16) 550 #define PM3FBDestReadBufferOffset_YOffset(y) (((y) & 0xffff) << 16)
573#define PM3FBDestReadBufferWidth0 0xaec0 551#define PM3FBDestReadBufferWidth0 0xaec0
574#define PM3FBDestReadBufferWidth1 0xaec8 552#define PM3FBDestReadBufferWidth1 0xaec8
575#define PM3FBDestReadBufferWidth2 0xaed0 553#define PM3FBDestReadBufferWidth2 0xaed0
576#define PM3FBDestReadBufferWidth3 0xaed8 554#define PM3FBDestReadBufferWidth3 0xaed8
577 #define PM3FBDestReadBufferWidth_Width(w) ((w)&0x0fff) 555 #define PM3FBDestReadBufferWidth_Width(w) ((w) & 0x0fff)
578 556
579#define PM3FBDestReadEnables 0xaee8 557#define PM3FBDestReadEnables 0xaee8
580#define PM3FBDestReadEnablesAnd 0xad20 558#define PM3FBDestReadEnablesAnd 0xad20
581#define PM3FBDestReadEnablesOr 0xad28 559#define PM3FBDestReadEnablesOr 0xad28
582 #define PM3FBDestReadEnables_E(e) ((e)&0xff) 560 #define PM3FBDestReadEnables_E(e) ((e) & 0xff)
583 #define PM3FBDestReadEnables_E0 1<<0 561 #define PM3FBDestReadEnables_E0 (1 << 0)
584 #define PM3FBDestReadEnables_E1 1<<1 562 #define PM3FBDestReadEnables_E1 (1 << 1)
585 #define PM3FBDestReadEnables_E2 1<<2 563 #define PM3FBDestReadEnables_E2 (1 << 2)
586 #define PM3FBDestReadEnables_E3 1<<3 564 #define PM3FBDestReadEnables_E3 (1 << 3)
587 #define PM3FBDestReadEnables_E4 1<<4 565 #define PM3FBDestReadEnables_E4 (1 << 4)
588 #define PM3FBDestReadEnables_E5 1<<5 566 #define PM3FBDestReadEnables_E5 (1 << 5)
589 #define PM3FBDestReadEnables_E6 1<<6 567 #define PM3FBDestReadEnables_E6 (1 << 6)
590 #define PM3FBDestReadEnables_E7 1<<7 568 #define PM3FBDestReadEnables_E7 (1 << 7)
591 #define PM3FBDestReadEnables_R(r) (((r)&0xff)<<8) 569 #define PM3FBDestReadEnables_R(r) (((r) & 0xff) << 8)
592 #define PM3FBDestReadEnables_R0 1<<8 570 #define PM3FBDestReadEnables_R0 (1 << 8)
593 #define PM3FBDestReadEnables_R1 1<<9 571 #define PM3FBDestReadEnables_R1 (1 << 9)
594 #define PM3FBDestReadEnables_R2 1<<10 572 #define PM3FBDestReadEnables_R2 (1 << 10)
595 #define PM3FBDestReadEnables_R3 1<<11 573 #define PM3FBDestReadEnables_R3 (1 << 11)
596 #define PM3FBDestReadEnables_R4 1<<12 574 #define PM3FBDestReadEnables_R4 (1 << 12)
597 #define PM3FBDestReadEnables_R5 1<<13 575 #define PM3FBDestReadEnables_R5 (1 << 13)
598 #define PM3FBDestReadEnables_R6 1<<14 576 #define PM3FBDestReadEnables_R6 (1 << 14)
599 #define PM3FBDestReadEnables_R7 1<<15 577 #define PM3FBDestReadEnables_R7 (1 << 15)
600 #define PM3FBDestReadEnables_ReferenceAlpha(a) (((a)&0xff)<<24) 578 #define PM3FBDestReadEnables_ReferenceAlpha(a) (((a) & 0xff) << 24)
601 579
602#define PM3FBDestReadMode 0xaee0 580#define PM3FBDestReadMode 0xaee0
603#define PM3FBDestReadModeAnd 0xac90 581#define PM3FBDestReadModeAnd 0xac90
604#define PM3FBDestReadModeOr 0xac98 582#define PM3FBDestReadModeOr 0xac98
605 #define PM3FBDestReadMode_ReadDisable 0<<0 583 #define PM3FBDestReadMode_ReadDisable (0 << 0)
606 #define PM3FBDestReadMode_ReadEnable 1<<0 584 #define PM3FBDestReadMode_ReadEnable (1 << 0)
607 #define PM3FBDestReadMode_StripePitch(sp) (((sp)&0x7)<<2) 585 #define PM3FBDestReadMode_StripePitch(sp) (((sp) & 0x7) << 2)
608 #define PM3FBDestReadMode_StripeHeight(sh) (((sh)&0x7)<<7) 586 #define PM3FBDestReadMode_StripeHeight(sh) (((sh) & 0x7) << 7)
609 #define PM3FBDestReadMode_Enable0 1<<8 587 #define PM3FBDestReadMode_Enable0 (1 << 8)
610 #define PM3FBDestReadMode_Enable1 1<<9 588 #define PM3FBDestReadMode_Enable1 (1 << 9)
611 #define PM3FBDestReadMode_Enable2 1<<10 589 #define PM3FBDestReadMode_Enable2 (1 << 10)
612 #define PM3FBDestReadMode_Enable3 1<<11 590 #define PM3FBDestReadMode_Enable3 (1 << 11)
613 #define PM3FBDestReadMode_Layout0(l) (((l)&0x3)<<12) 591 #define PM3FBDestReadMode_Layout0(l) (((l) & 0x3) << 12)
614 #define PM3FBDestReadMode_Layout1(l) (((l)&0x3)<<14) 592 #define PM3FBDestReadMode_Layout1(l) (((l) & 0x3) << 14)
615 #define PM3FBDestReadMode_Layout2(l) (((l)&0x3)<<16) 593 #define PM3FBDestReadMode_Layout2(l) (((l) & 0x3) << 16)
616 #define PM3FBDestReadMode_Layout3(l) (((l)&0x3)<<18) 594 #define PM3FBDestReadMode_Layout3(l) (((l) & 0x3) << 18)
617 #define PM3FBDestReadMode_Origin0 1<<20 595 #define PM3FBDestReadMode_Origin0 (1 << 20)
618 #define PM3FBDestReadMode_Origin1 1<<21 596 #define PM3FBDestReadMode_Origin1 (1 << 21)
619 #define PM3FBDestReadMode_Origin2 1<<22 597 #define PM3FBDestReadMode_Origin2 (1 << 22)
620 #define PM3FBDestReadMode_Origin3 1<<23 598 #define PM3FBDestReadMode_Origin3 (1 << 23)
621 #define PM3FBDestReadMode_Blocking 1<<24 599 #define PM3FBDestReadMode_Blocking (1 << 24)
622 #define PM3FBDestReadMode_UseReadEnabled 1<<26 600 #define PM3FBDestReadMode_UseReadEnabled (1 << 26)
623 #define PM3FBDestReadMode_AlphaFiltering 1<<27 601 #define PM3FBDestReadMode_AlphaFiltering (1 << 27)
624 602
625#define PM3FBHardwareWriteMask 0x8ac0 603#define PM3FBHardwareWriteMask 0x8ac0
626#define PM3FBSoftwareWriteMask 0x8820 604#define PM3FBSoftwareWriteMask 0x8820
@@ -628,65 +606,65 @@
628#define PM3FBSourceData 0x8aa8 606#define PM3FBSourceData 0x8aa8
629#define PM3FBSourceReadBufferAddr 0xaf08 607#define PM3FBSourceReadBufferAddr 0xaf08
630#define PM3FBSourceReadBufferOffset 0xaf10 608#define PM3FBSourceReadBufferOffset 0xaf10
631 #define PM3FBSourceReadBufferOffset_XOffset(x) ((x)&0xffff) 609 #define PM3FBSourceReadBufferOffset_XOffset(x) ((x) & 0xffff)
632 #define PM3FBSourceReadBufferOffset_YOffset(y) (((y)&0xffff)<<16) 610 #define PM3FBSourceReadBufferOffset_YOffset(y) (((y) & 0xffff) << 16)
633#define PM3FBSourceReadBufferWidth 0xaf18 611#define PM3FBSourceReadBufferWidth 0xaf18
634 #define PM3FBSourceReadBufferWidth_Width(w) ((w)&0x0fff) 612 #define PM3FBSourceReadBufferWidth_Width(w) ((w) & 0x0fff)
635#define PM3FBSourceReadMode 0xaf00 613#define PM3FBSourceReadMode 0xaf00
636#define PM3FBSourceReadModeAnd 0xaca0 614#define PM3FBSourceReadModeAnd 0xaca0
637#define PM3FBSourceReadModeOr 0xaca8 615#define PM3FBSourceReadModeOr 0xaca8
638 #define PM3FBSourceReadMode_ReadDisable (0<<0) 616 #define PM3FBSourceReadMode_ReadDisable (0 << 0)
639 #define PM3FBSourceReadMode_ReadEnable (1<<0) 617 #define PM3FBSourceReadMode_ReadEnable (1 << 0)
640 #define PM3FBSourceReadMode_StripePitch(sp) (((sp)&0x7)<<2) 618 #define PM3FBSourceReadMode_StripePitch(sp) (((sp) & 0x7) << 2)
641 #define PM3FBSourceReadMode_StripeHeight(sh) (((sh)&0x7)<<7) 619 #define PM3FBSourceReadMode_StripeHeight(sh) (((sh) & 0x7) << 7)
642 #define PM3FBSourceReadMode_Layout(l) (((l)&0x3)<<8) 620 #define PM3FBSourceReadMode_Layout(l) (((l) & 0x3) << 8)
643 #define PM3FBSourceReadMode_Origin 1<<10 621 #define PM3FBSourceReadMode_Origin (1 << 10)
644 #define PM3FBSourceReadMode_Blocking 1<<11 622 #define PM3FBSourceReadMode_Blocking (1 << 11)
645 #define PM3FBSourceReadMode_UserTexelCoord 1<<13 623 #define PM3FBSourceReadMode_UserTexelCoord (1 << 13)
646 #define PM3FBSourceReadMode_WrapXEnable 1<<14 624 #define PM3FBSourceReadMode_WrapXEnable (1 << 14)
647 #define PM3FBSourceReadMode_WrapYEnable 1<<15 625 #define PM3FBSourceReadMode_WrapYEnable (1 << 15)
648 #define PM3FBSourceReadMode_WrapX(w) (((w)&0xf)<<16) 626 #define PM3FBSourceReadMode_WrapX(w) (((w) & 0xf) << 16)
649 #define PM3FBSourceReadMode_WrapY(w) (((w)&0xf)<<20) 627 #define PM3FBSourceReadMode_WrapY(w) (((w) & 0xf) << 20)
650 #define PM3FBSourceReadMode_ExternalSourceData 1<<24 628 #define PM3FBSourceReadMode_ExternalSourceData (1 << 24)
651#define PM3FBWriteBufferAddr0 0xb000 629#define PM3FBWriteBufferAddr0 0xb000
652#define PM3FBWriteBufferAddr1 0xb008 630#define PM3FBWriteBufferAddr1 0xb008
653#define PM3FBWriteBufferAddr2 0xb010 631#define PM3FBWriteBufferAddr2 0xb010
654#define PM3FBWriteBufferAddr3 0xb018 632#define PM3FBWriteBufferAddr3 0xb018
655 633
656#define PM3FBWriteBufferOffset0 0xb020 634#define PM3FBWriteBufferOffset0 0xb020
657#define PM3FBWriteBufferOffset1 0xb028 635#define PM3FBWriteBufferOffset1 0xb028
658#define PM3FBWriteBufferOffset2 0xb030 636#define PM3FBWriteBufferOffset2 0xb030
659#define PM3FBWriteBufferOffset3 0xb038 637#define PM3FBWriteBufferOffset3 0xb038
660 #define PM3FBWriteBufferOffset_XOffset(x) ((x)&0xffff) 638 #define PM3FBWriteBufferOffset_XOffset(x) ((x) & 0xffff)
661 #define PM3FBWriteBufferOffset_YOffset(y) (((y)&0xffff)<<16) 639 #define PM3FBWriteBufferOffset_YOffset(y) (((y) & 0xffff) << 16)
662 640
663#define PM3FBWriteBufferWidth0 0xb040 641#define PM3FBWriteBufferWidth0 0xb040
664#define PM3FBWriteBufferWidth1 0xb048 642#define PM3FBWriteBufferWidth1 0xb048
665#define PM3FBWriteBufferWidth2 0xb050 643#define PM3FBWriteBufferWidth2 0xb050
666#define PM3FBWriteBufferWidth3 0xb058 644#define PM3FBWriteBufferWidth3 0xb058
667 #define PM3FBWriteBufferWidth_Width(w) ((w)&0x0fff) 645 #define PM3FBWriteBufferWidth_Width(w) ((w) & 0x0fff)
668 646
669#define PM3FBWriteMode 0x8ab8 647#define PM3FBWriteMode 0x8ab8
670#define PM3FBWriteModeAnd 0xacf0 648#define PM3FBWriteModeAnd 0xacf0
671#define PM3FBWriteModeOr 0xacf8 649#define PM3FBWriteModeOr 0xacf8
672 #define PM3FBWriteMode_WriteDisable 0<<0 650 #define PM3FBWriteMode_WriteDisable (0 << 0)
673 #define PM3FBWriteMode_WriteEnable 1<<0 651 #define PM3FBWriteMode_WriteEnable (1 << 0)
674 #define PM3FBWriteMode_Replicate 1<<4 652 #define PM3FBWriteMode_Replicate (1 << 4)
675 #define PM3FBWriteMode_OpaqueSpan 1<<5 653 #define PM3FBWriteMode_OpaqueSpan (1 << 5)
676 #define PM3FBWriteMode_StripePitch(p) (((p)&0x7)<<6) 654 #define PM3FBWriteMode_StripePitch(p) (((p) & 0x7) << 6)
677 #define PM3FBWriteMode_StripeHeight(h) (((h)&0x7)<<9) 655 #define PM3FBWriteMode_StripeHeight(h) (((h) & 0x7) << 9)
678 #define PM3FBWriteMode_Enable0 1<<12 656 #define PM3FBWriteMode_Enable0 (1 << 12)
679 #define PM3FBWriteMode_Enable1 1<<13 657 #define PM3FBWriteMode_Enable1 (1 << 13)
680 #define PM3FBWriteMode_Enable2 1<<14 658 #define PM3FBWriteMode_Enable2 (1 << 14)
681 #define PM3FBWriteMode_Enable3 1<<15 659 #define PM3FBWriteMode_Enable3 (1 << 15)
682 #define PM3FBWriteMode_Layout0(l) (((l)&0x3)<<16) 660 #define PM3FBWriteMode_Layout0(l) (((l) & 0x3) << 16)
683 #define PM3FBWriteMode_Layout1(l) (((l)&0x3)<<18) 661 #define PM3FBWriteMode_Layout1(l) (((l) & 0x3) << 18)
684 #define PM3FBWriteMode_Layout2(l) (((l)&0x3)<<20) 662 #define PM3FBWriteMode_Layout2(l) (((l) & 0x3) << 20)
685 #define PM3FBWriteMode_Layout3(l) (((l)&0x3)<<22) 663 #define PM3FBWriteMode_Layout3(l) (((l) & 0x3) << 22)
686 #define PM3FBWriteMode_Origin0 1<<24 664 #define PM3FBWriteMode_Origin0 (1 << 24)
687 #define PM3FBWriteMode_Origin1 1<<25 665 #define PM3FBWriteMode_Origin1 (1 << 25)
688 #define PM3FBWriteMode_Origin2 1<<26 666 #define PM3FBWriteMode_Origin2 (1 << 26)
689 #define PM3FBWriteMode_Origin3 1<<27 667 #define PM3FBWriteMode_Origin3 (1 << 27)
690#define PM3ForegroundColor 0xb0c0 668#define PM3ForegroundColor 0xb0c0
691/* ... */ 669/* ... */
692#define PM3GIDMode 0xb538 670#define PM3GIDMode 0xb538
@@ -701,55 +679,55 @@
701#define PM3LBDestReadMode 0xb500 679#define PM3LBDestReadMode 0xb500
702#define PM3LBDestReadModeAnd 0xb580 680#define PM3LBDestReadModeAnd 0xb580
703#define PM3LBDestReadModeOr 0xb588 681#define PM3LBDestReadModeOr 0xb588
704 #define PM3LBDestReadMode_Disable 0<<0 682 #define PM3LBDestReadMode_Disable (0 << 0)
705 #define PM3LBDestReadMode_Enable 1<<0 683 #define PM3LBDestReadMode_Enable (1 << 0)
706 #define PM3LBDestReadMode_StripePitch(p) (((p)&0x7)<<2) 684 #define PM3LBDestReadMode_StripePitch(p) (((p) & 0x7) << 2)
707 #define PM3LBDestReadMode_StripeHeight(h) (((h)&0x7)<<5) 685 #define PM3LBDestReadMode_StripeHeight(h) (((h) & 0x7) << 5)
708 #define PM3LBDestReadMode_Layout 1<<8 686 #define PM3LBDestReadMode_Layout (1 << 8)
709 #define PM3LBDestReadMode_Origin 1<<9 687 #define PM3LBDestReadMode_Origin (1 << 9)
710 #define PM3LBDestReadMode_UserReadEnables 1<<10 688 #define PM3LBDestReadMode_UserReadEnables (1 << 10)
711 #define PM3LBDestReadMode_Packed16 1<<11 689 #define PM3LBDestReadMode_Packed16 (1 << 11)
712 #define PM3LBDestReadMode_Width(w) (((w)&0xfff)<<12) 690 #define PM3LBDestReadMode_Width(w) (((w) & 0xfff) << 12)
713#define PM3LBReadFormat 0x8888 691#define PM3LBReadFormat 0x8888
714 #define PM3LBReadFormat_DepthWidth(w) (((w)&0x3)<<0) 692 #define PM3LBReadFormat_DepthWidth(w) (((w) & 0x3) << 0)
715 #define PM3LBReadFormat_StencilWidth(w) (((w)&0xf)<<2) 693 #define PM3LBReadFormat_StencilWidth(w) (((w) & 0xf) << 2)
716 #define PM3LBReadFormat_StencilPosition(p) (((p)&0x1f)<<6) 694 #define PM3LBReadFormat_StencilPosition(p) (((p) & 0x1f) << 6)
717 #define PM3LBReadFormat_FCPWidth(w) (((w)&0xf)<<11) 695 #define PM3LBReadFormat_FCPWidth(w) (((w) & 0xf) << 11)
718 #define PM3LBReadFormat_FCPPosition(p) (((p)&0x1f)<<15) 696 #define PM3LBReadFormat_FCPPosition(p) (((p) & 0x1f) << 15)
719 #define PM3LBReadFormat_GIDWidth(w) (((w)&0x7)<<20) 697 #define PM3LBReadFormat_GIDWidth(w) (((w) & 0x7) << 20)
720 #define PM3LBReadFormat_GIDPosition(p) (((p)&0x1f)<<23) 698 #define PM3LBReadFormat_GIDPosition(p) (((p) & 0x1f) << 23)
721#define PM3LBSourceReadBufferAddr 0xb528 699#define PM3LBSourceReadBufferAddr 0xb528
722#define PM3LBSourceReadBufferOffset 0xb530 700#define PM3LBSourceReadBufferOffset 0xb530
723#define PM3LBSourceReadMode 0xb520 701#define PM3LBSourceReadMode 0xb520
724#define PM3LBSourceReadModeAnd 0xb5a0 702#define PM3LBSourceReadModeAnd 0xb5a0
725#define PM3LBSourceReadModeOr 0xb5a8 703#define PM3LBSourceReadModeOr 0xb5a8
726 #define PM3LBSourceReadMode_Enable 1<<0 704 #define PM3LBSourceReadMode_Enable (1 << 0)
727 #define PM3LBSourceReadMode_StripePitch(p) (((p)&0x7)<<2) 705 #define PM3LBSourceReadMode_StripePitch(p) (((p) & 0x7) << 2)
728 #define PM3LBSourceReadMode_StripeHeight(h) (((h)&0x7)<<5) 706 #define PM3LBSourceReadMode_StripeHeight(h) (((h) & 0x7) << 5)
729 #define PM3LBSourceReadMode_Layout 1<<8 707 #define PM3LBSourceReadMode_Layout (1 << 8)
730 #define PM3LBSourceReadMode_Origin 1<<9 708 #define PM3LBSourceReadMode_Origin (1 << 9)
731 #define PM3LBSourceReadMode_Packed16 1<<10 709 #define PM3LBSourceReadMode_Packed16 (1 << 10)
732 #define PM3LBSourceReadMode_Width(w) (((w)&0xfff)<<11) 710 #define PM3LBSourceReadMode_Width(w) (((w) & 0xfff) << 11)
733#define PM3LBStencil 0x88a8 711#define PM3LBStencil 0x88a8
734#define PM3LBWriteBufferAddr 0xb540 712#define PM3LBWriteBufferAddr 0xb540
735#define PM3LBWriteBufferOffset 0xb548 713#define PM3LBWriteBufferOffset 0xb548
736#define PM3LBWriteFormat 0x88c8 714#define PM3LBWriteFormat 0x88c8
737 #define PM3LBWriteFormat_DepthWidth(w) (((w)&0x3)<<0) 715 #define PM3LBWriteFormat_DepthWidth(w) (((w) & 0x3) << 0)
738 #define PM3LBWriteFormat_StencilWidth(w) (((w)&0xf)<<2) 716 #define PM3LBWriteFormat_StencilWidth(w) (((w) & 0xf) << 2)
739 #define PM3LBWriteFormat_StencilPosition(p) (((p)&0x1f)<<6) 717 #define PM3LBWriteFormat_StencilPosition(p) (((p) & 0x1f) << 6)
740 #define PM3LBWriteFormat_GIDWidth(w) (((w)&0x7)<<20) 718 #define PM3LBWriteFormat_GIDWidth(w) (((w) & 0x7) << 20)
741 #define PM3LBWriteFormat_GIDPosition(p) (((p)&0x1f)<<23) 719 #define PM3LBWriteFormat_GIDPosition(p) (((p) & 0x1f) << 23)
742#define PM3LBWriteMode 0x88c0 720#define PM3LBWriteMode 0x88c0
743#define PM3LBWriteModeAnd 0xac80 721#define PM3LBWriteModeAnd 0xac80
744#define PM3LBWriteModeOr 0xac88 722#define PM3LBWriteModeOr 0xac88
745 #define PM3LBWriteMode_WriteDisable 0<<0 723 #define PM3LBWriteMode_WriteDisable (0 << 0)
746 #define PM3LBWriteMode_WriteEnable 1<<0 724 #define PM3LBWriteMode_WriteEnable (1 << 0)
747 #define PM3LBWriteMode_StripePitch(p) (((p)&0x7)<<3) 725 #define PM3LBWriteMode_StripePitch(p) (((p) & 0x7) << 3)
748 #define PM3LBWriteMode_StripeHeight(h) (((h)&0x7)<<6) 726 #define PM3LBWriteMode_StripeHeight(h) (((h) & 0x7) << 6)
749 #define PM3LBWriteMode_Layout 1<<9 727 #define PM3LBWriteMode_Layout (1 << 9)
750 #define PM3LBWriteMode_Origin 1<<10 728 #define PM3LBWriteMode_Origin (1 << 10)
751 #define PM3LBWriteMode_Packed16 1<<11 729 #define PM3LBWriteMode_Packed16 (1 << 11)
752 #define PM3LBWriteMode_Width(w) (((w)&0xfff)<<12) 730 #define PM3LBWriteMode_Width(w) (((w) & 0xfff) << 12)
753/* ... */ 731/* ... */
754#define PM3LineStippleMode 0x81a8 732#define PM3LineStippleMode 0x81a8
755#define PM3LineStippleModeAnd 0xabc0 733#define PM3LineStippleModeAnd 0xabc0
@@ -759,19 +737,16 @@
759#define PM3LogicalOpMode 0x8828 737#define PM3LogicalOpMode 0x8828
760#define PM3LogicalOpModeAnd 0xace0 738#define PM3LogicalOpModeAnd 0xace0
761#define PM3LogicalOpModeOr 0xace8 739#define PM3LogicalOpModeOr 0xace8
762 #define PM3LogicalOpMode_Disable (0<<0) 740 #define PM3LogicalOpMode_Disable (0 << 0)
763 #define PM3LogicalOpMode_Enable (1<<0) 741 #define PM3LogicalOpMode_Enable (1 << 0)
764 #define PM3LogicalOpMode_LogicOp(op) (((op)&0xf)<<1) 742 #define PM3LogicalOpMode_LogicOp(op) (((op) & 0xf) << 1)
765 #define PM3LogicalOpMode_UseConstantWriteData_Disable (0<<5) 743 #define PM3LogicalOpMode_UseConstantWriteData_Disable (0 << 5)
766 #define PM3LogicalOpMode_UseConstantWriteData_Enable (1<<5) 744 #define PM3LogicalOpMode_UseConstantWriteData_Enable (1 << 5)
767 #define PM3LogicalOpMode_Background_Disable (0<<6) 745 #define PM3LogicalOpMode_Background_Disable (0 << 6)
768 #define PM3LogicalOpMode_Background_Enable (1<<6) 746 #define PM3LogicalOpMode_Background_Enable (1 << 6)
769 #define PM3LogicalOpMode_Background_LogicOp(op) (((op)&0xf)<<7) 747 #define PM3LogicalOpMode_Background_LogicOp(op) (((op) & 0xf) << 7)
770 #define PM3LogicalOpMode_UseConstantSource_Disable (0<<11) 748 #define PM3LogicalOpMode_UseConstantSource_Disable (0 << 11)
771 #define PM3LogicalOpMode_UseConstantSource_Enable (1<<11) 749 #define PM3LogicalOpMode_UseConstantSource_Enable (1 << 11)
772
773/* ... */
774#define PM3LUT 0x8e80
775/* ... */ 750/* ... */
776#define PM3LUT 0x8e80 751#define PM3LUT 0x8e80
777#define PM3LUTAddress 0x84d0 752#define PM3LUTAddress 0x84d0
@@ -783,75 +758,74 @@
783#define PM3LUTTransfer 0x84d8 758#define PM3LUTTransfer 0x84d8
784/* ... */ 759/* ... */
785#define PM3PixelSize 0x80c0 760#define PM3PixelSize 0x80c0
786 #define PM3PixelSize_GLOBAL_32BIT (0<<0) 761 #define PM3PixelSize_GLOBAL_32BIT (0 << 0)
787 #define PM3PixelSize_GLOBAL_16BIT (1<<0) 762 #define PM3PixelSize_GLOBAL_16BIT (1 << 0)
788 #define PM3PixelSize_GLOBAL_8BIT (2<<0) 763 #define PM3PixelSize_GLOBAL_8BIT (2 << 0)
789 #define PM3PixelSize_RASTERIZER_32BIT (0<<2) 764 #define PM3PixelSize_RASTERIZER_32BIT (0 << 2)
790 #define PM3PixelSize_RASTERIZER_16BIT (1<<2) 765 #define PM3PixelSize_RASTERIZER_16BIT (1 << 2)
791 #define PM3PixelSize_RASTERIZER_8BIT (2<<2) 766 #define PM3PixelSize_RASTERIZER_8BIT (2 << 2)
792 #define PM3PixelSize_SCISSOR_AND_STIPPLE_32BIT (0<<4) 767 #define PM3PixelSize_SCISSOR_AND_STIPPLE_32BIT (0 << 4)
793 #define PM3PixelSize_SCISSOR_AND_STIPPLE_16BIT (1<<4) 768 #define PM3PixelSize_SCISSOR_AND_STIPPLE_16BIT (1 << 4)
794 #define PM3PixelSize_SCISSOR_AND_STIPPLE_8BIT (2<<4) 769 #define PM3PixelSize_SCISSOR_AND_STIPPLE_8BIT (2 << 4)
795 #define PM3PixelSize_TEXTURE_32BIT (0<<6) 770 #define PM3PixelSize_TEXTURE_32BIT (0 << 6)
796 #define PM3PixelSize_TEXTURE_16BIT (1<<6) 771 #define PM3PixelSize_TEXTURE_16BIT (1 << 6)
797 #define PM3PixelSize_TEXTURE_8BIT (2<<6) 772 #define PM3PixelSize_TEXTURE_8BIT (2 << 6)
798 #define PM3PixelSize_LUT_32BIT (0<<8) 773 #define PM3PixelSize_LUT_32BIT (0 << 8)
799 #define PM3PixelSize_LUT_16BIT (1<<8) 774 #define PM3PixelSize_LUT_16BIT (1 << 8)
800 #define PM3PixelSize_LUT_8BIT (2<<8) 775 #define PM3PixelSize_LUT_8BIT (2 << 8)
801 #define PM3PixelSize_FRAMEBUFFER_32BIT (0<<10) 776 #define PM3PixelSize_FRAMEBUFFER_32BIT (0 << 10)
802 #define PM3PixelSize_FRAMEBUFFER_16BIT (1<<10) 777 #define PM3PixelSize_FRAMEBUFFER_16BIT (1 << 10)
803 #define PM3PixelSize_FRAMEBUFFER_8BIT (2<<10) 778 #define PM3PixelSize_FRAMEBUFFER_8BIT (2 << 10)
804 #define PM3PixelSize_LOGICAL_OP_32BIT (0<<12) 779 #define PM3PixelSize_LOGICAL_OP_32BIT (0 << 12)
805 #define PM3PixelSize_LOGICAL_OP_16BIT (1<<12) 780 #define PM3PixelSize_LOGICAL_OP_16BIT (1 << 12)
806 #define PM3PixelSize_LOGICAL_OP_8BIT (2<<12) 781 #define PM3PixelSize_LOGICAL_OP_8BIT (2 << 12)
807 #define PM3PixelSize_LOCALBUFFER_32BIT (0<<14) 782 #define PM3PixelSize_LOCALBUFFER_32BIT (0 << 14)
808 #define PM3PixelSize_LOCALBUFFER_16BIT (1<<14) 783 #define PM3PixelSize_LOCALBUFFER_16BIT (1 << 14)
809 #define PM3PixelSize_LOCALBUFFER_8BIT (2<<14) 784 #define PM3PixelSize_LOCALBUFFER_8BIT (2 << 14)
810 #define PM3PixelSize_SETUP_32BIT (0<<16) 785 #define PM3PixelSize_SETUP_32BIT (0 << 16)
811 #define PM3PixelSize_SETUP_16BIT (1<<16) 786 #define PM3PixelSize_SETUP_16BIT (1 << 16)
812 #define PM3PixelSize_SETUP_8BIT (2<<16) 787 #define PM3PixelSize_SETUP_8BIT (2 << 16)
813 #define PM3PixelSize_GLOBAL (0<<31) 788 #define PM3PixelSize_GLOBAL (0 << 31)
814 #define PM3PixelSize_INDIVIDUAL (1<<31) 789 #define PM3PixelSize_INDIVIDUAL (1 << 31)
815/* ... */ 790/* ... */
816#define PM3Render 0x8038 791#define PM3Render 0x8038
817 #define PM3Render_AreaStipple_Disable (0<<0) 792 #define PM3Render_AreaStipple_Disable (0 << 0)
818 #define PM3Render_AreaStipple_Enable (1<<0) 793 #define PM3Render_AreaStipple_Enable (1 << 0)
819 #define PM3Render_LineStipple_Disable (0<<1) 794 #define PM3Render_LineStipple_Disable (0 << 1)
820 #define PM3Render_LineStipple_Enable (1<<1) 795 #define PM3Render_LineStipple_Enable (1 << 1)
821 #define PM3Render_ResetLine_Disable (0<<2) 796 #define PM3Render_ResetLine_Disable (0 << 2)
822 #define PM3Render_ResetLine_Enable (1<<2) 797 #define PM3Render_ResetLine_Enable (1 << 2)
823 #define PM3Render_FastFill_Disable (0<<3) 798 #define PM3Render_FastFill_Disable (0 << 3)
824 #define PM3Render_FastFill_Enable (1<<3) 799 #define PM3Render_FastFill_Enable (1 << 3)
825 #define PM3Render_Primitive_Line (0<<6) 800 #define PM3Render_Primitive_Line (0 << 6)
826 #define PM3Render_Primitive_Trapezoid (1<<6) 801 #define PM3Render_Primitive_Trapezoid (1 << 6)
827 #define PM3Render_Primitive_Point (2<<6) 802 #define PM3Render_Primitive_Point (2 << 6)
828 #define PM3Render_Antialias_Disable (0<<8) 803 #define PM3Render_Antialias_Disable (0 << 8)
829 #define PM3Render_Antialias_Enable (1<<8) 804 #define PM3Render_Antialias_Enable (1 << 8)
830 #define PM3Render_Antialias_SubPixelRes_4x4 (0<<9) 805 #define PM3Render_Antialias_SubPixelRes_4x4 (0 << 9)
831 #define PM3Render_Antialias_SubPixelRes_8x8 (1<<9) 806 #define PM3Render_Antialias_SubPixelRes_8x8 (1 << 9)
832 #define PM3Render_UsePointTable_Disable (0<<10) 807 #define PM3Render_UsePointTable_Disable (0 << 10)
833 #define PM3Render_UsePointTable_Enable (1<<10) 808 #define PM3Render_UsePointTable_Enable (1 << 10)
834 #define PM3Render_SyncOnbitMask_Disable (0<<11) 809 #define PM3Render_SyncOnbitMask_Disable (0 << 11)
835 #define PM3Render_SyncOnBitMask_Enable (1<<11) 810 #define PM3Render_SyncOnBitMask_Enable (1 << 11)
836 #define PM3Render_SyncOnHostData_Disable (0<<12) 811 #define PM3Render_SyncOnHostData_Disable (0 << 12)
837 #define PM3Render_SyncOnHostData_Enable (1<<12) 812 #define PM3Render_SyncOnHostData_Enable (1 << 12)
838 #define PM3Render_Texture_Disable (0<<13) 813 #define PM3Render_Texture_Disable (0 << 13)
839 #define PM3Render_Texture_Enable (1<<13) 814 #define PM3Render_Texture_Enable (1 << 13)
840 #define PM3Render_Fog_Disable (0<<14) 815 #define PM3Render_Fog_Disable (0 << 14)
841 #define PM3Render_Fog_Enable (1<<14) 816 #define PM3Render_Fog_Enable (1 << 14)
842 #define PM3Render_Coverage_Disable (0<<15) 817 #define PM3Render_Coverage_Disable (0 << 15)
843 #define PM3Render_Coverage_Enable (1<<15) 818 #define PM3Render_Coverage_Enable (1 << 15)
844 #define PM3Render_SubPixelCorrection_Disable (0<<16) 819 #define PM3Render_SubPixelCorrection_Disable (0 << 16)
845 #define PM3Render_SubPixelCorrection_Enable (1<<16) 820 #define PM3Render_SubPixelCorrection_Enable (1 << 16)
846 #define PM3Render_SpanOperation_Disable (0<<18) 821 #define PM3Render_SpanOperation_Disable (0 << 18)
847 #define PM3Render_SpanOperation_Enable (1<<18) 822 #define PM3Render_SpanOperation_Enable (1 << 18)
848 #define PM3Render_FBSourceRead_Disable (0<<27) 823 #define PM3Render_FBSourceRead_Disable (0 << 27)
849 #define PM3Render_FBSourceRead_Enable (1<<27) 824 #define PM3Render_FBSourceRead_Enable (1 << 27)
850#define PM3RasterizerMode 0x80a0 825#define PM3RasterizerMode 0x80a0
851#define PM3RasterizerModeAnd 0xaba0 826#define PM3RasterizerModeAnd 0xaba0
852#define PM3RasterizerModeOr 0xabb8 827#define PM3RasterizerModeOr 0xaba8
853#define PM3RectangleHeight 0x94e0 828#define PM3RectangleHeight 0x94e0
854#define PM3Render 0x8038
855#define PM3RepeatLine 0x9328 829#define PM3RepeatLine 0x9328
856#define PM3ResetPickResult 0x8c20 830#define PM3ResetPickResult 0x8c20
857#define PM3RLEMask 0x8c48 831#define PM3RLEMask 0x8c48
@@ -918,31 +892,31 @@
918#define PM3TextureIndexMode1And 0xb3d0 892#define PM3TextureIndexMode1And 0xb3d0
919#define PM3TextureIndexMode1Or 0xb3d8 893#define PM3TextureIndexMode1Or 0xb3d8
920/* ... */ 894/* ... */
921#define PM3TextureMapSize 0xb428 895#define PM3TextureMapSize 0xb428
922#define PM3TextureMapWidth0 0x8580 896#define PM3TextureMapWidth0 0x8580
923#define PM3TextureMapWidth1 0x8588 897#define PM3TextureMapWidth1 0x8588
924 #define PM3TextureMapWidth_Width(w) ((w&0xfff)<<0) 898 #define PM3TextureMapWidth_Width(w) (((w) & 0xfff) << 0)
925 #define PM3TextureMapWidth_BorderLayout (1<<12) 899 #define PM3TextureMapWidth_BorderLayout (1 << 12)
926 #define PM3TextureMapWidth_Layout_Linear (0<<13) 900 #define PM3TextureMapWidth_Layout_Linear (0 << 13)
927 #define PM3TextureMapWidth_Layout_Patch64 (1<<13) 901 #define PM3TextureMapWidth_Layout_Patch64 (1 << 13)
928 #define PM3TextureMapWidth_Layout_Patch32_2 (2<<13) 902 #define PM3TextureMapWidth_Layout_Patch32_2 (2 << 13)
929 #define PM3TextureMapWidth_Layout_Patch2 (3<<13) 903 #define PM3TextureMapWidth_Layout_Patch2 (3 << 13)
930 #define PM3TextureMapWidth_HostTexture (1<<15) 904 #define PM3TextureMapWidth_HostTexture (1 << 15)
931#define PM3TextureReadMode0 0xb400 905#define PM3TextureReadMode0 0xb400
932#define PM3TextureReadMode0And 0xac30 906#define PM3TextureReadMode0And 0xac30
933#define PM3TextureReadMode0Or 0xac38 907#define PM3TextureReadMode0Or 0xac38
934#define PM3TextureReadMode1 0xb408 908#define PM3TextureReadMode1 0xb408
935#define PM3TextureReadMode1And 0xad40 909#define PM3TextureReadMode1And 0xad40
936#define PM3TextureReadMode1Or 0xad48 910#define PM3TextureReadMode1Or 0xad48
937/* ... */ 911/* ... */
938#define PM3WaitForCompletion 0x80b8 912#define PM3WaitForCompletion 0x80b8
939#define PM3Window 0x8980 913#define PM3Window 0x8980
940 #define PM3Window_ForceLBUpdate 1<<3 914 #define PM3Window_ForceLBUpdate (1 << 3)
941 #define PM3Window_LBUpdateSource 1<<4 915 #define PM3Window_LBUpdateSource (1 << 4)
942 #define PM3Window_FrameCount(c) (((c)&0xff)<<9) 916 #define PM3Window_FrameCount(c) (((c) & 0xff) << 9)
943 #define PM3Window_StencilFCP 1<<17 917 #define PM3Window_StencilFCP (1 << 17)
944 #define PM3Window_DepthFCP 1<<18 918 #define PM3Window_DepthFCP (1 << 18)
945 #define PM3Window_OverrideWriteFiltering 1<<19 919 #define PM3Window_OverrideWriteFiltering (1 << 19)
946#define PM3WindowAnd 0xab80 920#define PM3WindowAnd 0xab80
947#define PM3WindowOr 0xab88 921#define PM3WindowOr 0xab88
948#define PM3WindowOrigin 0x81c8 922#define PM3WindowOrigin 0x81c8
@@ -957,169 +931,131 @@
957 931
958 932
959/********************************************** 933/**********************************************
960* GLINT Permedia3 2D setup Unit * 934* GLINT Permedia3 2D setup Unit *
961***********************************************/ 935***********************************************/
962#define PM3Config2D 0xb618 936#define PM3Config2D 0xb618
963 #define PM3Config2D_OpaqueSpan 1<<0 937 #define PM3Config2D_OpaqueSpan (1 << 0)
964 #define PM3Config2D_MultiRXBlit 1<<1 938 #define PM3Config2D_MultiRXBlit (1 << 1)
965 #define PM3Config2D_UserScissorEnable 1<<2 939 #define PM3Config2D_UserScissorEnable (1 << 2)
966 #define PM3Config2D_FBDestReadEnable 1<<3 940 #define PM3Config2D_FBDestReadEnable (1 << 3)
967 #define PM3Config2D_AlphaBlendEnable 1<<4 941 #define PM3Config2D_AlphaBlendEnable (1 << 4)
968 #define PM3Config2D_DitherEnable 1<<5 942 #define PM3Config2D_DitherEnable (1 << 5)
969 #define PM3Config2D_ForegroundROPEnable 1<<6 943 #define PM3Config2D_ForegroundROPEnable (1 << 6)
970 #define PM3Config2D_ForegroundROP(rop) (((rop)&0xf)<<7) 944 #define PM3Config2D_ForegroundROP(rop) (((rop) & 0xf) << 7)
971 #define PM3Config2D_BackgroundROPEnable 1<<11 945 #define PM3Config2D_BackgroundROPEnable (1 << 11)
972 #define PM3Config2D_BackgroundROP(rop) (((rop)&0xf)<<12) 946 #define PM3Config2D_BackgroundROP(rop) (((rop) & 0xf) << 12)
973 #define PM3Config2D_UseConstantSource 1<<16 947 #define PM3Config2D_UseConstantSource (1 << 16)
974 #define PM3Config2D_FBWriteEnable 1<<17 948 #define PM3Config2D_FBWriteEnable (1 << 17)
975 #define PM3Config2D_Blocking 1<<18 949 #define PM3Config2D_Blocking (1 << 18)
976 #define PM3Config2D_ExternalSourceData 1<<19 950 #define PM3Config2D_ExternalSourceData (1 << 19)
977 #define PM3Config2D_LUTModeEnable 1<<20 951 #define PM3Config2D_LUTModeEnable (1 << 20)
978#define PM3DownloadGlyphwidth 0xb658 952#define PM3DownloadGlyphwidth 0xb658
979 #define PM3DownloadGlyphwidth_GlyphWidth(gw) ((gw)&0xffff) 953 #define PM3DownloadGlyphwidth_GlyphWidth(gw) ((gw) & 0xffff)
980#define PM3DownloadTarget 0xb650 954#define PM3DownloadTarget 0xb650
981 #define PM3DownloadTarget_TagName(tag) ((tag)&0x1fff) 955 #define PM3DownloadTarget_TagName(tag) ((tag) & 0x1fff)
982#define PM3GlyphData 0xb660 956#define PM3GlyphData 0xb660
983#define PM3GlyphPosition 0xb608 957#define PM3GlyphPosition 0xb608
984 #define PM3GlyphPosition_XOffset(x) ((x)&0xffff) 958 #define PM3GlyphPosition_XOffset(x) ((x) & 0xffff)
985 #define PM3GlyphPosition_YOffset(y) (((y)&0xffff)<<16) 959 #define PM3GlyphPosition_YOffset(y) (((y) & 0xffff) << 16)
986#define PM3Packed4Pixels 0xb668 960#define PM3Packed4Pixels 0xb668
987#define PM3Packed8Pixels 0xb630 961#define PM3Packed8Pixels 0xb630
988#define PM3Packed16Pixels 0xb638 962#define PM3Packed16Pixels 0xb638
989#define PM3RectanglePosition 0xb600 963#define PM3RectanglePosition 0xb600
990 #define PM3RectanglePosition_XOffset(x) ((x)&0xffff) 964 #define PM3RectanglePosition_XOffset(x) ((x) & 0xffff)
991 #define PM3RectanglePosition_YOffset(y) (((y)&0xffff)<<16) 965 #define PM3RectanglePosition_YOffset(y) (((y) & 0xffff) << 16)
992#define PM3Render2D 0xb640 966#define PM3Render2D 0xb640
993 #define PM3Render2D_Width(w) ((w)&0x0fff) 967 #define PM3Render2D_Width(w) ((w) & 0x0fff)
994 #define PM3Render2D_Operation_Normal 0<<12 968 #define PM3Render2D_Operation_Normal (0 << 12)
995 #define PM3Render2D_Operation_SyncOnHostData 1<<12 969 #define PM3Render2D_Operation_SyncOnHostData (1 << 12)
996 #define PM3Render2D_Operation_SyncOnBitMask 2<<12 970 #define PM3Render2D_Operation_SyncOnBitMask (2 << 12)
997 #define PM3Render2D_Operation_PatchOrderRendering 3<<12 971 #define PM3Render2D_Operation_PatchOrderRendering (3 << 12)
998 #define PM3Render2D_FBSourceReadEnable 1<<14 972 #define PM3Render2D_FBSourceReadEnable (1 << 14)
999 #define PM3Render2D_SpanOperation 1<<15 973 #define PM3Render2D_SpanOperation (1 << 15)
1000 #define PM3Render2D_Height(h) (((h)&0x0fff)<<16) 974 #define PM3Render2D_Height(h) (((h) & 0x0fff) << 16)
1001 #define PM3Render2D_XPositive 1<<28 975 #define PM3Render2D_XPositive (1 << 28)
1002 #define PM3Render2D_YPositive 1<<29 976 #define PM3Render2D_YPositive (1 << 29)
1003 #define PM3Render2D_AreaStippleEnable 1<<30 977 #define PM3Render2D_AreaStippleEnable (1 << 30)
1004 #define PM3Render2D_TextureEnable 1<<31 978 #define PM3Render2D_TextureEnable (1 << 31)
1005#define PM3Render2DGlyph 0xb648 979#define PM3Render2DGlyph 0xb648
1006 #define PM3Render2DGlyph_Width(w) ((w)&0x7f) 980 #define PM3Render2DGlyph_Width(w) ((w) & 0x7f)
1007 #define PM3Render2DGlyph_Height(h) (((h)&0x7f)<<7) 981 #define PM3Render2DGlyph_Height(h) (((h) & 0x7f) << 7)
1008 #define PM3Render2DGlyph_XOffset(x) (((x)&0x1ff)<<14) 982 #define PM3Render2DGlyph_XOffset(x) (((x) & 0x1ff) << 14)
1009 #define PM3Render2DGlyph_YOffset(y) (((y)&0x1ff)<<23) 983 #define PM3Render2DGlyph_YOffset(y) (((y) & 0x1ff) << 23)
1010#define PM3RenderPatchOffset 0xb610 984#define PM3RenderPatchOffset 0xb610
1011 #define PM3RenderPatchOffset_XOffset(x) ((x)&0xffff) 985 #define PM3RenderPatchOffset_XOffset(x) ((x) & 0xffff)
1012 #define PM3RenderPatchOffset_YOffset(y) (((y)&0xffff)<<16) 986 #define PM3RenderPatchOffset_YOffset(y) (((y) & 0xffff) << 16)
1013#define PM3RLCount 0xb678 987#define PM3RLCount 0xb678
1014 #define PM3RLCount_Count(c) ((c)&0x0fff) 988 #define PM3RLCount_Count(c) ((c) & 0x0fff)
1015#define PM3RLData 0xb670 989#define PM3RLData 0xb670
1016 990
1017/********************************************** 991/**********************************************
1018* GLINT Permedia3 Alias Register * 992* GLINT Permedia3 Alias Register *
1019***********************************************/ 993***********************************************/
1020#define PM3FillBackgroundColor 0x8330 994#define PM3FillBackgroundColor 0x8330
1021#define PM3FillConfig2D0 0x8338 995#define PM3FillConfig2D0 0x8338
1022#define PM3FillConfig2D1 0x8360 996#define PM3FillConfig2D1 0x8360
1023 #define PM3FillConfig2D_OpaqueSpan 1<<0 997 #define PM3FillConfig2D_OpaqueSpan (1 << 0)
1024 #define PM3FillConfig2D_MultiRXBlit 1<<1 998 #define PM3FillConfig2D_MultiRXBlit (1 << 1)
1025 #define PM3FillConfig2D_UserScissorEnable 1<<2 999 #define PM3FillConfig2D_UserScissorEnable (1 << 2)
1026 #define PM3FillConfig2D_FBDestReadEnable 1<<3 1000 #define PM3FillConfig2D_FBDestReadEnable (1 << 3)
1027 #define PM3FillConfig2D_AlphaBlendEnable 1<<4 1001 #define PM3FillConfig2D_AlphaBlendEnable (1 << 4)
1028 #define PM3FillConfig2D_DitherEnable 1<<5 1002 #define PM3FillConfig2D_DitherEnable (1 << 5)
1029 #define PM3FillConfig2D_ForegroundROPEnable 1<<6 1003 #define PM3FillConfig2D_ForegroundROPEnable (1 << 6)
1030 #define PM3FillConfig2D_ForegroundROP(rop) (((rop)&0xf)<<7) 1004 #define PM3FillConfig2D_ForegroundROP(rop) (((rop) & 0xf) << 7)
1031 #define PM3FillConfig2D_BackgroundROPEnable 1<<11 1005 #define PM3FillConfig2D_BackgroundROPEnable (1 << 11)
1032 #define PM3FillConfig2D_BackgroundROP(rop) (((rop)&0xf)<<12) 1006 #define PM3FillConfig2D_BackgroundROP(rop) (((rop) & 0xf) << 12)
1033 #define PM3FillConfig2D_UseConstantSource 1<<16 1007 #define PM3FillConfig2D_UseConstantSource (1 << 16)
1034 #define PM3FillConfig2D_FBWriteEnable 1<<17 1008 #define PM3FillConfig2D_FBWriteEnable (1 << 17)
1035 #define PM3FillConfig2D_Blocking 1<<18 1009 #define PM3FillConfig2D_Blocking (1 << 18)
1036 #define PM3FillConfig2D_ExternalSourceData 1<<19 1010 #define PM3FillConfig2D_ExternalSourceData (1 << 19)
1037 #define PM3FillConfig2D_LUTModeEnable 1<<20 1011 #define PM3FillConfig2D_LUTModeEnable (1 << 20)
1038#define PM3FillFBDestReadBufferAddr 0x8310 1012#define PM3FillFBDestReadBufferAddr 0x8310
1039#define PM3FillFBSourceReadBufferAddr 0x8308 1013#define PM3FillFBSourceReadBufferAddr 0x8308
1040#define PM3FillFBSourceReadBufferOffset 0x8340 1014#define PM3FillFBSourceReadBufferOffset 0x8340
1041 #define PM3FillFBSourceReadBufferOffset_XOffset(x) ((x)&0xffff) 1015 #define PM3FillFBSourceReadBufferOffset_XOffset(x) ((x) & 0xffff)
1042 #define PM3FillFBSourceReadBufferOffset_YOffset(y) (((y)&0xffff)<<16) 1016 #define PM3FillFBSourceReadBufferOffset_YOffset(y) \
1043#define PM3FillFBWriteBufferAddr 0x8300 1017 (((y) & 0xffff) << 16)
1044#define PM3FillForegroundColor0 0x8328 1018#define PM3FillFBWriteBufferAddr 0x8300
1045#define PM3FillForegroundColor1 0x8358 1019#define PM3FillForegroundColor0 0x8328
1046#define PM3FillGlyphPosition 0x8368 1020#define PM3FillForegroundColor1 0x8358
1047 #define PM3FillGlyphPosition_XOffset(x) ((x)&0xffff) 1021#define PM3FillGlyphPosition 0x8368
1048 #define PM3FillGlyphPosition_YOffset(y) (((y)&0xffff)<<16) 1022 #define PM3FillGlyphPosition_XOffset(x) ((x) & 0xffff)
1049#define PM3FillRectanglePosition 0x8348 1023 #define PM3FillGlyphPosition_YOffset(y) (((y) & 0xffff) << 16)
1050 #define PM3FillRectanglePosition_XOffset(x) ((x)&0xffff) 1024#define PM3FillRectanglePosition 0x8348
1051 #define PM3FillRectanglePosition_YOffset(y) (((y)&0xffff)<<16) 1025 #define PM3FillRectanglePosition_XOffset(x) ((x) & 0xffff)
1026 #define PM3FillRectanglePosition_YOffset(y) (((y) & 0xffff) << 16)
1052 1027
1053#define PM3_REGS_SIZE 0x10000
1054#define PM3_MAX_PIXCLOCK 300000
1055/* a few more useful registers & regs value... */ 1028/* a few more useful registers & regs value... */
1056#define PM3Sync 0x8c40 1029#define PM3Sync 0x8c40
1057 #define PM3Sync_Tag 0x188 1030 #define PM3Sync_Tag 0x188
1058#define PM3FilterMode 0x8c00 1031#define PM3FilterMode 0x8c00
1059 #define PM3FilterModeSync 0x400 1032 #define PM3FilterModeSync 0x400
1060#define PM3OutputFifo 0x2000 1033#define PM3OutputFifo 0x2000
1061#define PM3StatisticMode 0x8c08 1034#define PM3StatisticMode 0x8c08
1062#define PM3AreaStippleMode 0x81a0 1035#define PM3AreaStippleMode 0x81a0
1063 #define AreaStipplePattern0 (0x8200) 1036#define AreaStipplePattern_indexed(i) (0x8200 + ((i) * 0x8))
1064 #define AreaStipplePattern1 (0x8208)
1065 #define AreaStipplePattern2 (0x8210)
1066 #define AreaStipplePattern3 (0x8218)
1067 #define AreaStipplePattern4 (0x8220)
1068 #define AreaStipplePattern5 (0x8228)
1069 #define AreaStipplePattern6 (0x8230)
1070 #define AreaStipplePattern7 (0x8238)
1071 #define AreaStipplePattern8 (0x8240)
1072 #define AreaStipplePattern9 (0x8248)
1073 #define AreaStipplePattern10 (0x8250)
1074 #define AreaStipplePattern11 (0x8258)
1075 #define AreaStipplePattern12 (0x8260)
1076 #define AreaStipplePattern13 (0x8268)
1077 #define AreaStipplePattern14 (0x8270)
1078 #define AreaStipplePattern15 (0x8278)
1079 #define AreaStipplePattern16 (0x8280)
1080 #define AreaStipplePattern17 (0x8288)
1081 #define AreaStipplePattern18 (0x8290)
1082 #define AreaStipplePattern19 (0x8298)
1083 #define AreaStipplePattern20 (0x82a0)
1084 #define AreaStipplePattern21 (0x82a8)
1085 #define AreaStipplePattern22 (0x82b0)
1086 #define AreaStipplePattern23 (0x82b8)
1087 #define AreaStipplePattern24 (0x82c0)
1088 #define AreaStipplePattern25 (0x82c8)
1089 #define AreaStipplePattern26 (0x82d0)
1090 #define AreaStipplePattern27 (0x82d8)
1091 #define AreaStipplePattern28 (0x82eo)
1092 #define AreaStipplePattern29 (0x82e8)
1093 #define AreaStipplePattern30 (0x82f0)
1094 #define AreaStipplePattern31 (0x82f8)
1095 #define AreaStipplePattern_indexed(i) (0x8200 + ((i) * 0x8))
1096 1037
1097#define PM3DepthMode 0x89a0 1038#define PM3DepthMode 0x89a0
1098#define PM3StencilMode 0x8988 1039#define PM3StencilMode 0x8988
1099#define PM3StencilData 0x8990 1040#define PM3StencilData 0x8990
1100#define PM3TextureReadMode 0x8670 1041#define PM3TextureReadMode 0x8670
1101#define PM3FogMode 0x8690 1042#define PM3FogMode 0x8690
1102#define PM3ChromaTestMode 0x8f18 1043#define PM3ChromaTestMode 0x8f18
1103#define PM3YUVMode 0x8f00 1044#define PM3YUVMode 0x8f00
1104#define PM3BitMaskPattern 0x8068 1045#define PM3BitMaskPattern 0x8068
1105 1046
1106/* ***************************** */ 1047/* ***************************** */
1107/* ***** pm3fb IOCTL const ***** */ 1048/* ***** pm3fb IOCTL const ***** */
1108/* ***************************** */ 1049/* ***************************** */
1109/* debug-only IOCTL */ 1050#define PM3FBIO_RESETCHIP 0x504D33FF /* 'PM3\377' */
1110#define PM3FBIO_CLEARMEMORY 0x504D3300 /* 'PM3\000' */
1111#define PM3FBIO_CLEARCMAP 0x504D3301 /* 'PM3\001' */
1112/* common use IOCTL */
1113#define PM3FBIO_RESETCHIP 0x504D33FF /* 'PM3\377' */
1114 1051
1115/* ***************************************** */ 1052/* ***************************************** */
1116/* ***** pm3fb useful define and macro ***** */ 1053/* ***** pm3fb useful define and macro ***** */
1117/* ***************************************** */ 1054/* ***************************************** */
1118 1055
1119/* max size of options */ 1056/* fifo size in chip */
1120#define PM3_OPTIONS_SIZE 256 1057#define PM3_FIFO_SIZE 120
1121 1058#define PM3_REGS_SIZE 0x10000
1122/* max size of font name */ 1059#define PM3_MAX_PIXCLOCK 300000
1123#define PM3_FONTNAME_SIZE 40
1124 1060
1125#endif /* PM3FB_H */ 1061#endif /* PM3FB_H */
diff --git a/include/video/tdfx.h b/include/video/tdfx.h
index c1cc94ba3fdd..05b63c2a5abc 100644
--- a/include/video/tdfx.h
+++ b/include/video/tdfx.h
@@ -2,140 +2,140 @@
2#define _TDFX_H 2#define _TDFX_H
3 3
4/* membase0 register offsets */ 4/* membase0 register offsets */
5#define STATUS 0x00 5#define STATUS 0x00
6#define PCIINIT0 0x04 6#define PCIINIT0 0x04
7#define SIPMONITOR 0x08 7#define SIPMONITOR 0x08
8#define LFBMEMORYCONFIG 0x0c 8#define LFBMEMORYCONFIG 0x0c
9#define MISCINIT0 0x10 9#define MISCINIT0 0x10
10#define MISCINIT1 0x14 10#define MISCINIT1 0x14
11#define DRAMINIT0 0x18 11#define DRAMINIT0 0x18
12#define DRAMINIT1 0x1c 12#define DRAMINIT1 0x1c
13#define AGPINIT 0x20 13#define AGPINIT 0x20
14#define TMUGBEINIT 0x24 14#define TMUGBEINIT 0x24
15#define VGAINIT0 0x28 15#define VGAINIT0 0x28
16#define VGAINIT1 0x2c 16#define VGAINIT1 0x2c
17#define DRAMCOMMAND 0x30 17#define DRAMCOMMAND 0x30
18#define DRAMDATA 0x34 18#define DRAMDATA 0x34
19/* reserved 0x38 */ 19/* reserved 0x38 */
20/* reserved 0x3c */ 20/* reserved 0x3c */
21#define PLLCTRL0 0x40 21#define PLLCTRL0 0x40
22#define PLLCTRL1 0x44 22#define PLLCTRL1 0x44
23#define PLLCTRL2 0x48 23#define PLLCTRL2 0x48
24#define DACMODE 0x4c 24#define DACMODE 0x4c
25#define DACADDR 0x50 25#define DACADDR 0x50
26#define DACDATA 0x54 26#define DACDATA 0x54
27#define RGBMAXDELTA 0x58 27#define RGBMAXDELTA 0x58
28#define VIDPROCCFG 0x5c 28#define VIDPROCCFG 0x5c
29#define HWCURPATADDR 0x60 29#define HWCURPATADDR 0x60
30#define HWCURLOC 0x64 30#define HWCURLOC 0x64
31#define HWCURC0 0x68 31#define HWCURC0 0x68
32#define HWCURC1 0x6c 32#define HWCURC1 0x6c
33#define VIDINFORMAT 0x70 33#define VIDINFORMAT 0x70
34#define VIDINSTATUS 0x74 34#define VIDINSTATUS 0x74
35#define VIDSERPARPORT 0x78 35#define VIDSERPARPORT 0x78
36#define VIDINXDELTA 0x7c 36#define VIDINXDELTA 0x7c
37#define VIDININITERR 0x80 37#define VIDININITERR 0x80
38#define VIDINYDELTA 0x84 38#define VIDINYDELTA 0x84
39#define VIDPIXBUFTHOLD 0x88 39#define VIDPIXBUFTHOLD 0x88
40#define VIDCHRMIN 0x8c 40#define VIDCHRMIN 0x8c
41#define VIDCHRMAX 0x90 41#define VIDCHRMAX 0x90
42#define VIDCURLIN 0x94 42#define VIDCURLIN 0x94
43#define VIDSCREENSIZE 0x98 43#define VIDSCREENSIZE 0x98
44#define VIDOVRSTARTCRD 0x9c 44#define VIDOVRSTARTCRD 0x9c
45#define VIDOVRENDCRD 0xa0 45#define VIDOVRENDCRD 0xa0
46#define VIDOVRDUDX 0xa4 46#define VIDOVRDUDX 0xa4
47#define VIDOVRDUDXOFF 0xa8 47#define VIDOVRDUDXOFF 0xa8
48#define VIDOVRDVDY 0xac 48#define VIDOVRDVDY 0xac
49/* ... */ 49/* ... */
50#define VIDOVRDVDYOFF 0xe0 50#define VIDOVRDVDYOFF 0xe0
51#define VIDDESKSTART 0xe4 51#define VIDDESKSTART 0xe4
52#define VIDDESKSTRIDE 0xe8 52#define VIDDESKSTRIDE 0xe8
53#define VIDINADDR0 0xec 53#define VIDINADDR0 0xec
54#define VIDINADDR1 0xf0 54#define VIDINADDR1 0xf0
55#define VIDINADDR2 0xf4 55#define VIDINADDR2 0xf4
56#define VIDINSTRIDE 0xf8 56#define VIDINSTRIDE 0xf8
57#define VIDCUROVRSTART 0xfc 57#define VIDCUROVRSTART 0xfc
58 58
59#define INTCTRL (0x00100000 + 0x04) 59#define INTCTRL (0x00100000 + 0x04)
60#define CLIP0MIN (0x00100000 + 0x08) 60#define CLIP0MIN (0x00100000 + 0x08)
61#define CLIP0MAX (0x00100000 + 0x0c) 61#define CLIP0MAX (0x00100000 + 0x0c)
62#define DSTBASE (0x00100000 + 0x10) 62#define DSTBASE (0x00100000 + 0x10)
63#define DSTFORMAT (0x00100000 + 0x14) 63#define DSTFORMAT (0x00100000 + 0x14)
64#define SRCBASE (0x00100000 + 0x34) 64#define SRCBASE (0x00100000 + 0x34)
65#define COMMANDEXTRA_2D (0x00100000 + 0x38) 65#define COMMANDEXTRA_2D (0x00100000 + 0x38)
66#define CLIP1MIN (0x00100000 + 0x4c) 66#define CLIP1MIN (0x00100000 + 0x4c)
67#define CLIP1MAX (0x00100000 + 0x50) 67#define CLIP1MAX (0x00100000 + 0x50)
68#define SRCFORMAT (0x00100000 + 0x54) 68#define SRCFORMAT (0x00100000 + 0x54)
69#define SRCSIZE (0x00100000 + 0x58) 69#define SRCSIZE (0x00100000 + 0x58)
70#define SRCXY (0x00100000 + 0x5c) 70#define SRCXY (0x00100000 + 0x5c)
71#define COLORBACK (0x00100000 + 0x60) 71#define COLORBACK (0x00100000 + 0x60)
72#define COLORFORE (0x00100000 + 0x64) 72#define COLORFORE (0x00100000 + 0x64)
73#define DSTSIZE (0x00100000 + 0x68) 73#define DSTSIZE (0x00100000 + 0x68)
74#define DSTXY (0x00100000 + 0x6c) 74#define DSTXY (0x00100000 + 0x6c)
75#define COMMAND_2D (0x00100000 + 0x70) 75#define COMMAND_2D (0x00100000 + 0x70)
76#define LAUNCH_2D (0x00100000 + 0x80) 76#define LAUNCH_2D (0x00100000 + 0x80)
77 77
78#define COMMAND_3D (0x00200000 + 0x120) 78#define COMMAND_3D (0x00200000 + 0x120)
79 79
80/* register bitfields (not all, only as needed) */ 80/* register bitfields (not all, only as needed) */
81 81
82#define BIT(x) (1UL << (x)) 82#define BIT(x) (1UL << (x))
83 83
84/* COMMAND_2D reg. values */ 84/* COMMAND_2D reg. values */
85#define TDFX_ROP_COPY 0xcc // src 85#define TDFX_ROP_COPY 0xcc /* src */
86#define TDFX_ROP_INVERT 0x55 // NOT dst 86#define TDFX_ROP_INVERT 0x55 /* NOT dst */
87#define TDFX_ROP_XOR 0x66 // src XOR dst 87#define TDFX_ROP_XOR 0x66 /* src XOR dst */
88 88
89#define AUTOINC_DSTX BIT(10) 89#define AUTOINC_DSTX BIT(10)
90#define AUTOINC_DSTY BIT(11) 90#define AUTOINC_DSTY BIT(11)
91#define COMMAND_2D_FILLRECT 0x05 91#define COMMAND_2D_FILLRECT 0x05
92#define COMMAND_2D_S2S_BITBLT 0x01 // screen to screen 92#define COMMAND_2D_S2S_BITBLT 0x01 /* screen to screen */
93#define COMMAND_2D_H2S_BITBLT 0x03 // host to screen 93#define COMMAND_2D_H2S_BITBLT 0x03 /* host to screen */
94 94
95#define COMMAND_3D_NOP 0x00 95#define COMMAND_3D_NOP 0x00
96#define STATUS_RETRACE BIT(6) 96#define STATUS_RETRACE BIT(6)
97#define STATUS_BUSY BIT(9) 97#define STATUS_BUSY BIT(9)
98#define MISCINIT1_CLUT_INV BIT(0) 98#define MISCINIT1_CLUT_INV BIT(0)
99#define MISCINIT1_2DBLOCK_DIS BIT(15) 99#define MISCINIT1_2DBLOCK_DIS BIT(15)
100#define DRAMINIT0_SGRAM_NUM BIT(26) 100#define DRAMINIT0_SGRAM_NUM BIT(26)
101#define DRAMINIT0_SGRAM_TYPE BIT(27) 101#define DRAMINIT0_SGRAM_TYPE BIT(27)
102#define DRAMINIT0_SGRAM_TYPE_MASK (BIT(27)|BIT(28)|BIT(29)) 102#define DRAMINIT0_SGRAM_TYPE_MASK (BIT(27) | BIT(28) | BIT(29))
103#define DRAMINIT0_SGRAM_TYPE_SHIFT 27 103#define DRAMINIT0_SGRAM_TYPE_SHIFT 27
104#define DRAMINIT1_MEM_SDRAM BIT(30) 104#define DRAMINIT1_MEM_SDRAM BIT(30)
105#define VGAINIT0_VGA_DISABLE BIT(0) 105#define VGAINIT0_VGA_DISABLE BIT(0)
106#define VGAINIT0_EXT_TIMING BIT(1) 106#define VGAINIT0_EXT_TIMING BIT(1)
107#define VGAINIT0_8BIT_DAC BIT(2) 107#define VGAINIT0_8BIT_DAC BIT(2)
108#define VGAINIT0_EXT_ENABLE BIT(6) 108#define VGAINIT0_EXT_ENABLE BIT(6)
109#define VGAINIT0_WAKEUP_3C3 BIT(8) 109#define VGAINIT0_WAKEUP_3C3 BIT(8)
110#define VGAINIT0_LEGACY_DISABLE BIT(9) 110#define VGAINIT0_LEGACY_DISABLE BIT(9)
111#define VGAINIT0_ALT_READBACK BIT(10) 111#define VGAINIT0_ALT_READBACK BIT(10)
112#define VGAINIT0_FAST_BLINK BIT(11) 112#define VGAINIT0_FAST_BLINK BIT(11)
113#define VGAINIT0_EXTSHIFTOUT BIT(12) 113#define VGAINIT0_EXTSHIFTOUT BIT(12)
114#define VGAINIT0_DECODE_3C6 BIT(13) 114#define VGAINIT0_DECODE_3C6 BIT(13)
115#define VGAINIT0_SGRAM_HBLANK_DISABLE BIT(22) 115#define VGAINIT0_SGRAM_HBLANK_DISABLE BIT(22)
116#define VGAINIT1_MASK 0x1fffff 116#define VGAINIT1_MASK 0x1fffff
117#define VIDCFG_VIDPROC_ENABLE BIT(0) 117#define VIDCFG_VIDPROC_ENABLE BIT(0)
118#define VIDCFG_CURS_X11 BIT(1) 118#define VIDCFG_CURS_X11 BIT(1)
119#define VIDCFG_INTERLACE BIT(3) 119#define VIDCFG_INTERLACE BIT(3)
120#define VIDCFG_HALF_MODE BIT(4) 120#define VIDCFG_HALF_MODE BIT(4)
121#define VIDCFG_DESK_ENABLE BIT(7) 121#define VIDCFG_DESK_ENABLE BIT(7)
122#define VIDCFG_CLUT_BYPASS BIT(10) 122#define VIDCFG_CLUT_BYPASS BIT(10)
123#define VIDCFG_2X BIT(26) 123#define VIDCFG_2X BIT(26)
124#define VIDCFG_HWCURSOR_ENABLE BIT(27) 124#define VIDCFG_HWCURSOR_ENABLE BIT(27)
125#define VIDCFG_PIXFMT_SHIFT 18 125#define VIDCFG_PIXFMT_SHIFT 18
126#define DACMODE_2X BIT(0) 126#define DACMODE_2X BIT(0)
127 127
128/* VGA rubbish, need to change this for multihead support */ 128/* VGA rubbish, need to change this for multihead support */
129#define MISC_W 0x3c2 129#define MISC_W 0x3c2
130#define MISC_R 0x3cc 130#define MISC_R 0x3cc
131#define SEQ_I 0x3c4 131#define SEQ_I 0x3c4
132#define SEQ_D 0x3c5 132#define SEQ_D 0x3c5
133#define CRT_I 0x3d4 133#define CRT_I 0x3d4
134#define CRT_D 0x3d5 134#define CRT_D 0x3d5
135#define ATT_IW 0x3c0 135#define ATT_IW 0x3c0
136#define IS1_R 0x3da 136#define IS1_R 0x3da
137#define GRA_I 0x3ce 137#define GRA_I 0x3ce
138#define GRA_D 0x3cf 138#define GRA_D 0x3cf
139 139
140#ifdef __KERNEL__ 140#ifdef __KERNEL__
141 141
@@ -143,9 +143,9 @@ struct banshee_reg {
143 /* VGA rubbish */ 143 /* VGA rubbish */
144 unsigned char att[21]; 144 unsigned char att[21];
145 unsigned char crt[25]; 145 unsigned char crt[25];
146 unsigned char gra[ 9]; 146 unsigned char gra[9];
147 unsigned char misc[1]; 147 unsigned char misc[1];
148 unsigned char seq[ 5]; 148 unsigned char seq[5];
149 149
150 /* Banshee extensions */ 150 /* Banshee extensions */
151 unsigned char ext[2]; 151 unsigned char ext[2];
@@ -167,8 +167,6 @@ struct banshee_reg {
167 unsigned long clip0max; 167 unsigned long clip0max;
168 unsigned long clip1min; 168 unsigned long clip1min;
169 unsigned long clip1max; 169 unsigned long clip1max;
170 unsigned long srcbase;
171 unsigned long dstbase;
172 unsigned long miscinit0; 170 unsigned long miscinit0;
173}; 171};
174 172
@@ -177,18 +175,10 @@ struct tdfx_par {
177 u32 palette[16]; 175 u32 palette[16];
178 void __iomem *regbase_virt; 176 void __iomem *regbase_virt;
179 unsigned long iobase; 177 unsigned long iobase;
180 u32 baseline; 178 int mtrr_handle;
181
182 struct {
183 int w,u,d;
184 unsigned long enable,disable;
185 struct timer_list timer;
186 } hwcursor;
187
188 spinlock_t DAClock;
189}; 179};
190 180
191#endif /* __KERNEL__ */ 181#endif /* __KERNEL__ */
192 182
193#endif /* _TDFX_H */ 183#endif /* _TDFX_H */
194 184
diff --git a/include/video/uvesafb.h b/include/video/uvesafb.h
new file mode 100644
index 000000000000..95bcef193954
--- /dev/null
+++ b/include/video/uvesafb.h
@@ -0,0 +1,193 @@
1#ifndef _UVESAFB_H
2#define _UVESAFB_H
3
4struct v86_regs {
5 __u32 ebx;
6 __u32 ecx;
7 __u32 edx;
8 __u32 esi;
9 __u32 edi;
10 __u32 ebp;
11 __u32 eax;
12 __u32 eip;
13 __u32 eflags;
14 __u32 esp;
15 __u16 cs;
16 __u16 ss;
17 __u16 es;
18 __u16 ds;
19 __u16 fs;
20 __u16 gs;
21};
22
23/* Task flags */
24#define TF_VBEIB 0x01
25#define TF_BUF_ESDI 0x02
26#define TF_BUF_ESBX 0x04
27#define TF_BUF_RET 0x08
28#define TF_EXIT 0x10
29
30struct uvesafb_task {
31 __u8 flags;
32 int buf_len;
33 struct v86_regs regs;
34};
35
36/* Constants for the capabilities field
37 * in vbe_ib */
38#define VBE_CAP_CAN_SWITCH_DAC 0x01
39#define VBE_CAP_VGACOMPAT 0x02
40
41/* The VBE Info Block */
42struct vbe_ib {
43 char vbe_signature[4];
44 __u16 vbe_version;
45 __u32 oem_string_ptr;
46 __u32 capabilities;
47 __u32 mode_list_ptr;
48 __u16 total_memory;
49 __u16 oem_software_rev;
50 __u32 oem_vendor_name_ptr;
51 __u32 oem_product_name_ptr;
52 __u32 oem_product_rev_ptr;
53 __u8 reserved[222];
54 char oem_data[256];
55 char misc_data[512];
56} __attribute__ ((packed));
57
58#ifdef __KERNEL__
59
60/* VBE CRTC Info Block */
61struct vbe_crtc_ib {
62 u16 horiz_total;
63 u16 horiz_start;
64 u16 horiz_end;
65 u16 vert_total;
66 u16 vert_start;
67 u16 vert_end;
68 u8 flags;
69 u32 pixel_clock;
70 u16 refresh_rate;
71 u8 reserved[40];
72} __attribute__ ((packed));
73
74#define VBE_MODE_VGACOMPAT 0x20
75#define VBE_MODE_COLOR 0x08
76#define VBE_MODE_SUPPORTEDHW 0x01
77#define VBE_MODE_GRAPHICS 0x10
78#define VBE_MODE_LFB 0x80
79
80#define VBE_MODE_MASK (VBE_MODE_COLOR | VBE_MODE_SUPPORTEDHW | \
81 VBE_MODE_GRAPHICS | VBE_MODE_LFB)
82
83/* VBE Mode Info Block */
84struct vbe_mode_ib {
85 /* for all VBE revisions */
86 u16 mode_attr;
87 u8 winA_attr;
88 u8 winB_attr;
89 u16 win_granularity;
90 u16 win_size;
91 u16 winA_seg;
92 u16 winB_seg;
93 u32 win_func_ptr;
94 u16 bytes_per_scan_line;
95
96 /* for VBE 1.2+ */
97 u16 x_res;
98 u16 y_res;
99 u8 x_char_size;
100 u8 y_char_size;
101 u8 planes;
102 u8 bits_per_pixel;
103 u8 banks;
104 u8 memory_model;
105 u8 bank_size;
106 u8 image_pages;
107 u8 reserved1;
108
109 /* Direct color fields for direct/6 and YUV/7 memory models. */
110 /* Offsets are bit positions of lsb in the mask. */
111 u8 red_len;
112 u8 red_off;
113 u8 green_len;
114 u8 green_off;
115 u8 blue_len;
116 u8 blue_off;
117 u8 rsvd_len;
118 u8 rsvd_off;
119 u8 direct_color_info; /* direct color mode attributes */
120
121 /* for VBE 2.0+ */
122 u32 phys_base_ptr;
123 u8 reserved2[6];
124
125 /* for VBE 3.0+ */
126 u16 lin_bytes_per_scan_line;
127 u8 bnk_image_pages;
128 u8 lin_image_pages;
129 u8 lin_red_len;
130 u8 lin_red_off;
131 u8 lin_green_len;
132 u8 lin_green_off;
133 u8 lin_blue_len;
134 u8 lin_blue_off;
135 u8 lin_rsvd_len;
136 u8 lin_rsvd_off;
137 u32 max_pixel_clock;
138 u16 mode_id;
139 u8 depth;
140} __attribute__ ((packed));
141
142#define UVESAFB_DEFAULT_MODE "640x480-16"
143
144/* How long to wait for a reply from userspace [ms] */
145#define UVESAFB_TIMEOUT 5000
146
147/* Max number of concurrent tasks */
148#define UVESAFB_TASKS_MAX 16
149
150#define dac_reg (0x3c8)
151#define dac_val (0x3c9)
152
153struct uvesafb_pal_entry {
154 u_char blue, green, red, pad;
155} __attribute__ ((packed));
156
157struct uvesafb_ktask {
158 struct uvesafb_task t;
159 void *buf;
160 struct completion *done;
161 u32 ack;
162};
163
164static int uvesafb_exec(struct uvesafb_ktask *tsk);
165
166#define UVESAFB_EXACT_RES 1
167#define UVESAFB_EXACT_DEPTH 2
168
169struct uvesafb_par {
170 struct vbe_ib vbe_ib; /* VBE Info Block */
171 struct vbe_mode_ib *vbe_modes; /* list of supported VBE modes */
172 int vbe_modes_cnt;
173
174 u8 nocrtc;
175 u8 ypan; /* 0 - nothing, 1 - ypan, 2 - ywrap */
176 u8 pmi_setpal; /* PMI for palette changes */
177 u16 *pmi_base; /* protected mode interface location */
178 void *pmi_start;
179 void *pmi_pal;
180 u8 *vbe_state_orig; /*
181 * original hardware state, before the
182 * driver was loaded
183 */
184 u8 *vbe_state_saved; /* state saved by fb_save_state */
185 int vbe_state_size;
186 atomic_t ref_count;
187
188 int mode_idx;
189 struct vbe_crtc_ib crtc;
190};
191
192#endif /* __KERNEL__ */
193#endif /* _UVESAFB_H */